summaryrefslogtreecommitdiff
path: root/libavfilter/vf_idet.c
Commit message (Collapse)AuthorAge
* avfilter: add AVFILTER_FLAG_METADATA_ONLYAnton Khirnov2021-12-04
| | | | | | This flag allows distinguishing between filters that actually modify the data and those that only modify metadata or gather some stream information.
* Revert "avfilter/vf_idet: reduce noisyness if the filter has been auto inserted"Andreas Rheinhardt2021-10-11
| | | | | | | | | | | This reverts commit 723c37d3b7b5555f23bfdfe3e5c3599543c06332. Said commit was in preparation for auto-inserting the idet filter. This has never happened; even if it did, the code is wrong, because it segfaults if the filter instance doesn't have a name (having one is not mandatory). Furthermore, it is documented for libavfilter to not assign any semantics to the name, which this check violates. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_idet: Use formats list instead of query functionAndreas Rheinhardt2021-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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/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>
* avutil/internal, swresample/audioconvert: Remove cpu.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | | | | 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: 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_idet: added more YUVA formats to idet query_formatsRobert Nagy2018-01-14
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: do not use AVFrame accessorMuhammad Faiz2017-04-23
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* 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>
* lavfi/vf_idet: replace round and cast by lrintGanesh Ajjanagadde2015-12-19
| | | | | | | | lrint is faster and conveys the intent better here. It is safe as long int has at least 32 bits. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* lavfi: remove FF_LINK_FLAG_REQUEST_LOOP.Nicolas George2015-09-20
| | | | It has no longer any effect.
* lavfi/vf_idet: reindent after last commit.Nicolas George2015-09-20
|
* lavfi/vf_idet: remove the loop in request_frame().Nicolas George2015-09-20
| | | | It is not necessary due to the use of FF_LINK_FLAG_REQUEST_LOOP.
* Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-08
|
* avfilter: handle error in query_formats() of a bunch of random video filtersClément Bœsch2015-03-16
|
* avfilter/vf_idet: factorize av_frame_free(&idet->prev)Michael Niedermayer2015-01-19
| | | | | Found-by: Pascal Massimino <pascal.massimino@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: flush internal buffers on parameter changesMichael Niedermayer2015-01-19
| | | | | | This is needed to auto insert the filter by default Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: reduce noisyness if the filter has been auto insertedMichael Niedermayer2015-01-19
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: Add analyze_interlaced_flag modeMichael Niedermayer2015-01-06
| | | | | | This should allow us to insert idet before scale and let scale have interl=-1 as default in that case Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: Add 9, 12 and 14 bit pixel formatsMichael Niedermayer2015-01-01
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: Use frame_requested instead of prevMichael Niedermayer2015-01-01
| | | | | | This is more robust if the delay is not constant Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: Fixing idet for single-frame inputs.Neil Birkbeck2014-11-28
| | | | | | | | | | | | | | | | | | | | Handle single frame inputs similar to yadif (e.g., https://github.com/FFmpeg/FFmpeg/commit/0f9f24c9cfd291c7ece4d3bad64fdf06d107168a and https://github.com/FFmpeg/FFmpeg/commit/681e008d06d2241d50abe6316c908a184ddc5942) Example: ffmpeg -r 1 -t 1 -i fate-suite/ffmpeg-synthetic/vsynth1/%02d.pgm -vf idet,showinfo -f null -y /dev/null Previously: Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used) [Parsed_idet_0 @ 0x36389d0] Repeated Fields: Neither: 0 Top: 0 Bottom: 0 After patch: [Parsed_showinfo_1 @ 0x1909810] n:0 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 ... [Parsed_idet_0 @ 0x18f9bb0] Repeated Fields: Neither: 1 Top: 0 Bottom: 0 Fate looks good. Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: add a repeated field detectionKevin Mitchell2014-11-05
| | | | | | This can be useful for determining telecine. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: use exp2()Michael Niedermayer2014-11-03
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: use av_rescale()Michael Niedermayer2014-11-03
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: fix rounding of av_dict_set_fxp()Michael Niedermayer2014-11-03
| | | | | | fixes the remainder overflowing beyond .999 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: add a "half_life" option for statisticsKevin Mitchell2014-11-03
| | | | | | This can be useful for videos in which the interlacing pattern changes. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/idet: add current frame classification to metadataKevin Mitchell2014-11-01
| | | | | | Fixes ticket 3832 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/idet: add metadata to "current" frame instead of "next" frameKevin Mitchell2014-11-01
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: Fixes issue with idet not flushing last frame.Neil Birkbeck2014-10-22
| | | | | | | | | | | | | | | | | | Uses a similar approach as vf_yadif to flush the last frame in idet. Quick test with 50 frames from vsynth1: ./ffmpeg.old -i fate-suite/ffmpeg-synthetic/vsynth1/%02d.pgm -vf idet -f mp4 -y /dev/null 2>&1 | grep Multi (gives) [Parsed_idet_0 @ 0x261ebb0] Multi frame detection: TFF:0 BFF:0 Progressive:48 Undetermined:1 ./ffmpeg -i fate-suite/ffmpeg-synthetic/vsynth1/%02d.pgm -vf idet -f mp4 -y /dev/null 2>&1 | grep Multi (gives) [Parsed_idet_0 @ 0x35a0bb0] Multi frame detection: TFF:0 BFF:0 Progressive:49 Undetermined:1 Fate tests have been updated. (In testing, it seems this filter will also need a subsequent patch for single frame input) Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: add both multiple and single frame detection metadataKevin Mitchell2014-10-20
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: add counts to frame metadataKevin Mitchell2014-10-19
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/idet: typo fix: PROGRSSIVE -> PROGRESSIVEPascal Massimino2014-09-20
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* av_filter/x86/idet: MMX/SSE2 implementation of 16bits filter_line()Pascal Massimino2014-09-09
| | | | | | | | tested on http://ps-auxw.de/10bit-h264-sample/10bit-eldorado.mkv MMX: ~30% faster decoding overall SSE2:~40% faster Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_idet: MMX/MMXEXT/SSE2 implementation of idet's filter_line()skal2014-09-04
| | | | | | | | integration by Neil Birkbeck, with help from Vitor Sessak. core SSE2 loop by Skal (pascal.massimino@gmail.com) Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* 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>
* avfilter: various cosmeticsPaul B Mahol2013-09-12
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter: remove redundant use of AV_NE() macroPaul B Mahol2013-09-11
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/idet: remove request_frame hackPaul B Mahol2013-05-27
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/idet: fix chroma subsampling with odd sizes.Clément Bœsch2013-05-16
|
* lavfi: remove now unused args parameter from AVFilter.init and init_opaqueMichael Niedermayer2013-04-12
| | | | | | | | | This is mostly automated global search and replace The deprecated aconvert filter is disabled, if it still has users it should be updated Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi/idet: switch to an AVOptions-based system.Clément Bœsch2013-04-11
|
* lavfi/idet: use standard options parsing.Clément Bœsch2013-03-24
|
* lavfi: remove remaining forgotten min/rej perms.Clément Bœsch2013-03-10
|
* Merge commit '7e350379f87e7f74420b4813170fe808e2313911'Michael Niedermayer2013-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 759001c534287a96dc96d1e274665feb7059145d 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>
* vf_idet: adapt default scores due to bugfixMichael Niedermayer2013-02-21
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* vf_idet: Fix macro arguments sideeffectMichael Niedermayer2013-02-21
| | | | | | | Fixes valgrind errors should improve detection scores Signed-off-by: Michael Niedermayer <michaelni@gmx.at>