diff options
author | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2020-01-27 16:26:44 -0800 |
---|---|---|
committer | Harish Mahendrakar <harish.mahendrakar@ittiam.com> | 2024-02-20 00:47:28 +0000 |
commit | f47d8da8ab0c2e4f1d68aa3be2ce2b542e3bc020 (patch) | |
tree | daae6ce72cb11550edbe80a2a2efe51c1be9cd32 | |
parent | 1fc38510452c78ab8f2a79a169b44c98779a4492 (diff) | |
download | libhevc-f47d8da8ab0c2e4f1d68aa3be2ce2b542e3bc020.tar.gz |
decoder: Clean up scaling_mat_offset access
Test: atest android.media.cts.DecoderTest
Bug: 148412960
Change-Id: I90baa7482c0e8df183ccbb01d2eec68fcc513a1d
-rw-r--r-- | decoder/ihevcd_iquant_itrans_recon_ctb.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/decoder/ihevcd_iquant_itrans_recon_ctb.c b/decoder/ihevcd_iquant_itrans_recon_ctb.c index 6af3001..c526231 100644 --- a/decoder/ihevcd_iquant_itrans_recon_ctb.c +++ b/decoder/ihevcd_iquant_itrans_recon_ctb.c @@ -559,20 +559,22 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) UWORD8 *pu1_pic_intra_flag; /*************************************************************************/ /* Contanis scaling matrix offset in the following order in a 1D buffer */ + /* Entries that are listed as UNUSED are invalid combinations where */ + /* scaling matrix is not used. eg: 64x64 SKIP CU, 64x64 PCM CU */ /* Intra 4 x 4 Y, 4 x 4 U, 4 x 4 V */ /* Inter 4 x 4 Y, 4 x 4 U, 4 x 4 V */ /* Intra 8 x 8 Y, 8 x 8 U, 8 x 8 V */ /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V */ /* Intra 16x16 Y, 16x16 U, 16x16 V */ /* Inter 16x16 Y, 16x16 U, 16x16 V */ - /* Intra 32x32 Y */ - /* Inter 32x32 Y */ + /* Intra 32x32 Y, UNUSED, UNUSED */ + /* Inter 32x32 Y, UNUSED, UNUSED */ + /* UNUSED, UNUSED, UNUSED */ + /* UNUSED, UNUSED, UNUSED */ /*************************************************************************/ - /* Only first 20 entries are used. Array is extended to avoid out of bound - reads. Skip CUs (64x64) read this table, but don't really use the value */ static const WORD32 scaling_mat_offset[] = { 0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, - 1248, 1504, 1760, 2016, 3040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + 1248, 1504, 1760, 2016, 0, 0, 3040, 0, 0, 0, 0, 0, 0, 0, 0}; PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED(); @@ -806,10 +808,7 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) /* Calculating scaling matrix offset */ offset = log2_y_trans_size_minus_2 * 6 - + (!intra_flag) - * ((log2_y_trans_size_minus_2 - == 3) ? 1 : 3) - + c_idx; + + (!intra_flag) * 3 + c_idx; pi2_dequant_matrix = pi2_scaling_mat + scaling_mat_offset[offset]; |