summaryrefslogtreecommitdiff
path: root/src/gen6_mfc_common.c
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-02-27 10:30:55 +0800
commitbb1b7e40140150ca7acb8b5d19db5b0f9a13ef2d (patch)
tree4fc8425cfb511f2670c8bd95e2c71774052e2208 /src/gen6_mfc_common.c
parentdf966b871c4d321bf332821b22619cfa5519941e (diff)
downloadlibva-intel-driver-bb1b7e40140150ca7acb8b5d19db5b0f9a13ef2d.tar.gz
libva-intel-driver-bb1b7e40140150ca7acb8b5d19db5b0f9a13ef2d.tar.bz2
libva-intel-driver-bb1b7e40140150ca7acb8b5d19db5b0f9a13ef2d.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>
Diffstat (limited to 'src/gen6_mfc_common.c')
-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;