Commit Graph
3793 Commits
Author SHA1 Message Date
Michael Niedermayer 66a9edfcf6 do O(1) instead of O(n) atomic operations in register functions
about 1ms faster startup time

Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 133fbfc781)

Signed-off-by: Michael Niedermayer <[email protected]>
2013-12-24 01:05:47 +01:00
Michael Niedermayer 074ebfacf4 avfilter/ff_insert_pad: fix order of operations
Fixes out of bounds access
Fixes CID732170
Fixes CID732169

No filter is known to use this function in a way so the issue can be reproduced.

Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit ab2bfb85d4)

Conflicts:

	libavfilter/avfilter.c
2013-12-24 01:05:46 +01:00
Nicolas George 2005887707 lavfi/af_pan: support unknown layouts on input.
Fix trac ticket #2899.
(cherry picked from commit 7b0a587393)
2013-11-28 01:09:19 +01:00
Nicolas George cf8462ce00 lavfi/af_pan: support unknown layouts on output.
(cherry picked from commit 4e9adc9b73)
2013-11-28 01:09:12 +01:00
Nicolas George 9a4acedf31 lavfi: parsing helper for unknown channel layouts.
Make ff_parse_channel_layout() accept unknown layouts too.
(cherry picked from commit 6e2473edfd)
2013-11-28 01:08:59 +01:00
Nicolas George c2d37e7364 lavfi/avfiltergraph: do not reduce incompatible lists.
A list of "all channel layouts" but not "all channel counts"
can not be reduced to a single unknown channel count.
(cherry picked from commit d300f5f6f5)
2013-11-28 01:08:52 +01:00
Nicolas George 62baf22ec0 lavfi/avfiltergraph: suggest a solution when format selection fails.
Format selection can fail if unknown channel layouts are used
with filters that do not support it.
(cherry picked from commit f775eb3fb4)
2013-11-28 01:08:46 +01:00
Michael Niedermayer db99c41567 avfilter/vf_fps: make sure the fifo is not empty before using it
Fixes Ticket2905

Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit cdd5df8189)

Signed-off-by: Michael Niedermayer <[email protected]>
2013-09-23 21:46:15 +02:00
Michael Niedermayer d6d168e87b avfilter/vf_separatefields: fix ;;
Found-by: llogan
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 74561680cd)

Signed-off-by: Michael Niedermayer <[email protected]>
2013-08-09 13:58:45 +02:00
Michael Niedermayer 1bf2461765 avfilter: fix plane validity checks
Fixes out of array accesses

(cherry picked from commit e43a0a232d)
Signed-off-by: Michael Niedermayer <[email protected]>
2013-08-09 13:53:14 +02:00
Paul B Mahol 56bf38859b lavfi/aconvert: unbreak
Even if its deprecated, it should still work correctly.

Signed-off-by: Paul B Mahol <[email protected]>
(cherry picked from commit bc95b94289)

Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-11 12:02:00 +02:00
Michael Niedermayer 9711b52739 avfilter/af_earwax: Fix out of array accesses on odd packets
Found-by: Paul B Mahol <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 0a3a0edd52)

Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-10 19:07:50 +02:00
Michael Niedermayer d5de123195 avfilter/graphparse: Fix build with --enable-incompatible-fork-abi
Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-09 19:06:32 +02:00
Paul B Mahol c5a1b18f18 lavfi/drawtext: add support for printing frame metadata
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-09 15:21:01 +00:00
Paul B Mahol 3c5071db88 lavfi/psnr: rename 's' parameter to match documentation
Also removes some irrelevant lines in documentation.

Signed-off-by: Paul B Mahol <[email protected]>
2013-07-09 09:40:53 +00:00
Paul B Mahol a03e79ed5a lavfi: fix broken logic in metadata handling
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-08 20:13:56 +00:00
Paul B Mahol 19c8f22714 lavfi/rotate: switch to new drawutils
Get rid of ugly hacks, also add support for more pixel formats.

Signed-off-by: Paul B Mahol <[email protected]>
2013-07-08 16:40:49 +00:00
Paul B Mahol 55c94f48ce lavfi/drawutils: fix planar rgb
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-08 16:40:49 +00:00
Paul B Mahol d2dd1e075c lavfi/pad: use FFSIGN
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-08 16:40:48 +00:00
Paul B Mahol 6150bec3f8 lavfi: add psnr filter
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-08 14:58:04 +00:00
Paul B Mahol d64f3b72e0 replace some deprecated defines
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-06 05:43:24 +00:00
Paul B Mahol 9635806265 lavfi/blend: use dual input helpers
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-06 04:58:34 +00:00
Jean Delvare 4e10d87f38 lavfi/delogo: band width must be at least 1
We need at least one pixel around the logo to use as known points to
interpolate from. So properly declare the band/t attribute has having
a minimum value of 1.

