diff options
author | Rodeo <[email protected]> | 2013-11-08 21:21:02 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2013-11-08 21:21:02 +0000 |
commit | 43f0bc9d538c86ea75a5cd627a81452e9d76b825 (patch) | |
tree | a6bde5c2174543e4ea282ab26b6a2c76829105eb /libhb/common.h | |
parent | d0a2953efbce340e34a971b9481024a51ae52383 (diff) |
OpenCL: use the new library loading architecture for all OpenCL code.
An OpenCL SDK is no longer needed to build OpenCL support.
Note: as a result, the --enable-opencl configure option is removed.
Also, libOpenCL is no longer needed to run the application (it is still necessary to use OpenCL features, of course).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5886 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.h')
-rw-r--r-- | libhb/common.h | 61 |
1 files changed, 7 insertions, 54 deletions
diff --git a/libhb/common.h b/libhb/common.h index 6a657465c..b57103d06 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -21,9 +21,6 @@ #include <sys/stat.h> #include <dirent.h> -#ifdef USE_OPENCL -#include "extras/cl.h" -#endif /* * It seems WinXP doesn't align the stack of new threads to 16 bytes. * To prevent crashes in SSE functions, we need to force stack alignement @@ -537,10 +534,11 @@ struct hb_job_s uint32_t frames_to_skip; // decode but discard this many frames // initially (for frame accurate positioning // to non-I frames). - int use_opencl;/* 0 is disable use of opencl. 1 is enable use of opencl */ + int use_opencl; int use_hwd; int use_decomb; int use_detelecine; + #ifdef USE_QSV // QSV-specific settings struct @@ -920,10 +918,12 @@ struct hb_title_s uint32_t flags; // set if video stream doesn't have IDR frames - int opencl_support; - int hwd_support; #define HBTF_NO_IDR (1 << 0) #define HBTF_SCAN_COMPLETE (1 << 0) + + // whether OpenCL scaling is supported for this source + int opencl_support; + int hwd_support; // TODO: merge to video_decode_support }; // Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_state_s.cs when changing this struct @@ -1094,51 +1094,7 @@ extern hb_work_object_t hb_reader; #define HB_FILTER_DROP 3 #define HB_FILTER_DONE 4 -typedef struct hb_oclscale_s -{ -#ifdef USE_OPENCL - int initialized; - // bicubic scale weights - cl_mem bicubic_x_weights; - cl_mem bicubic_y_weights; - cl_float xscale; - cl_float yscale; - int width; - int height; - // horizontal scaling and vertical scaling kernel handle - cl_kernel m_kernel; - int use_ocl_mem; // 0 use host memory. 1 use gpu oclmem -#endif -} hb_oclscale_t; - -#ifdef USE_OPENCL -int hb_ocl_scale( hb_buffer_t *in, hb_buffer_t *out, int *crop, hb_oclscale_t *os ); -#endif - -#ifdef USE_OPENCL -int hb_use_dxva( hb_title_t * title ); -// create opencl buffer -#define CREATEBUF( out, flags, size )\ - {\ - out = clCreateBuffer( kenv->context, (flags), (size), NULL, &status );\ - if( CL_SUCCESS != status ) return -1;\ - } - -#define OCLCHECK( method, ... )\ - status = method( __VA_ARGS__ ); if( status != CL_SUCCESS ) {\ - hb_error("%s:%d (%s) error: %d\n", __FUNCTION__, __LINE__, #method, status); return status; } - -#define CL_FREE( buf )\ -{\ - if( buf )\ - {\ - { clReleaseMemObject( buf ); }\ - buf = NULL;\ - }\ -} - - -#endif +int hb_use_dxva(hb_title_t *title); typedef struct hb_filter_init_s { @@ -1152,10 +1108,7 @@ typedef struct hb_filter_init_s int vrate_base; int vrate; int cfr; -#ifdef USE_OPENCL int use_dxva; -#endif - } hb_filter_init_t; typedef struct hb_filter_info_s |