Lines Matching full:pstate
135 { G72x_STATE *pstate ;
137 if ((pstate = g72x_state_new ()) == NULL)
140 private_init_state (pstate) ;
142 pstate->encoder = NULL ;
146 pstate->decoder = g723_16_decoder ;
149 pstate->codec_bits = 2 ;
150 pstate->blocksize = G723_16_BYTES_PER_BLOCK ;
151 pstate->samplesperblock = G723_16_SAMPLES_PER_BLOCK ;
155 pstate->decoder = g723_24_decoder ;
158 pstate->codec_bits = 3 ;
159 pstate->blocksize = G723_24_BYTES_PER_BLOCK ;
160 pstate->samplesperblock = G723_24_SAMPLES_PER_BLOCK ;
164 pstate->decoder = g721_decoder ;
167 pstate->codec_bits = 4 ;
168 pstate->blocksize = G721_32_BYTES_PER_BLOCK ;
169 pstate->samplesperblock = G721_32_SAMPLES_PER_BLOCK ;
173 pstate->decoder = g723_40_decoder ;
176 pstate->codec_bits = 5 ;
177 pstate->blocksize = G721_40_BYTES_PER_BLOCK ;
178 pstate->samplesperblock = G721_40_SAMPLES_PER_BLOCK ;
182 free (pstate) ;
186 return pstate ;
190 { G72x_STATE *pstate ;
192 if ((pstate = g72x_state_new ()) == NULL)
195 private_init_state (pstate) ;
196 pstate->decoder = NULL ;
200 pstate->encoder = g723_16_encoder ;
203 pstate->codec_bits = 2 ;
204 pstate->blocksize = G723_16_BYTES_PER_BLOCK ;
205 pstate->samplesperblock = G723_16_SAMPLES_PER_BLOCK ;
209 pstate->encoder = g723_24_encoder ;
212 pstate->codec_bits = 3 ;
213 pstate->blocksize = G723_24_BYTES_PER_BLOCK ;
214 pstate->samplesperblock = G723_24_SAMPLES_PER_BLOCK ;
218 pstate->encoder = g721_encoder ;
221 pstate->codec_bits = 4 ;
222 pstate->blocksize = G721_32_BYTES_PER_BLOCK ;
223 pstate->samplesperblock = G721_32_SAMPLES_PER_BLOCK ;
227 pstate->encoder = g723_40_encoder ;
230 pstate->codec_bits = 5 ;
231 pstate->blocksize = G721_40_BYTES_PER_BLOCK ;
232 pstate->samplesperblock = G721_40_SAMPLES_PER_BLOCK ;
236 free (pstate) ;
240 return pstate ;
243 int g72x_decode_block (G72x_STATE *pstate, const unsigned char *block, short *samples)
246 count = unpack_bytes (pstate->codec_bits, pstate->blocksize, block, samples) ;
249 samples [k] = pstate->decoder (samples [k], pstate) ;
254 int g72x_encode_block (G72x_STATE *pstate, short *samples, unsigned char *block)
257 for (k = 0 ; k < pstate->samplesperblock ; k++)
258 samples [k] = pstate->encoder (samples [k], pstate) ;
260 count = pack_bytes (pstate->codec_bits, samples, block) ;