Revision 07f8991b postproc/postprocess.c

View differences:

postproc/postprocess.c
47 47

  
48 48
/*
49 49
TODO:
50
remove global/static vars
50 51
reduce the time wasted on the mem transfer
51 52
implement everything in C at least (done at the moment but ...)
52 53
unroll stuff if instructions depend too much on the prior one
......
153 154
int vFlatnessThreshold= 56 - 16;
154 155
int deringThreshold= 20;
155 156

  
156
static int dcOffset= 1;
157
static int dcThreshold= 3;
157
static int dcOffset;
158
static int dcThreshold;
158 159

  
159 160
//amount of "black" u r willing to loose to get a brightness corrected picture
160 161
double maxClippedThreshold= 0.01;
161 162

  
162
int maxAllowedY=234;
163
int minAllowedY=16;
164

  
165 163
static struct PPFilter filters[]=
166 164
{
167 165
	{"hb", "hdeblock", 		1, 1, 3, H_DEBLOCK},
......
672 670
					ppMode.minAllowedY= 16;
673 671
					ppMode.maxAllowedY= 234;
674 672
					for(o=0; options[o]!=NULL; o++)
673
					{
675 674
						if(  !strcmp(options[o],"fullyrange")
676 675
						   ||!strcmp(options[o],"f"))
677 676
						{
......
679 678
							ppMode.maxAllowedY= 255;
680 679
							numOfUnknownOptions--;
681 680
						}
681
					}
682 682
				}
683 683
				else if(filters[i].mask == TEMP_NOISE_FILTER)
684 684
				{
......
704 704
				else if(filters[i].mask == V_DEBLOCK || filters[i].mask == H_DEBLOCK)
705 705
				{
706 706
					int o;
707
					ppMode.maxDcDiff=1;
708
//					hFlatnessThreshold= 40;
709
//					vFlatnessThreshold= 40;
707 710

  
708 711
					for(o=0; options[o]!=NULL && o<2; o++)
709 712
					{
......
712 715
						if(tail==options[o]) break;
713 716

  
714 717
						numOfUnknownOptions--;
715
						if(o==0)
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
						}  
718
						if(o==0) ppMode.maxDcDiff= val;
725 719
						else hFlatnessThreshold=
726 720
						     vFlatnessThreshold= val;
727 721
					}
......
800 794
	ppMode.maxTmpNoise[0]= 700;
801 795
	ppMode.maxTmpNoise[1]= 1500;
802 796
	ppMode.maxTmpNoise[2]= 3000;
797
	ppMode.maxAllowedY= 234;
798
	ppMode.minAllowedY= 16;
799
	ppMode.maxDcDiff= 1;
803 800

  
804 801
#ifdef HAVE_ODIVX_POSTPROCESS
805 802
// Note: I could make this shit outside of this file, but it would mean one

Also available in: Unified diff