diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2025-04-22 21:04:37 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2025-04-27 05:04:34 +0200 |
commit | 142eb90f07a43a1658d0b61c4ae447f76e88f66b (patch) | |
tree | 8f1fa293247a13426ce6547cb0a670a3aa7db6c7 /libpostproc/postprocess_template.c | |
parent | 0118f392be916784f92508474e8d64243fd6fa97 (diff) | |
download | ffmpeg-142eb90f07a43a1658d0b61c4ae447f76e88f66b.tar.gz |
postproc/postprocess_template: fix handling of first row of dering_C
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libpostproc/postprocess_template.c')
-rw-r--r-- | libpostproc/postprocess_template.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index d2e7a642ff..0531e39477 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -831,9 +831,11 @@ static inline void RENAME(doVertDefFilter)(uint8_t src[], int stride, PPContext #endif //TEMPLATE_PP_ALTIVEC #if !TEMPLATE_PP_ALTIVEC -static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c, int leftborder, int rightborder) +static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c, int leftborder, int rightborder, int topborder) { #if TEMPLATE_PP_MMXEXT && HAVE_7REGS + if (topborder) + return; DECLARE_ALIGNED(8, uint64_t, tmp)[3]; __asm__ volatile( "pxor %%mm6, %%mm6 \n\t" @@ -1043,7 +1045,8 @@ DERING_CORE((%0, %1, 8) ,(%%FF_REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5, if (max - min < DERING_THRESHOLD) return; - for(y=0; y<10; y++){ + s[0] = 0; + for(y=topborder; y<10; y++){ int t = 0; if(!leftborder && src[stride*y + 0] > avg) t+= 1; @@ -3209,8 +3212,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ } #endif //TEMPLATE_PP_MMX if(mode & DERING){ - //FIXME filter first line - if(y>0) RENAME(dering)(dstBlock - stride - 8, stride, c, x<=8, 0); + RENAME(dering)(dstBlock - stride - 8, stride, c, x<=8, 0, y<=0); } if(mode & TEMP_NOISE_FILTER) @@ -3232,7 +3234,7 @@ static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[ } if(mode & DERING){ - if(y > 0) RENAME(dering)(dstBlock - dstStride - 8, dstStride, c, 0, 1); + RENAME(dering)(dstBlock - dstStride - 8, dstStride, c, 0, 1, y<=0); } if((mode & TEMP_NOISE_FILTER)){ |