~siretart/x264/trunk

« back to all changes in this revision

Viewing changes to common/opencl.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:
793
793
 
794
794
typedef struct x264_frame x264_frame;
795
795
 
 
796
#define x264_opencl_load_library x264_template(opencl_load_library)
796
797
x264_opencl_function_t *x264_opencl_load_library( void );
 
798
#define x264_opencl_close_library x264_template(opencl_close_library)
797
799
void x264_opencl_close_library( x264_opencl_function_t *ocl );
798
800
 
 
801
#define x264_opencl_lookahead_init x264_template(opencl_lookahead_init)
799
802
int x264_opencl_lookahead_init( x264_t *h );
 
803
#define x264_opencl_lookahead_delete x264_template(opencl_lookahead_delete)
800
804
void x264_opencl_lookahead_delete( x264_t *h );
801
805
 
 
806
#define x264_opencl_frame_delete x264_template(opencl_frame_delete)
802
807
void x264_opencl_frame_delete( x264_frame *frame );
803
808
 
804
809
#endif