Mercurial > libavcodec.hg
comparison h264.c @ 11465:2e9cf41e2c2e libavcodec
Always reset slice_table.
Previously, the area of a lost slice would be left at the slice number of the previous
frame which could occasionally match the number of the next slice and thus a non existing
slice could have been used for prediction leading to additional decoding errors in otherwise
undamaged slices.
author | michael |
---|---|
date | Fri, 12 Mar 2010 15:21:45 +0000 |
parents | 33f8308382f5 |
children | 049a0c71e5a3 |
comparison
equal
deleted
inserted
replaced
11464:1f170baf606f | 11465:2e9cf41e2c2e |
---|---|
959 * FIXME: redo bipred weight to not require extra buffer? */ | 959 * FIXME: redo bipred weight to not require extra buffer? */ |
960 for(i = 0; i < s->avctx->thread_count; i++) | 960 for(i = 0; i < s->avctx->thread_count; i++) |
961 if(!h->thread_context[i]->s.obmc_scratchpad) | 961 if(!h->thread_context[i]->s.obmc_scratchpad) |
962 h->thread_context[i]->s.obmc_scratchpad = av_malloc(16*2*s->linesize + 8*2*s->uvlinesize); | 962 h->thread_context[i]->s.obmc_scratchpad = av_malloc(16*2*s->linesize + 8*2*s->uvlinesize); |
963 | 963 |
964 /* some macroblocks will be accessed before they're available */ | 964 /* some macroblocks can be accessed before they're available in case of lost slices, mbaff or threading*/ |
965 if(FRAME_MBAFF || s->avctx->thread_count > 1) | |
966 memset(h->slice_table, -1, (s->mb_height*s->mb_stride-1) * sizeof(*h->slice_table)); | 965 memset(h->slice_table, -1, (s->mb_height*s->mb_stride-1) * sizeof(*h->slice_table)); |
967 | 966 |
968 // s->decode= (s->flags&CODEC_FLAG_PSNR) || !s->encoding || s->current_picture.reference /*|| h->contains_intra*/ || 1; | 967 // s->decode= (s->flags&CODEC_FLAG_PSNR) || !s->encoding || s->current_picture.reference /*|| h->contains_intra*/ || 1; |
969 | 968 |
970 // We mark the current picture as non-reference after allocating it, so | 969 // We mark the current picture as non-reference after allocating it, so |