summaryrefslogtreecommitdiff
path: root/libavfilter/vf_psnr.c
Commit message (Collapse)AuthorAge
* all: Replace if (ARCH_FOO) checks by #if ARCH_FOOAndreas Rheinhardt2022-06-15
| | | | | | | | | | | | | | | | | | 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: use avpriv_fopen_utf8() instead of plain fopen()softworkz2022-05-24
| | | | | | | | Unify file access operations by replacing usages of direct calls to posix fopen() to prepare for long filename support on Windows. Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* 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.
* avfilter/vf_psnr/ssim: fix typosPaul B Mahol2021-10-28
|
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_psnr: 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/vf_psnr: Remove always-false format checkAndreas Rheinhardt2021-09-21
| | | | | | | This filter uses ff_set_common_formats_from_list(). Reviewed-by: Paul B Mahol <onemda@gmail.com> 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_psnr: remove unnecessary checkLimin Wang2021-05-01
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.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_psnr: add support for slice threadingPaul B Mahol2021-02-19
|
* avfilter/vf_psnr: remove precision limits for metadata valuesPaul B Mahol2021-02-12
|
* avfilter/vf_psnr: add timeline supportPaul B Mahol2021-02-12
|
* avfilter/vf_psnr: fix logic failure when comparing time basesPaul B Mahol2020-02-01
|
* avfilter/vf_psnr,vf_ssim: add warning if different timebases are encounteredPaul B Mahol2019-10-25
|
* avfilter: add support for gray14 formatPaul B Mahol2018-09-09
|
* avfilter/vf_psnr: add more gbrap formatsPaul B Mahol2017-12-20
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi: Rename local variables "main" as "master".Carl Eugen Hoyos2017-10-07
| | | | | Silences several warnings: main is usually a function
* lavfi: rename framesync2 to framesync.Nicolas George2017-09-12
|
* lavfi/vf_psnr: convert to framesync2.Nicolas George2017-08-29
|
* avfilter: add support for GRAY9 and GBRAP10Paul B Mahol2017-08-07
|
* avfilter: do not use AVFrame accessorMuhammad Faiz2017-04-23
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
* lavfi/psnr: rename pow2 to pow_2Clément Bœsch2017-03-29
| | | | | | | | | | | This conflict with the DJGPP libc which includes a pow2 function¹ We cannot make DJGPP POSIX only (using -D_POSIX_SOURCE) to avoid this kind of symbols conflicts due to the lack of both posix_memalign and memalign (DJGPP non standard function) in that POSIX mode. We currently rely on memalign for aligned heap allocation. [1]: http://www.delorie.com/djgpp/doc/libc-2.02/libc_536.html
* avfilter/vf_psnr: add gray10 and gray12 supportPaul B Mahol2016-12-21
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_psnr: Add max value output option to psnr stats log.Lucas Cooper2016-09-01
| | | | | | | This allows retroactive calculation/aggregation of PSNR from the stats log. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: Add new format for PSNR stats logLucas Cooper2016-07-29
| | | | | | | | | | | | Add an AVOption stats_version with a new header for V2 stats, which specifies the stats log version and lists the fields that will be present in the log (to ease parsing). The primary motivation is to facilitate the addition of optional fields to the log without breaking backwards compatibility, while making the logs easier to parse. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_psnr: Fix rounding error in average_maxMichael Niedermayer2016-07-21
| | | | | | | The intermediate was rounded to an integer Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* 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/vf_psnr: use log10 instead of log()/log(10)Ganesh Ajjanagadde2015-10-29
| | | | | | | This is likely more precise and conveys the intent better. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* vf_psnr/ssim: don't crash if stats_file is NULL.Ronald S. Bultje2015-10-23
|
* vf_psnr: remove %0.2f format specifiers for stream summary line.Ronald S. Bultje2015-10-22
| | | | This makes output equally precise as vf_ssim.
* avfilter/vf_psnr: Add support for writing stats to stdoutTobias Rapp2015-10-21
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace all remaining occurances of step/depth_minus1 and offset_plus1Hendrik Leppkes2015-09-08
|
* vf_psnr: add psnr_avg to stats file.Ronald S. Bultje2015-08-05
|
* avfilter/vf_pnsr: fix author nameJames Almer2015-07-29
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* vf_psnr: sse2 optimizations for sum-squared-error.Ronald S. Bultje2015-07-14
| | | | | | | | | | | | The internal line accumulator for 16bit can overflow, so I changed that from int to uint64_t in the C code. The matching assembly looks a little weird but output looks correct. (avx2 should be trivial to add later.) Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vf_psnr: fix rgb channel order mixup in final log message.Ronald S. Bultje2015-07-11
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vf_psnr: always calculate MSE over full pixel range.Ronald S. Bultje2015-07-11
| | | | | | | | This makes the output compatible with that of pretty much any other tool that calculates PSNR. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vF_psnr: move set_meta() calls out of loop.Ronald S. Bultje2015-07-11
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vf_psnr: add channel weighting based on chroma subsampling.Ronald S. Bultje2015-07-11
| | | | | | Also add per-channel psnr stream averages to final log message. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: handle error in query_formats() in bunch of filtersPaul B Mahol2015-04-08
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Replace PixelFormats which sneaked in over time or where forgotten by ↵Michael Niedermayer2015-03-18
| | | | | | AVPixelFormats Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Fix a few heigth/height typo.Clément Bœsch2014-02-07
|
* 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/dualinput: simplifyPaul B Mahol2013-09-30
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* lavfi/dualinput: reimplement on top of framesync.Nicolas George2013-09-23
|
* avfilter/vf_psnr: avoid 64bit arithmetic in the inner loopMichael Niedermayer2013-09-21
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>