Made gops closed
Now no picture in a gop will depend on any picture in the previous gop All calls to force an IDR are respected as soon as possible Bug: 22860270 Change-Id: Id2bcd5687c3fb786336a01894c1b9228d67a87a6
This commit is contained in:
parent
860f75203e
commit
dbe9ac8936
3 changed files with 13 additions and 10 deletions
|
|
@ -198,7 +198,7 @@ void ih264e_rc_init(void *pv_rc_api,
|
|||
// UWORD8 u1_is_mb_level_rc_on = 0;
|
||||
UWORD32 au4_peak_bit_rate[2] = {0,0};
|
||||
UWORD32 u4_min_bit_rate = 0;
|
||||
WORD32 i4_is_gop_closed = 0;
|
||||
WORD32 i4_is_gop_closed = 1;
|
||||
// WORD32 i4_use_est_intra_sad = 1;
|
||||
UWORD32 u4_src_ticks = 0;
|
||||
UWORD32 u4_tgt_ticks = 0;
|
||||
|
|
|
|||
|
|
@ -2623,9 +2623,9 @@ struct _codec_t
|
|||
inp_buf_t as_inp_list[MAX_NUM_BFRAMES];
|
||||
|
||||
/**
|
||||
* IDR flags for each input
|
||||
* Flag to indicate if any IDR requests are pending
|
||||
*/
|
||||
WORD32 i4_idr_inp_list[MAX_NUM_BFRAMES];
|
||||
WORD32 i4_pending_idr_flag;
|
||||
|
||||
/*
|
||||
*Flag to indicate if we have recived the last input frame
|
||||
|
|
|
|||
|
|
@ -265,9 +265,9 @@ WORD32 ih264e_input_queue_update(codec_t *ps_codec,
|
|||
|
||||
i4_force_i = (ps_codec->force_curr_frame_type == IV_I_FRAME);
|
||||
|
||||
ps_codec->i4_idr_inp_list[ps_codec->i4_pic_cnt % MAX_NUM_BFRAMES] = i4_force_idr;
|
||||
ps_codec->i4_pending_idr_flag |= i4_force_idr;
|
||||
|
||||
if ((ps_codec->i4_frame_num > 0) && (i4_force_idr || i4_force_i))
|
||||
if ((ps_codec->i4_pic_cnt > 0) && (i4_force_idr || i4_force_i))
|
||||
{
|
||||
irc_force_I_frame(ps_codec->s_rate_control.pps_rate_control_api);
|
||||
}
|
||||
|
|
@ -312,12 +312,13 @@ WORD32 ih264e_input_queue_update(codec_t *ps_codec,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Set IDR if it has been requested or its the IDR interval */
|
||||
ps_codec->pic_type = ps_codec->i4_idr_inp_list[u4_pic_id % MAX_NUM_BFRAMES] ?
|
||||
/* Set IDR if it has been requested */
|
||||
if (ps_codec->pic_type == PIC_I)
|
||||
{
|
||||
ps_codec->pic_type = ps_codec->i4_pending_idr_flag ?
|
||||
PIC_IDR : ps_codec->pic_type;
|
||||
ps_codec->i4_idr_inp_list[u4_pic_id % MAX_NUM_BFRAMES] = 0;
|
||||
|
||||
|
||||
ps_codec->i4_pending_idr_flag = 0;
|
||||
}
|
||||
|
||||
/* Get current frame Qp */
|
||||
u1_frame_qp = (UWORD8)irc_get_frame_level_qp(
|
||||
|
|
@ -1354,6 +1355,8 @@ IH264E_ERROR_T ih264e_codec_init(codec_t *ps_codec)
|
|||
/* Init dependecy vars */
|
||||
ps_codec->i4_last_inp_buff_received = 0;
|
||||
|
||||
/* At codec start no IDR is pending */
|
||||
ps_codec->i4_pending_idr_flag = 0;
|
||||
|
||||
return IH264E_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue