Merge "Encoder: Fix in returning recon buffers with smaller IDR interval" am: cf4481b31d am: cc7a15ca99

Original change: https://android-review.googlesource.com/c/platform/external/libavc/+/200241

Change-Id: I0ebf41c57d21f6990858085997bebdf8c7ce6f8c
This commit is contained in:
Ray Essick 2020-11-15 23:19:58 +00:00 committed by Automerger Merge Worker
commit 3fac4a09ad

View file

@ -545,16 +545,16 @@ WORD32 ih264e_encode(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op)
* We need to return a recon when ever we consume an input buffer. This * We need to return a recon when ever we consume an input buffer. This
* comsumption include a pre or post enc skip. Thus dump recon is set for * comsumption include a pre or post enc skip. Thus dump recon is set for
* all cases except when * all cases except when
* 1) We are waiting -> ps_codec->i4_frame_num > 1 * 1) We are waiting -> ps_codec->i4_pic_cnt > ps_codec->s_cfg.u4_num_bframe
* 2) When the input buffer is null [ ie we are not consuming any inp]
* An exception need to be made for the case when we have the last buffer * An exception need to be made for the case when we have the last buffer
* since we need to flush out the on remainig recon. * since we need to flush out the on remainig recon.
****************************************************************************/ ****************************************************************************/
ps_video_encode_op->s_ive_op.dump_recon = 0; ps_video_encode_op->s_ive_op.dump_recon = 0;
if (ps_codec->s_cfg.u4_enable_recon && (ps_codec->i4_frame_num > 1 || s_inp_buf.u4_is_last) if (ps_codec->s_cfg.u4_enable_recon
&& (s_inp_buf.s_raw_buf.apv_bufs[0] || s_inp_buf.u4_is_last)) && (ps_codec->i4_pic_cnt > (WORD32)ps_codec->s_cfg.u4_num_bframes ||
s_inp_buf.u4_is_last))
{ {
/* error status */ /* error status */
IH264_ERROR_T ret = IH264_SUCCESS; IH264_ERROR_T ret = IH264_SUCCESS;