Browse code

Use the new libavcore audio channel API.

This also allows to remove a linking dependency of libavfilter on
libavcodec.

Originally committed as revision 25789 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini authored on 2010/11/22 05:06:22
Showing 14 changed files
... ...
@@ -36,6 +36,7 @@
36 36
 #include "libswscale/swscale.h"
37 37
 #include "libavcodec/opt.h"
38 38
 #include "libavcodec/audioconvert.h"
39
+#include "libavcore/audioconvert.h"
39 40
 #include "libavcore/parseutils.h"
40 41
 #include "libavcore/samplefmt.h"
41 42
 #include "libavutil/colorspace.h"
... ...
@@ -3541,7 +3542,7 @@ static void new_audio_stream(AVFormatContext *oc, int file_idx)
3541 3541
         audio_enc->sample_fmt = audio_sample_fmt;
3542 3542
         audio_enc->sample_rate = audio_sample_rate;
3543 3543
         audio_enc->channel_layout = channel_layout;
3544
-        if (avcodec_channel_layout_num_channels(channel_layout) != audio_channels)
3544
+        if (av_get_channel_layout_nb_channels(channel_layout) != audio_channels)
3545 3545
             audio_enc->channel_layout = 0;
3546 3546
         choose_sample_fmt(st, codec);
3547 3547
         choose_sample_rate(st, codec);
... ...
@@ -30,6 +30,7 @@
30 30
 #ifndef AVCODEC_AACDECTAB_H
31 31
 #define AVCODEC_AACDECTAB_H
32 32
 
33
+#include "libavcore/audioconvert.h"
33 34
 #include "aac.h"
34 35
 
35 36
 #include <stdint.h>
... ...
@@ -82,13 +83,13 @@ static const uint8_t aac_channel_layout_map[7][5][2] = {
82 82
 };
83 83
 
84 84
 static const int64_t aac_channel_layout[8] = {
85
-    CH_LAYOUT_MONO,
86
-    CH_LAYOUT_STEREO,
87
-    CH_LAYOUT_SURROUND,
88
-    CH_LAYOUT_4POINT0,
89
-    CH_LAYOUT_5POINT0_BACK,
90
-    CH_LAYOUT_5POINT1_BACK,
91
-    CH_LAYOUT_7POINT1_WIDE,
85
+    AV_CH_LAYOUT_MONO,
86
+    AV_CH_LAYOUT_STEREO,
87
+    AV_CH_LAYOUT_SURROUND,
88
+    AV_CH_LAYOUT_4POINT0,
89
+    AV_CH_LAYOUT_5POINT0_BACK,
90
+    AV_CH_LAYOUT_5POINT1_BACK,
91
+    AV_CH_LAYOUT_7POINT1_WIDE,
92 92
     0,
93 93
 };
94 94
 
... ...
@@ -25,6 +25,7 @@
25 25
  */
26 26
 //#define DEBUG
27 27
 //#define DEBUG_BITALLOC
28
+#include "libavcore/audioconvert.h"
28 29
 #include "libavutil/crc.h"
29 30
 #include "avcodec.h"
30 31
 #include "libavutil/common.h" /* for av_reverse */
... ...
@@ -620,26 +621,26 @@ static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
620 620
     ch_layout = *channel_layout;
621 621
     if (!ch_layout)
622 622
         ch_layout = avcodec_guess_channel_layout(channels, CODEC_ID_AC3, NULL);
623
-    if (avcodec_channel_layout_num_channels(ch_layout) != channels)
623
+    if (av_get_channel_layout_nb_channels(ch_layout) != channels)
624 624
         return -1;
625 625
 
626
-    s->lfe = !!(ch_layout & CH_LOW_FREQUENCY);
626
+    s->lfe = !!(ch_layout & AV_CH_LOW_FREQUENCY);
627 627
     s->nb_all_channels = channels;
628 628
     s->nb_channels = channels - s->lfe;
629 629
     s->lfe_channel = s->lfe ? s->nb_channels : -1;
630 630
     if (s->lfe)
631
-        ch_layout -= CH_LOW_FREQUENCY;
631
+        ch_layout -= AV_CH_LOW_FREQUENCY;
632 632
 
633 633
     switch (ch_layout) {
634
-    case CH_LAYOUT_MONO:           s->channel_mode = AC3_CHMODE_MONO;   break;
635
-    case CH_LAYOUT_STEREO:         s->channel_mode = AC3_CHMODE_STEREO; break;
636
-    case CH_LAYOUT_SURROUND:       s->channel_mode = AC3_CHMODE_3F;     break;
637
-    case CH_LAYOUT_2_1:            s->channel_mode = AC3_CHMODE_2F1R;   break;
638
-    case CH_LAYOUT_4POINT0:        s->channel_mode = AC3_CHMODE_3F1R;   break;
639
-    case CH_LAYOUT_QUAD:
640
-    case CH_LAYOUT_2_2:            s->channel_mode = AC3_CHMODE_2F2R;   break;
641
-    case CH_LAYOUT_5POINT0:
642
-    case CH_LAYOUT_5POINT0_BACK:   s->channel_mode = AC3_CHMODE_3F2R;   break;
634
+    case AV_CH_LAYOUT_MONO:           s->channel_mode = AC3_CHMODE_MONO;   break;
635
+    case AV_CH_LAYOUT_STEREO:         s->channel_mode = AC3_CHMODE_STEREO; break;
636
+    case AV_CH_LAYOUT_SURROUND:       s->channel_mode = AC3_CHMODE_3F;     break;
637
+    case AV_CH_LAYOUT_2_1:            s->channel_mode = AC3_CHMODE_2F1R;   break;
638
+    case AV_CH_LAYOUT_4POINT0:        s->channel_mode = AC3_CHMODE_3F1R;   break;
639
+    case AV_CH_LAYOUT_QUAD:
640
+    case AV_CH_LAYOUT_2_2:            s->channel_mode = AC3_CHMODE_2F2R;   break;
641
+    case AV_CH_LAYOUT_5POINT0:
642
+    case AV_CH_LAYOUT_5POINT0_BACK:   s->channel_mode = AC3_CHMODE_3F2R;   break;
643 643
     default:
644 644
         return -1;
645 645
     }
... ...
@@ -647,7 +648,7 @@ static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
647 647
     s->channel_map = ff_ac3_enc_channel_map[s->channel_mode][s->lfe];
648 648
     *channel_layout = ch_layout;
649 649
     if (s->lfe)
650
-        *channel_layout |= CH_LOW_FREQUENCY;
650
+        *channel_layout |= AV_CH_LOW_FREQUENCY;
651 651
 
652 652
     return 0;
653 653
 }
... ...
@@ -1403,23 +1404,23 @@ AVCodec ac3_encoder = {
1403 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
-        CH_LAYOUT_MONO,
1407
-        CH_LAYOUT_STEREO,
1408
-        CH_LAYOUT_2_1,
1409
-        CH_LAYOUT_SURROUND,
1410
-        CH_LAYOUT_2_2,
1411
-        CH_LAYOUT_QUAD,
1412
-        CH_LAYOUT_4POINT0,
1413
-        CH_LAYOUT_5POINT0,
1414
-        CH_LAYOUT_5POINT0_BACK,
1415
-       (CH_LAYOUT_MONO     | CH_LOW_FREQUENCY),
1416
-       (CH_LAYOUT_STEREO   | CH_LOW_FREQUENCY),
1417
-       (CH_LAYOUT_2_1      | CH_LOW_FREQUENCY),
1418
-       (CH_LAYOUT_SURROUND | CH_LOW_FREQUENCY),
1419
-       (CH_LAYOUT_2_2      | CH_LOW_FREQUENCY),
1420
-       (CH_LAYOUT_QUAD     | CH_LOW_FREQUENCY),
1421
-       (CH_LAYOUT_4POINT0  | CH_LOW_FREQUENCY),
1422
-        CH_LAYOUT_5POINT1,
1423
-        CH_LAYOUT_5POINT1_BACK,
1406
+        AV_CH_LAYOUT_MONO,
1407
+        AV_CH_LAYOUT_STEREO,
1408
+        AV_CH_LAYOUT_2_1,
1409
+        AV_CH_LAYOUT_SURROUND,
1410
+        AV_CH_LAYOUT_2_2,
1411
+        AV_CH_LAYOUT_QUAD,
1412
+        AV_CH_LAYOUT_4POINT0,
1413
+        AV_CH_LAYOUT_5POINT0,
1414
+        AV_CH_LAYOUT_5POINT0_BACK,
1415
+       (AV_CH_LAYOUT_MONO     | AV_CH_LOW_FREQUENCY),
1416
+       (AV_CH_LAYOUT_STEREO   | AV_CH_LOW_FREQUENCY),
1417
+       (AV_CH_LAYOUT_2_1      | AV_CH_LOW_FREQUENCY),
1418
+       (AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY),
1419
+       (AV_CH_LAYOUT_2_2      | AV_CH_LOW_FREQUENCY),
1420
+       (AV_CH_LAYOUT_QUAD     | AV_CH_LOW_FREQUENCY),
1421
+       (AV_CH_LAYOUT_4POINT0  | AV_CH_LOW_FREQUENCY),
1422
+        AV_CH_LAYOUT_5POINT1,
1423
+        AV_CH_LAYOUT_5POINT1_BACK,
1424 1424
         0 },
