summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-10-16 16:52:04 +0200
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-11-16 16:50:30 +0100
commita9ce0ea8140dc8f924ac03e34bc17b3fa23750a5 (patch)
treea0cf5444ca5a3e179a7aef4ff45d4d11a51f262a
parent8c0cff131a6cf4fd1f7ffbb6eed3de22035628d1 (diff)
h264: add flag to compile with strict DPB ordering mode.
Allow build with strict DPB ordering mode whereby evicted entries are replaced by the next entries, in order instead of optimizing it away with the last entry in the DPB. This is only useful for debugging purpose, against a reference SW decoder for example.
-rw-r--r--gst-libs/gst/vaapi/gstvaapidecoder_h264.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
index 9dfd38d5..8785923d 100644
--- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
+++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c
@@ -37,6 +37,9 @@
#define DEBUG 1
#include "gstvaapidebug.h"
+/* Defined to 1 if strict ordering of DPB is needed. Only useful for debug */
+#define USE_STRICT_DPB_ORDERING 0
+
typedef struct _GstVaapiPictureH264 GstVaapiPictureH264;
typedef struct _GstVaapiPictureH264Class GstVaapiPictureH264Class;
typedef struct _GstVaapiSliceH264 GstVaapiSliceH264;
@@ -369,9 +372,13 @@ static void
dpb_remove_index(GstVaapiDecoderH264 *decoder, guint index)
{
GstVaapiDecoderH264Private * const priv = decoder->priv;
- guint num_pictures = --priv->dpb_count;
+ guint i, num_pictures = --priv->dpb_count;
- if (index != num_pictures)
+ if (USE_STRICT_DPB_ORDERING) {
+ for (i = index; i < num_pictures; i++)
+ gst_vaapi_picture_replace(&priv->dpb[i], priv->dpb[i + 1]);
+ }
+ else if (index != num_pictures)
gst_vaapi_picture_replace(&priv->dpb[index], priv->dpb[num_pictures]);
gst_vaapi_picture_replace(&priv->dpb[num_pictures], NULL);
}