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

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Jan 10 05:29:33 PST 2008


Author: xiphmont
Date: 2008-01-10 05:29:30 -0800 (Thu, 10 Jan 2008)
New Revision: 14389

Modified:
   branches/theora-thusnelda/lib/enc/dct_encode.c
   branches/theora-thusnelda/lib/enc/encode.c
   branches/theora-thusnelda/lib/enc/encoder_toplevel.c
   branches/theora-thusnelda/lib/enc/mode.c
Log:
Runs, doesn't run *well*...



Modified: branches/theora-thusnelda/lib/enc/dct_encode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dct_encode.c	2008-01-10 13:00:30 UTC (rev 14388)
+++ branches/theora-thusnelda/lib/enc/dct_encode.c	2008-01-10 13:29:30 UTC (rev 14389)
@@ -562,9 +562,4 @@
   quantize (cpi, q, DCTOutput, cpi->frag_dct[fi].data);
   cpi->frag_dc[fi] = cpi->frag_dct[fi].data[0];
 
-  if ( (mode == CODE_INTER_NO_MV) &&
-       ( AllZeroDctData(cpi->frag_dct[fi].data) ) ) {
-    *cp = 0;
-  }
-
 }

Modified: branches/theora-thusnelda/lib/enc/encode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/encode.c	2008-01-10 13:00:30 UTC (rev 14388)
+++ branches/theora-thusnelda/lib/enc/encode.c	2008-01-10 13:29:30 UTC (rev 14389)
@@ -167,13 +167,8 @@
 
       for ( B=0; B<4; B++) {
 	fi = yuv[B];
-	if ( cp[fi] ) {
+	if ( cp[fi] ) 
 	  TransformQuantizeBlock( cpi, mp->mode, fi, mp->mv[B] );
-	  if(!cp[fi] && plane == 0){
-	    mp->coded &= ~(1<<B);
-	    if(!mp->coded) oc_mode_unset(cpi,mp);
-	  }
-	}
       }
     }
     return 0;
@@ -409,10 +404,6 @@
   PredictDC(cpi);
   DPCMTokenize(cpi);
 
-  /* The tree is not needed (implicit) for key frames */
-  if ( cpi->FrameType != KEY_FRAME )
-    PackAndWriteDFArray( cpi );
-
   /* Mode and MV data not needed for key frames. */
   if ( cpi->FrameType != KEY_FRAME ){
     PackModes(cpi);

Modified: branches/theora-thusnelda/lib/enc/encoder_toplevel.c
===================================================================
--- branches/theora-thusnelda/lib/enc/encoder_toplevel.c	2008-01-10 13:00:30 UTC (rev 14388)
+++ branches/theora-thusnelda/lib/enc/encoder_toplevel.c	2008-01-10 13:29:30 UTC (rev 14389)
@@ -68,7 +68,7 @@
   WriteFrameHeader(cpi);
 
   /* Select modes and motion vectors for each of the blocks */
-  if(PickModes( cpi ) && cpi->info.keyframe_auto_p){
+  if(PickModes( cpi )){
     /* mode analysis thinks this should have been a keyframe; start over and code as a keyframe instead */
     CompressKeyFrame(cpi);  /* Code a key frame */
     return 0;

Modified: branches/theora-thusnelda/lib/enc/mode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/mode.c	2008-01-10 13:00:30 UTC (rev 14388)
+++ branches/theora-thusnelda/lib/enc/mode.c	2008-01-10 13:29:30 UTC (rev 14389)
@@ -218,50 +218,6 @@
   }
 }
 
-void oc_mode_unset(CP_INSTANCE *cpi, 
-		   macroblock_t *mb){
-
-  oc_mode_scheme_chooser *chooser = &cpi->chooser;
-  int ri;
-  int si;
-  int mode = mb->mode;
-
-  chooser->mode_counts[mode]--;
-
-  /* Re-order the scheme0 mode list if necessary. */
-  for(ri = chooser->scheme0_ranks[mode]; ri<7; ri++){
-    int pmode;
-    pmode=chooser->scheme0_list[ri+1];
-    if(chooser->mode_counts[pmode] <= chooser->mode_counts[mode])break;
-
-    /* reorder the mode ranking */
-    chooser->scheme0_ranks[pmode]--;
-    chooser->scheme0_list[ri]=pmode;
-
-  }
-  chooser->scheme0_ranks[mode]=ri;
-  chooser->scheme0_list[ri]=mode;
-
-  /* Now remove the bit cost of the mode from each scheme.*/
-  for(si=0;si<8;si++){
-    chooser->scheme_bits[si]-=
-      chooser->mode_bits[si][chooser->mode_ranks[si][mode]];
-  }
-
-  /* Finally, re-order the list of schemes. */
-  for(si=1;si<8;si++){
-    int sj = si;
-    int scheme0 = chooser->scheme_list[si];
-    int bits0 = chooser->scheme_bits[scheme0];
-    do{
-      int scheme1 = chooser->scheme_list[sj-1];
-      if(bits0 >= chooser->scheme_bits[scheme1]) break;
-      chooser->scheme_list[sj] = scheme1;
-    } while(--sj>0);
-    chooser->scheme_list[sj]=scheme0;
-  }
-}
-
 static int BIntraSAD(CP_INSTANCE *cpi, int fi, int plane){
   int sad = 0;
   unsigned char *b = cpi->frame + cpi->frag_buffer_index[fi];
@@ -647,8 +603,8 @@
 
   if(cpi->FrameType != KEY_FRAME){
 
-    if(interbits>intrabits) return 1; /* short circuit */
-
+    //if(interbits>intrabits) return 1; /* short circuit */
+    
     /* finish adding flagging overhead costs to inter bit counts */
     
     if(cpi->MVBits_0 < cpi->MVBits_1)
@@ -658,7 +614,7 @@
     
     interbits+=cpi->chooser.scheme_bits[cpi->chooser.scheme_list[0]];
     
-    if(interbits>intrabits) return 1; /* short circuit */
+    //if(interbits>intrabits) return 1; /* short circuit */
 
     /* The easiest way to count the bits needed for coded/not coded fragments is
        to code them. */
@@ -668,7 +624,7 @@
       interbits += oggpackB_bits(cpi->oggbuffer) - bits;
     }
     
-    if(interbits>intrabits) return 1; 
+    //if(interbits>intrabits) return 1; 
     
   }
 



More information about the commits mailing list