FFmpeg
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
vf_paletteuse.c File Reference
#include "libavutil/bprint.h"
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/qsort.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"
#include "framesync.h"
#include "internal.h"
#include "palette.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  color_info
 
struct  color_node
 
struct  cached_color
 
struct  cache_node
 
struct  PaletteUseContext
 
struct  nearest_color
 
struct  stack_node
 
struct  color
 
struct  color_rect
 

Macros

#define CACHE_SIZE   (1<<15)
 
#define OFFSET(x)   offsetof(PaletteUseContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define INDENT   4
 
#define DECLARE_CMP_FUNC(name)
 
#define DEFINE_SET_FRAME(name, value)
 

Typedefs

typedef int(* set_frame_func) (struct PaletteUseContext *s, AVFrame *out, AVFrame *in, int x_start, int y_start, int width, int height)
 
typedef int(* cmp_func) (const void *, const void *)
 

Enumerations

enum  dithering_mode {
  DITHERING_NONE, DITHERING_BAYER, DITHERING_HECKBERT, DITHERING_FLOYD_STEINBERG,
  DITHERING_SIERRA2, DITHERING_SIERRA2_4A, DITHERING_SIERRA3, DITHERING_BURKES,
  DITHERING_ATKINSON, NB_DITHERING
}
 
enum  diff_mode { DIFF_MODE_NONE, DIFF_MODE_RECTANGLE, NB_DIFF_MODE }
 

Functions

 AVFILTER_DEFINE_CLASS (paletteuse)
 
static int load_apply_palette (FFFrameSync *fs)
 
static int query_formats (AVFilterContext *ctx)
 
static av_always_inline uint32_t dither_color (uint32_t px, int er, int eg, int eb, int scale, int shift)
 
static av_always_inline int diff (const struct color_info *a, const struct color_info *b, const int trans_thresh)
 
static struct color_info get_color_from_srgb (uint32_t srgb)
 
static void colormap_nearest_node (const struct color_node *map, const int node_pos, const struct color_info *target, const int trans_thresh, struct nearest_color *nearest)
 
static av_always_inline uint8_t colormap_nearest (const struct color_node *node, const struct color_info *target, const int trans_thresh)
 
static av_always_inline int color_get (PaletteUseContext *s, uint32_t color)
 Check if the requested color is in the cache already. More...
 
static av_always_inline int get_dst_color_err (PaletteUseContext *s, uint32_t c, int *er, int *eg, int *eb)
 
static av_always_inline int set_frame (PaletteUseContext *s, AVFrame *out, AVFrame *in, int x_start, int y_start, int w, int h, enum dithering_mode dither)
 
static void disp_node (AVBPrint *buf, const struct color_node *map, int parent_id, int node_id, int depth)
 
static int disp_tree (const struct color_node *node, const char *fname)
 
static int get_next_color (const uint8_t *color_used, const uint32_t *palette, int *component, const struct color_rect *box)
 
static int colormap_insert (struct color_node *map, uint8_t *color_used, int *nb_used, const uint32_t *palette, const int trans_thresh, const struct color_rect *box)
 
static int cmp_pal_entry (const void *a, const void *b)
 
static void load_colormap (PaletteUseContext *s)
 
static void set_processing_window (enum diff_mode diff_mode, const AVFrame *prv_src, const AVFrame *cur_src, const AVFrame *prv_dst, AVFrame *cur_dst, int *xp, int *yp, int *wp, int *hp)
 
static int apply_palette (AVFilterLink *inlink, AVFrame *in, AVFrame **outf)
 
static int config_output (AVFilterLink *outlink)
 
static int config_input_palette (AVFilterLink *inlink)
 
static void load_palette (PaletteUseContext *s, const AVFrame *palette_frame)
 
static int dither_value (int p)
 
static av_cold int init (AVFilterContext *ctx)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption paletteuse_options []
 
