Mercurial > libavcodec.hg
comparison g726.c @ 7782:6efb15a24e91 libavcodec
Replace generic CONFIG_ENCODERS preprocessor conditionals by more specific
CONFIG_FOO_ENCODER conditionals where appropriate.
author | diego |
---|---|
date | Wed, 03 Sep 2008 12:33:21 +0000 |
parents | a570a1e80400 |
children | 7a463923ecd1 |
comparison
equal
deleted
inserted
replaced
7781:0d62fafc69ae | 7782:6efb15a24e91 |
---|---|
283 c->y = 544; | 283 c->y = 544; |
284 | 284 |
285 return 0; | 285 return 0; |
286 } | 286 } |
287 | 287 |
288 #ifdef CONFIG_ENCODERS | 288 #ifdef CONFIG_ADPCM_G726_ENCODER |
289 static int16_t g726_encode(G726Context* c, int16_t sig) | 289 static int16_t g726_encode(G726Context* c, int16_t sig) |
290 { | 290 { |
291 uint8_t i; | 291 uint8_t i; |
292 | 292 |
293 i = quant(c, sig/4 - c->se) & ((1<<c->code_size) - 1); | 293 i = quant(c, sig/4 - c->se) & ((1<<c->code_size) - 1); |
340 { | 340 { |
341 av_freep(&avctx->coded_frame); | 341 av_freep(&avctx->coded_frame); |
342 return 0; | 342 return 0; |
343 } | 343 } |
344 | 344 |
345 #ifdef CONFIG_ENCODERS | 345 #ifdef CONFIG_ADPCM_G726_ENCODER |
346 static int g726_encode_frame(AVCodecContext *avctx, | 346 static int g726_encode_frame(AVCodecContext *avctx, |
347 uint8_t *dst, int buf_size, void *data) | 347 uint8_t *dst, int buf_size, void *data) |
348 { | 348 { |
349 G726Context *c = avctx->priv_data; | 349 G726Context *c = avctx->priv_data; |
350 short *samples = data; | 350 short *samples = data; |
379 | 379 |
380 *data_size = (uint8_t*)samples - (uint8_t*)data; | 380 *data_size = (uint8_t*)samples - (uint8_t*)data; |
381 return buf_size; | 381 return buf_size; |
382 } | 382 } |
383 | 383 |
384 #ifdef CONFIG_ENCODERS | 384 #ifdef CONFIG_ADPCM_G726_ENCODER |
385 AVCodec adpcm_g726_encoder = { | 385 AVCodec adpcm_g726_encoder = { |
386 "g726", | 386 "g726", |
387 CODEC_TYPE_AUDIO, | 387 CODEC_TYPE_AUDIO, |
388 CODEC_ID_ADPCM_G726, | 388 CODEC_ID_ADPCM_G726, |
389 sizeof(G726Context), | 389 sizeof(G726Context), |
392 g726_close, | 392 g726_close, |
393 NULL, | 393 NULL, |
394 .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, | 394 .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, |
395 .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), | 395 .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), |
396 }; | 396 }; |
397 #endif //CONFIG_ENCODERS | 397 #endif |
398 | 398 |
399 AVCodec adpcm_g726_decoder = { | 399 AVCodec adpcm_g726_decoder = { |
400 "g726", | 400 "g726", |
401 CODEC_TYPE_AUDIO, | 401 CODEC_TYPE_AUDIO, |
402 CODEC_ID_ADPCM_G726, | 402 CODEC_ID_ADPCM_G726, |