FFmpeg
|
#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 *) |
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 |
Use a palette to downsample an input video stream.
Definition in file vf_paletteuse.c.
#define CACHE_SIZE (1<<15) |
Definition at line 71 of file vf_paletteuse.c.
#define OFFSET | ( | x | ) | offsetof(PaletteUseContext, x) |
Definition at line 112 of file vf_paletteuse.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 113 of file vf_paletteuse.c.
#define INDENT 4 |
Definition at line 458 of file vf_paletteuse.c.
#define DECLARE_CMP_FUNC | ( | name | ) |
Definition at line 523 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 85 of file vf_paletteuse.c.
typedef int(* cmp_func) (const void *, const void *) |
Definition at line 521 of file vf_paletteuse.c.
enum 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.
enum diff_mode |
Enumerator | |
---|---|
DIFF_MODE_NONE | |
DIFF_MODE_RECTANGLE | |
NB_DIFF_MODE |
Definition at line 53 of file vf_paletteuse.c.
AVFILTER_DEFINE_CLASS | ( | paletteuse | ) |
|
static |
Definition at line 878 of file vf_paletteuse.c.
Referenced by config_output().
|
static |
Definition at line 139 of file vf_paletteuse.c.
|
static |
Definition at line 155 of file vf_paletteuse.c.
Referenced by set_frame().
|
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(), 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(), 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(), magicyuv_median_pred16(), main(), make_noises(), max_component_diff(), mdec_decode_block_intra(), mf_enca_output_score(), motion_search(), mpeg2_decode_block_intra(), mpeg2_fast_decode_block_intra(), 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(), 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().
|
static |
Definition at line 182 of file vf_paletteuse.c.
Referenced by color_get(), and colormap_insert().
|
static |
Definition at line 194 of file vf_paletteuse.c.
Referenced by colormap_nearest().
|
static |
Definition at line 224 of file vf_paletteuse.c.
Referenced by color_get().
|
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().
|
static |
Definition at line 269 of file vf_paletteuse.c.
Referenced by set_frame().
|
static |
Definition at line 290 of file vf_paletteuse.c.
|
static |
Definition at line 459 of file vf_paletteuse.c.
Referenced by disp_tree().
|
static |
Definition at line 486 of file vf_paletteuse.c.
Referenced by load_colormap().
|
static |
Definition at line 537 of file vf_paletteuse.c.
Referenced by colormap_insert().
|
static |
Definition at line 593 of file vf_paletteuse.c.
Referenced by load_colormap().
|
static |
Definition at line 636 of file vf_paletteuse.c.
Referenced by load_colormap().
|
static |
Definition at line 643 of file vf_paletteuse.c.
Referenced by load_palette().
|
static |
Definition at line 679 of file vf_paletteuse.c.
Referenced by apply_palette().
|
static |
Definition at line 768 of file vf_paletteuse.c.
Referenced by load_apply_palette().
|
static |
Definition at line 807 of file vf_paletteuse.c.
|
static |
Definition at line 829 of file vf_paletteuse.c.
|
static |
Definition at line 844 of file vf_paletteuse.c.
Referenced by load_apply_palette().
Definition at line 933 of file vf_paletteuse.c.
Referenced by init().
|
static |
Definition at line 941 of file vf_paletteuse.c.
|
static |
Definition at line 962 of file vf_paletteuse.c.
|
static |
Definition at line 968 of file vf_paletteuse.c.
|
static |
Definition at line 114 of file vf_paletteuse.c.
|
static |
Definition at line 535 of file vf_paletteuse.c.
Referenced by get_next_color().
|
static |
Definition at line 921 of file vf_paletteuse.c.
Referenced by init().
|
static |
Definition at line 979 of file vf_paletteuse.c.
|
static |
Definition at line 990 of file vf_paletteuse.c.
const AVFilter ff_vf_paletteuse |
Definition at line 998 of file vf_paletteuse.c.