Commit Graph

97 Commits

Author SHA1 Message Date
Andreas Rheinhardt 1d33a310df avfilter/vf_aspect: Deduplicate inputs
Also avoid using the avfilter-prefix for static objects.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-11-04 01:24:09 +01:00
Stefano Sabatini 7d58df7bb2 lavfi/aspect: apply style fixes 2023-03-29 00:15:19 +02:00
Martin Storsjö a78f136f3f configure: Use a separate config_components.h header for $ALL_COMPONENTS
This avoids unnecessary rebuilds of most source files if only the
list of enabled components has changed, but not the other properties
of the build, set in config.h.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:12:49 +02:00
Anton Khirnov b9c928a486 avfilter: add AVFILTER_FLAG_METADATA_ONLY
This flag allows distinguishing between filters that actually modify the
data and those that only modify metadata or gather some stream
information.
2021-12-04 14:07:19 +01:00
Andreas Rheinhardt 8be701d9f7 avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilter
Up until now, an AVFilter's lists of input and output AVFilterPads
were terminated by a sentinel and the only way to get the length
of these lists was by using avfilter_pad_count(). This has two
drawbacks: first, sizeof(AVFilterPad) is not negligible
(i.e. 64B on 64bit systems); second, getting the size involves
a function call instead of just reading the data.

This commit therefore changes this. The sentinels are removed and new
private fields nb_inputs and nb_outputs are added to AVFilter that
contain the number of elements of the respective AVFilterPad array.

Given that AVFilter.(in|out)puts are the only arrays of zero-terminated
AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads
are not zero-terminated and they already have a size field) the argument
to avfilter_pad_count() is always one of these lists, so it just has to
find the filter the list belongs to and read said number. This is slower
than before, but a replacement function that just reads the internal numbers
that users are expected to switch to will be added soon; and furthermore,
avfilter_pad_count() is probably never called in hot loops anyway.

This saves about 49KiB from the binary; notice that these sentinels are
not in .bss despite being zeroed: they are in .data.rel.ro due to the
non-sentinels.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-20 12:53:58 +02:00
Andreas Rheinhardt a04ad248a0 avfilter: Constify all AVFilters
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
Michael Niedermayer 0c0ca0f244 avfilter/vf_aspect: Fix integer overflow in compute_dar()
Fixes: signed integer overflow: 1562273630 * 17 cannot be represented in type 'int'
Fixes: Ticket8323

Found-by: Suhwan
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-16 15:13:10 +01:00
Paul B Mahol f6608f4725 avfilter/vf_aspect: change outlink sample aspect ratio instead of inlink
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-12-23 10:48:14 +01:00
James Almer 0ed61546c4 Merge commit '88fd836a015a5f3380df74592e440e7d1e5b8000'
* commit '88fd836a015a5f3380df74592e440e7d1e5b8000':
  lavfi: Drop deprecated way of passing options for a few filters

Merged-by: James Almer <jamrial@gmail.com>
2017-10-21 15:27:03 -03:00
Vittorio Giovara 88fd836a01 lavfi: Drop deprecated way of passing options for a few filters
Deprecated in 02/2013.
2017-03-23 09:57:32 +01:00
Ronald S. Bultje 6495c4c687 lavfi: fix compilation with FF_API_OLD_FILTER_OPTS=0. 2015-08-18 22:22:49 -04:00
Michael Niedermayer 74a8dbe1c4 Merge commit '58400ac133bcfb6bf8196b4e5208bc178307739b'
* commit '58400ac133bcfb6bf8196b4e5208bc178307739b':
  lavfi: name anonymous structs

Conflicts:
	libavfilter/buffersink.c
	libavfilter/f_select.c
	libavfilter/src_movie.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_overlay.c
	libavfilter/vf_showinfo.c
	libavfilter/vf_unsharp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-19 18:20:17 +02:00
Vittorio Giovara 58400ac133 lavfi: name anonymous structs 2014-04-19 16:20:57 +02:00
Paul B Mahol 3d9fc5c6ad avfilter/vf_aspect: remove dupe constants setup
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-11-03 16:39:22 +00:00
Michael Niedermayer a75bf4e5c1 Merge commit '34a0ac41a880039c7fb4b3abce10d8e2ce48fac7'
* commit '34a0ac41a880039c7fb4b3abce10d8e2ce48fac7':
  vf_aspect: support variables in evaluating the aspect ratios

