diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-01 20:44:12 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-08 17:51:46 +0100 |
commit | a7dbeb77c3c30ac4904928978938b209ff6e1ab1 (patch) | |
tree | 893978166a547db270f342c45e4314b902ee52c7 /libavcodec/mvcdec.c | |
parent | 1cf374c973796bb0f8e7f6d5a41d94e8b00cc9f5 (diff) | |
download | ffmpeg-a7dbeb77c3c30ac4904928978938b209ff6e1ab1.tar.gz |
avcodec/atrac3plus: Combine codebooks into one array
ATRAC3+ uses VLCs whose code lengths are ascending from left to right in
the tree; ergo it is possible (and done) to run-length encode the
lengths into so-called codebooks. These codebooks were variable-sized:
The first byte contained the minimum length of a code, the second the
maximum length; this was followed by max - min + 1 bytes containing the
actual numbers. The minimal min was 1, the maximal max 12.
While one saves a few bytes by only containing the range that is
actually used, this is more than offset by the fact that there needs
to be a pointer to each of these codebooks.
Furthermore, since 5f8de7b74147e2a347481d7bc900ebecba6f340f the content
of the Atrac3pSpecCodeTab structure (containing data for spectrum
decoding) can be cleanly separated into fields that are only used during
initialization and fields used during actual decoding: The pointers to
the codebooks and the field indicating whether an earlier codebook should
be reused constitute the former category. Therefore the new codebooks are
not placed into the Atrac3pSpecCodeTab (which is now unused during
init), but in an array of its own. The information whether an earlier
codebook should be reused is encoded in the first number of each
spectrum codebook: If it is negative, an earlier codebook (given by the
number) should be reused.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/mvcdec.c')
0 files changed, 0 insertions, 0 deletions