Soft Works
58dce6f010
swscale/swscale: check SWS_PRINT_INFO flag for printing alignment warnings
...
This makes output consistent with a similar warning just few
lines above where this flag is checked in the same way.
Signed-off-by: softworkz <softworkz@hotmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
3 years ago
Michael Niedermayer
f801207568
swscale/swscale: Pass slice location into unscaled code also for dst scaling
...
Fixes: alphablend=checkerboard
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years ago
Andreas Rheinhardt
044a7c08dc
swscale/swscale: Disable x86-specific code for other arches
...
SSE2 is x86 specific, yet due to the call to av_get_cpu_flags()
compilers were unable to optimize the checks (and the call) away
on other arches.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years ago
Andreas Rheinhardt
f440c422b7
swscale/swscale: Fix races when using unaligned strides/data
...
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>
3 years ago
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
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.
4 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.
4 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.
4 years ago
Anton Khirnov
a91e6c927e
sws: simplify setting sliceDir
4 years ago
Anton Khirnov
ff753f41dd
sws: merge handling frame start into a single block
...
Also, return an error code on failure rather than 0.
4 years ago
Anton Khirnov
1b11a324fe
sws: make checking for the start of a new frame more explicit
4 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.
4 years ago
Anton Khirnov
1f80789bf7
sws: rename SwsContext.swscale to convert_unscaled
...
That function pointer is now used only for unscaled conversion.
4 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.
4 years ago
Anton Khirnov
0f8e0957d2
sws: do not reallocate scratch buffers for each slice
4 years ago
Anton Khirnov
2730639259
sws: group the parameters validity checks together
...
Also, fail with an error code rather than 0.
4 years ago
Anton Khirnov
c05cab34a9
sws: initialize {src,dst}Stride2 consistently with {src,dst}2
4 years ago
Anton Khirnov
d3d8e09640
sws: cosmetics
...
Reindent after previous commit, rewrap long lines.
4 years ago
Anton Khirnov
f136493d03
sws: factor out cascaded scaling
4 years ago
Anton Khirnov
a2254aedc9
sws: cosmetics
...
Reindent after previous commit, split long lines.
4 years ago
Anton Khirnov
44f12718bf
sws: factor out gamma-correct scaling
4 years ago
Anton Khirnov
e355af9be9
sws: return an error code on invalid parameters to sws_scale()
4 years ago
Anton Khirnov
21a4e48f88
sws: reindent after previous commit
4 years ago
Anton Khirnov
27acca1af0
sws: factor out updating the palette
4 years ago
Anton Khirnov
f8c21ccbfc
sws: remove unnecessary braces
...
There used to be more code inside them, but it was removed in
6de58b4903
.
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
Mark Reid
b4967fc71c
libswscale: add output support for AV_PIX_FMT_GBRAPF32
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Ruiling Song
4700f7d6fc
swscale/swscale: remove useless code
...
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
a6ca22c118
swscale/swscale: Fix several invalid shifts related to vChrDrop
...
Fixes: Invalid shifts
Fixes : #8166
Fixes: filter-crop_scale_vflip FATE-test
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Limin Wang
cde1d70a39
swscale/swscale: cosmetics
...
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Limin Wang
29bde4b3b6
swscale/swscale: delete unwanted assignments
...
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Martin Vignali
bdd6754648
swscale/swscale : small cosmetic
6 years ago
Martin Vignali
3af1c4ea7d
swscale : treat float input data as uint 16bpc
...
Currently float are converted to 16b uint in input part
using src depth (32 bits) in hScale16To19 and hScale16to15,
make an invalid shift for the data
So shift the value when using float input
like 16 bpc uint.
6 years ago
Lou Logan
183fd30e0f
Fix several typos
...
"apix_fmts" found by Marc Péchaud.
"speedloss" found by Mikhail V.
Signed-off-by: Lou Logan <lou@lrcd.com>
7 years ago
Michael Niedermayer
03ce71e4a1
swscale/swscale: Fix dereference of stride array before null check
...
Fixes: CID1396263
Fixes: CID1396271
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
d736b52a04
swscale: Drop is9_OR_10BPS() use, its name is not correct
...
Found-by: Luca Barbato
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Luca Barbato
2b5b1e1e9b
swscale: Rename is9_OR_10 to match what it does
...
It is used to select functions that work with 9-15bits.
8 years ago
Luca Barbato
e87a501e7d
swscale: Update bitdepth range check
...
Make sure the scaling functions for the 9-15bits are used for
9-15bits bit depths correctly.
8 years ago
Pedro Arthur
8433d953e4
swscale: fix for sliced scaling artifacts
...
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
8 years ago
Michael Niedermayer
ba7be8c083
swscale: Fix "warning: ISO C90 forbids mixed declarations and code"
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
89ec11e096
swscale/swscale: Try to fix rgb48Toxyz12() with slices
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
f580719b1a
swscale/swscale: Factor bottom to top handling
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Ronald S. Bultje
70d418c7e6
Revert "PPC64: Add versions of functions in libswscale/input.c optimized for POWER8 VSX SIMD."
...
This reverts commit 1df908f33f
. The expected
performance improvements are essentially non-existent.
9 years ago
Dan Parrot
1df908f33f
PPC64: Add versions of functions in libswscale/input.c optimized for POWER8 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>
9 years ago
Pedro Arthur
e616e9a4b8
swscale: fix ring buffer size when scaling slices of a frame
...
The ring buffer size should be able to store input lines
when there is not enough lines to output a single line.
9 years ago
Matthieu Bouron
7abc8e7ae3
swscale/arm: add ff_hscale_8_to_15_neon
9 years ago
Pedro Arthur
6de58b4903
swscale: cleanup unused code
...
Removed previous swscale code under '#ifndef NEW_FILTER'
and removed unused fields of SwsContext
9 years ago
Clément Bœsch
263eb76bdf
sws/aarch64: add ff_hscale_8_to_15_neon
...
./ffmpeg -nostats -f lavfi -i testsrc2=4k:d=2 -vf bench=start,scale=1024x1024,bench=stop -f null -
before: t:0.489726 avg:0.489883 max:0.491852 min:0.489482
after: t:0.256515 avg:0.256458 max:0.256999 min:0.253755
9 years ago