static const cmp_func cmp_funcs [] = {cmp_L, cmp_a, cmp_b}
 
static const set_frame_func set_frame_lut [NB_DITHERING]
 
static const AVFilterPad paletteuse_inputs []
 
static const AVFilterPad paletteuse_outputs []
 
const AVFilter ff_vf_paletteuse
 

Detailed Description

Use a palette to downsample an input video stream.

Definition in file vf_paletteuse.c.

Macro Definition Documentation

◆ CACHE_SIZE

#define CACHE_SIZE   (1<<15)

Definition at line 71 of file vf_paletteuse.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(PaletteUseContext, x)

Definition at line 112 of file vf_paletteuse.c.

◆ FLAGS

Definition at line 113 of file vf_paletteuse.c.

◆ INDENT

#define INDENT   4

Definition at line 458 of file vf_paletteuse.c.

◆ DECLARE_CMP_FUNC

#define DECLARE_CMP_FUNC (   name)
Value:
static int cmp_##name(const void *pa, const void *pb) \
{ \
const struct color *a = pa; \
const struct color *b = pb; \
return FFDIFFSIGN(a->value.name, b->value.name); \
}

Definition at line 523 of file vf_paletteuse.c.

◆ DEFINE_SET_FRAME

#define DEFINE_SET_FRAME (   name,
  value 
)
Value:
static int set_frame_##name(PaletteUseContext *s, AVFrame *out, AVFrame *in, \
int x_start, int y_start, int w, int h) \
{ \
return set_frame(s, out, in, x_start, y_start, w, h, value); \
}

Definition at line 904 of file vf_paletteuse.c.

Typedef Documentation

◆ set_frame_func

typedef int(* set_frame_func) (struct PaletteUseContext *s, AVFrame *out, AVFrame *in, int x_start, int y_start, int width, int height)

Definition at line 85 of file vf_paletteuse.c.

◆ cmp_func

typedef int(* cmp_func) (const void *, const void *)

Definition at line 521 of file vf_paletteuse.c.

Enumeration Type Documentation

◆ dithering_mode

Enumerator
DITHERING_NONE 
DITHERING_BAYER 
DITHERING_HECKBERT 
DITHERING_FLOYD_STEINBERG 
DITHERING_SIERRA2 
DITHERING_SIERRA2_4A 
DITHERING_SIERRA3 
DITHERING_BURKES 
DITHERING_ATKINSON 
NB_DITHERING 

Definition at line 40 of file vf_paletteuse.c.

◆ diff_mode

enum diff_mode
Enumerator
DIFF_MODE_NONE 
DIFF_MODE_RECTANGLE 
NB_DIFF_MODE 

Definition at line 53 of file vf_paletteuse.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( paletteuse  )

◆ load_apply_palette()

static int load_apply_palette ( FFFrameSync fs)
static

Definition at line 878 of file vf_paletteuse.c.

Referenced by config_output().

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 139 of file vf_paletteuse.c.

◆ dither_color()

static av_always_inline uint32_t dither_color ( uint32_t  px,
int  er,
int  eg,
int  eb,
int  scale,
int  shift 
)
static

Definition at line 155 of file vf_paletteuse.c.

Referenced by set_frame().

◆ diff()

static av_always_inline int diff ( const struct color_info a,
const struct color_info b,
const int  trans_thresh 
)
static

Definition at line 164 of file vf_paletteuse.c.

