[xiph-commits] r9814 - in branches/theora-mmx: . examples include/theora lib m4 tests

j at svn.xiph.org j at svn.xiph.org
Sat Aug 20 16:28:56 PDT 2005


Author: j
Date: 2005-08-20 16:28:37 -0700 (Sat, 20 Aug 2005)
New Revision: 9814

Added:
   branches/theora-mmx/lib/Version_script.in
   branches/theora-mmx/m4/
   branches/theora-mmx/m4/as-ac-expand.m4
   branches/theora-mmx/tests/
   branches/theora-mmx/tests/Makefile.am
   branches/theora-mmx/tests/comment-test.c
   branches/theora-mmx/tests/noop.c
   branches/theora-mmx/tests/tests.h
Removed:
   branches/theora-mmx/m4/as-ac-expand.m4
   branches/theora-mmx/tests/Makefile.am
   branches/theora-mmx/tests/comment-test.c
   branches/theora-mmx/tests/noop.c
   branches/theora-mmx/tests/tests.h
Modified:
   branches/theora-mmx/
   branches/theora-mmx/CHANGES
   branches/theora-mmx/COPYING
   branches/theora-mmx/Makefile.am
   branches/theora-mmx/README
   branches/theora-mmx/autogen.sh
   branches/theora-mmx/configure.ac
   branches/theora-mmx/examples/dump_video.c
   branches/theora-mmx/include/theora/theora.h
   branches/theora-mmx/lib/Makefile.am
   branches/theora-mmx/lib/codec_internal.h
   branches/theora-mmx/lib/dct_decode.c
   branches/theora-mmx/lib/decode.c
   branches/theora-mmx/lib/encoder_toplevel.c
   branches/theora-mmx/lib/frarray.c
   branches/theora-mmx/lib/idct.c
   branches/theora-mmx/lib/pb.c
   branches/theora-mmx/lib/quant.c
   branches/theora-mmx/lib/quant_lookup.h
   branches/theora-mmx/lib/toplevel.c
   branches/theora-mmx/libtheora.spec.in
Log:
merge changes from alpha5, this should be the last update to the theora-mmx branch


Property changes on: branches/theora-mmx
___________________________________________________________________
Name: branch-point
   - 9613
   + 9813

Modified: branches/theora-mmx/CHANGES
===================================================================
--- branches/theora-mmx/CHANGES	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/CHANGES	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,8 +1,21 @@
-libtheora 1.0alpha5 (unreleased)
+libtheora 1.0alph6 (unreleased)
 
+ * no changes yet
+
+libtheora 1.0alpha5 (2005 August 20)
+
  * Fixed bitrate management bugs that caused popping and encode
    errors
- * new theora_granule_shift() utility function
+ * Fixed a crash problem with the theora_state internals not
+   being intialized properly.
+ * new utility function:
+   - theora_granule_shift()
+ * dump_video example now makes YUV4MPEG files by default, so
+   the results can be fed back to encoder_example and similar
+   tools. The old behavior is restored through the '-r' switch.
+ * ./configure now prints a summary
+ * simple unit test of the comment api under 'make check'
+ * misc code cleanup, warning and leak fixes
 
 libtheora 1.0alpha4 (2004 December 15)
 

Modified: branches/theora-mmx/COPYING
===================================================================
--- branches/theora-mmx/COPYING	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/COPYING	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,4 +1,4 @@
-Copyright (C) 2002-2004 Xiph.org Foundation
+Copyright (C) 2002-2005 Xiph.org Foundation
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions

Modified: branches/theora-mmx/Makefile.am
===================================================================
--- branches/theora-mmx/Makefile.am	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/Makefile.am	2005-08-20 23:28:37 UTC (rev 9814)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign 1.6 dist-zip dist-bzip2
 
-SUBDIRS = lib include doc examples debian
+SUBDIRS = lib include doc examples debian tests
 
 EXTRA_DIST = COPYING autogen.sh win32 libtheora.spec libtheora.spec.in \
 	theora-uninstalled.pc.in

Modified: branches/theora-mmx/README
===================================================================
--- branches/theora-mmx/README	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/README	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------
-          The Xiph.org Foundation's libtheora 1.0alpha4 release
+          The Xiph.org Foundation's libtheora 1.0alpha5 release
 -------------------------------------------------------------------------
 
 *** What is Theora?
@@ -26,14 +26,13 @@
 
 Traditionally alpha mean proof of concept, not a production-ready 
 release. However the code is very robust, ready for and indeed
-in general use. But WE DO INTEND TO MAKE INCOMPATIBLE API changes 
-before stable beta release however, particularly on the encoding side.
+in general use. 
 
 The purpose of this release is to provide an updated testing base for 
 those interested in theora and to dissiminate more widely the changes
 we've made since the last alpha release. These include some helper
-utility functions, a draft format specification and rough api 
-documentation located in the doc directory.
+utility functions, a draft format specification and api documentation 
+located in the doc directory.
 
 -------------------------------------------------------------------------
 Getting started with the code

Modified: branches/theora-mmx/autogen.sh
===================================================================
--- branches/theora-mmx/autogen.sh	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/autogen.sh	2005-08-20 23:28:37 UTC (rev 9814)
@@ -22,6 +22,8 @@
 
 VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
 VERSIONMKINT="sed -e s/[^0-9]//"
+
+ACLOCAL_FLAGS="-I m4"
                                                                                 
 # do we need automake?
 if test -r Makefile.am; then

Modified: branches/theora-mmx/configure.ac
===================================================================
--- branches/theora-mmx/configure.ac	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/configure.ac	2005-08-20 23:28:37 UTC (rev 9814)
@@ -4,7 +4,7 @@
 dnl Initialization and Versioning
 dnl ------------------------------------------------
 
-AC_INIT(libtheora-mmx,[1.0alpha4])
+AC_INIT(libtheora-mmx,[1.0alpha5])
 
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
@@ -16,13 +16,16 @@
 
 dnl Library versioning
 
-V_LIB_CURRENT=1
+V_LIB_CURRENT=2
 V_LIB_REVISION=0
-V_LIB_AGE=1
+V_LIB_AGE=2
 AC_SUBST(V_LIB_CURRENT)
 AC_SUBST(V_LIB_REVISION)
 AC_SUBST(V_LIB_AGE)
 
+dnl Extra linker options (for version script)
+SHLIB_VERSION_ARG=""
+
 dnl --------------------------------------------------  
 dnl Check for programs
 dnl --------------------------------------------------  
@@ -36,6 +39,9 @@
 
 AM_PROG_LIBTOOL
 
+dnl Add parameters for aclocal
+AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
+
 dnl Check for doxygen
 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
 AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
@@ -47,6 +53,30 @@
 AC_CHECK_PROG(HAVE_PYTHON, python, true, false)
 AM_CONDITIONAL(HAVE_PYTHON,$HAVE_PYTHON)
 
+dnl Check for valgrind
+VALGRIND_ENVIRONMENT=""
+ac_enable_valgrind=no
+AC_ARG_ENABLE(valgrind-testing,
+     [  --enable-valgrind-testing     enable running of tests inside Valgrind ],     [ ac_enable_valgrind=yes ], [ ac_enable_valgrind=no] )
+
+if test "x${ac_enable_valgrind}" = xyes ; then
+  if test "x${enable_shared}" = xyes ; then
+    VALGRIND_ENVIRONMENT="libtool --mode=execute "
+  fi
+
+  AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no)
+  if test "x$HAVE_VALGRIND" = xyes ; then
+    VALGRIND_ENVIRONMENT="$VALGRIND_ENVIRONMENT valgrind -q --leak-check=yes --show-reachable=yes --num-callers=100"
+    AC_SUBST(VALGRIND_ENVIRONMENT)
+    TESTS_INFO="Type 'make check' to run test suite. Tests will be run under:
+  ${VALGRIND_ENVIRONMENT}"
+  else
+    TESTS_INFO="Type 'make check' to run test suite (Valgrind not found)"
+  fi
+else
+  TESTS_INFO="Type 'make check' to run test suite (Valgrind testing not enabled)"
+fi
+
 dnl --------------------------------------------------
 dnl Set build flags based on environment
 dnl --------------------------------------------------
@@ -74,6 +104,16 @@
 CFLAGS="$CFLAGS $cflags_save"
 LDFLAGS="$LDFLAGS $ldflags_save"
 
+dnl Set extra linker options
+case "$target_os" in
+	linux* | solaris* )
+		SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
+		;;
+	*)
+		;;
+esac
+AC_SUBST(SHLIB_VERSION_ARG)
+
 dnl --------------------------------------------------
 dnl Checks for support libraries and headers
 dnl --------------------------------------------------
@@ -102,7 +142,7 @@
   CFLAGS="$CFLAGS $OGG_CFLAGS"
   LIBS="$LIBS $OGG_LIBS"
   AC_CHECK_FUNC(oggpackB_read, , [
-    AC_MSG_ERROR([newer libogg version (>1.0) required])
+    AC_MSG_ERROR([newer libogg version (1.1 or later) required])
   ])
   CFLAGS=$cflags_save
   LIBS=$libs_save
@@ -224,7 +264,42 @@
   examples/Makefile
   doc/Makefile doc/Doxyfile
   debian/Makefile
+  tests/Makefile
+  lib/Version_script
   libtheora.spec
   theora.pc
   theora-uninstalled.pc
 ])
