ref: 3225b893e80627aa95e924ec789468db6c38f82c
parent: 4bb895e85401d81d7dd2615380309812edfefc5e
author: Yaowu Xu <yaowu@google.com>
date: Tue Jun 8 09:32:15 EDT 2010
minor cleanup of quantizer and fdct code Change-Id: I7ccc580410bea096a70dce0cc3d455348d4287c5
--- a/vp8/encoder/block.h
+++ b/vp8/encoder/block.h
@@ -102,7 +102,6 @@
void (*vp8_short_fdct8x4)(short *input, short *output, int pitch);
void (*short_fdct4x4rd)(short *input, short *output, int pitch);
void (*short_fdct8x4rd)(short *input, short *output, int pitch);
- void (*vp8_short_fdct4x4_ptr)(short *input, short *output, int pitch);
void (*short_walsh4x4)(short *input, short *output, int pitch);
void (*quantize_b)(BLOCK *b, BLOCKD *d);
--- a/vp8/encoder/ethreading.c
+++ b/vp8/encoder/ethreading.c
@@ -260,7 +260,6 @@
z->short_fdct4x4rd = x->short_fdct4x4rd;
z->short_fdct8x4rd = x->short_fdct8x4rd;
z->short_fdct8x4rd = x->short_fdct8x4rd;
- z->vp8_short_fdct4x4_ptr = x->vp8_short_fdct4x4_ptr;
z->short_walsh4x4 = x->short_walsh4x4;
z->quantize_b = x->quantize_b;
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -1144,7 +1144,6 @@
cpi->mb.short_fdct4x4rd = FDCT_INVOKE(&cpi->rtcd.fdct, fast4x4);
}
- cpi->mb.vp8_short_fdct4x4_ptr = FDCT_INVOKE(&cpi->rtcd.fdct, short4x4);
cpi->mb.short_walsh4x4 = FDCT_INVOKE(&cpi->rtcd.fdct, walsh_short4x4);
if (cpi->sf.improved_quant)
--- a/vp8/encoder/quantize.c
+++ b/vp8/encoder/quantize.c
@@ -56,9 +56,7 @@
}
}
}
-
d->eob = eob + 1;
-
}
void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d)
@@ -112,61 +110,40 @@
d->eob = eob + 1;
}
+
void vp8_quantize_mby(MACROBLOCK *x)
{
int i;
+ int has_2nd_order = (x->e_mbd.mbmi.mode != B_PRED
+ && x->e_mbd.mbmi.mode != SPLITMV);
- if (x->e_mbd.mbmi.mode != B_PRED && x->e_mbd.mbmi.mode != SPLITMV)
+ for (i = 0; i < 16; i++)
{
- for (i = 0; i < 16; i++)
- {
- x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
- x->e_mbd.mbmi.mb_skip_coeff &= (x->e_mbd.block[i].eob < 2);
- }
+ x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
+ x->e_mbd.mbmi.mb_skip_coeff &=
+ (x->e_mbd.block[i].eob <= has_2nd_order);
+ }
+ if(has_2nd_order)
+ {
x->quantize_b(&x->block[24], &x->e_mbd.block[24]);
x->e_mbd.mbmi.mb_skip_coeff &= (!x->e_mbd.block[24].eob);
-
}
- else
- {
- for (i = 0; i < 16; i++)
- {
- x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
- x->e_mbd.mbmi.mb_skip_coeff &= (!x->e_mbd.block[i].eob);
- }
- }
}
void vp8_quantize_mb(MACROBLOCK *x)
{
int i;
+ int has_2nd_order=(x->e_mbd.mbmi.mode != B_PRED
+ && x->e_mbd.mbmi.mode != SPLITMV);
x->e_mbd.mbmi.mb_skip_coeff = 1;
-
- if (x->e_mbd.mbmi.mode != B_PRED && x->e_mbd.mbmi.mode != SPLITMV)
+ for (i = 0; i < 24+has_2nd_order; i++)
{
- for (i = 0; i < 16; i++)
- {
- x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
- x->e_mbd.mbmi.mb_skip_coeff &= (x->e_mbd.block[i].eob < 2);
- }
-
- for (i = 16; i < 25; i++)
- {
- x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
- x->e_mbd.mbmi.mb_skip_coeff &= (!x->e_mbd.block[i].eob);
- }
+ x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
+ x->e_mbd.mbmi.mb_skip_coeff &=
+ (x->e_mbd.block[i].eob <= (has_2nd_order && i<16));
}
- else
- {
- for (i = 0; i < 24; i++)
- {
- x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
- x->e_mbd.mbmi.mb_skip_coeff &= (!x->e_mbd.block[i].eob);
- }
- }
-
}