├── .gitattributes ├── README.md └── libavfilter ├── xpsnr.h ├── allfilters.c ├── vf_xpsnr.c └── Makefile /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | *.c text 7 | *.h text 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | XPSNR Filter Plug-in for FFmpeg 2 | =============================== 3 | 4 | **NOTE: A cleaned version of this plug-in is now directly available 5 | in the FFmpeg codebase. For details see e.g. the Git repository at 6 | https://github.com/FFmpeg/FFmpeg/tree/master/ and the FFmpeg filter 7 | documentation at https://ffmpeg.org/ffmpeg-filters.html#xpsnr-1. 8 | This repository is only kept for reference and is not maintained!** 9 | 10 | The Extended Perceptually Weighted Peak Signal-to-Noise Ratio XPSNR 11 | is a low-complexity psychovisually motivated distortion measurement 12 | algorithm for assessing the difference between two video streams or 13 | images. This is particularly useful for objectively quantifying the 14 | distortions caused by video or image codecs, as an alternative to a 15 | formal subjective test. The logarithmic XPSNR output values are in 16 | a similar range as those of traditional PSNR assessments but better 17 | reflect human impressions of visual coding quality. More details on 18 | the XPSNR method can be found in the following scientific papers: 19 | 20 | * C. R. Helmrich, M. Siekmann, S. Becker, S. Bosse, D. Marpe, and 21 | T. Wiegand, "XPSNR: A Low-Complexity Extension of the Perceptually 22 | Weighted Peak Signal-to-Noise Ratio for High-Resolution Video Qua- 23 | lity Assessment," in Proc. IEEE Int. Conf. Acoustics, Speech, Sig. 24 | Process. (ICASSP), virt./online, May 2020. www.ecodis.de/xpsnr.htm 25 | 26 | * C. R. Helmrich, S. Bosse, H. Schwarz, D. Marpe, and T. Wiegand, 27 | "A Study of the Extended Perceptually Weighted Peak Signal-to-Noise 28 | Ratio (XPSNR) for Video Compression with Different Resolutions and 29 | Bit Depths," ITU Journal: ICT Discoveries, vol. 3, no. 1, pp. 65 - 30 | 72, May 2020. http://handle.itu.int/11.1002/pub/8153d78b-en 31 | 32 | This software allows to determine XPSNR output values, per-frame or 33 | averaged across all assessed frames, between two video streams (the 34 | reference, or input, video and the reconstructed, or output, video) 35 | using the *FFmpeg* software suite, available at https://ffmpeg.org/ 36 | 37 | When publishing the results of XPSNR assessments (which the license 38 | of this XPSNR implementation allows, see below), a reference to the 39 | above papers as a means of documentation is strongly encouraged. 40 | 41 | ___________________________________________________________________ 42 | 43 | 44 | Copyright 45 | --------- 46 | 47 | © 2019 - 2024 Fraunhofer-Gesellschaft zur Förderung der angewandten 48 | Forschung e.V. (Fraunhofer). All rights reserved. 49 | 50 | 51 | License 52 | ------- 53 | 54 | The copyright in this software implementation of the XPSNR model is 55 | being made available under the following Software Copyright License 56 | which is similar to the 3-clause BSD license but altered to address 57 | specific aspects dictated by the nature and use of this application. 58 | Please note that this software may be subject to other third-party 59 | and contributor rights, including patent rights, and no such rights 60 | are granted under this license. 61 | 62 | Redistribution and use of this software in source and binary forms, 63 | with or without modification, are permitted for non-commercial and 64 | commercial purposes provided that the following conditions are met: 65 | 66 | * Redistributions of source code must retain the above copyright 67 | notice, this list of conditions, and the following disclaimer. 68 | * Redistributions in binary form must reproduce the above copyright 69 | notice, this list of conditions, and the following disclaimer 70 | in the documentation and/or other materials provided with the 71 | distribution. 72 | * Neither the names of the copyright holder nor the names of its 73 | contributors may be used to endorse or promote products derived 74 | from this software without specific prior written permission. 75 | 76 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS 77 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 78 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 79 | FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE 80 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 81 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 82 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 83 | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 84 | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY 85 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 86 | THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 87 | DAMAGE. 88 | 89 | NO PATENTS GRANTED 90 | 91 | NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, INCLUDING WITH- 92 | OUT LIMITATION THE PATENTS OF THE COPYRIGHT HOLDER AND CONTRIBUTORS, 93 | ARE GRANTED BY THIS SOFTWARE COPYRIGHT LICENSE. THE COPYRIGHT HOLDER 94 | AND CONTRIBUTORS PROVIDE NO WARRANTY OF PATENT NON-INFRINGEMENT WITH 95 | RESPECT TO THIS SOFTWARE. 96 | 97 | 98 | Compilation 99 | ----------- 100 | 101 | This section describes how to compile the source code of this XPSNR 102 | implementation into the FFmpeg executable application as A/V filter 103 | under Linux. Instructions for Microsoft Windows may be added later. 104 | Please also see https://trac.ffmpeg.org/wiki/CompilationGuide for a 105 | more detailed explanation of the steps required to compile FFmpeg. 106 | 107 | First, you need to obtain the latest revision of the *FFmpeg 7.0.x* 108 | source code from its Git repository: 109 | 110 | `git clone -b release/7.0 https://git.ffmpeg.org/ffmpeg.git ffmpeg` 111 | 112 | Alternatively, download the latest 7.0.x release as a zip archive 113 | from https://github.com/FFmpeg/FFmpeg/tags and unpack the zip. Note 114 | that you may need to rename the upper-level directory to `ffmpeg`. 115 | Then, you need to copy the files inside the `libavfilter` directory 116 | of this source distribution into FFmpeg's `libavfilter` directory: 117 | 118 | `cp xpsnr/libavfilter/* ffmpeg/libavfilter/` 119 | 120 | Note that the `allfilters.c` and `Makefile` files already exist in 121 | the FFmpeg source distribution and will be replaced (XPSNR related 122 | lines have been added in each of these source files). The `xpsnr.h` 123 | and `vf_xpsnr.c` files will be added to the FFmpeg distribution. 124 | 125 | Now, you can configure and compile FFmpeg to generate the `ffmpeg` 126 | executable with integrated XPSNR support: 127 | 128 | `cd ffmpeg` 129 | 130 | `./configure --extra-cflags=-mavx2` 131 | 132 | `make` 133 | 134 | If the `--extra-cflags=...` option does not work, you may omit it. 135 | 136 | 137 | Usage 138 | ----- 139 | 140 | This section describes how to calculate XPSNR output values between 141 | two video streams using a compiled FFmpeg executable which includes 142 | this plug-in (see the "Compilation" section above). Since the XPSNR 143 | filter works similarly to FFmpeg's existing PSNR filter, it is also 144 | worth taking a look at https://trac.ffmpeg.org/wiki/FilteringGuide, 145 | or http://ffmpeg.org/ffmpeg-filters.html#psnr specifically. 146 | 147 | ### Simple command-line examples: 148 | 149 | The following examples assume an assessment of two 50-Hz input YUVs 150 | (uncompressed video files), inRef.yuv and inTest.yuv, under a Linux 151 | OS. For usage under Windows, replace the `./ffmpeg` by `ffmpeg.exe`. 152 | 153 | Two output files are created when using these command-lines, a .log 154 | file with frame-wise XPSNR statistics and a .yuv file (identical to 155 | the inRef.yuv file), which demonstrates that the XPSNR plug-in does 156 | not change the video input. Use of both output files can be omitted 157 | by employing `stats_file=-` instead of `stats_file=(x)psnr.log` and 158 | `-f null -` instead of `-y out.yuv`, respectively. 159 | 160 | 161 | *8-bit HD reference and test YUVs, first 100 frames:* 162 | 163 | ` 164 | ./ffmpeg -s 1920x1080 -framerate 50 -i inRef.yuv 165 | -s 1920x1080 -framerate 50 -i inTest.yuv 166 | -lavfi xpsnr="stats_file=xpsnr.log" -vframes 100 -y out.yuv 167 | ` 168 | 169 | *10-bit UHD reference and test YUVs, first 100 frames:* 170 | 171 | ` 172 | ./ffmpeg -s 3840x2160 -framerate 50 -pix_fmt yuv420p10le -i inRef.yuv 173 | -s 3840x2160 -framerate 50 -pix_fmt yuv420p10le -i inTest.yuv 174 | -lavfi xpsnr="stats_file=xpsnr.log" -vframes 100 -y out.yuv 175 | ` 176 | 177 | *8-bit HD reference, 10-bit HD test YUV, all frames:* 178 | 179 | ` 180 | ./ffmpeg -s 1920x1080 -framerate 50 -pix_fmt yuv420p -i inRef.yuv 181 | -s 1920x1080 -framerate 50 -pix_fmt yuv420p10le -i inTest.yuv 182 | -lavfi xpsnr="stats_file=xpsnr.log" -y out.yuv 183 | ` 184 | 185 | *8-bit HD reference, 10-bit HD test YUV, PSNR for comparison:* 186 | 187 | ` 188 | ./ffmpeg -s 1920x1080 -framerate 50 -pix_fmt yuv420p -i inRef.yuv 189 | -s 1920x1080 -framerate 50 -pix_fmt yuv420p10le -i inTest.yuv 190 | -lavfi psnr="stats_file=psnr.log" -y out.yuv 191 | ` 192 | 193 | 194 | Development 195 | ----------- 196 | 197 | This section addresses two aspects related to future development of 198 | the XPSNR plug-in for FFmpeg (but not the XPSNR algorithm itself). 199 | 200 | ### Code contribution: 201 | 202 | If you are interested in contributing to this implementation of the 203 | XPSNR algorithm, please contact Fraunhofer HHI or the contributors. 204 | Pull requests with bugfixes and/or speedups are highly appreciated. 205 | 206 | ### Feature roadmap: 207 | 208 | The following functionality is planned to be integrated in a future 209 | revision of this XPSNR implementation. Support is kindly requested. 210 | 211 | * support for multithreading during visual filtering for more speed 212 | * direct XPSNR integration into FFmpeg codebase if widely requested 213 | 214 | 215 | Contact Information 216 | ------------------- 217 | 218 | Christian Helmrich and Christian Stoffers, 219 | Fraunhofer Heinrich Hertz Institute (HHI), 220 | Video Communication and Applications Dept, 221 | Einsteinufer 37, 10587 Berlin, Germany. 222 | 223 | For detailed contact information please see "People and Contact" at 224 | https://www.hhi.fraunhofer.de/en/departments/vca.html 225 | -------------------------------------------------------------------------------- /libavfilter/xpsnr.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: xpsnr.h - public declarations for XPSNR measurement filter plug-in for FFmpeg 3 | Authors: Christian Helmrich and Christian Stoffers, Fraunhofer HHI, Berlin, Germany 4 | 5 | License: 6 | 7 | The copyright in this software is being made available under this Software Copyright 8 | License. This software may be subject to other third-party and contributor rights, 9 | including patent rights, and no such rights are granted under this license. 10 | 11 | Copyright (c) 2019 - 2024 Fraunhofer-Gesellschaft zur Förderung der angewandten 12 | Forschung e.V. (Fraunhofer). All rights reserved. 13 | 14 | Redistribution and use of this software in source and binary forms, with or without 15 | modification, are permitted for non-commercial and commercial purposes provided that 16 | the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright notice, this list 19 | of conditions, and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright notice, this 21 | list of conditions, and the following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | * Neither the names of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without specific 25 | prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 29 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT 30 | SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 31 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 32 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 33 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 36 | DAMAGE. 37 | 38 | NO PATENTS GRANTED 39 | 40 | NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, INCLUDING WITHOUT LIMITATION 41 | THE PATENTS OF THE COPYRIGHT HOLDER AND CONTRIBUTORS, ARE GRANTED BY THIS SOFTWARE 42 | LICENSE. THE COPYRIGHT HOLDER AND CONTRIBUTORS PROVIDE NO WARRANTY OF PATENT NON- 43 | INFRINGEMENT WITH RESPECT TO THIS SOFTWARE. 44 | */ 45 | 46 | #ifndef AVFILTER_XPSNR_H 47 | #define AVFILTER_XPSNR_H 48 | 49 | #include 50 | #include 51 | #include "libavutil/x86/cpu.h" 52 | 53 | /* public XPSNR DSP structure definition */ 54 | 55 | typedef struct XPSNRDSPContext 56 | { 57 | uint64_t (*sse_line) (const uint8_t *buf, const uint8_t *ref, int w); 58 | uint64_t (*highds_func) (const int xAct, const int yAct, const int wAct, const int hAct, const int16_t *o, const int O); 59 | uint64_t (*diff1st_func) (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, const int O); 60 | uint64_t (*diff2nd_func) (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, int16_t *oM2, const int O); 61 | } 62 | PSNRDSPContext; 63 | 64 | void ff_psnr_init_x86 (PSNRDSPContext *dsp, int bpp); 65 | 66 | /* SIMD functions included here */ 67 | #include 68 | 69 | #define _mm_storeu_si16(p, a) (void)(*(short*)(p) = (short)_mm_cvtsi128_si32((a))) 70 | 71 | #define MULADD(p1, p2, scale, tmp1, tmp2, sum) \ 72 | tmp1 = _mm_madd_epi16 (p1, scale); \ 73 | tmp2 = _mm_madd_epi16 (p2, scale); \ 74 | tmp1 = _mm_hadd_epi32 (tmp1, tmp2); \ 75 | tmp1 = _mm_hadd_epi32 (tmp1, tmp1); \ 76 | tmp1 = _mm_hadd_epi32 (tmp1, tmp1); \ 77 | sum += _mm_extract_epi32 (tmp1, 0); 78 | 79 | /* XPSNR function definitions */ 80 | static uint64_t highds (const int xAct, const int yAct, const int wAct, const int hAct, const int16_t *o, const int O); 81 | static uint64_t diff1st (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, const int O); 82 | static uint64_t diff2nd (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, int16_t *oM2, const int O); 83 | 84 | #ifdef __AVX2__ 85 | static uint64_t highds_SIMD (const int xAct, const int yAct, const int wAct, const int hAct, const int16_t *o, const int O); 86 | static uint64_t diff1st_SIMD (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, const int O); 87 | static uint64_t diff2nd_SIMD (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, int16_t *oM2, const int O); 88 | 89 | static uint64_t highds_SIMD (const int xAct, const int yAct, const int wAct, const int hAct, const int16_t *o, const int O) 90 | { 91 | uint64_t saAct = 0; 92 | 93 | if (wAct > 12) 94 | { 95 | const __m128i scale1 = _mm_set_epi16 (0, 0,-1,-2,-3,-3,-2,-1); 96 | const __m128i scale2 = _mm_set_epi16 (0, 0,-1,-3,12,12,-3,-1); 97 | const __m128i scale3 = _mm_set_epi16 (0, 0, 0,-1,-1,-1,-1, 0); 98 | __m128i tmp1, tmp2; 99 | __m128i l0, lP1, lM1, lP2, lM2, lP3; 100 | int sum; 101 | 102 | for (int y = yAct; y < hAct; y += 2) 103 | { 104 | for (int x = xAct; x < wAct; x += 12) 105 | { 106 | __m256i lineM2 = _mm256_lddqu_si256 ((__m256i*) &o[(y-2)*O + x-2]); 107 | __m256i lineM1 = _mm256_lddqu_si256 ((__m256i*) &o[(y-1)*O + x-2]); 108 | __m256i line0 = _mm256_lddqu_si256 ((__m256i*) &o[ y *O + x-2]); 109 | __m256i lineP1 = _mm256_lddqu_si256 ((__m256i*) &o[(y+1)*O + x-2]); 110 | __m256i lineP2 = _mm256_lddqu_si256 ((__m256i*) &o[(y+2)*O + x-2]); 111 | __m256i lineP3 = _mm256_lddqu_si256 ((__m256i*) &o[(y+3)*O + x-2]); 112 | 113 | for (int xx = 0; xx < 3; xx++) 114 | { 115 | if ((xx << 2) + x < wAct) 116 | { 117 | sum = 0; 118 | l0 = _mm256_castsi256_si128 (line0 ); 119 | lP1 = _mm256_castsi256_si128 (lineP1); 120 | MULADD (l0 , lP1, scale2, tmp1, tmp2, sum) 121 | lM1 = _mm256_castsi256_si128 (lineM1); 122 | lP2 = _mm256_castsi256_si128 (lineP2); 123 | MULADD (lM1, lP2, scale1, tmp1, tmp2, sum) 124 | lM2 = _mm256_castsi256_si128 (lineM2); 125 | lP3 = _mm256_castsi256_si128 (lineP3); 126 | MULADD (lM2, lP3, scale3, tmp1, tmp2, sum) 127 | saAct += (uint64_t) abs (sum); 128 | } 129 | if ((xx << 2) + x + 2 < wAct) 130 | { 131 | sum = 0; 132 | l0 = _mm_bsrli_si128 (l0 , 4); 133 | lP1 = _mm_bsrli_si128 (lP1, 4); 134 | MULADD (l0 , lP1, scale2, tmp1, tmp2, sum) 135 | lM1 = _mm_bsrli_si128 (lM1, 4); 136 | lP2 = _mm_bsrli_si128 (lP2, 4); 137 | MULADD (lM1, lP2, scale1, tmp1, tmp2, sum) 138 | lM2 = _mm_bsrli_si128 (lM2, 4); 139 | lP3 = _mm_bsrli_si128 (lP3, 4); 140 | MULADD (lM2, lP3, scale3, tmp1, tmp2, sum) 141 | saAct += (uint64_t) abs (sum); 142 | 143 | /* 4 byte to the right */ 144 | lineM2 = _mm256_permute4x64_epi64 (lineM2, 0x39); 145 | lineM1 = _mm256_permute4x64_epi64 (lineM1, 0x39); 146 | line0 = _mm256_permute4x64_epi64 (line0 , 0x39); 147 | lineP1 = _mm256_permute4x64_epi64 (lineP1, 0x39); 148 | lineP2 = _mm256_permute4x64_epi64 (lineP2, 0x39); 149 | lineP3 = _mm256_permute4x64_epi64 (lineP3, 0x39); 150 | } 151 | } 152 | } 153 | } 154 | } 155 | else 156 | { 157 | saAct = highds (xAct, yAct, wAct, hAct, o, O); 158 | } 159 | return saAct; 160 | } 161 | 162 | static uint64_t diff1st_SIMD (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, const int O) 163 | { 164 | uint64_t taAct = 0; 165 | uint16_t act = 0; 166 | 167 | for (uint32_t y = 0; y < hAct; y += 2) 168 | { 169 | for (uint32_t x = 0; x < wAct; x += 8) 170 | { 171 | __m128i lineM0u = _mm_lddqu_si128 ((__m128i*) &o [ y *O + x]); /* load 8 16-bit values */ 172 | __m128i lineM0d = _mm_lddqu_si128 ((__m128i*) &o [(y+1)*O + x]); 173 | __m128i lineM1u = _mm_lddqu_si128 ((__m128i*) &oM1[ y *O + x]); 174 | __m128i lineM1d = _mm_lddqu_si128 ((__m128i*) &oM1[(y+1)*O + x]); 175 | 176 | __m128i M0 = _mm_add_epi16 (lineM0u, lineM0d); 177 | __m128i M1 = _mm_add_epi16 (lineM1u, lineM1d); 178 | 179 | M1 = _mm_sub_epi16 (M0, M1); /* abs (sum (o[u0, u1, d0, d1]) - sum (oM1[u0, u1, d0, d1])) */ 180 | M1 = _mm_hadd_epi16 (M1, M1); 181 | M1 = _mm_abs_epi16 (M1); 182 | M1 = _mm_hadds_epi16 (M1, M1); 183 | M1 = _mm_hadds_epi16 (M1, M1); 184 | 185 | _mm_storeu_si16 (&act, M1); 186 | taAct += (uint64_t) act; 187 | 188 | _mm_storeu_si128 ((__m128i*) &oM1[ y *O + x], lineM0u); 189 | _mm_storeu_si128 ((__m128i*) &oM1[(y+1)*O + x], lineM0d); 190 | } 191 | } 192 | return (taAct << 1); /* * XPSNR_GAMMA */ 193 | } 194 | 195 | static uint64_t diff2nd_SIMD (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, int16_t *oM2, const int O) 196 | { 197 | uint64_t taAct = 0; 198 | uint16_t act = 0; 199 | 200 | for (uint32_t y = 0; y < hAct; y += 2) 201 | { 202 | for (uint32_t x = 0; x < wAct; x += 8) 203 | { 204 | __m128i lineM0u = _mm_lddqu_si128 ((__m128i*) &o [ y *O + x]); /* load 8 16-bit values */ 205 | __m128i lineM0d = _mm_lddqu_si128 ((__m128i*) &o [(y+1)*O + x]); 206 | __m128i lineM1u = _mm_lddqu_si128 ((__m128i*) &oM1[ y *O + x]); 207 | __m128i lineM1d = _mm_lddqu_si128 ((__m128i*) &oM1[(y+1)*O + x]); 208 | __m128i lineM2u = _mm_lddqu_si128 ((__m128i*) &oM2[ y *O + x]); 209 | __m128i lineM2d = _mm_lddqu_si128 ((__m128i*) &oM2[(y+1)*O + x]); 210 | 211 | __m128i M0 = _mm_add_epi16 (lineM0u, lineM0d); 212 | __m128i M1 = _mm_add_epi16 (lineM1u, lineM1d); 213 | __m128i M2 = _mm_add_epi16 (lineM2u, lineM2d); 214 | 215 | M0 = _mm_add_epi16 (M0, M2); 216 | M0 = _mm_hadd_epi16 (M0, M1); 217 | M1 = _mm_shuffle_epi32 (M0, 0xee); 218 | M1 = _mm_slli_epi16 (M1, 0x1); 219 | M1 = _mm_sub_epi16 (M0, M1); 220 | M1 = _mm_abs_epi16 (M1); 221 | M1 = _mm_hadds_epi16 (M1, M1); 222 | M1 = _mm_hadds_epi16 (M1, M1); 223 | 224 | _mm_storeu_si16 (&act, M1); 225 | taAct += (uint64_t) act; 226 | 227 | _mm_storeu_si128 ((__m128i*) &oM2[ y *O + x], lineM1u); 228 | _mm_storeu_si128 ((__m128i*) &oM2[(y+1)*O + x], lineM1d); 229 | _mm_storeu_si128 ((__m128i*) &oM1[ y *O + x], lineM0u); 230 | _mm_storeu_si128 ((__m128i*) &oM1[(y+1)*O + x], lineM0d); 231 | } 232 | } 233 | return (taAct << 1); /* * XPSNR_GAMMA */ 234 | } 235 | #endif /* __AVX2__ */ 236 | 237 | #endif /* AVFILTER_XPSNR_H */ 238 | -------------------------------------------------------------------------------- /libavfilter/allfilters.c: -------------------------------------------------------------------------------- 1 | /* 2 | * filter registration 3 | * Copyright (c) 2008 Vitor Sessak 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include "avfilter.h" 23 | 24 | extern const AVFilter ff_af_aap; 25 | extern const AVFilter ff_af_abench; 26 | extern const AVFilter ff_af_acompressor; 27 | extern const AVFilter ff_af_acontrast; 28 | extern const AVFilter ff_af_acopy; 29 | extern const AVFilter ff_af_acue; 30 | extern const AVFilter ff_af_acrossfade; 31 | extern const AVFilter ff_af_acrossover; 32 | extern const AVFilter ff_af_acrusher; 33 | extern const AVFilter ff_af_adeclick; 34 | extern const AVFilter ff_af_adeclip; 35 | extern const AVFilter ff_af_adecorrelate; 36 | extern const AVFilter ff_af_adelay; 37 | extern const AVFilter ff_af_adenorm; 38 | extern const AVFilter ff_af_aderivative; 39 | extern const AVFilter ff_af_adrc; 40 | extern const AVFilter ff_af_adynamicequalizer; 41 | extern const AVFilter ff_af_adynamicsmooth; 42 | extern const AVFilter ff_af_aecho; 43 | extern const AVFilter ff_af_aemphasis; 44 | extern const AVFilter ff_af_aeval; 45 | extern const AVFilter ff_af_aexciter; 46 | extern const AVFilter ff_af_afade; 47 | extern const AVFilter ff_af_afftdn; 48 | extern const AVFilter ff_af_afftfilt; 49 | extern const AVFilter ff_af_afir; 50 | extern const AVFilter ff_af_aformat; 51 | extern const AVFilter ff_af_afreqshift; 52 | extern const AVFilter ff_af_afwtdn; 53 | extern const AVFilter ff_af_agate; 54 | extern const AVFilter ff_af_aiir; 55 | extern const AVFilter ff_af_aintegral; 56 | extern const AVFilter ff_af_ainterleave; 57 | extern const AVFilter ff_af_alatency; 58 | extern const AVFilter ff_af_alimiter; 59 | extern const AVFilter ff_af_allpass; 60 | extern const AVFilter ff_af_aloop; 61 | extern const AVFilter ff_af_amerge; 62 | extern const AVFilter ff_af_ametadata; 63 | extern const AVFilter ff_af_amix; 64 | extern const AVFilter ff_af_amultiply; 65 | extern const AVFilter ff_af_anequalizer; 66 | extern const AVFilter ff_af_anlmdn; 67 | extern const AVFilter ff_af_anlmf; 68 | extern const AVFilter ff_af_anlms; 69 | extern const AVFilter ff_af_anull; 70 | extern const AVFilter ff_af_apad; 71 | extern const AVFilter ff_af_aperms; 72 | extern const AVFilter ff_af_aphaser; 73 | extern const AVFilter ff_af_aphaseshift; 74 | extern const AVFilter ff_af_apsnr; 75 | extern const AVFilter ff_af_apsyclip; 76 | extern const AVFilter ff_af_apulsator; 77 | extern const AVFilter ff_af_arealtime; 78 | extern const AVFilter ff_af_aresample; 79 | extern const AVFilter ff_af_areverse; 80 | extern const AVFilter ff_af_arls; 81 | extern const AVFilter ff_af_arnndn; 82 | extern const AVFilter ff_af_asdr; 83 | extern const AVFilter ff_af_asegment; 84 | extern const AVFilter ff_af_aselect; 85 | extern const AVFilter ff_af_asendcmd; 86 | extern const AVFilter ff_af_asetnsamples; 87 | extern const AVFilter ff_af_asetpts; 88 | extern const AVFilter ff_af_asetrate; 89 | extern const AVFilter ff_af_asettb; 90 | extern const AVFilter ff_af_ashowinfo; 91 | extern const AVFilter ff_af_asidedata; 92 | extern const AVFilter ff_af_asisdr; 93 | extern const AVFilter ff_af_asoftclip; 94 | extern const AVFilter ff_af_aspectralstats; 95 | extern const AVFilter ff_af_asplit; 96 | extern const AVFilter ff_af_asr; 97 | extern const AVFilter ff_af_astats; 98 | extern const AVFilter ff_af_astreamselect; 99 | extern const AVFilter ff_af_asubboost; 100 | extern const AVFilter ff_af_asubcut; 101 | extern const AVFilter ff_af_asupercut; 102 | extern const AVFilter ff_af_asuperpass; 103 | extern const AVFilter ff_af_asuperstop; 104 | extern const AVFilter ff_af_atempo; 105 | extern const AVFilter ff_af_atilt; 106 | extern const AVFilter ff_af_atrim; 107 | extern const AVFilter ff_af_axcorrelate; 108 | extern const AVFilter ff_af_azmq; 109 | extern const AVFilter ff_af_bandpass; 110 | extern const AVFilter ff_af_bandreject; 111 | extern const AVFilter ff_af_bass; 112 | extern const AVFilter ff_af_biquad; 113 | extern const AVFilter ff_af_bs2b; 114 | extern const AVFilter ff_af_channelmap; 115 | extern const AVFilter ff_af_channelsplit; 116 | extern const AVFilter ff_af_chorus; 117 | extern const AVFilter ff_af_compand; 118 | extern const AVFilter ff_af_compensationdelay; 119 | extern const AVFilter ff_af_crossfeed; 120 | extern const AVFilter ff_af_crystalizer; 121 | extern const AVFilter ff_af_dcshift; 122 | extern const AVFilter ff_af_deesser; 123 | extern const AVFilter ff_af_dialoguenhance; 124 | extern const AVFilter ff_af_drmeter; 125 | extern const AVFilter ff_af_dynaudnorm; 126 | extern const AVFilter ff_af_earwax; 127 | extern const AVFilter ff_af_ebur128; 128 | extern const AVFilter ff_af_equalizer; 129 | extern const AVFilter ff_af_extrastereo; 130 | extern const AVFilter ff_af_firequalizer; 131 | extern const AVFilter ff_af_flanger; 132 | extern const AVFilter ff_af_haas; 133 | extern const AVFilter ff_af_hdcd; 134 | extern const AVFilter ff_af_headphone; 135 | extern const AVFilter ff_af_highpass; 136 | extern const AVFilter ff_af_highshelf; 137 | extern const AVFilter ff_af_join; 138 | extern const AVFilter ff_af_ladspa; 139 | extern const AVFilter ff_af_loudnorm; 140 | extern const AVFilter ff_af_lowpass; 141 | extern const AVFilter ff_af_lowshelf; 142 | extern const AVFilter ff_af_lv2; 143 | extern const AVFilter ff_af_mcompand; 144 | extern const AVFilter ff_af_pan; 145 | extern const AVFilter ff_af_replaygain; 146 | extern const AVFilter ff_af_rubberband; 147 | extern const AVFilter ff_af_sidechaincompress; 148 | extern const AVFilter ff_af_sidechaingate; 149 | extern const AVFilter ff_af_silencedetect; 150 | extern const AVFilter ff_af_silenceremove; 151 | extern const AVFilter ff_af_sofalizer; 152 | extern const AVFilter ff_af_speechnorm; 153 | extern const AVFilter ff_af_stereotools; 154 | extern const AVFilter ff_af_stereowiden; 155 | extern const AVFilter ff_af_superequalizer; 156 | extern const AVFilter ff_af_surround; 157 | extern const AVFilter ff_af_tiltshelf; 158 | extern const AVFilter ff_af_treble; 159 | extern const AVFilter ff_af_tremolo; 160 | extern const AVFilter ff_af_vibrato; 161 | extern const AVFilter ff_af_virtualbass; 162 | extern const AVFilter ff_af_volume; 163 | extern const AVFilter ff_af_volumedetect; 164 | 165 | extern const AVFilter ff_asrc_aevalsrc; 166 | extern const AVFilter ff_asrc_afdelaysrc; 167 | extern const AVFilter ff_asrc_afireqsrc; 168 | extern const AVFilter ff_asrc_afirsrc; 169 | extern const AVFilter ff_asrc_anoisesrc; 170 | extern const AVFilter ff_asrc_anullsrc; 171 | extern const AVFilter ff_asrc_flite; 172 | extern const AVFilter ff_asrc_hilbert; 173 | extern const AVFilter ff_asrc_sinc; 174 | extern const AVFilter ff_asrc_sine; 175 | 176 | extern const AVFilter ff_asink_anullsink; 177 | 178 | extern const AVFilter ff_vf_addroi; 179 | extern const AVFilter ff_vf_alphaextract; 180 | extern const AVFilter ff_vf_alphamerge; 181 | extern const AVFilter ff_vf_amplify; 182 | extern const AVFilter ff_vf_ass; 183 | extern const AVFilter ff_vf_atadenoise; 184 | extern const AVFilter ff_vf_avgblur; 185 | extern const AVFilter ff_vf_avgblur_opencl; 186 | extern const AVFilter ff_vf_avgblur_vulkan; 187 | extern const AVFilter ff_vf_backgroundkey; 188 | extern const AVFilter ff_vf_bbox; 189 | extern const AVFilter ff_vf_bench; 190 | extern const AVFilter ff_vf_bilateral; 191 | extern const AVFilter ff_vf_bilateral_cuda; 192 | extern const AVFilter ff_vf_bitplanenoise; 193 | extern const AVFilter ff_vf_blackdetect; 194 | extern const AVFilter ff_vf_blackframe; 195 | extern const AVFilter ff_vf_blend; 196 | extern const AVFilter ff_vf_blend_vulkan; 197 | extern const AVFilter ff_vf_blockdetect; 198 | extern const AVFilter ff_vf_blurdetect; 199 | extern const AVFilter ff_vf_bm3d; 200 | extern const AVFilter ff_vf_boxblur; 201 | extern const AVFilter ff_vf_boxblur_opencl; 202 | extern const AVFilter ff_vf_bwdif; 203 | extern const AVFilter ff_vf_bwdif_cuda; 204 | extern const AVFilter ff_vf_bwdif_vulkan; 205 | extern const AVFilter ff_vf_cas; 206 | extern const AVFilter ff_vf_ccrepack; 207 | extern const AVFilter ff_vf_chromaber_vulkan; 208 | extern const AVFilter ff_vf_chromahold; 209 | extern const AVFilter ff_vf_chromakey; 210 | extern const AVFilter ff_vf_chromakey_cuda; 211 | extern const AVFilter ff_vf_chromanr; 212 | extern const AVFilter ff_vf_chromashift; 213 | extern const AVFilter ff_vf_ciescope; 214 | extern const AVFilter ff_vf_codecview; 215 | extern const AVFilter ff_vf_colorbalance; 216 | extern const AVFilter ff_vf_colorchannelmixer; 217 | extern const AVFilter ff_vf_colorcontrast; 218 | extern const AVFilter ff_vf_colorcorrect; 219 | extern const AVFilter ff_vf_colorize; 220 | extern const AVFilter ff_vf_colorkey; 221 | extern const AVFilter ff_vf_colorkey_opencl; 222 | extern const AVFilter ff_vf_colorhold; 223 | extern const AVFilter ff_vf_colorlevels; 224 | extern const AVFilter ff_vf_colormap; 225 | extern const AVFilter ff_vf_colormatrix; 226 | extern const AVFilter ff_vf_colorspace; 227 | extern const AVFilter ff_vf_colorspace_cuda; 228 | extern const AVFilter ff_vf_colortemperature; 229 | extern const AVFilter ff_vf_convolution; 230 | extern const AVFilter ff_vf_convolution_opencl; 231 | extern const AVFilter ff_vf_convolve; 232 | extern const AVFilter ff_vf_copy; 233 | extern const AVFilter ff_vf_coreimage; 234 | extern const AVFilter ff_vf_corr; 235 | extern const AVFilter ff_vf_cover_rect; 236 | extern const AVFilter ff_vf_crop; 237 | extern const AVFilter ff_vf_cropdetect; 238 | extern const AVFilter ff_vf_cue; 239 | extern const AVFilter ff_vf_curves; 240 | extern const AVFilter ff_vf_datascope; 241 | extern const AVFilter ff_vf_dblur; 242 | extern const AVFilter ff_vf_dctdnoiz; 243 | extern const AVFilter ff_vf_deband; 244 | extern const AVFilter ff_vf_deblock; 245 | extern const AVFilter ff_vf_decimate; 246 | extern const AVFilter ff_vf_deconvolve; 247 | extern const AVFilter ff_vf_dedot; 248 | extern const AVFilter ff_vf_deflate; 249 | extern const AVFilter ff_vf_deflicker; 250 | extern const AVFilter ff_vf_deinterlace_qsv; 251 | extern const AVFilter ff_vf_deinterlace_vaapi; 252 | extern const AVFilter ff_vf_dejudder; 253 | extern const AVFilter ff_vf_delogo; 254 | extern const AVFilter ff_vf_denoise_vaapi; 255 | extern const AVFilter ff_vf_derain; 256 | extern const AVFilter ff_vf_deshake; 257 | extern const AVFilter ff_vf_deshake_opencl; 258 | extern const AVFilter ff_vf_despill; 259 | extern const AVFilter ff_vf_detelecine; 260 | extern const AVFilter ff_vf_dilation; 261 | extern const AVFilter ff_vf_dilation_opencl; 262 | extern const AVFilter ff_vf_displace; 263 | extern const AVFilter ff_vf_dnn_classify; 264 | extern const AVFilter ff_vf_dnn_detect; 265 | extern const AVFilter ff_vf_dnn_processing; 266 | extern const AVFilter ff_vf_doubleweave; 267 | extern const AVFilter ff_vf_drawbox; 268 | extern const AVFilter ff_vf_drawgraph; 269 | extern const AVFilter ff_vf_drawgrid; 270 | extern const AVFilter ff_vf_drawtext; 271 | extern const AVFilter ff_vf_edgedetect; 272 | extern const AVFilter ff_vf_elbg; 273 | extern const AVFilter ff_vf_entropy; 274 | extern const AVFilter ff_vf_epx; 275 | extern const AVFilter ff_vf_eq; 276 | extern const AVFilter ff_vf_erosion; 277 | extern const AVFilter ff_vf_erosion_opencl; 278 | extern const AVFilter ff_vf_estdif; 279 | extern const AVFilter ff_vf_exposure; 280 | extern const AVFilter ff_vf_extractplanes; 281 | extern const AVFilter ff_vf_fade; 282 | extern const AVFilter ff_vf_feedback; 283 | extern const AVFilter ff_vf_fftdnoiz; 284 | extern const AVFilter ff_vf_fftfilt; 285 | extern const AVFilter ff_vf_field; 286 | extern const AVFilter ff_vf_fieldhint; 287 | extern const AVFilter ff_vf_fieldmatch; 288 | extern const AVFilter ff_vf_fieldorder; 289 | extern const AVFilter ff_vf_fillborders; 290 | extern const AVFilter ff_vf_find_rect; 291 | extern const AVFilter ff_vf_flip_vulkan; 292 | extern const AVFilter ff_vf_floodfill; 293 | extern const AVFilter ff_vf_format; 294 | extern const AVFilter ff_vf_fps; 295 | extern const AVFilter ff_vf_framepack; 296 | extern const AVFilter ff_vf_framerate; 297 | extern const AVFilter ff_vf_framestep; 298 | extern const AVFilter ff_vf_freezedetect; 299 | extern const AVFilter ff_vf_freezeframes; 300 | extern const AVFilter ff_vf_frei0r; 301 | extern const AVFilter ff_vf_fspp; 302 | extern const AVFilter ff_vf_fsync; 303 | extern const AVFilter ff_vf_gblur; 304 | extern const AVFilter ff_vf_gblur_vulkan; 305 | extern const AVFilter ff_vf_geq; 306 | extern const AVFilter ff_vf_gradfun; 307 | extern const AVFilter ff_vf_graphmonitor; 308 | extern const AVFilter ff_vf_grayworld; 309 | extern const AVFilter ff_vf_greyedge; 310 | extern const AVFilter ff_vf_guided; 311 | extern const AVFilter ff_vf_haldclut; 312 | extern const AVFilter ff_vf_hflip; 313 | extern const AVFilter ff_vf_hflip_vulkan; 314 | extern const AVFilter ff_vf_histeq; 315 | extern const AVFilter ff_vf_histogram; 316 | extern const AVFilter ff_vf_hqdn3d; 317 | extern const AVFilter ff_vf_hqx; 318 | extern const AVFilter ff_vf_hstack; 319 | extern const AVFilter ff_vf_hsvhold; 320 | extern const AVFilter ff_vf_hsvkey; 321 | extern const AVFilter ff_vf_hue; 322 | extern const AVFilter ff_vf_huesaturation; 323 | extern const AVFilter ff_vf_hwdownload; 324 | extern const AVFilter ff_vf_hwmap; 325 | extern const AVFilter ff_vf_hwupload; 326 | extern const AVFilter ff_vf_hwupload_cuda; 327 | extern const AVFilter ff_vf_hysteresis; 328 | extern const AVFilter ff_vf_iccdetect; 329 | extern const AVFilter ff_vf_iccgen; 330 | extern const AVFilter ff_vf_identity; 331 | extern const AVFilter ff_vf_idet; 332 | extern const AVFilter ff_vf_il; 333 | extern const AVFilter ff_vf_inflate; 334 | extern const AVFilter ff_vf_interlace; 335 | extern const AVFilter ff_vf_interleave; 336 | extern const AVFilter ff_vf_kerndeint; 337 | extern const AVFilter ff_vf_kirsch; 338 | extern const AVFilter ff_vf_lagfun; 339 | extern const AVFilter ff_vf_latency; 340 | extern const AVFilter ff_vf_lenscorrection; 341 | extern const AVFilter ff_vf_lensfun; 342 | extern const AVFilter ff_vf_libplacebo; 343 | extern const AVFilter ff_vf_libvmaf; 344 | extern const AVFilter ff_vf_libvmaf_cuda; 345 | extern const AVFilter ff_vf_limitdiff; 346 | extern const AVFilter ff_vf_limiter; 347 | extern const AVFilter ff_vf_loop; 348 | extern const AVFilter ff_vf_lumakey; 349 | extern const AVFilter ff_vf_lut; 350 | extern const AVFilter ff_vf_lut1d; 351 | extern const AVFilter ff_vf_lut2; 352 | extern const AVFilter ff_vf_lut3d; 353 | extern const AVFilter ff_vf_lutrgb; 354 | extern const AVFilter ff_vf_lutyuv; 355 | extern const AVFilter ff_vf_maskedclamp; 356 | extern const AVFilter ff_vf_maskedmax; 357 | extern const AVFilter ff_vf_maskedmerge; 358 | extern const AVFilter ff_vf_maskedmin; 359 | extern const AVFilter ff_vf_maskedthreshold; 360 | extern const AVFilter ff_vf_maskfun; 361 | extern const AVFilter ff_vf_mcdeint; 362 | extern const AVFilter ff_vf_median; 363 | extern const AVFilter ff_vf_mergeplanes; 364 | extern const AVFilter ff_vf_mestimate; 365 | extern const AVFilter ff_vf_metadata; 366 | extern const AVFilter ff_vf_midequalizer; 367 | extern const AVFilter ff_vf_minterpolate; 368 | extern const AVFilter ff_vf_mix; 369 | extern const AVFilter ff_vf_monochrome; 370 | extern const AVFilter ff_vf_morpho; 371 | extern const AVFilter ff_vf_mpdecimate; 372 | extern const AVFilter ff_vf_msad; 373 | extern const AVFilter ff_vf_multiply; 374 | extern const AVFilter ff_vf_negate; 375 | extern const AVFilter ff_vf_nlmeans; 376 | extern const AVFilter ff_vf_nlmeans_opencl; 377 | extern const AVFilter ff_vf_nlmeans_vulkan; 378 | extern const AVFilter ff_vf_nnedi; 379 | extern const AVFilter ff_vf_noformat; 380 | extern const AVFilter ff_vf_noise; 381 | extern const AVFilter ff_vf_normalize; 382 | extern const AVFilter ff_vf_null; 383 | extern const AVFilter ff_vf_ocr; 384 | extern const AVFilter ff_vf_ocv; 385 | extern const AVFilter ff_vf_oscilloscope; 386 | extern const AVFilter ff_vf_overlay; 387 | extern const AVFilter ff_vf_overlay_opencl; 388 | extern const AVFilter ff_vf_overlay_qsv; 389 | extern const AVFilter ff_vf_overlay_vaapi; 390 | extern const AVFilter ff_vf_overlay_vulkan; 391 | extern const AVFilter ff_vf_overlay_cuda; 392 | extern const AVFilter ff_vf_owdenoise; 393 | extern const AVFilter ff_vf_pad; 394 | extern const AVFilter ff_vf_pad_opencl; 395 | extern const AVFilter ff_vf_palettegen; 396 | extern const AVFilter ff_vf_paletteuse; 397 | extern const AVFilter ff_vf_perms; 398 | extern const AVFilter ff_vf_perspective; 399 | extern const AVFilter ff_vf_phase; 400 | extern const AVFilter ff_vf_photosensitivity; 401 | extern const AVFilter ff_vf_pixdesctest; 402 | extern const AVFilter ff_vf_pixelize; 403 | extern const AVFilter ff_vf_pixscope; 404 | extern const AVFilter ff_vf_pp; 405 | extern const AVFilter ff_vf_pp7; 406 | extern const AVFilter ff_vf_premultiply; 407 | extern const AVFilter ff_vf_prewitt; 408 | extern const AVFilter ff_vf_prewitt_opencl; 409 | extern const AVFilter ff_vf_procamp_vaapi; 410 | extern const AVFilter ff_vf_program_opencl; 411 | extern const AVFilter ff_vf_pseudocolor; 412 | extern const AVFilter ff_vf_psnr; 413 | extern const AVFilter ff_vf_pullup; 414 | extern const AVFilter ff_vf_qp; 415 | extern const AVFilter ff_vf_qrencode; 416 | extern const AVFilter ff_vf_quirc; 417 | extern const AVFilter ff_vf_random; 418 | extern const AVFilter ff_vf_readeia608; 419 | extern const AVFilter ff_vf_readvitc; 420 | extern const AVFilter ff_vf_realtime; 421 | extern const AVFilter ff_vf_remap; 422 | extern const AVFilter ff_vf_remap_opencl; 423 | extern const AVFilter ff_vf_removegrain; 424 | extern const AVFilter ff_vf_removelogo; 425 | extern const AVFilter ff_vf_repeatfields; 426 | extern const AVFilter ff_vf_reverse; 427 | extern const AVFilter ff_vf_rgbashift; 428 | extern const AVFilter ff_vf_roberts; 429 | extern const AVFilter ff_vf_roberts_opencl; 430 | extern const AVFilter ff_vf_rotate; 431 | extern const AVFilter ff_vf_sab; 432 | extern const AVFilter ff_vf_scale; 433 | extern const AVFilter ff_vf_scale_cuda; 434 | extern const AVFilter ff_vf_scale_npp; 435 | extern const AVFilter ff_vf_scale_qsv; 436 | extern const AVFilter ff_vf_scale_vaapi; 437 | extern const AVFilter ff_vf_scale_vt; 438 | extern const AVFilter ff_vf_scale_vulkan; 439 | extern const AVFilter ff_vf_scale2ref; 440 | extern const AVFilter ff_vf_scale2ref_npp; 441 | extern const AVFilter ff_vf_scdet; 442 | extern const AVFilter ff_vf_scharr; 443 | extern const AVFilter ff_vf_scroll; 444 | extern const AVFilter ff_vf_segment; 445 | extern const AVFilter ff_vf_select; 446 | extern const AVFilter ff_vf_selectivecolor; 447 | extern const AVFilter ff_vf_sendcmd; 448 | extern const AVFilter ff_vf_separatefields; 449 | extern const AVFilter ff_vf_setdar; 450 | extern const AVFilter ff_vf_setfield; 451 | extern const AVFilter ff_vf_setparams; 452 | extern const AVFilter ff_vf_setpts; 453 | extern const AVFilter ff_vf_setrange; 454 | extern const AVFilter ff_vf_setsar; 455 | extern const AVFilter ff_vf_settb; 456 | extern const AVFilter ff_vf_sharpen_npp; 457 | extern const AVFilter ff_vf_sharpness_vaapi; 458 | extern const AVFilter ff_vf_shear; 459 | extern const AVFilter ff_vf_showinfo; 460 | extern const AVFilter ff_vf_showpalette; 461 | extern const AVFilter ff_vf_shuffleframes; 462 | extern const AVFilter ff_vf_shufflepixels; 463 | extern const AVFilter ff_vf_shuffleplanes; 464 | extern const AVFilter ff_vf_sidedata; 465 | extern const AVFilter ff_vf_signalstats; 466 | extern const AVFilter ff_vf_signature; 467 | extern const AVFilter ff_vf_siti; 468 | extern const AVFilter ff_vf_smartblur; 469 | extern const AVFilter ff_vf_sobel; 470 | extern const AVFilter ff_vf_sobel_opencl; 471 | extern const AVFilter ff_vf_split; 472 | extern const AVFilter ff_vf_spp; 473 | extern const AVFilter ff_vf_sr; 474 | extern const AVFilter ff_vf_ssim; 475 | extern const AVFilter ff_vf_ssim360; 476 | extern const AVFilter ff_vf_stereo3d; 477 | extern const AVFilter ff_vf_streamselect; 478 | extern const AVFilter ff_vf_subtitles; 479 | extern const AVFilter ff_vf_super2xsai; 480 | extern const AVFilter ff_vf_swaprect; 481 | extern const AVFilter ff_vf_swapuv; 482 | extern const AVFilter ff_vf_tblend; 483 | extern const AVFilter ff_vf_telecine; 484 | extern const AVFilter ff_vf_thistogram; 485 | extern const AVFilter ff_vf_threshold; 486 | extern const AVFilter ff_vf_thumbnail; 487 | extern const AVFilter ff_vf_thumbnail_cuda; 488 | extern const AVFilter ff_vf_tile; 489 | extern const AVFilter ff_vf_tiltandshift; 490 | extern const AVFilter ff_vf_tinterlace; 491 | extern const AVFilter ff_vf_tlut2; 492 | extern const AVFilter ff_vf_tmedian; 493 | extern const AVFilter ff_vf_tmidequalizer; 494 | extern const AVFilter ff_vf_tmix; 495 | extern const AVFilter ff_vf_tonemap; 496 | extern const AVFilter ff_vf_tonemap_opencl; 497 | extern const AVFilter ff_vf_tonemap_vaapi; 498 | extern const AVFilter ff_vf_tpad; 499 | extern const AVFilter ff_vf_transpose; 500 | extern const AVFilter ff_vf_transpose_npp; 501 | extern const AVFilter ff_vf_transpose_opencl; 502 | extern const AVFilter ff_vf_transpose_vaapi; 503 | extern const AVFilter ff_vf_transpose_vt; 504 | extern const AVFilter ff_vf_transpose_vulkan; 505 | extern const AVFilter ff_vf_trim; 506 | extern const AVFilter ff_vf_unpremultiply; 507 | extern const AVFilter ff_vf_unsharp; 508 | extern const AVFilter ff_vf_unsharp_opencl; 509 | extern const AVFilter ff_vf_untile; 510 | extern const AVFilter ff_vf_uspp; 511 | extern const AVFilter ff_vf_v360; 512 | extern const AVFilter ff_vf_vaguedenoiser; 513 | extern const AVFilter ff_vf_varblur; 514 | extern const AVFilter ff_vf_vectorscope; 515 | extern const AVFilter ff_vf_vflip; 516 | extern const AVFilter ff_vf_vflip_vulkan; 517 | extern const AVFilter ff_vf_vfrdet; 518 | extern const AVFilter ff_vf_vibrance; 519 | extern const AVFilter ff_vf_vidstabdetect; 520 | extern const AVFilter ff_vf_vidstabtransform; 521 | extern const AVFilter ff_vf_vif; 522 | extern const AVFilter ff_vf_vignette; 523 | extern const AVFilter ff_vf_vmafmotion; 524 | extern const AVFilter ff_vf_vpp_qsv; 525 | extern const AVFilter ff_vf_vstack; 526 | extern const AVFilter ff_vf_w3fdif; 527 | extern const AVFilter ff_vf_waveform; 528 | extern const AVFilter ff_vf_weave; 529 | extern const AVFilter ff_vf_xbr; 530 | extern const AVFilter ff_vf_xcorrelate; 531 | extern const AVFilter ff_vf_xfade; 532 | extern const AVFilter ff_vf_xfade_opencl; 533 | extern const AVFilter ff_vf_xfade_vulkan; 534 | extern const AVFilter ff_vf_xmedian; 535 | extern const AVFilter ff_vf_xpsnr; 536 | extern const AVFilter ff_vf_xstack; 537 | extern const AVFilter ff_vf_yadif; 538 | extern const AVFilter ff_vf_yadif_cuda; 539 | extern const AVFilter ff_vf_yadif_videotoolbox; 540 | extern const AVFilter ff_vf_yaepblur; 541 | extern const AVFilter ff_vf_zmq; 542 | extern const AVFilter ff_vf_zoompan; 543 | extern const AVFilter ff_vf_zscale; 544 | extern const AVFilter ff_vf_hstack_vaapi; 545 | extern const AVFilter ff_vf_vstack_vaapi; 546 | extern const AVFilter ff_vf_xstack_vaapi; 547 | extern const AVFilter ff_vf_hstack_qsv; 548 | extern const AVFilter ff_vf_vstack_qsv; 549 | extern const AVFilter ff_vf_xstack_qsv; 550 | 551 | extern const AVFilter ff_vsrc_allrgb; 552 | extern const AVFilter ff_vsrc_allyuv; 553 | extern const AVFilter ff_vsrc_cellauto; 554 | extern const AVFilter ff_vsrc_color; 555 | extern const AVFilter ff_vsrc_color_vulkan; 556 | extern const AVFilter ff_vsrc_colorchart; 557 | extern const AVFilter ff_vsrc_colorspectrum; 558 | extern const AVFilter ff_vsrc_coreimagesrc; 559 | extern const AVFilter ff_vsrc_ddagrab; 560 | extern const AVFilter ff_vsrc_frei0r_src; 561 | extern const AVFilter ff_vsrc_gradients; 562 | extern const AVFilter ff_vsrc_haldclutsrc; 563 | extern const AVFilter ff_vsrc_life; 564 | extern const AVFilter ff_vsrc_mandelbrot; 565 | extern const AVFilter ff_vsrc_mptestsrc; 566 | extern const AVFilter ff_vsrc_nullsrc; 567 | extern const AVFilter ff_vsrc_openclsrc; 568 | extern const AVFilter ff_vsrc_qrencodesrc; 569 | extern const AVFilter ff_vsrc_pal75bars; 570 | extern const AVFilter ff_vsrc_pal100bars; 571 | extern const AVFilter ff_vsrc_rgbtestsrc; 572 | extern const AVFilter ff_vsrc_sierpinski; 573 | extern const AVFilter ff_vsrc_smptebars; 574 | extern const AVFilter ff_vsrc_smptehdbars; 575 | extern const AVFilter ff_vsrc_testsrc; 576 | extern const AVFilter ff_vsrc_testsrc2; 577 | extern const AVFilter ff_vsrc_yuvtestsrc; 578 | extern const AVFilter ff_vsrc_zoneplate; 579 | 580 | extern const AVFilter ff_vsink_nullsink; 581 | 582 | /* multimedia filters */ 583 | extern const AVFilter ff_avf_a3dscope; 584 | extern const AVFilter ff_avf_abitscope; 585 | extern const AVFilter ff_avf_adrawgraph; 586 | extern const AVFilter ff_avf_agraphmonitor; 587 | extern const AVFilter ff_avf_ahistogram; 588 | extern const AVFilter ff_avf_aphasemeter; 589 | extern const AVFilter ff_avf_avectorscope; 590 | extern const AVFilter ff_avf_concat; 591 | extern const AVFilter ff_avf_showcqt; 592 | extern const AVFilter ff_avf_showcwt; 593 | extern const AVFilter ff_avf_showfreqs; 594 | extern const AVFilter ff_avf_showspatial; 595 | extern const AVFilter ff_avf_showspectrum; 596 | extern const AVFilter ff_avf_showspectrumpic; 597 | extern const AVFilter ff_avf_showvolume; 598 | extern const AVFilter ff_avf_showwaves; 599 | extern const AVFilter ff_avf_showwavespic; 600 | extern const AVFilter ff_vaf_spectrumsynth; 601 | 602 | /* multimedia sources */ 603 | extern const AVFilter ff_avsrc_avsynctest; 604 | extern const AVFilter ff_avsrc_amovie; 605 | extern const AVFilter ff_avsrc_movie; 606 | 607 | /* those filters are part of public or internal API, 608 | * they are formatted to not be found by the grep 609 | * as they are manually added again (due to their 'names' 610 | * being the same while having different 'types'). */ 611 | extern const AVFilter ff_asrc_abuffer; 612 | extern const AVFilter ff_vsrc_buffer; 613 | extern const AVFilter ff_asink_abuffer; 614 | extern const AVFilter ff_vsink_buffer; 615 | 616 | #include "libavfilter/filter_list.c" 617 | 618 | 619 | const AVFilter *av_filter_iterate(void **opaque) 620 | { 621 | uintptr_t i = (uintptr_t)*opaque; 622 | const AVFilter *f = filter_list[i]; 623 | 624 | if (f) 625 | *opaque = (void*)(i + 1); 626 | 627 | return f; 628 | } 629 | 630 | const AVFilter *avfilter_get_by_name(const char *name) 631 | { 632 | const AVFilter *f = NULL; 633 | void *opaque = 0; 634 | 635 | if (!name) 636 | return NULL; 637 | 638 | while ((f = av_filter_iterate(&opaque))) 639 | if (!strcmp(f->name, name)) 640 | return f; 641 | 642 | return NULL; 643 | } 644 | -------------------------------------------------------------------------------- /libavfilter/vf_xpsnr.c: -------------------------------------------------------------------------------- 1 | /* 2 | File: vf_xpsnr.c - code definitions for XPSNR measurement filter plug-in for FFmpeg 3 | Authors: Christian Helmrich and Christian Stoffers, Fraunhofer HHI, Berlin, Germany 4 | 5 | License: 6 | 7 | The copyright in this software is being made available under this Software Copyright 8 | License. This software may be subject to other third-party and contributor rights, 9 | including patent rights, and no such rights are granted under this license. 10 | 11 | Copyright (c) 2019 - 2024 Fraunhofer-Gesellschaft zur Förderung der angewandten 12 | Forschung e.V. (Fraunhofer). All rights reserved. 13 | 14 | Redistribution and use of this software in source and binary forms, with or without 15 | modification, are permitted for non-commercial and commercial purposes provided that 16 | the following conditions are met: 17 | 18 | * Redistributions of source code must retain the above copyright notice, this list 19 | of conditions, and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright notice, this 21 | list of conditions, and the following disclaimer in the documentation and/or other 22 | materials provided with the distribution. 23 | * Neither the names of the copyright holder nor the names of its contributors may 24 | be used to endorse or promote products derived from this software without specific 25 | prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY 28 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 29 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT 30 | SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 31 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 32 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 33 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 35 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 36 | DAMAGE. 37 | 38 | NO PATENTS GRANTED 39 | 40 | NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, INCLUDING WITHOUT LIMITATION 41 | THE PATENTS OF THE COPYRIGHT HOLDER AND CONTRIBUTORS, ARE GRANTED BY THIS SOFTWARE 42 | LICENSE. THE COPYRIGHT HOLDER AND CONTRIBUTORS PROVIDE NO WARRANTY OF PATENT NON- 43 | INFRINGEMENT WITH RESPECT TO THIS SOFTWARE. 44 | */ 45 | 46 | /* 47 | * @file 48 | * Calculate the extended perceptually weighted PSNR (XPSNR) between two input videos. 49 | */ 50 | 51 | #include 52 | #include "libavutil/avstring.h" 53 | #include "libavutil/mem.h" 54 | #include "libavutil/opt.h" 55 | #include "libavutil/pixdesc.h" 56 | #include "avfilter.h" 57 | #include "drawutils.h" 58 | #include "formats.h" 59 | #include "framesync.h" 60 | #include "internal.h" 61 | #include "video.h" 62 | #include "xpsnr.h" 63 | 64 | /* XPSNR structure definition */ 65 | 66 | typedef struct XPSNRContext 67 | { 68 | /* required basic variables */ 69 | const AVClass *class; 70 | int bpp; /* unpacked */ 71 | int depth; /* packed */ 72 | char comps[4]; 73 | int numComps; 74 | uint64_t numFrames64; 75 | unsigned frameRate; 76 | FFFrameSync fs; 77 | int lineSizes[4]; 78 | int planeHeight[4]; 79 | int planeWidth[4]; 80 | uint8_t rgbaMap[4]; 81 | FILE *statsFile; 82 | char *statsFileStr; 83 | /* XPSNR specific variables */ 84 | double *sseLuma; 85 | double *weights; 86 | AVBufferRef* bufOrg [3]; 87 | AVBufferRef* bufOrgM1[3]; 88 | AVBufferRef* bufOrgM2[3]; 89 | AVBufferRef* bufRec [3]; 90 | uint64_t maxError64; 91 | double sumWDist[3]; 92 | double sumXPSNR[3]; 93 | bool andIsInf[3]; 94 | bool isRGB; 95 | PSNRDSPContext dsp; 96 | } 97 | XPSNRContext; 98 | 99 | /* required macro definitions */ 100 | 101 | #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM 102 | #ifndef MAX 103 | #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 104 | #endif 105 | #define OFFSET(x) offsetof(XPSNRContext, x) 106 | #define XPSNR_GAMMA 2 107 | 108 | static const AVOption xpsnr_options[] = 109 | { 110 | {"stats_file", "Set file where to store per-frame difference information", OFFSET (statsFileStr), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS}, 111 | {"f", "Set file where to store per-frame difference information", OFFSET (statsFileStr), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS}, 112 | { NULL } 113 | }; 114 | 115 | FRAMESYNC_DEFINE_CLASS (xpsnr, XPSNRContext, fs); 116 | 117 | /* XPSNR function definitions */ 118 | static uint64_t highds (const int xAct, const int yAct, const int wAct, const int hAct, const int16_t *o, const int O) 119 | { 120 | uint64_t saAct = 0; 121 | 122 | for (int y = yAct; y < hAct; y += 2) 123 | { 124 | for (int x = xAct; x < wAct; x += 2) 125 | { 126 | const int f = 12 * ((int)o[ y *O + x ] + (int)o[ y *O + x+1] + (int)o[(y+1)*O + x ] + (int)o[(y+1)*O + x+1]) 127 | - 3 * ((int)o[(y-1)*O + x ] + (int)o[(y-1)*O + x+1] + (int)o[(y+2)*O + x ] + (int)o[(y+2)*O + x+1]) 128 | - 3 * ((int)o[ y *O + x-1] + (int)o[ y *O + x+2] + (int)o[(y+1)*O + x-1] + (int)o[(y+1)*O + x+2]) 129 | - 2 * ((int)o[(y-1)*O + x-1] + (int)o[(y-1)*O + x+2] + (int)o[(y+2)*O + x-1] + (int)o[(y+2)*O + x+2]) 130 | - ((int)o[(y-2)*O + x-1] + (int)o[(y-2)*O + x ] + (int)o[(y-2)*O + x+1] + (int)o[(y-2)*O + x+2] 131 | + (int)o[(y+3)*O + x-1] + (int)o[(y+3)*O + x ] + (int)o[(y+3)*O + x+1] + (int)o[(y+3)*O + x+2] 132 | + (int)o[(y-1)*O + x-2] + (int)o[ y *O + x-2] + (int)o[(y+1)*O + x-2] + (int)o[(y+2)*O + x-2] 133 | + (int)o[(y-1)*O + x+3] + (int)o[ y *O + x+3] + (int)o[(y+1)*O + x+3] + (int)o[(y+2)*O + x+3]); 134 | saAct += (uint64_t) abs(f); 135 | } 136 | } 137 | return saAct; 138 | } 139 | 140 | static uint64_t diff1st (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, const int O) 141 | { 142 | uint64_t taAct = 0; 143 | 144 | for (uint32_t y = 0; y < hAct; y += 2) 145 | { 146 | for (uint32_t x = 0; x < wAct; x += 2) 147 | { 148 | const int t = (int)o [y*O + x] + (int)o [y*O + x+1] + (int)o [(y+1)*O + x] + (int)o [(y+1)*O + x+1] 149 | - ((int)oM1[y*O + x] + (int)oM1[y*O + x+1] + (int)oM1[(y+1)*O + x] + (int)oM1[(y+1)*O + x+1]); 150 | taAct += (uint64_t) abs(t); 151 | oM1[y*O + x ] = o [y*O + x ]; oM1[(y+1)*O + x ] = o [(y+1)*O + x ]; 152 | oM1[y*O + x+1] = o [y*O + x+1]; oM1[(y+1)*O + x+1] = o [(y+1)*O + x+1]; 153 | } 154 | } 155 | return (taAct * XPSNR_GAMMA); 156 | } 157 | 158 | static uint64_t diff2nd (const uint32_t wAct, const uint32_t hAct, const int16_t *o, int16_t *oM1, int16_t *oM2, const int O) 159 | { 160 | uint64_t taAct = 0; 161 | 162 | for (uint32_t y = 0; y < hAct; y += 2) 163 | { 164 | for (uint32_t x = 0; x < wAct; x += 2) 165 | { 166 | const int t = (int)o [y*O + x] + (int)o [y*O + x+1] + (int)o [(y+1)*O + x] + (int)o [(y+1)*O + x+1] 167 | - 2 * ((int)oM1[y*O + x] + (int)oM1[y*O + x+1] + (int)oM1[(y+1)*O + x] + (int)oM1[(y+1)*O + x+1]) 168 | + (int)oM2[y*O + x] + (int)oM2[y*O + x+1] + (int)oM2[(y+1)*O + x] + (int)oM2[(y+1)*O + x+1]; 169 | taAct += (uint64_t) abs(t); 170 | oM2[y*O + x ] = oM1[y*O + x ]; oM2[(y+1)*O + x ] = oM1[(y+1)*O + x ]; 171 | oM2[y*O + x+1] = oM1[y*O + x+1]; oM2[(y+1)*O + x+1] = oM1[(y+1)*O + x+1]; 172 | oM1[y*O + x ] = o [y*O + x ]; oM1[(y+1)*O + x ] = o [(y+1)*O + x ]; 173 | oM1[y*O + x+1] = o [y*O + x+1]; oM1[(y+1)*O + x+1] = o [(y+1)*O + x+1]; 174 | } 175 | } 176 | return (taAct * XPSNR_GAMMA); 177 | } 178 | 179 | static uint64_t sseLine16bit (const uint8_t *blkOrg8, const uint8_t *blkRec8, int blockWidth) 180 | { 181 | const uint16_t *blkOrg = (const uint16_t*) blkOrg8; 182 | const uint16_t *blkRec = (const uint16_t*) blkRec8; 183 | uint64_t lSSE = 0; /* data for 1 pixel line */ 184 | 185 | for (int x = 0; x < blockWidth; x++) 186 | { 187 | const int64_t error = (int64_t) blkOrg[x] - (int64_t) blkRec[x]; 188 | 189 | lSSE += error * error; 190 | } 191 | 192 | /* sum of squared errors for the pixel line */ 193 | return lSSE; 194 | } 195 | 196 | static inline uint64_t calcSquaredError(XPSNRContext const *s, 197 | const int16_t *blkOrg, const uint32_t strideOrg, 198 | const int16_t *blkRec, const uint32_t strideRec, 199 | const uint32_t blockWidth, const uint32_t blockHeight) 200 | { 201 | uint64_t uSSE = 0; /* sum of squared errors */ 202 | 203 | for (uint32_t y = 0; y < blockHeight; y++) 204 | { 205 | uSSE += s->dsp.sse_line ((const uint8_t*) blkOrg, (const uint8_t*) blkRec, (int) blockWidth); 206 | blkOrg += strideOrg; 207 | blkRec += strideRec; 208 | } 209 | 210 | /* return nonweighted sum of squared errors */ 211 | return uSSE; 212 | } 213 | 214 | static inline double calcSquaredErrorAndWeight (XPSNRContext const *s, 215 | const int16_t *picOrg, const uint32_t strideOrg, 216 | int16_t *picOrgM1, int16_t *picOrgM2, 217 | const int16_t *picRec, const uint32_t strideRec, 218 | const uint32_t offsetX, const uint32_t offsetY, 219 | const uint32_t blockWidth, const uint32_t blockHeight, 220 | const uint32_t bitDepth, const uint32_t intFrameRate, double *msAct) 221 | { 222 | const int O = (int) strideOrg; 223 | const int R = (int) strideRec; 224 | const int16_t *o = picOrg + offsetY*O + offsetX; 225 | int16_t *oM1 = picOrgM1 + offsetY*O + offsetX; 226 | int16_t *oM2 = picOrgM2 + offsetY*O + offsetX; 227 | const int16_t *r = picRec + offsetY*R + offsetX; 228 | const int bVal = (s->planeWidth[0] * s->planeHeight[0] > 2048 * 1152 ? 2 : 1); /* threshold is a bit more than HD resolution */ 229 | const int xAct = (offsetX > 0 ? 0 : bVal); 230 | const int yAct = (offsetY > 0 ? 0 : bVal); 231 | const int wAct = (offsetX + blockWidth < (uint32_t) s->planeWidth [0] ? (int) blockWidth : (int) blockWidth - bVal); 232 | const int hAct = (offsetY + blockHeight < (uint32_t) s->planeHeight[0] ? (int) blockHeight : (int) blockHeight - bVal); 233 | 234 | const double sse = (double) calcSquaredError (s, o, strideOrg, 235 | r, strideRec, 236 | blockWidth, blockHeight); 237 | uint64_t saAct = 0; /* spatial abs. activity */ 238 | uint64_t taAct = 0; /* temporal abs. activity */ 239 | 240 | if (wAct <= xAct || hAct <= yAct) /* too tiny */ 241 | { 242 | return sse; 243 | } 244 | 245 | if (bVal > 1) /* highpass with downsampling */ 246 | { 247 | saAct = s->dsp.highds_func (xAct, yAct, wAct, hAct, o, O); 248 | } 249 | else /* <=HD, highpass without downsampling */ 250 | { 251 | for (int y = yAct; y < hAct; y++) 252 | { 253 | for (int x = xAct; x < wAct; x++) 254 | { 255 | const int f = 12 * (int)o[y*O + x] - 2 * ((int)o[y*O + x-1] + (int)o[y*O + x+1] + (int)o[(y-1)*O + x] + (int)o[(y+1)*O + x]) 256 | - ((int)o[(y-1)*O + x-1] + (int)o[(y-1)*O + x+1] + (int)o[(y+1)*O + x-1] + (int)o[(y+1)*O + x+1]); 257 | saAct += (uint64_t) abs(f); 258 | } 259 | } 260 | } 261 | 262 | /* calculate weight (mean squared activity) */ 263 | *msAct = (double) saAct / ((double)(wAct - xAct) * (double)(hAct - yAct)); 264 | 265 | if (bVal > 1) /* highpass with downsampling */ 266 | { 267 | if (intFrameRate <= 32) /* 1st-order diff */ 268 | { 269 | taAct = s->dsp.diff1st_func (blockWidth, blockHeight, o, oM1, O); 270 | } 271 | else /* 2nd-order diff (diff of 2 diffs) */ 272 | { 273 | taAct = s->dsp.diff2nd_func (blockWidth, blockHeight, o, oM1, oM2, O); 274 | } 275 | } 276 | else /* <=HD, highpass without downsampling */ 277 | { 278 | if (intFrameRate <= 32) /* 1st-order diff */ 279 | { 280 | for (uint32_t y = 0; y < blockHeight; y++) 281 | { 282 | for (uint32_t x = 0; x < blockWidth; x++) 283 | { 284 | const int t = (int)o[y*O + x] - (int)oM1[y*O + x]; 285 | 286 | taAct += XPSNR_GAMMA * (uint64_t) abs(t); 287 | oM1[y*O + x] = o [y*O + x]; 288 | } 289 | } 290 | } 291 | else /* 2nd-order diff (diff of 2 diffs) */ 292 | { 293 | for (uint32_t y = 0; y < blockHeight; y++) 294 | { 295 | for (uint32_t x = 0; x < blockWidth; x++) 296 | { 297 | const int t = (int)o[y*O + x] - 2 * (int)oM1[y*O + x] + (int)oM2[y*O + x]; 298 | 299 | taAct += XPSNR_GAMMA * (uint64_t) abs(t); 300 | oM2[y*O + x] = oM1[y*O + x]; 301 | oM1[y*O + x] = o [y*O + x]; 302 | } 303 | } 304 | } 305 | } 306 | 307 | /* weight += mean squared temporal activity */ 308 | *msAct += (double) taAct / ((double) blockWidth * (double) blockHeight); 309 | 310 | /* lower limit, accounts for high-pass gain */ 311 | if (*msAct < (double)(1 << (bitDepth - 6))) *msAct = (double)(1 << (bitDepth - 6)); 312 | 313 | *msAct *= *msAct; /* because SSE is squared */ 314 | 315 | /* return nonweighted sum of squared errors */ 316 | return sse; 317 | } 318 | 319 | static inline double getAvgXPSNR (const double sqrtWSSEData, const double sumXPSNRData, 320 | const uint32_t imageWidth, const uint32_t imageHeight, 321 | const uint64_t maxError64, const uint64_t numFrames64) 322 | { 323 | if (numFrames64 == 0) return INFINITY; 324 | 325 | if (sqrtWSSEData >= (double) numFrames64) /* sq.-mean-root dist averaging */ 326 | { 327 | const double meanDist = sqrtWSSEData / (double) numFrames64; 328 | const uint64_t num64 = (uint64_t) imageWidth * (uint64_t) imageHeight * maxError64; 329 | 330 | return 10.0 * log10 ((double) num64 / ((double) meanDist * (double) meanDist)); 331 | } 332 | 333 | return sumXPSNRData / (double) numFrames64; /* older log-domain averaging */ 334 | } 335 | 336 | static int getWSSE (AVFilterContext *ctx, int16_t **org, int16_t **orgM1, int16_t **orgM2, int16_t **rec, uint64_t* const wsse64) 337 | { 338 | XPSNRContext* const s = ctx->priv; 339 | const uint32_t W = s->planeWidth [0]; /* luma image width in pixels */ 340 | const uint32_t H = s->planeHeight[0]; /* luma image height in pixels */ 341 | const double R = (double)(W * H) / (3840.0 * 2160.0); /* UHD ratio */ 342 | const uint32_t B = MAX (0, 4 * (int32_t)(32.0 * sqrt (R) + 0.5)); /* block size, integer multiple of 4 for SIMD */ 343 | const uint32_t WBlk = (W + B - 1) / B; /* luma width in units of blocks */ 344 | const double avgAct = sqrt (16.0 * (double)(1 << (2 * s->depth - 9)) / sqrt (MAX (0.00001, R))); /* = sqrt (a_pic) */ 345 | const int* strideOrg = (s->bpp == 1 ? s->planeWidth : s->lineSizes); 346 | uint32_t x, y, idxBlk = 0; /* the "16.0" above is due to fixed-point code */ 347 | double* const sseLuma = s->sseLuma; 348 | double* const weights = s->weights; 349 | int c; 350 | 351 | if ((wsse64 == NULL) || (s->depth < 6) || (s->depth > 16) || (s->numComps <= 0) || (s->numComps > 3) || (W == 0) || (H == 0)) 352 | { 353 | av_log (ctx, AV_LOG_ERROR, "Error in XPSNR routine: invalid argument(s).\n"); 354 | 355 | return AVERROR (EINVAL); 356 | } 357 | 358 | if ((weights == NULL) || (B >= 4 && sseLuma == NULL)) 359 | { 360 | av_log (ctx, AV_LOG_ERROR, "Failed to allocate temporary block memory.\n"); 361 | 362 | return AVERROR (ENOMEM); 363 | } 364 | 365 | if (B >= 4) 366 | { 367 | const bool blockWeightSmoothing = (W * H <= 640u * 480u); /* JITU paper */ 368 | const int16_t *pOrg = org[0]; 369 | const uint32_t sOrg = strideOrg[0] / s->bpp; 370 | const int16_t *pRec = rec[0]; 371 | const uint32_t sRec = s->planeWidth[0]; 372 | int16_t *pOrgM1 = orgM1[0]; /* pixel */ 373 | int16_t *pOrgM2 = orgM2[0]; /* memory */ 374 | double wsseLuma = 0.0; 375 | 376 | for (y = 0; y < H; y += B) /* calculate block SSE and perceptual weight */ 377 | { 378 | const uint32_t blockHeight = (y + B > H ? H - y : B); 379 | 380 | for (x = 0; x < W; x += B, idxBlk++) 381 | { 382 | const uint32_t blockWidth = (x + B > W ? W - x : B); 383 | double msAct = 1.0, msActPrev = 0.0; 384 | 385 | sseLuma[idxBlk] = calcSquaredErrorAndWeight(s, pOrg, sOrg, 386 | pOrgM1, pOrgM2, 387 | pRec, sRec, 388 | x, y, 389 | blockWidth, blockHeight, 390 | s->depth, s->frameRate, &msAct); 391 | weights[idxBlk] = 1.0 / sqrt (msAct); 392 | 393 | if (blockWeightSmoothing) /* inline "minimum-smoothing" as in paper */ 394 | { 395 | if (x == 0) /* first column */ 396 | { 397 | msActPrev = (idxBlk > 1 ? weights[idxBlk - 2] : 0); 398 | } 399 | else /* after first column */ 400 | { 401 | msActPrev = (x > B ? MAX (weights[idxBlk - 2], weights[idxBlk]) : weights[idxBlk]); 402 | } 403 | if (idxBlk > WBlk) /* after first row and first column */ 404 | { 405 | msActPrev = MAX (msActPrev, weights[idxBlk - 1 - WBlk]); /* min (left, top) */ 406 | } 407 | if ((idxBlk > 0) && (weights[idxBlk - 1] > msActPrev)) 408 | { 409 | weights[idxBlk - 1] = msActPrev; 410 | } 411 | if ((x + B >= W) && (y + B >= H) && (idxBlk > WBlk)) /* last block in picture */ 412 | { 413 | msActPrev = MAX (weights[idxBlk - 1], weights[idxBlk - WBlk]); 414 | if (weights[idxBlk] > msActPrev) 415 | { 416 | weights[idxBlk] = msActPrev; 417 | } 418 | } 419 | } 420 | } /* for x */ 421 | } /* for y */ 422 | 423 | for (y = idxBlk = 0; y < H; y += B) /* calculate sum for luma (Y) XPSNR */ 424 | { 425 | for (x = 0; x < W; x += B, idxBlk++) 426 | { 427 | wsseLuma += sseLuma[idxBlk] * weights[idxBlk]; 428 | } 429 | } 430 | wsse64[0] = (wsseLuma <= 0.0 ? 0 : (uint64_t)(wsseLuma * avgAct + 0.5)); 431 | } /* B >= 4 */ 432 | 433 | for (c = 0; c < s->numComps; c++) /* finalize SSE data for all components */ 434 | { 435 | const int16_t *pOrg = org[c]; 436 | const uint32_t sOrg = strideOrg[c] / s->bpp; 437 | const int16_t *pRec = rec[c]; 438 | const uint32_t sRec = s->planeWidth[c]; 439 | const uint32_t WPln = s->planeWidth[c]; 440 | const uint32_t HPln = s->planeHeight[c]; 441 | 442 | if (B < 4) /* picture is too small for XPSNR, calculate unweighted PSNR */ 443 | { 444 | wsse64[c] = calcSquaredError (s, pOrg, sOrg, 445 | pRec, sRec, 446 | WPln, HPln); 447 | } 448 | else if (c > 0) /* B >= 4, so Y XPSNR has already been calculated above */ 449 | { 450 | const uint32_t Bx = (B * WPln) / W; 451 | const uint32_t By = (B * HPln) / H; /* up to chroma downsampling by 4 */ 452 | double wsseChroma = 0.0; 453 | 454 | for (y = idxBlk = 0; y < HPln; y += By) /* calc. chroma (Cb/Cr) XPSNR */ 455 | { 456 | const uint32_t blockHeight = (y + By > HPln ? HPln - y : By); 457 | 458 | for (x = 0; x < WPln; x += Bx, idxBlk++) 459 | { 460 | const uint32_t blockWidth = (x + Bx > WPln ? WPln - x : Bx); 461 | 462 | wsseChroma += (double) calcSquaredError(s, pOrg + y*sOrg + x, sOrg, 463 | pRec + y*sRec + x, sRec, 464 | blockWidth, blockHeight) * weights[idxBlk]; 465 | } 466 | } 467 | wsse64[c] = (wsseChroma <= 0.0 ? 0 : (uint64_t)(wsseChroma * avgAct + 0.5)); 468 | } 469 | } /* for c */ 470 | 471 | return 0; 472 | } 473 | 474 | static int do_xpsnr (FFFrameSync *fs) 475 | { 476 | AVFilterContext *ctx = fs->parent; 477 | XPSNRContext* const s = ctx->priv; 478 | const uint32_t W = s->planeWidth [0]; /* luma image width in pixels */ 479 | const uint32_t H = s->planeHeight[0]; /* luma image height in pixels */ 480 | const uint32_t B = MAX (0, 4 * (int32_t)(32.0 * sqrt ((double)(W * H) / (3840.0 * 2160.0)) + 0.5)); /* block size */ 481 | const uint32_t WBlk = (W + B - 1) / B; /* luma width in units of blocks */ 482 | const uint32_t HBlk = (H + B - 1) / B;/* luma height in units of blocks */ 483 | AVFrame *master, *ref = NULL; 484 | int16_t *pOrg [3]; 485 | int16_t *pOrgM1[3]; 486 | int16_t *pOrgM2[3]; 487 | int16_t *pRec [3]; 488 | uint64_t wsse64[3] = {0, 0, 0}; 489 | double curXPSNR[3] = {INFINITY, INFINITY, INFINITY}; 490 | int c, retValue; 491 | 492 | if ((retValue = ff_framesync_dualinput_get (fs, &master, &ref)) < 0) return retValue; 493 | if (ref == NULL) return ff_filter_frame (ctx->outputs[0], master); 494 | 495 | /* prepare XPSNR calculation: allocate temporary picture and block memory */ 496 | if (s->sseLuma == NULL) s->sseLuma = (double*) av_malloc_array (WBlk * HBlk, sizeof (double)); 497 | if (s->weights == NULL) s->weights = (double*) av_malloc_array (WBlk * HBlk, sizeof (double)); 498 | 499 | for (c = 0; c < s->numComps; c++) /* allocate temporal org buffer memory */ 500 | { 501 | s->lineSizes[c] = master->linesize[c]; 502 | 503 | if (c == 0) /* luma ch. */ 504 | { 505 | const int strideOrgBpp = (s->bpp == 1 ? s->planeWidth[c] : s->lineSizes[c] / s->bpp); 506 | 507 | if (s->bufOrgM1[c] == NULL) s->bufOrgM1[c] = av_buffer_allocz (strideOrgBpp * s->planeHeight[c] * sizeof (int16_t)); 508 | if (s->bufOrgM2[c] == NULL) s->bufOrgM2[c] = av_buffer_allocz (strideOrgBpp * s->planeHeight[c] * sizeof (int16_t)); 509 | 510 | pOrgM1[c] = (int16_t*) s->bufOrgM1[c]->data; 511 | pOrgM2[c] = (int16_t*) s->bufOrgM2[c]->data; 512 | } 513 | } 514 | 515 | if (s->bpp == 1) /* 8 bit */ 516 | { 517 | for (c = 0; c < s->numComps; c++) /* allocate the org/rec buffer memory */ 518 | { 519 | const int M = s->lineSizes[c]; /* master stride */ 520 | const int R = ref->linesize[c]; /* ref/c stride */ 521 | const int O = s->planeWidth[c]; /* XPSNR stride */ 522 | 523 | if (s->bufOrg[c] == NULL) s->bufOrg[c] = av_buffer_allocz (s->planeWidth[c] * s->planeHeight[c] * sizeof (int16_t)); 524 | if (s->bufRec[c] == NULL) s->bufRec[c] = av_buffer_allocz (s->planeWidth[c] * s->planeHeight[c] * sizeof (int16_t)); 525 | 526 | pOrg[c] = (int16_t*) s->bufOrg[c]->data; 527 | pRec[c] = (int16_t*) s->bufRec[c]->data; 528 | 529 | for (int y = 0; y < s->planeHeight[c]; y++) 530 | { 531 | for (int x = 0; x < s->planeWidth[c]; x++) 532 | { 533 | pOrg[c][y*O + x] = (int16_t) master->data[c][y*M + x]; 534 | pRec[c][y*O + x] = (int16_t) ref->data[c][y*R + x]; 535 | } 536 | } 537 | } 538 | } 539 | else /* 10, 12, or 14 bit */ 540 | { 541 | for (c = 0; c < s->numComps; c++) 542 | { 543 | pOrg[c] = (int16_t*) master->data[c]; 544 | pRec[c] = (int16_t*) ref->data[c]; 545 | } 546 | } 547 | 548 | /* extended perceptually weighted peak signal-to-noise ratio (XPSNR) data */ 549 | 550 | if ((retValue = getWSSE (ctx, (int16_t **)&pOrg, (int16_t **)&pOrgM1, (int16_t **)&pOrgM2, (int16_t **)&pRec, wsse64)) < 0) 551 | { 552 | return retValue; /* an error here implies something went wrong earlier! */ 553 | } 554 | 555 | for (c = 0; c < s->numComps; c++) 556 | { 557 | const double sqrtWSSE = sqrt ((double) wsse64[c]); 558 | 559 | curXPSNR[c] = getAvgXPSNR (sqrtWSSE, INFINITY, 560 | s->planeWidth[c], s->planeHeight[c], 561 | s->maxError64, 1 /* single frame */); 562 | s->sumWDist[c] += sqrtWSSE; 563 | s->sumXPSNR[c] += curXPSNR[c]; 564 | s->andIsInf[c] &= isinf (curXPSNR[c]); 565 | } 566 | s->numFrames64++; 567 | 568 | if (s->statsFile != NULL) /* print out frame- and component-wise averages */ 569 | { 570 | fprintf (s->statsFile, "n: %4"PRId64"", s->numFrames64); 571 | 572 | for (c = 0; c < s->numComps; c++) 573 | { 574 | fprintf (s->statsFile, " XPSNR %c: %3.4f", s->comps[c], curXPSNR[c]); 575 | } 576 | fprintf (s->statsFile, "\n"); 577 | } 578 | 579 | return ff_filter_frame (ctx->outputs[0], master); 580 | } 581 | 582 | static av_cold int init (AVFilterContext *ctx) 583 | { 584 | XPSNRContext* const s = ctx->priv; 585 | int c; 586 | 587 | if (s->statsFileStr != NULL) 588 | { 589 | if (!strcmp (s->statsFileStr, "-")) /* no statistics file, take stdout */ 590 | { 591 | s->statsFile = stdout; 592 | } 593 | else 594 | { 595 | s->statsFile = fopen (s->statsFileStr, "w"); 596 | 597 | if (s->statsFile == NULL) 598 | { 599 | const int err = AVERROR (errno); 600 | char buf[128]; 601 | 602 | av_strerror (err, buf, sizeof (buf)); 603 | av_log (ctx, AV_LOG_ERROR, "Could not open statistics file %s: %s\n", s->statsFileStr, buf); 604 | 605 | return err; 606 | } 607 | } 608 | } 609 | 610 | s->sseLuma = NULL; 611 | s->weights = NULL; 612 | 613 | for (c = 0; c < 3; c++) /* initialize XPSNR data of every color component */ 614 | { 615 | s->bufOrg [c] = NULL; 616 | s->bufOrgM1[c] = NULL; 617 | s->bufOrgM2[c] = NULL; 618 | s->bufRec [c] = NULL; 619 | s->sumWDist[c] = 0.0; 620 | s->sumXPSNR[c] = 0.0; 621 | s->andIsInf[c] = true; 622 | } 623 | 624 | s->fs.on_event = do_xpsnr; 625 | 626 | return 0; 627 | } 628 | 629 | static const enum AVPixelFormat xpsnr_formats[] = 630 | { 631 | AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16, 632 | #define PF_NOALPHA(suf) AV_PIX_FMT_YUV420##suf, AV_PIX_FMT_YUV422##suf, AV_PIX_FMT_YUV444##suf 633 | #define PF_ALPHA(suf) AV_PIX_FMT_YUVA420##suf, AV_PIX_FMT_YUVA422##suf, AV_PIX_FMT_YUVA444##suf 634 | #define PF(suf) PF_NOALPHA(suf), PF_ALPHA(suf) 635 | PF(P), PF(P9), PF(P10), PF_NOALPHA(P12), PF_NOALPHA(P14), PF(P16), 636 | AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, 637 | AV_PIX_FMT_YUVJ411P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, 638 | AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P, 639 | AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, 640 | AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, 641 | AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16, 642 | AV_PIX_FMT_NONE 643 | }; 644 | 645 | static int config_input_ref (AVFilterLink *inLink) 646 | { 647 | const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get (inLink->format); 648 | AVFilterContext *ctx = inLink->dst; 649 | XPSNRContext* const s = ctx->priv; 650 | int cpu_flags; 651 | 652 | if ((ctx->inputs[0]->w != ctx->inputs[1]->w) || 653 | (ctx->inputs[0]->h != ctx->inputs[1]->h)) 654 | { 655 | av_log (ctx, AV_LOG_ERROR, "Width and height of the input videos must match.\n"); 656 | 657 | return AVERROR (EINVAL); 658 | } 659 | 660 | if (ctx->inputs[0]->format != ctx->inputs[1]->format) 661 | { 662 | av_log (ctx, AV_LOG_ERROR, "The input videos must be of the same pixel format.\n"); 663 | 664 | return AVERROR (EINVAL); 665 | } 666 | 667 | s->bpp = (desc->comp[0].depth <= 8 ? 1 : 2); 668 | s->depth = desc->comp[0].depth; 669 | #if 1 670 | s->maxError64 = (1 << s->depth) - 1; /* conventional limit */ 671 | #else 672 | s->maxError64 = 255 * (1 << (s->depth - 8)); /* JVET style */ 673 | #endif 674 | s->maxError64 *= s->maxError64; 675 | 676 | s->frameRate = inLink->frame_rate.num / inLink->frame_rate.den; 677 | 678 | s->numComps = (desc->nb_components > 3 ? 3 : desc->nb_components); 679 | 680 | s->isRGB = (ff_fill_rgba_map (s->rgbaMap, inLink->format) >= 0); 681 | s->comps[0] = (s->isRGB ? 'R' : 'Y'); 682 | s->comps[1] = (s->isRGB ? 'G' : 'U'); 683 | s->comps[2] = (s->isRGB ? 'B' : 'V'); 684 | s->comps[3] = 'A'; 685 | 686 | s->planeWidth [1] = s->planeWidth [2] = AV_CEIL_RSHIFT (inLink->w, desc->log2_chroma_w); 687 | s->planeWidth [0] = s->planeWidth [3] = inLink->w; 688 | s->planeHeight[1] = s->planeHeight[2] = AV_CEIL_RSHIFT (inLink->h, desc->log2_chroma_h); 689 | s->planeHeight[0] = s->planeHeight[3] = inLink->h; 690 | 691 | s->dsp.sse_line = sseLine16bit; /* initialize SIMD routine */ 692 | if (ARCH_X86) ff_psnr_init_x86 (&s->dsp, 15); /* from PSNR */ 693 | 694 | s->dsp.highds_func = highds; /* initialize customized AVX2 */ 695 | s->dsp.diff1st_func = diff1st; /* SIMD routines from XPSNR */ 696 | s->dsp.diff2nd_func = diff2nd; 697 | cpu_flags = av_get_cpu_flags(); 698 | if (EXTERNAL_AVX2 (cpu_flags)) 699 | { 700 | #ifdef __AVX2__ 701 | s->dsp.highds_func = highds_SIMD; 702 | s->dsp.diff1st_func = diff1st_SIMD; 703 | s->dsp.diff2nd_func = diff2nd_SIMD; 704 | #endif 705 | } 706 | return 0; 707 | } 708 | 709 | static int config_output (AVFilterLink *outLink) 710 | { 711 | AVFilterContext *ctx = outLink->src; 712 | AVFilterLink *mainLink = ctx->inputs[0]; 713 | XPSNRContext *s = ctx->priv; 714 | int retValue; 715 | 716 | if ((retValue = ff_framesync_init_dualinput (&s->fs, ctx)) < 0) return retValue; 717 | 718 | outLink->w = mainLink->w; 719 | outLink->h = mainLink->h; 720 | outLink->frame_rate = mainLink->frame_rate; 721 | outLink->sample_aspect_ratio = mainLink->sample_aspect_ratio; 722 | outLink->time_base = mainLink->time_base; 723 | 724 | if ((retValue = ff_framesync_configure (&s->fs)) < 0) return retValue; 725 | 726 | return 0; 727 | } 728 | 729 | static int activate (AVFilterContext *ctx) 730 | { 731 | XPSNRContext *s = ctx->priv; 732 | 733 | return ff_framesync_activate (&s->fs); 734 | } 735 | 736 | static av_cold void uninit (AVFilterContext *ctx) 737 | { 738 | XPSNRContext* const s = ctx->priv; 739 | int c; 740 | 741 | if (s->numFrames64 > 0) /* print out overall component-wise XPSNR average */ 742 | { 743 | const double xpsnrLuma = getAvgXPSNR (s->sumWDist[0], s->sumXPSNR[0], 744 | s->planeWidth[0], s->planeHeight[0], 745 | s->maxError64, s->numFrames64); 746 | double xpsnrMin = xpsnrLuma; 747 | 748 | /* luma */ 749 | av_log (ctx, AV_LOG_INFO, "XPSNR %c: %3.4f", s->comps[0], xpsnrLuma); 750 | if (s->statsFile != NULL) 751 | { 752 | fprintf (s->statsFile, "\nXPSNR average, %"PRId64" frames", s->numFrames64); 753 | fprintf (s->statsFile, " %c: %3.4f", s->comps[0], xpsnrLuma); 754 | } 755 | /* chroma */ 756 | for (c = 1; c < s->numComps; c++) 757 | { 758 | const double xpsnrChroma = getAvgXPSNR (s->sumWDist[c], s->sumXPSNR[c], 759 | s->planeWidth[c], s->planeHeight[c], 760 | s->maxError64, s->numFrames64); 761 | if (xpsnrMin > xpsnrChroma) xpsnrMin = xpsnrChroma; 762 | 763 | av_log (ctx, AV_LOG_INFO, " %c: %3.4f", s->comps[c], xpsnrChroma); 764 | if (s->statsFile != NULL) 765 | { 766 | fprintf (s->statsFile, " %c: %3.4f", s->comps[c], xpsnrChroma); 767 | } 768 | } 769 | /* print out line break (and minimum XPSNR across the color components) */ 770 | if (s->numComps > 1) 771 | { 772 | av_log (ctx, AV_LOG_INFO, " (minimum: %3.4f)\n", xpsnrMin); 773 | if (s->statsFile != NULL) fprintf (s->statsFile, " (minimum: %3.4f)\n", xpsnrMin); 774 | } 775 | else 776 | { 777 | av_log (ctx, AV_LOG_INFO, "\n"); 778 | if (s->statsFile != NULL) fprintf (s->statsFile, "\n"); 779 | } 780 | } 781 | 782 | ff_framesync_uninit (&s->fs); /* free temporary picture and block memory */ 783 | 784 | if (s->sseLuma != NULL) av_freep (&s->sseLuma); 785 | if (s->weights != NULL) av_freep (&s->weights); 786 | 787 | for (c = 0; c < s->numComps; c++) /* free addl temporal org buffer memory */ 788 | { 789 | if (s->bufOrgM1[c] != NULL) av_freep (&s->bufOrgM1[c]); 790 | if (s->bufOrgM2[c] != NULL) av_freep (&s->bufOrgM2[c]); 791 | } 792 | if (s->bpp == 1) /* 8 bit */ 793 | { 794 | for (c = 0; c < s->numComps; c++) /* free org/rec picture buffer memory */ 795 | { 796 | if (&s->bufOrg[c] != NULL) av_freep (&s->bufOrg[c]); 797 | if (&s->bufRec[c] != NULL) av_freep (&s->bufRec[c]); 798 | } 799 | } 800 | } 801 | 802 | static const AVFilterPad xpsnr_inputs[] = 803 | { 804 | { 805 | .name = "main", 806 | .type = AVMEDIA_TYPE_VIDEO, 807 | }, 808 | { 809 | .name = "reference", 810 | .type = AVMEDIA_TYPE_VIDEO, 811 | .config_props = config_input_ref, 812 | } 813 | }; 814 | 815 | static const AVFilterPad xpsnr_outputs[] = 816 | { 817 | { 818 | .name = "default", 819 | .type = AVMEDIA_TYPE_VIDEO, 820 | .config_props = config_output, 821 | } 822 | }; 823 | 824 | AVFilter ff_vf_xpsnr = 825 | { 826 | .name = "xpsnr", 827 | .description = NULL_IF_CONFIG_SMALL ("Calculate the extended perceptually weighted peak signal-to-noise ratio (XPSNR) between two video streams."), 828 | .preinit = xpsnr_framesync_preinit, 829 | .init = init, 830 | .uninit = uninit, 831 | .activate = activate, 832 | .priv_size = sizeof (XPSNRContext), 833 | .priv_class = &xpsnr_class, 834 | FILTER_INPUTS(xpsnr_inputs), 835 | FILTER_OUTPUTS(xpsnr_outputs), 836 | FILTER_PIXFMTS_ARRAY(xpsnr_formats), 837 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | 838 | AVFILTER_FLAG_SLICE_THREADS | 839 | AVFILTER_FLAG_METADATA_ONLY 840 | }; 841 | -------------------------------------------------------------------------------- /libavfilter/Makefile: -------------------------------------------------------------------------------- 1 | NAME = avfilter 2 | DESC = FFmpeg audio/video filtering library 3 | 4 | HEADERS = avfilter.h \ 5 | buffersink.h \ 6 | buffersrc.h \ 7 | version.h \ 8 | version_major.h \ 9 | 10 | OBJS = allfilters.o \ 11 | audio.o \ 12 | avfilter.o \ 13 | avfiltergraph.o \ 14 | buffersink.o \ 15 | buffersrc.o \ 16 | colorspace.o \ 17 | ccfifo.o \ 18 | drawutils.o \ 19 | formats.o \ 20 | framepool.o \ 21 | framequeue.o \ 22 | graphdump.o \ 23 | graphparser.o \ 24 | version.o \ 25 | video.o \ 26 | 27 | OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o 28 | OBJS-$(HAVE_THREADS) += pthread.o 29 | 30 | # subsystems 31 | OBJS-$(CONFIG_QSVVPP) += qsvvpp.o 32 | OBJS-$(CONFIG_SCENE_SAD) += scene_sad.o 33 | OBJS-$(CONFIG_DNN) += dnn_filter_common.o 34 | include $(SRC_PATH)/libavfilter/dnn/Makefile 35 | 36 | # audio filters 37 | OBJS-$(CONFIG_AAP_FILTER) += af_aap.o 38 | OBJS-$(CONFIG_ABENCH_FILTER) += f_bench.o 39 | OBJS-$(CONFIG_ACOMPRESSOR_FILTER) += af_sidechaincompress.o 40 | OBJS-$(CONFIG_ACONTRAST_FILTER) += af_acontrast.o 41 | OBJS-$(CONFIG_ACOPY_FILTER) += af_acopy.o 42 | OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o 43 | OBJS-$(CONFIG_ACROSSOVER_FILTER) += af_acrossover.o 44 | OBJS-$(CONFIG_ACRUSHER_FILTER) += af_acrusher.o 45 | OBJS-$(CONFIG_ACUE_FILTER) += f_cue.o 46 | OBJS-$(CONFIG_ADECLICK_FILTER) += af_adeclick.o 47 | OBJS-$(CONFIG_ADECLIP_FILTER) += af_adeclick.o 48 | OBJS-$(CONFIG_ADECORRELATE_FILTER) += af_adecorrelate.o 49 | OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o 50 | OBJS-$(CONFIG_ADENORM_FILTER) += af_adenorm.o 51 | OBJS-$(CONFIG_ADERIVATIVE_FILTER) += af_aderivative.o 52 | OBJS-$(CONFIG_ADRC_FILTER) += af_adrc.o 53 | OBJS-$(CONFIG_ADYNAMICEQUALIZER_FILTER) += af_adynamicequalizer.o 54 | OBJS-$(CONFIG_ADYNAMICSMOOTH_FILTER) += af_adynamicsmooth.o 55 | OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o 56 | OBJS-$(CONFIG_AEMPHASIS_FILTER) += af_aemphasis.o 57 | OBJS-$(CONFIG_AEVAL_FILTER) += aeval.o 58 | OBJS-$(CONFIG_AEXCITER_FILTER) += af_aexciter.o 59 | OBJS-$(CONFIG_AFADE_FILTER) += af_afade.o 60 | OBJS-$(CONFIG_AFFTDN_FILTER) += af_afftdn.o 61 | OBJS-$(CONFIG_AFFTFILT_FILTER) += af_afftfilt.o 62 | OBJS-$(CONFIG_AFIR_FILTER) += af_afir.o 63 | OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o 64 | OBJS-$(CONFIG_AFREQSHIFT_FILTER) += af_afreqshift.o 65 | OBJS-$(CONFIG_AFWTDN_FILTER) += af_afwtdn.o 66 | OBJS-$(CONFIG_AGATE_FILTER) += af_agate.o 67 | OBJS-$(CONFIG_AIIR_FILTER) += af_aiir.o 68 | OBJS-$(CONFIG_AINTEGRAL_FILTER) += af_aderivative.o 69 | OBJS-$(CONFIG_AINTERLEAVE_FILTER) += f_interleave.o 70 | OBJS-$(CONFIG_ALATENCY_FILTER) += f_latency.o 71 | OBJS-$(CONFIG_ALIMITER_FILTER) += af_alimiter.o 72 | OBJS-$(CONFIG_ALLPASS_FILTER) += af_biquads.o 73 | OBJS-$(CONFIG_ALOOP_FILTER) += f_loop.o 74 | OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o 75 | OBJS-$(CONFIG_AMETADATA_FILTER) += f_metadata.o 76 | OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o 77 | OBJS-$(CONFIG_AMULTIPLY_FILTER) += af_amultiply.o 78 | OBJS-$(CONFIG_ANEQUALIZER_FILTER) += af_anequalizer.o 79 | OBJS-$(CONFIG_ANLMDN_FILTER) += af_anlmdn.o 80 | OBJS-$(CONFIG_ANLMF_FILTER) += af_anlms.o 81 | OBJS-$(CONFIG_ANLMS_FILTER) += af_anlms.o 82 | OBJS-$(CONFIG_ANULL_FILTER) += af_anull.o 83 | OBJS-$(CONFIG_APAD_FILTER) += af_apad.o 84 | OBJS-$(CONFIG_APERMS_FILTER) += f_perms.o 85 | OBJS-$(CONFIG_APHASER_FILTER) += af_aphaser.o generate_wave_table.o 86 | OBJS-$(CONFIG_APHASESHIFT_FILTER) += af_afreqshift.o 87 | OBJS-$(CONFIG_APSNR_FILTER) += af_asdr.o 88 | OBJS-$(CONFIG_APSYCLIP_FILTER) += af_apsyclip.o 89 | OBJS-$(CONFIG_APULSATOR_FILTER) += af_apulsator.o 90 | OBJS-$(CONFIG_AREALTIME_FILTER) += f_realtime.o 91 | OBJS-$(CONFIG_ARESAMPLE_FILTER) += af_aresample.o 92 | OBJS-$(CONFIG_AREVERSE_FILTER) += f_reverse.o 93 | OBJS-$(CONFIG_ARLS_FILTER) += af_arls.o 94 | OBJS-$(CONFIG_ARNNDN_FILTER) += af_arnndn.o 95 | OBJS-$(CONFIG_ASDR_FILTER) += af_asdr.o 96 | OBJS-$(CONFIG_ASEGMENT_FILTER) += f_segment.o 97 | OBJS-$(CONFIG_ASELECT_FILTER) += f_select.o 98 | OBJS-$(CONFIG_ASENDCMD_FILTER) += f_sendcmd.o 99 | OBJS-$(CONFIG_ASETNSAMPLES_FILTER) += af_asetnsamples.o 100 | OBJS-$(CONFIG_ASETPTS_FILTER) += setpts.o 101 | OBJS-$(CONFIG_ASETRATE_FILTER) += af_asetrate.o 102 | OBJS-$(CONFIG_ASETTB_FILTER) += settb.o 103 | OBJS-$(CONFIG_ASHOWINFO_FILTER) += af_ashowinfo.o 104 | OBJS-$(CONFIG_ASIDEDATA_FILTER) += f_sidedata.o 105 | OBJS-$(CONFIG_ASISDR_FILTER) += af_asdr.o 106 | OBJS-$(CONFIG_ASOFTCLIP_FILTER) += af_asoftclip.o 107 | OBJS-$(CONFIG_ASPECTRALSTATS_FILTER) += af_aspectralstats.o 108 | OBJS-$(CONFIG_ASPLIT_FILTER) += split.o 109 | OBJS-$(CONFIG_ASR_FILTER) += af_asr.o 110 | OBJS-$(CONFIG_ASTATS_FILTER) += af_astats.o 111 | OBJS-$(CONFIG_ASTREAMSELECT_FILTER) += f_streamselect.o framesync.o 112 | OBJS-$(CONFIG_ASUBBOOST_FILTER) += af_asubboost.o 113 | OBJS-$(CONFIG_ASUBCUT_FILTER) += af_asupercut.o 114 | OBJS-$(CONFIG_ASUPERCUT_FILTER) += af_asupercut.o 115 | OBJS-$(CONFIG_ASUPERPASS_FILTER) += af_asupercut.o 116 | OBJS-$(CONFIG_ASUPERSTOP_FILTER) += af_asupercut.o 117 | OBJS-$(CONFIG_ATEMPO_FILTER) += af_atempo.o 118 | OBJS-$(CONFIG_ATILT_FILTER) += af_atilt.o 119 | OBJS-$(CONFIG_ATRIM_FILTER) += trim.o 120 | OBJS-$(CONFIG_AXCORRELATE_FILTER) += af_axcorrelate.o 121 | OBJS-$(CONFIG_AZMQ_FILTER) += f_zmq.o 122 | OBJS-$(CONFIG_BANDPASS_FILTER) += af_biquads.o 123 | OBJS-$(CONFIG_BANDREJECT_FILTER) += af_biquads.o 124 | OBJS-$(CONFIG_BASS_FILTER) += af_biquads.o 125 | OBJS-$(CONFIG_BIQUAD_FILTER) += af_biquads.o 126 | OBJS-$(CONFIG_BS2B_FILTER) += af_bs2b.o 127 | OBJS-$(CONFIG_CHANNELMAP_FILTER) += af_channelmap.o 128 | OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o 129 | OBJS-$(CONFIG_CHORUS_FILTER) += af_chorus.o generate_wave_table.o 130 | OBJS-$(CONFIG_COMPAND_FILTER) += af_compand.o 131 | OBJS-$(CONFIG_COMPENSATIONDELAY_FILTER) += af_compensationdelay.o 132 | OBJS-$(CONFIG_CROSSFEED_FILTER) += af_crossfeed.o 133 | OBJS-$(CONFIG_CRYSTALIZER_FILTER) += af_crystalizer.o 134 | OBJS-$(CONFIG_DCSHIFT_FILTER) += af_dcshift.o 135 | OBJS-$(CONFIG_DEESSER_FILTER) += af_deesser.o 136 | OBJS-$(CONFIG_DIALOGUENHANCE_FILTER) += af_dialoguenhance.o 137 | OBJS-$(CONFIG_DRMETER_FILTER) += af_drmeter.o 138 | OBJS-$(CONFIG_DYNAUDNORM_FILTER) += af_dynaudnorm.o 139 | OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o 140 | OBJS-$(CONFIG_EBUR128_FILTER) += f_ebur128.o 141 | OBJS-$(CONFIG_EQUALIZER_FILTER) += af_biquads.o 142 | OBJS-$(CONFIG_EXTRASTEREO_FILTER) += af_extrastereo.o 143 | OBJS-$(CONFIG_FIREQUALIZER_FILTER) += af_firequalizer.o 144 | OBJS-$(CONFIG_FLANGER_FILTER) += af_flanger.o generate_wave_table.o 145 | OBJS-$(CONFIG_HAAS_FILTER) += af_haas.o 146 | OBJS-$(CONFIG_HDCD_FILTER) += af_hdcd.o 147 | OBJS-$(CONFIG_HEADPHONE_FILTER) += af_headphone.o 148 | OBJS-$(CONFIG_HIGHPASS_FILTER) += af_biquads.o 149 | OBJS-$(CONFIG_HIGHSHELF_FILTER) += af_biquads.o 150 | OBJS-$(CONFIG_JOIN_FILTER) += af_join.o 151 | OBJS-$(CONFIG_LADSPA_FILTER) += af_ladspa.o 152 | OBJS-$(CONFIG_LOUDNORM_FILTER) += af_loudnorm.o ebur128.o 153 | OBJS-$(CONFIG_LOWPASS_FILTER) += af_biquads.o 154 | OBJS-$(CONFIG_LOWSHELF_FILTER) += af_biquads.o 155 | OBJS-$(CONFIG_LV2_FILTER) += af_lv2.o 156 | OBJS-$(CONFIG_MCOMPAND_FILTER) += af_mcompand.o 157 | OBJS-$(CONFIG_PAN_FILTER) += af_pan.o 158 | OBJS-$(CONFIG_REPLAYGAIN_FILTER) += af_replaygain.o 159 | OBJS-$(CONFIG_RUBBERBAND_FILTER) += af_rubberband.o 160 | OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER) += af_sidechaincompress.o 161 | OBJS-$(CONFIG_SIDECHAINGATE_FILTER) += af_agate.o 162 | OBJS-$(CONFIG_SILENCEDETECT_FILTER) += af_silencedetect.o 163 | OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o 164 | OBJS-$(CONFIG_SOFALIZER_FILTER) += af_sofalizer.o 165 | OBJS-$(CONFIG_SPEECHNORM_FILTER) += af_speechnorm.o 166 | OBJS-$(CONFIG_STEREOTOOLS_FILTER) += af_stereotools.o 167 | OBJS-$(CONFIG_STEREOWIDEN_FILTER) += af_stereowiden.o 168 | OBJS-$(CONFIG_SUPEREQUALIZER_FILTER) += af_superequalizer.o 169 | OBJS-$(CONFIG_SURROUND_FILTER) += af_surround.o 170 | OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o 171 | OBJS-$(CONFIG_TREMOLO_FILTER) += af_tremolo.o 172 | OBJS-$(CONFIG_VIBRATO_FILTER) += af_vibrato.o generate_wave_table.o 173 | OBJS-$(CONFIG_VIRTUALBASS_FILTER) += af_virtualbass.o 174 | OBJS-$(CONFIG_VOLUME_FILTER) += af_volume.o 175 | OBJS-$(CONFIG_VOLUMEDETECT_FILTER) += af_volumedetect.o 176 | 177 | OBJS-$(CONFIG_AEVALSRC_FILTER) += aeval.o 178 | OBJS-$(CONFIG_AFDELAYSRC_FILTER) += asrc_afdelaysrc.o 179 | OBJS-$(CONFIG_AFIREQSRC_FILTER) += asrc_afirsrc.o 180 | OBJS-$(CONFIG_AFIRSRC_FILTER) += asrc_afirsrc.o 181 | OBJS-$(CONFIG_ANOISESRC_FILTER) += asrc_anoisesrc.o 182 | OBJS-$(CONFIG_ANULLSRC_FILTER) += asrc_anullsrc.o 183 | OBJS-$(CONFIG_FLITE_FILTER) += asrc_flite.o 184 | OBJS-$(CONFIG_HILBERT_FILTER) += asrc_hilbert.o 185 | OBJS-$(CONFIG_SINC_FILTER) += asrc_sinc.o 186 | OBJS-$(CONFIG_SINE_FILTER) += asrc_sine.o 187 | 188 | OBJS-$(CONFIG_ANULLSINK_FILTER) += asink_anullsink.o 189 | 190 | # video filters 191 | OBJS-$(CONFIG_ADDROI_FILTER) += vf_addroi.o 192 | OBJS-$(CONFIG_ALPHAEXTRACT_FILTER) += vf_extractplanes.o 193 | OBJS-$(CONFIG_ALPHAMERGE_FILTER) += vf_alphamerge.o framesync.o 194 | OBJS-$(CONFIG_AMPLIFY_FILTER) += vf_amplify.o 195 | OBJS-$(CONFIG_ASS_FILTER) += vf_subtitles.o 196 | OBJS-$(CONFIG_ATADENOISE_FILTER) += vf_atadenoise.o 197 | OBJS-$(CONFIG_AVGBLUR_FILTER) += vf_avgblur.o 198 | OBJS-$(CONFIG_AVGBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \ 199 | opencl/avgblur.o boxblur.o 200 | OBJS-$(CONFIG_AVGBLUR_VULKAN_FILTER) += vf_avgblur_vulkan.o vulkan.o vulkan_filter.o 201 | OBJS-$(CONFIG_BACKGROUNDKEY_FILTER) += vf_backgroundkey.o 202 | OBJS-$(CONFIG_BBOX_FILTER) += bbox.o vf_bbox.o 203 | OBJS-$(CONFIG_BENCH_FILTER) += f_bench.o 204 | OBJS-$(CONFIG_BILATERAL_FILTER) += vf_bilateral.o 205 | OBJS-$(CONFIG_BILATERAL_CUDA_FILTER) += vf_bilateral_cuda.o vf_bilateral_cuda.ptx.o 206 | OBJS-$(CONFIG_BITPLANENOISE_FILTER) += vf_bitplanenoise.o 207 | OBJS-$(CONFIG_BLACKDETECT_FILTER) += vf_blackdetect.o 208 | OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o 209 | OBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o framesync.o 210 | OBJS-$(CONFIG_BLEND_VULKAN_FILTER) += vf_blend_vulkan.o framesync.o vulkan.o vulkan_filter.o 211 | OBJS-$(CONFIG_BLOCKDETECT_FILTER) += vf_blockdetect.o 212 | OBJS-$(CONFIG_BLURDETECT_FILTER) += vf_blurdetect.o edge_common.o 213 | OBJS-$(CONFIG_BM3D_FILTER) += vf_bm3d.o framesync.o 214 | OBJS-$(CONFIG_BOXBLUR_FILTER) += vf_boxblur.o boxblur.o 215 | OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \ 216 | opencl/avgblur.o boxblur.o 217 | OBJS-$(CONFIG_BWDIF_FILTER) += vf_bwdif.o bwdifdsp.o yadif_common.o 218 | OBJS-$(CONFIG_BWDIF_CUDA_FILTER) += vf_bwdif_cuda.o vf_bwdif_cuda.ptx.o \ 219 | yadif_common.o 220 | OBJS-$(CONFIG_BWDIF_VULKAN_FILTER) += vf_bwdif_vulkan.o yadif_common.o vulkan.o vulkan_filter.o 221 | OBJS-$(CONFIG_CAS_FILTER) += vf_cas.o 222 | OBJS-$(CONFIG_CCREPACK_FILTER) += vf_ccrepack.o 223 | OBJS-$(CONFIG_CHROMABER_VULKAN_FILTER) += vf_chromaber_vulkan.o vulkan.o vulkan_filter.o 224 | OBJS-$(CONFIG_CHROMAHOLD_FILTER) += vf_chromakey.o 225 | OBJS-$(CONFIG_CHROMAKEY_FILTER) += vf_chromakey.o 226 | OBJS-$(CONFIG_CHROMAKEY_CUDA_FILTER) += vf_chromakey_cuda.o vf_chromakey_cuda.ptx.o 227 | 228 | OBJS-$(CONFIG_CHROMANR_FILTER) += vf_chromanr.o 229 | OBJS-$(CONFIG_CHROMASHIFT_FILTER) += vf_chromashift.o 230 | OBJS-$(CONFIG_CIESCOPE_FILTER) += vf_ciescope.o 231 | OBJS-$(CONFIG_CODECVIEW_FILTER) += vf_codecview.o qp_table.o 232 | OBJS-$(CONFIG_COLORBALANCE_FILTER) += vf_colorbalance.o 233 | OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o 234 | OBJS-$(CONFIG_COLORCONTRAST_FILTER) += vf_colorcontrast.o 235 | OBJS-$(CONFIG_COLORCORRECT_FILTER) += vf_colorcorrect.o 236 | OBJS-$(CONFIG_COLORIZE_FILTER) += vf_colorize.o 237 | OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o 238 | OBJS-$(CONFIG_COLORKEY_OPENCL_FILTER) += vf_colorkey_opencl.o opencl.o \ 239 | opencl/colorkey.o 240 | OBJS-$(CONFIG_COLORHOLD_FILTER) += vf_colorkey.o 241 | OBJS-$(CONFIG_COLORLEVELS_FILTER) += vf_colorlevels.o 242 | OBJS-$(CONFIG_COLORMAP_FILTER) += vf_colormap.o 243 | OBJS-$(CONFIG_COLORMATRIX_FILTER) += vf_colormatrix.o 244 | OBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o colorspacedsp.o 245 | OBJS-$(CONFIG_COLORSPACE_CUDA_FILTER) += vf_colorspace_cuda.o \ 246 | vf_colorspace_cuda.ptx.o \ 247 | cuda/load_helper.o 248 | OBJS-$(CONFIG_COLORTEMPERATURE_FILTER) += vf_colortemperature.o 249 | OBJS-$(CONFIG_CONVOLUTION_FILTER) += vf_convolution.o 250 | OBJS-$(CONFIG_CONVOLUTION_OPENCL_FILTER) += vf_convolution_opencl.o opencl.o \ 251 | opencl/convolution.o 252 | OBJS-$(CONFIG_CONVOLVE_FILTER) += vf_convolve.o framesync.o 253 | OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o 254 | OBJS-$(CONFIG_COREIMAGE_FILTER) += vf_coreimage.o 255 | OBJS-$(CONFIG_CORR_FILTER) += vf_corr.o framesync.o 256 | OBJS-$(CONFIG_COVER_RECT_FILTER) += vf_cover_rect.o lavfutils.o 257 | OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o 258 | OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o edge_common.o 259 | OBJS-$(CONFIG_CUE_FILTER) += f_cue.o 260 | OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o 261 | OBJS-$(CONFIG_DATASCOPE_FILTER) += vf_datascope.o 262 | OBJS-$(CONFIG_DBLUR_FILTER) += vf_dblur.o 263 | OBJS-$(CONFIG_DCTDNOIZ_FILTER) += vf_dctdnoiz.o 264 | OBJS-$(CONFIG_DEBAND_FILTER) += vf_deband.o 265 | OBJS-$(CONFIG_DEBLOCK_FILTER) += vf_deblock.o 266 | OBJS-$(CONFIG_DECIMATE_FILTER) += vf_decimate.o 267 | OBJS-$(CONFIG_DERAIN_FILTER) += vf_derain.o 268 | OBJS-$(CONFIG_DECONVOLVE_FILTER) += vf_convolve.o framesync.o 269 | OBJS-$(CONFIG_DEDOT_FILTER) += vf_dedot.o 270 | OBJS-$(CONFIG_DEFLATE_FILTER) += vf_neighbor.o 271 | OBJS-$(CONFIG_DEFLICKER_FILTER) += vf_deflicker.o 272 | OBJS-$(CONFIG_DEINTERLACE_QSV_FILTER) += vf_vpp_qsv.o 273 | OBJS-$(CONFIG_DEINTERLACE_VAAPI_FILTER) += vf_deinterlace_vaapi.o vaapi_vpp.o 274 | OBJS-$(CONFIG_DEJUDDER_FILTER) += vf_dejudder.o 275 | OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o 276 | OBJS-$(CONFIG_DENOISE_VAAPI_FILTER) += vf_misc_vaapi.o vaapi_vpp.o 277 | OBJS-$(CONFIG_DESHAKE_OPENCL_FILTER) += vf_deshake_opencl.o opencl.o \ 278 | opencl/deshake.o transform.o 279 | OBJS-$(CONFIG_DESHAKE_FILTER) += vf_deshake.o transform.o 280 | OBJS-$(CONFIG_DESPILL_FILTER) += vf_despill.o 281 | OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o 282 | OBJS-$(CONFIG_DILATION_FILTER) += vf_neighbor.o 283 | OBJS-$(CONFIG_DILATION_OPENCL_FILTER) += vf_neighbor_opencl.o opencl.o \ 284 | opencl/neighbor.o 285 | OBJS-$(CONFIG_DISPLACE_FILTER) += vf_displace.o framesync.o 286 | OBJS-$(CONFIG_DNN_CLASSIFY_FILTER) += vf_dnn_classify.o 287 | OBJS-$(CONFIG_DNN_DETECT_FILTER) += vf_dnn_detect.o 288 | OBJS-$(CONFIG_DNN_PROCESSING_FILTER) += vf_dnn_processing.o 289 | OBJS-$(CONFIG_DOUBLEWEAVE_FILTER) += vf_weave.o 290 | OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o 291 | OBJS-$(CONFIG_DRAWGRAPH_FILTER) += f_drawgraph.o 292 | OBJS-$(CONFIG_DRAWGRID_FILTER) += vf_drawbox.o 293 | OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o textutils.o 294 | OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o edge_common.o 295 | OBJS-$(CONFIG_ELBG_FILTER) += vf_elbg.o 296 | OBJS-$(CONFIG_ENTROPY_FILTER) += vf_entropy.o 297 | OBJS-$(CONFIG_EPX_FILTER) += vf_epx.o 298 | OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o 299 | OBJS-$(CONFIG_EROSION_FILTER) += vf_neighbor.o 300 | OBJS-$(CONFIG_EROSION_OPENCL_FILTER) += vf_neighbor_opencl.o opencl.o \ 301 | opencl/neighbor.o 302 | OBJS-$(CONFIG_ESTDIF_FILTER) += vf_estdif.o 303 | OBJS-$(CONFIG_EXPOSURE_FILTER) += vf_exposure.o 304 | OBJS-$(CONFIG_EXTRACTPLANES_FILTER) += vf_extractplanes.o 305 | OBJS-$(CONFIG_FADE_FILTER) += vf_fade.o 306 | OBJS-$(CONFIG_FEEDBACK_FILTER) += vf_feedback.o 307 | OBJS-$(CONFIG_FFTDNOIZ_FILTER) += vf_fftdnoiz.o 308 | OBJS-$(CONFIG_FFTFILT_FILTER) += vf_fftfilt.o 309 | OBJS-$(CONFIG_FIELD_FILTER) += vf_field.o 310 | OBJS-$(CONFIG_FIELDHINT_FILTER) += vf_fieldhint.o 311 | OBJS-$(CONFIG_FIELDMATCH_FILTER) += vf_fieldmatch.o 312 | OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o 313 | OBJS-$(CONFIG_FILLBORDERS_FILTER) += vf_fillborders.o 314 | OBJS-$(CONFIG_FIND_RECT_FILTER) += vf_find_rect.o lavfutils.o 315 | OBJS-$(CONFIG_FLOODFILL_FILTER) += vf_floodfill.o 316 | OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o 317 | OBJS-$(CONFIG_FPS_FILTER) += vf_fps.o 318 | OBJS-$(CONFIG_FRAMEPACK_FILTER) += vf_framepack.o 319 | OBJS-$(CONFIG_FRAMERATE_FILTER) += vf_framerate.o 320 | OBJS-$(CONFIG_FRAMESTEP_FILTER) += vf_framestep.o 321 | OBJS-$(CONFIG_FREEZEDETECT_FILTER) += vf_freezedetect.o 322 | OBJS-$(CONFIG_FREEZEFRAMES_FILTER) += vf_freezeframes.o 323 | OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o 324 | OBJS-$(CONFIG_FSPP_FILTER) += vf_fspp.o qp_table.o 325 | OBJS-$(CONFIG_FSYNC_FILTER) += vf_fsync.o 326 | OBJS-$(CONFIG_GBLUR_FILTER) += vf_gblur.o 327 | OBJS-$(CONFIG_GBLUR_VULKAN_FILTER) += vf_gblur_vulkan.o vulkan.o vulkan_filter.o 328 | OBJS-$(CONFIG_GEQ_FILTER) += vf_geq.o 329 | OBJS-$(CONFIG_GRADFUN_FILTER) += vf_gradfun.o 330 | OBJS-$(CONFIG_GRAPHMONITOR_FILTER) += f_graphmonitor.o 331 | OBJS-$(CONFIG_GRAYWORLD_FILTER) += vf_grayworld.o 332 | OBJS-$(CONFIG_GREYEDGE_FILTER) += vf_colorconstancy.o 333 | OBJS-$(CONFIG_GUIDED_FILTER) += vf_guided.o 334 | OBJS-$(CONFIG_HALDCLUT_FILTER) += vf_lut3d.o framesync.o 335 | OBJS-$(CONFIG_HFLIP_FILTER) += vf_hflip.o 336 | OBJS-$(CONFIG_HFLIP_VULKAN_FILTER) += vf_flip_vulkan.o vulkan.o 337 | OBJS-$(CONFIG_HISTEQ_FILTER) += vf_histeq.o 338 | OBJS-$(CONFIG_HISTOGRAM_FILTER) += vf_histogram.o 339 | OBJS-$(CONFIG_HQDN3D_FILTER) += vf_hqdn3d.o 340 | OBJS-$(CONFIG_HQX_FILTER) += vf_hqx.o 341 | OBJS-$(CONFIG_HSTACK_FILTER) += vf_stack.o framesync.o 342 | OBJS-$(CONFIG_HSVHOLD_FILTER) += vf_hsvkey.o 343 | OBJS-$(CONFIG_HSVKEY_FILTER) += vf_hsvkey.o 344 | OBJS-$(CONFIG_HUE_FILTER) += vf_hue.o 345 | OBJS-$(CONFIG_HUESATURATION_FILTER) += vf_huesaturation.o 346 | OBJS-$(CONFIG_HWDOWNLOAD_FILTER) += vf_hwdownload.o 347 | OBJS-$(CONFIG_HWMAP_FILTER) += vf_hwmap.o 348 | OBJS-$(CONFIG_HWUPLOAD_CUDA_FILTER) += vf_hwupload_cuda.o 349 | OBJS-$(CONFIG_HWUPLOAD_FILTER) += vf_hwupload.o 350 | OBJS-$(CONFIG_HYSTERESIS_FILTER) += vf_hysteresis.o framesync.o 351 | OBJS-$(CONFIG_ICCDETECT_FILTER) += vf_iccdetect.o fflcms2.o 352 | OBJS-$(CONFIG_ICCGEN_FILTER) += vf_iccgen.o fflcms2.o 353 | OBJS-$(CONFIG_IDENTITY_FILTER) += vf_identity.o 354 | OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o 355 | OBJS-$(CONFIG_IL_FILTER) += vf_il.o 356 | OBJS-$(CONFIG_INFLATE_FILTER) += vf_neighbor.o 357 | OBJS-$(CONFIG_INTERLACE_FILTER) += vf_tinterlace.o 358 | OBJS-$(CONFIG_INTERLEAVE_FILTER) += f_interleave.o 359 | OBJS-$(CONFIG_KERNDEINT_FILTER) += vf_kerndeint.o 360 | OBJS-$(CONFIG_KIRSCH_FILTER) += vf_convolution.o 361 | OBJS-$(CONFIG_LAGFUN_FILTER) += vf_lagfun.o 362 | OBJS-$(CONFIG_LATENCY_FILTER) += f_latency.o 363 | OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o 364 | OBJS-$(CONFIG_LENSFUN_FILTER) += vf_lensfun.o 365 | OBJS-$(CONFIG_LIBPLACEBO_FILTER) += vf_libplacebo.o vulkan.o vulkan_filter.o 366 | OBJS-$(CONFIG_LIBVMAF_FILTER) += vf_libvmaf.o framesync.o 367 | OBJS-$(CONFIG_LIBVMAF_CUDA_FILTER) += vf_libvmaf.o framesync.o 368 | OBJS-$(CONFIG_LIMITDIFF_FILTER) += vf_limitdiff.o framesync.o 369 | OBJS-$(CONFIG_LIMITER_FILTER) += vf_limiter.o 370 | OBJS-$(CONFIG_LOOP_FILTER) += f_loop.o 371 | OBJS-$(CONFIG_LUMAKEY_FILTER) += vf_lumakey.o 372 | OBJS-$(CONFIG_LUT1D_FILTER) += vf_lut3d.o 373 | OBJS-$(CONFIG_LUT_FILTER) += vf_lut.o 374 | OBJS-$(CONFIG_LUT2_FILTER) += vf_lut2.o framesync.o 375 | OBJS-$(CONFIG_LUT3D_FILTER) += vf_lut3d.o framesync.o 376 | OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o 377 | OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o 378 | OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += vf_maskedclamp.o framesync.o 379 | OBJS-$(CONFIG_MASKEDMAX_FILTER) += vf_maskedminmax.o framesync.o 380 | OBJS-$(CONFIG_MASKEDMERGE_FILTER) += vf_maskedmerge.o framesync.o 381 | OBJS-$(CONFIG_MASKEDMIN_FILTER) += vf_maskedminmax.o framesync.o 382 | OBJS-$(CONFIG_MASKEDTHRESHOLD_FILTER) += vf_maskedthreshold.o framesync.o 383 | OBJS-$(CONFIG_MASKFUN_FILTER) += vf_maskfun.o 384 | OBJS-$(CONFIG_MCDEINT_FILTER) += vf_mcdeint.o 385 | OBJS-$(CONFIG_MEDIAN_FILTER) += vf_median.o 386 | OBJS-$(CONFIG_MERGEPLANES_FILTER) += vf_mergeplanes.o framesync.o 387 | OBJS-$(CONFIG_MESTIMATE_FILTER) += vf_mestimate.o motion_estimation.o 388 | OBJS-$(CONFIG_METADATA_FILTER) += f_metadata.o 389 | OBJS-$(CONFIG_MIDEQUALIZER_FILTER) += vf_midequalizer.o framesync.o 390 | OBJS-$(CONFIG_MINTERPOLATE_FILTER) += vf_minterpolate.o motion_estimation.o 391 | OBJS-$(CONFIG_MIX_FILTER) += vf_mix.o framesync.o 392 | OBJS-$(CONFIG_MONOCHROME_FILTER) += vf_monochrome.o 393 | OBJS-$(CONFIG_MORPHO_FILTER) += vf_morpho.o 394 | OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o 395 | OBJS-$(CONFIG_MULTIPLY_FILTER) += vf_multiply.o 396 | OBJS-$(CONFIG_NEGATE_FILTER) += vf_negate.o 397 | OBJS-$(CONFIG_NLMEANS_FILTER) += vf_nlmeans.o 398 | OBJS-$(CONFIG_NLMEANS_OPENCL_FILTER) += vf_nlmeans_opencl.o opencl.o opencl/nlmeans.o 399 | OBJS-$(CONFIG_NLMEANS_VULKAN_FILTER) += vf_nlmeans_vulkan.o vulkan.o vulkan_filter.o 400 | OBJS-$(CONFIG_NNEDI_FILTER) += vf_nnedi.o 401 | OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o 402 | OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o 403 | OBJS-$(CONFIG_NORMALIZE_FILTER) += vf_normalize.o 404 | OBJS-$(CONFIG_NULL_FILTER) += vf_null.o 405 | OBJS-$(CONFIG_OCR_FILTER) += vf_ocr.o 406 | OBJS-$(CONFIG_OCV_FILTER) += vf_libopencv.o 407 | OBJS-$(CONFIG_OSCILLOSCOPE_FILTER) += vf_datascope.o 408 | OBJS-$(CONFIG_OVERLAY_FILTER) += vf_overlay.o framesync.o 409 | OBJS-$(CONFIG_OVERLAY_CUDA_FILTER) += vf_overlay_cuda.o framesync.o vf_overlay_cuda.ptx.o \ 410 | cuda/load_helper.o 411 | OBJS-$(CONFIG_OVERLAY_OPENCL_FILTER) += vf_overlay_opencl.o opencl.o \ 412 | opencl/overlay.o framesync.o 413 | OBJS-$(CONFIG_OVERLAY_QSV_FILTER) += vf_overlay_qsv.o framesync.o 414 | OBJS-$(CONFIG_OVERLAY_VAAPI_FILTER) += vf_overlay_vaapi.o framesync.o vaapi_vpp.o 415 | OBJS-$(CONFIG_OVERLAY_VULKAN_FILTER) += vf_overlay_vulkan.o vulkan.o vulkan_filter.o 416 | OBJS-$(CONFIG_OWDENOISE_FILTER) += vf_owdenoise.o 417 | OBJS-$(CONFIG_PAD_FILTER) += vf_pad.o 418 | OBJS-$(CONFIG_PAD_OPENCL_FILTER) += vf_pad_opencl.o opencl.o opencl/pad.o 419 | OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o palette.o 420 | OBJS-$(CONFIG_PALETTEUSE_FILTER) += vf_paletteuse.o framesync.o palette.o 421 | OBJS-$(CONFIG_PERMS_FILTER) += f_perms.o 422 | OBJS-$(CONFIG_PERSPECTIVE_FILTER) += vf_perspective.o 423 | OBJS-$(CONFIG_PHASE_FILTER) += vf_phase.o 424 | OBJS-$(CONFIG_PHOTOSENSITIVITY_FILTER) += vf_photosensitivity.o 425 | OBJS-$(CONFIG_PIXDESCTEST_FILTER) += vf_pixdesctest.o 426 | OBJS-$(CONFIG_PIXELIZE_FILTER) += vf_pixelize.o 427 | OBJS-$(CONFIG_PIXSCOPE_FILTER) += vf_datascope.o 428 | OBJS-$(CONFIG_PP_FILTER) += vf_pp.o qp_table.o 429 | OBJS-$(CONFIG_PP7_FILTER) += vf_pp7.o qp_table.o 430 | OBJS-$(CONFIG_PREMULTIPLY_FILTER) += vf_premultiply.o framesync.o 431 | OBJS-$(CONFIG_PREWITT_FILTER) += vf_convolution.o 432 | OBJS-$(CONFIG_PREWITT_OPENCL_FILTER) += vf_convolution_opencl.o opencl.o \ 433 | opencl/convolution.o 434 | OBJS-$(CONFIG_PROCAMP_VAAPI_FILTER) += vf_procamp_vaapi.o vaapi_vpp.o 435 | OBJS-$(CONFIG_PROGRAM_OPENCL_FILTER) += vf_program_opencl.o opencl.o framesync.o 436 | OBJS-$(CONFIG_PSEUDOCOLOR_FILTER) += vf_pseudocolor.o 437 | OBJS-$(CONFIG_PSNR_FILTER) += vf_psnr.o framesync.o 438 | OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o 439 | OBJS-$(CONFIG_QP_FILTER) += vf_qp.o 440 | OBJS-$(CONFIG_QUIRC_FILTER) += vf_quirc.o 441 | OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o 442 | OBJS-$(CONFIG_READEIA608_FILTER) += vf_readeia608.o 443 | OBJS-$(CONFIG_READVITC_FILTER) += vf_readvitc.o 444 | OBJS-$(CONFIG_REALTIME_FILTER) += f_realtime.o 445 | OBJS-$(CONFIG_REMAP_FILTER) += vf_remap.o framesync.o 446 | OBJS-$(CONFIG_REMAP_OPENCL_FILTER) += vf_remap_opencl.o framesync.o opencl.o \ 447 | opencl/remap.o 448 | OBJS-$(CONFIG_REMOVEGRAIN_FILTER) += vf_removegrain.o 449 | OBJS-$(CONFIG_REMOVELOGO_FILTER) += bbox.o lswsutils.o lavfutils.o vf_removelogo.o 450 | OBJS-$(CONFIG_REPEATFIELDS_FILTER) += vf_repeatfields.o 451 | OBJS-$(CONFIG_REVERSE_FILTER) += f_reverse.o 452 | OBJS-$(CONFIG_RGBASHIFT_FILTER) += vf_chromashift.o 453 | OBJS-$(CONFIG_ROBERTS_FILTER) += vf_convolution.o 454 | OBJS-$(CONFIG_ROBERTS_OPENCL_FILTER) += vf_convolution_opencl.o opencl.o \ 455 | opencl/convolution.o 456 | OBJS-$(CONFIG_ROTATE_FILTER) += vf_rotate.o 457 | OBJS-$(CONFIG_SAB_FILTER) += vf_sab.o 458 | OBJS-$(CONFIG_SCALE_FILTER) += vf_scale.o scale_eval.o 459 | OBJS-$(CONFIG_SCALE_CUDA_FILTER) += vf_scale_cuda.o scale_eval.o \ 460 | vf_scale_cuda.ptx.o cuda/load_helper.o 461 | OBJS-$(CONFIG_SCALE_NPP_FILTER) += vf_scale_npp.o scale_eval.o 462 | OBJS-$(CONFIG_SCALE_QSV_FILTER) += vf_vpp_qsv.o 463 | OBJS-$(CONFIG_SCALE_VAAPI_FILTER) += vf_scale_vaapi.o scale_eval.o vaapi_vpp.o 464 | OBJS-$(CONFIG_SCALE_VT_FILTER) += vf_scale_vt.o scale_eval.o 465 | OBJS-$(CONFIG_SCALE_VULKAN_FILTER) += vf_scale_vulkan.o vulkan.o vulkan_filter.o 466 | OBJS-$(CONFIG_SCALE2REF_FILTER) += vf_scale.o scale_eval.o 467 | OBJS-$(CONFIG_SCALE2REF_NPP_FILTER) += vf_scale_npp.o scale_eval.o 468 | OBJS-$(CONFIG_SCDET_FILTER) += vf_scdet.o 469 | OBJS-$(CONFIG_SCHARR_FILTER) += vf_convolution.o 470 | OBJS-$(CONFIG_SCROLL_FILTER) += vf_scroll.o 471 | OBJS-$(CONFIG_SEGMENT_FILTER) += f_segment.o 472 | OBJS-$(CONFIG_SELECT_FILTER) += f_select.o 473 | OBJS-$(CONFIG_SELECTIVECOLOR_FILTER) += vf_selectivecolor.o 474 | OBJS-$(CONFIG_SENDCMD_FILTER) += f_sendcmd.o 475 | OBJS-$(CONFIG_SEPARATEFIELDS_FILTER) += vf_separatefields.o 476 | OBJS-$(CONFIG_SETDAR_FILTER) += vf_aspect.o 477 | OBJS-$(CONFIG_SETFIELD_FILTER) += vf_setparams.o 478 | OBJS-$(CONFIG_SETPARAMS_FILTER) += vf_setparams.o 479 | OBJS-$(CONFIG_SETPTS_FILTER) += setpts.o 480 | OBJS-$(CONFIG_SETRANGE_FILTER) += vf_setparams.o 481 | OBJS-$(CONFIG_SETSAR_FILTER) += vf_aspect.o 482 | OBJS-$(CONFIG_SETTB_FILTER) += settb.o 483 | OBJS-$(CONFIG_SHARPEN_NPP_FILTER) += vf_sharpen_npp.o 484 | OBJS-$(CONFIG_SHARPNESS_VAAPI_FILTER) += vf_misc_vaapi.o vaapi_vpp.o 485 | OBJS-$(CONFIG_SHEAR_FILTER) += vf_shear.o 486 | OBJS-$(CONFIG_SHOWINFO_FILTER) += vf_showinfo.o 487 | OBJS-$(CONFIG_SHOWPALETTE_FILTER) += vf_showpalette.o 488 | OBJS-$(CONFIG_SHUFFLEFRAMES_FILTER) += vf_shuffleframes.o 489 | OBJS-$(CONFIG_SHUFFLEPIXELS_FILTER) += vf_shufflepixels.o 490 | OBJS-$(CONFIG_SHUFFLEPLANES_FILTER) += vf_shuffleplanes.o 491 | OBJS-$(CONFIG_SIDEDATA_FILTER) += f_sidedata.o 492 | OBJS-$(CONFIG_SIGNALSTATS_FILTER) += vf_signalstats.o 493 | OBJS-$(CONFIG_SIGNATURE_FILTER) += vf_signature.o 494 | OBJS-$(CONFIG_SMARTBLUR_FILTER) += vf_smartblur.o 495 | OBJS-$(CONFIG_SOBEL_FILTER) += vf_convolution.o 496 | OBJS-$(CONFIG_SOBEL_OPENCL_FILTER) += vf_convolution_opencl.o opencl.o \ 497 | opencl/convolution.o 498 | OBJS-$(CONFIG_SITI_FILTER) += vf_siti.o 499 | OBJS-$(CONFIG_SPLIT_FILTER) += split.o 500 | OBJS-$(CONFIG_SPP_FILTER) += vf_spp.o qp_table.o 501 | OBJS-$(CONFIG_SR_FILTER) += vf_sr.o 502 | OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o framesync.o 503 | OBJS-$(CONFIG_SSIM360_FILTER) += vf_ssim360.o framesync.o 504 | OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o 505 | OBJS-$(CONFIG_STREAMSELECT_FILTER) += f_streamselect.o framesync.o 506 | OBJS-$(CONFIG_SUBTITLES_FILTER) += vf_subtitles.o 507 | OBJS-$(CONFIG_SUPER2XSAI_FILTER) += vf_super2xsai.o 508 | OBJS-$(CONFIG_SWAPRECT_FILTER) += vf_swaprect.o 509 | OBJS-$(CONFIG_SWAPUV_FILTER) += vf_swapuv.o 510 | OBJS-$(CONFIG_TBLEND_FILTER) += vf_blend.o framesync.o 511 | OBJS-$(CONFIG_TELECINE_FILTER) += vf_telecine.o 512 | OBJS-$(CONFIG_THISTOGRAM_FILTER) += vf_histogram.o 513 | OBJS-$(CONFIG_THRESHOLD_FILTER) += vf_threshold.o framesync.o 514 | OBJS-$(CONFIG_THUMBNAIL_FILTER) += vf_thumbnail.o 515 | OBJS-$(CONFIG_THUMBNAIL_CUDA_FILTER) += vf_thumbnail_cuda.o vf_thumbnail_cuda.ptx.o \ 516 | cuda/load_helper.o 517 | OBJS-$(CONFIG_TILE_FILTER) += vf_tile.o 518 | OBJS-$(CONFIG_TILTANDSHIFT_FILTER) += vf_tiltandshift.o 519 | OBJS-$(CONFIG_TINTERLACE_FILTER) += vf_tinterlace.o 520 | OBJS-$(CONFIG_TLUT2_FILTER) += vf_lut2.o framesync.o 521 | OBJS-$(CONFIG_TMEDIAN_FILTER) += vf_xmedian.o framesync.o 522 | OBJS-$(CONFIG_TMIDEQUALIZER_FILTER) += vf_tmidequalizer.o 523 | OBJS-$(CONFIG_TMIX_FILTER) += vf_mix.o framesync.o 524 | OBJS-$(CONFIG_TONEMAP_FILTER) += vf_tonemap.o 525 | OBJS-$(CONFIG_TONEMAP_OPENCL_FILTER) += vf_tonemap_opencl.o opencl.o \ 526 | opencl/tonemap.o opencl/colorspace_common.o 527 | OBJS-$(CONFIG_TONEMAP_VAAPI_FILTER) += vf_tonemap_vaapi.o vaapi_vpp.o 528 | OBJS-$(CONFIG_TPAD_FILTER) += vf_tpad.o 529 | OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o 530 | OBJS-$(CONFIG_TRANSPOSE_NPP_FILTER) += vf_transpose_npp.o 531 | OBJS-$(CONFIG_TRANSPOSE_OPENCL_FILTER) += vf_transpose_opencl.o opencl.o opencl/transpose.o 532 | OBJS-$(CONFIG_TRANSPOSE_VAAPI_FILTER) += vf_transpose_vaapi.o vaapi_vpp.o 533 | OBJS-$(CONFIG_TRANSPOSE_VT_FILTER) += vf_transpose_vt.o 534 | OBJS-$(CONFIG_TRANSPOSE_VULKAN_FILTER) += vf_transpose_vulkan.o vulkan.o vulkan_filter.o 535 | OBJS-$(CONFIG_TRIM_FILTER) += trim.o 536 | OBJS-$(CONFIG_UNPREMULTIPLY_FILTER) += vf_premultiply.o framesync.o 537 | OBJS-$(CONFIG_UNSHARP_FILTER) += vf_unsharp.o 538 | OBJS-$(CONFIG_UNSHARP_OPENCL_FILTER) += vf_unsharp_opencl.o opencl.o \ 539 | opencl/unsharp.o 540 | OBJS-$(CONFIG_UNTILE_FILTER) += vf_untile.o 541 | OBJS-$(CONFIG_USPP_FILTER) += vf_uspp.o qp_table.o 542 | OBJS-$(CONFIG_V360_FILTER) += vf_v360.o 543 | OBJS-$(CONFIG_VAGUEDENOISER_FILTER) += vf_vaguedenoiser.o 544 | OBJS-$(CONFIG_VARBLUR_FILTER) += vf_varblur.o framesync.o 545 | OBJS-$(CONFIG_VECTORSCOPE_FILTER) += vf_vectorscope.o 546 | OBJS-$(CONFIG_VFLIP_FILTER) += vf_vflip.o 547 | OBJS-$(CONFIG_VFLIP_VULKAN_FILTER) += vf_flip_vulkan.o vulkan.o 548 | OBJS-$(CONFIG_VFRDET_FILTER) += vf_vfrdet.o 549 | OBJS-$(CONFIG_VIBRANCE_FILTER) += vf_vibrance.o 550 | OBJS-$(CONFIG_VIDSTABDETECT_FILTER) += vidstabutils.o vf_vidstabdetect.o 551 | OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER) += vidstabutils.o vf_vidstabtransform.o 552 | OBJS-$(CONFIG_VIF_FILTER) += vf_vif.o framesync.o 553 | OBJS-$(CONFIG_VIGNETTE_FILTER) += vf_vignette.o 554 | OBJS-$(CONFIG_VMAFMOTION_FILTER) += vf_vmafmotion.o framesync.o 555 | OBJS-$(CONFIG_VPP_QSV_FILTER) += vf_vpp_qsv.o 556 | OBJS-$(CONFIG_VSTACK_FILTER) += vf_stack.o framesync.o 557 | OBJS-$(CONFIG_W3FDIF_FILTER) += vf_w3fdif.o 558 | OBJS-$(CONFIG_WAVEFORM_FILTER) += vf_waveform.o 559 | OBJS-$(CONFIG_WEAVE_FILTER) += vf_weave.o 560 | OBJS-$(CONFIG_XBR_FILTER) += vf_xbr.o 561 | OBJS-$(CONFIG_XCORRELATE_FILTER) += vf_convolve.o framesync.o 562 | OBJS-$(CONFIG_XFADE_FILTER) += vf_xfade.o 563 | OBJS-$(CONFIG_XFADE_OPENCL_FILTER) += vf_xfade_opencl.o opencl.o opencl/xfade.o 564 | OBJS-$(CONFIG_XFADE_VULKAN_FILTER) += vf_xfade_vulkan.o vulkan.o vulkan_filter.o 565 | OBJS-$(CONFIG_XMEDIAN_FILTER) += vf_xmedian.o framesync.o 566 | OBJS-$(CONFIG_XPSNR_FILTER) += vf_xpsnr.o framesync.o 567 | OBJS-$(CONFIG_XSTACK_FILTER) += vf_stack.o framesync.o 568 | OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o yadif_common.o 569 | OBJS-$(CONFIG_YADIF_CUDA_FILTER) += vf_yadif_cuda.o vf_yadif_cuda.ptx.o \ 570 | yadif_common.o cuda/load_helper.o 571 | OBJS-$(CONFIG_YADIF_VIDEOTOOLBOX_FILTER) += vf_yadif_videotoolbox.o \ 572 | metal/vf_yadif_videotoolbox.metallib.o \ 573 | metal/utils.o \ 574 | yadif_common.o 575 | OBJS-$(CONFIG_YAEPBLUR_FILTER) += vf_yaepblur.o 576 | OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o 577 | OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o 578 | OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o 579 | OBJS-$(CONFIG_HSTACK_VAAPI_FILTER) += vf_stack_vaapi.o framesync.o vaapi_vpp.o 580 | OBJS-$(CONFIG_VSTACK_VAAPI_FILTER) += vf_stack_vaapi.o framesync.o vaapi_vpp.o 581 | OBJS-$(CONFIG_XSTACK_VAAPI_FILTER) += vf_stack_vaapi.o framesync.o vaapi_vpp.o 582 | OBJS-$(CONFIG_HSTACK_QSV_FILTER) += vf_stack_qsv.o framesync.o 583 | OBJS-$(CONFIG_VSTACK_QSV_FILTER) += vf_stack_qsv.o framesync.o 584 | OBJS-$(CONFIG_XSTACK_QSV_FILTER) += vf_stack_qsv.o framesync.o 585 | 586 | OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o 587 | OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o 588 | OBJS-$(CONFIG_CELLAUTO_FILTER) += vsrc_cellauto.o 589 | OBJS-$(CONFIG_COLOR_FILTER) += vsrc_testsrc.o 590 | OBJS-$(CONFIG_COLORCHART_FILTER) += vsrc_testsrc.o 591 | OBJS-$(CONFIG_COLORSPECTRUM_FILTER) += vsrc_testsrc.o 592 | OBJS-$(CONFIG_COREIMAGESRC_FILTER) += vf_coreimage.o 593 | OBJS-$(CONFIG_DDAGRAB_FILTER) += vsrc_ddagrab.o 594 | OBJS-$(CONFIG_FREI0R_SRC_FILTER) += vf_frei0r.o 595 | OBJS-$(CONFIG_GRADIENTS_FILTER) += vsrc_gradients.o 596 | OBJS-$(CONFIG_HALDCLUTSRC_FILTER) += vsrc_testsrc.o 597 | OBJS-$(CONFIG_LIFE_FILTER) += vsrc_life.o 598 | OBJS-$(CONFIG_MANDELBROT_FILTER) += vsrc_mandelbrot.o 599 | OBJS-$(CONFIG_MPTESTSRC_FILTER) += vsrc_mptestsrc.o 600 | OBJS-$(CONFIG_NULLSRC_FILTER) += vsrc_testsrc.o 601 | OBJS-$(CONFIG_OPENCLSRC_FILTER) += vf_program_opencl.o opencl.o 602 | OBJS-$(CONFIG_PAL75BARS_FILTER) += vsrc_testsrc.o 603 | OBJS-$(CONFIG_PAL100BARS_FILTER) += vsrc_testsrc.o 604 | OBJS-$(CONFIG_QRENCODE_FILTER) += qrencode.o textutils.o 605 | OBJS-$(CONFIG_QRENCODESRC_FILTER) += qrencode.o textutils.o 606 | OBJS-$(CONFIG_RGBTESTSRC_FILTER) += vsrc_testsrc.o 607 | OBJS-$(CONFIG_SIERPINSKI_FILTER) += vsrc_sierpinski.o 608 | OBJS-$(CONFIG_SMPTEBARS_FILTER) += vsrc_testsrc.o 609 | OBJS-$(CONFIG_SMPTEHDBARS_FILTER) += vsrc_testsrc.o 610 | OBJS-$(CONFIG_COLOR_VULKAN_FILTER) += vsrc_testsrc_vulkan.o vulkan.o vulkan_filter.o 611 | OBJS-$(CONFIG_TESTSRC_FILTER) += vsrc_testsrc.o 612 | OBJS-$(CONFIG_TESTSRC2_FILTER) += vsrc_testsrc.o 613 | OBJS-$(CONFIG_YUVTESTSRC_FILTER) += vsrc_testsrc.o 614 | OBJS-$(CONFIG_ZONEPLATE_FILTER) += vsrc_testsrc.o 615 | 616 | OBJS-$(CONFIG_NULLSINK_FILTER) += vsink_nullsink.o 617 | 618 | # multimedia filters 619 | OBJS-$(CONFIG_A3DSCOPE_FILTER) += avf_a3dscope.o 620 | OBJS-$(CONFIG_ABITSCOPE_FILTER) += avf_abitscope.o 621 | OBJS-$(CONFIG_ADRAWGRAPH_FILTER) += f_drawgraph.o 622 | OBJS-$(CONFIG_AGRAPHMONITOR_FILTER) += f_graphmonitor.o 623 | OBJS-$(CONFIG_AHISTOGRAM_FILTER) += avf_ahistogram.o 624 | OBJS-$(CONFIG_APHASEMETER_FILTER) += avf_aphasemeter.o 625 | OBJS-$(CONFIG_AVECTORSCOPE_FILTER) += avf_avectorscope.o 626 | OBJS-$(CONFIG_CONCAT_FILTER) += avf_concat.o 627 | OBJS-$(CONFIG_SHOWCQT_FILTER) += avf_showcqt.o lswsutils.o lavfutils.o 628 | OBJS-$(CONFIG_SHOWCWT_FILTER) += avf_showcwt.o 629 | OBJS-$(CONFIG_SHOWFREQS_FILTER) += avf_showfreqs.o 630 | OBJS-$(CONFIG_SHOWSPATIAL_FILTER) += avf_showspatial.o 631 | OBJS-$(CONFIG_SHOWSPECTRUM_FILTER) += avf_showspectrum.o 632 | OBJS-$(CONFIG_SHOWSPECTRUMPIC_FILTER) += avf_showspectrum.o 633 | OBJS-$(CONFIG_SHOWVOLUME_FILTER) += avf_showvolume.o 634 | OBJS-$(CONFIG_SHOWWAVES_FILTER) += avf_showwaves.o 635 | OBJS-$(CONFIG_SHOWWAVESPIC_FILTER) += avf_showwaves.o 636 | OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER) += vaf_spectrumsynth.o 637 | 638 | # multimedia sources 639 | OBJS-$(CONFIG_AVSYNCTEST_FILTER) += src_avsynctest.o 640 | OBJS-$(CONFIG_AMOVIE_FILTER) += src_movie.o 641 | OBJS-$(CONFIG_MOVIE_FILTER) += src_movie.o 642 | 643 | # vulkan libs 644 | OBJS-$(CONFIG_LIBGLSLANG) += vulkan_glslang.o 645 | OBJS-$(CONFIG_LIBSHADERC) += vulkan_shaderc.o 646 | 647 | # Objects duplicated from other libraries for shared builds 648 | SHLIBOBJS += log2_tab.o 649 | 650 | # Windows resource file 651 | SHLIBOBJS-$(HAVE_GNU_WINDRES) += avfilterres.o 652 | 653 | SKIPHEADERS-$(CONFIG_LCMS2) += fflcms2.h 654 | SKIPHEADERS-$(CONFIG_LIBVIDSTAB) += vidstabutils.h 655 | 656 | SKIPHEADERS-$(CONFIG_QSVVPP) += qsvvpp.h stack_internal.h 657 | SKIPHEADERS-$(CONFIG_OPENCL) += opencl.h 658 | SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_vpp.h stack_internal.h 659 | SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_filter.h 660 | SKIPHEADERS-$(CONFIG_LIBSHADERC) += vulkan_spirv.h 661 | SKIPHEADERS-$(CONFIG_LIBGLSLANG) += vulkan_spirv.h 662 | 663 | TOOLS = graph2dot 664 | TESTPROGS = drawutils filtfmts formats integral 665 | 666 | TOOLS-$(CONFIG_LIBZMQ) += zmqsend 667 | 668 | clean:: 669 | $(RM) $(CLEANSUFFIXES:%=libavfilter/dnn/%) $(CLEANSUFFIXES:%=libavfilter/opencl/%) \ 670 | $(CLEANSUFFIXES:%=libavfilter/metal/%) \ 671 | $(CLEANSUFFIXES:%=libavfilter/vulkan/%) 672 | 673 | OPENCL = $(subst $(SRC_PATH)/,,$(wildcard $(SRC_PATH)/libavfilter/opencl/*.cl)) 674 | .SECONDARY: $(OPENCL:.cl=.c) 675 | libavfilter/opencl/%.c: TAG = OPENCL 676 | libavfilter/opencl/%.c: $(SRC_PATH)/libavfilter/opencl/%.cl 677 | $(M)$(SRC_PATH)/tools/source2c $< $@ 678 | 679 | VULKAN = $(subst $(SRC_PATH)/,,$(wildcard $(SRC_PATH)/libavfilter/vulkan/*.comp)) 680 | .SECONDARY: $(VULKAN:.comp=.c) 681 | libavfilter/vulkan/%.c: TAG = OPENCL 682 | libavfilter/vulkan/%.c: $(SRC_PATH)/libavfilter/vulkan/%.comp 683 | $(M)$(SRC_PATH)/tools/source2c $< $@ 684 | --------------------------------------------------------------------------------