[xiph-commits] r14624 - branches/theora-thusnelda/lib/enc
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Mon Mar 24 22:54:32 PDT 2008
Author: xiphmont
Date: 2008-03-24 22:54:31 -0700 (Mon, 24 Mar 2008)
New Revision: 14624
Modified:
branches/theora-thusnelda/lib/enc/dct_encode.c
branches/theora-thusnelda/lib/enc/mode.c
Log:
Correct a SAD collection bug that was causing poor choices on frame boundaries
Modified: branches/theora-thusnelda/lib/enc/dct_encode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/dct_encode.c 2008-03-25 05:02:48 UTC (rev 14623)
+++ branches/theora-thusnelda/lib/enc/dct_encode.c 2008-03-25 05:54:31 UTC (rev 14624)
@@ -232,7 +232,6 @@
prepended later. Group 0/Plane 0 is the exception (can't be
prepended) */
if(cpi->dct_token_count[plane][coeff] == 0 && (coeff||plane)){
-
/* prepending requires space to do so-- save some at front of token stack */
if(eob_pre[coeff]==0 || eob_pre[coeff]&0x8ff){ /* 0xfff is a safe overallocation,
saves a mod 4095 */
Modified: branches/theora-thusnelda/lib/enc/mode.c
===================================================================
--- branches/theora-thusnelda/lib/enc/mode.c 2008-03-25 05:02:48 UTC (rev 14623)
+++ branches/theora-thusnelda/lib/enc/mode.c 2008-03-25 05:54:31 UTC (rev 14624)
@@ -315,7 +315,7 @@
int mx2 = mvmap2[qp][mv.x+31];
int my2 = mvmap2[qp][mv.y+31];
int stride = cpi->stride[plane];
- unsigned char *r = (goldenp ? cpi->golden : cpi->recon ) +
+ unsigned char *r = (goldenp ? cpi->golden : cpi->lastrecon ) +
cpi->frag_buffer_index[fi] + my * stride + mx;
int j,k;
@@ -528,11 +528,11 @@
cost[CODE_USING_GOLDEN] = MBInterCost420(cpi,qi,mbi,(mv_t){0,0},1);
cost[CODE_GOLDEN_MV] = MBInterCost420(cpi,qi,mbi,mb->analysis_mv[0][1],1);
cost[CODE_INTER_FOURMV] = MBInter4Cost420(cpi,qi,mbi,mb->mv,0);
-
+
/* add estimated labelling cost for each mode */
for(i = 0; i < 8; i++)
cost[i] += oc_mode_cost(cpi,i) << OC_BIT_SCALE;
-
+
/* Add the motion vector bits for each mode that requires them.*/
mb_mv_bits_0 = MvBits[mb->analysis_mv[0][0].x + MAX_MV_EXTENT] +
MvBits[mb->analysis_mv[0][0].y + MAX_MV_EXTENT];
@@ -588,7 +588,7 @@
/* add back such that inter/intra counting are relatively correct */
cost[CODE_INTER_PLUS_MV] += 384;
-
+
switch(mode){
case CODE_INTER_PLUS_MV:
cpi->MVBits_0 += mb_mv_bits_0;
More information about the commits
mailing list