~siretart/x264/trunk

« back to all changes in this revision

Viewing changes to common/x86/predict.h

  • Committer: Anton Mitrofanov
  • Author(s): Vittorio Giovara
  • Date: 2017-12-24 20:47:24 UTC
  • Revision ID: git-v1:71ed44c7312438fac7c5c5301e45522e57127db4
Unify 8-bit and 10-bit CLI and libraries

Add 'i_bitdepth' to x264_param_t with the corresponding '--output-depth' CLI
option to set the bit depth at runtime.

Drop the 'x264_bit_depth' global variable. Rather than hardcoding it to an
incorrect value, it's preferable to induce a linking failure. If applications
relies on this symbol this will make it more obvious where the problem is.

Add Makefile rules that compiles modules with different bit depths. Assembly
on x86 is prefixed with the 'private_prefix' define, while all other archs
modify their function prefix internally.

Templatize the main C library, x86/x86_64 assembly, ARM assembly, AARCH64
assembly, PowerPC assembly, and MIPS assembly.

The depth and cache CLI filters heavily depend on bit depth size, so they
need to be duplicated for each value. This means having to rename these
filters, and adjust the callers to use the right version.

Unfortunately the threaded input CLI module inherits a common.h dependency
(input/frame -> common/threadpool -> common/frame -> common/common) which
is extremely complicated to address in a sensible way. Instead duplicate
the module and select the appropriate one at run time.

Each bitdepth needs different checkasm compilation rules, so split the main
checkasm target into two executables.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#ifndef X264_I386_PREDICT_H
28
28
#define X264_I386_PREDICT_H
29
29
 
 
30
#define x264_predict_16x16_init_mmx x264_template(predict_16x16_init_mmx)
30
31
void x264_predict_16x16_init_mmx( int cpu, x264_predict_t pf[7] );
 
32
#define x264_predict_8x16c_init_mmx x264_template(predict_8x16c_init_mmx)
31
33
void x264_predict_8x16c_init_mmx( int cpu, x264_predict_t pf[7] );
 
34
#define x264_predict_8x8c_init_mmx x264_template(predict_8x8c_init_mmx)
32
35
void x264_predict_8x8c_init_mmx ( int cpu, x264_predict_t pf[7] );
 
36
#define x264_predict_4x4_init_mmx x264_template(predict_4x4_init_mmx)
33
37
void x264_predict_4x4_init_mmx  ( int cpu, x264_predict_t pf[12] );
 
38
#define x264_predict_8x8_init_mmx x264_template(predict_8x8_init_mmx)
34
39
void x264_predict_8x8_init_mmx  ( int cpu, x264_predict8x8_t pf[12], x264_predict_8x8_filter_t *predict_8x8_filter );
35
40
 
 
41
#define x264_predict_16x16_v_mmx2 x264_template(predict_16x16_v_mmx2)
36
42
void x264_predict_16x16_v_mmx2( pixel *src );
 
43
#define x264_predict_16x16_v_sse x264_template(predict_16x16_v_sse)
37
44
void x264_predict_16x16_v_sse ( pixel *src );
 
45
#define x264_predict_16x16_v_avx x264_template(predict_16x16_v_avx)
38
46
void x264_predict_16x16_v_avx ( uint16_t *src );
 
47
#define x264_predict_16x16_h_mmx2 x264_template(predict_16x16_h_mmx2)
39
48
void x264_predict_16x16_h_mmx2( pixel *src );
 
49
#define x264_predict_16x16_h_sse2 x264_template(predict_16x16_h_sse2)
40
50
void x264_predict_16x16_h_sse2( uint16_t *src );
 
51
#define x264_predict_16x16_h_ssse3 x264_template(predict_16x16_h_ssse3)
41
52
void x264_predict_16x16_h_ssse3( uint8_t *src );
 
53
#define x264_predict_16x16_h_avx2 x264_template(predict_16x16_h_avx2)
42
54
void x264_predict_16x16_h_avx2( uint16_t *src );
 
55
#define x264_predict_16x16_dc_sse2 x264_template(predict_16x16_dc_sse2)
43
56
void x264_predict_16x16_dc_sse2( pixel *src );
 
