]> granicus.if.org Git - libvpx/blob - vp9/common/vp9_rtcd_defs.pl
subpel variance neon: add mixed sizes
[libvpx] / vp9 / common / vp9_rtcd_defs.pl
1 sub vp9_common_forward_decls() {
2 print <<EOF
3 /*
4  * VP9
5  */
6
7 #include "vpx/vpx_integer.h"
8 #include "vp9/common/vp9_common.h"
9 #include "vp9/common/vp9_enums.h"
10
11 struct macroblockd;
12
13 /* Encoder forward decls */
14 struct macroblock;
15 struct vp9_variance_vtable;
16 struct search_site_config;
17 struct mv;
18 union int_mv;
19 struct yv12_buffer_config;
20 EOF
21 }
22 forward_decls qw/vp9_common_forward_decls/;
23
24 # functions that are 64 bit only.
25 $mmx_x86_64 = $sse2_x86_64 = $ssse3_x86_64 = $avx_x86_64 = $avx2_x86_64 = '';
26 if ($opts{arch} eq "x86_64") {
27   $mmx_x86_64 = 'mmx';
28   $sse2_x86_64 = 'sse2';
29   $ssse3_x86_64 = 'ssse3';
30   $avx_x86_64 = 'avx';
31   $avx2_x86_64 = 'avx2';
32 }
33
34 #
35 # post proc
36 #
37 if (vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
38 add_proto qw/void vp9_filter_by_weight16x16/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int src_weight";
39 specialize qw/vp9_filter_by_weight16x16 sse2 msa/;
40
41 add_proto qw/void vp9_filter_by_weight8x8/, "const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int src_weight";
42 specialize qw/vp9_filter_by_weight8x8 sse2 msa/;
43 }
44
45 #
46 # dct
47 #
48 if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
49   # Force C versions if CONFIG_EMULATE_HARDWARE is 1
50   if (vpx_config("CONFIG_EMULATE_HARDWARE") eq "yes") {
51     add_proto qw/void vp9_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
52
53     add_proto qw/void vp9_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
54
55     add_proto qw/void vp9_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, int tx_type";
56   } else {
57     add_proto qw/void vp9_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
58     specialize qw/vp9_iht4x4_16_add sse2/;
59
60     add_proto qw/void vp9_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
61     specialize qw/vp9_iht8x8_64_add sse2/;
62
63     add_proto qw/void vp9_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, int tx_type";
64     specialize qw/vp9_iht16x16_256_add sse2/;
65   }
66 } else {
67   # Force C versions if CONFIG_EMULATE_HARDWARE is 1
68   if (vpx_config("CONFIG_EMULATE_HARDWARE") eq "yes") {
69     add_proto qw/void vp9_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
70
71     add_proto qw/void vp9_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
72
73     add_proto qw/void vp9_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, int tx_type";
74   } else {
75     add_proto qw/void vp9_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
76     specialize qw/vp9_iht4x4_16_add sse2 neon dspr2 msa/;
77
78     add_proto qw/void vp9_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type";
79     specialize qw/vp9_iht8x8_64_add sse2 neon dspr2 msa/;
80
81     add_proto qw/void vp9_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, int tx_type";
82     specialize qw/vp9_iht16x16_256_add sse2 dspr2 msa/;
83   }
84 }
85
86 # High bitdepth functions
87 if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
88   #
89   # post proc
90   #
91   if (vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
92     add_proto qw/void vp9_highbd_mbpost_proc_down/, "uint16_t *dst, int pitch, int rows, int cols, int flimit";
93
94     add_proto qw/void vp9_highbd_mbpost_proc_across_ip/, "uint16_t *src, int pitch, int rows, int cols, int flimit";
95
96     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";
97   }
98
99   #
100   # dct
101   #
102   # Note as optimized versions of these functions are added we need to add a check to ensure
103   # that when CONFIG_EMULATE_HARDWARE is on, it defaults to the C versions only.
104   add_proto qw/void vp9_highbd_iht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type, int bd";
105
106   add_proto qw/void vp9_highbd_iht8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int tx_type, int bd";
107
108   add_proto qw/void vp9_highbd_iht16x16_256_add/, "const tran_low_t *input, uint8_t *output, int pitch, int tx_type, int bd";
109 }
110
111 #
112 # Encoder functions below this point.
113 #
114 if (vpx_config("CONFIG_VP9_ENCODER") eq "yes") {
115
116 # ENCODEMB INVOKE
117
118 #
119 # Denoiser
120 #
121 if (vpx_config("CONFIG_VP9_TEMPORAL_DENOISING") eq "yes") {
122   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";
123   specialize qw/vp9_denoiser_filter sse2/;
124 }
125
126 if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
127   add_proto qw/int64_t vp9_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
128   specialize qw/vp9_block_error avx2 sse2/;
129
130   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";
131   specialize qw/vp9_highbd_block_error sse2/;
132
133   add_proto qw/int64_t vp9_block_error_fp/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, int block_size";
134   specialize qw/vp9_block_error_fp sse2/;
135
136   add_proto qw/void vp9_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
137   specialize qw/vp9_quantize_fp neon sse2/, "$ssse3_x86_64";
138
139   add_proto qw/void vp9_quantize_fp_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
140   specialize qw/vp9_quantize_fp_32x32/, "$ssse3_x86_64";
141
142   add_proto qw/void vp9_fdct8x8_quant/, "const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
143   specialize qw/vp9_fdct8x8_quant neon ssse3/;
144 } else {
145   add_proto qw/int64_t vp9_block_error/, "const tran_low_t *coeff, const tran_low_t *dqcoeff, intptr_t block_size, int64_t *ssz";
146   specialize qw/vp9_block_error avx2 msa sse2/;
147
148   add_proto qw/int64_t vp9_block_error_fp/, "const int16_t *coeff, const int16_t *dqcoeff, int block_size";
149   specialize qw/vp9_block_error_fp neon sse2/;
150
151   add_proto qw/void vp9_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
152   specialize qw/vp9_quantize_fp neon sse2/, "$ssse3_x86_64";
153
154   add_proto qw/void vp9_quantize_fp_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
155   specialize qw/vp9_quantize_fp_32x32/, "$ssse3_x86_64";
156
157   add_proto qw/void vp9_fdct8x8_quant/, "const int16_t *input, int stride, tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
158   specialize qw/vp9_fdct8x8_quant sse2 ssse3 neon/;
159 }
160
161 # fdct functions
162
163 if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
164   add_proto qw/void vp9_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
165   specialize qw/vp9_fht4x4 sse2/;
166
167   add_proto qw/void vp9_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
168   specialize qw/vp9_fht8x8 sse2/;
169
170   add_proto qw/void vp9_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
171   specialize qw/vp9_fht16x16 sse2/;
172
173   add_proto qw/void vp9_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
174   specialize qw/vp9_fwht4x4 sse2/;
175 } else {
176   add_proto qw/void vp9_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
177   specialize qw/vp9_fht4x4 sse2 msa/;
178
179   add_proto qw/void vp9_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
180   specialize qw/vp9_fht8x8 sse2 msa/;
181
182   add_proto qw/void vp9_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
183   specialize qw/vp9_fht16x16 sse2 msa/;
184
185   add_proto qw/void vp9_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
186   specialize qw/vp9_fwht4x4 msa sse2/;
187 }
188
189 #
190 # Motion search
191 #
192 add_proto qw/int vp9_full_search_sad/, "const struct macroblock *x, const struct mv *ref_mv, int sad_per_bit, int distance, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv, struct mv *best_mv";
193 specialize qw/vp9_full_search_sad sse3 sse4_1/;
194 $vp9_full_search_sad_sse3=vp9_full_search_sadx3;
195 $vp9_full_search_sad_sse4_1=vp9_full_search_sadx8;
196
197 add_proto qw/int vp9_diamond_search_sad/, "const struct macroblock *x, const struct search_site_config *cfg,  struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, const struct mv *center_mv";
198 specialize qw/vp9_diamond_search_sad avx/;
199
200 add_proto qw/void vp9_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 filter_weight, uint32_t *accumulator, uint16_t *count";
201 specialize qw/vp9_temporal_filter_apply sse4_1/;
202
203 if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") {
204
205   # ENCODEMB INVOKE
206
207   add_proto qw/void vp9_highbd_quantize_fp/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
208
209   add_proto qw/void vp9_highbd_quantize_fp_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *round_ptr, const int16_t *quant_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan" ;
210
211   # fdct functions
212   add_proto qw/void vp9_highbd_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
213
214   add_proto qw/void vp9_highbd_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
215
216   add_proto qw/void vp9_highbd_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
217
218   add_proto qw/void vp9_highbd_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
219
220   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 filter_weight, uint32_t *accumulator, uint16_t *count";
221
222 }
223 # End vp9_high encoder functions
224
225 #
226 # frame based scale
227 #
228 add_proto qw/void vp9_scale_and_extend_frame/, "const struct yv12_buffer_config *src, struct yv12_buffer_config *dst, int phase_scaler";
229 specialize qw/vp9_scale_and_extend_frame ssse3/;
230
231 }
232 # end encoder functions
233 1;