1*09537850SAkhilesh Sanikop // Copyright 2019 The libgav1 Authors
2*09537850SAkhilesh Sanikop //
3*09537850SAkhilesh Sanikop // Licensed under the Apache License, Version 2.0 (the "License");
4*09537850SAkhilesh Sanikop // you may not use this file except in compliance with the License.
5*09537850SAkhilesh Sanikop // You may obtain a copy of the License at
6*09537850SAkhilesh Sanikop //
7*09537850SAkhilesh Sanikop // http://www.apache.org/licenses/LICENSE-2.0
8*09537850SAkhilesh Sanikop //
9*09537850SAkhilesh Sanikop // Unless required by applicable law or agreed to in writing, software
10*09537850SAkhilesh Sanikop // distributed under the License is distributed on an "AS IS" BASIS,
11*09537850SAkhilesh Sanikop // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*09537850SAkhilesh Sanikop // See the License for the specific language governing permissions and
13*09537850SAkhilesh Sanikop // limitations under the License.
14*09537850SAkhilesh Sanikop
15*09537850SAkhilesh Sanikop #include "src/dsp/weight_mask.h"
16*09537850SAkhilesh Sanikop
17*09537850SAkhilesh Sanikop #include <algorithm>
18*09537850SAkhilesh Sanikop #include <cassert>
19*09537850SAkhilesh Sanikop #include <cstddef>
20*09537850SAkhilesh Sanikop #include <cstdint>
21*09537850SAkhilesh Sanikop #include <string>
22*09537850SAkhilesh Sanikop #include <type_traits>
23*09537850SAkhilesh Sanikop
24*09537850SAkhilesh Sanikop #include "src/dsp/dsp.h"
25*09537850SAkhilesh Sanikop #include "src/utils/common.h"
26*09537850SAkhilesh Sanikop
27*09537850SAkhilesh Sanikop namespace libgav1 {
28*09537850SAkhilesh Sanikop namespace dsp {
29*09537850SAkhilesh Sanikop namespace {
30*09537850SAkhilesh Sanikop
31*09537850SAkhilesh Sanikop template <int width, int height, int bitdepth, bool mask_is_inverse>
WeightMask_C(const void * LIBGAV1_RESTRICT prediction_0,const void * LIBGAV1_RESTRICT prediction_1,uint8_t * LIBGAV1_RESTRICT mask,ptrdiff_t mask_stride)32*09537850SAkhilesh Sanikop void WeightMask_C(const void* LIBGAV1_RESTRICT prediction_0,
33*09537850SAkhilesh Sanikop const void* LIBGAV1_RESTRICT prediction_1,
34*09537850SAkhilesh Sanikop uint8_t* LIBGAV1_RESTRICT mask, ptrdiff_t mask_stride) {
35*09537850SAkhilesh Sanikop using PredType =
36*09537850SAkhilesh Sanikop typename std::conditional<bitdepth == 8, int16_t, uint16_t>::type;
37*09537850SAkhilesh Sanikop const auto* pred_0 = static_cast<const PredType*>(prediction_0);
38*09537850SAkhilesh Sanikop const auto* pred_1 = static_cast<const PredType*>(prediction_1);
39*09537850SAkhilesh Sanikop static_assert(width >= 8, "");
40*09537850SAkhilesh Sanikop static_assert(height >= 8, "");
41*09537850SAkhilesh Sanikop constexpr int rounding_bits = bitdepth - 8 + ((bitdepth == 12) ? 2 : 4);
42*09537850SAkhilesh Sanikop for (int y = 0; y < height; ++y) {
43*09537850SAkhilesh Sanikop for (int x = 0; x < width; ++x) {
44*09537850SAkhilesh Sanikop const int difference = RightShiftWithRounding(
45*09537850SAkhilesh Sanikop std::abs(pred_0[x] - pred_1[x]), rounding_bits);
46*09537850SAkhilesh Sanikop const auto mask_value =
47*09537850SAkhilesh Sanikop static_cast<uint8_t>(std::min(DivideBy16(difference) + 38, 64));
48*09537850SAkhilesh Sanikop mask[x] = mask_is_inverse ? 64 - mask_value : mask_value;
49*09537850SAkhilesh Sanikop }
50*09537850SAkhilesh Sanikop pred_0 += width;
51*09537850SAkhilesh Sanikop pred_1 += width;
52*09537850SAkhilesh Sanikop mask += mask_stride;
53*09537850SAkhilesh Sanikop }
54*09537850SAkhilesh Sanikop }
55*09537850SAkhilesh Sanikop
56*09537850SAkhilesh Sanikop #define INIT_WEIGHT_MASK(width, height, bitdepth, w_index, h_index) \
57*09537850SAkhilesh Sanikop dsp->weight_mask[w_index][h_index][0] = \
58*09537850SAkhilesh Sanikop WeightMask_C<width, height, bitdepth, 0>; \
59*09537850SAkhilesh Sanikop dsp->weight_mask[w_index][h_index][1] = \
60*09537850SAkhilesh Sanikop WeightMask_C<width, height, bitdepth, 1>
61*09537850SAkhilesh Sanikop
Init8bpp()62*09537850SAkhilesh Sanikop void Init8bpp() {
63*09537850SAkhilesh Sanikop Dsp* const dsp = dsp_internal::GetWritableDspTable(8);
64*09537850SAkhilesh Sanikop assert(dsp != nullptr);
65*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
66*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 8, 8, 0, 0);
67*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 16, 8, 0, 1);
68*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 32, 8, 0, 2);
69*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 8, 8, 1, 0);
70*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 16, 8, 1, 1);
71*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 32, 8, 1, 2);
72*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 64, 8, 1, 3);
73*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 8, 8, 2, 0);
74*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 16, 8, 2, 1);
75*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 32, 8, 2, 2);
76*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 64, 8, 2, 3);
77*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 16, 8, 3, 1);
78*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 32, 8, 3, 2);
79*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 64, 8, 3, 3);
80*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 128, 8, 3, 4);
81*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 64, 8, 4, 3);
82*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 128, 8, 4, 4);
83*09537850SAkhilesh Sanikop #else // !LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
84*09537850SAkhilesh Sanikop static_cast<void>(dsp);
85*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_8x8
86*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 8, 8, 0, 0);
87*09537850SAkhilesh Sanikop #endif
88*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_8x16
89*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 16, 8, 0, 1);
90*09537850SAkhilesh Sanikop #endif
91*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_8x32
92*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 32, 8, 0, 2);
93*09537850SAkhilesh Sanikop #endif
94*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_16x8
95*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 8, 8, 1, 0);
96*09537850SAkhilesh Sanikop #endif
97*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_16x16
98*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 16, 8, 1, 1);
99*09537850SAkhilesh Sanikop #endif
100*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_16x32
101*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 32, 8, 1, 2);
102*09537850SAkhilesh Sanikop #endif
103*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_16x64
104*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 64, 8, 1, 3);
105*09537850SAkhilesh Sanikop #endif
106*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_32x8
107*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 8, 8, 2, 0);
108*09537850SAkhilesh Sanikop #endif
109*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_32x16
110*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 16, 8, 2, 1);
111*09537850SAkhilesh Sanikop #endif
112*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_32x32
113*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 32, 8, 2, 2);
114*09537850SAkhilesh Sanikop #endif
115*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_32x64
116*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 64, 8, 2, 3);
117*09537850SAkhilesh Sanikop #endif
118*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_64x16
119*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 16, 8, 3, 1);
120*09537850SAkhilesh Sanikop #endif
121*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_64x32
122*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 32, 8, 3, 2);
123*09537850SAkhilesh Sanikop #endif
124*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_64x64
125*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 64, 8, 3, 3);
126*09537850SAkhilesh Sanikop #endif
127*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_64x128
128*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 128, 8, 3, 4);
129*09537850SAkhilesh Sanikop #endif
130*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_128x64
131*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 64, 8, 4, 3);
132*09537850SAkhilesh Sanikop #endif
133*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp8bpp_WeightMask_128x128
134*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 128, 8, 4, 4);
135*09537850SAkhilesh Sanikop #endif
136*09537850SAkhilesh Sanikop #endif // LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
137*09537850SAkhilesh Sanikop }
138*09537850SAkhilesh Sanikop
139*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
Init10bpp()140*09537850SAkhilesh Sanikop void Init10bpp() {
141*09537850SAkhilesh Sanikop Dsp* const dsp = dsp_internal::GetWritableDspTable(10);
142*09537850SAkhilesh Sanikop assert(dsp != nullptr);
143*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
144*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 8, 10, 0, 0);
145*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 16, 10, 0, 1);
146*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 32, 10, 0, 2);
147*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 8, 10, 1, 0);
148*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 16, 10, 1, 1);
149*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 32, 10, 1, 2);
150*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 64, 10, 1, 3);
151*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 8, 10, 2, 0);
152*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 16, 10, 2, 1);
153*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 32, 10, 2, 2);
154*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 64, 10, 2, 3);
155*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 16, 10, 3, 1);
156*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 32, 10, 3, 2);
157*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 64, 10, 3, 3);
158*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 128, 10, 3, 4);
159*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 64, 10, 4, 3);
160*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 128, 10, 4, 4);
161*09537850SAkhilesh Sanikop #else // !LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
162*09537850SAkhilesh Sanikop static_cast<void>(dsp);
163*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_8x8
164*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 8, 10, 0, 0);
165*09537850SAkhilesh Sanikop #endif
166*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_8x16
167*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 16, 10, 0, 1);
168*09537850SAkhilesh Sanikop #endif
169*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_8x32
170*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 32, 10, 0, 2);
171*09537850SAkhilesh Sanikop #endif
172*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_16x8
173*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 8, 10, 1, 0);
174*09537850SAkhilesh Sanikop #endif
175*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_16x16
176*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 16, 10, 1, 1);
177*09537850SAkhilesh Sanikop #endif
178*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_16x32
179*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 32, 10, 1, 2);
180*09537850SAkhilesh Sanikop #endif
181*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_16x64
182*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 64, 10, 1, 3);
183*09537850SAkhilesh Sanikop #endif
184*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_32x8
185*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 8, 10, 2, 0);
186*09537850SAkhilesh Sanikop #endif
187*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_32x16
188*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 16, 10, 2, 1);
189*09537850SAkhilesh Sanikop #endif
190*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_32x32
191*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 32, 10, 2, 2);
192*09537850SAkhilesh Sanikop #endif
193*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_32x64
194*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 64, 10, 2, 3);
195*09537850SAkhilesh Sanikop #endif
196*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_64x16
197*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 16, 10, 3, 1);
198*09537850SAkhilesh Sanikop #endif
199*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_64x32
200*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 32, 10, 3, 2);
201*09537850SAkhilesh Sanikop #endif
202*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_64x64
203*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 64, 10, 3, 3);
204*09537850SAkhilesh Sanikop #endif
205*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_64x128
206*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 128, 10, 3, 4);
207*09537850SAkhilesh Sanikop #endif
208*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_128x64
209*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 64, 10, 4, 3);
210*09537850SAkhilesh Sanikop #endif
211*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp10bpp_WeightMask_128x128
212*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 128, 10, 4, 4);
213*09537850SAkhilesh Sanikop #endif
214*09537850SAkhilesh Sanikop #endif // LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
215*09537850SAkhilesh Sanikop }
216*09537850SAkhilesh Sanikop #endif // LIBGAV1_MAX_BITDEPTH >= 10
217*09537850SAkhilesh Sanikop
218*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
Init12bpp()219*09537850SAkhilesh Sanikop void Init12bpp() {
220*09537850SAkhilesh Sanikop Dsp* const dsp = dsp_internal::GetWritableDspTable(12);
221*09537850SAkhilesh Sanikop assert(dsp != nullptr);
222*09537850SAkhilesh Sanikop #if LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
223*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 8, 12, 0, 0);
224*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 16, 12, 0, 1);
225*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 32, 12, 0, 2);
226*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 8, 12, 1, 0);
227*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 16, 12, 1, 1);
228*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 32, 12, 1, 2);
229*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 64, 12, 1, 3);
230*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 8, 12, 2, 0);
231*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 16, 12, 2, 1);
232*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 32, 12, 2, 2);
233*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 64, 12, 2, 3);
234*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 16, 12, 3, 1);
235*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 32, 12, 3, 2);
236*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 64, 12, 3, 3);
237*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 128, 12, 3, 4);
238*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 64, 12, 4, 3);
239*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 128, 12, 4, 4);
240*09537850SAkhilesh Sanikop #else // !LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
241*09537850SAkhilesh Sanikop static_cast<void>(dsp);
242*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_8x8
243*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 8, 12, 0, 0);
244*09537850SAkhilesh Sanikop #endif
245*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_8x16
246*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 16, 12, 0, 1);
247*09537850SAkhilesh Sanikop #endif
248*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_8x32
249*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(8, 32, 12, 0, 2);
250*09537850SAkhilesh Sanikop #endif
251*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_16x8
252*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 8, 12, 1, 0);
253*09537850SAkhilesh Sanikop #endif
254*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_16x16
255*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 16, 12, 1, 1);
256*09537850SAkhilesh Sanikop #endif
257*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_16x32
258*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 32, 12, 1, 2);
259*09537850SAkhilesh Sanikop #endif
260*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_16x64
261*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(16, 64, 12, 1, 3);
262*09537850SAkhilesh Sanikop #endif
263*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_32x8
264*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 8, 12, 2, 0);
265*09537850SAkhilesh Sanikop #endif
266*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_32x16
267*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 16, 12, 2, 1);
268*09537850SAkhilesh Sanikop #endif
269*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_32x32
270*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 32, 12, 2, 2);
271*09537850SAkhilesh Sanikop #endif
272*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_32x64
273*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(32, 64, 12, 2, 3);
274*09537850SAkhilesh Sanikop #endif
275*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_64x16
276*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 16, 12, 3, 1);
277*09537850SAkhilesh Sanikop #endif
278*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_64x32
279*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 32, 12, 3, 2);
280*09537850SAkhilesh Sanikop #endif
281*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_64x64
282*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 64, 12, 3, 3);
283*09537850SAkhilesh Sanikop #endif
284*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_64x128
285*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(64, 128, 12, 3, 4);
286*09537850SAkhilesh Sanikop #endif
287*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_128x64
288*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 64, 12, 4, 3);
289*09537850SAkhilesh Sanikop #endif
290*09537850SAkhilesh Sanikop #ifndef LIBGAV1_Dsp12bpp_WeightMask_128x128
291*09537850SAkhilesh Sanikop INIT_WEIGHT_MASK(128, 128, 12, 4, 4);
292*09537850SAkhilesh Sanikop #endif
293*09537850SAkhilesh Sanikop #endif // LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
294*09537850SAkhilesh Sanikop }
295*09537850SAkhilesh Sanikop #endif // LIBGAV1_MAX_BITDEPTH == 12
296*09537850SAkhilesh Sanikop
297*09537850SAkhilesh Sanikop } // namespace
298*09537850SAkhilesh Sanikop
WeightMaskInit_C()299*09537850SAkhilesh Sanikop void WeightMaskInit_C() {
300*09537850SAkhilesh Sanikop Init8bpp();
301*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH >= 10
302*09537850SAkhilesh Sanikop Init10bpp();
303*09537850SAkhilesh Sanikop #endif
304*09537850SAkhilesh Sanikop #if LIBGAV1_MAX_BITDEPTH == 12
305*09537850SAkhilesh Sanikop Init12bpp();
306*09537850SAkhilesh Sanikop #endif
307*09537850SAkhilesh Sanikop }
308*09537850SAkhilesh Sanikop
309*09537850SAkhilesh Sanikop } // namespace dsp
310*09537850SAkhilesh Sanikop } // namespace libgav1
311