comparison libmpcodecs/vf_spp.c @ 24552:c9c2e550a449

MPEG-2 blocks at qp 1 get overfiltered by spp, apparently because "qp>>1" turns it into 0, which causes an integer overflow later. Clip qp at 1 to avoid this. patch by Alexander Strange, astrange ithinksw com
author diego
date Tue, 18 Sep 2007 14:08:08 +0000
parents a124f3abc1ec
children 57545b63efec
comparison
equal deleted inserted replaced
24551:925b7145748d 24552:c9c2e550a449
400 400
401 if(p->qp) 401 if(p->qp)
402 qp= p->qp; 402 qp= p->qp;
403 else{ 403 else{
404 qp= qp_store[ (XMIN(x, width-1)>>qps) + (XMIN(y, height-1)>>qps) * qp_stride]; 404 qp= qp_store[ (XMIN(x, width-1)>>qps) + (XMIN(y, height-1)>>qps) * qp_stride];
405 if(p->mpeg2) qp>>=1; 405 if(p->mpeg2) qp = FFMAX(1, qp>>1);
406 } 406 }
407 for(i=0; i<count; i++){ 407 for(i=0; i<count; i++){
408 const int x1= x + offset[i+count-1][0]; 408 const int x1= x + offset[i+count-1][0];
409 const int y1= y + offset[i+count-1][1]; 409 const int y1= y + offset[i+count-1][1];
410 const int index= x1 + y1*stride; 410 const int index= x1 + y1*stride;