Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master:
swscale: Readd #define _SVID_SOURCE
Fix av_get_channel_layout_string() for positions >31
configure: Store vda lib flags in extralibs instead of ldflags
Make channel layout masks unsigned
dca: ARMv6 optimised decode_blockcode()
nullenc: drop AVFMT_RAWPICTURE from the flags
frame-mt: return consumed packet size in ff_thread_decode_frame
aacdec: add more fate tests covering SBR and PS
MK(BE)TAG: avoid undefined shifts

Conflicts:
configure
libavcodec/arm/dca.h
libavcodec/dca.c
libavcodec/mlp_parser.c
libavcodec/version.h
libavfilter/asrc_anullsrc.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/defaults.c
libavutil/audioconvert.c
libavutil/avutil.h
libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/11/26 09:12:08
Showing 28 changed files
... ...
@@ -2999,7 +2999,7 @@ disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
2999 2999
 if ! disabled vda; then
3000 3000
     if check_header VideoDecodeAcceleration/VDADecoder.h; then
3001 3001
         enable vda
3002
-        add_ldflags -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
3002
+        add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore
3003 3003
     fi
3004 3004
 fi
3005 3005
 
... ...
@@ -48,7 +48,7 @@ typedef struct AACAC3ParseContext {
48 48
     int sample_rate;
49 49
     int bit_rate;
50 50
     int samples;
51
-    int64_t channel_layout;
51
+    uint64_t channel_layout;
52 52
     int service_type;
53 53
 
54 54
     int remaining_size;
... ...
@@ -90,7 +90,7 @@ static const uint8_t aac_channel_layout_map[7][5][2] = {
90 90
     { { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_LFE, 0 }, { TYPE_CPE, 2 }, { TYPE_CPE, 1 }, },
91 91
 };
92 92
 
93
-static const int64_t aac_channel_layout[8] = {
93
+static const uint64_t aac_channel_layout[8] = {
94 94
     AV_CH_LAYOUT_MONO,
95 95
     AV_CH_LAYOUT_STEREO,
96 96
     AV_CH_LAYOUT_SURROUND,
... ...
@@ -120,7 +120,7 @@ typedef struct {
120 120
     uint32_t bit_rate;
121 121
     uint8_t channels;
122 122
     uint16_t frame_size;
123
-    int64_t channel_layout;
123
+    uint64_t channel_layout;
124 124
     /** @} */
125 125
 } AC3HeaderInfo;
126 126
 
... ...
@@ -77,7 +77,7 @@ static uint8_t exponent_group_tab[2][3][256];
77 77
 /**
78 78
  * List of supported channel layouts.
79 79
  */
80
-const int64_t ff_ac3_channel_layouts[19] = {
80
+const uint64_t ff_ac3_channel_layouts[19] = {
81 81
      AV_CH_LAYOUT_MONO,
82 82
      AV_CH_LAYOUT_STEREO,
83 83
      AV_CH_LAYOUT_2_1,
... ...
@@ -2060,13 +2060,13 @@ av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
2060 2060
  * Set channel information during initialization.
2061 2061
  */
2062 2062
 static av_cold int set_channel_info(AC3EncodeContext *s, int channels,
2063
-                                    int64_t *channel_layout)
2063
+                                    uint64_t *channel_layout)
2064 2064
 {
2065 2065
     int ch_layout;
2066 2066
 
2067 2067
     if (channels < 1 || channels > AC3_MAX_CHANNELS)
2068 2068
         return AVERROR(EINVAL);
2069
-    if ((uint64_t)*channel_layout > 0x7FF)
2069
+    if (*channel_layout > 0x7FF)
2070 2070
         return AVERROR(EINVAL);
2071 2071
     ch_layout = *channel_layout;
2072 2072
     if (!ch_layout)
... ...
@@ -258,7 +258,7 @@ typedef struct AC3EncodeContext {
258 258
 } AC3EncodeContext;
259 259
 
260 260
 
261
-extern const int64_t ff_ac3_channel_layouts[19];
261
+extern const uint64_t ff_ac3_channel_layouts[19];
262 262
 
263 263
 int ff_ac3_encode_init(AVCodecContext *avctx);
264 264
 
... ...
@@ -27,38 +27,54 @@
27 27
 
28 28
 #if HAVE_ARMV6 && HAVE_INLINE_ASM
29 29
 
30
-#define decode_blockcode decode_blockcode
31
-static inline int decode_blockcode(int code, int levels, int *values)
30
+#define decode_blockcodes decode_blockcodes
31
+static inline int decode_blockcodes(int code1, int code2, int levels,
32
+                                    int *values)
32 33
 {
33
-    int v0, v1, v2, v3;
34
+    int v0, v1, v2, v3, v4, v5;
34 35
 
35
-    __asm__ ("smmul   %4, %8, %11           \n"
36
-             "smlabb  %8, %4, %10, %8       \n"
37
-             "smmul   %5, %4, %11           \n"
38
-             "sub     %8, %8, %9, lsr #1    \n"
39
-             "smlabb  %4, %5, %10, %4       \n"
40
-             "smmul   %6, %5, %11           \n"
41
-             "str     %8, %0                \n"
42
-             "sub     %4, %4, %9, lsr #1    \n"
43
-             "smlabb  %5, %6, %10, %5       \n"
44
-             "smmul   %7, %6, %11           \n"
45
-             "str     %4, %1                \n"
46
-             "sub     %5, %5, %9, lsr #1    \n"
47
-             "smlabb  %6, %7, %10, %6       \n"
48
-             "cmp     %7, #0                \n"
49
-             "str     %5, %2                \n"
50
-             "sub     %6, %6, %9, lsr #1    \n"
51
-             "it      eq                    \n"
52
-             "mvneq   %7, #0                \n"
53
-             "str     %6, %3                \n"
36
+    __asm__ ("smmul   %8,  %14, %18           \n"
37
+             "smmul   %11, %15, %18           \n"
38
+             "smlabb  %14, %8,  %17, %14      \n"
39
+             "smlabb  %15, %11, %17, %15      \n"
40
+             "smmul   %9,  %8,  %18           \n"
41
+             "smmul   %12, %11, %18           \n"
42
+             "sub     %14, %14, %16, lsr #1   \n"
43
+             "sub     %15, %15, %16, lsr #1   \n"
44
+             "smlabb  %8,  %9,  %17, %8       \n"
45
+             "smlabb  %11, %12, %17, %11      \n"
46
+             "smmul   %10, %9,  %18           \n"
47
+             "smmul   %13, %12, %18           \n"
48
+             "str     %14, %0                 \n"
49
+             "str     %15, %4                 \n"
50
+             "sub     %8,  %8,  %16, lsr #1   \n"
51
+             "sub     %11, %11, %16, lsr #1   \n"
52
+             "smlabb  %9,  %10, %17, %9       \n"
53
+             "smlabb  %12, %13, %17, %12      \n"
54
+             "smmul   %14, %10, %18           \n"
55
+             "smmul   %15, %13, %18           \n"
56
+             "str     %8,  %1                 \n"
57
+             "str     %11, %5                 \n"
58
+             "sub     %9,  %9,  %16, lsr #1   \n"
59
+             "sub     %12, %12, %16, lsr #1   \n"
60
+             "smlabb  %10, %14, %17, %10      \n"
61
+             "smlabb  %13, %15, %17, %13      \n"
62
+             "str     %9,  %2                 \n"
63
+             "str     %12, %6                 \n"
64
+             "sub     %10, %10, %16, lsr #1   \n"
65
+             "sub     %13, %13, %16, lsr #1   \n"
66
+             "str     %10, %3                 \n"
67
+             "str     %13, %7                 \n"
54 68
              : "=m"(values[0]), "=m"(values[1]),
55 69
                "=m"(values[2]), "=m"(values[3]),
56
-               "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3),
57
-               "+&r"(code)
58
-             : "r"(levels - 1), "r"(-levels), "r"(ff_inverse[levels])
59
-             : "cc");
70
+               "=m"(values[4]), "=m"(values[5]),
71
+               "=m"(values[6]), "=m"(values[7]),
72
+               "=&r"(v0), "=&r"(v1), "=&r"(v2),
73
+               "=&r"(v3), "=&r"(v4), "=&r"(v5),
74
+               "+&r"(code1), "+&r"(code2)
75
+             : "r"(levels - 1), "r"(-levels), "r"(ff_inverse[levels]));
60 76
 
61
-    return v3;
77
+    return code1 | code2;
62 78
 }
63 79
 
64 80
 #endif
... ...
@@ -48,7 +48,7 @@ void avcodec_sample_fmt_string (char *buf, int buf_size, int sample_fmt)
48 48
 }
49 49
 #endif
50 50
 
51
-int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name)
51
+uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name)
52 52
 {
53 53
     switch(nb_channels) {
54 54
     case 1: return AV_CH_LAYOUT_MONO;
... ...
@@ -80,7 +80,7 @@ int avcodec_channel_layout_num_channels(int64_t channel_layout);
80 80
  * @param fmt_name Format name, or NULL if unknown
81 81
  * @return Channel layout mask
82 82
  */
83
-int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name);
83
+uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name);
84 84
 
85 85
 struct AVAudioConvert;
86 86
 typedef struct AVAudioConvert AVAudioConvert;
... ...
@@ -2758,14 +2758,14 @@ typedef struct AVCodecContext {
2758 2758
      * - encoding: set by user.
2759 2759
      * - decoding: set by user, may be overwritten by libavcodec.
2760 2760
      */
2761
-    int64_t channel_layout;
2761
+    uint64_t channel_layout;
2762 2762
 
2763 2763
     /**
2764 2764
      * Request decoder to use this channel layout if it can (0 for default)
2765 2765
      * - encoding: unused
2766 2766
      * - decoding: Set by user.
2767 2767
      */
2768
-    int64_t request_channel_layout;
2768
+    uint64_t request_channel_layout;
2769 2769
 
2770 2770
     /**
2771 2771
      * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
... ...
@@ -3122,7 +3122,7 @@ typedef struct AVCodec {
3122 3122
     const char *long_name;
3123 3123
     const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
3124 3124
     const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
3125
-    const int64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
3125
+    const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
3126 3126
     uint8_t max_lowres;                     ///< maximum value for lowres supported by the decoder
3127 3127
     const AVClass *priv_class;              ///< AVClass for the private context
3128 3128
     const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
... ...
@@ -128,7 +128,7 @@ static const int dca_ext_audio_descr_mask[] = {
128 128
  * All 2 channel configurations -> AV_CH_LAYOUT_STEREO
129 129
  */
130 130
 
131
-static const int64_t dca_core_channel_layout[] = {
131
+static const uint64_t dca_core_channel_layout[] = {
132 132
     AV_CH_FRONT_CENTER,                                                      ///< 1, A
133 133
     AV_CH_LAYOUT_STEREO,                                                     ///< 2, A + B (dual mono)
134 134
     AV_CH_LAYOUT_STEREO,                                                     ///< 2, L + R (stereo)
... ...
@@ -1037,7 +1037,7 @@ static void dca_downmix(float *samples, int srcfmt,
1037 1037
 }
1038 1038
 
1039 1039
 
1040
-#ifndef decode_blockcode
1040
+#ifndef decode_blockcodes
1041 1041
 /* Very compact version of the block code decoder that does not use table
1042 1042
  * look-up but is slightly slower */
1043 1043
 static int decode_blockcode(int code, int levels, int *values)
... ...
@@ -1051,12 +1051,13 @@ static int decode_blockcode(int code, int levels, int *values)
1051 1051
         code = div;
1052 1052
     }
1053 1053
 
1054
-    if (code == 0)
1055
-        return 0;
1056
-    else {
1057
-        av_log(NULL, AV_LOG_ERROR, "ERROR: block code look-up failed\n");
1058
-        return AVERROR_INVALIDDATA;
1059
-    }
1054
+    return code;
1055
+}
1056
+
1057
+static int decode_blockcodes(int code1, int code2, int levels, int *values)
1058
+{
1059
+    return decode_blockcode(code1, levels, values) |
1060
+           decode_blockcode(code2, levels, values + 4);
1060 1061
 }
1061 1062
 #endif
1062 1063
 
... ...
@@ -1126,16 +1127,20 @@ static int dca_subsubframe(DCAContext * s, int base_channel, int block_index)
1126 1126
                 if (abits >= 11 || !dca_smpl_bitalloc[abits].vlc[sel].table){
1127 1127
                     if (abits <= 7){
1128 1128
                         /* Block code */
1129
-                        int block_code1, block_code2, size, levels;
1129
+                        int block_code1, block_code2, size, levels, err;
1130 1130
 
1131 1131
                         size = abits_sizes[abits-1];
1132 1132
                         levels = abits_levels[abits-1];
1133 1133
 
1134 1134
                         block_code1 = get_bits(&s->gb, size);
1135
-                        /* FIXME Should test return value */
1136
-                        decode_blockcode(block_code1, levels, block);
1137 1135
                         block_code2 = get_bits(&s->gb, size);
1138
-                        decode_blockcode(block_code2, levels, &block[4]);
1136
+                        err = decode_blockcodes(block_code1, block_code2,
1137
+                                                levels, block);
1138
+                        if (err) {
1139
+                            av_log(s->avctx, AV_LOG_ERROR,
1140
+                                   "ERROR: block code look-up failed\n");
1141
+                            return AVERROR_INVALIDDATA;
1142
+                        }
1139 1143
                     }else{
1140 1144
                         /* no coding */
1141 1145
                         for (m = 0; m < 8; m++)
... ...
@@ -107,7 +107,7 @@ static int truehd_channels(int chanmap)
107 107
     return channels;
108 108
 }
109 109
 
110
-int64_t ff_truehd_layout(int chanmap)
110
+uint64_t ff_truehd_layout(int chanmap)
111 111
 {
112 112
     int layout = 0, i;
113 113
 
... ...
@@ -54,7 +54,7 @@ typedef struct MLPHeaderInfo
54 54
 
55 55
 
56 56
 int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb);
57
-int64_t ff_truehd_layout(int chanmap);
57
+uint64_t ff_truehd_layout(int chanmap);
58 58
 
59 59
 extern const uint64_t ff_mlp_layout[32];
60 60
 
... ...
@@ -525,7 +525,7 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
525 525
         if (fctx->next_decoding >= (avctx->thread_count-1)) fctx->delaying = 0;
526 526
 
527 527
         *got_picture_ptr=0;
528
-        return 0;
528
+        return avpkt->size;
529 529
     }
530 530
 
531 531
     /*
... ...
@@ -566,7 +566,8 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
566 566
 
567 567
     fctx->next_finished = finished;
568 568
 
569
-    return p->result;
569
+    /* return the size of the consumed packet if no error occurred */
570
+    return (p->result >= 0) ? avpkt->size : p->result;
570 571
 }
571 572
 
572 573
 void ff_thread_report_progress(AVFrame *f, int n, int field)
... ...
@@ -42,6 +42,9 @@ void ff_thread_flush(AVCodecContext *avctx);
42 42
  * Submits a new frame to a decoding thread.
43 43
  * Returns the next available frame in picture. *got_picture_ptr
44 44
  * will be 0 if none is available.
45
+ * The return value on success is the size of the consumed packet for
46
+ * compatiblity with avcodec_decode_video2(). This means the decoder
47
+ * has to consume the full packet.
45 48
  *
46 49
  * Parameters are the same as avcodec_decode_video2().
47 50
  */
... ...
@@ -22,7 +22,7 @@
22 22
 
23 23
 #define LIBAVCODEC_VERSION_MAJOR 53
24 24
 #define LIBAVCODEC_VERSION_MINOR 37
25
-#define LIBAVCODEC_VERSION_MICRO  0
25
+#define LIBAVCODEC_VERSION_MICRO  1
26 26
 
27 27
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
28 28
                                                LIBAVCODEC_VERSION_MINOR, \
... ...
@@ -27,7 +27,7 @@ extern const float ff_vorbis_floor1_inverse_db_table[256];
27 27
 extern const float * const ff_vorbis_vwin[8];
28 28
 extern const uint8_t ff_vorbis_channel_layout_offsets[8][8];
29 29
 extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8];
30
-extern const int64_t ff_vorbis_channel_layouts[9];
30
+extern const uint64_t ff_vorbis_channel_layouts[9];
31 31
 
32 32
 typedef struct {
33 33
     uint16_t x;
... ...
@@ -44,7 +44,7 @@ const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = {
44 44
     { 0, 2, 1, 6, 7, 4, 5, 3 },
45 45
 };
46 46
 
47
-const int64_t ff_vorbis_channel_layouts[9] = {
47
+const uint64_t ff_vorbis_channel_layouts[9] = {
48 48
     AV_CH_LAYOUT_MONO,
49 49
     AV_CH_LAYOUT_STEREO,
50 50
     AV_CH_LAYOUT_SURROUND,
... ...
@@ -143,7 +143,7 @@ switch(format) {\
143 143
     case FORMAT_F32: s->reorder_func = alsa_reorder_f32_out_ ##layout;   break;\
144 144
 }
145 145
 
146
-static av_cold int find_reorder_func(AlsaData *s, int codec_id, int64_t layout, int out)
146
+static av_cold int find_reorder_func(AlsaData *s, int codec_id, uint64_t layout, int out)
147 147
 {
148 148
     int format;
149 149
 
... ...
@@ -194,7 +194,7 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
194 194
     snd_pcm_t *h;
195 195
     snd_pcm_hw_params_t *hw_params;
196 196
     snd_pcm_uframes_t buffer_size, period_size;
197
-    int64_t layout = ctx->streams[0]->codec->channel_layout;
197
+    uint64_t layout = ctx->streams[0]->codec->channel_layout;
198 198
 
199 199
     if (ctx->filename[0] == 0) audio_device = "default";
200 200
     else                       audio_device = ctx->filename;
... ...
@@ -30,7 +30,7 @@
30 30
 typedef struct {
31 31
     const AVClass *class;
32 32
     char   *channel_layout_str;
33
-    int64_t channel_layout;
33
+    uint64_t channel_layout;
34 34
     char   *sample_rate_str;
35 35
     int     sample_rate;
36 36
     int nb_samples;             ///< number of samples per requested frame
... ...
@@ -473,7 +473,7 @@ AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link,
473 473
 AVFilterBufferRef *
474 474
 avfilter_get_audio_buffer_ref_from_arrays(uint8_t *data[8], int linesize[8], int perms,
475 475
                                           int nb_samples, enum AVSampleFormat sample_fmt,
476
-                                          int64_t channel_layout, int planar)
476
+                                          uint64_t channel_layout, int planar)
477 477
 {
478 478
     AVFilterBuffer *samples = av_mallocz(sizeof(AVFilterBuffer));
479 479
     AVFilterBufferRef *samplesref = av_mallocz(sizeof(AVFilterBufferRef));
... ...
@@ -30,7 +30,7 @@
30 30
 
31 31
 #define LIBAVFILTER_VERSION_MAJOR  2
32 32
 #define LIBAVFILTER_VERSION_MINOR 49
33
-#define LIBAVFILTER_VERSION_MICRO  0
33
+#define LIBAVFILTER_VERSION_MICRO  1
34 34
 
35 35
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
36 36
                                                LIBAVFILTER_VERSION_MINOR, \
... ...
@@ -110,7 +110,7 @@ typedef struct AVFilterBuffer {
110 110
  * per reference properties must be separated out.
111 111
  */
112 112
 typedef struct AVFilterBufferRefAudioProps {
113
-    int64_t channel_layout;     ///< channel layout of audio buffer
113
+    uint64_t channel_layout;    ///< channel layout of audio buffer
114 114
     int nb_samples;             ///< number of audio samples per channel
115 115
     int sample_rate;            ///< audio buffer sample rate
116 116
     int planar;                 ///< audio buffer - planar or packed
... ...
@@ -641,7 +641,7 @@ struct AVFilterLink {
641 641
     int h;                      ///< agreed upon image height
642 642
     AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio
643 643
     /* These parameters apply only to audio */
644
-    int64_t channel_layout;     ///< channel layout of current buffer (see libavutil/audioconvert.h)
644
+    uint64_t channel_layout;    ///< channel layout of current buffer (see libavutil/audioconvert.h)
645 645
 #if LIBAVFILTER_VERSION_MAJOR < 3
646 646
     int64_t sample_rate;        ///< samples per second
647 647
 #else
... ...
@@ -772,8 +772,7 @@ AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms,
772 772
 AVFilterBufferRef *
773 773
 avfilter_get_audio_buffer_ref_from_arrays(uint8_t *data[8], int linesize[8], int perms,
774 774
                                           int nb_samples, enum AVSampleFormat sample_fmt,
775
-                                          int64_t channel_layout, int planar);
776
-
775
+                                          uint64_t channel_layout, int planar);
777 776
 /**
778 777
  * Request an input frame from the filter at the other end of the link.
779 778
  *
... ...
@@ -32,5 +32,5 @@ AVOutputFormat ff_null_muxer = {
32 32
     .audio_codec       = AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE),
33 33
     .video_codec       = CODEC_ID_RAWVIDEO,
34 34
     .write_packet      = null_write_packet,
35
-    .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
35
+    .flags = AVFMT_NOFILE | AVFMT_NOTIMESTAMPS,
36 36
 };
... ...
@@ -60,7 +60,7 @@ static const char *get_channel_name(int channel_id)
60 60
 static const struct {
61 61
     const char *name;
62 62
     int         nb_channels;
63
-    int64_t     layout;
63
+    uint64_t     layout;
64 64
 } channel_layout_map[] = {
65 65
     { "mono",        1,  AV_CH_LAYOUT_MONO },
66 66
     { "stereo",      2,  AV_CH_LAYOUT_STEREO },
... ...
@@ -76,7 +76,7 @@ static const struct {
76 76
     { 0 }
77 77
 };
78 78
 
79
-static int64_t get_channel_layout_single(const char *name, int name_len)
79
+static uint64_t get_channel_layout_single(const char *name, int name_len)
80 80
 {
81 81
     int i;
82 82
     char *end;
... ...
@@ -102,7 +102,7 @@ static int64_t get_channel_layout_single(const char *name, int name_len)
102 102
     return 0;
103 103
 }
104 104
 
105
-int64_t av_get_channel_layout(const char *name)
105
+uint64_t av_get_channel_layout(const char *name)
106 106
 {
107 107
     const char *n, *e;
108 108
     const char *name_end = name + strlen(name);
... ...
@@ -119,7 +119,7 @@ int64_t av_get_channel_layout(const char *name)
119 119
 }
120 120
 
121 121
 void av_get_channel_layout_string(char *buf, int buf_size,
122
-                                  int nb_channels, int64_t channel_layout)
122
+                                  int nb_channels, uint64_t channel_layout)
123 123
 {
124 124
     int i;
125 125
 
... ...
@@ -138,7 +138,7 @@ void av_get_channel_layout_string(char *buf, int buf_size,
138 138
         int i, ch;
139 139
         av_strlcat(buf, " (", buf_size);
140 140
         for (i = 0, ch = 0; i < 64; i++) {
141
-            if ((channel_layout & (1L << i))) {
141
+            if ((channel_layout & (UINT64_C(1) << i))) {
142 142
                 const char *name = get_channel_name(i);
143 143
                 if (name) {
144 144
                     if (ch > 0)
... ...
@@ -152,7 +152,7 @@ void av_get_channel_layout_string(char *buf, int buf_size,
152 152
     }
153 153
 }
154 154
 
155
-int av_get_channel_layout_nb_channels(int64_t channel_layout)
155
+int av_get_channel_layout_nb_channels(uint64_t channel_layout)
156 156
 {
157 157
     int count;
158 158
     uint64_t x = channel_layout;
... ...
@@ -62,7 +62,7 @@
62 62
 /** Channel mask value used for AVCodecContext.request_channel_layout
63 63
     to indicate that the user requests the channel order of the decoder output
64 64
     to be the native codec channel order. */
65
-#define AV_CH_LAYOUT_NATIVE          0x8000000000000000LL
65
+#define AV_CH_LAYOUT_NATIVE          0x8000000000000000ULL
66 66
 
67 67
 /**
68 68
  * @}
... ...
@@ -104,7 +104,7 @@
104 104
  *   AV_CH_* macros).
105 105
  + Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
106 106
  */
107
-int64_t av_get_channel_layout(const char *name);
107
+uint64_t av_get_channel_layout(const char *name);
108 108
 
109 109
 /**
110 110
  * Return a description of a channel layout.
... ...
@@ -113,12 +113,12 @@ int64_t av_get_channel_layout(const char *name);
113 113
  * @param buf put here the string containing the channel layout
114 114
  * @param buf_size size in bytes of the buffer
115 115
  */
116
-void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout);
116
+void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
117 117
 
118 118
 /**
119 119
  * Return the number of channels in the channel layout.
120 120
  */
121
-int av_get_channel_layout_nb_channels(int64_t channel_layout);
121
+int av_get_channel_layout_nb_channels(uint64_t channel_layout);
122 122
 
123 123
 /**
124 124
  * Return default channel layout for a given number of channels.
... ...
@@ -154,7 +154,7 @@
154 154
 
155 155
 #define LIBAVUTIL_VERSION_MAJOR 51
156 156
 #define LIBAVUTIL_VERSION_MINOR 29
157
-#define LIBAVUTIL_VERSION_MICRO  0
157
+#define LIBAVUTIL_VERSION_MICRO  1
158 158
 
159 159
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
160 160
                                                LIBAVUTIL_VERSION_MINOR, \
... ...
@@ -220,8 +220,8 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
220 220
     return (x + (x >> 16)) & 0x3F;
221 221
 }
222 222
 
223
-#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
224
-#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
223
+#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
224
+#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
225 225
 
226 226
 /**
227 227
  * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
... ...
@@ -38,6 +38,19 @@ FATE_AAC += fate-aac-ap05_48
38 38
 fate-aac-ap05_48: CMD = pcm -i $(SAMPLES)/aac/ap05_48.mp4
39 39
 fate-aac-ap05_48: REF = $(SAMPLES)/aac/ap05_48.s16
40 40
 
41
+fate-aac-ct%: CMD = pcm -i $(SAMPLES)/aac/CT_DecoderCheck/$(@:fate-aac-ct-%=%)
42
+fate-aac-ct%: REF = $(SAMPLES)/aac/CT_DecoderCheck/aacPlusv2.wav
43
+
44
+FATE_AAC_CT = sbr_bc-ps_i.3gp  \
45
+              sbr_bic-ps_i.3gp \
46
+              sbr_i-ps_i.aac   \
47
+              sbr_bc-ps_bc.mp4 \
48
+              sbr_bc-ps_i.mp4  \
49
+              sbr_i-ps_bic.mp4 \
50
+              sbr_i-ps_i.mp4
51
+
52
+#FATE_AAC += $(FATE_AAC_CT:%=fate-aac-ct-%)
53
+
41 54
 FATE_TESTS += $(FATE_AAC)
42 55
 fate-aac: $(FATE_AAC)
43 56
 $(FATE_AAC): CMP = oneoff