From 41244e13d5452e70cfd42f76ede4a20b7081c71f Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Tue, 22 Jan 2013 21:53:53 +0100 Subject: [PATCH 1/3] flac: don't check the number of channels before setting the channel layout. This is unnecessary, as ff_flac_set_channel_layout can handle any number of channels. Signed-off-by: Anton Khirnov --- libavcodec/flac_parser.c | 2 +- libavcodec/flacdec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index 3d8e17f995..ee92ee3b0d 100644 --- a/libavcodec/flac_parser.c +++ b/libavcodec/flac_parser.c @@ -458,7 +458,7 @@ static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf, } if (header->fi.channels != fpc->avctx->channels || - (!fpc->avctx->channel_layout && header->fi.channels <= 6)) { + !fpc->avctx->channel_layout) { fpc->avctx->channels = header->fi.channels; ff_flac_set_channel_layout(fpc->avctx); } diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 51fd19628c..f273d145cb 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -426,7 +426,7 @@ static int decode_frame(FLACContext *s) return ret; } s->channels = s->avctx->channels = fi.channels; - if (!s->avctx->channel_layout && s->channels <= 6) + if (!s->avctx->channel_layout) ff_flac_set_channel_layout(s->avctx); s->ch_mode = fi.ch_mode; From 9d083d64172ebf94e343a3a269eabba5bbcdf182 Mon Sep 17 00:00:00 2001 From: Tim Walker Date: Tue, 22 Jan 2013 21:53:54 +0100 Subject: [PATCH 2/3] flac: add channel layout masks for streams with 7 or 8 channels. They were added to the latest FLAC specification: https://git.xiph.org/?p=flac-website.git;a=commit;h=65c199a2 Signed-off-by: Anton Khirnov --- libavcodec/flac.c | 6 ++++-- libavcodec/version.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/flac.c b/libavcodec/flac.c index 32b28d0443..aa322b42f9 100644 --- a/libavcodec/flac.c +++ b/libavcodec/flac.c @@ -29,13 +29,15 @@ static const int8_t sample_size_table[] = { 0, 8, 12, 0, 16, 20, 24, 0 }; -static const int64_t flac_channel_layouts[6] = { +static const uint64_t flac_channel_layouts[8] = { AV_CH_LAYOUT_MONO, AV_CH_LAYOUT_STEREO, AV_CH_LAYOUT_SURROUND, AV_CH_LAYOUT_QUAD, AV_CH_LAYOUT_5POINT0, - AV_CH_LAYOUT_5POINT1 + AV_CH_LAYOUT_5POINT1, + AV_CH_LAYOUT_6POINT1, + AV_CH_LAYOUT_7POINT1 }; static int64_t get_utf8(GetBitContext *gb) diff --git a/libavcodec/version.h b/libavcodec/version.h index 80da6e2133..7a024d38a1 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -28,7 +28,7 @@ #define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MINOR 41 -#define LIBAVCODEC_VERSION_MICRO 0 +#define LIBAVCODEC_VERSION_MICRO 1 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ From ca1fe6c0e60808da45d4dfd8728f45e843b9f9b0 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 3 Feb 2013 08:32:39 +0100 Subject: [PATCH 3/3] h263: remove an unused parameter from ff_h263_decode_init_vlc --- libavcodec/h263.h | 2 +- libavcodec/h263dec.c | 2 +- libavcodec/ituh263dec.c | 2 +- libavcodec/rv10.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/h263.h b/libavcodec/h263.h index 0b5ace3960..e1e0dd7ded 100644 --- a/libavcodec/h263.h +++ b/libavcodec/h263.h @@ -80,7 +80,7 @@ void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line); int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir, int *px, int *py); void ff_h263_encode_init(MpegEncContext *s); -void ff_h263_decode_init_vlc(MpegEncContext *s); +void ff_h263_decode_init_vlc(void); int ff_h263_decode_picture_header(MpegEncContext *s); int ff_h263_decode_gob_header(MpegEncContext *s); void ff_h263_update_motion_val(MpegEncContext * s); diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 169fd35281..0eaf4d7f61 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -117,7 +117,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) if (ff_MPV_common_init(s) < 0) return -1; - ff_h263_decode_init_vlc(s); + ff_h263_decode_init_vlc(); return 0; } diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index f062b246b4..30cd58efd3 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -101,7 +101,7 @@ static VLC cbpc_b_vlc; /* init vlcs */ /* XXX: find a better solution to handle static init */ -void ff_h263_decode_init_vlc(MpegEncContext *s) +void ff_h263_decode_init_vlc(void) { static int done = 0; diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 9239cf7d94..8cce6cf699 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -472,7 +472,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) if (ff_MPV_common_init(s) < 0) return -1; - ff_h263_decode_init_vlc(s); + ff_h263_decode_init_vlc(); /* init rv vlc */ if (!done) {