1425 1425
 };
... ...
@@ -24,6 +24,7 @@
24 24
  * tables taken directly from the AC-3 spec.
25 25
  */
26 26
 
27
+#include "libavcore/audioconvert.h"
27 28
 #include "avcodec.h"
28 29
 #include "ac3tab.h"
29 30
 
... ...
@@ -84,14 +85,14 @@ const uint8_t ff_ac3_channels_tab[8] = {
84 84
  * Map audio coding mode (acmod) to channel layout mask.
85 85
  */
86 86
 const uint16_t ff_ac3_channel_layout_tab[8] = {
87
-    CH_LAYOUT_STEREO,
88
-    CH_LAYOUT_MONO,
89
-    CH_LAYOUT_STEREO,
90
-    CH_LAYOUT_SURROUND,
91
-    CH_LAYOUT_2_1,
92
-    CH_LAYOUT_4POINT0,
93
-    CH_LAYOUT_2_2,
94
-    CH_LAYOUT_5POINT0
87
+    AV_CH_LAYOUT_STEREO,
88
+    AV_CH_LAYOUT_MONO,
89
+    AV_CH_LAYOUT_STEREO,
90
+    AV_CH_LAYOUT_SURROUND,
91
+    AV_CH_LAYOUT_2_1,
92
+    AV_CH_LAYOUT_4POINT0,
93
+    AV_CH_LAYOUT_2_2,
94
+    AV_CH_LAYOUT_5POINT0
95 95
 };
96 96
 
97 97
 #define COMMON_CHANNEL_MAP \
... ...
@@ -51,13 +51,13 @@ void avcodec_sample_fmt_string (char *buf, int buf_size, int sample_fmt)
51 51
 int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name)
52 52
 {
53 53
     switch(nb_channels) {
54
-    case 1: return CH_LAYOUT_MONO;
55
-    case 2: return CH_LAYOUT_STEREO;
56
-    case 3: return CH_LAYOUT_SURROUND;
57
-    case 4: return CH_LAYOUT_QUAD;
58
-    case 5: return CH_LAYOUT_5POINT0;
59
-    case 6: return CH_LAYOUT_5POINT1;
60
-    case 8: return CH_LAYOUT_7POINT1;
54
+    case 1: return AV_CH_LAYOUT_MONO;
55
+    case 2: return AV_CH_LAYOUT_STEREO;
56
+    case 3: return AV_CH_LAYOUT_SURROUND;
57
+    case 4: return AV_CH_LAYOUT_QUAD;
58
+    case 5: return AV_CH_LAYOUT_5POINT0;
59
+    case 6: return AV_CH_LAYOUT_5POINT1;
60
+    case 8: return AV_CH_LAYOUT_7POINT1;
61 61
     default: return 0;
62 62
     }
63 63
 }
... ...
@@ -33,7 +33,7 @@
33 33
 
34 34
 #define LIBAVCODEC_VERSION_MAJOR 52
35 35
 #define LIBAVCODEC_VERSION_MINOR 97
36
-#define LIBAVCODEC_VERSION_MICRO  1
36
+#define LIBAVCODEC_VERSION_MICRO  2
37 37
 
38 38
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
39 39
                                                LIBAVCODEC_VERSION_MINOR, \
... ...
@@ -80,7 +80,7 @@
80 80
 #define FF_API_OLD_SAMPLE_FMT   (LIBAVCODEC_VERSION_MAJOR < 53)
81 81
 #endif
