summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeb Mukherjee <debargha@google.com>2014-04-04 14:38:29 -0700
committerDeb Mukherjee <debargha@google.com>2014-04-21 11:58:36 -0700
commit26210c672a075319aaf1dda40d95f1f0590c5bda (patch)
treef151a21dd2b0c708a315f1bedc4d3f9e5b217f50
parent79303c993ae09390b6e636943f2f44c545f41928 (diff)
downloadlibvpx-26210c672a075319aaf1dda40d95f1f0590c5bda.tar
libvpx-26210c672a075319aaf1dda40d95f1f0590c5bda.tar.gz
libvpx-26210c672a075319aaf1dda40d95f1f0590c5bda.tar.bz2
libvpx-26210c672a075319aaf1dda40d95f1f0590c5bda.zip
Adds test code for supplemental superframe data
Adds test code to verify that supplemental superframe information that precedes the normal superframe information will not break decoding. Change-Id: Ia252b887d7ee138f51dc9a778376ff739402c455
-rw-r--r--vp9/vp9_cx_iface.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 07617a4ca..fe0824c7a 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -628,7 +628,8 @@ static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx,
}
}
-
+// Turn on to test if supplemental superframe data breaks decoding
+// #define TEST_SUPPLEMENTAL_SUPERFRAME_DATA
static int write_superframe_index(vpx_codec_alg_priv_t *ctx) {
uint8_t marker = 0xc0;
unsigned int mask;
@@ -654,6 +655,20 @@ static int write_superframe_index(vpx_codec_alg_priv_t *ctx) {
if (ctx->pending_cx_data_sz + index_sz < ctx->cx_data_sz) {
uint8_t *x = ctx->pending_cx_data + ctx->pending_cx_data_sz;
int i, j;
+#ifdef TEST_SUPPLEMENTAL_SUPERFRAME_DATA
+ uint8_t marker_test = 0xc0;
+ int mag_test = 2; // 1 - 4
+ int frames_test = 4; // 1 - 8
+ int index_sz_test = 2 + mag_test * frames_test;
+ marker_test |= frames_test - 1;
+ marker_test |= (mag_test - 1) << 3;
+ *x++ = marker_test;
+ for (i = 0; i < mag_test * frames_test; ++i)
+ *x++ = 0; // fill up with arbitrary data
+ *x++ = marker_test;
+ ctx->pending_cx_data_sz += index_sz_test;
+ printf("Added supplemental superframe data\n");
+#endif
*x++ = marker;
for (i = 0; i < ctx->pending_frame_count; i++) {
@@ -666,6 +681,9 @@ static int write_superframe_index(vpx_codec_alg_priv_t *ctx) {
}
*x++ = marker;
ctx->pending_cx_data_sz += index_sz;
+#ifdef TEST_SUPPLEMENTAL_SUPERFRAME_DATA
+ index_sz += index_sz_test;
+#endif
}
return index_sz;
}