diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2014-01-17 16:46:52 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-01-17 16:46:52 +0800 |
commit | c87d255bc08bb947e0ef9a0771d2036cd4f25aa8 (patch) | |
tree | 8ca0cca633bca2419fb737f1c75fff139206eed7 | |
parent | de74ff763a5c5a6d5478ac332162c160fb4bebbd (diff) | |
download | libva-intel-driver-c87d255bc08bb947e0ef9a0771d2036cd4f25aa8.tar.gz libva-intel-driver-c87d255bc08bb947e0ef9a0771d2036cd4f25aa8.tar.bz2 libva-intel-driver-c87d255bc08bb947e0ef9a0771d2036cd4f25aa8.zip |
Don't advertise CBR for MPEG-2 encoding
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r-- | src/gen6_mfc_common.c | 2 | ||||
-rwxr-xr-x | src/i965_drv_video.c | 6 | ||||
-rw-r--r-- | src/i965_encoder.c | 7 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c index 31573ba..26d8400 100644 --- a/src/gen6_mfc_common.c +++ b/src/gen6_mfc_common.c @@ -391,6 +391,8 @@ void intel_mfc_brc_prepare(struct encode_state *encode_state, struct gen6_mfc_context *mfc_context = encoder_context->mfc_context; if (rate_control_mode == VA_RC_CBR) { + assert(encoder_context->codec != CODEC_MPEG2); + /*Programing bit rate control */ if ( mfc_context->bit_rate_control_context[SLICE_TYPE_I].MaxSizeInWord == 0 ) { intel_mfc_bit_rate_control_context_init(encode_state, mfc_context); diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 22ac470..50010b4 100755 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -533,7 +533,11 @@ i965_GetConfigAttributes(VADriverContextP ctx, case VAConfigAttribRateControl: if (entrypoint == VAEntrypointEncSlice) { - attrib_list[i].value = VA_RC_CBR | VA_RC_CQP; + attrib_list[i].value = VA_RC_CQP; + + if (profile != VAProfileMPEG2Main && + profile != VAProfileMPEG2Simple) + attrib_list[i].value |= VA_RC_CBR; break; } diff --git a/src/i965_encoder.c b/src/i965_encoder.c index 9bf133f..534591c 100644 --- a/src/i965_encoder.c +++ b/src/i965_encoder.c @@ -367,6 +367,13 @@ intel_enc_hw_context_init(VADriverContextP ctx, for (i = 0; i < obj_config->num_attribs; i++) { if (obj_config->attrib_list[i].type == VAConfigAttribRateControl) { encoder_context->rate_control_mode = obj_config->attrib_list[i].value; + + if (encoder_context->codec == CODEC_MPEG2 && + encoder_context->rate_control_mode & VA_RC_CBR) { + WARN_ONCE("Don't support CBR for MPEG-2 encoding\n"); + encoder_context->rate_control_mode &= ~VA_RC_CBR; + } + break; } } |