summaryrefslogtreecommitdiff
path: root/libavcodec/dcahuff.h
Commit message (Collapse)AuthorAge
* avcodec/dca_lbr: Inline nb_bits for VLCsAndreas Rheinhardt2022-09-16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dcahuff: Replace DCAVLC by ordinary VLCsAndreas Rheinhardt2022-09-16
| | | | | | | This is possible now that the offsets are already applied when creating the VLC. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dca_core: Inline number of bits of scale factor VLCsAndreas Rheinhardt2022-09-16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dcahuff, dca_core, dca_lbr: Apply offset during VLC creationAndreas Rheinhardt2022-09-16
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dcahuff: Combine tables, use ff_init_vlc_from_lengths()Andreas Rheinhardt2022-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, initializing the dca VLC tables uses ff_init_vlc_sparse() with length tables of type uint8_t and code tables of type uint16_t (except for the LBR tables, which uses length and symbols of type uint8_t; these tables are interleaved). In case of the quant index codebooks these arrays were accessed via tables of pointers to the individual tables. This commit changes this: First, we switch to ff_init_vlc_from_lengths() to replace the uint16_t code tables by uint8_t symbol tables (this necessitates ordering the tables from left-to-right in the tree first). These symbol tables are interleaved with the length tables. Furthermore, these tables are combined in order to remove the table of pointers to individual tables, thereby avoiding relocations (for x64 elf systems this amounts to 96*24B = 2304B saved in .rela.dyn) and saving 1280B from .data.rel.ro (for 64bit systems). Meanwhile the savings in .rodata amount to 2709 + 2 * 334 = 3377B. Due to padding the actual savings are higher: The ELF x64 ABI requires objects >= 16B to be padded to 16B and lots of the tables have 2^n + 1 elements of these were from replacing uint16_t codes with uint8_t symbols; the rest was due to the fact that combining the tables eliminated padding (the ELF x64 ABI requires objects >= 16B to be padded to 16B and lots of the tables have 2^n + 1 elements)). Taking this into account gives savings of 4548B. (GCC by default uses an even higher alignment (controlled by -malign-data); for it the savings are 5748B.) These changes also necessitated to modify the init code for the encoder tables. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dcaenc: Create encoder-adapted tablesAndreas Rheinhardt2022-09-16
| | | | | | | | | | | | | | | | | | Up until now, the encoder used the same tables that the decoder uses to create its VLCs. These have the downside of requiring the encoder to offset the tables at runtime as well as having to read from separate tables for the length as well as the code of the symbol to encode. The former are uint8_t, the latter uint16_t, so using a joint table would require padding, but this doesn't matter when these tables are generated at runtime, because they live in the .bss segment. Also move these init functions as well as the functions that actually use them to dcaenc.c, because they are encoder-specific. This also allows to remove an inclusion of PutBitContext from dcahuff.h (and indirectly from all dca-decoder files). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dcahuff: Always use three bits for transition mode VLCsAndreas Rheinhardt2022-09-16
| | | | | | | | It increases the size of one VLC from two to three bits, thereby requiring four more VLCEntries (16 bytes .bss), but it allows to inline the number of bits used when reading them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dca_core, dcahuff: Don't use DCAVLC unnecessarilyAndreas Rheinhardt2022-09-16
| | | | | | | The ff_dca_vlc_transition_mode VLCs don't use an offset at all, so just use ordinary VLCs for them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove/replace some unnecessary avcodec.h inclusionsAndreas Rheinhardt2021-07-22
| | | | | | | Also remove other unnecessary headers and include headers directly while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* dcaenc: Use Huffman codes for Bit Allocation IndexDaniil Cherednik2017-01-20
| | | | Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* dcaenc: Implementation of Huffman codes for DCA encoderDaniil Cherednik2017-01-15
| | | | Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* avcodec/dca: add DTS Express (LBR) decoderfoo862016-05-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dca: move huffman data into separate object filefoo862016-05-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Merge commit '45ff7c93dd84a254cc96acc589e5ac3d7bd16bce'Michael Niedermayer2014-09-16
|\ | | | | | | | | | | | | | | | | | | | | * commit '45ff7c93dd84a254cc96acc589e5ac3d7bd16bce': dca: K&R formatting cosmetics Conflicts: libavcodec/dca_parser.c libavcodec/dcadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dca: K&R formatting cosmeticsGabriel Dume2014-09-16
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Fix huffman coded dca samples.Benjamin Larsson2008-10-28
| | | | Originally committed as revision 15733 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Globally rename the header inclusion guard names.Stefano Sabatini2008-08-31
| | | | | | | | | Consistently apply this rule: the guard name is obtained from the filename by stripping the leading "lib", converting '/' and '.' to '_' and uppercasing the resulting name. Guard names in the root directory have to be prefixed by "FFMPEG_". Originally committed as revision 15120 to svn://svn.ffmpeg.org/ffmpeg/trunk
* mark read-only data as constStefan Gehrer2008-06-24
| | | | Originally committed as revision 13947 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add FFMPEG_ prefix to all multiple inclusion guards.Diego Biurrun2007-10-17
| | | | Originally committed as revision 10765 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add a comment to indicate which #endif belong to which #defineGuillaume Poirier2007-06-17
| | | | Originally committed as revision 9356 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add multiple inclusion guards to headersMåns Rullgård2007-06-17
| | | | Originally committed as revision 9345 to svn://svn.ffmpeg.org/ffmpeg/trunk
* include all prerequisites in header filesMåns Rullgård2007-06-16
| | | | Originally committed as revision 9344 to svn://svn.ffmpeg.org/ffmpeg/trunk
* DCA decoderKostya Shishkov2007-02-27
Originally committed as revision 8141 to svn://svn.ffmpeg.org/ffmpeg/trunk