1/* ------------------------------------------------------------------
2 * Copyright (C) 1998-2009 PacketVideo
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13 * express or implied.
14 * See the License for the specific language governing permissions
15 * and limitations under the License.
16 * -------------------------------------------------------------------
17 */
18/**************************************************************************
19
20This software module was originally developed by
21
22Mikko Suonio (Nokia)
23
24in the course of development of the MPEG-2 NBC/MPEG-4 Audio standard
25ISO/IEC 13818-7, 14496-1,2 and 3. This software module is an
26implementation of a part of one or more MPEG-2 NBC/MPEG-4 Audio tools
27as specified by the MPEG-2 NBC/MPEG-4 Audio standard. ISO/IEC gives
28users of the MPEG-2 NBC/MPEG-4 Audio standards free license to this
29software module or modifications thereof for use in hardware or
30software products claiming conformance to the MPEG-2 NBC/ MPEG-4 Audio
31standards. Those intending to use this software module in hardware or
32software products are advised that this use may infringe existing
33patents. The original developer of this software module and his/her
34company, the subsequent editors and their companies, and ISO/IEC have
35no liability for use of this software module or modifications thereof
36in an implementation. Copyright is not released for non MPEG-2
37NBC/MPEG-4 Audio conforming products. The original developer retains
38full right to use the code for his/her own purpose, assign or donate
39the code to a third party and to inhibit third party from using the
40code for non MPEG-2 NBC/MPEG-4 Audio conforming products. This
41copyright notice must be included in all copies or derivative works.
42
43Copyright (c) 1997.
44
45***************************************************************************/
46
47#ifndef _LTP_COMMON_INTERNAL_H
48#define _LTP_COMMON_INTERNAL_H
49
50
51/*
52  Purpose:      Number of LTP coefficients. */
53#define LPC 1
54
55/*
56  Purpose:      Maximum LTP lag.  */
57#define DELAY 2048
58
59/*
60  Purpose:  Length of the bitstream element ltp_data_present.  */
61#define LEN_LTP_DATA_PRESENT 1
62
63/*
64  Purpose:  Length of the bitstream element ltp_lag.  */
65#define LEN_LTP_LAG 11
66
67/*
68  Purpose:  Length of the bitstream element ltp_coef.  */
69#define LEN_LTP_COEF 3
70
71/*
72  Purpose:  Length of the bitstream element ltp_short_used.  */
73#define LEN_LTP_SHORT_USED 1
74
75/*
76  Purpose:  Length of the bitstream element ltp_short_lag_present.  */
77#define LEN_LTP_SHORT_LAG_PRESENT 1
78
79/*
80  Purpose:  Length of the bitstream element ltp_short_lag.  */
81#define LEN_LTP_SHORT_LAG 5
82
83/*
84  Purpose:  Offset of the lags written in the bitstream.  */
85#define LTP_LAG_OFFSET 16
86
87/*
88  Purpose:  Length of the bitstream element ltp_long_used.  */
89#define LEN_LTP_LONG_USED 1
90
91/*
92  Purpose:  Upper limit for the number of scalefactor bands
93        which can use lt prediction with long windows.
94  Explanation:  Bands 0..MAX_LT_PRED_SFB-1 can use lt prediction.  */
95#define MAX_LT_PRED_LONG_SFB 40
96
97/*
98  Purpose:  Upper limit for the number of scalefactor bands
99        which can use lt prediction with short windows.
100  Explanation:  Bands 0..MAX_LT_PRED_SFB-1 can use lt prediction.  */
101#define MAX_LT_PRED_SHORT_SFB 13
102
103/*
104   Purpose:      Buffer offset to maintain block alignment.
105   Explanation:  This is only used for a short window sequence.  */
106#define SHORT_SQ_OFFSET (BLOCK_LEN_LONG-(BLOCK_LEN_SHORT*4+BLOCK_LEN_SHORT/2))
107
108/*
109  Purpose:  Number of codes for LTP weight. */
110#define CODESIZE 8
111
112/* number of scalefactor bands used for reconstruction for short windows */
113#define NUM_RECONSTRUCTED_SFB (8)
114
115#endif /* _LTP_COMMON_INTERNAL_H */
116