57
#define x264_predict_16x16_dc_avx2 x264_template(predict_16x16_dc_avx2)
44
58
void x264_predict_16x16_dc_avx2( pixel *src );
 
59
#define x264_predict_16x16_dc_left_sse2 x264_template(predict_16x16_dc_left_sse2)
45
60
void x264_predict_16x16_dc_left_sse2( pixel *src );
 
61
#define x264_predict_16x16_dc_left_avx2 x264_template(predict_16x16_dc_left_avx2)
46
62
void x264_predict_16x16_dc_left_avx2( pixel *src );
 
63
#define x264_predict_16x16_dc_top_sse2 x264_template(predict_16x16_dc_top_sse2)
47
64
void x264_predict_16x16_dc_top_sse2( pixel *src );
 
65
#define x264_predict_16x16_dc_top_avx2 x264_template(predict_16x16_dc_top_avx2)
48
66
void x264_predict_16x16_dc_top_avx2( pixel *src );
 
67
#define x264_predict_16x16_p_core_mmx2 x264_template(predict_16x16_p_core_mmx2)
49
68
void x264_predict_16x16_p_core_mmx2( uint8_t *src, int i00, int b, int c );
 
69
#define x264_predict_16x16_p_core_sse2 x264_template(predict_16x16_p_core_sse2)
50
70
void x264_predict_16x16_p_core_sse2( pixel *src, int i00, int b, int c );
 
71
#define x264_predict_16x16_p_core_avx x264_template(predict_16x16_p_core_avx)
51
72
void x264_predict_16x16_p_core_avx( pixel *src, int i00, int b, int c );
 
73
#define x264_predict_16x16_p_core_avx2 x264_template(predict_16x16_p_core_avx2)
52
74
void x264_predict_16x16_p_core_avx2( pixel *src, int i00, int b, int c );
 
75
#define x264_predict_8x16c_dc_mmx2 x264_template(predict_8x16c_dc_mmx2)
53
76
void x264_predict_8x16c_dc_mmx2( pixel *src );
 
77
#define x264_predict_8x16c_dc_sse2 x264_template(predict_8x16c_dc_sse2)
54
78
void x264_predict_8x16c_dc_sse2( uint16_t *src );
 
79
#define x264_predict_8x16c_dc_top_mmx2 x264_template(predict_8x16c_dc_top_mmx2)
55
80
void x264_predict_8x16c_dc_top_mmx2( uint8_t *src );
 
81
#define x264_predict_8x16c_dc_top_sse2 x264_template(predict_8x16c_dc_top_sse2)
56
82
void x264_predict_8x16c_dc_top_sse2( uint16_t *src );
 
83
#define x264_predict_8x16c_v_mmx x264_template(predict_8x16c_v_mmx)
57
84
void x264_predict_8x16c_v_mmx( uint8_t *src );
 
85
#define x264_predict_8x16c_v_sse x264_template(predict_8x16c_v_sse)
58
86
void x264_predict_8x16c_v_sse( uint16_t *src );
 
87
#define x264_predict_8x16c_h_mmx2 x264_template(predict_8x16c_h_mmx2)
59
88
void x264_predict_8x16c_h_mmx2( pixel *src );
 
89
#define x264_predict_8x16c_h_sse2 x264_template(predict_8x16c_h_sse2)
60
90
void x264_predict_8x16c_h_sse2( uint16_t *src );
 
91
#define x264_predict_8x16c_h_ssse3 x264_template(predict_8x16c_h_ssse3)
61
92
void x264_predict_8x16c_h_ssse3( uint8_t *src );
 
93
#define x264_predict_8x16c_h_avx2 x264_template(predict_8x16c_h_avx2)
62
94
void x264_predict_8x16c_h_avx2( uint16_t *src );
 
95
#define x264_predict_8x16c_p_core_mmx2 x264_template(predict_8x16c_p_core_mmx2)
63
96
void x264_predict_8x16c_p_core_mmx2( uint8_t *src, int i00, int b, int c );
 
