summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_mvs.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-02-08 06:10:27 +0100
committerLuca Barbato <lu_zero@gentoo.org>2014-02-09 19:53:43 +0100
commit246d3bf0ec93dd21069f9352ed4909aec334cd4d (patch)
treebc4dd4c037f0ff258d331e1a2181fbd7a6f3f8cc /libavcodec/hevc_mvs.c
parente95018b694c0774477abec5bbf86ecc7946a9a28 (diff)
hevc: Conceal zero td
It was done only in check_mvset(), while mv_scale() is called also by dist_scale(). Sample-Id: 00001579-google Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/hevc_mvs.c')
-rw-r--r--libavcodec/hevc_mvs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c
index 49d5ff25d8..2fe4dbbed6 100644
--- a/libavcodec/hevc_mvs.c
+++ b/libavcodec/hevc_mvs.c
@@ -568,8 +568,12 @@ static av_always_inline void dist_scale(HEVCContext *s, Mv *mv,
int ref_pic_elist = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]];
int ref_pic_curr = refPicList[ref_idx_curr].list[ref_idx];
- if (ref_pic_elist != ref_pic_curr)
- mv_scale(mv, mv, s->poc - ref_pic_elist, s->poc - ref_pic_curr);
+ if (ref_pic_elist != ref_pic_curr) {
+ int poc_diff = s->poc - ref_pic_elist;
+ if (!poc_diff)
+ poc_diff = 1;
+ mv_scale(mv, mv, poc_diff, s->poc - ref_pic_curr);
+ }
}
static int mv_mp_mode_mx(HEVCContext *s, int x, int y, int pred_flag_index,