summaryrefslogtreecommitdiff
path: root/libswscale
Commit message (Collapse)AuthorAge
* lsws/ppc/yuv2rgb: Fix transparency converting from yuv->rgb32.Carl Eugen Hoyos2021-01-24
| | | | | | Based on 68363b69 by Reimar Döffinger. Fixes ticket #9077.
* lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bumpAnton Khirnov2021-01-01
| | | | They are not properly namespaced and not intended for public use.
* lavu: move LOCAL_ALIGNED from internal.h to mem_internal.hAnton Khirnov2021-01-01
| | | | That is a more appropriate place for it.
* libswscale: avoid UB nullptr-with-offset.Jeremy Leconte2020-12-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/rgb2rgb_template: use shuffle macro on big-endian archesAndriy Gelman2020-12-12
| | | | | | | | | | | | | | Fixes fate-qtrle-32bit on big-endian. The macro does a simple byte swap on uint8 array without any casts, so it's valid on big-endian arches. The mentioned test was failing because the byteswap function shuffle_bytes_3210_c() is used in the pixel format conversion (argb->bgra). Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* lsws/x86/yuv2rgb: Fix compilation with mmxext or ssse3 disabled.Carl Eugen Hoyos2020-11-14
| | | | Fixes ticket #8986.
* swscale/x86/yuv2rgb: fix crashes when loading alpha from unaligned buffersMarton Balint2020-11-02
| | | | | | | | | Regression since fc6a5883d6af8cae0e96af84dda0ad74b360a084 on SSSE3 enabled CPUs. Fixes ticket #8955. Signed-off-by: Marton Balint <cus@passwd.hu>
* 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
|
* libswcale/input: use more accurate planer rgb16 yuv conversionsMark Reid2020-10-06
| | | | | | | These conversion appears to be exhibiting the same rounding error as the rgbf32 formats where. I seperated the rounding value from the 16 and 128 offsets, I think it makes it a little more clear. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswcale/input: use more accurate rgbf32 yuv conversionsMark Reid2020-10-02
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswscale/tests: add floatimg_cmp testMark Reid2020-10-02
| | | | | | | | | | changes since v1: - made into fate test - fixed c90 warnings - tests more intermediate formats - tested on BE mips too Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/x86/output: add missing AVX2 support preprocessor wrappersJames Almer2020-08-20
| | | | | | Fixes compilation with old yasm Signed-off-by: James Almer <jamrial@gmail.com>
* swscale: do not drop half of bits from 16bit bayer formatsPaul B Mahol2020-08-08
|
* swscale/yuv2rgb: cosmeticsLimin Wang2020-07-25
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* swscale/yuv2rgb: consider x2rgb10le on big endian hardwareFei Wang2020-07-20
| | | | | | | This fixed FATE fail report by filter-pixfmts* for x2rgb10le on big endian hardware. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/tests/swscale: use 1 for indicating errosMichael Niedermayer2020-07-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/tests/swscale: Initialize res to a non random error codeMichael Niedermayer2020-07-14
| | | | | | | | | Regression since: 3adffab073bc59af39dddd035168ac72bc9ffde3 -1 is consistent what other error paths return Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/tests/swscale: Fix incorrect return code checkMichael Niedermayer2020-07-14
| | | | | | | Regression since: 3adffab073bc59af39dddd035168ac72bc9ffde3 Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* x86/yuv2rgb: fix crashes when storing data on unaligned buffersJames Almer2020-07-14
| | | | | | | | | Regression since fc6a5883d6af8cae0e96af84dda0ad74b360a084 on SSSE3 enabled CPUs. Fixes ticket #8747 Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/tests: check return value of sws_scaleLynne2020-07-09
|
* aarch64/yuv2rgb_neon: fix return valueLynne2020-07-09
| | | | | | We return 0 for this particular architecture but should instead be returning the number of lines. Fixes users who check the return value matches what they expect.
* swscale: cosmetic fixesNelson Gomez2020-06-14
| | | | Signed-off-by: Nelson Gomez <nelson.gomez@microsoft.com>
* swscale/x86/output: add AVX2 version of yuv2nv12cXNelson Gomez2020-06-14
| | | | | | | | | | 256 bits is just wide enough to fit all the operands needed to vectorize the software implementation, but AVX2 is needed to for a couple of instructions like cross-lane permutation. Output is bit-for-bit identical to C. Signed-off-by: Nelson Gomez <nelson.gomez@microsoft.com>
* swscale: make yuv2interleavedX more asm-friendlyNelson Gomez2020-06-14
| | | | | | | | | Extracting information from SwsContext in assembly is difficult, and rearranging SwsContext just for asm access didn't look good. These functions only need a couple of fields from it anyway, so just make them parameters in their own right. Signed-off-by: Nelson Gomez <nelson.gomez@microsoft.com>
* 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>
* Bump minor versions after branching 4.3Michael Niedermayer2020-06-08
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump minor versions to separate 4.3 from masterMichael Niedermayer2020-06-08
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: aarch64: Add a NEON implementation of interleaveBytesMartin Storsjö2020-05-15
| | | | | | | | | | | | This allows speeding up format conversions from yuv420 to nv12. Cortex A53 A72 A73 interleave_bytes_c: 86077.5 51433.0 66972.0 interleave_bytes_neon: 19701.7 23019.2 15859.2 interleave_bytes_aligned_c: 86603.0 52017.2 67484.2 interleave_bytes_aligned_neon: 9061.0 7623.0 6309.0 Signed-off-by: Martin Storsjö <martin@martin.st>
* swscale: arm: fix NEON hscale initJosh de Kock2020-05-15
| | | | | | | | | | | | | | | | | The NEON hscale function only supports X8 filter sizes and should only be selected when these are being used. At the moment filterAlign is set to 8 but in the future when extra NEON assembly for specific sizes is added they will need to have checks here too. The immediate usecase for this change is making the hscale checkasm test easier and without NEON specific edge-cases (x86 already has these guards). This applies the same fix from 718c8f9aa59751bb490e2688acf2b5cb68fd5ad1 on the 32 bit arm version of the function, fixing fate-checkasm-sw_scale there. Signed-off-by: Martin Storsjö <martin@martin.st>
* swscale: fix NEON hscale initJosh de Kock2020-05-15
| | | | | | | | | | | | | The NEON hscale function only supports X8 filter sizes and should only be selected when these are being used. At the moment filterAlign is set to 8 but in the future when extra NEON assembly for specific sizes is added they will need to have checks here too. The immediate usecase for this change is making the hscale checkasm test easier and without NEON specific edge-cases (x86 already has these guards). Signed-off-by: Josh de Kock <josh@itanimul.li>
* 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/vscale: Increase type strictnessAndreas Rheinhardt2020-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | libswscale/vscale.c makes extensive use of function pointers and in doing so it converts these function pointers to and from a pointer to void. Yet this is actually against the C standard: C90 only guarantees that one can convert a pointer to any incomplete type or object type to void* and back with the result comparing equal to the original which makes pointers to void generic pointers to incomplete or object type. Yet C90 lacks a generic function pointer type. C99 additionally guarantees that a pointer to a function of one type may be converted to a pointer to a function of another type with the result and the original comparing equal when converting back. This makes any function pointer type a generic function pointer type. Yet even this does not make pointers to void generic function pointers. Both GCC and Clang emit warnings for this when in pedantic mode. This commit fixes this by using a union that can hold one member of any of the required function pointer types to store the function pointer. This works even for C90. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* swscale: aarch64: Don't clobber callee-saved registers v8-v15Martin Storsjö2020-04-21
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* swscale: aarch64: Avoid using the x18 registerMartin Storsjö2020-04-20
| | | | | | | | | | The x18 is a reserved platform register on Darwin and Windows. x8/w8 seems to be unused in this function though (and same about x10 and x14), so there's really no reason to use x18 here - just change the uses of x18/w18 into x8/w8 instead without any further rewrites. Signed-off-by: Martin Storsjö <martin@martin.st>
* swscale/yuv2rgb: Fix vertical dither offset with slicesMichael Niedermayer2020-04-12
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Fix integer overflow in yuv2rgb_write_full() with out of ↵Michael Niedermayer2020-04-04
| | | | | | | | | | range input Fixes: signed integer overflow: 1169365504 + 981452800 cannot be represented in type 'int' Fixes: ticket8293 Found-by: Suhwan Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Fix integer overflow in alpha computation in ↵Michael Niedermayer2020-04-04
| | | | | | | | | | yuv2gbrp16_full_X_c() Fixes: signed integer overflow: 524280 * 4432 cannot be represented in type 'int' Fixes: ticket8322 Found-by: Suhwan Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/swscale: remove useless codeRuiling Song2020-04-03
| | | | | Signed-off-by: Ruiling Song <ruiling.song@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lsws/input: Do not change transparency range.Carl Eugen Hoyos2020-03-11
| | | | Fixes ticket #8509.
* libswscale/x86/yuv2rgb: Fix Segmentation Fault when load unaligned dataTing Fu2020-02-26
| | | | | | Fixes ticket #8532 Signed-off-by: Ting Fu <ting.fu@intel.com>
* 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/x86/yuv2rgb: add ssse3 versionTing Fu2020-02-10
| | | | | | | | | | Tested using this command: /ffmpeg -pix_fmt yuv420p -s 1920*1080 -i ArashRawYuv420.yuv \ -vcodec rawvideo -s 1920*1080 -pix_fmt rgb24 -f null /dev/null The fps increase from 389 to 640 on Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz Signed-off-by: Ting Fu <ting.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>
* libswscale/x86/yuv2rgb: Change inline assembly into nasm codeTing Fu2020-02-05
| | | | | | | | The original inline assembly and nasm code have the same fps when called by command. NASM code almost has no impact on the perfromance. Signed-off-by: Ting Fu <ting.fu@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>