summaryrefslogtreecommitdiff
path: root/libswscale/utils.c
Commit message (Collapse)AuthorAge
* lib*/version: Move library version functions into files of their ownAndreas Rheinhardt2022-05-10
| | | | | | | This avoids having to rebuild big files every time FFMPEG_VERSION changes (which it does with every commit). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libswscale: Split version.hMartin Storsjö2022-03-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* swscale: Take the destination range into account for yuv->rgb->yuv conversionsMartin Storsjö2022-02-25
| | | | | | | | | | | | The range parameters need to be set up before calling sws_init_context (which selects which fastpaths can be used; this gets called by sws_getContext); solely passing them via sws_setColorspaceDetails isn't enough. This fixes producing full range YUV range output when doing YUV->YUV conversions between different YUV color spaces. Signed-off-by: Martin Storsjö <martin@martin.st>
* libswscale: Re-factor ff_shuffle_filter_coefficients.Alan Kelly2022-02-17
| | | | | | Make the code more readable and follow the style guide. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswscale: Check and propagate memory allocation errors from ↵Alan Kelly2022-02-17
| | | | | | ff_shuffle_filter_coefficients. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: add P210/P410/P216/P416 outputrcombs2021-12-22
|
* libswscale: Test AV_CPU_FLAG_SLOW_GATHER for hscale functions.Alan Kelly2021-12-21
| | | | | This is instead of EXTERNAL_AVX2_FAST so that the avx2 hscale functions are only used where they are faster.
* libswscale: Adds ff_hscale8to15_4_avx2 and ff_hscale8to15_X4_avx2 for all ↵Alan Kelly2021-12-15
| | | | | | | | | | filter sizes. Fixes so that fate under 64 bit Windows passes. These functions replace all ff_hscale8to15_*_ssse3 when avx2 is available. Signed-off-by: James Almer <jamrial@gmail.com>
* swscale: add P210/P410/P216/P416 inputrcombs2021-11-28
|
* swscale/utils: Improve return codes of sws_setColorspaceDetails()Michael Niedermayer2021-10-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/utils: Set all threads to the same colorspace even on failureMichael Niedermayer2021-10-24
| | | | | | Fixes: ./ffplay dav.y4m -vf "scale=hd1080:threads=4" Found-by: Paul Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: add input/output support for X2BGR10LEManuel Stoeckl2021-09-26
| | | | | Signed-off-by: Manuel Stoeckl <code@mstoeckl.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale/swscale: Fix races when using unaligned strides/dataAndreas Rheinhardt2021-09-19
| | | | | | | | | | | | | | | | | | | | | | | | In this case the current code tries to warn once; to do so, it uses ordinary static ints to store whether the warning has already been emitted. This is both a data race (and therefore undefined behaviour) as well as a race condition, because it is really possible for multiple threads to be the one thread to emit the warning. This is actually common since the introduction of the new multithreaded scaling API. This commit fixes this by using atomic integers for the state; furthermore, these are not static anymore, but rather contained in the user-facing SwsContext (i.e. the parent SwsContext in case of slice-threading). Given that these atomic variables are not intended for synchronization at all (but only for atomicity, i.e. only to output the warning once), the atomic operations use memory_order_relaxed. This affected the nv12, nv21, yuv420, yuv420p10, yuv422, yuv422p10 and yuv444 filter-overlay FATE-tests. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libswscale/options: Add parent_log_context_offset to AVClassAndreas Rheinhardt2021-09-19
| | | | | | | | This allows to associate log messages from slice contexts to the user-visible SwsContext. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* sws: implement slice threadingAnton Khirnov2021-09-06
|
* sws: add a new scaling APIAnton Khirnov2021-09-06
|
* swscale/utils: Use full chroma interpolation for rgb4/8 and dither noneMichael Niedermayer2021-07-09
| | | | | | | | Dither none is only implemented in full chroma interpolation for these rgb formats Its also a obscure choice (producing less nice images) that implementing it in the other code-paths makes no sense Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* sws: rename SwsContext.swscale to convert_unscaledAnton Khirnov2021-07-03
| | | | That function pointer is now used only for unscaled conversion.
* sws: separate the calls to scaled vs unscaled conversionAnton Khirnov2021-07-03
| | | | | | | | | | Call the scaler function directly rather than through a function pointer. Drop the now-unused return value from ff_getSwsFunc() and rename the function to reflect its new role. This will be useful in the following commits, where it will become important that the amount of output is different for scaled vs unscaled case.
* sws: do not reallocate scratch buffers for each sliceAnton Khirnov2021-07-03
|
* libswscale: Make sws_init_context thread safe.Peter Lundblad2021-07-01
| | | | | | | Call ff_sws_rgb2rgb_init via ff_thread_once instead of checking one of the variables it updates. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswscale: Remove unused deprecated functions, make used ones staticAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in 3b905b9fe611efb3282aa4c5c659e1870d91a83b. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/utils: override forced-zero formats back to full rangeJan Ekström2020-10-11
| | | | | | | | Fixes vf_scale outputting RGB AVFrames with limited range flagged in case either input or output specifically sets the range. This is the reverse of the logic utilized for RGB and PAL8 content in sws_setColorspaceDetails.
* swscale/utils: split range override check into its own functionJan Ekström2020-10-11
|
* swscale: do not drop half of bits from 16bit bayer formatsPaul B Mahol2020-08-08
|
* swscale/utils: return better error code from initFilter()Limin Wang2020-06-14
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* swscale/utils: reindentLimin Wang2020-06-14
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* swscale/utils: remove FF_ALLOC_ARRAY_OR_GOTO macrosLimin Wang2020-06-13
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* swscale: Add swscale input/output support for X2RGB10LEFei Wang2020-06-12
| | | | Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* libswscale: fix for floating point formats, require full chromaMark Reid2020-05-12
| | | | | | upon more floating point testing, looks like I missed adding this bit. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswscale: add output support for AV_PIX_FMT_GBRAPF32Mark Reid2020-05-05
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswscale: add input support AV_PIX_FMT_GBRAPF32Mark Reid2020-05-05
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: Add swscale input support for Y210LELinjie Fu2020-02-24
| | | | | | | | Add swscale input support for Y210LE, output support and fate test could be added later if there is requirement for software CSC to this packed format. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* libswscale/utils.c: Fix bug #8255Gautam Ramakrishnan2020-02-09
| | | | | | | | | | Bug #8255 points out a double free error in libwscale/utils.c file. The double free is because the pointer to cascaded_context of an sw_context is not set to NULL after freeing it. When the sw_context is later freed, sws_freeContext is called on the cascaded_context, causing a double free. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Silence "string-plus-int" warning shown by clang.Carl Eugen Hoyos2020-01-06
| | | | libswscale/utils.c:89:42: warning: adding 'unsigned long' to a string does not append to the string [-Wstring-plus-int]
* swscale/utils: remove access of AV_PIX_FMT_NBZhao Zhili2019-12-31
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/utils: Fix invalid left shifts of negative numbersAndreas Rheinhardt2019-09-28
| | | | | | | | Affected the FATE-tests vsynth_lena-dv-411, vsynth1-dv-411, vsynth2-dv-411 and hevc-paramchange-yuv420p.yuv420p10. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: Add support for NV24 and NV42Philip Langdale2019-05-12
| | | | | | | | | | | The implementation is pretty straight-forward. Most of the existing NV12 codepaths work regardless of subsampling and are re-used as is. Where necessary I wrote the slightly different NV24 versions. Finally, the one thing that confused me for a long time was the asm specific x86 path that did an explicit exclusion check for NV12. I replaced that with a semi-planar check and also updated the equivalent PPC code, which Lauri kindly checked.
* swscale : add support for YUVA444P12 and YUVA422P12Martin Vignali2018-11-24
|
* swscale/utils : simplify unscaled initial test for float pixfmtMartin Vignali2018-10-24
|
* swscale : add YA16 LE/BE outputMartin Vignali2018-10-18
|
* libswscale: Adds conversions from/to float gray format.Sergey Lavrushkin2018-08-14
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: add gray14 supportPaul B Mahol2018-05-05
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* swscale: Add p016 output support and generalise yuv420p1x to p010Philip Langdale2018-03-02
| | | | | | | | To make the best use of existing code, I generalised the wrapper that currently does yuv420p10 to p010 to support any mixture of input and output sizes between 10 and 16 bits. This had the side effect of yielding a working code path for all yuv420p1x formats to p01x.
* Merge commit '29ccc641b17afad058a5c24071ea827865a8b3a9'James Almer2017-11-11
|\ | | | | | | | | | | | | * commit '29ccc641b17afad058a5c24071ea827865a8b3a9': build: Drop check for sys/mman.h in favor of mmap() check Merged-by: James Almer <jamrial@gmail.com>
| * build: Drop check for sys/mman.h in favor of mmap() checkDiego Biurrun2017-10-10
| | | | | | | | We already rely on just mmap() in other places.
| * swscale: Do not expand a macro with 'defined' in itDerek Buitenhuis2017-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: libswscale/utils.c:1632:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] #if USE_MMAP ^ libswscale/utils.c:1577:49: note: expanded from macro 'USE_MMAP' #define USE_MMAP (HAVE_MMAP && HAVE_MPROTECT && defined MAP_ANONYMOUS) ^ Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * build: Add feature test macros for glibc 2.19+Diego Biurrun2017-07-10
| | | | | | | | | | | | | | glibc introduced _DEFAULT_SOURCE in version 2.19 to replace _BSD_SOURCE and _SVID_SOURCE, which were deprecated in version 2.20. Add _DEFAULT_SOURCE where the latter two are used to be forwards-compatible and avoid warnings about the use of deprecated definitions.
| * swscale: Add gbrap10 outputMichael Niedermayer2017-04-15
| | | | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>