diff options
author | Mans Rullgard <mans@mansr.com> | 2011-11-25 12:51:57 +0000 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-11-25 13:19:54 +0000 |
commit | cc276c85d15272df6e44fb3252657a43cbd49555 (patch) | |
tree | baed10d2966866ed98d9887cd437cc43e009329f /libavcodec | |
parent | 00a856e3f95214c54a878b7cbd6e8ae8c5ce3ca9 (diff) | |
download | ffmpeg-cc276c85d15272df6e44fb3252657a43cbd49555.tar.gz |
Make channel layout masks unsigned
It makes more sense for a bit mask to use an unsigned type.
The change should be source and binary compatible on all
supported systems, hence micro version bump.
Fixes a few invalid shifts.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/aac_ac3_parser.h | 2 | ||||
-rw-r--r-- | libavcodec/aacdectab.h | 2 | ||||
-rw-r--r-- | libavcodec/ac3.h | 2 | ||||
-rw-r--r-- | libavcodec/ac3enc.c | 6 | ||||
-rw-r--r-- | libavcodec/ac3enc.h | 2 | ||||
-rw-r--r-- | libavcodec/audioconvert.c | 2 | ||||
-rw-r--r-- | libavcodec/audioconvert.h | 2 | ||||
-rw-r--r-- | libavcodec/avcodec.h | 6 | ||||
-rw-r--r-- | libavcodec/dca.c | 2 | ||||
-rw-r--r-- | libavcodec/mlp_parser.c | 2 | ||||
-rw-r--r-- | libavcodec/version.h | 2 | ||||
-rw-r--r-- | libavcodec/vorbis.h | 2 | ||||
-rw-r--r-- | libavcodec/vorbis_data.c | 2 |
13 files changed, 17 insertions, 17 deletions
diff --git a/libavcodec/aac_ac3_parser.h b/libavcodec/aac_ac3_parser.h index c4ed816d93..a14fce5190 100644 --- a/libavcodec/aac_ac3_parser.h +++ b/libavcodec/aac_ac3_parser.h @@ -48,7 +48,7 @@ typedef struct AACAC3ParseContext { int sample_rate; int bit_rate; int samples; - int64_t channel_layout; + uint64_t channel_layout; int service_type; int remaining_size; diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h index 23a7868ab2..4f8d84b241 100644 --- a/libavcodec/aacdectab.h +++ b/libavcodec/aacdectab.h @@ -90,7 +90,7 @@ static const uint8_t aac_channel_layout_map[7][5][2] = { { { TYPE_CPE, 0 }, { TYPE_SCE, 0 }, { TYPE_LFE, 0 }, { TYPE_CPE, 2 }, { TYPE_CPE, 1 }, }, }; -static const int64_t aac_channel_layout[8] = { +static const uint64_t aac_channel_layout[8] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, diff --git a/libavcodec/ac3.h b/libavcodec/ac3.h index 9adad93db8..304c86c181 100644 --- a/libavcodec/ac3.h +++ b/libavcodec/ac3.h @@ -118,7 +118,7 @@ typedef struct { uint32_t bit_rate; uint8_t channels; uint16_t frame_size; - int64_t channel_layout; + uint64_t channel_layout; /** @} */ } AC3HeaderInfo; diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index c1564d2a3a..b8e23e49f6 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -77,7 +77,7 @@ static uint8_t exponent_group_tab[2][3][256]; /** * List of supported channel layouts. */ -const int64_t ff_ac3_channel_layouts[19] = { +const uint64_t ff_ac3_channel_layouts[19] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_2_1, @@ -2063,13 +2063,13 @@ av_cold int ff_ac3_encode_close(AVCodecContext *avctx) * Set channel information during initialization. */ static av_cold int set_channel_info(AC3EncodeContext *s, int channels, - int64_t *channel_layout) + uint64_t *channel_layout) { int ch_layout; if (channels < 1 || channels > AC3_MAX_CHANNELS) return AVERROR(EINVAL); - if ((uint64_t)*channel_layout > 0x7FF) + if (*channel_layout > 0x7FF) return AVERROR(EINVAL); ch_layout = *channel_layout; if (!ch_layout) diff --git a/libavcodec/ac3enc.h b/libavcodec/ac3enc.h index 4a017498f6..6ef1a5373a 100644 --- a/libavcodec/ac3enc.h +++ b/libavcodec/ac3enc.h @@ -258,7 +258,7 @@ typedef struct AC3EncodeContext { } AC3EncodeContext; -extern const int64_t ff_ac3_channel_layouts[19]; +extern const uint64_t ff_ac3_channel_layouts[19]; int ff_ac3_encode_init(AVCodecContext *avctx); diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c index 4bea30848f..a24434547e 100644 --- a/libavcodec/audioconvert.c +++ b/libavcodec/audioconvert.c @@ -48,7 +48,7 @@ void avcodec_sample_fmt_string (char *buf, int buf_size, int sample_fmt) } #endif -int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name) +uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name) { switch(nb_channels) { case 1: return AV_CH_LAYOUT_MONO; diff --git a/libavcodec/audioconvert.h b/libavcodec/audioconvert.h index e9a78fe495..f50eb3e1bb 100644 --- a/libavcodec/audioconvert.h +++ b/libavcodec/audioconvert.h @@ -80,7 +80,7 @@ int avcodec_channel_layout_num_channels(int64_t channel_layout); * @param fmt_name Format name, or NULL if unknown * @return Channel layout mask */ -int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name); +uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name); struct AVAudioConvert; typedef struct AVAudioConvert AVAudioConvert; diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index dc794b0538..8005af4fd5 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2696,14 +2696,14 @@ typedef struct AVCodecContext { * - encoding: set by user. * - decoding: set by libavcodec. */ - int64_t channel_layout; + uint64_t channel_layout; /** * Request decoder to use this channel layout if it can (0 for default) * - encoding: unused * - decoding: Set by user. */ - int64_t request_channel_layout; + uint64_t request_channel_layout; /** * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow. @@ -3044,7 +3044,7 @@ typedef struct AVCodec { const char *long_name; const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 - const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 + const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 uint8_t max_lowres; ///< maximum value for lowres supported by the decoder const AVClass *priv_class; ///< AVClass for the private context const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} diff --git a/libavcodec/dca.c b/libavcodec/dca.c index b310638dc1..9d24b595c2 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -128,7 +128,7 @@ static const int dca_ext_audio_descr_mask[] = { * All 2 channel configurations -> AV_CH_LAYOUT_STEREO */ -static const int64_t dca_core_channel_layout[] = { +static const uint64_t dca_core_channel_layout[] = { AV_CH_FRONT_CENTER, ///< 1, A AV_CH_LAYOUT_STEREO, ///< 2, A + B (dual mono) AV_CH_LAYOUT_STEREO, ///< 2, L + R (stereo) diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c index 0fca1967c5..e0fedeb7e9 100644 --- a/libavcodec/mlp_parser.c +++ b/libavcodec/mlp_parser.c @@ -107,7 +107,7 @@ static int truehd_channels(int chanmap) return channels; } -static int64_t truehd_layout(int chanmap) +static uint64_t truehd_layout(int chanmap) { int layout = 0, i; diff --git a/libavcodec/version.h b/libavcodec/version.h index 6280e1c1c9..2313fae021 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -22,7 +22,7 @@ #define LIBAVCODEC_VERSION_MAJOR 53 #define LIBAVCODEC_VERSION_MINOR 22 -#define LIBAVCODEC_VERSION_MICRO 0 +#define LIBAVCODEC_VERSION_MICRO 1 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h index 8501e0a178..a55523f17e 100644 --- a/libavcodec/vorbis.h +++ b/libavcodec/vorbis.h @@ -27,7 +27,7 @@ extern const float ff_vorbis_floor1_inverse_db_table[256]; extern const float * const ff_vorbis_vwin[8]; extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8]; -extern const int64_t ff_vorbis_channel_layouts[9]; +extern const uint64_t ff_vorbis_channel_layouts[9]; typedef struct { uint16_t x; diff --git a/libavcodec/vorbis_data.c b/libavcodec/vorbis_data.c index 4e1fe00863..bd27b82d4a 100644 --- a/libavcodec/vorbis_data.c +++ b/libavcodec/vorbis_data.c @@ -44,7 +44,7 @@ const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8] = { { 0, 2, 1, 6, 7, 4, 5, 3 }, }; -const int64_t ff_vorbis_channel_layouts[9] = { +const uint64_t ff_vorbis_channel_layouts[9] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, |