97
#define x264_predict_8x16c_p_core_sse2 x264_template(predict_8x16c_p_core_sse2)
64
98
void x264_predict_8x16c_p_core_sse2( pixel *src, int i00, int b, int c );
 
99
#define x264_predict_8x16c_p_core_avx x264_template(predict_8x16c_p_core_avx)
65
100
void x264_predict_8x16c_p_core_avx ( pixel *src, int i00, int b, int c );
 
101
#define x264_predict_8x16c_p_core_avx2 x264_template(predict_8x16c_p_core_avx2)
66
102
void x264_predict_8x16c_p_core_avx2( pixel *src, int i00, int b, int c );
 
103
#define x264_predict_8x8c_p_core_mmx2 x264_template(predict_8x8c_p_core_mmx2)
67
104
void x264_predict_8x8c_p_core_mmx2( uint8_t *src, int i00, int b, int c );
 
105
#define x264_predict_8x8c_p_core_sse2 x264_template(predict_8x8c_p_core_sse2)
68
106
void x264_predict_8x8c_p_core_sse2( pixel *src, int i00, int b, int c );
 
107
#define x264_predict_8x8c_p_core_avx x264_template(predict_8x8c_p_core_avx)
69
108
void x264_predict_8x8c_p_core_avx ( pixel *src, int i00, int b, int c );
 
109
#define x264_predict_8x8c_p_core_avx2 x264_template(predict_8x8c_p_core_avx2)
70
110
void x264_predict_8x8c_p_core_avx2( pixel *src, int i00, int b, int c );
 
111
#define x264_predict_8x8c_dc_mmx2 x264_template(predict_8x8c_dc_mmx2)
71
112
void x264_predict_8x8c_dc_mmx2( pixel *src );
 
113
#define x264_predict_8x8c_dc_sse2 x264_template(predict_8x8c_dc_sse2)
72
114
void x264_predict_8x8c_dc_sse2( uint16_t *src );
 
115
#define x264_predict_8x8c_dc_top_mmx2 x264_template(predict_8x8c_dc_top_mmx2)
73
116
void x264_predict_8x8c_dc_top_mmx2( uint8_t *src );
 
117
#define x264_predict_8x8c_dc_top_sse2 x264_template(predict_8x8c_dc_top_sse2)
74
118
void x264_predict_8x8c_dc_top_sse2( uint16_t *src );
 
119
#define x264_predict_8x8c_v_mmx x264_template(predict_8x8c_v_mmx)
75
120
void x264_predict_8x8c_v_mmx( pixel *src );
 
121
#define x264_predict_8x8c_v_sse x264_template(predict_8x8c_v_sse)
76
122
void x264_predict_8x8c_v_sse( uint16_t *src );
 
123
#define x264_predict_8x8c_h_mmx2 x264_template(predict_8x8c_h_mmx2)
77
124
void x264_predict_8x8c_h_mmx2( pixel *src );
 
125
#define x264_predict_8x8c_h_sse2 x264_template(predict_8x8c_h_sse2)
78
126
void x264_predict_8x8c_h_sse2( uint16_t *src );
 
127
#define x264_predict_8x8c_h_ssse3 x264_template(predict_8x8c_h_ssse3)
79
128
void x264_predict_8x8c_h_ssse3( uint8_t *src );
 
129
#define x264_predict_8x8c_h_avx2 x264_template(predict_8x8c_h_avx2)
80
130
void x264_predict_8x8c_h_avx2( uint16_t *src );
 
131
#define x264_predict_8x8_v_mmx2 x264_template(predict_8x8_v_mmx2)
81
132
void x264_predict_8x8_v_mmx2( uint8_t *src, uint8_t edge[36] );
 
133
#define x264_predict_8x8_v_sse x264_template(predict_8x8_v_sse)
82
134
void x264_predict_8x8_v_sse ( uint16_t *src, uint16_t edge[36] );
 
135
#define x264_predict_8x8_h_mmx2 x264_template(predict_8x8_h_mmx2)
83
136
void x264_predict_8x8_h_mmx2( uint8_t *src, uint8_t edge[36] );
 
