Modify all codecs to report their supported input and output sample format(s).

Originally committed as revision 14482 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Peter Ross 17 years ago
parent c8fd5da42f
commit fd76c37fd9
  1. 1
      libavcodec/8svx.c
  2. 1
      libavcodec/ac3dec.c
  3. 1
      libavcodec/ac3enc.c
  4. 2
      libavcodec/adpcm.c
  5. 8
      libavcodec/adxdec.c
  6. 1
      libavcodec/adxenc.c
  7. 1
      libavcodec/alac.c
  8. 1
      libavcodec/apedec.c
  9. 1
      libavcodec/atrac3.c
  10. 2
      libavcodec/cook.c
  11. 1
      libavcodec/dca.c
  12. 1
      libavcodec/dpcm.c
  13. 1
      libavcodec/dsicinav.c
  14. 1
      libavcodec/flac.c
  15. 1
      libavcodec/flacenc.c
  16. 4
      libavcodec/g726.c
  17. 1
      libavcodec/imc.c
  18. 1
      libavcodec/liba52.c
  19. 3
      libavcodec/libamr.c
  20. 1
      libavcodec/libfaac.c
  21. 1
      libavcodec/libfaad.c
  22. 4
      libavcodec/libgsm.c
  23. 1
      libavcodec/libmp3lame.c
  24. 1
      libavcodec/libvorbis.c
  25. 1
      libavcodec/mace.c
  26. 1
      libavcodec/mlpdec.c
  27. 1
      libavcodec/mpc7.c
  28. 1
      libavcodec/mpc8.c
  29. 1
      libavcodec/mpegaudioenc.c
  30. 1
      libavcodec/nellymoserdec.c
  31. 49
      libavcodec/pcm.c
  32. 2
      libavcodec/qdm2.c
  33. 1
      libavcodec/ra144.c
  34. 8
      libavcodec/ra288.c
  35. 1
      libavcodec/roqaudioenc.c
  36. 1
      libavcodec/shorten.c
  37. 1
      libavcodec/smacker.c
  38. 1
      libavcodec/sonic.c
  39. 1
      libavcodec/truespeech.c
  40. 1
      libavcodec/vmdav.c
  41. 1
      libavcodec/vorbis_dec.c
  42. 1
      libavcodec/vorbis_enc.c
  43. 1
      libavcodec/wavpack.c
  44. 1
      libavcodec/wmadec.c
  45. 2
      libavcodec/wmaenc.c
  46. 1
      libavcodec/ws-snd1.c

@ -86,6 +86,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
default: default:
return -1; return -1;
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -221,6 +221,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
return AVERROR_NOMEM; return AVERROR_NOMEM;
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -1364,5 +1364,6 @@ AVCodec ac3_encoder = {
AC3_encode_frame, AC3_encode_frame,
AC3_encode_close, AC3_encode_close,
NULL, NULL,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 / AC-3"), .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 / AC-3"),
}; };

@ -698,6 +698,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
default: default:
break; break;
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }
@ -1599,6 +1600,7 @@ AVCodec name ## _encoder = { \
adpcm_encode_frame, \ adpcm_encode_frame, \
adpcm_encode_close, \ adpcm_encode_close, \
NULL, \ NULL, \
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
}; };
#else #else

@ -30,6 +30,12 @@
* adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/ * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
*/ */
static av_cold void adx_decode_init(AVCodecContext *avctx)
{
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0;
}
/* 18 bytes <-> 32 samples */ /* 18 bytes <-> 32 samples */
static void adx_decode(short *out,const unsigned char *in,PREV *prev) static void adx_decode(short *out,const unsigned char *in,PREV *prev)
@ -161,7 +167,7 @@ AVCodec adpcm_adx_decoder = {
CODEC_TYPE_AUDIO, CODEC_TYPE_AUDIO,
CODEC_ID_ADPCM_ADX, CODEC_ID_ADPCM_ADX,
sizeof(ADXContext), sizeof(ADXContext),
NULL, adx_decode_init,
NULL, NULL,
NULL, NULL,
adx_decode_frame, adx_decode_frame,

@ -190,5 +190,6 @@ AVCodec adpcm_adx_encoder = {
adx_encode_frame, adx_encode_frame,
adx_encode_close, adx_encode_close,
NULL, NULL,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX"), .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX"),
}; };

@ -594,6 +594,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
alac->numchannels = alac->avctx->channels; alac->numchannels = alac->avctx->channels;
alac->bytespersample = (avctx->bits_per_sample / 8) * alac->numchannels; alac->bytespersample = (avctx->bits_per_sample / 8) * alac->numchannels;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -198,6 +198,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx)
} }
dsputil_init(&s->dsp, avctx); dsputil_init(&s->dsp, avctx);
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -1058,6 +1058,7 @@ static int atrac3_decode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -1178,6 +1178,8 @@ static int cook_decode_init(AVCodecContext *avctx)
return -1; return -1;
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
#ifdef COOKDEBUG #ifdef COOKDEBUG
dump_cook_context(q); dump_cook_context(q);
#endif #endif

@ -1253,6 +1253,7 @@ static av_cold int dca_decode_init(AVCodecContext * avctx)
avctx->channels = avctx->request_channels; avctx->channels = avctx->request_channels;
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -154,6 +154,7 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx)
break; break;
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -305,6 +305,7 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx)
cin->avctx = avctx; cin->avctx = avctx;
cin->initial_decode_frame = 1; cin->initial_decode_frame = 1;
cin->delta = 0; cin->delta = 0;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -113,6 +113,7 @@ static av_cold int flac_decode_init(AVCodecContext * avctx)
} }
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -1485,5 +1485,6 @@ AVCodec flac_encoder = {
flac_encode_close, flac_encode_close,
NULL, NULL,
.capabilities = CODEC_CAP_SMALL_LAST_FRAME, .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"), .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
}; };

@ -323,6 +323,9 @@ static av_cold int g726_init(AVCodecContext * avctx)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
avctx->coded_frame->key_frame = 1; avctx->coded_frame->key_frame = 1;
if (avctx->codec->decode)
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }
@ -381,6 +384,7 @@ AVCodec adpcm_g726_encoder = {
g726_encode_frame, g726_encode_frame,
g726_close, g726_close,
NULL, NULL,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"), .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
}; };
#endif //CONFIG_ENCODERS #endif //CONFIG_ENCODERS

@ -154,6 +154,7 @@ static av_cold int imc_decode_init(AVCodecContext * avctx)
ff_fft_init(&q->fft, 7, 1); ff_fft_init(&q->fft, 7, 1);
dsputil_init(&q->dsp, avctx); dsputil_init(&q->dsp, avctx);
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -119,6 +119,7 @@ static av_cold int a52_decode_init(AVCodecContext *avctx)
avctx->channels = avctx->request_channels; avctx->channels = avctx->request_channels;
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -134,6 +134,7 @@ static void amr_decode_fix_avctx(AVCodecContext * avctx)
} }
avctx->frame_size = 160 * is_amr_wb; avctx->frame_size = 160 * is_amr_wb;
avctx->sample_fmt = SAMPLE_FMT_S16;
} }
#ifdef CONFIG_LIBAMR_NB_FIXED #ifdef CONFIG_LIBAMR_NB_FIXED
@ -516,6 +517,7 @@ AVCodec libamr_nb_encoder =
amr_nb_encode_frame, amr_nb_encode_frame,
amr_nb_encode_close, amr_nb_encode_close,
NULL, NULL,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libamr-nb Adaptive Multi-Rate (AMR) Narrow-Band"), .long_name = NULL_IF_CONFIG_SMALL("libamr-nb Adaptive Multi-Rate (AMR) Narrow-Band"),
}; };
@ -710,6 +712,7 @@ AVCodec libamr_wb_encoder =
amr_wb_encode_frame, amr_wb_encode_frame,
amr_wb_encode_close, amr_wb_encode_close,
NULL, NULL,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libamr-wb Adaptive Multi-Rate (AMR) Wide-Band"), .long_name = NULL_IF_CONFIG_SMALL("libamr-wb Adaptive Multi-Rate (AMR) Wide-Band"),
}; };

@ -151,5 +151,6 @@ AVCodec libfaac_encoder = {
Faac_encode_init, Faac_encode_init,
Faac_encode_frame, Faac_encode_frame,
Faac_encode_close, Faac_encode_close,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"), .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
}; };

