Commit Graph

1334 Commits

Author SHA1 Message Date
Anton Khirnov e16e23d70e vf_cropdetect: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
2013-05-16 07:31:50 +02:00
Anton Khirnov 671563d9fd vf_crop: cosmetics, break lines 2013-05-16 07:31:31 +02:00
Anton Khirnov 7f83959598 vf_crop: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
2013-05-16 07:31:11 +02:00
Anton Khirnov 762df56ef9 vf_boxblur: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
2013-05-16 07:30:56 +02:00
Anton Khirnov a2a696990c vf_blackframe: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
2013-05-16 07:30:41 +02:00
Anton Khirnov b3ea76624a vf_aspect: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
2013-05-16 07:30:28 +02:00
Diego Biurrun 2832ea26f3 Remove commented-out debug #define cruft 2013-05-16 00:23:30 +02:00
Anton Khirnov e6c4ac7b5f pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* 2013-05-15 07:46:51 +02:00
Anton Khirnov ffba2053ed lavfi: fix compatibility code for old vf_scale options syntax
Currently it would incorrectly trigger on a string that contains a '='
but does not contain a ':', e.g. flags=<flags>.
2013-05-15 07:46:04 +02:00
Anton Khirnov 096696ef0d avfiltergraph: simplify inserting conversion filters.
There is now no need to explicitly pass 0:0 as width/height to scale,
those are the defaults.
2013-05-15 07:45:51 +02:00
James Darnley d10499a32a yadif: correct strides in filter_edges_16bit
The C code treats the data as arrays of uint16_t so strides must not
be in bytes but in pixels.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-05-14 09:24:13 +02:00
James Darnley b0ef0ae776 yadif: restore speed of the C filtering code
Always use the special filter for the first and last 3 columns (only).

Changes made in 64ed397 slowed the filter to just under 3/4 of what it
was.  This commit restores the speed while maintaining identical output.

For reference, on my Athlon64:
1733222 decicycles in old
2358563 decicycles in new
1727558 decicycles in this

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-05-14 09:23:55 +02:00
Anton Khirnov 16a4a18db0 af_asyncts: fix offset calculation
delta is in samples, not bytes. Also the sample format is not guaranteed
to be planar.

CC:libav-stable@libav.org
2013-05-10 09:31:27 +02:00
Diego Biurrun 6e9f8d6a7d x86: vf_yadif: Remove stray dsputil_mmx #include 2013-05-08 18:18:23 +02:00
Janne Grunau 5f87c277bd vf_scale: add endianness conversion pixel format in query_formats 2013-05-06 21:48:15 +02:00
Hendrik Leppkes 20c86571cc lavfi: let gcc realign the stack on public graph driving functions
The functions which actually drive the filter graph by pushing
frames through it need to ensure an aligned stack for SIMD functions.

This fixes a crash in YADIF filter when using a mingw build in a MSVC
application.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-04 23:40:13 +03:00
Diego Biurrun 093804a93c avfilter: Add av_cold attributes to init/uninit functions 2013-05-04 21:10:05 +02:00
Anton Khirnov a1e05b0487 lavfi: add trim and atrim filters. 2013-04-30 11:24:57 +02:00
Anton Khirnov b472938233 lavfi: add an asetpts filter 2013-04-30 11:17:57 +02:00
Anton Khirnov 2548834b22 vf_setpts: cosmetics, reformat 2013-04-30 11:17:23 +02:00
Anton Khirnov c22263d3e8 graphparser: only print filter arguments if they are non-NULL 2013-04-30 11:16:57 +02:00
Anton Khirnov 8aaab1113c af_channelmap: ensure the output channel layout is valid. 2013-04-30 11:16:37 +02:00
Anton Khirnov 949c603ed9 af_channelmap: remove now unnecessary goto
Options are freed from the generic code now, there is no need to call
av_opt_free() from the filter.
2013-04-30 11:16:22 +02:00
Anton Khirnov 1012155722 vf_split: fix description
It now allows an arbitrary number of inputs, not just two.
2013-04-30 11:16:16 +02:00
Diego Biurrun c1ad70c3cb x86: Move some conditional code around to avoid unused variable warnings 2013-04-22 17:50:02 +02:00
Anton Khirnov 9bfc6e02ba afifo: fix request_samples on the last frame in certain cases
The current code can fail to return the last frame if it contains
exactly the requested number of samples.

Fixes the join filter test, which previously did not include the last
408 samples in most cases.

