summaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-16 15:38:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-16 15:38:27 +0200
commit371d37fcf5207d164684beefa016657564eb5068 (patch)
tree61796f9b8d5525457303812f9e8b1b86e737f980 /libavcodec/ffv1.c
parent8486c8cc9a0af420826ba174ab0c4391e0b2d42d (diff)
downloadffmpeg-streaming-371d37fcf5207d164684beefa016657564eb5068.zip
ffmpeg-streaming-371d37fcf5207d164684beefa016657564eb5068.tar.gz
ffv1: keep last_frame (to be used for error concealment)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r--libavcodec/ffv1.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 79e512d..5f63243 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -181,6 +181,7 @@ typedef struct FFV1Context{
int flags;
int picture_number;
AVFrame picture;
+ AVFrame last_picture;
int plane_count;
int ac; ///< 1=range coder <-> 0=golomb rice
int ac_byte_count; ///< number of bytes used for AC coding
@@ -1364,6 +1365,8 @@ static av_cold int common_end(AVCodecContext *avctx){
if (avctx->codec->decode && s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
+ if (avctx->codec->decode && s->last_picture.data[0])
+ avctx->release_buffer(avctx, &s->last_picture);
for(j=0; j<s->slice_count; j++){
FFV1Context *fs= s->slice_context[j];
@@ -1988,7 +1991,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
p->key_frame= 0;
}
- p->reference= 0;
+ p->reference= 3; //for error concealment
if(avctx->get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
@@ -2038,6 +2041,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
*picture= *p;
*data_size = sizeof(AVFrame);
+ FFSWAP(AVFrame, f->picture, f->last_picture);
+
return buf_size;
}
OpenPOWER on IntegriCloud