xref: /aosp_15_r20/external/libdav1d/src/x86/itx.h (revision c09093415860a1c2373dacd84c4fde00c507cdfd)
1*c0909341SAndroid Build Coastguard Worker /*
2*c0909341SAndroid Build Coastguard Worker  * Copyright © 2018-2023, VideoLAN and dav1d authors
3*c0909341SAndroid Build Coastguard Worker  * Copyright © 2018-2023, Two Orioles, LLC
4*c0909341SAndroid Build Coastguard Worker  * All rights reserved.
5*c0909341SAndroid Build Coastguard Worker  *
6*c0909341SAndroid Build Coastguard Worker  * Redistribution and use in source and binary forms, with or without
7*c0909341SAndroid Build Coastguard Worker  * modification, are permitted provided that the following conditions are met:
8*c0909341SAndroid Build Coastguard Worker  *
9*c0909341SAndroid Build Coastguard Worker  * 1. Redistributions of source code must retain the above copyright notice, this
10*c0909341SAndroid Build Coastguard Worker  *    list of conditions and the following disclaimer.
11*c0909341SAndroid Build Coastguard Worker  *
12*c0909341SAndroid Build Coastguard Worker  * 2. Redistributions in binary form must reproduce the above copyright notice,
13*c0909341SAndroid Build Coastguard Worker  *    this list of conditions and the following disclaimer in the documentation
14*c0909341SAndroid Build Coastguard Worker  *    and/or other materials provided with the distribution.
15*c0909341SAndroid Build Coastguard Worker  *
16*c0909341SAndroid Build Coastguard Worker  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17*c0909341SAndroid Build Coastguard Worker  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18*c0909341SAndroid Build Coastguard Worker  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19*c0909341SAndroid Build Coastguard Worker  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20*c0909341SAndroid Build Coastguard Worker  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21*c0909341SAndroid Build Coastguard Worker  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22*c0909341SAndroid Build Coastguard Worker  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23*c0909341SAndroid Build Coastguard Worker  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24*c0909341SAndroid Build Coastguard Worker  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25*c0909341SAndroid Build Coastguard Worker  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*c0909341SAndroid Build Coastguard Worker  */
27*c0909341SAndroid Build Coastguard Worker 
28*c0909341SAndroid Build Coastguard Worker #include "src/cpu.h"
29*c0909341SAndroid Build Coastguard Worker #include "src/itx.h"
30*c0909341SAndroid Build Coastguard Worker 
31*c0909341SAndroid Build Coastguard Worker #define BF_BPC(x, bits, suffix) x##_##bits##bpc_##suffix
32*c0909341SAndroid Build Coastguard Worker 
33*c0909341SAndroid Build Coastguard Worker #define decl_itx_fns(ext) \
34*c0909341SAndroid Build Coastguard Worker decl_itx17_fns( 4,  4, ext); \
35*c0909341SAndroid Build Coastguard Worker decl_itx16_fns( 4,  8, ext); \
36*c0909341SAndroid Build Coastguard Worker decl_itx16_fns( 4, 16, ext); \
37*c0909341SAndroid Build Coastguard Worker decl_itx16_fns( 8,  4, ext); \
38*c0909341SAndroid Build Coastguard Worker decl_itx16_fns( 8,  8, ext); \
39*c0909341SAndroid Build Coastguard Worker decl_itx16_fns( 8, 16, ext); \
40*c0909341SAndroid Build Coastguard Worker decl_itx2_fns ( 8, 32, ext); \
41*c0909341SAndroid Build Coastguard Worker decl_itx16_fns(16,  4, ext); \
42*c0909341SAndroid Build Coastguard Worker decl_itx16_fns(16,  8, ext); \
43*c0909341SAndroid Build Coastguard Worker decl_itx12_fns(16, 16, ext); \
44*c0909341SAndroid Build Coastguard Worker decl_itx2_fns (16, 32, ext); \
45*c0909341SAndroid Build Coastguard Worker decl_itx2_fns (32,  8, ext); \
46*c0909341SAndroid Build Coastguard Worker decl_itx2_fns (32, 16, ext); \
47*c0909341SAndroid Build Coastguard Worker decl_itx2_fns (32, 32, ext); \
48*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF(dav1d_inv_txfm_add_dct_dct_16x64, ext)); \
49*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF(dav1d_inv_txfm_add_dct_dct_32x64, ext)); \
50*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF(dav1d_inv_txfm_add_dct_dct_64x16, ext)); \
51*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF(dav1d_inv_txfm_add_dct_dct_64x32, ext)); \
52*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF(dav1d_inv_txfm_add_dct_dct_64x64, ext))
53*c0909341SAndroid Build Coastguard Worker 
54*c0909341SAndroid Build Coastguard Worker 
55*c0909341SAndroid Build Coastguard Worker #define decl_itx2_bpc_fns(w, h, bpc, opt) \
56*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_dct_##w##x##h, bpc, opt)); \
57*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_identity_identity_##w##x##h, bpc, opt))
58*c0909341SAndroid Build Coastguard Worker 
59*c0909341SAndroid Build Coastguard Worker #define decl_itx12_bpc_fns(w, h, bpc, opt) \
60*c0909341SAndroid Build Coastguard Worker decl_itx2_bpc_fns(w, h, bpc, opt); \
61*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_adst_##w##x##h, bpc, opt)); \
62*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_flipadst_##w##x##h, bpc, opt)); \
63*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_identity_##w##x##h, bpc, opt)); \
64*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_adst_dct_##w##x##h, bpc, opt)); \
65*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_adst_adst_##w##x##h, bpc, opt)); \
66*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_adst_flipadst_##w##x##h, bpc, opt)); \
67*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_flipadst_dct_##w##x##h, bpc, opt)); \
68*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_flipadst_adst_##w##x##h, bpc, opt)); \
69*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_flipadst_flipadst_##w##x##h, bpc, opt)); \
70*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_identity_dct_##w##x##h, bpc, opt))
71*c0909341SAndroid Build Coastguard Worker 
72*c0909341SAndroid Build Coastguard Worker #define decl_itx16_bpc_fns(w, h, bpc, opt) \
73*c0909341SAndroid Build Coastguard Worker decl_itx12_bpc_fns(w, h, bpc, opt); \
74*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_adst_identity_##w##x##h, bpc, opt)); \
75*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_flipadst_identity_##w##x##h, bpc, opt)); \
76*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_identity_adst_##w##x##h, bpc, opt)); \
77*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_identity_flipadst_##w##x##h, bpc, opt))
78*c0909341SAndroid Build Coastguard Worker 
79*c0909341SAndroid Build Coastguard Worker #define decl_itx_bpc_fns(bpc, ext) \
80*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns( 4,  4, bpc, ext); \
81*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns( 4,  8, bpc, ext); \
82*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns( 4, 16, bpc, ext); \
83*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns( 8,  4, bpc, ext); \
84*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns( 8,  8, bpc, ext); \
85*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns( 8, 16, bpc, ext); \
86*c0909341SAndroid Build Coastguard Worker decl_itx2_bpc_fns ( 8, 32, bpc, ext); \
87*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns(16,  4, bpc, ext); \
88*c0909341SAndroid Build Coastguard Worker decl_itx16_bpc_fns(16,  8, bpc, ext); \
89*c0909341SAndroid Build Coastguard Worker decl_itx12_bpc_fns(16, 16, bpc, ext); \
90*c0909341SAndroid Build Coastguard Worker decl_itx2_bpc_fns (16, 32, bpc, ext); \
91*c0909341SAndroid Build Coastguard Worker decl_itx2_bpc_fns (32,  8, bpc, ext); \
92*c0909341SAndroid Build Coastguard Worker decl_itx2_bpc_fns (32, 16, bpc, ext); \
93*c0909341SAndroid Build Coastguard Worker decl_itx2_bpc_fns (32, 32, bpc, ext); \
94*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_dct_16x64, bpc, ext)); \
95*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_dct_32x64, bpc, ext)); \
96*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_dct_64x16, bpc, ext)); \
97*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_dct_64x32, bpc, ext)); \
98*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF_BPC(dav1d_inv_txfm_add_dct_dct_64x64, bpc, ext))
99*c0909341SAndroid Build Coastguard Worker 
100*c0909341SAndroid Build Coastguard Worker decl_itx_fns(avx512icl);
101*c0909341SAndroid Build Coastguard Worker decl_itx_bpc_fns(10, avx512icl);
102*c0909341SAndroid Build Coastguard Worker decl_itx_fns(avx2);
103*c0909341SAndroid Build Coastguard Worker decl_itx_bpc_fns(10, avx2);
104*c0909341SAndroid Build Coastguard Worker decl_itx_bpc_fns(12, avx2);
105*c0909341SAndroid Build Coastguard Worker decl_itx_fns(sse4);
106*c0909341SAndroid Build Coastguard Worker decl_itx_fns(ssse3);
107*c0909341SAndroid Build Coastguard Worker decl_itx_fn(dav1d_inv_txfm_add_wht_wht_4x4_16bpc_avx2);
108*c0909341SAndroid Build Coastguard Worker decl_itx_fn(BF(dav1d_inv_txfm_add_wht_wht_4x4, sse2));
109*c0909341SAndroid Build Coastguard Worker 
itx_dsp_init_x86(Dav1dInvTxfmDSPContext * const c,const int bpc,int * const all_simd)110*c0909341SAndroid Build Coastguard Worker static ALWAYS_INLINE void itx_dsp_init_x86(Dav1dInvTxfmDSPContext *const c,
111*c0909341SAndroid Build Coastguard Worker                                            const int bpc, int *const all_simd)
112*c0909341SAndroid Build Coastguard Worker {
113*c0909341SAndroid Build Coastguard Worker #define assign_itx_bpc_fn(pfx, w, h, type, type_enum, bpc, ext) \
114*c0909341SAndroid Build Coastguard Worker     c->itxfm_add[pfx##TX_##w##X##h][type_enum] = \
115*c0909341SAndroid Build Coastguard Worker         BF_BPC(dav1d_inv_txfm_add_##type##_##w##x##h, bpc, ext)
116*c0909341SAndroid Build Coastguard Worker 
117*c0909341SAndroid Build Coastguard Worker #define assign_itx1_bpc_fn(pfx, w, h, bpc, ext) \
118*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, dct_dct,           DCT_DCT,           bpc, ext)
119*c0909341SAndroid Build Coastguard Worker 
120*c0909341SAndroid Build Coastguard Worker #define assign_itx2_bpc_fn(pfx, w, h, bpc, ext) \
121*c0909341SAndroid Build Coastguard Worker     assign_itx1_bpc_fn(pfx, w, h, bpc, ext); \
122*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, identity_identity, IDTX,              bpc, ext)
123*c0909341SAndroid Build Coastguard Worker 
124*c0909341SAndroid Build Coastguard Worker #define assign_itx12_bpc_fn(pfx, w, h, bpc, ext) \
125*c0909341SAndroid Build Coastguard Worker     assign_itx2_bpc_fn(pfx, w, h, bpc, ext); \
126*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, dct_adst,          ADST_DCT,          bpc, ext); \
127*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, dct_flipadst,      FLIPADST_DCT,      bpc, ext); \
128*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, dct_identity,      H_DCT,             bpc, ext); \
129*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, adst_dct,          DCT_ADST,          bpc, ext); \
130*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, adst_adst,         ADST_ADST,         bpc, ext); \
131*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, adst_flipadst,     FLIPADST_ADST,     bpc, ext); \
132*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, flipadst_dct,      DCT_FLIPADST,      bpc, ext); \
133*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, flipadst_adst,     ADST_FLIPADST,     bpc, ext); \
134*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, flipadst_flipadst, FLIPADST_FLIPADST, bpc, ext); \
135*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, identity_dct,      V_DCT,             bpc, ext)
136*c0909341SAndroid Build Coastguard Worker 
137*c0909341SAndroid Build Coastguard Worker #define assign_itx16_bpc_fn(pfx, w, h, bpc, ext) \
138*c0909341SAndroid Build Coastguard Worker     assign_itx12_bpc_fn(pfx, w, h, bpc, ext); \
139*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, adst_identity,     H_ADST,            bpc, ext); \
140*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, flipadst_identity, H_FLIPADST,        bpc, ext); \
141*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, identity_adst,     V_ADST,            bpc, ext); \
142*c0909341SAndroid Build Coastguard Worker     assign_itx_bpc_fn(pfx, w, h, identity_flipadst, V_FLIPADST,        bpc, ext)
143*c0909341SAndroid Build Coastguard Worker 
144*c0909341SAndroid Build Coastguard Worker     const unsigned flags = dav1d_get_cpu_flags();
145*c0909341SAndroid Build Coastguard Worker 
146*c0909341SAndroid Build Coastguard Worker     if (!(flags & DAV1D_X86_CPU_FLAG_SSE2)) return;
147*c0909341SAndroid Build Coastguard Worker 
148*c0909341SAndroid Build Coastguard Worker     assign_itx_fn(, 4, 4, wht_wht, WHT_WHT, sse2);
149*c0909341SAndroid Build Coastguard Worker 
150*c0909341SAndroid Build Coastguard Worker     if (!(flags & DAV1D_X86_CPU_FLAG_SSSE3)) return;
151*c0909341SAndroid Build Coastguard Worker 
152*c0909341SAndroid Build Coastguard Worker #if BITDEPTH == 8
153*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(,   4,  4, ssse3);
154*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  4,  8, ssse3);
155*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  8,  4, ssse3);
156*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(,   8,  8, ssse3);
157*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  4, 16, ssse3);
158*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R, 16,  4, ssse3);
159*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  8, 16, ssse3);
160*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R, 16,  8, ssse3);
161*c0909341SAndroid Build Coastguard Worker     assign_itx12_fn(,  16, 16, ssse3);
162*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R,  8, 32, ssse3);
163*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 32,  8, ssse3);
164*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 16, 32, ssse3);
165*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 32, 16, ssse3);
166*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (,  32, 32, ssse3);
167*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 16, 64, ssse3);
168*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 32, 64, ssse3);
169*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 64, 16, ssse3);
170*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 64, 32, ssse3);
171*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn ( , 64, 64, ssse3);
172*c0909341SAndroid Build Coastguard Worker     *all_simd = 1;
173*c0909341SAndroid Build Coastguard Worker #endif
174*c0909341SAndroid Build Coastguard Worker 
175*c0909341SAndroid Build Coastguard Worker     if (!(flags & DAV1D_X86_CPU_FLAG_SSE41)) return;
176*c0909341SAndroid Build Coastguard Worker 
177*c0909341SAndroid Build Coastguard Worker #if BITDEPTH == 16
178*c0909341SAndroid Build Coastguard Worker     if (bpc == 10) {
179*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(,   4,  4, sse4);
180*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(R,  4,  8, sse4);
181*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(R,  4, 16, sse4);
182*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(R,  8,  4, sse4);
183*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(,   8,  8, sse4);
184*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(R,  8, 16, sse4);
185*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(R, 16,  4, sse4);
186*c0909341SAndroid Build Coastguard Worker         assign_itx16_fn(R, 16,  8, sse4);
187*c0909341SAndroid Build Coastguard Worker         assign_itx12_fn(,  16, 16, sse4);
188*c0909341SAndroid Build Coastguard Worker         assign_itx2_fn (R,  8, 32, sse4);
189*c0909341SAndroid Build Coastguard Worker         assign_itx2_fn (R, 32,  8, sse4);
190*c0909341SAndroid Build Coastguard Worker         assign_itx2_fn (R, 16, 32, sse4);
191*c0909341SAndroid Build Coastguard Worker         assign_itx2_fn (R, 32, 16, sse4);
192*c0909341SAndroid Build Coastguard Worker         assign_itx2_fn (,  32, 32, sse4);
193*c0909341SAndroid Build Coastguard Worker         assign_itx1_fn (R, 16, 64, sse4);
194*c0909341SAndroid Build Coastguard Worker         assign_itx1_fn (R, 32, 64, sse4);
195*c0909341SAndroid Build Coastguard Worker         assign_itx1_fn (R, 64, 16, sse4);
196*c0909341SAndroid Build Coastguard Worker         assign_itx1_fn (R, 64, 32, sse4);
197*c0909341SAndroid Build Coastguard Worker         assign_itx1_fn (,  64, 64, sse4);
198*c0909341SAndroid Build Coastguard Worker         *all_simd = 1;
199*c0909341SAndroid Build Coastguard Worker     }
200*c0909341SAndroid Build Coastguard Worker #endif
201*c0909341SAndroid Build Coastguard Worker 
202*c0909341SAndroid Build Coastguard Worker #if ARCH_X86_64
203*c0909341SAndroid Build Coastguard Worker     if (!(flags & DAV1D_X86_CPU_FLAG_AVX2)) return;
204*c0909341SAndroid Build Coastguard Worker 
205*c0909341SAndroid Build Coastguard Worker     assign_itx_fn(, 4, 4, wht_wht, WHT_WHT, avx2);
206*c0909341SAndroid Build Coastguard Worker 
207*c0909341SAndroid Build Coastguard Worker #if BITDEPTH == 8
208*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn( ,  4,  4, avx2);
209*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  4,  8, avx2);
210*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  4, 16, avx2);
211*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  8,  4, avx2);
212*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn( ,  8,  8, avx2);
213*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  8, 16, avx2);
214*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R,  8, 32, avx2);
215*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R, 16,  4, avx2);
216*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R, 16,  8, avx2);
217*c0909341SAndroid Build Coastguard Worker     assign_itx12_fn( , 16, 16, avx2);
218*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 16, 32, avx2);
219*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 16, 64, avx2);
220*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 32,  8, avx2);
221*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 32, 16, avx2);
222*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn ( , 32, 32, avx2);
223*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 32, 64, avx2);
224*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 64, 16, avx2);
225*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 64, 32, avx2);
226*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn ( , 64, 64, avx2);
227*c0909341SAndroid Build Coastguard Worker #else
228*c0909341SAndroid Build Coastguard Worker     if (bpc == 10) {
229*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn( ,  4,  4, 10, avx2);
230*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  4,  8, 10, avx2);
231*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  4, 16, 10, avx2);
232*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  8,  4, 10, avx2);
233*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn( ,  8,  8, 10, avx2);
234*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  8, 16, 10, avx2);
235*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R,  8, 32, 10, avx2);
236*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R, 16,  4, 10, avx2);
237*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R, 16,  8, 10, avx2);
238*c0909341SAndroid Build Coastguard Worker         assign_itx12_bpc_fn( , 16, 16, 10, avx2);
239*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R, 16, 32, 10, avx2);
240*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 16, 64, 10, avx2);
241*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R, 32,  8, 10, avx2);
242*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R, 32, 16, 10, avx2);
243*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn ( , 32, 32, 10, avx2);
244*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 32, 64, 10, avx2);
245*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 64, 16, 10, avx2);
246*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 64, 32, 10, avx2);
247*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn ( , 64, 64, 10, avx2);
248*c0909341SAndroid Build Coastguard Worker     } else {
249*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn( ,  4,  4, 12, avx2);
250*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  4,  8, 12, avx2);
251*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  4, 16, 12, avx2);
252*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  8,  4, 12, avx2);
253*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn( ,  8,  8, 12, avx2);
254*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  8, 16, 12, avx2);
255*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R,  8, 32, 12, avx2);
256*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R, 16,  4, 12, avx2);
257*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R, 16,  8, 12, avx2);
258*c0909341SAndroid Build Coastguard Worker         assign_itx12_bpc_fn( , 16, 16, 12, avx2);
259*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R, 32,  8, 12, avx2);
260*c0909341SAndroid Build Coastguard Worker         assign_itx_bpc_fn(R, 16, 32, identity_identity, IDTX, 12, avx2);
261*c0909341SAndroid Build Coastguard Worker         assign_itx_bpc_fn(R, 32, 16, identity_identity, IDTX, 12, avx2);
262*c0909341SAndroid Build Coastguard Worker         assign_itx_bpc_fn( , 32, 32, identity_identity, IDTX, 12, avx2);
263*c0909341SAndroid Build Coastguard Worker     }
264*c0909341SAndroid Build Coastguard Worker #endif
265*c0909341SAndroid Build Coastguard Worker 
266*c0909341SAndroid Build Coastguard Worker     if (!(flags & DAV1D_X86_CPU_FLAG_AVX512ICL)) return;
267*c0909341SAndroid Build Coastguard Worker 
268*c0909341SAndroid Build Coastguard Worker #if BITDEPTH == 8
269*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn( ,  4,  4, avx512icl); // no wht
270*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  4,  8, avx512icl);
271*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  4, 16, avx512icl);
272*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  8,  4, avx512icl);
273*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn( ,  8,  8, avx512icl);
274*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R,  8, 16, avx512icl);
275*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R,  8, 32, avx512icl);
276*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R, 16,  4, avx512icl);
277*c0909341SAndroid Build Coastguard Worker     assign_itx16_fn(R, 16,  8, avx512icl);
278*c0909341SAndroid Build Coastguard Worker     assign_itx12_fn( , 16, 16, avx512icl);
279*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 16, 32, avx512icl);
280*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 16, 64, avx512icl);
281*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 32,  8, avx512icl);
282*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn (R, 32, 16, avx512icl);
283*c0909341SAndroid Build Coastguard Worker     assign_itx2_fn ( , 32, 32, avx512icl);
284*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 32, 64, avx512icl);
285*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 64, 16, avx512icl);
286*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn (R, 64, 32, avx512icl);
287*c0909341SAndroid Build Coastguard Worker     assign_itx1_fn ( , 64, 64, avx512icl);
288*c0909341SAndroid Build Coastguard Worker #else
289*c0909341SAndroid Build Coastguard Worker     if (bpc == 10) {
290*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn( ,  8,  8, 10, avx512icl);
291*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R,  8, 16, 10, avx512icl);
292*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R,  8, 32, 10, avx512icl);
293*c0909341SAndroid Build Coastguard Worker         assign_itx16_bpc_fn(R, 16,  8, 10, avx512icl);
294*c0909341SAndroid Build Coastguard Worker         assign_itx12_bpc_fn( , 16, 16, 10, avx512icl);
295*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R, 16, 32, 10, avx512icl);
296*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R, 32,  8, 10, avx512icl);
297*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn (R, 32, 16, 10, avx512icl);
298*c0909341SAndroid Build Coastguard Worker         assign_itx2_bpc_fn ( , 32, 32, 10, avx512icl);
299*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 16, 64, 10, avx512icl);
300*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 32, 64, 10, avx512icl);
301*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 64, 16, 10, avx512icl);
302*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn (R, 64, 32, 10, avx512icl);
303*c0909341SAndroid Build Coastguard Worker         assign_itx1_bpc_fn ( , 64, 64, 10, avx512icl);
304*c0909341SAndroid Build Coastguard Worker     }
305*c0909341SAndroid Build Coastguard Worker #endif
306*c0909341SAndroid Build Coastguard Worker #endif
307*c0909341SAndroid Build Coastguard Worker }
308