Commit 3225b893 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

minor cleanup of quantizer and fdct code

Change-Id: I7ccc580410bea096a70dce0cc3d455348d4287c5
parent 4bb895e8
......@@ -102,7 +102,6 @@ typedef struct
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);
......
......@@ -260,7 +260,6 @@ static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc)
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;
......
......@@ -1144,7 +1144,6 @@ void vp8_set_speed_features(VP8_COMP *cpi)
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)
......
......@@ -56,9 +56,7 @@ void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d)
}
}
}
d->eob = eob + 1;
}
void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d)
......@@ -112,61 +110,40 @@ void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d)
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);
}
}
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);
}
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));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment