summaryrefslogtreecommitdiff
path: root/libswscale/output.c
Commit message (Collapse)AuthorAge
* swscale: add GBRAP14 format supportPaul B Mahol2023-09-28
|
* swscale/output: Bias 16bps output calculations to improve non overflowing ↵Michael Niedermayer2022-11-04
| | | | | | | range for GBRP16/GBRPF32 Fixes: integer overflow Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Bias 16bps output calculations to improve non overflowing rangeMichael Niedermayer2022-11-04
| | | | | | | | | Fixes: integer overflow Fixes: ./ffmpeg -f rawvideo -video_size 66x64 -pixel_format yuva420p10le -i ~/videos/overflow_input_w66h64.yuva420p10le -filter_complex "scale=flags=bicubic+full_chroma_int+full_chroma_inp+bitexact+accurate_rnd:in_color_matrix=bt2020:out_color_matrix=bt2020:in_range=full:out_range=full,format=rgba64[out]" -pixel_format rgba64 -map '[out]' -y overflow_w66h64.png Found-by: Drew Dunne <asdunne@google.com> Tested-by: Drew Dunne <asdunne@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Don't call av_pix_fmt_desc_get() in a loopAndreas Rheinhardt2022-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, libswscale/output.c used a macro to write an output pixel which involved a call to av_pix_fmt_desc_get() to find out whether the input pixel format is BE or LE despite this being known at compile-time (there are templates per pixfmt). Even worse, these calls are made in a loop, so that e.g. there are eight calls to av_pix_fmt_desc_get() for every pixel processed in yuv2rgba64_X_c_template() for 64bit RGB formats. This commit modifies these macros to ensure that isBE() is evaluated at compile-time. This saved 41184B of .text for me (GCC 11.2, -O3). Of course, it also improved performance. E.g. ffmpeg_g -f lavfi -i testsrc2,format=yuva420p -pix_fmt rgba64le \ -threads 1 -t 1:00 -f null - (which uses yuv2rgba64le_X_c, which is an invocation of yuv2rgba64_X_c_template() mentioned above), performance improved from 95589 to 41387 decicycles for one call to yuv2packedX; for the be variant the numbers went down from 76087 to 43024 decicycles. Reviewed-by: Anton Khirnov <anton@khirnov.net> Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale/output: add support for Y210LE and Y212LEPhilip Langdale2022-09-10
|
* swscale/output: add support for XV30LEPhilip Langdale2022-09-10
|
* swscale/output: add support for XV36LEPhilip Langdale2022-09-10
|
* swscale/output: add support for P012Philip Langdale2022-09-10
| | | | This generalises the existing P010 support.
* libswscale: add support for VUYX formatPhilip Langdale2022-08-25
| | | | | | As we already have support for VUYA, I figured I should do the small amount of work to support VUYX as well. That means a little refactoring to share code.
* swscale/output: fix reading chroma values when generating vuya outputJames Almer2022-08-08
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/output: add VUYA output supportJames Almer2022-08-07
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* swscale/output: use isSwappedChromarcombs2022-01-04
|
* swscale/output: use isSemiPlanarYUV for NV12/21/24/42 casercombs2022-01-04
|
* swscale/output: use isDataInHighBits for 10-bit casercombs2022-01-04
| | | | | This code will need fleshing-out (probably templating) if we ever add e.g. a P012 format.
* swscale/output: use isSemiPlanarYUV for 16-bit casercombs2022-01-04
|
* swscale/output: template-ize yuv2nv12cX 10-bit and 16-bit casesrcombs2022-01-04
| | | | | | Fixes incorrect big-endian output introduced in 88d804b7ffa20caab2e8e2809da974c41f7fd8fc Avoids making the filter-time BE check more expensive
* swscale: add P210/P410/P216/P416 outputrcombs2021-12-22
|
* 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>
* avutil/internal, swresample/audioconvert: Remove cpu.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | | | | These inclusions are not necessary, as cpu.h is already included wherever it is needed (via direct inclusion or via the arch-specific headers). Also remove other unnecessary cpu.h inclusions from ordinary non-headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale/output: Implement dither none for yuv2rgb_write_full()Michael Niedermayer2021-07-09
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* 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.
* swscale: cosmetic fixesNelson Gomez2020-06-14
| | | | 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: Add swscale input/output support for X2RGB10LEFei Wang2020-06-12
| | | | Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* libswscale: add output support for AV_PIX_FMT_GBRAPF32Mark Reid2020-05-05
| | | | 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/output: Fix several invalid shifts in yuv2rgb_full_1_c_template()Michael Niedermayer2020-01-22
| | | | | | | | Fixes: Invalid shifts Fixes: #8320 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Avoid 64bit in Alpha in yuv2ya16_X_c_template()Michael Niedermayer2019-10-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Correct Alpha in yuv2ya16_X_c_template()Michael Niedermayer2019-10-16
| | | | | | Untested, no testcase Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Implement Luma computation from yuv2ya16_X_c_template() ↵Michael Niedermayer2019-10-16
| | | | | | | | | without 64bit This also reverts 21838cad2fc44023ad85e35d5c677e2f8d29a0ef The revert is in this commit to avoid 2 fate updates Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: fix signed integer overflow for ya16Paul B Mahol2019-09-26
| | | | Fixes #7666.
* swscale/output: fix some code indentationsLinjie Fu2019-09-06
| | | | | Signed-off-by: Linjie Fu <linjie.fu@intel.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: Remove duplicated codeLauri Kasanen2019-03-27
| | | | In this function, the exact same clamping happens both in the if and unconditionally.
* 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 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.
* swscale: fix gbrap16 alpha channel issuesJames Cowgill2017-08-05
| | | | | | | | | | | | | Fixes filter-pixfmts-scale test failing on big-endian systems due to alpSrc not being cast to (const int32_t**). Also fixes distortions in the output alpha channel values by copying the alpha channel code from the rgba64 case found elsewhere in output.c. Fixes ticket 6555. Signed-off-by: James Cowgill <James.Cowgill@imgtec.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: add gbr(a)p16 output supportPaul B Mahol2016-12-01
|
* swscale: Add GBRAP10 outputMichael Niedermayer2016-11-10
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: Add the GBRAP12 outputLuca Barbato2016-11-10
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/output: Fix alpha shift in yuv2gbrp_full_X_c()Michael Niedermayer2016-11-10
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: Drop is9_OR_10BPS() use, its name is not correctMichael Niedermayer2016-11-10
| | | | | Found-by: Luca Barbato Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale: add support for P010LE/BE outputTimo Rothenpieler2016-08-31
|
* swscale/output: Fix rounding offset in yuv2gbrp_full_X_c()Michael Niedermayer2016-08-23
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\ | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * Drop pointless assert.h #includesDiego Biurrun2016-05-03
| |
* | swscale: cleanup unused codePedro Arthur2016-03-31
| | | | | | | | | | Removed previous swscale code under '#ifndef NEW_FILTER' and removed unused fields of SwsContext