xref: /aosp_15_r20/external/libaom/aom_dsp/intrapred_common.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker /*
2*77c1e3ccSAndroid Build Coastguard Worker  * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3*77c1e3ccSAndroid Build Coastguard Worker  *
4*77c1e3ccSAndroid Build Coastguard Worker  * This source code is subject to the terms of the BSD 2 Clause License and
5*77c1e3ccSAndroid Build Coastguard Worker  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6*77c1e3ccSAndroid Build Coastguard Worker  * was not distributed with this source code in the LICENSE file, you can
7*77c1e3ccSAndroid Build Coastguard Worker  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8*77c1e3ccSAndroid Build Coastguard Worker  * Media Patent License 1.0 was not distributed with this source code in the
9*77c1e3ccSAndroid Build Coastguard Worker  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*77c1e3ccSAndroid Build Coastguard Worker  */
11*77c1e3ccSAndroid Build Coastguard Worker 
12*77c1e3ccSAndroid Build Coastguard Worker #ifndef AOM_AOM_DSP_INTRAPRED_COMMON_H_
13*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AOM_DSP_INTRAPRED_COMMON_H_
14*77c1e3ccSAndroid Build Coastguard Worker 
15*77c1e3ccSAndroid Build Coastguard Worker #include "config/aom_config.h"
16*77c1e3ccSAndroid Build Coastguard Worker 
17*77c1e3ccSAndroid Build Coastguard Worker // Weights are quadratic from '1' to '1 / block_size', scaled by
18*77c1e3ccSAndroid Build Coastguard Worker // 2^SMOOTH_WEIGHT_LOG2_SCALE.
19*77c1e3ccSAndroid Build Coastguard Worker #define SMOOTH_WEIGHT_LOG2_SCALE 8
20*77c1e3ccSAndroid Build Coastguard Worker 
21*77c1e3ccSAndroid Build Coastguard Worker // Note these arrays are aligned to ensure NEON loads using a cast to uint32_t*
22*77c1e3ccSAndroid Build Coastguard Worker // have sufficient alignment. Using 8 preserves the potential for an alignment
23*77c1e3ccSAndroid Build Coastguard Worker // hint in load_weight_w8(). For that case, this could be increased to 16 to
24*77c1e3ccSAndroid Build Coastguard Worker // allow an aligned load in x86.
25*77c1e3ccSAndroid Build Coastguard Worker DECLARE_ALIGNED(8, static const uint8_t, smooth_weights[]) = {
26*77c1e3ccSAndroid Build Coastguard Worker   // bs = 4
27*77c1e3ccSAndroid Build Coastguard Worker   255, 149, 85, 64,
28*77c1e3ccSAndroid Build Coastguard Worker   // bs = 8
29*77c1e3ccSAndroid Build Coastguard Worker   255, 197, 146, 105, 73, 50, 37, 32,
30*77c1e3ccSAndroid Build Coastguard Worker   // bs = 16
31*77c1e3ccSAndroid Build Coastguard Worker   255, 225, 196, 170, 145, 123, 102, 84, 68, 54, 43, 33, 26, 20, 17, 16,
32*77c1e3ccSAndroid Build Coastguard Worker   // bs = 32
33*77c1e3ccSAndroid Build Coastguard Worker   255, 240, 225, 210, 196, 182, 169, 157, 145, 133, 122, 111, 101, 92, 83, 74,
34*77c1e3ccSAndroid Build Coastguard Worker   66, 59, 52, 45, 39, 34, 29, 25, 21, 17, 14, 12, 10, 9, 8, 8,
35*77c1e3ccSAndroid Build Coastguard Worker   // bs = 64
36*77c1e3ccSAndroid Build Coastguard Worker   255, 248, 240, 233, 225, 218, 210, 203, 196, 189, 182, 176, 169, 163, 156,
37*77c1e3ccSAndroid Build Coastguard Worker   150, 144, 138, 133, 127, 121, 116, 111, 106, 101, 96, 91, 86, 82, 77, 73, 69,
38*77c1e3ccSAndroid Build Coastguard Worker   65, 61, 57, 54, 50, 47, 44, 41, 38, 35, 32, 29, 27, 25, 22, 20, 18, 16, 15,
39*77c1e3ccSAndroid Build Coastguard Worker   13, 12, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4
40*77c1e3ccSAndroid Build Coastguard Worker };
41*77c1e3ccSAndroid Build Coastguard Worker 
42*77c1e3ccSAndroid Build Coastguard Worker DECLARE_ALIGNED(8, static const uint16_t, smooth_weights_u16[]) = {
43*77c1e3ccSAndroid Build Coastguard Worker   // block dimension = 4
44*77c1e3ccSAndroid Build Coastguard Worker   255, 149, 85, 64,
45*77c1e3ccSAndroid Build Coastguard Worker   // block dimension = 8
46*77c1e3ccSAndroid Build Coastguard Worker   255, 197, 146, 105, 73, 50, 37, 32,
47*77c1e3ccSAndroid Build Coastguard Worker   // block dimension = 16
48*77c1e3ccSAndroid Build Coastguard Worker   255, 225, 196, 170, 145, 123, 102, 84, 68, 54, 43, 33, 26, 20, 17, 16,
49*77c1e3ccSAndroid Build Coastguard Worker   // block dimension = 32
50*77c1e3ccSAndroid Build Coastguard Worker   255, 240, 225, 210, 196, 182, 169, 157, 145, 133, 122, 111, 101, 92, 83, 74,
51*77c1e3ccSAndroid Build Coastguard Worker   66, 59, 52, 45, 39, 34, 29, 25, 21, 17, 14, 12, 10, 9, 8, 8,
52*77c1e3ccSAndroid Build Coastguard Worker   // block dimension = 64
53*77c1e3ccSAndroid Build Coastguard Worker   255, 248, 240, 233, 225, 218, 210, 203, 196, 189, 182, 176, 169, 163, 156,
54*77c1e3ccSAndroid Build Coastguard Worker   150, 144, 138, 133, 127, 121, 116, 111, 106, 101, 96, 91, 86, 82, 77, 73, 69,
55*77c1e3ccSAndroid Build Coastguard Worker   65, 61, 57, 54, 50, 47, 44, 41, 38, 35, 32, 29, 27, 25, 22, 20, 18, 16, 15,
56*77c1e3ccSAndroid Build Coastguard Worker   13, 12, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4
57*77c1e3ccSAndroid Build Coastguard Worker };
58*77c1e3ccSAndroid Build Coastguard Worker 
59*77c1e3ccSAndroid Build Coastguard Worker #endif  // AOM_AOM_DSP_INTRAPRED_COMMON_H_
60