+
+AS_AC_EXPAND(LIBDIR, ${libdir})
+AS_AC_EXPAND(INCLUDEDIR, ${includedir})
+AS_AC_EXPAND(BINDIR, ${bindir})
+AS_AC_EXPAND(DOCDIR, ${datadir}/doc)
+
+AC_MSG_RESULT([
+------------------------------------------------------------------------
+  $PACKAGE $VERSION:  Automatic configuration OK.
+
+  General configuration:
+
+    Encoding support: ............ ${ac_enable_encode}
+    Floating point support: ...... ${ac_enable_float}
+
+  Installation paths:
+
+    libtheora: ................... ${LIBDIR}
+    C header files: .............. ${INCLUDEDIR}/theora
+    Documentation: ............... ${DOCDIR}/$PACKAGE
+
+  Building:
+
+    Type 'make' to compile $PACKAGE.
+
+    Type 'make install' to install $PACKAGE.
+
+    ${TESTS_INFO}
+
+  Example programs will be built but not installed.
+------------------------------------------------------------------------
+])
+

Modified: branches/theora-mmx/examples/dump_video.c
===================================================================
--- branches/theora-mmx/examples/dump_video.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/examples/dump_video.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -47,9 +47,10 @@
 
 
 
-const char *optstring = "o:";
+const char *optstring = "o:r";
 struct option options [] = {
   {"output",required_argument,NULL,'o'},
+  {"raw",no_argument, NULL, 'r'}, /* Disable YUV4MPEG2 headers if set */
   {NULL,0,NULL,0}
 };
 
@@ -79,6 +80,7 @@
 int          videobuf_ready=0;
 ogg_int64_t  videobuf_granulepos=-1;
 double       videobuf_time=0;
+int          raw = 0;
 
 FILE* outfile = NULL;
 
@@ -100,6 +102,8 @@
   yuv_buffer yuv;
   theora_decode_YUVout(&td,&yuv);
 
+  if(!raw)
+    fprintf(outfile, "FRAME\n");
   for(i=0;i<yuv.y_height;i++)
     fwrite(yuv.y+yuv.y_stride*i, 1, yuv.y_width, outfile);
   for(i=0;i<yuv.uv_height;i++)
@@ -174,6 +178,10 @@
       }
       break;
 
+      case 'r':
+      raw = 1;
+      break;
+
       default:
         usage();
     }
