OSDN Git Service

Add flags for VP9 low power encoding mode
authorXiang, Haihao <haihao.xiang@intel.com>
Thu, 21 Sep 2017 07:42:52 +0000 (15:42 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 29 Jan 2018 04:40:02 +0000 (12:40 +0800)
Add some related checks as well

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/i965_drv_video.c
src/i965_drv_video.h

index 748735a..9907d22 100644 (file)
@@ -583,7 +583,8 @@ i965_QueryConfigProfiles(VADriverContextP ctx,
     }
 
     if (HAS_VP9_DECODING_PROFILE(i965, VAProfileVP9Profile0) ||
-        HAS_VP9_ENCODING(i965)) {
+        HAS_VP9_ENCODING(i965) ||
+        HAS_LP_VP9_ENCODING(i965)) {
         profile_list[i++] = VAProfileVP9Profile0;
     }
 
@@ -720,6 +721,9 @@ i965_QueryConfigEntrypoints(VADriverContextP ctx,
         if (HAS_VP9_ENCODING(i965) && (profile == VAProfileVP9Profile0))
             entrypoint_list[n++] = VAEntrypointEncSlice;
 
+        if (HAS_LP_VP9_ENCODING(i965) && (profile == VAProfileVP9Profile0))
+            entrypoint_list[n++] = VAEntrypointEncSliceLP;
+
         if (profile == VAProfileVP9Profile0) {
             if (i965->wrapper_pdrvctx) {
                 VAStatus va_status = VA_STATUS_SUCCESS;
@@ -877,12 +881,18 @@ i965_validate_config(VADriverContextP ctx, VAProfile profile,
         } else if ((HAS_VP9_ENCODING_PROFILE(i965, profile)) &&
                    (entrypoint == VAEntrypointEncSlice)) {
             va_status = VA_STATUS_SUCCESS;
+        } else if ((HAS_LP_VP9_ENCODING(i965) &&
+                    profile == VAProfileVP9Profile0 &&
+                    entrypoint == VAEntrypointEncSliceLP)) {
+            va_status = VA_STATUS_SUCCESS;
         } else if (profile == VAProfileVP9Profile0 &&
                    entrypoint == VAEntrypointVLD &&
                    i965->wrapper_pdrvctx) {
             va_status = VA_STATUS_SUCCESS;
         } else if (!HAS_VP9_DECODING_PROFILE(i965, profile) &&
-                   !HAS_VP9_ENCODING(i965) && !i965->wrapper_pdrvctx) {
+                   !HAS_VP9_ENCODING(i965) &&
+                   !HAS_LP_VP9_ENCODING(i965) &&
+                   !i965->wrapper_pdrvctx) {
             va_status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
         } else {
             va_status = VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
@@ -990,6 +1000,9 @@ i965_get_rc_attributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint ent
             profile == VAProfileH264StereoHigh)
             rc_attribs = i965->codec_info->lp_h264_brc_mode;
 
+        else if (profile == VAProfileVP9Profile0)
+            rc_attribs = i965->codec_info->lp_vp9_brc_mode;
+
     } else if (entrypoint == VAEntrypointFEI) {
 
         if (profile == VAProfileH264ConstrainedBaseline ||
index 56dcd7f..2979540 100644 (file)
 #define HAS_VP9_ENCODING(ctx)          ((ctx)->codec_info->has_vp9_encoding && \
                                          (ctx)->intel.has_bsd)
 
+#define HAS_LP_VP9_ENCODING(ctx) ((ctx)->codec_info->has_lp_vp9_encoding && \
+                                    (ctx)->intel.has_huc)
+
 #define HAS_VP9_ENCODING_PROFILE(ctx, profile)                     \
     (HAS_VP9_ENCODING(ctx) &&                                      \
      ((ctx)->codec_info->vp9_enc_profiles & (1U << (profile - VAProfileVP9Profile0))))
@@ -499,8 +502,11 @@ struct hw_codec_info {
     unsigned int has_vp9_encoding: 1;
     unsigned int has_fei_h264_encoding: 1;
     unsigned int has_h264_preenc: 1;
+    unsigned int has_lp_vp9_encoding: 1;
 
     unsigned int lp_h264_brc_mode;
+    unsigned int lp_vp9_brc_mode;
+
     unsigned int h264_brc_mode;
     unsigned int vp9_brc_mode;