OSDN Git Service

ENC: add RC query for AVC mb rc mode on SKL+
authorPengfei Qu <Pengfei.Qu@intel.com>
Tue, 16 May 2017 07:49:13 +0000 (15:49 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 12 Jun 2017 06:04:01 +0000 (14:04 +0800)
v0: add h264_brc_mode to store the RC capability of H264

Fixes #168

Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
src/i965_device_info.c
src/i965_drv_video.c
src/i965_drv_video.h

index 2019b97..629b1f2 100644 (file)
@@ -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 = {
index eb203d5..aab16e8 100644 (file)
@@ -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);
index abc85be..626e13c 100644 (file)
@@ -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];