FFmpeg
|
Use a palette to downsample an input video stream. More...
#include "libavutil/bprint.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/qsort.h"
#include "dualinput.h"
#include "avfilter.h"
Go to the source code of this file.
Data Structures | |
struct | color_node |
struct | cached_color |
struct | cache_node |
struct | PaletteUseContext |
struct | nearest_color |
struct | stack_node |
struct | color |
struct | color_rect |
Macros | |
#define | NBITS 5 |
#define | CACHE_SIZE (1<<(3*NBITS)) |
#define | OFFSET(x) offsetof(PaletteUseContext, x) |
#define | FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
#define | COLORMAP_NEAREST(search, palette, root, target) |
#define | INDENT 4 |
#define | DECLARE_CMP_FUNC(name, pos) |
#define | DEFINE_SET_FRAME(color_search, name, value) |
#define | DEFINE_SET_FRAME_COLOR_SEARCH(color_search, color_search_macro) |
#define | DITHERING_ENTRIES(color_search) |
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 *) |
Variables | |
static const AVOption | paletteuse_options [] |
static const cmp_func | cmp_funcs [] = {cmp_r, cmp_g, cmp_b} |
static const set_frame_func | set_frame_lut [NB_COLOR_SEARCHES][NB_DITHERING] |
static const AVFilterPad | paletteuse_inputs [] |
static const AVFilterPad | paletteuse_outputs [] |
AVFilter | ff_vf_paletteuse |
Use a palette to downsample an input video stream.
Definition in file vf_paletteuse.c.
#define NBITS 5 |
Definition at line 63 of file vf_paletteuse.c.
Referenced by color_get().
#define CACHE_SIZE (1<<(3*NBITS)) |
Definition at line 64 of file vf_paletteuse.c.
Referenced by load_palette(), and uninit().
#define OFFSET | ( | x | ) | offsetof(PaletteUseContext, x) |
Definition at line 105 of file vf_paletteuse.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 106 of file vf_paletteuse.c.
Definition at line 313 of file vf_paletteuse.c.
Referenced by color_get(), and debug_accuracy().
#define INDENT 4 |
Definition at line 481 of file vf_paletteuse.c.
Referenced by disp_node().
#define DECLARE_CMP_FUNC | ( | name, | |
pos | |||
) |
Definition at line 578 of file vf_paletteuse.c.
Definition at line 971 of file vf_paletteuse.c.
#define DEFINE_SET_FRAME_COLOR_SEARCH | ( | color_search, | |
color_search_macro | |||
) |
Definition at line 978 of file vf_paletteuse.c.
#define DITHERING_ENTRIES | ( | color_search | ) |
Definition at line 990 of file vf_paletteuse.c.
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 78 of file vf_paletteuse.c.
Definition at line 576 of file vf_paletteuse.c.
enum dithering_mode |
Enumerator | |
---|---|
DITHERING_NONE | |
DITHERING_BAYER | |
DITHERING_HECKBERT | |
DITHERING_FLOYD_STEINBERG | |
DITHERING_SIERRA2 | |
DITHERING_SIERRA2_4A | |
NB_DITHERING |
Definition at line 33 of file vf_paletteuse.c.
enum color_search_method |
Enumerator | |
---|---|
COLOR_SEARCH_NNS_ITERATIVE | |
COLOR_SEARCH_NNS_RECURSIVE | |
COLOR_SEARCH_BRUTEFORCE | |
NB_COLOR_SEARCHES |
Definition at line 43 of file vf_paletteuse.c.
enum diff_mode |
Enumerator | |
---|---|
DIFF_MODE_NONE | |
DIFF_MODE_RECTANGLE | |
NB_DIFF_MODE |
Definition at line 50 of file vf_paletteuse.c.
AVFILTER_DEFINE_CLASS | ( | paletteuse | ) |
|
static |
Definition at line 132 of file vf_paletteuse.c.
|
static |
Definition at line 154 of file vf_paletteuse.c.
Referenced by set_frame().
|
static |
Definition at line 161 of file vf_paletteuse.c.
Referenced by colormap_nearest_bruteforce(), colormap_nearest_iterative(), colormap_nearest_node(), debug_accuracy(), and debug_mean_error().
|
static |
Definition at line 170 of file vf_paletteuse.c.
Referenced by debug_accuracy().
|
static |
Definition at line 199 of file vf_paletteuse.c.
Referenced by colormap_nearest_recursive().
|
static |
Definition at line 229 of file vf_paletteuse.c.
|
static |
Definition at line 241 of file vf_paletteuse.c.
|
static |
Check if the requested color is in the cache already.
If not, find it in the color tree and cache it. Note: r, g, and b are the component of c but are passed as well to avoid recomputing them (they are generally computed by the caller for other uses).
Definition at line 324 of file vf_paletteuse.c.
Referenced by get_dst_color_err(), and set_frame().
|
static |
Definition at line 354 of file vf_paletteuse.c.
Referenced by set_frame().
|
static |
Definition at line 371 of file vf_paletteuse.c.
|
static |
Definition at line 482 of file vf_paletteuse.c.
Referenced by disp_tree().
|
static |
Definition at line 510 of file vf_paletteuse.c.
Referenced by load_colormap().
|
static |
Definition at line 535 of file vf_paletteuse.c.
Referenced by load_colormap().
|
static |
Definition at line 593 of file vf_paletteuse.c.
Referenced by colormap_insert().
|
static |
Definition at line 650 of file vf_paletteuse.c.
Referenced by load_colormap().
Definition at line 694 of file vf_paletteuse.c.
Referenced by load_colormap().
|
static |
Definition at line 701 of file vf_paletteuse.c.
Referenced by load_palette().
|
static |
Definition at line 737 of file vf_paletteuse.c.
Referenced by apply_palette().
|
static |
Definition at line 767 of file vf_paletteuse.c.
Referenced by apply_palette().
|
static |
Definition at line 856 of file vf_paletteuse.c.
Referenced by load_apply_palette().
|
static |
Definition at line 897 of file vf_paletteuse.c.
|
static |
Definition at line 912 of file vf_paletteuse.c.
|
static |
Definition at line 927 of file vf_paletteuse.c.
Referenced by load_apply_palette().
|
static |
Definition at line 954 of file vf_paletteuse.c.
Referenced by init().
|
static |
Definition at line 965 of file vf_paletteuse.c.
Definition at line 1005 of file vf_paletteuse.c.
Referenced by init().
|
static |
Definition at line 1013 of file vf_paletteuse.c.
|
static |
Definition at line 1033 of file vf_paletteuse.c.
|
static |
Definition at line 1039 of file vf_paletteuse.c.
|
static |
Definition at line 107 of file vf_paletteuse.c.
|
static |
Definition at line 591 of file vf_paletteuse.c.
Referenced by get_next_color().
|
static |
Definition at line 999 of file vf_paletteuse.c.
|
static |
Definition at line 1051 of file vf_paletteuse.c.
|
static |
Definition at line 1066 of file vf_paletteuse.c.
AVFilter ff_vf_paletteuse |
Definition at line 1076 of file vf_paletteuse.c.