Go to the documentation of this file.
25 #define DETECT_RANGE_FUNC(FUNC_NAME, ASM_FUNC_NAME, C_FUNC_NAME, SHIFT, MMSIZE) \
26 int ASM_FUNC_NAME(const uint8_t *src, ptrdiff_t stride, \
27 ptrdiff_t width, ptrdiff_t height, int min, int max); \
29 static int FUNC_NAME(const uint8_t *src, ptrdiff_t stride, \
30 ptrdiff_t width, ptrdiff_t height, int min, int max) \
32 ptrdiff_t bytes = (width << SHIFT) & ~(MMSIZE - 1); \
33 int ret = ASM_FUNC_NAME(src, stride, bytes, height, min, max); \
37 return C_FUNC_NAME(src + bytes, stride, width - (bytes >> SHIFT), \
41 #define DETECT_ALPHA_FUNC(FUNC_NAME, ASM_FUNC_NAME, C_FUNC_NAME, SHIFT, MMSIZE) \
42 int ASM_FUNC_NAME(const uint8_t *color, ptrdiff_t color_stride, \
43 const uint8_t *alpha, ptrdiff_t alpha_stride, \
44 ptrdiff_t width, ptrdiff_t height, int p, int q, int k); \
46 static int FUNC_NAME(const uint8_t *color, ptrdiff_t color_stride, \
47 const uint8_t *alpha, ptrdiff_t alpha_stride, \
48 ptrdiff_t width, ptrdiff_t height, int p, int q, int k) \
50 ptrdiff_t bytes = (width << SHIFT) & ~(MMSIZE - 1); \
51 int ret = ASM_FUNC_NAME(color, color_stride, alpha, alpha_stride, \
52 bytes, height, p, q, k); \
56 return C_FUNC_NAME(color + bytes, color_stride, alpha + bytes, alpha_stride,\
57 width - (bytes >> SHIFT), height, p, q, k); \
61 #if HAVE_AVX512ICL_EXTERNAL
69 #if HAVE_AVX2_EXTERNAL
84 #if HAVE_AVX2_EXTERNAL
86 dsp->
detect_range = depth > 8 ? detect_range16_avx2 : detect_range_avx2;
88 dsp->
detect_alpha = depth > 8 ? detect_alpha16_full_avx2 : detect_alpha_full_avx2;
90 dsp->
detect_alpha = depth > 8 ? detect_alpha16_limited_avx2 : detect_alpha_limited_avx2;
94 #if HAVE_AVX512ICL_EXTERNAL
96 dsp->
detect_range = depth > 8 ? detect_range16_avx512icl : detect_range_avx512icl;
98 dsp->
detect_alpha = depth > 8 ? detect_alpha16_full_avx512icl : detect_alpha_full_avx512icl;
100 dsp->
detect_alpha = depth > 8 ? detect_alpha16_limited_avx512icl : detect_alpha_limited_avx512icl;
#define EXTERNAL_AVX2_FAST(flags)
@ AVCOL_RANGE_JPEG
Full range content.
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
static atomic_int cpu_flags
av_cold void ff_color_detect_dsp_init_x86(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
#define DETECT_RANGE_FUNC(FUNC_NAME, ASM_FUNC_NAME, C_FUNC_NAME, SHIFT, MMSIZE)
static int ff_detect_range16_c(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int mpeg_min, int mpeg_max)
static int ff_detect_alpha_limited_c(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int p, int q, int k)
static int ff_detect_alpha_full_c(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int p, int q, int k)
static int ff_detect_alpha16_full_c(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int p, int q, int k)
#define DETECT_ALPHA_FUNC(FUNC_NAME, ASM_FUNC_NAME, C_FUNC_NAME, SHIFT, MMSIZE)
int(* detect_range)(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int mpeg_min, int mpeg_max)
static int ff_detect_alpha16_limited_c(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int p, int q, int k)
#define EXTERNAL_AVX512ICL(flags)
int(* detect_alpha)(const uint8_t *color, ptrdiff_t color_stride, const uint8_t *alpha, ptrdiff_t alpha_stride, ptrdiff_t width, ptrdiff_t height, int p, int q, int k)
AVColorRange
Visual content value range.
static int ff_detect_range_c(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int mpeg_min, int mpeg_max)