[xiph-commits] r9244 - in branches/theora-mmx: . doc/spec lib

j at motherfish-iii.xiph.org j at motherfish-iii.xiph.org
Mon May 9 12:51:26 PDT 2005


Author: j
Date: 2005-05-09 12:51:21 -0700 (Mon, 09 May 2005)
New Revision: 9244

Modified:
   branches/theora-mmx/
   branches/theora-mmx/doc/spec/ltablex.sty
   branches/theora-mmx/doc/spec/spec.tex
   branches/theora-mmx/lib/misc_common.c
Log:
Merge changes from trunk


Property changes on: branches/theora-mmx
___________________________________________________________________
Name: branch-point
   - 9045
   + 9243


Property changes on: branches/theora-mmx/doc/spec/ltablex.sty
___________________________________________________________________
Name: svn:executable
   - *

Modified: branches/theora-mmx/doc/spec/spec.tex
===================================================================
--- branches/theora-mmx/doc/spec/spec.tex	2005-05-09 18:15:11 UTC (rev 9243)
+++ branches/theora-mmx/doc/spec/spec.tex	2005-05-09 19:51:21 UTC (rev 9244)
@@ -5548,6 +5548,7 @@
  containing block \locvar{\bi}. \\
 \locvar{\rfi}     & Integer &  2 & No  & The index of the reference frame
  indicated by the coding mode for macro block \locvar{\mbi}. \\
+\locvar{\pli}     & Integer &  2 & No  & A color plane index. \\
 \bottomrule\end{tabularx}
 \medskip
 
@@ -5563,13 +5564,17 @@
 
 \begin{enumerate}
 \item
+For each consecutive value of \locvar{\pli} from $0$ to $2$:
+\begin{enumerate}
+\item
 Assign $\locvar{LASTDC}[0]$ the value zero.
 \item
 Assign $\locvar{LASTDC}[1]$ the value zero.
 \item
 Assign $\locvar{LASTDC}[2]$ the value zero.
 \item
-For each block in {\em raster} order, with coded-order index \locvar{\bi}:
+For each block of color plane \locvar{\pli} in {\em raster} order, with
+ coded-order index \locvar{\bi}:
 \begin{enumerate}
 \item
 If $\bitvar{BCODED}[\locvar{\bi}]$ is non-zero:
@@ -5596,6 +5601,7 @@
 \end{enumerate}
 \end{enumerate}
 \end{enumerate}
+\end{enumerate}
 
 \section{Reconstruction}
 
@@ -7550,7 +7556,7 @@
  the DCT coefficients into \locvar{NCOEFFS} and \locvar{NCOEFFS} using the
  procedure given in Section~\ref{sub:dct-coeffs}.
 \item
-Using \locvar{BCODED}, \locvar{MBMODES}, undo the DC prediction on the DC
+Using \locvar{BCODED} and \locvar{MBMODES}, undo the DC prediction on the DC
  coefficients stored in \locvar{COEFFS} using the procedure given in
  Section~\ref{sub:dc-pred-undo}.
 \end{enumerate}

Modified: branches/theora-mmx/lib/misc_common.c
===================================================================
--- branches/theora-mmx/lib/misc_common.c	2005-05-09 18:15:11 UTC (rev 9243)
+++ branches/theora-mmx/lib/misc_common.c	2005-05-09 19:51:21 UTC (rev 9244)
@@ -230,25 +230,27 @@
 }
 
 void RegulateQ( CP_INSTANCE *cpi, ogg_int32_t UpdateScore ) {
-  double TargetUnitScoreBytes = (double)cpi->ThisFrameTargetBytes /
-    (double)UpdateScore;
   double PredUnitScoreBytes;
-  double LastBitError = 10000.0;       /* Silly high number */
   ogg_uint32_t QIndex = Q_TABLE_SIZE - 1;
   ogg_uint32_t i;
 
-  /* Search for the best Q for the target bitrate. */
-  for ( i = 0; i < Q_TABLE_SIZE; i++ ) {
-    PredUnitScoreBytes = GetEstimatedBpb( cpi, cpi->pb.QThreshTable[i] );
-    if ( PredUnitScoreBytes > TargetUnitScoreBytes ) {
-      if ( (PredUnitScoreBytes - TargetUnitScoreBytes) <= LastBitError ) {
-        QIndex = i;
+  if ( UpdateScore > 0 ) {
+    double TargetUnitScoreBytes = (double)cpi->ThisFrameTargetBytes /
+      (double)UpdateScore;
+    double LastBitError = 10000.0;       /* Silly high number */
+    /* Search for the best Q for the target bitrate. */
+    for ( i = 0; i < Q_TABLE_SIZE; i++ ) {
+      PredUnitScoreBytes = GetEstimatedBpb( cpi, cpi->pb.QThreshTable[i] );
+      if ( PredUnitScoreBytes > TargetUnitScoreBytes ) {
+        if ( (PredUnitScoreBytes - TargetUnitScoreBytes) <= LastBitError ) {
+          QIndex = i;
+        } else {
+          QIndex = i - 1;
+        }
+        break;
       } else {
-        QIndex = i - 1;
+        LastBitError = TargetUnitScoreBytes - PredUnitScoreBytes;
       }
-      break;
-    } else {
-      LastBitError = TargetUnitScoreBytes - PredUnitScoreBytes;
     }
   }
 



More information about the commits mailing list