Revision 5d6e4c16

View differences:

ffmpeg.c
148 148
static int frame_height = 0;
149 149
static float frame_aspect_ratio = 0;
150 150
static enum PixelFormat frame_pix_fmt = PIX_FMT_NONE;
151
static enum SampleFormat audio_sample_fmt = SAMPLE_FMT_NONE;
151
static enum AVSampleFormat audio_sample_fmt = AV_SAMPLE_FMT_NONE;
152 152
static int max_frames[4] = {INT_MAX, INT_MAX, INT_MAX, INT_MAX};
153 153
static AVRational frame_rate;
154 154
static float video_qscale = 0;
......
597 597
static void choose_sample_fmt(AVStream *st, AVCodec *codec)
598 598
{
599 599
    if(codec && codec->sample_fmts){
600
        const enum SampleFormat *p= codec->sample_fmts;
600
        const enum AVSampleFormat *p= codec->sample_fmts;
601 601
        for(; *p!=-1; p++){
602 602
            if(*p == st->codec->sample_fmt)
603 603
                break;
......
809 809
        ost->audio_resample = 1;
810 810

  
811 811
    if (ost->audio_resample && !ost->resample) {
812
        if (dec->sample_fmt != SAMPLE_FMT_S16)
812
        if (dec->sample_fmt != AV_SAMPLE_FMT_S16)
813 813
            fprintf(stderr, "Warning, using s16 intermediate sample format for resampling\n");
814 814
        ost->resample = av_audio_resample_init(enc->channels,    dec->channels,
815 815
                                               enc->sample_rate, dec->sample_rate,
......
823 823
        }
824 824
    }
825 825

  
826
#define MAKE_SFMT_PAIR(a,b) ((a)+SAMPLE_FMT_NB*(b))
826
#define MAKE_SFMT_PAIR(a,b) ((a)+AV_SAMPLE_FMT_NB*(b))
827 827
    if (!ost->audio_resample && dec->sample_fmt!=enc->sample_fmt &&
828 828
        MAKE_SFMT_PAIR(enc->sample_fmt,dec->sample_fmt)!=ost->reformat_pair) {
829 829
        if (ost->reformat_ctx)
......
2175 2175
                ost->fifo= av_fifo_alloc(1024);
2176 2176
                if(!ost->fifo)
2177 2177
                    goto fail;
2178
                ost->reformat_pair = MAKE_SFMT_PAIR(SAMPLE_FMT_NONE,SAMPLE_FMT_NONE);
2178
                ost->reformat_pair = MAKE_SFMT_PAIR(AV_SAMPLE_FMT_NONE,AV_SAMPLE_FMT_NONE);
2179 2179
                ost->audio_resample = codec->sample_rate != icodec->sample_rate || audio_sync_method > 1;
2180 2180
                icodec->request_channels = codec->channels;
2181 2181
                ist->decoding_needed = 1;
......
2851 2851
    if (strcmp(arg, "list"))
2852 2852
        audio_sample_fmt = av_get_sample_fmt(arg);
2853 2853
    else {
2854
        list_fmts(av_get_sample_fmt_string, SAMPLE_FMT_NB);
2854
        list_fmts(av_get_sample_fmt_string, AV_SAMPLE_FMT_NB);
2855 2855
        ffmpeg_exit(0);
2856 2856
    }
2857 2857
}
ffplay.c
163 163
    int audio_buf_index; /* in bytes */
164 164
    AVPacket audio_pkt_temp;
165 165
    AVPacket audio_pkt;
166
    enum SampleFormat audio_src_fmt;
166
    enum AVSampleFormat audio_src_fmt;
167 167
    AVAudioConvert *reformat_ctx;
168 168

  
169 169
    int show_audio; /* if true, display audio samples */
......
2095 2095
            if (dec->sample_fmt != is->audio_src_fmt) {
2096 2096
                if (is->reformat_ctx)
2097 2097
                    av_audio_convert_free(is->reformat_ctx);
2098
                is->reformat_ctx= av_audio_convert_alloc(SAMPLE_FMT_S16, 1,
2098
                is->reformat_ctx= av_audio_convert_alloc(AV_SAMPLE_FMT_S16, 1,
2099 2099
                                                         dec->sample_fmt, 1, NULL, 0);
2100 2100
                if (!is->reformat_ctx) {
2101 2101
                    fprintf(stderr, "Cannot convert %s sample format to %s sample format\n",
2102 2102
                        av_get_sample_fmt_name(dec->sample_fmt),
2103
                        av_get_sample_fmt_name(SAMPLE_FMT_S16));
2103
                        av_get_sample_fmt_name(AV_SAMPLE_FMT_S16));
2104 2104
                        break;
2105 2105
                }
2106 2106
                is->audio_src_fmt= dec->sample_fmt;
......
2268 2268
            return -1;
2269 2269
        }
2270 2270
        is->audio_hw_buf_size = spec.size;
2271
        is->audio_src_fmt= SAMPLE_FMT_S16;
2271
        is->audio_src_fmt= AV_SAMPLE_FMT_S16;
2272 2272
    }
2273 2273

  
2274 2274
    ic->streams[stream_index]->discard = AVDISCARD_DEFAULT;
libavcodec/8svx.c
88 88
        default:
89 89
          return -1;
90 90
    }
91
    avctx->sample_fmt = SAMPLE_FMT_S16;
91
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
92 92
    return 0;
93 93
}
94 94

  
libavcodec/aacdec.c
545 545
            return -1;
546 546
    }
547 547

  
548
    avctx->sample_fmt = SAMPLE_FMT_S16;
548
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
549 549

  
550 550
    AAC_INIT_VLC_STATIC( 0, 304);
551 551
    AAC_INIT_VLC_STATIC( 1, 270);
......
2369 2369
    aac_decode_close,
2370 2370
    aac_decode_frame,
2371 2371
    .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
2372
    .sample_fmts = (const enum SampleFormat[]) {
2373
        SAMPLE_FMT_S16,SAMPLE_FMT_NONE
2372
    .sample_fmts = (const enum AVSampleFormat[]) {
2373
        AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE
2374 2374
    },
2375 2375
    .channel_layouts = aac_channel_layout,
2376 2376
};
......
2389 2389
    .close  = aac_decode_close,
2390 2390
    .decode = latm_decode_frame,
2391 2391
    .long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Codec LATM syntax)"),
2392
    .sample_fmts = (const enum SampleFormat[]) {
2393
        SAMPLE_FMT_S16,SAMPLE_FMT_NONE
2392
    .sample_fmts = (const enum AVSampleFormat[]) {
2393
        AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE
2394 2394
    },
2395 2395
    .channel_layouts = aac_channel_layout,
2396 2396
};
libavcodec/aacenc.c
645 645
    aac_encode_frame,
646 646
    aac_encode_end,
647 647
    .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
648
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
648
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
649 649
    .long_name = NULL_IF_CONFIG_SMALL("Advanced Audio Coding"),
650 650
};
libavcodec/ac3dec.c
219 219
            return AVERROR(ENOMEM);
220 220
    }
221 221

  
222
    avctx->sample_fmt = SAMPLE_FMT_S16;
222
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
223 223
    return 0;
224 224
}
225 225

  
libavcodec/ac3enc.c
1400 1400
    AC3_encode_frame,
1401 1401
    AC3_encode_close,
1402 1402
    NULL,
1403
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
1403
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
1404 1404
    .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52A (AC-3)"),
1405 1405
    .channel_layouts = (const int64_t[]){
1406 1406
        CH_LAYOUT_MONO,
libavcodec/adpcm.c
737 737
    default:
738 738
        break;
739 739
    }
740
    avctx->sample_fmt = SAMPLE_FMT_S16;
740
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
741 741
    return 0;
742 742
}
743 743

  
......
1678 1678
    adpcm_encode_frame,                         \
1679 1679
    adpcm_encode_close,                         \
1680 1680
    NULL,                                       \
1681
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
1681
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, \
1682 1682
    .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
1683 1683
};
1684 1684
#else
libavcodec/adxdec.c
34 34

  
35 35
static av_cold int adx_decode_init(AVCodecContext *avctx)
36 36
{
37
    avctx->sample_fmt = SAMPLE_FMT_S16;
37
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
38 38
    return 0;
39 39
}
40 40

  
libavcodec/adxenc.c
192 192
    adx_encode_frame,
193 193
    adx_encode_close,
194 194
    NULL,
195
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
195
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
196 196
    .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
197 197
};
libavcodec/alac.c
505 505
        outputsamples = alac->setinfo_max_samples_per_frame;
506 506

  
507 507
    switch (alac->setinfo_sample_size) {
508
    case 16: avctx->sample_fmt    = SAMPLE_FMT_S16;
508
    case 16: avctx->sample_fmt    = AV_SAMPLE_FMT_S16;
509 509
             alac->bytespersample = channels << 1;
510 510
             break;
511
    case 24: avctx->sample_fmt    = SAMPLE_FMT_S32;
511
    case 24: avctx->sample_fmt    = AV_SAMPLE_FMT_S32;
512 512
             alac->bytespersample = channels << 2;
513 513
             break;
514 514
    default: av_log(avctx, AV_LOG_ERROR, "Sample depth %d is not supported.\n",
libavcodec/alacenc.c
383 383
    avctx->frame_size      = DEFAULT_FRAME_SIZE;
384 384
    avctx->bits_per_coded_sample = DEFAULT_SAMPLE_SIZE;
385 385

  
386
    if(avctx->sample_fmt != SAMPLE_FMT_S16) {
386
    if(avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
387 387
        av_log(avctx, AV_LOG_ERROR, "only pcm_s16 input samples are supported\n");
388 388
        return -1;
389 389
    }
......
528 528
    alac_encode_frame,
529 529
    alac_encode_close,
530 530
    .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
531
    .sample_fmts = (const enum SampleFormat[]){ SAMPLE_FMT_S16, SAMPLE_FMT_NONE},
531
    .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE},
532 532
    .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
533 533
};
libavcodec/alsdec.c
1573 1573
        ff_bgmc_init(avctx, &ctx->bgmc_lut, &ctx->bgmc_lut_status);
1574 1574

  
1575 1575
    if (sconf->floating) {
1576
        avctx->sample_fmt          = SAMPLE_FMT_FLT;
1576
        avctx->sample_fmt          = AV_SAMPLE_FMT_FLT;
1577 1577
        avctx->bits_per_raw_sample = 32;
1578 1578
    } else {
1579 1579
        avctx->sample_fmt          = sconf->resolution > 1
1580
                                     ? SAMPLE_FMT_S32 : SAMPLE_FMT_S16;
1580
                                     ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S16;
1581 1581
        avctx->bits_per_raw_sample = (sconf->resolution + 1) * 8;
1582 1582
    }
1583 1583

  
libavcodec/amrnbdec.c
154 154
    AMRContext *p = avctx->priv_data;
155 155
    int i;
156 156

  
157
    avctx->sample_fmt = SAMPLE_FMT_FLT;
157
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
158 158

  
159 159
    // p->excitation always points to the same position in p->excitation_buf
160 160
    p->excitation = &p->excitation_buf[PITCH_DELAY_MAX + LP_FILTER_ORDER + 1];
......
1044 1044
    .init           = amrnb_decode_init,
1045 1045
    .decode         = amrnb_decode_frame,
1046 1046
    .long_name      = NULL_IF_CONFIG_SMALL("Adaptive Multi-Rate NarrowBand"),
1047
    .sample_fmts    = (enum SampleFormat[]){SAMPLE_FMT_FLT,SAMPLE_FMT_NONE},
1047
    .sample_fmts    = (enum AVSampleFormat[]){AV_SAMPLE_FMT_FLT,AV_SAMPLE_FMT_NONE},
1048 1048
};
libavcodec/apedec.c
198 198
    }
199 199

  
200 200
    dsputil_init(&s->dsp, avctx);
201
    avctx->sample_fmt = SAMPLE_FMT_S16;
201
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
202 202
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
203 203
    return 0;
204 204
}
libavcodec/atrac1.c
326 326
{
327 327
    AT1Ctx *q = avctx->priv_data;
328 328

  
329
    avctx->sample_fmt = SAMPLE_FMT_FLT;
329
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
330 330

  
331 331
    q->channels = avctx->channels;
332 332

  
libavcodec/atrac3.c
1014 1014
        return AVERROR(ENOMEM);
1015 1015
    }
1016 1016

  
1017
    avctx->sample_fmt = SAMPLE_FMT_S16;
1017
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
1018 1018
    return 0;
1019 1019
}
1020 1020

  
libavcodec/audioconvert.c
37 37
    return av_get_sample_fmt_name(sample_fmt);
38 38
}
39 39

  
40
enum SampleFormat avcodec_get_sample_fmt(const char* name)
40
enum AVSampleFormat avcodec_get_sample_fmt(const char* name)
41 41
{
42 42
    return av_get_sample_fmt(name);
43 43
}
......
152 152
    int fmt_pair;
153 153
};
154 154

  
155
AVAudioConvert *av_audio_convert_alloc(enum SampleFormat out_fmt, int out_channels,
156
                                       enum SampleFormat in_fmt, int in_channels,
155
AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
156
                                       enum AVSampleFormat in_fmt, int in_channels,
157 157
                                       const float *matrix, int flags)
158 158
{
159 159
    AVAudioConvert *ctx;
......
164 164
        return NULL;
165 165
    ctx->in_channels = in_channels;
166 166
    ctx->out_channels = out_channels;
167
    ctx->fmt_pair = out_fmt + SAMPLE_FMT_NB*in_fmt;
167
    ctx->fmt_pair = out_fmt + AV_SAMPLE_FMT_NB*in_fmt;
168 168
    return ctx;
169 169
}
170 170

  
......
191 191
            continue;
