[xiph-commits] r14145 - branches/theora-thusnelda/lib/enc

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Nov 14 23:08:00 PST 2007


Author: xiphmont
Date: 2007-11-14 23:08:00 -0800 (Wed, 14 Nov 2007)
New Revision: 14145

Modified:
   branches/theora-thusnelda/lib/enc/dct_decode.c
   branches/theora-thusnelda/lib/enc/dct_encode.c
   branches/theora-thusnelda/lib/enc/dsp.c
   branches/theora-thusnelda/lib/enc/dsp.h
   branches/theora-thusnelda/lib/enc/reconstruct.c
Log:
Unify motion compensation portion of reconstruction with the motion
compensation code used to produce input to the dct; eliminates swath
of redundant code and need for several assembly routine variations.



Modified: branches/theora-thusnelda/lib/enc/dct_decode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dct_decode.c	2007-11-15 07:00:57 UTC (rev 14144)
+++ branches/theora-thusnelda/lib/enc/dct_decode.c	2007-11-15 07:08:00 UTC (rev 14145)
@@ -163,87 +163,9 @@
 
   /* 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);
 
-  /* Action depends on decode mode. */
-  if ( pbi->CodingMode == CODE_INTER_NO_MV ){
-    /* Inter with no motion vector */
-    /* Reconstruct the pixel data using the last frame reconstruction
-       and change data when the motion vector is (0,0), the recon is
-       based on the lastframe without loop filtering---- for testing */
-    dsp_recon_inter8x8 (pbi->dsp, &pbi->ThisFrameRecon[ReconPixelIndex],
-                &pbi->LastFrameRecon[ReconPixelIndex],
-                  pbi->ReconDataBuffer, ReconPixelsPerLine);
-  }else if ( ModeUsesMC[pbi->CodingMode] ) {
-    /* The mode uses a motion vector. */
-    /* Get vector from list */
-    pbi->MVector.x = pbi->FragMVect[FragmentNumber].x;
-    pbi->MVector.y = pbi->FragMVect[FragmentNumber].y;
-
-    /* Work out the base motion vector offset and the 1/2 pixel offset
-       if any.  For the U and V planes the MV specifies 1/4 pixel
-       accuracy. This is adjusted to 1/2 pixel as follows ( 0->0,
-       1/4->1/2, 1/2->1/2, 3/4->1/2 ). */
-    MVOffset = 0;
-    ReconPtr2Offset = 0;
-    if ( pbi->MVector.x > 0 ){
-      MVOffset = pbi->MVector.x >> MvShift;
-      if ( pbi->MVector.x & MvModMask )
-        ReconPtr2Offset += 1;
-    } else if ( pbi->MVector.x < 0 ) {
-      MVOffset -= (-pbi->MVector.x) >> MvShift;
-      if ( (-pbi->MVector.x) & MvModMask )
-        ReconPtr2Offset -= 1;
-    }
-
-    if ( pbi->MVector.y > 0 ){
-      MVOffset += (pbi->MVector.y >>  MvShift) * ReconPixelsPerLine;
-      if ( pbi->MVector.y & MvModMask )
-        ReconPtr2Offset += ReconPixelsPerLine;
-    } else if ( pbi->MVector.y < 0 ){
-      MVOffset -= ((-pbi->MVector.y) >> MvShift) * ReconPixelsPerLine;
-      if ( (-pbi->MVector.y) & MvModMask )
-        ReconPtr2Offset -= ReconPixelsPerLine;
-    }
-
-    /* Set up the first of the two reconstruction buffer pointers. */
-    if ( pbi->CodingMode==CODE_GOLDEN_MV ) {
-      LastFrameRecPtr = &pbi->GoldenFrame[ReconPixelIndex] + MVOffset;
-    }else{
-      LastFrameRecPtr = &pbi->LastFrameRecon[ReconPixelIndex] + MVOffset;
-    }
-
-    /* Set up the second of the two reconstruction pointers. */
-    LastFrameRecPtr2 = LastFrameRecPtr + ReconPtr2Offset;
-
-    /* Select the appropriate reconstruction function */
-    if ( (int)(LastFrameRecPtr - LastFrameRecPtr2) == 0 ) {
-      /* Reconstruct the pixel dats from the reference frame and change data
-         (no half pixel in this case as the two references were the same. */
-      dsp_recon_inter8x8 (pbi->dsp,
-          &pbi->ThisFrameRecon[ReconPixelIndex],
-                  LastFrameRecPtr, pbi->ReconDataBuffer,
-                  ReconPixelsPerLine);
-    }else{
-      /* Fractional pixel reconstruction. */
-      /* Note that we only use two pixels per reconstruction even for
-         the diagonal. */
-      dsp_recon_inter8x8_half(pbi->dsp, &pbi->ThisFrameRecon[ReconPixelIndex],
-                            LastFrameRecPtr, LastFrameRecPtr2,
-                            pbi->ReconDataBuffer, ReconPixelsPerLine);
-    }
-  } else if ( pbi->CodingMode == CODE_USING_GOLDEN ){
-    /* Golden frame with motion vector */
-    /* Reconstruct the pixel data using the golden frame
-       reconstruction and change data */
-    dsp_recon_inter8x8 (pbi->dsp, &pbi->ThisFrameRecon[ReconPixelIndex],
-                &pbi->GoldenFrame[ ReconPixelIndex ],
-                  pbi->ReconDataBuffer, ReconPixelsPerLine);
-  } else {
-    /* Simple Intra coding */
-    /* Get the pixel index for the first pixel in the fragment. */
-    dsp_recon_intra8x8 (pbi->dsp, &pbi->ThisFrameRecon[ReconPixelIndex],
-              pbi->ReconDataBuffer, ReconPixelsPerLine);
-  }
 }
 
 static void UpdateUMV_HBorders( PB_INSTANCE *pbi,

Modified: branches/theora-thusnelda/lib/enc/dct_encode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dct_encode.c	2007-11-15 07:00:57 UTC (rev 14144)
+++ branches/theora-thusnelda/lib/enc/dct_encode.c	2007-11-15 07:08:00 UTC (rev 14145)
@@ -283,10 +283,14 @@
   return 1;
 }
 
