14f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber/* ------------------------------------------------------------------
24f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * Copyright (C) 1998-2009 PacketVideo
34f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber *
44f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
54f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * you may not use this file except in compliance with the License.
64f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * You may obtain a copy of the License at
74f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber *
84f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
94f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber *
104f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * Unless required by applicable law or agreed to in writing, software
114f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
124f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
134f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * express or implied.
144f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * See the License for the specific language governing permissions
154f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * and limitations under the License.
164f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber * -------------------------------------------------------------------
174f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber */
184f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber/****************************************************************************************
194f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas HuberPortions of this file are derived from the following 3GPP standard:
204f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
214f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    3GPP TS 26.073
224f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
234f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    Available from http://www.3gpp.org
244f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
254f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
264f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas HuberPermission to distribute, modify and use this file under the standard license
274f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huberterms listed above has been obtained from the copyright holder.
284f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber****************************************************************************************/
294f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber/*
304f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
314f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber Filename: /audio/gsm_amr/c/include/log2_norm.h
324f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
334f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber------------------------------------------------------------------------------
344f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber REVISION HISTORY
354f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
364f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber Description: Created separate header file for Log2_norm function.
374f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
384f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber Description: Updated function prototype declaration to reflect new interface.
394f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber              A pointer to overflow flag is passed into the function. Updated
404f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber              template. Added extern declaration for log2_tbl[]
414f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
424f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber Description: Moved _cplusplus #ifdef after Include section.
434f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
444f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber Who:                       Date:
454f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber Description:
464f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
474f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber------------------------------------------------------------------------------
484f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber INCLUDE DESCRIPTION
494f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
504f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber This file contains the prototype declaration for Log2_norm function.
514f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
524f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber------------------------------------------------------------------------------
534f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber*/
544f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
554f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber/*----------------------------------------------------------------------------
564f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber; CONTINUE ONLY IF NOT ALREADY DEFINED
574f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber----------------------------------------------------------------------------*/
584f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#ifndef LOG2_NORM_H
594f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#define LOG2_NORM_H
604f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
614f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#define log2_h "$Id $"              /* Used by legacy code */
624f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
634f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber/*----------------------------------------------------------------------------
644f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber; INCLUDES
654f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber----------------------------------------------------------------------------*/
664f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#include    "typedef.h"
674f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
684f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber/*--------------------------------------------------------------------------*/
694f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#ifdef __cplusplus
704f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huberextern "C"
714f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber{
724f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#endif
734f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
744f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
754f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; MACROS
764f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; Define module specific macros here
774f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
784f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
794f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
804f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; DEFINES
814f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; Include all pre-processor statements here.
824f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
834f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
844f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
854f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; EXTERNAL VARIABLES REFERENCES
864f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; Declare variables used in this module but defined elsewhere
874f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
8893eec2bc24e3782420d76df52586c84a03669087Martin Storsjo    extern const Word16 log2_tbl[];
894f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
904f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; SIMPLE TYPEDEF'S
914f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
924f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
934f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
944f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; ENUMERATED TYPEDEF'S
954f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
964f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
974f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
984f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; STRUCTURES TYPEDEF'S
994f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
1004f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
1014f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
1024f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; GLOBAL FUNCTION DEFINITIONS
1034f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; Function Prototype declaration
1044f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
1054f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    void Log2_norm(
1064f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber        Word32 L_x,        /* (i) : input value (normalized)                    */
1074f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber        Word16 exp,        /* (i) : norm_l (L_x)                                */
1084f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber        Word16 *exponent,  /* (o) : Integer part of Log2.   (range: 0<=val<=30) */
1094f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber        Word16 *fraction   /* (o) : Fractional part of Log2. (range: 0<=val<1)  */
1104f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    );
1114f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
1124f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    /*----------------------------------------------------------------------------
1134f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ; END
1144f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber    ----------------------------------------------------------------------------*/
1154f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#ifdef __cplusplus
1164f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber}
1174f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#endif
1184f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber
1194f1efc098cb5791c3e9f483f2af84aef70d2d0a0Andreas Huber#endif /* _LOG2_NORM_H_ */
120