[Libva] [Libva-intel-driver][PATCH 5/5] svct: Adjust the estimated frame size for QP=1
Xiang, Haihao
haihao.xiang at intel.com
Mon Oct 24 04:49:42 UTC 2016
Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
src/gen6_mfc_common.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c
index 4f4377f..add73a6 100644
--- a/src/gen6_mfc_common.c
+++ b/src/gen6_mfc_common.c
@@ -95,8 +95,9 @@ static void intel_mfc_brc_init(struct encode_state *encode_state,
{
struct gen6_mfc_context *mfc_context = encoder_context->mfc_context;
double bitrate, framerate;
- double qp1_size = 0.1 * 8 * 3 * encoder_context->frame_width_in_pixel * encoder_context->frame_height_in_pixel / 2;
- double qp51_size = 0.001 * 8 * 3 * encoder_context->frame_width_in_pixel * encoder_context->frame_height_in_pixel / 2;
+ double frame_per_bits = 8 * 3 * encoder_context->frame_width_in_pixel * encoder_context->frame_height_in_pixel / 2;
+ double qp1_size = 0.1 * frame_per_bits;
+ double qp51_size = 0.001 * frame_per_bits;
double bpf, factor;
int inum = encoder_context->brc.num_iframes_in_gop,
pnum = encoder_context->brc.num_pframes_in_gop,
@@ -104,6 +105,9 @@ static void intel_mfc_brc_init(struct encode_state *encode_state,
int intra_period = encoder_context->brc.gop_size;
int i;
+ if (encoder_context->layer.num_layers > 1)
+ qp1_size = 0.15 * frame_per_bits;
+
mfc_context->brc.mode = encoder_context->rate_control_mode;
mfc_context->hrd.buffer_size = encoder_context->brc.hrd_buffer_size;
--
1.9.1
More information about the Libva
mailing list