comparison postprocess_template.c @ 29:2e855f3f4e0b libpostproc

printf --> av_log with some help from Oded
author diego
date Wed, 11 Oct 2006 00:18:33 +0000
parents c83a71c1729d
children 81ad3274583c
comparison
equal deleted inserted replaced
28:b55400a067f0 29:2e855f3f4e0b
894 } 894 }
895 if(y==4) bias+=d; 895 if(y==4) bias+=d;
896 num++; 896 num++;
897 if(num%1000000 == 0) 897 if(num%1000000 == 0)
898 { 898 {
899 printf(" %d %d %d %d\n", num, sum, max, bias); 899 av_log(c, AV_LOG_INFO, " %d %d %d %d\n", num, sum, max, bias);
900 } 900 }
901 } 901 }
902 } 902 }
903 } 903 }
904 */ 904 */
1505 } 1505 }
1506 errorSum+= error; 1506 errorSum+= error;
1507 1507
1508 if(1024LL*1024LL*1024LL % numSkiped == 0) 1508 if(1024LL*1024LL*1024LL % numSkiped == 0)
1509 { 1509 {
1510 printf( "sum:%1.3f, skip:%d, wQP:%d, " 1510 av_log(c, AV_LOG_INFO, "sum:%1.3f, skip:%d, wQP:%d, "
1511 "wRange:%d, wDiff:%d, relSkip:%1.3f\n", 1511 "wRange:%d, wDiff:%d, relSkip:%1.3f\n",
1512 (float)errorSum/numSkiped, numSkiped, worstQP, worstRange, 1512 (float)errorSum/numSkiped, numSkiped, worstQP, worstRange,
1513 worstDiff, (float)numSkiped/numPixels); 1513 worstDiff, (float)numSkiped/numPixels);
1514 } 1514 }
1515 } 1515 }
2533 "4: \n\t" 2533 "4: \n\t"
2534 2534
2535 :: "r" (src), "r" (tempBlured), "r"((long)stride), "m" (tempBluredPast) 2535 :: "r" (src), "r" (tempBlured), "r"((long)stride), "m" (tempBluredPast)
2536 : "%"REG_a, "%"REG_d, "%"REG_c, "memory" 2536 : "%"REG_a, "%"REG_d, "%"REG_c, "memory"
2537 ); 2537 );
2538 //printf("%d\n", test);
2539 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW) 2538 #else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
2540 { 2539 {
2541 int y; 2540 int y;
2542 int d=0; 2541 int d=0;
2543 // int sysd=0; 2542 // int sysd=0;
2566 +(*(tempBluredPast+256)) 2565 +(*(tempBluredPast+256))
2567 +4)>>3; 2566 +4)>>3;
2568 *tempBluredPast=i; 2567 *tempBluredPast=i;
2569 // ((*tempBluredPast)*3 + d + 2)>>2; 2568 // ((*tempBluredPast)*3 + d + 2)>>2;
2570 2569
2571 //printf("%d %d %d\n", maxNoise[0], maxNoise[1], maxNoise[2]);
2572 /* 2570 /*
2573 Switch between 2571 Switch between
2574 1 0 0 0 0 0 0 (0) 2572 1 0 0 0 0 0 0 (0)
2575 64 32 16 8 4 2 1 (1) 2573 64 32 16 8 4 2 1 (1)
2576 64 48 36 27 20 15 11 (33) (approx) 2574 64 48 36 27 20 15 11 (33) (approx)
3413 if(c.frameNum == 1) yHistogram[0]= width*height/64*15/256; 3411 if(c.frameNum == 1) yHistogram[0]= width*height/64*15/256;
3414 3412
3415 for(i=0; i<256; i++) 3413 for(i=0; i<256; i++)
3416 { 3414 {
3417 sum+= yHistogram[i]; 3415 sum+= yHistogram[i];
3418 // printf("%d ", yHistogram[i]);
3419 } 3416 }
3420 // printf("\n\n");
3421 3417
3422 /* we allways get a completly black picture first */ 3418 /* we allways get a completly black picture first */
3423 maxClipped= (uint64_t)(sum * c.ppMode.maxClippedThreshold); 3419 maxClipped= (uint64_t)(sum * c.ppMode.maxClippedThreshold);
3424 3420
3425 clipped= sum; 3421 clipped= sum;
3543 memcpy(dst + i*dstStride, tempDst + (9+i)*dstStride, width); 3539 memcpy(dst + i*dstStride, tempDst + (9+i)*dstStride, width);
3544 } 3540 }
3545 } 3541 }
3546 } 3542 }
3547 3543
3548 //printf("\n");
3549 for(y=0; y<height; y+=BLOCK_SIZE) 3544 for(y=0; y<height; y+=BLOCK_SIZE)
3550 { 3545 {
3551 //1% speedup if these are here instead of the inner loop 3546 //1% speedup if these are here instead of the inner loop
3552 uint8_t *srcBlock= &(src[y*srcStride]); 3547 uint8_t *srcBlock= &(src[y*srcStride]);
3553 uint8_t *dstBlock= &(dst[y*dstStride]); 3548 uint8_t *dstBlock= &(dst[y*dstStride]);
3580 memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), ABS(dstStride)); 3575 memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), ABS(dstStride));
3581 3576
3582 dstBlock= tempDst + dstStride; 3577 dstBlock= tempDst + dstStride;
3583 srcBlock= tempSrc; 3578 srcBlock= tempSrc;
3584 } 3579 }
3585 //printf("\n");
3586 3580
3587 // From this point on it is guranteed that we can read and write 16 lines downward 3581 // From this point on it is guranteed that we can read and write 16 lines downward
3588 // finish 1 block before the next otherwise we might have a problem 3582 // finish 1 block before the next otherwise we might have a problem
3589 // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing 3583 // with the L1 Cache of the P4 ... or only a few blocks at a time or soemthing
3590 for(x=0; x<width; x+=BLOCK_SIZE) 3584 for(x=0; x<width; x+=BLOCK_SIZE)