| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | use ec_va::va::{ |
| 9 | BufferType, HevcLongSliceFlags, HevcPicFields, HevcSliceParsingFields, IQMatrix, PictureHEVC, |
| 10 | PictureParameter, SliceParameter, |
| 11 | }; |
| 12 | use ec_va::va::{ |
| 13 | IQMatrixBufferHEVC as CrosIQMatrix, PictureParameterBufferHEVC as CrosPicture, |
| 14 | SliceParameterBufferHEVC as CrosSlice, |
| 15 | }; |
| 16 | |
| 17 | use super::INVALID_SURFACE; |
| 18 | |
| 19 | |
| 20 | pub const PICTURE_INVALID: u32 = 0x0000_0001; |
| 21 | |
| 22 | pub const PICTURE_FIELD_PIC: u32 = 0x0000_0002; |
| 23 | |
| 24 | pub const PICTURE_BOTTOM_FIELD: u32 = 0x0000_0004; |
| 25 | |
| 26 | pub const PICTURE_LONG_TERM_REFERENCE: u32 = 0x0000_0008; |
| 27 | |
| 28 | pub const PICTURE_RPS_ST_CURR_BEFORE: u32 = 0x0000_0010; |
| 29 | |
| 30 | pub const PICTURE_RPS_ST_CURR_AFTER: u32 = 0x0000_0020; |
| 31 | |
| 32 | pub const PICTURE_RPS_LT_CURR: u32 = 0x0000_0040; |
| 33 | |
| 34 | |
| 35 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 36 | pub struct VAPictureHEVC { |
| 37 | |
| 38 | pub picture_id: u32, |
| 39 | |
| 40 | pub pic_order_cnt: i32, |
| 41 | |
| 42 | pub flags: u32, |
| 43 | } |
| 44 | |
| 45 | impl VAPictureHEVC { |
| 46 | |
| 47 | pub const INVALID: VAPictureHEVC = VAPictureHEVC { |
| 48 | picture_id: INVALID_SURFACE, |
| 49 | pic_order_cnt: 0, |
| 50 | flags: PICTURE_INVALID, |
| 51 | }; |
| 52 | |
| 53 | |
| 54 | pub fn new(picture_id: u32, pic_order_cnt: i32, flags: u32) -> VAPictureHEVC { |
| 55 | VAPictureHEVC { |
| 56 | picture_id, |
| 57 | pic_order_cnt, |
| 58 | flags, |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | fn to_cros(self) -> PictureHEVC { |
| 63 | PictureHEVC::new(self.picture_id, self.pic_order_cnt, self.flags) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | impl Default for VAPictureHEVC { |
| 68 | fn default() -> Self { |
| 69 | VAPictureHEVC::INVALID |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | |
| 74 | #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] |
| 75 | #[allow(missing_docs)] |
| 76 | pub struct PicFields { |
| 77 | pub chroma_format_idc: u32, |
| 78 | pub separate_colour_plane_flag: u32, |
| 79 | pub pcm_enabled_flag: u32, |
| 80 | pub scaling_list_enabled_flag: u32, |
| 81 | pub transform_skip_enabled_flag: u32, |
| 82 | pub amp_enabled_flag: u32, |
| 83 | pub strong_intra_smoothing_enabled_flag: u32, |
| 84 | pub sign_data_hiding_enabled_flag: u32, |
| 85 | pub constrained_intra_pred_flag: u32, |
| 86 | pub cu_qp_delta_enabled_flag: u32, |
| 87 | pub weighted_pred_flag: u32, |
| 88 | pub weighted_bipred_flag: u32, |
| 89 | pub transquant_bypass_enabled_flag: u32, |
| 90 | pub tiles_enabled_flag: u32, |
| 91 | pub entropy_coding_sync_enabled_flag: u32, |
| 92 | pub pps_loop_filter_across_slices_enabled_flag: u32, |
| 93 | pub loop_filter_across_tiles_enabled_flag: u32, |
| 94 | pub pcm_loop_filter_disabled_flag: u32, |
| 95 | pub no_pic_reordering_flag: u32, |
| 96 | pub no_bi_pred_flag: u32, |
| 97 | } |
| 98 | |
| 99 | |
| 100 | #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] |
| 101 | #[allow(missing_docs)] |
| 102 | pub struct SliceParsingFields { |
| 103 | pub lists_modification_present_flag: u32, |
| 104 | pub long_term_ref_pics_present_flag: u32, |
| 105 | pub sps_temporal_mvp_enabled_flag: u32, |
| 106 | pub cabac_init_present_flag: u32, |
| 107 | pub output_flag_present_flag: u32, |
| 108 | pub dependent_slice_segments_enabled_flag: u32, |
| 109 | pub pps_slice_chroma_qp_offsets_present_flag: u32, |
| 110 | pub sample_adaptive_offset_enabled_flag: u32, |
| 111 | pub deblocking_filter_override_enabled_flag: u32, |
| 112 | pub pps_disable_deblocking_filter_flag: u32, |
| 113 | pub slice_segment_header_extension_present_flag: u32, |
| 114 | pub rap_pic_flag: u32, |
| 115 | pub idr_pic_flag: u32, |
| 116 | pub intra_pic_flag: u32, |
| 117 | } |
| 118 | |
| 119 | |
| 120 | #[derive(Debug, Clone, Copy)] |
| 121 | pub struct PictureParameterBufferHEVC { |
| 122 | |
| 123 | pub curr_pic: VAPictureHEVC, |
| 124 | |
| 125 | pub reference_frames: [VAPictureHEVC; 15], |
| 126 | |
| 127 | pub pic_width_in_luma_samples: u16, |
| 128 | |
| 129 | pub pic_height_in_luma_samples: u16, |
| 130 | |
| 131 | pub pic_fields: PicFields, |
| 132 | |
| 133 | pub sps_max_dec_pic_buffering_minus1: u8, |
| 134 | |
| 135 | pub bit_depth_luma_minus8: u8, |
| 136 | |
| 137 | pub bit_depth_chroma_minus8: u8, |
| 138 | |
| 139 | pub pcm_sample_bit_depth_luma_minus1: u8, |
| 140 | |
| 141 | pub pcm_sample_bit_depth_chroma_minus1: u8, |
| 142 | |
| 143 | pub log2_min_luma_coding_block_size_minus3: u8, |
| 144 | |
| 145 | pub log2_diff_max_min_luma_coding_block_size: u8, |
| 146 | |
| 147 | pub log2_min_transform_block_size_minus2: u8, |
| 148 | |
| 149 | pub log2_diff_max_min_transform_block_size: u8, |
| 150 | |
| 151 | pub log2_min_pcm_luma_coding_block_size_minus3: u8, |
| 152 | |
| 153 | pub log2_diff_max_min_pcm_luma_coding_block_size: u8, |
| 154 | |
| 155 | pub max_transform_hierarchy_depth_intra: u8, |
| 156 | |
| 157 | pub max_transform_hierarchy_depth_inter: u8, |
| 158 | |
| 159 | pub init_qp_minus26: i8, |
| 160 | |
| 161 | pub diff_cu_qp_delta_depth: u8, |
| 162 | |
| 163 | pub pps_cb_qp_offset: i8, |
| 164 | |
| 165 | pub pps_cr_qp_offset: i8, |
| 166 | |
| 167 | pub log2_parallel_merge_level_minus2: u8, |
| 168 | |
| 169 | pub num_tile_columns_minus1: u8, |
| 170 | |
| 171 | pub num_tile_rows_minus1: u8, |
| 172 | |
| 173 | pub column_width_minus1: [u16; 19], |
| 174 | |
| 175 | pub row_height_minus1: [u16; 21], |
| 176 | |
| 177 | pub slice_parsing_fields: SliceParsingFields, |
| 178 | |
| 179 | pub log2_max_pic_order_cnt_lsb_minus4: u8, |
| 180 | |
| 181 | pub num_short_term_ref_pic_sets: u8, |
| 182 | |
| 183 | pub num_long_term_ref_pic_sps: u8, |
| 184 | |
| 185 | pub num_ref_idx_l0_default_active_minus1: u8, |
| 186 | |
| 187 | pub num_ref_idx_l1_default_active_minus1: u8, |
| 188 | |
| 189 | pub pps_beta_offset_div2: i8, |
| 190 | |
| 191 | pub pps_tc_offset_div2: i8, |
| 192 | |
| 193 | pub num_extra_slice_header_bits: u8, |
| 194 | |
| 195 | pub st_rps_bits: u32, |
| 196 | } |
| 197 | |
| 198 | impl Default for PictureParameterBufferHEVC { |
| 199 | fn default() -> Self { |
| 200 | PictureParameterBufferHEVC { |
| 201 | curr_pic: VAPictureHEVC::INVALID, |
| 202 | reference_frames: [VAPictureHEVC::INVALID; 15], |
| 203 | pic_width_in_luma_samples: 0, |
| 204 | pic_height_in_luma_samples: 0, |
| 205 | pic_fields: PicFields::default(), |
| 206 | sps_max_dec_pic_buffering_minus1: 0, |
| 207 | bit_depth_luma_minus8: 0, |
| 208 | bit_depth_chroma_minus8: 0, |
| 209 | pcm_sample_bit_depth_luma_minus1: 0, |
| 210 | pcm_sample_bit_depth_chroma_minus1: 0, |
| 211 | log2_min_luma_coding_block_size_minus3: 0, |
| 212 | log2_diff_max_min_luma_coding_block_size: 0, |
| 213 | log2_min_transform_block_size_minus2: 0, |
| 214 | log2_diff_max_min_transform_block_size: 0, |
| 215 | log2_min_pcm_luma_coding_block_size_minus3: 0, |
| 216 | log2_diff_max_min_pcm_luma_coding_block_size: 0, |
| 217 | max_transform_hierarchy_depth_intra: 0, |
| 218 | max_transform_hierarchy_depth_inter: 0, |
| 219 | init_qp_minus26: 0, |
| 220 | diff_cu_qp_delta_depth: 0, |
| 221 | pps_cb_qp_offset: 0, |
| 222 | pps_cr_qp_offset: 0, |
| 223 | log2_parallel_merge_level_minus2: 0, |
| 224 | num_tile_columns_minus1: 0, |
| 225 | num_tile_rows_minus1: 0, |
| 226 | column_width_minus1: [0; 19], |
| 227 | row_height_minus1: [0; 21], |
| 228 | slice_parsing_fields: SliceParsingFields::default(), |
| 229 | log2_max_pic_order_cnt_lsb_minus4: 0, |
| 230 | num_short_term_ref_pic_sets: 0, |
| 231 | num_long_term_ref_pic_sps: 0, |
| 232 | num_ref_idx_l0_default_active_minus1: 0, |
| 233 | num_ref_idx_l1_default_active_minus1: 0, |
| 234 | pps_beta_offset_div2: 0, |
| 235 | pps_tc_offset_div2: 0, |
| 236 | num_extra_slice_header_bits: 0, |
| 237 | st_rps_bits: 0, |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | impl PictureParameterBufferHEVC { |
| 243 | |
| 244 | pub fn to_buffer(&self) -> BufferType { |
| 245 | let f = self.pic_fields; |
| 246 | let pic = HevcPicFields::new( |
| 247 | f.chroma_format_idc, |
| 248 | f.separate_colour_plane_flag, |
| 249 | f.pcm_enabled_flag, |
| 250 | f.scaling_list_enabled_flag, |
| 251 | f.transform_skip_enabled_flag, |
| 252 | f.amp_enabled_flag, |
| 253 | f.strong_intra_smoothing_enabled_flag, |
| 254 | f.sign_data_hiding_enabled_flag, |
| 255 | f.constrained_intra_pred_flag, |
| 256 | f.cu_qp_delta_enabled_flag, |
| 257 | f.weighted_pred_flag, |
| 258 | f.weighted_bipred_flag, |
| 259 | f.transquant_bypass_enabled_flag, |
| 260 | f.tiles_enabled_flag, |
| 261 | f.entropy_coding_sync_enabled_flag, |
| 262 | f.pps_loop_filter_across_slices_enabled_flag, |
| 263 | f.loop_filter_across_tiles_enabled_flag, |
| 264 | f.pcm_loop_filter_disabled_flag, |
| 265 | f.no_pic_reordering_flag, |
| 266 | f.no_bi_pred_flag, |
| 267 | ); |
| 268 | let s = self.slice_parsing_fields; |
| 269 | let slice = HevcSliceParsingFields::new( |
| 270 | s.lists_modification_present_flag, |
| 271 | s.long_term_ref_pics_present_flag, |
| 272 | s.sps_temporal_mvp_enabled_flag, |
| 273 | s.cabac_init_present_flag, |
| 274 | s.output_flag_present_flag, |
| 275 | s.dependent_slice_segments_enabled_flag, |
| 276 | s.pps_slice_chroma_qp_offsets_present_flag, |
| 277 | s.sample_adaptive_offset_enabled_flag, |
| 278 | s.deblocking_filter_override_enabled_flag, |
| 279 | s.pps_disable_deblocking_filter_flag, |
| 280 | s.slice_segment_header_extension_present_flag, |
| 281 | s.rap_pic_flag, |
| 282 | s.idr_pic_flag, |
| 283 | s.intra_pic_flag, |
| 284 | ); |
| 285 | let refs: [PictureHEVC; 15] = self.reference_frames.map(VAPictureHEVC::to_cros); |
| 286 | BufferType::PictureParameter(PictureParameter::HEVC(CrosPicture::new( |
| 287 | self.curr_pic.to_cros(), |
| 288 | refs, |
| 289 | self.pic_width_in_luma_samples, |
| 290 | self.pic_height_in_luma_samples, |
| 291 | &pic, |
| 292 | self.sps_max_dec_pic_buffering_minus1, |
| 293 | self.bit_depth_luma_minus8, |
| 294 | self.bit_depth_chroma_minus8, |
| 295 | self.pcm_sample_bit_depth_luma_minus1, |
| 296 | self.pcm_sample_bit_depth_chroma_minus1, |
| 297 | self.log2_min_luma_coding_block_size_minus3, |
| 298 | self.log2_diff_max_min_luma_coding_block_size, |
| 299 | self.log2_min_transform_block_size_minus2, |
| 300 | self.log2_diff_max_min_transform_block_size, |
| 301 | self.log2_min_pcm_luma_coding_block_size_minus3, |
| 302 | self.log2_diff_max_min_pcm_luma_coding_block_size, |
| 303 | self.max_transform_hierarchy_depth_intra, |
| 304 | self.max_transform_hierarchy_depth_inter, |
| 305 | self.init_qp_minus26, |
| 306 | self.diff_cu_qp_delta_depth, |
| 307 | self.pps_cb_qp_offset, |
| 308 | self.pps_cr_qp_offset, |
| 309 | self.log2_parallel_merge_level_minus2, |
| 310 | self.num_tile_columns_minus1, |
| 311 | self.num_tile_rows_minus1, |
| 312 | self.column_width_minus1, |
| 313 | self.row_height_minus1, |
| 314 | &slice, |
| 315 | self.log2_max_pic_order_cnt_lsb_minus4, |
| 316 | self.num_short_term_ref_pic_sets, |
| 317 | self.num_long_term_ref_pic_sps, |
| 318 | self.num_ref_idx_l0_default_active_minus1, |
| 319 | self.num_ref_idx_l1_default_active_minus1, |
| 320 | self.pps_beta_offset_div2, |
| 321 | self.pps_tc_offset_div2, |
| 322 | self.num_extra_slice_header_bits, |
| 323 | self.st_rps_bits, |
| 324 | ))) |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | |
| 329 | #[derive(Debug, Clone, Copy, Default, PartialEq, Eq)] |
| 330 | #[allow(missing_docs)] |
| 331 | pub struct LongSliceFlags { |
| 332 | pub last_slice_of_pic: u32, |
| 333 | pub dependent_slice_segment_flag: u32, |
| 334 | pub slice_type: u32, |
| 335 | pub color_plane_id: u32, |
| 336 | pub slice_sao_luma_flag: u32, |
| 337 | pub slice_sao_chroma_flag: u32, |
| 338 | pub mvd_l1_zero_flag: u32, |
| 339 | pub cabac_init_flag: u32, |
| 340 | pub slice_temporal_mvp_enabled_flag: u32, |
| 341 | pub slice_deblocking_filter_disabled_flag: u32, |
| 342 | pub collocated_from_l0_flag: u32, |
| 343 | pub slice_loop_filter_across_slices_enabled_flag: u32, |
| 344 | } |
| 345 | |
| 346 | |
| 347 | #[derive(Debug, Clone, Copy)] |
| 348 | pub struct SliceParameterBufferHEVC { |
| 349 | |
| 350 | pub slice_data_size: u32, |
| 351 | |
| 352 | pub slice_data_offset: u32, |
| 353 | |
| 354 | pub slice_data_flag: u32, |
| 355 | |
| 356 | |
| 357 | pub slice_data_byte_offset: u32, |
| 358 | |
| 359 | pub slice_segment_address: u32, |
| 360 | |
| 361 | pub ref_pic_list: [[u8; 15]; 2], |
| 362 | |
| 363 | pub long_slice_flags: LongSliceFlags, |
| 364 | |
| 365 | pub collocated_ref_idx: u8, |
| 366 | |
| 367 | pub num_ref_idx_l0_active_minus1: u8, |
| 368 | |
| 369 | pub num_ref_idx_l1_active_minus1: u8, |
| 370 | |
| 371 | pub slice_qp_delta: i8, |
| 372 | |
| 373 | pub slice_cb_qp_offset: i8, |
| 374 | |
| 375 | pub slice_cr_qp_offset: i8, |
| 376 | |
| 377 | pub slice_beta_offset_div2: i8, |
| 378 | |
| 379 | pub slice_tc_offset_div2: i8, |
| 380 | |
| 381 | pub luma_log2_weight_denom: u8, |
| 382 | |
| 383 | pub delta_chroma_log2_weight_denom: i8, |
| 384 | |
| 385 | pub delta_luma_weight_l0: [i8; 15], |
| 386 | |
| 387 | pub luma_offset_l0: [i8; 15], |
| 388 | |
| 389 | pub delta_chroma_weight_l0: [[i8; 2]; 15], |
| 390 | |
| 391 | pub chroma_offset_l0: [[i8; 2]; 15], |
| 392 | |
| 393 | pub delta_luma_weight_l1: [i8; 15], |
| 394 | |
| 395 | pub luma_offset_l1: [i8; 15], |
| 396 | |
| 397 | pub delta_chroma_weight_l1: [[i8; 2]; 15], |
| 398 | |
| 399 | pub chroma_offset_l1: [[i8; 2]; 15], |
| 400 | |
| 401 | pub five_minus_max_num_merge_cand: u8, |
| 402 | |
| 403 | pub num_entry_point_offsets: u16, |
| 404 | |
| 405 | pub entry_offset_to_subset_array: u16, |
| 406 | |
| 407 | pub slice_data_num_emu_prevn_bytes: u16, |
| 408 | } |
| 409 | |
| 410 | impl Default for SliceParameterBufferHEVC { |
| 411 | fn default() -> Self { |
| 412 | SliceParameterBufferHEVC { |
| 413 | slice_data_size: 0, |
| 414 | slice_data_offset: 0, |
| 415 | slice_data_flag: 0, |
| 416 | slice_data_byte_offset: 0, |
| 417 | slice_segment_address: 0, |
| 418 | ref_pic_list: [[0xff; 15]; 2], |
| 419 | long_slice_flags: LongSliceFlags::default(), |
| 420 | collocated_ref_idx: 0xff, |
| 421 | num_ref_idx_l0_active_minus1: 0, |
| 422 | num_ref_idx_l1_active_minus1: 0, |
| 423 | slice_qp_delta: 0, |
| 424 | slice_cb_qp_offset: 0, |
| 425 | slice_cr_qp_offset: 0, |
| 426 | slice_beta_offset_div2: 0, |
| 427 | slice_tc_offset_div2: 0, |
| 428 | luma_log2_weight_denom: 0, |
| 429 | delta_chroma_log2_weight_denom: 0, |
| 430 | delta_luma_weight_l0: [0; 15], |
| 431 | luma_offset_l0: [0; 15], |
| 432 | delta_chroma_weight_l0: [[0; 2]; 15], |
| 433 | chroma_offset_l0: [[0; 2]; 15], |
| 434 | delta_luma_weight_l1: [0; 15], |
| 435 | luma_offset_l1: [0; 15], |
| 436 | delta_chroma_weight_l1: [[0; 2]; 15], |
| 437 | chroma_offset_l1: [[0; 2]; 15], |
| 438 | five_minus_max_num_merge_cand: 0, |
| 439 | num_entry_point_offsets: 0, |
| 440 | entry_offset_to_subset_array: 0, |
| 441 | slice_data_num_emu_prevn_bytes: 0, |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | impl SliceParameterBufferHEVC { |
| 447 | |
| 448 | pub fn to_buffer(&self) -> BufferType { |
| 449 | let f = self.long_slice_flags; |
| 450 | let flags = HevcLongSliceFlags::new( |
| 451 | f.last_slice_of_pic, |
| 452 | f.dependent_slice_segment_flag, |
| 453 | f.slice_type, |
| 454 | f.color_plane_id, |
| 455 | f.slice_sao_luma_flag, |
| 456 | f.slice_sao_chroma_flag, |
| 457 | f.mvd_l1_zero_flag, |
| 458 | f.cabac_init_flag, |
| 459 | f.slice_temporal_mvp_enabled_flag, |
| 460 | f.slice_deblocking_filter_disabled_flag, |
| 461 | f.collocated_from_l0_flag, |
| 462 | f.slice_loop_filter_across_slices_enabled_flag, |
| 463 | ); |
| 464 | BufferType::SliceParameter(SliceParameter::HEVC(CrosSlice::new( |
| 465 | self.slice_data_size, |
| 466 | self.slice_data_offset, |
| 467 | self.slice_data_flag, |
| 468 | self.slice_data_byte_offset, |
| 469 | self.slice_segment_address, |
| 470 | self.ref_pic_list, |
| 471 | &flags, |
| 472 | self.collocated_ref_idx, |
| 473 | self.num_ref_idx_l0_active_minus1, |
| 474 | self.num_ref_idx_l1_active_minus1, |
| 475 | self.slice_qp_delta, |
| 476 | self.slice_cb_qp_offset, |
| 477 | self.slice_cr_qp_offset, |
| 478 | self.slice_beta_offset_div2, |
| 479 | self.slice_tc_offset_div2, |
| 480 | self.luma_log2_weight_denom, |
| 481 | self.delta_chroma_log2_weight_denom, |
| 482 | self.delta_luma_weight_l0, |
| 483 | self.luma_offset_l0, |
| 484 | self.delta_chroma_weight_l0, |
| 485 | self.chroma_offset_l0, |
| 486 | self.delta_luma_weight_l1, |
| 487 | self.luma_offset_l1, |
| 488 | self.delta_chroma_weight_l1, |
| 489 | self.chroma_offset_l1, |
| 490 | self.five_minus_max_num_merge_cand, |
| 491 | self.num_entry_point_offsets, |
| 492 | self.entry_offset_to_subset_array, |
| 493 | self.slice_data_num_emu_prevn_bytes, |
| 494 | ))) |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | |
| 499 | #[derive(Debug, Clone, Copy)] |
| 500 | pub struct IQMatrixBufferHEVC { |
| 501 | |
| 502 | pub scaling_list_4x4: [[u8; 16]; 6], |
| 503 | |
| 504 | pub scaling_list_8x8: [[u8; 64]; 6], |
| 505 | |
| 506 | pub scaling_list_16x16: [[u8; 64]; 6], |
| 507 | |
| 508 | pub scaling_list_32x32: [[u8; 64]; 2], |
| 509 | |
| 510 | pub scaling_list_dc_16x16: [u8; 6], |
| 511 | |
| 512 | pub scaling_list_dc_32x32: [u8; 2], |
| 513 | } |
| 514 | |
| 515 | impl Default for IQMatrixBufferHEVC { |
| 516 | fn default() -> Self { |
| 517 | IQMatrixBufferHEVC { |
| 518 | scaling_list_4x4: [[16; 16]; 6], |
| 519 | scaling_list_8x8: [[16; 64]; 6], |
| 520 | scaling_list_16x16: [[16; 64]; 6], |
| 521 | scaling_list_32x32: [[16; 64]; 2], |
| 522 | scaling_list_dc_16x16: [16; 6], |
| 523 | scaling_list_dc_32x32: [16; 2], |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | impl IQMatrixBufferHEVC { |
| 529 | |
| 530 | pub fn to_buffer(&self) -> BufferType { |
| 531 | BufferType::IQMatrix(IQMatrix::HEVC(CrosIQMatrix::new( |
| 532 | self.scaling_list_4x4, |
| 533 | self.scaling_list_8x8, |
| 534 | self.scaling_list_16x16, |
| 535 | self.scaling_list_32x32, |
| 536 | self.scaling_list_dc_16x16, |
| 537 | self.scaling_list_dc_32x32, |
| 538 | ))) |
| 539 | } |
| 540 | } |