[FFmpeg-cvslog] r14482 - in trunk/libavcodec: 8svx.c ac3dec.c ac3enc.c adpcm.c adxdec.c adxenc.c alac.c apedec.c atrac3.c cook.c dca.c dpcm.c dsicinav.c flac.c flacenc.c g726.c imc.c liba52.c libamr.c libfaac.c libfaad.c libgsm.c libmp3lame.c libvorbis.c mace.c mlpdec.c mpc7.c mpc8.c mpegaudioenc.c nellymoserdec.c pcm.c qdm2.c ra144.c ra288.c roqaudioenc.c shorten.c smacker.c sonic.c truespeech.c vmdav.c vorbis_dec.c vorbis_enc.c wavpack.c wmadec.c wmaenc.c ws-snd1.c

pross subversion
Thu Jul 31 12:47:32 CEST 2008


Author: pross
Date: Thu Jul 31 12:47:31 2008
New Revision: 14482

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


Modified:
   trunk/libavcodec/8svx.c
   trunk/libavcodec/ac3dec.c
   trunk/libavcodec/ac3enc.c
   trunk/libavcodec/adpcm.c
   trunk/libavcodec/adxdec.c
   trunk/libavcodec/adxenc.c
   trunk/libavcodec/alac.c
   trunk/libavcodec/apedec.c
   trunk/libavcodec/atrac3.c
   trunk/libavcodec/cook.c
   trunk/libavcodec/dca.c
   trunk/libavcodec/dpcm.c
   trunk/libavcodec/dsicinav.c
   trunk/libavcodec/flac.c
   trunk/libavcodec/flacenc.c
   trunk/libavcodec/g726.c
   trunk/libavcodec/imc.c
   trunk/libavcodec/liba52.c
   trunk/libavcodec/libamr.c
   trunk/libavcodec/libfaac.c
   trunk/libavcodec/libfaad.c
   trunk/libavcodec/libgsm.c
   trunk/libavcodec/libmp3lame.c
   trunk/libavcodec/libvorbis.c
   trunk/libavcodec/mace.c
   trunk/libavcodec/mlpdec.c
   trunk/libavcodec/mpc7.c
   trunk/libavcodec/mpc8.c
   trunk/libavcodec/mpegaudioenc.c
   trunk/libavcodec/nellymoserdec.c
   trunk/libavcodec/pcm.c
   trunk/libavcodec/qdm2.c
   trunk/libavcodec/ra144.c
   trunk/libavcodec/ra288.c
   trunk/libavcodec/roqaudioenc.c
   trunk/libavcodec/shorten.c
   trunk/libavcodec/smacker.c
   trunk/libavcodec/sonic.c
   trunk/libavcodec/truespeech.c
   trunk/libavcodec/vmdav.c
   trunk/libavcodec/vorbis_dec.c
   trunk/libavcodec/vorbis_enc.c
   trunk/libavcodec/wavpack.c
   trunk/libavcodec/wmadec.c
   trunk/libavcodec/wmaenc.c
   trunk/libavcodec/ws-snd1.c