82 82
 #ifndef FF_API_OLD_AUDIOCONVERT
83
-#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54)
83
+#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 53)
84 84
 #endif
85 85
 
86 86
 #define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
... ...
@@ -28,6 +28,7 @@
28 28
 
29 29
 #include "libavutil/intmath.h"
30 30
 #include "libavutil/intreadwrite.h"
31
+#include "libavcore/audioconvert.h"
31 32
 #include "avcodec.h"
32 33
 #include "dsputil.h"
33 34
 #include "fft.h"
... ...
@@ -74,22 +75,22 @@ enum DCAMode {
74 74
  */
75 75
 
76 76
 static const int64_t dca_core_channel_layout[] = {
77
-    CH_FRONT_CENTER,                                               ///< 1, A
78
-    CH_LAYOUT_STEREO,                                              ///< 2, A + B (dual mono)
79
-    CH_LAYOUT_STEREO,                                              ///< 2, L + R (stereo)
80
-    CH_LAYOUT_STEREO,                                              ///< 2, (L+R) + (L-R) (sum-difference)
81
-    CH_LAYOUT_STEREO,                                              ///< 2, LT +RT (left and right total)
82
-    CH_LAYOUT_STEREO|CH_FRONT_CENTER,                              ///< 3, C+L+R
83
-    CH_LAYOUT_STEREO|CH_BACK_CENTER,                               ///< 3, L+R+S
84
-    CH_LAYOUT_STEREO|CH_FRONT_CENTER|CH_BACK_CENTER,               ///< 4, C + L + R+ S
85
-    CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_SIDE_RIGHT,                   ///< 4, L + R +SL+ SR
86
-    CH_LAYOUT_STEREO|CH_FRONT_CENTER|CH_SIDE_LEFT|CH_SIDE_RIGHT,   ///< 5, C + L + R+ SL+SR
87
-    CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_SIDE_RIGHT|CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER,                 ///< 6, CL + CR + L + R + SL + SR
88
-    CH_LAYOUT_STEREO|CH_BACK_LEFT|CH_BACK_RIGHT|CH_FRONT_CENTER|CH_BACK_CENTER,                                   ///< 6, C + L + R+ LR + RR + OV
89
-    CH_FRONT_CENTER|CH_FRONT_RIGHT_OF_CENTER|CH_FRONT_LEFT_OF_CENTER|CH_BACK_CENTER|CH_BACK_LEFT|CH_BACK_RIGHT,   ///< 6, CF+ CR+LF+ RF+LR + RR
90
-    CH_FRONT_LEFT_OF_CENTER|CH_FRONT_CENTER|CH_FRONT_RIGHT_OF_CENTER|CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_SIDE_RIGHT, ///< 7, CL + C + CR + L + R + SL + SR
91
-    CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER|CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_SIDE_RIGHT|CH_BACK_LEFT|CH_BACK_RIGHT, ///< 8, CL + CR + L + R + SL1 + SL2+ SR1 + SR2
92
-    CH_FRONT_LEFT_OF_CENTER|CH_FRONT_CENTER|CH_FRONT_RIGHT_OF_CENTER|CH_LAYOUT_STEREO|CH_SIDE_LEFT|CH_BACK_CENTER|CH_SIDE_RIGHT, ///< 8, CL + C+ CR + L + R + SL + S+ SR
77
+    AV_CH_FRONT_CENTER,                                                      ///< 1, A
78
+    AV_CH_LAYOUT_STEREO,                                                     ///< 2, A + B (dual mono)
79
+    AV_CH_LAYOUT_STEREO,                                                     ///< 2, L + R (stereo)
80
+    AV_CH_LAYOUT_STEREO,                                                     ///< 2, (L+R) + (L-R) (sum-difference)
81
+    AV_CH_LAYOUT_STEREO,                                                     ///< 2, LT +RT (left and right total)
82
+    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER,                                  ///< 3, C+L+R
83
+    AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER,                                   ///< 3, L+R+S
84
+    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|CH_BACK_CENTER,                   ///< 4, C + L + R+ S
85
+    AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT,                    ///< 4, L + R +SL+ SR
86
+    AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 5, C + L + R+ SL+SR
87
+    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
88
+    AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT|AV_CH_FRONT_CENTER|AV_CH_BACK_CENTER,                                      ///< 6, C + L + R+ LR + RR + OV
89
+    AV_CH_FRONT_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT,   ///< 6, CF+ CR+LF+ RF+LR + RR
90
+    AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, ///< 7, CL + C + CR + L + R + SL + SR
91
+    AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT, ///< 8, CL + CR + L + R + SL1 + SL2+ SR1 + SR2
92
+    AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_BACK_CENTER|AV_CH_SIDE_RIGHT, ///< 8, CL + C+ CR + L + R + SL + S+ SR
93 93
 };
94 94
 
95 95
 static const int8_t dca_lfe_index[] = {
... ...
@@ -1368,9 +1369,9 @@ static int dca_decode_frame(AVCodecContext * avctx,
1368 1368
 
1369 1369
         if (s->xch_present && (!avctx->request_channels ||
1370 1370
                                avctx->request_channels > num_core_channels + !!s->lfe)) {
1371
-            avctx->channel_layout |= CH_BACK_CENTER;
1371
+            avctx->channel_layout |= AV_CH_BACK_CENTER;
1372 1372
             if (s->lfe) {
1373
-                avctx->channel_layout |= CH_LOW_FREQUENCY;
1373
+                avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
1374 1374
                 s->channel_order_tab = dca_channel_reorder_lfe_xch[s->amode];
1375 1375
             } else {
1376 1376
                 s->channel_order_tab = dca_channel_reorder_nolfe_xch[s->amode];
... ...
@@ -1379,7 +1380,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
1379 1379
             channels = num_core_channels + !!s->lfe;
1380 1380
             s->xch_present = 0; /* disable further xch processing */
1381 1381
             if (s->lfe) {
1382
-                avctx->channel_layout |= CH_LOW_FREQUENCY;
1382
+                avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
1383 1383
                 s->channel_order_tab = dca_channel_reorder_lfe[s->amode];
1384 1384
             } else
1385 1385
                 s->channel_order_tab = dca_channel_reorder_nolfe[s->amode];
... ...
@@ -1392,7 +1393,7 @@ static int dca_decode_frame(AVCodecContext * avctx,
1392 1392
         if (avctx->request_channels == 2 && s->prim_channels > 2) {
1393 1393
             channels = 2;
1394 1394
             s->output = DCA_STEREO;
1395
-            avctx->channel_layout = CH_LAYOUT_STEREO;
1395
+            avctx->channel_layout = AV_CH_LAYOUT_STEREO;
1396 1396
         }
1397 1397
     } else {
1398 1398
         av_log(avctx, AV_LOG_ERROR, "Non standard configuration %d !\n",s->amode);
... ...
@@ -34,6 +34,7 @@
34 34
 #include "nellymoser.h"
35 35
 #include "libavutil/lfg.h"
36 36
 #include "libavutil/random_seed.h"
37
+#include "libavcore/audioconvert.h"
37 38
 #include "avcodec.h"
38 39
 #include "dsputil.h"
39 40
 #include "fft.h"
... ...
@@ -148,7 +149,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
148 148
         ff_init_ff_sine_windows(7);
149 149
 
150 150
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
151
-    avctx->channel_layout = CH_LAYOUT_MONO;
151
+    avctx->channel_layout = AV_CH_LAYOUT_MONO;
152 152
     return 0;
153 153
 }
154 154
 
... ...
@@ -24,6 +24,7 @@
24 24
  * PCM codecs for encodings found in MPEG streams (DVD/Blu-ray)
25 25
  */
26 26
 
27
+#include "libavcore/audioconvert.h"
27 28
 #include "avcodec.h"
28 29
 #include "bytestream.h"
29 30
 
... ...
@@ -53,9 +54,9 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
53 53
 {
54 54
     static const uint8_t bits_per_samples[4] = { 0, 16, 20, 24 };
55 55
     static const uint32_t channel_layouts[16] = {
56
-        0, CH_LAYOUT_MONO, 0, CH_LAYOUT_STEREO, CH_LAYOUT_SURROUND,
57
-        CH_LAYOUT_2_1, CH_LAYOUT_4POINT0, CH_LAYOUT_2_2, CH_LAYOUT_5POINT0,
58
-        CH_LAYOUT_5POINT1, CH_LAYOUT_7POINT0, CH_LAYOUT_7POINT1, 0, 0, 0, 0
56
+        0, AV_CH_LAYOUT_MONO, 0, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND,
57
+        AV_CH_LAYOUT_2_1, AV_CH_LAYOUT_4POINT0, AV_CH_LAYOUT_2_2, AV_CH_LAYOUT_5POINT0,
58
+        AV_CH_LAYOUT_5POINT1, AV_CH_LAYOUT_7POINT0, AV_CH_LAYOUT_7POINT1, 0, 0, 0, 0
59 59
     };
60 60
     static const uint8_t channels[16] = {
61 61
         0, 1, 0, 2, 3, 3, 4, 4, 5, 6, 7, 8, 0, 0, 0, 0
... ...
@@ -158,9 +159,9 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx,
158 158
     if (samples) {
159 159
         switch (avctx->channel_layout) {
160 160
             /* cases with same number of source and coded channels */
161
-        case CH_LAYOUT_STEREO:
162
-        case CH_LAYOUT_4POINT0:
163
-        case CH_LAYOUT_2_2:
161
+        case AV_CH_LAYOUT_STEREO:
162
+        case AV_CH_LAYOUT_4POINT0:
163
+        case AV_CH_LAYOUT_2_2:
164 164
             samples *= num_source_channels;
165 165
             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
166 166
 #if HAVE_BIGENDIAN
... ...
@@ -177,10 +178,10 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx,
177 177
             }
178 178
             break;
179 179
         /* cases where number of source channels = coded channels + 1 */
180
-        case CH_LAYOUT_MONO:
181
-        case CH_LAYOUT_SURROUND:
182
-        case CH_LAYOUT_2_1:
183
-        case CH_LAYOUT_5POINT0:
180
+        case AV_CH_LAYOUT_MONO:
181
+        case AV_CH_LAYOUT_SURROUND:
182
+        case AV_CH_LAYOUT_2_1:
183
+        case AV_CH_LAYOUT_5POINT0:
184 184
             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
185 185
                 do {
186 186
 #if HAVE_BIGENDIAN
... ...
@@ -206,7 +207,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx,
206 206
             }
207 207
             break;
208 208
             /* remapping: L, R, C, LBack, RBack, LF */
209
-        case CH_LAYOUT_5POINT1:
209
+        case AV_CH_LAYOUT_5POINT1:
210 210
             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
211 211
                 do {
212 212
                     dst16[0] = bytestream_get_be16(&src);
... ...
@@ -230,7 +231,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx,
230 230
             }
231 231
             break;
232 232
             /* remapping: L, R, C, LSide, LBack, RBack, RSide, <unused> */
233
-        case CH_LAYOUT_7POINT0:
233
+        case AV_CH_LAYOUT_7POINT0:
234 234
             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
235 235
                 do {
236 236
                     dst16[0] = bytestream_get_be16(&src);
... ...
@@ -258,7 +259,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx,
258 258
             }
259 259
             break;
260 260
             /* remapping: L, R, C, LSide, LBack, RBack, RSide, LF */
261
-        case CH_LAYOUT_7POINT1:
261
+        case AV_CH_LAYOUT_7POINT1:
262 262
             if (AV_SAMPLE_FMT_S16 == avctx->sample_fmt) {
263 263
                 do {
264 264
                     dst16[0] = bytestream_get_be16(&src);
... ...
@@ -29,6 +29,7 @@
29 29
 #include "libavutil/integer.h"
30 30
 #include "libavutil/crc.h"
31 31
 #include "libavutil/pixdesc.h"
32
+#include "libavcore/audioconvert.h"
32 33
 #include "libavcore/imgutils.h"
33 34
 #include "libavcore/internal.h"
34 35
 #include "libavcore/samplefmt.h"
... ...
@@ -922,7 +923,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
922 922
                      ", %d Hz", enc->sample_rate);
923 923
         }
924 924
         av_strlcat(buf, ", ", buf_size);
925
-        avcodec_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout);
925
+        av_get_channel_layout_string(buf + strlen(buf), buf_size - strlen(buf), enc->channels, enc->channel_layout);
926 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));
... ...
@@ -1,7 +1,7 @@
1 1
 include $(SUBDIR)../config.mak
2 2
 
3 3
 NAME = avfilter
4
-FFLIBS = avcodec avcore avutil
4
+FFLIBS = avcore avutil
5 5
 FFLIBS-$(CONFIG_SCALE_FILTER) += swscale
6 6
 
7 7
 HEADERS = avfilter.h avfiltergraph.h
... ...
@@ -22,7 +22,7 @@
22 22
  */
23 23
 
24 24
 #include "avfilter.h"
25
-#include "libavcodec/audioconvert.h"
25
+#include "libavcore/audioconvert.h"
26 26
 
27 27
 typedef struct {
28 28
     int64_t channel_layout;
... ...
@@ -35,7 +35,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque)
35 35
     char channel_layout_str[128] = "";
36 36
 
37 37
     priv->sample_rate = 44100;
38
-    priv->channel_layout = CH_LAYOUT_STEREO;
38
+    priv->channel_layout = AV_CH_LAYOUT_STEREO;
39 39
 
40 40
     if (args)
41 41
         sscanf(args, "%"PRId64":%s", &priv->sample_rate, channel_layout_str);
... ...
@@ -46,7 +46,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque)
46 46
     }
47 47
 
48 48
     if (*channel_layout_str)
49
-        if (!(priv->channel_layout = avcodec_get_channel_layout(channel_layout_str))
49
+        if (!(priv->channel_layout = av_get_channel_layout(channel_layout_str))
50 50
             && sscanf(channel_layout_str, "%"PRId64, &priv->channel_layout) != 1) {
51 51
             av_log(ctx, AV_LOG_ERROR, "Invalid value '%s' for channel layout\n",
52 52
                    channel_layout_str);
... ...
@@ -65,8 +65,8 @@ static int config_props(AVFilterLink *outlink)
65 65
     outlink->sample_rate = priv->sample_rate;
66 66
     outlink->channel_layout = priv->channel_layout;
67 67
 
68
-    chans_nb = avcodec_channel_layout_num_channels(priv->channel_layout);
69
-    avcodec_get_channel_layout_string(buf, sizeof(buf), chans_nb, priv->channel_layout);
68
+    chans_nb = av_get_channel_layout_nb_channels(priv->channel_layout);
69
+    av_get_channel_layout_string(buf, sizeof(buf), chans_nb, priv->channel_layout);
70 70
     av_log(outlink->src, AV_LOG_INFO,
71 71
            "sample_rate:%"PRId64 " channel_layout:%"PRId64 " channel_layout_description:'%s'\n",
72 72
            priv->sample_rate, priv->channel_layout, buf);
... ...
@@ -26,7 +26,7 @@
26 26
 
27 27
 #define LIBAVFILTER_VERSION_MAJOR  1
28 28
 #define LIBAVFILTER_VERSION_MINOR 63
29
-#define LIBAVFILTER_VERSION_MICRO  0
29
+#define LIBAVFILTER_VERSION_MICRO  1
30 30
 
31 31
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
32 32
                                                LIBAVFILTER_VERSION_MINOR, \
... ...
@@ -579,7 +579,7 @@ struct AVFilterLink {
579 579
     int w;                      ///< agreed upon image width
580 580
     int h;                      ///< agreed upon image height
581 581
     /* These two parameters apply only to audio */
582
-    int64_t channel_layout;     ///< channel layout of current buffer (see avcodec.h)
582
+    int64_t channel_layout;     ///< channel layout of current buffer (see libavcore/audioconvert.h)
583 583
     int64_t sample_rate;        ///< samples per second
584 584
 
585 585
     int format;                 ///< agreed upon media format
... ...
@@ -19,9 +19,9 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
+#include "libavcore/audioconvert.h"
22 23
 #include "libavcore/imgutils.h"
23 24
 #include "libavcore/samplefmt.h"
24
-#include "libavcodec/audioconvert.h"
25 25
 #include "avfilter.h"
26 26
 
27 27
 /* TODO: buffer pool.  see comment for avfilter_default_get_video_buffer() */
... ...
@@ -111,7 +111,7 @@ AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int per
111 111
     samples->free       = avfilter_default_free_buffer;
112 112
 
113 113
     sample_size = av_get_bits_per_sample_fmt(sample_fmt) >>3;
114
-    chans_nb = avcodec_channel_layout_num_channels(channel_layout);
114
+    chans_nb = av_get_channel_layout_nb_channels(channel_layout);
115 115
 
116 116
     per_channel_size = size/chans_nb;
117 117
     ref->audio->samples_nb = per_channel_size/sample_size;