summaryrefslogtreecommitdiff
path: root/libavcodec/get_bits.h
Commit message (Collapse)AuthorAge
* get_bits: get_bits_long() support n=0 as the docs allow itMichael Niedermayer2012-10-06
| | | | | | 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-30
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* get_bits_long: fix variable typeMichael Niedermayer2012-09-30
| | | | | | This fixes a theoretical signed overflow Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-09-28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-27
| |
* | get_bits: check the number of bits parameter through av_assert2()Michael Niedermayer2012-04-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-02-25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-24
| |
* | 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 Niedermayer2011-12-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-22
| | | | | | | | | | 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-18
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-17
| | | | | | | | | | | | 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-17
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: whitespace (mostly) cosmeticsMans Rullgard2011-12-17
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: remove unnecessary #includesMans Rullgard2011-12-17
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: introduce safe bitreading to prevent overreads.Ronald S. Bultje2011-12-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-18
| | | | | | | | | | | | | | | | | | | | | | 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-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-16
| | | | | | | | | | | | 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-13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-12
| |
* | Revert "get_bits: remove x86 inline asm in A32 bitstream reader"Elvis Presley2011-09-15
| | | | | | | | This reverts commit 23ce6e72123a40895baaeefeb27c7c18748bd67e.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-02
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: get_bits: remove x86 inline asm in A32 bitstream reader doc: Remove outdated information about our issue tracker avidec: Factor out the sync fucntionality. fate-aac: Expand coverage. ac3dsp: add x86-optimized versions of ac3dsp.extract_exponents(). ac3dsp: simplify extract_exponents() now that it does not need to do clipping. ac3enc: clip coefficients after MDCT. ac3enc: add int32_t array clipping function to DSPUtil, including x86 versions. swscale: for >8bit scaling, read in native bit-depth. matroskadec: matroska_read_seek after after EBML_STOP leads to failure. doxygen: fix usage of @file directive in libavutil/{dict,file}.h doxygen: Help doxygen parser to understand the DECLARE_ALIGNED and offsetof macros Conflicts: doc/issue_tracker.txt libavformat/avidec.c libavutil/dict.h libswscale/swscale.c libswscale/utils.c tests/ref/lavfi/pixfmts_scale Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits: remove x86 inline asm in A32 bitstream readerMans Rullgard2011-07-01
| | | | | | | | | | | | | | x86 does not use this variant so having inline asm there is pointless. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-01
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: cosmetics: fix some then/than typos doxygen: Include libavcodec and libavformat examples into the documentation avutil: elaborate documentation for av_get_random_seed Add support for aac streams in mp4/mov without extradata. aes: whitespace cosmetics adler32: whitespace cosmetics swscale: fix another yuv range conversion overflow in 16bit scaling. Fix cpu flags test program opt-test: Add missing braces to silence compiler warnings. build: Eliminate obsolete test targets. udp: Fix a compilation warning swscale: Unbreak build with --enable-small base64: add fate test aes: improve test program and add fate test adler32: make test program more useful and add fate test swscale: fix yuv range correction when using 16-bit scaling. aacenc: Make chan_map const correct Conflicts: Makefile doc/examples/muxing-example.c libavformat/udp.c libavutil/random_seed.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: fix some then/than typosDiego Biurrun2011-06-30
| |
| * get_bits: add av_unused tag to cache variableMans Rullgard2011-05-28
| | | | | | | | | | | | | | This silences numerous compiler warnings from skip_bits(), where the cache variable is not used. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | Merge remote branch 'qatar/master'Michael Niedermayer2011-05-05
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (23 commits) doc: Check standalone compilation before submitting new components. Fix standalone compilation of pipe protocol. Fix standalone compilation of ac3_fixed encoder. Fix standalone compilation of binkaudio_dct / binkaudio_rdft decoders. Fix standalone compilation of IMC decoder. Fix standalone compilation of WTV demuxer. Fix standalone compilation of MXPEG decoder. flashsv: K&R cosmetics matroskaenc: fix memory leak vc1: make overlap filter for I-frames bit-exact. vc1dec: use s->start/end_mb_y instead of passing them as function args. Revert "VC1: merge idct8x8, coeff adjustments and put_pixels." Replace strncpy() with av_strlcpy(). indeo3: Eliminate use of long. get_bits: make cache unsigned to eliminate undefined signed overflow. asfdec: fix assert failure on invalid files avfilter: check malloc return values. Not pulled as reason for reindent is not pulled: mpegvideo: reindent. nutenc: check malloc return values. Not pulled due to much simpler solution in ffmpeg *: don't av_malloc(0). ... Conflicts: doc/developer.texi libavcodec/Makefile libavcodec/get_bits.h libavcodec/mpegvideo.c libavformat/Makefile libavutil/log.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * get_bits: make cache unsigned to eliminate undefined signed overflow.Alex Converse2011-05-03
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * get_bits: move tracing macros to end of fileMans Rullgard2011-01-23
| | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Sanitise get_bits macros, part 2Mans Rullgard2011-01-23
| | | | | | | | | | | | | | These whitespace changes improve the readability of the get_bits macros. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Sanitise get_bits macros, part 1Mans Rullgard2011-01-23
| | | | | | | | | | | | | | | | | | Some of the macros in get_bits.h include a final semicolon, some do not. This removes these or adds do {} while(0) around the macros as appropriate and adds semicolons where needed in calling code. Signed-off-by: Mans Rullgard <mans@mansr.com>
| * Remove "libmpeg2" bitstream readerMans Rullgard2011-01-23
| | | | | | | | | | | | | | | | | | | | Using the libmpeg2 reader causes errors in a multitude of places, including MPEG and H264 codecs. As the advantage of this reader is questionable, removing it seems the sensible course of action, especially considering the simplifications this allows elsewhere with the bit cache size increasing from 17 to 25 bits as minimum. Signed-off-by: Mans Rullgard <mans@mansr.com>
* | bitstream_reader: Try to fix "get_bits.h:305:45: warning: variable ↵Michael Niedermayer2011-05-04
| | | | | | | | | | | | ‘re_cache’ set but not used [-Wunused-but-set-variable]" Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | bitstream reader: remove unneeded variable initilization.Michael Niedermayer2011-05-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | get_bits: move tracing macros to end of fileMans Rullgard2011-01-23
| | | | | | | | | | Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 611a6f59ce91947b25033bb8d0f9311b5c542b05)
* | Sanitise get_bits macros, part 2Mans Rullgard2011-01-23
| | | | | | | | | | | | | | | | These whitespace changes improve the readability of the get_bits macros. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit fb5c841d5f05ae54b699ba6ef28356a6563751eb)
* | Sanitise get_bits macros, part 1Mans Rullgard2011-01-23
| | | | | | | | | | | | | | | | | | | | Some of the macros in get_bits.h include a final semicolon, some do not. This removes these or adds do {} while(0) around the macros as appropriate and adds semicolons where needed in calling code. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit bf5f9b528b4117596afc57578a36e7b5728b15d3)
* | Remove "libmpeg2" bitstream readerMans Rullgard2011-01-23
|/ | | | | | | | | | | Using the libmpeg2 reader causes errors in a multitude of places, including MPEG and H264 codecs. As the advantage of this reader is questionable, removing it seems the sensible course of action, especially considering the simplifications this allows elsewhere with the bit cache size increasing from 17 to 25 bits as minimum. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 938f72e19957e9ee3f4ae2bee2fb53ded359009f)
* Add av_ prefix to bswap macrosMåns Rullgård2010-07-10
| | | | Originally committed as revision 24170 to svn://svn.ffmpeg.org/ffmpeg/trunk
* bswap: change ME to NE in macro namesMåns Rullgård2010-07-10
| | | | | | | Other parts of FFmpeg use NE (native endian) rather than ME (machine). This makes it consistent. Originally committed as revision 24169 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove explicit filename from Doxygen @file commands.Diego Biurrun2010-04-20
| | | | | | | | Passing an explicit filename to this command is only necessary if the documentation in the @file block refers to a file different from the one the block resides in. Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
* get/show_bits() can read up to MIN_CACHE_BITS bitsMåns Rullgård2010-02-21
| | | | | | | The limit for get/show_bits_long() to use get/show_bits() directly should be MIN_CACHE_BITS, not 17. Originally committed as revision 21951 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Deobfuscate LE SHOW_[SU]BITS; these are simple sign/zero-extendMåns Rullgård2010-02-21
| | | | Originally committed as revision 21948 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move NEG_[US]SR32 macros to mathops.hMåns Rullgård2010-02-17
| | | | Originally committed as revision 21873 to svn://svn.ffmpeg.org/ffmpeg/trunk
* get_bits: Fix spelling and grammar in GET_VLC() comment.Alex Converse2010-02-17
| | | | Originally committed as revision 21868 to svn://svn.ffmpeg.org/ffmpeg/trunk