Modified: trunk/libavcodec/8svx.c
==============================================================================
--- trunk/libavcodec/8svx.c	(original)
+++ trunk/libavcodec/8svx.c	Thu Jul 31 12:47:31 2008
@@ -86,6 +86,7 @@ static av_cold int eightsvx_decode_init(
         default:
           return -1;
     }
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/ac3dec.c
==============================================================================
--- trunk/libavcodec/ac3dec.c	(original)
+++ trunk/libavcodec/ac3dec.c	Thu Jul 31 12:47:31 2008
@@ -221,6 +221,7 @@ static av_cold int ac3_decode_init(AVCod
             return AVERROR_NOMEM;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/ac3enc.c
==============================================================================
--- trunk/libavcodec/ac3enc.c	(original)
+++ trunk/libavcodec/ac3enc.c	Thu Jul 31 12:47:31 2008
@@ -1364,5 +1364,6 @@ AVCodec ac3_encoder = {
     AC3_encode_frame,
     AC3_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 / AC-3"),
 };

Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c	(original)
+++ trunk/libavcodec/adpcm.c	Thu Jul 31 12:47:31 2008
@@ -698,6 +698,7 @@ static av_cold int adpcm_decode_init(AVC
     default:
         break;
     }
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
@@ -1599,6 +1600,7 @@ AVCodec name ## _encoder = {            
     adpcm_encode_frame,                         \
     adpcm_encode_close,                         \
     NULL,                                       \
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else

Modified: trunk/libavcodec/adxdec.c
==============================================================================
--- trunk/libavcodec/adxdec.c	(original)
+++ trunk/libavcodec/adxdec.c	Thu Jul 31 12:47:31 2008
@@ -30,6 +30,12 @@
  * 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 */
 
 static void adx_decode(short *out,const unsigned char *in,PREV *prev)
@@ -161,7 +167,7 @@ AVCodec adpcm_adx_decoder = {
     CODEC_TYPE_AUDIO,
     CODEC_ID_ADPCM_ADX,
     sizeof(ADXContext),
-    NULL,
+    adx_decode_init,
     NULL,
     NULL,
     adx_decode_frame,

Modified: trunk/libavcodec/adxenc.c
==============================================================================
--- trunk/libavcodec/adxenc.c	(original)
+++ trunk/libavcodec/adxenc.c	Thu Jul 31 12:47:31 2008
@@ -190,5 +190,6 @@ AVCodec adpcm_adx_encoder = {
     adx_encode_frame,
     adx_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX"),
 };

Modified: trunk/libavcodec/alac.c
==============================================================================
--- trunk/libavcodec/alac.c	(original)
+++ trunk/libavcodec/alac.c	Thu Jul 31 12:47:31 2008
@@ -594,6 +594,7 @@ static av_cold int alac_decode_init(AVCo
 
     alac->numchannels = alac->avctx->channels;
     alac->bytespersample = (avctx->bits_per_sample / 8) * alac->numchannels;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }

Modified: trunk/libavcodec/apedec.c
==============================================================================
--- trunk/libavcodec/apedec.c	(original)
+++ trunk/libavcodec/apedec.c	Thu Jul 31 12:47:31 2008
@@ -198,6 +198,7 @@ static av_cold int ape_decode_init(AVCod
     }
 
     dsputil_init(&s->dsp, avctx);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/atrac3.c
==============================================================================
--- trunk/libavcodec/atrac3.c	(original)
+++ trunk/libavcodec/atrac3.c	Thu Jul 31 12:47:31 2008
@@ -1058,6 +1058,7 @@ static int atrac3_decode_init(AVCodecCon
         return AVERROR(ENOMEM);
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/cook.c
==============================================================================
--- trunk/libavcodec/cook.c	(original)
+++ trunk/libavcodec/cook.c	Thu Jul 31 12:47:31 2008
@@ -1178,6 +1178,8 @@ static int cook_decode_init(AVCodecConte
         return -1;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+
 #ifdef COOKDEBUG
     dump_cook_context(q);
 #endif

Modified: trunk/libavcodec/dca.c
==============================================================================
--- trunk/libavcodec/dca.c	(original)
+++ trunk/libavcodec/dca.c	Thu Jul 31 12:47:31 2008
@@ -1253,6 +1253,7 @@ static av_cold int dca_decode_init(AVCod
         avctx->channels = avctx->request_channels;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/dpcm.c
==============================================================================
--- trunk/libavcodec/dpcm.c	(original)
+++ trunk/libavcodec/dpcm.c	Thu Jul 31 12:47:31 2008
@@ -154,6 +154,7 @@ static av_cold int dpcm_decode_init(AVCo
         break;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/dsicinav.c
==============================================================================
--- trunk/libavcodec/dsicinav.c	(original)
+++ trunk/libavcodec/dsicinav.c	Thu Jul 31 12:47:31 2008
@@ -305,6 +305,7 @@ static av_cold int cinaudio_decode_init(
     cin->avctx = avctx;
     cin->initial_decode_frame = 1;
     cin->delta = 0;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }

Modified: trunk/libavcodec/flac.c
==============================================================================
--- trunk/libavcodec/flac.c	(original)
+++ trunk/libavcodec/flac.c	Thu Jul 31 12:47:31 2008
@@ -113,6 +113,7 @@ static av_cold int flac_decode_init(AVCo
         }
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/flacenc.c
==============================================================================
--- trunk/libavcodec/flacenc.c	(original)
+++ trunk/libavcodec/flacenc.c	Thu Jul 31 12:47:31 2008
@@ -1485,5 +1485,6 @@ AVCodec flac_encoder = {
     flac_encode_close,
     NULL,
     .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)"),
 };

Modified: trunk/libavcodec/g726.c
==============================================================================
--- trunk/libavcodec/g726.c	(original)
+++ trunk/libavcodec/g726.c	Thu Jul 31 12:47:31 2008
@@ -323,6 +323,9 @@ static av_cold int g726_init(AVCodecCont
         return AVERROR(ENOMEM);
     avctx->coded_frame->key_frame = 1;
 
+    if (avctx->codec->decode)
+        avctx->sample_fmt = SAMPLE_FMT_S16;
+
     return 0;
 }
 
@@ -381,6 +384,7 @@ AVCodec adpcm_g726_encoder = {
     g726_encode_frame,
     g726_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
 };
 #endif //CONFIG_ENCODERS

Modified: trunk/libavcodec/imc.c
==============================================================================
--- trunk/libavcodec/imc.c	(original)
+++ trunk/libavcodec/imc.c	Thu Jul 31 12:47:31 2008
@@ -154,6 +154,7 @@ static av_cold int imc_decode_init(AVCod
 
     ff_fft_init(&q->fft, 7, 1);
     dsputil_init(&q->dsp, avctx);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/liba52.c
==============================================================================
--- trunk/libavcodec/liba52.c	(original)
+++ trunk/libavcodec/liba52.c	Thu Jul 31 12:47:31 2008
@@ -119,6 +119,7 @@ static av_cold int a52_decode_init(AVCod
         avctx->channels = avctx->request_channels;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/libamr.c
==============================================================================
--- trunk/libavcodec/libamr.c	(original)
+++ trunk/libavcodec/libamr.c	Thu Jul 31 12:47:31 2008
@@ -134,6 +134,7 @@ static void amr_decode_fix_avctx(AVCodec
     }
 
     avctx->frame_size = 160 * is_amr_wb;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 }
 
 #ifdef CONFIG_LIBAMR_NB_FIXED
@@ -516,6 +517,7 @@ AVCodec libamr_nb_encoder =
     amr_nb_encode_frame,
     amr_nb_encode_close,
     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"),
 };
 
@@ -710,6 +712,7 @@ AVCodec libamr_wb_encoder =
     amr_wb_encode_frame,
     amr_wb_encode_close,
     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"),
 };
 

Modified: trunk/libavcodec/libfaac.c
==============================================================================
--- trunk/libavcodec/libfaac.c	(original)
+++ trunk/libavcodec/libfaac.c	Thu Jul 31 12:47:31 2008
@@ -151,5 +151,6 @@ AVCodec libfaac_encoder = {
     Faac_encode_init,
     Faac_encode_frame,
     Faac_encode_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
 };

Modified: trunk/libavcodec/libfaad.c
==============================================================================
--- trunk/libavcodec/libfaad.c	(original)
+++ trunk/libavcodec/libfaad.c	Thu Jul 31 12:47:31 2008
@@ -313,6 +313,7 @@ static av_cold int faac_decode_init(AVCo
     if(!s->init && avctx->channels > 0)
         channel_setup(avctx);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/libgsm.c
==============================================================================
--- trunk/libavcodec/libgsm.c	(original)
+++ trunk/libavcodec/libgsm.c	Thu Jul 31 12:47:31 2008
@@ -48,6 +48,8 @@ static av_cold int libgsm_init(AVCodecCo
 
         if(!avctx->sample_rate)
             avctx->sample_rate= 8000;
+
+        avctx->sample_fmt = SAMPLE_FMT_S16;
     }else{
         if (avctx->sample_rate != 8000) {
             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_encode_frame,
     libgsm_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"),
 };
 
@@ -128,6 +131,7 @@ AVCodec libgsm_ms_encoder = {
     libgsm_init,
     libgsm_encode_frame,
     libgsm_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
 };
 

Modified: trunk/libavcodec/libmp3lame.c
==============================================================================
--- trunk/libavcodec/libmp3lame.c	(original)
+++ trunk/libavcodec/libmp3lame.c	Thu Jul 31 12:47:31 2008
@@ -218,5 +218,6 @@ AVCodec libmp3lame_encoder = {
     MP3lame_encode_frame,
     MP3lame_encode_close,
     .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)"),
 };

Modified: trunk/libavcodec/libvorbis.c
==============================================================================
--- trunk/libavcodec/libvorbis.c	(original)
+++ trunk/libavcodec/libvorbis.c	Thu Jul 31 12:47:31 2008
@@ -217,5 +217,6 @@ AVCodec libvorbis_encoder = {
     oggvorbis_encode_frame,
     oggvorbis_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
 } ;

Modified: trunk/libavcodec/mace.c
==============================================================================
--- trunk/libavcodec/mace.c	(original)
+++ trunk/libavcodec/mace.c	Thu Jul 31 12:47:31 2008
@@ -396,6 +396,7 @@ static av_cold int mace_decode_init(AVCo
 {
     if (avctx->channels > 2)
         return -1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/mlpdec.c
==============================================================================
--- trunk/libavcodec/mlpdec.c	(original)
+++ trunk/libavcodec/mlpdec.c	Thu Jul 31 12:47:31 2008
@@ -336,6 +336,7 @@ static av_cold int mlp_decode_init(AVCod
     m->avctx = avctx;
     for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
         m->substream[substr].lossless_check_data = 0xffffffff;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/mpc7.c
==============================================================================
--- trunk/libavcodec/mpc7.c	(original)
+++ trunk/libavcodec/mpc7.c	Thu Jul 31 12:47:31 2008
@@ -108,6 +108,7 @@ static av_cold int mpc7_decode_init(AVCo
         }
     }
     vlc_initialized = 1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/mpc8.c
==============================================================================
--- trunk/libavcodec/mpc8.c	(original)
+++ trunk/libavcodec/mpc8.c	Thu Jul 31 12:47:31 2008
@@ -177,6 +177,7 @@ static av_cold int mpc8_decode_init(AVCo
                  &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);
     }
     vlc_initialized = 1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/mpegaudioenc.c
==============================================================================
--- trunk/libavcodec/mpegaudioenc.c	(original)
+++ trunk/libavcodec/mpegaudioenc.c	Thu Jul 31 12:47:31 2008
@@ -796,6 +796,7 @@ AVCodec mp2_encoder = {
     MPA_encode_frame,
     MPA_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
 };
 

Modified: trunk/libavcodec/nellymoserdec.c
==============================================================================
--- trunk/libavcodec/nellymoserdec.c	(original)
+++ trunk/libavcodec/nellymoserdec.c	Thu Jul 31 12:47:31 2008
@@ -149,6 +149,7 @@ static av_cold int decode_init(AVCodecCo
     if (!sine_window[0])
         ff_sine_window_init(sine_window, 128);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/pcm.c
==============================================================================
--- trunk/libavcodec/pcm.c	(original)
+++ trunk/libavcodec/pcm.c	Thu Jul 31 12:47:31 2008
@@ -553,7 +553,7 @@ static int pcm_decode_frame(AVCodecConte
 }
 
 #ifdef CONFIG_ENCODERS
-#define PCM_ENCODER(id,name,long_name_)         \
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
 AVCodec name ## _encoder = {                    \
     #name,                                      \
     CODEC_TYPE_AUDIO,                           \
@@ -563,10 +563,11 @@ AVCodec name ## _encoder = {            
     pcm_encode_frame,                           \
     pcm_encode_close,                           \
     NULL,                                       \
+    .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else
-#define PCM_ENCODER(id,name,long_name_)
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
 #endif
 
 #ifdef CONFIG_DECODERS
@@ -586,28 +587,28 @@ AVCodec name ## _decoder = {            
 #define PCM_DECODER(id,name,long_name_)
 #endif
 
-#define PCM_CODEC(id, name, long_name_)         \
-    PCM_ENCODER(id,name,long_name_) PCM_DECODER(id,name,long_name_)
+#define PCM_CODEC(id, sample_fmt_, 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. */
-PCM_CODEC  (CODEC_ID_PCM_ALAW, 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_F32BE, 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_S8, 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_S16LE, pcm_s16le, "signed 16-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_ALAW,  SAMPLE_FMT_S16, pcm_alaw, "A-law 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, SAMPLE_FMT_FLT, pcm_f32be, "32-bit floating point big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "mu-law PCM");
+PCM_CODEC  (CODEC_ID_PCM_S8,    SAMPLE_FMT_S16, pcm_s8, "signed 8-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "signed 16-bit big-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_CODEC  (CODEC_ID_PCM_S24BE, 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_S24LE, 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_S32LE, 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_U16BE, 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_U24BE, 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_U32BE, 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_ZORK, pcm_zork, "Zork PCM");
+PCM_CODEC  (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S16, pcm_s24be, "signed 24-bit big-endian 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, SAMPLE_FMT_S16, pcm_s24le, "signed 24-bit little-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, SAMPLE_FMT_S16, pcm_s32le, "signed 32-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U8,    SAMPLE_FMT_S16, pcm_u8, "unsigned 8-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "unsigned 16-bit big-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, SAMPLE_FMT_S16, pcm_u24be, "unsigned 24-bit big-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, SAMPLE_FMT_S16, pcm_u32be, "unsigned 32-bit big-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,  SAMPLE_FMT_S16, pcm_zork, "Zork PCM");

Modified: trunk/libavcodec/qdm2.c
==============================================================================
--- trunk/libavcodec/qdm2.c	(original)
+++ trunk/libavcodec/qdm2.c	Thu Jul 31 12:47:31 2008
@@ -1931,6 +1931,8 @@ static int qdm2_decode_init(AVCodecConte
 
     qdm2_init(s);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+
 //    dump_context(s);
     return 0;
 }

Modified: trunk/libavcodec/ra144.c
==============================================================================
--- trunk/libavcodec/ra144.c	(original)
+++ trunk/libavcodec/ra144.c	Thu Jul 31 12:47:31 2008
@@ -58,6 +58,7 @@ static int ra144_decode_init(AVCodecCont
     ractx->lpc_coef[0] = ractx->lpc_tables[0];
     ractx->lpc_coef[1] = ractx->lpc_tables[1];
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/ra288.c
==============================================================================
--- trunk/libavcodec/ra288.c	(original)
+++ trunk/libavcodec/ra288.c	Thu Jul 31 12:47:31 2008
@@ -42,6 +42,12 @@ typedef struct {
     float gain_block[10];  ///< Gain data of four blocks (spec: GSTATE)
 } 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,
                                          int size)
 {
@@ -258,7 +264,7 @@ AVCodec ra_288_decoder =
     CODEC_TYPE_AUDIO,
     CODEC_ID_RA_288,
     sizeof(RA288Context),
-    NULL,
+    ra288_decode_init,
     NULL,
     NULL,
     ra288_decode_frame,

Modified: trunk/libavcodec/roqaudioenc.c
==============================================================================
--- trunk/libavcodec/roqaudioenc.c	(original)
+++ trunk/libavcodec/roqaudioenc.c	Thu Jul 31 12:47:31 2008
@@ -174,5 +174,6 @@ AVCodec roq_dpcm_encoder = {
     roq_dpcm_encode_frame,
     roq_dpcm_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
 };

Modified: trunk/libavcodec/shorten.c
==============================================================================
--- trunk/libavcodec/shorten.c	(original)
+++ trunk/libavcodec/shorten.c	Thu Jul 31 12:47:31 2008
@@ -104,6 +104,7 @@ static av_cold int shorten_decode_init(A
 {
     ShortenContext *s = avctx->priv_data;
     s->avctx = avctx;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }

Modified: trunk/libavcodec/smacker.c
==============================================================================
--- trunk/libavcodec/smacker.c	(original)
+++ trunk/libavcodec/smacker.c	Thu Jul 31 12:47:31 2008
@@ -558,6 +558,7 @@ static av_cold int decode_end(AVCodecCon
 
 static av_cold int smka_decode_init(AVCodecContext *avctx)
 {
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/sonic.c
==============================================================================
--- trunk/libavcodec/sonic.c	(original)
+++ trunk/libavcodec/sonic.c	Thu Jul 31 12:47:31 2008
@@ -828,6 +828,7 @@ static av_cold int sonic_decode_init(AVC
     }
     s->int_samples = av_mallocz(4* s->frame_size);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/truespeech.c
==============================================================================
--- trunk/libavcodec/truespeech.c	(original)
+++ trunk/libavcodec/truespeech.c	Thu Jul 31 12:47:31 2008
@@ -54,6 +54,7 @@ static av_cold int truespeech_decode_ini
 {
 //    TSContext *c = avctx->priv_data;
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/vmdav.c
==============================================================================
--- trunk/libavcodec/vmdav.c	(original)
+++ trunk/libavcodec/vmdav.c	Thu Jul 31 12:47:31 2008
@@ -446,6 +446,7 @@ static av_cold int vmdaudio_decode_init(
     s->channels = avctx->channels;
     s->bits = avctx->bits_per_sample;
     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",
             s->channels, s->bits, s->block_align, avctx->sample_rate);

Modified: trunk/libavcodec/vorbis_dec.c
==============================================================================
--- trunk/libavcodec/vorbis_dec.c	(original)
+++ trunk/libavcodec/vorbis_dec.c	Thu Jul 31 12:47:31 2008
@@ -971,6 +971,7 @@ static av_cold int vorbis_decode_init(AV
     avccontext->channels = vc->audio_channels;
     avccontext->sample_rate = vc->audio_samplerate;
     avccontext->frame_size  = FFMIN(vc->blocksize[0], vc->blocksize[1])>>2;
+    avccontext->sample_fmt = SAMPLE_FMT_S16;
 
     return 0 ;
 }

Modified: trunk/libavcodec/vorbis_enc.c
==============================================================================
--- trunk/libavcodec/vorbis_enc.c	(original)
+++ trunk/libavcodec/vorbis_enc.c	Thu Jul 31 12:47:31 2008
@@ -1084,5 +1084,6 @@ AVCodec vorbis_encoder = {
     vorbis_encode_frame,
     vorbis_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
 };

Modified: trunk/libavcodec/wavpack.c
==============================================================================
--- trunk/libavcodec/wavpack.c	(original)
+++ trunk/libavcodec/wavpack.c	Thu Jul 31 12:47:31 2008
@@ -360,6 +360,7 @@ static av_cold int wavpack_decode_init(A
 
     s->avctx = avctx;
     s->stereo = (avctx->channels == 2);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }

Modified: trunk/libavcodec/wmadec.c
==============================================================================
--- trunk/libavcodec/wmadec.c	(original)
+++ trunk/libavcodec/wmadec.c	Thu Jul 31 12:47:31 2008
@@ -126,6 +126,7 @@ static int wma_decode_init(AVCodecContex
         wma_lsp_to_curve_init(s, s->frame_len);
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 

Modified: trunk/libavcodec/wmaenc.c
==============================================================================
--- trunk/libavcodec/wmaenc.c	(original)
+++ trunk/libavcodec/wmaenc.c	Thu Jul 31 12:47:31 2008
@@ -387,6 +387,7 @@ AVCodec wmav1_encoder =
     encode_init,
     encode_superframe,
     ff_wma_end,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
 };
 
@@ -399,5 +400,6 @@ AVCodec wmav2_encoder =
     encode_init,
     encode_superframe,
     ff_wma_end,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
 };

Modified: trunk/libavcodec/ws-snd1.c
==============================================================================
--- trunk/libavcodec/ws-snd1.c	(original)
+++ trunk/libavcodec/ws-snd1.c	Thu Jul 31 12:47:31 2008
@@ -40,6 +40,7 @@ static av_cold int ws_snd_decode_init(AV
 {
 //    WSSNDContext *c = avctx->priv_data;
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 




More information about the ffmpeg-cvslog mailing list