xref: /aosp_15_r20/external/libvpx/vp9/common/vp9_rtcd_defs.pl (revision fb1b10ab9aebc7c7068eedab379b749d7e3900be)
1##
2##  Copyright (c) 2017 The WebM project authors. All Rights Reserved.
3##
4##  Use of this source code is governed by a BSD-style license
5##  that can be found in the LICENSE file in the root of the source
6##  tree. An additional intellectual property rights grant can be found
7##  in the file PATENTS.  All contributing project authors may
8##  be found in the AUTHORS file in the root of the source tree.
9##
10
11sub vp9_common_forward_decls() {
12print <<EOF
13/*
14 * VP9
15 */
16
17#include "vpx/vpx_integer.h"
18#include "vp9/common/vp9_common.h"
19#include "vp9/common/vp9_enums.h"
20#include "vp9/common/vp9_filter.h"
21
22struct macroblockd;
23
24/* Encoder forward decls */
25struct macroblock;
26struct macroblock_plane;
27struct vp9_sad_table;
28struct ScanOrder;
29struct search_site_config;
30struct mv;
31union int_mv;
32struct yv12_buffer_config;
33EOF
34}
35forward_decls qw/vp9_common_forward_decls/;
36
37# functions that are 64 bit only.
38$mmx_x86_64 = $sse2_x86_64 = $ssse3_x86_64 = $avx_x86_64 = $avx2_x86_64 = '';
39if ($opts{arch} eq "x86_64") {
40  $mmx_x86_64 = 'mmx';
41  $sse2_x86_64 = 'sse2';
42  $ssse3_x86_64 = 'ssse3';
43  $avx_x86_64 = 'avx';
44  $avx2_x86_64 = 'avx2';
45  $avx512_x86_64 = 'avx512';
46}
47
48#
49# post proc
50#
51if (vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
52add_proto qw/void vp9_filter_by_weight16x16/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int src_weight";
53specialize qw/vp9_filter_by_weight16x16 sse2 msa/;
54
55add_proto qw/void vp9_filter_by_weight8x8/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int src_weight";
56specialize qw/vp9_filter_by_weight8x8 sse2 msa/;
57}
58
59#
60# dct
61#
62# Force C versions if CONFIG_EMULATE_HARDWARE is 1
63add_proto qw/void vp9_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
64
65add_proto qw/void vp9_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
66
67add_proto qw/void vp9_iht16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
68
69if (vpx_config("CONFIG_EMULATE_HARDWARE") ne "yes") {
70  # Note that there are more specializations appended when
71  # CONFIG_VP9_HIGHBITDEPTH is off.
72  specialize qw/vp9_iht4x4_16_add neon sse2 vsx/;
73  specialize qw/vp9_iht8x8_64_add neon sse2 vsx/;
74  specialize qw/vp9_iht16x16_256_add neon sse2 vsx/;
75  if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") ne "yes") {
76    # Note that these specializations are appended to the above ones.
77    specialize qw/vp9_iht4x4_16_add dspr2 msa/;
78    specialize qw/vp9_iht8x8_64_add dspr2 msa/;
79    specialize qw/vp9_iht16x16_256_add dspr2 msa/;
80  }
81}
82
83# High bitdepth functions
84if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
85  #
86  # post proc
87  #
88  if (vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
89    add_proto qw/void vp9_highbd_mbpost_proc_down/, "uint16_t *dst, int pitch, int rows, int cols, int flimit";
90
91    add_proto qw/void vp9_highbd_mbpost_proc_across_ip/, "uint16_t *src, int pitch, int rows, int cols, int flimit";
92
93    add_proto qw/void vp9_highbd_post_proc_down_and_across/, "const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit";
94  }
95
96  #
97  # dct
98  #
99  # Note as optimized versions of these functions are added we need to add a check to ensure
100  # that when CONFIG_EMULATE_HARDWARE is on, it defaults to the C versions only.
101  add_proto qw/void vp9_highbd_iht4x4_16_add/, "const tran_low_t *input, uint16_t *dest, int stride, int tx_type, int bd";
102
103  add_proto qw/void vp9_highbd_iht8x8_64_add/, "const tran_low_t *input, uint16_t *dest, int stride, int tx_type, int bd";
104
105  add_proto qw/void vp9_highbd_iht16x16_256_add/, "const tran_low_t *input, uint16_t *dest, int stride, int tx_type, int bd";
106
107  if (vpx_config("CONFIG_EMULATE_HARDWARE") ne "yes") {
108    specialize qw/vp9_highbd_iht4x4_16_add neon sse4_1/;
109    specialize qw/vp9_highbd_iht8x8_64_add neon sse4_1/;
110    specialize qw/vp9_highbd_iht16x16_256_add neon sse4_1/;
111  }
112}
113
114#
115# Encoder functions below this point.
116#
117if (vpx_config("CONFIG_VP9_ENCODER") eq "yes") {
118
119# ENCODEMB INVOKE
120
121#
122# Denoiser
123#
124if (vpx_config("CONFIG_VP9_TEMPORAL_DENOISING") eq "yes") {
125  add_proto qw/int vp9_denoiser_filter/, "const uint8_t *sig, int sig_stride, const uint8_t *mc_avg, int mc_avg_stride, uint8_t *avg, int avg_stride, int increase_denoising, BLOCK_SIZE bs, int motion_magnitude";
126  specialize qw/vp9_denoiser_filter neon sse2/;
127}
128
129add_proto qw/int64_t vp9_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
130
131add_proto qw/int64_t vp9_block_error_fp/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, int block_size";
132specialize qw/vp9_block_error_fp neon sve avx2 sse2/;
133
134add_proto qw/void vp9_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order";
135specialize qw/vp9_quantize_fp neon sse2 ssse3 avx2 vsx/;
136
137add_proto qw/void vp9_quantize_fp_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order";
138specialize qw/vp9_quantize_fp_32x32 neon ssse3 avx2 vsx/;
139
140if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
141  specialize qw/vp9_block_error neon sve avx2 sse2/;
142
143  add_proto qw/int64_t vp9_highbd_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz, int bd";
144  specialize qw/vp9_highbd_block_error neon sse2/;
145} else {
146  specialize qw/vp9_block_error neon sve avx2 msa sse2/;
147}
148
149# fdct functions
150
151add_proto qw/void vp9_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
152
153add_proto qw/void vp9_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
154
155add_proto qw/void vp9_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
156
157add_proto qw/void vp9_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
158
159# Note that there are more specializations appended when CONFIG_VP9_HIGHBITDEPTH
160# is off.
161specialize qw/vp9_fht4x4 sse2 neon/;
162specialize qw/vp9_fht8x8 sse2 neon/;
163specialize qw/vp9_fht16x16 sse2 neon/;
164specialize qw/vp9_fwht4x4 sse2/;
165if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") ne "yes") {
166  # Note that these specializations are appended to the above ones.
167  specialize qw/vp9_fht4x4 msa/;
168  specialize qw/vp9_fht8x8 msa/;
169  specialize qw/vp9_fht16x16 msa/;
170  specialize qw/vp9_fwht4x4 msa/;
171}
172
173#
174# Motion search
175#
176add_proto qw/int vp9_diamond_search_sad/, "const struct macroblock *x, const struct search_site_config *cfg,  struct mv *ref_mv, uint32_t start_mv_sad, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_sad_table *sad_fn_ptr, const struct mv *center_mv";
177specialize qw/vp9_diamond_search_sad neon/;
178
179#
180# Apply temporal filter
181#
182if (vpx_config("CONFIG_REALTIME_ONLY") ne "yes") {
183add_proto qw/void vp9_apply_temporal_filter/, "const uint8_t *y_src, int y_src_stride, const uint8_t *y_pre, int y_pre_stride, const uint8_t *u_src, const uint8_t *v_src, int uv_src_stride, const uint8_t *u_pre, const uint8_t *v_pre, int uv_pre_stride, unsigned int block_width, unsigned int block_height, int ss_x, int ss_y, int strength, const int *const blk_fw, int use_32x32, uint32_t *y_accumulator, uint16_t *y_count, uint32_t *u_accumulator, uint16_t *u_count, uint32_t *v_accumulator, uint16_t *v_count";
184specialize qw/vp9_apply_temporal_filter sse4_1 neon/;
185
186  if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
187    add_proto qw/void vp9_highbd_apply_temporal_filter/, "const uint16_t *y_src, int y_src_stride, const uint16_t *y_pre, int y_pre_stride, const uint16_t *u_src, const uint16_t *v_src, int uv_src_stride, const uint16_t *u_pre, const uint16_t *v_pre, int uv_pre_stride, unsigned int block_width, unsigned int block_height, int ss_x, int ss_y, int strength, const int *const blk_fw, int use_32x32, uint32_t *y_accum, uint16_t *y_count, uint32_t *u_accum, uint16_t *u_count, uint32_t *v_accum, uint16_t *v_count";
188    specialize qw/vp9_highbd_apply_temporal_filter sse4_1 neon/;
189  }
190}
191
192
193if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
194
195  # ENCODEMB INVOKE
196
197  add_proto qw/void vp9_highbd_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order";
198  specialize qw/vp9_highbd_quantize_fp avx2 neon/;
199
200  add_proto qw/void vp9_highbd_quantize_fp_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, const struct macroblock_plane *const mb_plane, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const struct ScanOrder *const scan_order";
201  specialize qw/vp9_highbd_quantize_fp_32x32 avx2 neon/;
202
203  # fdct functions
204  add_proto qw/void vp9_highbd_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
205  specialize qw/vp9_highbd_fht4x4 neon/;
206
207  add_proto qw/void vp9_highbd_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
208  specialize qw/vp9_highbd_fht8x8 neon/;
209
210  add_proto qw/void vp9_highbd_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
211  specialize qw/vp9_highbd_fht16x16 neon/;
212
213  add_proto qw/void vp9_highbd_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
214
215  add_proto qw/void vp9_highbd_temporal_filter_apply/, "const uint8_t *frame1, unsigned int stride, const uint8_t *frame2, unsigned int block_width, unsigned int block_height, int strength, int *blk_fw, int use_32x32, uint32_t *accumulator, uint16_t *count";
216
217}
218# End vp9_high encoder functions
219
220#
221# frame based scale
222#
223add_proto qw/void vp9_scale_and_extend_frame/, "const struct yv12_buffer_config *src, struct yv12_buffer_config *dst, INTERP_FILTER filter_type, int phase_scaler";
224specialize qw/vp9_scale_and_extend_frame neon ssse3/;
225
226}
227# end encoder functions
2281;
229