[xiph-commits] r9815 - in branches/theora-oil: . examples include/theora lib

j at svn.xiph.org j at svn.xiph.org
Sat Aug 20 16:36:31 PDT 2005


Author: j
Date: 2005-08-20 16:36:24 -0700 (Sat, 20 Aug 2005)
New Revision: 9815

Modified:
   branches/theora-oil/
   branches/theora-oil/CHANGES
   branches/theora-oil/COPYING
   branches/theora-oil/README
   branches/theora-oil/configure.ac
   branches/theora-oil/examples/dump_video.c
   branches/theora-oil/include/theora/theora.h
   branches/theora-oil/lib/decode.c
   branches/theora-oil/lib/frarray.c
   branches/theora-oil/lib/quant.c
   branches/theora-oil/libtheora.spec.in
Log:
merge changes from trunk to theora-oil


Property changes on: branches/theora-oil
___________________________________________________________________
Name: branch-point
   + 9814

Modified: branches/theora-oil/CHANGES
===================================================================
--- branches/theora-oil/CHANGES	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/CHANGES	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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-oil/COPYING
===================================================================
--- branches/theora-oil/COPYING	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/COPYING	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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-oil/README
===================================================================
--- branches/theora-oil/README	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/README	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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-oil/configure.ac
===================================================================
--- branches/theora-oil/configure.ac	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/configure.ac	2005-08-20 23:36:24 UTC (rev 9815)
@@ -4,7 +4,7 @@
 dnl Initialization and Versioning
 dnl ------------------------------------------------
 
-AC_INIT(libtheora,[1.0alpha4])
+AC_INIT(libtheora,[1.0alpha6-svn])
 
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
@@ -16,9 +16,9 @@
 
 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)
@@ -142,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

Modified: branches/theora-oil/examples/dump_video.c
===================================================================
--- branches/theora-oil/examples/dump_video.c	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/examples/dump_video.c	2005-08-20 23:36:24 UTC (rev 9815)
@@ -47,10 +47,10 @@
 
 
 
-const char *optstring = "or:";
+const char *optstring = "o:r";
 struct option options [] = {
   {"output",required_argument,NULL,'o'},
-  {"raw",required_argument, NULL, 'r'}, /* Disable YUV4MPEG2 headers if set */
+  {"raw",no_argument, NULL, 'r'}, /* Disable YUV4MPEG2 headers if set */
   {NULL,0,NULL,0}
 };
 
@@ -177,12 +177,9 @@
         exit(1);
       }
       break;
-      case 'r':
-      if(sscanf(optarg, "%u", &raw) != 1) {
-          fprintf(stderr, "Invalid option, assuming YUV4MPEG4 output\n");
-          raw = 0;
-      }
 
+      case 'r':
+      raw = 1;
       break;
 
       default:
@@ -297,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 */
@@ -362,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-oil/include/theora/theora.h
===================================================================
--- branches/theora-oil/include/theora/theora.h	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/include/theora/theora.h	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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);
 

Modified: branches/theora-oil/lib/decode.c
===================================================================
--- branches/theora-oil/lib/decode.c	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/lib/decode.c	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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-oil/lib/frarray.c
===================================================================
--- branches/theora-oil/lib/frarray.c	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/lib/frarray.c	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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-oil/lib/quant.c
===================================================================
--- branches/theora-oil/lib/quant.c	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/lib/quant.c	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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++) {
@@ -310,11 +309,10 @@
   memcpy(pbi->DcScaleFactorTable, ci->DcScaleFactorTable,
          sizeof(pbi->DcScaleFactorTable));
 
-  /* the decoder only supports 3 different base matricies; do the
+  /* the decoder only supports 6 different base matricies; do the
      best we can with the range table. We assume the first range
-     entry for Intra U is also good for V, and that the first 
-     Inter Y is good for all the Inter channels. A NULL range 
-     table entry indicates we fall back to the previous value. */
+     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;

Modified: branches/theora-oil/libtheora.spec.in
===================================================================
--- branches/theora-oil/libtheora.spec.in	2005-08-20 23:28:37 UTC (rev 9814)
+++ branches/theora-oil/libtheora.spec.in	2005-08-20 23:36:24 UTC (rev 9815)
@@ -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



More information about the commits mailing list