comparison g726.c @ 3777:20545fbb6f7c libavcodec

add some #ifdef CONFIG_ENCODERS/DECODERS
author mru
date Wed, 27 Sep 2006 19:54:07 +0000
parents 0b546eab515d
children c8c591fe26f8
comparison
equal deleted inserted replaced
3776:1843a85123b7 3777:20545fbb6f7c
297 static int16_t g726_decode(G726Context* c, int16_t i) 297 static int16_t g726_decode(G726Context* c, int16_t i)
298 { 298 {
299 return g726_iterate(c, i); 299 return g726_iterate(c, i);
300 } 300 }
301 301
302 #ifdef CONFIG_ENCODERS
302 static int16_t g726_encode(G726Context* c, int16_t sig) 303 static int16_t g726_encode(G726Context* c, int16_t sig)
303 { 304 {
304 uint8_t i; 305 uint8_t i;
305 306
306 i = quant(c, sig/4 - c->se) & ((1<<c->tbls->bits) - 1); 307 i = quant(c, sig/4 - c->se) & ((1<<c->tbls->bits) - 1);
307 g726_iterate(c, i); 308 g726_iterate(c, i);
308 return i; 309 return i;
309 } 310 }
311 #endif
310 312
311 /* Interfacing to the libavcodec */ 313 /* Interfacing to the libavcodec */
312 314
313 typedef struct AVG726Context { 315 typedef struct AVG726Context {
314 G726Context c; 316 G726Context c;
348 { 350 {
349 av_freep(&avctx->coded_frame); 351 av_freep(&avctx->coded_frame);
350 return 0; 352 return 0;
351 } 353 }
352 354
355 #ifdef CONFIG_ENCODERS
353 static int g726_encode_frame(AVCodecContext *avctx, 356 static int g726_encode_frame(AVCodecContext *avctx,
354 uint8_t *dst, int buf_size, void *data) 357 uint8_t *dst, int buf_size, void *data)
355 { 358 {
356 AVG726Context *c = avctx->priv_data; 359 AVG726Context *c = avctx->priv_data;
357 short *samples = data; 360 short *samples = data;
364 367
365 flush_put_bits(&pb); 368 flush_put_bits(&pb);
366 369
367 return put_bits_count(&pb)>>3; 370 return put_bits_count(&pb)>>3;
368 } 371 }
372 #endif
369 373
370 static int g726_decode_frame(AVCodecContext *avctx, 374 static int g726_decode_frame(AVCodecContext *avctx,
371 void *data, int *data_size, 375 void *data, int *data_size,
372 uint8_t *buf, int buf_size) 376 uint8_t *buf, int buf_size)
373 { 377 {