137
#define x264_predict_8x8_h_sse2 x264_template(predict_8x8_h_sse2)
84
138
void x264_predict_8x8_h_sse2( uint16_t *src, uint16_t edge[36] );
 
139
#define x264_predict_8x8_hd_mmx2 x264_template(predict_8x8_hd_mmx2)
85
140
void x264_predict_8x8_hd_mmx2( uint8_t *src, uint8_t edge[36] );
 
141
#define x264_predict_8x8_hu_mmx2 x264_template(predict_8x8_hu_mmx2)
86
142
void x264_predict_8x8_hu_mmx2( uint8_t *src, uint8_t edge[36] );
 
143
#define x264_predict_8x8_dc_mmx2 x264_template(predict_8x8_dc_mmx2)
87
144
void x264_predict_8x8_dc_mmx2( uint8_t *src, uint8_t edge[36] );
 
145
#define x264_predict_8x8_dc_sse2 x264_template(predict_8x8_dc_sse2)
88
146
void x264_predict_8x8_dc_sse2( uint16_t *src, uint16_t edge[36] );
 
147
#define x264_predict_8x8_dc_top_mmx2 x264_template(predict_8x8_dc_top_mmx2)
89
148
void x264_predict_8x8_dc_top_mmx2( uint8_t *src, uint8_t edge[36] );
 
149
#define x264_predict_8x8_dc_top_sse2 x264_template(predict_8x8_dc_top_sse2)
90
150
void x264_predict_8x8_dc_top_sse2( uint16_t *src, uint16_t edge[36] );
 
151
#define x264_predict_8x8_dc_left_mmx2 x264_template(predict_8x8_dc_left_mmx2)
91
152
void x264_predict_8x8_dc_left_mmx2( uint8_t *src, uint8_t edge[36] );
 
153
#define x264_predict_8x8_dc_left_sse2 x264_template(predict_8x8_dc_left_sse2)
92
154
void x264_predict_8x8_dc_left_sse2( uint16_t *src, uint16_t edge[36] );
 
155
#define x264_predict_8x8_ddl_mmx2 x264_template(predict_8x8_ddl_mmx2)
93
156
void x264_predict_8x8_ddl_mmx2( uint8_t *src, uint8_t edge[36] );
 
157
#define x264_predict_8x8_ddl_sse2 x264_template(predict_8x8_ddl_sse2)
94
158
void x264_predict_8x8_ddl_sse2( pixel *src, pixel edge[36] );
 
159
#define x264_predict_8x8_ddl_ssse3 x264_template(predict_8x8_ddl_ssse3)
95
160
void x264_predict_8x8_ddl_ssse3( pixel *src, pixel edge[36] );
 
161
#define x264_predict_8x8_ddl_cache64_ssse3 x264_template(predict_8x8_ddl_cache64_ssse3)
96
162
void x264_predict_8x8_ddl_cache64_ssse3( pixel *src, pixel edge[36] );
 
163
#define x264_predict_8x8_ddl_avx x264_template(predict_8x8_ddl_avx)
97
164
void x264_predict_8x8_ddl_avx( pixel *src, pixel edge[36] );
 
165
#define x264_predict_8x8_ddr_mmx2 x264_template(predict_8x8_ddr_mmx2)
98
166
void x264_predict_8x8_ddr_mmx2( uint8_t *src, uint8_t edge[36] );
 
167
#define x264_predict_8x8_ddr_sse2 x264_template(predict_8x8_ddr_sse2)
99
168
void x264_predict_8x8_ddr_sse2( pixel *src, pixel edge[36] );
 
169
#define x264_predict_8x8_ddr_ssse3 x264_template(predict_8x8_ddr_ssse3)
100
170
void x264_predict_8x8_ddr_ssse3( pixel *src, pixel edge[36] );
 
171
#define x264_predict_8x8_ddr_cache64_ssse3 x264_template(predict_8x8_ddr_cache64_ssse3)
101
172
void x264_predict_8x8_ddr_cache64_ssse3( pixel *src, pixel edge[36] );
 
