From 96a40a0afb6d3edcde78f4877474ded40e127add Mon Sep 17 00:00:00 2001 From: Naveen Kumar P Date: Thu, 22 Jun 2017 15:36:50 +0530 Subject: Update ctb pu map for I slice The update in I slice is required for P/B slices in the same frame for accessing neighbor pus. Bug: 62851602 Bug: 63522067 Test: re-run PoC from b/62851602 Change-Id: Ie5e43f1cd5649b2745b6527654bc24d8c7d42932 (cherry picked from commit 43f126112a8f2000cd0744f2fc5d545ff1a9a70c) --- decoder/ihevcd_parse_slice.c | 31 ++++++++++++++++++++++--------- decoder/ihevcd_process_slice.c | 29 ++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/decoder/ihevcd_parse_slice.c b/decoder/ihevcd_parse_slice.c index c1b067e..aedfbe7 100644 --- a/decoder/ihevcd_parse_slice.c +++ b/decoder/ihevcd_parse_slice.c @@ -3111,15 +3111,7 @@ IHEVCD_ERROR_T ihevcd_parse_slice_data(codec_t *ps_codec) UWORD32 *pu4_nbr_pu_idx = ps_proc->pu4_pic_pu_idx_map; WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2; pu_t *ps_pu; - - for(row = 0; row < ctb_size / MIN_PU_SIZE; row++) - { - for(col = 0; col < ctb_size / MIN_PU_SIZE; col++) - { - pu1_pic_pu_map_ctb[row * ctb_size / MIN_PU_SIZE + col] = 0; - } - } - + WORD32 ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE); /* Neighbor PU idx update inside CTB */ /* 1byte per 4x4. Indicates the PU idx that 4x4 block belongs to */ @@ -3170,6 +3162,27 @@ IHEVCD_ERROR_T ihevcd_parse_slice_data(codec_t *ps_codec) } } + + /* Updating the CTB level PU idx (Used for collocated MV pred)*/ + { + WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map; + WORD32 first_pu_of_ctb; + first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd]; + + index_pic_map = 0 * ctb_size_in_min_pu + 0; + index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1); + + for(ctb_row = 0; ctb_row < ctb_size_in_min_pu; ctb_row++) + { + for(ctb_col = 0; ctb_col < ctb_size_in_min_pu; ctb_col++) + { + pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col] + - first_pu_of_ctb; + } + index_pic_map += ctb_size_in_min_pu; + index_nbr_map += nbr_pu_idx_strd; + } + } } /*************************************************/ diff --git a/decoder/ihevcd_process_slice.c b/decoder/ihevcd_process_slice.c index f57cc31..72db2cc 100644 --- a/decoder/ihevcd_process_slice.c +++ b/decoder/ihevcd_process_slice.c @@ -704,14 +704,8 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) WORD32 row, col; UWORD32 *pu4_nbr_pu_idx = ps_proc->pu4_pic_pu_idx_map; WORD32 nbr_pu_idx_strd = MAX_CTB_SIZE / MIN_PU_SIZE + 2; + WORD32 ctb_size_in_min_pu = (ctb_size / MIN_PU_SIZE); - for(row = 0; row < ctb_size / MIN_PU_SIZE; row++) - { - for(col = 0; col < ctb_size / MIN_PU_SIZE; col++) - { - pu1_pic_pu_map_ctb[row * ctb_size / MIN_PU_SIZE + col] = 0; - } - } /* Neighbor PU idx update inside CTB */ /* 1byte per 4x4. Indicates the PU idx that 4x4 block belongs to */ @@ -760,6 +754,27 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) pu4_nbr_pu_idx[(ctb_size_left / MIN_PU_SIZE) * nbr_pu_idx_strd + i + 1]; } + + /* Updating the CTB level PU idx (Used for collocated MV pred)*/ + { + WORD32 ctb_row, ctb_col, index_pic_map, index_nbr_map; + WORD32 first_pu_of_ctb; + first_pu_of_ctb = pu4_nbr_pu_idx[1 + nbr_pu_idx_strd]; + + index_pic_map = 0 * ctb_size_in_min_pu + 0; + index_nbr_map = (0 + 1) * nbr_pu_idx_strd + (0 + 1); + + for(ctb_row = 0; ctb_row < ctb_size_in_min_pu; ctb_row++) + { + for(ctb_col = 0; ctb_col < ctb_size_in_min_pu; ctb_col++) + { + pu1_pic_pu_map_ctb[index_pic_map + ctb_col] = pu4_nbr_pu_idx[index_nbr_map + ctb_col] + - first_pu_of_ctb; + } + index_pic_map += ctb_size_in_min_pu; + index_nbr_map += nbr_pu_idx_strd; + } + } } } } -- cgit v1.2.3 From b0e1239a611617d598ebc8a93c2edae77430dd39 Mon Sep 17 00:00:00 2001 From: Naveen Kumar P Date: Thu, 6 Jul 2017 16:11:17 +0530 Subject: Check if luma wd and ht are multiple of min cb size Bug: 65483665 Instead of aligning width and height to 8, it is now checked for being a multiple of min CB size Change-Id: I99bf60e19d490fd06933aa01fa6a34f47fe58bb4 (cherry picked from commit ccfd1ea5c4cf9cf0a55088506ae5f312663f8792) --- decoder/ihevcd_parse_headers.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c index 578a429..a8daa3c 100644 --- a/decoder/ihevcd_parse_headers.c +++ b/decoder/ihevcd_parse_headers.c @@ -1350,12 +1350,6 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) if((0 >= ps_sps->i2_pic_width_in_luma_samples) || (0 >= ps_sps->i2_pic_height_in_luma_samples)) return IHEVCD_INVALID_PARAMETER; - /* i2_pic_width_in_luma_samples and i2_pic_height_in_luma_samples - should be multiples of min_cb_size. Here these are aligned to 8, - i.e. smallest CB size */ - ps_sps->i2_pic_width_in_luma_samples = ALIGN8(ps_sps->i2_pic_width_in_luma_samples); - ps_sps->i2_pic_height_in_luma_samples = ALIGN8(ps_sps->i2_pic_height_in_luma_samples); - BITS_PARSE("pic_cropping_flag", value, ps_bitstrm, 1); ps_sps->i1_pic_cropping_flag = value; @@ -1496,7 +1490,9 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) (ps_sps->i1_log2_diff_max_min_transform_block_size < 0) || (ps_sps->i1_log2_max_transform_block_size > ps_sps->i1_log2_ctb_size) || (ps_sps->i1_log2_ctb_size < 4) || - (ps_sps->i1_log2_ctb_size > 6)) + (ps_sps->i1_log2_ctb_size > 6) || + (ps_sps->i2_pic_width_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0) || + (ps_sps->i2_pic_height_in_luma_samples % (1 << ps_sps->i1_log2_min_coding_block_size) != 0)) { return IHEVCD_INVALID_PARAMETER; } -- cgit v1.2.3