From bf9f77b1afb0829b97e2d502057aec973c5fd7f5 Mon Sep 17 00:00:00 2001 From: Wind Yuan Date: Thu, 12 Apr 2012 11:48:24 +0200 Subject: [PATCH] mpeg4: fix VOP coding type of backward reference pictures. Signed-off-by: Gwenole Beauchesne --- gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c index bd089e2..9909db5 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c @@ -587,6 +587,12 @@ decode_picture(GstVaapiDecoderMpeg4 *decoder, const guint8 *buf, guint buf_size) return status; } +static inline guint +get_vop_coding_type(GstVaapiPicture *picture) +{ + return picture->type - GST_VAAPI_PICTURE_TYPE_I; +} + static gboolean fill_picture(GstVaapiDecoderMpeg4 *decoder, GstVaapiPicture *picture) { @@ -666,7 +672,7 @@ fill_picture(GstVaapiDecoderMpeg4 *decoder, GstVaapiPicture *picture) case GST_MPEG4_B_VOP: pic_param->TRB = priv->trb; pic_param->backward_reference_picture = priv->next_picture->surface_id; - pic_param->vop_fields.bits.backward_reference_vop_coding_type = priv->prev_picture->type; + pic_param->vop_fields.bits.backward_reference_vop_coding_type = get_vop_coding_type(priv->prev_picture); // fall-through case GST_MPEG4_P_VOP: pic_param->TRD = priv->trd; -- 2.7.4