# HG changeset patch # User gpoirier # Date 1153661900 0 # Node ID 7e4f5f62703da18bc309e7f7e3218fb82f123070 # Parent 39d60ed7edfe9786398fdedeadaa96c164d515cb -vf pp7 overblurs still parts of the image, which have qp=1, and qp becomes zero after the >> 1. Modifying the threshold table for qp=0 so it copies the qp=1 case seems to fix the problem. Patch by Jindrich Makovicka % makovick AH gmail P com % Original thread: Date: Jul 22, 2006 2:55 PM Subject: [MPlayer-dev-eng] [PATCH] -vf pp7 artifacting in still MPEG2 images diff -r 39d60ed7edfe -r 7e4f5f62703d libmpcodecs/vf_pp7.c --- a/libmpcodecs/vf_pp7.c Sun Jul 23 10:10:06 2006 +0000 +++ b/libmpcodecs/vf_pp7.c Sun Jul 23 13:38:20 2006 +0000 @@ -38,6 +38,7 @@ #include "libvo/fastmemcpy.h" #define XMIN(a,b) ((a) < (b) ? (a) : (b)) +#define XMAX(a,b) ((a) > (b) ? (a) : (b)) typedef short DCTELEM; @@ -218,7 +219,7 @@ for(qp=0; qp<99; qp++){ for(i=0; i<16; i++){ - thres2[qp][i]= ((i&1)?SN2:SN0) * ((i&4)?SN2:SN0) * qp * (1<<2) - 1 - bias; + thres2[qp][i]= ((i&1)?SN2:SN0) * ((i&4)?SN2:SN0) * XMAX(1,qp) * (1<<2) - 1 - bias; } } }