CI13LC SDK API手册  2.1.1
本手册用于描述CI13LC SDK各个组件和驱动API
mp3common.h
浏览该文件的文档.
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 "mp3statname.h" /* do name-mangling for static linking */
49 #include "sdk_default_config.h"
50 
51 #define MAX_SCFBD 4 /* max scalefactor bands per channel */
52 #define NGRANS_MPEG1 2
53 #define NGRANS_MPEG2 1
54 
55 /* 11-bit syncword if MPEG 2.5 extensions are enabled */
56 #define SYNCWORDH 0xff
57 #define SYNCWORDL 0xe0
58 
59 /* 12-bit syncword if MPEG 1,2 only are supported
60  * #define SYNCWORDH 0xff
61  * #define SYNCWORDL 0xf0
62  */
63 
64 typedef struct _MP3DecInfo {
65  /* pointers to platform-specific data structures */
67  void *SideInfoPS;
71  void *IMDCTInfoPS;
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 */
82  int bitrate;
83  int nChans;
84  int samprate;
85  int nGrans; /* granules per frame */
86  int nGranSamps; /* samples per granule */
87  int nSlots;
88  int layer;
90 
93 
95 
96 } MP3DecInfo;
97 
98 typedef struct _SFBandTable {
99  short l[23];
100  short s[14];
101 } SFBandTable;
102 
103 /* decoder functions which must be implemented for each platform */
105 void FreeBuffers(MP3DecInfo *mp3DecInfo);
106 void ClearBuffers(MP3DecInfo *mp3DecInfo);
107 int CheckPadBit(MP3DecInfo *mp3DecInfo);
108 int UnpackFrameHeader(MP3DecInfo *mp3DecInfo, unsigned char *buf);
109 int UnpackSideInfo(MP3DecInfo *mp3DecInfo, unsigned char *buf);
110 int DecodeHuffman(MP3DecInfo *mp3DecInfo, unsigned char *buf, int *bitOffset, int huffBlockBits, int gr, int ch);
111 int Dequantize(MP3DecInfo *mp3DecInfo, int gr);
112 int IMDCT(MP3DecInfo *mp3DecInfo, int gr, int ch);
113 int UnpackScaleFactors(MP3DecInfo *mp3DecInfo, unsigned char *buf, int *bitOffset, int bitsAvail, int gr, int ch);
114 int Subband(MP3DecInfo *mp3DecInfo, short *pcmBuf);
115 
116 #ifdef USE_OUTSIDE_MP3_TABLE
117 /* mp3tabs.c - global ROM tables */
118 extern int (* samplerateTab)[3];
119 extern short (* bitrateTab)[3][15];
120 extern short (* samplesPerFrameTab)[3];
121 extern short * bitsPerSlotTab;
122 extern short (* sideBytesTab)[2];
123 extern short (* slotTab)[3][15];
124 extern SFBandTable (* sfBandTable)[3];
125 #else
126 /* mp3tabs.c - global ROM tables */
127 extern const int samplerateTab[3][3];
128 extern const short bitrateTab[3][3][15];
129 extern const short samplesPerFrameTab[3][3];
130 extern const short bitsPerSlotTab[3];
131 extern const short sideBytesTab[3][2];
132 extern const short slotTab[3][3][15];
133 extern const SFBandTable sfBandTable[3][3];
134 #endif /* USE_OUTSIDE_MP3_TABLE */
135 
136 #endif /* _MP3COMMON_H */
_DIF_ _DIF_ const short bitrateTab[3][3][15]
Definition: mp3tabs.c:86
_DIF_ const short slotTab[3][3][15]
Definition: mp3tabs.c:132
int nGranSamps
Definition: mp3common.h:86
void * SideInfoPS
Definition: mp3common.h:67
void * ScaleFactorInfoPS
Definition: mp3common.h:68
void * IMDCTInfoPS
Definition: mp3common.h:71
unsigned char mainBuf[MAINBUF_SIZE]
Definition: mp3common.h:75
void * HuffmanInfoPS
Definition: mp3common.h:69
_XIF_ int DecodeHuffman(MP3DecInfo *mp3DecInfo, unsigned char *buf, int *bitOffset, int huffBlockBits, int gr, int ch)
Definition: mp3huffman.c:388
short l[23]
Definition: mp3common.h:99
#define MAINBUF_SIZE
Definition: mp3dec.h:70
_XIF_ void FreeBuffers(MP3DecInfo *mp3DecInfo)
Definition: mp3buffers.c:221
int nChans
Definition: mp3common.h:83
_XIF_ MP3DecInfo * AllocateBuffers(void)
Definition: mp3buffers.c:118
_XIF_ int UnpackFrameHeader(MP3DecInfo *mp3DecInfo, unsigned char *buf)
Definition: mp3bitstream.c:218
int freeBitrateFlag
Definition: mp3common.h:78
int mainDataBytes
Definition: mp3common.h:92
int part23Length[MAX_NGRAN][MAX_NCHAN]
Definition: mp3common.h:94
int samprate
Definition: mp3common.h:84
struct _SFBandTable SFBandTable
short s[14]
Definition: mp3common.h:100
_XIF_ int UnpackSideInfo(MP3DecInfo *mp3DecInfo, unsigned char *buf)
Definition: mp3bitstream.c:299
_DIF_ const short bitsPerSlotTab[3]
Definition: mp3tabs.c:117
_DIF_ const int samplerateTab[3][3]
Definition: mp3tabs.c:75
MPEGVersion version
Definition: mp3common.h:89
Definition: mp3common.h:64
_XIF_ int Dequantize(MP3DecInfo *mp3DecInfo, int gr)
Definition: mp3dequant.c:73
_DIF_ const short sideBytesTab[3][2]
Definition: mp3tabs.c:122
int mainDataBegin
Definition: mp3common.h:91
int bitrate
Definition: mp3common.h:82
_XIF_ int Subband(MP3DecInfo *mp3DecInfo, short *pcmBuf)
Definition: mp3subband.c:60
_XIF_ int UnpackScaleFactors(MP3DecInfo *mp3DecInfo, unsigned char *buf, int *bitOffset, int bitsAvail, int gr, int ch)
Definition: mp3scalfact.c:356
_DIF_ const short samplesPerFrameTab[3][3]
Definition: mp3tabs.c:110
MPEGVersion
Definition: mp3dec.h:77
void * SubbandInfoPS
Definition: mp3common.h:72
_XIF_ int CheckPadBit(MP3DecInfo *mp3DecInfo)
Definition: mp3bitstream.c:188
int freeBitrateSlots
Definition: mp3common.h:79
_XIF_ int IMDCT(MP3DecInfo *mp3DecInfo, int gr, int ch)
Definition: mp3imdct.c:717
void * DequantInfoPS
Definition: mp3common.h:70
_DIF_ const SFBandTable sfBandTable[3][3]
Definition: mp3tabs.c:157
int layer
Definition: mp3common.h:88
#define MAX_NCHAN
Definition: mp3dec.h:73
struct _MP3DecInfo MP3DecInfo
void * FrameHeaderPS
Definition: mp3common.h:66
Definition: mp3common.h:98
int nSlots
Definition: mp3common.h:87
#define MAX_NGRAN
Definition: mp3dec.h:72
sdk配置文件
int nGrans
Definition: mp3common.h:85
_XIF_ void ClearBuffers(MP3DecInfo *mp3DecInfo)
Definition: mp3buffers.c:253