OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
mp3common.h
Go to the documentation of this file.
1/* ***** BEGIN LICENSE BLOCK *****
2 * Version: RCSL 1.0/RPSL 1.0
3 *
4 * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved.
5 *
6 * The contents of this file, and the files included with this file, are
7 * subject to the current version of the RealNetworks Public Source License
8 * Version 1.0 (the "RPSL") available at
9 * http://www.helixcommunity.org/content/rpsl unless you have licensed
10 * the file under the RealNetworks Community Source License Version 1.0
11 * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl,
12 * in which case the RCSL will apply. You may also obtain the license terms
13 * directly from RealNetworks. You may not use this file except in
14 * compliance with the RPSL or, if you have a valid RCSL with RealNetworks
15 * applicable to this file, the RCSL. Please see the applicable RPSL or
16 * RCSL for the rights, obligations and limitations governing use of the
17 * contents of the file.
18 *
19 * This file is part of the Helix DNA Technology. RealNetworks is the
20 * developer of the Original Code and owns the copyrights in the portions
21 * it created.
22 *
23 * This file, and the files included with this file, is distributed and made
24 * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
25 * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES,
26 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
27 * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
28 *
29 * Technology Compatibility Kit Test Suite(s) Location:
30 * http://www.helixcommunity.org/content/tck
31 *
32 * Contributor(s):
33 *
34 * ***** END LICENSE BLOCK ***** */
35
36/**************************************************************************************
37 * Fixed-point MP3 decoder
38 * Jon Recker (jrecker@real.com), Ken Cooke (kenc@real.com)
39 * June 2003
40 *
41 * mp3common.h - implementation-independent API's, datatypes, and definitions
42 **************************************************************************************/
43
44#ifndef _MP3COMMON_H
45#define _MP3COMMON_H
46
47#include "mp3dec.h"
48#include "statname.h" /* do name-mangling for static linking */
49
50#define MAX_SCFBD 4 /* max scalefactor bands per channel */
51#define NGRANS_MPEG1 2
52#define NGRANS_MPEG2 1
53
54/* 11-bit syncword if MPEG 2.5 extensions are enabled */
55/*
56#define SYNCWORDH 0xff
57#define SYNCWORDL 0xe0
58*/
59
60/* 12-bit syncword if MPEG 1,2 only are supported */
61#define SYNCWORDH 0xff
62#define SYNCWORDL 0xf0
63
64typedef struct _MP3DecInfo {
65 /* pointers to platform-specific data structures */
73
74 /* buffer which must be large enough to hold largest possible main_data section */
75 unsigned char mainBuf[MAINBUF_SIZE];
76
77 /* special info for "free" bitrate files */
80
81 /* user-accessible info */
83 int nChans;
85 int nGrans; /* granules per frame */
86 int nGranSamps; /* samples per granule */
87 int nSlots;
88 int layer;
90
93
95
97
98typedef struct _SFBandTable {
99 short l[23];
100 short s[14];
102
103/* decoder functions which must be implemented for each platform */
105void FreeBuffers(MP3DecInfo *mp3DecInfo);
106int CheckPadBit(MP3DecInfo *mp3DecInfo);
107int UnpackFrameHeader(MP3DecInfo *mp3DecInfo, unsigned char *buf);
108int UnpackSideInfo(MP3DecInfo *mp3DecInfo, unsigned char *buf);
109int DecodeHuffman(MP3DecInfo *mp3DecInfo, unsigned char *buf, int *bitOffset, int huffBlockBits, int gr, int ch);
110int Dequantize(MP3DecInfo *mp3DecInfo, int gr);
111int IMDCT(MP3DecInfo *mp3DecInfo, int gr, int ch);
112int UnpackScaleFactors(MP3DecInfo *mp3DecInfo, unsigned char *buf, int *bitOffset, int bitsAvail, int gr, int ch);
113int Subband(MP3DecInfo *mp3DecInfo, short *pcmBuf);
114
115/* mp3tabs.c - global ROM tables */
116extern const int samplerateTab[3][3];
117extern const short bitrateTab[3][3][15];
118extern const short samplesPerFrameTab[3][3];
119extern const short bitsPerSlotTab[3];
120extern const short sideBytesTab[3][2];
121extern const short slotTab[3][3][15];
122extern const SFBandTable sfBandTable[3][3];
123
124#endif /* _MP3COMMON_H */
struct _SFBandTable SFBandTable
const short sideBytesTab[3][2]
Definition mp3tabs.c:96
const short bitsPerSlotTab[3]
Definition mp3tabs.c:91
MP3DecInfo * AllocateBuffers(void)
Definition buffers.c:92
const short bitrateTab[3][3][15]
Definition mp3tabs.c:60
const short slotTab[3][3][15]
Definition mp3tabs.c:106
const short samplesPerFrameTab[3][3]
Definition mp3tabs.c:84
const int samplerateTab[3][3]
Definition mp3tabs.c:49
struct _MP3DecInfo MP3DecInfo
const SFBandTable sfBandTable[3][3]
Definition mp3tabs.c:131
#define MAX_NCHAN
Definition mp3dec.h:79
MPEGVersion
Definition mp3dec.h:83
#define MAINBUF_SIZE
Definition mp3dec.h:76
#define MAX_NGRAN
Definition mp3dec.h:78
#define UnpackScaleFactors
Definition statname.h:71
#define FreeBuffers
Definition statname.h:67
#define Dequantize
Definition statname.h:69
#define UnpackSideInfo
Definition statname.h:65
#define DecodeHuffman
Definition statname.h:68
#define UnpackFrameHeader
Definition statname.h:64
#define IMDCT
Definition statname.h:70
#define CheckPadBit
Definition statname.h:63
#define Subband
Definition statname.h:72
void * IMDCTInfoPS
Definition mp3common.h:71
MPEGVersion version
Definition mp3common.h:89
int part23Length[MAX_NGRAN][MAX_NCHAN]
Definition mp3common.h:94
int mainDataBegin
Definition mp3common.h:91
int mainDataBytes
Definition mp3common.h:92
void * FrameHeaderPS
Definition mp3common.h:66
void * DequantInfoPS
Definition mp3common.h:70
void * ScaleFactorInfoPS
Definition mp3common.h:68
void * SideInfoPS
Definition mp3common.h:67
int freeBitrateSlots
Definition mp3common.h:79
void * HuffmanInfoPS
Definition mp3common.h:69
unsigned char mainBuf[MAINBUF_SIZE]
Definition mp3common.h:75
void * SubbandInfoPS
Definition mp3common.h:72
int freeBitrateFlag
Definition mp3common.h:78
int nGranSamps
Definition mp3common.h:86
short l[23]
Definition mp3common.h:99
short s[14]
Definition mp3common.h:100