Home | History | Annotate | Download | only in src
      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    PacketVideo Corp.
     21    MP3 Decoder Library
     22 
     23    Filename: pvmp3_decode_header.h
     24 
     25    Date: 09/21/2007
     26 
     27 ------------------------------------------------------------------------------
     28  REVISION HISTORY
     29 
     30  Description:
     31 
     32 ------------------------------------------------------------------------------
     33  INCLUDE DESCRIPTION
     34 
     35 ------------------------------------------------------------------------------
     36 */
     37 
     38 /*----------------------------------------------------------------------------
     39 ; CONTINUE ONLY IF NOT ALREADY DEFINED
     40 ----------------------------------------------------------------------------*/
     41 #ifndef PVMP3_POLYPHASE_FILTER_WINDOW_H
     42 #define PVMP3_POLYPHASE_FILTER_WINDOW_H
     43 
     44 /*----------------------------------------------------------------------------
     45 ; INCLUDES
     46 ----------------------------------------------------------------------------*/
     47 
     48 #include "pvmp3_audio_type_defs.h"
     49 #include "s_tmp3dec_chan.h"
     50 
     51 /*----------------------------------------------------------------------------
     52 ; MACROS
     53 ; Define module specific macros here
     54 ----------------------------------------------------------------------------*/
     55 
     56 /*----------------------------------------------------------------------------
     57 ; DEFINES
     58 ; Include all pre-processor statements here.
     59 ----------------------------------------------------------------------------*/
     60 #define MAX_16BITS_INT  0x7FFF
     61 
     62 /*----------------------------------------------------------------------------
     63 ; EXTERNAL VARIABLES REFERENCES
     64 ; Declare variables used in this module but defined elsewhere
     65 ----------------------------------------------------------------------------*/
     66 
     67 /*----------------------------------------------------------------------------
     68 ; SIMPLE TYPEDEF'S
     69 ----------------------------------------------------------------------------*/
     70 
     71 /*----------------------------------------------------------------------------
     72 ; ENUMERATED TYPEDEF'S
     73 ----------------------------------------------------------------------------*/
     74 
     75 /*----------------------------------------------------------------------------
     76 ; STRUCTURES TYPEDEF'S
     77 ----------------------------------------------------------------------------*/
     78 
     79 /*----------------------------------------------------------------------------
     80 ; GLOBAL FUNCTION DEFINITIONS
     81 ; Function Prototype declaration
     82 ----------------------------------------------------------------------------*/
     83 
     84 #ifdef __cplusplus
     85 extern "C"
     86 {
     87 #endif
     88 
     89 
     90 #if (defined(PV_ARM_V5)||defined(PV_ARM_V4))
     91 
     92 
     93     __inline int16 saturate16(int32 sample)
     94     {
     95         int32 a;
     96         int32 b = 31;
     97         __asm
     98         {
     99             mov   a, sample, asr#15
    100             teq a, sample, asr b
    101             eorne sample, MAX_16BITS_INT, sample, asr#31
    102         }
    103         return sample ;
    104     }
    105 
    106 #else
    107 
    108     inline int16 saturate16(int32 sample)
    109     {
    110 
    111         if ((sample >> 15) ^(sample >> 31))
    112         {
    113             sample = MAX_16BITS_INT ^(sample >> 31);
    114         }
    115         return sample;
    116 
    117     }
    118 #endif
    119 
    120 
    121     void pvmp3_polyphase_filter_window(int32 *synth_buffer,
    122                                        int16 *outPcm,
    123                                        int32 numChannels);
    124 
    125 
    126 #ifdef __cplusplus
    127 }
    128 #endif
    129 
    130 /*----------------------------------------------------------------------------
    131 ; END
    132 ----------------------------------------------------------------------------*/
    133 #endif
    134 
    135 
    136 
    137 
    138 
    139