hardware/intel/common/vaapi
Revisión | 8718ff7dea8485aba2c67350521ae8d00e118d75 (tree) |
---|---|
Tiempo | 2017-08-10 15:39:17 |
Autor | Pengfei Qu <Pengfei.Qu@inte...> |
Commiter | Xiang, Haihao |
add brc mode check for AVC when creating the config
v0:this add the RC check for AVC encoder
Fixes #35
Signed-off-by: Pengfei Qu <Pengfei.Qu@intel.com>
@@ -1296,6 +1296,27 @@ i965_CreateConfig(VADriverContextP ctx, | ||
1296 | 1296 | vaStatus = VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT; |
1297 | 1297 | } |
1298 | 1298 | |
1299 | + | |
1300 | + if (vaStatus == VA_STATUS_SUCCESS) { | |
1301 | + VAConfigAttrib attrib, *attrib_found; | |
1302 | + attrib.type = VAConfigAttribRateControl; | |
1303 | + attrib_found = i965_lookup_config_attribute(obj_config, attrib.type); | |
1304 | + switch (profile) { | |
1305 | + case VAProfileH264ConstrainedBaseline: | |
1306 | + case VAProfileH264Main: | |
1307 | + case VAProfileH264High: | |
1308 | + if ((entrypoint == VAEntrypointEncSlice) && | |
1309 | + !(attrib_found->value & i965->codec_info->h264_brc_mode)) | |
1310 | + vaStatus = VA_STATUS_ERROR_INVALID_CONFIG; | |
1311 | + else if ((entrypoint == VAEntrypointEncSliceLP) && | |
1312 | + !(attrib_found->value & i965->codec_info->lp_h264_brc_mode)) | |
1313 | + vaStatus = VA_STATUS_ERROR_INVALID_CONFIG; | |
1314 | + break; | |
1315 | + default: | |
1316 | + break; | |
1317 | + } | |
1318 | + } | |
1319 | + | |
1299 | 1320 | if (vaStatus == VA_STATUS_SUCCESS) { |
1300 | 1321 | VAConfigAttrib attrib; |
1301 | 1322 | attrib.type = VAConfigAttribEncMaxSlices; |