niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
leozwang@webrtc.org | 91b359e | 2012-02-28 17:26:14 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | /****************************************************************** |
| 12 | |
| 13 | iLBC Speech Coder ANSI-C Source Code |
| 14 | |
| 15 | iLBCInterface.c |
| 16 | |
| 17 | ******************************************************************/ |
| 18 | |
| 19 | #include "ilbc.h" |
| 20 | #include "defines.h" |
| 21 | #include "init_encode.h" |
| 22 | #include "encode.h" |
| 23 | #include "init_decode.h" |
| 24 | #include "decode.h" |
| 25 | #include <stdlib.h> |
| 26 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 27 | int16_t WebRtcIlbcfix_EncoderAssign(IlbcEncoderInstance** iLBC_encinst, |
| 28 | int16_t* ILBCENC_inst_Addr, |
| 29 | int16_t* size) { |
| 30 | *iLBC_encinst=(IlbcEncoderInstance*)ILBCENC_inst_Addr; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 31 | *size=sizeof(IlbcEncoder)/sizeof(int16_t); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 32 | if (*iLBC_encinst!=NULL) { |
| 33 | return(0); |
| 34 | } else { |
| 35 | return(-1); |
| 36 | } |
| 37 | } |
| 38 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 39 | int16_t WebRtcIlbcfix_DecoderAssign(IlbcDecoderInstance** iLBC_decinst, |
| 40 | int16_t* ILBCDEC_inst_Addr, |
| 41 | int16_t* size) { |
| 42 | *iLBC_decinst=(IlbcDecoderInstance*)ILBCDEC_inst_Addr; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 43 | *size=sizeof(IlbcDecoder)/sizeof(int16_t); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 44 | if (*iLBC_decinst!=NULL) { |
| 45 | return(0); |
| 46 | } else { |
| 47 | return(-1); |
| 48 | } |
| 49 | } |
| 50 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 51 | int16_t WebRtcIlbcfix_EncoderCreate(IlbcEncoderInstance **iLBC_encinst) { |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 52 | *iLBC_encinst=(IlbcEncoderInstance*)malloc(sizeof(IlbcEncoder)); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 53 | if (*iLBC_encinst!=NULL) { |
kma@webrtc.org | ac4d70d | 2012-10-05 00:19:01 +0000 | [diff] [blame] | 54 | WebRtcSpl_Init(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 55 | return(0); |
| 56 | } else { |
| 57 | return(-1); |
| 58 | } |
| 59 | } |
| 60 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 61 | int16_t WebRtcIlbcfix_DecoderCreate(IlbcDecoderInstance **iLBC_decinst) { |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 62 | *iLBC_decinst=(IlbcDecoderInstance*)malloc(sizeof(IlbcDecoder)); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 63 | if (*iLBC_decinst!=NULL) { |
kma@webrtc.org | ac4d70d | 2012-10-05 00:19:01 +0000 | [diff] [blame] | 64 | WebRtcSpl_Init(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 65 | return(0); |
| 66 | } else { |
| 67 | return(-1); |
| 68 | } |
| 69 | } |
| 70 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 71 | int16_t WebRtcIlbcfix_EncoderFree(IlbcEncoderInstance *iLBC_encinst) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 72 | free(iLBC_encinst); |
| 73 | return(0); |
| 74 | } |
| 75 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 76 | int16_t WebRtcIlbcfix_DecoderFree(IlbcDecoderInstance *iLBC_decinst) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 77 | free(iLBC_decinst); |
| 78 | return(0); |
| 79 | } |
| 80 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 81 | int16_t WebRtcIlbcfix_EncoderInit(IlbcEncoderInstance* iLBCenc_inst, |
| 82 | int16_t mode) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 83 | if ((mode==20)||(mode==30)) { |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 84 | WebRtcIlbcfix_InitEncode((IlbcEncoder*) iLBCenc_inst, mode); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 85 | return(0); |
| 86 | } else { |
| 87 | return(-1); |
| 88 | } |
| 89 | } |
| 90 | |
Peter Kasting | cb18097 | 2015-06-11 12:42:27 -0700 | [diff] [blame] | 91 | int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance* iLBCenc_inst, |
| 92 | const int16_t* speechIn, |
| 93 | int16_t len, |
| 94 | uint8_t* encoded) { |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 95 | int16_t pos = 0; |
| 96 | int16_t encpos = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 97 | |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 98 | if ((len != ((IlbcEncoder*)iLBCenc_inst)->blockl) && |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 99 | #ifdef SPLIT_10MS |
| 100 | (len != 80) && |
| 101 | #endif |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 102 | (len != 2*((IlbcEncoder*)iLBCenc_inst)->blockl) && |
| 103 | (len != 3*((IlbcEncoder*)iLBCenc_inst)->blockl)) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 104 | { |
| 105 | /* A maximum of 3 frames/packet is allowed */ |
| 106 | return(-1); |
| 107 | } else { |
| 108 | |
| 109 | /* call encoder */ |
| 110 | while (pos<len) { |
kwiberg@webrtc.org | cb858ba | 2014-12-08 17:11:44 +0000 | [diff] [blame] | 111 | WebRtcIlbcfix_EncodeImpl((uint16_t*)&encoded[2 * encpos], &speechIn[pos], |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 112 | (IlbcEncoder*)iLBCenc_inst); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 113 | #ifdef SPLIT_10MS |
| 114 | pos += 80; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 115 | if(((IlbcEncoder*)iLBCenc_inst)->section == 0) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 116 | #else |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 117 | pos += ((IlbcEncoder*)iLBCenc_inst)->blockl; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 118 | #endif |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 119 | encpos += ((IlbcEncoder*)iLBCenc_inst)->no_of_words; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 120 | } |
| 121 | return (encpos*2); |
| 122 | } |
| 123 | } |
| 124 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 125 | int16_t WebRtcIlbcfix_DecoderInit(IlbcDecoderInstance* iLBCdec_inst, |
| 126 | int16_t mode) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 127 | if ((mode==20)||(mode==30)) { |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 128 | WebRtcIlbcfix_InitDecode((IlbcDecoder*) iLBCdec_inst, mode, 1); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 129 | return(0); |
| 130 | } else { |
| 131 | return(-1); |
| 132 | } |
| 133 | } |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 134 | int16_t WebRtcIlbcfix_DecoderInit20Ms(IlbcDecoderInstance *iLBCdec_inst) { |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 135 | WebRtcIlbcfix_InitDecode((IlbcDecoder*) iLBCdec_inst, 20, 1); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 136 | return(0); |
| 137 | } |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 138 | int16_t WebRtcIlbcfix_Decoderinit30Ms(IlbcDecoderInstance *iLBCdec_inst) { |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 139 | WebRtcIlbcfix_InitDecode((IlbcDecoder*) iLBCdec_inst, 30, 1); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 140 | return(0); |
| 141 | } |
| 142 | |
| 143 | |
Peter Kasting | cb18097 | 2015-06-11 12:42:27 -0700 | [diff] [blame] | 144 | int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst, |
| 145 | const uint8_t* encoded, |
| 146 | int16_t len, |
| 147 | int16_t* decoded, |
| 148 | int16_t* speechType) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 149 | { |
| 150 | int i=0; |
| 151 | /* Allow for automatic switching between the frame sizes |
| 152 | (although you do get some discontinuity) */ |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 153 | if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| |
| 154 | (len==2*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| |
| 155 | (len==3*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 156 | /* ok, do nothing */ |
| 157 | } else { |
| 158 | /* Test if the mode has changed */ |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 159 | if (((IlbcDecoder*)iLBCdec_inst)->mode==20) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 160 | if ((len==NO_OF_BYTES_30MS)|| |
| 161 | (len==2*NO_OF_BYTES_30MS)|| |
| 162 | (len==3*NO_OF_BYTES_30MS)) { |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 163 | WebRtcIlbcfix_InitDecode( |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 164 | ((IlbcDecoder*)iLBCdec_inst), 30, |
| 165 | ((IlbcDecoder*)iLBCdec_inst)->use_enhancer); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 166 | } else { |
| 167 | /* Unsupported frame length */ |
| 168 | return(-1); |
| 169 | } |
| 170 | } else { |
| 171 | if ((len==NO_OF_BYTES_20MS)|| |
| 172 | (len==2*NO_OF_BYTES_20MS)|| |
| 173 | (len==3*NO_OF_BYTES_20MS)) { |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 174 | WebRtcIlbcfix_InitDecode( |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 175 | ((IlbcDecoder*)iLBCdec_inst), 20, |
| 176 | ((IlbcDecoder*)iLBCdec_inst)->use_enhancer); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 177 | } else { |
| 178 | /* Unsupported frame length */ |
| 179 | return(-1); |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 184 | while ((i*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)<len) { |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 185 | WebRtcIlbcfix_DecodeImpl( |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 186 | &decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 187 | (const uint16_t*)&encoded |
jmarusic@webrtc.org | 71b35a4 | 2015-02-17 16:02:18 +0000 | [diff] [blame] | 188 | [2 * i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 189 | (IlbcDecoder*)iLBCdec_inst, 1); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 190 | i++; |
| 191 | } |
| 192 | /* iLBC does not support VAD/CNG yet */ |
| 193 | *speechType=1; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 194 | return(i*((IlbcDecoder*)iLBCdec_inst)->blockl); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 195 | } |
| 196 | |
Peter Kasting | cb18097 | 2015-06-11 12:42:27 -0700 | [diff] [blame] | 197 | int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst, |
| 198 | const uint8_t* encoded, |
| 199 | int16_t len, |
| 200 | int16_t* decoded, |
| 201 | int16_t* speechType) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 202 | { |
| 203 | int i=0; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 204 | if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| |
| 205 | (len==2*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| |
| 206 | (len==3*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 207 | /* ok, do nothing */ |
| 208 | } else { |
| 209 | return(-1); |
| 210 | } |
| 211 | |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 212 | while ((i*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)<len) { |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 213 | WebRtcIlbcfix_DecodeImpl( |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 214 | &decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 215 | (const uint16_t*)&encoded |
jmarusic@webrtc.org | 71b35a4 | 2015-02-17 16:02:18 +0000 | [diff] [blame] | 216 | [2 * i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 217 | (IlbcDecoder*)iLBCdec_inst, 1); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 218 | i++; |
| 219 | } |
| 220 | /* iLBC does not support VAD/CNG yet */ |
| 221 | *speechType=1; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 222 | return(i*((IlbcDecoder*)iLBCdec_inst)->blockl); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 223 | } |
| 224 | |
Peter Kasting | cb18097 | 2015-06-11 12:42:27 -0700 | [diff] [blame] | 225 | int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance* iLBCdec_inst, |
| 226 | const uint8_t* encoded, |
| 227 | int16_t len, |
| 228 | int16_t* decoded, |
| 229 | int16_t* speechType) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 230 | { |
| 231 | int i=0; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 232 | if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| |
| 233 | (len==2*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| |
| 234 | (len==3*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 235 | /* ok, do nothing */ |
| 236 | } else { |
| 237 | return(-1); |
| 238 | } |
| 239 | |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 240 | while ((i*((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)<len) { |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 241 | WebRtcIlbcfix_DecodeImpl( |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 242 | &decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 243 | (const uint16_t*)&encoded |
jmarusic@webrtc.org | 71b35a4 | 2015-02-17 16:02:18 +0000 | [diff] [blame] | 244 | [2 * i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 245 | (IlbcDecoder*)iLBCdec_inst, 1); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 246 | i++; |
| 247 | } |
| 248 | /* iLBC does not support VAD/CNG yet */ |
| 249 | *speechType=1; |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 250 | return(i*((IlbcDecoder*)iLBCdec_inst)->blockl); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 251 | } |
| 252 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 253 | int16_t WebRtcIlbcfix_DecodePlc(IlbcDecoderInstance* iLBCdec_inst, |
| 254 | int16_t* decoded, |
| 255 | int16_t noOfLostFrames) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 256 | int i; |
pbos@webrtc.org | 0946a56 | 2013-04-09 00:28:06 +0000 | [diff] [blame] | 257 | uint16_t dummy; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 258 | |
| 259 | for (i=0;i<noOfLostFrames;i++) { |
| 260 | /* call decoder */ |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 261 | WebRtcIlbcfix_DecodeImpl( |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 262 | &decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], &dummy, |
| 263 | (IlbcDecoder*)iLBCdec_inst, 0); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 264 | } |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 265 | return (noOfLostFrames*((IlbcDecoder*)iLBCdec_inst)->blockl); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 266 | } |
| 267 | |
pbos@webrtc.org | e728ee0 | 2014-12-17 13:43:55 +0000 | [diff] [blame] | 268 | int16_t WebRtcIlbcfix_NetEqPlc(IlbcDecoderInstance* iLBCdec_inst, |
| 269 | int16_t* decoded, |
| 270 | int16_t noOfLostFrames) { |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 271 | /* Two input parameters not used, but needed for function pointers in NetEQ */ |
andrew@webrtc.org | 9562a36 | 2011-08-31 18:50:12 +0000 | [diff] [blame] | 272 | (void)(decoded = NULL); |
| 273 | (void)(noOfLostFrames = 0); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 274 | |
pbos@webrtc.org | eb54446 | 2014-12-17 15:23:29 +0000 | [diff] [blame] | 275 | WebRtcSpl_MemSetW16(((IlbcDecoder*)iLBCdec_inst)->enh_buf, 0, ENH_BUFL); |
| 276 | ((IlbcDecoder*)iLBCdec_inst)->prev_enh_pl = 2; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 277 | |
| 278 | return (0); |
| 279 | } |
| 280 | |
leozwang@webrtc.org | 91b359e | 2012-02-28 17:26:14 +0000 | [diff] [blame] | 281 | void WebRtcIlbcfix_version(char *version) |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 282 | { |
tina.legrand@webrtc.org | a41b4ce | 2011-08-29 08:19:30 +0000 | [diff] [blame] | 283 | strcpy((char*)version, "1.1.1"); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 284 | } |