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
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.
8 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
Derek Buitenhuis
21f9468402
avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
...
Libav, for some reason, merged this as a public API function. This will
aid in future merges.
A define is left for backwards compat, just in case some person
used it, since it is in a public header.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
9 years ago
Michael Niedermayer
321e85e176
swscale/swscale: Add some sanity checks for srcSlice* parameters
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Clément Bœsch
e8bc642202
lavu: add AV_CEIL_RSHIFT and use it in various places
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Pedro Arthur
5bd62a1b3c
swscale: fix ticket #4881
...
When scaling only a slice of a frame the output was written always
in the first lines leaving the rest of the frame black.
9 years ago
Pedro Arthur
a8602dde5e
swscale: fix ticket #4877
9 years ago
Pedro Arthur
77367f61b3
swscale: fix ticket 4850
9 years ago
Ganesh Ajjanagadde
b4cb597900
libswscale/swscale: fix -Wunused-function
...
hyscale, hcscale are only used in old filter code, hence place
header guard to silence -Wunused-function.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago