Commit Graph

27 Commits

Author SHA1 Message Date
Timo Rothenpieler 237ccd8a16 lavfi/paletteuse: check get_color return value
Fixes CID #1420396
2017-11-13 20:33:10 +01:00
Clément Bœsch 1d348dd03f lavfi/paletteuse: fix debug_kdtree after aba926e7d 2017-10-28 18:49:49 +02:00
Clément Bœsch 157d08e971 lavfi/paletteuse: fix debug_mean_error after aba926e7d 2017-10-28 18:03:28 +02:00
Clément Bœsch 3d547c19c2 lavfi/paletteuse: fix debug_accuracy after aba926e7d 2017-10-28 18:03:28 +02:00
Clément Bœsch 33e226f84d lavfi/paletteuse: simplify color get function prototypes 2017-10-28 17:39:48 +02:00
Clément Bœsch 5c8e904eb3 lavfi/paletteuse: move "new" option before debugging options 2017-10-28 17:15:06 +02:00
Bjorn Roche aba926e7d6 lavfi/paletteuse: fix to support transparency
This patch enables paletteuse to identify the transparency in incoming
video and tag transparent pixels on outgoing video with the correct
index from the palette.

This requires tracking the transparency index in the palette,
establishing an alpha threshold below which a pixel is considered
transparent and above which the pixel is considered opaque, and
additional changes to track the alpha value throughout the conversion
process.

This change is a partial fix for https://trac.ffmpeg.org/ticket/4443
However, animated GIFs are still output incorrectly due to a bug
in gif optimization which does not correctly handle transparency.

Signed-off-by: Clément Bœsch <u@pkh.me>
2017-10-28 17:14:26 +02:00
Carl Eugen Hoyos 5d3e935728 lavfi: Rename local variables "main" as "master".
Silences several warnings:
main is usually a function
2017-10-07 20:49:48 +02:00
Nicolas George 5f5dcf44e3 lavfi: rename framesync2 to framesync. 2017-09-12 11:03:51 +02:00
Nicolas George 23000c3de5 lavfi/vf_paletteuse: convert to framesync2. 2017-08-29 10:19:04 +02:00
Paul B Mahol 9cd44e64be avfilter/vf_paletteuse: silence warning about misaligned indentation
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-10 11:25:44 +02:00
Clément Bœsch 549045254c Fix all -Wformat warnings raised by DJGPP 2017-03-29 14:49:29 +02:00
Nicolas George 183ce55b0d lavfi: split frame_count between input and output.
AVFilterLink.frame_count is supposed to count the number of frames
that were passed on the link, but with min_samples, that number is
not always the same for the source and destination filters.
With the addition of a FIFO on the link, the difference will become
more significant.

Split the variable in two: frame_count_in counts the number of
frames that entered the link, frame_count_out counts the number
of frames that were sent to the destination filter.
2016-11-13 10:41:16 +01:00
Paul B Mahol b7e78c75cc avfilter/vf_paletteuse: add option to use new palette for each output frame 2016-09-07 15:56:13 +02:00
Michael Niedermayer 8baa1d2209 avfilter/vf_paletteuse: enable skip_initial_unpaired
Fixes crash due to unprocessed input being passed through

This fixes the last segfault caused by mixing 3.0 and 3.1 libs and
applications

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 01:08:28 +02:00
Ganesh Ajjanagadde 6aaac24d72 avfilter/all: propagate errors of functions from avfilter/formats
Many of the functions from avfilter/formats can return errors, usually AVERROR(ENOMEM).
This propagates the return values.

All of these were found by using av_warn_unused_result, demonstrating its utility.

Tested with FATE. I am least sure of the changes to avfilter/filtergraph,
since I don't know what/how reduce_format is intended to behave and how it should
react to errors.

Fixes: CID 1325680, 1325679, 1325678.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Previous version Reviewed-by: Nicolas George <george@nsup.org>
Previous version Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-14 10:04:01 -04:00
Clément Bœsch d1c4e8c7db avfilter/paletteuse: use AV_OPT_TYPE_BOOL for mean_err and debug_accuracy option 2015-09-09 00:38:22 +02:00
Ronald S. Bultje 229843aa35 Replace av_dlog with ff_dlog.
ff_dlog checks compilability, and is non-public. av_dlog is deprecated
and no longer exists if FF_API_DLOG=0.
2015-08-18 10:24:01 -04:00
Clément Bœsch 1cded1f8d7 avfilter/vf_paletteuse: indent fix after 7ccc5848 2015-03-05 16:04:20 +01:00
Michael Niedermayer 7ccc584824 avfilter/vf_paletteuse: Use int where AVERROR can be returned
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 16:00:44 +01:00
Clément Bœsch 4629993d99 avfilter/paletteuse: use AV_QSORT()
See previous commit for a rationale.
2015-02-26 14:20:02 +01:00
Clément Bœsch c3d40e305c avfilter/palette{gen,use}: add Copyright 2015-02-23 14:00:13 +01:00
Clément Bœsch 92b7f56193 avfilter/paletteuse: add diff_mode 2015-02-23 09:56:22 +01:00
Clément Bœsch b0f5227558 avfilter/paletteuse: fix error dithering accuracy 2015-02-23 09:56:22 +01:00
Clément Bœsch f40266560b avfilter/paletteuse: fix leak in case of error
Fixes CID1270819
2015-02-18 14:04:10 +01:00
Clément Bœsch a00bab3475 avfilter/paletteuse: raise cache size from 64k to 512k
(or 32k to 256k in 32-bit)
2015-02-17 17:20:42 +01:00
Clément Bœsch bab4fcebb1 avfilter: add paletteuse filter 2015-02-14 20:48:50 +01:00