192 192

  
193 193
#define CONV(ofmt, otype, ifmt, expr)\
194
if(ctx->fmt_pair == ofmt + SAMPLE_FMT_NB*ifmt){\
194
if(ctx->fmt_pair == ofmt + AV_SAMPLE_FMT_NB*ifmt){\
195 195
    do{\
196 196
        *(otype*)po = expr; pi += is; po += os;\
197 197
    }while(po < end);\
......
200 200
//FIXME put things below under ifdefs so we do not waste space for cases no codec will need
201 201
//FIXME rounding ?
202 202

  
203
             CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_U8 ,  *(const uint8_t*)pi)
204
        else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)<<8)
205
        else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)<<24)
206
        else CONV(SAMPLE_FMT_FLT, float  , SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)*(1.0 / (1<<7)))
207
        else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)*(1.0 / (1<<7)))
208
        else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_S16, (*(const int16_t*)pi>>8) + 0x80)
209
        else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_S16,  *(const int16_t*)pi)
210
        else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_S16,  *(const int16_t*)pi<<16)
211
        else CONV(SAMPLE_FMT_FLT, float  , SAMPLE_FMT_S16,  *(const int16_t*)pi*(1.0 / (1<<15)))
212
        else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_S16,  *(const int16_t*)pi*(1.0 / (1<<15)))
213
        else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_S32, (*(const int32_t*)pi>>24) + 0x80)
214
        else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_S32,  *(const int32_t*)pi>>16)
215
        else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_S32,  *(const int32_t*)pi)
216
        else CONV(SAMPLE_FMT_FLT, float  , SAMPLE_FMT_S32,  *(const int32_t*)pi*(1.0 / (1<<31)))
217
        else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_S32,  *(const int32_t*)pi*(1.0 / (1<<31)))
218
        else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_FLT, av_clip_uint8(  lrintf(*(const float*)pi * (1<<7)) + 0x80))
219
        else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_FLT, av_clip_int16(  lrintf(*(const float*)pi * (1<<15))))
220
        else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(const float*)pi * (1U<<31))))
221
        else CONV(SAMPLE_FMT_FLT, float  , SAMPLE_FMT_FLT, *(const float*)pi)
222
        else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_FLT, *(const float*)pi)
223
        else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_DBL, av_clip_uint8(  lrint(*(const double*)pi * (1<<7)) + 0x80))
224
        else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_DBL, av_clip_int16(  lrint(*(const double*)pi * (1<<15))))
225
        else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(const double*)pi * (1U<<31))))
226
        else CONV(SAMPLE_FMT_FLT, float  , SAMPLE_FMT_DBL, *(const double*)pi)
227
        else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_DBL, *(const double*)pi)
203
             CONV(AV_SAMPLE_FMT_U8 , uint8_t, AV_SAMPLE_FMT_U8 ,  *(const uint8_t*)pi)
204
        else CONV(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)<<8)
205
        else CONV(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)<<24)
206
        else CONV(AV_SAMPLE_FMT_FLT, float  , AV_SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)*(1.0 / (1<<7)))
207
        else CONV(AV_SAMPLE_FMT_DBL, double , AV_SAMPLE_FMT_U8 , (*(const uint8_t*)pi - 0x80)*(1.0 / (1<<7)))
208
        else CONV(AV_SAMPLE_FMT_U8 , uint8_t, AV_SAMPLE_FMT_S16, (*(const int16_t*)pi>>8) + 0x80)
209
        else CONV(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_S16,  *(const int16_t*)pi)
210
        else CONV(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S16,  *(const int16_t*)pi<<16)
211
        else CONV(AV_SAMPLE_FMT_FLT, float  , AV_SAMPLE_FMT_S16,  *(const int16_t*)pi*(1.0 / (1<<15)))
212
        else CONV(AV_SAMPLE_FMT_DBL, double , AV_SAMPLE_FMT_S16,  *(const int16_t*)pi*(1.0 / (1<<15)))
213
        else CONV(AV_SAMPLE_FMT_U8 , uint8_t, AV_SAMPLE_FMT_S32, (*(const int32_t*)pi>>24) + 0x80)
214
        else CONV(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_S32,  *(const int32_t*)pi>>16)
215
        else CONV(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_S32,  *(const int32_t*)pi)
216
        else CONV(AV_SAMPLE_FMT_FLT, float  , AV_SAMPLE_FMT_S32,  *(const int32_t*)pi*(1.0 / (1<<31)))
217
        else CONV(AV_SAMPLE_FMT_DBL, double , AV_SAMPLE_FMT_S32,  *(const int32_t*)pi*(1.0 / (1<<31)))
218
        else CONV(AV_SAMPLE_FMT_U8 , uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(  lrintf(*(const float*)pi * (1<<7)) + 0x80))
219
        else CONV(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(  lrintf(*(const float*)pi * (1<<15))))
220
        else CONV(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(const float*)pi * (1U<<31))))
221
        else CONV(AV_SAMPLE_FMT_FLT, float  , AV_SAMPLE_FMT_FLT, *(const float*)pi)
222
        else CONV(AV_SAMPLE_FMT_DBL, double , AV_SAMPLE_FMT_FLT, *(const float*)pi)
223
        else CONV(AV_SAMPLE_FMT_U8 , uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(  lrint(*(const double*)pi * (1<<7)) + 0x80))
224
        else CONV(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(  lrint(*(const double*)pi * (1<<15))))
225
        else CONV(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(const double*)pi * (1U<<31))))
226
        else CONV(AV_SAMPLE_FMT_FLT, float  , AV_SAMPLE_FMT_DBL, *(const double*)pi)
227
        else CONV(AV_SAMPLE_FMT_DBL, double , AV_SAMPLE_FMT_DBL, *(const double*)pi)
228 228
        else return -1;
229 229
    }
230 230
    return 0;
libavcodec/audioconvert.h
49 49
 * @deprecated Use av_get_sample_fmt() instead.
50 50
 */
51 51
attribute_deprecated
52
enum SampleFormat avcodec_get_sample_fmt(const char* name);
52
enum AVSampleFormat avcodec_get_sample_fmt(const char* name);
53 53
#endif
54 54

  
55 55
/**
......
94 94
 * @param flags See AV_CPU_FLAG_xx
95 95
 * @return NULL on error
96 96
 */
97
AVAudioConvert *av_audio_convert_alloc(enum SampleFormat out_fmt, int out_channels,
98
                                       enum SampleFormat in_fmt, int in_channels,
97
AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
98
                                       enum AVSampleFormat in_fmt, int in_channels,
99 99
                                       const float *matrix, int flags);
100 100

  
101 101
/**
libavcodec/avcodec.h
1231 1231
     * - encoding: Set by user.
1232 1232
     * - decoding: Set by libavcodec.
1233 1233
     */
1234
    enum SampleFormat sample_fmt;  ///< sample format
1234
    enum AVSampleFormat sample_fmt;  ///< sample format
1235 1235

  
1236 1236
    /* The following data should not be initialized. */
1237 1237
    /**
......
2555 2555

  
2556 2556
    /**
2557 2557
     * Bits per sample/pixel of internal libavcodec pixel/sample format.
2558
     * This field is applicable only when sample_fmt is SAMPLE_FMT_S32.
2558
     * This field is applicable only when sample_fmt is AV_SAMPLE_FMT_S32.
2559 2559
     * - encoding: set by user.
2560 2560
     * - decoding: set by libavcodec.
2561 2561
     */
