summaryrefslogtreecommitdiff
path: root/libavfilter/vf_fade.c
Commit message (Collapse)AuthorAge
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one looks at the many query_formats callbacks in existence, one will immediately recognize that there is one type of default callback for video and a slightly different default callback for audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);" for video with a filter-specific pix_fmts list. For audio, it is the same with a filter-specific sample_fmts list together with ff_set_common_all_samplerates() and ff_set_common_all_channel_counts(). This commit allows to remove the boilerplate query_formats callbacks by replacing said callback with a union consisting the old callback and pointers for pixel and sample format arrays. For the not uncommon case in which these lists only contain a single entry (besides the sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also added to the union to store them directly in the AVFilter, thereby avoiding a relocation. The state of said union will be contained in a new, dedicated AVFilter field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t in order to create a hole for this new field; this is no problem, as the maximum of all the nb_inputs is four; for nb_outputs it is only two). The state's default value coincides with the earlier default of query_formats being unset, namely that the filter accepts all formats (and also sample rates and channel counts/layouts for audio) provided that these properties agree coincide for all inputs and outputs. By using different union members for audio and video filters the type-unsafety of using the same functions for audio and video lists will furthermore be more confined to formats.c than before. When the new fields are used, they will also avoid allocations: Currently something nearly equivalent to ff_default_query_formats() is called after every successful call to a query_formats callback; yet in the common case that the newly allocated AVFilterFormats are not used at all (namely if there are no free links) these newly allocated AVFilterFormats are freed again without ever being used. Filters no longer using the callback will not exhibit this any more. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* avfilter/internal: Replace AVFilterPad.needs_writable by flagsAndreas Rheinhardt2021-08-17
| | | | | | | It will be useful in the future when more flags are added. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/internal: Factor out executing a filter's execute_funcAndreas Rheinhardt2021-08-15
| | | | | | | The current way of doing it involves writing the ctx parameter twice. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Factor common function combinations outAndreas Rheinhardt2021-08-13
| | | | | | | | | | | Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-27
| | | | | | | 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>
* avfilter/vf_fade: add timeline supportPaul B Mahol2020-12-11
|
* avfilter/vf_fade: config_props -> config_inputLimin Wang2020-11-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/vf_fade: simplify code to use pts timebase for time checkLimin Wang2020-11-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* remove CHAR_MIN/CHAR_MAX usagePaul B Mahol2020-03-17
| | | | It is not needed at all.
* avfilter/vf_fade: fix color fading for planar rgbPaul B Mahol2020-02-09
|
* avfilter/vf_fade: add >8 bit support for black and alpha fadePaul B Mahol2020-02-09
|
* avfilter/vf_fade: improve type option descriptionPaul B Mahol2020-02-08
|
* avfilter/vf_fade: add missing .flags for type optionPaul B Mahol2020-02-08
|
* avfilter/vf_fade: reindent after previous commitPaul B Mahol2019-12-23
|
* avfilter/vf_fade: add support for gbrp/gbrap formatsPaul B Mahol2019-12-23
|
* avfilter/fade: don't allow nb_frames == 0Gyan Doshi2019-07-29
| | | | In filter init, there's a division by nb_frames but value isn't checked.
* avfilter/vf_fade: fix start/duration max valueMark Harris2018-11-12
| | | | | A fade out (usually at the end of a video) can easily start beyond INT32_MAX (about 36 minutes). Regression since d40dc64173.
* lavfi: split frame_count between input and output.Nicolas George2016-11-13
| | | | | | | | | | | | 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.
* avfilter: make use of ff_filter_get_nb_threadsPaul B Mahol2016-08-29
|
* Merge commit 'a638e9184d63e57e67901f34afe919fd56fd3ac4'Derek Buitenhuis2016-04-21
|\ | | | | | | | | | | | | * commit 'a638e9184d63e57e67901f34afe919fd56fd3ac4': vf_fade: make sure the slice end is always in the frame Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * vf_fade: make sure the slice end is always in the frameAnton Khirnov2016-03-25
| | | | | | | | CC: libav-stable@libav.org
* | avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-27
| | | | | | | | | | | | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avfilter/fade: use AV_OPT_TYPE_BOOL for alpha optionClément Bœsch2015-09-09
| |
* | avfilter/vf_fade: Force alpha pixel format if alpha is set to 1Michael Niedermayer2015-05-31
| | | | | | | | | | | | Fixes Ticket4321 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter: handle error in query_formats() in bunch of filtersPaul B Mahol2015-04-08
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavfi/fade: Do not overread input buffer.Carl Eugen Hoyos2015-02-25
| |
* | Merge commit '58400ac133bcfb6bf8196b4e5208bc178307739b'Michael Niedermayer2014-04-19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavfi: name anonymous structsVittorio Giovara2014-04-19
| |
* | avfilter/fade: use FADE_OUT macro.Clément Bœsch2013-11-10
| |
* | avfilter/fade: remove a bunch of useless parenthesis.Clément Bœsch2013-11-10
| |
* | avfilter/fade: use inlink->frame_count.Clément Bœsch2013-11-10
| |
* | avfilter/fade: add color option.Clément Bœsch2013-11-10
| | | | | | | | Fixes Ticket #1822.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavfi: do not export the filters from shared objectsAnton Khirnov2013-10-28
| |
* | avfilter: remove duplicate includesMichael Niedermayer2013-09-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter: various cosmeticsPaul B Mahol2013-09-12
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter: remove redundant .get_(audio/video)_buffer initializationsPaul B Mahol2013-09-07
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | vf_fade: remove unused functionMichael Niedermayer2013-05-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | vf_fade: Support slice threaded alphaMichael Niedermayer2013-05-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | vf_fade: Fix alpha flag integrationMichael Niedermayer2013-05-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | fade: fix slice sizesMichael Niedermayer2013-05-24
| | | | | | | | | | | | | | | | This more evenly distributes the load between threads This also fixes the chroma filtering where the filter was applied twice Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-05-24
|\| | | | | | | | | | | | | | | | | | | | | | | * qatar/master: vf_fade: support slice threading vf_yadif: support slice threading Conflicts: libavfilter/vf_fade.c libavfilter/vf_yadif.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_fade: support slice threadingAnton Khirnov2013-05-24
| |
* | Merge commit 'c0279956b3ca3e5fd0a6a25253893d6f07000e68'Michael Niedermayer2013-05-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c0279956b3ca3e5fd0a6a25253893d6f07000e68': vf_fade: use the name 's' for the pointer to the private context vf_drawtext: use the name 's' for the pointer to the private context vf_drawbox: use the name 's' for the pointer to the private context Conflicts: libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_fade: use the name 's' for the pointer to the private contextAnton Khirnov2013-05-16
| | | | | | | | This is shorter and consistent across filters.
| * lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-09
| |
* | replace remaining PIX_FMT_* flags with AV_PIX_FMT_FLAG_*Michael Niedermayer2013-05-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavfi: use ceil right shift for chroma width/height.Clément Bœsch2013-05-10
| | | | | | | | | | | | | | This should fix several issues with odd dimensions inputs. lut, vflip, pad and crop video filters also need to be checked for such issues. It's possible sws is also affected.
* | lavfi/fade: Added ability to do video fade based on timestampAndy Martin2013-04-21
| |