1 // This file is generated. Do not edit.
2 #ifndef AV1_RTCD_H_
3 #define AV1_RTCD_H_
4 
5 #ifdef RTCD_C
6 #define RTCD_EXTERN
7 #else
8 #define RTCD_EXTERN extern
9 #endif
10 
11 /*
12  * AV1
13  */
14 
15 #include "aom/aom_integer.h"
16 #include "aom_dsp/txfm_common.h"
17 #include "av1/common/av1_txfm.h"
18 #include "av1/common/common.h"
19 #include "av1/common/convolve.h"
20 #include "av1/common/enums.h"
21 #include "av1/common/filter.h"
22 #include "av1/common/odintrin.h"
23 #include "av1/common/quant_common.h"
24 #include "av1/common/restoration.h"
25 
26 struct macroblockd;
27 
28 /* Encoder forward decls */
29 struct macroblock;
30 struct txfm_param;
31 struct aom_variance_vtable;
32 struct search_site_config;
33 struct yv12_buffer_config;
34 struct NN_CONFIG;
35 typedef struct NN_CONFIG NN_CONFIG;
36 
37 enum { NONE, RELU, SOFTSIGN, SIGMOID } UENUM1BYTE(ACTIVATION);
38 #if CONFIG_NN_V2
39 enum { SOFTMAX_CROSS_ENTROPY } UENUM1BYTE(LOSS);
40 struct NN_CONFIG_V2;
41 typedef struct NN_CONFIG_V2 NN_CONFIG_V2;
42 struct FC_LAYER;
43 typedef struct FC_LAYER FC_LAYER;
44 #endif  // CONFIG_NN_V2
45 
46 struct CNN_CONFIG;
47 typedef struct CNN_CONFIG CNN_CONFIG;
48 struct CNN_LAYER_CONFIG;
49 typedef struct CNN_LAYER_CONFIG CNN_LAYER_CONFIG;
50 struct CNN_THREAD_DATA;
51 typedef struct CNN_THREAD_DATA CNN_THREAD_DATA;
52 struct CNN_BRANCH_CONFIG;
53 typedef struct CNN_BRANCH_CONFIG CNN_BRANCH_CONFIG;
54 struct CNN_MULTI_OUT;
55 typedef struct CNN_MULTI_OUT CNN_MULTI_OUT;
56 
57 /* Function pointers return by CfL functions */
58 typedef void (*cfl_subsample_lbd_fn)(const uint8_t* input,
59                                      int input_stride,
60                                      uint16_t* output_q3);
61 
62 #if CONFIG_AV1_HIGHBITDEPTH
63 typedef void (*cfl_subsample_hbd_fn)(const uint16_t* input,
64                                      int input_stride,
65                                      uint16_t* output_q3);
66 
67 typedef void (*cfl_predict_hbd_fn)(const int16_t* src,
68                                    uint16_t* dst,
69                                    int dst_stride,
70                                    int alpha_q3,
71                                    int bd);
72 #endif
73 
74 typedef void (*cfl_subtract_average_fn)(const uint16_t* src, int16_t* dst);
75 
76 typedef void (*cfl_predict_lbd_fn)(const int16_t* src,
77                                    uint8_t* dst,
78                                    int dst_stride,
79                                    int alpha_q3);
80 
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84 
85 void aom_quantize_b_helper_c(const tran_low_t* coeff_ptr,
86                              intptr_t n_coeffs,
87                              const int16_t* zbin_ptr,
88                              const int16_t* round_ptr,
89                              const int16_t* quant_ptr,
90                              const int16_t* quant_shift_ptr,
91                              tran_low_t* qcoeff_ptr,
92                              tran_low_t* dqcoeff_ptr,
93                              const int16_t* dequant_ptr,
94                              uint16_t* eob_ptr,
95                              const int16_t* scan,
96                              const int16_t* iscan,
97                              const qm_val_t* qm_ptr,
98                              const qm_val_t* iqm_ptr,
99                              const int log_scale);
100 void aom_quantize_b_helper_neon(const tran_low_t* coeff_ptr,
101                                 intptr_t n_coeffs,
102                                 const int16_t* zbin_ptr,
103                                 const int16_t* round_ptr,
104                                 const int16_t* quant_ptr,
105                                 const int16_t* quant_shift_ptr,
106                                 tran_low_t* qcoeff_ptr,
107                                 tran_low_t* dqcoeff_ptr,
108                                 const int16_t* dequant_ptr,
109                                 uint16_t* eob_ptr,
110                                 const int16_t* scan,
111                                 const int16_t* iscan,
112                                 const qm_val_t* qm_ptr,
113                                 const qm_val_t* iqm_ptr,
114                                 const int log_scale);
115 RTCD_EXTERN void (*aom_quantize_b_helper)(const tran_low_t* coeff_ptr,
116                                           intptr_t n_coeffs,
117                                           const int16_t* zbin_ptr,
118                                           const int16_t* round_ptr,
119                                           const int16_t* quant_ptr,
120                                           const int16_t* quant_shift_ptr,
121                                           tran_low_t* qcoeff_ptr,
122                                           tran_low_t* dqcoeff_ptr,
123                                           const int16_t* dequant_ptr,
124                                           uint16_t* eob_ptr,
125                                           const int16_t* scan,
126                                           const int16_t* iscan,
127                                           const qm_val_t* qm_ptr,
128                                           const qm_val_t* iqm_ptr,
129                                           const int log_scale);
130 
131 void av1_apply_selfguided_restoration_c(const uint8_t* dat,
132                                         int width,
133                                         int height,
134                                         int stride,
135                                         int eps,
136                                         const int* xqd,
137                                         uint8_t* dst,
138                                         int dst_stride,
139                                         int32_t* tmpbuf,
140                                         int bit_depth,
141                                         int highbd);
142 void av1_apply_selfguided_restoration_neon(const uint8_t* dat,
143                                            int width,
144                                            int height,
145                                            int stride,
146                                            int eps,
147                                            const int* xqd,
148                                            uint8_t* dst,
149                                            int dst_stride,
150                                            int32_t* tmpbuf,
151                                            int bit_depth,
152                                            int highbd);
153 RTCD_EXTERN void (*av1_apply_selfguided_restoration)(const uint8_t* dat,
154                                                      int width,
155                                                      int height,
156                                                      int stride,
157                                                      int eps,
158                                                      const int* xqd,
159                                                      uint8_t* dst,
160                                                      int dst_stride,
161                                                      int32_t* tmpbuf,
162                                                      int bit_depth,
163                                                      int highbd);
164 
165 void av1_apply_temporal_filter_c(const struct yv12_buffer_config* ref_frame,
166                                  const struct macroblockd* mbd,
167                                  const BLOCK_SIZE block_size,
168                                  const int mb_row,
169                                  const int mb_col,
170                                  const int num_planes,
171                                  const double* noise_levels,
172                                  const MV* subblock_mvs,
173                                  const int* subblock_mses,
174                                  const int q_factor,
175                                  const int filter_strength,
176                                  const uint8_t* pred,
177                                  uint32_t* accum,
178                                  uint16_t* count);
179 #define av1_apply_temporal_filter av1_apply_temporal_filter_c
180 
181 int64_t av1_block_error_c(const tran_low_t* coeff,
182                           const tran_low_t* dqcoeff,
183                           intptr_t block_size,
184                           int64_t* ssz);
185 int64_t av1_block_error_neon(const tran_low_t* coeff,
186                              const tran_low_t* dqcoeff,
187                              intptr_t block_size,
188                              int64_t* ssz);
189 RTCD_EXTERN int64_t (*av1_block_error)(const tran_low_t* coeff,
190                                        const tran_low_t* dqcoeff,
191                                        intptr_t block_size,
192                                        int64_t* ssz);
193 
194 int64_t av1_block_error_lp_c(const int16_t* coeff,
195                              const int16_t* dqcoeff,
196                              intptr_t block_size);
197 int64_t av1_block_error_lp_neon(const int16_t* coeff,
198                                 const int16_t* dqcoeff,
199                                 intptr_t block_size);
200 RTCD_EXTERN int64_t (*av1_block_error_lp)(const int16_t* coeff,
201                                           const int16_t* dqcoeff,
202                                           intptr_t block_size);
203 
204 void av1_build_compound_diffwtd_mask_c(uint8_t* mask,
205                                        DIFFWTD_MASK_TYPE mask_type,
206                                        const uint8_t* src0,
207                                        int src0_stride,
208                                        const uint8_t* src1,
209                                        int src1_stride,
210                                        int h,
211                                        int w);
212 #define av1_build_compound_diffwtd_mask av1_build_compound_diffwtd_mask_c
213 
214 void av1_build_compound_diffwtd_mask_d16_c(uint8_t* mask,
215                                            DIFFWTD_MASK_TYPE mask_type,
216                                            const CONV_BUF_TYPE* src0,
217                                            int src0_stride,
218                                            const CONV_BUF_TYPE* src1,
219                                            int src1_stride,
220                                            int h,
221                                            int w,
222                                            ConvolveParams* conv_params,
223                                            int bd);
224 void av1_build_compound_diffwtd_mask_d16_neon(uint8_t* mask,
225                                               DIFFWTD_MASK_TYPE mask_type,
226                                               const CONV_BUF_TYPE* src0,
227                                               int src0_stride,
228                                               const CONV_BUF_TYPE* src1,
229                                               int src1_stride,
230                                               int h,
231                                               int w,
232                                               ConvolveParams* conv_params,
233                                               int bd);
234 RTCD_EXTERN void (*av1_build_compound_diffwtd_mask_d16)(
235     uint8_t* mask,
236     DIFFWTD_MASK_TYPE mask_type,
237     const CONV_BUF_TYPE* src0,
238     int src0_stride,
239     const CONV_BUF_TYPE* src1,
240     int src1_stride,
241     int h,
242     int w,
243     ConvolveParams* conv_params,
244     int bd);
245 
246 void av1_build_compound_diffwtd_mask_highbd_c(uint8_t* mask,
247                                               DIFFWTD_MASK_TYPE mask_type,
248                                               const uint8_t* src0,
249                                               int src0_stride,
250                                               const uint8_t* src1,
251                                               int src1_stride,
252                                               int h,
253                                               int w,
254                                               int bd);
255 #define av1_build_compound_diffwtd_mask_highbd \
256   av1_build_compound_diffwtd_mask_highbd_c
257 
258 int64_t av1_calc_frame_error_c(const uint8_t* const ref,
259                                int stride,
260                                const uint8_t* const dst,
261                                int p_width,
262                                int p_height,
263                                int p_stride);
264 #define av1_calc_frame_error av1_calc_frame_error_c
265 
266 void av1_calc_proj_params_c(const uint8_t* src8,
267                             int width,
268                             int height,
269                             int src_stride,
270                             const uint8_t* dat8,
271                             int dat_stride,
272                             int32_t* flt0,
273                             int flt0_stride,
274                             int32_t* flt1,
275                             int flt1_stride,
276                             int64_t H[2][2],
277                             int64_t C[2],
278                             const sgr_params_type* params);
279 #define av1_calc_proj_params av1_calc_proj_params_c
280 
281 void av1_calc_proj_params_high_bd_c(const uint8_t* src8,
282                                     int width,
283                                     int height,
284                                     int src_stride,
285                                     const uint8_t* dat8,
286                                     int dat_stride,
287                                     int32_t* flt0,
288                                     int flt0_stride,
289                                     int32_t* flt1,
290                                     int flt1_stride,
291                                     int64_t H[2][2],
292                                     int64_t C[2],
293                                     const sgr_params_type* params);
294 #define av1_calc_proj_params_high_bd av1_calc_proj_params_high_bd_c
295 
296 void av1_cnn_activate_c(float** input,
297                         int channels,
298                         int width,
299                         int height,
300                         int stride,
301                         ACTIVATION layer_activation);
302 #define av1_cnn_activate av1_cnn_activate_c
303 
304 void av1_cnn_add_c(float** input,
305                    int channels,
306                    int width,
307                    int height,
308                    int stride,
309                    const float** add);
310 #define av1_cnn_add av1_cnn_add_c
311 
312 void av1_cnn_batchnorm_c(float** image,
313                          int channels,
314                          int width,
315                          int height,
316                          int stride,
317                          const float* gamma,
318                          const float* beta,
319                          const float* mean,
320                          const float* std);
321 #define av1_cnn_batchnorm av1_cnn_batchnorm_c
322 
323 void av1_cnn_convolve_c(const float** input,
324                         int in_width,
325                         int in_height,
326                         int in_stride,
327                         const CNN_LAYER_CONFIG* layer_config,
328                         float** output,
329                         int out_stride,
330                         int start_idx,
331                         int step);
332 #define av1_cnn_convolve av1_cnn_convolve_c
333 
334 void av1_cnn_deconvolve_c(const float** input,
335                           int in_width,
336                           int in_height,
337                           int in_stride,
338                           const CNN_LAYER_CONFIG* layer_config,
339                           float** output,
340                           int out_stride);
341 #define av1_cnn_deconvolve av1_cnn_deconvolve_c
342 
343 void av1_cnn_predict_c(const float** input,
344                        int in_width,
345                        int in_height,
346                        int in_stride,
347                        const CNN_CONFIG* cnn_config,
348                        const CNN_THREAD_DATA* thread_data,
349                        CNN_MULTI_OUT* output_struct);
350 #define av1_cnn_predict av1_cnn_predict_c
351 
352 double av1_compute_cross_correlation_c(unsigned char* im1,
353                                        int stride1,
354                                        int x1,
355                                        int y1,
356                                        unsigned char* im2,
357                                        int stride2,
358                                        int x2,
359                                        int y2);
360 #define av1_compute_cross_correlation av1_compute_cross_correlation_c
361 
362 void av1_compute_stats_c(int wiener_win,
363                          const uint8_t* dgd8,
364                          const uint8_t* src8,
365                          int h_start,
366                          int h_end,
367                          int v_start,
368                          int v_end,
369                          int dgd_stride,
370                          int src_stride,
371                          int64_t* M,
372                          int64_t* H);
373 #define av1_compute_stats av1_compute_stats_c
374 
375 void av1_compute_stats_highbd_c(int wiener_win,
376                                 const uint8_t* dgd8,
377                                 const uint8_t* src8,
378                                 int h_start,
379                                 int h_end,
380                                 int v_start,
381                                 int v_end,
382                                 int dgd_stride,
383                                 int src_stride,
384                                 int64_t* M,
385                                 int64_t* H,
386                                 aom_bit_depth_t bit_depth);
387 #define av1_compute_stats_highbd av1_compute_stats_highbd_c
388 
389 void av1_convolve_2d_scale_c(const uint8_t* src,
390                              int src_stride,
391                              uint8_t* dst,
392                              int dst_stride,
393                              int w,
394                              int h,
395                              const InterpFilterParams* filter_params_x,
396                              const InterpFilterParams* filter_params_y,
397                              const int subpel_x_qn,
398                              const int x_step_qn,
399                              const int subpel_y_qn,
400                              const int y_step_qn,
401                              ConvolveParams* conv_params);
402 #define av1_convolve_2d_scale av1_convolve_2d_scale_c
403 
404 void av1_convolve_2d_sr_c(const uint8_t* src,
405                           int src_stride,
406                           uint8_t* dst,
407                           int dst_stride,
408                           int w,
409                           int h,
410                           const InterpFilterParams* filter_params_x,
411                           const InterpFilterParams* filter_params_y,
412                           const int subpel_x_qn,
413                           const int subpel_y_qn,
414                           ConvolveParams* conv_params);
415 void av1_convolve_2d_sr_neon(const uint8_t* src,
416                              int src_stride,
417                              uint8_t* dst,
418                              int dst_stride,
419                              int w,
420                              int h,
421                              const InterpFilterParams* filter_params_x,
422                              const InterpFilterParams* filter_params_y,
423                              const int subpel_x_qn,
424                              const int subpel_y_qn,
425                              ConvolveParams* conv_params);
426 RTCD_EXTERN void (*av1_convolve_2d_sr)(
427     const uint8_t* src,
428     int src_stride,
429     uint8_t* dst,
430     int dst_stride,
431     int w,
432     int h,
433     const InterpFilterParams* filter_params_x,
434     const InterpFilterParams* filter_params_y,
435     const int subpel_x_qn,
436     const int subpel_y_qn,
437     ConvolveParams* conv_params);
438 
439 void av1_convolve_horiz_rs_c(const uint8_t* src,
440                              int src_stride,
441                              uint8_t* dst,
442                              int dst_stride,
443                              int w,
444                              int h,
445                              const int16_t* x_filters,
446                              int x0_qn,
447                              int x_step_qn);
448 #define av1_convolve_horiz_rs av1_convolve_horiz_rs_c
449 
450 void av1_convolve_x_sr_c(const uint8_t* src,
451                          int src_stride,
452                          uint8_t* dst,
453                          int dst_stride,
454                          int w,
455                          int h,
456                          const InterpFilterParams* filter_params_x,
457                          const int subpel_x_qn,
458                          ConvolveParams* conv_params);
459 void av1_convolve_x_sr_neon(const uint8_t* src,
460                             int src_stride,
461                             uint8_t* dst,
462                             int dst_stride,
463                             int w,
464                             int h,
465                             const InterpFilterParams* filter_params_x,
466                             const int subpel_x_qn,
467                             ConvolveParams* conv_params);
468 RTCD_EXTERN void (*av1_convolve_x_sr)(const uint8_t* src,
469                                       int src_stride,
470                                       uint8_t* dst,
471                                       int dst_stride,
472                                       int w,
473                                       int h,
474                                       const InterpFilterParams* filter_params_x,
475                                       const int subpel_x_qn,
476                                       ConvolveParams* conv_params);
477 
478 void av1_convolve_y_sr_c(const uint8_t* src,
479                          int src_stride,
480                          uint8_t* dst,
481                          int dst_stride,
482                          int w,
483                          int h,
484                          const InterpFilterParams* filter_params_y,
485                          const int subpel_y_qn);
486 void av1_convolve_y_sr_neon(const uint8_t* src,
487                             int src_stride,
488                             uint8_t* dst,
489                             int dst_stride,
490                             int w,
491                             int h,
492                             const InterpFilterParams* filter_params_y,
493                             const int subpel_y_qn);
494 RTCD_EXTERN void (*av1_convolve_y_sr)(const uint8_t* src,
495                                       int src_stride,
496                                       uint8_t* dst,
497                                       int dst_stride,
498                                       int w,
499                                       int h,
500                                       const InterpFilterParams* filter_params_y,
501                                       const int subpel_y_qn);
502 
503 void av1_dist_wtd_convolve_2d_c(const uint8_t* src,
504                                 int src_stride,
505                                 uint8_t* dst,
506                                 int dst_stride,
507                                 int w,
508                                 int h,
509                                 const InterpFilterParams* filter_params_x,
510                                 const InterpFilterParams* filter_params_y,
511                                 const int subpel_x_qn,
512                                 const int subpel_y_qn,
513                                 ConvolveParams* conv_params);
514 void av1_dist_wtd_convolve_2d_neon(const uint8_t* src,
515                                    int src_stride,
516                                    uint8_t* dst,
517                                    int dst_stride,
518                                    int w,
519                                    int h,
520                                    const InterpFilterParams* filter_params_x,
521                                    const InterpFilterParams* filter_params_y,
522                                    const int subpel_x_qn,
523                                    const int subpel_y_qn,
524                                    ConvolveParams* conv_params);
525 RTCD_EXTERN void (*av1_dist_wtd_convolve_2d)(
526     const uint8_t* src,
527     int src_stride,
528     uint8_t* dst,
529     int dst_stride,
530     int w,
531     int h,
532     const InterpFilterParams* filter_params_x,
533     const InterpFilterParams* filter_params_y,
534     const int subpel_x_qn,
535     const int subpel_y_qn,
536     ConvolveParams* conv_params);
537 
538 void av1_dist_wtd_convolve_2d_copy_c(const uint8_t* src,
539                                      int src_stride,
540                                      uint8_t* dst,
541                                      int dst_stride,
542                                      int w,
543                                      int h,
544                                      ConvolveParams* conv_params);
545 void av1_dist_wtd_convolve_2d_copy_neon(const uint8_t* src,
546                                         int src_stride,
547                                         uint8_t* dst,
548                                         int dst_stride,
549                                         int w,
550                                         int h,
551                                         ConvolveParams* conv_params);
552 RTCD_EXTERN void (*av1_dist_wtd_convolve_2d_copy)(const uint8_t* src,
553                                                   int src_stride,
554                                                   uint8_t* dst,
555                                                   int dst_stride,
556                                                   int w,
557                                                   int h,
558                                                   ConvolveParams* conv_params);
559 
560 void av1_dist_wtd_convolve_x_c(const uint8_t* src,
561                                int src_stride,
562                                uint8_t* dst,
563                                int dst_stride,
564                                int w,
565                                int h,
566                                const InterpFilterParams* filter_params_x,
567                                const int subpel_x_qn,
568                                ConvolveParams* conv_params);
569 void av1_dist_wtd_convolve_x_neon(const uint8_t* src,
570                                   int src_stride,
571                                   uint8_t* dst,
572                                   int dst_stride,
573                                   int w,
574                                   int h,
575                                   const InterpFilterParams* filter_params_x,
576                                   const int subpel_x_qn,
577                                   ConvolveParams* conv_params);
578 RTCD_EXTERN void (*av1_dist_wtd_convolve_x)(
579     const uint8_t* src,
580     int src_stride,
581     uint8_t* dst,
582     int dst_stride,
583     int w,
584     int h,
585     const InterpFilterParams* filter_params_x,
586     const int subpel_x_qn,
587     ConvolveParams* conv_params);
588 
589 void av1_dist_wtd_convolve_y_c(const uint8_t* src,
590                                int src_stride,
591                                uint8_t* dst,
592                                int dst_stride,
593                                int w,
594                                int h,
595                                const InterpFilterParams* filter_params_y,
596                                const int subpel_y_qn,
597                                ConvolveParams* conv_params);
598 void av1_dist_wtd_convolve_y_neon(const uint8_t* src,
599                                   int src_stride,
600                                   uint8_t* dst,
601                                   int dst_stride,
602                                   int w,
603                                   int h,
604                                   const InterpFilterParams* filter_params_y,
605                                   const int subpel_y_qn,
606                                   ConvolveParams* conv_params);
607 RTCD_EXTERN void (*av1_dist_wtd_convolve_y)(
608     const uint8_t* src,
609     int src_stride,
610     uint8_t* dst,
611     int dst_stride,
612     int w,
613     int h,
614     const InterpFilterParams* filter_params_y,
615     const int subpel_y_qn,
616     ConvolveParams* conv_params);
617 
618 void av1_dr_prediction_z1_c(uint8_t* dst,
619                             ptrdiff_t stride,
620                             int bw,
621                             int bh,
622                             const uint8_t* above,
623                             const uint8_t* left,
624                             int upsample_above,
625                             int dx,
626                             int dy);
627 void av1_dr_prediction_z1_neon(uint8_t* dst,
628                                ptrdiff_t stride,
629                                int bw,
630                                int bh,
631                                const uint8_t* above,
632                                const uint8_t* left,
633                                int upsample_above,
634                                int dx,
635                                int dy);
636 RTCD_EXTERN void (*av1_dr_prediction_z1)(uint8_t* dst,
637                                          ptrdiff_t stride,
638                                          int bw,
639                                          int bh,
640                                          const uint8_t* above,
641                                          const uint8_t* left,
642                                          int upsample_above,
643                                          int dx,
644                                          int dy);
645 
646 void av1_dr_prediction_z2_c(uint8_t* dst,
647                             ptrdiff_t stride,
648                             int bw,
649                             int bh,
650                             const uint8_t* above,
651                             const uint8_t* left,
652                             int upsample_above,
653                             int upsample_left,
654                             int dx,
655                             int dy);
656 void av1_dr_prediction_z2_neon(uint8_t* dst,
657                                ptrdiff_t stride,
658                                int bw,
659                                int bh,
660                                const uint8_t* above,
661                                const uint8_t* left,
662                                int upsample_above,
663                                int upsample_left,
664                                int dx,
665                                int dy);
666 RTCD_EXTERN void (*av1_dr_prediction_z2)(uint8_t* dst,
667                                          ptrdiff_t stride,
668                                          int bw,
669                                          int bh,
670                                          const uint8_t* above,
671                                          const uint8_t* left,
672                                          int upsample_above,
673                                          int upsample_left,
674                                          int dx,
675                                          int dy);
676 
677 void av1_dr_prediction_z3_c(uint8_t* dst,
678                             ptrdiff_t stride,
679                             int bw,
680                             int bh,
681                             const uint8_t* above,
682                             const uint8_t* left,
683                             int upsample_left,
684                             int dx,
685                             int dy);
686 void av1_dr_prediction_z3_neon(uint8_t* dst,
687                                ptrdiff_t stride,
688                                int bw,
689                                int bh,
690                                const uint8_t* above,
691                                const uint8_t* left,
692                                int upsample_left,
693                                int dx,
694                                int dy);
695 RTCD_EXTERN void (*av1_dr_prediction_z3)(uint8_t* dst,
696                                          ptrdiff_t stride,
697                                          int bw,
698                                          int bh,
699                                          const uint8_t* above,
700                                          const uint8_t* left,
701                                          int upsample_left,
702                                          int dx,
703                                          int dy);
704 
705 void av1_filter_intra_edge_c(uint8_t* p, int sz, int strength);
706 #define av1_filter_intra_edge av1_filter_intra_edge_c
707 
708 void av1_filter_intra_edge_high_c(uint16_t* p, int sz, int strength);
709 #define av1_filter_intra_edge_high av1_filter_intra_edge_high_c
710 
711 void av1_filter_intra_predictor_c(uint8_t* dst,
712                                   ptrdiff_t stride,
713                                   TX_SIZE tx_size,
714                                   const uint8_t* above,
715                                   const uint8_t* left,
716                                   int mode);
717 void av1_filter_intra_predictor_neon(uint8_t* dst,
718                                      ptrdiff_t stride,
719                                      TX_SIZE tx_size,
720                                      const uint8_t* above,
721                                      const uint8_t* left,
722                                      int mode);
723 RTCD_EXTERN void (*av1_filter_intra_predictor)(uint8_t* dst,
724                                                ptrdiff_t stride,
725                                                TX_SIZE tx_size,
726                                                const uint8_t* above,
727                                                const uint8_t* left,
728                                                int mode);
729 
730 void av1_fwd_txfm2d_16x16_c(const int16_t* input,
731                             int32_t* output,
732                             int stride,
733                             TX_TYPE tx_type,
734                             int bd);
735 void av1_fwd_txfm2d_16x16_neon(const int16_t* input,
736                                int32_t* output,
737                                int stride,
738                                TX_TYPE tx_type,
739                                int bd);
740 RTCD_EXTERN void (*av1_fwd_txfm2d_16x16)(const int16_t* input,
741                                          int32_t* output,
742                                          int stride,
743                                          TX_TYPE tx_type,
744                                          int bd);
745 
746 void av1_fwd_txfm2d_16x32_c(const int16_t* input,
747                             int32_t* output,
748                             int stride,
749                             TX_TYPE tx_type,
750                             int bd);
751 void av1_fwd_txfm2d_16x32_neon(const int16_t* input,
752                                int32_t* output,
753                                int stride,
754                                TX_TYPE tx_type,
755                                int bd);
756 RTCD_EXTERN void (*av1_fwd_txfm2d_16x32)(const int16_t* input,
757                                          int32_t* output,
758                                          int stride,
759                                          TX_TYPE tx_type,
760                                          int bd);
761 
762 void av1_fwd_txfm2d_16x4_c(const int16_t* input,
763                            int32_t* output,
764                            int stride,
765                            TX_TYPE tx_type,
766                            int bd);
767 void av1_fwd_txfm2d_16x4_neon(const int16_t* input,
768                               int32_t* output,
769                               int stride,
770                               TX_TYPE tx_type,
771                               int bd);
772 RTCD_EXTERN void (*av1_fwd_txfm2d_16x4)(const int16_t* input,
773                                         int32_t* output,
774                                         int stride,
775                                         TX_TYPE tx_type,
776                                         int bd);
777 
778 void av1_fwd_txfm2d_16x64_c(const int16_t* input,
779                             int32_t* output,
780                             int stride,
781                             TX_TYPE tx_type,
782                             int bd);
783 void av1_fwd_txfm2d_16x64_neon(const int16_t* input,
784                                int32_t* output,
785                                int stride,
786                                TX_TYPE tx_type,
787                                int bd);
788 RTCD_EXTERN void (*av1_fwd_txfm2d_16x64)(const int16_t* input,
789                                          int32_t* output,
790                                          int stride,
791                                          TX_TYPE tx_type,
792                                          int bd);
793 
794 void av1_fwd_txfm2d_16x8_c(const int16_t* input,
795                            int32_t* output,
796                            int stride,
797                            TX_TYPE tx_type,
798                            int bd);
799 void av1_fwd_txfm2d_16x8_neon(const int16_t* input,
800                               int32_t* output,
801                               int stride,
802                               TX_TYPE tx_type,
803                               int bd);
804 RTCD_EXTERN void (*av1_fwd_txfm2d_16x8)(const int16_t* input,
805                                         int32_t* output,
806                                         int stride,
807                                         TX_TYPE tx_type,
808                                         int bd);
809 
810 void av1_fwd_txfm2d_32x16_c(const int16_t* input,
811                             int32_t* output,
812                             int stride,
813                             TX_TYPE tx_type,
814                             int bd);
815 void av1_fwd_txfm2d_32x16_neon(const int16_t* input,
816                                int32_t* output,
817                                int stride,
818                                TX_TYPE tx_type,
819                                int bd);
820 RTCD_EXTERN void (*av1_fwd_txfm2d_32x16)(const int16_t* input,
821                                          int32_t* output,
822                                          int stride,
823                                          TX_TYPE tx_type,
824                                          int bd);
825 
826 void av1_fwd_txfm2d_32x32_c(const int16_t* input,
827                             int32_t* output,
828                             int stride,
829                             TX_TYPE tx_type,
830                             int bd);
831 void av1_fwd_txfm2d_32x32_neon(const int16_t* input,
832                                int32_t* output,
833                                int stride,
834                                TX_TYPE tx_type,
835                                int bd);
836 RTCD_EXTERN void (*av1_fwd_txfm2d_32x32)(const int16_t* input,
837                                          int32_t* output,
838                                          int stride,
839                                          TX_TYPE tx_type,
840                                          int bd);
841 
842 void av1_fwd_txfm2d_32x64_c(const int16_t* input,
843                             int32_t* output,
844                             int stride,
845                             TX_TYPE tx_type,
846                             int bd);
847 void av1_fwd_txfm2d_32x64_neon(const int16_t* input,
848                                int32_t* output,
849                                int stride,
850                                TX_TYPE tx_type,
851                                int bd);
852 RTCD_EXTERN void (*av1_fwd_txfm2d_32x64)(const int16_t* input,
853                                          int32_t* output,
854                                          int stride,
855                                          TX_TYPE tx_type,
856                                          int bd);
857 
858 void av1_fwd_txfm2d_32x8_c(const int16_t* input,
859                            int32_t* output,
860                            int stride,
861                            TX_TYPE tx_type,
862                            int bd);
863 void av1_fwd_txfm2d_32x8_neon(const int16_t* input,
864                               int32_t* output,
865                               int stride,
866                               TX_TYPE tx_type,
867                               int bd);
868 RTCD_EXTERN void (*av1_fwd_txfm2d_32x8)(const int16_t* input,
869                                         int32_t* output,
870                                         int stride,
871                                         TX_TYPE tx_type,
872                                         int bd);
873 
874 void av1_fwd_txfm2d_4x16_c(const int16_t* input,
875                            int32_t* output,
876                            int stride,
877                            TX_TYPE tx_type,
878                            int bd);
879 void av1_fwd_txfm2d_4x16_neon(const int16_t* input,
880                               int32_t* output,
881                               int stride,
882                               TX_TYPE tx_type,
883                               int bd);
884 RTCD_EXTERN void (*av1_fwd_txfm2d_4x16)(const int16_t* input,
885                                         int32_t* output,
886                                         int stride,
887                                         TX_TYPE tx_type,
888                                         int bd);
889 
890 void av1_fwd_txfm2d_4x4_c(const int16_t* input,
891                           int32_t* output,
892                           int stride,
893                           TX_TYPE tx_type,
894                           int bd);
895 void av1_fwd_txfm2d_4x4_neon(const int16_t* input,
896                              int32_t* output,
897                              int stride,
898                              TX_TYPE tx_type,
899                              int bd);
900 RTCD_EXTERN void (*av1_fwd_txfm2d_4x4)(const int16_t* input,
901                                        int32_t* output,
902                                        int stride,
903                                        TX_TYPE tx_type,
904                                        int bd);
905 
906 void av1_fwd_txfm2d_4x8_c(const int16_t* input,
907                           int32_t* output,
908                           int stride,
909                           TX_TYPE tx_type,
910                           int bd);
911 void av1_fwd_txfm2d_4x8_neon(const int16_t* input,
912                              int32_t* output,
913                              int stride,
914                              TX_TYPE tx_type,
915                              int bd);
916 RTCD_EXTERN void (*av1_fwd_txfm2d_4x8)(const int16_t* input,
917                                        int32_t* output,
918                                        int stride,
919                                        TX_TYPE tx_type,
920                                        int bd);
921 
922 void av1_fwd_txfm2d_64x16_c(const int16_t* input,
923                             int32_t* output,
924                             int stride,
925                             TX_TYPE tx_type,
926                             int bd);
927 void av1_fwd_txfm2d_64x16_neon(const int16_t* input,
928                                int32_t* output,
929                                int stride,
930                                TX_TYPE tx_type,
931                                int bd);
932 RTCD_EXTERN void (*av1_fwd_txfm2d_64x16)(const int16_t* input,
933                                          int32_t* output,
934                                          int stride,
935                                          TX_TYPE tx_type,
936                                          int bd);
937 
938 void av1_fwd_txfm2d_64x32_c(const int16_t* input,
939                             int32_t* output,
940                             int stride,
941                             TX_TYPE tx_type,
942                             int bd);
943 void av1_fwd_txfm2d_64x32_neon(const int16_t* input,
944                                int32_t* output,
945                                int stride,
946                                TX_TYPE tx_type,
947                                int bd);
948 RTCD_EXTERN void (*av1_fwd_txfm2d_64x32)(const int16_t* input,
949                                          int32_t* output,
950                                          int stride,
951                                          TX_TYPE tx_type,
952                                          int bd);
953 
954 void av1_fwd_txfm2d_64x64_c(const int16_t* input,
955                             int32_t* output,
956                             int stride,
957                             TX_TYPE tx_type,
958                             int bd);
959 void av1_fwd_txfm2d_64x64_neon(const int16_t* input,
960                                int32_t* output,
961                                int stride,
962                                TX_TYPE tx_type,
963                                int bd);
964 RTCD_EXTERN void (*av1_fwd_txfm2d_64x64)(const int16_t* input,
965                                          int32_t* output,
966                                          int stride,
967                                          TX_TYPE tx_type,
968                                          int bd);
969 
970 void av1_fwd_txfm2d_8x16_c(const int16_t* input,
971                            int32_t* output,
972                            int stride,
973                            TX_TYPE tx_type,
974                            int bd);
975 void av1_fwd_txfm2d_8x16_neon(const int16_t* input,
976                               int32_t* output,
977                               int stride,
978                               TX_TYPE tx_type,
979                               int bd);
980 RTCD_EXTERN void (*av1_fwd_txfm2d_8x16)(const int16_t* input,
981                                         int32_t* output,
982                                         int stride,
983                                         TX_TYPE tx_type,
984                                         int bd);
985 
986 void av1_fwd_txfm2d_8x32_c(const int16_t* input,
987                            int32_t* output,
988                            int stride,
989                            TX_TYPE tx_type,
990                            int bd);
991 void av1_fwd_txfm2d_8x32_neon(const int16_t* input,
992                               int32_t* output,
993                               int stride,
994                               TX_TYPE tx_type,
995                               int bd);
996 RTCD_EXTERN void (*av1_fwd_txfm2d_8x32)(const int16_t* input,
997                                         int32_t* output,
998                                         int stride,
999                                         TX_TYPE tx_type,
1000                                         int bd);
1001 
1002 void av1_fwd_txfm2d_8x4_c(const int16_t* input,
1003                           int32_t* output,
1004                           int stride,
1005                           TX_TYPE tx_type,
1006                           int bd);
1007 void av1_fwd_txfm2d_8x4_neon(const int16_t* input,
1008                              int32_t* output,
1009                              int stride,
1010                              TX_TYPE tx_type,
1011                              int bd);
1012 RTCD_EXTERN void (*av1_fwd_txfm2d_8x4)(const int16_t* input,
1013                                        int32_t* output,
1014                                        int stride,
1015                                        TX_TYPE tx_type,
1016                                        int bd);
1017 
1018 void av1_fwd_txfm2d_8x8_c(const int16_t* input,
1019                           int32_t* output,
1020                           int stride,
1021                           TX_TYPE tx_type,
1022                           int bd);
1023 void av1_fwd_txfm2d_8x8_neon(const int16_t* input,
1024                              int32_t* output,
1025                              int stride,
1026                              TX_TYPE tx_type,
1027                              int bd);
1028 RTCD_EXTERN void (*av1_fwd_txfm2d_8x8)(const int16_t* input,
1029                                        int32_t* output,
1030                                        int stride,
1031                                        TX_TYPE tx_type,
1032                                        int bd);
1033 
1034 void av1_fwht4x4_c(const int16_t* input, tran_low_t* output, int stride);
1035 void av1_fwht4x4_neon(const int16_t* input, tran_low_t* output, int stride);
1036 RTCD_EXTERN void (*av1_fwht4x4)(const int16_t* input,
1037                                 tran_low_t* output,
1038                                 int stride);
1039 
1040 uint32_t av1_get_crc32c_value_c(void* crc_calculator,
1041                                 uint8_t* p,
1042                                 size_t length);
1043 #define av1_get_crc32c_value av1_get_crc32c_value_c
1044 
1045 void av1_get_horver_correlation_full_c(const int16_t* diff,
1046                                        int stride,
1047                                        int w,
1048                                        int h,
1049                                        float* hcorr,
1050                                        float* vcorr);
1051 void av1_get_horver_correlation_full_neon(const int16_t* diff,
1052                                           int stride,
1053                                           int w,
1054                                           int h,
1055                                           float* hcorr,
1056                                           float* vcorr);
1057 RTCD_EXTERN void (*av1_get_horver_correlation_full)(const int16_t* diff,
1058                                                     int stride,
1059                                                     int w,
1060                                                     int h,
1061                                                     float* hcorr,
1062                                                     float* vcorr);
1063 
1064 void av1_get_nz_map_contexts_c(const uint8_t* const levels,
1065                                const int16_t* const scan,
1066                                const uint16_t eob,
1067                                const TX_SIZE tx_size,
1068                                const TX_CLASS tx_class,
1069                                int8_t* const coeff_contexts);
1070 void av1_get_nz_map_contexts_neon(const uint8_t* const levels,
1071                                   const int16_t* const scan,
1072                                   const uint16_t eob,
1073                                   const TX_SIZE tx_size,
1074                                   const TX_CLASS tx_class,
1075                                   int8_t* const coeff_contexts);
1076 RTCD_EXTERN void (*av1_get_nz_map_contexts)(const uint8_t* const levels,
1077                                             const int16_t* const scan,
1078                                             const uint16_t eob,
1079                                             const TX_SIZE tx_size,
1080                                             const TX_CLASS tx_class,
1081                                             int8_t* const coeff_contexts);
1082 
1083 void av1_highbd_apply_temporal_filter_c(
1084     const struct yv12_buffer_config* ref_frame,
1085     const struct macroblockd* mbd,
1086     const BLOCK_SIZE block_size,
1087     const int mb_row,
1088     const int mb_col,
1089     const int num_planes,
1090     const double* noise_levels,
1091     const MV* subblock_mvs,
1092     const int* subblock_mses,
1093     const int q_factor,
1094     const int filter_strength,
1095     const uint8_t* pred,
1096     uint32_t* accum,
1097     uint16_t* count);
1098 #define av1_highbd_apply_temporal_filter av1_highbd_apply_temporal_filter_c
1099 
1100 int64_t av1_highbd_block_error_c(const tran_low_t* coeff,
1101                                  const tran_low_t* dqcoeff,
1102                                  intptr_t block_size,
1103                                  int64_t* ssz,
1104                                  int bd);
1105 #define av1_highbd_block_error av1_highbd_block_error_c
1106 
1107 void av1_highbd_convolve8_c(const uint8_t* src,
1108                             ptrdiff_t src_stride,
1109                             uint8_t* dst,
1110                             ptrdiff_t dst_stride,
1111                             const int16_t* filter_x,
1112                             int x_step_q4,
1113                             const int16_t* filter_y,
1114                             int y_step_q4,
1115                             int w,
1116                             int h,
1117                             int bps);
1118 #define av1_highbd_convolve8 av1_highbd_convolve8_c
1119 
1120 void av1_highbd_convolve8_horiz_c(const uint8_t* src,
1121                                   ptrdiff_t src_stride,
1122                                   uint8_t* dst,
1123                                   ptrdiff_t dst_stride,
1124                                   const int16_t* filter_x,
1125                                   int x_step_q4,
1126                                   const int16_t* filter_y,
1127                                   int y_step_q4,
1128                                   int w,
1129                                   int h,
1130                                   int bps);
1131 #define av1_highbd_convolve8_horiz av1_highbd_convolve8_horiz_c
1132 
1133 void av1_highbd_convolve8_vert_c(const uint8_t* src,
1134                                  ptrdiff_t src_stride,
1135                                  uint8_t* dst,
1136                                  ptrdiff_t dst_stride,
1137                                  const int16_t* filter_x,
1138                                  int x_step_q4,
1139                                  const int16_t* filter_y,
1140                                  int y_step_q4,
1141                                  int w,
1142                                  int h,
1143                                  int bps);
1144 #define av1_highbd_convolve8_vert av1_highbd_convolve8_vert_c
1145 
1146 void av1_highbd_convolve_2d_scale_c(const uint16_t* src,
1147                                     int src_stride,
1148                                     uint16_t* dst,
1149                                     int dst_stride,
1150                                     int w,
1151                                     int h,
1152                                     const InterpFilterParams* filter_params_x,
1153                                     const InterpFilterParams* filter_params_y,
1154                                     const int subpel_x_qn,
1155                                     const int x_step_qn,
1156                                     const int subpel_y_qn,
1157                                     const int y_step_qn,
1158                                     ConvolveParams* conv_params,
1159                                     int bd);
1160 #define av1_highbd_convolve_2d_scale av1_highbd_convolve_2d_scale_c
1161 
1162 void av1_highbd_convolve_2d_sr_c(const uint16_t* src,
1163                                  int src_stride,
1164                                  uint16_t* dst,
1165                                  int dst_stride,
1166                                  int w,
1167                                  int h,
1168                                  const InterpFilterParams* filter_params_x,
1169                                  const InterpFilterParams* filter_params_y,
1170                                  const int subpel_x_qn,
1171                                  const int subpel_y_qn,
1172                                  ConvolveParams* conv_params,
1173                                  int bd);
1174 #define av1_highbd_convolve_2d_sr av1_highbd_convolve_2d_sr_c
1175 
1176 void av1_highbd_convolve_avg_c(const uint8_t* src,
1177                                ptrdiff_t src_stride,
1178                                uint8_t* dst,
1179                                ptrdiff_t dst_stride,
1180                                const int16_t* filter_x,
1181                                int x_step_q4,
1182                                const int16_t* filter_y,
1183                                int y_step_q4,
1184                                int w,
1185                                int h,
1186                                int bps);
1187 #define av1_highbd_convolve_avg av1_highbd_convolve_avg_c
1188 
1189 void av1_highbd_convolve_copy_c(const uint8_t* src,
1190                                 ptrdiff_t src_stride,
1191                                 uint8_t* dst,
1192                                 ptrdiff_t dst_stride,
1193                                 const int16_t* filter_x,
1194                                 int x_step_q4,
1195                                 const int16_t* filter_y,
1196                                 int y_step_q4,
1197                                 int w,
1198                                 int h,
1199                                 int bps);
1200 #define av1_highbd_convolve_copy av1_highbd_convolve_copy_c
1201 
1202 void av1_highbd_convolve_horiz_rs_c(const uint16_t* src,
1203                                     int src_stride,
1204                                     uint16_t* dst,
1205                                     int dst_stride,
1206                                     int w,
1207                                     int h,
1208                                     const int16_t* x_filters,
1209                                     int x0_qn,
1210                                     int x_step_qn,
1211                                     int bd);
1212 #define av1_highbd_convolve_horiz_rs av1_highbd_convolve_horiz_rs_c
1213 
1214 void av1_highbd_convolve_x_sr_c(const uint16_t* src,
1215                                 int src_stride,
1216                                 uint16_t* dst,
1217                                 int dst_stride,
1218                                 int w,
1219                                 int h,
1220                                 const InterpFilterParams* filter_params_x,
1221                                 const int subpel_x_qn,
1222                                 ConvolveParams* conv_params,
1223                                 int bd);
1224 #define av1_highbd_convolve_x_sr av1_highbd_convolve_x_sr_c
1225 
1226 void av1_highbd_convolve_y_sr_c(const uint16_t* src,
1227                                 int src_stride,
1228                                 uint16_t* dst,
1229                                 int dst_stride,
1230                                 int w,
1231                                 int h,
1232                                 const InterpFilterParams* filter_params_y,
1233                                 const int subpel_y_qn,
1234                                 int bd);
1235 #define av1_highbd_convolve_y_sr av1_highbd_convolve_y_sr_c
1236 
1237 void av1_highbd_dist_wtd_convolve_2d_c(
1238     const uint16_t* src,
1239     int src_stride,
1240     uint16_t* dst,
1241     int dst_stride,
1242     int w,
1243     int h,
1244     const InterpFilterParams* filter_params_x,
1245     const InterpFilterParams* filter_params_y,
1246     const int subpel_x_qn,
1247     const int subpel_y_qn,
1248     ConvolveParams* conv_params,
1249     int bd);
1250 #define av1_highbd_dist_wtd_convolve_2d av1_highbd_dist_wtd_convolve_2d_c
1251 
1252 void av1_highbd_dist_wtd_convolve_2d_copy_c(const uint16_t* src,
1253                                             int src_stride,
1254                                             uint16_t* dst,
1255                                             int dst_stride,
1256                                             int w,
1257                                             int h,
1258                                             ConvolveParams* conv_params,
1259                                             int bd);
1260 #define av1_highbd_dist_wtd_convolve_2d_copy \
1261   av1_highbd_dist_wtd_convolve_2d_copy_c
1262 
1263 void av1_highbd_dist_wtd_convolve_x_c(const uint16_t* src,
1264                                       int src_stride,
1265                                       uint16_t* dst,
1266                                       int dst_stride,
1267                                       int w,
1268                                       int h,
1269                                       const InterpFilterParams* filter_params_x,
1270                                       const int subpel_x_qn,
1271                                       ConvolveParams* conv_params,
1272                                       int bd);
1273 #define av1_highbd_dist_wtd_convolve_x av1_highbd_dist_wtd_convolve_x_c
1274 
1275 void av1_highbd_dist_wtd_convolve_y_c(const uint16_t* src,
1276                                       int src_stride,
1277                                       uint16_t* dst,
1278                                       int dst_stride,
1279                                       int w,
1280                                       int h,
1281                                       const InterpFilterParams* filter_params_y,
1282                                       const int subpel_y_qn,
1283                                       ConvolveParams* conv_params,
1284                                       int bd);
1285 #define av1_highbd_dist_wtd_convolve_y av1_highbd_dist_wtd_convolve_y_c
1286 
1287 void av1_highbd_dr_prediction_z1_c(uint16_t* dst,
1288                                    ptrdiff_t stride,
1289                                    int bw,
1290                                    int bh,
1291                                    const uint16_t* above,
1292                                    const uint16_t* left,
1293                                    int upsample_above,
1294                                    int dx,
1295                                    int dy,
1296                                    int bd);
1297 #define av1_highbd_dr_prediction_z1 av1_highbd_dr_prediction_z1_c
1298 
1299 void av1_highbd_dr_prediction_z2_c(uint16_t* dst,
1300                                    ptrdiff_t stride,
1301                                    int bw,
1302                                    int bh,
1303                                    const uint16_t* above,
1304                                    const uint16_t* left,
1305                                    int upsample_above,
1306                                    int upsample_left,
1307                                    int dx,
1308                                    int dy,
1309                                    int bd);
1310 #define av1_highbd_dr_prediction_z2 av1_highbd_dr_prediction_z2_c
1311 
1312 void av1_highbd_dr_prediction_z3_c(uint16_t* dst,
1313                                    ptrdiff_t stride,
1314                                    int bw,
1315                                    int bh,
1316                                    const uint16_t* above,
1317                                    const uint16_t* left,
1318                                    int upsample_left,
1319                                    int dx,
1320                                    int dy,
1321                                    int bd);
1322 #define av1_highbd_dr_prediction_z3 av1_highbd_dr_prediction_z3_c
1323 
1324 void av1_highbd_fwht4x4_c(const int16_t* input, tran_low_t* output, int stride);
1325 void av1_highbd_fwht4x4_neon(const int16_t* input,
1326                              tran_low_t* output,
1327                              int stride);
1328 RTCD_EXTERN void (*av1_highbd_fwht4x4)(const int16_t* input,
1329                                        tran_low_t* output,
1330                                        int stride);
1331 
1332 void av1_highbd_inv_txfm_add_c(const tran_low_t* input,
1333                                uint8_t* dest,
1334                                int stride,
1335                                const TxfmParam* txfm_param);
1336 void av1_highbd_inv_txfm_add_neon(const tran_low_t* input,
1337                                   uint8_t* dest,
1338                                   int stride,
1339                                   const TxfmParam* txfm_param);
1340 RTCD_EXTERN void (*av1_highbd_inv_txfm_add)(const tran_low_t* input,
1341                                             uint8_t* dest,
1342                                             int stride,
1343                                             const TxfmParam* txfm_param);
1344 
1345 void av1_highbd_inv_txfm_add_16x32_c(const tran_low_t* input,
1346                                      uint8_t* dest,
1347                                      int stride,
1348                                      const TxfmParam* txfm_param);
1349 void av1_highbd_inv_txfm_add_16x32_neon(const tran_low_t* input,
1350                                         uint8_t* dest,
1351                                         int stride,
1352                                         const TxfmParam* txfm_param);
1353 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_16x32)(const tran_low_t* input,
1354                                                   uint8_t* dest,
1355                                                   int stride,
1356                                                   const TxfmParam* txfm_param);
1357 
1358 void av1_highbd_inv_txfm_add_16x4_c(const tran_low_t* input,
1359                                     uint8_t* dest,
1360                                     int stride,
1361                                     const TxfmParam* txfm_param);
1362 void av1_highbd_inv_txfm_add_16x4_neon(const tran_low_t* input,
1363                                        uint8_t* dest,
1364                                        int stride,
1365                                        const TxfmParam* txfm_param);
1366 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_16x4)(const tran_low_t* input,
1367                                                  uint8_t* dest,
1368                                                  int stride,
1369                                                  const TxfmParam* txfm_param);
1370 
1371 void av1_highbd_inv_txfm_add_16x64_c(const tran_low_t* input,
1372                                      uint8_t* dest,
1373                                      int stride,
1374                                      const TxfmParam* txfm_param);
1375 #define av1_highbd_inv_txfm_add_16x64 av1_highbd_inv_txfm_add_16x64_c
1376 
1377 void av1_highbd_inv_txfm_add_16x8_c(const tran_low_t* input,
1378                                     uint8_t* dest,
1379                                     int stride,
1380                                     const TxfmParam* txfm_param);
1381 void av1_highbd_inv_txfm_add_16x8_neon(const tran_low_t* input,
1382                                        uint8_t* dest,
1383                                        int stride,
1384                                        const TxfmParam* txfm_param);
1385 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_16x8)(const tran_low_t* input,
1386                                                  uint8_t* dest,
1387                                                  int stride,
1388                                                  const TxfmParam* txfm_param);
1389 
1390 void av1_highbd_inv_txfm_add_32x16_c(const tran_low_t* input,
1391                                      uint8_t* dest,
1392                                      int stride,
1393                                      const TxfmParam* txfm_param);
1394 void av1_highbd_inv_txfm_add_32x16_neon(const tran_low_t* input,
1395                                         uint8_t* dest,
1396                                         int stride,
1397                                         const TxfmParam* txfm_param);
1398 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_32x16)(const tran_low_t* input,
1399                                                   uint8_t* dest,
1400                                                   int stride,
1401                                                   const TxfmParam* txfm_param);
1402 
1403 void av1_highbd_inv_txfm_add_32x32_c(const tran_low_t* input,
1404                                      uint8_t* dest,
1405                                      int stride,
1406                                      const TxfmParam* txfm_param);
1407 void av1_highbd_inv_txfm_add_32x32_neon(const tran_low_t* input,
1408                                         uint8_t* dest,
1409                                         int stride,
1410                                         const TxfmParam* txfm_param);
1411 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_32x32)(const tran_low_t* input,
1412                                                   uint8_t* dest,
1413                                                   int stride,
1414                                                   const TxfmParam* txfm_param);
1415 
1416 void av1_highbd_inv_txfm_add_32x64_c(const tran_low_t* input,
1417                                      uint8_t* dest,
1418                                      int stride,
1419                                      const TxfmParam* txfm_param);
1420 void av1_highbd_inv_txfm_add_32x64_neon(const tran_low_t* input,
1421                                         uint8_t* dest,
1422                                         int stride,
1423                                         const TxfmParam* txfm_param);
1424 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_32x64)(const tran_low_t* input,
1425                                                   uint8_t* dest,
1426                                                   int stride,
1427                                                   const TxfmParam* txfm_param);
1428 
1429 void av1_highbd_inv_txfm_add_32x8_c(const tran_low_t* input,
1430                                     uint8_t* dest,
1431                                     int stride,
1432                                     const TxfmParam* txfm_param);
1433 #define av1_highbd_inv_txfm_add_32x8 av1_highbd_inv_txfm_add_32x8_c
1434 
1435 void av1_highbd_inv_txfm_add_4x16_c(const tran_low_t* input,
1436                                     uint8_t* dest,
1437                                     int stride,
1438                                     const TxfmParam* txfm_param);
1439 void av1_highbd_inv_txfm_add_4x16_neon(const tran_low_t* input,
1440                                        uint8_t* dest,
1441                                        int stride,
1442                                        const TxfmParam* txfm_param);
1443 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_4x16)(const tran_low_t* input,
1444                                                  uint8_t* dest,
1445                                                  int stride,
1446                                                  const TxfmParam* txfm_param);
1447 
1448 void av1_highbd_inv_txfm_add_4x4_c(const tran_low_t* input,
1449                                    uint8_t* dest,
1450                                    int stride,
1451                                    const TxfmParam* txfm_param);
1452 void av1_highbd_inv_txfm_add_4x4_neon(const tran_low_t* input,
1453                                       uint8_t* dest,
1454                                       int stride,
1455                                       const TxfmParam* txfm_param);
1456 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_4x4)(const tran_low_t* input,
1457                                                 uint8_t* dest,
1458                                                 int stride,
1459                                                 const TxfmParam* txfm_param);
1460 
1461 void av1_highbd_inv_txfm_add_4x8_c(const tran_low_t* input,
1462                                    uint8_t* dest,
1463                                    int stride,
1464                                    const TxfmParam* txfm_param);
1465 void av1_highbd_inv_txfm_add_4x8_neon(const tran_low_t* input,
1466                                       uint8_t* dest,
1467                                       int stride,
1468                                       const TxfmParam* txfm_param);
1469 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_4x8)(const tran_low_t* input,
1470                                                 uint8_t* dest,
1471                                                 int stride,
1472                                                 const TxfmParam* txfm_param);
1473 
1474 void av1_highbd_inv_txfm_add_64x16_c(const tran_low_t* input,
1475                                      uint8_t* dest,
1476                                      int stride,
1477                                      const TxfmParam* txfm_param);
1478 #define av1_highbd_inv_txfm_add_64x16 av1_highbd_inv_txfm_add_64x16_c
1479 
1480 void av1_highbd_inv_txfm_add_64x32_c(const tran_low_t* input,
1481                                      uint8_t* dest,
1482                                      int stride,
1483                                      const TxfmParam* txfm_param);
1484 void av1_highbd_inv_txfm_add_64x32_neon(const tran_low_t* input,
1485                                         uint8_t* dest,
1486                                         int stride,
1487                                         const TxfmParam* txfm_param);
1488 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_64x32)(const tran_low_t* input,
1489                                                   uint8_t* dest,
1490                                                   int stride,
1491                                                   const TxfmParam* txfm_param);
1492 
1493 void av1_highbd_inv_txfm_add_64x64_c(const tran_low_t* input,
1494                                      uint8_t* dest,
1495                                      int stride,
1496                                      const TxfmParam* txfm_param);
1497 void av1_highbd_inv_txfm_add_64x64_neon(const tran_low_t* input,
1498                                         uint8_t* dest,
1499                                         int stride,
1500                                         const TxfmParam* txfm_param);
1501 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_64x64)(const tran_low_t* input,
1502                                                   uint8_t* dest,
1503                                                   int stride,
1504                                                   const TxfmParam* txfm_param);
1505 
1506 void av1_highbd_inv_txfm_add_8x16_c(const tran_low_t* input,
1507                                     uint8_t* dest,
1508                                     int stride,
1509                                     const TxfmParam* txfm_param);
1510 void av1_highbd_inv_txfm_add_8x16_neon(const tran_low_t* input,
1511                                        uint8_t* dest,
1512                                        int stride,
1513                                        const TxfmParam* txfm_param);
1514 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_8x16)(const tran_low_t* input,
1515                                                  uint8_t* dest,
1516                                                  int stride,
1517                                                  const TxfmParam* txfm_param);
1518 
1519 void av1_highbd_inv_txfm_add_8x32_c(const tran_low_t* input,
1520                                     uint8_t* dest,
1521                                     int stride,
1522                                     const TxfmParam* txfm_param);
1523 #define av1_highbd_inv_txfm_add_8x32 av1_highbd_inv_txfm_add_8x32_c
1524 
1525 void av1_highbd_inv_txfm_add_8x4_c(const tran_low_t* input,
1526                                    uint8_t* dest,
1527                                    int stride,
1528                                    const TxfmParam* txfm_param);
1529 void av1_highbd_inv_txfm_add_8x4_neon(const tran_low_t* input,
1530                                       uint8_t* dest,
1531                                       int stride,
1532                                       const TxfmParam* txfm_param);
1533 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_8x4)(const tran_low_t* input,
1534                                                 uint8_t* dest,
1535                                                 int stride,
1536                                                 const TxfmParam* txfm_param);
1537 
1538 void av1_highbd_inv_txfm_add_8x8_c(const tran_low_t* input,
1539                                    uint8_t* dest,
1540                                    int stride,
1541                                    const TxfmParam* txfm_param);
1542 void av1_highbd_inv_txfm_add_8x8_neon(const tran_low_t* input,
1543                                       uint8_t* dest,
1544                                       int stride,
1545                                       const TxfmParam* txfm_param);
1546 RTCD_EXTERN void (*av1_highbd_inv_txfm_add_8x8)(const tran_low_t* input,
1547                                                 uint8_t* dest,
1548                                                 int stride,
1549                                                 const TxfmParam* txfm_param);
1550 
1551 void av1_highbd_iwht4x4_16_add_c(const tran_low_t* input,
1552                                  uint8_t* dest,
1553                                  int dest_stride,
1554                                  int bd);
1555 #define av1_highbd_iwht4x4_16_add av1_highbd_iwht4x4_16_add_c
1556 
1557 void av1_highbd_iwht4x4_1_add_c(const tran_low_t* input,
1558                                 uint8_t* dest,
1559                                 int dest_stride,
1560                                 int bd);
1561 #define av1_highbd_iwht4x4_1_add av1_highbd_iwht4x4_1_add_c
1562 
1563 int64_t av1_highbd_pixel_proj_error_c(const uint8_t* src8,
1564                                       int width,
1565                                       int height,
1566                                       int src_stride,
1567                                       const uint8_t* dat8,
1568                                       int dat_stride,
1569                                       int32_t* flt0,
1570                                       int flt0_stride,
1571                                       int32_t* flt1,
1572                                       int flt1_stride,
1573                                       int xq[2],
1574                                       const sgr_params_type* params);
1575 #define av1_highbd_pixel_proj_error av1_highbd_pixel_proj_error_c
1576 
1577 void av1_highbd_quantize_fp_c(const tran_low_t* coeff_ptr,
1578                               intptr_t n_coeffs,
1579                               const int16_t* zbin_ptr,
1580                               const int16_t* round_ptr,
1581                               const int16_t* quant_ptr,
1582                               const int16_t* quant_shift_ptr,
1583                               tran_low_t* qcoeff_ptr,
1584                               tran_low_t* dqcoeff_ptr,
1585                               const int16_t* dequant_ptr,
1586                               uint16_t* eob_ptr,
1587                               const int16_t* scan,
1588                               const int16_t* iscan,
1589                               int log_scale);
1590 #define av1_highbd_quantize_fp av1_highbd_quantize_fp_c
1591 
1592 void av1_highbd_warp_affine_c(const int32_t* mat,
1593                               const uint16_t* ref,
1594                               int width,
1595                               int height,
1596                               int stride,
1597                               uint16_t* pred,
1598                               int p_col,
1599                               int p_row,
1600                               int p_width,
1601                               int p_height,
1602                               int p_stride,
1603                               int subsampling_x,
1604                               int subsampling_y,
1605                               int bd,
1606                               ConvolveParams* conv_params,
1607                               int16_t alpha,
1608                               int16_t beta,
1609                               int16_t gamma,
1610                               int16_t delta);
1611 #define av1_highbd_warp_affine av1_highbd_warp_affine_c
1612 
1613 void av1_highbd_wiener_convolve_add_src_c(const uint8_t* src,
1614                                           ptrdiff_t src_stride,
1615                                           uint8_t* dst,
1616                                           ptrdiff_t dst_stride,
1617                                           const int16_t* filter_x,
1618                                           int x_step_q4,
1619                                           const int16_t* filter_y,
1620                                           int y_step_q4,
1621                                           int w,
1622                                           int h,
1623                                           const ConvolveParams* conv_params,
1624                                           int bd);
1625 #define av1_highbd_wiener_convolve_add_src av1_highbd_wiener_convolve_add_src_c
1626 
1627 void av1_inv_txfm2d_add_16x16_c(const int32_t* input,
1628                                 uint16_t* output,
1629                                 int stride,
1630                                 TX_TYPE tx_type,
1631                                 int bd);
1632 #define av1_inv_txfm2d_add_16x16 av1_inv_txfm2d_add_16x16_c
1633 
1634 void av1_inv_txfm2d_add_16x32_c(const int32_t* input,
1635                                 uint16_t* output,
1636                                 int stride,
1637                                 TX_TYPE tx_type,
1638                                 int bd);
1639 void av1_inv_txfm2d_add_16x32_neon(const int32_t* input,
1640                                    uint16_t* output,
1641                                    int stride,
1642                                    TX_TYPE tx_type,
1643                                    int bd);
1644 RTCD_EXTERN void (*av1_inv_txfm2d_add_16x32)(const int32_t* input,
1645                                              uint16_t* output,
1646                                              int stride,
1647                                              TX_TYPE tx_type,
1648                                              int bd);
1649 
1650 void av1_inv_txfm2d_add_16x4_c(const int32_t* input,
1651                                uint16_t* output,
1652                                int stride,
1653                                TX_TYPE tx_type,
1654                                int bd);
1655 void av1_inv_txfm2d_add_16x4_neon(const int32_t* input,
1656                                   uint16_t* output,
1657                                   int stride,
1658                                   TX_TYPE tx_type,
1659                                   int bd);
1660 RTCD_EXTERN void (*av1_inv_txfm2d_add_16x4)(const int32_t* input,
1661                                             uint16_t* output,
1662                                             int stride,
1663                                             TX_TYPE tx_type,
1664                                             int bd);
1665 
1666 void av1_inv_txfm2d_add_16x64_c(const int32_t* input,
1667                                 uint16_t* output,
1668                                 int stride,
1669                                 TX_TYPE tx_type,
1670                                 int bd);
1671 void av1_inv_txfm2d_add_16x64_neon(const int32_t* input,
1672                                    uint16_t* output,
1673                                    int stride,
1674                                    TX_TYPE tx_type,
1675                                    int bd);
1676 RTCD_EXTERN void (*av1_inv_txfm2d_add_16x64)(const int32_t* input,
1677                                              uint16_t* output,
1678                                              int stride,
1679                                              TX_TYPE tx_type,
1680                                              int bd);
1681 
1682 void av1_inv_txfm2d_add_16x8_c(const int32_t* input,
1683                                uint16_t* output,
1684                                int stride,
1685                                TX_TYPE tx_type,
1686                                int bd);
1687 void av1_inv_txfm2d_add_16x8_neon(const int32_t* input,
1688                                   uint16_t* output,
1689                                   int stride,
1690                                   TX_TYPE tx_type,
1691                                   int bd);
1692 RTCD_EXTERN void (*av1_inv_txfm2d_add_16x8)(const int32_t* input,
1693                                             uint16_t* output,
1694                                             int stride,
1695                                             TX_TYPE tx_type,
1696                                             int bd);
1697 
1698 void av1_inv_txfm2d_add_32x16_c(const int32_t* input,
1699                                 uint16_t* output,
1700                                 int stride,
1701                                 TX_TYPE tx_type,
1702                                 int bd);
1703 void av1_inv_txfm2d_add_32x16_neon(const int32_t* input,
1704                                    uint16_t* output,
1705                                    int stride,
1706                                    TX_TYPE tx_type,
1707                                    int bd);
1708 RTCD_EXTERN void (*av1_inv_txfm2d_add_32x16)(const int32_t* input,
1709                                              uint16_t* output,
1710                                              int stride,
1711                                              TX_TYPE tx_type,
1712                                              int bd);
1713 
1714 void av1_inv_txfm2d_add_32x32_c(const int32_t* input,
1715                                 uint16_t* output,
1716                                 int stride,
1717                                 TX_TYPE tx_type,
1718                                 int bd);
1719 void av1_inv_txfm2d_add_32x32_neon(const int32_t* input,
1720                                    uint16_t* output,
1721                                    int stride,
1722                                    TX_TYPE tx_type,
1723                                    int bd);
1724 RTCD_EXTERN void (*av1_inv_txfm2d_add_32x32)(const int32_t* input,
1725                                              uint16_t* output,
1726                                              int stride,
1727                                              TX_TYPE tx_type,
1728                                              int bd);
1729 
1730 void av1_inv_txfm2d_add_32x64_c(const int32_t* input,
1731                                 uint16_t* output,
1732                                 int stride,
1733                                 TX_TYPE tx_type,
1734                                 int bd);
1735 void av1_inv_txfm2d_add_32x64_neon(const int32_t* input,
1736                                    uint16_t* output,
1737                                    int stride,
1738                                    TX_TYPE tx_type,
1739                                    int bd);
1740 RTCD_EXTERN void (*av1_inv_txfm2d_add_32x64)(const int32_t* input,
1741                                              uint16_t* output,
1742                                              int stride,
1743                                              TX_TYPE tx_type,
1744                                              int bd);
1745 
1746 void av1_inv_txfm2d_add_32x8_c(const int32_t* input,
1747                                uint16_t* output,
1748                                int stride,
1749                                TX_TYPE tx_type,
1750                                int bd);
1751 void av1_inv_txfm2d_add_32x8_neon(const int32_t* input,
1752                                   uint16_t* output,
1753                                   int stride,
1754                                   TX_TYPE tx_type,
1755                                   int bd);
1756 RTCD_EXTERN void (*av1_inv_txfm2d_add_32x8)(const int32_t* input,
1757                                             uint16_t* output,
1758                                             int stride,
1759                                             TX_TYPE tx_type,
1760                                             int bd);
1761 
1762 void av1_inv_txfm2d_add_4x16_c(const int32_t* input,
1763                                uint16_t* output,
1764                                int stride,
1765                                TX_TYPE tx_type,
1766                                int bd);
1767 void av1_inv_txfm2d_add_4x16_neon(const int32_t* input,
1768                                   uint16_t* output,
1769                                   int stride,
1770                                   TX_TYPE tx_type,
1771                                   int bd);
1772 RTCD_EXTERN void (*av1_inv_txfm2d_add_4x16)(const int32_t* input,
1773                                             uint16_t* output,
1774                                             int stride,
1775                                             TX_TYPE tx_type,
1776                                             int bd);
1777 
1778 void av1_inv_txfm2d_add_4x4_c(const int32_t* input,
1779                               uint16_t* output,
1780                               int stride,
1781                               TX_TYPE tx_type,
1782                               int bd);
1783 void av1_inv_txfm2d_add_4x4_neon(const int32_t* input,
1784                                  uint16_t* output,
1785                                  int stride,
1786                                  TX_TYPE tx_type,
1787                                  int bd);
1788 RTCD_EXTERN void (*av1_inv_txfm2d_add_4x4)(const int32_t* input,
1789                                            uint16_t* output,
1790                                            int stride,
1791                                            TX_TYPE tx_type,
1792                                            int bd);
1793 
1794 void av1_inv_txfm2d_add_4x8_c(const int32_t* input,
1795                               uint16_t* output,
1796                               int stride,
1797                               TX_TYPE tx_type,
1798                               int bd);
1799 void av1_inv_txfm2d_add_4x8_neon(const int32_t* input,
1800                                  uint16_t* output,
1801                                  int stride,
1802                                  TX_TYPE tx_type,
1803                                  int bd);
1804 RTCD_EXTERN void (*av1_inv_txfm2d_add_4x8)(const int32_t* input,
1805                                            uint16_t* output,
1806                                            int stride,
1807                                            TX_TYPE tx_type,
1808                                            int bd);
1809 
1810 void av1_inv_txfm2d_add_64x16_c(const int32_t* input,
1811                                 uint16_t* output,
1812                                 int stride,
1813                                 TX_TYPE tx_type,
1814                                 int bd);
1815 void av1_inv_txfm2d_add_64x16_neon(const int32_t* input,
1816                                    uint16_t* output,
1817                                    int stride,
1818                                    TX_TYPE tx_type,
1819                                    int bd);
1820 RTCD_EXTERN void (*av1_inv_txfm2d_add_64x16)(const int32_t* input,
1821                                              uint16_t* output,
1822                                              int stride,
1823                                              TX_TYPE tx_type,
1824                                              int bd);
1825 
1826 void av1_inv_txfm2d_add_64x32_c(const int32_t* input,
1827                                 uint16_t* output,
1828                                 int stride,
1829                                 TX_TYPE tx_type,
1830                                 int bd);
1831 void av1_inv_txfm2d_add_64x32_neon(const int32_t* input,
1832                                    uint16_t* output,
1833                                    int stride,
1834                                    TX_TYPE tx_type,
1835                                    int bd);
1836 RTCD_EXTERN void (*av1_inv_txfm2d_add_64x32)(const int32_t* input,
1837                                              uint16_t* output,
1838                                              int stride,
1839                                              TX_TYPE tx_type,
1840                                              int bd);
1841 
1842 void av1_inv_txfm2d_add_64x64_c(const int32_t* input,
1843                                 uint16_t* output,
1844                                 int stride,
1845                                 TX_TYPE tx_type,
1846                                 int bd);
1847 void av1_inv_txfm2d_add_64x64_neon(const int32_t* input,
1848                                    uint16_t* output,
1849                                    int stride,
1850                                    TX_TYPE tx_type,
1851                                    int bd);
1852 RTCD_EXTERN void (*av1_inv_txfm2d_add_64x64)(const int32_t* input,
1853                                              uint16_t* output,
1854                                              int stride,
1855                                              TX_TYPE tx_type,
1856                                              int bd);
1857 
1858 void av1_inv_txfm2d_add_8x16_c(const int32_t* input,
1859                                uint16_t* output,
1860                                int stride,
1861                                TX_TYPE tx_type,
1862                                int bd);
1863 void av1_inv_txfm2d_add_8x16_neon(const int32_t* input,
1864                                   uint16_t* output,
1865                                   int stride,
1866                                   TX_TYPE tx_type,
1867                                   int bd);
1868 RTCD_EXTERN void (*av1_inv_txfm2d_add_8x16)(const int32_t* input,
1869                                             uint16_t* output,
1870                                             int stride,
1871                                             TX_TYPE tx_type,
1872                                             int bd);
1873 
1874 void av1_inv_txfm2d_add_8x32_c(const int32_t* input,
1875                                uint16_t* output,
1876                                int stride,
1877                                TX_TYPE tx_type,
1878                                int bd);
1879 void av1_inv_txfm2d_add_8x32_neon(const int32_t* input,
1880                                   uint16_t* output,
1881                                   int stride,
1882                                   TX_TYPE tx_type,
1883                                   int bd);
1884 RTCD_EXTERN void (*av1_inv_txfm2d_add_8x32)(const int32_t* input,
1885                                             uint16_t* output,
1886                                             int stride,
1887                                             TX_TYPE tx_type,
1888                                             int bd);
1889 
1890 void av1_inv_txfm2d_add_8x4_c(const int32_t* input,
1891                               uint16_t* output,
1892                               int stride,
1893                               TX_TYPE tx_type,
1894                               int bd);
1895 void av1_inv_txfm2d_add_8x4_neon(const int32_t* input,
1896                                  uint16_t* output,
1897                                  int stride,
1898                                  TX_TYPE tx_type,
1899                                  int bd);
1900 RTCD_EXTERN void (*av1_inv_txfm2d_add_8x4)(const int32_t* input,
1901                                            uint16_t* output,
1902                                            int stride,
1903                                            TX_TYPE tx_type,
1904                                            int bd);
1905 
1906 void av1_inv_txfm2d_add_8x8_c(const int32_t* input,
1907                               uint16_t* output,
1908                               int stride,
1909                               TX_TYPE tx_type,
1910                               int bd);
1911 void av1_inv_txfm2d_add_8x8_neon(const int32_t* input,
1912                                  uint16_t* output,
1913                                  int stride,
1914                                  TX_TYPE tx_type,
1915                                  int bd);
1916 RTCD_EXTERN void (*av1_inv_txfm2d_add_8x8)(const int32_t* input,
1917                                            uint16_t* output,
1918                                            int stride,
1919                                            TX_TYPE tx_type,
1920                                            int bd);
1921 
1922 void av1_inv_txfm_add_c(const tran_low_t* dqcoeff,
1923                         uint8_t* dst,
1924                         int stride,
1925                         const TxfmParam* txfm_param);
1926 void av1_inv_txfm_add_neon(const tran_low_t* dqcoeff,
1927                            uint8_t* dst,
1928                            int stride,
1929                            const TxfmParam* txfm_param);
1930 RTCD_EXTERN void (*av1_inv_txfm_add)(const tran_low_t* dqcoeff,
1931                                      uint8_t* dst,
1932                                      int stride,
1933                                      const TxfmParam* txfm_param);
1934 
1935 void av1_lowbd_fwd_txfm_c(const int16_t* src_diff,
1936                           tran_low_t* coeff,
1937                           int diff_stride,
1938                           TxfmParam* txfm_param);
1939 void av1_lowbd_fwd_txfm_neon(const int16_t* src_diff,
1940                              tran_low_t* coeff,
1941                              int diff_stride,
1942                              TxfmParam* txfm_param);
1943 RTCD_EXTERN void (*av1_lowbd_fwd_txfm)(const int16_t* src_diff,
1944                                        tran_low_t* coeff,
1945                                        int diff_stride,
1946                                        TxfmParam* txfm_param);
1947 
1948 int64_t av1_lowbd_pixel_proj_error_c(const uint8_t* src8,
1949                                      int width,
1950                                      int height,
1951                                      int src_stride,
1952                                      const uint8_t* dat8,
1953                                      int dat_stride,
1954                                      int32_t* flt0,
1955                                      int flt0_stride,
1956                                      int32_t* flt1,
1957                                      int flt1_stride,
1958                                      int xq[2],
1959                                      const sgr_params_type* params);
1960 int64_t av1_lowbd_pixel_proj_error_neon(const uint8_t* src8,
1961                                         int width,
1962                                         int height,
1963                                         int src_stride,
1964                                         const uint8_t* dat8,
1965                                         int dat_stride,
1966                                         int32_t* flt0,
1967                                         int flt0_stride,
1968                                         int32_t* flt1,
1969                                         int flt1_stride,
1970                                         int xq[2],
1971                                         const sgr_params_type* params);
1972 RTCD_EXTERN int64_t (*av1_lowbd_pixel_proj_error)(
1973     const uint8_t* src8,
1974     int width,
1975     int height,
1976     int src_stride,
1977     const uint8_t* dat8,
1978     int dat_stride,
1979     int32_t* flt0,
1980     int flt0_stride,
1981     int32_t* flt1,
1982     int flt1_stride,
1983     int xq[2],
1984     const sgr_params_type* params);
1985 
1986 void av1_nn_predict_c(const float* input_nodes,
1987                       const NN_CONFIG* const nn_config,
1988                       int reduce_prec,
1989                       float* const output);
1990 void av1_nn_predict_neon(const float* input_nodes,
1991                          const NN_CONFIG* const nn_config,
1992                          int reduce_prec,
1993                          float* const output);
1994 RTCD_EXTERN void (*av1_nn_predict)(const float* input_nodes,
1995                                    const NN_CONFIG* const nn_config,
1996                                    int reduce_prec,
1997                                    float* const output);
1998 
1999 void av1_quantize_b_c(const tran_low_t* coeff_ptr,
2000                       intptr_t n_coeffs,
2001                       const int16_t* zbin_ptr,
2002                       const int16_t* round_ptr,
2003                       const int16_t* quant_ptr,
2004                       const int16_t* quant_shift_ptr,
2005                       tran_low_t* qcoeff_ptr,
2006                       tran_low_t* dqcoeff_ptr,
2007                       const int16_t* dequant_ptr,
2008                       uint16_t* eob_ptr,
2009                       const int16_t* scan,
2010                       const int16_t* iscan,
2011                       const qm_val_t* qm_ptr,
2012                       const qm_val_t* iqm_ptr,
2013                       int log_scale);
2014 #define av1_quantize_b av1_quantize_b_c
2015 
2016 void av1_quantize_fp_c(const tran_low_t* coeff_ptr,
2017                        intptr_t n_coeffs,
2018                        const int16_t* zbin_ptr,
2019                        const int16_t* round_ptr,
2020                        const int16_t* quant_ptr,
2021                        const int16_t* quant_shift_ptr,
2022                        tran_low_t* qcoeff_ptr,
2023                        tran_low_t* dqcoeff_ptr,
2024                        const int16_t* dequant_ptr,
2025                        uint16_t* eob_ptr,
2026                        const int16_t* scan,
2027                        const int16_t* iscan);
2028 void av1_quantize_fp_neon(const tran_low_t* coeff_ptr,
2029                           intptr_t n_coeffs,
2030                           const int16_t* zbin_ptr,
2031                           const int16_t* round_ptr,
2032                           const int16_t* quant_ptr,
2033                           const int16_t* quant_shift_ptr,
2034                           tran_low_t* qcoeff_ptr,
2035                           tran_low_t* dqcoeff_ptr,
2036                           const int16_t* dequant_ptr,
2037                           uint16_t* eob_ptr,
2038                           const int16_t* scan,
2039                           const int16_t* iscan);
2040 RTCD_EXTERN void (*av1_quantize_fp)(const tran_low_t* coeff_ptr,
2041                                     intptr_t n_coeffs,
2042                                     const int16_t* zbin_ptr,
2043                                     const int16_t* round_ptr,
2044                                     const int16_t* quant_ptr,
2045                                     const int16_t* quant_shift_ptr,
2046                                     tran_low_t* qcoeff_ptr,
2047                                     tran_low_t* dqcoeff_ptr,
2048                                     const int16_t* dequant_ptr,
2049                                     uint16_t* eob_ptr,
2050                                     const int16_t* scan,
2051                                     const int16_t* iscan);
2052 
2053 void av1_quantize_fp_32x32_c(const tran_low_t* coeff_ptr,
2054                              intptr_t n_coeffs,
2055                              const int16_t* zbin_ptr,
2056                              const int16_t* round_ptr,
2057                              const int16_t* quant_ptr,
2058                              const int16_t* quant_shift_ptr,
2059                              tran_low_t* qcoeff_ptr,
2060                              tran_low_t* dqcoeff_ptr,
2061                              const int16_t* dequant_ptr,
2062                              uint16_t* eob_ptr,
2063                              const int16_t* scan,
2064                              const int16_t* iscan);
2065 void av1_quantize_fp_32x32_neon(const tran_low_t* coeff_ptr,
2066                                 intptr_t n_coeffs,
2067                                 const int16_t* zbin_ptr,
2068                                 const int16_t* round_ptr,
2069                                 const int16_t* quant_ptr,
2070                                 const int16_t* quant_shift_ptr,
2071                                 tran_low_t* qcoeff_ptr,
2072                                 tran_low_t* dqcoeff_ptr,
2073                                 const int16_t* dequant_ptr,
2074                                 uint16_t* eob_ptr,
2075                                 const int16_t* scan,
2076                                 const int16_t* iscan);
2077 RTCD_EXTERN void (*av1_quantize_fp_32x32)(const tran_low_t* coeff_ptr,
2078                                           intptr_t n_coeffs,
2079                                           const int16_t* zbin_ptr,
2080                                           const int16_t* round_ptr,
2081                                           const int16_t* quant_ptr,
2082                                           const int16_t* quant_shift_ptr,
2083                                           tran_low_t* qcoeff_ptr,
2084                                           tran_low_t* dqcoeff_ptr,
2085                                           const int16_t* dequant_ptr,
2086                                           uint16_t* eob_ptr,
2087                                           const int16_t* scan,
2088                                           const int16_t* iscan);
2089 
2090 void av1_quantize_fp_64x64_c(const tran_low_t* coeff_ptr,
2091                              intptr_t n_coeffs,
2092                              const int16_t* zbin_ptr,
2093                              const int16_t* round_ptr,
2094                              const int16_t* quant_ptr,
2095                              const int16_t* quant_shift_ptr,
2096                              tran_low_t* qcoeff_ptr,
2097                              tran_low_t* dqcoeff_ptr,
2098                              const int16_t* dequant_ptr,
2099                              uint16_t* eob_ptr,
2100                              const int16_t* scan,
2101                              const int16_t* iscan);
2102 void av1_quantize_fp_64x64_neon(const tran_low_t* coeff_ptr,
2103                                 intptr_t n_coeffs,
2104                                 const int16_t* zbin_ptr,
2105                                 const int16_t* round_ptr,
2106                                 const int16_t* quant_ptr,
2107                                 const int16_t* quant_shift_ptr,
2108                                 tran_low_t* qcoeff_ptr,
2109                                 tran_low_t* dqcoeff_ptr,
2110                                 const int16_t* dequant_ptr,
2111                                 uint16_t* eob_ptr,
2112                                 const int16_t* scan,
2113                                 const int16_t* iscan);
2114 RTCD_EXTERN void (*av1_quantize_fp_64x64)(const tran_low_t* coeff_ptr,
2115                                           intptr_t n_coeffs,
2116                                           const int16_t* zbin_ptr,
2117                                           const int16_t* round_ptr,
2118                                           const int16_t* quant_ptr,
2119                                           const int16_t* quant_shift_ptr,
2120                                           tran_low_t* qcoeff_ptr,
2121                                           tran_low_t* dqcoeff_ptr,
2122                                           const int16_t* dequant_ptr,
2123                                           uint16_t* eob_ptr,
2124                                           const int16_t* scan,
2125                                           const int16_t* iscan);
2126 
2127 void av1_quantize_lp_c(const int16_t* coeff_ptr,
2128                        intptr_t n_coeffs,
2129                        const int16_t* round_ptr,
2130                        const int16_t* quant_ptr,
2131                        int16_t* qcoeff_ptr,
2132                        int16_t* dqcoeff_ptr,
2133                        const int16_t* dequant_ptr,
2134                        uint16_t* eob_ptr,
2135                        const int16_t* scan);
2136 void av1_quantize_lp_neon(const int16_t* coeff_ptr,
2137                           intptr_t n_coeffs,
2138                           const int16_t* round_ptr,
2139                           const int16_t* quant_ptr,
2140                           int16_t* qcoeff_ptr,
2141                           int16_t* dqcoeff_ptr,
2142                           const int16_t* dequant_ptr,
2143                           uint16_t* eob_ptr,
2144                           const int16_t* scan);
2145 RTCD_EXTERN void (*av1_quantize_lp)(const int16_t* coeff_ptr,
2146                                     intptr_t n_coeffs,
2147                                     const int16_t* round_ptr,
2148                                     const int16_t* quant_ptr,
2149                                     int16_t* qcoeff_ptr,
2150                                     int16_t* dqcoeff_ptr,
2151                                     const int16_t* dequant_ptr,
2152                                     uint16_t* eob_ptr,
2153                                     const int16_t* scan);
2154 
2155 void av1_resize_and_extend_frame_c(const YV12_BUFFER_CONFIG* src,
2156                                    YV12_BUFFER_CONFIG* dst,
2157                                    const InterpFilter filter,
2158                                    const int phase,
2159                                    const int num_planes);
2160 void av1_resize_and_extend_frame_neon(const YV12_BUFFER_CONFIG* src,
2161                                       YV12_BUFFER_CONFIG* dst,
2162                                       const InterpFilter filter,
2163                                       const int phase,
2164                                       const int num_planes);
2165 RTCD_EXTERN void (*av1_resize_and_extend_frame)(const YV12_BUFFER_CONFIG* src,
2166                                                 YV12_BUFFER_CONFIG* dst,
2167                                                 const InterpFilter filter,
2168                                                 const int phase,
2169                                                 const int num_planes);
2170 
2171 void av1_round_shift_array_c(int32_t* arr, int size, int bit);
2172 void av1_round_shift_array_neon(int32_t* arr, int size, int bit);
2173 RTCD_EXTERN void (*av1_round_shift_array)(int32_t* arr, int size, int bit);
2174 
2175 int av1_selfguided_restoration_c(const uint8_t* dgd8,
2176                                  int width,
2177                                  int height,
2178                                  int dgd_stride,
2179                                  int32_t* flt0,
2180                                  int32_t* flt1,
2181                                  int flt_stride,
2182                                  int sgr_params_idx,
2183                                  int bit_depth,
2184                                  int highbd);
2185 int av1_selfguided_restoration_neon(const uint8_t* dgd8,
2186                                     int width,
2187                                     int height,
2188                                     int dgd_stride,
2189                                     int32_t* flt0,
2190                                     int32_t* flt1,
2191                                     int flt_stride,
2192                                     int sgr_params_idx,
2193                                     int bit_depth,
2194                                     int highbd);
2195 RTCD_EXTERN int (*av1_selfguided_restoration)(const uint8_t* dgd8,
2196                                               int width,
2197                                               int height,
2198                                               int dgd_stride,
2199                                               int32_t* flt0,
2200                                               int32_t* flt1,
2201                                               int flt_stride,
2202                                               int sgr_params_idx,
2203                                               int bit_depth,
2204                                               int highbd);
2205 
2206 void av1_txb_init_levels_c(const tran_low_t* const coeff,
2207                            const int width,
2208                            const int height,
2209                            uint8_t* const levels);
2210 void av1_txb_init_levels_neon(const tran_low_t* const coeff,
2211                               const int width,
2212                               const int height,
2213                               uint8_t* const levels);
2214 RTCD_EXTERN void (*av1_txb_init_levels)(const tran_low_t* const coeff,
2215                                         const int width,
2216                                         const int height,
2217                                         uint8_t* const levels);
2218 
2219 void av1_upsample_intra_edge_c(uint8_t* p, int sz);
2220 #define av1_upsample_intra_edge av1_upsample_intra_edge_c
2221 
2222 void av1_upsample_intra_edge_high_c(uint16_t* p, int sz, int bd);
2223 #define av1_upsample_intra_edge_high av1_upsample_intra_edge_high_c
2224 
2225 void av1_warp_affine_c(const int32_t* mat,
2226                        const uint8_t* ref,
2227                        int width,
2228                        int height,
2229                        int stride,
2230                        uint8_t* pred,
2231                        int p_col,
2232                        int p_row,
2233                        int p_width,
2234                        int p_height,
2235                        int p_stride,
2236                        int subsampling_x,
2237                        int subsampling_y,
2238                        ConvolveParams* conv_params,
2239                        int16_t alpha,
2240                        int16_t beta,
2241                        int16_t gamma,
2242                        int16_t delta);
2243 void av1_warp_affine_neon(const int32_t* mat,
2244                           const uint8_t* ref,
2245                           int width,
2246                           int height,
2247                           int stride,
2248                           uint8_t* pred,
2249                           int p_col,
2250                           int p_row,
2251                           int p_width,
2252                           int p_height,
2253                           int p_stride,
2254                           int subsampling_x,
2255                           int subsampling_y,
2256                           ConvolveParams* conv_params,
2257                           int16_t alpha,
2258                           int16_t beta,
2259                           int16_t gamma,
2260                           int16_t delta);
2261 RTCD_EXTERN void (*av1_warp_affine)(const int32_t* mat,
2262                                     const uint8_t* ref,
2263                                     int width,
2264                                     int height,
2265                                     int stride,
2266                                     uint8_t* pred,
2267                                     int p_col,
2268                                     int p_row,
2269                                     int p_width,
2270                                     int p_height,
2271                                     int p_stride,
2272                                     int subsampling_x,
2273                                     int subsampling_y,
2274                                     ConvolveParams* conv_params,
2275                                     int16_t alpha,
2276                                     int16_t beta,
2277                                     int16_t gamma,
2278                                     int16_t delta);
2279 
2280 void av1_wedge_compute_delta_squares_c(int16_t* d,
2281                                        const int16_t* a,
2282                                        const int16_t* b,
2283                                        int N);
2284 #define av1_wedge_compute_delta_squares av1_wedge_compute_delta_squares_c
2285 
2286 int8_t av1_wedge_sign_from_residuals_c(const int16_t* ds,
2287                                        const uint8_t* m,
2288                                        int N,
2289                                        int64_t limit);
2290 #define av1_wedge_sign_from_residuals av1_wedge_sign_from_residuals_c
2291 
2292 uint64_t av1_wedge_sse_from_residuals_c(const int16_t* r1,
2293                                         const int16_t* d,
2294                                         const uint8_t* m,
2295                                         int N);
2296 #define av1_wedge_sse_from_residuals av1_wedge_sse_from_residuals_c
2297 
2298 void av1_wiener_convolve_add_src_c(const uint8_t* src,
2299                                    ptrdiff_t src_stride,
2300                                    uint8_t* dst,
2301                                    ptrdiff_t dst_stride,
2302                                    const int16_t* filter_x,
2303                                    int x_step_q4,
2304                                    const int16_t* filter_y,
2305                                    int y_step_q4,
2306                                    int w,
2307                                    int h,
2308                                    const ConvolveParams* conv_params);
2309 void av1_wiener_convolve_add_src_neon(const uint8_t* src,
2310                                       ptrdiff_t src_stride,
2311                                       uint8_t* dst,
2312                                       ptrdiff_t dst_stride,
2313                                       const int16_t* filter_x,
2314                                       int x_step_q4,
2315                                       const int16_t* filter_y,
2316                                       int y_step_q4,
2317                                       int w,
2318                                       int h,
2319                                       const ConvolveParams* conv_params);
2320 RTCD_EXTERN void (*av1_wiener_convolve_add_src)(
2321     const uint8_t* src,
2322     ptrdiff_t src_stride,
2323     uint8_t* dst,
2324     ptrdiff_t dst_stride,
2325     const int16_t* filter_x,
2326     int x_step_q4,
2327     const int16_t* filter_y,
2328     int y_step_q4,
2329     int w,
2330     int h,
2331     const ConvolveParams* conv_params);
2332 
2333 void cdef_copy_rect8_16bit_to_16bit_c(uint16_t* dst,
2334                                       int dstride,
2335                                       const uint16_t* src,
2336                                       int sstride,
2337                                       int v,
2338                                       int h);
2339 void cdef_copy_rect8_16bit_to_16bit_neon(uint16_t* dst,
2340                                          int dstride,
2341                                          const uint16_t* src,
2342                                          int sstride,
2343                                          int v,
2344                                          int h);
2345 RTCD_EXTERN void (*cdef_copy_rect8_16bit_to_16bit)(uint16_t* dst,
2346                                                    int dstride,
2347                                                    const uint16_t* src,
2348                                                    int sstride,
2349                                                    int v,
2350                                                    int h);
2351 
2352 void cdef_copy_rect8_8bit_to_16bit_c(uint16_t* dst,
2353                                      int dstride,
2354                                      const uint8_t* src,
2355                                      int sstride,
2356                                      int v,
2357                                      int h);
2358 void cdef_copy_rect8_8bit_to_16bit_neon(uint16_t* dst,
2359                                         int dstride,
2360                                         const uint8_t* src,
2361                                         int sstride,
2362                                         int v,
2363                                         int h);
2364 RTCD_EXTERN void (*cdef_copy_rect8_8bit_to_16bit)(uint16_t* dst,
2365                                                   int dstride,
2366                                                   const uint8_t* src,
2367                                                   int sstride,
2368                                                   int v,
2369                                                   int h);
2370 
2371 void cdef_filter_block_c(uint8_t* dst8,
2372                          uint16_t* dst16,
2373                          int dstride,
2374                          const uint16_t* in,
2375                          int pri_strength,
2376                          int sec_strength,
2377                          int dir,
2378                          int pri_damping,
2379                          int sec_damping,
2380                          int bsize,
2381                          int coeff_shift);
2382 void cdef_filter_block_neon(uint8_t* dst8,
2383                             uint16_t* dst16,
2384                             int dstride,
2385                             const uint16_t* in,
2386                             int pri_strength,
2387                             int sec_strength,
2388                             int dir,
2389                             int pri_damping,
2390                             int sec_damping,
2391                             int bsize,
2392                             int coeff_shift);
2393 RTCD_EXTERN void (*cdef_filter_block)(uint8_t* dst8,
2394                                       uint16_t* dst16,
2395                                       int dstride,
2396                                       const uint16_t* in,
2397                                       int pri_strength,
2398                                       int sec_strength,
2399                                       int dir,
2400                                       int pri_damping,
2401                                       int sec_damping,
2402                                       int bsize,
2403                                       int coeff_shift);
2404 
2405 int cdef_find_dir_c(const uint16_t* img,
2406                     int stride,
2407                     int32_t* var,
2408                     int coeff_shift);
2409 int cdef_find_dir_neon(const uint16_t* img,
2410                        int stride,
2411                        int32_t* var,
2412                        int coeff_shift);
2413 RTCD_EXTERN int (*cdef_find_dir)(const uint16_t* img,
2414                                  int stride,
2415                                  int32_t* var,
2416                                  int coeff_shift);
2417 
2418 cfl_subsample_hbd_fn cfl_get_luma_subsampling_420_hbd_c(TX_SIZE tx_size);
2419 cfl_subsample_hbd_fn cfl_get_luma_subsampling_420_hbd_neon(TX_SIZE tx_size);
2420 RTCD_EXTERN cfl_subsample_hbd_fn (*cfl_get_luma_subsampling_420_hbd)(
2421     TX_SIZE tx_size);
2422 
2423 cfl_subsample_lbd_fn cfl_get_luma_subsampling_420_lbd_c(TX_SIZE tx_size);
2424 cfl_subsample_lbd_fn cfl_get_luma_subsampling_420_lbd_neon(TX_SIZE tx_size);
2425 RTCD_EXTERN cfl_subsample_lbd_fn (*cfl_get_luma_subsampling_420_lbd)(
2426     TX_SIZE tx_size);
2427 
2428 cfl_subsample_hbd_fn cfl_get_luma_subsampling_422_hbd_c(TX_SIZE tx_size);
2429 cfl_subsample_hbd_fn cfl_get_luma_subsampling_422_hbd_neon(TX_SIZE tx_size);
2430 RTCD_EXTERN cfl_subsample_hbd_fn (*cfl_get_luma_subsampling_422_hbd)(
2431     TX_SIZE tx_size);
2432 
2433 cfl_subsample_lbd_fn cfl_get_luma_subsampling_422_lbd_c(TX_SIZE tx_size);
2434 cfl_subsample_lbd_fn cfl_get_luma_subsampling_422_lbd_neon(TX_SIZE tx_size);
2435 RTCD_EXTERN cfl_subsample_lbd_fn (*cfl_get_luma_subsampling_422_lbd)(
2436     TX_SIZE tx_size);
2437 
2438 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_c(TX_SIZE tx_size);
2439 cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd_neon(TX_SIZE tx_size);
2440 RTCD_EXTERN cfl_subsample_hbd_fn (*cfl_get_luma_subsampling_444_hbd)(
2441     TX_SIZE tx_size);
2442 
2443 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_c(TX_SIZE tx_size);
2444 cfl_subsample_lbd_fn cfl_get_luma_subsampling_444_lbd_neon(TX_SIZE tx_size);
2445 RTCD_EXTERN cfl_subsample_lbd_fn (*cfl_get_luma_subsampling_444_lbd)(
2446     TX_SIZE tx_size);
2447 
2448 cfl_predict_hbd_fn cfl_get_predict_hbd_fn_c(TX_SIZE tx_size);
2449 cfl_predict_hbd_fn cfl_get_predict_hbd_fn_neon(TX_SIZE tx_size);
2450 RTCD_EXTERN cfl_predict_hbd_fn (*cfl_get_predict_hbd_fn)(TX_SIZE tx_size);
2451 
2452 cfl_predict_lbd_fn cfl_get_predict_lbd_fn_c(TX_SIZE tx_size);
2453 cfl_predict_lbd_fn cfl_get_predict_lbd_fn_neon(TX_SIZE tx_size);
2454 RTCD_EXTERN cfl_predict_lbd_fn (*cfl_get_predict_lbd_fn)(TX_SIZE tx_size);
2455 
2456 cfl_subtract_average_fn cfl_get_subtract_average_fn_c(TX_SIZE tx_size);
2457 cfl_subtract_average_fn cfl_get_subtract_average_fn_neon(TX_SIZE tx_size);
2458 RTCD_EXTERN cfl_subtract_average_fn (*cfl_get_subtract_average_fn)(
2459     TX_SIZE tx_size);
2460 
2461 void av1_rtcd(void);
2462 
2463 #include "config/aom_config.h"
2464 
2465 #ifdef RTCD_C
2466 #include "aom_ports/arm.h"
setup_rtcd_internal(void)2467 static void setup_rtcd_internal(void) {
2468   int flags = aom_arm_cpu_caps();
2469 
2470   (void)flags;
2471 
2472   aom_quantize_b_helper = aom_quantize_b_helper_c;
2473   if (flags & HAS_NEON)
2474     aom_quantize_b_helper = aom_quantize_b_helper_neon;
2475   av1_apply_selfguided_restoration = av1_apply_selfguided_restoration_c;
2476   if (flags & HAS_NEON)
2477     av1_apply_selfguided_restoration = av1_apply_selfguided_restoration_neon;
2478   av1_block_error = av1_block_error_c;
2479   if (flags & HAS_NEON)
2480     av1_block_error = av1_block_error_neon;
2481   av1_block_error_lp = av1_block_error_lp_c;
2482   if (flags & HAS_NEON)
2483     av1_block_error_lp = av1_block_error_lp_neon;
2484   av1_build_compound_diffwtd_mask_d16 = av1_build_compound_diffwtd_mask_d16_c;
2485   if (flags & HAS_NEON)
2486     av1_build_compound_diffwtd_mask_d16 =
2487         av1_build_compound_diffwtd_mask_d16_neon;
2488   av1_convolve_2d_sr = av1_convolve_2d_sr_c;
2489   if (flags & HAS_NEON)
2490     av1_convolve_2d_sr = av1_convolve_2d_sr_neon;
2491   av1_convolve_x_sr = av1_convolve_x_sr_c;
2492   if (flags & HAS_NEON)
2493     av1_convolve_x_sr = av1_convolve_x_sr_neon;
2494   av1_convolve_y_sr = av1_convolve_y_sr_c;
2495   if (flags & HAS_NEON)
2496     av1_convolve_y_sr = av1_convolve_y_sr_neon;
2497   av1_dist_wtd_convolve_2d = av1_dist_wtd_convolve_2d_c;
2498   if (flags & HAS_NEON)
2499     av1_dist_wtd_convolve_2d = av1_dist_wtd_convolve_2d_neon;
2500   av1_dist_wtd_convolve_2d_copy = av1_dist_wtd_convolve_2d_copy_c;
2501   if (flags & HAS_NEON)
2502     av1_dist_wtd_convolve_2d_copy = av1_dist_wtd_convolve_2d_copy_neon;
2503   av1_dist_wtd_convolve_x = av1_dist_wtd_convolve_x_c;
2504   if (flags & HAS_NEON)
2505     av1_dist_wtd_convolve_x = av1_dist_wtd_convolve_x_neon;
2506   av1_dist_wtd_convolve_y = av1_dist_wtd_convolve_y_c;
2507   if (flags & HAS_NEON)
2508     av1_dist_wtd_convolve_y = av1_dist_wtd_convolve_y_neon;
2509   av1_dr_prediction_z1 = av1_dr_prediction_z1_c;
2510   if (flags & HAS_NEON)
2511     av1_dr_prediction_z1 = av1_dr_prediction_z1_neon;
2512   av1_dr_prediction_z2 = av1_dr_prediction_z2_c;
2513   if (flags & HAS_NEON)
2514     av1_dr_prediction_z2 = av1_dr_prediction_z2_neon;
2515   av1_dr_prediction_z3 = av1_dr_prediction_z3_c;
2516   if (flags & HAS_NEON)
2517     av1_dr_prediction_z3 = av1_dr_prediction_z3_neon;
2518   av1_filter_intra_predictor = av1_filter_intra_predictor_c;
2519   if (flags & HAS_NEON)
2520     av1_filter_intra_predictor = av1_filter_intra_predictor_neon;
2521   av1_fwd_txfm2d_16x16 = av1_fwd_txfm2d_16x16_c;
2522   if (flags & HAS_NEON)
2523     av1_fwd_txfm2d_16x16 = av1_fwd_txfm2d_16x16_neon;
2524   av1_fwd_txfm2d_16x32 = av1_fwd_txfm2d_16x32_c;
2525   if (flags & HAS_NEON)
2526     av1_fwd_txfm2d_16x32 = av1_fwd_txfm2d_16x32_neon;
2527   av1_fwd_txfm2d_16x4 = av1_fwd_txfm2d_16x4_c;
2528   if (flags & HAS_NEON)
2529     av1_fwd_txfm2d_16x4 = av1_fwd_txfm2d_16x4_neon;
2530   av1_fwd_txfm2d_16x64 = av1_fwd_txfm2d_16x64_c;
2531   if (flags & HAS_NEON)
2532     av1_fwd_txfm2d_16x64 = av1_fwd_txfm2d_16x64_neon;
2533   av1_fwd_txfm2d_16x8 = av1_fwd_txfm2d_16x8_c;
2534   if (flags & HAS_NEON)
2535     av1_fwd_txfm2d_16x8 = av1_fwd_txfm2d_16x8_neon;
2536   av1_fwd_txfm2d_32x16 = av1_fwd_txfm2d_32x16_c;
2537   if (flags & HAS_NEON)
2538     av1_fwd_txfm2d_32x16 = av1_fwd_txfm2d_32x16_neon;
2539   av1_fwd_txfm2d_32x32 = av1_fwd_txfm2d_32x32_c;
2540   if (flags & HAS_NEON)
2541     av1_fwd_txfm2d_32x32 = av1_fwd_txfm2d_32x32_neon;
2542   av1_fwd_txfm2d_32x64 = av1_fwd_txfm2d_32x64_c;
2543   if (flags & HAS_NEON)
2544     av1_fwd_txfm2d_32x64 = av1_fwd_txfm2d_32x64_neon;
2545   av1_fwd_txfm2d_32x8 = av1_fwd_txfm2d_32x8_c;
2546   if (flags & HAS_NEON)
2547     av1_fwd_txfm2d_32x8 = av1_fwd_txfm2d_32x8_neon;
2548   av1_fwd_txfm2d_4x16 = av1_fwd_txfm2d_4x16_c;
2549   if (flags & HAS_NEON)
2550     av1_fwd_txfm2d_4x16 = av1_fwd_txfm2d_4x16_neon;
2551   av1_fwd_txfm2d_4x4 = av1_fwd_txfm2d_4x4_c;
2552   if (flags & HAS_NEON)
2553     av1_fwd_txfm2d_4x4 = av1_fwd_txfm2d_4x4_neon;
2554   av1_fwd_txfm2d_4x8 = av1_fwd_txfm2d_4x8_c;
2555   if (flags & HAS_NEON)
2556     av1_fwd_txfm2d_4x8 = av1_fwd_txfm2d_4x8_neon;
2557   av1_fwd_txfm2d_64x16 = av1_fwd_txfm2d_64x16_c;
2558   if (flags & HAS_NEON)
2559     av1_fwd_txfm2d_64x16 = av1_fwd_txfm2d_64x16_neon;
2560   av1_fwd_txfm2d_64x32 = av1_fwd_txfm2d_64x32_c;
2561   if (flags & HAS_NEON)
2562     av1_fwd_txfm2d_64x32 = av1_fwd_txfm2d_64x32_neon;
2563   av1_fwd_txfm2d_64x64 = av1_fwd_txfm2d_64x64_c;
2564   if (flags & HAS_NEON)
2565     av1_fwd_txfm2d_64x64 = av1_fwd_txfm2d_64x64_neon;
2566   av1_fwd_txfm2d_8x16 = av1_fwd_txfm2d_8x16_c;
2567   if (flags & HAS_NEON)
2568     av1_fwd_txfm2d_8x16 = av1_fwd_txfm2d_8x16_neon;
2569   av1_fwd_txfm2d_8x32 = av1_fwd_txfm2d_8x32_c;
2570   if (flags & HAS_NEON)
2571     av1_fwd_txfm2d_8x32 = av1_fwd_txfm2d_8x32_neon;
2572   av1_fwd_txfm2d_8x4 = av1_fwd_txfm2d_8x4_c;
2573   if (flags & HAS_NEON)
2574     av1_fwd_txfm2d_8x4 = av1_fwd_txfm2d_8x4_neon;
2575   av1_fwd_txfm2d_8x8 = av1_fwd_txfm2d_8x8_c;
2576   if (flags & HAS_NEON)
2577     av1_fwd_txfm2d_8x8 = av1_fwd_txfm2d_8x8_neon;
2578   av1_fwht4x4 = av1_fwht4x4_c;
2579   if (flags & HAS_NEON)
2580     av1_fwht4x4 = av1_fwht4x4_neon;
2581   av1_get_horver_correlation_full = av1_get_horver_correlation_full_c;
2582   if (flags & HAS_NEON)
2583     av1_get_horver_correlation_full = av1_get_horver_correlation_full_neon;
2584   av1_get_nz_map_contexts = av1_get_nz_map_contexts_c;
2585   if (flags & HAS_NEON)
2586     av1_get_nz_map_contexts = av1_get_nz_map_contexts_neon;
2587   av1_highbd_fwht4x4 = av1_highbd_fwht4x4_c;
2588   if (flags & HAS_NEON)
2589     av1_highbd_fwht4x4 = av1_highbd_fwht4x4_neon;
2590   av1_highbd_inv_txfm_add = av1_highbd_inv_txfm_add_c;
2591   if (flags & HAS_NEON)
2592     av1_highbd_inv_txfm_add = av1_highbd_inv_txfm_add_neon;
2593   av1_highbd_inv_txfm_add_16x32 = av1_highbd_inv_txfm_add_16x32_c;
2594   if (flags & HAS_NEON)
2595     av1_highbd_inv_txfm_add_16x32 = av1_highbd_inv_txfm_add_16x32_neon;
2596   av1_highbd_inv_txfm_add_16x4 = av1_highbd_inv_txfm_add_16x4_c;
2597   if (flags & HAS_NEON)
2598     av1_highbd_inv_txfm_add_16x4 = av1_highbd_inv_txfm_add_16x4_neon;
2599   av1_highbd_inv_txfm_add_16x8 = av1_highbd_inv_txfm_add_16x8_c;
2600   if (flags & HAS_NEON)
2601     av1_highbd_inv_txfm_add_16x8 = av1_highbd_inv_txfm_add_16x8_neon;
2602   av1_highbd_inv_txfm_add_32x16 = av1_highbd_inv_txfm_add_32x16_c;
2603   if (flags & HAS_NEON)
2604     av1_highbd_inv_txfm_add_32x16 = av1_highbd_inv_txfm_add_32x16_neon;
2605   av1_highbd_inv_txfm_add_32x32 = av1_highbd_inv_txfm_add_32x32_c;
2606   if (flags & HAS_NEON)
2607     av1_highbd_inv_txfm_add_32x32 = av1_highbd_inv_txfm_add_32x32_neon;
2608   av1_highbd_inv_txfm_add_32x64 = av1_highbd_inv_txfm_add_32x64_c;
2609   if (flags & HAS_NEON)
2610     av1_highbd_inv_txfm_add_32x64 = av1_highbd_inv_txfm_add_32x64_neon;
2611   av1_highbd_inv_txfm_add_4x16 = av1_highbd_inv_txfm_add_4x16_c;
2612   if (flags & HAS_NEON)
2613     av1_highbd_inv_txfm_add_4x16 = av1_highbd_inv_txfm_add_4x16_neon;
2614   av1_highbd_inv_txfm_add_4x4 = av1_highbd_inv_txfm_add_4x4_c;
2615   if (flags & HAS_NEON)
2616     av1_highbd_inv_txfm_add_4x4 = av1_highbd_inv_txfm_add_4x4_neon;
2617   av1_highbd_inv_txfm_add_4x8 = av1_highbd_inv_txfm_add_4x8_c;
2618   if (flags & HAS_NEON)
2619     av1_highbd_inv_txfm_add_4x8 = av1_highbd_inv_txfm_add_4x8_neon;
2620   av1_highbd_inv_txfm_add_64x32 = av1_highbd_inv_txfm_add_64x32_c;
2621   if (flags & HAS_NEON)
2622     av1_highbd_inv_txfm_add_64x32 = av1_highbd_inv_txfm_add_64x32_neon;
2623   av1_highbd_inv_txfm_add_64x64 = av1_highbd_inv_txfm_add_64x64_c;
2624   if (flags & HAS_NEON)
2625     av1_highbd_inv_txfm_add_64x64 = av1_highbd_inv_txfm_add_64x64_neon;
2626   av1_highbd_inv_txfm_add_8x16 = av1_highbd_inv_txfm_add_8x16_c;
2627   if (flags & HAS_NEON)
2628     av1_highbd_inv_txfm_add_8x16 = av1_highbd_inv_txfm_add_8x16_neon;
2629   av1_highbd_inv_txfm_add_8x4 = av1_highbd_inv_txfm_add_8x4_c;
2630   if (flags & HAS_NEON)
2631     av1_highbd_inv_txfm_add_8x4 = av1_highbd_inv_txfm_add_8x4_neon;
2632   av1_highbd_inv_txfm_add_8x8 = av1_highbd_inv_txfm_add_8x8_c;
2633   if (flags & HAS_NEON)
2634     av1_highbd_inv_txfm_add_8x8 = av1_highbd_inv_txfm_add_8x8_neon;
2635   av1_inv_txfm2d_add_16x32 = av1_inv_txfm2d_add_16x32_c;
2636   if (flags & HAS_NEON)
2637     av1_inv_txfm2d_add_16x32 = av1_inv_txfm2d_add_16x32_neon;
2638   av1_inv_txfm2d_add_16x4 = av1_inv_txfm2d_add_16x4_c;
2639   if (flags & HAS_NEON)
2640     av1_inv_txfm2d_add_16x4 = av1_inv_txfm2d_add_16x4_neon;
2641   av1_inv_txfm2d_add_16x64 = av1_inv_txfm2d_add_16x64_c;
2642   if (flags & HAS_NEON)
2643     av1_inv_txfm2d_add_16x64 = av1_inv_txfm2d_add_16x64_neon;
2644   av1_inv_txfm2d_add_16x8 = av1_inv_txfm2d_add_16x8_c;
2645   if (flags & HAS_NEON)
2646     av1_inv_txfm2d_add_16x8 = av1_inv_txfm2d_add_16x8_neon;
2647   av1_inv_txfm2d_add_32x16 = av1_inv_txfm2d_add_32x16_c;
2648   if (flags & HAS_NEON)
2649     av1_inv_txfm2d_add_32x16 = av1_inv_txfm2d_add_32x16_neon;
2650   av1_inv_txfm2d_add_32x32 = av1_inv_txfm2d_add_32x32_c;
2651   if (flags & HAS_NEON)
2652     av1_inv_txfm2d_add_32x32 = av1_inv_txfm2d_add_32x32_neon;
2653   av1_inv_txfm2d_add_32x64 = av1_inv_txfm2d_add_32x64_c;
2654   if (flags & HAS_NEON)
2655     av1_inv_txfm2d_add_32x64 = av1_inv_txfm2d_add_32x64_neon;
2656   av1_inv_txfm2d_add_32x8 = av1_inv_txfm2d_add_32x8_c;
2657   if (flags & HAS_NEON)
2658     av1_inv_txfm2d_add_32x8 = av1_inv_txfm2d_add_32x8_neon;
2659   av1_inv_txfm2d_add_4x16 = av1_inv_txfm2d_add_4x16_c;
2660   if (flags & HAS_NEON)
2661     av1_inv_txfm2d_add_4x16 = av1_inv_txfm2d_add_4x16_neon;
2662   av1_inv_txfm2d_add_4x4 = av1_inv_txfm2d_add_4x4_c;
2663   if (flags & HAS_NEON)
2664     av1_inv_txfm2d_add_4x4 = av1_inv_txfm2d_add_4x4_neon;
2665   av1_inv_txfm2d_add_4x8 = av1_inv_txfm2d_add_4x8_c;
2666   if (flags & HAS_NEON)
2667     av1_inv_txfm2d_add_4x8 = av1_inv_txfm2d_add_4x8_neon;
2668   av1_inv_txfm2d_add_64x16 = av1_inv_txfm2d_add_64x16_c;
2669   if (flags & HAS_NEON)
2670     av1_inv_txfm2d_add_64x16 = av1_inv_txfm2d_add_64x16_neon;
2671   av1_inv_txfm2d_add_64x32 = av1_inv_txfm2d_add_64x32_c;
2672   if (flags & HAS_NEON)
2673     av1_inv_txfm2d_add_64x32 = av1_inv_txfm2d_add_64x32_neon;
2674   av1_inv_txfm2d_add_64x64 = av1_inv_txfm2d_add_64x64_c;
2675   if (flags & HAS_NEON)
2676     av1_inv_txfm2d_add_64x64 = av1_inv_txfm2d_add_64x64_neon;
2677   av1_inv_txfm2d_add_8x16 = av1_inv_txfm2d_add_8x16_c;
2678   if (flags & HAS_NEON)
2679     av1_inv_txfm2d_add_8x16 = av1_inv_txfm2d_add_8x16_neon;
2680   av1_inv_txfm2d_add_8x32 = av1_inv_txfm2d_add_8x32_c;
2681   if (flags & HAS_NEON)
2682     av1_inv_txfm2d_add_8x32 = av1_inv_txfm2d_add_8x32_neon;
2683   av1_inv_txfm2d_add_8x4 = av1_inv_txfm2d_add_8x4_c;
2684   if (flags & HAS_NEON)
2685     av1_inv_txfm2d_add_8x4 = av1_inv_txfm2d_add_8x4_neon;
2686   av1_inv_txfm2d_add_8x8 = av1_inv_txfm2d_add_8x8_c;
2687   if (flags & HAS_NEON)
2688     av1_inv_txfm2d_add_8x8 = av1_inv_txfm2d_add_8x8_neon;
2689   av1_inv_txfm_add = av1_inv_txfm_add_c;
2690   if (flags & HAS_NEON)
2691     av1_inv_txfm_add = av1_inv_txfm_add_neon;
2692   av1_lowbd_fwd_txfm = av1_lowbd_fwd_txfm_c;
2693   if (flags & HAS_NEON)
2694     av1_lowbd_fwd_txfm = av1_lowbd_fwd_txfm_neon;
2695   av1_lowbd_pixel_proj_error = av1_lowbd_pixel_proj_error_c;
2696   if (flags & HAS_NEON)
2697     av1_lowbd_pixel_proj_error = av1_lowbd_pixel_proj_error_neon;
2698   av1_nn_predict = av1_nn_predict_c;
2699   if (flags & HAS_NEON)
2700     av1_nn_predict = av1_nn_predict_neon;
2701   av1_quantize_fp = av1_quantize_fp_c;
2702   if (flags & HAS_NEON)
2703     av1_quantize_fp = av1_quantize_fp_neon;
2704   av1_quantize_fp_32x32 = av1_quantize_fp_32x32_c;
2705   if (flags & HAS_NEON)
2706     av1_quantize_fp_32x32 = av1_quantize_fp_32x32_neon;
2707   av1_quantize_fp_64x64 = av1_quantize_fp_64x64_c;
2708   if (flags & HAS_NEON)
2709     av1_quantize_fp_64x64 = av1_quantize_fp_64x64_neon;
2710   av1_quantize_lp = av1_quantize_lp_c;
2711   if (flags & HAS_NEON)
2712     av1_quantize_lp = av1_quantize_lp_neon;
2713   av1_resize_and_extend_frame = av1_resize_and_extend_frame_c;
2714   if (flags & HAS_NEON)
2715     av1_resize_and_extend_frame = av1_resize_and_extend_frame_neon;
2716   av1_round_shift_array = av1_round_shift_array_c;
2717   if (flags & HAS_NEON)
2718     av1_round_shift_array = av1_round_shift_array_neon;
2719   av1_selfguided_restoration = av1_selfguided_restoration_c;
2720   if (flags & HAS_NEON)
2721     av1_selfguided_restoration = av1_selfguided_restoration_neon;
2722   av1_txb_init_levels = av1_txb_init_levels_c;
2723   if (flags & HAS_NEON)
2724     av1_txb_init_levels = av1_txb_init_levels_neon;
2725   av1_warp_affine = av1_warp_affine_c;
2726   if (flags & HAS_NEON)
2727     av1_warp_affine = av1_warp_affine_neon;
2728   av1_wiener_convolve_add_src = av1_wiener_convolve_add_src_c;
2729   if (flags & HAS_NEON)
2730     av1_wiener_convolve_add_src = av1_wiener_convolve_add_src_neon;
2731   cdef_copy_rect8_16bit_to_16bit = cdef_copy_rect8_16bit_to_16bit_c;
2732   if (flags & HAS_NEON)
2733     cdef_copy_rect8_16bit_to_16bit = cdef_copy_rect8_16bit_to_16bit_neon;
2734   cdef_copy_rect8_8bit_to_16bit = cdef_copy_rect8_8bit_to_16bit_c;
2735   if (flags & HAS_NEON)
2736     cdef_copy_rect8_8bit_to_16bit = cdef_copy_rect8_8bit_to_16bit_neon;
2737   cdef_filter_block = cdef_filter_block_c;
2738   if (flags & HAS_NEON)
2739     cdef_filter_block = cdef_filter_block_neon;
2740   cdef_find_dir = cdef_find_dir_c;
2741   if (flags & HAS_NEON)
2742     cdef_find_dir = cdef_find_dir_neon;
2743   cfl_get_luma_subsampling_420_hbd = cfl_get_luma_subsampling_420_hbd_c;
2744   if (flags & HAS_NEON)
2745     cfl_get_luma_subsampling_420_hbd = cfl_get_luma_subsampling_420_hbd_neon;
2746   cfl_get_luma_subsampling_420_lbd = cfl_get_luma_subsampling_420_lbd_c;
2747   if (flags & HAS_NEON)
2748     cfl_get_luma_subsampling_420_lbd = cfl_get_luma_subsampling_420_lbd_neon;
2749   cfl_get_luma_subsampling_422_hbd = cfl_get_luma_subsampling_422_hbd_c;
2750   if (flags & HAS_NEON)
2751     cfl_get_luma_subsampling_422_hbd = cfl_get_luma_subsampling_422_hbd_neon;
2752   cfl_get_luma_subsampling_422_lbd = cfl_get_luma_subsampling_422_lbd_c;
2753   if (flags & HAS_NEON)
2754     cfl_get_luma_subsampling_422_lbd = cfl_get_luma_subsampling_422_lbd_neon;
2755   cfl_get_luma_subsampling_444_hbd = cfl_get_luma_subsampling_444_hbd_c;
2756   if (flags & HAS_NEON)
2757     cfl_get_luma_subsampling_444_hbd = cfl_get_luma_subsampling_444_hbd_neon;
2758   cfl_get_luma_subsampling_444_lbd = cfl_get_luma_subsampling_444_lbd_c;
2759   if (flags & HAS_NEON)
2760     cfl_get_luma_subsampling_444_lbd = cfl_get_luma_subsampling_444_lbd_neon;
2761   cfl_get_predict_hbd_fn = cfl_get_predict_hbd_fn_c;
2762   if (flags & HAS_NEON)
2763     cfl_get_predict_hbd_fn = cfl_get_predict_hbd_fn_neon;
2764   cfl_get_predict_lbd_fn = cfl_get_predict_lbd_fn_c;
2765   if (flags & HAS_NEON)
2766     cfl_get_predict_lbd_fn = cfl_get_predict_lbd_fn_neon;
2767   cfl_get_subtract_average_fn = cfl_get_subtract_average_fn_c;
2768   if (flags & HAS_NEON)
2769     cfl_get_subtract_average_fn = cfl_get_subtract_average_fn_neon;
2770 }
2771 #endif
2772 
2773 #ifdef __cplusplus
2774 }  // extern "C"
2775 #endif
2776 
2777 #endif
2778