comparison libpostproc/postprocess.c @ 182:3ccd74a91074 libavcodec

minor brightness/contrast bugfix / moved some global vars into ppMode non mmx compilation bugfix
author michael
date Fri, 28 Dec 2001 13:56:04 +0000
parents edc5f6cf1855
children d310beb2d848
comparison
equal deleted inserted replaced
181:edc5f6cf1855 182:3ccd74a91074
45 c = checked against the other implementations (-vo md5) 45 c = checked against the other implementations (-vo md5)
46 */ 46 */
47 47
48 /* 48 /*
49 TODO: 49 TODO:
50 remove global/static vars
50 reduce the time wasted on the mem transfer 51 reduce the time wasted on the mem transfer
51 implement everything in C at least (done at the moment but ...) 52 implement everything in C at least (done at the moment but ...)
52 unroll stuff if instructions depend too much on the prior one 53 unroll stuff if instructions depend too much on the prior one
53 we use 8x8 blocks for the horizontal filters, opendivx seems to use 8x4? 54 we use 8x8 blocks for the horizontal filters, opendivx seems to use 8x4?
54 move YScale thing to the end instead of fixing QP 55 move YScale thing to the end instead of fixing QP
151 152
152 int hFlatnessThreshold= 56 - 16; 153 int hFlatnessThreshold= 56 - 16;
153 int vFlatnessThreshold= 56 - 16; 154 int vFlatnessThreshold= 56 - 16;
154 int deringThreshold= 20; 155 int deringThreshold= 20;
155 156
156 static int dcOffset= 1; 157 static int dcOffset;
157 static int dcThreshold= 3; 158 static int dcThreshold;
158 159
159 //amount of "black" u r willing to loose to get a brightness corrected picture 160 //amount of "black" u r willing to loose to get a brightness corrected picture
160 double maxClippedThreshold= 0.01; 161 double maxClippedThreshold= 0.01;
161
162 int maxAllowedY=234;
163 int minAllowedY=16;
164 162
165 static struct PPFilter filters[]= 163 static struct PPFilter filters[]=
166 { 164 {
167 {"hb", "hdeblock", 1, 1, 3, H_DEBLOCK}, 165 {"hb", "hdeblock", 1, 1, 3, H_DEBLOCK},
168 {"vb", "vdeblock", 1, 2, 4, V_DEBLOCK}, 166 {"vb", "vdeblock", 1, 2, 4, V_DEBLOCK},
670 { 668 {
671 int o; 669 int o;
672 ppMode.minAllowedY= 16; 670 ppMode.minAllowedY= 16;
673 ppMode.maxAllowedY= 234; 671 ppMode.maxAllowedY= 234;
674 for(o=0; options[o]!=NULL; o++) 672 for(o=0; options[o]!=NULL; o++)
673 {
675 if( !strcmp(options[o],"fullyrange") 674 if( !strcmp(options[o],"fullyrange")
676 ||!strcmp(options[o],"f")) 675 ||!strcmp(options[o],"f"))
677 { 676 {
678 ppMode.minAllowedY= 0; 677 ppMode.minAllowedY= 0;
679 ppMode.maxAllowedY= 255; 678 ppMode.maxAllowedY= 255;
680 numOfUnknownOptions--; 679 numOfUnknownOptions--;
681 } 680 }
681 }
682 } 682 }
683 else if(filters[i].mask == TEMP_NOISE_FILTER) 683 else if(filters[i].mask == TEMP_NOISE_FILTER)
684 { 684 {
685 int o; 685 int o;
686 int numOfNoises=0; 686 int numOfNoises=0;
702 } 702 }
703 } 703 }
704 else if(filters[i].mask == V_DEBLOCK || filters[i].mask == H_DEBLOCK) 704 else if(filters[i].mask == V_DEBLOCK || filters[i].mask == H_DEBLOCK)
705 { 705 {
706 int o; 706 int o;
707 ppMode.maxDcDiff=1;
708 // hFlatnessThreshold= 40;
709 // vFlatnessThreshold= 40;
707 710
708 for(o=0; options[o]!=NULL && o<2; o++) 711 for(o=0; options[o]!=NULL && o<2; o++)
709 { 712 {
710 char *tail; 713 char *tail;
711 int val= strtol(options[o], &tail, 0); 714 int val= strtol(options[o], &tail, 0);
712 if(tail==options[o]) break; 715 if(tail==options[o]) break;
713 716
714 numOfUnknownOptions--; 717 numOfUnknownOptions--;
715 if(o==0) 718 if(o==0) ppMode.maxDcDiff= val;
716 {
717 dcOffset= val;
718 dcThreshold= 2*val+1;
719 mmxDCOffset= 0x7F - val;
720 mmxDCThreshold= 0x7F - 2*val - 1;
721
722 mmxDCOffset*= 0x0101010101010101LL;
723 mmxDCThreshold*= 0x0101010101010101LL;
724 }
725 else hFlatnessThreshold= 719 else hFlatnessThreshold=
726 vFlatnessThreshold= val; 720 vFlatnessThreshold= val;
727 } 721 }
728 } 722 }
729 } 723 }
798 mode= ((mode&0xFF)>>4) | (mode&0xFFFFFF00); 792 mode= ((mode&0xFF)>>4) | (mode&0xFFFFFF00);
799 ppMode.chromMode= mode; 793 ppMode.chromMode= mode;
800 ppMode.maxTmpNoise[0]= 700; 794 ppMode.maxTmpNoise[0]= 700;
801 ppMode.maxTmpNoise[1]= 1500; 795 ppMode.maxTmpNoise[1]= 1500;
802 ppMode.maxTmpNoise[2]= 3000; 796 ppMode.maxTmpNoise[2]= 3000;
797 ppMode.maxAllowedY= 234;
798 ppMode.minAllowedY= 16;
799 ppMode.maxDcDiff= 1;
803 800
804 #ifdef HAVE_ODIVX_POSTPROCESS 801 #ifdef HAVE_ODIVX_POSTPROCESS
805 // Note: I could make this shit outside of this file, but it would mean one 802 // Note: I could make this shit outside of this file, but it would mean one
806 // more function call... 803 // more function call...
807 if(use_old_pp){ 804 if(use_old_pp){