40 int jobnr,
int nb_jobs);
44 float y = yptr[x] * imax; \
45 float u = uptr[x] * imax - .5f; \
46 float v = vptr[x] * imax - .5f; \
50 nu = saturation * (u + y * bd + bl); \
51 nv = saturation * (v + y * rd + rl);
57 const int depth =
s->depth;
58 const float max = (1 << depth) - 1;
59 const float imax = 1.f /
max;
62 const int slice_start = (
height * jobnr) / nb_jobs;
70 const float saturation =
s->saturation;
71 const float bl =
s->bl;
72 const float rl =
s->rl;
73 const float bd =
s->bh - bl;
74 const float rd =
s->rh - rl;
76 for (
int y = slice_start; y <
slice_end; y++) {
77 for (
int x = 0; x <
width; x++) {
97 const int depth =
s->depth;
98 const float max = (1 << depth) - 1;
99 const float imax = 1.f /
max;
102 const int slice_start = (
height * jobnr) / nb_jobs;
107 uint16_t *yptr = (uint16_t *)
frame->
data[0] + slice_start * ylinesize;
108 uint16_t *uptr = (uint16_t *)
frame->
data[1] + slice_start * ulinesize;
109 uint16_t *vptr = (uint16_t *)
frame->
data[2] + slice_start * vlinesize;
110 const float saturation =
s->saturation;
111 const float bl =
s->bl;
112 const float rl =
s->rl;
113 const float bd =
s->bh - bl;
114 const float rd =
s->rh - rl;
117 for (
int x = 0; x <
width; x++) {
168 s->depth =
desc->comp[0].depth;
193 #define OFFSET(x) offsetof(ColorCorrectContext, x)
194 #define VF AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
208 .
name =
"colorcorrect",
209 .description =
NULL_IF_CONFIG_SMALL(
"Adjust color white balance selectively for blacks and whites."),
211 .priv_class = &colorcorrect_class,
static const AVFilterPad inputs[]
static const AVFilterPad outputs[]
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Main libavfilter public API header.
#define flags(name, subs,...)
static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
Clip a signed integer to an unsigned power of two range.
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int slice_end(AVCodecContext *avctx, AVFrame *pict)
Handle slice ends.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_YUVA444P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
#define AV_PIX_FMT_YUVA444P16
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_YUVA444P9
#define AV_PIX_FMT_YUVA444P12
#define AV_PIX_FMT_YUV444P16
#define AV_PIX_FMT_YUV444P10
Describe the class of an AVClass context structure.
A link between two filters.
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
const char * name
Pad name.
const char * name
Filter name.
AVFormatInternal * internal
An opaque field for libavformat internal usage.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int(* do_slice)(AVFilterContext *s, void *arg, int jobnr, int nb_jobs)
static int colorcorrect_slice16(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static const AVOption colorcorrect_options[]
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
static av_cold int query_formats(AVFilterContext *ctx)
AVFilter ff_vf_colorcorrect
static const AVFilterPad colorcorrect_inputs[]
static av_cold int config_input(AVFilterLink *inlink)
static const AVFilterPad colorcorrect_outputs[]
static int colorcorrect_slice8(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
AVFILTER_DEFINE_CLASS(colorcorrect)