Conflicts:
	Changelog
	doc/filters.texi
	libavfilter/vf_aspect.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-03 11:54:19 +01:00
Rudolf Polzer 34a0ac41a8 vf_aspect: support variables in evaluating the aspect ratios
Example: -vf setsar=sar="sar*9/10"

Signed-off-by: Rudolf Polzer <divverent@xonotic.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-02 21:14:08 +01:00
Michael Niedermayer 325f6e0a97 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavfi: do not export the filters from shared objects

Conflicts:
	libavfilter/af_amix.c
	libavfilter/af_anull.c
	libavfilter/asrc_anullsrc.c
	libavfilter/f_select.c
	libavfilter/f_settb.c
	libavfilter/split.c
	libavfilter/src_movie.c
	libavfilter/vf_aspect.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_colorbalance.c
	libavfilter/vf_copy.c
	libavfilter/vf_crop.c
	libavfilter/vf_cropdetect.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_format.c
	libavfilter/vf_framestep.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_hflip.c
	libavfilter/vf_libopencv.c
	libavfilter/vf_lut.c
	libavfilter/vf_null.c
	libavfilter/vf_overlay.c
	libavfilter/vf_scale.c
	libavfilter/vf_transpose.c
	libavfilter/vf_unsharp.c
	libavfilter/vf_vflip.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-29 11:58:11 +01:00
Anton Khirnov cd43ca0443 lavfi: do not export the filters from shared objects 2013-10-28 15:29:54 +01:00
Paul B Mahol b211607b5c avfilter: various cosmetics
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-09-12 14:01:43 +00:00
Paul B Mahol b077d8d908 avfilter: remove redundant .get_(audio/video)_buffer initializations
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-09-07 18:20:16 +00:00
Michael Niedermayer 71fcb6072e Merge commit '3fb29588a27a711132106b924e27b53789a58dcb'
* commit '3fb29588a27a711132106b924e27b53789a58dcb':
  vf_drawtext: don't leak the expressions.
  vf_crop: make config_props work properly when called multiple times.
  vf_setdar: make config_props work properly when called multiple times.

Conflicts:
	libavfilter/vf_aspect.c
	libavfilter/vf_drawtext.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-17 11:29:22 +02:00
Anton Khirnov d5c66d9c56 vf_setdar: make config_props work properly when called multiple times.
Do not overwrite the variable set through AVOptions.
2013-05-17 07:43:44 +02:00
Michael Niedermayer efc08e00cc Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'
* commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110':
  vf_aspect: use the name 's' for the pointer to the private context
  Remove commented-out debug #define cruft

Conflicts:
	libavcodec/4xm.c
	libavcodec/dvdsubdec.c
	libavcodec/ituh263dec.c
	libavcodec/mpeg12.c
	libavfilter/avfilter.c
	libavfilter/vf_aspect.c
	libavfilter/vf_fieldorder.c
	libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-16 09:56:43 +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
Nicolas George b42827ffd9 lavfi/vf_aspect: improve compatibility of parsing.
Try to accept both the old "num:den" and the new "num/den"
syntax. Fix "aspect=2" being ignored due to a missing den.

Also remove a duplicated #include.
2013-04-18 20:51:55 +02:00
Stefano Sabatini 1efcab02b6 lavfi/aspect: apply hot fix for NUM:DEN syntax 2013-04-17 23:37:22 +02:00
Stefano Sabatini f04ec05f0e lavfi/setdar: fix num/den swapping in log message 2013-04-17 23:37:22 +02:00
Stefano Sabatini f212c2380a lavfi/setsar: remove spurious #if FF_API_OLD_FILTER_OPTS around init field 2013-04-17 23:37:05 +02:00
Stefano Sabatini 5229b78371 lavfi/aspect: extend verbose feedback, show old SAR and DAR values 2013-04-17 22:39:26 +02:00
Stefano Sabatini fe5ca6b913 lavfi/aspect: restore ratio parsing
Allow to set a ratio as "a:b" (with proper escaping), and correctly
honour the max parameter.
2013-04-17 22:39:20 +02:00
Stefano Sabatini 30926a1f1f lavfi/aspect: fix weird copyright notice 2013-04-16 22:15:34 +02:00
Anton Khirnov d69a4177b9 lavfi: remove now unused args parameter from AVFilter.init
Conflicts:

	libavfilter/avfilter.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_lut.c
	libavfilter/vf_select.c
	libavfilter/vf_setpts.c
	libavfilter/vsrc_color.c
	libavfilter/vsrc_movie.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-12 11:54:39 +02:00