@@ -286,7 +294,8 @@
   if(theora_p){
     theora_decode_init(&td,&ti);
     fprintf(stderr,"Ogg logical stream %x is Theora %dx%d %.02f fps video\nEncoded frame content is %dx%d with %dx%d offset\n",
-            to.serialno,ti.width,ti.height, (double)ti.fps_numerator/ti.fps_denominator,
+            (unsigned int)to.serialno,ti.width,ti.height, 
+	    (double)ti.fps_numerator/ti.fps_denominator,
             ti.frame_width, ti.frame_height, ti.offset_x, ti.offset_y);
   }else{
     /* tear down the partial theora setup */
@@ -297,6 +306,11 @@
   /* open video */
   if(theora_p)open_video();
 
+  if(!raw)
+    fprintf(outfile, "YUV4MPEG2 W%d H%d F%d:%d I%c A%d:%d\n",
+          ti.width, ti.height, ti.fps_numerator, ti.fps_denominator, 'p', 
+          ti.aspect_numerator, ti.aspect_denominator);
+
   /* install signal handler */
   signal (SIGINT, sigint_handler);
 
@@ -346,7 +360,7 @@
 
     if(!videobuf_ready){
       /* no data yet for somebody.  Grab another page */
-      int ret=buffer_data(infile,&oy);
+      buffer_data(infile,&oy);
       while(ogg_sync_pageout(&oy,&og)>0){
         queue_page(&og);
       }

Modified: branches/theora-mmx/include/theora/theora.h
===================================================================
--- branches/theora-mmx/include/theora/theora.h	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/include/theora/theora.h	2005-08-20 23:28:37 UTC (rev 9814)
@@ -58,16 +58,16 @@
  * All samples are 8 bits.
  */
 typedef struct {
-    int   y_width;	/**< width of the Y' luminance plane */
-    int   y_height;	/**< height of the luminance plane */
-    int   y_stride;	/**< offset in bytes between successive rows */
+    int   y_width;	/**< Width of the Y' luminance plane */
+    int   y_height;	/**< Height of the luminance plane */
+    int   y_stride;	/**< Offset in bytes between successive rows */
 
-    int   uv_width;	/**< height of the Cb and Cr chroma planes */
-    int   uv_height;	/**< width of the chroma planes */
-    int   uv_stride;	/**< offset between successive chroma rows */
-    unsigned char *y;	/**< pointer to start of luminance data */
-    unsigned char *u;	/**< pointer to start of Cb data */
-    unsigned char *v;	/**< pointer to start of Cr data */
+    int   uv_width;	/**< Height of the Cb and Cr chroma planes */
+    int   uv_height;	/**< Width of the chroma planes */
+    int   uv_stride;	/**< Offset between successive chroma rows */
+    unsigned char *y;	/**< Pointer to start of luminance data */
+    unsigned char *u;	/**< Pointer to start of Cb data */
+    unsigned char *v;	/**< Pointer to start of Cr data */
 
 } yuv_buffer;
 
@@ -75,10 +75,10 @@
  * A Colorspace.
  */
 typedef enum {
-  OC_CS_UNSPECIFIED,	/**< the colorspace is unknown or unspecified */
-  OC_CS_ITU_REC_470M,	/**< best option for 'NTSC' content */
-  OC_CS_ITU_REC_470BG,	/**< best option for 'PAL' content */
-  OC_CS_NSPACES		/* mark the end of the defined colorspaces */
+  OC_CS_UNSPECIFIED,	/**< The colorspace is unknown or unspecified */
+  OC_CS_ITU_REC_470M,	/**< This is the best option for 'NTSC' content */
+  OC_CS_ITU_REC_470BG,	/**< This is the best option for 'PAL' content */
+  OC_CS_NSPACES		/**< This marks the end of the defined colorspaces */
 } theora_colorspace;
 
 /**
@@ -90,7 +90,7 @@
  */
 typedef enum {
   OC_PF_420,	/**< Chroma subsampling by 2 in each direction (4:2:0) */
-  OC_PF_RSVD,	/**< reserved value */
+  OC_PF_RSVD,	/**< Reserved value */
   OC_PF_422,	/**< Horizonatal chroma subsampling by 2 (4:2:2) */
   OC_PF_444,	/**< No chroma subsampling at all (4:4:4) */
 } theora_pixelformat;
@@ -128,8 +128,8 @@
   ogg_uint32_t  aspect_denominator;
   theora_colorspace colorspace;
   int           target_bitrate;
-  int           quality;  /**< nominal quality setting, 0-63 */
-  int           quick_p;  /**< quick encode/decode */
+  int           quality;  /**< Nominal quality setting, 0-63 */
+  int           quick_p;  /**< Quick encode/decode */
 
   /* decode only */
   unsigned char version_major;
@@ -185,26 +185,26 @@
  * for their length.
  */
 typedef struct theora_comment{
-  char **user_comments;		/**< an array of comment string vectors */
-  int   *comment_lengths;	/**< an array of corresponding string vector lengths in bytes */
-  int    comments;		/**< the total number of comment string vectors */
-  char  *vendor;		/**< the vendor string identifying the encoder, null terminated */
+  char **user_comments;		/**< An array of comment string vectors */
+  int   *comment_lengths;	/**< An array of corresponding string vector lengths in bytes */
+  int    comments;		/**< The total number of comment string vectors */
+  char  *vendor;		/**< The vendor string identifying the encoder, null terminated */
 
 } theora_comment;
 
-#define OC_FAULT       -1	/**< general failure */
-#define OC_EINVAL      -10	/**< library encountered invalid internal data */
-#define OC_DISABLED    -11	/**< requested action is disabled */
-#define OC_BADHEADER   -20	/**< header packet was corrupt/invalid */
-#define OC_NOTFORMAT   -21	/**< packet is not a theora packet */
-#define OC_VERSION     -22	/**< bitstream version is not handled */
-#define OC_IMPL        -23	/**< feature or action not implemented */
-#define OC_BADPACKET   -24	/**< packet is corrupt */
-#define OC_NEWPACKET   -25	/**< packet is an (ignorable) unhandled extension */
+#define OC_FAULT       -1	/**< General failure */
+#define OC_EINVAL      -10	/**< Library encountered invalid internal data */
+#define OC_DISABLED    -11	/**< Requested action is disabled */
+#define OC_BADHEADER   -20	/**< Header packet was corrupt/invalid */
+#define OC_NOTFORMAT   -21	/**< Packet is not a theora packet */
+#define OC_VERSION     -22	/**< Bitstream version is not handled */
+#define OC_IMPL        -23	/**< Feature or action not implemented */
+#define OC_BADPACKET   -24	/**< Packet is corrupt */
+#define OC_NEWPACKET   -25	/**< Packet is an (ignorable) unhandled extension */
 
 /** 
  * Retrieve a human-readable string to identify the encoder vendor and version.
- * \returns a version string.
+ * \returns A version string.
  */
 extern const char *theora_version_string(void);
 
@@ -215,7 +215,7 @@
 <pre>
    (VERSION_MAJOR<<16) + (VERSION_MINOR<<8) + (VERSION_SUB)
 </pre>
-* \returns the version number.
+* \returns The version number.
 */
 extern ogg_uint32_t theora_version_number(void);
 
@@ -223,9 +223,9 @@
  * Initialize the theora encoder.
  * \param th The theora_state handle to initialize for encoding.
  * \param ti A theora_info struct filled with the desired encoding parameters.
- * \returns 0 Success
+ * \retval 0 Success
  */
-extern int theora_encode_init(theora_state *th, theora_info *c);
+extern int theora_encode_init(theora_state *th, theora_info *ti);
 
 /**
  * Submit a YUV buffer to the theora encoder.
@@ -339,7 +339,7 @@
  * \param c  A theora_info struct filled with the desired decoding parameters.
  *           This is of course usually obtained from a previous call to
  *           theora_decode_header().
- * \returns 0 Success
+ * \retval 0 Success
  */
 extern int theora_decode_init(theora_state *th, theora_info *c);
 
@@ -380,7 +380,7 @@
  * \param op An ogg_packet containing encoded theora data.
  * \retval 1 The packet contains a keyframe image
  * \retval 0 The packet is contains an interframe delta
- * \retval -1 the packet is not an image data packet at all
+ * \retval -1 The packet is not an image data packet at all
  *
  * Thus function was added in the 1.0alpha4 release.
  */
@@ -409,7 +409,7 @@
  * \param ti A previously initialized theora_info struct
  * \returns The bit shift dividing the two granulepos fields
  *
- * This function was added inthe 1.0alpha5 release.
+ * This function was added in the 1.0alpha5 release.
  */
 int theora_granule_shift(theora_info *ti);
 
@@ -459,42 +459,72 @@
  */
 extern void theora_clear(theora_state *t);
 
-/** Initialize an allocated theora_comment structure */
+/**
+ * Initialize an allocated theora_comment structure
+ * \param tc An allocated theora_comment structure 
+ **/
 extern void theora_comment_init(theora_comment *tc);
-/** Add a comment to an initialized theora_comment structure
-    \param comment must be a null-terminated string encoding
-      the comment in "TAG=the value" form */
+
+/**
+ * Add a comment to an initialized theora_comment structure
+ * \param tc A previously initialized theora comment structure
+ * \param comment A null-terminated string encoding the comment in the form
+ *                "TAG=the value"
+ *
+ * Neither theora_comment_add() nor theora_comment_add_tag() support
+ * comments containing null values, although the bitstream format
+ * supports this. To add such comments you will need to manipulate
+ * the theora_comment structure directly.
+ **/
+
 extern void theora_comment_add(theora_comment *tc, char *comment);
-/** Add a comment to an initialized theora_comment structure
-    \param tag a null-terminated string containing the tag 
-      associated with the comment.
-    \param value the corresponding value as a null-terminated string
-    Neither theora_comment_add() nor theora_comment_add_tag() support
-    comments containing null values, although the bitstream format
-    supports this. To add such comments you will need to manipulate
-    the theora_comment structure directly */
+
+/**
+ * Add a comment to an initialized theora_comment structure.
+ * \param tc A previously initialized theora comment structure
+ * \param tag A null-terminated string containing the tag 
+ *            associated with the comment.
+ * \param value The corresponding value as a null-terminated string
+ *
+ * Neither theora_comment_add() nor theora_comment_add_tag() support
+ * comments containing null values, although the bitstream format
+ * supports this. To add such comments you will need to manipulate
+ * the theora_comment structure directly.
+ **/
 extern void theora_comment_add_tag(theora_comment *tc,
                                        char *tag, char *value);
-/** look up a comment value by tag
-    \param tc an initialized theora_comment structure
-    \param tag the tag to look up
-    \param count the instance of the tag. The same tag can appear 
-      multiple times, each with a distinct and ordered value, so
-      an index is required to retrieve them all.
-    Use theora_comment_query_count() to get the legal range for the
-    count parameter
-    \returns a pointer to the queried tag's value
-    \retval NULL if no matching tag is found */
+
+/**
+ * Look up a comment value by tag.
+ * \param tc Tn initialized theora_comment structure
+ * \param tag The tag to look up
+ * \param count The instance of the tag. The same tag can appear multiple
+ *              times, each with a distinct and ordered value, so an index
+ *              is required to retrieve them all.
+ * \returns A pointer to the queried tag's value
+ * \retval NULL No matching tag is found
+ *
+ * \note Use theora_comment_query_count() to get the legal range for the
+ * count parameter.
+ **/
+
 extern char *theora_comment_query(theora_comment *tc, char *tag, int count);
-/** look up the number of instances of a tag
-    \param tc an initialized theora_comment structure
-    \param tag the tag to look up
-    \returns the number on instances of a particular tag.
-    Call this first when querying for a specific tag and then interate
-    over the number of instances with separate calls to 
-    theora_comment_query() to retrieve all instances in order. */
+
+/** Look up the number of instances of a tag.
+ *  \param tc An initialized theora_comment structure
+ *  \param tag The tag to look up
+ *  \returns The number on instances of a particular tag.
+ * 
+ *  Call this first when querying for a specific tag and then interate
+ *  over the number of instances with separate calls to 
+ *  theora_comment_query() to retrieve all instances in order.
+ **/
 extern int   theora_comment_query_count(theora_comment *tc, char *tag);
-/** clears an allocated theora_comment struct so that it can be freed. */
+
+/**
+ * Clear an allocated theora_comment struct so that it can be freed.
+ * \param tc An allocated theora_comment structure.
+ **/
 extern void  theora_comment_clear(theora_comment *tc);
 
 #ifdef __cplusplus

Modified: branches/theora-mmx/lib/Makefile.am
===================================================================
--- branches/theora-mmx/lib/Makefile.am	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/Makefile.am	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,5 +1,7 @@
 INCLUDES = -I$(top_srcdir)/include
 
+EXTRA_DIST = Version_script.in
+
 lib_LTLIBRARIES = libtheora.la
 
 if THEORA_DISABLE_ENCODE
@@ -48,8 +50,8 @@
 	dsp.h
 
 libtheora_la_CFLAGS = $(OGG_CFLAGS)
-libtheora_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@
-libtheora_la_LIBS = $(OGG_LIBS)
+libtheora_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@ @SHLIB_VERSION_ARG@
+libtheora_la_LIBADD = $(OGG_LIBS)
 
 debug:
 	$(MAKE) all CFLAGS="@DEBUG@" LDFLAGS="-lefence"	

Copied: branches/theora-mmx/lib/Version_script.in (from rev 9813, trunk/theora/lib/Version_script.in)

Modified: branches/theora-mmx/lib/codec_internal.h
===================================================================
--- branches/theora-mmx/lib/codec_internal.h	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/codec_internal.h	2005-08-20 23:28:37 UTC (rev 9814)
@@ -269,10 +269,6 @@
   Q_LIST_ENTRY *qmats;
   qmat_range_table *range_table[6];
 
-  Q_LIST_ENTRY Y_coeffs[64];
-  Q_LIST_ENTRY UV_coeffs[64];
-  Q_LIST_ENTRY Inter_coeffs[64];
-
   HUFF_ENTRY *HuffRoot[NUM_HUFF_TABLES];
 
   unsigned char LoopFilterLimitValues[Q_TABLE_SIZE];
@@ -454,10 +450,19 @@
   ogg_uint32_t   QThreshTable[Q_TABLE_SIZE];
   Q_LIST_ENTRY   DcScaleFactorTable[Q_TABLE_SIZE];
   Q_LIST_ENTRY   Y_coeffs[64];
-  Q_LIST_ENTRY   UV_coeffs[64];
-  Q_LIST_ENTRY   Inter_coeffs[64];
-  Q_LIST_ENTRY  *dequant_InterUV_coeffs;
-  unsigned int   quant_index[64];
+  Q_LIST_ENTRY   U_coeffs[64];
+  Q_LIST_ENTRY   V_coeffs[64];
+  Q_LIST_ENTRY   InterY_coeffs[64];
+  Q_LIST_ENTRY   InterU_coeffs[64];
+  Q_LIST_ENTRY   InterV_coeffs[64];
+  Q_LIST_ENTRY  *dequant_Y_coeffs;
+  Q_LIST_ENTRY  *dequant_U_coeffs;
+  Q_LIST_ENTRY  *dequant_V_coeffs;
+  Q_LIST_ENTRY  *dequant_InterY_coeffs;
+  Q_LIST_ENTRY  *dequant_InterU_coeffs;
+  Q_LIST_ENTRY  *dequant_InterV_coeffs;
+  Q_LIST_ENTRY  *dequant_coeffs;	/* currently active quantizer */
+  unsigned int   zigzag_index[64];
   ogg_int32_t    quant_Y_coeffs[64];
   ogg_int32_t    quant_UV_coeffs[64];
   ogg_int32_t    fp_quant_Y_coeffs[64]; /* used in reiniting quantizers */
@@ -479,10 +484,6 @@
   ogg_int32_t   *fquant_coeffs;
   ogg_int32_t   *fquant_round;
   ogg_int32_t   *fquant_ZbSize;
-  Q_LIST_ENTRY  *dequant_Y_coeffs;
-  Q_LIST_ENTRY  *dequant_UV_coeffs;
-  Q_LIST_ENTRY  *dequant_Inter_coeffs;
-  Q_LIST_ENTRY  *dequant_coeffs;
 
   /* Predictor used in choosing entropy table for decoding block patterns. */
   unsigned char  BlockPatternPredictor;

Modified: branches/theora-mmx/lib/dct_decode.c
===================================================================
--- branches/theora-mmx/lib/dct_decode.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/dct_decode.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -121,9 +121,12 @@
   if ( FragmentNumber<(ogg_int32_t)pbi->YPlaneFragments ){
     ReconPixelsPerLine = pbi->YStride;
     pbi->dequant_coeffs = pbi->dequant_Y_coeffs;
+  }else if ( FragmentNumber<(ogg_int32_t)(pbi->YPlaneFragments + pbi->UVPlaneFragments) ){
+    ReconPixelsPerLine = pbi->UVStride;
+    pbi->dequant_coeffs = pbi->dequant_U_coeffs;
   }else{
     ReconPixelsPerLine = pbi->UVStride;
-    pbi->dequant_coeffs = pbi->dequant_UV_coeffs;
+    pbi->dequant_coeffs = pbi->dequant_V_coeffs;
   }
 
   /* Set up pointer into the quantisation buffer. */
@@ -185,7 +188,7 @@
     if ( pbi->CodingMode == CODE_INTRA )
       pbi->dequant_coeffs = pbi->dequant_Y_coeffs;
     else
-      pbi->dequant_coeffs = pbi->dequant_Inter_coeffs;
+      pbi->dequant_coeffs = pbi->dequant_InterY_coeffs;
   }else{
     ReconPixelsPerLine = pbi->UVStride;
     MvShift = 2;
@@ -193,9 +196,17 @@
 
     /* Select appropriate dequantiser matrix. */
     if ( pbi->CodingMode == CODE_INTRA )
-      pbi->dequant_coeffs = pbi->dequant_UV_coeffs;
+      if ( FragmentNumber < 
+		(ogg_int32_t)(pbi->YPlaneFragments + pbi->UVPlaneFragments) )
+        pbi->dequant_coeffs = pbi->dequant_U_coeffs;
+      else
+        pbi->dequant_coeffs = pbi->dequant_V_coeffs;
     else
-      pbi->dequant_coeffs = pbi->dequant_Inter_coeffs;
+      if ( FragmentNumber < 
+		(ogg_int32_t)(pbi->YPlaneFragments + pbi->UVPlaneFragments) )
+        pbi->dequant_coeffs = pbi->dequant_InterU_coeffs;
+      else
+        pbi->dequant_coeffs = pbi->dequant_InterV_coeffs;
   }
 
   /* Set up pointer into the quantisation buffer. */

Modified: branches/theora-mmx/lib/decode.c
===================================================================
--- branches/theora-mmx/lib/decode.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/decode.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -61,7 +61,8 @@
 
 static int LoadFrameHeader(PB_INSTANCE *pbi){
   long ret;
-  unsigned char  DctQIndex;
+  int NQIndex;
+  unsigned char  DctQIndex[3];
   unsigned char  SpareBits;       /* Spare cfg bits */
 
   /* Is the frame and inter frame or a key frame */
@@ -69,15 +70,25 @@
   pbi->FrameType = (unsigned char)ret;
 
   /* Quality (Q) index */
+  NQIndex = 0;
   theora_read(pbi->opb,6,&ret);
-  DctQIndex = (unsigned char)ret;
+  DctQIndex[NQIndex++] = (unsigned char)ret;
 
-  /* spare bit for possible additional Q indicies - should be 0 */
   theora_read(pbi->opb,1,&ret);
   SpareBits = (unsigned char)ret;
-  /* todo: properly handle additional Q indicies */
-  if (SpareBits != 0) return OC_IMPL;
+  if (SpareBits) {
+    theora_read(pbi->opb,6,&ret);
+    DctQIndex[NQIndex++] = (unsigned char)ret;
+    theora_read(pbi->opb,1,&ret);
+    SpareBits = (unsigned char)ret;
+    if (SpareBits) {
+      theora_read(pbi->opb,6,&ret);
+      DctQIndex[NQIndex++] = (unsigned char)ret;
+    }
+  }
 
+  if (NQIndex != 1) return OC_IMPL;
+
   if ( (pbi->FrameType == KEY_FRAME) ){
     /* Read the type / coding method for the key frame. */
     theora_read(pbi->opb,1,&ret);
@@ -90,7 +101,7 @@
   }
 
   /* Set this frame quality value and tables from the coded Q Index */
-  UpdateQ(pbi, DctQIndex);
+  UpdateQ(pbi, DctQIndex[0]);
 
   return 1;
 }

Modified: branches/theora-mmx/lib/encoder_toplevel.c
===================================================================
--- branches/theora-mmx/lib/encoder_toplevel.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/encoder_toplevel.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1190,6 +1190,7 @@
     ClearTmpBuffers(&cpi->pb);
     ClearPPInstance(&cpi->pp);
     
+    oggpackB_writeclear(cpi->oggbuffer);
     _ogg_free(cpi->oggbuffer);
     _ogg_free(cpi);
   }