173
#define x264_predict_8x8_ddr_avx x264_template(predict_8x8_ddr_avx)
102
174
void x264_predict_8x8_ddr_avx( pixel *src, pixel edge[36] );
 
175
#define x264_predict_8x8_vl_sse2 x264_template(predict_8x8_vl_sse2)
103
176
void x264_predict_8x8_vl_sse2( pixel *src, pixel edge[36] );
 
177
#define x264_predict_8x8_vl_ssse3 x264_template(predict_8x8_vl_ssse3)
104
178
void x264_predict_8x8_vl_ssse3( pixel *src, pixel edge[36] );
 
179
#define x264_predict_8x8_vl_avx x264_template(predict_8x8_vl_avx)
105
180
void x264_predict_8x8_vl_avx( pixel *src, pixel edge[36] );
 
181
#define x264_predict_8x8_vl_mmx2 x264_template(predict_8x8_vl_mmx2)
106
182
void x264_predict_8x8_vl_mmx2( uint8_t *src, uint8_t edge[36] );
 
183
#define x264_predict_8x8_vr_mmx2 x264_template(predict_8x8_vr_mmx2)
107
184
void x264_predict_8x8_vr_mmx2( uint8_t *src, uint8_t edge[36] );
 
185
#define x264_predict_8x8_vr_sse2 x264_template(predict_8x8_vr_sse2)
108
186
void x264_predict_8x8_vr_sse2( pixel *src, pixel edge[36] );
 
187
#define x264_predict_8x8_vr_ssse3 x264_template(predict_8x8_vr_ssse3)
109
188
void x264_predict_8x8_vr_ssse3( pixel *src, pixel edge[36] );
 
189
#define x264_predict_8x8_vr_avx x264_template(predict_8x8_vr_avx)
110
190
void x264_predict_8x8_vr_avx( pixel *src, pixel edge[36] );
 
191
#define x264_predict_8x8_hu_sse2 x264_template(predict_8x8_hu_sse2)
111
192
void x264_predict_8x8_hu_sse2( pixel *src, pixel edge[36] );
 
193
#define x264_predict_8x8_hu_ssse3 x264_template(predict_8x8_hu_ssse3)
112
194
void x264_predict_8x8_hu_ssse3( pixel *src, pixel edge[36] );
 
195
#define x264_predict_8x8_hu_avx x264_template(predict_8x8_hu_avx)
113
196
void x264_predict_8x8_hu_avx( pixel *src, pixel edge[36] );
 
197
#define x264_predict_8x8_hd_sse2 x264_template(predict_8x8_hd_sse2)
114
198
void x264_predict_8x8_hd_sse2( pixel *src, pixel edge[36] );
 
199
#define x264_predict_8x8_hd_ssse3 x264_template(predict_8x8_hd_ssse3)
115
200
void x264_predict_8x8_hd_ssse3( pixel *src, pixel edge[36] );
 
201
#define x264_predict_8x8_hd_avx x264_template(predict_8x8_hd_avx)
116
202
void x264_predict_8x8_hd_avx( pixel *src, pixel edge[36] );
 
203
#define x264_predict_8x8_filter_mmx2 x264_template(predict_8x8_filter_mmx2)
117
204
void x264_predict_8x8_filter_mmx2( uint8_t *src, uint8_t edge[36], int i_neighbor, int i_filters );
 
205
#define x264_predict_8x8_filter_sse2 x264_template(predict_8x8_filter_sse2)
118
206
void x264_predict_8x8_filter_sse2( uint16_t *src, uint16_t edge[36], int i_neighbor, int i_filters );
 
207
#define x264_predict_8x8_filter_ssse3 x264_template(predict_8x8_filter_ssse3)
119
208
void x264_predict_8x8_filter_ssse3( pixel *src, pixel edge[36], int i_neighbor, int i_filters );
 
209
#define x264_predict_8x8_filter_avx x264_template(predict_8x8_filter_avx)
120
210
void x264_predict_8x8_filter_avx( uint16_t *src, uint16_t edge[36], int i_neighbor, int i_filters );
 
211
#define x264_predict_4x4_h_avx2 x264_template(predict_4x4_h_avx2)
121
212
void x264_predict_4x4_h_avx2( uint16_t *src );
 