Clément Bœsch 7bd014eaec lavfi/aspect: fix d2q convert in init.
Regression since git 71ef1ec7b.
2013-04-11 22:46:47 +02:00
Clément Bœsch 71ef1ec7b4 lavfi/aspect: switch to an AVOptions-based system.
This is heavily based on 2831b307 by Anton Khirnov <anton@khirnov.net>
2013-04-11 22:05:03 +02:00
Michael Niedermayer 43bac121d3 Merge commit '62dcdb028cc84845fd263bb09304c4c6500bda7a'
* commit '62dcdb028cc84845fd263bb09304c4c6500bda7a':
  vf_blackframe: switch to an AVOptions-based system.
  vf_aspect: switch to an AVOptions-based system.

Conflicts:
	doc/filters.texi
	libavfilter/vf_aspect.c
	libavfilter/vf_blackframe.c

In the aspect filter most changes are merged but not the final
switch to the libav API because that is too restrictive and has
difficulty handling the syntax.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-10 15:37:21 +02:00
Anton Khirnov c43a7ecad9 lavfi: remove now unused args parameter from AVFilter.init 2013-04-09 19:12:38 +02:00
Anton Khirnov 2831b307e6 vf_aspect: switch to an AVOptions-based system. 2013-04-09 18:58:30 +02:00
Michael Niedermayer a05a44e205 Merge commit '7e350379f87e7f74420b4813170fe808e2313911'
* commit '7e350379f87e7f74420b4813170fe808e2313911':
  lavfi: switch to AVFrame.

Conflicts:
	doc/filters.texi
	libavfilter/af_ashowinfo.c
	libavfilter/audio.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersink.c
	libavfilter/buffersrc.c
	libavfilter/buffersrc.h
	libavfilter/f_select.c
	libavfilter/f_setpts.c
	libavfilter/fifo.c
	libavfilter/split.c
	libavfilter/src_movie.c
	libavfilter/version.h
	libavfilter/vf_aspect.c
	libavfilter/vf_bbox.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fieldorder.c
	libavfilter/vf_fps.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_gradfun.c
	libavfilter/vf_hqdn3d.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_showinfo.c
	libavfilter/vf_transpose.c
	libavfilter/vf_vflip.c
	libavfilter/vf_yadif.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavfilter/yadif.h

Following are notes about the merge authorship and various technical details.

Michael Niedermayer:
  * Main merge operation, notably avfilter.c and video.c
  * Switch to AVFrame:
    - afade
    - anullsrc
    - apad
    - aresample
    - blackframe
    - deshake
    - idet
    - il
    - mandelbrot
    - mptestsrc
    - noise
    - setfield
    - smartblur
    - tinterlace
  * various merge changes and fixes in:
    - ashowinfo
    - blackdetect
    - field
    - fps
    - select
    - testsrc
    - yadif

Nicolas George:
  * Switch to AVFrame:
    - make rawdec work with refcounted frames. Adapted from commit
      759001c534 by Anton Khirnov.
      Also, fix the use of || instead of | in a flags check.
    - make buffer sink and src, audio and video work all together

Clément Bœsch:
  * Switch to AVFrame:
    - aevalsrc
    - alphaextract
    - blend
    - cellauto
    - colormatrix
    - concat
    - earwax
    - ebur128
    - edgedetect
    - geq
    - histeq
    - histogram
    - hue
    - kerndeint
    - life
    - movie
    - mp (with the help of Michael)
    - overlay
    - pad
    - pan
    - pp
    - pp
    - removelogo
    - sendcmd
    - showspectrum
    - showwaves
    - silencedetect
    - stereo3d
    - subtitles
    - super2xsai
    - swapuv
    - thumbnail
    - tile

Hendrik Leppkes:
  * Switch to AVFrame:
    - aconvert
    - amerge
    - asetnsamples
    - atempo
    - biquads

Matthieu Bouron:
  * Switch to AVFrame
    - alphamerge
    - decimate
    - volumedetect

