Steinar H. Gunderson
2a293ec7ac
avcodec: add Newtek SpeedHQ decoder
...
This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9),
including correct decoding of the alpha channel.
1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell),
about evenly split between bitstream reader and IDCT. There is currently
no attempt at slice or frame threading, even though the format trivially
supports both.
NewTek very helpfully provided a full set of SHQ samples, as well as
source code for an SHQ2 encoder (not included) and assistance with
understanding some details of the format.
8 years ago
Paul B Mahol
14090b7050
avcodec/get_bits: add av_assert2 to get_bits_long()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Michael Niedermayer
c72fa43234
avcodec/get_bits: Fix get_sbits_long(0)
...
Fixes undefined behavior
Fixes: 640889-media
Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Clément Bœsch
6c98398b0b
lavc/get_bits: add a logging context to check_marker()
...
Based on d338abb664
9 years ago
Diego Biurrun
52567e8198
get_bits: Drop some TRACE-level debug code
...
It will not be provided by the new bit reader anyway.
9 years ago
Alexandra Hájková
ffa190d047
Move VLC and RL_VLC_ELEM structure definitions to a separate header
...
Use the newly created vlc.h directly instead of including get_bits when needed.
The VLC and RL_VLC_ELEM structures are independent from the bitreader.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years ago
Alexandra Hájková
e4b38878da
Move check_marker() from get_bits to mpeg4videodec
...
MPEG-4 is the only decoder which uses check_marker().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years ago
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Andreas Cadhalpun
62825236db
lavc: Add get_bitsz()
...
get_bit variant supporting 0-bits reads.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years ago
Kieran Kunhya
46350db737
get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL
9 years ago
Andreas Cadhalpun
713654d9d3
get_bits: add get_bitsz for reading 0-25 bits
...
This can be used to simplify code in a couple of places.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
9 years ago
Kieran Kunhya
906c0b7716
get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL
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
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Michael Niedermayer
343f34c0b8
avcodec/get_bits: print details of the location of the missing bit in check_marker()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
351d0f8b7a
get_bits: remove unused assignment
...
Bug-Id: CID 1238816
10 years ago
Diego Biurrun
b574e1e97e
get_bits: Add OPEN_READER macro variant w/o size_plus8
...
This avoids a trillion warnings from MSVC.
10 years ago
Diego Biurrun
91d305790e
get_bits: Rename HAVE_BITS_REMAINING --> BITS_AVAILABLE
...
The HAVE_ prefix is reserved for macros set by configure.
10 years ago
Michael Niedermayer
11512d70fa
avcodec/get_bits: add BITS_LEFT() for finding the bits left with an opened reader
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Timothy Gu
ea6178fff8
get_bits: remove unused assignment
...
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e6f9fc4adc
avcodec/bitstream: try to make vlc init code inherently thread safe
...
also remove spinlock, it doesnt work on AIX
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Matthew Lindner
b372f67342
avcodec: better level/index printing
11 years ago
Michael Niedermayer
6df33c4926
avcodec: include GET_RL_VLC() in trace output
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Reimar Döffinger
8cbf0827e1
Various small spelling fixes.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
11 years ago
Michael Niedermayer
44e8e82d34
avcodec/get_bits: add skip_1stop_8data_bits
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
54197c7aae
skip_bits: dont call UPDATE_CACHE
...
UPDATE_CACHE isnt needed and can cause segfaults
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
121fc05b4d
avcodec/get_bits: place volatile at the right spot
...
Should fix Ticket2825
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
43411f416f
avcodec/get_bits: init_state is used for thread sync, make it volatile
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6af8326354
avcodec/ff_init_vlc_sparse: use a spinlock for thread sync
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
48f2750de8
get_bits: add get_bits_le()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
ff130d7363
get_xbits: assert validity of the number of bits
...
similar is already done in the other get_bits() functions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Ronald S. Bultje
9918f57dcf
get_bits: Return pointer to buffer that is the result of the alignment
...
This allows more transparent mixing of get_bits and whole-byte access
without having to touch get_bits internals.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Ronald S. Bultje
fd6a021d8e
get_bits: return pointer to buffer that is the result of the alignment.
...
This allows more transparent mixing of get_bits and whole-byte access
without having to touch get_bits internals.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
4af5310d29
get_bits/put_bits: K&R formatting cosmetics
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years ago
Luca Barbato
4603ec85ed
get_bits: change the failure condition in init_get_bits
...
Too much code relies in having init_get_bits fed with a valid
buffer and set its dimension to 0.
Check for NULL buffer instead.
12 years ago
Michael Niedermayer
7980cca05c
init_get_bits: fix off by 1 error
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
153fad14e5
init_get_bits8: zero pointers & struct on error
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ac73d3a12a
init_get_bits8: check byte_size against being positive
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
e28ac6e5e2
lavc: introduce the convenience function init_get_bits8
...
Accept the buffer size in bytes and check for overflow before passing
the value in bits to init_get_bits.
12 years ago
Luca Barbato
d9cf5f5169
lavc: check for overflow in init_get_bits
...
Fix an undefined behaviour and make the function return a proper
error in case of overflow.
CC: libav-stable@libav.org
12 years ago
Michael Niedermayer
7efee140d7
get_bits: rename get_bits_longlong to get_bits64
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
41540b36a1
bitstream: add get_bits64() to support reading more than 32 bits at once
...
Also remove a duplicate function in the MPEG-TS demuxer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago
Michael Niedermayer
094a82c7de
get_bits: get_bits_long() support n=0 as the docs allow it
...
also the 0 case is indeed used in some code pathes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
f51c4bfe3f
bitstream: add get_bits_longlong() to support more than 32bits
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
5f1c3c785c
get_bits_long: fix variable type
...
This fixes a theoretical signed overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
e00215040a
get_bits: const correctness for get_bits_trace()/get_xbits_trace() arguments
12 years ago
Michael Niedermayer
6560fa390e
get_bits: check the number of bits parameter through av_assert2()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Ronald S. Bultje
b44b41633f
get_bits: add HAVE_BITS_REMAINING macro.
13 years ago
Martin Storsjö
e96b4a53df
vlc/rl: Add ff_ prefix to the nonstatic symbols
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Diego Biurrun
aaf47bcde7
Drop ALT_ prefix from BITSTREAM_READER_LE name.
...
The prefix is a historic remnant that probably meant "alternative".
Now that the A32 bitstream reader has been dropped it makes no sense anymore.
13 years ago