[xiph-commits] r14076 - trunk/theora/lib/enc

giles at svn.xiph.org giles at svn.xiph.org
Wed Oct 31 14:16:06 PDT 2007


Author: giles
Date: 2007-10-31 14:16:05 -0700 (Wed, 31 Oct 2007)
New Revision: 14076

Modified:
   trunk/theora/lib/enc/codec_internal.h
   trunk/theora/lib/enc/dct_decode.c
   trunk/theora/lib/enc/dct_encode.c
   trunk/theora/lib/enc/encode.c
   trunk/theora/lib/enc/encoder_toplevel.c
   trunk/theora/lib/enc/misc_common.c
Log:
Remove the FrameType accessors entirely.


Modified: trunk/theora/lib/enc/codec_internal.h
===================================================================
--- trunk/theora/lib/enc/codec_internal.h	2007-10-31 14:58:51 UTC (rev 14075)
+++ trunk/theora/lib/enc/codec_internal.h	2007-10-31 21:16:05 UTC (rev 14076)
@@ -854,13 +854,4 @@
 extern void ScanYUVInit( PP_INSTANCE *  ppi,
                          SCAN_CONFIG_DATA * ScanConfigPtr);
 
-static int GetFrameType(PB_INSTANCE *pbi){
-  return pbi->FrameType;
-}
-
-static void SetFrameType( PB_INSTANCE *pbi,unsigned char FrType ){
-  pbi->FrameType = FrType;
-}
-
-
 #endif /* ENCODER_INTERNAL_H */

Modified: trunk/theora/lib/enc/dct_decode.c
===================================================================
--- trunk/theora/lib/enc/dct_decode.c	2007-10-31 14:58:51 UTC (rev 14075)
+++ trunk/theora/lib/enc/dct_decode.c	2007-10-31 21:16:05 UTC (rev 14076)
@@ -147,7 +147,7 @@
                                         pixel is used */
 
   /* Get coding mode for this block */
-  if ( GetFrameType(pbi) == KEY_FRAME ){
+  if ( pbi->FrameType == KEY_FRAME ){
     pbi->CodingMode = CODE_INTRA;
   }else{
     /* Get Motion vector and mode for this block. */
@@ -1073,7 +1073,7 @@
 
   void (*ExpandBlockA) ( PB_INSTANCE *pbi, ogg_int32_t FragmentNumber );
 
-  if ( GetFrameType(pbi) == KEY_FRAME )
+  if ( pbi->FrameType == KEY_FRAME )
     ExpandBlockA=ExpandKFBlock;
   else
     ExpandBlockA=ExpandBlock;
@@ -1117,7 +1117,7 @@
 
         /* only do 2 prediction if fragment coded and on non intra or
            if all fragments are intra */
-        if( pbi->display_fragments[i] || (GetFrameType(pbi) == KEY_FRAME) ){
+        if( pbi->display_fragments[i] || (pbi->FrameType == KEY_FRAME) ){
           /* Type of Fragment */
           WhichFrame = Mode2Frame[pbi->FragCodingMethod[i]];
 
@@ -1297,7 +1297,7 @@
 
   /* Reconstruct the golden frame if necessary.
      For VFW codec only on key frames */
-  if ( GetFrameType(pbi) == KEY_FRAME ){
+  if ( pbi->FrameType == KEY_FRAME ){
     CopyRecon( pbi, pbi->GoldenFrame, pbi->LastFrameRecon );
     /* We may need to update the UMV border */
     UpdateUMVBorder(pbi, pbi->GoldenFrame);

Modified: trunk/theora/lib/enc/dct_encode.c
===================================================================
--- trunk/theora/lib/enc/dct_encode.c	2007-10-31 14:58:51 UTC (rev 14075)
+++ trunk/theora/lib/enc/dct_encode.c	2007-10-31 21:16:05 UTC (rev 14076)
@@ -250,7 +250,7 @@
                                 ogg_int32_t FragIndex){
   ogg_uint32_t  token_count;
 
-  if ( GetFrameType(&cpi->pb) == KEY_FRAME ){
+  if ( cpi->pb.FrameType == KEY_FRAME ){
     /* Key frame so code block in INTRA mode. */
     cpi->pb.CodingMode = CODE_INTRA;
   }else{
@@ -394,7 +394,7 @@
   /* adjusted / filtered pointers */
   FiltPtr = &cpi->ConvDestBuffer[cpi->pb.pixel_index_table[FragIndex]];
 
-  if ( GetFrameType(&cpi->pb) == KEY_FRAME ) {
+  if ( cpi->pb.FrameType == KEY_FRAME ) {
     /* Key frame so code block in INTRA mode. */
     cpi->pb.CodingMode = CODE_INTRA;
   }else{

Modified: trunk/theora/lib/enc/encode.c
===================================================================
--- trunk/theora/lib/enc/encode.c	2007-10-31 14:58:51 UTC (rev 14075)
+++ trunk/theora/lib/enc/encode.c	2007-10-31 21:16:05 UTC (rev 14076)
@@ -608,7 +608,7 @@
   ClearDownQFragData(&cpi->pb);
 
   /* The tree is not needed (implicit) for key frames */
-  if ( GetFrameType(&cpi->pb) != KEY_FRAME ){
+  if ( cpi->pb.FrameType != KEY_FRAME ){
     /* Pack the quad tree fragment mapping. */
     PackAndWriteDFArray( cpi );
   }
@@ -617,7 +617,7 @@
   cpi->FrameBitCount = oggpackB_bytes(cpi->oggbuffer) << 3;
 
   /* Mode and MV data not needed for key frames. */
-  if ( GetFrameType(&cpi->pb) != KEY_FRAME ){
+  if ( cpi->pb.FrameType != KEY_FRAME ){
     /* Pack and code the mode list. */
     PackModes(cpi);
     /* Pack the motion vectors */
@@ -831,7 +831,7 @@
         /* only do 2 prediction if fragment coded and on non intra or
            if all fragments are intra */
         if( cpi->pb.display_fragments[i] ||
-            (GetFrameType(&cpi->pb) == KEY_FRAME) ) {
+            (cpi->pb.FrameType == KEY_FRAME) ) {
           /* Type of Fragment */
 
           WhichFrame = Mode2Frame[cpi->pb.FragCodingMethod[i]];

Modified: trunk/theora/lib/enc/encoder_toplevel.c
===================================================================
--- trunk/theora/lib/enc/encoder_toplevel.c	2007-10-31 14:58:51 UTC (rev 14075)
+++ trunk/theora/lib/enc/encoder_toplevel.c	2007-10-31 21:16:05 UTC (rev 14076)
@@ -354,7 +354,7 @@
   memset( cpi->extra_fragments, 1, cpi->pb.UnitFragments );
 
   /* Set up for a KEY FRAME */
-  SetFrameType( &cpi->pb,KEY_FRAME );
+  cpi->pb.FrameType = KEY_FRAME;
 }
 
 static void AdjustKeyFrameContext(CP_INSTANCE *cpi) {
@@ -451,7 +451,7 @@
   EncodeData(cpi);
 
   /* Adjust drop frame trigger. */
-  if ( GetFrameType(&cpi->pb) != KEY_FRAME ) {
+  if ( cpi->pb.FrameType != KEY_FRAME ) {
     /* Apply decay factor then add in the last frame size. */
     cpi->DropFrameTriggerBytes =
       ((cpi->DropFrameTriggerBytes * (DF_CANDIDATE_WINDOW-1)) /
@@ -484,7 +484,7 @@
 
   /* Update the BpbCorrectionFactor variable according to whether or
      not we were close enough with our selection of DCT quantiser.  */
-  if ( GetFrameType(&cpi->pb) != KEY_FRAME ) {
+  if ( cpi->pb.FrameType != KEY_FRAME ) {
     /* Work out a size correction factor. */
     CorrectionFactor = (double)oggpackB_bytes(cpi->oggbuffer) /
       (double)cpi->ThisFrameTargetBytes;
@@ -516,7 +516,7 @@
   }
 
   /* Adjust carry over and or key frame context. */
-  if ( GetFrameType(&cpi->pb) == KEY_FRAME ) {
+  if ( cpi->pb.FrameType == KEY_FRAME ) {
     /* Adjust the key frame context unless the key frame was very small */
     AdjustKeyFrameContext(cpi);
   } else {
@@ -668,7 +668,7 @@
   }
 
   /* Default to delta frames. */
-  SetFrameType( &cpi->pb, DELTA_FRAME );
+  cpi->pb.FrameType = DELTA_FRAME;
 
   /* Clear down the difference arrays for the current frame. */
   memset( cpi->pb.display_fragments, 0, cpi->pb.UnitFragments );

Modified: trunk/theora/lib/enc/misc_common.c
===================================================================
--- trunk/theora/lib/enc/misc_common.c	2007-10-31 14:58:51 UTC (rev 14075)
+++ trunk/theora/lib/enc/misc_common.c	2007-10-31 21:16:05 UTC (rev 14076)
@@ -59,7 +59,7 @@
   }
 
   /* Adjust according to Q shift and type of frame */
-  if ( GetFrameType(&cpi->pb) == KEY_FRAME ) {
+  if ( cpi->pb.FrameType == KEY_FRAME ) {
     /* Get primary prediction */
     BytesPerBlock = KfBpbTable[ThreshTableIndex];
   } else {
@@ -258,7 +258,7 @@
   cpi->pb.ThisFrameQualityValue = cpi->pb.QThreshTable[QIndex];
 
   /* Apply range restrictions for key frames. */
-  if ( GetFrameType(&cpi->pb) == KEY_FRAME ) {
+  if ( cpi->pb.FrameType == KEY_FRAME ) {
     if ( cpi->pb.ThisFrameQualityValue > cpi->pb.QThreshTable[20] )
       cpi->pb.ThisFrameQualityValue = cpi->pb.QThreshTable[20];
     else if ( cpi->pb.ThisFrameQualityValue < cpi->pb.QThreshTable[50] )
@@ -273,7 +273,7 @@
   }
 
   if(cpi->FixedQ) {
-    if ( GetFrameType(&cpi->pb) == KEY_FRAME ) {
+    if ( cpi->pb.FrameType == KEY_FRAME ) {
       cpi->pb.ThisFrameQualityValue = cpi->pb.QThreshTable[43];
       cpi->pb.ThisFrameQualityValue = cpi->FixedQ;
     } else {



More information about the commits mailing list