Stefano Sabatini:
  * Switch to AVFrame:
    - astreamsync
    - flite
    - framestep

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-10 01:40:35 +01:00
Anton Khirnov 7e350379f8 lavfi: switch to AVFrame.
Deprecate AVFilterBuffer/AVFilterBufferRef and everything related to it
and use AVFrame instead.
2013-03-08 07:37:18 +01:00
Michael Niedermayer 951d39fecd avfilter: fix segfault with setsar/dar
Reported-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-20 12:34:05 +01:00
Anton Khirnov 8f21cfc6b3 vf_aspect: switch to filter_frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-29 00:31:50 +01:00
Anton Khirnov 565e4993c6 lavfi: merge start_frame/draw_slice/end_frame
Any alleged performance benefits gained from the split are purely
mythological and do not justify added code complexity.
2012-11-28 08:50:19 +01:00
Michael Niedermayer 6182e0a6f6 vf_aspect: unbreak avoption system
This fixes ff* -h infinite looping

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-22 13:12:15 +02:00
Stefano Sabatini 6752aac6bc lavfi/aspect: add max option 2012-10-22 10:46:43 +02:00
Stefano Sabatini ccd6def9b3 lavfi/aspect: extend syntax for the setdar and setsar filters
Add support for named options, and deprecate old "num:den" ambiguous
syntax.
2012-10-22 10:46:34 +02:00
Michael Niedermayer 526cb36e4b Merge commit '4436f25a1682ada3f7226cb6fadf429946933161'
* commit '4436f25a1682ada3f7226cb6fadf429946933161':
  build: remove references to unused EXTRAOBJS variable
  lavfi: convert input/ouput list compound literals to named objects
  fate: add h263 obmc vsynth tests
  avconv: remove bogus warning when using avconv -h without parameter
  averror: explicitly define AVERROR_* values
  flashsv: propagate inflateReset() errors
  indeo4/5: remove constant parameter num_bands from wavelet recomposition
  mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
  Double motion vector range for HPEL interlaced picture in proper place

Conflicts:
	libavcodec/v210dec.h
	libavfilter/af_aformat.c
	libavfilter/af_amix.c
	libavfilter/af_asyncts.c
	libavfilter/af_channelmap.c
	libavfilter/af_join.c
	libavfilter/asrc_anullsrc.c
	libavfilter/buffersrc.c
	libavfilter/f_setpts.c
	libavfilter/f_settb.c
	libavfilter/fifo.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_blackframe.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawbox.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_fieldorder.c
	libavfilter/vf_fps.c
	libavfilter/vf_hflip.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_select.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/vsrc_testsrc.c
	libavformat/mxfdec.c
	libavutil/error.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-11 15:46:48 +02:00
Mans Rullgard 568c70e79e lavfi: convert input/ouput list compound literals to named objects
A number of compilers, for example those from TI and IBM, choke on
these initialisers.  The current style is also quite ugly.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-10 22:26:12 +01:00
Michael Niedermayer c581cb4e4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
	configure
	doc/APIchanges
	doc/examples/decoding_encoding.c
	libavcodec/Makefile
	libavcodec/assdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/avpacket.c
	libavcodec/dv_profile.c
	libavcodec/dwt.c
	libavcodec/libtheoraenc.c
	libavcodec/rawdec.c
	libavcodec/rv40dsp.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/v210dec.h
	libavcodec/vc1dsp.c
	libavcodec/x86/Makefile
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/buffer.c
	libavfilter/formats.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_select.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/version.h
	libavutil/audioconvert.c
	libavutil/error.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 16:20:30 +02:00
Martin Storsjö 1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Michael Niedermayer 88beb2df98 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  FATE: fix the asyncts test
  build: Drop gcc-specific warning flag from header compilation rule
  FATE: add a test for the asyncts audio filter.
  matroskadec: return more correct error code on read error.
  buffersrc: check ff_get_audio_buffer() for errors.
  lavfi: check all ff_get_video_buffer() calls for errors.
  lavfi: check all avfilter_ref_buffer() calls for errors.
  vf_select: avoid an unnecessary avfilter_ref_buffer().
  buffersrc: avoid creating unnecessary buffer reference
  lavfi: use avfilter_unref_bufferp() where appropriate.
  vf_fps: add more error checks.
  vf_fps: fix a memleak on malloc failure.
  lavfi: check all ff_start_frame/draw_slice/end_frame calls for errors
  lavfi: add error handling to end_frame().
  lavfi: add error handling to draw_slice().
  lavfi: add error handling to start_frame().

Conflicts:
	Makefile
	ffplay.c
	libavfilter/buffersrc.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_frei0r.c
	libavfilter/vf_hflip.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/video.c
	libavfilter/vsrc_color.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-22 23:56:21 +02:00