diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2018-01-19 13:48:56 +0800 |
---|---|---|
committer | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2018-01-22 10:23:53 -0800 |
commit | cccf2a3c61b3cdc4836ee6a0a30db436fcc6ffe5 (patch) | |
tree | be468510f72e6dfd9cf3ed0ae726218c03f72cd9 | |
parent | 336d8913aa30c2e56493187b5cc28626b978d2cc (diff) | |
download | libva-intel-driver-cccf2a3c61b3cdc4836ee6a0a30db436fcc6ffe5.tar.gz |
Check the flags of the packed headers when creating a config
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r-- | src/i965_drv_video.c | 63 |
1 files changed, 42 insertions, 21 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 24e0d15c..9b54597c 100644 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -1000,6 +1000,36 @@ i965_get_rc_attributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint ent return rc_attribs; } +static uint32_t +i965_get_enc_packed_attributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint) +{ + uint32_t enc_packed_attribs = VA_ATTRIB_NOT_SUPPORTED; + + if (entrypoint == VAEntrypointEncSlice || + entrypoint == VAEntrypointEncSliceLP || + entrypoint == VAEntrypointFEI) { + enc_packed_attribs = VA_ENC_PACKED_HEADER_SEQUENCE | VA_ENC_PACKED_HEADER_PICTURE | VA_ENC_PACKED_HEADER_MISC; + + if (profile == VAProfileH264ConstrainedBaseline || + profile == VAProfileH264Main || + profile == VAProfileH264High || + profile == VAProfileH264StereoHigh || + profile == VAProfileH264MultiviewHigh || + profile == VAProfileHEVCMain || + profile == VAProfileHEVCMain10) { + enc_packed_attribs |= (VA_ENC_PACKED_HEADER_RAW_DATA | VA_ENC_PACKED_HEADER_SLICE); + + } else if (profile == VAProfileVP9Profile0) + enc_packed_attribs = VA_ENC_PACKED_HEADER_RAW_DATA; + + } else if (entrypoint == VAEntrypointEncPicture) { + if (profile == VAProfileJPEGBaseline) + enc_packed_attribs = VA_ENC_PACKED_HEADER_RAW_DATA; + } + + return enc_packed_attribs; +} + VAStatus i965_GetConfigAttributes(VADriverContextP ctx, VAProfile profile, @@ -1031,27 +1061,7 @@ i965_GetConfigAttributes(VADriverContextP ctx, break; case VAConfigAttribEncPackedHeaders: - if (entrypoint == VAEntrypointEncSlice || - entrypoint == VAEntrypointEncSliceLP || - entrypoint == VAEntrypointFEI) { - attrib_list[i].value = VA_ENC_PACKED_HEADER_SEQUENCE | VA_ENC_PACKED_HEADER_PICTURE | VA_ENC_PACKED_HEADER_MISC; - if (profile == VAProfileH264ConstrainedBaseline || - profile == VAProfileH264Main || - profile == VAProfileH264High || - profile == VAProfileH264StereoHigh || - profile == VAProfileH264MultiviewHigh || - profile == VAProfileHEVCMain || - profile == VAProfileHEVCMain10) { - attrib_list[i].value |= (VA_ENC_PACKED_HEADER_RAW_DATA | - VA_ENC_PACKED_HEADER_SLICE); - } else if (profile == VAProfileVP9Profile0) - attrib_list[i].value = VA_ENC_PACKED_HEADER_RAW_DATA; - break; - } else if (entrypoint == VAEntrypointEncPicture) { - if (profile == VAProfileJPEGBaseline) - attrib_list[i].value = VA_ENC_PACKED_HEADER_RAW_DATA; - } else if (entrypoint == VAEntrypointStats) - attrib_list[i].value = VA_ATTRIB_NOT_SUPPORTED; + attrib_list[i].value = i965_get_enc_packed_attributes(ctx, profile, entrypoint); break; @@ -1381,6 +1391,17 @@ i965_CreateConfig(VADriverContextP ctx, } if (vaStatus == VA_STATUS_SUCCESS) { + VAConfigAttrib *attrib_found = i965_lookup_config_attribute(obj_config, VAConfigAttribEncPackedHeaders); + + if (attrib_found) { + uint32_t enc_packed_attribs = i965_get_enc_packed_attributes(ctx, profile, entrypoint); + + if (!(attrib_found->value & enc_packed_attribs)) + vaStatus = VA_STATUS_ERROR_INVALID_VALUE; + } + } + + if (vaStatus == VA_STATUS_SUCCESS) { VAConfigAttrib attrib; attrib.type = VAConfigAttribEncMaxSlices; attrib.value = VA_ATTRIB_NOT_SUPPORTED; |