OSDN Git Service

svct: Adjust the estimated frame size for QP=1
authorXiang, Haihao <haihao.xiang@intel.com>
Mon, 24 Oct 2016 04:49:42 +0000 (12:49 +0800)
committerSean V Kelley <seanvk@posteo.de>
Mon, 24 Oct 2016 22:46:17 +0000 (15:46 -0700)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>
src/gen6_mfc_common.c

index 4f4377f..add73a6 100644 (file)
@@ -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;