summaryrefslogtreecommitdiff
path: root/libavcodec/bitstream.c
Commit message (Collapse)AuthorAge
* avcodec/bitstream: replace qsort with AV_QSORTGanesh Ajjanagadde2015-10-18
| | | | | | | | | | | | | | | | | | | | | | | Commit 3a0a2f33a6c955823fa4fb12c0b49cd29a496659 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>
* doc: avoid incorrect phrase 'allows to'Andreas Cadhalpun2015-06-16
| | | | | | | | 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>
* doc: fix spelling errorsAndreas Cadhalpun2015-06-14
| | | | | | | | | | | 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>
* avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()Michael Niedermayer2015-05-25
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-19
| |
* | Merge commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7f9f771eac0d37a632e0ed9bd89961d57fcfb7e0': avcodec: Don't anonymously typedef structs Conflicts: libavcodec/alac.c libavcodec/cinepak.c libavcodec/cscd.c libavcodec/dcadec.c libavcodec/g723_1.c libavcodec/gif.c libavcodec/iff.c libavcodec/kgv1dec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/ra288.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
* | avcodec/bitstream: remove trivial assertMichael Niedermayer2014-07-02
| | | | | | | | | | | | Fixed CID1224273 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: document the double volatileMichael Niedermayer2014-06-21
| | | | | | | | | | Suggested-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: try to workaround internal compiler bug in gcc 4.2Michael Niedermayer2014-06-20
| | | | | | | | | | | | | | gcc 4.2 seems not maintained anymore so theres no option besides just working around it. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: try to make vlc init code inherently thread safeMichael Niedermayer2014-06-16
| | | | | | | | | | | | also remove spinlock, it doesnt work on AIX Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: fill invalid vlc tables entries as last pass instead of firstMichael Niedermayer2014-06-16
| | | | | | | | | | | | This avoids writing entries twice Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: zero vlc tables on allocationMichael Niedermayer2014-06-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | vcodec/bitstream: use av_malloc_array()Michael Niedermayer2014-04-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: assert that no integer overflow happened when writing ↵Michael Niedermayer2014-01-23
| | | | | | | | | | | | codes in build_table() Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: remove unused variableMichael Niedermayer2013-12-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '9b8d11a76ae7bca8bbb58abb822138f8b42c776c'Michael Niedermayer2013-12-09
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9b8d11a76ae7bca8bbb58abb822138f8b42c776c': avcodec: Use av_reallocp where suitable Conflicts: libavcodec/bitstream.c libavcodec/eatgv.c libavcodec/flashsv.c libavcodec/libtheoraenc.c libavcodec/libvpxenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Use av_reallocp where suitableAlexandra Khirnova2013-12-09
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
| * bitstream: Check the result of av_malloc()Diego Biurrun2013-10-15
| |
* | avcodec/bitstream: Dont try to free buffers for static VLCsMichael Niedermayer2013-08-08
| | | | | | | | | | | | | | | | | | | | 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>
* | avcodec/ff_init_vlc_sparse: use a local array for static vlcs avoiding malloc()Michael Niedermayer2013-07-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/ff_init_vlc_sparse: use a spinlock for thread syncMichael Niedermayer2013-07-29
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "bitstream: make vlc init of static tables thread safe."Michael Niedermayer2013-07-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4b6869d6e0120c92253d525921f0e04361888e10. 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>
* | bitstream: fix a crash in case of oomPiotr Bandurski2013-07-09
| | | | | | | | | | | | fixes ticket #2766 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f80b60ad59945dae32bb26a4e239ed94b0e92fa3'Michael Niedermayer2013-06-16
|\| | | | | | | | | | | | | | | | | | | * commit 'f80b60ad59945dae32bb26a4e239ed94b0e92fa3': bitstream: forward error values and drop few abort() Conflicts: libavcodec/bitstream.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bitstream: forward error values and drop few abort()Luca Barbato2013-06-16
| |
* | Merge commit 'f776899a17dce32ad7fb9231d98f15558f37cc3f'Michael Niedermayer2013-06-16
|\| | | | | | | | | | | | | | | | | | | * commit 'f776899a17dce32ad7fb9231d98f15558f37cc3f': bitstream: K&R formatting cosmetics Conflicts: libavcodec/bitstream.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bitstream: K&R formatting cosmeticsLuca Barbato2013-06-16
| |
* | avcodec/bitstream: print vlc length in error case.Michael Niedermayer2013-05-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | init_vlc_sparse: fix leak on errorMichael Niedermayer2013-04-21
| | | | | | | | | | | | Fixes CID1005312 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: check codes in ff_init_vlc_sparse()Michael Niedermayer2013-04-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/bitstream: Check bits in ff_init_vlc_sparse()Michael Niedermayer2013-04-18
| | | | | | | | | | | | | | Fixes out of array reads Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '511cf612ac979f536fd65e14603a87ca5ad435f3'Michael Niedermayer2012-12-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '511cf612ac979f536fd65e14603a87ca5ad435f3': miscellaneous typo fixes Conflicts: libavcodec/4xm.c libavcodec/lagarith.c libavcodec/parser.c libavcodec/ratecontrol.c libavcodec/shorten.c libavcodec/vda_h264.c libavformat/dvenc.c libavformat/wtv.c tools/patcheck Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * miscellaneous typo fixesDiego Biurrun2012-12-21
| |
* | bitstream: make vlc init of static tables thread safe.Michael Niedermayer2012-12-06
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Revert "Add assert that the avcodec lock is held when initializing static ↵Michael Niedermayer2012-12-06
| | | | | | | | | | | | VLC tables." This reverts commit dd154198b1afa9f3f740eb0b2ccd7ab665f8edd4.
* | Add assert that the avcodec lock is held when initializing static VLC tables.Reimar Döffinger2012-12-05
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit 'd5c62122a7b26704bf867a1262df358623bf5edf'Michael Niedermayer2012-10-13
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd5c62122a7b26704bf867a1262df358623bf5edf': Move av_reverse table to libavcodec Conflicts: libavcodec/asvenc.c libavcodec/vble.c libavutil/common.h libavutil/mathematics.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Move av_reverse table to libavcodecDiego Biurrun2012-10-12
| | | | | | | | It is only used in that library.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-09-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: x86: dsputil: Only compile motion_est code when encoders are enabled mem: fix typo in check for __ICC fate: mp3: drop redundant CMP setting rtp: Depacketization of JPEG (RFC 2435) Rename ff_put_string to avpriv_put_string mjpeg: Rename some symbols to avpriv_* instead of ff_* yadif: cosmetics Conflicts: Changelog libavcodec/mjpegenc.c libavcodec/x86/Makefile libavfilter/vf_yadif.c libavformat/version.h libavutil/mem.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Rename ff_put_string to avpriv_put_stringMartin Storsjö2012-09-09
| | | | | | | | | | | | | | 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>
* | libavcodec/bitstream: switch to av_assertMichael Niedermayer2012-07-23
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | bitstream: build_table, check table_nb_bits.Michael Niedermayer2012-03-23
| | | | | | | | | | | | | | Fixes null ptr deref. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-02-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (27 commits) ppc: Add ff_ prefix to nonstatic symbols sh4: Add ff_ prefix to nonstatic symbols mpegvideo: Add ff_ prefix to nonstatic functions rtjpeg: Add ff_ prefix to nonstatic symbols rv: Add ff_ prefix to nonstatic symbols vp56: Add ff_ prefix to nonstatic symbols vorbis: Add ff_ prefix to nonstatic symbols msmpeg4: Add ff_ prefix to nonstatic symbols vc1: Add ff_ prefix to nonstatic symbols msmpeg4: Add ff_ prefixes to nonstatic symbols snow: Add ff_ prefix to nonstatic symbols mpeg12: Add ff_ prefix to nonstatic symbols mpeg4: Add ff_ prefixes to nonstatic symbols lagarith: Add ff_ prefix to lag_rac_init libavcodec: Add ff_ prefix to j_rev_dct* dsputil: Add ff_ prefix to inv_zigzag_direct16 libavcodec: Prefix fdct_ifast, fdct_ifast248 dsputil: Add ff_ prefix to the dsputil*_init* functions libavcodec: Add ff_ prefix to some nonstatic symbols vlc/rl: Add ff_ prefix to the nonstatic symbols ... Conflicts: libavcodec/Makefile libavcodec/allcodecs.c libavcodec/dnxhddec.c libavcodec/ffv1.c libavcodec/h263.h libavcodec/h263dec.c libavcodec/h264.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/nuv.c libavcodec/ppc/dsputil_ppc.c libavcodec/proresdsp.c libavcodec/svq3.c libavcodec/version.h libavformat/dv.h libavformat/dvenc.c libavformat/matroskadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vlc/rl: Add ff_ prefix to the nonstatic symbolsMartin Storsjö2012-02-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: aacenc: Fix LONG_START windowing. aacenc: Fix a bug where deinterleaved samples were stored in the wrong place. avplay: use the correct array size for stride. lavc: extend doxy for avcodec_alloc_context3(). APIchanges: mention avcodec_alloc_context()/2/3 avcodec_align_dimensions2: set only 4 linesizes, not AV_NUM_DATA_POINTERS. aacsbr: ARM NEON optimised sbrdsp functions aacsbr: align some arrays aacsbr: move some simdable loops to function pointers cosmetics: Remove extra newlines at EOF Conflicts: libavcodec/utils.c libavfilter/formats.c libavutil/mem.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Remove extra newlines at EOFAlex Converse2012-01-27
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: x86: cabac: replace explicit memory references with "m" operands avplay: don't request a stereo downmix wmapro: use av_float2int() lavc: avoid invalid memcpy() in avcodec_default_release_buffer() lavu: replace int/float punning functions lavfi: install libavfilter/vsrc_buffer.h Remove extraneous semicolons sdp: Restore the original mp4 format h264 extradata if converted rtpenc: Add support for mp4 format h264 rtpenc: Simplify code by introducing a separate end pointer movenc: Use the actual converted sample for RTP hinting Fix a bunch of common typos. Conflicts: doc/developer.texi doc/eval.texi doc/filters.texi doc/protocols.texi ffmpeg.c ffplay.c libavcodec/mpegvideo.h libavcodec/x86/cabac.h libavfilter/Makefile libavformat/avformat.h libavformat/cafdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/gxfenc.c libavformat/img2.c libavformat/movenc.c libavformat/mpegts.c libavformat/rtpenc_h264.c libavformat/utils.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Fix a bunch of common typos.Diego Biurrun2011-12-11
| |