diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-03-24 18:58:23 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-03-24 18:58:23 +0000 |
commit | 3d654001c45d8361a9db3e22e2142dbad60aeba5 (patch) | |
tree | cd863459f00b6b87eb92916bccb8b2fc03fe8c43 /test | |
parent | 3b8a89df3201758d1c8d6bd0d1a7835f33b086a9 (diff) | |
parent | b852cf285cacce86e516e425edf72f7629b1e85b (diff) | |
download | libhevc-3d654001c45d8361a9db3e22e2142dbad60aeba5.tar.gz |
Merge "libhevcenc: Add support for force idr picture"
Diffstat (limited to 'test')
-rw-r--r-- | test/encoder/main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/encoder/main.c b/test/encoder/main.c index 98106de..49d1aec 100644 --- a/test/encoder/main.c +++ b/test/encoder/main.c @@ -60,6 +60,7 @@ /* Constant Macros */ /*****************************************************************************/ #define DYN_BITRATE_TEST 0 +#define FORCE_IDR_TEST 0 /*****************************************************************************/ /* Global definitions */ @@ -839,8 +840,8 @@ IHEVCE_PLUGIN_STATUS_T allocate_input(appl_ctxt_t *ps_ctxt, ihevce_inp_buf_t *in inp_pic->i4_curr_bitrate = params->s_tgt_lyr_prms.as_tgt_params[0].ai4_tgt_bitrate[0]; inp_pic->i4_curr_peak_bitrate = params->s_tgt_lyr_prms.as_tgt_params[0].ai4_peak_bitrate[0]; - inp_pic->i4_curr_rate_factor = params->s_config_prms.i4_rate_factor; inp_pic->u8_pts = 0; + inp_pic->i4_force_idr_flag = 0; return IHEVCE_EOK; } @@ -1022,6 +1023,8 @@ IHEVCE_PLUGIN_STATUS_T libihevce_encode_frame(appl_ctxt_t *ps_ctxt, FILE *pf_inp { ihevce_inp_buf_t *ps_inp_pic = &inp_pic; + ps_inp_pic->i4_force_idr_flag = 0; + if(i4_num_frames < params->s_config_prms.i4_num_frms_to_encode) { status = read_input(ps_ctxt, pf_inp_yuv, &inp_pic); @@ -1040,6 +1043,12 @@ IHEVCE_PLUGIN_STATUS_T libihevce_encode_frame(appl_ctxt_t *ps_ctxt, FILE *pf_inp ps_inp_pic->i4_curr_bitrate = ps_inp_pic->i4_curr_bitrate << 1; } #endif +#if FORCE_IDR_TEST + if((i4_num_frames == 70) && (ps_inp_pic != NULL)) + { + ps_inp_pic->i4_force_idr_flag = 1; + } +#endif /* call encoder process frame */ PROFILE_START(&s_profile_data); status = ihevce_encode(ps_ctxt->ihevceHdl, ps_inp_pic, &out_pic); |