FFmpeg
Loading...
Searching...
No Matches
vf_curves.c File Reference
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/bprint.h"
#include "libavutil/eval.h"
#include "libavutil/file.h"
#include "libavutil/file_open.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "filters.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  keypoint
 
struct  CurvesContext
 
struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define R   0
 
#define G   1
 
#define B   2
 
#define A   3
 
#define NB_COMP   3
 
#define OFFSET(x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 
#define CLIP(v)
 Natural cubic spline interpolation Finding curves using Cubic Splines notes by Steven Rauch and John Stockie.
 
#define BD   0 /* sub diagonal (below main) */
 
#define MD   1 /* main diagonal (center) */
 
#define AD   2 /* sup diagonal (above main) */
 
#define SIGN(x)
 
#define READ16(dst)
 
#define SET_COMP_IF_NOT_SET(n, name)
 

Enumerations

enum  preset {
  PRESET_NONE , PRESET_COLOR_NEGATIVE , PRESET_CROSS_PROCESS , PRESET_DARKER ,
  PRESET_INCREASE_CONTRAST , PRESET_LIGHTER , PRESET_LINEAR_CONTRAST , PRESET_MEDIUM_CONTRAST ,
  PRESET_NEGATIVE , PRESET_STRONG_CONTRAST , PRESET_VINTAGE , NB_PRESETS
}
 
enum  interp { INTERP_NATURAL , INTERP_PCHIP , NB_INTERPS }
 

Functions

 AVFILTER_DEFINE_CLASS (curves)
 
static struct keypointmake_point (double x, double y, struct keypoint *next)
 
static int parse_points_str (AVFilterContext *ctx, struct keypoint **points, const char *s, int lut_size)
 
static int get_nb_points (const struct keypoint *d)
 
static int interpolate (void *log_ctx, uint16_t *y, const struct keypoint *points, int nbits)
 
static double pchip_edge_case (double h0, double h1, double m0, double m1)
 Evalaute the derivative of an edge endpoint.
 
static int pchip_find_derivatives (const int n, const double *hk, const double *mk, double *dk)
 Evalaute the piecewise polynomial derivatives at endpoints.
 
static double interp_cubic_hermite_half (const double x, const double f, const double d)
 Evalaute half of the cubic hermite interpolation expression, wrt one interval endpoint.
 
static int interpolate_pchip (void *log_ctx, uint16_t *y, const struct keypoint *points, int nbits)
 Prepare the lookup table by piecewise monotonic cubic interpolation (PCHIP)
 
static int parse_psfile (AVFilterContext *ctx, const char *fname)
 
static int dump_curves (const char *fname, uint16_t *graph[NB_COMP+1], struct keypoint *comp_points[NB_COMP+1], int lut_size, void *log_ctx)
 
static av_cold int curves_init (AVFilterContext *ctx)
 
