summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang, Haihao <haihao.xiang@intel.com>2014-01-17 16:51:20 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2014-01-17 16:57:48 +0800
commit623a09944d9e6ef0fcb4d7674be0fdc7b145ec72 (patch)
treee2eda0b8d1d770da4bc737bed17eb1e796c38ee6
parentc87d255bc08bb947e0ef9a0771d2036cd4f25aa8 (diff)
downloadlibva-intel-driver-623a09944d9e6ef0fcb4d7674be0fdc7b145ec72.tar.gz
libva-intel-driver-623a09944d9e6ef0fcb4d7674be0fdc7b145ec72.tar.bz2
libva-intel-driver-623a09944d9e6ef0fcb4d7674be0fdc7b145ec72.zip
Use the right parameters to initialize bit rate context
Reported-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com> Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
-rw-r--r--src/gen6_mfc_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c
index 26d8400..07e2eb2 100644
--- a/src/gen6_mfc_common.c
+++ b/src/gen6_mfc_common.c
@@ -89,8 +89,8 @@ intel_mfc_bit_rate_control_context_init(struct encode_state *encode_state,
struct gen6_mfc_context *mfc_context)
{
VAEncSequenceParameterBufferH264 *pSequenceParameter = (VAEncSequenceParameterBufferH264 *)encode_state->seq_param_ext->buffer;
- int width_in_mbs = (mfc_context->surface_state.width + 15) / 16;
- int height_in_mbs = (mfc_context->surface_state.height + 15) / 16;
+ int width_in_mbs = pSequenceParameter->picture_width_in_mbs;
+ int height_in_mbs = pSequenceParameter->picture_height_in_mbs;
float fps = pSequenceParameter->time_scale * 0.5 / pSequenceParameter->num_units_in_tick ;
int inter_mb_size = pSequenceParameter->bits_per_second * 1.0 / (fps+4.0) / width_in_mbs / height_in_mbs;
int intra_mb_size = inter_mb_size * 5.0;