......
2796 2796
     */
2797 2797
    const char *long_name;
2798 2798
    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
2799
    const enum SampleFormat *sample_fmts;   ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
2799
    const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
2800 2800
    const int64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
2801 2801
    uint8_t max_lowres;                     ///< maximum value for lowres supported by the decoder
2802 2802
    AVClass *priv_class;                    ///< AVClass for the private context
......
3060 3060
 */
3061 3061
ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
3062 3062
                                        int output_rate, int input_rate,
3063
                                        enum SampleFormat sample_fmt_out,
3064
                                        enum SampleFormat sample_fmt_in,
3063
                                        enum AVSampleFormat sample_fmt_out,
3064
                                        enum AVSampleFormat sample_fmt_in,
3065 3065
                                        int filter_length, int log2_phase_count,
3066 3066
                                        int linear, double cutoff);
3067 3067

  
......
3744 3744
 * @deprecated Use av_get_bits_per_sample_fmt() instead.
3745 3745
 */
3746 3746
attribute_deprecated
3747
int av_get_bits_per_sample_format(enum SampleFormat sample_fmt);
3747
int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt);
3748 3748
#endif
3749 3749

  
3750 3750
/* frame parsing */
libavcodec/binkaudio.c
119 119
    s->bands[s->num_bands] = s->frame_len / 2;
120 120

  
121 121
    s->first = 1;
122
    avctx->sample_fmt = SAMPLE_FMT_S16;
122
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
123 123

  
124 124
    for (i = 0; i < s->channels; i++)
125 125
        s->coeffs_ptr[i] = s->coeffs + i * s->frame_len;
libavcodec/cook.c
1270 1270
        return -1;
1271 1271
    }
1272 1272

  
1273
    avctx->sample_fmt = SAMPLE_FMT_S16;
1273
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
1274 1274
    if (channel_mask)
1275 1275
        avctx->channel_layout = channel_mask;
1276 1276
    else
libavcodec/dca.c
1464 1464

  
1465 1465
    for (i = 0; i < DCA_PRIM_CHANNELS_MAX+1; i++)
1466 1466
        s->samples_chanptr[i] = s->samples + i * 256;
1467
    avctx->sample_fmt = SAMPLE_FMT_S16;
1467
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
1468 1468

  
1469 1469
    if (s->dsp.float_to_int16_interleave == ff_float_to_int16_interleave_c) {
1470 1470
        s->add_bias = 385.0f;
libavcodec/dpcm.c
155 155
        break;
156 156
    }
157 157

  
158
    avctx->sample_fmt = SAMPLE_FMT_S16;
158
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
159 159
    return 0;
160 160
}
161 161

  
libavcodec/dsicinav.c
307 307
    cin->avctx = avctx;
308 308
    cin->initial_decode_frame = 1;
309 309
    cin->delta = 0;
310
    avctx->sample_fmt = SAMPLE_FMT_S16;
310
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
311 311

  
312 312
    return 0;
313 313
}
libavcodec/flacdec.c
113 113
    FLACContext *s = avctx->priv_data;
114 114
    s->avctx = avctx;
115 115

  
116
    avctx->sample_fmt = SAMPLE_FMT_S16;
116
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
117 117

  
118 118
    /* for now, the raw FLAC header is allowed to be passed to the decoder as
119 119
       frame data instead of extradata. */
......
126 126
    /* initialize based on the demuxer-supplied streamdata header */
127 127
    ff_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
128 128
    if (s->bps > 16)
129
        avctx->sample_fmt = SAMPLE_FMT_S32;
129
        avctx->sample_fmt = AV_SAMPLE_FMT_S32;
130 130
    else
131
        avctx->sample_fmt = SAMPLE_FMT_S16;
131
        avctx->sample_fmt = AV_SAMPLE_FMT_S16;
132 132
    allocate_buffers(s);
133 133
    s->got_streaminfo = 1;
134 134

  
......
603 603
    s->bps = s->avctx->bits_per_raw_sample = fi.bps;
604 604

  
605 605
    if (s->bps > 16) {
606
        s->avctx->sample_fmt = SAMPLE_FMT_S32;
606
        s->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
607 607
        s->sample_shift = 32 - s->bps;
608 608
        s->is32 = 1;
609 609
    } else {
610
        s->avctx->sample_fmt = SAMPLE_FMT_S16;
610
        s->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
611 611
        s->sample_shift = 16 - s->bps;
612 612
        s->is32 = 0;
613 613
    }
libavcodec/flacenc.c
219 219

  
220 220
    dsputil_init(&s->dsp, avctx);
221 221

  
222
    if (avctx->sample_fmt != SAMPLE_FMT_S16)
222
    if (avctx->sample_fmt != AV_SAMPLE_FMT_S16)
223 223
        return -1;
224 224

  
225 225
    if (channels < 1 || channels > FLAC_MAX_CHANNELS)
......
1335 1335
    flac_encode_close,
1336 1336
    NULL,
1337 1337
    .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
1338
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
1338
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
1339 1339
    .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
1340 1340
};
libavcodec/g722.c
193 193
        av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n");
194 194
        return AVERROR_INVALIDDATA;
195 195
    }
196
    avctx->sample_fmt = SAMPLE_FMT_S16;
196
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
197 197

  
198 198
    switch (avctx->bits_per_coded_sample) {
199 199
    case 8:
......
379 379
    .init           = g722_init,
380 380
    .encode         = g722_encode_frame,
381 381
    .long_name      = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
382
    .sample_fmts    = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
382
    .sample_fmts    = (enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
383 383
};
384 384
#endif
385 385

  
libavcodec/g726.c
332 332
    avctx->coded_frame->key_frame = 1;
333 333

  
334 334
    if (avctx->codec->decode)
335
        avctx->sample_fmt = SAMPLE_FMT_S16;
335
        avctx->sample_fmt = AV_SAMPLE_FMT_S16;
336 336

  
337 337
    /* select a frame size that will end on a byte boundary and have a size of
338 338
       approximately 1024 bytes */
......
401 401
    g726_close,
402 402
    NULL,
403 403
    .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
404
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
404
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
405 405
    .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
406 406
};
407 407
#endif
libavcodec/gsmdec.c
35 35
    avctx->channels = 1;
36 36
    if (!avctx->sample_rate)
37 37
        avctx->sample_rate = 8000;
38
    avctx->sample_fmt = SAMPLE_FMT_S16;
38
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
39 39

  
40 40
    switch (avctx->codec_id) {
41 41
    case CODEC_ID_GSM:
libavcodec/imc.c
156 156

  
157 157
    ff_fft_init(&q->fft, 7, 1);
158 158
    dsputil_init(&q->dsp, avctx);
159
    avctx->sample_fmt = SAMPLE_FMT_FLT;
159
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
160 160
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
161 161
    return 0;
162 162
}
libavcodec/libfaac.c
153 153
    Faac_encode_init,
154 154
    Faac_encode_frame,
155 155
    Faac_encode_close,
156
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
156
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
157 157
    .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
158 158
};
libavcodec/libgsm.c
49 49
        if(!avctx->sample_rate)
