Go to the documentation of this file.
19 #ifndef AVFILTER_COLORDETECT_H
20 #define AVFILTER_COLORDETECT_H
41 int mpeg_min,
int mpeg_max);
45 const uint8_t *
alpha, ptrdiff_t alpha_stride,
47 int alpha_max,
int mpeg_range,
int offset);
58 uint8_t mpeg_min, uint8_t mpeg_max)
62 for (
int x = 0; x <
width; x++) {
64 cond |= val < mpeg_min || val > mpeg_max;
76 int mpeg_min,
int mpeg_max)
78 av_assume(mpeg_min >= 0 && mpeg_min <= UINT8_MAX);
79 av_assume(mpeg_max >= 0 && mpeg_max <= UINT8_MAX);
85 uint16_t mpeg_min, uint16_t mpeg_max)
88 const uint16_t *data16 = (
const uint16_t *)
data;
90 for (
int x = 0; x <
width; x++) {
91 const uint16_t
val = data16[x];
92 cond |= val < mpeg_min || val > mpeg_max;
104 int mpeg_min,
int mpeg_max)
106 av_assume(mpeg_min >= 0 && mpeg_min <= UINT16_MAX);
107 av_assume(mpeg_max >= 0 && mpeg_max <= UINT16_MAX);
113 const uint8_t *
alpha, ptrdiff_t alpha_stride,
115 int alpha_max,
int mpeg_range,
int offset)
117 uint8_t transparent = 0;
119 uint8_t straight = 0;
120 for (
int x = 0; x <
width; x++) {
122 transparent |=
alpha[x] != alpha_max;
126 color += color_stride;
127 alpha += alpha_stride;
134 const uint8_t *
alpha, ptrdiff_t alpha_stride,
136 int alpha_max,
int mpeg_range,
int offset)
138 uint8_t transparent = 0;
140 uint8_t straight = 0;
141 for (
int x = 0; x <
width; x++) {
143 transparent |=
alpha[x] != alpha_max;
147 color += color_stride;
148 alpha += alpha_stride;
155 const uint8_t *
alpha, ptrdiff_t alpha_stride,
157 int alpha_max,
int mpeg_range,
int offset)
159 uint8_t transparent = 0;
162 const uint16_t *alpha16 = (
const uint16_t *)
alpha;
163 uint8_t straight = 0;
164 for (
int x = 0; x <
width; x++) {
165 straight |=
color16[x] > alpha16[x];
166 transparent |= alpha16[x] != alpha_max;
170 color += color_stride;
171 alpha += alpha_stride;
178 const uint8_t *
alpha, ptrdiff_t alpha_stride,
180 int alpha_max,
int mpeg_range,
int offset)
182 uint8_t transparent = 0;
185 const uint16_t *alpha16 = (
const uint16_t *)
alpha;
186 for (
int x = 0; x <
width; x++) {
189 transparent |= alpha16[x] != alpha_max;
191 color += color_stride;
192 alpha += alpha_stride;
@ FF_ALPHA_TRANSPARENT
alpha < alpha_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 alpha_max, int mpeg_range, int offset)
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 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_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)
static double val(void *priv, double ch)
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)
@ FF_ALPHA_STRAIGHT
alpha < pixel
void ff_color_detect_dsp_init_x86(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
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)
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 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
void ff_color_detect_dsp_init(FFColorDetectDSPContext *dsp, int depth, enum AVColorRange color_range)
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_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 const int16_t alpha[]
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)
int(* cond)(enum AVPixelFormat pix_fmt)