Signed-off-by: Jean Delvare <[email protected]>
Reviewed-by: Stefano Sabatini <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-05 18:02:11 +02:00
Jean Delvare 72abce3c46 lavfi/delogo: option show shouldn't affect band
Options "show" and "band" are unrelated and should thus be
independent. However, setting "show" to 1 currently resets "band" to
its default value of 4. While this is documented, this still
surprising and confusing IMHO.

Change this behavior and make "show" and "band" independent from each
other. Update the documentation accordingly.

Signed-off-by: Jean Delvare <[email protected]>
Reviewed-by: Stefano Sabatini <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-05 18:02:11 +02:00
Paul B Mahol 413f865a9a lavfi/blackdetect: support 2 more pixels formats
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-05 15:30:37 +00:00
Paul B Mahol 9dd1447788 lavfi/cropdetect: export cropdetect info to frame metadata
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-05 15:07:33 +00:00
Jean Delvare 4e8d6b315c lavfi/delogo: remember left and right samples when interpolating
The left and right samples are the same for the whole line, so store
their values and don't recompute them for every iteration of "y".

This simple optimization results in a speed improvement between 15%
and 20% in my tests (depending on the logo geometry.)

Result is obviously the same.

Signed-off-by: Jean Delvare <[email protected]>
Reviewed-by: Stefano Sabatini <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-05 13:53:37 +02:00
Jean Delvare 6fc8c4cc0e lavfi/delogo: don't recompute the same difference again and again
The top left hand corner pixel coordinates are already stored in
logo_x1 and logo_y1 so don't recompute each of them 6 times for every
iteration.

This is a simple code optimization, result is obviously the same. The
performance gain is small (about 2% in my tests) but still good to
have, and the new code is clearer.

Signed-off-by: Jean Delvare <[email protected]>
Reviewed-by; Stefano Sabatini <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-05 13:52:59 +02:00
Paul B Mahol 253e155251 lavfi/crop: support more pixel formats
Signed-off-by: Paul B Mahol <[email protected]>
2013-07-04 11:46:06 +00:00
Jean Delvare f0bcb13aed lavfi/delogo: avoid propagation of rounding errors in chroma planes
When operating on subsampled chroma planes, some rounding is taking
place. The left and top borders are rounded down while the width and
height are rounded up, so all rounding is done outward to guarantee the
logo area is fully covered.

The problem is that the width and height are counted from the
unrounded left and top borders, respectively. So if the left or top
border position has indeed been rounded down, and the width or height
needs no rounding (up), the position of the the right or bottom border
will be effectively rounded down, i.e. inward.

The issue can easily be seen with a yuv240p input and
  -vf delogo=45:45:60:40:show=1 -vframes 1 delogo-bug.png
(or virtually any logo area with odd x and y and even width and
height.) The right and bottom chroma borders (in green) are clearly
off.

In order to fix this, the width and height must be adjusted to include
the bits lost in the rounding of the left and top border positions,
respectively, prior to being themselves rounded up.

Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-03 23:10:57 +02:00
Jean Delvare 99f1d74933 lavfi/delogo: take SAR into account
When interpolating, weights are based on relative distances, which
assume square pixels. If a non-1:1 sample aspect ratio is used, it
should be taken into account when comparing distances, because the
human eye and brain care about the picture as it is displayed, not
stored.

Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
2013-07-03 23:10:46 +02:00
Stefano Sabatini 838bd73139 lavfi: create Libav-API compatibility layer for avfilter_graph_parse() at the next bump
Add function avfilter_graph_parse_ptr() and favor it in place of
avfilter_graph_parse(), which will be restored with the old/Libav
signature at the next bump.

If HAVE_INCOMPATIBLE_LIBAV_API is enabled it will use the
Libav-compatible signature for avfilter_graph_parse().

At the next major bump the current implementation of
avfilter_graph_parse() should be dropped in favor of the Libav/old
implementation.

Should address trac ticket #2672.
2013-07-03 13:21:42 +02:00
Jean Delvare 16fd75ceec lavfi/delogo: use weighted interpolation
The original delogo algorithm interpolates both horizontally and
vertically and uses the average to compute the resulting sample. This
works reasonably well when the logo area is almost square. However
when the logo area is significantly larger than high or higher than
large, the result is largely suboptimal.