50 50
            avctx->sample_rate= 8000;
51 51

  
52
        avctx->sample_fmt = SAMPLE_FMT_S16;
52
        avctx->sample_fmt = AV_SAMPLE_FMT_S16;
53 53
    }else{
54 54
        if (avctx->sample_rate != 8000) {
55 55
            av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
......
120 120
    libgsm_init,
121 121
    libgsm_encode_frame,
122 122
    libgsm_close,
123
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
123
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
124 124
    .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"),
125 125
};
126 126

  
......
132 132
    libgsm_init,
133 133
    libgsm_encode_frame,
134 134
    libgsm_close,
135
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
135
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
136 136
    .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
137 137
};
138 138

  
libavcodec/libmp3lame.c
222 222
    MP3lame_encode_frame,
223 223
    MP3lame_encode_close,
224 224
    .capabilities= CODEC_CAP_DELAY,
225
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
225
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
226 226
    .supported_samplerates= sSampleRates,
227 227
    .long_name= NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
228 228
};
libavcodec/libopencore-amr.c
32 32
        avctx->channels = 1;
33 33

  
34 34
    avctx->frame_size = 160 * is_amr_wb;
35
    avctx->sample_fmt = SAMPLE_FMT_S16;
35
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
36 36
}
37 37

  
38 38
#if CONFIG_LIBOPENCORE_AMRNB
......
222 222
    amr_nb_encode_frame,
223 223
    amr_nb_encode_close,
224 224
    NULL,
225
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
225
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
226 226
    .long_name = NULL_IF_CONFIG_SMALL("OpenCORE Adaptive Multi-Rate (AMR) Narrow-Band"),
227 227
};
228 228

  
libavcodec/libspeexdec.c
49 49
    if (avctx->extradata_size >= 80)
50 50
        s->header = speex_packet_to_header(avctx->extradata, avctx->extradata_size);
51 51

  
52
    avctx->sample_fmt = SAMPLE_FMT_S16;
52
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
53 53
    if (s->header) {
54 54
        avctx->sample_rate = s->header->rate;
55 55
        avctx->channels    = s->header->nb_channels;
libavcodec/libvorbis.c
252 252
    oggvorbis_encode_frame,
253 253
    oggvorbis_encode_close,
254 254
    .capabilities= CODEC_CAP_DELAY,
255
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
255
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
256 256
    .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
257 257
    .priv_class= &class,
258 258
} ;
libavcodec/mace.c
230 230
{
231 231
    if (avctx->channels > 2)
232 232
        return -1;
233
    avctx->sample_fmt = SAMPLE_FMT_S16;
233
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
234 234
    return 0;
235 235
}
236 236

  
libavcodec/mlp_parser.c
255 255

  
256 256
        avctx->bits_per_raw_sample = mh.group1_bits;
257 257
        if (avctx->bits_per_raw_sample > 16)
258
            avctx->sample_fmt = SAMPLE_FMT_S32;
258
            avctx->sample_fmt = AV_SAMPLE_FMT_S32;
259 259
        else
260
            avctx->sample_fmt = SAMPLE_FMT_S16;
260
            avctx->sample_fmt = AV_SAMPLE_FMT_S16;
261 261
        avctx->sample_rate = mh.group1_samplerate;
262 262
        avctx->frame_size = mh.access_unit_size;
263 263

  
libavcodec/mlpdec.c
318 318

  
319 319
    m->avctx->bits_per_raw_sample = mh.group1_bits;
320 320
    if (mh.group1_bits > 16)
321
        m->avctx->sample_fmt = SAMPLE_FMT_S32;
321
        m->avctx->sample_fmt = AV_SAMPLE_FMT_S32;
322 322
    else
323
        m->avctx->sample_fmt = SAMPLE_FMT_S16;
323
        m->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
324 324

  
325 325
    m->params_valid = 1;
326 326
    for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
......
931 931
static int output_data(MLPDecodeContext *m, unsigned int substr,
932 932
                       uint8_t *data, unsigned int *data_size)
933 933
{
934
    if (m->avctx->sample_fmt == SAMPLE_FMT_S32)
934
    if (m->avctx->sample_fmt == AV_SAMPLE_FMT_S32)
935 935
        return output_data_internal(m, substr, data, data_size, 1);
936 936
    else
937 937
        return output_data_internal(m, substr, data, data_size, 0);
libavcodec/mpc7.c
85 85
            c->IS, c->MSS, c->gapless, c->lastframelen, c->maxbands);
86 86
    c->frames_to_skip = 0;
87 87

  
88
    avctx->sample_fmt = SAMPLE_FMT_S16;
88
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
89 89
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
90 90

  
91 91
    if(vlc_initialized) return 0;
libavcodec/mpc8.c
129 129
    c->MSS = get_bits1(&gb);
130 130
    c->frames = 1 << (get_bits(&gb, 3) * 2);
131 131

  
132
    avctx->sample_fmt = SAMPLE_FMT_S16;
132
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
133 133
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
134 134

  
135 135
    if(vlc_initialized) return 0;
libavcodec/mpegaudio.h
72 72

  
73 73
#if CONFIG_FLOAT
74 74
typedef float OUT_INT;
75
#define OUT_FMT SAMPLE_FMT_FLT
75
#define OUT_FMT AV_SAMPLE_FMT_FLT
76 76
#elif CONFIG_MPEGAUDIO_HP && CONFIG_AUDIO_NONSHORT
77 77
typedef int32_t OUT_INT;
78 78
#define OUT_MAX INT32_MAX
79 79
#define OUT_MIN INT32_MIN
80 80
#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 31)
81
#define OUT_FMT SAMPLE_FMT_S32
81
#define OUT_FMT AV_SAMPLE_FMT_S32
82 82
#else
83 83
typedef int16_t OUT_INT;
84 84
#define OUT_MAX INT16_MAX
85 85
#define OUT_MIN INT16_MIN
86 86
#define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
87
#define OUT_FMT SAMPLE_FMT_S16
87
#define OUT_FMT AV_SAMPLE_FMT_S16
88 88
#endif
89 89

  
90 90
#if CONFIG_FLOAT
libavcodec/mpegaudioenc.c
792 792
    MPA_encode_frame,
793 793
    MPA_encode_close,
794 794
    NULL,
795
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
795
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
796 796
    .supported_samplerates= (const int[]){44100, 48000,  32000, 22050, 24000, 16000, 0},
797 797
    .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
798 798
};
libavcodec/nellymoserdec.c
147 147
    if (!ff_sine_128[127])
148 148
        ff_init_ff_sine_windows(7);
149 149

  
150
    avctx->sample_fmt = SAMPLE_FMT_S16;
150
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
151 151
    avctx->channel_layout = CH_LAYOUT_MONO;
152 152
    return 0;
153 153
}
libavcodec/nellymoserenc.c
392 392
    .close = encode_end,
393 393
    .capabilities = CODEC_CAP_SMALL_LAST_FRAME | CODEC_CAP_DELAY,
394 394
    .long_name = NULL_IF_CONFIG_SMALL("Nellymoser Asao"),
