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: PVMP4AudioDecoderGetMemRequirements.c
     21 
     22 ------------------------------------------------------------------------------
     23  REVISION HISTORY
     24 
     25  Description:  Copied from aac_decode_frame
     26 
     27  Description: Cleaned up.
     28 
     29  Description: (1) use UInt32 to replace size_t type
     30               (2) memory of tDec_Int_File is splitted into 3 pieces,
     31                   sizeof(tDec_Int_File) is only part of the total memory
     32                   required. The additional memory required to decode per
     33                   channel information is allocated by a DPI call outside this
     34                   API
     35 
     36  Who:                                   Date: MM/DD/YYYY
     37  Description:
     38 
     39 ------------------------------------------------------------------------------
     40  INPUT AND OUTPUT DEFINITIONS
     41 
     42  Inputs: None
     43 
     44  Local Stores/Buffers/Pointers Needed: None
     45 
     46  Global Stores/Buffers/Pointers Needed: None
     47 
     48  Outputs:
     49     size = amount of memory needed to be allocated by the calling
     50         environment.
     51 
     52  Pointers and Buffers Modified: None
     53 
     54  Local Stores Modified: None
     55 
     56  Global Stores Modified: None
     57 
     58 ------------------------------------------------------------------------------
     59  FUNCTION DESCRIPTION
     60 
     61  This function returns the amount of internal memory needed by the library.
     62  Presently this is a constant value, but could later be more sophisticated
     63  by taking into account mono or stereo, and whether LTP is to be used.
     64 
     65 ------------------------------------------------------------------------------
     66  REQUIREMENTS
     67 
     68 
     69 ------------------------------------------------------------------------------
     70  REFERENCES
     71 
     72 
     73 ------------------------------------------------------------------------------
     74  PSEUDO-CODE
     75 
     76     size = sizeof(tDec_Int_File);
     77 
     78  RETURN (size)
     79 
     80 ------------------------------------------------------------------------------
     81  RESOURCES USED
     82    When the code is written for a specific target processor the
     83      the resources used should be documented below.
     84 
     85  STACK USAGE: [stack count for this module] + [variable to represent
     86           stack usage for each subroutine called]
     87 
     88      where: [stack usage variable] = stack usage for [subroutine
     89          name] (see [filename].ext)
     90 
     91  DATA MEMORY USED: x words
     92 
     93  PROGRAM MEMORY USED: x words
     94 
     95  CLOCK CYCLES: [cycle count equation for this module] + [variable
     96            used to represent cycle count for each subroutine
     97            called]
     98 
     99      where: [cycle count variable] = cycle count for [subroutine
    100         name] (see [filename].ext)
    101 
    102 ------------------------------------------------------------------------------
    103 */
    104 
    105 
    106 /*----------------------------------------------------------------------------
    107 ; INCLUDES
    108 ----------------------------------------------------------------------------*/
    109 
    110 #include "pv_audio_type_defs.h"
    111 #include "s_tdec_int_file.h"
    112 #include "pvmp4audiodecoder_api.h" /* Where this function is declared */
    113 
    114 /*----------------------------------------------------------------------------
    115 ; MACROS
    116 ; Define module specific macros here
    117 ----------------------------------------------------------------------------*/
    118 
    119 /*----------------------------------------------------------------------------
    120 ; DEFINES
    121 ; Include all pre-processor statements here. Include conditional
    122 ; compile variables also.
    123 ----------------------------------------------------------------------------*/
    124 
    125 /*----------------------------------------------------------------------------
    126 ; LOCAL FUNCTION DEFINITIONS
    127 ; Function Prototype declaration
    128 ----------------------------------------------------------------------------*/
    129 
    130 /*----------------------------------------------------------------------------
    131 ; LOCAL VARIABLE DEFINITIONS
    132 ; Variable declaration - defined here and used outside this module
    133 ----------------------------------------------------------------------------*/
    134 
    135 /*----------------------------------------------------------------------------
    136 ; EXTERNAL FUNCTION REFERENCES
    137 ; Declare functions defined elsewhere and referenced in this module
    138 ----------------------------------------------------------------------------*/
    139 
    140 /*----------------------------------------------------------------------------
    141 ; EXTERNAL VARIABLES REFERENCES
    142 ; Declare variables used in this module but defined elsewhere
    143 ----------------------------------------------------------------------------*/
    144 
    145 /*----------------------------------------------------------------------------
    146 ; FUNCTION CODE
    147 ----------------------------------------------------------------------------*/
    148 OSCL_EXPORT_REF UInt32 PVMP4AudioDecoderGetMemRequirements(void)
    149 {
    150     UInt32 size;
    151 
    152     size = (UInt32) sizeof(tDec_Int_File);
    153 
    154     return (size);
    155 
    156 } /* PVMP4AudioDecoderGetMemRequirements() */
    157 
    158