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 20 This software module was originally developed by 21 22 Mikko Suonio (Nokia) 23 24 in the course of development of the MPEG-2 NBC/MPEG-4 Audio standard 25 ISO/IEC 13818-7, 14496-1,2 and 3. This software module is an 26 implementation of a part of one or more MPEG-2 NBC/MPEG-4 Audio tools 27 as specified by the MPEG-2 NBC/MPEG-4 Audio standard. ISO/IEC gives 28 users of the MPEG-2 NBC/MPEG-4 Audio standards free license to this 29 software module or modifications thereof for use in hardware or 30 software products claiming conformance to the MPEG-2 NBC/ MPEG-4 Audio 31 standards. Those intending to use this software module in hardware or 32 software products are advised that this use may infringe existing 33 patents. The original developer of this software module and his/her 34 company, the subsequent editors and their companies, and ISO/IEC have 35 no liability for use of this software module or modifications thereof 36 in an implementation. Copyright is not released for non MPEG-2 37 NBC/MPEG-4 Audio conforming products. The original developer retains 38 full right to use the code for his/her own purpose, assign or donate 39 the code to a third party and to inhibit third party from using the 40 code for non MPEG-2 NBC/MPEG-4 Audio conforming products. This 41 copyright notice must be included in all copies or derivative works. 42 43 Copyright (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