From 6550659721c9531f5ca6decafb11b68312979725 Mon Sep 17 00:00:00 2001 From: Pengfei Qu Date: Tue, 16 May 2017 15:49:13 +0800 Subject: [PATCH] ENC: add RC query for AVC mb rc mode on SKL+ v0: add h264_brc_mode to store the RC capability of H264 Fixes #168 Signed-off-by: Pengfei Qu (cherry picked from commit 3416db0c8280a321db0b8d2afde9c30c3229ee7d) --- src/i965_device_info.c | 14 ++++++++++++++ src/i965_drv_video.c | 8 +++++--- src/i965_drv_video.h | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/i965_device_info.c b/src/i965_device_info.c index 2019b97..629b1f2 100644 --- a/src/i965_device_info.c +++ b/src/i965_device_info.c @@ -132,6 +132,8 @@ static struct hw_codec_info snb_hw_codec_info = { .has_tiled_surface = 1, .has_di_motion_adptive = 1, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR, + .num_filters = 2, .filters = { { VAProcFilterNoiseReduction, I965_RING_NULL }, @@ -173,6 +175,8 @@ static struct hw_codec_info ivb_hw_codec_info = { .has_di_motion_adptive = 1, .has_di_motion_compensated = 1, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR, + .num_filters = 2, .filters = { { VAProcFilterNoiseReduction, I965_RING_NULL }, @@ -217,6 +221,8 @@ static struct hw_codec_info hsw_hw_codec_info = { .has_di_motion_compensated = 1, .has_h264_mvc_encoding = 1, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR, + .num_filters = 5, .filters = { { VAProcFilterNoiseReduction, I965_RING_VEBOX }, @@ -262,6 +268,8 @@ static struct hw_codec_info bdw_hw_codec_info = { .has_vp8_decoding = 1, .has_h264_mvc_encoding = 1, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR, + .num_filters = 5, .filters = { { VAProcFilterNoiseReduction, I965_RING_VEBOX }, @@ -309,6 +317,8 @@ static struct hw_codec_info chv_hw_codec_info = { .has_h264_mvc_encoding = 1, .has_hevc_decoding = 1, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR, + .num_filters = 5, .filters = { { VAProcFilterNoiseReduction, I965_RING_VEBOX }, @@ -365,6 +375,7 @@ static struct hw_codec_info skl_hw_codec_info = { .has_lp_h264_encoding = 1, .lp_h264_brc_mode = VA_RC_CQP, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR | VA_RC_MB, .num_filters = 5, .filters = { @@ -423,6 +434,7 @@ static struct hw_codec_info bxt_hw_codec_info = { .has_lp_h264_encoding = 1, .lp_h264_brc_mode = VA_RC_CQP, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR | VA_RC_MB, .num_filters = 5, .filters = { @@ -486,6 +498,7 @@ static struct hw_codec_info kbl_hw_codec_info = { .has_lp_h264_encoding = 1, .lp_h264_brc_mode = VA_RC_CQP, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR | VA_RC_MB, .num_filters = 5, .filters = { @@ -550,6 +563,7 @@ static struct hw_codec_info glk_hw_codec_info = { .has_lp_h264_encoding = 1, .lp_h264_brc_mode = VA_RC_CQP, + .h264_brc_mode = VA_RC_CQP | VA_RC_CBR | VA_RC_VBR | VA_RC_MB, .num_filters = 5, .filters = { diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index eb203d5..aab16e8 100644 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -975,12 +975,14 @@ i965_GetConfigAttributes(VADriverContextP ctx, if (profile == VAProfileVP8Version0_3 || profile == VAProfileVP9Profile0 || - profile == VAProfileH264ConstrainedBaseline || - profile == VAProfileH264Main || - profile == VAProfileH264High || profile == VAProfileHEVCMain) attrib_list[i].value |= VA_RC_VBR; + if (profile == VAProfileH264ConstrainedBaseline || + profile == VAProfileH264Main || + profile == VAProfileH264High) + attrib_list[i].value = i965->codec_info->h264_brc_mode; + break; } else if (entrypoint == VAEntrypointEncSliceLP) { struct i965_driver_data * const i965 = i965_driver_data(ctx); diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h index abc85be..626e13c 100644 --- a/src/i965_drv_video.h +++ b/src/i965_drv_video.h @@ -480,6 +480,7 @@ struct hw_codec_info { unsigned int has_vp9_encoding: 1; unsigned int lp_h264_brc_mode; + unsigned int h264_brc_mode; unsigned int num_filters; struct i965_filter filters[VAProcFilterCount]; -- 2.11.0