1 // Copyright 2021 The libgav1 Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include "src/dsp/intrapred_smooth.h"
16
17 #include <algorithm>
18 #include <cassert>
19 #include <cstddef>
20 #include <cstdlib>
21 #include <cstring>
22
23 #include "src/dsp/constants.h"
24 #include "src/dsp/dsp.h"
25 #include "src/utils/common.h"
26 #include "src/utils/constants.h"
27
28 namespace libgav1 {
29 namespace dsp {
30 namespace {
31
32 template <int block_width, int block_height, typename Pixel>
33 struct SmoothFuncs_C {
34 SmoothFuncs_C() = delete;
35
36 static void Smooth(void* dest, ptrdiff_t stride, const void* top_row,
37 const void* left_column);
38 static void SmoothVertical(void* dest, ptrdiff_t stride, const void* top_row,
39 const void* left_column);
40 static void SmoothHorizontal(void* dest, ptrdiff_t stride,
41 const void* top_row, const void* left_column);
42 };
43
44 constexpr uint8_t kSmoothWeights[] = {
45 #include "src/dsp/smooth_weights.inc"
46 };
47
48 // SmoothFuncs_C::Smooth
49 template <int block_width, int block_height, typename Pixel>
Smooth(void * LIBGAV1_RESTRICT const dest,ptrdiff_t stride,const void * LIBGAV1_RESTRICT const top_row,const void * LIBGAV1_RESTRICT const left_column)50 void SmoothFuncs_C<block_width, block_height, Pixel>::Smooth(
51 void* LIBGAV1_RESTRICT const dest, ptrdiff_t stride,
52 const void* LIBGAV1_RESTRICT const top_row,
53 const void* LIBGAV1_RESTRICT const left_column) {
54 const auto* const top = static_cast<const Pixel*>(top_row);
55 const auto* const left = static_cast<const Pixel*>(left_column);
56 const Pixel top_right = top[block_width - 1];
57 const Pixel bottom_left = left[block_height - 1];
58 static_assert(
59 block_width >= 4 && block_height >= 4,
60 "Weights for smooth predictor undefined for block width/height < 4");
61 const uint8_t* const weights_x = kSmoothWeights + block_width - 4;
62 const uint8_t* const weights_y = kSmoothWeights + block_height - 4;
63 const uint16_t scale_value = (1 << kSmoothWeightScale);
64 auto* dst = static_cast<Pixel*>(dest);
65 stride /= sizeof(Pixel);
66
67 for (int y = 0; y < block_height; ++y) {
68 for (int x = 0; x < block_width; ++x) {
69 assert(scale_value >= weights_y[y] && scale_value >= weights_x[x]);
70 uint32_t pred = weights_y[y] * top[x];
71 pred += weights_x[x] * left[y];
72 pred += static_cast<uint8_t>(scale_value - weights_y[y]) * bottom_left;
73 pred += static_cast<uint8_t>(scale_value - weights_x[x]) * top_right;
74 // The maximum value of pred with the rounder is 2^9 * (2^bitdepth - 1)
75 // + 256. With the descale there's no need for saturation.
76 dst[x] = static_cast<Pixel>(
77 RightShiftWithRounding(pred, kSmoothWeightScale + 1));
78 }
79 dst += stride;
80 }
81 }
82
83 // SmoothFuncs_C::SmoothVertical
84 template <int block_width, int block_height, typename Pixel>
SmoothVertical(void * LIBGAV1_RESTRICT const dest,ptrdiff_t stride,const void * LIBGAV1_RESTRICT const top_row,const void * LIBGAV1_RESTRICT const left_column)85 void SmoothFuncs_C<block_width, block_height, Pixel>::SmoothVertical(
86 void* LIBGAV1_RESTRICT const dest, ptrdiff_t stride,
87 const void* LIBGAV1_RESTRICT const top_row,
88 const void* LIBGAV1_RESTRICT const left_column) {
89 const auto* const top = static_cast<const Pixel*>(top_row);
90 const auto* const left = static_cast<const Pixel*>(left_column);
91 const Pixel bottom_left = left[block_height - 1];
92 static_assert(block_height >= 4,
93 "Weights for smooth predictor undefined for block height < 4");
94 const uint8_t* const weights_y = kSmoothWeights + block_height - 4;
95 const uint16_t scale_value = (1 << kSmoothWeightScale);
96 auto* dst = static_cast<Pixel*>(dest);
97 stride /= sizeof(Pixel);
98
99 for (int y = 0; y < block_height; ++y) {
100 for (int x = 0; x < block_width; ++x) {
101 assert(scale_value >= weights_y[y]);
102 uint32_t pred = weights_y[y] * top[x];
103 pred += static_cast<uint8_t>(scale_value - weights_y[y]) * bottom_left;
104 dst[x] =
105 static_cast<Pixel>(RightShiftWithRounding(pred, kSmoothWeightScale));
106 }
107 dst += stride;
108 }
109 }
110
111 // SmoothFuncs_C::SmoothHorizontal
112 template <int block_width, int block_height, typename Pixel>
SmoothHorizontal(void * LIBGAV1_RESTRICT const dest,ptrdiff_t stride,const void * LIBGAV1_RESTRICT const top_row,const void * LIBGAV1_RESTRICT const left_column)113 void SmoothFuncs_C<block_width, block_height, Pixel>::SmoothHorizontal(
114 void* LIBGAV1_RESTRICT const dest, ptrdiff_t stride,
115 const void* LIBGAV1_RESTRICT const top_row,
116 const void* LIBGAV1_RESTRICT const left_column) {
117 const auto* const top = static_cast<const Pixel*>(top_row);
118 const auto* const left = static_cast<const Pixel*>(left_column);
119 const Pixel top_right = top[block_width - 1];
120 static_assert(block_width >= 4,
121 "Weights for smooth predictor undefined for block width < 4");
122 const uint8_t* const weights_x = kSmoothWeights + block_width - 4;
123 const uint16_t scale_value = (1 << kSmoothWeightScale);
124 auto* dst = static_cast<Pixel*>(dest);
125 stride /= sizeof(Pixel);
126
127 for (int y = 0; y < block_height; ++y) {
128 for (int x = 0; x < block_width; ++x) {
129 assert(scale_value >= weights_x[x]);
130 uint32_t pred = weights_x[x] * left[y];
131 pred += static_cast<uint8_t>(scale_value - weights_x[x]) * top_right;
132 dst[x] =
133 static_cast<Pixel>(RightShiftWithRounding(pred, kSmoothWeightScale));
134 }
135 dst += stride;
136 }
137 }
138
139 // -----------------------------------------------------------------------------
140
141 template <typename Pixel>
142 struct SmoothDefs {
143 SmoothDefs() = delete;
144
145 using _4x4 = SmoothFuncs_C<4, 4, Pixel>;
146 using _4x8 = SmoothFuncs_C<4, 8, Pixel>;
147 using _4x16 = SmoothFuncs_C<4, 16, Pixel>;
148 using _8x4 = SmoothFuncs_C<8, 4, Pixel>;
149 using _8x8 = SmoothFuncs_C<8, 8, Pixel>;
150 using _8x16 = SmoothFuncs_C<8, 16, Pixel>;
151 using _8x32 = SmoothFuncs_C<8, 32, Pixel>;
152 using _16x4 = SmoothFuncs_C<16, 4, Pixel>;
153 using _16x8 = SmoothFuncs_C<16, 8, Pixel>;
154 using _16x16 = SmoothFuncs_C<16, 16, Pixel>;
155 using _16x32 = SmoothFuncs_C<16, 32, Pixel>;
156 using _16x64 = SmoothFuncs_C<16, 64, Pixel>;
157 using _32x8 = SmoothFuncs_C<32, 8, Pixel>;
158 using _32x16 = SmoothFuncs_C<32, 16, Pixel>;
159 using _32x32 = SmoothFuncs_C<32, 32, Pixel>;
160 using _32x64 = SmoothFuncs_C<32, 64, Pixel>;
161 using _64x16 = SmoothFuncs_C<64, 16, Pixel>;
162 using _64x32 = SmoothFuncs_C<64, 32, Pixel>;
163 using _64x64 = SmoothFuncs_C<64, 64, Pixel>;
164 };
165
166 using Defs = SmoothDefs<uint8_t>;
167
168 // Initializes dsp entries for kTransformSize|W|x|H| from |DEFS| of
169 // the same size.
170 #define INIT_SMOOTH_WxH(DEFS, W, H) \
171 dsp->intra_predictors[kTransformSize##W##x##H][kIntraPredictorSmooth] = \
172 DEFS::_##W##x##H::Smooth; \
173 dsp->intra_predictors[kTransformSize##W##x##H] \
174 [kIntraPredictorSmoothVertical] = \
175 DEFS::_##W##x##H::SmoothVertical; \
176 dsp->intra_predictors[kTransformSize##W##x##H] \
177 [kIntraPredictorSmoothHorizontal] = \
178 DEFS::_##W##x##H::SmoothHorizontal
179
180 #define INIT_SMOOTH(DEFS) \
181 INIT_SMOOTH_WxH(DEFS, 4, 4); \
182 INIT_SMOOTH_WxH(DEFS, 4, 8); \
183 INIT_SMOOTH_WxH(DEFS, 4, 16); \
184 INIT_SMOOTH_WxH(DEFS, 8, 4); \
185 INIT_SMOOTH_WxH(DEFS, 8, 8); \
186 INIT_SMOOTH_WxH(DEFS, 8, 16); \
187 INIT_SMOOTH_WxH(DEFS, 8, 32); \
188 INIT_SMOOTH_WxH(DEFS, 16, 4); \
189 INIT_SMOOTH_WxH(DEFS, 16, 8); \
190 INIT_SMOOTH_WxH(DEFS, 16, 16); \
191 INIT_SMOOTH_WxH(DEFS, 16, 32); \
192 INIT_SMOOTH_WxH(DEFS, 16, 64); \
193 INIT_SMOOTH_WxH(DEFS, 32, 8); \
194 INIT_SMOOTH_WxH(DEFS, 32, 16); \
195 INIT_SMOOTH_WxH(DEFS, 32, 32); \
196 INIT_SMOOTH_WxH(DEFS, 32, 64); \
197 INIT_SMOOTH_WxH(DEFS, 64, 16); \
198 INIT_SMOOTH_WxH(DEFS, 64, 32); \
199 INIT_SMOOTH_WxH(DEFS, 64, 64)
200
Init8bpp()201 void Init8bpp() {
202 Dsp* const dsp = dsp_internal::GetWritableDspTable(8);
203 assert(dsp != nullptr);
204 #if LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
205 INIT_SMOOTH(Defs);
206 #else // !LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
207 static_cast<void>(dsp);
208 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x4_IntraPredictorSmooth
209 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmooth] =
210 Defs::_4x4::Smooth;
211 #endif
212 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x4_IntraPredictorSmoothVertical
213 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmoothVertical] =
214 Defs::_4x4::SmoothVertical;
215 #endif
216 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x4_IntraPredictorSmoothHorizontal
217 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmoothHorizontal] =
218 Defs::_4x4::SmoothHorizontal;
219 #endif
220
221 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x8_IntraPredictorSmooth
222 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmooth] =
223 Defs::_4x8::Smooth;
224 #endif
225 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x8_IntraPredictorSmoothVertical
226 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmoothVertical] =
227 Defs::_4x8::SmoothVertical;
228 #endif
229 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x8_IntraPredictorSmoothHorizontal
230 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmoothHorizontal] =
231 Defs::_4x8::SmoothHorizontal;
232 #endif
233
234 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x16_IntraPredictorSmooth
235 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmooth] =
236 Defs::_4x16::Smooth;
237 #endif
238 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x16_IntraPredictorSmoothVertical
239 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmoothVertical] =
240 Defs::_4x16::SmoothVertical;
241 #endif
242 #ifndef LIBGAV1_Dsp8bpp_TransformSize4x16_IntraPredictorSmoothHorizontal
243 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmoothHorizontal] =
244 Defs::_4x16::SmoothHorizontal;
245 #endif
246
247 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x4_IntraPredictorSmooth
248 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmooth] =
249 Defs::_8x4::Smooth;
250 #endif
251 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x4_IntraPredictorSmoothVertical
252 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmoothVertical] =
253 Defs::_8x4::SmoothVertical;
254 #endif
255 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x4_IntraPredictorSmoothHorizontal
256 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmoothHorizontal] =
257 Defs::_8x4::SmoothHorizontal;
258 #endif
259
260 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x8_IntraPredictorSmooth
261 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmooth] =
262 Defs::_8x8::Smooth;
263 #endif
264 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x8_IntraPredictorSmoothVertical
265 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmoothVertical] =
266 Defs::_8x8::SmoothVertical;
267 #endif
268 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x8_IntraPredictorSmoothHorizontal
269 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmoothHorizontal] =
270 Defs::_8x8::SmoothHorizontal;
271 #endif
272
273 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x16_IntraPredictorSmooth
274 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmooth] =
275 Defs::_8x16::Smooth;
276 #endif
277 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x16_IntraPredictorSmoothVertical
278 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmoothVertical] =
279 Defs::_8x16::SmoothVertical;
280 #endif
281 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x16_IntraPredictorSmoothHorizontal
282 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmoothHorizontal] =
283 Defs::_8x16::SmoothHorizontal;
284 #endif
285
286 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x32_IntraPredictorSmooth
287 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmooth] =
288 Defs::_8x32::Smooth;
289 #endif
290 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x32_IntraPredictorSmoothVertical
291 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmoothVertical] =
292 Defs::_8x32::SmoothVertical;
293 #endif
294 #ifndef LIBGAV1_Dsp8bpp_TransformSize8x32_IntraPredictorSmoothHorizontal
295 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmoothHorizontal] =
296 Defs::_8x32::SmoothHorizontal;
297 #endif
298
299 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x4_IntraPredictorSmooth
300 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmooth] =
301 Defs::_16x4::Smooth;
302 #endif
303 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x4_IntraPredictorSmoothVertical
304 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmoothVertical] =
305 Defs::_16x4::SmoothVertical;
306 #endif
307 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x4_IntraPredictorSmoothHorizontal
308 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmoothHorizontal] =
309 Defs::_16x4::SmoothHorizontal;
310 #endif
311
312 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x8_IntraPredictorSmooth
313 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmooth] =
314 Defs::_16x8::Smooth;
315 #endif
316 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x8_IntraPredictorSmoothVertical
317 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmoothVertical] =
318 Defs::_16x8::SmoothVertical;
319 #endif
320 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x8_IntraPredictorSmoothHorizontal
321 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmoothHorizontal] =
322 Defs::_16x8::SmoothHorizontal;
323 #endif
324
325 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x16_IntraPredictorSmooth
326 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmooth] =
327 Defs::_16x16::Smooth;
328 #endif
329 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x16_IntraPredictorSmoothVertical
330 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmoothVertical] =
331 Defs::_16x16::SmoothVertical;
332 #endif
333 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x16_IntraPredictorSmoothHorizontal
334 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmoothHorizontal] =
335 Defs::_16x16::SmoothHorizontal;
336 #endif
337
338 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x32_IntraPredictorSmooth
339 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmooth] =
340 Defs::_16x32::Smooth;
341 #endif
342 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x32_IntraPredictorSmoothVertical
343 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmoothVertical] =
344 Defs::_16x32::SmoothVertical;
345 #endif
346 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x32_IntraPredictorSmoothHorizontal
347 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmoothHorizontal] =
348 Defs::_16x32::SmoothHorizontal;
349 #endif
350
351 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x64_IntraPredictorSmooth
352 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmooth] =
353 Defs::_16x64::Smooth;
354 #endif
355 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x64_IntraPredictorSmoothVertical
356 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmoothVertical] =
357 Defs::_16x64::SmoothVertical;
358 #endif
359 #ifndef LIBGAV1_Dsp8bpp_TransformSize16x64_IntraPredictorSmoothHorizontal
360 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmoothHorizontal] =
361 Defs::_16x64::SmoothHorizontal;
362 #endif
363
364 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x8_IntraPredictorSmooth
365 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmooth] =
366 Defs::_32x8::Smooth;
367 #endif
368 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x8_IntraPredictorSmoothVertical
369 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmoothVertical] =
370 Defs::_32x8::SmoothVertical;
371 #endif
372 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x8_IntraPredictorSmoothHorizontal
373 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmoothHorizontal] =
374 Defs::_32x8::SmoothHorizontal;
375 #endif
376
377 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x16_IntraPredictorSmooth
378 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmooth] =
379 Defs::_32x16::Smooth;
380 #endif
381 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x16_IntraPredictorSmoothVertical
382 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmoothVertical] =
383 Defs::_32x16::SmoothVertical;
384 #endif
385 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x16_IntraPredictorSmoothHorizontal
386 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmoothHorizontal] =
387 Defs::_32x16::SmoothHorizontal;
388 #endif
389
390 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x32_IntraPredictorSmooth
391 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmooth] =
392 Defs::_32x32::Smooth;
393 #endif
394 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x32_IntraPredictorSmoothVertical
395 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmoothVertical] =
396 Defs::_32x32::SmoothVertical;
397 #endif
398 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x32_IntraPredictorSmoothHorizontal
399 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmoothHorizontal] =
400 Defs::_32x32::SmoothHorizontal;
401 #endif
402
403 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x64_IntraPredictorSmooth
404 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmooth] =
405 Defs::_32x64::Smooth;
406 #endif
407 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x64_IntraPredictorSmoothVertical
408 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmoothVertical] =
409 Defs::_32x64::SmoothVertical;
410 #endif
411 #ifndef LIBGAV1_Dsp8bpp_TransformSize32x64_IntraPredictorSmoothHorizontal
412 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmoothHorizontal] =
413 Defs::_32x64::SmoothHorizontal;
414 #endif
415
416 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x16_IntraPredictorSmooth
417 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmooth] =
418 Defs::_64x16::Smooth;
419 #endif
420 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x16_IntraPredictorSmoothVertical
421 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmoothVertical] =
422 Defs::_64x16::SmoothVertical;
423 #endif
424 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x16_IntraPredictorSmoothHorizontal
425 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmoothHorizontal] =
426 Defs::_64x16::SmoothHorizontal;
427 #endif
428
429 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x32_IntraPredictorSmooth
430 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmooth] =
431 Defs::_64x32::Smooth;
432 #endif
433 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x32_IntraPredictorSmoothVertical
434 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmoothVertical] =
435 Defs::_64x32::SmoothVertical;
436 #endif
437 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x32_IntraPredictorSmoothHorizontal
438 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmoothHorizontal] =
439 Defs::_64x32::SmoothHorizontal;
440 #endif
441
442 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x64_IntraPredictorSmooth
443 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmooth] =
444 Defs::_64x64::Smooth;
445 #endif
446 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x64_IntraPredictorSmoothVertical
447 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmoothVertical] =
448 Defs::_64x64::SmoothVertical;
449 #endif
450 #ifndef LIBGAV1_Dsp8bpp_TransformSize64x64_IntraPredictorSmoothHorizontal
451 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmoothHorizontal] =
452 Defs::_64x64::SmoothHorizontal;
453 #endif
454 #endif // LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
455 } // NOLINT(readability/fn_size)
456
457 #if LIBGAV1_MAX_BITDEPTH >= 10
458 using DefsHbd = SmoothDefs<uint16_t>;
459
Init10bpp()460 void Init10bpp() {
461 Dsp* const dsp = dsp_internal::GetWritableDspTable(10);
462 assert(dsp != nullptr);
463 #if LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
464 INIT_SMOOTH(DefsHbd);
465 #else // !LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
466 static_cast<void>(dsp);
467 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x4_IntraPredictorSmooth
468 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmooth] =
469 DefsHbd::_4x4::Smooth;
470 #endif
471 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x4_IntraPredictorSmoothVertical
472 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmoothVertical] =
473 DefsHbd::_4x4::SmoothVertical;
474 #endif
475 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x4_IntraPredictorSmoothHorizontal
476 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmoothHorizontal] =
477 DefsHbd::_4x4::SmoothHorizontal;
478 #endif
479
480 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x8_IntraPredictorSmooth
481 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmooth] =
482 DefsHbd::_4x8::Smooth;
483 #endif
484 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x8_IntraPredictorSmoothVertical
485 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmoothVertical] =
486 DefsHbd::_4x8::SmoothVertical;
487 #endif
488 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x8_IntraPredictorSmoothHorizontal
489 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmoothHorizontal] =
490 DefsHbd::_4x8::SmoothHorizontal;
491 #endif
492
493 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x16_IntraPredictorSmooth
494 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmooth] =
495 DefsHbd::_4x16::Smooth;
496 #endif
497 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x16_IntraPredictorSmoothVertical
498 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmoothVertical] =
499 DefsHbd::_4x16::SmoothVertical;
500 #endif
501 #ifndef LIBGAV1_Dsp10bpp_TransformSize4x16_IntraPredictorSmoothHorizontal
502 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmoothHorizontal] =
503 DefsHbd::_4x16::SmoothHorizontal;
504 #endif
505
506 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x4_IntraPredictorSmooth
507 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmooth] =
508 DefsHbd::_8x4::Smooth;
509 #endif
510 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x4_IntraPredictorSmoothVertical
511 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmoothVertical] =
512 DefsHbd::_8x4::SmoothVertical;
513 #endif
514 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x4_IntraPredictorSmoothHorizontal
515 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmoothHorizontal] =
516 DefsHbd::_8x4::SmoothHorizontal;
517 #endif
518
519 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x8_IntraPredictorSmooth
520 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmooth] =
521 DefsHbd::_8x8::Smooth;
522 #endif
523 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x8_IntraPredictorSmoothVertical
524 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmoothVertical] =
525 DefsHbd::_8x8::SmoothVertical;
526 #endif
527 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x8_IntraPredictorSmoothHorizontal
528 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmoothHorizontal] =
529 DefsHbd::_8x8::SmoothHorizontal;
530 #endif
531
532 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x16_IntraPredictorSmooth
533 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmooth] =
534 DefsHbd::_8x16::Smooth;
535 #endif
536 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x16_IntraPredictorSmoothVertical
537 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmoothVertical] =
538 DefsHbd::_8x16::SmoothVertical;
539 #endif
540 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x16_IntraPredictorSmoothHorizontal
541 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmoothHorizontal] =
542 DefsHbd::_8x16::SmoothHorizontal;
543 #endif
544
545 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x32_IntraPredictorSmooth
546 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmooth] =
547 DefsHbd::_8x32::Smooth;
548 #endif
549 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x32_IntraPredictorSmoothVertical
550 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmoothVertical] =
551 DefsHbd::_8x32::SmoothVertical;
552 #endif
553 #ifndef LIBGAV1_Dsp10bpp_TransformSize8x32_IntraPredictorSmoothHorizontal
554 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmoothHorizontal] =
555 DefsHbd::_8x32::SmoothHorizontal;
556 #endif
557
558 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x4_IntraPredictorSmooth
559 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmooth] =
560 DefsHbd::_16x4::Smooth;
561 #endif
562 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x4_IntraPredictorSmoothVertical
563 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmoothVertical] =
564 DefsHbd::_16x4::SmoothVertical;
565 #endif
566 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x4_IntraPredictorSmoothHorizontal
567 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmoothHorizontal] =
568 DefsHbd::_16x4::SmoothHorizontal;
569 #endif
570
571 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x8_IntraPredictorSmooth
572 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmooth] =
573 DefsHbd::_16x8::Smooth;
574 #endif
575 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x8_IntraPredictorSmoothVertical
576 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmoothVertical] =
577 DefsHbd::_16x8::SmoothVertical;
578 #endif
579 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x8_IntraPredictorSmoothHorizontal
580 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmoothHorizontal] =
581 DefsHbd::_16x8::SmoothHorizontal;
582 #endif
583
584 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x16_IntraPredictorSmooth
585 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmooth] =
586 DefsHbd::_16x16::Smooth;
587 #endif
588 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x16_IntraPredictorSmoothVertical
589 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmoothVertical] =
590 DefsHbd::_16x16::SmoothVertical;
591 #endif
592 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x16_IntraPredictorSmoothHorizontal
593 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmoothHorizontal] =
594 DefsHbd::_16x16::SmoothHorizontal;
595 #endif
596
597 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x32_IntraPredictorSmooth
598 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmooth] =
599 DefsHbd::_16x32::Smooth;
600 #endif
601 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x32_IntraPredictorSmoothVertical
602 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmoothVertical] =
603 DefsHbd::_16x32::SmoothVertical;
604 #endif
605 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x32_IntraPredictorSmoothHorizontal
606 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmoothHorizontal] =
607 DefsHbd::_16x32::SmoothHorizontal;
608 #endif
609
610 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x64_IntraPredictorSmooth
611 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmooth] =
612 DefsHbd::_16x64::Smooth;
613 #endif
614 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x64_IntraPredictorSmoothVertical
615 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmoothVertical] =
616 DefsHbd::_16x64::SmoothVertical;
617 #endif
618 #ifndef LIBGAV1_Dsp10bpp_TransformSize16x64_IntraPredictorSmoothHorizontal
619 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmoothHorizontal] =
620 DefsHbd::_16x64::SmoothHorizontal;
621 #endif
622
623 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x8_IntraPredictorSmooth
624 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmooth] =
625 DefsHbd::_32x8::Smooth;
626 #endif
627 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x8_IntraPredictorSmoothVertical
628 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmoothVertical] =
629 DefsHbd::_32x8::SmoothVertical;
630 #endif
631 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x8_IntraPredictorSmoothHorizontal
632 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmoothHorizontal] =
633 DefsHbd::_32x8::SmoothHorizontal;
634 #endif
635
636 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x16_IntraPredictorSmooth
637 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmooth] =
638 DefsHbd::_32x16::Smooth;
639 #endif
640 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x16_IntraPredictorSmoothVertical
641 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmoothVertical] =
642 DefsHbd::_32x16::SmoothVertical;
643 #endif
644 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x16_IntraPredictorSmoothHorizontal
645 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmoothHorizontal] =
646 DefsHbd::_32x16::SmoothHorizontal;
647 #endif
648
649 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x32_IntraPredictorSmooth
650 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmooth] =
651 DefsHbd::_32x32::Smooth;
652 #endif
653 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x32_IntraPredictorSmoothVertical
654 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmoothVertical] =
655 DefsHbd::_32x32::SmoothVertical;
656 #endif
657 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x32_IntraPredictorSmoothHorizontal
658 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmoothHorizontal] =
659 DefsHbd::_32x32::SmoothHorizontal;
660 #endif
661
662 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x64_IntraPredictorSmooth
663 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmooth] =
664 DefsHbd::_32x64::Smooth;
665 #endif
666 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x64_IntraPredictorSmoothVertical
667 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmoothVertical] =
668 DefsHbd::_32x64::SmoothVertical;
669 #endif
670 #ifndef LIBGAV1_Dsp10bpp_TransformSize32x64_IntraPredictorSmoothHorizontal
671 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmoothHorizontal] =
672 DefsHbd::_32x64::SmoothHorizontal;
673 #endif
674
675 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x16_IntraPredictorSmooth
676 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmooth] =
677 DefsHbd::_64x16::Smooth;
678 #endif
679 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x16_IntraPredictorSmoothVertical
680 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmoothVertical] =
681 DefsHbd::_64x16::SmoothVertical;
682 #endif
683 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x16_IntraPredictorSmoothHorizontal
684 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmoothHorizontal] =
685 DefsHbd::_64x16::SmoothHorizontal;
686 #endif
687
688 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x32_IntraPredictorSmooth
689 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmooth] =
690 DefsHbd::_64x32::Smooth;
691 #endif
692 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x32_IntraPredictorSmoothVertical
693 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmoothVertical] =
694 DefsHbd::_64x32::SmoothVertical;
695 #endif
696 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x32_IntraPredictorSmoothHorizontal
697 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmoothHorizontal] =
698 DefsHbd::_64x32::SmoothHorizontal;
699 #endif
700
701 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x64_IntraPredictorSmooth
702 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmooth] =
703 DefsHbd::_64x64::Smooth;
704 #endif
705 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x64_IntraPredictorSmoothVertical
706 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmoothVertical] =
707 DefsHbd::_64x64::SmoothVertical;
708 #endif
709 #ifndef LIBGAV1_Dsp10bpp_TransformSize64x64_IntraPredictorSmoothHorizontal
710 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmoothHorizontal] =
711 DefsHbd::_64x64::SmoothHorizontal;
712 #endif
713 #endif // LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
714 } // NOLINT(readability/fn_size)
715 #endif // LIBGAV1_MAX_BITDEPTH >= 10
716
717 #if LIBGAV1_MAX_BITDEPTH == 12
718 using DefsHbd = SmoothDefs<uint16_t>;
719
Init12bpp()720 void Init12bpp() {
721 Dsp* const dsp = dsp_internal::GetWritableDspTable(12);
722 assert(dsp != nullptr);
723 #if LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
724 INIT_SMOOTH(DefsHbd);
725 #else // !LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
726 static_cast<void>(dsp);
727 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x4_IntraPredictorSmooth
728 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmooth] =
729 DefsHbd::_4x4::Smooth;
730 #endif
731 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x4_IntraPredictorSmoothVertical
732 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmoothVertical] =
733 DefsHbd::_4x4::SmoothVertical;
734 #endif
735 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x4_IntraPredictorSmoothHorizontal
736 dsp->intra_predictors[kTransformSize4x4][kIntraPredictorSmoothHorizontal] =
737 DefsHbd::_4x4::SmoothHorizontal;
738 #endif
739
740 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x8_IntraPredictorSmooth
741 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmooth] =
742 DefsHbd::_4x8::Smooth;
743 #endif
744 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x8_IntraPredictorSmoothVertical
745 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmoothVertical] =
746 DefsHbd::_4x8::SmoothVertical;
747 #endif
748 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x8_IntraPredictorSmoothHorizontal
749 dsp->intra_predictors[kTransformSize4x8][kIntraPredictorSmoothHorizontal] =
750 DefsHbd::_4x8::SmoothHorizontal;
751 #endif
752
753 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x16_IntraPredictorSmooth
754 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmooth] =
755 DefsHbd::_4x16::Smooth;
756 #endif
757 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x16_IntraPredictorSmoothVertical
758 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmoothVertical] =
759 DefsHbd::_4x16::SmoothVertical;
760 #endif
761 #ifndef LIBGAV1_Dsp12bpp_TransformSize4x16_IntraPredictorSmoothHorizontal
762 dsp->intra_predictors[kTransformSize4x16][kIntraPredictorSmoothHorizontal] =
763 DefsHbd::_4x16::SmoothHorizontal;
764 #endif
765
766 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x4_IntraPredictorSmooth
767 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmooth] =
768 DefsHbd::_8x4::Smooth;
769 #endif
770 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x4_IntraPredictorSmoothVertical
771 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmoothVertical] =
772 DefsHbd::_8x4::SmoothVertical;
773 #endif
774 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x4_IntraPredictorSmoothHorizontal
775 dsp->intra_predictors[kTransformSize8x4][kIntraPredictorSmoothHorizontal] =
776 DefsHbd::_8x4::SmoothHorizontal;
777 #endif
778
779 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x8_IntraPredictorSmooth
780 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmooth] =
781 DefsHbd::_8x8::Smooth;
782 #endif
783 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x8_IntraPredictorSmoothVertical
784 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmoothVertical] =
785 DefsHbd::_8x8::SmoothVertical;
786 #endif
787 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x8_IntraPredictorSmoothHorizontal
788 dsp->intra_predictors[kTransformSize8x8][kIntraPredictorSmoothHorizontal] =
789 DefsHbd::_8x8::SmoothHorizontal;
790 #endif
791
792 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x16_IntraPredictorSmooth
793 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmooth] =
794 DefsHbd::_8x16::Smooth;
795 #endif
796 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x16_IntraPredictorSmoothVertical
797 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmoothVertical] =
798 DefsHbd::_8x16::SmoothVertical;
799 #endif
800 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x16_IntraPredictorSmoothHorizontal
801 dsp->intra_predictors[kTransformSize8x16][kIntraPredictorSmoothHorizontal] =
802 DefsHbd::_8x16::SmoothHorizontal;
803 #endif
804
805 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x32_IntraPredictorSmooth
806 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmooth] =
807 DefsHbd::_8x32::Smooth;
808 #endif
809 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x32_IntraPredictorSmoothVertical
810 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmoothVertical] =
811 DefsHbd::_8x32::SmoothVertical;
812 #endif
813 #ifndef LIBGAV1_Dsp12bpp_TransformSize8x32_IntraPredictorSmoothHorizontal
814 dsp->intra_predictors[kTransformSize8x32][kIntraPredictorSmoothHorizontal] =
815 DefsHbd::_8x32::SmoothHorizontal;
816 #endif
817
818 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x4_IntraPredictorSmooth
819 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmooth] =
820 DefsHbd::_16x4::Smooth;
821 #endif
822 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x4_IntraPredictorSmoothVertical
823 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmoothVertical] =
824 DefsHbd::_16x4::SmoothVertical;
825 #endif
826 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x4_IntraPredictorSmoothHorizontal
827 dsp->intra_predictors[kTransformSize16x4][kIntraPredictorSmoothHorizontal] =
828 DefsHbd::_16x4::SmoothHorizontal;
829 #endif
830
831 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x8_IntraPredictorSmooth
832 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmooth] =
833 DefsHbd::_16x8::Smooth;
834 #endif
835 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x8_IntraPredictorSmoothVertical
836 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmoothVertical] =
837 DefsHbd::_16x8::SmoothVertical;
838 #endif
839 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x8_IntraPredictorSmoothHorizontal
840 dsp->intra_predictors[kTransformSize16x8][kIntraPredictorSmoothHorizontal] =
841 DefsHbd::_16x8::SmoothHorizontal;
842 #endif
843
844 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x16_IntraPredictorSmooth
845 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmooth] =
846 DefsHbd::_16x16::Smooth;
847 #endif
848 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x16_IntraPredictorSmoothVertical
849 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmoothVertical] =
850 DefsHbd::_16x16::SmoothVertical;
851 #endif
852 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x16_IntraPredictorSmoothHorizontal
853 dsp->intra_predictors[kTransformSize16x16][kIntraPredictorSmoothHorizontal] =
854 DefsHbd::_16x16::SmoothHorizontal;
855 #endif
856
857 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x32_IntraPredictorSmooth
858 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmooth] =
859 DefsHbd::_16x32::Smooth;
860 #endif
861 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x32_IntraPredictorSmoothVertical
862 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmoothVertical] =
863 DefsHbd::_16x32::SmoothVertical;
864 #endif
865 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x32_IntraPredictorSmoothHorizontal
866 dsp->intra_predictors[kTransformSize16x32][kIntraPredictorSmoothHorizontal] =
867 DefsHbd::_16x32::SmoothHorizontal;
868 #endif
869
870 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x64_IntraPredictorSmooth
871 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmooth] =
872 DefsHbd::_16x64::Smooth;
873 #endif
874 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x64_IntraPredictorSmoothVertical
875 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmoothVertical] =
876 DefsHbd::_16x64::SmoothVertical;
877 #endif
878 #ifndef LIBGAV1_Dsp12bpp_TransformSize16x64_IntraPredictorSmoothHorizontal
879 dsp->intra_predictors[kTransformSize16x64][kIntraPredictorSmoothHorizontal] =
880 DefsHbd::_16x64::SmoothHorizontal;
881 #endif
882
883 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x8_IntraPredictorSmooth
884 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmooth] =
885 DefsHbd::_32x8::Smooth;
886 #endif
887 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x8_IntraPredictorSmoothVertical
888 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmoothVertical] =
889 DefsHbd::_32x8::SmoothVertical;
890 #endif
891 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x8_IntraPredictorSmoothHorizontal
892 dsp->intra_predictors[kTransformSize32x8][kIntraPredictorSmoothHorizontal] =
893 DefsHbd::_32x8::SmoothHorizontal;
894 #endif
895
896 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x16_IntraPredictorSmooth
897 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmooth] =
898 DefsHbd::_32x16::Smooth;
899 #endif
900 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x16_IntraPredictorSmoothVertical
901 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmoothVertical] =
902 DefsHbd::_32x16::SmoothVertical;
903 #endif
904 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x16_IntraPredictorSmoothHorizontal
905 dsp->intra_predictors[kTransformSize32x16][kIntraPredictorSmoothHorizontal] =
906 DefsHbd::_32x16::SmoothHorizontal;
907 #endif
908
909 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x32_IntraPredictorSmooth
910 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmooth] =
911 DefsHbd::_32x32::Smooth;
912 #endif
913 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x32_IntraPredictorSmoothVertical
914 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmoothVertical] =
915 DefsHbd::_32x32::SmoothVertical;
916 #endif
917 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x32_IntraPredictorSmoothHorizontal
918 dsp->intra_predictors[kTransformSize32x32][kIntraPredictorSmoothHorizontal] =
919 DefsHbd::_32x32::SmoothHorizontal;
920 #endif
921
922 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x64_IntraPredictorSmooth
923 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmooth] =
924 DefsHbd::_32x64::Smooth;
925 #endif
926 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x64_IntraPredictorSmoothVertical
927 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmoothVertical] =
928 DefsHbd::_32x64::SmoothVertical;
929 #endif
930 #ifndef LIBGAV1_Dsp12bpp_TransformSize32x64_IntraPredictorSmoothHorizontal
931 dsp->intra_predictors[kTransformSize32x64][kIntraPredictorSmoothHorizontal] =
932 DefsHbd::_32x64::SmoothHorizontal;
933 #endif
934
935 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x16_IntraPredictorSmooth
936 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmooth] =
937 DefsHbd::_64x16::Smooth;
938 #endif
939 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x16_IntraPredictorSmoothVertical
940 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmoothVertical] =
941 DefsHbd::_64x16::SmoothVertical;
942 #endif
943 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x16_IntraPredictorSmoothHorizontal
944 dsp->intra_predictors[kTransformSize64x16][kIntraPredictorSmoothHorizontal] =
945 DefsHbd::_64x16::SmoothHorizontal;
946 #endif
947
948 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x32_IntraPredictorSmooth
949 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmooth] =
950 DefsHbd::_64x32::Smooth;
951 #endif
952 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x32_IntraPredictorSmoothVertical
953 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmoothVertical] =
954 DefsHbd::_64x32::SmoothVertical;
955 #endif
956 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x32_IntraPredictorSmoothHorizontal
957 dsp->intra_predictors[kTransformSize64x32][kIntraPredictorSmoothHorizontal] =
958 DefsHbd::_64x32::SmoothHorizontal;
959 #endif
960
961 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x64_IntraPredictorSmooth
962 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmooth] =
963 DefsHbd::_64x64::Smooth;
964 #endif
965 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x64_IntraPredictorSmoothVertical
966 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmoothVertical] =
967 DefsHbd::_64x64::SmoothVertical;
968 #endif
969 #ifndef LIBGAV1_Dsp12bpp_TransformSize64x64_IntraPredictorSmoothHorizontal
970 dsp->intra_predictors[kTransformSize64x64][kIntraPredictorSmoothHorizontal] =
971 DefsHbd::_64x64::SmoothHorizontal;
972 #endif
973 #endif // LIBGAV1_ENABLE_ALL_DSP_FUNCTIONS
974 } // NOLINT(readability/fn_size)
975 #endif // LIBGAV1_MAX_BITDEPTH == 12
976
977 #undef INIT_SMOOTH_WxH
978 #undef INIT_SMOOTH
979 } // namespace
980
IntraPredSmoothInit_C()981 void IntraPredSmoothInit_C() {
982 Init8bpp();
983 #if LIBGAV1_MAX_BITDEPTH >= 10
984 Init10bpp();
985 #endif
986 #if LIBGAV1_MAX_BITDEPTH == 12
987 Init12bpp();
988 #endif
989 }
990
991 } // namespace dsp
992 } // namespace libgav1
993