mpeg4: fix VOP coding type of backward reference pictures.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
Wind Yuan 2012-04-12 11:48:24 +02:00 committed by Gwenole Beauchesne
parent 60b5c2da97
commit bf9f77b1af

View file

@ -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;