xref: /aosp_15_r20/external/libaom/av1/common/av1_txfm.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker /*
2*77c1e3ccSAndroid Build Coastguard Worker  * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3*77c1e3ccSAndroid Build Coastguard Worker  *
4*77c1e3ccSAndroid Build Coastguard Worker  * This source code is subject to the terms of the BSD 2 Clause License and
5*77c1e3ccSAndroid Build Coastguard Worker  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6*77c1e3ccSAndroid Build Coastguard Worker  * was not distributed with this source code in the LICENSE file, you can
7*77c1e3ccSAndroid Build Coastguard Worker  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8*77c1e3ccSAndroid Build Coastguard Worker  * Media Patent License 1.0 was not distributed with this source code in the
9*77c1e3ccSAndroid Build Coastguard Worker  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*77c1e3ccSAndroid Build Coastguard Worker  */
11*77c1e3ccSAndroid Build Coastguard Worker 
12*77c1e3ccSAndroid Build Coastguard Worker #ifndef AOM_AV1_COMMON_AV1_TXFM_H_
13*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AV1_COMMON_AV1_TXFM_H_
14*77c1e3ccSAndroid Build Coastguard Worker 
15*77c1e3ccSAndroid Build Coastguard Worker #include <assert.h>
16*77c1e3ccSAndroid Build Coastguard Worker #include <math.h>
17*77c1e3ccSAndroid Build Coastguard Worker #include <stdio.h>
18*77c1e3ccSAndroid Build Coastguard Worker 
19*77c1e3ccSAndroid Build Coastguard Worker #include "config/aom_config.h"
20*77c1e3ccSAndroid Build Coastguard Worker 
21*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/enums.h"
22*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/blockd.h"
23*77c1e3ccSAndroid Build Coastguard Worker #include "aom/aom_integer.h"
24*77c1e3ccSAndroid Build Coastguard Worker #include "aom_dsp/aom_dsp_common.h"
25*77c1e3ccSAndroid Build Coastguard Worker 
26*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
27*77c1e3ccSAndroid Build Coastguard Worker extern "C" {
28*77c1e3ccSAndroid Build Coastguard Worker #endif
29*77c1e3ccSAndroid Build Coastguard Worker 
30*77c1e3ccSAndroid Build Coastguard Worker #if !defined(DO_RANGE_CHECK_CLAMP)
31*77c1e3ccSAndroid Build Coastguard Worker #define DO_RANGE_CHECK_CLAMP 0
32*77c1e3ccSAndroid Build Coastguard Worker #endif
33*77c1e3ccSAndroid Build Coastguard Worker 
34*77c1e3ccSAndroid Build Coastguard Worker extern const int32_t av1_cospi_arr_data[4][64];
35*77c1e3ccSAndroid Build Coastguard Worker extern const int32_t av1_sinpi_arr_data[4][5];
36*77c1e3ccSAndroid Build Coastguard Worker 
37*77c1e3ccSAndroid Build Coastguard Worker #define MAX_TXFM_STAGE_NUM 12
38*77c1e3ccSAndroid Build Coastguard Worker 
39*77c1e3ccSAndroid Build Coastguard Worker static const int cos_bit_min = 10;
40*77c1e3ccSAndroid Build Coastguard Worker 
41*77c1e3ccSAndroid Build Coastguard Worker #define NewSqrt2Bits ((int32_t)12)
42*77c1e3ccSAndroid Build Coastguard Worker // 2^12 * sqrt(2)
43*77c1e3ccSAndroid Build Coastguard Worker static const int32_t NewSqrt2 = 5793;
44*77c1e3ccSAndroid Build Coastguard Worker // 2^12 / sqrt(2)
45*77c1e3ccSAndroid Build Coastguard Worker static const int32_t NewInvSqrt2 = 2896;
46*77c1e3ccSAndroid Build Coastguard Worker 
cospi_arr(int n)47*77c1e3ccSAndroid Build Coastguard Worker static inline const int32_t *cospi_arr(int n) {
48*77c1e3ccSAndroid Build Coastguard Worker   return av1_cospi_arr_data[n - cos_bit_min];
49*77c1e3ccSAndroid Build Coastguard Worker }
50*77c1e3ccSAndroid Build Coastguard Worker 
sinpi_arr(int n)51*77c1e3ccSAndroid Build Coastguard Worker static inline const int32_t *sinpi_arr(int n) {
52*77c1e3ccSAndroid Build Coastguard Worker   return av1_sinpi_arr_data[n - cos_bit_min];
53*77c1e3ccSAndroid Build Coastguard Worker }
54*77c1e3ccSAndroid Build Coastguard Worker 
55*77c1e3ccSAndroid Build Coastguard Worker // The reduced bit-width and permuted arrays are only used in the Arm Neon
56*77c1e3ccSAndroid Build Coastguard Worker // implementations in av1_fwd_txfm2d_neon.c and highbd_fwd_txfm_neon.c for now.
57*77c1e3ccSAndroid Build Coastguard Worker #if HAVE_NEON
58*77c1e3ccSAndroid Build Coastguard Worker // Store cospi/sinpi costants in Q2.13 format.
59*77c1e3ccSAndroid Build Coastguard Worker // See: https://en.wikipedia.org/wiki/Q_(number_format)
60*77c1e3ccSAndroid Build Coastguard Worker extern const int16_t av1_cospi_arr_q13_data[4][128];
61*77c1e3ccSAndroid Build Coastguard Worker extern const int16_t av1_sinpi_arr_q13_data[4][4];
62*77c1e3ccSAndroid Build Coastguard Worker 
63*77c1e3ccSAndroid Build Coastguard Worker extern const int32_t av1_cospi_arr_s32_data[4][66];
64*77c1e3ccSAndroid Build Coastguard Worker 
cospi_arr_q13(int n)65*77c1e3ccSAndroid Build Coastguard Worker static inline const int16_t *cospi_arr_q13(int n) {
66*77c1e3ccSAndroid Build Coastguard Worker   return av1_cospi_arr_q13_data[n - cos_bit_min];
67*77c1e3ccSAndroid Build Coastguard Worker }
68*77c1e3ccSAndroid Build Coastguard Worker 
sinpi_arr_q13(int n)69*77c1e3ccSAndroid Build Coastguard Worker static inline const int16_t *sinpi_arr_q13(int n) {
70*77c1e3ccSAndroid Build Coastguard Worker   return av1_sinpi_arr_q13_data[n - cos_bit_min];
71*77c1e3ccSAndroid Build Coastguard Worker }
72*77c1e3ccSAndroid Build Coastguard Worker 
cospi_arr_s32(int n)73*77c1e3ccSAndroid Build Coastguard Worker static inline const int32_t *cospi_arr_s32(int n) {
74*77c1e3ccSAndroid Build Coastguard Worker   return av1_cospi_arr_s32_data[n - cos_bit_min];
75*77c1e3ccSAndroid Build Coastguard Worker }
76*77c1e3ccSAndroid Build Coastguard Worker #endif  // HAVE_NEON
77*77c1e3ccSAndroid Build Coastguard Worker 
range_check_value(int32_t value,int8_t bit)78*77c1e3ccSAndroid Build Coastguard Worker static inline int32_t range_check_value(int32_t value, int8_t bit) {
79*77c1e3ccSAndroid Build Coastguard Worker #if CONFIG_COEFFICIENT_RANGE_CHECKING
80*77c1e3ccSAndroid Build Coastguard Worker   const int64_t max_value = (1LL << (bit - 1)) - 1;
81*77c1e3ccSAndroid Build Coastguard Worker   const int64_t min_value = -(1LL << (bit - 1));
82*77c1e3ccSAndroid Build Coastguard Worker   if (value < min_value || value > max_value) {
83*77c1e3ccSAndroid Build Coastguard Worker     fprintf(stderr, "coeff out of bit range, value: %d bit %d\n", value, bit);
84*77c1e3ccSAndroid Build Coastguard Worker #if !CONFIG_AV1_ENCODER
85*77c1e3ccSAndroid Build Coastguard Worker     assert(0);
86*77c1e3ccSAndroid Build Coastguard Worker #endif
87*77c1e3ccSAndroid Build Coastguard Worker   }
88*77c1e3ccSAndroid Build Coastguard Worker #endif  // CONFIG_COEFFICIENT_RANGE_CHECKING
89*77c1e3ccSAndroid Build Coastguard Worker #if DO_RANGE_CHECK_CLAMP
90*77c1e3ccSAndroid Build Coastguard Worker   bit = AOMMIN(bit, 31);
91*77c1e3ccSAndroid Build Coastguard Worker   return clamp(value, -(1 << (bit - 1)), (1 << (bit - 1)) - 1);
92*77c1e3ccSAndroid Build Coastguard Worker #endif  // DO_RANGE_CHECK_CLAMP
93*77c1e3ccSAndroid Build Coastguard Worker   (void)bit;
94*77c1e3ccSAndroid Build Coastguard Worker   return value;
95*77c1e3ccSAndroid Build Coastguard Worker }
96*77c1e3ccSAndroid Build Coastguard Worker 
round_shift(int64_t value,int bit)97*77c1e3ccSAndroid Build Coastguard Worker static inline int32_t round_shift(int64_t value, int bit) {
98*77c1e3ccSAndroid Build Coastguard Worker   assert(bit >= 1);
99*77c1e3ccSAndroid Build Coastguard Worker   return (int32_t)((value + (1ll << (bit - 1))) >> bit);
100*77c1e3ccSAndroid Build Coastguard Worker }
101*77c1e3ccSAndroid Build Coastguard Worker 
half_btf(int32_t w0,int32_t in0,int32_t w1,int32_t in1,int bit)102*77c1e3ccSAndroid Build Coastguard Worker static inline int32_t half_btf(int32_t w0, int32_t in0, int32_t w1, int32_t in1,
103*77c1e3ccSAndroid Build Coastguard Worker                                int bit) {
104*77c1e3ccSAndroid Build Coastguard Worker   int64_t result_64 = (int64_t)(w0 * in0) + (int64_t)(w1 * in1);
105*77c1e3ccSAndroid Build Coastguard Worker   int64_t intermediate = result_64 + (1LL << (bit - 1));
106*77c1e3ccSAndroid Build Coastguard Worker   // NOTE(rachelbarker): The value 'result_64' may not necessarily fit
107*77c1e3ccSAndroid Build Coastguard Worker   // into 32 bits. However, the result of this function is nominally
108*77c1e3ccSAndroid Build Coastguard Worker   // ROUND_POWER_OF_TWO_64(result_64, bit)
109*77c1e3ccSAndroid Build Coastguard Worker   // and that is required to fit into stage_range[stage] many bits
110*77c1e3ccSAndroid Build Coastguard Worker   // (checked by range_check_buf()).
111*77c1e3ccSAndroid Build Coastguard Worker   //
112*77c1e3ccSAndroid Build Coastguard Worker   // Here we've unpacked that rounding operation, and it can be shown
113*77c1e3ccSAndroid Build Coastguard Worker   // that the value of 'intermediate' here *does* fit into 32 bits
114*77c1e3ccSAndroid Build Coastguard Worker   // for any conformant bitstream.
115*77c1e3ccSAndroid Build Coastguard Worker   // The upshot is that, if you do all this calculation using
116*77c1e3ccSAndroid Build Coastguard Worker   // wrapping 32-bit arithmetic instead of (non-wrapping) 64-bit arithmetic,
117*77c1e3ccSAndroid Build Coastguard Worker   // then you'll still get the correct result.
118*77c1e3ccSAndroid Build Coastguard Worker   // To provide a check on this logic, we assert that 'intermediate'
119*77c1e3ccSAndroid Build Coastguard Worker   // would fit into an int32 if range checking is enabled.
120*77c1e3ccSAndroid Build Coastguard Worker #if CONFIG_COEFFICIENT_RANGE_CHECKING
121*77c1e3ccSAndroid Build Coastguard Worker   assert(intermediate >= INT32_MIN && intermediate <= INT32_MAX);
122*77c1e3ccSAndroid Build Coastguard Worker #endif
123*77c1e3ccSAndroid Build Coastguard Worker   return (int32_t)(intermediate >> bit);
124*77c1e3ccSAndroid Build Coastguard Worker }
125*77c1e3ccSAndroid Build Coastguard Worker 
highbd_clip_pixel_add(uint16_t dest,tran_high_t trans,int bd)126*77c1e3ccSAndroid Build Coastguard Worker static inline uint16_t highbd_clip_pixel_add(uint16_t dest, tran_high_t trans,
127*77c1e3ccSAndroid Build Coastguard Worker                                              int bd) {
128*77c1e3ccSAndroid Build Coastguard Worker   return clip_pixel_highbd(dest + (int)trans, bd);
129*77c1e3ccSAndroid Build Coastguard Worker }
130*77c1e3ccSAndroid Build Coastguard Worker 
131*77c1e3ccSAndroid Build Coastguard Worker typedef void (*TxfmFunc)(const int32_t *input, int32_t *output, int8_t cos_bit,
132*77c1e3ccSAndroid Build Coastguard Worker                          const int8_t *stage_range);
133*77c1e3ccSAndroid Build Coastguard Worker 
134*77c1e3ccSAndroid Build Coastguard Worker typedef void (*FwdTxfm2dFunc)(const int16_t *input, int32_t *output, int stride,
135*77c1e3ccSAndroid Build Coastguard Worker                               TX_TYPE tx_type, int bd);
136*77c1e3ccSAndroid Build Coastguard Worker 
137*77c1e3ccSAndroid Build Coastguard Worker enum {
138*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_DCT4,
139*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_DCT8,
140*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_DCT16,
141*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_DCT32,
142*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_DCT64,
143*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_ADST4,
144*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_ADST8,
145*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_ADST16,
146*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_IDENTITY4,
147*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_IDENTITY8,
148*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_IDENTITY16,
149*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_IDENTITY32,
150*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPES,
151*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE_INVALID,
152*77c1e3ccSAndroid Build Coastguard Worker } UENUM1BYTE(TXFM_TYPE);
153*77c1e3ccSAndroid Build Coastguard Worker 
154*77c1e3ccSAndroid Build Coastguard Worker typedef struct TXFM_2D_FLIP_CFG {
155*77c1e3ccSAndroid Build Coastguard Worker   TX_SIZE tx_size;
156*77c1e3ccSAndroid Build Coastguard Worker   int ud_flip;  // flip upside down
157*77c1e3ccSAndroid Build Coastguard Worker   int lr_flip;  // flip left to right
158*77c1e3ccSAndroid Build Coastguard Worker   const int8_t *shift;
159*77c1e3ccSAndroid Build Coastguard Worker   int8_t cos_bit_col;
160*77c1e3ccSAndroid Build Coastguard Worker   int8_t cos_bit_row;
161*77c1e3ccSAndroid Build Coastguard Worker   int8_t stage_range_col[MAX_TXFM_STAGE_NUM];
162*77c1e3ccSAndroid Build Coastguard Worker   int8_t stage_range_row[MAX_TXFM_STAGE_NUM];
163*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE txfm_type_col;
164*77c1e3ccSAndroid Build Coastguard Worker   TXFM_TYPE txfm_type_row;
165*77c1e3ccSAndroid Build Coastguard Worker   int stage_num_col;
166*77c1e3ccSAndroid Build Coastguard Worker   int stage_num_row;
167*77c1e3ccSAndroid Build Coastguard Worker } TXFM_2D_FLIP_CFG;
168*77c1e3ccSAndroid Build Coastguard Worker 
get_flip_cfg(TX_TYPE tx_type,int * ud_flip,int * lr_flip)169*77c1e3ccSAndroid Build Coastguard Worker static inline void get_flip_cfg(TX_TYPE tx_type, int *ud_flip, int *lr_flip) {
170*77c1e3ccSAndroid Build Coastguard Worker   switch (tx_type) {
171*77c1e3ccSAndroid Build Coastguard Worker     case DCT_DCT:
172*77c1e3ccSAndroid Build Coastguard Worker     case ADST_DCT:
173*77c1e3ccSAndroid Build Coastguard Worker     case DCT_ADST:
174*77c1e3ccSAndroid Build Coastguard Worker     case ADST_ADST:
175*77c1e3ccSAndroid Build Coastguard Worker       *ud_flip = 0;
176*77c1e3ccSAndroid Build Coastguard Worker       *lr_flip = 0;
177*77c1e3ccSAndroid Build Coastguard Worker       break;
178*77c1e3ccSAndroid Build Coastguard Worker     case IDTX:
179*77c1e3ccSAndroid Build Coastguard Worker     case V_DCT:
180*77c1e3ccSAndroid Build Coastguard Worker     case H_DCT:
181*77c1e3ccSAndroid Build Coastguard Worker     case V_ADST:
182*77c1e3ccSAndroid Build Coastguard Worker     case H_ADST:
183*77c1e3ccSAndroid Build Coastguard Worker       *ud_flip = 0;
184*77c1e3ccSAndroid Build Coastguard Worker       *lr_flip = 0;
185*77c1e3ccSAndroid Build Coastguard Worker       break;
186*77c1e3ccSAndroid Build Coastguard Worker     case FLIPADST_DCT:
187*77c1e3ccSAndroid Build Coastguard Worker     case FLIPADST_ADST:
188*77c1e3ccSAndroid Build Coastguard Worker     case V_FLIPADST:
189*77c1e3ccSAndroid Build Coastguard Worker       *ud_flip = 1;
190*77c1e3ccSAndroid Build Coastguard Worker       *lr_flip = 0;
191*77c1e3ccSAndroid Build Coastguard Worker       break;
192*77c1e3ccSAndroid Build Coastguard Worker     case DCT_FLIPADST:
193*77c1e3ccSAndroid Build Coastguard Worker     case ADST_FLIPADST:
194*77c1e3ccSAndroid Build Coastguard Worker     case H_FLIPADST:
195*77c1e3ccSAndroid Build Coastguard Worker       *ud_flip = 0;
196*77c1e3ccSAndroid Build Coastguard Worker       *lr_flip = 1;
197*77c1e3ccSAndroid Build Coastguard Worker       break;
198*77c1e3ccSAndroid Build Coastguard Worker     case FLIPADST_FLIPADST:
199*77c1e3ccSAndroid Build Coastguard Worker       *ud_flip = 1;
200*77c1e3ccSAndroid Build Coastguard Worker       *lr_flip = 1;
201*77c1e3ccSAndroid Build Coastguard Worker       break;
202*77c1e3ccSAndroid Build Coastguard Worker     default:
203*77c1e3ccSAndroid Build Coastguard Worker       *ud_flip = 0;
204*77c1e3ccSAndroid Build Coastguard Worker       *lr_flip = 0;
205*77c1e3ccSAndroid Build Coastguard Worker       assert(0);
206*77c1e3ccSAndroid Build Coastguard Worker   }
207*77c1e3ccSAndroid Build Coastguard Worker }
208*77c1e3ccSAndroid Build Coastguard Worker 
set_flip_cfg(TX_TYPE tx_type,TXFM_2D_FLIP_CFG * cfg)209*77c1e3ccSAndroid Build Coastguard Worker static inline void set_flip_cfg(TX_TYPE tx_type, TXFM_2D_FLIP_CFG *cfg) {
210*77c1e3ccSAndroid Build Coastguard Worker   get_flip_cfg(tx_type, &cfg->ud_flip, &cfg->lr_flip);
211*77c1e3ccSAndroid Build Coastguard Worker }
212*77c1e3ccSAndroid Build Coastguard Worker 
213*77c1e3ccSAndroid Build Coastguard Worker // Utility function that returns the log of the ratio of the col and row
214*77c1e3ccSAndroid Build Coastguard Worker // sizes.
get_rect_tx_log_ratio(int col,int row)215*77c1e3ccSAndroid Build Coastguard Worker static inline int get_rect_tx_log_ratio(int col, int row) {
216*77c1e3ccSAndroid Build Coastguard Worker   if (col == row) return 0;
217*77c1e3ccSAndroid Build Coastguard Worker   if (col > row) {
218*77c1e3ccSAndroid Build Coastguard Worker     if (col == row * 2) return 1;
219*77c1e3ccSAndroid Build Coastguard Worker     if (col == row * 4) return 2;
220*77c1e3ccSAndroid Build Coastguard Worker     assert(0 && "Unsupported transform size");
221*77c1e3ccSAndroid Build Coastguard Worker   } else {
222*77c1e3ccSAndroid Build Coastguard Worker     if (row == col * 2) return -1;
223*77c1e3ccSAndroid Build Coastguard Worker     if (row == col * 4) return -2;
224*77c1e3ccSAndroid Build Coastguard Worker     assert(0 && "Unsupported transform size");
225*77c1e3ccSAndroid Build Coastguard Worker   }
226*77c1e3ccSAndroid Build Coastguard Worker   return 0;  // Invalid
227*77c1e3ccSAndroid Build Coastguard Worker }
228*77c1e3ccSAndroid Build Coastguard Worker 
229*77c1e3ccSAndroid Build Coastguard Worker void av1_gen_fwd_stage_range(int8_t *stage_range_col, int8_t *stage_range_row,
230*77c1e3ccSAndroid Build Coastguard Worker                              const TXFM_2D_FLIP_CFG *cfg, int bd);
231*77c1e3ccSAndroid Build Coastguard Worker 
232*77c1e3ccSAndroid Build Coastguard Worker void av1_gen_inv_stage_range(int8_t *stage_range_col, int8_t *stage_range_row,
233*77c1e3ccSAndroid Build Coastguard Worker                              const TXFM_2D_FLIP_CFG *cfg, TX_SIZE tx_size,
234*77c1e3ccSAndroid Build Coastguard Worker                              int bd);
235*77c1e3ccSAndroid Build Coastguard Worker 
236*77c1e3ccSAndroid Build Coastguard Worker void av1_get_fwd_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size,
237*77c1e3ccSAndroid Build Coastguard Worker                           TXFM_2D_FLIP_CFG *cfg);
238*77c1e3ccSAndroid Build Coastguard Worker void av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size,
239*77c1e3ccSAndroid Build Coastguard Worker                           TXFM_2D_FLIP_CFG *cfg);
240*77c1e3ccSAndroid Build Coastguard Worker extern const TXFM_TYPE av1_txfm_type_ls[5][TX_TYPES_1D];
241*77c1e3ccSAndroid Build Coastguard Worker extern const int8_t av1_txfm_stage_num_list[TXFM_TYPES];
get_txw_idx(TX_SIZE tx_size)242*77c1e3ccSAndroid Build Coastguard Worker static inline int get_txw_idx(TX_SIZE tx_size) {
243*77c1e3ccSAndroid Build Coastguard Worker   return tx_size_wide_log2[tx_size] - tx_size_wide_log2[0];
244*77c1e3ccSAndroid Build Coastguard Worker }
get_txh_idx(TX_SIZE tx_size)245*77c1e3ccSAndroid Build Coastguard Worker static inline int get_txh_idx(TX_SIZE tx_size) {
246*77c1e3ccSAndroid Build Coastguard Worker   return tx_size_high_log2[tx_size] - tx_size_high_log2[0];
247*77c1e3ccSAndroid Build Coastguard Worker }
248*77c1e3ccSAndroid Build Coastguard Worker 
249*77c1e3ccSAndroid Build Coastguard Worker void av1_range_check_buf(int32_t stage, const int32_t *input,
250*77c1e3ccSAndroid Build Coastguard Worker                          const int32_t *buf, int32_t size, int8_t bit);
251*77c1e3ccSAndroid Build Coastguard Worker #define MAX_TXWH_IDX 5
252*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
253*77c1e3ccSAndroid Build Coastguard Worker }
254*77c1e3ccSAndroid Build Coastguard Worker #endif  // __cplusplus
255*77c1e3ccSAndroid Build Coastguard Worker 
256*77c1e3ccSAndroid Build Coastguard Worker #endif  // AOM_AV1_COMMON_AV1_TXFM_H_
257