mpc_types.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _MPC_TYPES_H_
00035 #define _MPC_TYPES_H_
00036 #ifdef WIN32
00037 #pragma once
00038 #endif
00039
00040 #include <stdlib.h>
00041 #include <memory.h>
00042
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046
00047 #ifdef _MSC_VER
00048 typedef __int8 mpc_int8_t;
00049 typedef unsigned __int8 mpc_uint8_t;
00050 typedef __int16 mpc_int16_t;
00051 typedef unsigned __int16 mpc_uint16_t;
00052 typedef __int32 mpc_int32_t;
00053 typedef unsigned __int32 mpc_uint32_t;
00054 typedef __int64 mpc_int64_t;
00055 typedef unsigned __int64 mpc_uint64_t;
00056 #define mpc_inline __inline
00057 #else
00058 #include <stdint.h>
00059 typedef int8_t mpc_int8_t;
00060 typedef uint8_t mpc_uint8_t;
00061 typedef int16_t mpc_int16_t;
00062 typedef uint16_t mpc_uint16_t;
00063 typedef int32_t mpc_int32_t;
00064 typedef uint32_t mpc_uint32_t;
00065 typedef int64_t mpc_int64_t;
00066 typedef uint64_t mpc_uint64_t;
00067 #define mpc_inline inline
00068 #endif
00069
00070 typedef int mpc_int_t;
00071 typedef unsigned int mpc_uint_t;
00072 typedef size_t mpc_size_t;
00073 typedef mpc_uint8_t mpc_bool_t;
00074
00075
00076 #ifdef LONG_SEEK_TABLE // define as needed (mpc_uint32_t supports files up to 512 MB)
00077 typedef mpc_uint64_t mpc_seek_t;
00078 #else
00079 typedef mpc_uint32_t mpc_seek_t;
00080 #endif
00081
00082 # define mpc_int64_min -9223372036854775808ll
00083 # define mpc_int64_max 9223372036854775807ll
00084
00085 typedef struct mpc_quantizer {
00086 mpc_int16_t L [36];
00087 mpc_int16_t R [36];
00088 } mpc_quantizer;
00089
00091 typedef enum mpc_status {
00092 MPC_STATUS_OK = 0,
00093 MPC_STATUS_FILE = -1,
00094 MPC_STATUS_SV7BETA = -2,
00095 MPC_STATUS_CBR = -3,
00096 MPC_STATUS_IS = -4,
00097 MPC_STATUS_BLOCKSIZE = -5,
00098 MPC_STATUS_INVALIDSV = -6
00099 } mpc_status;
00100
00101
00102 #define MPC_FIXED_POINT_SHIFT 16
00103
00104 #ifdef MPC_FIXED_POINT
00105 # define MPC_FIXED_POINT_FRACTPART 14
00106 # define MPC_FIXED_POINT_SCALE_SHIFT (MPC_FIXED_POINT_SHIFT + MPC_FIXED_POINT_FRACTPART)
00107 # define MPC_FIXED_POINT_SCALE (1 << (MPC_FIXED_POINT_SCALE_SHIFT - 1))
00108 typedef mpc_int32_t MPC_SAMPLE_FORMAT;
00109 #else
00110 typedef float MPC_SAMPLE_FORMAT;
00111 #endif
00112
00113 enum {
00114 MPC_FALSE = 0,
00115 MPC_TRUE = !MPC_FALSE
00116 };
00117
00119 #if defined _WIN32
00120 # define mpc_cdecl __cdecl
00121 #elif defined __ZTC__
00122 # define mpc_cdecl _cdecl
00123 #elif defined __TURBOC__
00124 # define mpc_cdecl cdecl
00125 #else
00126 # define mpc_cdecl
00127 #endif
00128
00129 #ifdef __GNUC__
00130 # define MPC_API __attribute__ ((visibility("default")))
00131 #else
00132 # define MPC_API
00133 #endif
00134
00135 #ifdef __cplusplus
00136 }
00137 #endif
00138 #endif