1 /*
2 * Copyright(c) 2019 Intel Corporation
3 *
4 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at https://www.aomedia.org/license/software-license. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at https://www.aomedia.org/license/patent-license.
10 */
11 
12 #ifndef EbIntraPrediction_AVX2_h
13 #define EbIntraPrediction_AVX2_h
14 
15 #include "EbDefinitions.h"
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 // Weights are quadratic from '1' to '1 / BlockSize', scaled by
20 // 2^sm_weight_log2_scale.
21 static const int32_t sm_weight_log2_scale = 8;
22 // max(block_size_wide[BLOCK_LARGEST], block_size_high[BLOCK_LARGEST])
23 #define MAX_BLOCK_DIM 64
24 /* clang-format off */
25     static const uint8_t sm_weight_arrays[2 * MAX_BLOCK_DIM] = {
26         // Unused, because we always offset by bs, which is at least 2.
27         0, 0,
28         // bs = 2
29         255, 128,
30         // bs = 4
31         255, 149, 85, 64,
32         // bs = 8
33         255, 197, 146, 105, 73, 50, 37, 32,
34         // bs = 16
35         255, 225, 196, 170, 145, 123, 102, 84, 68, 54, 43, 33, 26, 20, 17, 16,
36         // bs = 32
37         255, 240, 225, 210, 196, 182, 169, 157, 145, 133, 122, 111, 101, 92, 83, 74,
38         66, 59, 52, 45, 39, 34, 29, 25, 21, 17, 14, 12, 10, 9, 8, 8,
39         // bs = 64
40         255, 248, 240, 233, 225, 218, 210, 203, 196, 189, 182, 176, 169, 163, 156,
41         150, 144, 138, 133, 127, 121, 116, 111, 106, 101, 96, 91, 86, 82, 77, 73, 69,
42         65, 61, 57, 54, 50, 47, 44, 41, 38, 35, 32, 29, 27, 25, 22, 20, 18, 16, 15,
43         13, 12, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4,
44     };
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 #endif // EbIntraPrediction_AVX2_h
50