CC:libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-04-22 02:29:56 +02:00
Anton Khirnov c0771a1ac6 af_channelmap: cosmetics, use an extra local variable to shorten the code 2013-04-17 08:37:59 +02:00
Anton Khirnov aafed1175d af_channelmap: sanity check input channel indices in all cases.
Fixes invalid reads from non-existing channels.

CC:libav-stable@libav.org
2013-04-17 08:37:59 +02:00
Vittorio Giovara 3fce136798 lavfi: new interlace filter
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-04-11 21:33:07 +02:00
Anton Khirnov f160c6a18a lavfi: do not segfault on NULL passed to avfilter_get_by_name() 2013-04-11 20:44:35 +02:00
Anton Khirnov fa2a34cd40 lavfi: change the filter registering system to match the other libraries
Removes an arbitrary hardcoded limit on the number of filters.
2013-04-11 20:44:03 +02:00
Anton Khirnov 7e8fe4be5f lavfi: add a function for counting elements in AVFilterPad arrays.
The caller needs to know what valid indices can be passed to
avfilter_pad_get_name/type.
2013-04-11 20:43:47 +02:00
Anton Khirnov 7cdd737ba8 lavfi: mark filters with dynamic number of inputs or outputs with special flags
This will be useful in avtools in the following commits.
Any other caller might also want to know this information.
2013-04-11 20:42:41 +02:00
Anton Khirnov 1ba95a9cca lavfi: add avfilter_init_dict() for initializing a filter with a dict. 2013-04-11 20:40:20 +02:00
Anton Khirnov 48a5adab62 lavfi: add avfilter_init_str() to replace avfilter_init_filter().
Drop the unused opaque parameter from its signature.
2013-04-11 20:39:13 +02:00
Anton Khirnov 1565cbc65c lavfi: make avfilter_free() remove the filter from its graph. 2013-04-11 20:38:48 +02:00
Anton Khirnov 111367263a lavfi: add AVFilterContext.graph.
It will be useful in the following commits.
2013-04-11 20:38:23 +02:00
Anton Khirnov c2c9801bc9 lavfi: deprecate avfilter_graph_add_filter().
Since this function adds a standalone filter to a filter graph and we do
not support creating such filters, there is no reason for this function
to exist.
2013-04-11 20:36:42 +02:00
Anton Khirnov bc1a985ba0 lavfi: replace avfilter_open() with avfilter_graph_alloc_filter().
Since we do not support "standalone" filters not attached to an
AVFilterGraph, we should not have a public function to create such
filters. In addition that function is horribly named, the action it does
cannot be possibly described as "opening" a filter.
2013-04-11 20:34:14 +02:00
Anton Khirnov 38f0c0781a lavfi: merge avfiltergraph.h into avfilter.h
We do not support using filters without AVFilterGraph in practice
anyway, so there is no point in pretending we do.
2013-04-11 20:33:33 +02:00
Anton Khirnov 4a37d4b3f8 lavfi: add const to the pads parameter of avfilter_pad_get_name/type 2013-04-11 20:33:23 +02:00
Anton Khirnov 91d2efa7d6 lavfi: add const to AVFilterContext.filter.
lavfi should never modify the filter through that pointer.
2013-04-11 20:32:39 +02:00
Anton Khirnov 837112c0c8 af_channelmap: fix uninitialized variable use introduced in ba8efac977 2013-04-09 22:01:34 +02:00
Anton Khirnov cdac3acb11 lavfi: add a bump and docs entries for the AVOptions switch 2013-04-09 19:13:27 +02:00
Anton Khirnov 8114c10160 lavfi: add avfilter_get_class().
Useful for examining options, the same as the corresponding functions
for the other libs.
2013-04-09 19:13:19 +02:00
Anton Khirnov 4d1f31ea44 lavfi: make AVFilterContext export filter options. 2013-04-09 19:13:10 +02:00
Anton Khirnov 62549f9655 lavfi: error out when options are provided to a filter that does not take any 2013-04-09 19:12:59 +02:00
Anton Khirnov c43a7ecad9 lavfi: remove now unused args parameter from AVFilter.init 2013-04-09 19:12:38 +02:00
Anton Khirnov 7b3eb745b9 vsrc_testsrc: switch to an AVOptions-based system. 2013-04-09 19:12:06 +02:00
Anton Khirnov a42d6e6c4c vsrc_movie: switch to an AVOptions-based system. 2013-04-09 19:11:27 +02:00
Anton Khirnov b7b3302f8f vsrc_nullsrc: switch to an AVOptions-based system. 2013-04-09 19:11:12 +02:00
Anton Khirnov 7bc1a883c9 vsrc_color: switch to an AVOptions-based system. 2013-04-09 19:11:03 +02:00
Anton Khirnov 73d5d405d4 split: switch to an AVOptions-based system. 2013-04-09 19:10:41 +02:00
Anton Khirnov b13623e184 af_volume: switch to an AVOptions-based system. 2013-04-09 19:10:27 +02:00
Anton Khirnov dd7fc37c71 af_join: switch to an AVOptions-based system.
Change the mappings separator from comma to '|' to avoid excessive
escaping, since comma is already used for separating filters in the
filtergraph description.
2013-04-09 19:10:12 +02:00
Anton Khirnov 3f14febbdf af_channelsplit: switch to an AVOptions-based system. 2013-04-09 19:10:00 +02:00
Anton Khirnov ba8efac977 af_channelmap: switch to an AVOptions-based system. 2013-04-09 19:09:40 +02:00
Anton Khirnov b2b25b0659 af_asyncts: switch to an AVOptions-based system. 2013-04-09 19:09:33 +02:00
Anton Khirnov ac20e3ab8e af_amix: switch to an AVOptions-based system. 2013-04-09 19:09:26 +02:00
Anton Khirnov 7536c67104 vf_yadif: switch to an AVOptions-based system. 2013-04-09 19:09:03 +02:00
Anton Khirnov b83e9efc53 vf_unsharp: switch to an AVOptions-based system. 2013-04-09 19:08:42 +02:00
Anton Khirnov 0c2466dec7 vf_transpose: switch to an AVOptions-based system. 2013-04-09 19:08:04 +02:00
Anton Khirnov ffea3b00c3 vf_settb: switch to an AVOptions-based system. 2013-04-09 19:07:44 +02:00
Anton Khirnov 33b97faaba vf_setpts: switch to an AVOptions-based system. 2013-04-09 19:07:28 +02:00
Anton Khirnov 95f1f56a21 vf_select: switch to an AVOptions-based system. 2013-04-09 19:06:51 +02:00
Anton Khirnov 40c885c589 vf_pad: switch to an AVOptions-based system. 2013-04-09 19:06:29 +02:00
Anton Khirnov 9087eaf193 vf_overlay: switch to an AVOptions-based system. 2013-04-09 19:06:13 +02:00
Anton Khirnov 20b46f8f4f vf_lut: switch to an AVOptions-based system. 2013-04-09 19:05:32 +02:00
Anton Khirnov ee0e8d4b15 vf_libopencv: switch to an AVOptions-based system. 2013-04-09 19:05:22 +02:00
Anton Khirnov 8c747d46f7 vf_hqdn3d: switch to an AVOptions-based system. 2013-04-09 19:05:12 +02:00
Anton Khirnov 7ed833d78e vf_gradfun: switch to an AVOptions-based system. 2013-04-09 19:04:57 +02:00
Anton Khirnov c334c113d4 vf_scale: switch to an AVOptions-based system. 2013-04-09 19:04:45 +02:00
Anton Khirnov 5aa1a668cf vf_frei0r: switch to an AVOptions-based system. 2013-04-09 19:04:28 +02:00
Anton Khirnov f13ab29925 vf_fps: switch to an AVOptions-based system. 2013-04-09 19:04:15 +02:00
Anton Khirnov a39c154049 vf_fieldorder: switch to an AVOptions-based system. 2013-04-09 19:03:56 +02:00
Anton Khirnov b9dfee9fa2 vf_fade: switch to an AVOptions-based system. 2013-04-09 19:03:43 +02:00
Anton Khirnov 8ec464c61c vf_drawtext: switch to an AVOptions-based system. 2013-04-09 19:03:23 +02:00
Anton Khirnov 335c31293b vf_drawbox: switch to an AVOptions-based system. 2013-04-09 19:03:08 +02:00
Anton Khirnov 63e58c55c1 vf_delogo: switch to an AVOptions-based system. 2013-04-09 19:02:43 +02:00
Anton Khirnov 460e7b4f6d vf_cropdetect: switch to an AVOptions-based system. 2013-04-09 19:02:32 +02:00
Anton Khirnov fba0156af7 vf_crop: switch to an AVOptions-based system. 2013-04-09 19:00:54 +02:00
Anton Khirnov 51def31dbe vf_boxblur: switch to an AVOptions-based system. 2013-04-09 19:00:39 +02:00
Anton Khirnov 62dcdb028c vf_blackframe: switch to an AVOptions-based system. 2013-04-09 19:00:26 +02:00
Anton Khirnov 2831b307e6 vf_aspect: switch to an AVOptions-based system. 2013-04-09 18:58:30 +02:00
Anton Khirnov e67a87eac8 vf_(no)format: switch to an AVOptions-based system. 2013-04-09 18:56:39 +02:00
Anton Khirnov 0af7fe1f95 af_aformat: switch to an AVOptions-based system. 2013-04-09 18:55:45 +02:00
Anton Khirnov d28cb84989 buffersrc: switch to an AVOptions-based system. 2013-04-09 18:48:16 +02:00
Anton Khirnov 4fa1f52e33 af_resample: switch to an AVOptions-based system. 2013-04-09 18:45:50 +02:00
Anton Khirnov b439c992c2 lavfi: switch to an AVOptions-based system. 2013-04-09 18:45:37 +02:00
Anton Khirnov 6d0546bbaf avfiltergraph: set deprecated filter_count. 2013-04-04 07:52:32 +02:00
Anton Khirnov 6e3c13a559 avfiltergraph: check for sws opts being non-NULL before using them.
Avoid snprintfing a NULL pointer.

CC: libav-stable@libav.org
2013-04-03 09:29:55 +02:00
Clément Bœsch 1ae44c87c9 lavfi/gradfun: remove rounding to match C and SSE code.
There is no noticable benefit for such precision.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-28 07:59:29 +01:00
Clément Bœsch 38a2f88d39 lavfi/gradfun: fix dithering in MMX code.
Current dithering only uses the first 4 instead of the whole 8 random values.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-28 07:59:18 +01:00
Clément Bœsch 2d66fc543b lavfi/gradfun: fix rounding in MMX code.
Current code divides before increasing precision.

Also reduce upper bound for strength from 255 to 64.  This will prevent
an overflow in the SSSE3 and MMX filter_line code: delta is expressed as
an u16 being shifted by 2 to the left. If it overflows, having a
strength not above 64 will make sure that m is set to 0 (making the
m*m*delta >> 14 expression void).

A value above 64 should not make any sense unless gradfun is used as
a blur filter.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-28 07:59:04 +01:00
Clément Bœsch 8b9a153ef3 lavfi/gradfun: do not increment DC pointer for odd values.
First DC is only used once otherwise. This also makes the code
consistent with ASM versions.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-28 07:58:55 +01:00
Jindřich Makovička 20a8ee3061 af_asyncts: fix compensation and PTS monotonicity
This patch improves af_asyncts behavior on streams with bogus PTS, which
are either non-monotonic, or contain PTS jitter, and trigger the
non-monotonicity error. With this patch, af_asyncts is able to correct
these streams and avoid the error.