213
#define x264_predict_4x4_ddl_mmx2 x264_template(predict_4x4_ddl_mmx2)
122
214
void x264_predict_4x4_ddl_mmx2( pixel *src );
 
215
#define x264_predict_4x4_ddl_sse2 x264_template(predict_4x4_ddl_sse2)
123
216
void x264_predict_4x4_ddl_sse2( uint16_t *src );
 
217
#define x264_predict_4x4_ddl_avx x264_template(predict_4x4_ddl_avx)
124
218
void x264_predict_4x4_ddl_avx( uint16_t *src );
 
219
#define x264_predict_4x4_ddr_mmx2 x264_template(predict_4x4_ddr_mmx2)
125
220
void x264_predict_4x4_ddr_mmx2( pixel *src );
 
221
#define x264_predict_4x4_vl_mmx2 x264_template(predict_4x4_vl_mmx2)
126
222
void x264_predict_4x4_vl_mmx2( pixel *src );
 
223
#define x264_predict_4x4_vl_sse2 x264_template(predict_4x4_vl_sse2)
127
224
void x264_predict_4x4_vl_sse2( uint16_t *src );
 
225
#define x264_predict_4x4_vl_avx x264_template(predict_4x4_vl_avx)
128
226
void x264_predict_4x4_vl_avx( uint16_t *src );
 
227
#define x264_predict_4x4_vr_mmx2 x264_template(predict_4x4_vr_mmx2)
129
228
void x264_predict_4x4_vr_mmx2( uint8_t *src );
 
229
#define x264_predict_4x4_vr_sse2 x264_template(predict_4x4_vr_sse2)
130
230
void x264_predict_4x4_vr_sse2( uint16_t *src );
 
231
#define x264_predict_4x4_vr_ssse3 x264_template(predict_4x4_vr_ssse3)
131
232
void x264_predict_4x4_vr_ssse3( pixel *src );
 
233
#define x264_predict_4x4_vr_cache64_ssse3 x264_template(predict_4x4_vr_cache64_ssse3)
132
234
void x264_predict_4x4_vr_cache64_ssse3( uint8_t *src );
 
235
#define x264_predict_4x4_vr_avx x264_template(predict_4x4_vr_avx)
133
236
void x264_predict_4x4_vr_avx( uint16_t *src );
 
237
#define x264_predict_4x4_hd_mmx2 x264_template(predict_4x4_hd_mmx2)
134
238
void x264_predict_4x4_hd_mmx2( pixel *src );
 
239
#define x264_predict_4x4_hd_sse2 x264_template(predict_4x4_hd_sse2)
135
240
void x264_predict_4x4_hd_sse2( uint16_t *src );
 
241
#define x264_predict_4x4_hd_ssse3 x264_template(predict_4x4_hd_ssse3)
136
242
void x264_predict_4x4_hd_ssse3( pixel *src );
 
243
#define x264_predict_4x4_hd_avx x264_template(predict_4x4_hd_avx)
137
244
void x264_predict_4x4_hd_avx( uint16_t *src );
 
245
#define x264_predict_4x4_dc_mmx2 x264_template(predict_4x4_dc_mmx2)
138
246
void x264_predict_4x4_dc_mmx2( pixel *src );
 
247
#define x264_predict_4x4_ddr_sse2 x264_template(predict_4x4_ddr_sse2)
139
248
void x264_predict_4x4_ddr_sse2( uint16_t *src );
 
249
#define x264_predict_4x4_ddr_ssse3 x264_template(predict_4x4_ddr_ssse3)
140
250
void x264_predict_4x4_ddr_ssse3( pixel *src );
 
251
#define x264_predict_4x4_ddr_avx x264_template(predict_4x4_ddr_avx)
141
252
void x264_predict_4x4_ddr_avx( uint16_t *src );
 
253
#define x264_predict_4x4_hu_mmx2 x264_template(predict_4x4_hu_mmx2)
142
254
void x264_predict_4x4_hu_mmx2( pixel *src );
143
255
 
144
256
#endif