[xiph-commits] r16122 - branches/theora-thusnelda/tests

giles at svn.xiph.org giles at svn.xiph.org
Sun Jun 14 02:49:21 PDT 2009


Author: giles
Date: 2009-06-14 02:49:21 -0700 (Sun, 14 Jun 2009)
New Revision: 16122

Modified:
   branches/theora-thusnelda/tests/noop.c
   branches/theora-thusnelda/tests/noop_theora.c
Log:
Set a 16x16 frame size before calling th(eora)_encode_init in the noop tests.

Previously, we initialized a theora info structure and initialized an
encoder state from it. This no longer works; the info struct is initialized
to an empty frame, and 0x0 frame sizes aren't allowed by the spec.

There's no way to choose a default size, so the api now requires
setting a width and height explicitly. All other info fields will
be supplied with defaults.

Modified: branches/theora-thusnelda/tests/noop.c
===================================================================
--- branches/theora-thusnelda/tests/noop.c	2009-06-14 08:20:38 UTC (rev 16121)
+++ branches/theora-thusnelda/tests/noop.c	2009-06-14 09:49:21 UTC (rev 16122)
@@ -25,9 +25,18 @@
   th_info ti;
   th_enc_ctx *te;
 
-  INFO ("+ Initializing theora_info struct");
+  INFO ("+ Initializing th_info struct");
   th_info_init (&ti);
 
+  INFO ("+ Allocating encoder context with empty th_info");
+  te = th_encode_alloc(&ti);
+  if (te != NULL)
+    FAIL("td_encode_alloc accepted an unconfigured th_info");
+
+  INFO ("+ Setting 16x16 image size");
+  ti.frame_width = 16;
+  ti.frame_height = 16;
+
   INFO ("+ Allocating encoder context");
   te = th_encode_alloc(&ti);
   if (te == NULL)

Modified: branches/theora-thusnelda/tests/noop_theora.c
===================================================================
--- branches/theora-thusnelda/tests/noop_theora.c	2009-06-14 08:20:38 UTC (rev 16121)
+++ branches/theora-thusnelda/tests/noop_theora.c	2009-06-14 09:49:21 UTC (rev 16122)
@@ -28,6 +28,10 @@
   INFO ("+ Initializing theora_info struct");
   theora_info_init (&ti);
 
+  INFO ("+ Setting a 16x16 frame");
+  ti.width = 16;
+  ti.height = 16;
+
   INFO ("+ Initializing theora_state for encoding");
   if (theora_encode_init (&th, &ti) != OC_DISABLED) {
     INFO ("+ Clearing theora_state");



More information about the commits mailing list