summaryrefslogtreecommitdiff
path: root/libavfilter/vf_hqdn3d.c
Commit message (Collapse)AuthorAge
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_hqdn3d: 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/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/vf_hqdn3d: fix left shift of negative numbersValerii Zapodovnikov2021-06-05
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* 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_hqdn3d: add support for commandsPaul B Mahol2019-11-29
|
* avfilter/vf_hqdn3d: add support for 12bit and 14bit yuv formatsPaul B Mahol2019-11-29
|
* lavfi/hqdn3d: add slice thread optimizationJun Zhao2019-10-10
| | | | | | | | | | | | | | Enabled one thread per plane, used the test command for 1080P video (YUV420P format) as follow: ffmpeg -i 1080p.mp4 -an -vf hqdn3d -f null /dev/nul This optimization improved the performance about 30% in 1080P YUV420P case (from 110fps to 143fps), also pass the framemd5 check and FATE. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\ | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | 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,swresample,swscale: use fabs, fabsf instead of FFABSGanesh Ajjanagadde2015-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is well known that fabs and fabsf are at least as fast and sometimes faster than the FFABS macro, at least on the gcc+glibc combination. For instance, see the reference: http://patchwork.sourceware.org/patch/6735/. This was a patch to glibc in order to remove their usages of a macro. The reason essentially boils down to fabs using the __builtin_fabs of the compiler, while FFABS needs to infer to not use a branch and to simply change the sign bit. Usually the inference works, but sometimes it does not. This may be easily checked by looking at the asm. This also has the added benefit of reducing macro usage, which has problems with side-effects. Note that avcodec is not handled here, as it is huge and most things there are integer arithmetic anyway. Tested with FATE. Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | Merge commit '2268db2cd052674fde55c7d48b7a5098ce89b4ba'Hendrik Leppkes2015-09-08
|\| | | | | | | | | | | | | * 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-07
| | | | | | | | | | | | The new fields can be accessed directly and are more intelligible. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avfilter/vf_hqdn3d: Initialize the whole LUTMichael Niedermayer2015-05-27
| | | | | | | | | | | | | | | | | | With bps > 8 more than 255..255 are used The initialized table content is left unchanged, But it could also be adjusted for the slight difference of the maximum Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avfilter: handle error in query_formats() of a bunch of random video filtersClément Bœsch2015-03-16
| |
* | avfilter/hqdn3d: an invalid bit depth means a bug, not invalid read dataClément Bœsch2015-02-08
| | | | | | | | This code looks clumsy, and an assert would probably be more welcome.
* | Merge commit '22b985d59c007c4422aefe3ef3fca0aa0daafa9f'Michael Niedermayer2015-01-29
|\| | | | | | | | | | | | | | | | | | | * commit '22b985d59c007c4422aefe3ef3fca0aa0daafa9f': hqdn3d: check memory allocations and propagate errors Conflicts: libavfilter/vf_hqdn3d.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * hqdn3d: check memory allocations and propagate errorsVittorio Giovara2015-01-29
| |
* | avfilter/vf_hqdn3: use av_malloc_array()Michael Niedermayer2014-05-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-03-05
|\| | | | | | | | | | | | | * qatar/master: avfilter: Add missing emms_c when needed Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avfilter: Add missing emms_c when neededLuca Barbato2014-03-05
| | | | | | | | | | | | | | | | Arch specific calls should have an emms_c following to keep the cpu state consistent. Reported-By: wm4 CC: libav-stable@libav.org
* | 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: 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/hqdn3d: make use of AVFILTER_DEFINE_CLASSPaul B Mahol2013-05-27
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '16a645adeb758207346a4bbf66766f02734c461e'Michael Niedermayer2013-05-17
|\| | | | | | | | | | | | | | | * commit '16a645adeb758207346a4bbf66766f02734c461e': vf_pixdesctest: make config_props work properly when called multiple times. vf_hqdn3d: make config_props work properly when called multiple times. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_hqdn3d: make config_props work properly when called multiple times.Anton Khirnov2013-05-17
| | | | | | | | Do not leak all the temp buffers.
* | Merge commit '4753f802c00853859b7b4b8fdb79c35e082cb7f8'Michael Niedermayer2013-05-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4753f802c00853859b7b4b8fdb79c35e082cb7f8': vf_libopencv: use the name 's' for the pointer to the private context vf_hqdn3d: use the name 's' for the pointer to the private context vf_hflip: use the name 's' for the pointer to the private context vf_gradfun: use the name 's' for the pointer to the private context Conflicts: libavfilter/vf_gradfun.c libavfilter/vf_hflip.c libavfilter/vf_hqdn3d.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_hqdn3d: use the name 's' for the pointer to the private contextAnton Khirnov2013-05-16
| | | | | | | | This is shorter and consistent across filters.
* | lavfi/hqdn3d: restore timeline feature.Clément Bœsch2013-05-12
| |
* | lavfi/hqdn3d: use macros instead of hardcoded indexes.Clément Bœsch2013-05-12
| |
* | 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.
* | Merge commit '093804a93cc5da3f95f98265a5df116912443cec'Michael Niedermayer2013-05-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '093804a93cc5da3f95f98265a5df116912443cec': avfilter: Add av_cold attributes to init/uninit functions Conflicts: libavfilter/af_ashowinfo.c libavfilter/af_volume.c libavfilter/src_movie.c libavfilter/vf_lut.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avfilter: Add av_cold attributes to init/uninit functionsDiego Biurrun2013-05-04
| |
| * lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-09
| |
* | lavfi/hqdn3d: remove timeline flag.Clément Bœsch2013-04-26
| | | | | | | | | | | | The filter stores some temporal data, which needs to be done with the passthrough callback system when timeline is enabled. Until then, timeline support is disabled.
* | lavfi: add timeline support.Clément Bœsch2013-04-23
| | | | | | | | | | Flag added in a few simple filters. A bunch of other filters can likely use the feature as well.
* | avfilter: add missing AV_OPT_FLAG_FILTERING_PARAMMichael Niedermayer2013-04-12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavfi: remove now unused args parameter from AVFilter.initAnton Khirnov2013-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit '8c747d46f721cffa8ea51990805ad1d3a3a4fd0a'Michael Niedermayer2013-04-10
|\| | | | | | | | | | | | | * commit '8c747d46f721cffa8ea51990805ad1d3a3a4fd0a': vf_hqdn3d: switch to an AVOptions-based system. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_hqdn3d: switch to an AVOptions-based system.Anton Khirnov2013-04-09
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-03-13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: hqdn3d: Fix out of array read in LOWPASS cabac: remove unused argument of ff_init_cabac_states() rawdec: fix a typo -- || instead of | Conflicts: libavcodec/cabac.c libavcodec/h264.c libavfilter/vf_hqdn3d.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * hqdn3d: Fix out of array read in LOWPASSLoren Merritt2013-03-13
| | | | | | | | | | CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '555000c7d5c1e13043a948ebc48d2939b0ba6536'Michael Niedermayer2013-03-13
|\| | | | | | | | | | | | | | | | | * commit '555000c7d5c1e13043a948ebc48d2939b0ba6536': h264: check that DPB is allocated before accessing it in flush_dpb() vf_hqdn3d: fix uninitialized variable use vf_gradfun: fix uninitialized variable use Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vf_hqdn3d: fix uninitialized variable useAnton Khirnov2013-03-11
| | | | | | | | CC:libav-stable@libav.org