diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-03-15 14:41:47 +0100 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-03-18 09:10:11 +0100 |
commit | 14f70559b516030d141cce09db54cf49d11df9b2 (patch) | |
tree | 0282004db9b50b3e174bd2a7b13e8bca0323c581 /src/gen6_mfd.c | |
parent | 18212d42c5dfee047094ae67914c2b2b630ad99e (diff) | |
download | libva-intel-driver-14f70559b516030d141cce09db54cf49d11df9b2.tar.gz libva-intel-driver-14f70559b516030d141cce09db54cf49d11df9b2.tar.bz2 libva-intel-driver-14f70559b516030d141cce09db54cf49d11df9b2.zip |
mpeg2: fix construction of reference frames list (SNB, IVB).
Fix construction of reference frames list for interlaced streams.
In this case, the array is indexed by frame store ID >> 1 where
bit 0 of frame store ID represents top (0) or bottom (1) field.
Besides, current render target can also be used as a reference
while decoding the second field.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'src/gen6_mfd.c')
-rw-r--r-- | src/gen6_mfd.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/gen6_mfd.c b/src/gen6_mfd.c index 367294f..51426ba 100644 --- a/src/gen6_mfd.c +++ b/src/gen6_mfd.c @@ -1084,30 +1084,17 @@ gen6_mfd_mpeg2_decode_init(VADriverContextP ctx, VAPictureParameterBufferMPEG2 *pic_param; struct i965_driver_data *i965 = i965_driver_data(ctx); struct object_surface *obj_surface; - int i; dri_bo *bo; assert(decode_state->pic_param && decode_state->pic_param->buffer); pic_param = (VAPictureParameterBufferMPEG2 *)decode_state->pic_param->buffer; - /* reference picture */ - obj_surface = SURFACE(pic_param->forward_reference_picture); - - if (obj_surface && obj_surface->bo) - gen6_mfd_context->reference_surface[0].surface_id = pic_param->forward_reference_picture; - else - gen6_mfd_context->reference_surface[0].surface_id = VA_INVALID_ID; - - obj_surface = SURFACE(pic_param->backward_reference_picture); - - if (obj_surface && obj_surface->bo) - gen6_mfd_context->reference_surface[1].surface_id = pic_param->backward_reference_picture; - else - gen6_mfd_context->reference_surface[1].surface_id = gen6_mfd_context->reference_surface[0].surface_id; - - /* must do so !!! */ - for (i = 2; i < ARRAY_ELEMS(gen6_mfd_context->reference_surface); i++) - gen6_mfd_context->reference_surface[i].surface_id = gen6_mfd_context->reference_surface[i % 2].surface_id; + mpeg2_set_reference_surfaces( + ctx, + gen6_mfd_context->reference_surface, + decode_state, + pic_param + ); /* Current decoded picture */ obj_surface = SURFACE(decode_state->current_render_target); |