Modified: branches/theora-mmx/lib/frarray.c
===================================================================
--- branches/theora-mmx/lib/frarray.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/frarray.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -19,6 +19,7 @@
 #include "codec_internal.h"
 #include "block_inline.h"
 
+/* Long run bit string coding */
 static ogg_uint32_t FrArrayCodeSBRun( CP_INSTANCE *cpi, ogg_uint32_t value ){
   ogg_uint32_t CodedVal = 0;
   ogg_uint32_t CodedBits = 0;
@@ -55,13 +56,15 @@
     CodedVal = 0x3F000 + (value - 34);
     CodedBits = 18;
   }
+  /* todo: handle value > 4129 extension */
 
   /* Add the bits to the encode holding buffer. */
-  oggpackB_write( cpi->oggbuffer, CodedVal, (ogg_uint32_t)CodedBits );
+  oggpackB_write( cpi->oggbuffer, CodedVal, CodedBits );
 
   return CodedBits;
 }
 
+/* Short run bit string coding */
 static ogg_uint32_t FrArrayCodeBlockRun( CP_INSTANCE *cpi,
                                          ogg_uint32_t value ) {
   ogg_uint32_t CodedVal = 0;
@@ -100,7 +103,7 @@
  }
 
   /* Add the bits to the encode holding buffer. */
-  oggpackB_write( cpi->oggbuffer, CodedVal, (ogg_uint32_t)CodedBits );
+  oggpackB_write( cpi->oggbuffer, CodedVal, CodedBits );
 
   return CodedBits;
 }
@@ -228,6 +231,7 @@
   pbi->bits_so_far = 0;
 }
 
+/* Short run bit string decoding */
 static int FrArrayDeCodeBlockRun(  PB_INSTANCE *pbi, ogg_uint32_t bit_value,
                             ogg_int32_t * run_value ){
   int  ret_val = 0;
@@ -296,6 +300,7 @@
   return ret_val;
 }
 
+/* Long run bit string decoding */
 static int FrArrayDeCodeSBRun (PB_INSTANCE *pbi, ogg_uint32_t bit_value,
                         ogg_int32_t * run_value ){
   int ret_val = 0;
@@ -373,6 +378,8 @@
     break;
   }
 
+  /* todo: handle additional bits for values over 4129 */
+
   return ret_val;
 }
 

Modified: branches/theora-mmx/lib/idct.c
===================================================================
--- branches/theora-mmx/lib/idct.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/idct.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -33,7 +33,7 @@
                    ogg_int32_t * DCT_block) {
   int i;
   for(i=0;i<64;i++)
-    DCT_block[dequant_index[i]] = quantized_list[i] * dequant_coeffs[i];
+    DCT_block[dezigzag_index[i]] = quantized_list[i] * dequant_coeffs[i];
 }
 
 void IDctSlow(  Q_LIST_ENTRY * InputData,
@@ -261,7 +261,7 @@
   int i;
   memset(DCT_block,0, 128);
   for(i=0;i<10;i++)
-    DCT_block[dequant_index[i]] = quantized_list[i] * dequant_coeffs[i];
+    DCT_block[dezigzag_index[i]] = quantized_list[i] * dequant_coeffs[i];
 
 }
 

Modified: branches/theora-mmx/lib/pb.c
===================================================================
--- branches/theora-mmx/lib/pb.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/pb.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -31,12 +31,16 @@
     _ogg_free(pbi->TmpReconBuffer);
   if(pbi->dequant_Y_coeffs)
     _ogg_free(pbi->dequant_Y_coeffs);
-  if(pbi->dequant_UV_coeffs)
-    _ogg_free(pbi->dequant_UV_coeffs);
-  if(pbi->dequant_Inter_coeffs)
-    _ogg_free(pbi->dequant_Inter_coeffs);
-  if(pbi->dequant_InterUV_coeffs)
-    _ogg_free(pbi->dequant_InterUV_coeffs);
+  if(pbi->dequant_U_coeffs)
+    _ogg_free(pbi->dequant_U_coeffs);
+  if(pbi->dequant_V_coeffs)
+    _ogg_free(pbi->dequant_V_coeffs);
+  if(pbi->dequant_InterY_coeffs)
+    _ogg_free(pbi->dequant_InterY_coeffs);
+  if(pbi->dequant_InterU_coeffs)
+    _ogg_free(pbi->dequant_InterU_coeffs);
+  if(pbi->dequant_InterV_coeffs)
+    _ogg_free(pbi->dequant_InterV_coeffs);
 
 
   pbi->ReconDataBuffer=0;
@@ -44,9 +48,11 @@
   pbi->TmpDataBuffer = 0;
   pbi->TmpReconBuffer = 0;
   pbi->dequant_Y_coeffs = 0;
-  pbi->dequant_UV_coeffs = 0;
-  pbi->dequant_InterUV_coeffs = 0;
-  pbi->dequant_Inter_coeffs = 0;
+  pbi->dequant_U_coeffs = 0;
+  pbi->dequant_V_coeffs = 0;
+  pbi->dequant_InterY_coeffs = 0;
+  pbi->dequant_InterU_coeffs = 0;
+  pbi->dequant_InterV_coeffs = 0;
 
 }
 
