~siretart/x264/trunk

« back to all changes in this revision

Viewing changes to common/frame.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:
216
216
                              int bframe );
217
217
} x264_deblock_function_t;
218
218
 
 
219
#define x264_frame_delete x264_template(frame_delete)
219
220
void          x264_frame_delete( x264_frame_t *frame );
220
221
 
 
222
#define x264_frame_copy_picture x264_template(frame_copy_picture)
221
223
int           x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src );
222
224
 
 
225
#define x264_frame_expand_border x264_template(frame_expand_border)
223
226
void          x264_frame_expand_border( x264_t *h, x264_frame_t *frame, int mb_y );
 
227
#define x264_frame_expand_border_filtered x264_template(frame_expand_border_filtered)
224
228
void          x264_frame_expand_border_filtered( x264_t *h, x264_frame_t *frame, int mb_y, int b_end );
 
229
#define x264_frame_expand_border_lowres x264_template(frame_expand_border_lowres)
225
230
void          x264_frame_expand_border_lowres( x264_frame_t *frame );
 
231
#define x264_frame_expand_border_chroma x264_template(frame_expand_border_chroma)
226
232
void          x264_frame_expand_border_chroma( x264_t *h, x264_frame_t *frame, int plane );
 
233
#define x264_frame_expand_border_mod16 x264_template(frame_expand_border_mod16)
227
234
void          x264_frame_expand_border_mod16( x264_t *h, x264_frame_t *frame );
 
235
#define x264_expand_border_mbpair x264_template(expand_border_mbpair)
228
236
void          x264_expand_border_mbpair( x264_t *h, int mb_x, int mb_y );
229
237
 
 
238
#define x264_frame_deblock_row x264_template(frame_deblock_row)
230
239
void          x264_frame_deblock_row( x264_t *h, int mb_y );
 
240
#define x264_macroblock_deblock x264_template(macroblock_deblock)
231
241
void          x264_macroblock_deblock( x264_t *h );
232
242
 
 
243
#define x264_frame_filter x264_template(frame_filter)
233
244
void          x264_frame_filter( x264_t *h, x264_frame_t *frame, int mb_y, int b_end );
 
245
#define x264_frame_init_lowres x264_template(frame_init_lowres)
234
246
void          x264_frame_init_lowres( x264_t *h, x264_frame_t *frame );
235
247
 
 
248
#define x264_deblock_init x264_template(deblock_init)
236
249
void          x264_deblock_init( int cpu, x264_deblock_function_t *pf, int b_mbaff );
237
250
 
 
251
#define x264_frame_cond_broadcast x264_template(frame_cond_broadcast)
238
252
void          x264_frame_cond_broadcast( x264_frame_t *frame, int i_lines_completed );
 
253
#define x264_frame_cond_wait x264_template(frame_cond_wait)
239
254
void          x264_frame_cond_wait( x264_frame_t *frame, int i_lines_completed );
 
255
#define x264_frame_new_slice x264_template(frame_new_slice)
240
256
int           x264_frame_new_slice( x264_t *h, x264_frame_t *frame );
241
257
 
 
258
#define x264_threadslice_cond_broadcast x264_template(threadslice_cond_broadcast)
242
259
void          x264_threadslice_cond_broadcast( x264_t *h, int pass );
 
260
#define x264_threadslice_cond_wait x264_template(threadslice_cond_wait)
243
261
void          x264_threadslice_cond_wait( x264_t *h, int pass );
244
262
 
 
263
#define x264_frame_push x264_template(frame_push)
245
264
void          x264_frame_push( x264_frame_t **list, x264_frame_t *frame );
 
265
#define x264_frame_pop x264_template(frame_pop)
246
266
x264_frame_t *x264_frame_pop( x264_frame_t **list );
 
267
#define x264_frame_unshift x264_template(frame_unshift)
247
268
void          x264_frame_unshift( x264_frame_t **list, x264_frame_t *frame );
 
269
#define x264_frame_shift x264_template(frame_shift)
248
270
x264_frame_t *x264_frame_shift( x264_frame_t **list );
 
271
#define x264_frame_push_unused x264_template(frame_push_unused)
249
272
void          x264_frame_push_unused( x264_t *h, x264_frame_t *frame );
 
273
#define x264_frame_push_blank_unused x264_template(frame_push_blank_unused)
250
274
void          x264_frame_push_blank_unused( x264_t *h, x264_frame_t *frame );
 
275
#define x264_frame_pop_blank_unused x264_template(frame_pop_blank_unused)
251
276
x264_frame_t *x264_frame_pop_blank_unused( x264_t *h );
 
277
#define x264_weight_scale_plane x264_template(weight_scale_plane)
252
278
void x264_weight_scale_plane( x264_t *h, pixel *dst, intptr_t i_dst_stride, pixel *src, intptr_t i_src_stride,
253
279
                              int i_width, int i_height, x264_weight_t *w );
 
280
#define x264_frame_pop_unused x264_template(frame_pop_unused)
254
281
x264_frame_t *x264_frame_pop_unused( x264_t *h, int b_fdec );
 
282
#define x264_frame_delete_list x264_template(frame_delete_list)
255
283
void          x264_frame_delete_list( x264_frame_t **list );
256
284
 
 
285
#define x264_sync_frame_list_init x264_template(sync_frame_list_init)
257
286
int           x264_sync_frame_list_init( x264_sync_frame_list_t *slist, int nelem );
 
287
#define x264_sync_frame_list_delete x264_template(sync_frame_list_delete)
258
288
void          x264_sync_frame_list_delete( x264_sync_frame_list_t *slist );
 
289
#define x264_sync_frame_list_push x264_template(sync_frame_list_push)
259
290
void          x264_sync_frame_list_push( x264_sync_frame_list_t *slist, x264_frame_t *frame );
 
291
#define x264_sync_frame_list_pop x264_template(sync_frame_list_pop)
260
292
x264_frame_t *x264_sync_frame_list_pop( x264_sync_frame_list_t *slist );
261
293
 
262
294
#endif