1 /******************************************************************************
2 *
3 * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18 /**
19 *******************************************************************************
20 * @file
21 *  ihevc_trans_tables.c
22 *
23 * @brief
24 *  Contains tables used for forward and inverse  transform
25 *
26 * @author
27 *  100470
28 *
29 * @par List of Tables:
30 * g_ihevc_iquant_scales
31 * g_ihevc_iquant_intr_scales
32 * g_ihevc_quant_scales
33 * g_ai4_ihevc_trans_4_ttype1
34 * g_ai4_ihevc_trans_4_ttype0
35 * g_ai2_ihevc_trans_dst_4
36 * g_ai4_ihevc_trans_dst_intr_4
37 * g_ai2_ihevc_trans_4
38 * g_ai2_ihevc_trans_4_transpose
39 * g_ai4_ihevc_trans_4_intr
40 * g_ai2_ihevc_trans_4_intr
41 * g_ai2_ihevc_trans_8
42 * g_ai2_ihevc_trans_8_transpose
43 * g_ai4_ihevc_trans_8_intr
44 * g_ai2_ihevc_trans_8_intr
45 * g_ai4_ihevc_trans_intr_even_8
46 * g_ai4_ihevc_trans_intr_odd_8
47 * g_ai2_ihevc_trans_16
48 * g_ai2_ihevc_trans_16_transpose
49 * g_ai2_ihevc_trans_32_intr_8
50 * g_ai4_ihevc_trans_16_even
51 * g_ai4_ihevc_trans_16_odd
52 * g_ai2_ihevc_trans_32_transpose
53 * g_ai2_ihevc_trans_32
54 * g_ai2_ihevc_trans_32_intr_16
55 * g_ai2_ihevc_trans_16_intr_odd
56 * g_ai2_ihevc_trans_16_intr_even
57 * g_ai2_ihevc_trans_32_intr_even
58 * g_ai2_ihevc_trans_32_intr_odd
59 * g_ai2_ihevc_trans_16_even_packed
60 * g_ai2_ihevc_trans_32_intr_packed
61 * g_ai2_ihevc_trans_32_intr_odd_packed
62 * g_ai2_ihevc_trans_16_even
63 * g_ai2_ihevc_trans_16_odd
64 * g_ai2_ihevc_trans_intr_even_8
65 * g_ai2_ihevc_trans_intr_odd_8
66 * g_ai2_ihevc_trans_intr_4
67 * IHEVCE_CHROMA_SHUFFLEMASK_HBD
68 * g_ai4_ihevc_trans_8_intr_avx2
69 * g_ai2_ihevc_trans_8_intr_avx2
70 * g_ai2_ihevc_trans_32_intr_8_avx2
71 * g_ai2_ihevc_trans_32_intr_16_avx2
72 * g_ai2_ihevc_trans_16_intr_odd_avx2
73 * g_ai2_ihevc_trans_16_intr_even_avx2
74 
75 *
76 * @remarks
77 *  None
78 *
79 *******************************************************************************
80 */
81 
82 #include "ihevc_typedefs.h"
83 #include "ihevc_macros.h"
84 
85 #include "ihevc_platform_macros.h"
86 #include "ihevc_func_selector.h"
87 #include "ihevc_macros.h"
88 #include "ihevc_trans_tables.h"
89 #include "ihevc_defs.h"
90 
91 const WORD32 g_ihevc_iquant_scales[6] =
92 {
93     40, 45, 51, 57, 64, 72
94 };
95 
96 /*Multiplied by 16 for flat scale coeff */
97 const WORD32 g_ihevc_iquant_scales_flat_scale[6] =
98 {
99     640, 720, 816, 912, 1024, 1152
100 };
101 
102 const WORD16 g_ihevc_iquant_intr_scales[6][8] =
103 {
104     { 40, 40, 40, 40, 40, 40, 40, 40 },
105     { 45, 45, 45, 45, 45, 45, 45, 45 },
106     { 51, 51, 51, 51, 51, 51, 51, 51 },
107     { 57, 57, 57, 57, 57, 57, 57, 57 },
108     { 64, 64, 64, 64, 64, 64, 64, 64 },
109     { 72, 72, 72, 72, 72, 72, 72, 72 }
110 };
111 
112 const WORD32 g_ihevc_quant_scales[6] =
113 {
114     26214, 23302, 20560, 18396, 16384, 14564
115 };
116 
117 //DST coeffs
118 const WORD32 g_ai4_ihevc_trans_4_ttype1[3][4] =
119 {
120     { 55, 55, 55, 55 },
121     { 29, 29, 29, 29 },
122     { 74, 74, 74, 74 }
123 };
124 
125 //DCT coeffs
126 const WORD32 g_ai4_ihevc_trans_4_ttype0[3][4] =
127 {
128     { 36, 36, 36, 36 },
129     { 64, 64, 64, 64 },
130     { 83, 83, 83, 83 }
131 };
132 
133 const WORD16 g_ai2_ihevc_trans_dst_4[4][4] =
134 {
135     { 29, 55, 74, 84 },
136     { 74, 74, 0, -74 },
137     { 84, -29, -74, 55 },
138     { 55, -84, 74, -29 }
139 };
140 
141 const WORD32 g_ai4_ihevc_trans_dst_intr_4[3][4] =
142 { /* 4*32 = 128 bit */
143     { 29, 29, 29, 29 },
144     { 55, 55, 55, 55 },
145     { 74, 74, 74, 74 }
146 };
147 
148 const WORD16 g_ai2_ihevc_trans_4[4][4] =
149 {
150     { 64,  64,  64,  64 },
151     { 83,  36, -36, -83 },
152     { 64, -64, -64,  64 },
153     { 36, -83,  83, -36 }
154 };
155 
156 const WORD16 g_ai2_ihevc_trans_4_transpose[4][4] =
157 {
158     { 64,  83,  64,  36 },
159     { 64,  36, -64, -83 },
160     { 64, -36, -64,  83 },
161     { 64, -83,  64, -36 }
162 };
163 
164 const WORD32 g_ai4_ihevc_trans_4_intr[3][4] =
165 { /* 4*32 = 128 bit */
166     { 64, 64, 64, 64 },
167     { 83, 83, 83, 83 },
168     { 36, 36, 36, 36 }
169 };
170 
171 const WORD16 g_ai2_ihevc_trans_4_intr[8] = { 64, 64, 83, 36, 64, -64, 36, -83 };
172 
173 
174 const WORD16 g_ai2_ihevc_trans_8[8][8] =
175 {
176     { 64,  64,  64,  64,  64,  64,  64,  64 },
177     { 89,  75,  50,  18, -18, -50, -75, -89 },
178     { 83,  36, -36, -83, -83, -36,  36,  83 },
179     { 75, -18, -89, -50,  50,  89,  18, -75 },
180     { 64, -64, -64,  64,  64, -64, -64,  64 },
181     { 50, -89,  18,  75, -75, -18,  89, -50 },
182     { 36, -83,  83, -36, -36,  83, -83,  36 },
183     { 18, -50,  75, -89,  89, -75,  50, -18 }
184 };
185 
186 /* Used by itrans_recon_8x8 */
187 const WORD16 g_ai2_ihevc_trans_8_transpose[8][8] =
188 {
189     { 64,  89,  83,  75,  64,  50,  36,  18 },
190     { 64,  75,  36, -18, -64, -89, -83, -50 },
191     { 64,  50, -36, -89, -64,  18,  83,  75 },
192     { 64,  18, -83, -50,  64,  75, -36, -89 },
193     { 64, -18, -83,  50,  64, -75, -36,  89 },
194     { 64, -50, -36,  89, -64, -18,  83, -75 },
195     { 64, -75,  36,  18, -64,  89, -83,  50 },
196     { 64, -89,  83, -75,  64, -50,  36, -18 }
197 };
198 
199 const WORD32 g_ai4_ihevc_trans_8_intr[7][4] =
200 { /* 4*32 = 128 bit */
201     { 64, 64, 64, 64 },
202     { 83, 83, 83, 83 },
203     { 36, 36, 36, 36 },
204     { 75, 75, 75, 75 },
205     { 18, 18, 18, 18 },
206     { 89, 89, 89, 89 },
207     { 50, 50, 50, 50 },
208 };
209 
210 
211 const WORD16 g_ai2_ihevc_trans_8_intr[8][8] =
212 { /* 4*32 = 128 bit */
213     { 64,  64,  64,  64,  64,  64,  64,  64 },
214     { 89,  75,  18,  50,  89,  75,  18,  50 },
215     { 83,  36,  83,  36,  83,  36,  83,  36 },
216     { 75, -18, -50, -89,  75, -18, -50, -89 },
217     { 64, -64,  64, -64,  64, -64,  64, -64 },
218     { 50, -89,  75,  18,  50, -89,  75,  18 },
219     { 36, -83,  36, -83,  36, -83,  36, -83 },
220     { 18, -50, -89,  75,  18, -50, -89,  75 }
221 };
222 
223 
224 const WORD32 g_ai4_ihevc_trans_intr_even_8[3][4] =
225 {
226     { 64, 64, 64, 64 },
227     { 83, 83, 83, 83 },
228     { 36, 36, 36, 36 },
229 };
230 
231 const WORD32 g_ai4_ihevc_trans_intr_odd_8[4][4] =
232 {
233     { 89, 89, 89, 89 },
234     { 75, 75, 75, 75 },
235     { 50, 50, 50, 50 },
236     { 18, 18, 18, 18 }
237 };
238 
239 const WORD16 g_ai2_ihevc_trans_16[16][16] =
240 {
241     { 64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64 },
242     { 90,  87,  80,  70,  57,  43,  25,   9,  -9, -25, -43, -57, -70, -80, -87, -90 },
243     { 89,  75,  50,  18, -18, -50, -75, -89, -89, -75, -50, -18,  18,  50,  75,  89 },
244     { 87,  57,   9, -43, -80, -90, -70, -25,  25,  70,  90,  80,  43,  -9, -57, -87 },
245     { 83,  36, -36, -83, -83, -36,  36,  83,  83,  36, -36, -83, -83, -36,  36,  83 },
246     { 80,   9, -70, -87, -25,  57,  90,  43, -43, -90, -57,  25,  87,  70,  -9, -80 },
247     { 75, -18, -89, -50,  50,  89,  18, -75, -75,  18,  89,  50, -50, -89, -18,  75 },
248     { 70, -43, -87,   9,  90,  25, -80, -57,  57,  80, -25, -90,  -9,  87,  43, -70 },
249     { 64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64 },
250     { 57, -80, -25,  90,  -9, -87,  43,  70, -70, -43,  87,   9, -90,  25,  80, -57 },
251     { 50, -89,  18,  75, -75, -18,  89, -50, -50,  89, -18, -75,  75,  18, -89,  50 },
252     { 43, -90,  57,  25, -87,  70,   9, -80,  80,  -9, -70,  87, -25, -57,  90, -43 },
253     { 36, -83,  83, -36, -36,  83, -83,  36,  36, -83,  83, -36, -36,  83, -83,  36 },
254     { 25, -70,  90, -80,  43,   9, -57,  87, -87,  57,  -9, -43,  80, -90,  70, -25 },
255     { 18, -50,  75, -89,  89, -75,  50, -18, -18,  50, -75,  89, -89,  75, -50,  18 },
256     {  9, -25,  43, -57,  70, -80,  87, -90,  90, -87,  80, -70,  57, -43,  25,  -9 }
257 };
258 
259 const WORD32 g_ai4_ihevc_trans_16[16][8] =
260 {
261     { 64,  64,  64,  64,  64,  64,  64,  64 },
262     { 90,  87,  80,  70,  57,  43,  25,   9 },
263     { 89,  75,  50,  18, -18, -50, -75, -89 },
264     { 87,  57,   9, -43, -80, -90, -70, -25 },
265     { 83,  36, -36, -83, -83, -36,  36,  83 },
266     { 80,   9, -70, -87, -25,  57,  90,  43 },
267     { 75, -18, -89, -50,  50,  89,  18, -75 },
268     { 70, -43, -87,   9,  90,  25, -80, -57 },
269     { 64, -64, -64,  64,  64, -64, -64,  64 },
270     { 57, -80, -25,  90,  -9, -87,  43,  70 },
271     { 50, -89,  18,  75, -75, -18,  89, -50 },
272     { 43, -90,  57,  25, -87,  70,   9, -80 },
273     { 36, -83,  83, -36, -36,  83, -83,  36 },
274     { 25, -70,  90, -80,  43,   9, -57,  87 },
275     { 18, -50,  75, -89,  89, -75,  50, -18 },
276     {  9, -25,  43, -57,  70, -80,  87, -90}};
277 
278 const WORD16 g_ai2_ihevc_trans_16_transpose[1][16] =
279 {
280     { 64, 90, 89, 87, 83, 80, 75, 70, 64, 57, 50, 43, 36, 25, 18, 9 }
281 };
282 
283 const WORD32 g_ai2_ihevc_trans_32_intr_8[8][4] =
284 { /* 4*32 = 128 bit */
285     { 90, 90, 90, 90 },
286     { 87, 87, 87, 87 },
287     { 80, 80, 80, 80 },
288     { 70, 70, 70, 70 },
289     { 57, 57, 57, 57 },
290     { 43, 43, 43, 43 },
291     { 25, 25, 25, 25 },
292     {  9,  9,  9,  9 }
293 };
294 
295 const WORD32 g_ai4_ihevc_trans_16_even[7][4] =
296 {
297     { 64, 64, 64, 64 },
298     { 89, 89, 89, 89 },
299     { 75, 75, 75, 75 },
300     { 83, 83, 83, 83 },
301     { 36, 36, 36, 36 },
302     { 18, 18, 18, 18 },
303     { 50, 50, 50, 50 },
304 };
305 
306 const WORD32 g_ai4_ihevc_trans_16_odd[8][4] =
307 {
308     { 90, 90, 90, 90 },
309     { 87, 87, 87, 87 },
310     { 80, 80, 80, 80 },
311     { 70, 70, 70, 70 },
312     { 57, 57, 57, 57 },
313     { 43, 43, 43, 43 },
314     { 25, 25, 25, 25 },
315     { 9,  9,  9,  9  }
316 };
317 
318 const WORD16 g_ai2_ihevc_trans_32_transpose[1][32] =
319 {
320     { 64, 90, 90, 90, 89, 88, 87, 85, 83, 82, 80, 78, 75, 73, 70, 67, 64, 61, 57, 54, 50, 46, 43, 38, 36, 31, 25, 22, 18, 13, 9, 4 }
321 };
322 const WORD16 g_ai2_ihevc_trans_32[32][32] =
323 {
324     { 64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64 },
325     { 90,  90,  88,  85,  82,  78,  73,  67,  61,  54,  46,  38,  31,  22,  13,   4,  -4, -13, -22, -31, -38, -46, -54, -61, -67, -73, -78, -82, -85, -88, -90, -90 },
326     { 90,  87,  80,  70,  57,  43,  25,   9,  -9, -25, -43, -57, -70, -80, -87, -90, -90, -87, -80, -70, -57, -43, -25,  -9,   9,  25,  43,  57,  70,  80,  87,  90 },
327     { 90,  82,  67,  46,  22,  -4, -31, -54, -73, -85, -90, -88, -78, -61, -38, -13,  13,  38,  61,  78,  88,  90,  85,  73,  54,  31,   4, -22, -46, -67, -82, -90 },
328     { 89,  75,  50,  18, -18, -50, -75, -89, -89, -75, -50, -18,  18,  50,  75,  89,  89,  75,  50,  18, -18, -50, -75, -89, -89, -75, -50, -18,  18,  50,  75,  89 },
329     { 88,  67,  31, -13, -54, -82, -90, -78, -46,  -4,  38,  73,  90,  85,  61,  22, -22, -61, -85, -90, -73, -38,   4,  46,  78,  90,  82,  54,  13, -31, -67, -88 },
330     { 87,  57,   9, -43, -80, -90, -70, -25,  25,  70,  90,  80,  43,  -9, -57, -87, -87, -57,  -9,  43,  80,  90,  70,  25, -25, -70, -90, -80, -43,   9,  57,  87 },
331     { 85,  46, -13, -67, -90, -73, -22,  38,  82,  88,  54,  -4, -61, -90, -78, -31,  31,  78,  90,  61,   4, -54, -88, -82, -38,  22,  73,  90,  67,  13, -46, -85 },
332     { 83,  36, -36, -83, -83, -36,  36,  83,  83,  36, -36, -83, -83, -36,  36,  83,  83,  36, -36, -83, -83, -36,  36,  83,  83,  36, -36, -83, -83, -36,  36,  83 },
333     { 82,  22, -54, -90, -61,  13,  78,  85,  31, -46, -90, -67,   4,  73,  88,  38, -38, -88, -73,  -4,  67,  90,  46, -31, -85, -78, -13,  61,  90,  54, -22, -82 },
334     { 80,   9, -70, -87, -25,  57,  90,  43, -43, -90, -57,  25,  87,  70,  -9, -80, -80,  -9,  70,  87,  25, -57, -90, -43,  43,  90,  57, -25, -87, -70,   9,  80 },
335     { 78,  -4, -82, -73,  13,  85,  67, -22, -88, -61,  31,  90,  54, -38, -90, -46,  46,  90,  38, -54, -90, -31,  61,  88,  22, -67, -85, -13,  73,  82,   4, -78 },
336     { 75, -18, -89, -50,  50,  89,  18, -75, -75,  18,  89,  50, -50, -89, -18,  75,  75, -18, -89, -50,  50,  89,  18, -75, -75,  18,  89,  50, -50, -89, -18,  75 },
337     { 73, -31, -90, -22,  78,  67, -38, -90, -13,  82,  61, -46, -88,  -4,  85,  54, -54, -85,   4,  88,  46, -61, -82,  13,  90,  38, -67, -78,  22,  90,  31, -73 },
338     { 70, -43, -87,   9,  90,  25, -80, -57,  57,  80, -25, -90,  -9,  87,  43, -70, -70,  43,  87,  -9, -90, -25,  80,  57, -57, -80,  25,  90,   9, -87, -43,  70 },
339     { 67, -54, -78,  38,  85, -22, -90,   4,  90,  13, -88, -31,  82,  46, -73, -61,  61,  73, -46, -82,  31,  88, -13, -90,  -4,  90,  22, -85, -38,  78,  54, -67 },
340     { 64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64 },
341     { 61, -73, -46,  82,  31, -88, -13,  90,  -4, -90,  22,  85, -38, -78,  54,  67, -67, -54,  78,  38, -85, -22,  90,   4, -90,  13,  88, -31, -82,  46,  73, -61 },
342     { 57, -80, -25,  90,  -9, -87,  43,  70, -70, -43,  87,   9, -90,  25,  80, -57, -57,  80,  25, -90,   9,  87, -43, -70,  70,  43, -87,  -9,  90, -25, -80,  57 },
343     { 54, -85,  -4,  88, -46, -61,  82,  13, -90,  38,  67, -78, -22,  90, -31, -73,  73,  31, -90,  22,  78, -67, -38,  90, -13, -82,  61,  46, -88,   4,  85, -54 },
344     { 50, -89,  18,  75, -75, -18,  89, -50, -50,  89, -18, -75,  75,  18, -89,  50,  50, -89,  18,  75, -75, -18,  89, -50, -50,  89, -18, -75,  75,  18, -89,  50 },
345     { 46, -90,  38,  54, -90,  31,  61, -88,  22,  67, -85,  13,  73, -82,   4,  78, -78,  -4,  82, -73, -13,  85, -67, -22,  88, -61, -31,  90, -54, -38,  90, -46 },
346     { 43, -90,  57,  25, -87,  70,   9, -80,  80,  -9, -70,  87, -25, -57,  90, -43, -43,  90, -57, -25,  87, -70,  -9,  80, -80,   9,  70, -87,  25,  57, -90,  43 },
347     { 38, -88,  73,  -4, -67,  90, -46, -31,  85, -78,  13,  61, -90,  54,  22, -82,  82, -22, -54,  90, -61, -13,  78, -85,  31,  46, -90,  67,   4, -73,  88, -38 },
348     { 36, -83,  83, -36, -36,  83, -83,  36,  36, -83,  83, -36, -36,  83, -83,  36,  36, -83,  83, -36, -36,  83, -83,  36,  36, -83,  83, -36, -36,  83, -83,  36 },
349     { 31, -78,  90, -61,   4,  54, -88,  82, -38, -22,  73, -90,  67, -13, -46,  85, -85,  46,  13, -67,  90, -73,  22,  38, -82,  88, -54,  -4,  61, -90,  78, -31 },
350     { 25, -70,  90, -80,  43,   9, -57,  87, -87,  57,  -9, -43,  80, -90,  70, -25, -25,  70, -90,  80, -43,  -9,  57, -87,  87, -57,   9,  43, -80,  90, -70,  25 },
351     { 22, -61,  85, -90,  73, -38,  -4,  46, -78,  90, -82,  54, -13, -31,  67, -88,  88, -67,  31,  13, -54,  82, -90,  78, -46,   4,  38, -73,  90, -85,  61, -22 },
352     { 18, -50,  75, -89,  89, -75,  50, -18, -18,  50, -75,  89, -89,  75, -50,  18,  18, -50,  75, -89,  89, -75,  50, -18, -18,  50, -75,  89, -89,  75, -50,  18 },
353     { 13, -38,  61, -78,  88, -90,  85, -73,  54, -31,   4,  22, -46,  67, -82,  90, -90,  82, -67,  46, -22,  -4,  31, -54,  73, -85,  90, -88,  78, -61,  38, -13 },
354     {  9, -25,  43, -57,  70, -80,  87, -90,  90, -87,  80, -70,  57, -43,  25,  -9,  -9,  25, -43,  57, -70,  80, -87,  90, -90,  87, -80,  70, -57,  43, -25,   9 },
355     {  4, -13,  22, -31,  38, -46,  54, -61,  67, -73,  78, -82,  85, -88,  90, -90,  90, -90,  88, -85,  82, -78,  73, -67,  61, -54,  46, -38,  31, -22,  13,  -4 }
356 };
357 
358 const WORD32 g_ai4_ihevc_trans_32[32][16] =
359 {
360     { 64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64},
361     { 90,  90,  88,  85,  82,  78,  73,  67,  61,  54,  46,  38,  31,  22,  13,   4},
362     { 90,  87,  80,  70,  57,  43,  25,   9,  -9, -25, -43, -57, -70, -80, -87, -90},
363     { 90,  82,  67,  46,  22,  -4, -31, -54, -73, -85, -90, -88, -78, -61, -38, -13},
364     { 89,  75,  50,  18, -18, -50, -75, -89, -89, -75, -50, -18,  18,  50,  75,  89},
365     { 88,  67,  31, -13, -54, -82, -90, -78, -46,  -4,  38,  73,  90,  85,  61,  22},
366     { 87,  57,   9, -43, -80, -90, -70, -25,  25,  70,  90,  80,  43,  -9, -57, -87},
367     { 85,  46, -13, -67, -90, -73, -22,  38,  82,  88,  54,  -4, -61, -90, -78, -31},
368     { 83,  36, -36, -83, -83, -36,  36,  83,  83,  36, -36, -83, -83, -36,  36,  83},
369     { 82,  22, -54, -90, -61,  13,  78,  85,  31, -46, -90, -67,   4,  73,  88,  38},
370     { 80,   9, -70, -87, -25,  57,  90,  43, -43, -90, -57,  25,  87,  70,  -9, -80},
371     { 78,  -4, -82, -73,  13,  85,  67, -22, -88, -61,  31,  90,  54, -38, -90, -46},
372     { 75, -18, -89, -50,  50,  89,  18, -75, -75,  18,  89,  50, -50, -89, -18,  75},
373     { 73, -31, -90, -22,  78,  67, -38, -90, -13,  82,  61, -46, -88,  -4,  85,  54},
374     { 70, -43, -87,   9,  90,  25, -80, -57,  57,  80, -25, -90,  -9,  87,  43, -70},
375     { 67, -54, -78,  38,  85, -22, -90,   4,  90,  13, -88, -31,  82,  46, -73, -61},
376     { 64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64,  64, -64, -64,  64},
377     { 61, -73, -46,  82,  31, -88, -13,  90,  -4, -90,  22,  85, -38, -78,  54,  67},
378     { 57, -80, -25,  90,  -9, -87,  43,  70, -70, -43,  87,   9, -90,  25,  80, -57},
379     { 54, -85,  -4,  88, -46, -61,  82,  13, -90,  38,  67, -78, -22,  90, -31, -73},
380     { 50, -89,  18,  75, -75, -18,  89, -50, -50,  89, -18, -75,  75,  18, -89,  50},
381     { 46, -90,  38,  54, -90,  31,  61, -88,  22,  67, -85,  13,  73, -82,   4,  78},
382     { 43, -90,  57,  25, -87,  70,   9, -80,  80,  -9, -70,  87, -25, -57,  90, -43},
383     { 38, -88,  73,  -4, -67,  90, -46, -31,  85, -78,  13,  61, -90,  54,  22, -82},
384     { 36, -83,  83, -36, -36,  83, -83,  36,  36, -83,  83, -36, -36,  83, -83,  36},
385     { 31, -78,  90, -61,   4,  54, -88,  82, -38, -22,  73, -90,  67, -13, -46,  85},
386     { 25, -70,  90, -80,  43,   9, -57,  87, -87,  57,  -9, -43,  80, -90,  70, -25},
387     { 22, -61,  85, -90,  73, -38,  -4,  46, -78,  90, -82,  54, -13, -31,  67, -88},
388     { 18, -50,  75, -89,  89, -75,  50, -18, -18,  50, -75,  89, -89,  75, -50,  18},
389     { 13, -38,  61, -78,  88, -90,  85, -73,  54, -31,   4,  22, -46,  67, -82,  90},
390     {  9, -25,  43, -57,  70, -80,  87, -90,  90, -87,  80, -70,  57, -43,  25,  -9},
391     {  4, -13,  22, -31,  38, -46,  54, -61,  67, -73,  78, -82,  85, -88,  90, -90}
392 };
393 
394 const WORD32 g_ai2_ihevc_trans_32_intr_16[15][4] =
395 { /* 4*32 = 128 bit */
396     { 90, 90, 90, 90 },
397     { 88, 88, 88, 88 },
398     { 85, 85, 85, 85 },
399     { 82, 82, 82, 82 },
400     { 78, 78, 78, 78 },
401     { 73, 73, 73, 73 },
402     { 67, 67, 67, 67 },
403     { 61, 61, 61, 61 },
404     { 54, 54, 54, 54 },
405     { 46, 46, 46, 46 },
406     { 38, 38, 38, 38 },
407     { 31, 31, 31, 31 },
408     { 22, 22, 22, 22 },
409     { 13, 13, 13, 13 },
410     { 4,  4,  4,  4  }
411 };
412 
413 const WORD16 g_ai2_ihevc_trans_16_intr_odd[32][8] =
414 {
415     {  90,  87,  90,  87,  90,  87,  90,  87 },
416     {  70,  80,  70,  80,  70,  80,  70,  80 },
417     {  57,  43,  57,  43,  57,  43,  57,  43 },
418     {   9,  25,   9,  25,   9,  25,   9,  25 },
419     {  87,  57,  87,  57,  87,  57,  87,  57 },
420     { -43,   9, -43,   9, -43,   9, -43,   9 },
421     { -80, -90, -80, -90, -80, -90, -80, -90 },
422     { -25, -70, -25, -70, -25, -70, -25, -70 },
423     {  80,   9,  80,   9,  80,   9,  80,   9 },
424     { -87, -70, -87, -70, -87, -70, -87, -70 },
425     { -25,  57, -25,  57, -25,  57, -25,  57 },
426     {  43,  90,  43,  90,  43,  90,  43,  90 },
427     {  70, -43,  70, -43,  70, -43,  70, -43 },
428     {   9, -87,   9, -87,   9, -87,   9, -87 },
429     {  90,  25,  90,  25,  90,  25,  90,  25 },
430     { -57, -80, -57, -80, -57, -80, -57, -80 },
431     {  57, -80,  57, -80,  57, -80,  57, -80 },
432     {  90, -25,  90, -25,  90, -25,  90, -25 },
433     {  -9, -87,  -9, -87,  -9, -87,  -9, -87 },
434     {  70,  43,  70,  43,  70,  43,  70,  43 },
435     {  43, -90,  43, -90,  43, -90,  43, -90 },
436     {  25,  57,  25,  57,  25,  57,  25,  57 },
437     { -87,  70, -87,  70, -87,  70, -87,  70 },
438     { -80,   9, -80,   9, -80,   9, -80,   9 },
439     {  25, -70,  25, -70,  25, -70,  25, -70 },
440     { -80,  90, -80,  90, -80,  90, -80,  90 },
441     {  43,   9,  43,   9,  43,   9,  43,   9 },
442     {  87, -57,  87, -57,  87, -57,  87, -57 },
443     {   9, -25,   9, -25,   9, -25,   9, -25 },
444     { -57,  43, -57,  43, -57,  43, -57,  43 },
445     {  70, -80,  70, -80,  70, -80,  70, -80 },
446     { -90,  87, -90,  87, -90,  87, -90,  87 }
447 };
448 
449 const WORD16 g_ai2_ihevc_trans_16_intr_even[12][8] =
450 {
451     {  64,  64,  64,  64,  64,  64,  64,  64 },
452     {  89,  75,  89,  75,  89,  75,  89,  75 },
453     {  18,  50,  18,  50,  18,  50,  18,  50 },
454     {  83,  36,  83,  36,  83,  36,  83,  36 },
455     {  75, -18,  75, -18,  75, -18,  75, -18 },
456     { -50, -89, -50, -89, -50, -89, -50, -89 },
457     {  64, -64,  64, -64,  64, -64,  64, -64 },
458     {  50, -89,  50, -89,  50, -89,  50, -89 },
459     {  75,  18,  75,  18,  75,  18,  75,  18 },
460     {  36, -83,  36, -83,  36, -83,  36, -83 },
461     {  18, -50,  18, -50,  18, -50,  18, -50 },
462     { -89,  75, -89,  75, -89,  75, -89,  75 }
463 };
464 
465 
466 const WORD16 g_ai2_ihevc_trans_32_intr_even[22][8] =
467 {
468     {  64,  64,  64,  64,  83,  36,  83,  36 },
469     {  64, -64,  64, -64,  36, -83,  36, -83 },
470     {  89,  18,  89,  18,  75,  50,  75,  50 },
471     {  75, -50,  75, -50, -18, -89, -18, -89 },
472     {  50,  75,  50,  75, -89,  18, -89,  18 },
473     {  18, -89,  18, -89, -50,  75, -50,  75 },
474 
475     {  90,  70,  90,  70,  87,  80,  87,  80 },
476     {   9,  57,   9,  57,  25,  43,  25,  43 },
477     {  87, -43,  87, -43,  57,   9,  57,   9 },
478     { -25, -80, -25, -80, -70, -90, -70, -90 },
479     {  80, -87,  80, -87,   9, -70,   9, -70 },
480     {  43, -25,  43, -25,  90,  57,  90,  57 },
481     {  70,   9,  70,   9, -43, -87, -43, -87 },
482     { -57,  90, -57,  90, -80,  25, -80,  25 },
483     {  57,  90,  57,  90, -80, -25, -80, -25 },
484     {  70,  -9,  70,  -9,  43, -87,  43, -87 },
485     {  43,  25,  43,  25, -90,  57, -90,  57 },
486     { -80, -87, -80, -87,   9,  70,   9,  70 },
487     {  25, -80,  25, -80, -70,  90, -70,  90 },
488     {  87,  43,  87,  43, -57,   9, -57,   9 },
489     {   9, -57,   9, -57, -25,  43, -25,  43 },
490     { -90,  70, -90,  70,  87, -80,  87, -80 }
491 };
492 
493 
494 const WORD16 g_ai2_ihevc_trans_32_intr_odd[32][16] =
495 {
496     {  90,  85,  90,  85,  90,  88,  90,  88,  61,  82,  61,  82, -73, -46, -73, -46 },
497     {  67,  82,  67,  82,  73,  78,  73,  78,  90,  31,  90,  31, -13, -88, -13, -88 },
498     {  61,  38,  61,  38,  54,  46,  54,  46,  -4,  85,  -4,  85, -90,  22, -90,  22 },
499     {   4,  31,   4,  31,  13,  22,  13,  22,  67, -38,  67, -38,  54, -78,  54, -78 },
500 
501     {  90,  46,  90,  46,  82,  67,  82,  67,  54,  88,  54,  88, -85,  -4, -85,  -4 },
502     { -54,  22, -54,  22, -31,  -4, -31,  -4,  13, -46,  13, -46,  82, -61,  82, -61 },
503     { -73, -88, -73, -88, -85, -90, -85, -90, -90, -78, -90, -78,  38,  67,  38,  67 },
504     { -13, -78, -13, -78, -38, -61, -38, -61, -73, -22, -73, -22, -31,  90, -31,  90 },
505 
506     {  88, -13,  88, -13,  67,  31,  67,  31,  46,  54,  46,  54, -90,  38, -90,  38 },
507     { -78, -54, -78, -54, -90, -82, -90, -82, -88, -90, -88, -90,  61,  31,  61,  31 },
508     { -46,  73, -46,  73,  -4,  38,  -4,  38,  22,  13,  22,  13,  67, -85,  67, -85 },
509     {  22,  90,  22,  90,  61,  85,  61,  85,  78,  73,  78,  73,   4, -82,   4, -82 },
510 
511     {  85, -67,  85, -67,  46, -13,  46, -13,  38,  -4,  38,  -4, -88,  73, -88,  73 },
512     {  38, -90,  38, -90, -22, -73, -22, -73, -31, -67, -31, -67, -46,  90, -46,  90 },
513     {  82,  -4,  82,  -4,  88,  54,  88,  54,  85,  61,  85,  61, -78,  13, -78,  13 },
514     { -31, -61, -31, -61, -78, -90, -78, -90, -82, -90, -82, -90,  22,  54,  22,  54 },
515 
516     {  82, -90,  82, -90,  22, -54,  22, -54,  31, -61,  31, -61, -78,  90, -78,  90 },
517     {  85, -61,  85, -61,  78,  13,  78,  13,  82,   4,  82,   4, -88,  54, -88,  54 },
518     {  31, -67,  31, -67, -46, -90, -46, -90, -38, -90, -38, -90, -22,  73, -22,  73 },
519     {  38,   4,  38,   4,  88,  73,  88,  73,  85,  67,  85,  67, -46, -13, -46, -13 },
520 
521     {  78, -73,  78, -73,  -4, -82,  -4, -82,  22, -90,  22, -90, -61,  85, -61,  85 },
522     { -22,  13, -22,  13,  67,  85,  67,  85,  46,  73,  46,  73,  -4, -38,  -4, -38 },
523     { -88,  90, -88,  90, -61,  31, -61,  31, -78,  54, -78,  54,  90, -82,  90, -82 },
524     { -46,  54, -46,  54, -90, -38, -90, -38, -88, -13, -88, -13,  67, -31,  67, -31 },
525 
526     {  73, -22,  73, -22, -31, -90, -31, -90,  13, -78,  13, -78, -38,  61, -38,  61 },
527     { -90,  78, -90,  78, -38,  67, -38,  67, -73,  88, -73,  88,  85, -90,  85, -90 },
528     { -13, -46, -13, -46,  82,  61,  82,  61,  54,  22,  54,  22, -31,   4, -31,   4 },
529     {  54, -88,  54, -88,  85,  -4,  85,  -4,  90, -46,  90, -46, -82,  67, -82,  67 },
530 
531     {  67,  38,  67,  38, -54, -78, -54, -78,   4, -31,   4, -31, -13,  22, -13,  22 },
532     {   4,  85,   4,  85, -90, -22, -90, -22, -61,  38, -61,  38,  54, -46,  54, -46 },
533     {  90, -31,  90, -31,  13, -88,  13, -88,  67, -82,  67, -82, -73,  78, -73,  78 },
534     { -61,  82, -61,  82, -73,  46, -73,  46, -90,  85, -90,  85,  90, -88,  90, -88 }
535 
536 };
537 
538 
539 /*Tables for itrans_recon functions*/
540 const WORD16 g_ai2_ihevc_trans_16_even_packed[12][8] =
541 {
542     {  83,  36,  83,  36,  83,  36,  83,  36 },
543 
544     {  36, -83,  36, -83,  36, -83,  36, -83 },
545 
546     {  64,  64,  64,  64,  64,  64,  64,  64 },
547 
548     {  64, -64,  64, -64,  64, -64,  64, -64 },
549 
550     {  89,  75,  89,  75,  89,  75,  89,  75 },
551 
552     {  50,  18,  50,  18,  50,  18,  50,  18 },
553 
554     {  75, -18,  75, -18,  75, -18,  75, -18 },
555 
556     {  89,  50,  89,  50,  89,  50,  89,  50 },
557 
558     {  50, -89,  50, -89,  50, -89,  50, -89 },
559 
560     {  18,  75,  18,  75,  18,  75,  18,  75 },
561 
562     {  18, -50,  18, -50,  18, -50,  18, -50 },
563 
564     {  75, -89,  75, -89,  75, -89,  75, -89 },
565 
566 
567 };
568 
569 const WORD16 g_ai2_ihevc_trans_32_intr_packed[32][8] =
570 {
571     {  90,  87,  90,  87,  90,  87,  90,  87 },
572 
573     {  80,  70,  80,  70,  80,  70,  80,  70 },
574 
575     {  57,  43,  57,  43,  57,  43,  57,  43 },
576 
577     {  25,   9,  25,   9,  25,   9,  25,   9 },
578 
579     {  87,  57,  87,  57,  87,  57,  87,  57 },
580 
581     {   9, -43,   9, -43,   9, -43,   9, -43 },
582 
583     {  80,  90,  80,  90,  80,  90,  80,  90 },
584 
585     {  70,  25,  70,  25,  70,  25,  70,  25 },
586 
587     {  80,   9,  80,   9,  80,   9,  80,   9 },
588 
589     {  70,  87,  70,  87,  70,  87,  70,  87 },
590 
591     { -25,  57, -25,  57, -25,  57, -25,  57 },
592 
593     {  90,  43,  90,  43,  90,  43,  90,  43 },
594 
595     {  70, -43,  70, -43,  70, -43,  70, -43 },
596 
597     { -87,   9, -87,   9, -87,   9, -87,   9 },
598 
599     {  90,  25,  90,  25,  90,  25,  90,  25 },
600 
601     {  80,  57,  80,  57,  80,  57,  80,  57 },
602 
603     {  57, -80,  57, -80,  57, -80,  57, -80 },
604 
605     { -25,  90, -25,  90, -25,  90, -25,  90 },
606 
607     {   9,  87,   9,  87,   9,  87,   9,  87 },
608 
609     {  43,  70,  43,  70,  43,  70,  43,  70 },
610 
611     {  43, -90,  43, -90,  43, -90,  43, -90 },
612 
613     {  57,  25,  57,  25,  57,  25,  57,  25 },
614 
615     { -87,  70, -87,  70, -87,  70, -87,  70 },
616 
617     {   9, -80,   9, -80,   9, -80,   9, -80 },
618 
619     {  25, -70,  25, -70,  25, -70,  25, -70 },
620 
621     {  90, -80,  90, -80,  90, -80,  90, -80 },
622 
623     {  43,   9,  43,   9,  43,   9,  43,   9 },
624 
625     { -57,  87, -57,  87, -57,  87, -57,  87 },
626 
627     {   9, -25,   9, -25,   9, -25,   9, -25 },
628 
629     {  43, -57,  43, -57,  43, -57,  43, -57 },
630 
631     {  70, -80,  70, -80,  70, -80,  70, -80 },
632 
633     {  87, -90,  87, -90,  87, -90,  87, -90 },
634 
635 };
636 
637 const WORD16 g_ai2_ihevc_trans_32_intr_odd_packed[128][8] =
638 {
639     /*o0*/
640     {  90,  90,  90,  90,  90,  90,  90,  90 },
641     {  88,  85,  88,  85,  88,  85,  88,  85 },
642     {  82,  78,  82,  78,  82,  78,  82,  78 },
643     {  73,  67,  73,  67,  73,  67,  73,  67 },
644     {  61,  54,  61,  54,  61,  54,  61,  54 },
645     {  46,  38,  46,  38,  46,  38,  46,  38 },
646     {  31,  22,  31,  22,  31,  22,  31,  22 },
647     {  13,   4,  13,   4,  13,   4,  13,   4 },
648 
649     /*o1*/
650 
651     {  90,  82,  90,  82,  90,  82,  90,  82 },
652     {  67,  46,  67,  46,  67,  46,  67,  46 },
653     { -22,   4, -22,   4, -22,   4, -22,   4 },
654     {  31,  54,  31,  54,  31,  54,  31,  54 },
655     {  73,  85,  73,  85,  73,  85,  73,  85 },
656     {  90,  88,  90,  88,  90,  88,  90,  88 },
657     {  78,  61,  78,  61,  78,  61,  78,  61 },
658     {  38,  13,  38,  13,  38,  13,  38,  13 },
659 
660     /*o2*/
661     {  88,  67,  88,  67,  88,  67,  88,  67 },
662     { -31,  13, -31,  13, -31,  13, -31,  13 },
663     {  54,  82,  54,  82,  54,  82,  54,  82 },
664     {  90,  78,  90,  78,  90,  78,  90,  78 },
665     {  46,   4,  46,   4,  46,   4,  46,   4 },
666     {  38,  73,  38,  73,  38,  73,  38,  73 },
667     {  90,  85,  90,  85,  90,  85,  90,  85 },
668     {  61,  22,  61,  22,  61,  22,  61,  22 },
669 
670     /*o3*/
671     {  85,  46,  85,  46,  85,  46,  85,  46 },
672     {  13,  67,  13,  67,  13,  67,  13,  67 },
673     {  90,  73,  90,  73,  90,  73,  90,  73 },
674     {  22, -38,  22, -38,  22, -38,  22, -38 },
675     {  82,  88,  82,  88,  82,  88,  82,  88 },
676     { -54,   4, -54,   4, -54,   4, -54,   4 },
677     {  61,  90,  61,  90,  61,  90,  61,  90 },
678     {  78,  31,  78,  31,  78,  31,  78,  31 },
679 
680     /*o4*/
681     { -82, -22, -82, -22, -82, -22, -82, -22 },
682     {  54,  90,  54,  90,  54,  90,  54,  90 },
683     {  61, -13,  61, -13,  61, -13,  61, -13 },
684     { -78, -85, -78, -85, -78, -85, -78, -85 },
685     { -31,  46, -31,  46, -31,  46, -31,  46 },
686     {  90,  67,  90,  67,  90,  67,  90,  67 },
687     {  -4, -73,  -4, -73,  -4, -73,  -4, -73 },
688     { -88, -38, -88, -38, -88, -38, -88, -38 },
689 
690     /*o5*/
691     { -78,   4, -78,   4, -78,   4, -78,   4 },
692     {  82,  73,  82,  73,  82,  73,  82,  73 },
693     { -13, -85, -13, -85, -13, -85, -13, -85 },
694     { -67,  22, -67,  22, -67,  22, -67,  22 },
695     {  88,  61,  88,  61,  88,  61,  88,  61 },
696     { -31, -90, -31, -90, -31, -90, -31, -90 },
697     { -54,  38, -54,  38, -54,  38, -54,  38 },
698     {  90,  46,  90,  46,  90,  46,  90,  46 },
699 
700     /*o6*/
701     { -73,  31, -73,  31, -73,  31, -73,  31 },
702     {  90,  22,  90,  22,  90,  22,  90,  22 },
703     { -78, -67, -78, -67, -78, -67, -78, -67 },
704     {  38,  90,  38,  90,  38,  90,  38,  90 },
705     {  13, -82,  13, -82,  13, -82,  13, -82 },
706     { -61,  46, -61,  46, -61,  46, -61,  46 },
707     {  88,   4,  88,   4,  88,   4,  88,   4 },
708     { -85, -54, -85, -54, -85, -54, -85, -54 },
709 
710     /*o7*/
711     { -67,  54, -67,  54, -67,  54, -67,  54 },
712     {  78, -38,  78, -38,  78, -38,  78, -38 },
713     { -85,  22, -85,  22, -85,  22, -85,  22 },
714     {  90,  -4,  90,  -4,  90,  -4,  90,  -4 },
715     { -90, -13, -90, -13, -90, -13, -90, -13 },
716     {  88,  31,  88,  31,  88,  31,  88,  31 },
717     { -82, -46, -82, -46, -82, -46, -82, -46 },
718     {  73,  61,  73,  61,  73,  61,  73,  61 },
719 
720     /*o8*/
721     { -61,  73, -61,  73, -61,  73, -61,  73 },
722     {  46, -82,  46, -82,  46, -82,  46, -82 },
723     { -31,  88, -31,  88, -31,  88, -31,  88 },
724     {  13, -90,  13, -90,  13, -90,  13, -90 },
725     {   4,  90,   4,  90,   4,  90,   4,  90 },
726     { -22, -85, -22, -85, -22, -85, -22, -85 },
727     {  38,  78,  38,  78,  38,  78,  38,  78 },
728     { -54, -67, -54, -67, -54, -67, -54, -67 },
729 
730     /*o9*/
731     { -54,  85, -54,  85, -54,  85, -54,  85 },
732     {   4, -88,   4, -88,   4, -88,   4, -88 },
733     {  46,  61,  46,  61,  46,  61,  46,  61 },
734     { -82, -13, -82, -13, -82, -13, -82, -13 },
735     {  90, -38,  90, -38,  90, -38,  90, -38 },
736     { -67,  78, -67,  78, -67,  78, -67,  78 },
737     {  22, -90,  22, -90,  22, -90,  22, -90 },
738     {  31,  73,  31,  73,  31,  73,  31,  73 },
739 
740     /*o10*/
741     { -46,  90, -46,  90, -46,  90, -46,  90 },
742     { -38, -54, -38, -54, -38, -54, -38, -54 },
743     {  90, -31,  90, -31,  90, -31,  90, -31 },
744     { -61,  88, -61,  88, -61,  88, -61,  88 },
745     { -22, -67, -22, -67, -22, -67, -22, -67 },
746     {  85, -13,  85, -13,  85, -13,  85, -13 },
747     { -73,  82, -73,  82, -73,  82, -73,  82 },
748     {  -4, -78,  -4, -78,  -4, -78,  -4, -78 },
749 
750     /*o11*/
751     { -38,  88, -38,  88, -38,  88, -38,  88 },
752     { -73,   4, -73,   4, -73,   4, -73,   4 },
753     {  67, -90,  67, -90,  67, -90,  67, -90 },
754     {  46,  31,  46,  31,  46,  31,  46,  31 },
755     { -85,  78, -85,  78, -85,  78, -85,  78 },
756     { -13, -61, -13, -61, -13, -61, -13, -61 },
757     {  90, -54,  90, -54,  90, -54,  90, -54 },
758     { -22,  82, -22,  82, -22,  82, -22,  82 },
759 
760 
761     /*012*/
762     { -31,  78, -31,  78, -31,  78, -31,  78 },
763     { -90,  61, -90,  61, -90,  61, -90,  61 },
764     {  -4, -54,  -4, -54,  -4, -54,  -4, -54 },
765     {  88, -82,  88, -82,  88, -82,  88, -82 },
766     {  38,  22,  38,  22,  38,  22,  38,  22 },
767     { -73,  90, -73,  90, -73,  90, -73,  90 },
768     { -67,  13, -67,  13, -67,  13, -67,  13 },
769     {  46, -85,  46, -85,  46, -85,  46, -85 },
770 
771     /*o13*/
772     { -22,  61, -22,  61, -22,  61, -22,  61 },
773     { -85,  90, -85,  90, -85,  90, -85,  90 },
774     { -73,  38, -73,  38, -73,  38, -73,  38 },
775     {   4, -46,   4, -46,   4, -46,   4, -46 },
776     {  78, -90,  78, -90,  78, -90,  78, -90 },
777     {  82, -54,  82, -54,  82, -54,  82, -54 },
778     {  13,  31,  13,  31,  13,  31,  13,  31 },
779     { -67,  88, -67,  88, -67,  88, -67,  88 },
780 
781     /*o14*/
782     { -13,  38, -13,  38, -13,  38, -13,  38 },
783     { -61,  78, -61,  78, -61,  78, -61,  78 },
784     { -88,  90, -88,  90, -88,  90, -88,  90 },
785     { -85,  73, -85,  73, -85,  73, -85,  73 },
786     { -54,  31, -54,  31, -54,  31, -54,  31 },
787     {  -4, -22,  -4, -22,  -4, -22,  -4, -22 },
788     {  46, -67,  46, -67,  46, -67,  46, -67 },
789     {  82, -90,  82, -90,  82, -90,  82, -90 },
790 
791     /*o15*/
792     {  -4,  13,  -4,  13,  -4,  13,  -4,  13 },
793     { -22,  31, -22,  31, -22,  31, -22,  31 },
794     { -38,  46, -38,  46, -38,  46, -38,  46 },
795     { -54,  61, -54,  61, -54,  61, -54,  61 },
796     { -67,  73, -67,  73, -67,  73, -67,  73 },
797     { -78,  82, -78,  82, -78,  82, -78,  82 },
798     { -85,  88, -85,  88, -85,  88, -85,  88 },
799     { -90,  90, -90,  90, -90,  90, -90,  90 },
800 
801 };
802 const WORD16 g_ai2_ihevc_trans_16_even[12][8] =
803 {
804     {  64,  64,  64,  64,  64,  64,  64,  64 },
805     {  64, -64,  64, -64,  64, -64,  64, -64 },
806     {  89,  75,  89,  75,  89,  75,  89,  75 },
807     {  75, -18,  75, -18,  75, -18,  75, -18 },
808     {  50,  18,  50,  18,  50,  18,  50,  18 },
809     {  89,  50,  89,  50,  89,  50,  89,  50 },
810     {  83,  36,  83,  36,  83,  36,  83,  36 },
811     {  36, -83,  36, -83,  36, -83,  36, -83 },
812     {  50, -89,  50, -89,  50, -89,  50, -89 },
813     {  18, -50,  18, -50,  18, -50,  18, -50 },
814     {  18,  75,  18,  75,  18,  75,  18,  75 },
815     {  75, -89,  75, -89,  75, -89,  75, -89 },
816 };
817 const WORD16 g_ai2_ihevc_trans_16_odd[32][8] =
818 {
819     {  90,  87,  90,  87,  90,  87,  90,  87 },
820     {  80,  70,  80,  70,  80,  70,  80,  70 },
821     {  57,  43,  57,  43,  57,  43,  57,  43 },
822     {  25,   9,  25,   9,  25,   9,  25,   9 },
823     {  87,  57,  87,  57,  87,  57,  87,  57 },
824     {   9, -43,   9, -43,   9, -43,   9, -43 },
825     {  80,  90,  80,  90,  80,  90,  80,  90 },
826     {  70,  25,  70,  25,  70,  25,  70,  25 },
827     {  80,   9,  80,   9,  80,   9,  80,   9 },
828     {  70,  87,  70,  87,  70,  87,  70,  87 },
829     {  25, -57,  25, -57,  25, -57,  25, -57 },
830     {  90,  43,  90,  43,  90,  43,  90,  43 },
831     {  70, -43,  70, -43,  70, -43,  70, -43 },
832     {  87,  -9,  87,  -9,  87,  -9,  87,  -9 },
833     {  90,  25,  90,  25,  90,  25,  90,  25 },
834     {  80,  57,  80,  57,  80,  57,  80,  57 },
835     {  57, -80,  57, -80,  57, -80,  57, -80 },
836     {  25, -90,  25, -90,  25, -90,  25, -90 },
837     {   9,  87,   9,  87,   9,  87,   9,  87 },
838     {  43,  70,  43,  70,  43,  70,  43,  70 },
839     {  43, -90,  43, -90,  43, -90,  43, -90 },
840     {  57,  25,  57,  25,  57,  25,  57,  25 },
841     {  87, -70,  87, -70,  87, -70,  87, -70 },
842     {   9, -80,   9, -80,   9, -80,   9, -80 },
843     {  25, -70,  25, -70,  25, -70,  25, -70 },
844     {  90, -80,  90, -80,  90, -80,  90, -80 },
845     {  43,   9,  43,   9,  43,   9,  43,   9 },
846     {  57, -87,  57, -87,  57, -87,  57, -87 },
847     {   9, -25,   9, -25,   9, -25,   9, -25 },
848     {  43, -57,  43, -57,  43, -57,  43, -57 },
849     {  70, -80,  70, -80,  70, -80,  70, -80 },
850     {  87, -90,  87, -90,  87, -90,  87, -90 },
851 };
852 const WORD16 g_ai2_ihevc_trans_intr_even_8[4][8] =
853 {
854     {  64,  64,  64,  64,  64,  64,  64,  64 },
855     {  36, -83,  36, -83,  36, -83,  36, -83 },
856     {  83,  36,  83,  36,  83,  36,  83,  36 },
857     {  64, -64,  64, -64,  64, -64,  64, -64 }
858 };
859 const WORD16 g_ai2_ihevc_trans_intr_odd_8[8][8] =
860 {
861     {  89,  75,  89,  75,  89,  75,  89,  75 },
862     {  50,  18,  50,  18,  50,  18,  50,  18 },
863     {  75, -18,  75, -18,  75, -18,  75, -18 },
864     {  89,  50,  89,  50,  89,  50,  89,  50 },
865     {  50, -89,  50, -89,  50, -89,  50, -89 },
866     {  18,  75,  18,  75,  18,  75,  18,  75 },
867     {  18, -50,  18, -50,  18, -50,  18, -50 },
868     {  75, -89,  75, -89,  75, -89,  75, -89 },
869 };
870 const WORD16 g_ai2_ihevc_trans_intr_4[4][8] =
871 {
872     {  83,  36,  83,  36,  83,  36,  83,  36 },
873     {  36, -83,  36, -83,  36, -83,  36, -83 },
874     {  64,  64,  64,  64,  64,  64,  64,  64 },
875     {  64, -64,  64, -64,  64, -64,  64, -64 }
876 };
877 
878 const UWORD8 IHEVCE_CHROMA_SHUFFLEMASK_HBD[8] = { 0x00, 0x01, 0x04, 0x05,
879     0x08, 0x09, 0x0C, 0x0D };
880 #ifndef DISABLE_AVX2
881 const WORD32 g_ai4_ihevc_trans_8_intr_avx2[7][8] =
882 { /* 4*32 = 128 bit */
883     {  64,  64,  64,  64,  64,  64,  64,  64 },
884     {  83,  83,  83,  83,  83,  83,  83,  83 },
885     {  36,  36,  36,  36,  36,  36,  36,  36 },
886     {  75,  75,  75,  75,  75,  75,  75,  75 },
887     {  18,  18,  18,  18,  18,  18,  18,  18 },
888     {  89,  89,  89,  89,  89,  89,  89,  89 },
889     {  50,  50,  50,  50,  50,  50,  50,  50 },
890 };
891 const WORD16 g_ai2_ihevc_trans_8_intr_avx2[8][16] =
892 { /* 4*32 = 128 bit */
893     {  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64 },
894     {  89,  75,  18,  50,  89,  75,  18,  50,  89,  75,  18,  50,  89,  75,  18,  50 },
895     {  83,  36,  83,  36,  83,  36,  83,  36,  83,  36,  83,  36,  83,  36,  83,  36 },
896     {  75, -18, -50, -89,  75, -18, -50, -89,  75, -18, -50, -89,  75, -18, -50, -89 },
897     {  64, -64,  64, -64,  64, -64,  64, -64,  64, -64,  64, -64,  64, -64,  64, -64 },
898     {  50, -89,  75,  18,  50, -89,  75,  18,  50, -89,  75,  18,  50, -89,  75,  18 },
899     {  36, -83,  36, -83,  36, -83,  36, -83,  36, -83,  36, -83,  36, -83,  36, -83 },
900     {  18, -50, -89,  75,  18, -50, -89,  75,  18, -50, -89,  75,  18, -50, -89,  75 }
901 };
902 
903 const WORD32 g_ai2_ihevc_trans_32_intr_8_avx2[8][8] =
904 { /* 4*32 = 128 bit */
905     { 90, 90, 90, 90, 90, 90, 90, 90 },
906     { 87, 87, 87, 87, 87, 87, 87, 87 },
907     { 80, 80, 80, 80, 80, 80, 80, 80 },
908     { 70, 70, 70, 70, 70, 70, 70, 70 },
909     { 57, 57, 57, 57, 57, 57, 57, 57 },
910     { 43, 43, 43, 43, 43, 43, 43, 43 },
911     { 25, 25, 25, 25, 25, 25, 25, 25 },
912     {  9,  9,  9,  9,  9,  9,  9,  9 }
913 };
914 const WORD32 g_ai2_ihevc_trans_32_intr_16_avx2[15][8] =
915 { /* 4*32 = 128 bit */
916     { 90, 90, 90, 90, 90, 90, 90, 90, },
917     { 88, 88, 88, 88, 88, 88, 88, 88, },
918     { 85, 85, 85, 85, 85, 85, 85, 85, },
919     { 82, 82, 82, 82, 82, 82, 82, 82, },
920     { 78, 78, 78, 78, 78, 78, 78, 78, },
921     { 73, 73, 73, 73, 73, 73, 73, 73, },
922     { 67, 67, 67, 67, 67, 67, 67, 67, },
923     { 61, 61, 61, 61, 61, 61, 61, 61, },
924     { 54, 54, 54, 54, 54, 54, 54, 54, },
925     { 46, 46, 46, 46, 46, 46, 46, 46, },
926     { 38, 38, 38, 38, 38, 38, 38, 38, },
927     { 31, 31, 31, 31, 31, 31, 31, 31, },
928     { 22, 22, 22, 22, 22, 22, 22, 22, },
929     { 13, 13, 13, 13, 13, 13, 13, 13, },
930     { 4,  4,  4,  4,  4,  4,  4,  4,  }
931 };
932 const WORD16 g_ai2_ihevc_trans_16_intr_odd_avx2[32][16] =
933 {
934     {  90,  87,  90,  87,  90,  87,  90,  87,  90,  87,  90,  87,  90,  87,  90,  87 },
935     {  70,  80,  70,  80,  70,  80,  70,  80,  70,  80,  70,  80,  70,  80,  70,  80 },
936     {  57,  43,  57,  43,  57,  43,  57,  43,  57,  43,  57,  43,  57,  43,  57,  43 },
937     {   9,  25,   9,  25,   9,  25,   9,  25,   9,  25,   9,  25,   9,  25,   9,  25 },
938     {  87,  57,  87,  57,  87,  57,  87,  57,  87,  57,  87,  57,  87,  57,  87,  57 },
939     { -43,   9, -43,   9, -43,   9, -43,   9, -43,   9, -43,   9, -43,   9, -43,   9 },
940     { -80, -90, -80, -90, -80, -90, -80, -90, -80, -90, -80, -90, -80, -90, -80, -90 },
941     { -25, -70, -25, -70, -25, -70, -25, -70, -25, -70, -25, -70, -25, -70, -25, -70 },
942     {  80,   9,  80,   9,  80,   9,  80,   9,  80,   9,  80,   9,  80,   9,  80,   9 },
943     { -87, -70, -87, -70, -87, -70, -87, -70, -87, -70, -87, -70, -87, -70, -87, -70 },
944     { -25,  57, -25,  57, -25,  57, -25,  57, -25,  57, -25,  57, -25,  57, -25,  57 },
945     {  43,  90,  43,  90,  43,  90,  43,  90,  43,  90,  43,  90,  43,  90,  43,  90 },
946     {  70, -43,  70, -43,  70, -43,  70, -43,  70, -43,  70, -43,  70, -43,  70, -43 },
947     {   9, -87,   9, -87,   9, -87,   9, -87,   9, -87,   9, -87,   9, -87,   9, -87 },
948     {  90,  25,  90,  25,  90,  25,  90,  25,  90,  25,  90,  25,  90,  25,  90,  25 },
949     { -57, -80, -57, -80, -57, -80, -57, -80, -57, -80, -57, -80, -57, -80, -57, -80 },
950     {  57, -80,  57, -80,  57, -80,  57, -80,  57, -80,  57, -80,  57, -80,  57, -80 },
951     {  90, -25,  90, -25,  90, -25,  90, -25,  90, -25,  90, -25,  90, -25,  90, -25 },
952     {  -9, -87,  -9, -87,  -9, -87,  -9, -87,  -9, -87,  -9, -87,  -9, -87,  -9, -87 },
953     {  70,  43,  70,  43,  70,  43,  70,  43,  70,  43,  70,  43,  70,  43,  70,  43 },
954     {  43, -90,  43, -90,  43, -90,  43, -90,  43, -90,  43, -90,  43, -90,  43, -90 },
955     {  25,  57,  25,  57,  25,  57,  25,  57,  25,  57,  25,  57,  25,  57,  25,  57 },
956     { -87,  70, -87,  70, -87,  70, -87,  70, -87,  70, -87,  70, -87,  70, -87,  70 },
957     { -80,   9, -80,   9, -80,   9, -80,   9, -80,   9, -80,   9, -80,   9, -80,   9 },
958     {  25, -70,  25, -70,  25, -70,  25, -70,  25, -70,  25, -70,  25, -70,  25, -70 },
959     { -80,  90, -80,  90, -80,  90, -80,  90, -80,  90, -80,  90, -80,  90, -80,  90 },
960     {  43,   9,  43,   9,  43,   9,  43,   9,  43,   9,  43,   9,  43,   9,  43,   9 },
961     {  87, -57,  87, -57,  87, -57,  87, -57,  87, -57,  87, -57,  87, -57,  87, -57 },
962     {   9, -25,   9, -25,   9, -25,   9, -25,   9, -25,   9, -25,   9, -25,   9, -25 },
963     { -57,  43, -57,  43, -57,  43, -57,  43, -57,  43, -57,  43, -57,  43, -57,  43 },
964     {  70, -80,  70, -80,  70, -80,  70, -80,  70, -80,  70, -80,  70, -80,  70, -80 },
965     { -90,  87, -90,  87, -90,  87, -90,  87, -90,  87, -90,  87, -90,  87, -90,  87 }
966 };
967 
968 const WORD16 g_ai2_ihevc_trans_16_intr_even_avx2[12][16] =
969 {
970     {  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64,  64 },
971     {  89,  75,  89,  75,  89,  75,  89,  75,  89,  75,  89,  75,  89,  75,  89,  75 },
972     {  18,  50,  18,  50,  18,  50,  18,  50,  18,  50,  18,  50,  18,  50,  18,  50 },
973     {  83,  36,  83,  36,  83,  36,  83,  36,  83,  36,  83,  36,  83,  36,  83,  36 },
974     {  75, -18,  75, -18,  75, -18,  75, -18,  75, -18,  75, -18,  75, -18,  75, -18 },
975     { -50, -89, -50, -89, -50, -89, -50, -89, -50, -89, -50, -89, -50, -89, -50, -89 },
976     {  64, -64,  64, -64,  64, -64,  64, -64,  64, -64,  64, -64,  64, -64,  64, -64 },
977     {  50, -89,  50, -89,  50, -89,  50, -89,  50, -89,  50, -89,  50, -89,  50, -89 },
978     {  75,  18,  75,  18,  75,  18,  75,  18,  75,  18,  75,  18,  75,  18,  75,  18 },
979     {  36, -83,  36, -83,  36, -83,  36, -83,  36, -83,  36, -83,  36, -83,  36, -83 },
980     {  18, -50,  18, -50,  18, -50,  18, -50,  18, -50,  18, -50,  18, -50,  18, -50 },
981     { -89,  75, -89,  75, -89,  75, -89,  75, -89,  75, -89,  75, -89,  75, -89,  75 }
982 };
983 
984 
985 #endif
986