@ -313,6 +313,7 @@ static av_cold int faac_decode_init(AVCodecContext *avctx)
if(!s->init && avctx->channels > 0) if(!s->init && avctx->channels > 0)
channel_setup(avctx); channel_setup(avctx);
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -48,6 +48,8 @@ static av_cold int libgsm_init(AVCodecContext *avctx) {
if(!avctx->sample_rate) if(!avctx->sample_rate)
avctx->sample_rate= 8000; avctx->sample_rate= 8000;
avctx->sample_fmt = SAMPLE_FMT_S16;
}else{ }else{
if (avctx->sample_rate != 8000) { if (avctx->sample_rate != 8000) {
av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n", av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
@ -117,6 +119,7 @@ AVCodec libgsm_encoder = {
libgsm_init, libgsm_init,
libgsm_encode_frame, libgsm_encode_frame,
libgsm_close, libgsm_close,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"), .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"),
}; };
@ -128,6 +131,7 @@ AVCodec libgsm_ms_encoder = {
libgsm_init, libgsm_init,
libgsm_encode_frame, libgsm_encode_frame,
libgsm_close, libgsm_close,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"), .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
}; };

@ -218,5 +218,6 @@ AVCodec libmp3lame_encoder = {
MP3lame_encode_frame, MP3lame_encode_frame,
MP3lame_encode_close, MP3lame_encode_close,
.capabilities= CODEC_CAP_DELAY, .capabilities= CODEC_CAP_DELAY,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"), .long_name= NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
}; };

@ -217,5 +217,6 @@ AVCodec libvorbis_encoder = {
oggvorbis_encode_frame, oggvorbis_encode_frame,
oggvorbis_encode_close, oggvorbis_encode_close,
.capabilities= CODEC_CAP_DELAY, .capabilities= CODEC_CAP_DELAY,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"), .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
} ; } ;

@ -396,6 +396,7 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
{ {
if (avctx->channels > 2) if (avctx->channels > 2)
return -1; return -1;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -336,6 +336,7 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
m->avctx = avctx; m->avctx = avctx;
for (substr = 0; substr < MAX_SUBSTREAMS; substr++) for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
m->substream[substr].lossless_check_data = 0xffffffff; m->substream[substr].lossless_check_data = 0xffffffff;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -108,6 +108,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
} }
} }
vlc_initialized = 1; vlc_initialized = 1;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -177,6 +177,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
&mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC); &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);
} }
vlc_initialized = 1; vlc_initialized = 1;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -796,6 +796,7 @@ AVCodec mp2_encoder = {
MPA_encode_frame, MPA_encode_frame,
MPA_encode_close, MPA_encode_close,
NULL, NULL,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
}; };

