From 9342dc04b6281353599c777f103faadb6bdb1275 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Wed, 16 Jan 2013 19:19:43 +0000 Subject: Bump Libav to v9.1. Fixes high bit-depth H.264 decoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5176 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- contrib/ffmpeg/A01-swscale-assert.patch | 2 +- contrib/ffmpeg/A03-h264-recovery-point.patch | 4 +- contrib/ffmpeg/A04-dca-resync.patch | 71 +++++++++++++++++++++++ contrib/ffmpeg/A04-snow-use-videodspcontext.patch | 33 ----------- contrib/ffmpeg/A05-dca-resync.patch | 71 ----------------------- contrib/ffmpeg/P01-solaris.patch | 4 +- contrib/ffmpeg/P02-darwin-pic.patch | 6 +- contrib/ffmpeg/module.defs | 2 +- 8 files changed, 80 insertions(+), 113 deletions(-) create mode 100644 contrib/ffmpeg/A04-dca-resync.patch delete mode 100644 contrib/ffmpeg/A04-snow-use-videodspcontext.patch delete mode 100644 contrib/ffmpeg/A05-dca-resync.patch (limited to 'contrib/ffmpeg') diff --git a/contrib/ffmpeg/A01-swscale-assert.patch b/contrib/ffmpeg/A01-swscale-assert.patch index e0b6aad6b..9db84b7fa 100644 --- a/contrib/ffmpeg/A01-swscale-assert.patch +++ b/contrib/ffmpeg/A01-swscale-assert.patch @@ -1,5 +1,5 @@ diff --git a/libswscale/utils.c b/libswscale/utils.c -index e5e4d60..062ae01 100644 +index f0a2b46..61506c6 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -531,7 +531,9 @@ static int initFilter(int16_t **outFilter, int32_t **filterPos, diff --git a/contrib/ffmpeg/A03-h264-recovery-point.patch b/contrib/ffmpeg/A03-h264-recovery-point.patch index bbd25ab46..78c182df2 100644 --- a/contrib/ffmpeg/A03-h264-recovery-point.patch +++ b/contrib/ffmpeg/A03-h264-recovery-point.patch @@ -1,5 +1,5 @@ diff --git a/libavcodec/h264.c b/libavcodec/h264.c -index 1a0b341..98a0350 100644 +index 3660597..bf4e072 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2163,6 +2163,7 @@ static void flush_dpb(AVCodecContext *avctx) @@ -10,7 +10,7 @@ index 1a0b341..98a0350 100644 } static int init_poc(H264Context *h) -@@ -3976,9 +3977,18 @@ again: +@@ -3981,9 +3982,18 @@ again: if ((err = decode_slice_header(hx, h))) break; diff --git a/contrib/ffmpeg/A04-dca-resync.patch b/contrib/ffmpeg/A04-dca-resync.patch new file mode 100644 index 000000000..3e32c7a74 --- /dev/null +++ b/contrib/ffmpeg/A04-dca-resync.patch @@ -0,0 +1,71 @@ +From 021a7700ff839b295b5776d4552563de1a448df6 Mon Sep 17 00:00:00 2001 +From: John Stebbins +Date: Sat, 5 Jan 2013 16:57:06 -0800 +Subject: [PATCH] dca_parser: Handle changes in dca frame size + +A change in framesize caused a perpetual loss of synchronization. +So read (and use) the frame size from the frame header instead of +setting it only once. +--- + libavcodec/dca_parser.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c +index ab235cf..75e9321 100644 +--- a/libavcodec/dca_parser.c ++++ b/libavcodec/dca_parser.c +@@ -62,10 +62,12 @@ static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf, + if (IS_MARKER(state, i, buf, buf_size)) { + if (pc1->lastmarker && state == pc1->lastmarker) { + start_found = 1; ++ i++; + break; + } else if (!pc1->lastmarker) { + start_found = 1; + pc1->lastmarker = state; ++ i++; + break; + } + } +@@ -80,9 +82,6 @@ static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf, + if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size)) { + if(pc1->framesize > pc1->size) + continue; +- if(!pc1->framesize){ +- pc1->framesize = pc1->hd_pos ? pc1->hd_pos : pc1->size; +- } + pc->frame_start_found = 0; + pc->state = -1; + pc1->size = 0; +@@ -139,7 +138,7 @@ int ff_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, + } + + static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration, +- int *sample_rate) ++ int *sample_rate, int *framesize) + { + GetBitContext gb; + uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 }; +@@ -159,6 +158,10 @@ static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration, + return AVERROR_INVALIDDATA; + *duration = 256 * (sample_blocks / 8); + ++ *framesize = get_bits(&gb, 14) + 1; ++ if (*framesize < 95) ++ return AVERROR_INVALIDDATA; ++ + skip_bits(&gb, 20); + sr_code = get_bits(&gb, 4); + *sample_rate = avpriv_dca_sample_rates[sr_code]; +@@ -190,7 +193,7 @@ static int dca_parse(AVCodecParserContext * s, + } + + /* read the duration and sample rate from the frame header */ +- if (!dca_parse_params(buf, buf_size, &duration, &sample_rate)) { ++ if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, &pc1->framesize)) { + s->duration = duration; + avctx->sample_rate = sample_rate; + } else +-- +1.7.10.4 + diff --git a/contrib/ffmpeg/A04-snow-use-videodspcontext.patch b/contrib/ffmpeg/A04-snow-use-videodspcontext.patch deleted file mode 100644 index fc9a120b9..000000000 --- a/contrib/ffmpeg/A04-snow-use-videodspcontext.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/libavcodec/snow.c b/libavcodec/snow.c -index b9dab45..153e5b2 100644 ---- a/libavcodec/snow.c -+++ b/libavcodec/snow.c -@@ -349,7 +349,7 @@ void ff_snow_pred_block(SnowContext *s, uint8_t *dst, uint8_t *tmp, int stride, - src += sx + sy*stride; - if( (unsigned)sx >= w - b_w - (HTAPS_MAX-2) - || (unsigned)sy >= h - b_h - (HTAPS_MAX-2)){ -- s->dsp.emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1, sx, sy, w, h); -+ s->vdsp.emulated_edge_mc(tmp + MB_SIZE, src, stride, b_w+HTAPS_MAX-1, b_h+HTAPS_MAX-1, sx, sy, w, h); - src= tmp + MB_SIZE; - } - // assert(b_w == b_h || 2*b_w == b_h || b_w == 2*b_h); -@@ -402,6 +402,7 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ - s->max_ref_frames=1; //just make sure its not an invalid value in case of no initial keyframe - - ff_dsputil_init(&s->dsp, avctx); -+ ff_videodsp_init(&s->vdsp, 8); - ff_dwt_init(&s->dwt); - - #define mcf(dx,dy)\ -diff --git a/libavcodec/snow.h b/libavcodec/snow.h -index abf3309..b988115 100644 ---- a/libavcodec/snow.h -+++ b/libavcodec/snow.h -@@ -108,6 +108,7 @@ typedef struct SnowContext{ - AVCodecContext *avctx; - RangeCoder c; - DSPContext dsp; -+ VideoDSPContext vdsp; - DWTContext dwt; - AVFrame new_picture; - AVFrame input_picture; ///< new_picture with the internal linesizes diff --git a/contrib/ffmpeg/A05-dca-resync.patch b/contrib/ffmpeg/A05-dca-resync.patch deleted file mode 100644 index 3e32c7a74..000000000 --- a/contrib/ffmpeg/A05-dca-resync.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 021a7700ff839b295b5776d4552563de1a448df6 Mon Sep 17 00:00:00 2001 -From: John Stebbins -Date: Sat, 5 Jan 2013 16:57:06 -0800 -Subject: [PATCH] dca_parser: Handle changes in dca frame size - -A change in framesize caused a perpetual loss of synchronization. -So read (and use) the frame size from the frame header instead of -setting it only once. ---- - libavcodec/dca_parser.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c -index ab235cf..75e9321 100644 ---- a/libavcodec/dca_parser.c -+++ b/libavcodec/dca_parser.c -@@ -62,10 +62,12 @@ static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf, - if (IS_MARKER(state, i, buf, buf_size)) { - if (pc1->lastmarker && state == pc1->lastmarker) { - start_found = 1; -+ i++; - break; - } else if (!pc1->lastmarker) { - start_found = 1; - pc1->lastmarker = state; -+ i++; - break; - } - } -@@ -80,9 +82,6 @@ static int dca_find_frame_end(DCAParseContext * pc1, const uint8_t * buf, - if (state == pc1->lastmarker && IS_MARKER(state, i, buf, buf_size)) { - if(pc1->framesize > pc1->size) - continue; -- if(!pc1->framesize){ -- pc1->framesize = pc1->hd_pos ? pc1->hd_pos : pc1->size; -- } - pc->frame_start_found = 0; - pc->state = -1; - pc1->size = 0; -@@ -139,7 +138,7 @@ int ff_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, - } - - static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration, -- int *sample_rate) -+ int *sample_rate, int *framesize) - { - GetBitContext gb; - uint8_t hdr[12 + FF_INPUT_BUFFER_PADDING_SIZE] = { 0 }; -@@ -159,6 +158,10 @@ static int dca_parse_params(const uint8_t *buf, int buf_size, int *duration, - return AVERROR_INVALIDDATA; - *duration = 256 * (sample_blocks / 8); - -+ *framesize = get_bits(&gb, 14) + 1; -+ if (*framesize < 95) -+ return AVERROR_INVALIDDATA; -+ - skip_bits(&gb, 20); - sr_code = get_bits(&gb, 4); - *sample_rate = avpriv_dca_sample_rates[sr_code]; -@@ -190,7 +193,7 @@ static int dca_parse(AVCodecParserContext * s, - } - - /* read the duration and sample rate from the frame header */ -- if (!dca_parse_params(buf, buf_size, &duration, &sample_rate)) { -+ if (!dca_parse_params(buf, buf_size, &duration, &sample_rate, &pc1->framesize)) { - s->duration = duration; - avctx->sample_rate = sample_rate; - } else --- -1.7.10.4 - diff --git a/contrib/ffmpeg/P01-solaris.patch b/contrib/ffmpeg/P01-solaris.patch index b97907941..0a2355f91 100644 --- a/contrib/ffmpeg/P01-solaris.patch +++ b/contrib/ffmpeg/P01-solaris.patch @@ -1,8 +1,8 @@ diff --git a/configure b/configure -index 5355300..5ac7bc0 100755 +index e87a326..5ccfc0f 100755 --- a/configure +++ b/configure -@@ -3146,7 +3146,7 @@ EOF +@@ -3156,7 +3156,7 @@ EOF check_cc <config.fate diff --git a/contrib/ffmpeg/module.defs b/contrib/ffmpeg/module.defs index 3dbe5d88a..22c1aea56 100644 --- a/contrib/ffmpeg/module.defs +++ b/contrib/ffmpeg/module.defs @@ -1,7 +1,7 @@ $(eval $(call import.MODULE.defs,FFMPEG,ffmpeg,YASM BZIP2 ZLIB)) $(eval $(call import.CONTRIB.defs,FFMPEG)) -FFMPEG.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libav-v9_beta3.tar.bz2 +FFMPEG.FETCH.url = http://download.handbrake.fr/handbrake/contrib/libav-v9.1.tar.bz2 FFMPEG.CONFIGURE.deps = FFMPEG.CONFIGURE.env = -- cgit v1.2.3