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); \
34 if (ret == FF_ALPHA_STRAIGHT) \
37 return ret | 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); \
53 if (ret == FF_ALPHA_STRAIGHT) \
56 return ret | C_FUNC_NAME(color + bytes, color_stride, alpha + bytes, \
57 alpha_stride, width - (bytes >> SHIFT), height, \
62 #if HAVE_AVX512ICL_EXTERNAL
70 #if HAVE_AVX2_EXTERNAL
85 #if HAVE_AVX2_EXTERNAL
87 dsp->
detect_range = depth > 8 ? detect_range16_avx2 : detect_range_avx2;
89 dsp->
detect_alpha = depth > 8 ? detect_alpha16_full_avx2 : detect_alpha_full_avx2;
91 dsp->
detect_alpha = depth > 8 ? detect_alpha16_limited_avx2 : detect_alpha_limited_avx2;
95 #if HAVE_AVX512ICL_EXTERNAL
97 dsp->
detect_range = depth > 8 ? detect_range16_avx512icl : detect_range_avx512icl;
99 dsp->
detect_alpha = depth > 8 ? detect_alpha16_full_avx512icl : detect_alpha_full_avx512icl;
101 dsp->
detect_alpha = depth > 8 ? detect_alpha16_limited_avx512icl : detect_alpha_limited_avx512icl;
av_cold void ff_color_detect_dsp_init_x86(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
#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
#define DETECT_RANGE_FUNC(FUNC_NAME, ASM_FUNC_NAME, C_FUNC_NAME, SHIFT, MMSIZE)
#define DETECT_ALPHA_FUNC(FUNC_NAME, ASM_FUNC_NAME, C_FUNC_NAME, SHIFT, MMSIZE)
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 alpha_max, int mpeg_range, int offset)
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 alpha_max, int mpeg_range, int offset)
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 alpha_max, int mpeg_range, int offset)
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 alpha_max, int mpeg_range, int offset)
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 alpha_max, int mpeg_range, int offset)
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_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_range_c(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, int mpeg_min, int mpeg_max)
#define EXTERNAL_AVX512ICL(flags)
AVColorRange
Visual content value range.