History

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

Michael Niedermayer committed 14 years ago

Commit 022f8d22 parents a11eeb9 f32dfad28 files · +119 −82Browse files

Unified · Split

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t