1 /*
2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 
12 #include "vpx_config.h"
13 #include "vp8_rtcd.h"
14 #include "vp8/encoder/block.h"
15 #include <math.h>
16 #include "vpx_mem/vpx_mem.h"
17 #include "vp8/encoder/quantize.h"
18 #include "vp8/common/entropy.h"
19 
20 
21 #if HAVE_NEON
22 
23 /* vp8_quantize_mbX functions here differs from corresponding ones in
24  * quantize.c only by using quantize_b_pair function pointer instead of
25  * the regular quantize_b function pointer */
vp8_quantize_mby_neon(MACROBLOCK * x)26 void vp8_quantize_mby_neon(MACROBLOCK *x)
27 {
28     int i;
29     int has_2nd_order = (x->e_mbd.mode_info_context->mbmi.mode != B_PRED
30         && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
31 
32     for (i = 0; i < 16; i+=2)
33         x->quantize_b_pair(&x->block[i], &x->block[i+1],
34                            &x->e_mbd.block[i], &x->e_mbd.block[i+1]);
35 
36     if(has_2nd_order)
37         x->quantize_b(&x->block[24], &x->e_mbd.block[24]);
38 }
39 
vp8_quantize_mb_neon(MACROBLOCK * x)40 void vp8_quantize_mb_neon(MACROBLOCK *x)
41 {
42     int i;
43     int has_2nd_order=(x->e_mbd.mode_info_context->mbmi.mode != B_PRED
44         && x->e_mbd.mode_info_context->mbmi.mode != SPLITMV);
45 
46     for (i = 0; i < 24; i+=2)
47         x->quantize_b_pair(&x->block[i], &x->block[i+1],
48                            &x->e_mbd.block[i], &x->e_mbd.block[i+1]);
49 
50     if (has_2nd_order)
51         x->quantize_b(&x->block[24], &x->e_mbd.block[24]);
52 }
53 
54 
vp8_quantize_mbuv_neon(MACROBLOCK * x)55 void vp8_quantize_mbuv_neon(MACROBLOCK *x)
56 {
57     int i;
58 
59     for (i = 16; i < 24; i+=2)
60         x->quantize_b_pair(&x->block[i], &x->block[i+1],
61                            &x->e_mbd.block[i], &x->e_mbd.block[i+1]);
62 }
63 
64 #endif /* HAVE_NEON */
65