Paul B Mahol
562f00ed07
avcodec/utvideodec: use cached bitstream reader everywhere except on x86_32
...
From 100x real-time decoding to 138x real-time decoding for 320x240 video.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years ago
Michael Niedermayer
47b7c68ae5
avcodec/utvideodec: Set pro flag based on fourcc
...
This avoids mixing 8bit variants with pro and 10bit with non pro mode.
Fixes: out of array read
Fixes: poc_03_30.avi
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
Michael Niedermayer
7414d0bda7
avcodec/utvideodec: Check subsample factors
...
Fixes: Out of array read
Fixes: heap_poc
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
Michael Niedermayer
76cc0f0f67
avcodec/utvideodec: Add several out of array read related checks
...
Fixes: OV_decode_plane.avi
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
Michael Niedermayer
118e1b0b33
avcodec/utvideodec: Fix bytes left check in decode_frame()
...
Fixes: out of array read
Fixes: poc-2017.avi
Found-by: GwanYeong Kim <gy741.kim@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
Paul B Mahol
92b32664cd
avcodec/utvideodec: add support for UMH2, UMY2, UMH4, UMY4, UMRA, UMRG
...
These are new modes which are supposed to be more SIMD friendly.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years ago
Martin Vignali
f2e9156eb6
avcodec/utvideodec : use gradient_pred dsp in interlace decoding
7 years ago
Martin Vignali
630967ef63
avcodec/utvideodec : add SIMD (SSSE3 and AVX2) for gradient_pred
7 years ago
Martin Vignali
9e1c9633cc
avcodec/utvideodec : use dsp add_median_pred for second line
...
process start of the line in scalar, before call dsp
(dsp need align 16)
7 years ago
Martin Vignali
9c71473189
libavcodec/utvideo : simplify decode_plane
...
the func is only call with step = 1
no need to pass it in the func
7 years ago
Michael Niedermayer
850c6db97d
avcodec/utvideodec: Factor multiply out of inner loop
...
0.5% faster loop
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
5eb4701b7d
avcodec/utvideodec: bswap directly without memcpy
...
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
676a589c93
avcodec/utvideodec: enable unchecked bitreader
...
inner reader loop becomes 16% faster
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
9c604b34d4
avcodec/utvideodec: hardcode vlc bits
...
2.5% faster vlc decoding
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
1835c5e7a4
avcodec/utvideodec: Move bitstream end check out of inner loop
...
This is not needed when the buffer is large enough for the worst case of a line
2% faster vlc reading
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Paul B Mahol
4ed7c2bbc3
avcodec/utvideodec: add SIMD for restore_rgb_planes
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Paul B Mahol
3594788b71
avcodec/utvideodec: decode to GBR(A)P
...
This is actually internal utvideo format.
Allows to make use of SIMD for median prediction for rgb(a) formats,
thus speeding up decoding.
Simplifies code, eases further developement and maintenance.
Update FATE because of pixel format switch.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Luca Barbato
73fc82f343
vlc: Add header #include when the types are used
...
Do not rely on indirectly including it from bitstream.h.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
8 years ago
Paul B Mahol
b812db66af
utvideodec: Fix gradient prediction when stride does not match width
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Paul B Mahol
7c25523cc8
utvideodec: Fix decoding odd sizes with interlaced video with some formats
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Paul B Mahol
4925537004
avcodec/utvideodec: fix gradient prediction when stride does not match width
...
Fixes #6340 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Paul B Mahol
9ef21a897c
avcodec/utvideodec: fix decoding odd sizes with interlaced video with some formats
...
Fixes #6316 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Paul B Mahol
378460fef1
utvideodec: Support for gradient prediction
...
Introduced with utvideo 18.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Paul B Mahol
9227bd8ac2
utvideodec: Reuse the huffyuv add_left
...
~10% faster when simd is available.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Paul B Mahol
4f33d9d41a
utvideodec: Support ULY4 and ULH4
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Paul B Mahol
a93faf30d6
utvideodec: Support UQRA and UQRG
8 years ago
Paul B Mahol
c523095564
utvideodec: Support UQY2
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Ganesh Ajjanagadde
1fe858136b
utvideodec: Prevent possible signed overflow
...
Doing slice_end - slice_start is unsafe and can lead to undefined behavior
until slice_end has been properly sanitized.
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Paul B Mahol
faa94a576f
avcodec/utvideodec: add support for gradient prediction
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Martin Storsjö
bc25897630
utvideodec: Add a missing include
...
This was missing from 77c23704c7
, fixing building.
Signed-off-by: Martin Storsjö <martin@martin.st>
8 years ago
Derek Buitenhuis
77c23704c7
avcodec: Mark some codecs with threadsafe init as such
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
8 years ago
Derek Buitenhuis
91ed4e7196
avcodec: Mark some codecs with threadsafe init as such
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Diego Biurrun
a25dac976a
Use bitstream_init8() where appropriate
8 years ago
James Almer
47f212329e
huffyuvdsp: move functions only used by huffyuv from lossless_videodsp
...
Signed-off-by: James Almer <jamrial@gmail.com>
8 years ago
James Almer
5ac1dd8e23
lossless_videodsp: move shared functions from huffyuvdsp
...
Several codecs other than huffyuv use them.
Signed-off-by: James Almer <jamrial@gmail.com>
8 years ago
Paul B Mahol
68e5598e22
avcodec/utvideo: fix mistake using wrong arguments for left and lefttop pixel components
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Paul B Mahol
ea93052db3
avcodec/utvideodec: add SIMD support for median prediction for planar formats
...
~10% faster overall.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Alexandra Hájková
104a4289f9
utvideodec: Convert to the new bitstream reader
8 years ago
Diego Biurrun
131a85a1fe
utvideo: Change type of array stride parameters to ptrdiff_t
...
ptrdiff_t is the correct type for array strides and similar.
8 years ago
Paul B Mahol
c62cb9bf5a
avcodec/utvideodec: add support for ULY4 and ULH4
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Paul B Mahol
84efdabc94
avcodec/utvideodec: add support for UQRG and UQRA formats
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
3ecc59bc35
avcodec/utvideodec: fix multiple slices for UQY2 and other issues
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
115e63c8d6
avcodec/utvideo: add support for UQY2
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Ganesh Ajjanagadde
e86444b19d
lavc/utvideodec: prevent possible signed overflow
...
Doing slice_end - slice_start is unsafe and can lead to undefined behavior
until slice_end has been properly sanitized.
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
9 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Michael Niedermayer
0ce3a0f9d9
utvideodec: Handle slice_height being zero
...
Fixes out of array accesses.
CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Bug-Id: CVE-2014-9604
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
10 years ago
Michael Niedermayer
3881606240
avcodec/utvideodec: Fix handling of slice_height=0
...
Fixes out of array accesses
Fixes: asan_heap-oob_25bcd7e_3783_cov_3553517262_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
48efe9ec86
avcodec/utvideodec: Fix undefined behavior in shift
...
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7656c4c6e6
avcodec/utvideodec: fix assumtation that slice_height >= 1
...
Fixes out of array read
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago