Revision fbdcdaee

View differences:

libavcodec/ac3_parser.c
24 24
#include "ac3_parser.h"
25 25
#include "aac_ac3_parser.h"
26 26
#include "get_bits.h"
27
#include "libavcore/audioconvert.h"
27 28

  
28 29

  
29 30
#define AC3_HEADER_SIZE 7
......
123 124
    }
124 125
    hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];
125 126
    if (hdr->lfe_on)
126
        hdr->channel_layout |= CH_LOW_FREQUENCY;
127
        hdr->channel_layout |= AV_CH_LOW_FREQUENCY;
127 128

  
128 129
    return 0;
129 130
}
libavcodec/apedec.c
25 25
#include "dsputil.h"
26 26
#include "get_bits.h"
27 27
#include "bytestream.h"
28
#include "libavcore/audioconvert.h"
28 29

  
29 30
/**
30 31
 * @file
......
199 200

  
200 201
    dsputil_init(&s->dsp, avctx);
201 202
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
202
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
203
    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
203 204
    return 0;
204 205
}
205 206

  
libavcodec/audioconvert.h
31 31

  
32 32
#include "libavutil/cpu.h"
33 33
#include "avcodec.h"
34
#include "libavcore/audioconvert.h"
34 35

  
35 36
#if FF_API_OLD_SAMPLE_FMT
36 37
/**
libavcodec/cook.c
53 53
#include "dsputil.h"
54 54
#include "bytestream.h"
55 55
#include "fft.h"
56
#include "libavcore/audioconvert.h"
56 57

  
57 58
#include "cookdata.h"
58 59

  
......
1274 1275
    if (channel_mask)
1275 1276
        avctx->channel_layout = channel_mask;
1276 1277
    else
1277
        avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
1278
        avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
1278 1279

  
1279 1280
#ifdef COOKDEBUG
1280 1281
    dump_cook_context(q);
libavcodec/dca.c
106 106
 * L = left, R = right, C = center, S = surround, F = front, R = rear, T = total, OV = overhead.
107 107
 * S  -> side, when both rear and back are configured move one of them to the side channel
108 108
 * OV -> center back
109
 * All 2 channel configurations -> CH_LAYOUT_STEREO
109
 * All 2 channel configurations -> AV_CH_LAYOUT_STEREO
110 110
 */
111 111

  
112 112
static const int64_t dca_core_channel_layout[] = {
......
117 117
    AV_CH_LAYOUT_STEREO,                                                     ///< 2, LT +RT (left and right total)
118 118
    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER,                                  ///< 3, C+L+R
119 119
    AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER,                                   ///< 3, L+R+S
120
    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|CH_BACK_CENTER,                   ///< 4, C + L + R+ S
120
    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|AV_CH_BACK_CENTER,                ///< 4, C + L + R+ S
121 121
    AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,                    ///< 4, L + R +SL+ SR
122 122
    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 5, C + L + R+ SL+SR
123 123
    AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER,                    ///< 6, CL + CR + L + R + SL + SR
libavcodec/imc.c
40 40
#include "get_bits.h"
41 41
#include "dsputil.h"
42 42
#include "fft.h"
43
#include "libavcore/audioconvert.h"
43 44

  
44 45
#include "imcdata.h"
45 46

  
......
157 158
    ff_fft_init(&q->fft, 7, 1);
158 159
    dsputil_init(&q->dsp, avctx);
159 160
    avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
160
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
161
    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
161 162
    return 0;
162 163
}
163 164

  
libavcodec/mpc7.c
30 30
#include "get_bits.h"
31 31
#include "dsputil.h"
32 32
#include "mpegaudio.h"
33
#include "libavcore/audioconvert.h"
33 34

  
34 35
#include "mpc.h"
35 36
#include "mpc7data.h"
......
86 87
    c->frames_to_skip = 0;
87 88

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

  
91 92
    if(vlc_initialized) return 0;
92 93
    av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
libavcodec/mpc8.c
30 30
#include "get_bits.h"
31 31
#include "dsputil.h"
32 32
#include "mpegaudio.h"
33
#include "libavcore/audioconvert.h"
33 34

  
34 35
#include "mpc.h"
35 36
#include "mpcdata.h"
......
135 136
    c->frames = 1 << (get_bits(&gb, 3) * 2);
136 137

  
137 138
    avctx->sample_fmt = AV_SAMPLE_FMT_S16;
138
    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
139
    avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
139 140

  
140 141
    if(vlc_initialized) return 0;
141 142
    av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
