DO NOT MERGE: Merge Oreo MR1 into master
Exempt-From-Owner-Approval: Changes already landed internally Change-Id: Ia8c97929933ddbdf7a3bfc694bbfb7cd96db3a5b
This commit is contained in:
commit
723c1e1d7c
8 changed files with 42 additions and 50 deletions
|
|
@ -1,5 +1,7 @@
|
|||
cc_library_static {
|
||||
name: "libavcdec",
|
||||
vendor_available: true,
|
||||
shared_libs: ["liblog", "libcutils",],
|
||||
|
||||
cflags: [
|
||||
"-fPIC",
|
||||
|
|
@ -233,6 +235,8 @@ cc_library_static {
|
|||
|
||||
cc_library_static {
|
||||
name: "libavcenc",
|
||||
vendor_available: true,
|
||||
shared_libs: ["liblog", "libcutils",],
|
||||
|
||||
cflags: [
|
||||
"-DNDEBUG",
|
||||
|
|
|
|||
|
|
@ -1804,7 +1804,8 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|
|||
&& ps_dec->i4_decode_header == 0)
|
||||
{
|
||||
UWORD32 i;
|
||||
if(ps_dec->ps_out_buffer->u4_num_bufs == 0)
|
||||
if((ps_dec->ps_out_buffer->u4_num_bufs == 0) ||
|
||||
(ps_dec->ps_out_buffer->u4_num_bufs > IVD_VIDDEC_MAX_IO_BUFFERS))
|
||||
{
|
||||
ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
|
||||
ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;
|
||||
|
|
@ -2247,7 +2248,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|
|||
}
|
||||
while(( header_data_left == 1)||(frame_data_left == 1));
|
||||
|
||||
if((ps_dec->u4_slice_start_code_found == 1)
|
||||
if((ps_dec->u4_pic_buf_got == 1)
|
||||
&& (ret != IVD_MEM_ALLOC_FAILED)
|
||||
&& ps_dec->u2_total_mbs_coded < ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
|
||||
{
|
||||
|
|
@ -2389,7 +2390,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|
|||
|
||||
}
|
||||
|
||||
if((ps_dec->u4_slice_start_code_found == 1)
|
||||
if((ps_dec->u4_pic_buf_got == 1)
|
||||
&& (ERROR_DANGLING_FIELD_IN_PIC != i4_err_status))
|
||||
{
|
||||
/*
|
||||
|
|
@ -2415,8 +2416,7 @@ WORD32 ih264d_video_decode(iv_obj_t *dec_hdl, void *pv_api_ip, void *pv_api_op)
|
|||
/* 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
|
||||
*/
|
||||
if (((ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC) == 0)
|
||||
&& (ps_dec->u4_pic_buf_got == 1))
|
||||
if ((ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC) == 0)
|
||||
{
|
||||
/* Calling Function to deblock Picture and Display */
|
||||
ret = ih264d_deblock_display(ps_dec);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,9 @@
|
|||
*
|
||||
************************************************************************
|
||||
*/
|
||||
#define H264_MAX_FRAME_WIDTH 3840
|
||||
#define H264_MAX_FRAME_HEIGHT 2176
|
||||
#define H264_MAX_FRAME_WIDTH 4080
|
||||
#define H264_MAX_FRAME_HEIGHT 4080
|
||||
#define H264_MAX_FRAME_SIZE (4096 * 2048)
|
||||
|
||||
#define H264_MIN_FRAME_WIDTH 16
|
||||
#define H264_MIN_FRAME_HEIGHT 16
|
||||
|
|
|
|||
|
|
@ -1197,7 +1197,8 @@ void ih264d_get_implicit_weights(dec_struct_t *ps_dec)
|
|||
struct pic_buffer_t *ps_pic_buff0, *ps_pic_buff1;
|
||||
WORD16 i2_dist_scale_factor;
|
||||
WORD16 i16_tb, i16_td, i16_tx;
|
||||
UWORD32 u4_poc0, u4_poc1;
|
||||
WORD32 i4_tb, i4_td;
|
||||
WORD32 i4_poc0, i4_poc1;
|
||||
UWORD32 ui_temp0, ui_temp1;
|
||||
UWORD8 uc_num_ref_idx_l0_active, uc_num_ref_idx_l1_active;
|
||||
|
||||
|
|
@ -1210,18 +1211,18 @@ void ih264d_get_implicit_weights(dec_struct_t *ps_dec)
|
|||
for(i = 0; i < uc_num_ref_idx_l0_active; i++)
|
||||
{
|
||||
ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][i];
|
||||
u4_poc0 = ps_pic_buff0->i4_avg_poc;
|
||||
i4_poc0 = ps_pic_buff0->i4_avg_poc;
|
||||
for(j = 0; j < uc_num_ref_idx_l1_active; j++)
|
||||
{
|
||||
ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][j];
|
||||
u4_poc1 = ps_pic_buff1->i4_avg_poc;
|
||||
i4_poc1 = ps_pic_buff1->i4_avg_poc;
|
||||
|
||||
if(u4_poc1 != u4_poc0)
|
||||
if(i4_poc1 != i4_poc0)
|
||||
{
|
||||
i16_tb = ps_dec->ps_cur_pic->i4_poc - u4_poc0;
|
||||
i16_tb = CLIP3(-128, 127, i16_tb);
|
||||
i16_td = u4_poc1 - u4_poc0;
|
||||
i16_td = CLIP3(-128, 127, i16_td);
|
||||
i4_tb = ps_dec->ps_cur_pic->i4_poc - i4_poc0;
|
||||
i16_tb = CLIP3(-128, 127, i4_tb);
|
||||
i4_td = i4_poc1 - i4_poc0;
|
||||
i16_td = CLIP3(-128, 127, i4_td);
|
||||
i16_tx = (16384 + ABS(SIGN_POW2_DIV(i16_td, 1))) / i16_td;
|
||||
i2_dist_scale_factor = CLIP3(-1024, 1023,
|
||||
(((i16_tb * i16_tx) + 32) >> 6));
|
||||
|
|
@ -1272,7 +1273,7 @@ void ih264d_get_implicit_weights(dec_struct_t *ps_dec)
|
|||
u2_l0_idx += MAX_REF_BUFS;
|
||||
}
|
||||
ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u2_l0_idx];
|
||||
u4_poc0 = ps_pic_buff0->i4_poc;
|
||||
i4_poc0 = ps_pic_buff0->i4_poc;
|
||||
for(j = 0; j < (uc_num_ref_idx_l1_active << 1); j++)
|
||||
{
|
||||
UWORD16 u2_l1_idx;
|
||||
|
|
@ -1285,13 +1286,13 @@ void ih264d_get_implicit_weights(dec_struct_t *ps_dec)
|
|||
u2_l1_idx += MAX_REF_BUFS;
|
||||
}
|
||||
ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][u2_l1_idx];
|
||||
u4_poc1 = ps_pic_buff1->i4_poc;
|
||||
if(u4_poc1 != u4_poc0)
|
||||
i4_poc1 = ps_pic_buff1->i4_poc;
|
||||
if(i4_poc1 != i4_poc0)
|
||||
{
|
||||
i16_tb = i4_cur_poc - u4_poc0;
|
||||
i16_tb = CLIP3(-128, 127, i16_tb);
|
||||
i16_td = u4_poc1 - u4_poc0;
|
||||
i16_td = CLIP3(-128, 127, i16_td);
|
||||
i4_tb = i4_cur_poc - i4_poc0;
|
||||
i16_tb = CLIP3(-128, 127, i4_tb);
|
||||
i4_td = i4_poc1 - i4_poc0;
|
||||
i16_td = CLIP3(-128, 127, i4_td);
|
||||
i16_tx = (16384 + ABS(SIGN_POW2_DIV(i16_td, 1)))
|
||||
/ i16_td;
|
||||
i2_dist_scale_factor = CLIP3(
|
||||
|
|
@ -1398,7 +1399,8 @@ WORD32 ih264d_parse_bslice(dec_struct_t * ps_dec, UWORD16 u2_first_mb_in_slice)
|
|||
{
|
||||
u1_max_ref_idx = MAX_FRAMES << 1;
|
||||
}
|
||||
if((u4_temp > u1_max_ref_idx) || (ui_temp1 > u1_max_ref_idx))
|
||||
if((u4_temp > u1_max_ref_idx) || (ui_temp1 > u1_max_ref_idx)
|
||||
|| (u4_temp < 1) || (ui_temp1 < 1))
|
||||
{
|
||||
return ERROR_NUM_REF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -791,6 +791,12 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
|
|||
u1_level_idc, ps_seq->u2_total_num_of_mbs);
|
||||
|
||||
u1_frm = ih264d_get_bit_h264(ps_bitstrm);
|
||||
if((ps_dec->i4_header_decoded & 1) && (ps_seq->u1_frame_mbs_only_flag != u1_frm))
|
||||
{
|
||||
ps_dec->u1_res_changed = 1;
|
||||
return IVD_RES_CHANGED;
|
||||
}
|
||||
|
||||
ps_seq->u1_frame_mbs_only_flag = u1_frm;
|
||||
|
||||
COPYTHECONTEXT("SPS: frame_mbs_only_flag", u1_frm);
|
||||
|
|
@ -911,7 +917,9 @@ WORD32 ih264d_parse_sps(dec_struct_t *ps_dec, dec_bit_stream_t *ps_bitstrm)
|
|||
}
|
||||
|
||||
/* Check for unsupported resolutions */
|
||||
if((u2_pic_wd > H264_MAX_FRAME_WIDTH) || (u2_pic_ht > H264_MAX_FRAME_HEIGHT))
|
||||
if((u2_pic_wd > H264_MAX_FRAME_WIDTH) || (u2_pic_ht > H264_MAX_FRAME_HEIGHT)
|
||||
|| (u2_pic_wd < H264_MIN_FRAME_WIDTH) || (u2_pic_ht < H264_MIN_FRAME_HEIGHT)
|
||||
|| (u2_pic_wd * (UWORD32)u2_pic_ht > H264_MAX_FRAME_SIZE))
|
||||
{
|
||||
return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1961,7 +1961,7 @@ WORD32 ih264d_parse_pslice(dec_struct_t *ps_dec, UWORD16 u2_first_mb_in_slice)
|
|||
|
||||
|
||||
UWORD8 u1_max_ref_idx = MAX_FRAMES << u1_field_pic_flag;
|
||||
if(u4_temp > u1_max_ref_idx)
|
||||
if(u4_temp > u1_max_ref_idx || u4_temp < 1)
|
||||
{
|
||||
return ERROR_NUM_REF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1382,9 +1382,8 @@ WORD32 ih264d_parse_decode_slice(UWORD8 u1_is_idr_slice,
|
|||
if(ps_dec->u1_dangling_field == 1)
|
||||
{
|
||||
ps_dec->u1_second_field = 1 - ps_dec->u1_second_field;
|
||||
ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
|
||||
ps_dec->u2_prv_frame_num = u2_frame_num;
|
||||
ps_dec->u1_first_slice_in_stream = 0;
|
||||
ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
|
||||
return ERROR_DANGLING_FIELD_IN_PIC;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -641,27 +641,6 @@ WORD32 ih264d_get_dpb_size(dec_seq_params_t *ps_seq)
|
|||
return (i4_size);
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
/* If change in Level or the required PicBuffers i4_size is more than the */
|
||||
/* current one FREE the current PicBuffers and allocate affresh */
|
||||
/***************************************************************************/
|
||||
UWORD8 ih264d_is_sps_changed(prev_seq_params_t * ps_prv,
|
||||
dec_seq_params_t * ps_cur)
|
||||
{
|
||||
|
||||
if((ps_prv->u2_frm_wd_in_mbs != ps_cur->u2_frm_wd_in_mbs)
|
||||
|| (ps_prv->u1_level_idc != ps_cur->u1_level_idc)
|
||||
|| (ps_prv->u1_profile_idc != ps_cur->u1_profile_idc)
|
||||
|| (ps_cur->u2_frm_ht_in_mbs != ps_prv->u2_frm_ht_in_mbs)
|
||||
|| (ps_cur->u1_frame_mbs_only_flag
|
||||
!= ps_prv->u1_frame_mbs_only_flag)
|
||||
|| (ps_cur->u1_direct_8x8_inference_flag
|
||||
!= ps_prv->u1_direct_8x8_inference_flag))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/* This function initialises the value of ps_dec->u1_recon_mb_grp */
|
||||
/* ps_dec->u1_recon_mb_grp must satisfy the following criteria */
|
||||
|
|
@ -747,8 +726,7 @@ WORD32 ih264d_init_pic(dec_struct_t *ps_dec,
|
|||
/* If change in Level or the required PicBuffers i4_size is more than the */
|
||||
/* current one FREE the current PicBuffers and allocate affresh */
|
||||
/***************************************************************************/
|
||||
if(!ps_dec->u1_init_dec_flag
|
||||
|| ih264d_is_sps_changed(ps_prev_seq_params, ps_seq))
|
||||
if(!ps_dec->u1_init_dec_flag)
|
||||
{
|
||||
ps_dec->u1_max_dec_frame_buffering = ih264d_get_dpb_size(ps_seq);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue