summaryrefslogtreecommitdiff
path: root/libswscale/swscale_internal.h
Commit message (Collapse)AuthorAge
* swscale/input: add rgbaf16 input supportTimo Rothenpieler2022-08-19
| | | | | | This is by no means perfect, since at least ddagrab will return scRGB data with values outside of 0.0f to 1.0f for HDR values. Its primary purpose is to be able to work with the format at all.
* swscale: add opaque parameter to input functionsTimo Rothenpieler2022-08-19
|
* Remove unnecessary libavutil/(avutil|common|internal).h inclusionsAndreas Rheinhardt2022-02-24
| | | | | | | | | | Some of these were made possible by moving several common macros to libavutil/macros.h. While just at it, also improve the other headers a bit. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove obsolete version.h inclusionsAndreas Rheinhardt2022-02-24
| | | | | | | Forgotten in e7bd47e657bbf9e1ce9915e93bc80cb1a29fb7f3. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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: introduce isSwappedChromarcombs2022-01-04
|
* swscale: introduce isDataInHighBitsrcombs2022-01-04
|
* 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/swscale_internal: Avoid unsigned for slice parametersMichael Niedermayer2021-09-30
| | | | | | | | Mixing unsigned and signed often leads to unexpected arithmetic results. Fixes: out of array write Found-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* 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
|
* 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
|
* 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: do not drop half of bits from 16bit bayer formatsPaul B Mahol2020-08-08
|
* 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>
* libswscale: add output support for AV_PIX_FMT_GBRAPF32Mark Reid2020-05-05
| | | | 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>
* swscale/ppc: Move VSX-using code to its own fileLauri Kasanen2018-12-04
| | | | | | | | Passes fate on LE (with "lavc/jrevdct: Avoid an aliasing violation" applied). Signed-off-by: Lauri Kasanen <cand@gmx.com> Tested-by: Michael Kostylev on BE Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libswscale: Adds conversions from/to float gray format.Sergey Lavrushkin2018-08-14
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPALwm42018-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PSEUDOPAL pixel formats are not paletted, but carried a palette with the intention of allowing code to treat unpaletted formats as paletted. The palette simply mapped the byte values to the resulting RGB values, making it some sort of LUT for RGB conversion. It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8, GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap formats. The last one, GRAY8, is more common, but its treatment is grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming from typical Y video planes was not mapped to the correct RGB values. This cannot be fixed, because AVFrame.color_range can be freely changed at runtime, and there is nothing to ensure the pseudo palette is updated. Also, nothing actually used the PSEUDOPAL palette data, except xwdenc (trivially changed in the previous commit). All other code had to treat it as a special case, just to ignore or to propagate palette data. In conclusion, this was just a very strange old mechnaism that has no real justification to exist anymore (although it may have been nice and useful in the past). Now it's an artifact that makes the API harder to use: API users who allocate their own pixel data have to be aware that they need to allocate the palette, or FFmpeg will crash on them in _some_ situations. On top of this, there was no API to allocate the pseuo palette outside of av_frame_get_buffer(). This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes the pseudo palette optional. Nothing accesses it anymore, though if it's set, it's propagated. It's still allocated and initialized for compatibility with API users that rely on this feature. But new API users do not need to allocate it. This was an explicit goal of this patch. Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0. Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition, FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation functions manually changed to not allocating a palette.
* swscale: Introduce a helper to identify semi-planar formatsPhilip Langdale2018-03-03
| | | | | This cleans up the ever-more-unreadable list of semi-planar exclusions for selecting the planar copy wrapper.
* Merge commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013'Clément Bœsch2017-04-26
|\ | | | | | | | | | | | | * commit 'ea7ee4b4e381e0fa731458de0cbf740430eeb013': ppc: Centralize compiler-specific altivec.h #include handling in one place Merged-by: Clément Bœsch <u@pkh.me>
| * ppc: Centralize compiler-specific altivec.h #include handling in one placeDiego Biurrun2016-12-14
| | | | | | | | Also move #includes into canonical order where appropriate.
| * swscale: Add GRAY12Luca Barbato2016-11-07
| |
| * swscale: Rename is9_OR_10 to match what it doesLuca Barbato2016-09-27
| | | | | | | | It is used to select functions that work with 9-15bits.
| * swscale: Update bitdepth range checkLuca Barbato2016-09-27
| | | | | | | | | | Make sure the scaling functions for the 9-15bits are used for 9-15bits bit depths correctly.
| * swscale: Kill non-compiling disabled cruftDiego Biurrun2016-08-17
| |
| * swscale: Rename sws_context_class to ff_sws_context_classAndreas Cadhalpun2016-07-16
| | | | | | | | | | | | | | It is an internal swscale symbol and thus should not be exported. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | sws: make is{RGB,BGR}inInt functionsClément Bœsch2017-03-24
| |
* | swscale: cosmetics in is{RGB,BGR}inIntClément Bœsch2017-03-20
| | | | | | | | Reduce diff with Libav.
* | swscale: remove unused is{RGB,BGR}inBytesClément Bœsch2017-03-20
| |
* | swscale: use a (more correct) function for isPackedClément Bœsch2017-03-20
| |
* | swscale: use a function for isAnyRGBClément Bœsch2017-03-20
| |
* | swscale: use a function for isBayerClément Bœsch2017-03-20
| |
* | swscale: use a function for isGrayClément Bœsch2017-03-20
| |
* | lsws: Add GRAY10 conversion.Carl Eugen Hoyos2016-11-14
| | | | | | | | Based on 19be5fb7 by Luca Barbato.
* | swscale: Add GRAY12Luca Barbato2016-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>
* | Revert "PPC64: Add versions of functions in libswscale/input.c optimized for ↵Ronald S. Bultje2016-07-11
| | | | | | | | | | | | | | POWER8 VSX SIMD." This reverts commit 1df908f33f658979b32599489ca6f1a39821013c. The expected performance improvements are essentially non-existent.
* | PPC64: Add versions of functions in libswscale/input.c optimized for POWER8 ↵Dan Parrot2016-06-30
| | | | | | | | | | | | | | | | | | | | VSX SIMD. This patch addresses Trac ticket #5570. The optimized functions are in file libswscale/ppc/input_vsx.c. Each optimized function name is a concatenation of the corresponding name in libswscale/input.c with suffix _vsx. 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>
* | swscale/arm: add ff_hscale_8_to_15_neonMatthieu Bouron2016-04-09
| |
* | swscale: add bt2020 yuv2rgb coefficients.Ronald S. Bultje2016-04-01
| |
* | swscale: cleanup unused codePedro Arthur2016-03-31
| | | | | | | | | | Removed previous swscale code under '#ifndef NEW_FILTER' and removed unused fields of SwsContext