@@ -71,15 +77,21 @@
   pbi->dequant_Y_coeffs     =
     _ogg_malloc(64 * sizeof(*pbi->dequant_Y_coeffs));
 
-  pbi->dequant_UV_coeffs    =
-    _ogg_malloc(64 * sizeof(*pbi->dequant_UV_coeffs));
+  pbi->dequant_U_coeffs    =
+    _ogg_malloc(64 * sizeof(*pbi->dequant_U_coeffs));
 
-  pbi->dequant_Inter_coeffs =
-    _ogg_malloc(64 * sizeof(*pbi->dequant_Inter_coeffs));
+  pbi->dequant_V_coeffs    =
+    _ogg_malloc(64 * sizeof(*pbi->dequant_V_coeffs));
 
-  pbi->dequant_InterUV_coeffs =
-    _ogg_malloc(64 * sizeof(*pbi->dequant_InterUV_coeffs));
+  pbi->dequant_InterY_coeffs =
+    _ogg_malloc(64 * sizeof(*pbi->dequant_InterY_coeffs));
 
+  pbi->dequant_InterU_coeffs =
+    _ogg_malloc(64 * sizeof(*pbi->dequant_InterU_coeffs));
+
+  pbi->dequant_InterV_coeffs =
+    _ogg_malloc(64 * sizeof(*pbi->dequant_InterV_coeffs));
+
 }
 
 void ClearPBInstance(PB_INSTANCE *pbi){

Modified: branches/theora-mmx/lib/quant.c
===================================================================
--- branches/theora-mmx/lib/quant.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/quant.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -145,10 +145,10 @@
     oggpackB_write(opb, pbi->Y_coeffs[x],8);
   }
   for(x=0; x<64; x++) {
-    oggpackB_write(opb, pbi->UV_coeffs[x],8);
+    oggpackB_write(opb, pbi->U_coeffs[x],8);
   }
   for(x=0; x<64; x++) {
-    oggpackB_write(opb, pbi->Inter_coeffs[x],8);
+    oggpackB_write(opb, pbi->InterY_coeffs[x],8);
   }
   /* table mapping */
   oggpackB_write(opb, 0, 2);  /* matrix 0 for intra Y */
@@ -217,7 +217,6 @@
   }
   /* base matricies */
   theora_read(opb,9,&N); N++;
-  if(N!=3)return OC_BADHEADER; /* we only support the VP3 config */
   ci->qmats=_ogg_malloc(N*64*sizeof(Q_LIST_ENTRY));
   ci->MaxQMatrixIndex = N;
   for(y=0; y<N; y++) {
@@ -300,21 +299,32 @@
     }
   }
   
-  /* ignore the range table and reference the matricies we use */
-  memcpy(ci->Y_coeffs, &ci->qmats[0], sizeof(ci->Y_coeffs));
-  memcpy(ci->UV_coeffs, &ci->qmats[64], sizeof(ci->UV_coeffs));
-  memcpy(ci->Inter_coeffs, &ci->qmats[2*64], sizeof(ci->Inter_coeffs));
-
   return 0;
 }
 
 void CopyQTables(PB_INSTANCE *pbi, codec_setup_info *ci) {
+  Q_LIST_ENTRY *qmat;
+
   memcpy(pbi->QThreshTable, ci->QThreshTable, sizeof(pbi->QThreshTable));
   memcpy(pbi->DcScaleFactorTable, ci->DcScaleFactorTable,
          sizeof(pbi->DcScaleFactorTable));
-  memcpy(pbi->Y_coeffs, ci->Y_coeffs, sizeof(pbi->Y_coeffs));
-  memcpy(pbi->UV_coeffs, ci->UV_coeffs, sizeof(pbi->UV_coeffs));
-  memcpy(pbi->Inter_coeffs, ci->Inter_coeffs, sizeof(pbi->Inter_coeffs));
+
+  /* the decoder only supports 6 different base matricies; do the
+     best we can with the range table. We assume the first range
+     entry is good for all qi values. A NULL range table entry 
+     indicates we fall back to the previous value. */
+  qmat = ci->range_table[0]->qmat;
+  memcpy(pbi->Y_coeffs, qmat, sizeof(pbi->Y_coeffs));
+  if (ci->range_table[1]) qmat = ci->range_table[1]->qmat;
+  memcpy(pbi->U_coeffs, qmat, sizeof(pbi->U_coeffs));
+  if (ci->range_table[2]) qmat = ci->range_table[2]->qmat;
+  memcpy(pbi->V_coeffs, qmat, sizeof(pbi->V_coeffs));
+  if (ci->range_table[3]) qmat = ci->range_table[3]->qmat;
+  memcpy(pbi->InterY_coeffs, qmat, sizeof(pbi->InterY_coeffs));
+  if (ci->range_table[4]) qmat = ci->range_table[4]->qmat;
+  memcpy(pbi->InterU_coeffs, qmat, sizeof(pbi->InterU_coeffs));
+  if (ci->range_table[5]) qmat = ci->range_table[5]->qmat;
+  memcpy(pbi->InterV_coeffs, qmat, sizeof(pbi->InterV_coeffs));
 }
 
 /* Initialize custom qtables using the VP31 values.
@@ -325,17 +335,20 @@
   memcpy(pbi->DcScaleFactorTable, DcScaleFactorTableV1,
          sizeof(pbi->DcScaleFactorTable));
   memcpy(pbi->Y_coeffs, Y_coeffsV1, sizeof(pbi->Y_coeffs));
-  memcpy(pbi->UV_coeffs, UV_coeffsV1, sizeof(pbi->UV_coeffs));
-  memcpy(pbi->Inter_coeffs, Inter_coeffsV1, sizeof(pbi->Inter_coeffs));
+  memcpy(pbi->U_coeffs, UV_coeffsV1, sizeof(pbi->U_coeffs));
+  memcpy(pbi->V_coeffs, UV_coeffsV1, sizeof(pbi->V_coeffs));
+  memcpy(pbi->InterY_coeffs, Inter_coeffsV1, sizeof(pbi->InterY_coeffs));
+  memcpy(pbi->InterU_coeffs, Inter_coeffsV1, sizeof(pbi->InterU_coeffs));
+  memcpy(pbi->InterV_coeffs, Inter_coeffsV1, sizeof(pbi->InterV_coeffs));
 }
 
-static void BuildQuantIndex_Generic(PB_INSTANCE *pbi){
+static void BuildZigZagIndex(PB_INSTANCE *pbi){
   ogg_int32_t i,j;
 
-  /* invert the dequant index into the quant index */
+  /* invert the row to zigzag coeffient order lookup table */
   for ( i = 0; i < BLOCK_SIZE; i++ ){
-    j = dequant_index[i];
-    pbi->quant_index[j] = i;
+    j = dezigzag_index[i];
+    pbi->zigzag_index[j] = i;
   }
 }
 
@@ -355,7 +368,6 @@
     const Q_LIST_ENTRY * Y_coeffs;
     const Q_LIST_ENTRY * UV_coeffs;
     const Q_LIST_ENTRY * DcScaleFactorTable;
-    const Q_LIST_ENTRY * UVDcScaleFactorTable;
 
     /* Notes on setup of quantisers.  The initial multiplication by
      the scale factor is done in the ogg_int32_t domain to insure that the
@@ -368,7 +380,6 @@
     Y_coeffs = Y_coeffsV1;
     UV_coeffs = UV_coeffsV1;
     DcScaleFactorTable = DcScaleFactorTableV1;
-    UVDcScaleFactorTable = DcScaleFactorTableV1;
     ZBinFactor = 0.9;
 
     switch(cpi->pb.info.sharpness){
@@ -413,7 +424,7 @@
 
     /* Intra UV */
     temp_fp_quant_coeffs =
-      (((ogg_uint32_t)(UVDcScaleFactorTable[QIndex] * UV_coeffs[0])/100) << 2);
+      (((ogg_uint32_t)(DcScaleFactorTable[QIndex] * UV_coeffs[0])/100) << 2);
     if ( temp_fp_quant_coeffs < MIN_LEGAL_QUANT_ENTRY * 2)
       temp_fp_quant_coeffs = MIN_LEGAL_QUANT_ENTRY * 2;
 
@@ -443,7 +454,7 @@
 
     /* Inter UV */
     temp_fp_quant_coeffs =
-      (((ogg_uint32_t)(UVDcScaleFactorTable[QIndex] * Inter_coeffs[0])/100) << 2);
+      (((ogg_uint32_t)(DcScaleFactorTable[QIndex] * Inter_coeffs[0])/100) << 2);
     if ( temp_fp_quant_coeffs < MIN_LEGAL_QUANT_ENTRY * 4)
       temp_fp_quant_coeffs = MIN_LEGAL_QUANT_ENTRY * 4;
 
