[Libva] [Libva-intel-driver][PATCH 2/2] Add CBR and VBR bitrate control flags for low power encode if possible
Xiang, Haihao
haihao.xiang at intel.com
Wed Sep 28 00:42:01 UTC 2016
CBR and VBR for low power encode depend on the fully loaded HuC firmware.
Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
---
src/i965_device_info.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index dc16197..4db6c51 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -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);
+}
--
1.9.1
More information about the Libva
mailing list