Michael Niedermayer
bfc22f364d
swscale/yuv2rgb: Use 64bit for brightness computation
...
This will not overflow for normal values
Fixes: CID1500280 Unintentional integer overflow
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-05-28 03:48:06 +02:00
Andreas Rheinhardt
790f793844
avutil/common: Don't auto-include mem.h
...
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.
Keep it for external users in order to not cause breakages.
Also improve the other headers a bit while just at it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Niklas Haas
736284e7b9
swscale/yuv2rgb: fix sws_getCoefficients for colorspace=0
...
The documentation states that invalid entries default to SWS_CS_DEFAULT.
A value of 0 is not a valid SWS_CS_*, yet the code incorrectly
hard-codes it to BT.709 coefficients instead of SWS_CS_DEFAULT.
2023-11-09 12:53:35 +01:00
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>
2022-09-10 22:56:38 +02:00
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>
2022-06-15 04:56:37 +02:00
Andreas Rheinhardt
3be6fe9a56
swscale/yuv2rgb: Silence a set-but-unused-variable warning
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-03 16:10:51 +01:00
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>
2021-09-26 16:26:10 +02:00
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>
2021-09-26 16:26:10 +02:00
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>
2021-07-22 14:33:45 +02:00
Limin Wang
7c8ad72f1c
swscale/yuv2rgb: cosmetics
...
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-07-25 10:20:42 +08:00
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>
2020-07-20 21:00:00 +02:00
Fei Wang
c721b45014
swscale: Add swscale input/output support for X2RGB10LE
...
Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2020-06-12 17:56:15 +01:00
Michael Niedermayer
be3c29e379
swscale/yuv2rgb: Fix vertical dither offset with slices
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-04-12 16:36:47 +02:00
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>
2019-01-01 21:11:47 +01:00
Carl Eugen Hoyos
9b0510a8e3
lsws/yuv2rgb: Fix yuva2rgb32 on big endian hardware.
2017-10-29 14:53:57 +01:00
Ronald S. Bultje
b3eda69490
swscale: add bt2020 yuv2rgb coefficients.
2016-04-01 15:39:48 -04:00
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).
2016-04-01 15:39:47 -04:00
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.
2016-02-27 11:13:26 +01:00
Clément Bœsch
f9987464cf
sws/yuv2rgb: avoid a few ub on signed left shifts
2016-02-27 11:13:26 +01:00
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>
2016-01-19 23:30:36 +01:00
Michael Niedermayer
5e5f82a287
swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-14 15:46:55 +01:00
Michael Niedermayer
b20426398c
swscale/yuv2rgb: Use av_clip_uint8()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 14:44:47 +01:00
Michael Niedermayer
90de28befd
Merge commit '1dd797e3c9f179f957316a0becbec048b42df8aa'
...
* commit '1dd797e3c9f179f957316a0becbec048b42df8aa':
swscale: check memory allocations
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 21:44:50 +01:00
Vittorio Giovara
1dd797e3c9
swscale: check memory allocations
...
CC: libav-stable@libav.org
Bug-Id: CID 1257779
2015-01-05 15:35:39 +01:00
Michael Niedermayer
3a2bed1f9e
swscale/yuv2rgb: Fix width % 4 != 0 with bgr4_byte/rgb4_byte
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 00:33:21 +01:00
Michael Niedermayer
3848512d48
swscale/yuv2rgb: Fix width % 4 != 0 with bgr4/rgb4
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 00:32:53 +01:00
Michael Niedermayer
3d00ba2688
swscale/yuv2rgb: fix width % 8 != 0 and rgb/bgr8 output
...
Fixes Ticket2570
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-24 00:23:49 +01:00
Michael Niedermayer
b55d3bbeed
Merge commit '880e2aa23645ed9871c66ee1cbd00f93c72d2d73'
...
* commit '880e2aa23645ed9871c66ee1cbd00f93c72d2d73':
Remove all Blackfin architecture optimizations
Conflicts:
libavcodec/bfin/dsputil.S
libavcodec/bfin/dsputil_init.c
libavcodec/bfin/fdct_bfin.S
libavcodec/bfin/hpel_pixels_no_rnd.S
libavcodec/bfin/hpeldsp_init.c
libavcodec/bfin/idct_bfin.S
libavcodec/bfin/mathops.h
libavcodec/bfin/pixels.S
libavcodec/bfin/pixels.h
libavcodec/bfin/vp3dsp.S
libavcodec/bfin/vp3dsp_init.c
libavutil/bfin/asm.h
libavutil/bfin/attributes.h
libswscale/bfin/internal_bfin.S
libswscale/bfin/swscale_bfin.c
libswscale/bfin/yuv2rgb_bfin.c
libswscale/swscale_internal.h
libswscale/version.h
If someone wants to maintain blackfin support in FFmpeg, please contact
ffmpeg-devel@ffmpeg.org
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 19:38:01 +02:00
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.
2014-06-02 08:41:47 -07:00
Michael Niedermayer
3fc2362aef
Merge commit 'b4dd424d96f09f9bafb88e47f37df65dc4529143'
...
* commit 'b4dd424d96f09f9bafb88e47f37df65dc4529143':
Remove all SPARC architecture optimizations
Conflicts:
Makefile
configure
libavcodec/sparc/dsputil_vis.c
libavcodec/sparc/dsputil_vis.h
libavcodec/sparc/hpeldsp_vis.c
libavcodec/sparc/simple_idct_vis.c
libavcodec/sparc/vis.h
libswscale/sparc/yuv2rgb_vis.c
libswscale/swscale_internal.h
If someone wants to maintain these (or other) SPARC optimizations, please
contact me or ffmpeg-devel.
I am happy to revert this removial if theres someone considering to
maintain this code.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-13 22:35:47 +01:00
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.
2014-03-13 05:50:28 -07:00
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>
2013-10-17 14:02:43 +02:00
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>
2013-09-16 22:47:21 +02:00
Michael Niedermayer
f896f92337
Merge remote-tracking branch 'qatar/master'
...
* qatar/master:
cosmetics: Place arch initialization calls in alphabetical order
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 16:15:54 +02:00
Michael Niedermayer
c5cec9a42b
Merge commit '3aa682f25324d811ec284edc808eb71a46eae950'
...
* commit '3aa682f25324d811ec284edc808eb71a46eae950':
swscale: consistent names for arch-specific acceleration functions
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 15:41:05 +02:00
Michael Niedermayer
5ff1b588eb
Merge commit 'c2503d9c8ab42ea55922e9f5a10c8bfbbbfeaf19'
...
* commit 'c2503d9c8ab42ea55922e9f5a10c8bfbbbfeaf19':
swscale: ppc: Hide arch-specific initialization details
Conflicts:
libswscale/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 15:10:09 +02:00
Michael Niedermayer
db6b389c7f
Merge commit 'a519583991c38d38503ab08357716513facc5725'
...
* commit 'a519583991c38d38503ab08357716513facc5725':
swscale: x86: Hide arch-specific initialization details
Conflicts:
libswscale/x86/Makefile
libswscale/x86/swscale.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-29 14:42:34 +02:00
Diego Biurrun
67e6a9f558
cosmetics: Place arch initialization calls in alphabetical order
2013-08-29 11:24:14 +02:00
Diego Biurrun
3aa682f253
swscale: consistent names for arch-specific acceleration functions
2013-08-29 10:23:52 +02:00
Diego Biurrun
c2503d9c8a
swscale: ppc: Hide arch-specific initialization details
...
Also give consistent names to init functions.
2013-08-29 10:23:41 +02:00
Diego Biurrun
a519583991
swscale: x86: Hide arch-specific initialization details
...
Also give consistent names to init functions.
2013-08-28 23:59:24 +02:00
Michael Niedermayer
c14fc4585c
Merge commit 'aa2ba8c99e5708884a56aea9c1d96e014866f8a3'
...
* commit 'aa2ba8c99e5708884a56aea9c1d96e014866f8a3':
swscale: Move extern declarations for tables to swscale_internal.h
Conflicts:
libswscale/output.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
libswscale/yuv2rgb.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-16 12:56:48 +02:00
Diego Biurrun
aa2ba8c99e
swscale: Move extern declarations for tables to swscale_internal.h
...
Also add missing ff_ prefixes where necessary.
2013-08-15 14:38:03 +02:00
Paul B Mahol
e1746d057b
swscale: RGBA64 output
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-12 21:47:19 +02:00
Michael Niedermayer
b3e9fd1fe5
Merge remote-tracking branch 'qatar/master'
...
* qatar/master:
swscale: Use alpha from the right row in yuva2rgba_c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 21:48:03 +02:00
Michael Niedermayer
050b48f397
Merge commit '6c5eac9a603a91a707d030d96ba97e2ef6b3ce50'
...
* commit '6c5eac9a603a91a707d030d96ba97e2ef6b3ce50':
swscale: Remove unnecessary backslashes
jpeg2000: Fix uninitialized data errors pointed out by valgrind/memcheck
Conflicts:
libavcodec/jpeg2000dec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 21:23:29 +02:00
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>
2013-05-06 17:40:25 +03:00
Martin Storsjö
6c5eac9a60
swscale: Remove unnecessary backslashes
...
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-05-06 17:40:19 +03:00
Michael Niedermayer
02b3ac87f8
Merge remote-tracking branch 'qatar/master'
...
* qatar/master:
sws: disable yuv2rgb warning for planar rgb.
Conflicts:
libswscale/yuv2rgb.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-10 14:17:06 +01:00
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>
2013-02-09 14:32:50 -05:00