1b815c7f3Sopenharmony_ci/*
2b815c7f3Sopenharmony_ci * Copyright (c) 2011 Apple Inc. All rights reserved.
3b815c7f3Sopenharmony_ci *
4b815c7f3Sopenharmony_ci * @APPLE_APACHE_LICENSE_HEADER_START@
5b815c7f3Sopenharmony_ci *
6b815c7f3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License") ;
7b815c7f3Sopenharmony_ci * you may not use this file except in compliance with the License.
8b815c7f3Sopenharmony_ci * You may obtain a copy of the License at
9b815c7f3Sopenharmony_ci *
10b815c7f3Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
11b815c7f3Sopenharmony_ci *
12b815c7f3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
13b815c7f3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
14b815c7f3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15b815c7f3Sopenharmony_ci * See the License for the specific language governing permissions and
16b815c7f3Sopenharmony_ci * limitations under the License.
17b815c7f3Sopenharmony_ci *
18b815c7f3Sopenharmony_ci * @APPLE_APACHE_LICENSE_HEADER_END@
19b815c7f3Sopenharmony_ci */
20b815c7f3Sopenharmony_ci
21b815c7f3Sopenharmony_ci/*
22b815c7f3Sopenharmony_ci	File:		ALACDecoder.h
23b815c7f3Sopenharmony_ci*/
24b815c7f3Sopenharmony_ci
25b815c7f3Sopenharmony_ci#ifndef _ALACDECODER_H
26b815c7f3Sopenharmony_ci#define _ALACDECODER_H
27b815c7f3Sopenharmony_ci
28b815c7f3Sopenharmony_ci#include <stdint.h>
29b815c7f3Sopenharmony_ci
30b815c7f3Sopenharmony_ci#include "ALACAudioTypes.h"
31b815c7f3Sopenharmony_ci
32b815c7f3Sopenharmony_cistruct BitBuffer ;
33b815c7f3Sopenharmony_ci
34b815c7f3Sopenharmony_ciclass ALACDecoder
35b815c7f3Sopenharmony_ci{
36b815c7f3Sopenharmony_ci	public:
37b815c7f3Sopenharmony_ci		ALACDecoder () ;
38b815c7f3Sopenharmony_ci		~ALACDecoder () ;
39b815c7f3Sopenharmony_ci
40b815c7f3Sopenharmony_ci		int32_t	Init (void * inMagicCookie, uint32_t inMagicCookieSize) ;
41b815c7f3Sopenharmony_ci		int32_t	Decode (struct BitBuffer * bits, uint8_t * sampleBuffer, uint32_t numSamples, uint32_t numChannels, uint32_t * outNumSamples) ;
42b815c7f3Sopenharmony_ci
43b815c7f3Sopenharmony_ci	public:
44b815c7f3Sopenharmony_ci		// decoding parameters (public for use in the analyzer)
45b815c7f3Sopenharmony_ci		ALACSpecificConfig		mConfig ;
46b815c7f3Sopenharmony_ci
47b815c7f3Sopenharmony_ci	protected:
48b815c7f3Sopenharmony_ci		int32_t	FillElement (struct BitBuffer * bits) ;
49b815c7f3Sopenharmony_ci		int32_t	DataStreamElement (struct BitBuffer * bits) ;
50b815c7f3Sopenharmony_ci
51b815c7f3Sopenharmony_ci		uint16_t			mActiveElements ;
52b815c7f3Sopenharmony_ci
53b815c7f3Sopenharmony_ci		// decoding buffers
54b815c7f3Sopenharmony_ci		int32_t *			mMixBufferU ;
55b815c7f3Sopenharmony_ci		int32_t *			mMixBufferV ;
56b815c7f3Sopenharmony_ci		int32_t *			mPredictor ;
57b815c7f3Sopenharmony_ci		uint16_t *			mShiftBuffer ;	// note: this points to mPredictor's memory but different
58b815c7f3Sopenharmony_ci											//		 variable for clarity and type difference
59b815c7f3Sopenharmony_ci} ;
60b815c7f3Sopenharmony_ci
61b815c7f3Sopenharmony_ci#endif	/* _ALACDECODER_H */
62