libavcodec/smacker.c
32 32
#include <stdlib.h>
33 33

  
34 34
#include "avcodec.h"
35
#include "libavcore/audioconvert.h"
35 36

  
36 37
#define ALT_BITSTREAM_READER_LE
37 38
#include "get_bits.h"
......
554 555

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

  
21 21
#include "dsputil.h"
22 22
#include "vorbis.h"
23
#include "libavcore/audioconvert.h"
23 24

  
24 25
const uint8_t ff_vorbis_channel_layout_offsets[8][8] = {
25 26
    { 0 },
......
44 45
};
45 46

  
46 47
const int64_t ff_vorbis_channel_layouts[9] = {
47
    CH_LAYOUT_MONO,
48
    CH_LAYOUT_STEREO,
49
    CH_LAYOUT_SURROUND,
50
    CH_LAYOUT_QUAD,
51
    CH_LAYOUT_5POINT0_BACK,
52
    CH_LAYOUT_5POINT1_BACK,
53
    CH_LAYOUT_5POINT1|CH_BACK_CENTER,
54
    CH_LAYOUT_7POINT1,
48
    AV_CH_LAYOUT_MONO,
49
    AV_CH_LAYOUT_STEREO,
50
    AV_CH_LAYOUT_SURROUND,
51
    AV_CH_LAYOUT_QUAD,
52
    AV_CH_LAYOUT_5POINT0_BACK,
53
    AV_CH_LAYOUT_5POINT1_BACK,
54
    AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER,
55
    AV_CH_LAYOUT_7POINT1,
55 56
    0
56 57
};
57 58

  
libavcodec/wavpack.c
22 22
#include "avcodec.h"
23 23
#include "get_bits.h"
24 24
#include "unary.h"
25
#include "libavcore/audioconvert.h"
25 26

  
26 27
/**
27 28
 * @file
......
706 707
    else
707 708
        avctx->sample_fmt = AV_SAMPLE_FMT_S32;
708 709
    if(avctx->channels <= 2 && !avctx->channel_layout)
709
        avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
710
        avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
710 711

  
711 712
    s->multichannel = avctx->channels > 2;
712 713
    /* lavf demuxer does not provide extradata, Matroska stores 0x403
libavformat/aea.c
23 23
#include "avformat.h"
24 24
#include "pcm.h"
25 25
#include "libavutil/intreadwrite.h"
26
#include "libavcore/audioconvert.h"
26 27

  
27 28
#define AT1_SU_SIZE     212
28 29

  
......
76 77
        return -1;
77 78
    }
78 79

  
79
    st->codec->channel_layout = (st->codec->channels == 1) ? CH_LAYOUT_MONO : CH_LAYOUT_STEREO;
80
    st->codec->channel_layout = (st->codec->channels == 1) ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
80 81

  
81 82
    st->codec->block_align = AT1_SU_SIZE * st->codec->channels;
82 83
    return 0;
libavformat/flic.c
33 33

  
34 34
#include "libavutil/intreadwrite.h"
35 35
#include "avformat.h"
36
#include "libavcore/audioconvert.h"
36 37

  
37 38
#define FLIC_FILE_MAGIC_1 0xAF11
38 39
#define FLIC_FILE_MAGIC_2 0xAF12
......
160 161
        ast->codec->sample_fmt = AV_SAMPLE_FMT_U8;
161 162
        ast->codec->bit_rate = st->codec->sample_rate * 8;
162 163
        ast->codec->bits_per_coded_sample = 8;
163
        ast->codec->channel_layout = CH_LAYOUT_MONO;
164
        ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
164 165
        ast->codec->extradata_size = 0;
165 166

  
166 167
        /* Since the header information is incorrect we have to figure out the
libavformat/wv.c
23 23
#include "avformat.h"
24 24
#include "apetag.h"
25 25
#include "id3v1.h"
26
#include "libavcore/audioconvert.h"
26 27

  
27 28
// specs say that maximum block size is 1Mb
28 29
#define WV_BLOCK_LIMIT 1047576
......
111 112
    //parse flags
112 113
    bpp = ((wc->flags & 3) + 1) << 3;
113 114
    chan = 1 + !(wc->flags & WV_MONO);
114
    chmask = wc->flags & WV_MONO ? CH_LAYOUT_MONO : CH_LAYOUT_STEREO;
115
    chmask = wc->flags & WV_MONO ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
115 116
    rate = wv_rates[(wc->flags >> 23) & 0xF];
116 117
    wc->multichannel = !!((wc->flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK);
117 118
    if(wc->multichannel){

Also available in: Unified diff