395
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
395
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
396 396
};
libavcodec/options.c
461 461
    s->execute2= avcodec_default_execute2;
462 462
    s->sample_aspect_ratio= (AVRational){0,1};
463 463
    s->pix_fmt= PIX_FMT_NONE;
464
    s->sample_fmt= SAMPLE_FMT_NONE;
464
    s->sample_fmt= AV_SAMPLE_FMT_NONE;
465 465

  
466 466
    s->palctrl = NULL;
467 467
    s->reget_buffer= avcodec_default_reget_buffer;
libavcodec/pcm-mpeg.c
72 72
        av_log(avctx, AV_LOG_ERROR, "unsupported sample depth (0)\n");
73 73
        return -1;
74 74
    }
75
    avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? SAMPLE_FMT_S16 :
76
                                                             SAMPLE_FMT_S32;
75
    avctx->sample_fmt = avctx->bits_per_coded_sample == 16 ? AV_SAMPLE_FMT_S16 :
76
                                                             AV_SAMPLE_FMT_S32;
77 77

  
78 78
    /* get the sample rate. Not all values are known or exist. */
79 79
    switch (header[2] & 0x0f) {
......
146 146
    samples = buf_size / sample_size;
147 147

  
148 148
    output_size = samples * avctx->channels *
149
                  (avctx->sample_fmt == SAMPLE_FMT_S32 ? 4 : 2);
149
                  (avctx->sample_fmt == AV_SAMPLE_FMT_S32 ? 4 : 2);
150 150
    if (output_size > *data_size) {
151 151
        av_log(avctx, AV_LOG_ERROR,
152 152
               "Insufficient output buffer space (%d bytes, needed %d bytes)\n",
......
162 162
        case CH_LAYOUT_4POINT0:
163 163
        case CH_LAYOUT_2_2:
164 164
            samples *= num_source_channels;
165
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
165
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
166 166
#if HAVE_BIGENDIAN
167 167
                memcpy(dst16, src, output_size);
168 168
#else
......
181 181
        case CH_LAYOUT_SURROUND:
182 182
        case CH_LAYOUT_2_1:
183 183
        case CH_LAYOUT_5POINT0:
184
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
184
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
185 185
                do {
186 186
#if HAVE_BIGENDIAN
187 187
                    memcpy(dst16, src, avctx->channels * 2);
......
207 207
            break;
208 208
            /* remapping: L, R, C, LBack, RBack, LF */
209 209
        case CH_LAYOUT_5POINT1:
210
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
210
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
211 211
                do {
212 212
                    dst16[0] = bytestream_get_be16(&src);
213 213
                    dst16[1] = bytestream_get_be16(&src);
......
231 231
            break;
232 232
            /* remapping: L, R, C, LSide, LBack, RBack, RSide, <unused> */
233 233
        case CH_LAYOUT_7POINT0:
234
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
234
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
235 235
                do {
236 236
                    dst16[0] = bytestream_get_be16(&src);
237 237
                    dst16[1] = bytestream_get_be16(&src);
......
259 259
            break;
260 260
            /* remapping: L, R, C, LSide, LBack, RBack, RSide, LF */
261 261
        case CH_LAYOUT_7POINT1:
262
            if (SAMPLE_FMT_S16 == avctx->sample_fmt) {
262
            if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
263 263
                do {
264 264
                    dst16[0] = bytestream_get_be16(&src);
265 265
                    dst16[1] = bytestream_get_be16(&src);
......
304 304
    NULL,
305 305
    NULL,
306 306
    pcm_bluray_decode_frame,
307
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16, SAMPLE_FMT_S32,
308
                                         SAMPLE_FMT_NONE},
307
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32,
308
                                         AV_SAMPLE_FMT_NONE},
309 309
    .long_name = NULL_IF_CONFIG_SMALL("PCM signed 16|20|24-bit big-endian for Blu-ray media"),
310 310
};
libavcodec/pcm.c
228 228

  
229 229
    avctx->sample_fmt = avctx->codec->sample_fmts[0];
230 230

  
231
    if (avctx->sample_fmt == SAMPLE_FMT_S32)
231
    if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
232 232
        avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec->id);
233 233

  
234 234
    return 0;
......
475 475
    .init        = pcm_encode_init,             \
476 476
    .encode      = pcm_encode_frame,            \
477 477
    .close       = pcm_encode_close,            \
478
    .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
478
    .sample_fmts = (const enum AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
479 479
    .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
480 480
};
481 481
#else
......
491 491
    .priv_data_size = sizeof(PCMDecode),        \
492 492
    .init           = pcm_decode_init,          \
493 493
    .decode         = pcm_decode_frame,         \
494
    .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
494
    .sample_fmts = (const enum AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
495 495
    .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
496 496
};
497 497
#else
......
502 502
    PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,sample_fmt_,name,long_name_)
503 503

  
504 504
/* Note: Do not forget to add new entries to the Makefile as well. */
505
PCM_CODEC  (CODEC_ID_PCM_ALAW,  SAMPLE_FMT_S16, pcm_alaw, "PCM A-law");
506
PCM_CODEC  (CODEC_ID_PCM_DVD,   SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
507
PCM_CODEC  (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
508
PCM_CODEC  (CODEC_ID_PCM_F32LE, SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
509
PCM_CODEC  (CODEC_ID_PCM_F64BE, SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
510
PCM_CODEC  (CODEC_ID_PCM_F64LE, SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
511
PCM_DECODER(CODEC_ID_PCM_LXF,   SAMPLE_FMT_S32, pcm_lxf, "PCM signed 20-bit little-endian planar");
512
PCM_CODEC  (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law");
513
PCM_CODEC  (CODEC_ID_PCM_S8,    SAMPLE_FMT_U8,  pcm_s8, "PCM signed 8-bit");
514
PCM_CODEC  (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
515
PCM_CODEC  (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
516
PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, SAMPLE_FMT_S16, pcm_s16le_planar, "PCM 16-bit little-endian planar");
517
PCM_CODEC  (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
518
PCM_CODEC  (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16,  pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
519
PCM_CODEC  (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
520
PCM_CODEC  (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
521
PCM_CODEC  (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
522
PCM_CODEC  (CODEC_ID_PCM_U8,    SAMPLE_FMT_U8,  pcm_u8, "PCM unsigned 8-bit");
523
PCM_CODEC  (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
524
PCM_CODEC  (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
525
PCM_CODEC  (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
526
PCM_CODEC  (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
527
PCM_CODEC  (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
528
PCM_CODEC  (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
529
PCM_CODEC  (CODEC_ID_PCM_ZORK,  SAMPLE_FMT_S16, pcm_zork, "PCM Zork");
505
PCM_CODEC  (CODEC_ID_PCM_ALAW,  AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law");
506
PCM_CODEC  (CODEC_ID_PCM_DVD,   AV_SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
507
PCM_CODEC  (CODEC_ID_PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
508
PCM_CODEC  (CODEC_ID_PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
509
PCM_CODEC  (CODEC_ID_PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
510
PCM_CODEC  (CODEC_ID_PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
511
PCM_DECODER(CODEC_ID_PCM_LXF,   AV_SAMPLE_FMT_S32, pcm_lxf, "PCM signed 20-bit little-endian planar");
512
PCM_CODEC  (CODEC_ID_PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law");
513
PCM_CODEC  (CODEC_ID_PCM_S8,    AV_SAMPLE_FMT_U8,  pcm_s8, "PCM signed 8-bit");
514
PCM_CODEC  (CODEC_ID_PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
515
PCM_CODEC  (CODEC_ID_PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
516
PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16, pcm_s16le_planar, "PCM 16-bit little-endian planar");
517
PCM_CODEC  (CODEC_ID_PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
518
PCM_CODEC  (CODEC_ID_PCM_S24DAUD, AV_SAMPLE_FMT_S16,  pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
519
PCM_CODEC  (CODEC_ID_PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
520
PCM_CODEC  (CODEC_ID_PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
521
PCM_CODEC  (CODEC_ID_PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
522
PCM_CODEC  (CODEC_ID_PCM_U8,    AV_SAMPLE_FMT_U8,  pcm_u8, "PCM unsigned 8-bit");
523
PCM_CODEC  (CODEC_ID_PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
524
PCM_CODEC  (CODEC_ID_PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
525
PCM_CODEC  (CODEC_ID_PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
526
PCM_CODEC  (CODEC_ID_PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
527
PCM_CODEC  (CODEC_ID_PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
528
PCM_CODEC  (CODEC_ID_PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
529
PCM_CODEC  (CODEC_ID_PCM_ZORK,  AV_SAMPLE_FMT_S16, pcm_zork, "PCM Zork");
libavcodec/qcelpdec.c
92 92
    QCELPContext *q = avctx->priv_data;
93 93
    int i;
94 94

  
95
    avctx->sample_fmt = SAMPLE_FMT_FLT;
95
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
96 96

  
97 97
    for(i=0; i<10; i++)
98 98
        q->prev_lspf[i] = (i+1)/11.;
libavcodec/qdm2.c
1866 1866

  
1867 1867
    qdm2_init(s);
1868 1868

  
1869
    avctx->sample_fmt = SAMPLE_FMT_S16;
1869
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
1870 1870

  
1871 1871
//    dump_context(s);
1872 1872
    return 0;
libavcodec/ra144dec.c
37 37
    ractx->lpc_coef[0] = ractx->lpc_tables[0];
38 38
    ractx->lpc_coef[1] = ractx->lpc_tables[1];
39 39

  
40
    avctx->sample_fmt = SAMPLE_FMT_S16;
40
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
41 41
    return 0;
42 42
}
43 43

  
libavcodec/ra144enc.c
38 38
{
39 39
    RA144Context *ractx;
40 40

  
41
    if (avctx->sample_fmt != SAMPLE_FMT_S16) {
41
    if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
42 42
        av_log(avctx, AV_LOG_ERROR, "invalid sample format\n");
43 43
        return -1;
44 44
    }
libavcodec/ra288.c
54 54

  
55 55
static av_cold int ra288_decode_init(AVCodecContext *avctx)
56 56
{
57
    avctx->sample_fmt = SAMPLE_FMT_FLT;
57
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
58 58
    return 0;
59 59
}
60 60

  
libavcodec/resample.c
47 47
    /* channel convert */
48 48
    int input_channels, output_channels, filter_channels;
49 49
    AVAudioConvert *convert_ctx[2];
50
    enum SampleFormat sample_fmt[2]; ///< input and output sample format
50
    enum AVSampleFormat sample_fmt[2]; ///< input and output sample format
51 51
    unsigned sample_size[2];         ///< size of one sample in sample_fmt
52 52
    short *buffer[2];                ///< buffers used for conversion to S16
53 53
    unsigned buffer_size[2];         ///< sizes of allocated buffers
......
144 144

  
145 145
ReSampleContext *av_audio_resample_init(int output_channels, int input_channels,
146 146
                                        int output_rate, int input_rate,
147
                                        enum SampleFormat sample_fmt_out,
148
                                        enum SampleFormat sample_fmt_in,
147
                                        enum AVSampleFormat sample_fmt_out,
148
                                        enum AVSampleFormat sample_fmt_in,
149 149
                                        int filter_length, int log2_phase_count,
150 150
                                        int linear, double cutoff)
151 151
{
......
178 178
    s->sample_size[0] = av_get_bits_per_sample_fmt(s->sample_fmt[0])>>3;
179 179
    s->sample_size[1] = av_get_bits_per_sample_fmt(s->sample_fmt[1])>>3;
180 180

  
181
    if (s->sample_fmt[0] != SAMPLE_FMT_S16) {
182
        if (!(s->convert_ctx[0] = av_audio_convert_alloc(SAMPLE_FMT_S16, 1,
181
    if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
182
        if (!(s->convert_ctx[0] = av_audio_convert_alloc(AV_SAMPLE_FMT_S16, 1,
183 183
                                                         s->sample_fmt[0], 1, NULL, 0))) {
184 184
            av_log(s, AV_LOG_ERROR,
185 185
                   "Cannot convert %s sample format to s16 sample format\n",
......
189 189
        }
190 190
    }
191 191

  
192
    if (s->sample_fmt[1] != SAMPLE_FMT_S16) {
192
    if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) {
193 193
        if (!(s->convert_ctx[1] = av_audio_convert_alloc(s->sample_fmt[1], 1,
194
                                                         SAMPLE_FMT_S16, 1, NULL, 0))) {
194
                                                         AV_SAMPLE_FMT_S16, 1, NULL, 0))) {
195 195
            av_log(s, AV_LOG_ERROR,
196 196
                   "Cannot convert s16 sample format to %s sample format\n",
197 197
                   av_get_sample_fmt_name(s->sample_fmt[1]));
......
224 224
{
225 225
    return av_audio_resample_init(output_channels, input_channels,
226 226
                                  output_rate, input_rate,
227
                                  SAMPLE_FMT_S16, SAMPLE_FMT_S16,
227
                                  AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
228 228
                                  TAPS, 10, 0, 0.8);
229 229
}
230 230
#endif
......
246 246
        return nb_samples;
247 247
    }
248 248

  
249
    if (s->sample_fmt[0] != SAMPLE_FMT_S16) {
249
    if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
250 250
        int istride[1] = { s->sample_size[0] };
251 251
        int ostride[1] = { 2 };
252 252
        const void *ibuf[1] = { input };
......
276 276

  
277 277
    lenout= 4*nb_samples * s->ratio + 16;
278 278

  
279
    if (s->sample_fmt[1] != SAMPLE_FMT_S16) {
279
    if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) {
280 280
        output_bak = output;
281 281

  
282 282
        if (!s->buffer_size[1] || s->buffer_size[1] < lenout) {
......
341 341
        ac3_5p1_mux(output, buftmp3[0], buftmp3[1], nb_samples1);
342 342
    }
343 343

  
344
    if (s->sample_fmt[1] != SAMPLE_FMT_S16) {
344
    if (s->sample_fmt[1] != AV_SAMPLE_FMT_S16) {
345 345
        int istride[1] = { 2 };
346 346
        int ostride[1] = { s->sample_size[1] };
347 347
        const void *ibuf[1] = { output };
libavcodec/roqaudioenc.c
49 49
        av_log(avctx, AV_LOG_ERROR, "Audio must be 22050 Hz\n");
50 50
        return -1;
51 51
    }
52
    if (avctx->sample_fmt != SAMPLE_FMT_S16) {
52
    if (avctx->sample_fmt != AV_SAMPLE_FMT_S16) {
53 53
        av_log(avctx, AV_LOG_ERROR, "Audio must be signed 16-bit\n");
54 54
        return -1;
55 55
    }
......
162 162
    roq_dpcm_encode_frame,
163 163
    roq_dpcm_encode_close,
164 164
    NULL,
165
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
165
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
166 166
    .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
167 167
};
libavcodec/shorten.c
105 105
{
106 106
    ShortenContext *s = avctx->priv_data;
107 107
    s->avctx = avctx;
108
    avctx->sample_fmt = SAMPLE_FMT_S16;
108
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
109 109

  
110 110
    return 0;
111 111
}
libavcodec/sipr.c
493 493
    for (i = 0; i < 4; i++)
494 494
        ctx->energy_history[i] = -14;
495 495

  
496
    avctx->sample_fmt = SAMPLE_FMT_FLT;
496
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
497 497

  
498 498
    dsputil_init(&ctx->dsp, avctx);
499 499

  
libavcodec/smacker.c
555 555
static av_cold int smka_decode_init(AVCodecContext *avctx)
556 556
{
557 557
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
558
    avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? SAMPLE_FMT_U8 : SAMPLE_FMT_S16;
558
    avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? AV_SAMPLE_FMT_U8 : AV_SAMPLE_FMT_S16;
559 559
    return 0;
560 560
}
561 561

  
libavcodec/sonic.c
825 825
    }
826 826
    s->int_samples = av_mallocz(4* s->frame_size);
827 827

  
828
    avctx->sample_fmt = SAMPLE_FMT_S16;
828
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
829 829
    return 0;
830 830
}
831 831

  
libavcodec/truespeech.c
56 56
{
57 57
//    TSContext *c = avctx->priv_data;
58 58

  
59
    avctx->sample_fmt = SAMPLE_FMT_S16;
59
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
60 60
    return 0;
61 61
}
62 62

  
libavcodec/tta.c
246 246

  
247 247
        if (s->is_float)
248 248
        {
249
            avctx->sample_fmt = SAMPLE_FMT_FLT;
249
            avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
250 250
            av_log(s->avctx, AV_LOG_ERROR, "Unsupported sample format. Please contact the developers.\n");
251 251
            return -1;
252 252
        }
253 253
        else switch(s->bps) {
254
//            case 1: avctx->sample_fmt = SAMPLE_FMT_U8; break;
255
            case 2: avctx->sample_fmt = SAMPLE_FMT_S16; break;
256
//            case 3: avctx->sample_fmt = SAMPLE_FMT_S24; break;
257
            case 4: avctx->sample_fmt = SAMPLE_FMT_S32; break;
254
//            case 1: avctx->sample_fmt = AV_SAMPLE_FMT_U8; break;
255
            case 2: avctx->sample_fmt = AV_SAMPLE_FMT_S16; break;
256
//            case 3: avctx->sample_fmt = AV_SAMPLE_FMT_S24; break;
257
            case 4: avctx->sample_fmt = AV_SAMPLE_FMT_S32; break;
258 258
            default:
259 259
                av_log(s->avctx, AV_LOG_ERROR, "Invalid/unsupported sample format. Please contact the developers.\n");
260 260
                return -1;
libavcodec/twinvq.c
1068 1068
    int ibps = avctx->bit_rate/(1000 * avctx->channels);
1069 1069

  
1070 1070
    tctx->avctx       = avctx;
1071
    avctx->sample_fmt = SAMPLE_FMT_FLT;
1071
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
1072 1072

  
1073 1073
    if (avctx->channels > CHANNELS_MAX) {
1074 1074
        av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
libavcodec/utils.c
923 923
        }
924 924
        av_strlcat(buf, ", ", buf_size);
925 925
        avcodec_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout);
926
        if (enc->sample_fmt != SAMPLE_FMT_NONE) {
926
        if (enc->sample_fmt != AV_SAMPLE_FMT_NONE) {
927 927
            snprintf(buf + strlen(buf), buf_size - strlen(buf),
928 928
                     ", %s", av_get_sample_fmt_name(enc->sample_fmt));
929 929
        }
......
1067 1067
}
1068 1068

  
1069 1069
#if FF_API_OLD_SAMPLE_FMT
1070
int av_get_bits_per_sample_format(enum SampleFormat sample_fmt) {
1070
int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt) {
1071 1071
    return av_get_bits_per_sample_fmt(sample_fmt);
1072 1072
}
1073 1073
#endif
libavcodec/vmdav.c
446 446
    s->channels = avctx->channels;
447 447
    s->bits = avctx->bits_per_coded_sample;
448 448
    s->block_align = avctx->block_align;
449
    avctx->sample_fmt = SAMPLE_FMT_S16;
449
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
450 450

  
451 451
    av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
452 452
            s->channels, s->bits, s->block_align, avctx->sample_rate);
libavcodec/vorbis_dec.c
1006 1006
    avccontext->channels    = vc->audio_channels;
1007 1007
    avccontext->sample_rate = vc->audio_samplerate;
1008 1008
    avccontext->frame_size  = FFMIN(vc->blocksize[0], vc->blocksize[1]) >> 2;
1009
    avccontext->sample_fmt  = SAMPLE_FMT_S16;
1009
    avccontext->sample_fmt  = AV_SAMPLE_FMT_S16;
1010 1010

  
1011 1011
    return 0 ;
1012 1012
}
libavcodec/vorbis_enc.c
1111 1111
    vorbis_encode_frame,
1112 1112
    vorbis_encode_close,
1113 1113
    .capabilities= CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
1114
    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
1114
    .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
1115 1115
    .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
1116 1116
};
libavcodec/wavpack.c
494 494
                    B = s->decorr[i].samplesB[pos];
495 495
                    j = (pos + t) & 7;
496 496
                }
497
                if(type != SAMPLE_FMT_S16){
497
                if(type != AV_SAMPLE_FMT_S16){
498 498
                    L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);
499 499
                    R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10);
500 500
                }else{
......
506 506
                s->decorr[i].samplesA[j] = L = L2;
507 507
                s->decorr[i].samplesB[j] = R = R2;
508 508
            }else if(t == -1){
509
                if(type != SAMPLE_FMT_S16)
509
                if(type != AV_SAMPLE_FMT_S16)
510 510
                    L2 = L + ((s->decorr[i].weightA * (int64_t)s->decorr[i].samplesA[0] + 512) >> 10);
511 511
                else
512 512
                    L2 = L + ((s->decorr[i].weightA * s->decorr[i].samplesA[0] + 512) >> 10);
513 513
                UPDATE_WEIGHT_CLIP(s->decorr[i].weightA, s->decorr[i].delta, s->decorr[i].samplesA[0], L);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff