|
libg722_1
0.0.1
|
00001 /* 00002 * broadvoice - a library for the BroadVoice 16 and 32 codecs 00003 * 00004 * broadvoice.h - 00005 * 00006 * Adapted by Steve Underwood <steveu@coppice.org> from code which is 00007 * Copyright 2000-2009 Broadcom Corporation 00008 * 00009 * All rights reserved. 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU Lesser General Public License version 2.1, 00013 * as published by the Free Software Foundation. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Lesser General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Lesser General Public 00021 * License along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00023 * 00024 * $Id: broadvoice.h,v 1.1.1.1 2009/11/19 12:10:48 steveu Exp $ 00025 */ 00026 00027 #if !defined(_BROADVOICE_BROADVOICE_H_) 00028 #define _BROADVOICE_BROADVOICE_H_ 00029 00030 #if defined(_M_IX86) || defined(_M_X64) 00031 #if defined(BROADVOICE_EXPORTS) 00032 #define BV_DECLARE(type) __declspec(dllexport) type __stdcall 00033 #define BV_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl 00034 #define BV_DECLARE_DATA __declspec(dllexport) 00035 #else 00036 #define BV_DECLARE(type) __declspec(dllimport) type __stdcall 00037 #define BV_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl 00038 #define BV_DECLARE_DATA __declspec(dllimport) 00039 #endif 00040 #elif defined(BROADVOICE_USE_EXPORT_CAPABILITY) && (defined(__GNUC__) || defined(__SUNCC__)) 00041 #define BV_DECLARE(type) __attribute__((visibility("default"))) type 00042 #define BV_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type 00043 #define BV_DECLARE_DATA __attribute__((visibility("default"))) 00044 #else 00045 #define BV_DECLARE(type) /**/ type 00046 #define BV_DECLARE_NONSTD(type) /**/ type 00047 #define BV_DECLARE_DATA /**/ 00048 #endif 00049 00050 typedef struct bv16_encode_state_s bv16_encode_state_t; 00051 typedef struct bv16_decode_state_s bv16_decode_state_t; 00052 typedef struct bv32_encode_state_s bv32_encode_state_t; 00053 typedef struct bv32_decode_state_s bv32_decode_state_t; 00054 00055 #define BV16_FRAME_LEN 40 00056 #define BV32_FRAME_LEN 80 00057 00058 #if defined(__cplusplus) 00059 extern "C" 00060 { 00061 #endif 00062 00063 BV_DECLARE(bv16_encode_state_t *) bv16_encode_init(bv16_encode_state_t *s); 00064 00065 BV_DECLARE(int) bv16_encode(bv16_encode_state_t *cs, 00066 uint8_t *out, 00067 const int16_t amp[], 00068 int len); 00069 00070 BV_DECLARE(int) bv16_encode_release(bv16_encode_state_t *s); 00071 00072 BV_DECLARE(int) bv16_encode_free(bv16_encode_state_t *s); 00073 00074 00075 BV_DECLARE(bv16_decode_state_t *) bv16_decode_init(bv16_decode_state_t *s); 00076 00077 BV_DECLARE(int) bv16_decode(bv16_decode_state_t *s, 00078 int16_t amp[], 00079 const uint8_t *in, 00080 int len); 00081 00082 BV_DECLARE(int) bv16_fillin(bv16_decode_state_t *s, 00083 int16_t amp[], 00084 int len); 00085 00086 BV_DECLARE(int) bv16_decode_release(bv16_decode_state_t *s); 00087 00088 BV_DECLARE(int) bv16_decode_free(bv16_decode_state_t *s); 00089 00090 00091 BV_DECLARE(bv32_encode_state_t *) bv32_encode_init(bv32_encode_state_t *s); 00092 00093 BV_DECLARE(int) bv32_encode(bv32_encode_state_t *s, 00094 uint8_t *out, 00095 const int16_t amp[], 00096 int len); 00097 00098 BV_DECLARE(int) bv32_encode_release(bv32_encode_state_t *s); 00099 00100 BV_DECLARE(int) bv32_encode_free(bv32_encode_state_t *s); 00101 00102 00103 BV_DECLARE(bv32_decode_state_t *) bv32_decode_init(bv32_decode_state_t *s); 00104 00105 BV_DECLARE(int) bv32_decode(bv32_decode_state_t *s, 00106 int16_t amp[], 00107 const uint8_t *in, 00108 int len); 00109 00110 BV_DECLARE(int) bv32_fillin(bv32_decode_state_t *ds, 00111 int16_t amp[], 00112 int len); 00113 00114 BV_DECLARE(int) bv32_decode_release(bv32_decode_state_t *s); 00115 00116 BV_DECLARE(int) bv32_decode_free(bv32_decode_state_t *s); 00117 00118 #if defined(__cplusplus) 00119 } 00120 #endif 00121 00122 #endif 00123 /*- End of file ------------------------------------------------------------*/