From 747db4e31a876142aadd488625774151ec27a236 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 26 Feb 2010 03:27:52 +0000 Subject: [PATCH] Move init of right side of ref_cache from fill_caches() to init_the_darn_decoder(). Originally committed as revision 22071 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 4 ++++ libavcodec/h264.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 5c1c840e79..5185e31ebb 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -872,6 +872,10 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx){ avctx->ticks_per_frame = 2; } + h->ref_cache[0][scan8[5 ]+1] = h->ref_cache[0][scan8[7 ]+1] = h->ref_cache[0][scan8[13]+1] = + h->ref_cache[1][scan8[5 ]+1] = h->ref_cache[1][scan8[7 ]+1] = h->ref_cache[1][scan8[13]+1] = PART_NOT_AVAILABLE; + + if(avctx->extradata_size > 0 && avctx->extradata && *(char *)avctx->extradata == 1){ int i, cnt, nalsize; unsigned char *p = avctx->extradata; diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 7f1dee3ada..2e77184c6d 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1037,9 +1037,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){ continue; if(!(mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2))) { - h->ref_cache[list][scan8[5 ]+1] = - h->ref_cache[list][scan8[7 ]+1] = - h->ref_cache[list][scan8[13]+1] = //FIXME remove past 3 (init somewhere else) h->ref_cache[list][scan8[4 ]] = h->ref_cache[list][scan8[12]] = PART_NOT_AVAILABLE; AV_ZERO32(h->mv_cache [list][scan8[4 ]]);