[FFmpeg-devel] [PATCH] VAAPI: Fix MPEG-4 decoding of video clips with B-frames

Gwenole Beauchesne gbeauchesne
Tue Apr 13 09:12:06 CEST 2010


Hi,

This patch fixes MPEG-4 decoding of video clips with B-frames. This  
works on NVIDIA HW but GMA500 seems to require this addition, which  
looks weird to me:

--- a/libavcodec/vaapi_mpeg4.c
+++ b/libavcodec/vaapi_mpeg4.c
@@ -91,9 +91,11 @@ static int vaapi_mpeg4_start_frame(AVCodecContext  
*avctx, av_unused const uint8_
      pic_param->TRB                                      = s->pb_time;
      pic_param->TRD                                      = s->pp_time;

-    if (s->pict_type == FF_B_TYPE)
-        pic_param->backward_reference_picture =  
ff_vaapi_get_surface_id(&s->next_picture);
-    if (s->pict_type != FF_I_TYPE)
+    if (s->pict_type == FF_B_TYPE) {
+        pic_param->forward_reference_picture  =  
ff_vaapi_get_surface_id(&s->next_picture);
+        pic_param->backward_reference_picture =  
ff_vaapi_get_surface_id(&s->last_picture);
+    }
+    else if (s->pict_type != FF_I_TYPE)
          pic_param->forward_reference_picture  =  
ff_vaapi_get_surface_id(&s->last_picture);

      /* Fill in VAIQMatrixBufferMPEG4 */

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.vaapi.mpeg4.bframes.patch
Type: application/octet-stream
Size: 4737 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100413/bf4377ca/attachment.obj>
-------------- next part --------------




More information about the ffmpeg-devel mailing list