Unified · Split
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include "ac3_parser.h" | 24 | #include "ac3_parser.h" |
| 25 | #include "aac_ac3_parser.h" | 25 | #include "aac_ac3_parser.h" |
| 26 | #include "get_bits.h" | 26 | #include "get_bits.h" |
| 27 | #include "libavcore/audioconvert.h" | ||
| 27 | 28 | ||
| 28 | 29 | ||
| 29 | #define AC3_HEADER_SIZE 7 | 30 | #define AC3_HEADER_SIZE 7 |
| @@ -123,7 +124,7 @@ int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) · 93 unmodified lines | |||
| 123 | } | 124 | } |
| 124 | hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode]; | 125 | hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode]; |
| 125 | if (hdr->lfe_on) | 126 | if (hdr->lfe_on) |
| 126 | hdr->channel_layout |= CH_LOW_FREQUENCY; | 127 | hdr->channel_layout |= AV_CH_LOW_FREQUENCY; |
| 127 | 128 | ||
| 128 | return 0; | 129 | return 0; |
| 129 | } | 130 | } |
| @@ -25,6 +25,7 @@ · 24 unmodified lines | |||
| 25 | #include "dsputil.h" | 25 | #include "dsputil.h" |
| 26 | #include "get_bits.h" | 26 | #include "get_bits.h" |
| 27 | #include "bytestream.h" | 27 | #include "bytestream.h" |
| 28 | #include "libavcore/audioconvert.h" | ||
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * @file | 31 | * @file |
| @@ -199,7 +200,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx) · 168 unmodified lines | |||
| 199 | 200 | ||
| 200 | dsputil_init(&s->dsp, avctx); | 201 | dsputil_init(&s->dsp, avctx); |
| 201 | avctx->sample_fmt = AV_SAMPLE_FMT_S16; | 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 | return 0; | 204 | return 0; |
| 204 | } | 205 | } |
| 205 | 206 | ||
| @@ -31,6 +31,7 @@ · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | #include "libavutil/cpu.h" | 32 | #include "libavutil/cpu.h" |
| 33 | #include "avcodec.h" | 33 | #include "avcodec.h" |
| 34 | #include "libavcore/audioconvert.h" | ||
| 34 | 35 | ||
| 35 | #if FF_API_OLD_SAMPLE_FMT | 36 | #if FF_API_OLD_SAMPLE_FMT |
| 36 | /** | 37 | /** |
| @@ -53,6 +53,7 @@ · 52 unmodified lines | |||
| 53 | #include "dsputil.h" | 53 | #include "dsputil.h" |
| 54 | #include "bytestream.h" | 54 | #include "bytestream.h" |
| 55 | #include "fft.h" | 55 | #include "fft.h" |
| 56 | #include "libavcore/audioconvert.h" | ||
| 56 | 57 | ||
| 57 | #include "cookdata.h" | 58 | #include "cookdata.h" |
| 58 | 59 | ||
| @@ -1274,7 +1275,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) · 1215 unmodified lines | |||
| 1274 | if (channel_mask) | 1275 | if (channel_mask) |
| 1275 | avctx->channel_layout = channel_mask; | 1276 | avctx->channel_layout = channel_mask; |
| 1276 | else | 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 | #ifdef COOKDEBUG | 1280 | #ifdef COOKDEBUG |
| 1280 | dump_cook_context(q); | 1281 | dump_cook_context(q); |
| @@ -106,7 +106,7 @@ enum DCAExtensionMask { · 105 unmodified lines | |||
| 106 | * L = left, R = right, C = center, S = surround, F = front, R = rear, T = total, OV = overhead. | 106 | * L = left, R = right, C = center, S = surround, F = front, R = rear, T = total, OV = overhead. |
| 107 | * S -> side, when both rear and back are configured move one of them to the side channel | 107 | * S -> side, when both rear and back are configured move one of them to the side channel |
| 108 | * OV -> center back | 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 | static const int64_t dca_core_channel_layout[] = { | 112 | static const int64_t dca_core_channel_layout[] = { |
| @@ -117,7 +117,7 @@ static const int64_t dca_core_channel_layout[] = { · 4 unmodified lines | |||
| 117 | AV_CH_LAYOUT_STEREO, ///< 2, LT +RT (left and right total) | 117 | AV_CH_LAYOUT_STEREO, ///< 2, LT +RT (left and right total) |
| 118 | AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER, ///< 3, C+L+R | 118 | AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER, ///< 3, C+L+R |
| 119 | AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER, ///< 3, L+R+S | 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 | AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 4, L + R +SL+ SR | 121 | AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 4, L + R +SL+ SR |
| 122 | AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 5, C + L + R+ SL+SR | 122 | AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 5, C + L + R+ SL+SR |
| 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 | 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 |
| @@ -40,6 +40,7 @@ · 39 unmodified lines | |||
| 40 | #include "get_bits.h" | 40 | #include "get_bits.h" |
| 41 | #include "dsputil.h" | 41 | #include "dsputil.h" |
| 42 | #include "fft.h" | 42 | #include "fft.h" |
| 43 | #include "libavcore/audioconvert.h" | ||
| 43 | 44 | ||
| 44 | #include "imcdata.h" | 45 | #include "imcdata.h" |
| 45 | 46 | ||
| @@ -157,7 +158,7 @@ static av_cold int imc_decode_init(AVCodecContext * avctx) · 111 unmodified lines | |||
| 157 | ff_fft_init(&q->fft, 7, 1); | 158 | ff_fft_init(&q->fft, 7, 1); |
| 158 | dsputil_init(&q->dsp, avctx); | 159 | dsputil_init(&q->dsp, avctx); |
| 159 | avctx->sample_fmt = AV_SAMPLE_FMT_FLT; | 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 | return 0; | 162 | return 0; |
| 162 | } | 163 | } |
| 163 | 164 | ||
| @@ -30,6 +30,7 @@ · 29 unmodified lines | |||
| 30 | #include "get_bits.h" | 30 | #include "get_bits.h" |
| 31 | #include "dsputil.h" | 31 | #include "dsputil.h" |
| 32 | #include "mpegaudio.h" | 32 | #include "mpegaudio.h" |
| 33 | #include "libavcore/audioconvert.h" | ||
| 33 | 34 | ||
| 34 | #include "mpc.h" | 35 | #include "mpc.h" |
| 35 | #include "mpc7data.h" | 36 | #include "mpc7data.h" |
| @@ -86,7 +87,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) · 50 unmodified lines | |||
| 86 | c->frames_to_skip = 0; | 87 | c->frames_to_skip = 0; |
| 87 | 88 | ||
| 88 | avctx->sample_fmt = AV_SAMPLE_FMT_S16; | 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 | if(vlc_initialized) return 0; | 92 | if(vlc_initialized) return 0; |
| 92 | av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); | 93 | av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | |||
| 30 | #include "get_bits.h" | 30 | #include "get_bits.h" |
| 31 | #include "dsputil.h" | 31 | #include "dsputil.h" |
| 32 | #include "mpegaudio.h" | 32 | #include "mpegaudio.h" |
| 33 | #include "libavcore/audioconvert.h" | ||
| 33 | 34 | ||
| 34 | #include "mpc.h" | 35 | #include "mpc.h" |
| 35 | #include "mpcdata.h" | 36 | #include "mpcdata.h" |
| @@ -135,7 +136,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) · 99 unmodified lines | |||
| 135 | c->frames = 1 << (get_bits(&gb, 3) * 2); | 136 | c->frames = 1 << (get_bits(&gb, 3) * 2); |
| 136 | 137 | ||
| 137 | avctx->sample_fmt = AV_SAMPLE_FMT_S16; | 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 | if(vlc_initialized) return 0; | 141 | if(vlc_initialized) return 0; |
| 141 | av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); | 142 | av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n"); |
| @@ -32,6 +32,7 @@ · 31 unmodified lines | |||
| 32 | #include <stdlib.h> | 32 | #include <stdlib.h> |
| 33 | 33 | ||
| 34 | #include "avcodec.h" | 34 | #include "avcodec.h" |
| 35 | #include "libavcore/audioconvert.h" | ||
| 35 | 36 | ||
| 36 | #define ALT_BITSTREAM_READER_LE | 37 | #define ALT_BITSTREAM_READER_LE |
| 37 | #include "get_bits.h" | 38 | #include "get_bits.h" |
| @@ -554,7 +555,7 @@ static av_cold int decode_end(AVCodecContext *avctx) · 516 unmodified lines | |||
| 554 | 555 | ||
| 555 | static av_cold int smka_decode_init(AVCodecContext *avctx) | 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 | avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? AV_SAMPLE_FMT_U8 : AV_SAMPLE_FMT_S16; | 559 | avctx->sample_fmt = avctx->bits_per_coded_sample == 8 ? AV_SAMPLE_FMT_U8 : AV_SAMPLE_FMT_S16; |
| 559 | return 0; | 560 | return 0; |
| 560 | } | 561 | } |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #include "dsputil.h" | 21 | #include "dsputil.h" |
| 22 | #include "vorbis.h" | 22 | #include "vorbis.h" |
| 23 | #include "libavcore/audioconvert.h" | ||
| 23 | 24 | ||
| 24 | const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { | 25 | const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { |
| 25 | { 0 }, | 26 | { 0 }, |
| @@ -44,14 +45,14 @@ const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = { · 18 unmodified lines | |||
| 44 | }; | 45 | }; |
| 45 | 46 | ||
| 46 | const int64_t ff_vorbis_channel_layouts[9] = { | 47 | const int64_t ff_vorbis_channel_layouts[9] = { |
| 47 | CH_LAYOUT_MONO, | 48 | AV_CH_LAYOUT_MONO, |
| 48 | CH_LAYOUT_STEREO, | 49 | AV_CH_LAYOUT_STEREO, |
| 49 | CH_LAYOUT_SURROUND, | 50 | AV_CH_LAYOUT_SURROUND, |
| 50 | CH_LAYOUT_QUAD, | 51 | AV_CH_LAYOUT_QUAD, |
| 51 | CH_LAYOUT_5POINT0_BACK, | 52 | AV_CH_LAYOUT_5POINT0_BACK, |
| 52 | CH_LAYOUT_5POINT1_BACK, | 53 | AV_CH_LAYOUT_5POINT1_BACK, |
| 53 | CH_LAYOUT_5POINT1|CH_BACK_CENTER, | 54 | AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER, |
| 54 | CH_LAYOUT_7POINT1, | 55 | AV_CH_LAYOUT_7POINT1, |
| 55 | 0 | 56 | 0 |
| 56 | }; | 57 | }; |
| 57 | 58 | ||
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include "avcodec.h" | 22 | #include "avcodec.h" |
| 23 | #include "get_bits.h" | 23 | #include "get_bits.h" |
| 24 | #include "unary.h" | 24 | #include "unary.h" |
| 25 | #include "libavcore/audioconvert.h" | ||
| 25 | 26 | ||
| 26 | /** | 27 | /** |
| 27 | * @file | 28 | * @file |
| @@ -706,7 +707,7 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx) · 678 unmodified lines | |||
| 706 | else | 707 | else |
| 707 | avctx->sample_fmt = AV_SAMPLE_FMT_S32; | 708 | avctx->sample_fmt = AV_SAMPLE_FMT_S32; |
| 708 | if(avctx->channels <= 2 && !avctx->channel_layout) | 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 | s->multichannel = avctx->channels > 2; | 712 | s->multichannel = avctx->channels > 2; |
| 712 | /* lavf demuxer does not provide extradata, Matroska stores 0x403 | 713 | /* lavf demuxer does not provide extradata, Matroska stores 0x403 |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include "avformat.h" | 23 | #include "avformat.h" |
| 24 | #include "pcm.h" | 24 | #include "pcm.h" |
| 25 | #include "libavutil/intreadwrite.h" | 25 | #include "libavutil/intreadwrite.h" |
| 26 | #include "libavcore/audioconvert.h" | ||
| 26 | 27 | ||
| 27 | #define AT1_SU_SIZE 212 | 28 | #define AT1_SU_SIZE 212 |
| 28 | 29 | ||
| @@ -76,7 +77,7 @@ static int aea_read_header(AVFormatContext *s, · 47 unmodified lines | |||
| 76 | return -1; | 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 | st->codec->block_align = AT1_SU_SIZE * st->codec->channels; | 82 | st->codec->block_align = AT1_SU_SIZE * st->codec->channels; |
| 82 | return 0; | 83 | return 0; |
| @@ -33,6 +33,7 @@ · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | #include "libavutil/intreadwrite.h" | 34 | #include "libavutil/intreadwrite.h" |
| 35 | #include "avformat.h" | 35 | #include "avformat.h" |
| 36 | #include "libavcore/audioconvert.h" | ||
| 36 | 37 | ||
| 37 | #define FLIC_FILE_MAGIC_1 0xAF11 | 38 | #define FLIC_FILE_MAGIC_1 0xAF11 |
| 38 | #define FLIC_FILE_MAGIC_2 0xAF12 | 39 | #define FLIC_FILE_MAGIC_2 0xAF12 |
| @@ -160,7 +161,7 @@ static int flic_read_header(AVFormatContext *s, · 121 unmodified lines | |||
| 160 | ast->codec->sample_fmt = AV_SAMPLE_FMT_U8; | 161 | ast->codec->sample_fmt = AV_SAMPLE_FMT_U8; |
| 161 | ast->codec->bit_rate = st->codec->sample_rate * 8; | 162 | ast->codec->bit_rate = st->codec->sample_rate * 8; |
| 162 | ast->codec->bits_per_coded_sample = 8; | 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 | ast->codec->extradata_size = 0; | 165 | ast->codec->extradata_size = 0; |
| 165 | 166 | ||
| 166 | /* Since the header information is incorrect we have to figure out the | 167 | /* Since the header information is incorrect we have to figure out the |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include "avformat.h" | 23 | #include "avformat.h" |
| 24 | #include "apetag.h" | 24 | #include "apetag.h" |
| 25 | #include "id3v1.h" | 25 | #include "id3v1.h" |
| 26 | #include "libavcore/audioconvert.h" | ||
| 26 | 27 | ||
| 27 | // specs say that maximum block size is 1Mb | 28 | // specs say that maximum block size is 1Mb |
| 28 | #define WV_BLOCK_LIMIT 1047576 | 29 | #define WV_BLOCK_LIMIT 1047576 |
| @@ -111,7 +112,7 @@ static int wv_read_block_header(AVFormatContext *ctx, ByteIOContext *pb, int app · 82 unmodified lines | |||
| 111 | //parse flags | 112 | //parse flags |
| 112 | bpp = ((wc->flags & 3) + 1) << 3; | 113 | bpp = ((wc->flags & 3) + 1) << 3; |
| 113 | chan = 1 + !(wc->flags & WV_MONO); | 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 | rate = wv_rates[(wc->flags >> 23) & 0xF]; | 116 | rate = wv_rates[(wc->flags >> 23) & 0xF]; |
| 116 | wc->multichannel = !!((wc->flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK); | 117 | wc->multichannel = !!((wc->flags & WV_SINGLE_BLOCK) != WV_SINGLE_BLOCK); |
| 117 | if(wc->multichannel){ | 118 | if(wc->multichannel){ |