@@ -552,14 +563,14 @@
 void quantize( PB_INSTANCE *pbi,
                ogg_int16_t * DCT_block,
                Q_LIST_ENTRY * quantized_list){
-  ogg_uint32_t          i;              /*      Row index */
+  ogg_uint32_t  i;              /* Row index */
   Q_LIST_ENTRY  val;            /* Quantised value. */
 
   ogg_int32_t * FquantRoundPtr = pbi->fquant_round;
   ogg_int32_t * FquantCoeffsPtr = pbi->fquant_coeffs;
   ogg_int32_t * FquantZBinSizePtr = pbi->fquant_ZbSize;
   ogg_int16_t * DCT_blockPtr = DCT_block;
-  ogg_uint32_t * QIndexPtr = (ogg_uint32_t *)pbi->quant_index;
+  ogg_uint32_t * ZigZagPtr = (ogg_uint32_t *)pbi->zigzag_index;
   ogg_int32_t temp;
 
   /* Set the quantized_list to default to 0 */
@@ -571,12 +582,12 @@
     if ( DCT_blockPtr[0] >= FquantZBinSizePtr[0] ) {
       temp = FquantCoeffsPtr[0] * ( DCT_blockPtr[0] + FquantRoundPtr[0] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[0]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[0]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[0] <= -FquantZBinSizePtr[0] ) {
       temp = FquantCoeffsPtr[0] *
         ( DCT_blockPtr[0] - FquantRoundPtr[0] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[0]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[0]] = ( val < -511 ) ? -511 : val;
     }
 
     /* Column 1 */
@@ -584,12 +595,12 @@
       temp = FquantCoeffsPtr[1] *
         ( DCT_blockPtr[1] + FquantRoundPtr[1] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[1]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[1]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[1] <= -FquantZBinSizePtr[1] ) {
       temp = FquantCoeffsPtr[1] *
         ( DCT_blockPtr[1] - FquantRoundPtr[1] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[1]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[1]] = ( val < -511 ) ? -511 : val;
     }
 
     /* Column 2 */
@@ -597,12 +608,12 @@
       temp = FquantCoeffsPtr[2] *
         ( DCT_blockPtr[2] + FquantRoundPtr[2] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[2]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[2]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[2] <= -FquantZBinSizePtr[2] ) {
       temp = FquantCoeffsPtr[2] *
         ( DCT_blockPtr[2] - FquantRoundPtr[2] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[2]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[2]] = ( val < -511 ) ? -511 : val;
     }
 
     /* Column 3 */
@@ -610,12 +621,12 @@
       temp = FquantCoeffsPtr[3] *
         ( DCT_blockPtr[3] + FquantRoundPtr[3] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[3]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[3]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[3] <= -FquantZBinSizePtr[3] ) {
       temp = FquantCoeffsPtr[3] *
         ( DCT_blockPtr[3] - FquantRoundPtr[3] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[3]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[3]] = ( val < -511 ) ? -511 : val;
     }
 
     /* Column 4 */
@@ -623,12 +634,12 @@
       temp = FquantCoeffsPtr[4] *
         ( DCT_blockPtr[4] + FquantRoundPtr[4] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[4]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[4]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[4] <= -FquantZBinSizePtr[4] ) {
       temp = FquantCoeffsPtr[4] *
         ( DCT_blockPtr[4] - FquantRoundPtr[4] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[4]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[4]] = ( val < -511 ) ? -511 : val;
     }
 
     /* Column 5 */
@@ -636,12 +647,12 @@
       temp = FquantCoeffsPtr[5] *
         ( DCT_blockPtr[5] + FquantRoundPtr[5] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[5]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[5]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[5] <= -FquantZBinSizePtr[5] ) {
       temp = FquantCoeffsPtr[5] *
         ( DCT_blockPtr[5] - FquantRoundPtr[5] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[5]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[5]] = ( val < -511 ) ? -511 : val;
     }
 
     /* Column 6 */
@@ -649,12 +660,12 @@
       temp = FquantCoeffsPtr[6] *
         ( DCT_blockPtr[6] + FquantRoundPtr[6] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[6]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[6]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[6] <= -FquantZBinSizePtr[6] ) {
       temp = FquantCoeffsPtr[6] *
         ( DCT_blockPtr[6] - FquantRoundPtr[6] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[6]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[6]] = ( val < -511 ) ? -511 : val;
     }
 
     /* Column 7 */
@@ -662,19 +673,19 @@
       temp = FquantCoeffsPtr[7] *
         ( DCT_blockPtr[7] + FquantRoundPtr[7] ) ;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[7]] = ( val > 511 ) ? 511 : val;
+      quantized_list[ZigZagPtr[7]] = ( val > 511 ) ? 511 : val;
     } else if ( DCT_blockPtr[7] <= -FquantZBinSizePtr[7] ) {
       temp = FquantCoeffsPtr[7] *
         ( DCT_blockPtr[7] - FquantRoundPtr[7] ) + MIN16;
       val = (Q_LIST_ENTRY) (temp>>16);
-      quantized_list[QIndexPtr[7]] = ( val < -511 ) ? -511 : val;
+      quantized_list[ZigZagPtr[7]] = ( val < -511 ) ? -511 : val;
     }
 
     FquantRoundPtr += 8;
     FquantCoeffsPtr += 8;
     FquantZBinSizePtr += 8;
     DCT_blockPtr += 8;
-    QIndexPtr += 8;
+    ZigZagPtr += 8;
   }
 }
 
