diff options
author | peng.chen <peng.c.chen@intel.com> | 2016-04-07 10:36:21 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2016-04-08 16:03:13 +0800 |
commit | 2c1bec03889fe759a33c087a7c107ad84bbb72fb (patch) | |
tree | f0eb9a3ad16d4f82ac9f2d29ef0f96fdb9cb5ebe | |
parent | 94400e961ef8dad379142d6393422cb9e809e77a (diff) |
fix the FPS caculation error for HEVC encoder
Signed-off-by: peng.chen <peng.c.chen@intel.com>
-rw-r--r-- | src/gen9_mfc_hevc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gen9_mfc_hevc.c b/src/gen9_mfc_hevc.c index c81cb3e..fd976f0 100644 --- a/src/gen9_mfc_hevc.c +++ b/src/gen9_mfc_hevc.c @@ -2151,7 +2151,7 @@ intel_hcpe_bit_rate_control_context_init(struct encode_state *encode_state, int width_in_mbs = (pSequenceParameter->pic_width_in_luma_samples + ctb_size - 1) / ctb_size; int height_in_mbs = (pSequenceParameter->pic_height_in_luma_samples + ctb_size - 1) / ctb_size; - float fps = pSequenceParameter->vui_time_scale * 0.5 / pSequenceParameter->vui_num_units_in_tick ; + float fps = pSequenceParameter->vui_time_scale / pSequenceParameter->vui_num_units_in_tick ; double bitrate = pSequenceParameter->bits_per_second * 1.0; int inter_mb_size = bitrate * 1.0 / (fps + 4.0) / width_in_mbs / height_in_mbs; int intra_mb_size = inter_mb_size * 5.0; @@ -2199,7 +2199,7 @@ static void intel_hcpe_brc_init(struct encode_state *encode_state, VAEncMiscParameterBuffer* pMiscParamHRD = NULL; double bitrate = pSequenceParameter->bits_per_second * 1.0; - double framerate = (double)pSequenceParameter->vui_time_scale / (2 * (double)pSequenceParameter->vui_num_units_in_tick); + double framerate = (double)pSequenceParameter->vui_time_scale / (double)pSequenceParameter->vui_num_units_in_tick; int inum = 1, pnum = 0, bnum = 0; /* Gop structure: number of I, P, B frames in the Gop. */ int intra_period = pSequenceParameter->intra_period; int ip_period = pSequenceParameter->ip_period; @@ -2518,7 +2518,7 @@ static bool intel_hcpe_brc_updated_check(struct encode_state *encode_state, cur_bitrate = pSequenceParameter->bits_per_second; cur_fps = (double)pSequenceParameter->vui_time_scale / - (2 * (double)pSequenceParameter->vui_num_units_in_tick); + (double)pSequenceParameter->vui_num_units_in_tick; if ((cur_bitrate == mfc_context->brc.saved_bps) && (cur_fps == mfc_context->brc.saved_fps) && |