xref: /aosp_15_r20/external/libgav1/src/dsp/smooth_weights.inc (revision 095378508e87ed692bf8dfeb34008b65b3735891)
1*09537850SAkhilesh Sanikop// Copyright 2021 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// Each row below contains weights used for a corresponding block size. Because
16*09537850SAkhilesh Sanikop// they are adjacent powers of 2, the index of each row is the sum of the sizes
17*09537850SAkhilesh Sanikop// of preceding rows, minus 4.
18*09537850SAkhilesh Sanikop// The weights need to be declared as uint8_t or uint16_t, depending on the
19*09537850SAkhilesh Sanikop// bitdepth, so the values are held in a single canonical place.
20*09537850SAkhilesh Sanikop// clang-format off
21*09537850SAkhilesh Sanikop    // block dimension = 4
22*09537850SAkhilesh Sanikop    255, 149, 85, 64,
23*09537850SAkhilesh Sanikop    // block dimension = 8
24*09537850SAkhilesh Sanikop    255, 197, 146, 105, 73, 50, 37, 32,
25*09537850SAkhilesh Sanikop    // block dimension = 16
26*09537850SAkhilesh Sanikop    255, 225, 196, 170, 145, 123, 102, 84, 68, 54, 43, 33, 26, 20, 17, 16,
27*09537850SAkhilesh Sanikop    // block dimension = 32
28*09537850SAkhilesh Sanikop    255, 240, 225, 210, 196, 182, 169, 157, 145, 133, 122, 111, 101, 92, 83, 74,
29*09537850SAkhilesh Sanikop    66, 59, 52, 45, 39, 34, 29, 25, 21, 17, 14, 12, 10, 9, 8, 8,
30*09537850SAkhilesh Sanikop    // block dimension = 64
31*09537850SAkhilesh Sanikop    255, 248, 240, 233, 225, 218, 210, 203, 196, 189, 182, 176, 169, 163, 156,
32*09537850SAkhilesh Sanikop    150, 144, 138, 133, 127, 121, 116, 111, 106, 101, 96, 91, 86, 82, 77, 73,
33*09537850SAkhilesh Sanikop    69, 65, 61, 57, 54, 50, 47, 44, 41, 38, 35, 32, 29, 27, 25, 22, 20, 18, 16,
34*09537850SAkhilesh Sanikop    15, 13, 12, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 4
35*09537850SAkhilesh Sanikop    // clang-format on
36