The issue can be clearly seen by testing the delogo filter with a fake
logo area that is 200 pixels large and 2 pixels high. Vertical
interpolation gives a very good result in that case, horizontal
interpolation gives a very bad result, and the overall result is poor,
because both are given the same weight.

Even when the logo is roughly square, the current algorithm gives poor
results on the borders of the logo area, because it always gives
horizontal and vertical interpolations an equal weight, and this is
suboptimal on borders. For example, in the middle of the left hand
side border of the logo, you want to trust the left known point much
more than the right known point (which the current algorithm already
does) but also much more than the top and bottom known points (which
the current algorithm doesn't do.)

By properly weighting each known point when computing the value of
each interpolated pixel, the visual result is much better, especially
on borders and/or for high or large logo areas.

The algorithm I implemented guarantees that the weight of each of the
4 known points directly depends on its distance to the interpolated
point. It is largely inspired from the original algorithm, the key
difference being that it computes the relative weights globally
instead of separating the vertical and horizontal interpolations and
combining them afterward.

Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Stefano Sabatini <[email protected]>
2013-07-01 09:33:33 +02:00
Carl Eugen Hoyos 674d8a9629 Rename thread_init() in libavcodec and libavfilter as library_thread_init().
The aix header sys/thread.h contains a definition for thread_init().
2013-06-30 13:47:45 +02:00
Carl Eugen Hoyos 33f5d70df5 Rename constant HZ in af_biquads.c as HERTZ.
The aix header sys/m_param.h defines HZ as _HZ.
2013-06-30 13:47:45 +02:00
Michael Niedermayer 2236456715 avfilter/avfilter: Make avfilter_register() thread safe
Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-28 12:44:03 +02:00
Michael Niedermayer ef90639004 avfilter/vf_mp: preserve pixel format when possible
Fixes Ticket2577

Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-28 03:32:00 +02:00
Michael Niedermayer ee97982408 avfilter/src_movie: Fix handling of packet size for video
See Ticket2556

Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-26 13:46:19 +02:00
Michael Niedermayer 87bc648930 libavfilter/src_movie: fix which packet is reset
Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-26 13:06:11 +02:00
Michael Niedermayer 73215fe30a vf_drawbox: give all v_log() a context
Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-26 00:54:08 +02:00
Michael Niedermayer 47da9b2c51 vf_drawbox: avoid declaration in for() arguments
Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-26 00:52:16 +02:00
Michael Niedermayer f1efaf8371 Merge branch 'drawbox_exprs' of https://github.com/mjmvisser/FFmpeg
* 'drawbox_exprs' of https://github.com/mjmvisser/FFmpeg:
  enabled expressions on x, y, w, h and t parameters for drawgrid and drawbox, added examples

Reviewed-by: Andrey Utkin
Merged-by: Michael Niedermayer <[email protected]>
2013-06-26 00:33:41 +02:00
Mark Visser 84f571e37f enabled expressions on x, y, w, h and t parameters for drawgrid and drawbox, added examples 2013-06-25 11:38:59 -04:00
Michael Niedermayer 015cc3239a lavfi/movie: free packet on decoder error
Prevents infinite loop, see Ticket2556

Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-25 13:37:40 +02:00
Michael Niedermayer 8a7aabe80b avfilter/vsrc_testsrc: fix artifacts with odd height
Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-24 23:21:17 +02:00
Michael Niedermayer 5d509fbdcf Merge commit 'eeeb5c291d3f78eaade5b99c2614c7cab0e9be79'
* commit 'eeeb5c291d3f78eaade5b99c2614c7cab0e9be79':
  vsrc_movie: do not free avoption variables in uninit()

Conflicts:
	libavfilter/src_movie.c

Merged-by: Michael Niedermayer <[email protected]>
2013-06-21 10:41:41 +02:00
Anton Khirnov eeeb5c291d vsrc_movie: do not free avoption variables in uninit()
The generic code frees them as well. Since av_free was used to free them
instead of av_freep, this would result in a double free.
2013-06-20 13:27:14 +02:00
Jean Delvare b08cd2fb94 delogo: Fix function description
The algorithm works on src and writes to dst, not the other way
around.

Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
2013-06-19 22:13:12 +02:00
Michael Niedermayer 209cb8afe0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavfi: switch ff_default_get_audio_buffer() to av_frame_get_buffer()

Conflicts:
	libavfilter/audio.c

Merged-by: Michael Niedermayer <[email protected]>
2013-06-19 08:27:35 +02:00
Michael Niedermayer 602d0bfe67 Merge branch 'frame_num_offset' of https://github.com/mjmvisser/FFmpeg
Merged-by: Michael Niedermayer <[email protected]>
2013-06-19 01:25:50 +02:00