static int filter_slice_packed (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int filter_slice_planar (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static av_cold void curves_uninit (AVFilterContext *ctx)
 

Variables

static const AVOption curves_options []
 
struct { 
 
   const char *   r 
 
   const char *   g 
 
   const char *   b 
 
   const char *   master 
 
curves_presets [] 
 
static const AVFilterPad curves_inputs []
 
const FFFilter ff_vf_curves
 

Macro Definition Documentation

◆ R

#define R   0

Definition at line 35 of file vf_curves.c.

◆ G

#define G   1

Definition at line 36 of file vf_curves.c.

◆ B

#define B   2

Definition at line 37 of file vf_curves.c.

◆ A

#define A   3

Definition at line 38 of file vf_curves.c.

◆ NB_COMP

#define NB_COMP   3

Definition at line 45 of file vf_curves.c.

Referenced by config_input(), curves_init(), curves_uninit(), dump_curves(), and process_command().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 92 of file vf_curves.c.

◆ FLAGS

◆ CLIP

#define CLIP ( v)
Value:
(nbits == 8 ? av_clip_uint8(v) : av_clip_uintp2_c(v, nbits))
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.
Definition common.h:280
#define av_clip_uint8
Definition common.h:106

Natural cubic spline interpolation Finding curves using Cubic Splines notes by Steven Rauch and John Stockie.

See also
http://people.math.sfu.ca/~stockie/teaching/macm316/notes/splines.pdf

Definition at line 230 of file vf_curves.c.

Referenced by interpolate(), and interpolate_pchip().

◆ BD

#define BD   0 /* sub diagonal (below main) */

Referenced by interpolate().

◆ MD

#define MD   1 /* main diagonal (center) */

Referenced by interpolate().

◆ AD

#define AD   2 /* sup diagonal (above main) */

◆ SIGN

#define SIGN ( x)
Value:
(x > 0.0 ? 1 : x < 0.0 ? -1 : 0)

Definition at line 355 of file vf_curves.c.

Referenced by config_output(), pchip_edge_case(), and pchip_find_derivatives().

◆ READ16

#define READ16 ( dst)
Value:
do { \
if (size < 2) { \
goto end; \
} \
dst = AV_RB16(buf); \
buf += 2; \
size -= 2; \
} while (0)
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AV_RB16(p)
int size

Referenced by parse_psfile().

◆ SET_COMP_IF_NOT_SET

#define SET_COMP_IF_NOT_SET ( n,
name )
Value:
do { \
if (!pts[n] && curves_presets[curves->preset].name) { \
pts[n] = av_strdup(curves_presets[curves->preset].name); \
if (!pts[n]) \
return AVERROR(ENOMEM); \
} \
} while (0)
#define AVERROR(e)
Definition error.h:45
#define av_strdup(s)
Definition ops_static.c:55
static int64_t pts
static const struct @360350104051211213322115217272171043060164323034 curves_presets[]
static const Curve curves[]

Referenced by curves_init().

Enumeration Type Documentation

◆ preset

enum preset
Enumerator
PRESET_NONE 
PRESET_COLOR_NEGATIVE 
PRESET_CROSS_PROCESS 
PRESET_DARKER 
PRESET_INCREASE_CONTRAST 
PRESET_LIGHTER 
PRESET_LINEAR_CONTRAST 
PRESET_MEDIUM_CONTRAST 
PRESET_NEGATIVE 
PRESET_STRONG_CONTRAST 
PRESET_VINTAGE 
NB_PRESETS 

Definition at line 47 of file vf_curves.c.

◆ interp

enum interp
Enumerator
INTERP_NATURAL 
INTERP_PCHIP 
NB_INTERPS 

Definition at line 62 of file vf_curves.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( curves )

◆ make_point()

static struct keypoint * make_point ( double x,
double y,
struct keypoint * next )
static

Definition at line 156 of file vf_curves.c.

Referenced by parse_points_str().

◆ parse_points_str()

static int parse_points_str ( AVFilterContext * ctx,
struct keypoint ** points,
const char * s,
int lut_size )
static

Definition at line 168 of file vf_curves.c.

Referenced by config_input().

◆ get_nb_points()

static int get_nb_points ( const struct keypoint * d)
static

Definition at line 214 of file vf_curves.c.

Referenced by interpolate(), and interpolate_pchip().

◆ interpolate()

static int interpolate ( void * log_ctx,
uint16_t * y,
const struct keypoint * points,
int nbits )
inlinestatic

Definition at line 232 of file vf_curves.c.

Referenced by config_input().

◆ pchip_edge_case()

static double pchip_edge_case ( double h0,
double h1,
double m0,
double m1 )
static

Evalaute the derivative of an edge endpoint.

Parameters
h0input interval of the interval closest to the edge
h1input interval of the interval next to the closest
m0linear slope of the interval closest to the edge
m1linear slope of the intervalnext to the closest
Returns
edge endpoint derivative

Based on scipy.interpolate._edge_case() https://github.com/scipy/scipy/blob/2e5883ef7af4f5ed4a5b80a1759a45e43163bf3f/scipy/interpolate/_cubic.py#L239 which is a python implementation of the special case endpoints, as suggested in Cleve Moler, Numerical Computing with MATLAB, Chap 3.6 (pchiptx.m)

Definition at line 371 of file vf_curves.c.

Referenced by pchip_find_derivatives().

◆ pchip_find_derivatives()

static int pchip_find_derivatives ( const int n,
const double * hk,
const double * mk,
double * dk )
static

Evalaute the piecewise polynomial derivatives at endpoints.

Parameters
ninput interval of the interval closest to the edge
hkinput intervals
mklinear slopes over intervals
dkendpoint derivatives (output)
Returns
0 success

Based on scipy.interpolate._find_derivatives() https://github.com/scipy/scipy/blob/2e5883ef7af4f5ed4a5b80a1759a45e43163bf3f/scipy/interpolate/_cubic.py#L254

Definition at line 400 of file vf_curves.c.

Referenced by interpolate_pchip().

◆ interp_cubic_hermite_half()

static double interp_cubic_hermite_half ( const double x,
const double f,
const double d )
inlinestatic

Evalaute half of the cubic hermite interpolation expression, wrt one interval endpoint.

Parameters
xnormalized input value at the endpoint
foutput value at the endpoint
dderivative at the endpoint: normalized to the interval, and properly sign adjusted
Returns
half of the interpolated value

Definition at line 444 of file vf_curves.c.

Referenced by interpolate_pchip().

◆ interpolate_pchip()

static int interpolate_pchip ( void * log_ctx,
uint16_t * y,
const struct keypoint * points,
int nbits )
inlinestatic

Prepare the lookup table by piecewise monotonic cubic interpolation (PCHIP)

Parameters
log_ctxfor logging
youtput lookup table (output)
pointsuser-defined control points/endpoints
nbitsbitdepth
Returns
0 success

References: [1] F. N. Fritsch and J. Butland, A method for constructing local monotone piecewise cubic interpolants, SIAM J. Sci. Comput., 5(2), 300-304 (1984). DOI:10.1137/0905021. [2] scipy.interpolate: https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PchipInterpolator.html

Definition at line 465 of file vf_curves.c.

Referenced by config_input().

◆ parse_psfile()

static int parse_psfile ( AVFilterContext * ctx,
const char * fname )
static

Definition at line 586 of file vf_curves.c.

Referenced by curves_init().

◆ dump_curves()

static int dump_curves ( const char * fname,
uint16_t * graph[NB_COMP+1],
struct keypoint * comp_points[NB_COMP+1],
int lut_size,
void * log_ctx )
static

Definition at line 642 of file vf_curves.c.

Referenced by config_input().

◆ curves_init()

static av_cold int curves_init ( AVFilterContext * ctx)
static

Definition at line 703 of file vf_curves.c.

Referenced by process_command().

◆ filter_slice_packed()

static int filter_slice_packed ( AVFilterContext * ctx,
void * arg,
int jobnr,
int nb_jobs )
static

Definition at line 747 of file vf_curves.c.

Referenced by config_input().

◆ filter_slice_planar()

static int filter_slice_planar ( AVFilterContext * ctx,
void * arg,
int jobnr,
int nb_jobs )
static

Definition at line 795 of file vf_curves.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 865 of file vf_curves.c.

Referenced by process_command().

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 931 of file vf_curves.c.

◆ process_command()

static int process_command ( AVFilterContext * ctx,
const char * cmd,
const char * args,
char * res,
int res_len,
int flags )
static

Definition at line 961 of file vf_curves.c.

◆ curves_uninit()

static av_cold void curves_uninit ( AVFilterContext * ctx)
static

Definition at line 997 of file vf_curves.c.

Variable Documentation

◆ curves_options

const AVOption curves_options[]
static
Initial value:
= {
{ "preset", "select a color curves preset", OFFSET(preset), AV_OPT_TYPE_INT, {.i64=PRESET_NONE}, PRESET_NONE, NB_PRESETS-1, FLAGS, .unit = "preset_name" },
{ "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NONE}, 0, 0, FLAGS, .unit = "preset_name" },
{ "color_negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COLOR_NEGATIVE}, 0, 0, FLAGS, .unit = "preset_name" },
{ "cross_process", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CROSS_PROCESS}, 0, 0, FLAGS, .unit = "preset_name" },
{ "darker", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_DARKER}, 0, 0, FLAGS, .unit = "preset_name" },
{ "increase_contrast", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_INCREASE_CONTRAST}, 0, 0, FLAGS, .unit = "preset_name" },
{ "lighter", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_LIGHTER}, 0, 0, FLAGS, .unit = "preset_name" },
{ "linear_contrast", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_LINEAR_CONTRAST}, 0, 0, FLAGS, .unit = "preset_name" },
{ "medium_contrast", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_MEDIUM_CONTRAST}, 0, 0, FLAGS, .unit = "preset_name" },
{ "negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_NEGATIVE}, 0, 0, FLAGS, .unit = "preset_name" },
{ "strong_contrast", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_STRONG_CONTRAST}, 0, 0, FLAGS, .unit = "preset_name" },
{ "vintage", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_VINTAGE}, 0, 0, FLAGS, .unit = "preset_name" },
{ "master","set master points coordinates",OFFSET(comp_points_str[NB_COMP]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "m", "set master points coordinates",OFFSET(comp_points_str[NB_COMP]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "red", "set red points coordinates", OFFSET(comp_points_str[0]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "r", "set red points coordinates", OFFSET(comp_points_str[0]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "green", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "g", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "blue", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "b", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "all", "set points coordinates for all components", OFFSET(comp_points_str_all), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "psfile", "set Photoshop curves file name", OFFSET(psfile), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "plot", "save Gnuplot script of the curves in specified file", OFFSET(plot_filename), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "interp", "specify the kind of interpolation", OFFSET(interp), AV_OPT_TYPE_INT, {.i64=INTERP_NATURAL}, INTERP_NATURAL, NB_INTERPS-1, FLAGS, .unit = "interp_name" },
{ "natural", "natural cubic spline", 0, AV_OPT_TYPE_CONST, {.i64=INTERP_NATURAL}, 0, 0, FLAGS, .unit = "interp_name" },
{ "pchip", "monotonically cubic interpolation", 0, AV_OPT_TYPE_CONST, {.i64=INTERP_PCHIP}, 0, 0, FLAGS, .unit = "interp_name" },
{ NULL }
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
interp
Definition vf_curves.c:62
@ NB_INTERPS
Definition vf_curves.c:65
@ INTERP_PCHIP
Definition vf_curves.c:64
@ INTERP_NATURAL
Definition vf_curves.c:63
#define NB_COMP
Definition vf_curves.c:45
preset
Definition vf_curves.c:47
@ PRESET_NEGATIVE
Definition vf_curves.c:56
@ PRESET_LINEAR_CONTRAST
Definition vf_curves.c:54
@ PRESET_COLOR_NEGATIVE
Definition vf_curves.c:49
@ PRESET_VINTAGE
Definition vf_curves.c:58
@ PRESET_MEDIUM_CONTRAST
Definition vf_curves.c:55
@ PRESET_LIGHTER
Definition vf_curves.c:53
@ PRESET_INCREASE_CONTRAST
Definition vf_curves.c:52
@ PRESET_CROSS_PROCESS
Definition vf_curves.c:50
@ PRESET_STRONG_CONTRAST
Definition vf_curves.c:57
@ NB_PRESETS
Definition vf_curves.c:59
@ PRESET_NONE
Definition vf_curves.c:48
@ PRESET_DARKER
Definition vf_curves.c:51

Definition at line 94 of file vf_curves.c.

◆ r

const char* r

Definition at line 127 of file vf_curves.c.

◆ g

const char* g

Definition at line 128 of file vf_curves.c.

Referenced by aac_encode_frame(), aac_is_encoding_err(), add_hfyu_left_pred_bgr32_c(), add_opt(), add_waves(), adjust_frame_information(), adpcm_decode_frame(), apply_complex_stereo(), apply_dependent_coupling(), apply_dependent_coupling(), apply_intensity_stereo(), apply_intensity_stereo(), apply_mid_side_stereo(), apply_mid_side_stereo(), apply_noise_fill(), aribcaption_trans_bitmap_subtitle(), asf_build_simple_index(), asf_read_content_desc(), asf_read_data(), asf_read_ext_content(), asf_read_ext_stream_properties(), asf_read_ext_stream_properties(), asf_read_header(), asf_read_header(), asf_read_language_list(), asf_read_marker(), asf_read_metadata_obj(), asf_read_properties(), asf_read_simple_index(), asf_read_stream_properties(), asf_read_stream_properties(), asf_read_unknown(), avcodec_string(), avformat_match_stream_specifier(), avpriv_set_systematic_pal2(), bethsoftvid_decode_frame(), bfi_decode_frame(), bgr24ToUV_c(), bgr24ToUV_half_c(), bprint_color(), butterworth_bp_filter(), butterworth_fo_section(), bytestream2_copy_buffer(), bytestream2_copy_bufferu(), bytestream2_get_buffer(), bytestream2_get_bufferu(), bytestream2_get_bytes_left(), bytestream2_init(), bytestream2_seek(), bytestream2_size(), bytestream2_skip(), bytestream2_skipu(), bytestream2_tell(), cairo_set_source(), calc_thr_3gpp(), calculate_gamma(), cas_slice16(), cas_slice8(), cdg_load_palette(), cdtoons_decode_frame(), cdxl_decode_ham6(), cdxl_decode_ham8(), celt_normalize_residual(), celt_renormalize_vector(), chebyshev2_bp_filter(), chebyshev2_fo_section(), choose_rct_params(), cinepak_decode_codebook(), clut_pick_or_set(), color_balance16(), color_balance16_p(), color_balance8(), color_balance8_p(), color_correlation(), color_decorrelation(), colorcontrast_slice16(), colorcontrast_slice16p(), colorcontrast_slice8(), colorcontrast_slice8p(), colormap_slice(), colorscale_matrix(), complex_stereo_downmix_cur(), complex_stereo_downmix_prev(), compress_color(), compute_antialias(), compute_band_indexes(), compute_imdct(), config_input(), config_input(), config_input(), constrain_rgb(), convert(), convert_dir2zdf(), create_lut(), curves_init(), dct_quantize_refine(), decode_adaptive45(), decode_adaptive6(), decode_argb(), decode_argbi(), decode_argx(), decode_argxi(), decode_band_types(), decode_cce(), decode_delta_j(), decode_frame(), decode_frame(), decode_frame(), decode_frame(), decode_frame(), decode_huff(), decode_hybrid(), decode_mvc2(), decode_pal(), decode_plte_chunk(), decode_raw_intra_rgb(), decode_rgb(), decode_rgb_frame_TMPL(), decode_rgbi(), decode_rgbx(), decode_rgbxi(), decode_run_i(), decode_run_p(), decode_scalefactors(), decode_spectrum_and_dequant(), decode_units(), decode_usac_scale_factors(), decode_usac_stereo_cplx(), decode_usac_stereo_info(), decode_value3(), decompress_i(), decompress_i3(), decompress_p(), decompress_p3(), dequant_scalefactors(), detect_unknown_subobject(), difference(), difference2(), dilate(), do_colorkey_pixel(), draw_dot(), draw_glyphs(), dvbsub_encode(), dvbsub_parse_clut_segment(), dwa_uncompress(), dx2_decode_slice_5x5(), encode_float32_rgb_frame(), encode_frame(), encode_rgb_frame_TMPL(), eq_interp(), erode(), estimate_quantization_noise(), expand_rle_row16(), expand_rle_row8(), exponents_from_scale_factors(), ff_aac_search_for_is(), ff_aac_search_for_tns(), ff_dvdclut_yuv_to_rgb(), ff_flac_parse_picture(), ff_get_guid(), ff_get_qtpalette(), ff_init_nextband_map(), ff_jpegls_decode_picture(), ff_mjpeg_decode_frame_from_buf(), ff_oklab_int_to_srgb_u8(), ff_opus_postfilter_rvv(), ff_png_filter_row(), ff_pns_bits(), ff_printGUID(), ff_put_guid(), ff_restore_rgb_planes10_rvv(), ff_restore_rgb_planes_rvv(), ff_srgb_u8_to_oklab_int(), ff_update_palette(), ff_vvc_inv_dct2_16(), ff_vvc_inv_dct2_32(), ff_vvc_inv_dct2_8(), fill_in_tongue(), filter_channels(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_frame(), filter_horizontally(), filter_rgb24(), filter_rgb48(), filter_rgba(), filter_rgba64(), filter_slice_packed(), filter_slice_planar(), find_best_vect(), find_guid(), finish_group(), flic_decode_frame_8BPP(), gamma_convert(), gamma_correct_rgb(), gbr24pToUV_half_c(), gdv_decode_frame(), gdv_read_header(), gem_decode_frame(), gen_image(), gen_sub_bitmap(), generate_joint_tables(), get_cmy_scale(), get_dst_color_err(), get_match_score(), get_max_component_diff(), get_rgb_scale(), get_triplet(), gif_find_frame_end(), gif_parse(), guess_palette(), hsl2rgb(), hsl2rgb(), huffman_decode(), idcin_read_packet(), idct(), idct_1d(), if(), imdct_calc(), import_palette(), incr_cntdec(), init(), init(), init(), init_axis_color(), init_default_clut(), init_long_region(), init_short_region(), interp_band_gain(), jp2_find_codestream(), lerp_colors32(), line_dilate(), line_erode(), load_rgb_float32_frame(), load_rgb_frame_TMPL(), magy_decode_slice(), magy_decode_slice10(), main(), mangle_rgb_planes(), mark_pns(), match_stream_specifier(), mov_write_video_tag(), mp_decode_layer3(), mp_yuv_to_rgb(), mxf_parse_jpeg2000_frame(), nb_decode(), nmr_apply_is_band(), nmr_apply_ms_band(), nmr_band_curve(), nmr_commit_channel(), nmr_decide_stereo(), nmr_is_image_masked(), nmr_setup_channel(), normalize(), old_codec45(), open_files(), optimize_colors(), p01x_wrapper(), paf_video_decode(), parse_3dl(), parse_bit_alloc(), parse_chunks(), parse_exponents(), parse_ifo_palette(), parse_indices(), parse_mantissas(), parse_optgroup(), parse_palette(), parse_palette_segment(), parse_pixel_format(), pcm_dvda_decode_samples(), pgx_decode_frame(), pgx_decode_header(), pgx_get_number(), pitch_filter(), planar_rgb_to_uv(), planar_rgb_to_uv_lasx(), planar_rgb_to_y(), planar_rgb_to_y_lasx(), planar_rgbf16_to_uv(), planar_rgbf16_to_y(), planar_rgbf32_to_uv(), planar_rgbf32_to_y(), pnm_decode_frame(), pnm_encode_frame(), power(), predict_slice(), premult2straight(), preserve_color(), preservel(), preservel(), process_bayer(), process_frame(), process_ipmovie_chunk(), process_sample(), psy_3gpp_analyze_channel(), psy_3gpp_init(), put_header(), put_pixel(), qdmc_decode_init(), quantize_band_cost_cached(), ra144_encode_subblock(), rd_frame(), read_rle_sgi(), read_uncompressed_sgi(), refine_colors(), region_offset2size(), remove_doubling(), reorder_block(), rescale_dec(), restore_rgb_planes10_c(), restore_rgb_planes_c(), rgb12to15(), rgb16_32ToUV_c_template(), rgb16_32ToUV_half_c_template(), rgb16_32ToY_c_template(), rgb24_to_rgb555(), rgb24_to_yuv420p(), rgb24to15_c(), rgb24to16_c(), rgb24tobgr15_c(), rgb24tobgr16_c(), rgb24ToUV_c(), rgb24ToUV_half_c(), rgb24ToY_c(), rgb2yuv(), rgb2yuv(), rgb48ToUV_c_template(), rgb48ToUV_half_c_template(), rgb48Toxyz12_c(), rgb48ToY_c_template(), rgb64ToUV_c_template(), rgb64ToUV_half_c_template(), rgb64ToY_c_template(), rgb_from_cqt(), rgb_to_yuv(), rgba2ycocg(), rgbaf16ToUV_endian(), rgbaf16ToUV_half_endian(), rgbaf16ToY_endian(), rgbf16ToUV_endian(), rgbf16ToUV_half_endian(), rgbf16ToY_endian(), rgbf32_to_uv_c(), rgbf32_to_uv_half_c(), rgbf32_to_y_c(), rgtc2_block_internal(), ripemd128_transform(), ripemd160_transform(), ripemd256_transform(), ripemd320_transform(), rnnoise_channel(), run_channel_fft(), run_postproc(), saturation_matrix(), sb_decode(), sbr_hf_gen(), search_for_ms(), search_for_pns(), search_for_quantizers_fast(), search_for_quantizers_twoloop(), search_for_tns_short_pooled(), set_frame(), set_palette(), set_palette(), set_special_band_scalefactors(), sha256_transform(), sha512_transform(), shuffle_bytes_0321_c(), shuffle_bytes_2103_c(), simbiosis_imx_read_packet(), slice_get_derivative(), spectrum_scale(), stream_specifier_match(), sub_left_prediction_bgr32(), sub_left_prediction_rgb24(), temperature_slice16(), temperature_slice16p(), temperature_slice32(), temperature_slice8(), temperature_slice8p(), tns_max_nonpns(), transform(), transform_step(), unbias_exponents(), update_model2_to_6(), update_model3_to_7(), update_model4_to_5(), update_model5_to_6(), update_palette_index(), vb_decode_framedata(), vgs_eval(), vibrance_slice16(), vibrance_slice16p(), vibrance_slice8(), vibrance_slice8p(), vif_statistic(), vmd_decode(), vmdvideo_decode_init(), vp9_handle_packet(), vqa_decode_frame_pal8(), write_stream_codec_info(), xan_decode_frame(), xyz12Torgb48_c(), xyz_to_rgb(), ycocg2rgba(), yuv2rgb_1_c_template(), yuv2rgb_1_template_lasx(), yuv2rgb_1_template_lsx(), yuv2rgb_2_c_template(), yuv2rgb_2_template_lasx(), yuv2rgb_2_template_lsx(), yuv2rgb_write(), yuv2rgb_write(), yuv2rgb_write(), yuv2rgb_write_full(), yuv2rgb_write_full(), yuv2rgb_write_full(), yuv2rgb_X_c_template(), yuv2rgb_X_template_lasx(), yuv2rgb_X_template_lsx(), yuv_a_to_rgba(), and yuv_from_cqt().

◆ b

const char* b

Definition at line 129 of file vf_curves.c.

◆ master

◆ [struct]

const struct { ... } curves_presets[]
Initial value:
= {
"0.129/1 0.466/0.498 0.725/0",
"0.109/1 0.301/0.498 0.517/0",
"0.098/1 0.235/0.498 0.423/0",
},
"0/0 0.25/0.156 0.501/0.501 0.686/0.745 1/1",
"0/0 0.25/0.188 0.38/0.501 0.745/0.815 1/0.815",
"0/0 0.231/0.094 0.709/0.874 1/1",
},
[PRESET_DARKER] = { .master = "0/0 0.5/0.4 1/1" },
[PRESET_INCREASE_CONTRAST] = { .master = "0/0 0.149/0.066 0.831/0.905 0.905/0.98 1/1" },
[PRESET_LIGHTER] = { .master = "0/0 0.4/0.5 1/1" },
[PRESET_LINEAR_CONTRAST] = { .master = "0/0 0.305/0.286 0.694/0.713 1/1" },
[PRESET_MEDIUM_CONTRAST] = { .master = "0/0 0.286/0.219 0.639/0.643 1/1" },
[PRESET_NEGATIVE] = { .master = "0/1 1/0" },
[PRESET_STRONG_CONTRAST] = { .master = "0/0 0.301/0.196 0.592/0.6 0.686/0.737 1/1" },
"0/0.11 0.42/0.51 1/0.95",
"0/0 0.50/0.48 1/1",
"0/0.22 0.49/0.44 1/0.8",
}
}

◆ curves_inputs

const AVFilterPad curves_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
}
static int config_input(AVFilterLink *inlink)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200

Definition at line 1006 of file vf_curves.c.

◆ ff_vf_curves

const FFFilter ff_vf_curves
Initial value:
= {
.p.name = "curves",
.p.description = NULL_IF_CONFIG_SMALL("Adjust components curves."),
.p.priv_class = &curves_class,
.priv_size = sizeof(CurvesContext),
.process_command = process_command,
}
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition avfilter.h:196
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition avfilter.h:166
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_PIXFMTS(...)
Definition filters.h:250
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
#define AV_PIX_FMT_GBRAP12
Definition pixfmt.h:569
#define AV_PIX_FMT_GBRAP16
Definition pixfmt.h:571
#define AV_PIX_FMT_GBRP9
Definition pixfmt.h:563
#define AV_PIX_FMT_BGR48
Definition pixfmt.h:536
#define AV_PIX_FMT_GBRP10
Definition pixfmt.h:564
#define AV_PIX_FMT_RGBA64
Definition pixfmt.h:535
#define AV_PIX_FMT_GBRP12
Definition pixfmt.h:565
#define AV_PIX_FMT_RGB48
Definition pixfmt.h:531
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition pixfmt.h:75
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition pixfmt.h:265
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition pixfmt.h:99
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition pixfmt.h:101
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition pixfmt.h:264
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition pixfmt.h:212
@ AV_PIX_FMT_RGB0
packed RGB 8:8:8, 32bpp, RGBXRGBX... X=unused/undefined
Definition pixfmt.h:263
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
@ AV_PIX_FMT_0RGB
packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined
Definition pixfmt.h:262
#define AV_PIX_FMT_BGRA64
Definition pixfmt.h:540
#define AV_PIX_FMT_GBRAP10
Definition pixfmt.h:568
#define AV_PIX_FMT_GBRP16
Definition pixfmt.h:567
#define AV_PIX_FMT_GBRP14
Definition pixfmt.h:566
static av_cold int curves_init(AVFilterContext *ctx)
Definition vf_curves.c:703
static const AVFilterPad curves_inputs[]
Definition vf_curves.c:1006
static av_cold void curves_uninit(AVFilterContext *ctx)
Definition vf_curves.c:997
const AVFilterPad ff_video_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_VIDEO.
Definition video.c:37

Definition at line 1015 of file vf_curves.c.