-static void MotionBlockDifference (CP_INSTANCE * cpi, unsigned char * FiltPtr,
-                            ogg_int16_t *DctInputPtr, ogg_int32_t MvDevisor,
-                            ogg_uint32_t FragIndex,ogg_uint32_t PixelsPerLine,
-                            ogg_uint32_t ReconPixelsPerLine) {
+static void BlockUpdateDifference (CP_INSTANCE * cpi, 
+				   unsigned char *FiltPtr,
+				   ogg_int16_t *DctInputPtr, 
+				   unsigned char *thisrecon,
+				   ogg_int32_t MvDevisor,
+				   ogg_uint32_t FragIndex,
+				   ogg_uint32_t PixelsPerLine,
+				   ogg_uint32_t ReconPixelsPerLine) {
 
   ogg_int32_t MvShift;
   ogg_int32_t MvModMask;
@@ -298,72 +302,95 @@
                                    half pixel MC */
   unsigned char  *ReconPtr1;    /* DCT reconstructed image pointers */
   unsigned char  *ReconPtr2;    /* Pointer used in half pixel MC */
-  
-  switch(MvDevisor) {
-  case 2:
-    MvShift = 1;
-    MvModMask = 1;
-    break;
-  case 4:
-    MvShift = 2;
-    MvModMask = 3;
-    break;
-  default:
-    break;
-  }
+   
+  if ( ModeUsesMC[cpi->pb.CodingMode] ){
+    switch(MvDevisor) {
+    case 2:
+      MvShift = 1;
+      MvModMask = 1;
+      break;
+    case 4:
+      MvShift = 2;
+      MvModMask = 3;
+      break;
+    default:
+      break;
+    }
+    
+    cpi->MVector.x = cpi->pb.FragMVect[FragIndex].x;
+    cpi->MVector.y = cpi->pb.FragMVect[FragIndex].y;
+    
+    /* Set up the baseline offset for the motion vector. */
+    MVOffset = ((cpi->MVector.y / MvDevisor) * ReconPixelsPerLine) +
+      (cpi->MVector.x / MvDevisor);
+    
+    /* Work out the offset of the second reference position for 1/2
+       pixel interpolation.  For the U and V planes the MV specifies 1/4
+       pixel accuracy. This is adjusted to 1/2 pixel as follows ( 0->0,
+       1/4->1/2, 1/2->1/2, 3/4->1/2 ). */
+    ReconPtr2Offset = 0;
+    AbsXOffset = cpi->MVector.x % MvDevisor;
+    AbsYOffset = cpi->MVector.y % MvDevisor;
+    
+    if ( AbsXOffset ) {
+      if ( cpi->MVector.x > 0 )
+	ReconPtr2Offset += 1;
+      else
+	ReconPtr2Offset -= 1;
+    }
+    
+    if ( AbsYOffset ) {
+      if ( cpi->MVector.y > 0 )
+	ReconPtr2Offset += ReconPixelsPerLine;
+      else
+	ReconPtr2Offset -= ReconPixelsPerLine;
+    }
+    
+    if ( cpi->pb.CodingMode==CODE_GOLDEN_MV ) {
+      ReconPtr1 = &cpi->
+	pb.GoldenFrame[cpi->pb.recon_pixel_index_table[FragIndex]];
+    } else {
+      ReconPtr1 = &cpi->
+	pb.LastFrameRecon[cpi->pb.recon_pixel_index_table[FragIndex]];
+    }
+    
+    ReconPtr1 += MVOffset;
+    ReconPtr2 =  ReconPtr1 + ReconPtr2Offset;
+    
+    AbsRefOffset = abs((int)(ReconPtr1 - ReconPtr2));
+    
+    /* Is the MV offset exactly pixel alligned */
+    if ( AbsRefOffset == 0 ){
+      dsp_sub8x8(cpi->dsp, FiltPtr, ReconPtr1, DctInputPtr,
+		 PixelsPerLine, ReconPixelsPerLine);
+      dsp_copy8x8 (cpi->dsp, ReconPtr1, thisrecon, ReconPixelsPerLine);
+    } else {
+      /* Fractional pixel MVs. */
+      /* Note that we only use two pixel values even for the diagonal */
+      dsp_sub8x8avg2(cpi->dsp, FiltPtr, ReconPtr1,ReconPtr2,DctInputPtr,
+		     PixelsPerLine, ReconPixelsPerLine);
+      dsp_copy8x8_half (cpi->dsp, ReconPtr1, ReconPtr2, thisrecon, ReconPixelsPerLine);
+    }
 
-  cpi->MVector.x = cpi->pb.FragMVect[FragIndex].x;
-  cpi->MVector.y = cpi->pb.FragMVect[FragIndex].y;
-
-  /* Set up the baseline offset for the motion vector. */
-  MVOffset = ((cpi->MVector.y / MvDevisor) * ReconPixelsPerLine) +
-    (cpi->MVector.x / MvDevisor);
-
-  /* Work out the offset of the second reference position for 1/2
-     pixel interpolation.  For the U and V planes the MV specifies 1/4
-     pixel accuracy. This is adjusted to 1/2 pixel as follows ( 0->0,
-     1/4->1/2, 1/2->1/2, 3/4->1/2 ). */
-  ReconPtr2Offset = 0;
-  AbsXOffset = cpi->MVector.x % MvDevisor;
-  AbsYOffset = cpi->MVector.y % MvDevisor;
-
-  if ( AbsXOffset ) {
-    if ( cpi->MVector.x > 0 )
-      ReconPtr2Offset += 1;
-    else
-      ReconPtr2Offset -= 1;
+  } else { 
+    if ( (cpi->pb.CodingMode==CODE_INTER_NO_MV ) ||
+	 ( cpi->pb.CodingMode==CODE_USING_GOLDEN ) ) {
+      if ( cpi->pb.CodingMode==CODE_INTER_NO_MV ) {
+	ReconPtr1 = &cpi->
+	  pb.LastFrameRecon[cpi->pb.recon_pixel_index_table[FragIndex]];
+      } else {
+	ReconPtr1 = &cpi->
+	  pb.GoldenFrame[cpi->pb.recon_pixel_index_table[FragIndex]];
+      }
+      
+      dsp_sub8x8(cpi->dsp, FiltPtr, ReconPtr1, DctInputPtr,
+		 PixelsPerLine, ReconPixelsPerLine);
+      dsp_copy8x8 (cpi->dsp, ReconPtr1, thisrecon, ReconPixelsPerLine);
+    } else if ( cpi->pb.CodingMode==CODE_INTRA ) {
+      dsp_sub8x8_128(cpi->dsp, FiltPtr, DctInputPtr, PixelsPerLine);
+      dsp_set8x8(cpi->dsp, 128, thisrecon, ReconPixelsPerLine);
+    }
   }
-
-  if ( AbsYOffset ) {
-    if ( cpi->MVector.y > 0 )
-      ReconPtr2Offset += ReconPixelsPerLine;
-    else
-      ReconPtr2Offset -= ReconPixelsPerLine;
-  }
-
-  if ( cpi->pb.CodingMode==CODE_GOLDEN_MV ) {
-    ReconPtr1 = &cpi->
-      pb.GoldenFrame[cpi->pb.recon_pixel_index_table[FragIndex]];
-  } else {
-    ReconPtr1 = &cpi->
-      pb.LastFrameRecon[cpi->pb.recon_pixel_index_table[FragIndex]];
-  }
-
-  ReconPtr1 += MVOffset;
-  ReconPtr2 =  ReconPtr1 + ReconPtr2Offset;
-
-  AbsRefOffset = abs((int)(ReconPtr1 - ReconPtr2));
-
-  /* Is the MV offset exactly pixel alligned */
-  if ( AbsRefOffset == 0 ){
-    dsp_sub8x8(cpi->dsp, FiltPtr, ReconPtr1, DctInputPtr,
-               PixelsPerLine, ReconPixelsPerLine);
-  } else {
-    /* Fractional pixel MVs. */
-    /* Note that we only use two pixel values even for the diagonal */
-    dsp_sub8x8avg2(cpi->dsp, FiltPtr, ReconPtr1,ReconPtr2,DctInputPtr,
-                 PixelsPerLine, ReconPixelsPerLine);
-  }
 }
 
 void TransformQuantizeBlock (CP_INSTANCE *cpi, ogg_int32_t FragIndex,
@@ -374,18 +401,20 @@
   ogg_uint32_t  ReconPixelsPerLine; /* Line length for recon buffers. */
 
   unsigned char   *ReconPtr1;   /* DCT reconstructed image pointers */
-  ogg_int32_t   MvDevisor;      /* Defines MV resolution (2 = 1/2
+  ogg_int32_t   MvDivisor;      /* Defines MV resolution (2 = 1/2
                                    pixel for Y or 4 = 1/4 for UV) */
 
   DctInputPtr   = cpi->DCTDataBuffer;
 
+  ReconPtr1 = &cpi->pb.ThisFrameRecon[cpi->pb.recon_pixel_index_table[FragIndex]];
+
   /* Set plane specific values */
   if (FragIndex < (ogg_int32_t)cpi->pb.YPlaneFragments){
     ReconPixelsPerLine = cpi->pb.YStride;
-    MvDevisor = 2;                  /* 1/2 pixel accuracy in Y */
+    MvDivisor = 2;                  /* 1/2 pixel accuracy in Y */
   }else{
     ReconPixelsPerLine = cpi->pb.UVStride;
-    MvDevisor = 4;                  /* UV planes at 1/2 resolution of Y */
+    MvDivisor = 4;                  /* UV planes at 1/2 resolution of Y */
   }
 
   /* adjusted / filtered pointers */
@@ -426,28 +455,13 @@
     }
   }
 
-  if ( ModeUsesMC[cpi->pb.CodingMode] ){
-
-    MotionBlockDifference(cpi, FiltPtr, DctInputPtr, MvDevisor,
-                          FragIndex, PixelsPerLine,
-                          ReconPixelsPerLine);
-
-  } else if ( (cpi->pb.CodingMode==CODE_INTER_NO_MV ) ||
-              ( cpi->pb.CodingMode==CODE_USING_GOLDEN ) ) {
-    if ( cpi->pb.CodingMode==CODE_INTER_NO_MV ) {
-      ReconPtr1 = &cpi->
-        pb.LastFrameRecon[cpi->pb.recon_pixel_index_table[FragIndex]];
-    } else {
-      ReconPtr1 = &cpi->
-        pb.GoldenFrame[cpi->pb.recon_pixel_index_table[FragIndex]];
-    }
-
-    dsp_sub8x8(cpi->dsp, FiltPtr, ReconPtr1, DctInputPtr,
-               PixelsPerLine, ReconPixelsPerLine);
-  } else if ( cpi->pb.CodingMode==CODE_INTRA ) {
-    dsp_sub8x8_128(cpi->dsp, FiltPtr, DctInputPtr, PixelsPerLine);
-  }
-
+  /* produces the appropriate motion compensation block, applies it to
+     the reconstruction buffer, and proces a difference block for
+     forward DCT */
+  BlockUpdateDifference(cpi, FiltPtr, DctInputPtr, ReconPtr1,
+			MvDivisor, FragIndex, PixelsPerLine,
+			ReconPixelsPerLine);
+  
   /* Proceed to encode the data into the encode buffer if the encoder
      is enabled. */
   /* Perform a 2D DCT transform on the data. */

Modified: branches/theora-thusnelda/lib/enc/dsp.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dsp.c	2007-11-15 07:00:57 UTC (rev 14144)
+++ branches/theora-thusnelda/lib/enc/dsp.c	2007-11-15 07:08:00 UTC (rev 14145)
@@ -22,6 +22,28 @@
 #define DSP_OP_DIFF(a,b) (((int)(a)) - ((int)(b)))
 #define DSP_OP_ABS_DIFF(a,b) abs((((int)(a)) - ((int)(b))))
 
+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;
+  memset(ptr,val,8);
+  ptr+=PixelsPerLine;
+  memset(ptr,val,8);
+  ptr+=PixelsPerLine;
+  memset(ptr,val,8);
+  ptr+=PixelsPerLine;
+  memset(ptr,val,8);
+  ptr+=PixelsPerLine;
+  memset(ptr,val,8);
+  ptr+=PixelsPerLine;
+  memset(ptr,val,8);
+  ptr+=PixelsPerLine;
+  memset(ptr,val,8);
+}
+
 static void sub8x8__c (unsigned char *FiltPtr, unsigned char *ReconPtr,
                   ogg_int16_t *DctInputPtr, ogg_uint32_t PixelsPerLine,
                   ogg_uint32_t ReconPixelsPerLine) {
@@ -385,6 +407,7 @@
   /* TH_DEBUG("setting dsp functions to C defaults.\n"); */
   funcs->save_fpu = nop;
   funcs->restore_fpu = nop;
+  funcs->set8x8 = set8x8__c;
   funcs->sub8x8 = sub8x8__c;
   funcs->sub8x8_128 = sub8x8_128__c;
   funcs->sub8x8avg2 = sub8x8avg2__c;

Modified: branches/theora-thusnelda/lib/enc/dsp.h
===================================================================
--- branches/theora-thusnelda/lib/enc/dsp.h	2007-11-15 07:00:57 UTC (rev 14144)
+++ branches/theora-thusnelda/lib/enc/dsp.h	2007-11-15 07:08:00 UTC (rev 14145)
@@ -26,6 +26,9 @@
   void   (*save_fpu)            (void);
   void   (*restore_fpu)         (void);
 
+  void   (*set8x8)      (unsigned char val, unsigned char *ptr,
+			 ogg_uint32_t PixelsPerLine);
+
   void   (*sub8x8)      (unsigned char *FiltPtr, unsigned char *ReconPtr,
                         ogg_int16_t *DctInputPtr, ogg_uint32_t PixelsPerLine,
          ogg_uint32_t ReconPixelsPerLine);
@@ -41,6 +44,12 @@
   void   (*copy8x8)      (unsigned char *src, unsigned char *dest, 
                      ogg_uint32_t stride);
 
+  void   (*copy8x8_half)      (unsigned char *src1, unsigned char *src2, 
+			       unsigned char *dest, ogg_uint32_t stride);
+
+  void   (*recon8x8)    (unsigned char *ReconPtr, ogg_int16_t *ChangePtr, 
+			 ogg_uint32_t LineStep);
+
   void   (*recon_intra8x8)    (unsigned char *ReconPtr, ogg_int16_t *ChangePtr, 
                      ogg_uint32_t LineStep);
 
@@ -115,6 +124,8 @@
 
 #define dsp_restore_fpu(funcs) (funcs.restore_fpu ())
 
+#define dsp_set8x8(funcs,a1,a2,a3) (funcs.set8x8 (a1,a2,a3))
+
 #define dsp_sub8x8(funcs,a1,a2,a3,a4,a5) (funcs.sub8x8 (a1,a2,a3,a4,a5))
 
 #define dsp_sub8x8_128(funcs,a1,a2,a3) (funcs.sub8x8_128 (a1,a2,a3))
@@ -123,6 +134,10 @@
 
 #define dsp_copy8x8(funcs,ptr1,ptr2,str1) (funcs.copy8x8 (ptr1,ptr2,str1))
 
+#define dsp_copy8x8_half(funcs,ptr1,ptr2,ptr3,str1) (funcs.copy8x8_half (ptr1,ptr2,ptr3,str1))
+
+#define dsp_recon8x8(funcs,ptr1,ptr2,str1) (funcs.recon8x8 (ptr1,ptr2,str1))
+
 #define dsp_recon_intra8x8(funcs,ptr1,ptr2,str1) (funcs.recon_intra8x8 (ptr1,ptr2,str1))
 
 #define dsp_recon_inter8x8(funcs,ptr1,ptr2,ptr3,str1) \

Modified: branches/theora-thusnelda/lib/enc/reconstruct.c
===================================================================
--- branches/theora-thusnelda/lib/enc/reconstruct.c	2007-11-15 07:00:57 UTC (rev 14144)
+++ branches/theora-thusnelda/lib/enc/reconstruct.c	2007-11-15 07:08:00 UTC (rev 14145)
@@ -18,11 +18,11 @@
 #include "codec_internal.h"
 
 static void copy8x8__c (unsigned char *src,
-                  unsigned char *dest,
-                  unsigned int stride)
+			unsigned char *dest,
+			unsigned int stride)
 {
   int j;
-  for ( j = 0; j < 8; j++ ){
+  for ( j = 8; j ; --j ){
     ((ogg_uint32_t*)dest)[0] = ((ogg_uint32_t*)src)[0];
     ((ogg_uint32_t*)dest)[1] = ((ogg_uint32_t*)src)[1];
     src+=stride;
@@ -30,6 +30,30 @@
   }
 }
 
+static void copy8x8_half__c (unsigned char *src1,
+			     unsigned char *src2, 
+			     unsigned char *dest,
+			     unsigned int stride)
+{
+  int j;
+
+  for (j = 8; j; --j){
+    dest[0] = ((int)src1[0] + (int)src2[0]) >> 1;
+    dest[1] = ((int)src1[1] + (int)src2[1]) >> 1;
+    dest[2] = ((int)src1[2] + (int)src2[2]) >> 1;
+    dest[3] = ((int)src1[3] + (int)src2[3]) >> 1;
+    dest[4] = ((int)src1[4] + (int)src2[4]) >> 1;
+    dest[5] = ((int)src1[5] + (int)src2[5]) >> 1;
+    dest[6] = ((int)src1[6] + (int)src2[6]) >> 1;
+    dest[7] = ((int)src1[7] + (int)src2[7]) >> 1;
+
+    src1+=stride;
+    src2+=stride;
+    dest+=stride;
+  }
+}
+
+
 static void recon_intra8x8__c (unsigned char *ReconPtr, ogg_int16_t *ChangePtr,
                                ogg_uint32_t LineStep)
 {
@@ -73,6 +97,26 @@
   }
 }
 