@ -149,6 +149,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
if (!sine_window[0]) if (!sine_window[0])
ff_sine_window_init(sine_window, 128); ff_sine_window_init(sine_window, 128);
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -553,7 +553,7 @@ static int pcm_decode_frame(AVCodecContext *avctx,
} }
#ifdef CONFIG_ENCODERS #ifdef CONFIG_ENCODERS
#define PCM_ENCODER(id,name,long_name_) \ #define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
AVCodec name ## _encoder = { \ AVCodec name ## _encoder = { \
#name, \ #name, \
CODEC_TYPE_AUDIO, \ CODEC_TYPE_AUDIO, \
@ -563,10 +563,11 @@ AVCodec name ## _encoder = { \
pcm_encode_frame, \ pcm_encode_frame, \
pcm_encode_close, \ pcm_encode_close, \
NULL, \ NULL, \
.sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \ .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
}; };
#else #else
#define PCM_ENCODER(id,name,long_name_) #define PCM_ENCODER(id,sample_fmt_,name,long_name_)
#endif #endif
#ifdef CONFIG_DECODERS #ifdef CONFIG_DECODERS
@ -586,28 +587,28 @@ AVCodec name ## _decoder = { \
#define PCM_DECODER(id,name,long_name_) #define PCM_DECODER(id,name,long_name_)
#endif #endif
#define PCM_CODEC(id, name, long_name_) \ #define PCM_CODEC(id, sample_fmt_, name, long_name_) \
PCM_ENCODER(id,name,long_name_) PCM_DECODER(id,name,long_name_) PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,name,long_name_)
/* Note: Do not forget to add new entries to the Makefile as well. */ /* Note: Do not forget to add new entries to the Makefile as well. */
PCM_CODEC (CODEC_ID_PCM_ALAW, pcm_alaw, "A-law PCM"); PCM_CODEC (CODEC_ID_PCM_ALAW, SAMPLE_FMT_S16, pcm_alaw, "A-law PCM");
PCM_CODEC (CODEC_ID_PCM_DVD, pcm_dvd, "signed 16|20|24-bit big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_DVD, SAMPLE_FMT_S16, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_F32BE, pcm_f32be, "32-bit floating point big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "32-bit floating point big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_MULAW, pcm_mulaw, "mu-law PCM"); PCM_CODEC (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "mu-law PCM");
PCM_CODEC (CODEC_ID_PCM_S8, pcm_s8, "signed 8-bit PCM"); PCM_CODEC (CODEC_ID_PCM_S8, SAMPLE_FMT_S16, pcm_s8, "signed 8-bit PCM");
PCM_CODEC (CODEC_ID_PCM_S16BE, pcm_s16be, "signed 16-bit big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "signed 16-bit big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_S16LE, pcm_s16le, "signed 16-bit little-endian PCM"); PCM_CODEC (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "signed 16-bit little-endian PCM");
PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, pcm_s16le_planar, "16-bit little-endian planar PCM"); PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, pcm_s16le_planar, "16-bit little-endian planar PCM");
PCM_CODEC (CODEC_ID_PCM_S24BE, pcm_s24be, "signed 24-bit big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S16, pcm_s24be, "signed 24-bit big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_S24DAUD, pcm_s24daud, "D-Cinema audio signed 24-bit PCM"); PCM_CODEC (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16, pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
PCM_CODEC (CODEC_ID_PCM_S24LE, pcm_s24le, "signed 24-bit little-endian PCM"); PCM_CODEC (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S16, pcm_s24le, "signed 24-bit little-endian PCM");
PCM_CODEC (CODEC_ID_PCM_S32BE, pcm_s32be, "signed 32-bit big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S16, pcm_s32be, "signed 32-bit big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_S32LE, pcm_s32le, "signed 32-bit little-endian PCM"); PCM_CODEC (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S16, pcm_s32le, "signed 32-bit little-endian PCM");
PCM_CODEC (CODEC_ID_PCM_U8, pcm_u8, "unsigned 8-bit PCM"); PCM_CODEC (CODEC_ID_PCM_U8, SAMPLE_FMT_S16, pcm_u8, "unsigned 8-bit PCM");
PCM_CODEC (CODEC_ID_PCM_U16BE, pcm_u16be, "unsigned 16-bit big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "unsigned 16-bit big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_U16LE, pcm_u16le, "unsigned 16-bit little-endian PCM"); PCM_CODEC (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "unsigned 16-bit little-endian PCM");
PCM_CODEC (CODEC_ID_PCM_U24BE, pcm_u24be, "unsigned 24-bit big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S16, pcm_u24be, "unsigned 24-bit big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_U24LE, pcm_u24le, "unsigned 24-bit little-endian PCM"); PCM_CODEC (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S16, pcm_u24le, "unsigned 24-bit little-endian PCM");
PCM_CODEC (CODEC_ID_PCM_U32BE, pcm_u32be, "unsigned 32-bit big-endian PCM"); PCM_CODEC (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S16, pcm_u32be, "unsigned 32-bit big-endian PCM");
PCM_CODEC (CODEC_ID_PCM_U32LE, pcm_u32le, "unsigned 32-bit little-endian PCM"); PCM_CODEC (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S16, pcm_u32le, "unsigned 32-bit little-endian PCM");
PCM_CODEC (CODEC_ID_PCM_ZORK, pcm_zork, "Zork PCM"); PCM_CODEC (CODEC_ID_PCM_ZORK, SAMPLE_FMT_S16, pcm_zork, "Zork PCM");

@ -1931,6 +1931,8 @@ static int qdm2_decode_init(AVCodecContext *avctx)
qdm2_init(s); qdm2_init(s);
avctx->sample_fmt = SAMPLE_FMT_S16;
// dump_context(s); // dump_context(s);
return 0; return 0;
} }

