diff options
author | hding3 <haitao.ding@intel.com> | 2014-12-15 18:04:10 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-12-18 08:24:44 -0800 |
commit | fe436fee778fb0470d1d07150a8150eb38232533 (patch) | |
tree | c09521d3a25b664b816e84d4848240ca80bd5d03 | |
parent | 5f7a214b9c178d289f0f0dacbe35e6f58e2835a0 (diff) | |
download | psb_video-fe436fee778fb0470d1d07150a8150eb38232533.tar.gz |
Fix VP8 encoder realted CTS issue .
Bug: 18670741
Change-Id: If2e3c934a575a90583c53db3f9d734c2998558fa
Signed-off-by: hding3 <haitao.ding@intel.com>
-rw-r--r-- | src/vsp_vp8.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/vsp_vp8.c b/src/vsp_vp8.c index a60e9d0..1e6bb9b 100644 --- a/src/vsp_vp8.c +++ b/src/vsp_vp8.c @@ -559,9 +559,17 @@ static VAStatus vsp_vp8_process_misc_param(context_VPP_p ctx, object_buffer_p ob break; case VAEncMiscParameterTypeFrameRate: frame_rate_param = (VAEncMiscParameterFrameRate *)pBuffer->data; - if (frame_rate_param->framerate < 1 || frame_rate_param->framerate > 65535) { - vaStatus = VA_STATUS_ERROR_INVALID_PARAMETER; - break; + if (frame_rate_param->framerate > 120) { + drv_debug_msg(VIDEO_DEBUG_ERROR, "%d is invalid." + "framerate could not be larger than 120\n", + frame_rate_param->framerate); + frame_rate_param->framerate = 120; + } + if (frame_rate_param->framerate < 1) { + drv_debug_msg(VIDEO_DEBUG_ERROR, "%d is invalid." + "framerate could not be smaller than 1\n", + frame_rate_param->framerate); + frame_rate_param->framerate = 1; } if (ctx->temporal_layer_number == 1) { @@ -587,13 +595,13 @@ static VAStatus vsp_vp8_process_misc_param(context_VPP_p ctx, object_buffer_p ob break; case VAEncMiscParameterTypeRateControl: rate_control_param = (VAEncMiscParameterRateControl *)pBuffer->data; - if (rate_control_param->initial_qp > 63 || + if (rate_control_param->max_qp > 63 || rate_control_param->min_qp > 63) { - drv_debug_msg(VIDEO_DEBUG_ERROR, "Initial_qp(%d) and min_qpinitial_qp(%d) " + drv_debug_msg(VIDEO_DEBUG_ERROR, "max_qp(%d) and min_qp(%d) " "are invalid.\nQP shouldn't be larger than 63 for VP8\n", - rate_control_param->initial_qp, rate_control_param->min_qp); - vaStatus = VA_STATUS_ERROR_INVALID_PARAMETER; - break; + rate_control_param->max_qp, rate_control_param->min_qp); + rate_control_param->max_qp = 63; + rate_control_param->min_qp = rate_control_param->max_qp; } if (rate_control_param->min_qp != seq->rc_min_quantizer) { @@ -616,6 +624,13 @@ static VAStatus vsp_vp8_process_misc_param(context_VPP_p ctx, object_buffer_p ob seq->rc_undershoot_pct = rate_control_param->target_percentage; } + if (rate_control_param->bits_per_second / 1000 > 20000) { + drv_debug_msg(VIDEO_DEBUG_ERROR, "%d is invalid." + "bitrate could not be larger than 20000\n", + rate_control_param->bits_per_second / 1000); + rate_control_param->bits_per_second = 20000000; + } + if (ctx->temporal_layer_number == 1) { if (rate_control_param->bits_per_second / 1000 != seq->rc_target_bitrate) { drv_debug_msg(VIDEO_DEBUG_ERROR, "bitrate was changed from %dkbps to %dkbps\n", |