videoeditorengine/audioeditorengine/resampler/inc/resampler_data_types.h
branchRCL_3
changeset 3 e0b5df5c0969
parent 0 951a5db380a0
child 5 4c409de21d23
equal deleted inserted replaced
0:951a5db380a0 3:e0b5df5c0969
     1 #ifndef __RESAMPLER_DATA_TYPES_H__
       
     2 #define __RESAMPLER_DATA_TYPES_H__
       
     3 /*
       
     4 * Copyright (c) 2010 Ixonos Plc.
       
     5 * All rights reserved.
       
     6 * This component and the accompanying materials are made available
       
     7 * under the terms of the "Eclipse Public License v1.0"
       
     8 * which accompanies this distribution, and is available
       
     9 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    10 *
       
    11 * Initial Contributors:
       
    12 * Nokia Corporation - Initial contribution
       
    13 *
       
    14 * Contributors:
       
    15 * Ixonos Plc
       
    16 *
       
    17 * Description:
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #include <limits.h>
       
    23 #include <stddef.h>
       
    24 
       
    25 /* Disable some warnings so that code compiles cleanly with highest 
       
    26  * warning levels. These are all related to function inlining.
       
    27  */
       
    28 
       
    29 
       
    30 /* Disable warnings for Windows and WINS compilations */
       
    31 #if defined(_MSC_VER)
       
    32 /* unreferenced inline function has been removed */
       
    33 #pragma warning(disable: 4514) 
       
    34 
       
    35 /* function not inlined */
       
    36 #pragma warning(disable: 4710) 
       
    37 
       
    38 /* selected for automatic inline expansion */
       
    39 #pragma warning(disable: 4711)
       
    40 #endif
       
    41 
       
    42 /** @ingroup types
       
    43 
       
    44 @file resampler_data_types.h
       
    45 
       
    46 A header file for sized integer types.
       
    47 
       
    48 
       
    49 */
       
    50 
       
    51 typedef signed short int        int16;
       
    52 typedef signed long int         int24;
       
    53 typedef signed int              int32;
       
    54 
       
    55 typedef signed long long int    int40;
       
    56 typedef signed long long int    int48;
       
    57 typedef signed long long int    int64;
       
    58 
       
    59 typedef unsigned short int      uint16;
       
    60 typedef unsigned long int       uint24;
       
    61 typedef unsigned int            uint32;
       
    62 
       
    63 typedef unsigned long long int  uint40;
       
    64 typedef unsigned long long int  uint48;
       
    65 typedef unsigned long long int  uint64;
       
    66 
       
    67 #define RESAMPLER_INT16_MAX        ((int16)32767)
       
    68 #define RESAMPLER_INT16_MIN ((int16)(-32767 - 1))
       
    69 #define RESAMPLER_INT24_MAX             (8388607)
       
    70 #define RESAMPLER_INT24_MIN        (-8388607 - 1)
       
    71 #define RESAMPLER_INT32_MAX          (2147483647)
       
    72 #define RESAMPLER_INT32_MIN     (-2147483647 - 1)
       
    73 
       
    74 
       
    75 typedef enum RESAMPLER_DataType
       
    76 {
       
    77     /** Sixteen-bit data type (Q15) */
       
    78     RESAMPLER_DATA_TYPE_INT16 = 0,
       
    79     /** Twenty-four-bit data type (Q19) */
       
    80     RESAMPLER_DATA_TYPE_INT24,
       
    81     /** Thirty-two-bit data type (Q23) */
       
    82     RESAMPLER_DATA_TYPE_INT32,
       
    83     /** Thirty-two-bit data type (Q15) */
       
    84     RESAMPLER_DATA_TYPE_INT32_Q15,
       
    85     /** Floating-point data type */
       
    86     RESAMPLER_DATA_TYPE_FLOAT,
       
    87     /** Number of different data types */
       
    88     RESAMPLER_DATA_TYPE_COUNT
       
    89 } RESAMPLER_DataType;
       
    90 
       
    91 /** @return A string that describes @c aType.
       
    92  *
       
    93  *  @pre @c aType is a valid instance of @c RESAMPLER_DataType. */
       
    94 const char*  RESAMPLER_DataType_AsString(RESAMPLER_DataType aType);
       
    95 
       
    96 /** @return The @c RESAMPLER_TestDataType that corresponds to @c pString.
       
    97  *
       
    98  *  @pre @c pString is equal to "int16", "int24", "int32", "int32Q15", or "float. */
       
    99 RESAMPLER_DataType RESAMPLER_DataType_FromString(const char* pString);
       
   100 
       
   101 /** @return Whether @c aType is a valid instance of
       
   102  *          @c RESAMPLER_DataType. */
       
   103 int          RESAMPLER_DataType_IsValid(RESAMPLER_DataType aType);
       
   104 
       
   105 /** @return The size, in bytes, of an element of type @c aType.
       
   106  *
       
   107  *  @pre @c aType is a valid instance of @c RESAMPLER_DataType. */
       
   108 size_t       RESAMPLER_DataType_Size(RESAMPLER_DataType aType);
       
   109 
       
   110 #endif  /* __RESAMPLER_DATA_TYPES_H__ */