CI13LC SDK API手册  2.1.1
本手册用于描述CI13LC SDK各个组件和驱动API
mp3dec.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  * mp3dec.h - public C API for MP3 decoder
42  **************************************************************************************/
43 
44 #ifndef _MP3DEC_H
45 #define _MP3DEC_H
46 
47 
48 #if defined(__GNUC__) && (defined(ARM) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__))
49 #include "ci112x_system.h"
50 #include "core_cm4.h"
51 #elif defined(__ICCARM__)
52 #include "ci112x_system.h"
53 #include "core_cm4.h"
54 #else
55 #endif
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 #include <stdlib.h>
62 
63 //#define USE_OUTSIDE_MP3_TABLE
64 
65 /* determining MAINBUF_SIZE:
66  * max mainDataBegin = (2^9 - 1) bytes (since 9-bit offset) = 511
67  * max nSlots (concatenated with mainDataBegin bytes from before) = 1440 - 9 - 4 + 1 = 1428
68  * 511 + 1428 = 1939, round up to 1940 (4-byte align)
69  */
70 #define MAINBUF_SIZE 1940
71 
72 #define MAX_NGRAN 2 /* max granules */
73 #define MAX_NCHAN 2 /* max channels */
74 #define MAX_NSAMP 576 /* max samples per channel, per granule */
75 
76 /* map to 0,1,2 to make table indexing easier */
77 typedef enum {
78  MPEG1 = 0,
79  MPEG2 = 1,
80  MPEG25 = 2
81 } MPEGVersion;
82 
83 typedef void *HMP3Decoder;
84 typedef void *MP3SaveLastInfo;
85 
86 enum {
100 
102 };
103 
104 typedef struct _MP3FrameInfo {
105  int bitrate;
106  int nChans;
107  int samprate;
110  int layer;
111  int version;
112 } MP3FrameInfo;
113 
114 /* public API */
116 void MP3FreeDecoder(HMP3Decoder hMP3Decoder);
117 int MP3Decode(HMP3Decoder hMP3Decoder, unsigned char **inbuf, int *bytesLeft, short *outbuf, int useSize);
118 
119 size_t MP3GetSaveLastInfoStructSize(void);
120 int MP3ClearLastDecodeMainData(HMP3Decoder hMP3Decoder);
121 int MP3SaveLastDecodeMainData(HMP3Decoder hMP3Decoder,MP3SaveLastInfo saveInfo);
122 int MP3LoadLastDecodeMainData(HMP3Decoder hMP3Decoder,MP3SaveLastInfo saveInfo);
123 
124 void MP3GetLastFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo);
125 int MP3GetNextFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo, unsigned char *buf);
126 int MP3FindSyncWord(unsigned char *buf, int nBytes);
127 void MP3Lib_Set_Func(void* f1, void* f2,void* f3,void* f4,void* f5);
128 #ifdef USE_OUTSIDE_MP3_TABLE
129 void config_mp3hufftabs_point(void *p0,void *p1,void *p2);
130 void config_mp3trigtabs_point(void *p);
131 void config_mp3tab_point(void *p);
132 #endif
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif /* _MP3DEC_H */
Definition: mp3dec.h:95
HMP3Decoder MP3InitDecoder(void)
Definition: mp3dec.c:60
Definition: mp3dec.h:92
Definition: mp3dec.h:99
void MP3Lib_Set_Func(void *f1, void *f2, void *f3, void *f4, void *f5)
Definition: mp3dec.h:88
Definition: mp3dec.h:89
Definition: mp3dec.h:91
int version
Definition: mp3dec.h:111
int MP3ClearLastDecodeMainData(HMP3Decoder hMP3Decoder)
Definition: mp3dec.c:452
int samprate
Definition: mp3dec.h:107
void * MP3SaveLastInfo
Definition: mp3dec.h:84
Definition: mp3dec.h:80
struct _MP3FrameInfo MP3FrameInfo
int MP3Decode(HMP3Decoder hMP3Decoder, unsigned char **inbuf, int *bytesLeft, short *outbuf, int useSize)
Definition: mp3dec.c:281
size_t MP3GetSaveLastInfoStructSize(void)
Definition: mp3dec.c:434
int MP3LoadLastDecodeMainData(HMP3Decoder hMP3Decoder, MP3SaveLastInfo saveInfo)
Definition: mp3dec.c:494
Definition: mp3dec.h:79
void * HMP3Decoder
Definition: mp3dec.h:83
Definition: mp3dec.h:94
Definition: mp3dec.h:101
Definition: mp3dec.h:98
int nChans
Definition: mp3dec.h:106
Definition: mp3dec.h:87
int bitsPerSample
Definition: mp3dec.h:108
Definition: mp3dec.h:97
int MP3GetNextFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo, unsigned char *buf)
Definition: mp3dec.c:221
Definition: mp3dec.h:93
int MP3SaveLastDecodeMainData(HMP3Decoder hMP3Decoder, MP3SaveLastInfo saveInfo)
Definition: mp3dec.c:473
void MP3FreeDecoder(HMP3Decoder hMP3Decoder)
Definition: mp3dec.c:81
MPEGVersion
Definition: mp3dec.h:77
Definition: mp3dec.h:96
Definition: mp3dec.h:90
Definition: mp3dec.h:78
int bitrate
Definition: mp3dec.h:105
int layer
Definition: mp3dec.h:110
Definition: mp3dec.h:104
int outputSamps
Definition: mp3dec.h:109
void MP3GetLastFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo)
Definition: mp3dec.c:184
int MP3FindSyncWord(unsigned char *buf, int nBytes)
Definition: mp3dec.c:104