Hao Chen
74d09b068d
swscale/la: Add yuv2rgb_lasx.c and rgb2rgb_lasx.c files
...
ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -pix_fmt rgb24 -y /dev/null -an
before: 178fps
after: 210fps
Signed-off-by: Hao Chen <chenhao@loongson.cn>
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years ago
Andreas Rheinhardt
40e6575aa3
all: Replace if (ARCH_FOO) checks by #if ARCH_FOO
...
This is more spec-compliant because it does not rely
on dead-code elimination by the compiler. Especially
MSVC has problems with this, as can be seen in
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
or
https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html
This commit does not eliminate every instance where we rely
on dead code elimination: It only tackles branching to
the initialization of arch-specific dsp code, not e.g. all
uses of CONFIG_ and HAVE_ checks. But maybe it is already
enough to compile FFmpeg with MSVC with whole-programm-optimizations
enabled (if one does not disable too many components).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2 years ago
Andreas Rheinhardt
3be6fe9a56
swscale/yuv2rgb: Silence a set-but-unused-variable warning
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years ago
Manuel Stoeckl
32329397e2
swscale: add input/output support for X2BGR10LE
...
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years ago
Manuel Stoeckl
ca594df622
swscale/yuv2rgb: fix conversion to X2RGB10
...
This resolves a problem where conversions from YUV to X2RGB10LE
would produce color values a factor 4 too small, because an 8-bit
value was placed in a 10-bit channel.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
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
Limin Wang
7c8ad72f1c
swscale/yuv2rgb: cosmetics
...
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years ago
Fei Wang
8544783280
swscale/yuv2rgb: consider x2rgb10le on big endian hardware
...
This fixed FATE fail report by filter-pixfmts* for x2rgb10le on big
endian hardware.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years ago
Fei Wang
c721b45014
swscale: Add swscale input/output support for X2RGB10LE
...
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
4 years ago
Michael Niedermayer
be3c29e379
swscale/yuv2rgb: Fix vertical dither offset with slices
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
fe17f9b956
swscale/yuv2rgb: Return a more specific error code from ff_yuv2rgb_c_init_tables()
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years ago
Carl Eugen Hoyos
9b0510a8e3
lsws/yuv2rgb: Fix yuva2rgb32 on big endian hardware.
7 years ago
Ronald S. Bultje
b3eda69490
swscale: add bt2020 yuv2rgb coefficients.
9 years ago
Ronald S. Bultje
98038e2ee0
swscale: fix bt709 yuv2rgb coefficients.
...
They were derived from incorrect values cr=0.2125 (should be cr=0.2126)
and cb=0.0721 (should be cb=0.0722).
9 years ago
Clément Bœsch
1e7a37f0a0
sws/yuv2rgb: clarify precision of coeff and offset for mmx code
...
It makes easier looking at the difference with the generic code just
below.
9 years ago
Clément Bœsch
f9987464cf
sws/yuv2rgb: avoid a few ub on signed left shifts
9 years ago
Vittorio Giovara
e9175634ec
yuv2rgb: Document the color space coefficients
...
Based on the original documentation found in mpeg2dec (1995).
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Vittorio Giovara
ff8c2c4103
yuv2rgb: Document the color space coefficients
...
Based on the original documentation found in mpeg2dec (1995).
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Michael Niedermayer
5e5f82a287
swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
b20426398c
swscale/yuv2rgb: Use av_clip_uint8()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
1dd797e3c9
swscale: check memory allocations
...
CC: libav-stable@libav.org
Bug-Id: CID 1257779
10 years ago
Michael Niedermayer
3a2bed1f9e
swscale/yuv2rgb: Fix width % 4 != 0 with bgr4_byte/rgb4_byte
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
3848512d48
swscale/yuv2rgb: Fix width % 4 != 0 with bgr4/rgb4
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
3d00ba2688
swscale/yuv2rgb: fix width % 8 != 0 and rgb/bgr8 output
...
Fixes Ticket2570
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
880e2aa236
Remove all Blackfin architecture optimizations
...
Blackfin is a painful platform to work with, no test machines are available
and the range of multimedia applications is dubious. Thus it only represents
a maintenance burden.
11 years ago
Diego Biurrun
b4dd424d96
Remove all SPARC architecture optimizations
...
SPARC is no longer being used in any multimedia-related fields and the
VIS optimizations only represent a maintenance burden.
11 years ago
Michael Niedermayer
d0a3bc1302
swscale/yuv2rgb: clip cy, avoid division by 0 with 0 contrast
...
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
46a723ec72
swscale/yuv2rgb: make sure yuvTable is set to NULL after deallocation
...
ensures no stale pointers remain
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
67e6a9f558
cosmetics: Place arch initialization calls in alphabetical order
11 years ago
Diego Biurrun
3aa682f253
swscale: consistent names for arch-specific acceleration functions
11 years ago
Diego Biurrun
c2503d9c8a
swscale: ppc: Hide arch-specific initialization details
...
Also give consistent names to init functions.
11 years ago
Diego Biurrun
a519583991
swscale: x86: Hide arch-specific initialization details
...
Also give consistent names to init functions.
11 years ago
Diego Biurrun
aa2ba8c99e
swscale: Move extern declarations for tables to swscale_internal.h
...
Also add missing ff_ prefixes where necessary.
11 years ago
Paul B Mahol
e1746d057b
swscale: RGBA64 output
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Martin Storsjö
6e293d111f
swscale: Use alpha from the right row in yuva2rgba_c
...
Every other pixel had the alpha channel taken from the wrong
row.
This fixes bug 504.
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
6c5eac9a60
swscale: Remove unnecessary backslashes
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
813784a8bf
sws: disable yuv2rgb warning for planar rgb.
...
planar rgb formats do not use the table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
12 years ago
Michael Niedermayer
6512405ce2
sws: disable yuv2rgb warning for planar rgb.
...
planar rgb formats do not use the table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
cccb45751e
yuv2rgb: fix integer overflow in fill_gv_table()
...
Fixes CID703747
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
a494792961
yuv2rgb: fix integer overflow in fill_table
...
Fixes CID703748
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
adcbb3fd8b
yuv2rgb: fix declared array sizes, so they match actuals.
...
Fixes CID733789, and others
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Ronald S. Bultje
b64a72e1b2
yuv2rgb: handle line widths that are not a multiple of 4.
...
This introduces support for width%4==2 in addition to width%4==0. For
odd widths, some more checks are needed, since the current code always
handles two luma items in a row, thus there is a possibility of an
overread by one.
12 years ago
Michael Niedermayer
22a279539e
yuv2rgb: implement 15/16bit ordered dither
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
23d8aaae46
yuv2rgb: remove assert() the codepath is not invalid
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
89d94b2182
swscale: K&R formatting cosmetics (part I)
13 years ago
Diego Biurrun
0144fe6995
Remove Sun medialib glue code.
...
It is obscure, most likely unused and not bit-exact compared to
libavcodec due to a different IDCT transform algorithm.
13 years ago
Paul B Mahol
7bab43f29c
yuv2rgb: better check if source format have alpha
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
0644cabd7a
sws: Move yuv2rgb clipping into the tables.
...
This fixes some cases where the clipping was entirely missing.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Thanks (for the comments and review) -to: Reimar, beastd, Ronald
13 years ago
Michael Niedermayer
6ed000c8e6
sws: Fix warning: ‘abase’ may be used uninitialized in this function
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago