summaryrefslogtreecommitdiff
path: root/libavcodec/huffman.c
Commit message (Collapse)AuthorAge
* Remove unnecessary libavutil/(avutil|common|internal).h inclusionsAndreas Rheinhardt2022-02-24
| | | | | | | | | | Some of these were made possible by moving several common macros to libavutil/macros.h. While just at it, also improve the other headers a bit. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/huffman: Use logcontext instead of AVCodecContextAndreas Rheinhardt2021-08-05
| | | | | | | Said AVCodecContext is only used for logging; it furthermore avoids an avcodec.h inclusion. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/huffman: beautify: add space between #include and filename.Yong Lei2016-07-22
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'ffa190d0479d2370dd89c95692f822cbff2cc24c'Clément Bœsch2016-06-23
|\ | | | | | | | | | | | | * commit 'ffa190d0479d2370dd89c95692f822cbff2cc24c': Move VLC and RL_VLC_ELEM structure definitions to a separate header Merged-by: Clément Bœsch <u@pkh.me>
| * Move VLC and RL_VLC_ELEM structure definitions to a separate headerAlexandra Hájková2016-05-17
| | | | | | | | | | | | | | 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>
* | Merge commit '5c31eaa9998b2185e0aa04d11adff128498dc14a'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | * commit '5c31eaa9998b2185e0aa04d11adff128498dc14a': Remove unnecessary get_bits.h #includes and add missing headers where needed. Merged-by: Clément Bœsch <clement@stupeflix.com>
| * Remove unnecessary get_bits.h #includes and add missing headers where needed.Alexandra Hájková2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * huffman: allow specifying nb_bits to ff_huff_build_tree()Michael Niedermayer2015-09-03
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * huffman: use a named identifer for the bits constantMichael Niedermayer2015-09-03
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avcodec/huffman: replace qsort with AV_QSORTGanesh Ajjanagadde2015-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ff_huff_build_tree uses qsort underneath. AV_QSORT is substantially faster due to the inlining of the comparison callback. Furthermore, this code is reasonably performance critical, since in e.g the fraps codec, ff_huff_build_tree is called on every frame. This routine is also called in vp6 on every frame in some circumstances. Sample benchmark (x86-64, Haswell, GNU/Linux), vp6 from FATE: vp6 (old): 78930 decicycles in qsort, 1 runs, 0 skips 45330 decicycles in qsort, 2 runs, 0 skips 27825 decicycles in qsort, 4 runs, 0 skips 17471 decicycles in qsort, 8 runs, 0 skips 12296 decicycles in qsort, 16 runs, 0 skips 9554 decicycles in qsort, 32 runs, 0 skips 8404 decicycles in qsort, 64 runs, 0 skips 7405 decicycles in qsort, 128 runs, 0 skips 6740 decicycles in qsort, 256 runs, 0 skips 7540 decicycles in qsort, 512 runs, 0 skips 9498 decicycles in qsort, 1024 runs, 0 skips 9938 decicycles in qsort, 2048 runs, 0 skips 8043 decicycles in qsort, 4095 runs, 1 skips vp6 (new): 15880 decicycles in qsort, 1 runs, 0 skips 10730 decicycles in qsort, 2 runs, 0 skips 10155 decicycles in qsort, 4 runs, 0 skips 7805 decicycles in qsort, 8 runs, 0 skips 6883 decicycles in qsort, 16 runs, 0 skips 6305 decicycles in qsort, 32 runs, 0 skips 5854 decicycles in qsort, 64 runs, 0 skips 5152 decicycles in qsort, 128 runs, 0 skips 4452 decicycles in qsort, 256 runs, 0 skips 4161 decicycles in qsort, 511 runs, 1 skips 4081 decicycles in qsort, 1023 runs, 1 skips 4072 decicycles in qsort, 2047 runs, 1 skips 4004 decicycles in qsort, 4095 runs, 1 skips Reviewed-by: Timothy Gu <timothygu99@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | 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/huffman: check if map was allocated tooPaul B Mahol2015-02-10
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/huffman/ff_huff_gen_len_table: support skiping stat=0 entriesMichael Niedermayer2014-06-09
| | | | | | | | | | | | | | This is probably not the simplest solution but as this is needed for a bugfix, simplification is left for later. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/huffman: use av_malloc_array()Michael Niedermayer2014-04-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/huffman: raise the input capability of ff_huff_gen_len_table() from ↵Michael Niedermayer2014-01-13
| | | | | | | | | | | | 8 to 14bit Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/huffman: extend ff_huff_gen_len_table() to allow >8bitMichael Niedermayer2014-01-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2013-11-24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Add missing #includes for *INT64_MAX and *INT64_C Conflicts: ffmpeg.c ffmpeg_filter.c ffplay.c libavformat/assdec.c libavformat/avidec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Add missing #includes for *INT64_MAX and *INT64_CDiego Biurrun2013-11-23
| |
* | avcodec/huffman: Allow specifying nb_bits to ff_huff_build_tree()Michael Niedermayer2013-09-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/huffman: use named identifer for the bits constantMichael Niedermayer2013-05-21
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd488c3bcbaf7ddda42597e014deb661a7e9e2112'Michael Niedermayer2012-08-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd488c3bcbaf7ddda42597e014deb661a7e9e2112': configure: support Bitrig OS yuv2rgb: handle line widths that are not a multiple of 4. graph2dot: Use the fallback getopt implementation if needed tools: Include io.h for open/read/write/close if unistd.h doesn't exist testprogs: Remove unused includes qt-faststart: Use other seek/tell functions on MSVC than on mingw ismindex: Include direct.h for _mkdir on windows sdp: Use static const char arrays instead of pointers to strings x86: avcodec: Drop silly "_mmx" suffixes from filenames x86: avcodec: Drop silly "_sse" suffixes from filenames sdp: Include profile-level-id for H264 utvideoenc: use ff_huff_gen_len_table huffman: add ff_huff_gen_len_table cllc: simplify/fix swapped data buffer allocation. rtpdec_h264: Don't set the pixel format h264: Check that the codec isn't null before accessing it audio_frame_queue: Define af_queue_log_state before using it Conflicts: libavcodec/audio_frame_queue.c libavcodec/h264.c libavcodec/huffman.h libavcodec/huffyuv.c libavcodec/utvideoenc.c libavcodec/x86/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * huffman: add ff_huff_gen_len_tableMichael Niedermayer2012-08-28
| | | | | | | | | | | | The function will be used by utvideo as well. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: vf_hqdn3d: Don't declare the loop variable within the for loop huffyuv: update to current coding style huffman: update to current coding style rtsp: Free the rtpdec context properly build: fft: x86: Drop unused YASM-OBJS-FFT- variable Conflicts: libavcodec/huffman.c libavcodec/huffyuv.c libavcodec/x86/Makefile libavfilter/vf_hqdn3d.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * huffman: update to current coding styleLuca Barbato2012-08-27
| |
* | huffman/huffyuv: move lorens huffman table generation code to huffman.c/hMichael Niedermayer2012-08-22
| | | | | | | | | | Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> 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>
* | huffman: use a simple assignment instead of FFSWAP.Reimar Döffinger2012-01-30
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Deobfuscate ff_huff_build_tree.Reimar Döffinger2012-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | I have no idea what the idea was behind the original code, but the new code is equivalent to it. In that loop that places the new node nodes[j] contains always the data of the new node (since the steps are always in order: FFSWAP copies node[j] to node[j-1], j is decremented). Thus nodes[j].no == i and nodes[j].sym == HNODE. make fate still passes and contains VP6 samples which use FF_HUFFMAN_FLAG_HNODE_FIRST. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-07-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: configure: Automatically add more flags required on symbian mem.h: switch doxygen parameter order to match function prototype doxygen: replace @sa tag by the more readable but equivalent @see doxygen: use Doxygen markup for authors and web links where appropriate doxygen: do not include license boilerplate in Doxygen documentation ac3enc: Mark AVClasses const ffserver: Replace two loops with one loop. ffmpeg: Fix the check for experimental codecs swscale: extend mmx padding. swscale: clip unscaled colorspace conversion path. doxygen: misc consistency cosmetics doc: remove file name from @file directive in Doxygen usage example doxygen: consistently place brief description doxygen: place empty line between brief description and detailed description avformat_open_input(): Add braces to shut up gcc warning. Conflicts: libavcodec/8svx.c libavcodec/tiff.c libavcodec/tiff.h libavcodec/vaapi_h264.c libavcodec/vorbis.c libavcodec/vorbisdec.c libavcodec/vp6.c libswscale/swscale_unscaled.c libswscale/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * doxygen: do not include license boilerplate in Doxygen documentationDiego Biurrun2011-07-15
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* 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
* Rename bitstream.h to get_bits.h.Stefano Sabatini2009-04-13
| | | | Originally committed as revision 18494 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use full internal pathname in doxygen @file directives.Diego Biurrun2009-02-01
| | | | | | | Otherwise doxygen complains about ambiguous filenames when files exist under the same name in different subdirectories. Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
* avoid POSIX reserved _t suffixAurelien Jacobs2008-12-11
| | | | Originally committed as revision 16068 to svn://svn.ffmpeg.org/ffmpeg/trunk
* huffman: add a zero_count flag and use it in frapsAurelien Jacobs2008-03-08
| | | | | | fixes issue349 Originally committed as revision 12374 to svn://svn.ffmpeg.org/ffmpeg/trunk
* huffman: pass hnode_first as a flag instead of as an argument on its ownAurelien Jacobs2008-03-08
| | | | Originally committed as revision 12373 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix nodes[nb_codes*2-1].count being uninitialized and used to initializeReimar Döffinger2007-12-01
| | | | | | | | nodes[nb_codes*2-2].count (thus making that invalid as well) in ff_huff_build_tree. Might fix some (hard to reproduce) crashes in VP6 decoder. Originally committed as revision 11119 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Cygwin don't like this function declaration.Aurelien Jacobs2007-10-15
| | | | | | So move this self-documentation into a comment instead. Originally committed as revision 10743 to svn://svn.ffmpeg.org/ffmpeg/trunk
* moves fraps huffman decoder to its own file, making it more genericAurelien Jacobs2007-10-14
Originally committed as revision 10736 to svn://svn.ffmpeg.org/ffmpeg/trunk