[xiph-commits] r15165 - branches/theora-thusnelda/lib/enc
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Thu Aug 7 20:11:22 PDT 2008
Author: xiphmont
Date: 2008-08-07 20:11:22 -0700 (Thu, 07 Aug 2008)
New Revision: 15165
Modified:
branches/theora-thusnelda/lib/enc/codec_internal.h
branches/theora-thusnelda/lib/enc/dct_encode.c
branches/theora-thusnelda/lib/enc/mode.c
Log:
Correct additional minor errors in mode cost training code (from
updating to handle new code flow). All good now.
Modified: branches/theora-thusnelda/lib/enc/codec_internal.h
===================================================================
--- branches/theora-thusnelda/lib/enc/codec_internal.h 2008-08-07 05:30:54 UTC (rev 15164)
+++ branches/theora-thusnelda/lib/enc/codec_internal.h 2008-08-08 03:11:22 UTC (rev 15165)
@@ -326,6 +326,9 @@
int chroma;
int pre;
int run;
+#ifdef COLLECT_METRICS
+ int runstack;
+#endif
} token_checkpoint_t;
extern void tokenlog_commit(CP_INSTANCE *cpi,
Modified: branches/theora-thusnelda/lib/enc/dct_encode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dct_encode.c 2008-08-07 05:30:54 UTC (rev 15164)
+++ branches/theora-thusnelda/lib/enc/dct_encode.c 2008-08-08 03:11:22 UTC (rev 15165)
@@ -231,6 +231,9 @@
if(stack[i].count>=0) cpi->dct_token_count[coeff] = stack[i].count;
cpi->eob_run[coeff] = stack[i].run;
cpi->eob_pre[coeff] = stack[i].pre;
+#ifdef COLLECT_METRICS
+ cpi->dct_eob_fi_count[coeff] = stack[i].runstack;
+#endif
}
}
@@ -271,6 +274,9 @@
(*stack)->count = -1;
(*stack)->run = cpi->eob_run[coeff];
(*stack)->pre = cpi->eob_pre[coeff];
+#ifdef COLLECT_METRICS
+ (*stack)->runstack = cpi->dct_eob_fi_count[coeff];
+#endif
(*stack)++;
}
@@ -286,6 +292,9 @@
(*stack)->chroma = chroma;
(*stack)->run = cpi->eob_run[coeff];
(*stack)->pre = cpi->eob_pre[coeff];
+#ifdef COLLECT_METRICS
+ (*stack)->runstack = cpi->dct_eob_fi_count[coeff];
+#endif
(*stack)++;
}else{
tokenlog_metrics(cpi,coeff,chroma,token);
@@ -501,8 +510,6 @@
/* we have a winner. Demote token */
dct[i]=dval;
- // perhaps a continue here is best; try it later
-
if(dval==0){
if(j==BLOCK_SIZE){
tokenize_mark_run(cpi,chroma,fi,coeff>1,coeff,stack);
Modified: branches/theora-thusnelda/lib/enc/mode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/mode.c 2008-08-07 05:30:54 UTC (rev 15164)
+++ branches/theora-thusnelda/lib/enc/mode.c 2008-08-08 03:11:22 UTC (rev 15165)
@@ -1346,7 +1346,7 @@
ModeMetricsGroup(cpi, gi, huff[2]+AC_HUFF_CHOICES*3, huff[2]+AC_HUFF_CHOICES*3, eobcounts, actual_bits);
/* accumulate */
- for(fi=0;fi<v;fi++){
+ for(fi=0;fi<v;fi++)
if(cp[fi]){
macroblock_t *mb = &cpi->macro[mp[fi]];
int mode = mb->mode;
More information about the commits
mailing list