Go to the documentation of this file.
19 #ifndef AVFILTER_COLORDETECTDSP_H
20 #define AVFILTER_COLORDETECTDSP_H
43 int mpeg_min,
int mpeg_max);
47 const uint8_t *
alpha, ptrdiff_t alpha_stride,
49 int alpha_max,
int mpeg_range,
int offset);
59 uint8_t mpeg_min, uint8_t mpeg_max)
63 for (
int x = 0; x <
width; x++) {
65 cond |= val < mpeg_min || val > mpeg_max;
77 int mpeg_min,
int mpeg_max)
79 av_assume(mpeg_min >= 0 && mpeg_min <= UINT8_MAX);
80 av_assume(mpeg_max >= 0 && mpeg_max <= UINT8_MAX);
86 uint16_t mpeg_min, uint16_t mpeg_max)
89 const uint16_t *data16 = (
const uint16_t *)
data;
91 for (
int x = 0; x <
width; x++) {
92 const uint16_t
val = data16[x];
93 cond |= val < mpeg_min || val > mpeg_max;
105 int mpeg_min,
int mpeg_max)
107 av_assume(mpeg_min >= 0 && mpeg_min <= UINT16_MAX);
108 av_assume(mpeg_max >= 0 && mpeg_max <= UINT16_MAX);
114 const uint8_t *
alpha, ptrdiff_t alpha_stride,
116 int alpha_max,
int mpeg_range,
int offset)
118 uint8_t transparent = 0;
120 uint8_t straight = 0;
121 for (
int x = 0; x <
width; x++) {
123 transparent |=
alpha[x] != alpha_max;
127 color += color_stride;
128 alpha += alpha_stride;
135 const uint8_t *
alpha, ptrdiff_t alpha_stride,
137 int alpha_max,
int mpeg_range,
int offset)
139 uint8_t transparent = 0;
141 uint8_t straight = 0;
142 for (
int x = 0; x <
width; x++) {
144 transparent |=
alpha[x] != alpha_max;
148 color += color_stride;
149 alpha += alpha_stride;
156 const uint8_t *
alpha, ptrdiff_t alpha_stride,
158 int alpha_max,
int mpeg_range,
int offset)
160 uint8_t transparent = 0;
163 const uint16_t *alpha16 = (
const uint16_t *)
alpha;
164 uint8_t straight = 0;
165 for (
int x = 0; x <
width; x++) {
166 straight |=
color16[x] > alpha16[x];
167 transparent |= alpha16[x] != alpha_max;
171 color += color_stride;
172 alpha += alpha_stride;
179 const uint8_t *
alpha, ptrdiff_t alpha_stride,
181 int alpha_max,
int mpeg_range,
int offset)
183 uint8_t transparent = 0;
186 const uint16_t *alpha16 = (
const uint16_t *)
alpha;
187 for (
int x = 0; x <
width; x++) {
190 transparent |= alpha16[x] != alpha_max;
192 color += color_stride;
193 alpha += alpha_stride;
@ AVCOL_RANGE_JPEG
Full range content.
static double val(void *priv, double ch)
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)
@ FF_ALPHA_TRANSPARENT
alpha < alpha_max
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)
void ff_color_detect_dsp_init_x86(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
static int ff_detect_range_impl_c(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, uint8_t mpeg_min, uint8_t mpeg_max)
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)
static const uint32_t color[16+AV_CLASS_CATEGORY_NB]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf 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)
static av_cold void ff_color_detect_dsp_init(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
static int ff_detect_range16_impl_c(const uint8_t *data, ptrdiff_t stride, ptrdiff_t width, ptrdiff_t height, uint16_t mpeg_min, uint16_t mpeg_max)
static const int16_t alpha[]
void ff_color_detect_dsp_init_aarch64(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
AVColorRange
Visual content value range.
int(* cond)(enum AVPixelFormat pix_fmt)
@ FF_ALPHA_STRAIGHT
alpha < pixel