FastLED 3.9.15
Loading...
Searching...
No Matches
mp3dec.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 * mp3dec.h - public C API for MP3 decoder
42 **************************************************************************************/
43
44#ifndef _MP3DEC_H
45#define _MP3DEC_H
46
47#include "fl/stl/cstddef.h"
48#include "fl/stl/noexcept.h"
49
50#if defined(_WIN32) && !defined(_WIN32_WCE)
51#
52#elif defined(_WIN32) && defined(_WIN32_WCE) && defined(ARM)
53#
54#elif defined(_WIN32) && defined(WINCE_EMULATOR)
55#
56#elif defined(ARM_ADS)
57#
58#elif defined(_SYMBIAN) && defined(__WINS__) /* Symbian emulator for Ix86 */
59#
60#elif defined(__GNUC__) && defined(ARM)
61#
62#elif defined(__GNUC__) && defined(__i386__)
63#
64#elif defined(_OPENWAVE_SIMULATOR) || defined(_OPENWAVE_ARMULATOR)
65#
66#else
67//#error No platform defined. See valid options in mp3dec.h
68#endif
69
70/* determining MAINBUF_SIZE:
71 * max mainDataBegin = (2^9 - 1) bytes (since 9-bit offset) = 511
72 * max nSlots (concatenated with mainDataBegin bytes from before) = 1440 - 9 - 4 + 1 = 1428
73 * 511 + 1428 = 1939, round up to 1940 (4-byte align)
74 */
75#define MAINBUF_SIZE 1940
76
77#define MAX_NGRAN 2 /* max granules */
78#define MAX_NCHAN 2 /* max channels */
79#define MAX_NSAMP 576 /* max samples per channel, per granule */
80
81/* map to 0,1,2 to make table indexing easier */
82typedef enum {
83 MPEG1 = 0,
84 MPEG2 = 1,
87
88typedef void *HMP3Decoder;
89
90enum {
104
106};
107
117
118#ifdef __cplusplus
119namespace fl {
120namespace third_party {
121#endif
122
123/* Internal API - all symbols in fl::third_party namespace */
126int MP3Decode(HMP3Decoder hMP3Decoder, const unsigned char **inbuf, size_t *bytesLeft, short *outbuf, int useSize) FL_NOEXCEPT;
127
129int MP3GetNextFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo, unsigned char *buf) FL_NOEXCEPT;
130int MP3FindSyncWord(const unsigned char *buf, int nBytes) FL_NOEXCEPT;
131
132#ifdef __cplusplus
133} // namespace third_party
134} // namespace fl
135#endif
136
137#endif /* _MP3DEC_H */
@ ERR_MP3_INVALID_SCALEFACT
Definition mp3dec.h:99
@ ERR_MP3_INVALID_IMDCT
Definition mp3dec.h:102
@ ERR_MP3_NONE
Definition mp3dec.h:91
@ ERR_MP3_INDATA_UNDERFLOW
Definition mp3dec.h:92
@ ERR_MP3_MAINDATA_UNDERFLOW
Definition mp3dec.h:93
@ ERR_MP3_INVALID_HUFFCODES
Definition mp3dec.h:100
@ ERR_UNKNOWN
Definition mp3dec.h:105
@ ERR_MP3_OUT_OF_MEMORY
Definition mp3dec.h:95
@ ERR_MP3_INVALID_FRAMEHEADER
Definition mp3dec.h:97
@ ERR_MP3_INVALID_SUBBAND
Definition mp3dec.h:103
@ ERR_MP3_INVALID_DEQUANTIZE
Definition mp3dec.h:101
@ ERR_MP3_FREE_BITRATE_SYNC
Definition mp3dec.h:94
@ ERR_MP3_INVALID_SIDEINFO
Definition mp3dec.h:98
@ ERR_MP3_NULL_POINTER
Definition mp3dec.h:96
void * HMP3Decoder
Definition mp3dec.h:88
struct _MP3FrameInfo MP3FrameInfo
MPEGVersion
Definition mp3dec.h:82
@ MPEG25
Definition mp3dec.h:85
@ MPEG2
Definition mp3dec.h:84
@ MPEG1
Definition mp3dec.h:83
int outputSamps
Definition mp3dec.h:113
int bitsPerSample
Definition mp3dec.h:112
int MP3FindSyncWord(const unsigned char *buf, int nBytes) FL_NOEXCEPT
Definition mp3dec.hpp:116
void MP3FreeDecoder(HMP3Decoder hMP3Decoder) FL_NOEXCEPT
Definition mp3dec.hpp:93
HMP3Decoder MP3InitDecoder(void) FL_NOEXCEPT
Definition mp3dec.hpp:72
int MP3Decode(HMP3Decoder hMP3Decoder, const unsigned char **inbuf, size_t *bytesLeft, short *outbuf, int useSize) FL_NOEXCEPT
Definition mp3dec.hpp:292
void MP3GetLastFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo) FL_NOEXCEPT
Definition mp3dec.hpp:196
int MP3GetNextFrameInfo(HMP3Decoder hMP3Decoder, MP3FrameInfo *mp3FrameInfo, unsigned char *buf) FL_NOEXCEPT
Definition mp3dec.hpp:233
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT