live
MP3InternalsHuffman.hh
Go to the documentation of this file.
1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// "liveMedia"
17// Copyright (c) 1996-2024 Live Networks, Inc. All rights reserved.
18// MP3 internal implementation details (Huffman encoding)
19// C++ header
20
21#ifndef _MP3_INTERNALS_HUFFMAN_HH
22#define _MP3_INTERNALS_HUFFMAN_HH
23
24#ifndef _MP3_INTERNALS_HH
25#include "MP3Internals.hh"
26#endif
27
29 unsigned char const* mainDataPtr,
30 unsigned p23L0, unsigned p23L1,
31 unsigned& part23Length0a,
32 unsigned& part23Length0aTruncation,
33 unsigned& part23Length0b,
34 unsigned& part23Length0bTruncation,
35 unsigned& part23Length1a,
36 unsigned& part23Length1aTruncation,
37 unsigned& part23Length1b,
38 unsigned& part23Length1bTruncation);
39
40#define SSLIMIT 18
41
43public:
44 MP3HuffmanEncodingInfo(Boolean includeDecodedValues = False);
46
47public:
48 unsigned numSamples;
50 unsigned reg1Start, reg2Start, bigvalStart; /* special bit offsets */
51 unsigned* decodedValues;
52};
53
54/* forward */
56 unsigned char const* fromBasePtr,
57 unsigned fromBitOffset, unsigned fromLength,
58 unsigned& scaleFactorsLength,
60
61extern unsigned char huffdec[]; // huffman table data
62
63// The following are used if we process Huffman-decoded values
64#ifdef FOUR_BYTE_SAMPLES
65#define BYTES_PER_SAMPLE_VALUE 4
66#else
67#ifdef TWO_BYTE_SAMPLES
68#define BYTES_PER_SAMPLE_VALUE 2
69#else
70// ONE_BYTE_SAMPLES
71#define BYTES_PER_SAMPLE_VALUE 1
72#endif
73#endif
74
75#ifdef DO_HUFFMAN_ENCODING
76unsigned MP3HuffmanEncode(MP3SideInfo::gr_info_s_t const* gr,
77 unsigned char const* fromPtr,
78 unsigned char* toPtr, unsigned toBitOffset,
79 unsigned numHuffBits);
80#endif
81
82#endif
const Boolean False
Definition: Boolean.hh:28
unsigned char Boolean
Definition: Boolean.hh:25
void updateSideInfoForHuffman(MP3SideInfo &sideInfo, Boolean isMPEG2, unsigned char const *mainDataPtr, unsigned p23L0, unsigned p23L1, unsigned &part23Length0a, unsigned &part23Length0aTruncation, unsigned &part23Length0b, unsigned &part23Length0bTruncation, unsigned &part23Length1a, unsigned &part23Length1aTruncation, unsigned &part23Length1b, unsigned &part23Length1bTruncation)
unsigned char huffdec[]
void MP3HuffmanDecode(MP3SideInfo::gr_info_s_t *gr, Boolean isMPEG2, unsigned char const *fromBasePtr, unsigned fromBitOffset, unsigned fromLength, unsigned &scaleFactorsLength, MP3HuffmanEncodingInfo &hei)
#define SSLIMIT
#define SBLIMIT
Definition: MP3Internals.hh:63
MP3HuffmanEncodingInfo(Boolean includeDecodedValues=False)
unsigned allBitOffsets[SBLIMIT *SSLIMIT+1]