summaryrefslogtreecommitdiffstats
path: root/libavcodec/get_bits.h
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/bitstream: try to make vlc init code inherently thread safeMichael Niedermayer2014-06-161-1/+0
| | | | | | also remove spinlock, it doesnt work on AIX Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec: better level/index printingMatthew Lindner2014-05-091-3/+3
|
* avcodec: include GET_RL_VLC() in trace outputMichael Niedermayer2014-05-091-1/+21
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Various small spelling fixes.Reimar Döffinger2014-04-221-1/+1
| | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* avcodec/get_bits: add skip_1stop_8data_bitsMichael Niedermayer2013-10-301-0/+14
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* skip_bits: dont call UPDATE_CACHEMichael Niedermayer2013-09-301-1/+0
| | | | | | UPDATE_CACHE isnt needed and can cause segfaults Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/get_bits: place volatile at the right spotMichael Niedermayer2013-07-301-1/+1
| | | | | | Should fix Ticket2825 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/get_bits: init_state is used for thread sync, make it volatileMichael Niedermayer2013-07-301-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/ff_init_vlc_sparse: use a spinlock for thread syncMichael Niedermayer2013-07-291-0/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* get_bits: add get_bits_le()Paul B Mahol2013-07-051-18/+43
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* get_xbits: assert validity of the number of bitsMichael Niedermayer2013-06-301-0/+1
| | | | | | similar is already done in the other get_bits() functions Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* get_bits: return pointer to buffer that is the result of the alignment.Ronald S. Bultje2013-02-111-1/+2
| | | | | | | 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>
* Merge commit '4af5310d29379283553bcd9f541a3f6c317f706e'Michael Niedermayer2013-01-221-138/+150
|\ | | | | | | | | | | | | | | | | | | | | * commit '4af5310d29379283553bcd9f541a3f6c317f706e': get_bits/put_bits: K&R formatting cosmetics Conflicts: libavcodec/get_bits.h libavcodec/put_bits.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits/put_bits: K&R formatting cosmeticsDiego Biurrun2013-01-211-138/+150
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '68f18f03519ae550e25cf12661172641e9f0eaca'Michael Niedermayer2013-01-211-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit '68f18f03519ae550e25cf12661172641e9f0eaca': videodsp_armv5te: remove #if HAVE_ARMV5TE_EXTERNAL dsputil: drop non-compliant "fast" qpel mc functions get_bits: change the failure condition in init_get_bits Conflicts: libavcodec/get_bits.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits: change the failure condition in init_get_bitsLuca Barbato2013-01-201-1/+1
| | | | | | | | | | | | | | 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.
* | init_get_bits: fix off by 1 errorMichael Niedermayer2013-01-141-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | init_get_bits8: zero pointers & struct on errorMichael Niedermayer2013-01-141-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | init_get_bits8: check byte_size against being positiveMichael Niedermayer2013-01-141-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'a1c525f7eb0783d31ba7a653865b6cbd3dc880de'Michael Niedermayer2013-01-141-7/+31
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a1c525f7eb0783d31ba7a653865b6cbd3dc880de': pcx: return meaningful error codes. tmv: return meaningful error codes. msrle: return meaningful error codes. cscd: return meaningful error codes. yadif: x86: fix build for compilers without aligned stack lavc: introduce the convenience function init_get_bits8 lavc: check for overflow in init_get_bits Conflicts: libavcodec/cscd.c libavcodec/pcx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: introduce the convenience function init_get_bits8Luca Barbato2013-01-141-0/+16
| | | | | | | | | | Accept the buffer size in bytes and check for overflow before passing the value in bits to init_get_bits.
| * lavc: check for overflow in init_get_bitsLuca Barbato2013-01-141-7/+15
| | | | | | | | | | | | | | Fix an undefined behaviour and make the function return a proper error in case of overflow. CC: libav-stable@libav.org
* | Merge commit '096abfa15052977eed93f0b5e01afd2d47c53c1f'Michael Niedermayer2012-12-081-5/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * commit '096abfa15052977eed93f0b5e01afd2d47c53c1f': parser: fix large overreads bitstream: add get_bits64() to support reading more than 32 bits at once arm: detect cpu features at runtime on Linux Conflicts: libavcodec/parser.c libavformat/mpegts.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bitstream: add get_bits64() to support reading more than 32 bits at onceMichael Niedermayer2012-12-071-0/+18
| | | | | | | | | | | | | | 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>
* | get_bits: rename get_bits_longlong to get_bits64Michael Niedermayer2012-12-081-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | get_bits: get_bits_long() support n=0 as the docs allow itMichael Niedermayer2012-10-061-1/+3
| | | | | | | | | | | | also the 0 case is indeed used in some code pathes Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | bitstream: add get_bits_longlong() to support more than 32bitsMichael Niedermayer2012-09-301-0/+18
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | get_bits_long: fix variable typeMichael Niedermayer2012-09-301-2/+2
| | | | | | | | | | | | This fixes a theoretical signed overflow Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-09-281-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: libopus: Remap channels using libopus' internal remapping. Opus decoder using libopus avcodec: document the use of AVCodecContext.delay for audio decoding vc1dec: add flush function for WMV9 and VC-1 decoders http: Increase buffer sizes to cope with longer URIs nutenc: const correctness for ff_put_v_trace/put_s_trace function arguments h264_refs: Fix debug tprintf argument types golomb: const correctness for get_ue()/get_se() function arguments get_bits: const correctness for get_bits_trace()/get_xbits_trace() arguments Conflicts: Changelog libavcodec/Makefile libavcodec/version.h libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits: const correctness for get_bits_trace()/get_xbits_trace() argumentsDiego Biurrun2012-09-271-3/+3
| |
* | get_bits: check the number of bits parameter through av_assert2()Michael Niedermayer2012-04-071-0/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-02-251-1/+14
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: docs: use -bsf:[vas] instead of -[vas]bsf. mpegaudiodec: Prevent premature clipping of mp3 input buffer. lavf: move the packet keyframe setting code. oggenc: free comment header for all codecs lcl: error out if uncompressed input buffer is smaller than framesize. mjpeg: abort decoding if packet is too large. golomb: use HAVE_BITS_REMAINING() macro to prevent infloop on EOF. get_bits: add HAVE_BITS_REMAINING macro. lavf/output-example: use new audio encoding API correctly. lavf/output-example: more proper usage of the new API. tiff: Prevent overreads in the type_sizes array. tiff: Make the TIFF_LONG and TIFF_SHORT types unsigned. apetag: do not leak memory if avio_read() fails apetag: propagate errors. SBR DSP x86: implement SSE sbr_hf_g_filt SBR DSP x86: implement SSE sbr_sum_square_sse SBR DSP: use intptr_t for the ixh parameter. Conflicts: doc/bitstream_filters.texi doc/examples/muxing.c doc/ffmpeg.texi libavcodec/golomb.h libavcodec/x86/Makefile libavformat/oggenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits: add HAVE_BITS_REMAINING macro.Ronald S. Bultje2012-02-241-1/+14
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-02-161-6/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-151-6/+6
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-231-4/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: build: fix standalone compilation of OMA muxer build: fix standalone compilation of Microsoft XMV demuxer build: fix standalone compilation of Core Audio Format demuxer kvmc: fix invalid reads 4xm: Add a check in decode_i_frame to prevent buffer overreads adpcm: fix IMA SMJPEG decoding options: set minimum for "threads" to zero bsd: use number of logical CPUs as automatic thread count windows: use number of CPUs as automatic thread count linux: use number of CPUs as automatic thread count pthreads: reset active_thread_type when slice thread_init returrns early v410dec: include correct headers Drop ALT_ prefix from BITSTREAM_READER_LE name. lavfi: always build vsrc_buffer. ra144enc: zero the reflection coeffs if the filter is unstable sws: readd PAL8 to isPacked() mov: Don't stick the QuickTime field ordering atom in extradata. truespeech: fix invalid reads in truespeech_apply_twopoint_filter() Conflicts: configure libavcodec/4xm.c libavcodec/avcodec.h libavfilter/Makefile libavfilter/allfilters.c libavformat/Makefile libswscale/swscale_internal.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Drop ALT_ prefix from BITSTREAM_READER_LE name.Diego Biurrun2011-12-221-4/+4
| | | | | | | | | | The prefix is a historic remnant that probably meant "alternative". Now that the A32 bitstream reader has been dropped it makes no sense anymore.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-181-66/+106
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: build: link test programs with static libraries dct-test: remove unused variable cropTbl swscale: fix overflow in gray16 vertical scaling. get_bits: remove LAST_SKIP_CACHE macro swscale: fix integer overflows in RGB pixel writing. swscale: add endian conversion for RGB555 and RGB444 pixel formats swscale: fix overflows in output of RGB48 pixels. get_bits: remove strange/obsolete comments get_bits: whitespace (mostly) cosmetics swscale: add rgb565 endianess conversion get_bits: remove unnecessary #includes mp3dec: hack: fix decoding with safe bitstream reader fate: fix eatqi test adpcm: Check for channels to be a non-zero integer swscale: fix overflows in RGB rounding constants. get_bits: introduce safe bitreading to prevent overreads. Conflicts: libswscale/swscale.c libswscale/swscale_unscaled.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits: remove LAST_SKIP_CACHE macroMans Rullgard2011-12-171-5/+1
| | | | | | | | | | | | This macro is empty since the removal of the A32 bitstream reader. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: remove strange/obsolete commentsMans Rullgard2011-12-171-9/+1
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: whitespace (mostly) cosmeticsMans Rullgard2011-12-171-49/+73
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: remove unnecessary #includesMans Rullgard2011-12-171-3/+0
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: introduce safe bitreading to prevent overreads.Ronald S. Bultje2011-12-171-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When turned on, H264/CAVLC gets ~15% (CVPCMNL1_SVA_C.264) slower for ultra-high-bitrate files, or ~2.5% (CVFI1_SVA_C.264) for lower-bitrate files. Other codecs are affected to a lesser extent because they are less optimized; e.g., VC-1 slows down by less than 1% (all on x86). The patch generated 3 extra instructions (cmp, cmovae and mov) per call to get_bits(). The performance penalty on ARM is within the error margin for most files, up to 4% in extreme cases such as CVPCMNL1_SVA_C.264. Based on work (for GCI) by Aneesh Dogra <lionaneesh@gmail.com>, and inspired by patch in Chromium by Chris Evans <cevans@chromium.org>.
* | get_bits: drop the a32 reader.Michael Niedermayer2011-12-181-105/+14
| | | | | | | | | | | | | | | | | | | | | | that way qatar maintains the code for me and i dont need to resolve conflicts. If someone wants the a32 reader back, only thing you need to do is maintain it, i would be happy to have it back, iam just not volunteering to maintain it due to lack of time. Based on: a1e98f198e9db4e5ddfc2f777014179d3d7bc4d2 by Mans Rullgard. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-171-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: get_bits: remove A32 variant avconv: support stream specifiers in -metadata and -map_metadata wavpack: Fix 32-bit clipping wavpack: Clip samples after shifting h264: don't drop B-frames after next keyframe on POC reset. get_bits: remove useless pointer casts configure: refactor lists of tests and components into variables rv40: NEON optimised weak loop filter mpegts: replace some magic numbers with the existing define swscale: add unscaled packed 16 bit per component endianess conversion Conflicts: libavcodec/get_bits.h libavcodec/h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits: remove A32 variantMans Rullgard2011-12-161-97/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The A32 bitstream reader variant is only used on ARMv5 and for Prores due to the larger bit cache this decoder requires. In benchmarks on ARMv5 (Marvell Sheeva) with gcc 4.6, the only statistically significant difference between ALT and A32 is a 4% advantage for ALT in FLAC decoding. There is thus no (longer) any reason to keep the A32 reader from this point of view. This patch adds an option to the ALT reader increasing the bit cache to 32 bits as required by the Prores decoder. Benchmarking shows no significant change in speed on Intel i7. Again, the A32 reader fails to justify its existence. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: remove useless pointer castsMans Rullgard2011-12-161-2/+2
| | | | | | | | | | | | These pointers are already of the correct type. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-131-10/+9
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: doxygen: misc consistency, spelling and wording fixes vcr1: drop unnecessary emms_c() calls without MMX code Replace all uses of av_close_input_file() with avformat_close_input(). lavf: add avformat_close_input(). lavf: deprecate av_close_input_stream(). lavf doxy: add some basic demuxing documentation. lavf doxy: add some general lavf information. lavf doxy: add misc utility functions to a group. lavf doxy: add av_guess_codec/format to the encoding group. lavf doxy: add core functions to a doxy group. Add basic libavdevice documentation. lavc: convert error_recognition to err_recognition. avconv: update -map option help text x86: Require 7 registers for the cabac asm x86: bswap: remove test for bswap instruction bswap: make generic implementation more compiler-friendly h264: remove useless cast proresdec: fix decode_slice() prototype Conflicts: configure doc/APIchanges ffprobe.c libavcodec/avcodec.h libavcodec/celp_math.h libavcodec/h264.c libavfilter/src_movie.c libavformat/anm.c libavformat/avformat.h libavformat/version.h libavutil/avstring.h libavutil/bswap.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * doxygen: misc consistency, spelling and wording fixesDiego Biurrun2011-12-121-10/+9
| |
* | Revert "get_bits: remove x86 inline asm in A32 bitstream reader"Elvis Presley2011-09-151-0/+8
| | | | | | | | This reverts commit 23ce6e72123a40895baaeefeb27c7c18748bd67e.
OpenPOWER on IntegriCloud