[xiph-commits] r14201 - in branches/theora-thusnelda/lib: . enc

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Tue Nov 20 07:58:19 PST 2007


Author: xiphmont
Date: 2007-11-20 07:58:19 -0800 (Tue, 20 Nov 2007)
New Revision: 14201

Removed:
   branches/theora-thusnelda/lib/enc/pb.c
Modified:
   branches/theora-thusnelda/lib/Makefile.am
   branches/theora-thusnelda/lib/enc/codec_internal.h
   branches/theora-thusnelda/lib/enc/dct_decode.c
   branches/theora-thusnelda/lib/enc/dsp.c
   branches/theora-thusnelda/lib/enc/encoder_quant.c
   branches/theora-thusnelda/lib/enc/encoder_toplevel.c
Log:
More dead/dying code put out of our misery



Modified: branches/theora-thusnelda/lib/Makefile.am
===================================================================
--- branches/theora-thusnelda/lib/Makefile.am	2007-11-20 14:36:55 UTC (rev 14200)
+++ branches/theora-thusnelda/lib/Makefile.am	2007-11-20 15:58:19 UTC (rev 14201)
@@ -40,7 +40,6 @@
 	enc/frarray.c \
 	enc/frinit.c \
 	enc/mcomp.c \
-	enc/pb.c \
 	enc/reconstruct.c \
 	enc/dsp.c
 

Modified: branches/theora-thusnelda/lib/enc/codec_internal.h
===================================================================
--- branches/theora-thusnelda/lib/enc/codec_internal.h	2007-11-20 14:36:55 UTC (rev 14200)
+++ branches/theora-thusnelda/lib/enc/codec_internal.h	2007-11-20 15:58:19 UTC (rev 14201)
@@ -146,7 +146,6 @@
 
 /** Decoder (Playback) instance -- installed in a theora_state */
 typedef struct PB_INSTANCE {
-  oggpack_buffer *opb;
   theora_info     info;
   
   /* flag to indicate if the headers already have been written */
@@ -255,9 +254,6 @@
   MOTION_VECTOR  MVector;
   ogg_int32_t    ReconPtr2Offset;       /* Offset for second reconstruction
                                            in half pixel MC */
-  ogg_int16_t   *quantized_list;
-  ogg_int16_t   *ReconDataBuffer;
-
   ogg_uint32_t   DcHuffChoice;          /* Huffman table selection variables */
   unsigned char  ACHuffChoice;
 
@@ -277,7 +273,6 @@
   ogg_int16_t    dequant_InterU_coeffs[64];
   ogg_int16_t    dequant_InterV_coeffs[64]; 
 
-  ogg_int16_t   *dequant_coeffs;        /* currently active quantizer */
   unsigned int   zigzag_index[64];
 
   HUFF_ENTRY    *HuffRoot_VP3x[NUM_HUFF_TABLES];

Modified: branches/theora-thusnelda/lib/enc/dct_decode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dct_decode.c	2007-11-20 14:36:55 UTC (rev 14200)
+++ branches/theora-thusnelda/lib/enc/dct_decode.c	2007-11-20 15:58:19 UTC (rev 14201)
@@ -71,100 +71,73 @@
 }
 
 static void ExpandBlock ( PB_INSTANCE *pbi, ogg_int32_t FragmentNumber){
-  unsigned char *LastFrameRecPtr;   /* Pointer into previous frame
-                                       reconstruction. */
-  unsigned char *LastFrameRecPtr2;  /* Pointer into previous frame
-                                       reconstruction for 1/2 pixel MC. */
-
   ogg_uint32_t   ReconPixelsPerLine; /* Pixels per line */
   ogg_int32_t    ReconPixelIndex;    /* Offset for block into a
                                         reconstruction buffer */
-  ogg_int32_t    ReconPtr2Offset;    /* Offset for second
-                                        reconstruction in half pixel
-                                        MC */
-  ogg_int32_t    MVOffset;           /* Baseline motion vector offset */
-  ogg_int32_t    MvShift  ;          /* Shift to correct to 1/2 or 1/4 pixel */
-  ogg_int32_t    MvModMask;          /* Mask to determine whether 1/2
-                                        pixel is used */
+  ogg_int16_t    reconstruct[64];
+  ogg_int16_t    *quantizers;
+  ogg_int16_t    *data = &pbi->QFragData[FragmentNumber][0];
 
-  /* Get coding mode for this block */
-  if ( pbi->FrameType == KEY_FRAME ){
-    pbi->CodingMode = CODE_INTRA;
-  }else{
-    /* Get Motion vector and mode for this block. */
-    pbi->CodingMode = pbi->FragCodingMethod[FragmentNumber];
-  }
+  int            mode = pbi->FragCodingMethod[FragmentNumber];
 
   /* Select the appropriate inverse Q matrix and line stride */
-  if ( FragmentNumber<(ogg_int32_t)pbi->YPlaneFragments ) {
+  if ( FragmentNumber<pbi->YPlaneFragments ) {
     ReconPixelsPerLine = pbi->YStride;
-    MvShift = 1;
-    MvModMask = 0x00000001;
-
-    /* Select appropriate dequantiser matrix. */
-    if ( pbi->CodingMode == CODE_INTRA )
-      pbi->dequant_coeffs = pbi->dequant_Y_coeffs;
+    if ( mode == CODE_INTRA )
+      quantizers = pbi->dequant_Y_coeffs;
     else
-      pbi->dequant_coeffs = pbi->dequant_InterY_coeffs;
+      quantizers = pbi->dequant_InterY_coeffs;
+
   }else{
     ReconPixelsPerLine = pbi->UVStride;
-    MvShift = 2;
-    MvModMask = 0x00000003;
-
-    /* Select appropriate dequantiser matrix. */
-    if ( pbi->CodingMode == CODE_INTRA )
-      if ( FragmentNumber < 
-                (ogg_int32_t)(pbi->YPlaneFragments + pbi->UVPlaneFragments) )
-        pbi->dequant_coeffs = pbi->dequant_U_coeffs;
+    if ( mode == CODE_INTRA )
+      if ( FragmentNumber < pbi->YPlaneFragments + pbi->UVPlaneFragments )
+        quantizers = pbi->dequant_U_coeffs;
       else
-        pbi->dequant_coeffs = pbi->dequant_V_coeffs;
+        quantizers = pbi->dequant_V_coeffs;
     else
-      if ( FragmentNumber < 
-                (ogg_int32_t)(pbi->YPlaneFragments + pbi->UVPlaneFragments) )
-        pbi->dequant_coeffs = pbi->dequant_InterU_coeffs;
+      if ( FragmentNumber < pbi->YPlaneFragments + pbi->UVPlaneFragments )
+        quantizers = pbi->dequant_InterU_coeffs;
       else
-        pbi->dequant_coeffs = pbi->dequant_InterV_coeffs;
+        quantizers = pbi->dequant_InterV_coeffs;
   }
 
-  /* Set up pointer into the quantisation buffer. */
-  pbi->quantized_list = &pbi->QFragData[FragmentNumber][0];
-
 #ifdef _TH_DEBUG_
  {
    int i;
    for(i=0;i<64;i++)
      pbi->QFragFREQ[FragmentNumber][dezigzag_index[i]]= 
-       pbi->quantized_list[i] * pbi->dequant_coeffs[i];
+       pbi->quantized_list[i] * quantizers[i];
  }
 #endif
 
   /* Invert quantisation and DCT to get pixel data. */
   switch(pbi->FragCoefEOB[FragmentNumber]){
   case 0:case 1:
-    IDct1( pbi->quantized_list, pbi->dequant_coeffs, pbi->ReconDataBuffer );
+    IDct1( data, quantizers, reconstruct );
     break;
   case 2: case 3:
-    dsp_IDct3(pbi->dsp, pbi->quantized_list, pbi->dequant_coeffs, pbi->ReconDataBuffer );
+    dsp_IDct3(pbi->dsp, data, quantizers, reconstruct );
     break;
   case 4:case 5:case 6:case 7:case 8: case 9:case 10:
-    dsp_IDct10(pbi->dsp, pbi->quantized_list, pbi->dequant_coeffs, pbi->ReconDataBuffer );
+    dsp_IDct10(pbi->dsp, data, quantizers, reconstruct );
     break;
   default:
-    dsp_IDctSlow(pbi->dsp, pbi->quantized_list, pbi->dequant_coeffs, pbi->ReconDataBuffer );
+    dsp_IDctSlow(pbi->dsp, data, quantizers, reconstruct );
   }
 
 #ifdef _TH_DEBUG_
  {
    int i;
    for(i=0;i<64;i++)
-     pbi->QFragTIME[FragmentNumber][i]= pbi->ReconDataBuffer[i];
+     pbi->QFragTIME[FragmentNumber][i]= reconstruct[i];
  }
 #endif
 
   /* Convert fragment number to a pixel offset in a reconstruction buffer. */
   ReconPixelIndex = pbi->recon_pixel_index_table[FragmentNumber];
   dsp_recon8x8 (pbi->dsp, &pbi->ThisFrameRecon[ReconPixelIndex],
-		pbi->ReconDataBuffer, ReconPixelsPerLine);
+		reconstruct, ReconPixelsPerLine);
 
 }
 

Modified: branches/theora-thusnelda/lib/enc/dsp.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dsp.c	2007-11-20 14:36:55 UTC (rev 14200)
+++ branches/theora-thusnelda/lib/enc/dsp.c	2007-11-20 15:58:19 UTC (rev 14201)
@@ -16,6 +16,7 @@
  ********************************************************************/
 
 #include <stdlib.h>
+#include <string.h>
 #include "codec_internal.h"
 
 #define DSP_OP_AVG(a,b) ((((int)(a)) + ((int)(b)))/2)
@@ -24,8 +25,6 @@
 
 static void set8x8__c (unsigned char val, unsigned char *ptr,
 		       ogg_uint32_t PixelsPerLine){
-  int i;
-  
   /* For each block row */
   memset(ptr,val,8);
   ptr+=PixelsPerLine;

Modified: branches/theora-thusnelda/lib/enc/encoder_quant.c
===================================================================
--- branches/theora-thusnelda/lib/enc/encoder_quant.c	2007-11-20 14:36:55 UTC (rev 14200)
+++ branches/theora-thusnelda/lib/enc/encoder_quant.c	2007-11-20 15:58:19 UTC (rev 14201)
@@ -588,8 +588,6 @@
     j = pbi->zigzag_index[i];
     pbi->dequant_InterV_coeffs[j] = InterV_coeffs[i];
   }
-
-  pbi->dequant_coeffs = pbi->dequant_Y_coeffs;
 }
 
 void UpdateQ( PB_INSTANCE *pbi, int NewQIndex ){

Modified: branches/theora-thusnelda/lib/enc/encoder_toplevel.c
===================================================================
--- branches/theora-thusnelda/lib/enc/encoder_toplevel.c	2007-11-20 14:36:55 UTC (rev 14200)
+++ branches/theora-thusnelda/lib/enc/encoder_toplevel.c	2007-11-20 15:58:19 UTC (rev 14201)
@@ -466,8 +466,6 @@
   c->version_minor=TH_VERSION_MINOR;
   c->version_subminor=TH_VERSION_SUB;
 
-  InitTmpBuffers(&cpi->pb);
-
   /* Initialise Configuration structure to legal values */
   if(c->quality>63)c->quality=63;
   if(c->quality<0)c->quality=32;
@@ -857,7 +855,6 @@
     ClearFrameInfo(&cpi->pb);
     EClearFragmentInfo(cpi);
     EClearFrameInfo(cpi);
-    ClearTmpBuffers(&cpi->pb);
 
     oggpackB_writeclear(cpi->oggbuffer);
     _ogg_free(cpi->oggbuffer);

Deleted: branches/theora-thusnelda/lib/enc/pb.c
===================================================================
--- branches/theora-thusnelda/lib/enc/pb.c	2007-11-20 14:36:55 UTC (rev 14200)
+++ branches/theora-thusnelda/lib/enc/pb.c	2007-11-20 15:58:19 UTC (rev 14201)
@@ -1,61 +0,0 @@
-/********************************************************************
- *                                                                  *
- * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE.   *
- * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
- * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
- * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
- *                                                                  *
- * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007                *
- * by the Xiph.Org Foundation http://www.xiph.org/                  *
- *                                                                  *
- ********************************************************************
-
-  function:
-  last mod: $Id$
-
- ********************************************************************/
-
-#include <stdlib.h>
-#include <string.h>
-#include "codec_internal.h"
-
-void ClearTmpBuffers(PB_INSTANCE * pbi){
-
-  if(pbi->ReconDataBuffer)
-    _ogg_free(pbi->ReconDataBuffer);
-
-  pbi->ReconDataBuffer=0;
-}
-
-void InitTmpBuffers(PB_INSTANCE * pbi){
-
-  /* clear any existing info */
-  ClearTmpBuffers(pbi);
-
-  /* Adjust the position of all of our temporary */
-  pbi->ReconDataBuffer      =
-    _ogg_malloc(64*sizeof(*pbi->ReconDataBuffer));
-}
-
-void ClearPBInstance(PB_INSTANCE *pbi){
-  if(pbi){
-    ClearTmpBuffers(pbi);
-    if (pbi->opb) {
-      _ogg_free(pbi->opb);
-    }
-  }
-}
-
-void InitPBInstance(PB_INSTANCE *pbi){
-  /* initialize whole structure to 0 */
-  memset(pbi, 0, sizeof(*pbi));
-
-  InitTmpBuffers(pbi);
-
-  /* allocate memory for the oggpack_buffer */
-#ifndef LIBOGG2
-  pbi->opb = _ogg_malloc(sizeof(oggpack_buffer));
-#else
-  pbi->opb = _ogg_malloc(oggpack_buffersize());
-#endif
-}



More information about the commits mailing list