[xiph-cvs] cvs commit: theora/lib pp.c scan.c

Monty xiphmont at xiph.org
Fri Sep 20 02:45:02 PDT 2002



xiphmont    02/09/20 05:45:02

  Modified:    lib      pp.c scan.c
  Log:
  It builds.  It doesn't work, but it builds.

Revision  Changes    Path
1.3       +2 -2      theora/lib/pp.c

Index: pp.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/pp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pp.c	20 Sep 2002 09:30:32 -0000	1.2
+++ pp.c	20 Sep 2002 09:45:02 -0000	1.3
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function: 
-  last mod: $Id: pp.c,v 1.2 2002/09/20 09:30:32 xiphmont Exp $
+  last mod: $Id: pp.c,v 1.3 2002/09/20 09:45:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -655,7 +655,7 @@
   
 }
 
-static void UpdateFragQIndex(PB_INSTANCE *pbi){
+void UpdateFragQIndex(PB_INSTANCE *pbi){
   
   ogg_uint32_t  ThisFrameQIndex;
   ogg_uint32_t  i;

<p><p>1.2       +144 -3    theora/lib/scan.c

Index: scan.c
===================================================================
RCS file: /usr/local/cvsroot/theora/lib/scan.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- scan.c	20 Sep 2002 09:30:32 -0000	1.1
+++ scan.c	20 Sep 2002 09:45:02 -0000	1.2
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function: 
-  last mod: $Id: scan.c,v 1.1 2002/09/20 09:30:32 xiphmont Exp $
+  last mod: $Id: scan.c,v 1.2 2002/09/20 09:45:02 xiphmont Exp $
 
  ********************************************************************/
 
@@ -535,7 +535,7 @@
     /* Skip if block already marked to be coded. */
     if ( *LocalDispFragPtr <= BLOCK_NOT_CODED ){
       /* Calculate the SAD score for the block column */
-      MaxSad = ColSAD( ppi, LocalYuvPtr1, LocalYuvPtr2 );
+      MaxSad = ScalarColSAD( ppi, LocalYuvPtr1, LocalYuvPtr2 );
 
       /* Now test the group SAD score */
       if ( MaxSad > LocalGrpLowSadThresh ){
@@ -1756,7 +1756,7 @@
 
   ogg_uint32_t   i,j;
   
-  ogg_uint32_t   PixelIndex = ScanGetFragIndex(ppi, BlockMapIndex);
+  ogg_uint32_t   PixelIndex = ppi->ScanPixelIndexTable[BlockMapIndex];
   signed char   * BlockMapPtr = &ppi->ScanDisplayFragments[BlockMapIndex];
   signed char   * PrevFragmentsPtr = &ppi->PrevFragments[0][BlockMapIndex];
   
@@ -1786,6 +1786,147 @@
     
     /* Increment pixel index for next block. */
     PixelIndex += ppi->ScanConfig.HFragPixels;
+  }
+}
+
+static void RowBarEnhBlockMap( PP_INSTANCE *ppi, 
+			       ogg_uint32_t * FragScorePtr, 
+			       signed char   * FragSgcPtr,
+			       signed char   * UpdatedBlockMapPtr,
+			       signed char   * BarBlockMapPtr,
+			       ogg_uint32_t RowNumber ){
+  /* For boundary blocks relax thresholds */
+  ogg_uint32_t BarBlockThresh = ppi->BlockThreshold / 10;
+  ogg_uint32_t BarSGCThresh = ppi->BlockSgcThresh / 2;
+  
+  ogg_int32_t i;
+  
+  /* Start by blanking the row in the bar block map structure. */
+  memset( BarBlockMapPtr, BLOCK_NOT_CODED, ppi->PlaneHFragments );
+
+  /* First row */
+  if ( RowNumber == 0 ){
+    
+    /* For each fragment in the row. */
+    for ( i = 0; i < ppi->PlaneHFragments; i ++ ){
+      /* Test for CANDIDATE_BLOCK or CANDIDATE_BLOCK_LOW. Uncoded or
+	 coded blocks will be ignored. */
+      if ( UpdatedBlockMapPtr[i] <= CANDIDATE_BLOCK ){
+	/* Is one of the immediate neighbours updated in the main map. */
+	/* Note special cases for blocks at the start and end of rows. */
+	if ( i == 0 ){
+	  
+	  if ((UpdatedBlockMapPtr[i+1] > BLOCK_NOT_CODED ) ||
+	      (UpdatedBlockMapPtr[i+ppi->PlaneHFragments]>BLOCK_NOT_CODED ) ||
+	      (UpdatedBlockMapPtr[i+ppi->PlaneHFragments+1]>BLOCK_NOT_CODED ) )
+	    BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+	  
+	  
+	}else if ( i == (ppi->PlaneHFragments - 1) ){
+                    
+	  if ((UpdatedBlockMapPtr[i-1] > BLOCK_NOT_CODED ) ||
+	      (UpdatedBlockMapPtr[i+ppi->PlaneHFragments-1]>BLOCK_NOT_CODED) ||
+	       (UpdatedBlockMapPtr[i+ppi->PlaneHFragments]>BLOCK_NOT_CODED) )
+	      BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+                    
+	}else{
+	  if((UpdatedBlockMapPtr[i-1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments-1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments+1] > BLOCK_NOT_CODED) )
+	      BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+	}
+      }
+    }
+    
+  } else if ( RowNumber == (ogg_uint32_t)(ppi->PlaneVFragments-1)) {
+    
+    /* Last row */
+    /* Used to read PlaneHFragments */
+    
+    /* For each fragment in the row. */
+    for ( i = 0; i < ppi->PlaneHFragments; i ++ ){
+      /* Test for CANDIDATE_BLOCK or CANDIDATE_BLOCK_LOW
+	 Uncoded or coded blocks will be ignored. */
+      if ( UpdatedBlockMapPtr[i] <= CANDIDATE_BLOCK ){
+	/* Is one of the immediate neighbours updated in the main map. */
+	/* Note special cases for blocks at the start and end of rows. */
+	if ( i == 0 ){
+	  if((UpdatedBlockMapPtr[i+1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments+1] > BLOCK_NOT_CODED ))
+	    BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+                
+	}else if ( i == (ppi->PlaneHFragments - 1) ){
+	  if((UpdatedBlockMapPtr[i-1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments-1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments] > BLOCK_NOT_CODED ) )
+	    BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+	}else{
+	  if((UpdatedBlockMapPtr[i-1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments-1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments+1] > BLOCK_NOT_CODED) )
+	    BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+	}
+      }
+    }
+    
+  }else{
+    /* All other rows */
+    /* For each fragment in the row. */
+    for ( i = 0; i < ppi->PlaneHFragments; i ++ ){
+      /* Test for CANDIDATE_BLOCK or CANDIDATE_BLOCK_LOW */
+      /* Uncoded or coded blocks will be ignored. */
+      if ( UpdatedBlockMapPtr[i] <= CANDIDATE_BLOCK ){
+	/* Is one of the immediate neighbours updated in the main map. */
+	/* Note special cases for blocks at the start and end of rows. */
+	if ( i == 0 ){
+	  
+	  if((UpdatedBlockMapPtr[i+1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments+1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments+1] > BLOCK_NOT_CODED) )
+	    BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+	  
+	}else if ( i == (ppi->PlaneHFragments - 1) ){
+                    
+	  if((UpdatedBlockMapPtr[i-1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments-1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments-1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments] > BLOCK_NOT_CODED ) )
+	    BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+	  
+	}else{
+	  if((UpdatedBlockMapPtr[i-1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+1] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments-1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i-ppi->PlaneHFragments+1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments-1] > BLOCK_NOT_CODED)||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments] > BLOCK_NOT_CODED ) ||
+	     (UpdatedBlockMapPtr[i+ppi->PlaneHFragments+1] > BLOCK_NOT_CODED ))
+	    BarBlockMapPtr[i] = BLOCK_CODED_BAR;
+	}
+      }
+    }
+  }
+}
+
+static void BarCopyBack( PP_INSTANCE *ppi, 
+			 signed char  * UpdatedBlockMapPtr,
+			 signed char  * BarBlockMapPtr ){
+  ogg_int32_t i;
+  
+  /* For each fragment in the row. */
+  for ( i = 0; i < ppi->PlaneHFragments; i ++ ){
+    if ( BarBlockMapPtr[i] > BLOCK_NOT_CODED ){
+      UpdatedBlockMapPtr[i] = BarBlockMapPtr[i];
+    }
   }
 }
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list