James Almer
5fe648d04a
libswscale/swscale: initialize all dst plane pointers in sws_receive_slice()
...
Fixes valgrind warnings about use of uninitialised values.
Signed-off-by: James Almer <jamrial@gmail.com>
3 years ago
Anton Khirnov
d6fdc78e91
sws: implement slice threading
3 years ago
Anton Khirnov
42cd64c182
sws: add a new scaling API
3 years ago
Andreas Rheinhardt
2c05ee092b
avutil/internal, swresample/audioconvert: Remove cpu.h inclusions
...
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>
3 years ago
Michael Niedermayer
7874d40f10
swscale/slice: Fix wrong return on error
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years ago
Michael Niedermayer
fa1e158ef6
swscale/utils: Use full chroma interpolation for rgb4/8 and dither none
...
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>
3 years ago
Michael Niedermayer
7528532550
swscale/output: Implement dither none for yuv2rgb_write_full()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years ago
Michael Niedermayer
997f9cfc12
swscale/slice: Check slice for allocation failure
...
Fixes: null pointer dereference
Fixes: alloc_slice.mp4
Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years ago
Anton Khirnov
37c0fe49b7
sws: move updating the palette higher up
...
It does not interact in any way with the code setting up the image
pointers/strides, so it should not be intermixed with it.
3 years ago
Anton Khirnov
d6649d9a3b
sws: move initializing dither_error higher up
...
It does not interact in any way with the code setting up the image
pointers/strides, so it should not be intermixed with it.
3 years ago
Anton Khirnov
e188985598
sws: move the early return for zero-sized slices higher up
...
Place it right after the input parameter validation. There is no point
in performing any setup if the sws_scale() call won't do anything.
3 years ago
Anton Khirnov
a91e6c927e
sws: simplify setting sliceDir
3 years ago
Anton Khirnov
ff753f41dd
sws: merge handling frame start into a single block
...
Also, return an error code on failure rather than 0.
3 years ago
Anton Khirnov
1b11a324fe
sws: make checking for the start of a new frame more explicit
3 years ago
Anton Khirnov
0fb014b7bb
sws: reset sliceDir at the end of sws_scale()
...
Makes it more clear that resetting it does not interact with the scaling
code that it is currently intermixed with.
3 years ago
Anton Khirnov
1f80789bf7
sws: rename SwsContext.swscale to convert_unscaled
...
That function pointer is now used only for unscaled conversion.
3 years ago
Anton Khirnov
fe490ec165
sws: separate the calls to scaled vs unscaled conversion
...
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.
3 years ago
Anton Khirnov
0f8e0957d2
sws: do not reallocate scratch buffers for each slice
3 years ago
Anton Khirnov
2730639259
sws: group the parameters validity checks together
...
Also, fail with an error code rather than 0.
3 years ago
Anton Khirnov
c05cab34a9
sws: initialize {src,dst}Stride2 consistently with {src,dst}2
3 years ago
Anton Khirnov
d3d8e09640
sws: cosmetics
...
Reindent after previous commit, rewrap long lines.
3 years ago
Anton Khirnov
f136493d03
sws: factor out cascaded scaling
3 years ago
Anton Khirnov
a2254aedc9
sws: cosmetics
...
Reindent after previous commit, split long lines.
3 years ago
Anton Khirnov
44f12718bf
sws: factor out gamma-correct scaling
3 years ago
Anton Khirnov
e355af9be9
sws: return an error code on invalid parameters to sws_scale()
3 years ago
Anton Khirnov
21a4e48f88
sws: reindent after previous commit
3 years ago
Anton Khirnov
27acca1af0
sws: factor out updating the palette
3 years ago
Anton Khirnov
f8c21ccbfc
sws: remove unnecessary braces
...
There used to be more code inside them, but it was removed in
6de58b4903
.
3 years ago
Peter Lundblad
da0abbbb01
libswscale: Make sws_init_context thread safe.
...
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>
3 years ago
Limin Wang
43295ae6a9
swscale/swscale_unscaled: don't use the optimized bgr24toYV12 unscaled conversion when width%2
...
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
3 years ago
Anton Khirnov
85ba17f36d
Bump major versions of all libraries.
...
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
4 years ago
Andreas Rheinhardt
ea2d9b7a2e
libswscale: Remove unused deprecated functions, make used ones static
...
Deprecated in 3b905b9fe6
.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
Andreas Rheinhardt
f3c197b129
Include attributes.h directly
...
Some files currently rely on libavutil/cpu.h to include it for them;
yet said file won't use include it any more after the currently
deprecated functions are removed, so include attributes.h directly.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
4 years ago
Alan Kelly
3ce8d09244
libswscale/x86/yuv2yuvX: Removes unrolling for mmx and mmxext
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years ago
Alan Kelly
dc57762cb4
libswscale/x86/swscale: Only call ff_yuv2yuvX functions if the input size is > 0
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years ago
Michael Niedermayer
c361fa9e21
Bump minor versions after release branch
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years ago
Michael Niedermayer
c67d2a2875
Bump Versions before release/4.4 branch
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years ago
Andreas Rheinhardt
c23a5523b5
swscale/x86/swscale: Remove unused ASM constants
...
The last user of g15Mask, r15Mask, g16Mask and r16Mask was disabled
in 77a416e8aa
and finally removed in
36e8de07ed62609df45d064b56501e3084d25723; b15Mask and b16Mask were
apparently always unused (except for in_asm_used_var_warning_killer,
a function that only existed to make the compiler not optimize ASM
constants away).
w10 is unused since d604bab901
, w02
since ef423a6618
.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
Andreas Rheinhardt
aad597a93c
swscale/x86/rgb2rgb: Remove unused ASM constants
...
mask24hh etc. are unused since f099fbf5f3
,
mask32b and mask32r since 296609f859
,
mask32g since b38d487466
and mask32 since
f8a138be52
.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
Andreas Rheinhardt
49db6e4b4e
swscale/x86/yuv2rgb: Remove unused ASM constants
...
mmx_grnmask is unused since 531f97b0c3
,
the other constants since e934194b6a
.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
Chip Kerchner
e7f53d6ac9
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments
...
Add inline function for vec_xl if VSX is not supported. vec_xl intrinsic
is only available on POWER 7 or higher.
Fixes ticket #8750 .
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years ago
James Almer
1a555d3c60
swscale/x86/yuv2yuvX: use the movsxdifnidn helper macro
...
Simplifies code
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
James Almer
ebb48d85a0
swscale/x86/yuv2yuvX: use movq to load 8 bytes in all non-AVX2 functions
...
mova expands to movq on non-XMM functions
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
James Almer
d512ebbaed
swscale/x86/yuv2yuvX: use the SPLATW helper macro
...
Simplifies code
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
James Almer
c00567647e
swscale/x86/swscale: fix mix of inline and external function definitions
...
This includes removing pointless static function forward declarations.
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
James Almer
c2bf1dcace
swscale/x86/swscale: fix compilation with old yasm
...
Where AVX2 may not be supported.
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
Alan Kelly
554c2bc708
swscale: move yuv2yuvX_sse3 to yasm, unrolls main loop
...
And other small optimizations for ~20% speedup.
4 years ago
Carl Eugen Hoyos
2687070d9b
lsws/ppc/yuv2rgb: Fix transparency converting from yuv->rgb32.
...
Based on 68363b69
by Reimar Döffinger.
Fixes ticket #9077 .
4 years ago
Anton Khirnov
e15371061d
lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bump
...
They are not properly namespaced and not intended for public use.
4 years ago
Anton Khirnov
c8c2dfbc37
lavu: move LOCAL_ALIGNED from internal.h to mem_internal.h
...
That is a more appropriate place for it.
4 years ago