# HG changeset patch # User iive # Date 1328999602 0 # Node ID d0135e230f3d0763618e8187011b9a3d1dcf2b65 # Parent a5d0652dd1a0f79fabc47e130b789cf667421540 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. diff -r a5d0652dd1a0 -r d0135e230f3d libmpcodecs/vf_yadif.c --- a/libmpcodecs/vf_yadif.c Sat Feb 11 21:17:50 2012 +0000 +++ b/libmpcodecs/vf_yadif.c Sat Feb 11 22:33:22 2012 +0000 @@ -60,8 +60,19 @@ 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 @@ 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++)