+static void recon8x8__c (unsigned char *ReconPtr, 
+			 ogg_int16_t *ChangePtr, ogg_uint32_t LineStep)
+{
+  ogg_uint32_t i;
+
+  for (i = 8; i; i--){
+    ReconPtr[0] = clamp255(ReconPtr[0] + ChangePtr[0]);
+    ReconPtr[1] = clamp255(ReconPtr[1] + ChangePtr[1]);
+    ReconPtr[2] = clamp255(ReconPtr[2] + ChangePtr[2]);
+    ReconPtr[3] = clamp255(ReconPtr[3] + ChangePtr[3]);
+    ReconPtr[4] = clamp255(ReconPtr[4] + ChangePtr[4]);
+    ReconPtr[5] = clamp255(ReconPtr[5] + ChangePtr[5]);
+    ReconPtr[6] = clamp255(ReconPtr[6] + ChangePtr[6]);
+    ReconPtr[7] = clamp255(ReconPtr[7] + ChangePtr[7]);
+
+    ChangePtr += 8;
+    ReconPtr += LineStep;
+  }
+}
+
 static void recon_inter8x8_half__c (unsigned char *ReconPtr, unsigned char *RefPtr1,
                unsigned char *RefPtr2, ogg_int16_t *ChangePtr,
          ogg_uint32_t LineStep)
@@ -99,6 +143,8 @@
 void dsp_recon_init (DspFunctions *funcs, ogg_uint32_t cpu_flags)
 {
   funcs->copy8x8 = copy8x8__c;
+  funcs->copy8x8_half = copy8x8_half__c;
+  funcs->recon8x8 = recon8x8__c;
   funcs->recon_intra8x8 = recon_intra8x8__c;
   funcs->recon_inter8x8 = recon_inter8x8__c;
   funcs->recon_inter8x8_half = recon_inter8x8_half__c;



More information about the commits mailing list