| Index: source/libvpx/vp8/encoder/arm/quantize_arm.c
|
| ===================================================================
|
| --- source/libvpx/vp8/encoder/arm/quantize_arm.c (revision 96967)
|
| +++ source/libvpx/vp8/encoder/arm/quantize_arm.c (working copy)
|
| @@ -15,65 +15,48 @@
|
| #include "vp8/encoder/quantize.h"
|
| #include "vp8/common/entropy.h"
|
|
|
| -DECLARE_ALIGNED(16, const short, vp8_rvsplus1_default_zig_zag1d[16]) =
|
| -{
|
| - 1, 2, 6, 7,
|
| - 3, 5, 8, 13,
|
| - 4, 9, 12, 14,
|
| - 10, 11, 15, 16,
|
| -};
|
|
|
| +#if HAVE_ARMV7
|
|
|
| -extern int vp8_fast_quantize_b_neon_func(short *coeff_ptr, short *zbin_ptr, short *qcoeff_ptr, short *dqcoeff_ptr, short *dequant_ptr, const short *scan_mask, short *round_ptr, short *quant_ptr);
|
| -
|
| -void vp8_fast_quantize_b_neon(BLOCK *b, BLOCKD *d)
|
| +/* vp8_quantize_mbX functions here differs from corresponding ones in
|
| + * quantize.c only by using quantize_b_pair function pointer instead of
|
| + * the regular quantize_b function pointer */
|
| +void vp8_quantize_mby_neon(MACROBLOCK *x)
|
| {
|
| - d->eob = vp8_fast_quantize_b_neon_func(b->coeff, b->zbin, d->qcoeff, d->dqcoeff, d->dequant, vp8_rvsplus1_default_zig_zag1d, b->round, b->quant_fast);
|
| + int i;
|
| + int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
|
| + && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
|
| +
|
| + for (i = 0; i < 16; i+=2)
|
| + x->quantize_b_pair(&x->block[i], &x->block[i+1],
|
| + &x->e_mbd.block[i], &x->e_mbd.block[i+1]);
|
| +
|
| + if(has_2nd_order)
|
| + x->quantize_b(&x->block[24], &x->e_mbd.block[24]);
|
| }
|
|
|
| -/*
|
| -//neon code is written according to the following rewritten c code
|
| -void vp8_fast_quantize_b_neon(BLOCK *b,BLOCKD *d)
|
| +void vp8_quantize_mb_neon(MACROBLOCK *x)
|
| {
|
| - int i, rc, eob;
|
| - int zbin;
|
| - int x, x1, y, z, sz;
|
| - short *coeff_ptr = &b->Coeff[0];
|
| - short *zbin_ptr = &b->Zbin[0][0];
|
| - short *round_ptr = &b->Round[0][0];
|
| - short *quant_ptr = &b->Quant[0][0];
|
| - short *qcoeff_ptr = d->qcoeff;
|
| - short *dqcoeff_ptr= d->dqcoeff;
|
| - short *dequant_ptr= &d->Dequant[0][0];
|
| + int i;
|
| + int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED
|
| + && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
|
|
|
| - eob = 0;
|
| + for (i = 0; i < 24; i+=2)
|
| + x->quantize_b_pair(&x->block[i], &x->block[i+1],
|
| + &x->e_mbd.block[i], &x->e_mbd.block[i+1]);
|
|
|
| - for(i=0;i<16;i++)
|
| - {
|
| - z = coeff_ptr[i];
|
| - zbin = zbin_ptr[i] ;
|
| - x = abs(z); // x = abs(z)
|
| + if (has_2nd_order)
|
| + x->quantize_b(&x->block[i], &x->e_mbd.block[i]);
|
| +}
|
|
|
| - if(x>=zbin)
|
| - {
|
| - sz = (z>>31); // sign of z
|
| - y = ((x+round_ptr[i])*quant_ptr[i])>>16; // quantize (x)
|
| - x1 = (y^sz) - sz; // get the sign back
|
|
|
| - qcoeff_ptr[i] = x1; // write to destination
|
| - dqcoeff_ptr[i] = x1 * dequant_ptr[i]; // dequantized value
|
| +void vp8_quantize_mbuv_neon(MACROBLOCK *x)
|
| +{
|
| + int i;
|
|
|
| - if(y)
|
| - {
|
| - if(eob<vp8_rvsplus1_default_zig_zag1d[i])
|
| - eob=(int)vp8_rvsplus1_default_zig_zag1d[i]; // last nonzero coeffs
|
| - }
|
| - }else
|
| - {
|
| - qcoeff_ptr[i] = 0; // write to destination
|
| - dqcoeff_ptr[i] = 0; // dequantized value
|
| - }
|
| - }
|
| - d->eob = eob;
|
| + for (i = 16; i < 24; i+=2)
|
| + x->quantize_b_pair(&x->block[i], &x->block[i+1],
|
| + &x->e_mbd.block[i], &x->e_mbd.block[i+1]);
|
| }
|
| -*/
|
| +
|
| +#endif /* HAVE_ARMV7 */
|
|
|