summaryrefslogtreecommitdiff
path: root/libavfilter/vf_yadif.c
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/ccfifo: remove unnecessary context allocationsJames Almer2023-05-121-3/+5
| | | | | | | This is not public API, no it has no need for an alloc() and free() functions. The struct can reside on stack. Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/yadif: Properly preserve CEA-708 closed captionsDevin Heitmueller2023-05-111-0/+8
| | | | | | | | | | | | | Various deinterlacing modes have the effect of doubling the framerate, and we need to ensure that the caption data isn't duplicated (or else you get double captions on-screen). Use the new ccfifo mechanism for yadif (and yadif_cuda and bwdif since they use the same yadif core) so that CEA-708 data is properly preserved through this filter. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* vf_yadif: Remove unused emms_cKieran Kunhya2023-02-141-2/+0
|
* all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt2022-06-151-2/+3
| | | | | | | | | | | | | | | | | | This is more spec-compliant because it does not rely on dead-code elimination by the compiler. Especially MSVC has problems with this, as can be seen in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html or https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html This commit does not eliminate every instance where we rely on dead code elimination: It only tackles branching to the initialization of arch-specific dsp code, not e.g. all uses of CONFIG_ and HAVE_ checks. But maybe it is already enough to compile FFmpeg with MSVC with whole-programm-optimizations enabled (if one does not disable too many components). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-051-17/+17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_yadif: Use formats list instead of query functionAndreas Rheinhardt2021-10-051-6/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Factor out executing a filter's execute_funcAndreas Rheinhardt2021-08-151-1/+2
| | | | | | | 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-131-4/+1
| | | | | | | | | | | 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>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/internal, swresample/audioconvert: Remove cpu.h inclusionsAndreas Rheinhardt2021-07-221-1/+0
| | | | | | | | | | These inclusions are not necessary, as cpu.h is already included wherever it is needed (via direct inclusion or via the arch-specific headers). Also remove other unnecessary cpu.h inclusions from ordinary non-headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_yadif: Fix handing of tiny imagesMichael Niedermayer2021-05-291-14/+18
| | | | | | | | Fixes: out of array access Fixes: Ticket8240 Fixes: CVE-2020-22021 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/yadif: Fix time base for large denominatorsTom Boshoven2021-05-271-2/+1
| | | | | | | This fixes an issue where the yadif filter could cause the timebase denominator to overflow. Signed-off-by: Tom Boshoven <tom@jwplayer.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | 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>
* Revert "avfilter/yadif: simplify the code for better readability"Limin Wang2020-08-271-10/+6
| | | | This reverts commit 2a9b934675b9e2d3850b46f8a618c19b03f02551.
* avfilter/yadif: simplify the code for better readabilityLimin Wang2020-08-261-6/+10
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/vf_yadif: cosmetics in the pix_fmts[] arrayLimin Wang2019-12-251-35/+12
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_yadif: rename config_props -> config_output, link -> outlinkLimin Wang2019-11-291-10/+10
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavfilter/vf_yadif: Make frame management logic and options shareablePhilip Langdale2018-11-021-187/+9
| | | | | | | | | | | I'm writing a cuda implementation of yadif, and while this obviously has a very different implementation of the actual filtering, all the frame management is unchanged. To avoid duplicating that logic, let's make it shareable. From the perspective of the existing filter, the only real change is introducing a function pointer for the filter() function so it can be specified for the specific filter.
* Merge commit 'feed239021bad89743d5e7989b426ae594322eb7'James Almer2017-11-111-11/+17
|\ | | | | | | | | | | | | | | | | * commit 'feed239021bad89743d5e7989b426ae594322eb7': yadif: Account for the buffer alignment while processing the frame edges See 221f902f1dc167bdc0bfdff6b6af3214ae3cc1f4 Merged-by: James Almer <jamrial@gmail.com>
| * yadif: Account for the buffer alignment while processing the frame edgesMichael Niedermayer2017-08-221-9/+19
| | | | | | | | | | | | | | | | Avoid out of bound reads. Bug-Id: 1031 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avfilter: make use of ff_filter_get_nb_threadsPaul B Mahol2016-08-291-1/+1
| |
* | avfilter/vf_yadif: make use of ctx pointerPaul B Mahol2016-02-011-8/+8
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-271-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit '9df477e03ef74068f3de130adc4dd34349a16ef2'Hendrik Leppkes2015-11-111-2/+3
|\ \ | |/ | | | | | | | | | | * commit '9df477e03ef74068f3de130adc4dd34349a16ef2': yadif: update frame rate Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * yadif: update frame rateMichael Niedermayer2015-11-091-0/+4
| | | | | | | | | | (cherry picked from ffmpeg commit 31619584556466e4beab98e9b04ed4c5ba0db178) Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | lavfi/vf_yadif: reindent after last commit.Nicolas George2015-10-071-15/+13
| |
* | lavfi/vf_yadif: remove looping on request_frame().Nicolas George2015-10-071-3/+2
| |
* | avfilter/vf_yadif: add missing "This file is part of FFmpeg"Michael Niedermayer2015-09-271-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'Hendrik Leppkes2015-09-081-2/+2
|\ \ | |/ | | | | | | | | | | * commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba': lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fields Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavu: Drop the {minus,plus}1 suffix from AVComponentDescriptor fieldsVittorio Giovara2015-09-071-2/+2
| | | | | | | | | | | | The new fields can be accessed directly and are more intelligible. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * vf_yadif: Relicense from GPL to LGPLRobert Krüger2014-01-141-9/+9
| | | | | | | | All copyright holders have agreed to the relicensing.
* | avfilter: handle error in query_formats() in bunch of filtersPaul B Mahol2015-04-081-3/+4
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avfilter/vf_yadif: detect telecine contentMichael Niedermayer2015-01-061-1/+5
| | | | | | | | | | | | Fixes: yadif with interlaced_flag_switch.mpeg Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter/vf_yadif: add >8bit planar rgb formatsMichael Niedermayer2014-12-301-0/+5
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter/vf_yadif: fix extra leading dup frame when deint=1Neil Birkbeck2014-11-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logic for handling single frame in yadif (0f9f24c9), caused deint=1 (e.g., yadif=0:-1:1) to output extra duplicate leading frame: ffmpeg -i fate-suite/ffmpeg-synthetic/vsynth1/%02d.pgm -vf yadif=0:-1:1,showinfo -f null -y /dev/null [Parsed_showinfo_1 @ 0x1d967d0] n:0 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:E457EEA0 plane_checksum:[E457EEA0] mean:[126] stdev:[46.6] [Parsed_showinfo_1 @ 0x1d967d0] n:1 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:E457EEA0 plane_checksum:[E457EEA0] mean:[126] stdev:[46.6] (Outputs 51 frames) After patch, vf "yadif=0:-1:1" behaves correctly (like "yadif=0:-1:0") and outputs 50 frames, first two: [Parsed_showinfo_1 @ 0x1e307d0] n:0 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:68E8D1EB plane_checksum:[68E8D1EB] mean:[126] stdev:[46.0] [Parsed_showinfo_1 @ 0x1e307d0] n:1 pts:2 pts_time:0.04 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:4E674BC7 plane_checksum:[4E674BC7] mean:[125] stdev:[46.0] (Outputs 50 frames) Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | vfilter/vf_yadif: fix request_frame after 0f9f24c9Michael Niedermayer2014-05-031-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter/vf_yadif: fix filtering a single imageMichael Niedermayer2014-05-021-5/+5
| | | | | | | | | | Found-by: wm4 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Change license of yadif from GPL to LGPLRobert Krüger2014-01-141-9/+9
| | | | | | | | | | Signed-off-by: Robert Krüger <krueger@lesspain.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "avfilter/yadif: Revert "lavfi: convert input/ouput list compound ↵Robert Krüger2014-01-141-14/+21
| | | | | | | | | | | | | | | | | | literals to named objects"" This reverts commit 4ef4bb4a203e8f472ab0484396270b9430862037. Signed-off-by: Robert Krüger <krueger@lesspain.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "Revert "yadif: add parens around macro parameters""Robert Krüger2014-01-141-4/+4
| | | | | | | | | | | | | | This reverts commit ab00800cde1af1f252731118062dd5149f1a7ed7. Signed-off-by: Robert Krüger <krueger@lesspain.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "Revert "vf_yadif: move x86 init code to x86/yadif.c""Robert Krüger2014-01-141-67/+3
| | | | | | | | | | | | | | This reverts commit 975110a85ef8e794fdc041455ff41b0ad30bc01e. Signed-off-by: Robert Krüger <krueger@lesspain.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "vf_yadif: move x86 init code to x86/yadif.c"Michael Niedermayer2013-12-011-3/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a87b17f3283aada762820f1b797eeb7a2dff6c61. This reduces the amount of non LGPL code, making a relicensing to LGPL easier Conflicts: libavfilter/vf_yadif.c libavfilter/x86/yadif.c libavfilter/x86/yadif_template.c libavfilter/yadif.h Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "yadif: add parens around macro parameters"Michael Niedermayer2013-12-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 49e617f9565b6528fe707bae7ea4b62b10c771a5. This reduces the amount of non LGPL code, making a relicensing to LGPL easier Conflicts: libavfilter/vf_yadif.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter/yadif: Revert "lavfi: convert input/ouput list compound literals to ↵Michael Niedermayer2013-12-011-21/+14
| | | | | | | | | | | | | | | | | | | | named objects" This reverts commit 568c70e79ee267426c15ef4603c69703f6a5884a. This reduces the amount of non LGPL code, making a relicensing to LGPL easier Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-10-291-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-281-1/+1
| |
* | avfilter: various cosmeticsPaul B Mahol2013-09-121-9/+7
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>