@@ -683,41 +694,53 @@
                         unsigned char  QIndex ){
   int i, j;
 
-  Q_LIST_ENTRY * Inter_coeffs;
+  Q_LIST_ENTRY * InterY_coeffs;
+  Q_LIST_ENTRY * InterU_coeffs;
+  Q_LIST_ENTRY * InterV_coeffs;
   Q_LIST_ENTRY * Y_coeffs;
-  Q_LIST_ENTRY * UV_coeffs;
+  Q_LIST_ENTRY * U_coeffs;
+  Q_LIST_ENTRY * V_coeffs;
   Q_LIST_ENTRY * DcScaleFactorTable;
-  Q_LIST_ENTRY * UVDcScaleFactorTable;
 
-  Inter_coeffs = pbi->Inter_coeffs;
+  InterY_coeffs = pbi->InterY_coeffs;
+  InterU_coeffs = pbi->InterU_coeffs;
+  InterV_coeffs = pbi->InterV_coeffs;
   Y_coeffs = pbi->Y_coeffs;
-  UV_coeffs = pbi->UV_coeffs;
+  U_coeffs = pbi->U_coeffs;
+  V_coeffs = pbi->V_coeffs;
   DcScaleFactorTable = pbi->DcScaleFactorTable;
-  UVDcScaleFactorTable = pbi->DcScaleFactorTable;
 
   /* invert the dequant index into the quant index
      the dxer has a different order than the cxer. */
-  BuildQuantIndex_Generic(pbi);
+  BuildZigZagIndex(pbi);
 
   /* Reorder dequantisation coefficients into dct zigzag order. */
   for ( i = 0; i < BLOCK_SIZE; i++ ) {
-    j = pbi->quant_index[i];
+    j = pbi->zigzag_index[i];
     pbi->dequant_Y_coeffs[j] = Y_coeffs[i];
   }
+  for ( i = 0; i < BLOCK_SIZE; i++ ) {
+    j = pbi->zigzag_index[i];
+    pbi->dequant_U_coeffs[j] = U_coeffs[i];
+  }
+  for ( i = 0; i < BLOCK_SIZE; i++ ) {
+    j = pbi->zigzag_index[i];
+    pbi->dequant_V_coeffs[j] = V_coeffs[i];
+  }
   for ( i = 0; i < BLOCK_SIZE; i++ ){
-    j = pbi->quant_index[i];
-    pbi->dequant_Inter_coeffs[j] = Inter_coeffs[i];
+    j = pbi->zigzag_index[i];
+    pbi->dequant_InterY_coeffs[j] = InterY_coeffs[i];
   }
   for ( i = 0; i < BLOCK_SIZE; i++ ){
-    j = pbi->quant_index[i];
-    pbi->dequant_UV_coeffs[j] = UV_coeffs[i];
+    j = pbi->zigzag_index[i];
+    pbi->dequant_InterU_coeffs[j] = InterU_coeffs[i];
   }
   for ( i = 0; i < BLOCK_SIZE; i++ ){
-    j = pbi->quant_index[i];
-    pbi->dequant_InterUV_coeffs[j] = Inter_coeffs[i];
+    j = pbi->zigzag_index[i];
+    pbi->dequant_InterV_coeffs[j] = InterV_coeffs[i];
   }
 
-  /* Intra Y */
+  /* Intra Y DC coeff */
   pbi->dequant_Y_coeffs[0] =
     ((DcScaleFactorTable[QIndex] * pbi->dequant_Y_coeffs[0])/100);
   if ( pbi->dequant_Y_coeffs[0] < MIN_DEQUANT_VAL * 2 )
@@ -726,30 +749,42 @@
     pbi->dequant_Y_coeffs[0] << IDCT_SCALE_FACTOR;
 
   /* Intra UV */
-  pbi->dequant_UV_coeffs[0] =
-    ((UVDcScaleFactorTable[QIndex] * pbi->dequant_UV_coeffs[0])/100);
-  if ( pbi->dequant_UV_coeffs[0] < MIN_DEQUANT_VAL * 2 )
-    pbi->dequant_UV_coeffs[0] = MIN_DEQUANT_VAL * 2;
-  pbi->dequant_UV_coeffs[0] =
-    pbi->dequant_UV_coeffs[0] << IDCT_SCALE_FACTOR;
+  pbi->dequant_U_coeffs[0] =
+    ((DcScaleFactorTable[QIndex] * pbi->dequant_U_coeffs[0])/100);
+  if ( pbi->dequant_U_coeffs[0] < MIN_DEQUANT_VAL * 2 )
+    pbi->dequant_U_coeffs[0] = MIN_DEQUANT_VAL * 2;
+  pbi->dequant_U_coeffs[0] =
+    pbi->dequant_U_coeffs[0] << IDCT_SCALE_FACTOR;
+  pbi->dequant_V_coeffs[0] =
+    ((DcScaleFactorTable[QIndex] * pbi->dequant_V_coeffs[0])/100);
+  if ( pbi->dequant_V_coeffs[0] < MIN_DEQUANT_VAL * 2 )
+    pbi->dequant_V_coeffs[0] = MIN_DEQUANT_VAL * 2;
+  pbi->dequant_V_coeffs[0] =
+    pbi->dequant_V_coeffs[0] << IDCT_SCALE_FACTOR;
 
-  /* Inter Y */
-  pbi->dequant_Inter_coeffs[0] =
-    ((DcScaleFactorTable[QIndex] * pbi->dequant_Inter_coeffs[0])/100);
-  if ( pbi->dequant_Inter_coeffs[0] < MIN_DEQUANT_VAL * 4 )
-    pbi->dequant_Inter_coeffs[0] = MIN_DEQUANT_VAL * 4;
-  pbi->dequant_Inter_coeffs[0] =
-    pbi->dequant_Inter_coeffs[0] << IDCT_SCALE_FACTOR;
+  /* Inter Y DC coeff */
+  pbi->dequant_InterY_coeffs[0] =
+    ((DcScaleFactorTable[QIndex] * pbi->dequant_InterY_coeffs[0])/100);
+  if ( pbi->dequant_InterY_coeffs[0] < MIN_DEQUANT_VAL * 4 )
+    pbi->dequant_InterY_coeffs[0] = MIN_DEQUANT_VAL * 4;
+  pbi->dequant_InterY_coeffs[0] =
+    pbi->dequant_InterY_coeffs[0] << IDCT_SCALE_FACTOR;
 
   /* Inter UV */
-  pbi->dequant_InterUV_coeffs[0] =
-    ((UVDcScaleFactorTable[QIndex] * pbi->dequant_InterUV_coeffs[0])/100);
-  if ( pbi->dequant_InterUV_coeffs[0] < MIN_DEQUANT_VAL * 4 )
-    pbi->dequant_InterUV_coeffs[0] = MIN_DEQUANT_VAL * 4;
-  pbi->dequant_InterUV_coeffs[0] =
-    pbi->dequant_InterUV_coeffs[0] << IDCT_SCALE_FACTOR;
+  pbi->dequant_InterU_coeffs[0] =
+    ((DcScaleFactorTable[QIndex] * pbi->dequant_InterU_coeffs[0])/100);
+  if ( pbi->dequant_InterU_coeffs[0] < MIN_DEQUANT_VAL * 4 )
+    pbi->dequant_InterU_coeffs[0] = MIN_DEQUANT_VAL * 4;
+  pbi->dequant_InterU_coeffs[0] =
+    pbi->dequant_InterU_coeffs[0] << IDCT_SCALE_FACTOR;
+  pbi->dequant_InterV_coeffs[0] =
+    ((DcScaleFactorTable[QIndex] * pbi->dequant_InterV_coeffs[0])/100);
+  if ( pbi->dequant_InterV_coeffs[0] < MIN_DEQUANT_VAL * 4 )
+    pbi->dequant_InterV_coeffs[0] = MIN_DEQUANT_VAL * 4;
+  pbi->dequant_InterV_coeffs[0] =
+    pbi->dequant_InterV_coeffs[0] << IDCT_SCALE_FACTOR;
 
-  for ( i = 1; i < 64; i++ ){
+  for ( i = 1; i < BLOCK_SIZE; i++ ){
     /* now scale coefficients by required compression factor */
     pbi->dequant_Y_coeffs[i] =
       (( scale_factor * pbi->dequant_Y_coeffs[i] ) / 100);
@@ -758,26 +793,40 @@
     pbi->dequant_Y_coeffs[i] =
       pbi->dequant_Y_coeffs[i] << IDCT_SCALE_FACTOR;
 
-    pbi->dequant_UV_coeffs[i] =
-      (( scale_factor * pbi->dequant_UV_coeffs[i] ) / 100);
-    if ( pbi->dequant_UV_coeffs[i] < MIN_DEQUANT_VAL )
-      pbi->dequant_UV_coeffs[i] = MIN_DEQUANT_VAL;
-    pbi->dequant_UV_coeffs[i] =
-      pbi->dequant_UV_coeffs[i] << IDCT_SCALE_FACTOR;
+    pbi->dequant_U_coeffs[i] =
+      (( scale_factor * pbi->dequant_U_coeffs[i] ) / 100);
+    if ( pbi->dequant_U_coeffs[i] < MIN_DEQUANT_VAL )
+      pbi->dequant_U_coeffs[i] = MIN_DEQUANT_VAL;
+    pbi->dequant_U_coeffs[i] =
+      pbi->dequant_U_coeffs[i] << IDCT_SCALE_FACTOR;
 
-    pbi->dequant_Inter_coeffs[i] =
-      (( scale_factor * pbi->dequant_Inter_coeffs[i] ) / 100);
-    if ( pbi->dequant_Inter_coeffs[i] < (MIN_DEQUANT_VAL * 2) )
-      pbi->dequant_Inter_coeffs[i] = MIN_DEQUANT_VAL * 2;
-    pbi->dequant_Inter_coeffs[i] =
-      pbi->dequant_Inter_coeffs[i] << IDCT_SCALE_FACTOR;
+    pbi->dequant_V_coeffs[i] =
+      (( scale_factor * pbi->dequant_V_coeffs[i] ) / 100);
+    if ( pbi->dequant_V_coeffs[i] < MIN_DEQUANT_VAL )
+      pbi->dequant_V_coeffs[i] = MIN_DEQUANT_VAL;
+    pbi->dequant_V_coeffs[i] =
+      pbi->dequant_V_coeffs[i] << IDCT_SCALE_FACTOR;
 
-    pbi->dequant_InterUV_coeffs[i] =
-      (( scale_factor * pbi->dequant_InterUV_coeffs[i] ) / 100);
-    if ( pbi->dequant_InterUV_coeffs[i] < (MIN_DEQUANT_VAL * 2) )
-      pbi->dequant_InterUV_coeffs[i] = MIN_DEQUANT_VAL * 2;
-    pbi->dequant_InterUV_coeffs[i] =
-      pbi->dequant_InterUV_coeffs[i] << IDCT_SCALE_FACTOR;
+    pbi->dequant_InterY_coeffs[i] =
+      (( scale_factor * pbi->dequant_InterY_coeffs[i] ) / 100);
+    if ( pbi->dequant_InterY_coeffs[i] < (MIN_DEQUANT_VAL * 2) )
+      pbi->dequant_InterY_coeffs[i] = MIN_DEQUANT_VAL * 2;
+    pbi->dequant_InterY_coeffs[i] =
+      pbi->dequant_InterY_coeffs[i] << IDCT_SCALE_FACTOR;
+
+    pbi->dequant_InterU_coeffs[i] =
+      (( scale_factor * pbi->dequant_InterU_coeffs[i] ) / 100);
+    if ( pbi->dequant_InterU_coeffs[i] < (MIN_DEQUANT_VAL * 2) )
+      pbi->dequant_InterU_coeffs[i] = MIN_DEQUANT_VAL * 2;
+    pbi->dequant_InterU_coeffs[i] =
+      pbi->dequant_InterU_coeffs[i] << IDCT_SCALE_FACTOR;
+
+    pbi->dequant_InterV_coeffs[i] =
+      (( scale_factor * pbi->dequant_InterV_coeffs[i] ) / 100);
+    if ( pbi->dequant_InterV_coeffs[i] < (MIN_DEQUANT_VAL * 2) )
+      pbi->dequant_InterV_coeffs[i] = MIN_DEQUANT_VAL * 2;
+    pbi->dequant_InterV_coeffs[i] =
+      pbi->dequant_InterV_coeffs[i] << IDCT_SCALE_FACTOR;
   }
 
   pbi->dequant_coeffs = pbi->dequant_Y_coeffs;
@@ -818,7 +867,7 @@
     pbi->FrameQIndex --;
   }
 
-  /* Re-initialise the q tables for forward and reverse transforms. */
+  /* Re-initialise the Q tables for forward and reverse transforms. */
   init_quantizer ( cpi, qscale, (unsigned char) pbi->FrameQIndex );
   init_dequantizer ( pbi, qscale, (unsigned char) pbi->FrameQIndex );
 }

Modified: branches/theora-mmx/lib/quant_lookup.h
===================================================================
--- branches/theora-mmx/lib/quant_lookup.h	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/quant_lookup.h	2005-08-20 23:28:37 UTC (rev 9814)
@@ -25,7 +25,8 @@
 #define IDCT_SCALE_FACTOR     2 /* Shift left bits to improve IDCT precision */
 #define OLD_SCHEME            1
 
