Clément Bœsch
549045254c
Fix all -Wformat warnings raised by DJGPP
8 years ago
Clément Bœsch
cb763a9ba8
lavc/bitstream: remove unused atomic.h include
8 years ago
Steinar H. Gunderson
eaff1aa09e
avcodec: move bitswap_32() into a header file
...
Allows more codecs than mpeg12video to make use of it.
8 years ago
Michael Niedermayer
7ca2a23aaa
avcodec/bitstream: Document the values supported for *_size in ff_init_vlc_sparse()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
8f1d18a91b
avcodec/bitstream: assert that *_size in ff_init_vlc_sparse() is valid
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Diego Biurrun
c454dfcff9
Use ISO C printf conversion specifiers where appropriate
8 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
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Lou Logan
06eef96b69
fix some a/an typos
...
Signed-off-by: Lou Logan <lou@lrcd.com>
9 years ago
Reimar Döffinger
5f5e6033cd
bitstream.c: improve init_vlc error messages.
...
Makes it far easier to spot the issue if e.g.
caused by a typo in the code table.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
9 years ago
Ganesh Ajjanagadde
e11e32686f
avcodec/bitstream: replace qsort with AV_QSORT
...
Commit 3a0a2f33a6
claims large performance
advantages for AV_QSORT over libc's qsort. The reason is that I suspect
that libc's qsort (at least on non LTO builds, like the typical FFmpeg config)
can't inline the comparison callback:
https://stackoverflow.com/questions/5290695/is-there-any-way-a-c-c-compiler-can-inline-a-c-callback-function .
AV_QSORT has two things going for it:
1. The guaranteed inlining of qsort itself. This yields a negligible
boost that may be ignored.
2. The more serious possibility of potentially allowing the comparison
function to be inlined - this is likely responsible for the large boosts
reported.
There is a comment explaining that this is a place that could use some
performance improvement. Thus AV_QSORT is used to achieve that.
Benchmarks deemed unnecessary due to existing claims about AV_QSORT.
Tested with FATE.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
Andreas Cadhalpun
28efeb6502
doc: avoid incorrect phrase 'allows to'
...
Also fix typo found by Lou Logan:
Sacrifying -> Sacrificing
Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
10 years ago
Andreas Cadhalpun
ed0b1db640
doc: fix spelling errors
...
Neccessary -> Necessary
formated -> formatted
thee -> the
eventhough -> even though
seperately -> separately
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
10 years ago
Michael Niedermayer
291ad5cc9c
avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Diego Biurrun
7f9f771eac
avcodec: Don't anonymously typedef structs
10 years ago
Michael Niedermayer
d266ecff4b
avcodec/bitstream: remove trivial assert
...
Fixed CID1224273
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a2de7b1bd5
avcodec/bitstream: document the double volatile
...
Suggested-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
329898aa45
avcodec/bitstream: try to workaround internal compiler bug in gcc 4.2
...
gcc 4.2 seems not maintained anymore so theres no option besides
just working around it.
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
Michael Niedermayer
f7f96cf4bc
avcodec/bitstream: fill invalid vlc tables entries as last pass instead of first
...
This avoids writing entries twice
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
600cbf3672
avcodec/bitstream: zero vlc tables on allocation
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e20e854ca0
vcodec/bitstream: use av_malloc_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
622d463000
avcodec/bitstream: assert that no integer overflow happened when writing codes in build_table()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
0f65503799
avcodec/bitstream: remove unused variable
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Alexandra Khirnova
9b8d11a76a
avcodec: Use av_reallocp where suitable
...
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Diego Biurrun
29c455ce3d
bitstream: Check the result of av_malloc()
11 years ago
Michael Niedermayer
9386f334af
avcodec/bitstream: Dont try to free buffers for static VLCs
...
Such buffers are not malloced thus freeing would be bad.
Note though this condition never could have happened so this
is more for correctness sake and not a true bugfix
Fixes CID1061047
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
f80ccf074a
avcodec/ff_init_vlc_sparse: use a local array for static vlcs avoiding malloc()
...
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
Michael Niedermayer
a9903f7ec1
Revert "bitstream: make vlc init of static tables thread safe."
...
This reverts commit 4b6869d6e0
.
Conflicts:
libavcodec/bitstream.c
This code can cause assertion failures on artificial OOM situations
It will be replaced by a solution that doesnt have this issue in the
following commits.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Piotr Bandurski
aa74810fc6
bitstream: fix a crash in case of oom
...
fixes ticket #2766
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
f80b60ad59
bitstream: forward error values and drop few abort()
12 years ago
Luca Barbato
f776899a17
bitstream: K&R formatting cosmetics
12 years ago
Michael Niedermayer
1d7e6a6bde
avcodec/bitstream: print vlc length in error case.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
83330cf5fa
init_vlc_sparse: fix leak on error
...
Fixes CID1005312
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6998af4a40
avcodec/bitstream: check codes in ff_init_vlc_sparse()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
fb3e3808ae
avcodec/bitstream: Check bits in ff_init_vlc_sparse()
...
Fixes out of array reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
511cf612ac
miscellaneous typo fixes
12 years ago
Michael Niedermayer
4b6869d6e0
bitstream: make vlc init of static tables thread safe.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
eed865540a
Revert "Add assert that the avcodec lock is held when initializing static VLC tables."
...
This reverts commit dd154198b1
.
12 years ago
Reimar Döffinger
dd154198b1
Add assert that the avcodec lock is held when initializing static VLC tables.
...
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Diego Biurrun
d5c62122a7
Move av_reverse table to libavcodec
...
It is only used in that library.
12 years ago
Martin Storsjö
aefea4d0de
Rename ff_put_string to avpriv_put_string
...
This allows using it from libavformat as well. This will be used
by the RTP/JPEG depacketizer.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Michael Niedermayer
bb1e0e80b0
libavcodec/bitstream: switch to av_assert
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
2e909b3c77
bitstream: build_table, check table_nb_bits.
...
Fixes null ptr deref.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Alex Converse
7181c4edee
cosmetics: Remove extra newlines at EOF
13 years ago
Diego Biurrun
da9cea77e3
Fix a bunch of common typos.
13 years ago
Anton Khirnov
9f51c682ee
lavc: use avpriv_ prefix for ff_copy_bits and align_put_bits.
...
They are used in lavf.
13 years ago