Referenced by abs_sub_q(), activate(), add_hfyu_median_pred_int16_c(), add_lag_median_prediction(), add_median_pred_c(), add_median_prediction(), adpcm_ct_expand_nibble(), adpcm_decode_frame(), adpcm_ima_alp_compress_sample(), adpcm_ima_alp_expand_nibble(), adpcm_ima_expand_nibble(), adpcm_ima_oki_expand_nibble(), adpcm_ima_qt_compress_sample(), adpcm_ima_qt_expand_nibble(), adpcm_ima_wav_expand_nibble(), adpcm_sbpro_expand_nibble(), amdl_update_prob(), aptx_encode_channel(), aribcaption_trans_ass_subtitle(), arith2_get_consumed_bytes(), asf_read_frame_header(), block_angle(), blur(), build_diff_map(), calc_slice_sizes(), cbs_av1_get_relative_dist(), cclm_get_params(), celt_decode_tf_changes(), celt_enc_tf(), celt_quant_fine(), check_add_median_pred(), codebook_sanity_check_for_rate_quarter(), colormap_nearest_node(), comp_harmonic_coeff(), compare_blocks(), compute_target_delay(), config_filter(), copy_region_enc(), correct_input_start_times(), deband_16_c(), deband_8_c(), decode(), decode_channel_sf_idx(), decode_channel_wordlen(), decode_dc(), decode_dc_le(), decode_frame(), decode_line(), decode_packet(), decode_residual(), decode_tones_amplitude(), dering_TMPL(), derive_bdof_vx_vy(), derive_mmvd(), derive_subblock_diff_mvs(), detect_scene_change(), diff_c(), dnxhd_calc_bits_thread(), dnxhd_encode_dc(), do_backgroundkey16_slice(), do_backgroundkey_slice(), do_chromahold16_slice(), do_chromahold_slice(), do_chromakey_pixel(), do_chromakey_pixel16(), do_colorkey_pixel(), do_hsvkey_pixel(), dpcm_decode_frame(), dpcm_predict(), draw_spatial(), dts_probe(), encode_block(), encode_dc(), encode_high(), encode_line(), encode_low(), encode_residual_ch(), encode_scale_factors(), enqueue_packet(), est_alpha_diff(), estimate_pitch(), eval_sse(), exp_quant_coarse(), fbdev_write_packet(), ff_dcaadpcm_subband_analysis(), ff_icc_profile_sanitize(), ff_libwebp_get_frame(), ff_mpeg1_decode_block_intra(), ff_mpeg4_encode_mb(), ff_rate_estimate_qscale(), filter_frame(), find_block_motion(), find_missing_packets(), find_timestamp_in_playlist(), fixed_gain_smooth(), fold(), get_closest_codebook(), get_pts(), get_relative_dist(), get_scene_score(), get_video_frame(), h263_decode_block(), h264_filter(), index_mb(), init_quantized_coeffs_elem0(), inv_predict_11(), IsAlmostEqual(), limitdiff16(), limitdiff8(), ljpeg_encode_bgr(), lsf2lsp(), lsf_decode(), luma_intra_pred_mode(), magicyuv_median_pred16(), main(), make_noises(), max_component_diff(), max_negtive(), mdec_decode_block_intra(), mf_enca_output_score(), min_positive(), motion_search(), mpeg2_decode_block_intra(), mux_log_debug_ts(), mvi_update_prediction(), parse_playlist(), parse_tonal(), perform_dc_correction(), pixel_color7_slow(), process_subpacket_9(), put_alpha_diff(), pxr24_uncompress(), rgb2yuv_fsb(), rtp_parse_one_packet(), rv30_weak_loop_filter(), rv40_weak_loop_filter(), sad_16width_msa(), sad_8width_msa(), sad_horiz_bilinear_filter_16width_msa(), sad_horiz_bilinear_filter_8width_msa(), sad_hv_bilinear_filter_16width_msa(), sad_hv_bilinear_filter_8width_msa(), sad_vert_bilinear_filter_16width_msa(), sad_vert_bilinear_filter_8width_msa(), select_from_pts_buffer(), silk_stabilize_lsf(), smvd_find(), speedhq_init_static_data(), sqrdiff(), svq1_decode_motion_vector(), swap_samplerates_on_filter(), synchronize_audio(), tm2_null_res_block(), truemotion2rt_decode_frame(), update_ch_subobj(), update_qscale(), validate_options(), vp8_handle_packet(), wavpack_encode_block(), and wmv2_pred_motion().

◆ get_color_from_srgb()

static struct color_info get_color_from_srgb ( uint32_t  srgb)
static

Definition at line 182 of file vf_paletteuse.c.

Referenced by color_get(), and colormap_insert().

◆ colormap_nearest_node()

static void colormap_nearest_node ( const struct color_node map,
const int  node_pos,
const struct color_info target,
const int  trans_thresh,
struct nearest_color nearest 
)
static

Definition at line 194 of file vf_paletteuse.c.

Referenced by colormap_nearest().

◆ colormap_nearest()

static av_always_inline uint8_t colormap_nearest ( const struct color_node node,
const struct color_info target,
const int  trans_thresh 
)
static

Definition at line 224 of file vf_paletteuse.c.

Referenced by color_get().

◆ color_get()

static av_always_inline int color_get ( PaletteUseContext s,
uint32_t  color 
)
static

Check if the requested color is in the cache already.

If not, find it in the color tree and cache it.

Definition at line 240 of file vf_paletteuse.c.

Referenced by get_dst_color_err(), and set_frame().

◆ get_dst_color_err()

static av_always_inline int get_dst_color_err ( PaletteUseContext s,
uint32_t  c,
int er,
int eg,
int eb 
)
static

Definition at line 269 of file vf_paletteuse.c.

Referenced by set_frame().

◆ set_frame()

static av_always_inline int set_frame ( PaletteUseContext s,
AVFrame out,
AVFrame in,
int  x_start,
int  y_start,
int  w,
int  h,
enum dithering_mode  dither 
)
static

Definition at line 290 of file vf_paletteuse.c.

◆ disp_node()

static void disp_node ( AVBPrint *  buf,
const struct color_node map,
int  parent_id,
int  node_id,
int  depth 
)
static

Definition at line 459 of file vf_paletteuse.c.

Referenced by disp_tree().

◆ disp_tree()

static int disp_tree ( const struct color_node node,
const char *  fname 
)
static

Definition at line 486 of file vf_paletteuse.c.

Referenced by load_colormap().

◆ get_next_color()

static int get_next_color ( const uint8_t *  color_used,
const uint32_t *  palette,
int component,
const struct color_rect box 
)
static

Definition at line 537 of file vf_paletteuse.c.

Referenced by colormap_insert().

◆ colormap_insert()

static int colormap_insert ( struct color_node map,
uint8_t *  color_used,
int nb_used,
const uint32_t *  palette,
const int  trans_thresh,
const struct color_rect box 
)
static

Definition at line 593 of file vf_paletteuse.c.

Referenced by load_colormap().

◆ cmp_pal_entry()

static int cmp_pal_entry ( const void *  a,
const void *  b 
)
static

Definition at line 636 of file vf_paletteuse.c.

Referenced by load_colormap().

◆ load_colormap()

static void load_colormap ( PaletteUseContext s)
static

Definition at line 643 of file vf_paletteuse.c.

Referenced by load_palette().

◆ set_processing_window()

static void set_processing_window ( enum diff_mode  diff_mode,
const AVFrame prv_src,
const AVFrame cur_src,
const AVFrame prv_dst,
AVFrame cur_dst,
int xp,
int yp,
int wp,
int hp 
)
static

Definition at line 679 of file vf_paletteuse.c.

Referenced by apply_palette().

◆ apply_palette()

static int apply_palette ( AVFilterLink inlink,
AVFrame in,
AVFrame **  outf 
)
static

Definition at line 768 of file vf_paletteuse.c.

Referenced by load_apply_palette().

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 807 of file vf_paletteuse.c.

◆ config_input_palette()

static int config_input_palette ( AVFilterLink inlink)
static

Definition at line 829 of file vf_paletteuse.c.

◆ load_palette()

static void load_palette ( PaletteUseContext s,
const AVFrame palette_frame 
)
static

Definition at line 844 of file vf_paletteuse.c.

Referenced by load_apply_palette().

◆ dither_value()

static int dither_value ( int  p)
static

Definition at line 933 of file vf_paletteuse.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 941 of file vf_paletteuse.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 962 of file vf_paletteuse.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 968 of file vf_paletteuse.c.

Variable Documentation

◆ paletteuse_options

const AVOption paletteuse_options[]
static
Initial value:
= {
{ "dither", "select dithering mode", OFFSET(dither), AV_OPT_TYPE_INT, {.i64=DITHERING_SIERRA2_4A}, 0, NB_DITHERING-1, FLAGS, .unit = "dithering_mode" },
{ "bayer", "ordered 8x8 bayer dithering (deterministic)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_BAYER}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "heckbert", "dithering as defined by Paul Heckbert in 1982 (simple error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_HECKBERT}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "floyd_steinberg", "Floyd and Steingberg dithering (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_FLOYD_STEINBERG}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "sierra2", "Frankie Sierra dithering v2 (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_SIERRA2}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "sierra2_4a", "Frankie Sierra dithering v2 \"Lite\" (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_SIERRA2_4A}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "sierra3", "Frankie Sierra dithering v3 (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_SIERRA3}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "burkes", "Burkes dithering (error diffusion)", 0, AV_OPT_TYPE_CONST, {.i64=DITHERING_BURKES}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "atkinson", "Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion)",0, AV_OPT_TYPE_CONST, {.i64=DITHERING_ATKINSON}, INT_MIN, INT_MAX, FLAGS, .unit = "dithering_mode" },
{ "bayer_scale", "set scale for bayer dithering", OFFSET(bayer_scale), AV_OPT_TYPE_INT, {.i64=2}, 0, 5, FLAGS },
{ "diff_mode", "set frame difference mode", OFFSET(diff_mode), AV_OPT_TYPE_INT, {.i64=DIFF_MODE_NONE}, 0, NB_DIFF_MODE-1, FLAGS, .unit = "diff_mode" },
{ "rectangle", "process smallest different rectangle", 0, AV_OPT_TYPE_CONST, {.i64=DIFF_MODE_RECTANGLE}, INT_MIN, INT_MAX, FLAGS, .unit = "diff_mode" },
{ "new", "take new palette for each output frame", OFFSET(new), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ "alpha_threshold", "set the alpha threshold for transparency", OFFSET(trans_thresh), AV_OPT_TYPE_INT, {.i64=128}, 0, 255, FLAGS },
{ "debug_kdtree", "save Graphviz graph of the kdtree in specified file", OFFSET(dot_filename), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
{ NULL }
}

Definition at line 114 of file vf_paletteuse.c.

◆ cmp_funcs

const cmp_func cmp_funcs[] = {cmp_L, cmp_a, cmp_b}
static

Definition at line 535 of file vf_paletteuse.c.

Referenced by get_next_color().

◆ set_frame_lut

const set_frame_func set_frame_lut[NB_DITHERING]
static
Initial value:
= {
[DITHERING_NONE] = set_frame_none,
[DITHERING_BAYER] = set_frame_bayer,
[DITHERING_HECKBERT] = set_frame_heckbert,
[DITHERING_FLOYD_STEINBERG] = set_frame_floyd_steinberg,
[DITHERING_SIERRA2] = set_frame_sierra2,
[DITHERING_SIERRA2_4A] = set_frame_sierra2_4a,
[DITHERING_SIERRA3] = set_frame_sierra3,
[DITHERING_BURKES] = set_frame_burkes,
[DITHERING_ATKINSON] = set_frame_atkinson,
}

Definition at line 921 of file vf_paletteuse.c.

Referenced by init().

◆ paletteuse_inputs

const AVFilterPad paletteuse_inputs[]
static
Initial value:
= {
{
.name = "default",
},{
.name = "palette",
.config_props = config_input_palette,
},
}

Definition at line 979 of file vf_paletteuse.c.

◆ paletteuse_outputs

const AVFilterPad paletteuse_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
}

Definition at line 990 of file vf_paletteuse.c.

◆ ff_vf_paletteuse

const AVFilter ff_vf_paletteuse
Initial value:
= {
.name = "paletteuse",
.description = NULL_IF_CONFIG_SMALL("Use a palette to downsample an input video stream."),
.priv_size = sizeof(PaletteUseContext),
.init = init,
.priv_class = &paletteuse_class,
}

Definition at line 998 of file vf_paletteuse.c.

config_input_palette
static int config_input_palette(AVFilterLink *inlink)
Definition: vf_paletteuse.c:829
name
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 default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_paletteuse.c:139
set_frame
static av_always_inline int set_frame(PaletteUseContext *s, AVFrame *out, AVFrame *in, int x_start, int y_start, int w, int h, enum dithering_mode dither)
Definition: vf_paletteuse.c:290
out
FILE * out
Definition: movenc.c:54
color
Definition: vf_paletteuse.c:511
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_paletteuse.c:941
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:344
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_paletteuse.c:968
w
uint8_t w
Definition: llviddspenc.c:38
b
#define b
Definition: input.c:41
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:159
DIFF_MODE_NONE
@ DIFF_MODE_NONE
Definition: vf_paletteuse.c:54
NB_DITHERING
@ NB_DITHERING
Definition: vf_paletteuse.c:50
FFDIFFSIGN
#define FFDIFFSIGN(x, y)
Comparator.
Definition: macros.h:45
s
#define s(width, name)
Definition: cbs_vp9.c:198
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_paletteuse.c:807
DITHERING_HECKBERT
@ DITHERING_HECKBERT
Definition: vf_paletteuse.c:43
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
PaletteUseContext
Definition: vf_paletteuse.c:88
DITHERING_NONE
@ DITHERING_NONE
Definition: vf_paletteuse.c:41
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
DITHERING_BAYER
@ DITHERING_BAYER
Definition: vf_paletteuse.c:42
DITHERING_FLOYD_STEINBERG
@ DITHERING_FLOYD_STEINBERG
Definition: vf_paletteuse.c:44
DITHERING_SIERRA2
@ DITHERING_SIERRA2
Definition: vf_paletteuse.c:45
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
DITHERING_SIERRA2_4A
@ DITHERING_SIERRA2_4A
Definition: vf_paletteuse.c:46
DITHERING_SIERRA3
@ DITHERING_SIERRA3
Definition: vf_paletteuse.c:47
activate
static int activate(AVFilterContext *ctx)
Definition: vf_paletteuse.c:962
OFFSET
#define OFFSET(x)
Definition: vf_paletteuse.c:112
value
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 default value
Definition: writing_filters.txt:86
diff_mode
diff_mode
Definition: vf_paletteuse.c:53
FLAGS
#define FLAGS
Definition: vf_paletteuse.c:113
DIFF_MODE_RECTANGLE
@ DIFF_MODE_RECTANGLE
Definition: vf_paletteuse.c:55
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
DITHERING_BURKES
@ DITHERING_BURKES
Definition: vf_paletteuse.c:48
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:251
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
DITHERING_ATKINSON
@ DITHERING_ATKINSON
Definition: vf_paletteuse.c:49
paletteuse_outputs
static const AVFilterPad paletteuse_outputs[]
Definition: vf_paletteuse.c:990
h
h
Definition: vp9dsp_template.c:2038
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:239
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:244
paletteuse_inputs
static const AVFilterPad paletteuse_inputs[]
Definition: vf_paletteuse.c:979
NB_DIFF_MODE
@ NB_DIFF_MODE
Definition: vf_paletteuse.c:56
dither
static const uint8_t dither[8][8]
Definition: vf_fspp.c:60