summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormplayer-svn <svn@mplayerhq.hu>2012-02-11 22:33:22 +0000
committerwm4 <wm4@nowhere>2012-08-03 01:46:43 +0200
commitb615b66322b0dae487f2f625c1a6354905a8a8cc (patch)
tree49a5ea327b6a92daf3a6d671922b19477ec766e4
parentcb2f0e7c38020a9d0777f0d4ccbb0a9f05e622fc (diff)
downloadmpv-b615b66322b0dae487f2f625c1a6354905a8a8cc.tar.bz2
mpv-b615b66322b0dae487f2f625c1a6354905a8a8cc.tar.xz
vf_yadif: fix green bottom line
Fix green bottom line on yadif with certain parity. This implementation of the filter method needs a padding, that mplayer allocates but never fills with data. Do the padding properly and tweak the height alignment to even number of lines, instead of rounding to 32. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34691 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: iive
-rw-r--r--libmpcodecs/vf_yadif.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index 6b9d05fde5..999ec56692 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -60,8 +60,19 @@ static void store_ref(struct vf_priv_s *p, uint8_t *src[3], int src_stride[3], i
for(i=0; i<3; i++){
int is_chroma= !!i;
+ int pn_width = width >>is_chroma;
+ int pn_height = height>>is_chroma;
- memcpy_pic(p->ref[2][i], src[i], width>>is_chroma, height>>is_chroma, p->stride[i], src_stride[i]);
+
+ memcpy_pic(p->ref[2][i], src[i], pn_width, pn_height, p->stride[i], src_stride[i]);
+
+ fast_memcpy(p->ref[2][i] + pn_height * p->stride[i],
+ src[i] + (pn_height-1)*src_stride[i], pn_width);
+ fast_memcpy(p->ref[2][i] + (pn_height+1)* p->stride[i],
+ src[i] + (pn_height-1)*src_stride[i], pn_width);
+
+ fast_memcpy(p->ref[2][i] - p->stride[i], src[i], pn_width);
+ fast_memcpy(p->ref[2][i] - 2*p->stride[i], src[i], pn_width);
}
}
@@ -373,7 +384,7 @@ static int config(struct vf_instance *vf,
for(i=0; i<3; i++){
int is_chroma= !!i;
int w= ((width + 31) & (~31))>>is_chroma;
- int h= ((height+6+ 31) & (~31))>>is_chroma;
+ int h=(((height + 1) & ( ~1))>>is_chroma) + 6;
vf->priv->stride[i]= w;
for(j=0; j<3; j++)