}
/* ------------------------------------------------------------------------- */
-/* --- MPEG-2 Decoded Picture Buffer --- */
+/* --- Decoded Picture Buffer (optimized for 2 reference pictures) --- */
/* ------------------------------------------------------------------------- */
-/* At most two reference pictures for MPEG-2 */
-#define MAX_MPEG2_REFERENCES 2
+/* At most two reference pictures for DPB2*/
+#define MAX_DPB2_REFERENCES 2
-G_DEFINE_TYPE(GstVaapiDpbMpeg2, gst_vaapi_dpb_mpeg2, GST_VAAPI_TYPE_DPB)
+G_DEFINE_TYPE(GstVaapiDpb2, gst_vaapi_dpb2, GST_VAAPI_TYPE_DPB)
static gboolean
-gst_vaapi_dpb_mpeg2_add(GstVaapiDpb *dpb, GstVaapiPicture *picture)
+gst_vaapi_dpb2_add(GstVaapiDpb *dpb, GstVaapiPicture *picture)
{
GstVaapiPicture *ref_picture;
gint index = -1;
- g_return_val_if_fail(GST_VAAPI_IS_DPB_MPEG2(dpb), FALSE);
+ g_return_val_if_fail(GST_VAAPI_IS_DPB2(dpb), FALSE);
/*
* Purpose: only store reference decoded pictures into the DPB
* - ... thus causing older reference pictures to be output, if not already
* - the oldest reference picture is replaced with the new reference picture
*/
- if (G_LIKELY(dpb->num_pictures == MAX_MPEG2_REFERENCES)) {
+ if (G_LIKELY(dpb->num_pictures == MAX_DPB2_REFERENCES)) {
index = (dpb->pictures[0]->poc > dpb->pictures[1]->poc);
ref_picture = dpb->pictures[index];
if (!GST_VAAPI_PICTURE_IS_OUTPUT(ref_picture)) {
}
static void
-gst_vaapi_dpb_mpeg2_init(GstVaapiDpbMpeg2 *dpb)
+gst_vaapi_dpb2_init(GstVaapiDpb2 *dpb)
{
}
static void
-gst_vaapi_dpb_mpeg2_class_init(GstVaapiDpbMpeg2Class *klass)
+gst_vaapi_dpb2_class_init(GstVaapiDpb2Class *klass)
{
GstVaapiDpbClass * const dpb_class = GST_VAAPI_DPB_CLASS(klass);
- dpb_class->add = gst_vaapi_dpb_mpeg2_add;
+ dpb_class->add = gst_vaapi_dpb2_add;
}
GstVaapiDpb *
-gst_vaapi_dpb_mpeg2_new(void)
+gst_vaapi_dpb2_new(void)
{
- return dpb_new(GST_VAAPI_TYPE_DPB_MPEG2, MAX_MPEG2_REFERENCES);
+ return dpb_new(GST_VAAPI_TYPE_DPB2, MAX_DPB2_REFERENCES);
}
void
-gst_vaapi_dpb_mpeg2_get_references(
+gst_vaapi_dpb2_get_references(
GstVaapiDpb *dpb,
GstVaapiPicture *picture,
GstVaapiPicture **prev_picture_ptr,
GstVaapiPicture **next_picture_ptr
)
{
- GstVaapiPicture *ref_picture, *ref_pictures[MAX_MPEG2_REFERENCES];
+ GstVaapiPicture *ref_picture, *ref_pictures[MAX_DPB2_REFERENCES];
GstVaapiPicture **picture_ptr;
guint i, index;
- g_return_if_fail(GST_VAAPI_IS_DPB_MPEG2(dpb));
+ g_return_if_fail(GST_VAAPI_IS_DPB2(dpb));
g_return_if_fail(GST_VAAPI_IS_PICTURE(picture));
ref_pictures[0] = NULL;
typedef struct _GstVaapiDpb GstVaapiDpb;
typedef struct _GstVaapiDpbClass GstVaapiDpbClass;
-typedef struct _GstVaapiDpbMpeg2 GstVaapiDpbMpeg2;
-typedef struct _GstVaapiDpbMpeg2Class GstVaapiDpbMpeg2Class;
+typedef struct _GstVaapiDpb2 GstVaapiDpb2;
+typedef struct _GstVaapiDpb2Class GstVaapiDpb2Class;
/* ------------------------------------------------------------------------- */
/* --- Base Decoded Picture Buffer --- */
}
/* ------------------------------------------------------------------------- */
-/* --- MPEG-2 Decoded Picture Buffer --- */
+/* --- Decoded Picture Buffer (optimized for 2 reference pictures) --- */
/* ------------------------------------------------------------------------- */
-#define GST_VAAPI_TYPE_DPB_MPEG2 \
- (gst_vaapi_dpb_mpeg2_get_type())
+#define GST_VAAPI_TYPE_DPB2 \
+ (gst_vaapi_dpb2_get_type())
-#define GST_VAAPI_DPB_MPEG2_CAST(obj) \
- ((GstVaapiDpbMpeg2 *)(obj))
+#define GST_VAAPI_DPB2_CAST(obj) \
+ ((GstVaapiDpb2 *)(obj))
-#define GST_VAAPI_DPB_MPEG2(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GST_VAAPI_TYPE_DPB_MPEG2, \
- GstVaapiDpbMpeg2))
+#define GST_VAAPI_DPB2(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ GST_VAAPI_TYPE_DPB2, \
+ GstVaapiDpb2))
-#define GST_VAAPI_DPB_MPEG2_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), \
- GST_VAAPI_TYPE_DPB_MPEG2, \
- GstVaapiDpbMpeg2Class))
+#define GST_VAAPI_DPB2_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
+ GST_VAAPI_TYPE_DPB2, \
+ GstVaapiDpb2Class))
-#define GST_VAAPI_IS_DPB_MPEG2(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_DPB_MPEG2))
+#define GST_VAAPI_IS_DPB2(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_DPB2))
-#define GST_VAAPI_IS_DPB_MPEG2_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_DPB_MPEG2))
+#define GST_VAAPI_IS_DPB2_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_DPB2))
-#define GST_VAAPI_DPB_MPEG2_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS((obj), \
- GST_VAAPI_TYPE_DPB_MPEG2, \
- GstVaapiDpbMpeg2Class))
+#define GST_VAAPI_DPB2_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
+ GST_VAAPI_TYPE_DPB2, \
+ GstVaapiDpb2Class))
/**
- * GstVaapiDpbMpeg2:
+ * GstVaapiDpb2:
*
- * A decoded picture buffer (DPB_MPEG2) object.
+ * A decoded picture buffer (DPB2) object.
*/
-struct _GstVaapiDpbMpeg2 {
+struct _GstVaapiDpb2 {
/*< private >*/
GstVaapiDpb parent_instance;
};
/**
- * GstVaapiDpbMpeg2Class:
+ * GstVaapiDpb2Class:
*
- * The #GstVaapiDpbMpeg2 base class.
+ * The #GstVaapiDpb2 base class.
*/
-struct _GstVaapiDpbMpeg2Class {
+struct _GstVaapiDpb2Class {
/*< private >*/
GstVaapiDpbClass parent_class;
};
G_GNUC_INTERNAL
GType
-gst_vaapi_dpb_mpeg2_get_type(void) G_GNUC_CONST;
+gst_vaapi_dpb2_get_type(void) G_GNUC_CONST;
G_GNUC_INTERNAL
GstVaapiDpb *
-gst_vaapi_dpb_mpeg2_new(void);
+gst_vaapi_dpb2_new(void);
G_GNUC_INTERNAL
void
-gst_vaapi_dpb_mpeg2_get_references(
+gst_vaapi_dpb2_get_references(
GstVaapiDpb *dpb,
GstVaapiPicture *picture,
GstVaapiPicture **prev_picture_ptr,