summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-11 00:47:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-11 00:57:59 +0200
commit3732c483040f0309505f1aa896fdefef5083ba34 (patch)
tree315e07d2ecef4b74c0c712f91ec733f1a04b5282 /libavcodec
parenta811ec7cb5d6b31ddeef59bfaab074074f2e1a92 (diff)
error_concealment: Use previous pictures motion vectors when the current ones have been lost.
Looks better for some cases, worse for others, overall not much difference. Its more correct though. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/error_resilience.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 0320ed01d0..dac555909b 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -381,6 +381,14 @@ static void guess_mv(MpegEncContext *s){
fixed[mb_xy]= f;
if(f==MV_FROZEN)
num_avail++;
+ else if(s->last_picture.data[0]){
+ const int mb_y= mb_xy / s->mb_stride;
+ const int mb_x= mb_xy % s->mb_stride;
+ const int mot_index= (mb_x + mb_y*mot_stride) * mot_step;
+ s->current_picture.motion_val[0][mot_index][0]= s->last_picture.motion_val[0][mot_index][0];
+ s->current_picture.motion_val[0][mot_index][1]= s->last_picture.motion_val[0][mot_index][1];
+ s->current_picture.ref_index[0][4*mb_xy] = s->last_picture.ref_index[0][4*mb_xy];
+ }
}
if((!(s->avctx->error_concealment&FF_EC_GUESS_MVS)) || num_avail <= mb_width/2){