Firstly, it fixes resample compensation calculation by supplying proper
units to avresample_set_compensation (sample count per second instead
of sample count per some arbitrary frame size). Also, the calculation of
the compensation itself is fixed - delta is proportional to an adjustment
of the compensation, not the compensation itself. Ideally, the compensation
should converge to a value that keeps delta at zero.

To be able to deal with sources with PTS jitter even without resampling,
small PTS errors are adjusted, so the output frames do not overlap.

Finally, one more monotonicity check is added.

The FATE reference changes because now there is 8 less samples of
silence because of the pts jitter.

Signed-off-by: Jindřich Makovička <makovick@gmail.com>
2013-03-22 20:09:34 +01:00
Anton Khirnov 6599b087de buffersrc: fix a typo.
Vertical shift is log2_chroma_h, not log2_chroma_w.
2013-03-19 11:12:17 +01:00
Anton Khirnov c977039e58 lavc, lavfi: fix counting number of planes in AVBufferRef wrappers
Number of planes is not always equal to the number of components even
for formats marked with PIX_FMT_PLANAR -- e.g. NV12 has three components
in two planes.
2013-03-19 11:12:17 +01:00
Anton Khirnov 6552808014 lavc,lavfi: fix calculating the plane size in the AVBufferRef wrappers
It is supposed to be height * linesize, not width * linesize.
Thanks to Hendrik Leppkes for pointing out the bug.
2013-03-17 09:10:04 +01:00
Anton Khirnov 4750b05d67 af_join: do not leak input frames. 2013-03-16 05:37:01 +01:00