Home | History | Annotate | Download | only in aacdec
      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  Pathname: LT_PRED_STATUS.h
     21 
     22 
     23 ------------------------------------------------------------------------------
     24  REVISION HISTORY
     25 
     26  Description:
     27  (1) Merged in #defines from ltp_common.h, thereby eliminating that file.
     28 
     29  Description:
     30  (1) Modified to include the lines...
     31 
     32     #ifdef __cplusplus
     33     extern "C" {
     34     #endif
     35 
     36     #ifdef __cplusplus
     37     }
     38     #endif
     39 
     40  (2) Updated the copyright header.
     41 
     42  Description: Moved large ltp_buffer up to s_tDec_Int_Chan.h, since this
     43  move allowed for other elements in this structure to be shared with
     44  the fxpCoef array.
     45 
     46  Description: Decreased size of LTP buffers from 4096 to 3072.  The upper 1024
     47  elements in the LTP buffers were never touched in the code.  This saves
     48  4 kilobytes in memory.
     49 
     50  Description: Decreased size of LTP buffers again from 3072 to 2048.  This
     51  time, I realized that 1024 elements were duplicated in the 32-bit array
     52  pVars->pChVars[]->time_quant.  Rather than copy this data EVERY frame
     53  from a 32-bit to a 16-bit LTP buffer, the data is accessed only
     54  when it is needed.  This saves both MIPS and memory.
     55 
     56  Who:                       Date:
     57  Description:
     58 ------------------------------------------------------------------------------
     59  INCLUDE DESCRIPTION
     60 
     61  define LT_PRED_STATUS structure for pulse data decoding.
     62 
     63 ------------------------------------------------------------------------------
     64 */
     65 
     66 /*----------------------------------------------------------------------------
     67 ; CONTINUE ONLY IF NOT ALREADY DEFINED
     68 ----------------------------------------------------------------------------*/
     69 #ifndef S_LT_PRED_STATUS_H
     70 #define S_LT_PRED_STATUS_H
     71 
     72 #ifdef __cplusplus
     73 extern "C"
     74 {
     75 #endif
     76 
     77     /*----------------------------------------------------------------------------
     78     ; INCLUDES
     79     ----------------------------------------------------------------------------*/
     80 #include "pv_audio_type_defs.h"
     81 #include "e_blockswitching.h"
     82 
     83     /*----------------------------------------------------------------------------
     84     ; MACROS
     85     ; Define module specific macros here
     86     ----------------------------------------------------------------------------*/
     87 
     88     /*----------------------------------------------------------------------------
     89     ; DEFINES
     90     ; Include all pre-processor statements here.
     91     ----------------------------------------------------------------------------*/
     92     /*
     93       Macro:    MAX_SHORT_WINDOWS
     94       Purpose:  Number of short windows in one long window.
     95       Explanation:  -  */
     96 #ifndef MAX_SHORT_WINDOWS
     97 #define MAX_SHORT_WINDOWS NSHORT
     98 #endif
     99 
    100     /*
    101       Macro:    MAX_SCFAC_BANDS
    102       Purpose:  Maximum number of scalefactor bands in one frame.
    103       Explanation:  -  */
    104 #ifndef MAX_SCFAC_BANDS
    105 #define MAX_SCFAC_BANDS MAXBANDS
    106 #endif
    107 
    108     /*
    109       Macro:    BLOCK_LEN_LONG
    110       Purpose:  Length of one long window
    111       Explanation:  -  */
    112 #ifndef BLOCK_LEN_LONG
    113 #define BLOCK_LEN_LONG LN2
    114 #endif
    115 
    116 
    117     /*
    118       Macro:    LTP_MAX_BLOCK_LEN_LONG
    119       Purpose:  Informs the routine of the maximum block size used.
    120       Explanation:  This is needed since the TwinVQ long window
    121             is different from the AAC long window.  */
    122 #define LTP_MAX_BLOCK_LEN_LONG BLOCK_LEN_LONG //(2 * BLOCK_LEN_LONG)
    123 
    124     /*
    125       Macro:    LT_BLEN
    126       Purpose:  Length of the history buffer.
    127       Explanation:  Has to hold 2 long windows of time domain data.  */
    128 #ifndef LT_BLEN
    129 #define LT_BLEN (2 * LTP_MAX_BLOCK_LEN_LONG)
    130 #endif
    131 
    132     /*----------------------------------------------------------------------------
    133     ; EXTERNAL VARIABLES REFERENCES
    134     ; Declare variables used in this module but defined elsewhere
    135     ----------------------------------------------------------------------------*/
    136 
    137     /*----------------------------------------------------------------------------
    138     ; SIMPLE TYPEDEF'S
    139     ----------------------------------------------------------------------------*/
    140 
    141     /*----------------------------------------------------------------------------
    142     ; ENUMERATED TYPEDEF'S
    143     ----------------------------------------------------------------------------*/
    144 
    145     /*----------------------------------------------------------------------------
    146     ; STRUCTURES TYPEDEF'S
    147     ----------------------------------------------------------------------------*/
    148     /*
    149       Type:     LT_PRED_STATUS
    150       Purpose:  Type of the struct holding the LTP encoding parameters.
    151       Explanation:  -  */
    152     typedef struct
    153     {
    154         Int weight_index;
    155         Int win_prediction_used[MAX_SHORT_WINDOWS];
    156         Int sfb_prediction_used[MAX_SCFAC_BANDS];
    157         Bool ltp_data_present;
    158 
    159         Int delay[MAX_SHORT_WINDOWS];
    160     }
    161     LT_PRED_STATUS;
    162 
    163     /*----------------------------------------------------------------------------
    164     ; GLOBAL FUNCTION DEFINITIONS
    165     ; Function Prototype declaration
    166     ----------------------------------------------------------------------------*/
    167 
    168 #ifdef __cplusplus
    169 }
    170 #endif
    171 
    172 #endif /* S_LT_PRED_STATUS_H */
    173 
    174 
    175