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  Filename: sbr_constants.h
     21  Funtions:
     22 
     23 
     24 ------------------------------------------------------------------------------
     25  REVISION HISTORY
     26 
     27 
     28  Who:                                   Date: MM/DD/YYYY
     29  Description:
     30 ------------------------------------------------------------------------------
     31 SC 29 Software Copyright Licencing Disclaimer:
     32 
     33 This software module was originally developed by
     34   Coding Technologies
     35 
     36 and edited by
     37   -
     38 
     39 in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
     40 standards for reference purposes and its performance may not have been
     41 optimized. This software module is an implementation of one or more tools as
     42 specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
     43 ISO/IEC gives users free license to this software module or modifications
     44 thereof for use in products claiming conformance to audiovisual and
     45 image-coding related ITU Recommendations and/or ISO/IEC International
     46 Standards. ISO/IEC gives users the same free license to this software module or
     47 modifications thereof for research purposes and further ISO/IEC standardisation.
     48 Those intending to use this software module in products are advised that its
     49 use may infringe existing patents. ISO/IEC have no liability for use of this
     50 software module or modifications thereof. Copyright is not released for
     51 products that do not conform to audiovisual and image-coding related ITU
     52 Recommendations and/or ISO/IEC International Standards.
     53 The original developer retains full right to modify and use the code for its
     54 own purpose, assign or donate the code to a third party and to inhibit third
     55 parties from using the code for products that do not conform to audiovisual and
     56 image-coding related ITU Recommendations and/or ISO/IEC International Standards.
     57 This copyright notice must be included in all copies or derivative works.
     58 Copyright (c) ISO/IEC 2002.
     59 
     60 */
     61 
     62 /*----------------------------------------------------------------------------
     63 ; CONTINUE ONLY IF NOT ALREADY DEFINED
     64 ----------------------------------------------------------------------------*/
     65 #ifndef SBR_CONSTANTS_H
     66 #define SBR_CONSTANTS_H
     67 
     68 /*----------------------------------------------------------------------------
     69 ; INCLUDES
     70 ----------------------------------------------------------------------------*/
     71 
     72 /*----------------------------------------------------------------------------
     73 ; MACROS
     74 ; Define module specific macros here
     75 ----------------------------------------------------------------------------*/
     76 
     77 /*----------------------------------------------------------------------------
     78 ; DEFINES
     79 ; Include all pre-processor statements here.
     80 ----------------------------------------------------------------------------*/
     81 
     82 
     83 #define SBR_AMP_RES_1_5         0
     84 #define SBR_AMP_RES_3_0         1
     85 
     86 #define MAX_NOISE_ENVELOPES     2
     87 #define MAX_NOISE_COEFFS        5
     88 #define MAX_NUM_NOISE_VALUES     (MAX_NOISE_ENVELOPES * MAX_NOISE_COEFFS)
     89 
     90 #define MAX_ENVELOPES           5
     91 #define MAX_FREQ_COEFFS         58
     92 #define MAX_NUM_ENVELOPE_VALUES (MAX_ENVELOPES * MAX_FREQ_COEFFS)
     93 
     94 #define MAX_NUM_CHANNELS            2
     95 #define NOISE_FLOOR_OFFSET          6
     96 #define NOISE_FLOOR_OFFSET_PLUS_1   7
     97 
     98 #define LOW_RES                     0
     99 #define HIGH_RES                    1
    100 
    101 #define LO                          0
    102 #define HI                          1
    103 
    104 #define TIME                        1
    105 #define FREQ                        0
    106 
    107 #define LENGTH_FRAME_INFO           35
    108 
    109 #define SI_SBR_CRC_BITS             10
    110 
    111 #define SBR_FREQ_SCALE_DEFAULT      2
    112 #define SBR_ALTER_SCALE_DEFAULT     1
    113 #define SBR_NOISE_BANDS_DEFAULT     2
    114 
    115 #define SBR_LIMITER_BANDS_DEFAULT      2
    116 #define SBR_LIMITER_GAINS_DEFAULT      2
    117 #define SBR_INTERPOL_FREQ_DEFAULT      1
    118 #define SBR_SMOOTHING_LENGTH_DEFAULT   1
    119 
    120 /* header */
    121 #define SI_SBR_AMP_RES_BITS            1
    122 #define SI_SBR_START_FREQ_BITS         4
    123 #define SI_SBR_STOP_FREQ_BITS          4
    124 #define SI_SBR_XOVER_BAND_BITS         3
    125 #define SI_SBR_RESERVED_BITS_HDR       2
    126 #define SI_SBR_DATA_EXTRA_BITS         1
    127 #define SI_SBR_HEADER_EXTRA_1_BITS     1
    128 #define SI_SBR_HEADER_EXTRA_2_BITS     1
    129 
    130 #define SI_SBR_FREQ_SCALE_BITS         2
    131 #define SI_SBR_ALTER_SCALE_BITS        1
    132 #define SI_SBR_NOISE_BANDS_BITS        2
    133 
    134 #define SI_SBR_LIMITER_BANDS_BITS      2
    135 #define SI_SBR_LIMITER_GAINS_BITS      2
    136 #define SI_SBR_INTERPOL_FREQ_BITS      1
    137 #define SI_SBR_SMOOTHING_LENGTH_BITS   1
    138 
    139 
    140 /* data */
    141 #define SI_SBR_RESERVED_PRESENT        1
    142 #define SI_SBR_RESERVED_BITS_DATA      4
    143 
    144 #define SI_SBR_COUPLING_BITS           1
    145 
    146 #define SI_SBR_INVF_MODE_BITS          2
    147 
    148 #define SI_SBR_EXTENDED_DATA_BITS      1
    149 #define SI_SBR_EXTENSION_SIZE_BITS     4
    150 #define SI_SBR_EXTENSION_ESC_COUNT_BITS   8
    151 #define SI_SBR_EXTENSION_ID_BITS          2
    152 
    153 #define SI_SBR_NOISE_MODE_BITS         1
    154 #define SI_SBR_DOMAIN_BITS             1
    155 
    156 #define SI_SBR_START_ENV_BITS_AMP_RES_3_0           6
    157 #define SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_3_0   5
    158 #define SI_SBR_START_NOISE_BITS_AMP_RES_3_0         5
    159 #define SI_SBR_START_NOISE_BITS_BALANCE_AMP_RES_3_0 5
    160 
    161 #define SI_SBR_START_ENV_BITS_AMP_RES_1_5           7
    162 #define SI_SBR_START_ENV_BITS_BALANCE_AMP_RES_1_5   6
    163 
    164 
    165 #define SBR_CLA_BITS  2
    166 #define SBR_ABS_BITS  2
    167 #define SBR_RES_BITS  1
    168 #define SBR_REL_BITS  2
    169 #define SBR_ENV_BITS  2
    170 #define SBR_NUM_BITS  2
    171 
    172 
    173 #define FIXFIX  0
    174 #define FIXVAR  1
    175 #define VARFIX  2
    176 #define VARVAR  3
    177 
    178 
    179 #define    LEN_EX_TYPE  (4)
    180 #define    LEN_NIBBLE   (4)
    181 
    182 
    183 /*----------------------------------------------------------------------------
    184 ; EXTERNAL VARIABLES REFERENCES
    185 ; Declare variables used in this module but defined elsewhere
    186 ----------------------------------------------------------------------------*/
    187 
    188 /*----------------------------------------------------------------------------
    189 ; SIMPLE TYPEDEF'S
    190 ----------------------------------------------------------------------------*/
    191 
    192 /*----------------------------------------------------------------------------
    193 ; ENUMERATED TYPEDEF'S
    194 ----------------------------------------------------------------------------*/
    195 
    196 /*----------------------------------------------------------------------------
    197 ; STRUCTURES TYPEDEF'S
    198 ----------------------------------------------------------------------------*/
    199 
    200 /*----------------------------------------------------------------------------
    201 ; GLOBAL FUNCTION DEFINITIONS
    202 ; Function Prototype declaration
    203 ----------------------------------------------------------------------------*/
    204 
    205 /*----------------------------------------------------------------------------
    206 ; END
    207 ----------------------------------------------------------------------------*/
    208 #endif
    209 
    210 
    211