Merge Exact Quant
Change-Id: Id2412a7f24a7c1016ec9fc3b9b0fbd16871f374a
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
extern int enc_debug;
|
||||
#endif
|
||||
|
||||
#define EXACT_QUANT
|
||||
void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d)
|
||||
{
|
||||
int i, rc, eob;
|
||||
@@ -58,9 +57,6 @@ void vp8_fast_quantize_b_c(BLOCK *b, BLOCKD *d)
|
||||
d->eob = eob + 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef EXACT_QUANT
|
||||
void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d)
|
||||
{
|
||||
int i, rc, eob;
|
||||
@@ -173,64 +169,6 @@ void vp8_strict_quantize_b(BLOCK *b, BLOCKD *d)
|
||||
d->eob = eob + 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d)
|
||||
{
|
||||
int i, rc, eob;
|
||||
int zbin;
|
||||
int x, y, z, sz;
|
||||
short *zbin_boost_ptr = b->zrun_zbin_boost;
|
||||
short *coeff_ptr = b->coeff;
|
||||
short *zbin_ptr = b->zbin;
|
||||
short *round_ptr = b->round;
|
||||
short *quant_ptr = b->quant;
|
||||
short *qcoeff_ptr = d->qcoeff;
|
||||
short *dqcoeff_ptr = d->dqcoeff;
|
||||
short *dequant_ptr = d->dequant;
|
||||
short zbin_oq_value = b->zbin_extra;
|
||||
|
||||
vpx_memset(qcoeff_ptr, 0, 32);
|
||||
vpx_memset(dqcoeff_ptr, 0, 32);
|
||||
|
||||
eob = -1;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
rc = vp8_default_zig_zag1d[i];
|
||||
z = coeff_ptr[rc];
|
||||
|
||||
//if ( i == 0 )
|
||||
// zbin = zbin_ptr[rc] + *zbin_boost_ptr + zbin_oq_value/2;
|
||||
//else
|
||||
zbin = zbin_ptr[rc] + *zbin_boost_ptr + zbin_oq_value;
|
||||
|
||||
zbin_boost_ptr ++;
|
||||
sz = (z >> 31); // sign of z
|
||||
x = (z ^ sz) - sz; // x = abs(z)
|
||||
|
||||
if (x >= zbin)
|
||||
{
|
||||
y = ((x + round_ptr[rc]) * quant_ptr[rc]) >> 16; // quantize (x)
|
||||
x = (y ^ sz) - sz; // get the sign back
|
||||
qcoeff_ptr[rc] = x; // write to destination
|
||||
dqcoeff_ptr[rc] = x * dequant_ptr[rc]; // dequantized value
|
||||
|
||||
if (y)
|
||||
{
|
||||
eob = i; // last nonzero coeffs
|
||||
zbin_boost_ptr = &b->zrun_zbin_boost[0]; // reset zero runlength
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
d->eob = eob + 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
//EXACT_QUANT
|
||||
|
||||
|
||||
void vp8_quantize_mby_c(MACROBLOCK *x)
|
||||
{
|
||||
int i;
|
||||
@@ -668,8 +606,6 @@ void vp8_fast_quantize_b_pair_c(BLOCK *b1, BLOCK *b2, BLOCKD *d1, BLOCKD *d2)
|
||||
}
|
||||
|
||||
|
||||
#define EXACT_QUANT
|
||||
#ifdef EXACT_QUANT
|
||||
static void invert_quant(int improved_quant, short *quant,
|
||||
unsigned char *shift, short d)
|
||||
{
|
||||
@@ -767,8 +703,6 @@ void vp8cx_init_quantizer(VP8_COMP *cpi)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x)
|
||||
{
|
||||
|
Reference in New Issue
Block a user