summaryrefslogtreecommitdiff
path: root/libswscale
Commit message (Collapse)AuthorAge
* 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.
* arm: swscale: Only compile the rgb2yuv asm if .dn aliases are supportedMartin Storsjö2018-03-31
| | | | | | | | | | | | | | | Vanilla clang supports altmacro since clang 5.0, and thus doesn't require gas-preprocessor for building the arm assembly any longer. However, the built-in assembler doesn't support .dn directives. This readds checks that were removed in d7320ca3ed10f0d, when the last usage of .dn directives within libav were removed. Alternatively, the assembly could be rewritten to not use the .dn directive, making it available to clang users. Signed-off-by: Martin Storsjö <martin@martin.st>
* swscale/rgb2rgb : cosmetic, move shuffle_bytes func declarationMartin Vignali2018-03-24
| | | | | move shuffle_bytes_1230, 3012, 3210 with the other shuffle_byte declaration
* swscale/rgb : add X86 SIMD (SSSE3), for shuffle_bytes_1230, ↵Martin Vignali2018-03-24
| | | | shuffle_bytes_3012, shuffle_bytes_3210
* swscale/rgb : move shuffle func shuffle_bytes_1230, shuffle_bytes_3012, ↵Martin Vignali2018-03-24
| | | | shuffle_bytes_3210 in order to add SIMD
* swscale/rgb : add X86 SIMD (SSSE3) for shuffle_bytes_2103 and shuffle_bytes_0321Martin Vignali2018-03-24
|
* 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.
* 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.
* Fix missing used attribute for inline assembly variablesThomas Köppe2017-11-13
| | | | | | | | | | | | | Variables used in inline assembly need to be marked with attribute((used)). Static constants already were, via the define of DECLARE_ASM_CONST. But DECLARE_ALIGNED does not add this attribute, and some of the variables defined with it are const only used in inline assembly, and therefore appeared dead. This change adds a macro DECLARE_ASM_ALIGNED that marks variables as used. This change makes FFMPEG work with Clang's ThinLTO. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* 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.
* | Merge commit '0fd0d4fd0a518e30ff23972828ad7cf7f35cfb9d'James Almer2017-10-30
|\| | | | | | | | | | | | | * commit '0fd0d4fd0a518e30ff23972828ad7cf7f35cfb9d': swscale-test: const correctness Merged-by: James Almer <jamrial@gmail.com>
| * swscale-test: const correctnessDiego Biurrun2017-04-24
| |
| * swscale: Convert the check check_image_pointers helper to a macroLuca Barbato2017-04-15
| | | | | | | | Avoid warnings about types mismatch and make the code a little simpler.
| * swscale: Do not shift negative values directlyLuca Barbato2017-04-15
| | | | | | | | | | It is undefined in C as reported: warning: shifting a negative signed value is undefined
| * swscale: Add gbrap10 outputMichael Niedermayer2017-04-15
| | | | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * swscale: Add input support for gbrap10 pixel formatPaul B Mahol2017-04-13
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lsws/yuv2rgb: Fix yuva2rgb32 on big endian hardware.Carl Eugen Hoyos2017-10-29
| |
* | swscale: use dithering in DITHER_COPY only if not set -sws_dither noneMateusz2017-10-25
| | | | | | | | | | | | | | | | | | | | | | | | This patch uses dithering in DITHER_COPY macro only if it was not used option '-sws_dither none'. With option '-sws_dither none' it uses downshift. For human eye dithering is OK, for video codecs not necessarily. If user don't want to use dithering, we should respect that. Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | swscale: more accurate DITHER_COPY macro for full and limited rangeMateusz2017-10-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '07a2b155949eb267cdfc7805f42c7b3375f9c7c5'James Almer2017-10-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '07a2b155949eb267cdfc7805f42c7b3375f9c7c5': Bump major versions of all libraries A few API deprecated ~2 years ago or more are also postponed here for varying reasons. FF_API_LOWRES: Since this functionality depends on AVStream->codec, i figure the two can be removed at the same time in the next bump or so. FF_API_AVCTX_TIMEBASE: Couldn't get this one to work. Not just libavcodec but apparently also libavformat and ffmpeg.c expect AVCodecContext->time_base to be set for decoding. Upon removal some tests report a different generic stream time base (like 1/25), and others lose packet duration values. I guess it's somehow tied to the AVStream->codec clusterfuck. It can be dealt with alongside FF_API_LAVF_AVCTX in the next bump. FF_API_OLD_FILTER_OPTS_ERROR: This one is meant to remain after FF_API_OLD_FILTER_OPTS is removed. Its purpose is displaying the corrected command line using the new syntax as a suggestion as part of the error message. Merged-by: James Almer <jamrial@gmail.com>
| * Bump major versions of all librariesVittorio Giovara2017-03-23
| | | | | | | | | | | | | | | | | | This disables everything that was deprecated at least 18 months ago. Readjust the minimum API version as needed, postponing any API-incompatible changes until the next bump. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '994c4bc10751e39c7ed9f67ffd0c0dea5223daf2'James Almer2017-10-21
|\| | | | | | | | | | | | | | | | | * commit '994c4bc10751e39c7ed9f67ffd0c0dea5223daf2': x86util: Port all macros to cpuflags See d5f8a642f6eb1c6e305c41dabddd0fd36ffb3f77 Merged-by: James Almer <jamrial@gmail.com>
| * x86util: Port all macros to cpuflagsDiego Biurrun2017-03-14
| | | | | | | | | | | | Also do some small cosmetic changes: Drop pointless _MMX suffix from ABSD2 macro name, drop pointless check for MMX support, we always assume MMX is available in our SIMD code, fix spelling.
| * build: Generalize yasm/nasm-related variable namesDiego Biurrun2017-03-01
| | | | | | | | None of them are specific to the YASM assembler.
| * swscale-test: const correctness for pointer variableDiego Biurrun2017-01-24
| | | | | | | | | | libswscale/swscale-test.c:369:20: warning: passing argument 2 of ‘sws_scale’ from incompatible pointer type [-Wincompatible-pointer-types] libswscale/swscale.h:207:5: note: expected ‘const uint8_t * const* {aka const unsigned char * const*}’ but argument is of type ‘uint8_t ** {aka unsigned char **}’
* | Bump version for master after 3.4 branchpointMichael Niedermayer2017-10-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Bump minor versions for branching 3.4Michael Niedermayer2017-10-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Fix several typosLou Logan2017-09-21
| | | | | | | | | | | | | | "apix_fmts" found by Marc Péchaud. "speedloss" found by Mikhail V. Signed-off-by: Lou Logan <lou@lrcd.com>
* | utils: Do not expand a macro with 'defined' in itDerek Buitenhuis2017-08-25
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | lsws/rgb2rgb: Add unscaled 48bit to 64bit rgb conversion.Carl Eugen Hoyos2017-08-24
| | | | | | | | | | | | Based on b4befca2 and 6b7849e6 by Paul B Mahol. Fixes ticket #6608.
* | libswscale: add gray9 supportPaul B Mahol2017-08-07
| |
* | 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>
* | sws/tests/pixdesc_query: fix use of free() instead of av_free()Clément Bœsch2017-07-30
| | | | | | | | Fix CID 1415949
* | sws/tests/pixdesc_query: replace rgb based pix fmts with endianess agnostic ↵Clément Bœsch2017-07-30
| | | | | | | | | | | | names Fixes ticket #6554
* | sws/tests/pixdesc_query: sort pixel formatsClément Bœsch2017-07-30
| |
* | sws/tests/pixdesc_query: save every pix fmts in a listClément Bœsch2017-07-30
| | | | | | | | This will be required for the next commit.
* | build: Generalize yasm/nasm-related variable namesDiego Biurrun2017-06-21
| | | | | | | | | | | | | | | | None of them are specific to the YASM assembler. (Cherry-picked from libav commit 39e208f4d4756367c7cd2d581847e0c1b8a429c1) Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '92db5083077a8b0f8e1050507671b456fd155125'James Almer2017-05-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '92db5083077a8b0f8e1050507671b456fd155125': build: Generate pkg-config files from Make and not from configure build: Store library version numbers in .version files Includes cherry-picked commits 8a34f3659371680ca523aecfd9098c28f0f809eb and ee164727dd64c199b87118917e674b17c25e0da3 to fix issues. Changes were also made to retain support for raise_major and build_suffix. Reviewed-by: ubitux Merged-by: James Almer <jamrial@gmail.com>
| * build: Generate pkg-config files from Make and not from configureDiego Biurrun2016-12-22
| | | | | | | | | | | | | | | | This moves work from the configure to the Make stage where it can be parallelized and ensures that pkgconfig files are updated when library versions change. Bug-Id: 449
* | Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'Clément Bœsch2017-05-03
|\| | | | | | | | | | | | | | | | | * commit '11a9320de54759340531177c9f2b1e31e6112cc2': build: Move build-system-related helper files to a separate subdirectory "ffbuild" directory name is used instead of "avbuild". Merged-by: Clément Bœsch <u@pkh.me>
* | libswscale/tests/swscale: Fix uninitialized variablesMichael Niedermayer2017-04-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | 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
| |
* | lsws/utils: Make gray10 and gray12 full-scale like gray8 and gray16.Carl Eugen Hoyos2017-04-12
| |
* | Bump versions for master after 3.3Michael Niedermayer2017-04-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Bump minor for 3.3Michael Niedermayer2017-04-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>