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
Vittorio Giovara
7c6eb0a1b7
lavc: AV-prefix all codec flags
...
Convert doxygen to multiline and express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Andreas Cadhalpun
9a345802ed
huffyuvdec: validate image size
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
10 years ago
Michael Niedermayer
2f1de5ca13
avcodec/huffyuvdec: apply vertical filter in steps of 1 line for interlaced BGRA
...
Fixes out of array read
Fixes: signal_sigsegv_3287332_2301_cov_2994954934_huffyuv.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Lukasz Marek
c9d39fc8c6
lavc/huffyuvdec: fix mem leak in case of init failure
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
10 years ago
Reimar Döffinger
3dbf569032
huffyuvdec: avoid large stack use.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
10 years ago
Christophe Gisquet
f75baa6c9b
huffyuvdec: decode the last odd sample
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
331b1f7d81
huffyuvdec: fix old (v1) rgba
...
Commit deadcf5e
misplaced a hunk.
Fixes ticket #3877 .
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Michael Niedermayer
ba47d519e5
avcodec/huffyuvdec: fix overread checks
...
Fixes: ffvhuff_f.avi
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a7153444df
huffyuvdec: check width size for yuv422p
...
Avoid out of array accesses.
CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Diego Biurrun
d0393d79bc
huffyuv: Check and propagate function return values
...
Bug-Id: CVE-2013-0868
inspired by a patch from Michael Niedermayer <michaelni@gmx.at>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Diego Biurrun <diego@biurrun.de>
CC: libav-stable@libav.org
11 years ago
Diego Biurrun
6234058148
huffyuv: Return proper error codes
11 years ago
Diego Biurrun
3160bdc7f7
huffyuv: Use avpriv_report_missing_feature() where appropriate
11 years ago
Diego Biurrun
b7616f5716
huffyuv: Eliminate some pointless casts
11 years ago
Diego Biurrun
c065f4a0c6
huffyuv: K&R formatting cosmetics
11 years ago
Diego Biurrun
c67b449beb
dsputil: Split bswap*_buf() off into a separate context
11 years ago
Michael Niedermayer
5439959ef0
avcodec/huffyuvdec: do not leave alpha values uninitialized
...
fixes fate failure under valgrind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
20c7baf832
avcodec/huffyuvdec: Fix fill value for truncated bitstreams
...
Found-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
f6577bd9cf
huffyuvdec: use unsafe bitstream reader
...
The reader reads in chunks of 11 bits at most, and at most 3 times. The unsafe
reader therefore may read 6 chunks instead of 1 in worst case, ie 8 bytes,
which is within the padding tolerance.
The reader ends up being ~10% faster. Cumulative effect of unsafe reading and
code block swapping on 3 sequences is for 1 thread, decoding time goes from
23.3s to 19.0s.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
29f427c239
huffyuvdec: remove somewhat deprecated code
...
The old code was reserving the 0xFFFF entry to represent an inexisting
entry/codeword. These entries are now detected through their length
being <= 0. As this entry is often used for the residuals (-1,-1), which
should be among the most frequent, it is particularly important to not
reserve it.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e9c477059d
avcodec/huffyuvdec: assume vlcs can be 32 instead of 31 bits max
...
This should avoid a division as well
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
9dc1791977
huffyuvdec: swap code blocks
...
The effect is not really deterministic, as it seems to be a combination
on x86_64 of fewer registers used, different jump offsets and, for all
archs, of likely branches.
Speedup is around 15%.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
7eb5b20a87
huffyuvdec: trick for plane decoding <= 14bits
...
Refactor the code to minimize code duplication.
Before:
130870 decicycles in g, 1048139 runs, 437 skips
10bits: 9.048
12bits: 10.733
After:
126960 decicycles in g, 1048136 runs, 440 skips
10bits: 8.642
12bits: 9.656
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
0d632b35a0
huffyuvdec: remove superfluous check in BGR code
...
Before: 154861 decicycles
After: 152912 decicycles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
6848325acb
huffyuvdec: remove superfluous check
...
An invalid entry already has the property of having a negative number
of bits, so remove the check on the reserved value, and rearrange the
code as a consequence.
346800 decicycles in 422, 262079 runs, 65 skips
168197 decicycles in gray, 262077 runs, 67 skips
Overall time: 7.878s
319076 decicycles in 422, 262096 runs, 48 skips
159875 decicycles in gray, 262057 runs, 87 skips
Overall time: 7.394s
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
a37020402a
huffyuvdec: trick for plane decoding, 8bits
...
10496 -> 9105 cycles.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
35dae62204
huffyuvdec: clean up macro
...
It's no longer used inside another specific macro, so rename it.
Also remove duplicated definition and realign code.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
deadcf5e71
huffyuvdec: implement trick for BGR
...
Before:
179436 decicycles in rgb, 32735 runs, 33 skips
Stripped object size: 23188
After:
154861 decicycles in rgb, 32738 runs, 30 skips
Stripped object size: 22736
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
11b4703813
huffyuvdec: implement trick
...
When the joint table does not contain a valid entry, the decoding restarts
from scratch. By implementing the trick of jumping to the 2nd level of the
individual table (and inlining the whole), a speed improvement of 5-10%
is possible.
On a 1000-frames YUV4:2:0 video, before:
362851 decicycles in 422, 262094 runs, 50 skips
182488 decicycles in gray, 262087 runs, 57 skips
Object size: 23584
Overall time: 8.377
After:
346800 decicycles in 422, 262079 runs, 65 skips
168197 decicycles in gray, 262077 runs, 67 skips
Object size: 23188
Overall time: 7.878
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7b4c46050e
rename add_hfyu_left_prediction_int16 to add_hfyu_left_pred_int16
...
This makes the naming more consistent with the 8bit variant
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
550ae6c02f
rename add_hfyu_median_prediction_int16 to add_hfyu_median_pred_int16
...
This makes the naming more consistent with the 8bit variant
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
25e6310a3e
huffyuv: change left prediction access in BGRA
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
0d439fbede
dsputil: Split off HuffYUV decoding bits into their own context
...
Also shorten HuffYUV context member names to avoid clutter.
11 years ago
Diego Biurrun
2f02bbcca0
build: Let the ffvhuff decoder/encoder depend on the huffyuv decoder/encoder
...
Almost all of the code is shared so there is little point in
enabling one decoder/encoder without the other.
11 years ago
Michael Niedermayer
9bb1af8f36
avcodec/huffyuvdec: use RGB0 for 24bit rgb output instead of BGRA
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
469de4f583
avcodec/huffyuvdec: use the correct height field
...
Fixes Ticket3395
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6369766f01
avcodec/huffyuv: support gbrp9/10/12/14
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7cf8918b0d
avcodec/huffyuv: update years in copyright
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e6c0da70fc
avcodec/huffyuvdec: optimize >8bps VLC reading
...
97479 -> 54891 decicycles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
53167ecfdb
avcodec/huffyuv: support AV_PIX_FMT_YUV(A)4XYP16 and GRAY16
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e6d1c66d74
avcodec/x86/lossless_videodsp: disable median optimizations for 16bps
...
They only support upto 15bps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
13c33c8e1f
Move add_hfyu_median_prediction_int16() to losslessviddsp
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
883570e6b7
Move add_hfyu_left_prediction_int16 to losslessviddsp
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
f70d7eb20c
Move add/diff_int16 to lossless_videodsp
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
da0684820a
avcodec/dsputil/huffyuv: move diff int16 and add int16 to dsputil
...
This also fixes masking the bits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2fd39642c9
avcodec/huffyuv: fix median prediction for >8bps
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3d87927959
avcodec/huffyuv: add YUVA{420,422,444}P{9,10} support
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ef0282125c
avcodec/huffyuv: add YUV{420,422,444}P{9,10,12,14} support
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago