summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-05-24 17:27:54 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-05-24 17:27:54 +0000
commitaa861e202bdc301112d7bacf1be9a1ba635448f7 (patch)
tree16374404c293bf331f08bf97cf55cc83217d27ff
parent5c3fd5d93a268abb20ff22f26009535b40db3c7d (diff)
parent9490be39f05fa06246fb9285dffd6391345c3dbd (diff)
downloadandroid_external_libavc-aa861e202bdc301112d7bacf1be9a1ba635448f7.tar.gz
android_external_libavc-aa861e202bdc301112d7bacf1be9a1ba635448f7.tar.bz2
android_external_libavc-aa861e202bdc301112d7bacf1be9a1ba635448f7.zip
Merge cherrypicks of [2307556, 2307630, 2307631, 2307557, 2307632, 2307656, 2307743, 2307635, 2307799, 2307577, 2307800, 2307707, 2307803, 2307781, 2307773, 2307637, 2307804, 2307618, 2307734, 2307708, 2307805, 2307709, 2307806, 2307820, 2307746, 2307774, 2307839, 2307735, 2307782, 2307808, 2307840, 2307738, 2307783, 2307749, 2307775, 2307860, 2307899, 2307822, 2307823, 2307880, 2307778, 2307825, 2307882, 2307787, 2307919, 2307844, 2307905, 2307883, 2307829, 2307907, 2307832, 2307944, 2307945, 2307911] into nyc-mr2-pixel-monthly-release
Change-Id: I2f6f7dc53161c8c75844fe88de78f620af4a6b94
-rw-r--r--decoder/ih264d_api.c9
-rw-r--r--decoder/ih264d_dpb_mgr.c4
-rw-r--r--decoder/ih264d_parse_headers.c6
-rw-r--r--decoder/ih264d_parse_islice.c17
-rw-r--r--decoder/ih264d_parse_pslice.c20
-rw-r--r--decoder/ih264d_parse_slice.c4
-rw-r--r--decoder/ih264d_process_bslice.c4
-rw-r--r--decoder/ih264d_process_intra_mb.c12
-rw-r--r--decoder/ih264d_utils.c1
9 files changed, 53 insertions, 24 deletions
diff --git a/decoder/ih264d_api.c b/decoder/ih264d_api.c
index 33fd11f..6940788 100644
--- a/decoder/ih264d_api.c
+++ b/decoder/ih264d_api.c
@@ -1409,9 +1409,8 @@ WORD32 ih264d_allocate_static_bufs(iv_obj_t **dec_hdl, void *pv_api_ip, void *pv
pu1_buf += size / 2;
ps_dec->ps_dpb_mgr->ps_init_dpb[1][0] = (struct pic_buffer_t *)pu1_buf;
- size = (sizeof(UWORD32) * 3
- * (MAX_FRAMES * MAX_FRAMES))
- << 3;
+ size = (sizeof(UWORD32) * 2 * 3
+ * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1)) * 2);
pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
RETURN_IF((NULL == pv_buf), IV_FAIL);
ps_dec->pu4_mbaff_wt_mat = pv_buf;
@@ -2310,6 +2309,10 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
ps_dec->u1_top_bottom_decoded |= TOP_FIELD_ONLY;
}
}
+ else
+ {
+ ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
+ }
/* if new frame in not found (if we are still getting slices from previous frame)
* ih264d_deblock_display is not called. Such frames will not be added to reference /display
diff --git a/decoder/ih264d_dpb_mgr.c b/decoder/ih264d_dpb_mgr.c
index a75aeee..e02cc90 100644
--- a/decoder/ih264d_dpb_mgr.c
+++ b/decoder/ih264d_dpb_mgr.c
@@ -291,6 +291,8 @@ WORD32 ih264d_insert_lt_node(dpb_manager_t *ps_dpb_mgr,
ps_mov_node->s_bot_field.u1_reference_info = IS_LONG_TERM;
ps_mov_node->s_top_field.u1_long_term_frame_idx = u4_lt_idx;
ps_mov_node->s_bot_field.u1_long_term_frame_idx = u4_lt_idx;
+ u1_mark_bot_field_long_term = 1;
+ u1_mark_top_field_long_term = 1;
}
ps_mov_node->u1_lt_idx = u4_lt_idx; //Assign the LT index to the node
@@ -337,7 +339,7 @@ WORD32 ih264d_insert_lt_node(dpb_manager_t *ps_dpb_mgr,
/* Increment LT buf count only if new LT node inserted */
/* If Increment during top_field is done, don't increment */
/* for bottom field, as both them are part of same pic. */
- if(!u1_mark_bot_field_long_term)
+ if(u1_mark_bot_field_long_term)
ps_dpb_mgr->u1_num_lt_ref_bufs++;
}
diff --git a/decoder/ih264d_parse_headers.c b/decoder/ih264d_parse_headers.c
index 0bc4c3f..3807a14 100644
--- a/decoder/ih264d_parse_headers.c
+++ b/decoder/ih264d_parse_headers.c
@@ -361,11 +361,13 @@ WORD32 ih264d_parse_pps(dec_struct_t * ps_dec, dec_bit_stream_t * ps_bitstrm)
}
/* read second_chroma_qp_index_offset syntax element */
- ps_pps->i1_second_chroma_qp_index_offset = ih264d_sev(
+ i_temp = ih264d_sev(
pu4_bitstrm_ofst, pu4_bitstrm_buf);
- if((ps_pps->i1_second_chroma_qp_index_offset + 12) > 24)
+ if((i_temp < -12) || (i_temp > 12))
return ERROR_INV_RANGE_QP_T;
+
+ ps_pps->i1_second_chroma_qp_index_offset = i_temp;
}
/* In case bitstream read has exceeded the filled size, then
diff --git a/decoder/ih264d_parse_islice.c b/decoder/ih264d_parse_islice.c
index 0312060..504b775 100644
--- a/decoder/ih264d_parse_islice.c
+++ b/decoder/ih264d_parse_islice.c
@@ -866,6 +866,8 @@ WORD32 ih264d_parse_islice_data_cavlc(dec_struct_t * ps_dec,
ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
}
+ uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
+
if(u1_mbaff)
{
ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
@@ -879,7 +881,7 @@ WORD32 ih264d_parse_islice_data_cavlc(dec_struct_t * ps_dec,
/**************************************************************/
i2_cur_mb_addr++;
- uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
+
/* Store the colocated information */
{
@@ -1087,8 +1089,7 @@ WORD32 ih264d_parse_islice_data_cabac(dec_struct_t * ps_dec,
{
ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
}
- /* Next macroblock information */
- i2_cur_mb_addr++;
+
if(ps_cur_mb_info->u1_topmb && u1_mbaff)
uc_more_data_flag = 1;
@@ -1099,6 +1100,16 @@ WORD32 ih264d_parse_islice_data_cabac(dec_struct_t * ps_dec,
uc_more_data_flag = !uc_more_data_flag;
COPYTHECONTEXT("Decode Sliceterm",!uc_more_data_flag);
}
+
+ if(u1_mbaff)
+ {
+ if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
+ {
+ return ERROR_EOB_FLUSHBITS_T;
+ }
+ }
+ /* Next macroblock information */
+ i2_cur_mb_addr++;
/* Store the colocated information */
{
diff --git a/decoder/ih264d_parse_pslice.c b/decoder/ih264d_parse_pslice.c
index ca3f80b..97ea27c 100644
--- a/decoder/ih264d_parse_pslice.c
+++ b/decoder/ih264d_parse_pslice.c
@@ -1006,8 +1006,7 @@ WORD32 ih264d_parse_inter_slice_data_cabac(dec_struct_t * ps_dec,
{
ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
}
- /* Next macroblock information */
- i2_cur_mb_addr++;
+
if(ps_cur_mb_info->u1_topmb && u1_mbaff)
uc_more_data_flag = 1;
@@ -1019,6 +1018,15 @@ WORD32 ih264d_parse_inter_slice_data_cabac(dec_struct_t * ps_dec,
COPYTHECONTEXT("Decode Sliceterm",!uc_more_data_flag);
}
+ if(u1_mbaff)
+ {
+ if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
+ {
+ return ERROR_EOB_FLUSHBITS_T;
+ }
+ }
+ /* Next macroblock information */
+ i2_cur_mb_addr++;
u1_num_mbs++;
u1_num_mbsNby2++;
ps_parse_mb_data++;
@@ -1456,7 +1464,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
UWORD32 u1_inter_mb_type;
UWORD32 u1_deblk_mb_type;
UWORD16 u2_total_mbs_coded;
- UWORD32 u1_mbaff = ps_slice->u1_mbaff_frame_flag;
+ UWORD32 u1_mbaff;
parse_part_params_t *ps_part_info;
WORD32 ret;
UNUSED(u1_is_idr_slice);
@@ -1579,7 +1587,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
{
// Slice data corrupted
// in the case of mbaff, conceal from the even mb.
- if((u1_mbaff) && (ps_dec->u4_num_mbs_cur_nmb & 1))
+ if((ps_dec->ps_cur_slice->u1_mbaff_frame_flag) && (ps_dec->u4_num_mbs_cur_nmb & 1))
{
ps_dec->u4_num_mbs_cur_nmb = ps_dec->u4_num_mbs_cur_nmb - 1;
ps_dec->u2_cur_mb_addr--;
@@ -1626,7 +1634,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
u1_end_of_row = (!u1_num_mbs_next)
- && (!(u1_mbaff && (u1_num_mbs & 0x01)));
+ && (!(ps_dec->ps_cur_slice->u1_mbaff_frame_flag && (u1_num_mbs & 0x01)));
u1_slice_end = 1;
u1_tfr_n_mb = 1;
ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
@@ -1699,7 +1707,7 @@ WORD32 ih264d_mark_err_slice_skip(dec_struct_t * ps_dec,
pu1_buf += size * ps_dec->u2_cur_slice_num;
ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (volatile void **)pu1_buf;
}
-
+ u1_mbaff = ps_slice->u1_mbaff_frame_flag;
ps_dec->ps_cur_slice->u2_first_mb_in_slice = ps_dec->u2_total_mbs_coded >> u1_mbaff;
ps_dec->ps_cur_slice->i1_slice_alpha_c0_offset = 0;
ps_dec->ps_cur_slice->i1_slice_beta_offset = 0;
diff --git a/decoder/ih264d_parse_slice.c b/decoder/ih264d_parse_slice.c
index f755970..7e0815f 100644
--- a/decoder/ih264d_parse_slice.c
+++ b/decoder/ih264d_parse_slice.c
@@ -1191,10 +1191,6 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
u1_nal_unit_type = SLICE_NAL;
if(u1_is_idr_slice)
{
- if(0 == u1_field_pic_flag)
- {
- ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
- }
u1_nal_unit_type = IDR_SLICE_NAL;
u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst,
pu4_bitstrm_buf);
diff --git a/decoder/ih264d_process_bslice.c b/decoder/ih264d_process_bslice.c
index 4c5ee05..7784110 100644
--- a/decoder/ih264d_process_bslice.c
+++ b/decoder/ih264d_process_bslice.c
@@ -1494,7 +1494,7 @@ void ih264d_init_ref_idx_lx_b(dec_struct_t *ps_dec)
UWORD8 u1_i;
pic_buffer_t *ps_ref_pic;
- ps_ref_pic = ps_dpb_mgr->ps_init_dpb[1][0] + MAX_REF_BUFS;
+ ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS;
if(NULL == ps_ref_pic->pu1_buf1)
{
@@ -1521,7 +1521,7 @@ void ih264d_init_ref_idx_lx_b(dec_struct_t *ps_dec)
UWORD8 u1_i;
pic_buffer_t *ps_ref_pic;
- ps_ref_pic = ps_dpb_mgr->ps_init_dpb[1][0];
+ ps_ref_pic = ps_dpb_mgr->ps_init_dpb[0][0];
if(NULL == ps_ref_pic->pu1_buf1)
{
diff --git a/decoder/ih264d_process_intra_mb.c b/decoder/ih264d_process_intra_mb.c
index 279ff87..211d796 100644
--- a/decoder/ih264d_process_intra_mb.c
+++ b/decoder/ih264d_process_intra_mb.c
@@ -930,7 +930,9 @@ WORD32 ih264d_process_intra_mb(dec_struct_t * ps_dec,
}
}
{
- UWORD8 au1_ngbr_pels[33];
+ /* Align the size to multiple of 8, so that SIMD functions
+ can read 64 bits at a time. Only 33 bytes are actaully used */
+ UWORD8 au1_ngbr_pels[40];
/* Get neighbour pixels */
/* left pels */
if(u2_use_left_mb)
@@ -1175,7 +1177,9 @@ WORD32 ih264d_process_intra_mb(dec_struct_t * ps_dec,
/* Scan the sub-blocks in Raster Scan Order */
for(u1_sub_mb_num = 0; u1_sub_mb_num < 16; u1_sub_mb_num++)
{
- UWORD8 au1_ngbr_pels[13];
+ /* Align the size to multiple of 8, so that SIMD functions
+ can read 64 bits at a time. Only 13 bytes are actaully used */
+ UWORD8 au1_ngbr_pels[16];
u1_sub_blk_x = u1_sub_mb_num & 0x3;
u1_sub_blk_y = u1_sub_mb_num >> 2;
@@ -1664,7 +1668,9 @@ WORD32 ih264d_process_intra_mb(dec_struct_t * ps_dec,
}
{
- UWORD8 au1_ngbr_pels[25];
+ /* Align the size to multiple of 8, so that SIMD functions
+ can read 64 bits at a time. Only 25 bytes are actaully used */
+ UWORD8 au1_ngbr_pels[32];
WORD32 ngbr_avail;
ngbr_avail = u1_is_left_sub_block << 0;
ngbr_avail |= u1_is_top_sub_block << 2;
diff --git a/decoder/ih264d_utils.c b/decoder/ih264d_utils.c
index 8d02d0e..c64ee8a 100644
--- a/decoder/ih264d_utils.c
+++ b/decoder/ih264d_utils.c
@@ -1873,6 +1873,7 @@ WORD16 ih264d_allocate_dynamic_bufs(dec_struct_t * ps_dec)
size = sizeof(parse_pmbarams_t) * (ps_dec->u1_recon_mb_grp);
pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
RETURN_IF((NULL == pv_buf), IV_FAIL);
+ memset(pv_buf, 0, size);
ps_dec->ps_parse_mb_data = pv_buf;
size = sizeof(parse_part_params_t)