summaryrefslogtreecommitdiff
path: root/libavcodec/on2avcdata.h
Commit message (Collapse)AuthorAge
* avcodec/on2avcdata: Combine tables for codebooksAndreas Rheinhardt2020-12-08
| | | | | | | Using one big table for the codebook symbols and lengths makes it possible to remove the pointers to the individual tables. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/on2avc: Use smaller tables for VLCsAndreas Rheinhardt2020-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | The On2 audio decoder uses huge tables to initialize VLC tables. These tables (mostly) use symbols tables in addition to the codes tables and the lengths tables. This commit makes the codes tables redundant and removes them: If all tables are permuted so that the codes are ordered from left to right in the Huffman tree, the codes become redundant and can be easily calculated at runtime from the lengths (via ff_init_vlc_from_lengths()); this also avoids sorting the codes in ff_init_vlc_sparse()*. The symbols tables are always 16bit, the codes tables are 32bit, 16bit or (rarely) 8bit, the lengths tables are always 8bit. Even though some symbols tables have been used twice (which is no longer possible now because different permutations need to be performed on the code tables sharing the same symbol table in order to order them from left to right), this nevertheless saves about 28KB. *: If the initializations of the VLCs are repeated 2048 times (interleaved with calls to free the VLCs which have not been timed), the number of decicycles spent on each round of initializations improves from 27669656 to 7356159. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/on2avc: Unify initializing quad and pair VLCsAndreas Rheinhardt2020-10-21
| | | | | | | | | | | | Up until now, quad VLCs are initialized with codes of type uint32_t, pair VLCs with codes of type uint16_t. There were two separate loops in the decoder's init function for each type of VLC. This commit unifies this: The type of the codes are now passed in as void * and the actual size of the codes is obtained from a table. This approach also allows to use the smallest type for each VLC code table: some quad tables actually fitted in uint16_t. This allows to remove about 7KB from the binary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Merge commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3'James Almer2017-09-26
|\ | | | | | | | | | | | | * commit 'fd9212f2edfe9b107c3c08ba2df5fd2cba5ab9e3': Mark some arrays that never change as const. Merged-by: James Almer <jamrial@gmail.com>
| * Mark some arrays that never change as const.Anton Khirnov2017-02-01
| |
* | all: Make header guard names consistentTimothy Gu2016-01-31
| |
* | Add missing "const" to pointer arrays.Reimar Döffinger2014-05-10
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | Merge commit '7cade8ea2bb19e78dae42b29720535a70fb2ae84'Michael Niedermayer2014-04-23
|\| | | | | | | | | | | | | * commit '7cade8ea2bb19e78dae42b29720535a70fb2ae84': on2avc: change a comment at #endif to match actual define Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * on2avc: change a comment at #endif to match actual defineKostya Shishkov2014-04-23
| |
* | Merge commit 'e2834567d73bd1e46478ba67ac133cb8ef5f50fd'Michael Niedermayer2014-04-23
|/ | | | | | | | | | | | | | * commit 'e2834567d73bd1e46478ba67ac133cb8ef5f50fd': On2 AVC decoder Conflicts: Changelog configure libavcodec/avcodec.h libavcodec/codec_desc.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* On2 AVC decoderKostya Shishkov2014-04-23