OSDN Git Service

Add CBR and VBR bitrate control flags for low power encode if possible
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 28 Sep 2016 00:42:01 +0000 (08:42 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 31 Oct 2016 02:00:08 +0000 (10:00 +0800)
CBR and VBR for low power encode depend on the fully loaded HuC firmware.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit f3d975c39ad1b63a3afa8cf1534e7a508deb2625)

src/i965_device_info.c

index dc16197..4db6c51 100644 (file)
@@ -319,6 +319,8 @@ static struct hw_codec_info chv_hw_codec_info = {
     },
 };
 
+static void gen9_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *codec_info);
+
 extern struct hw_context *gen9_enc_hw_context_init(VADriverContextP, struct object_config *);
 extern void gen9_post_processing_context_init(VADriverContextP, void *, struct intel_batchbuffer *);
 extern void gen9_max_resolution(struct i965_driver_data *, struct object_config *, int *, int *);
@@ -329,6 +331,7 @@ static struct hw_codec_info skl_hw_codec_info = {
     .render_init = gen9_render_init,
     .post_processing_context_init = gen9_post_processing_context_init,
     .max_resolution = gen9_max_resolution,
+    .preinit_hw_codec = gen9_hw_codec_preinit,
 
     .max_width = 4096,  /* default. See max_resolution */
     .max_height = 4096, /* default. See max_resolution */
@@ -869,3 +872,11 @@ static void gen7_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *co
     }
     return;
 }
+
+static void gen9_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *codec_info)
+{
+    struct i965_driver_data *i965 = i965_driver_data(ctx);
+
+    if (i965->intel.has_huc && codec_info->has_lp_h264_encoding)
+        codec_info->lp_h264_brc_mode |= (VA_RC_CBR | VA_RC_VBR);
+}