@ -58,6 +58,7 @@ static int ra144_decode_init(AVCodecContext * avctx)
ractx->lpc_coef[0] = ractx->lpc_tables[0]; ractx->lpc_coef[0] = ractx->lpc_tables[0];
ractx->lpc_coef[1] = ractx->lpc_tables[1]; ractx->lpc_coef[1] = ractx->lpc_tables[1];
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -42,6 +42,12 @@ typedef struct {
float gain_block[10]; ///< Gain data of four blocks (spec: GSTATE) float gain_block[10]; ///< Gain data of four blocks (spec: GSTATE)
} RA288Context; } RA288Context;
static av_cold int ra288_decode_init(AVCodecContext *avctx)
{
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0;
}
static inline float scalar_product_float(const float * v1, const float * v2, static inline float scalar_product_float(const float * v1, const float * v2,
int size) int size)
{ {
@ -258,7 +264,7 @@ AVCodec ra_288_decoder =
CODEC_TYPE_AUDIO, CODEC_TYPE_AUDIO,
CODEC_ID_RA_288, CODEC_ID_RA_288,
sizeof(RA288Context), sizeof(RA288Context),
NULL, ra288_decode_init,
NULL, NULL,
NULL, NULL,
ra288_decode_frame, ra288_decode_frame,

@ -174,5 +174,6 @@ AVCodec roq_dpcm_encoder = {
roq_dpcm_encode_frame, roq_dpcm_encode_frame,
roq_dpcm_encode_close, roq_dpcm_encode_close,
NULL, NULL,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"), .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
}; };

@ -104,6 +104,7 @@ static av_cold int shorten_decode_init(AVCodecContext * avctx)
{ {
ShortenContext *s = avctx->priv_data; ShortenContext *s = avctx->priv_data;
s->avctx = avctx; s->avctx = avctx;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -558,6 +558,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
static av_cold int smka_decode_init(AVCodecContext *avctx) static av_cold int smka_decode_init(AVCodecContext *avctx)
{ {
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -828,6 +828,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
} }
s->int_samples = av_mallocz(4* s->frame_size); s->int_samples = av_mallocz(4* s->frame_size);
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -54,6 +54,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
{ {
// TSContext *c = avctx->priv_data; // TSContext *c = avctx->priv_data;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -446,6 +446,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
s->channels = avctx->channels; s->channels = avctx->channels;
s->bits = avctx->bits_per_sample; s->bits = avctx->bits_per_sample;
s->block_align = avctx->block_align; s->block_align = avctx->block_align;
avctx->sample_fmt = SAMPLE_FMT_S16;
av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n", av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
s->channels, s->bits, s->block_align, avctx->sample_rate); s->channels, s->bits, s->block_align, avctx->sample_rate);

@ -971,6 +971,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext) {
avccontext->channels = vc->audio_channels; avccontext->channels = vc->audio_channels;
avccontext->sample_rate = vc->audio_samplerate; avccontext->sample_rate = vc->audio_samplerate;
avccontext->frame_size = FFMIN(vc->blocksize[0], vc->blocksize[1])>>2; avccontext->frame_size = FFMIN(vc->blocksize[0], vc->blocksize[1])>>2;
avccontext->sample_fmt = SAMPLE_FMT_S16;
return 0 ; return 0 ;
} }

@ -1084,5 +1084,6 @@ AVCodec vorbis_encoder = {
vorbis_encode_frame, vorbis_encode_frame,
vorbis_encode_close, vorbis_encode_close,
.capabilities= CODEC_CAP_DELAY, .capabilities= CODEC_CAP_DELAY,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Vorbis"), .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
}; };

@ -360,6 +360,7 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
s->avctx = avctx; s->avctx = avctx;
s->stereo = (avctx->channels == 2); s->stereo = (avctx->channels == 2);
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -126,6 +126,7 @@ static int wma_decode_init(AVCodecContext * avctx)
wma_lsp_to_curve_init(s, s->frame_len); wma_lsp_to_curve_init(s, s->frame_len);
} }
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

@ -387,6 +387,7 @@ AVCodec wmav1_encoder =
encode_init, encode_init,
encode_superframe, encode_superframe,
ff_wma_end, ff_wma_end,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"), .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
}; };
@ -399,5 +400,6 @@ AVCodec wmav2_encoder =
encode_init, encode_init,
encode_superframe, encode_superframe,
ff_wma_end, ff_wma_end,
.sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"), .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
}; };

@ -40,6 +40,7 @@ static av_cold int ws_snd_decode_init(AVCodecContext * avctx)
{ {
// WSSNDContext *c = avctx->priv_data; // WSSNDContext *c = avctx->priv_data;
avctx->sample_fmt = SAMPLE_FMT_S16;
return 0; return 0;
} }

Loading…
Cancel
Save