decoder: h264: add initial support for repeat-first-field (RFF) flag.

Use the SEI pic_timing() message to track and propagate down the repeat
first field (RFF) flag. This is only initial support as there is one
other condition that could induce the RFF flag, which is not handled
yet.
This commit is contained in:
Gwenole Beauchesne 2014-11-13 15:13:24 +01:00
parent a4048a9d6b
commit 8f71f74c5d
4 changed files with 15 additions and 3 deletions

View file

@ -2932,10 +2932,15 @@ init_picture(
base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD;
break;
case GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP:
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_RFF);
// fall-through
case GST_H264_SEI_PIC_STRUCT_TOP_BOTTOM:
if (GST_VAAPI_PICTURE_IS_FIRST_FIELD(picture))
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_TFF);
break;
case GST_H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM:
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_RFF);
break;
}
picture->structure = base_picture->structure;

View file

@ -114,7 +114,7 @@ gst_vaapi_picture_create (GstVaapiPicture * picture,
GST_VAAPI_PICTURE_FLAG_REFERENCE |
GST_VAAPI_PICTURE_FLAG_INTERLACED |
GST_VAAPI_PICTURE_FLAG_FF | GST_VAAPI_PICTURE_FLAG_TFF |
GST_VAAPI_PICTURE_FLAG_MVC));
GST_VAAPI_PICTURE_FLAG_RFF | GST_VAAPI_PICTURE_FLAG_MVC));
picture->structure = parent_picture->structure;
if ((args->flags & GST_VAAPI_CREATE_PICTURE_FLAG_FIELD) &&
@ -342,6 +342,8 @@ do_output (GstVaapiPicture * picture)
flags |= GST_VAAPI_SURFACE_PROXY_FLAG_INTERLACED;
if (GST_VAAPI_PICTURE_IS_TFF (picture))
flags |= GST_VAAPI_SURFACE_PROXY_FLAG_TFF;
if (GST_VAAPI_PICTURE_IS_RFF (picture))
flags |= GST_VAAPI_SURFACE_PROXY_FLAG_RFF;
if (GST_VAAPI_PICTURE_IS_ONEFIELD (picture))
flags |= GST_VAAPI_SURFACE_PROXY_FLAG_ONEFIELD;
}

View file

@ -67,6 +67,7 @@ typedef enum
* @GST_VAAPI_PICTURE_FLAG_TFF: top-field-first
* @GST_VAAPI_PICTURE_FLAG_ONEFIELD: only one field is valid
* @GST_VAAPI_PICTURE_FLAG_MVC: multiview component
* @GST_VAAPI_PICTURE_FLAG_RFF: repeat-first-field
* @GST_VAAPI_PICTURE_FLAG_LAST: first flag that can be used by subclasses
*
* Enum values used for #GstVaapiPicture flags.
@ -81,7 +82,8 @@ typedef enum
GST_VAAPI_PICTURE_FLAG_TFF = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 5),
GST_VAAPI_PICTURE_FLAG_ONEFIELD = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 6),
GST_VAAPI_PICTURE_FLAG_MVC = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 7),
GST_VAAPI_PICTURE_FLAG_LAST = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 8),
GST_VAAPI_PICTURE_FLAG_RFF = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 8),
GST_VAAPI_PICTURE_FLAG_LAST = (GST_VAAPI_CODEC_OBJECT_FLAG_LAST << 9),
} GstVaapiPictureFlags;
#define GST_VAAPI_PICTURE_FLAGS GST_VAAPI_MINI_OBJECT_FLAGS
@ -107,6 +109,9 @@ typedef enum
#define GST_VAAPI_PICTURE_IS_TFF(picture) \
GST_VAAPI_PICTURE_FLAG_IS_SET (picture, GST_VAAPI_PICTURE_FLAG_TFF)
#define GST_VAAPI_PICTURE_IS_RFF(picture) \
GST_VAAPI_PICTURE_FLAG_IS_SET (picture, GST_VAAPI_PICTURE_FLAG_RFF)
#define GST_VAAPI_PICTURE_IS_ONEFIELD(picture) \
GST_VAAPI_PICTURE_FLAG_IS_SET (picture, GST_VAAPI_PICTURE_FLAG_ONEFIELD)

View file

@ -34,7 +34,7 @@ G_BEGIN_DECLS
* GstVaapiSurfaceProxyFlags:
* @GST_VAAPI_SURFACE_PROXY_FLAG_INTERLACED: interlaced frame
* @GST_VAAPI_SURFACE_PROXY_FLAG_TFF: top-field-first
* @GST_VAAPI_SURFACE_PROXY_FLAG_RFF: repeat-field-first
* @GST_VAAPI_SURFACE_PROXY_FLAG_RFF: repeat-first-field
* @GST_VAAPI_SURFACE_PROXY_FLAG_ONEFIELD: only one field is available
* @GST_VAAPI_SURFACE_PROXY_FLAG_FFB: first frame in bundle, e.g. the first
* view component of a MultiView Coded (MVC) frame