-static const ogg_uint32_t dequant_index[64] = {
+/* lookup table for DCT coefficient zig-zag ordering */
+static const ogg_uint32_t dezigzag_index[64] = {
   0,  1,  8,  16,  9,  2,  3, 10,
   17, 24, 32, 25, 18, 11,  4,  5,
   12, 19, 26, 33, 40, 48, 41, 34,

Modified: branches/theora-mmx/lib/toplevel.c
===================================================================
--- branches/theora-mmx/lib/toplevel.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/lib/toplevel.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -319,7 +319,7 @@
   /* Clear down the YUVtoRGB conversion skipped list. */
   memset(pbi->skipped_display_fragments, 0, pbi->UnitFragments );
 
-  /* Initialise version specific quantiser and in-loop filter values */
+  /* Initialise quantiser and in-loop filter */
   CopyQTables(pbi, ci);
   CopyFilterTables(pbi, ci);
 

Modified: branches/theora-mmx/libtheora.spec.in
===================================================================
--- branches/theora-mmx/libtheora.spec.in	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/libtheora.spec.in	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,6 +1,6 @@
 Name:		libtheora
 Version:	@VERSION@
-Release:	0.xiph.0.4.alpha4
+Release:	0.xiph.0.4.alpha5
 Summary:	The Theora Video Compression Codec.
 
 Group:		System Environment/Libraries
@@ -17,7 +17,7 @@
 # this needs to be explicit since vorbis's .so versioning didn't get bumped
 # when going from 1.0 to 1.0.1
 Requires:       libvorbis >= 1:1.0.1
-                                                                                
+
 %description
 Theora is Xiph.Org's first publicly released video codec, intended
 for use within the Ogg's project's Ogg multimedia streaming system.
@@ -25,7 +25,7 @@
 nearly identical, varying only in encapsulating decoder tables in the
 bitstream headers, but Theora will make use of this extra freedom
 in the future to improve over what is possible with VP3.
-                                                                                
+
 %package devel
 Summary:        Development tools for Theora applications.
 Group:          Development/Libraries
@@ -76,3 +76,5 @@
 %changelog
 * Thu Jun 10 2004 Thomas Vander Stichele <thomas at apestaart dot org>
 - transported fedora.us spec file
+* Sat Aug 20 2005 Ralph Giles <giles at xiph.org>
+- updated version for 1.0alpha5 release

Copied: branches/theora-mmx/m4 (from rev 9813, trunk/theora/m4)

Deleted: branches/theora-mmx/m4/as-ac-expand.m4
===================================================================
--- trunk/theora/m4/as-ac-expand.m4	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/m4/as-ac-expand.m4	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,43 +0,0 @@
-dnl as-ac-expand.m4 0.2.0
-dnl autostars m4 macro for expanding directories using configure's prefix
-dnl thomas at apestaart.org
-
-dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
-dnl example
-dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
-dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
-
-AC_DEFUN([AS_AC_EXPAND],
-[
-  EXP_VAR=[$1]
-  FROM_VAR=[$2]
-
-  dnl first expand prefix and exec_prefix if necessary
-  prefix_save=$prefix
-  exec_prefix_save=$exec_prefix
-
-  dnl if no prefix given, then use /usr/local, the default prefix
-  if test "x$prefix" = "xNONE"; then
-    prefix="$ac_default_prefix"
-  fi
-  dnl if no exec_prefix given, then use prefix
-  if test "x$exec_prefix" = "xNONE"; then
-    exec_prefix=$prefix
-  fi
-
-  full_var="$FROM_VAR"
-  dnl loop until it doesn't change anymore
-  while true; do
-    new_full_var="`eval echo $full_var`"
-    if test "x$new_full_var" = "x$full_var"; then break; fi
-    full_var=$new_full_var
-  done
-
-  dnl clean up
-  full_var=$new_full_var
-  AC_SUBST([$1], "$full_var")
-
-  dnl restore prefix and exec_prefix
-  prefix=$prefix_save
-  exec_prefix=$exec_prefix_save
-])

Copied: branches/theora-mmx/m4/as-ac-expand.m4 (from rev 9813, trunk/theora/m4/as-ac-expand.m4)

Copied: branches/theora-mmx/tests (from rev 9813, trunk/theora/tests)

Deleted: branches/theora-mmx/tests/Makefile.am
===================================================================
--- trunk/theora/tests/Makefile.am	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/tests/Makefile.am	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,20 +0,0 @@
-INCLUDES = -I$(top_srcdir)/include
-
-noinst_HEADERS = tests.h
-
-THEORADIR = ../lib
-THEORA_LIBS = $(THEORADIR)/libtheora.la $(OGG_LIBS)
-
-test: check
-
-TESTS_ENVIRONMENT = $(VALGRIND_ENVIRONMENT)
-
-TESTS = noop comment-test
-
-noinst_PROGRAMS = $(TESTS)
-
-noop_SOURCES = noop.c
-noop_LDADD = $(THEORA_LIBS)
-
-comment_test_SOURCES = comment-test.c
-comment_test_LDADD = $(THEORA_LIBS)

Copied: branches/theora-mmx/tests/Makefile.am (from rev 9813, trunk/theora/tests/Makefile.am)

Deleted: branches/theora-mmx/tests/comment-test.c
===================================================================
--- trunk/theora/tests/comment-test.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/tests/comment-test.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,72 +0,0 @@
-#include <theora/theora.h>
-
-#include <string.h>
-#include "tests.h"
-
-#define ARTIST1 "Bug-eyed Fish"
-#define ARTIST2 "VJ Fugu"
-#define COPYRIGHT "Copyright (C) 2005. Some Rights Reserved."
-#define LICENSE "Creative Commons Attribution-ShareAlike 2.5"
-
-static int
-test_comments ()
-{
-  theora_comment tc;
-  int i, n;
-  char * value;
-
-  INFO ("+ Initializing theora_comment");
-  theora_comment_init (&tc);
-
-  INFO ("+ Adding ARTIST1");
-  theora_comment_add (&tc, "ARTIST=" ARTIST1);
-
-  INFO ("+ Adding LICENSE by tag");
-  theora_comment_add_tag (&tc, "LICENSE", LICENSE);
-
-  INFO ("+ Adding ARTIST2 by tag");
-  theora_comment_add_tag (&tc, "ARTIST", ARTIST2);
-
-  INFO ("+ Querying value of LICENSE");
-  value = theora_comment_query (&tc, "LICENSE", 0);
-  if (strcmp (value, LICENSE))
-    FAIL ("Incorrect value for LICENSE");
-
-  INFO ("+ Querying count of ARTIST comments");
-  n = theora_comment_query_count (&tc, "ARTIST");
-
-  if (n != 2)
-    FAIL ("Incorrect count of ARTIST comments");
-
-  INFO ("+ Querying value of ARTIST index 0");
-  value = theora_comment_query (&tc, "ARTIST", 0);
-  if (strcmp (value, ARTIST1))
-    FAIL ("Incorrect value for ARTIST index 0");
-
-  INFO ("+ Querying value of ARTIST index 1");
-  value = theora_comment_query (&tc, "ARTIST", 1);
-  if (strcmp (value, ARTIST2))
-    FAIL ("Incorrect value for ARTIST index 1");
-
-  INFO ("+ Querying value of ARTIST index 2 (out of bounds)");
-  value = theora_comment_query (&tc, "ARTIST", 2);
-  if (value != NULL)
-    FAIL ("Non-NULL value for ARTIST index 2 (out of bounds)");
-
-  INFO ("+ Querying value of UNDEF index 7 (tag not defined)");
-  value = theora_comment_query (&tc, "UNDEF", 7);
-  if (value != NULL)
-    FAIL ("Non-NULL value for UNDEF index 7 (tag not defined)");
-
-  INFO ("+ Clearing theora_comment");
-  theora_comment_clear (&tc);
-
-  return 0;
-}
-
-int main(int argc, char *argv[])
-{
-  test_comments ();
-
-  exit (0);
-}

Copied: branches/theora-mmx/tests/comment-test.c (from rev 9813, trunk/theora/tests/comment-test.c)

Deleted: branches/theora-mmx/tests/noop.c
===================================================================
--- trunk/theora/tests/noop.c	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/tests/noop.c	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,67 +0,0 @@
-#include <theora/theora.h>
-
-#include "tests.h"
-
-static int
-noop_test_encode ()
-{
-  theora_info ti;
-  theora_state th;
-
-  INFO ("+ Initializing theora_info struct");
-  theora_info_init (&ti);
-
-  INFO ("+ Initializing theora_state for encoding");
-  if (theora_encode_init (&th, &ti) != OC_DISABLED) {
-    INFO ("+ Clearing theora_state");
-    theora_clear (&th);
-  }
-
-  INFO ("+ Clearing theora_info struct");
-  theora_info_clear (&ti);
-
-  return 0;
-}
-
-static int
-noop_test_decode ()
-{
-  theora_info ti;
-  theora_state th;
-
-  INFO ("+ Initializing theora_info struct");
-  theora_info_init (&ti);
-
-  INFO ("+ Initializing theora_state for decoding");
-  theora_decode_init (&th, &ti);
-
-  INFO ("+ Clearing theora_state");
-  theora_clear (&th);
-
-  INFO ("+ Clearing theora_info struct");
-  theora_info_clear (&ti);
-
-  return 0;
-}
-
-static int
-noop_test_comments ()
-{
-  theora_comment tc;
-
-  theora_comment_init (&tc);
-  theora_comment_clear (&tc);
-
-  return 0;
-}
-
-int main(int argc, char *argv[])
-{
-  /*noop_test_decode ();*/
-
-  noop_test_encode ();
-
-  noop_test_comments ();
-
-  exit (0);
-}

Copied: branches/theora-mmx/tests/noop.c (from rev 9813, trunk/theora/tests/noop.c)

Deleted: branches/theora-mmx/tests/tests.h
===================================================================
--- trunk/theora/tests/tests.h	2005-08-20 22:40:38 UTC (rev 9813)
+++ branches/theora-mmx/tests/tests.h	2005-08-20 23:28:37 UTC (rev 9814)
@@ -1,16 +0,0 @@
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define INFO(str) \
-  { printf ("----  %s ...\n", (str)); }
-
-#define WARN(str) \
-  { printf ("%s:%d: warning: %s\n", __FILE__, __LINE__, (str)); }
-
-#define FAIL(str) \
-  { printf ("%s:%d: %s\n", __FILE__, __LINE__, (str)); exit(1); }
-
-#undef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))

Copied: branches/theora-mmx/tests/tests.h (from rev 9813, trunk/theora/tests/tests.h)



More information about the commits mailing list