if(verbose) printf("%s::%s\n", filterToken, filterName);
if(verbose>1) printf("pp: %s::%s\n", filterToken, filterName);
struct PPMode getPPModeByNameAndQuality(char *name, int quality){	char temp[GET_MODE_BUFFER_SIZE];	char *p= temp;	char *filterDelimiters= ",";	char *optionDelimiters= ":";	struct PPMode ppMode= {0,0,0,0,0,0,{150,200,400}};	char *filterToken;	strncpy(temp, name, GET_MODE_BUFFER_SIZE);	if(verbose) printf("%s\n", name);	for(;;){		char *filterName;		int q= 1000000; //GET_PP_QUALITY_MAX;		int chrom=-1;		char *option;		char *options[OPTIONS_ARRAY_SIZE];		int i;		int filterNameOk=0;		int numOfUnknownOptions=0;		int enable=1; //does the user want us to enabled or disabled the filter		filterToken= strtok(p, filterDelimiters);		if(filterToken == NULL) break;		p+= strlen(filterToken) + 1; // p points to next filterToken		filterName= strtok(filterToken, optionDelimiters);		if(verbose) printf("%s::%s\n", filterToken, filterName);		if(*filterName == '-')		{			enable=0;			filterName++;		}		for(;;){ //for all options			option= strtok(NULL, optionDelimiters);			if(option == NULL) break;			if(verbose) printf(" option: %s\n", option);			if(!strcmp("autoq", option) || !strcmp("a", option)) q= quality;			else if(!strcmp("nochrom", option) || !strcmp("y", option)) chrom=0;			else if(!strcmp("chrom", option) || !strcmp("c", option)) chrom=1;			else			{				options[numOfUnknownOptions] = option;				numOfUnknownOptions++;			}			if(numOfUnknownOptions >= OPTIONS_ARRAY_SIZE-1) break;		}		options[numOfUnknownOptions] = NULL;		/* replace stuff from the replace Table */		for(i=0; replaceTable[2*i]!=NULL; i++)		{			if(!strcmp(replaceTable[2*i], filterName))			{				int newlen= strlen(replaceTable[2*i + 1]);				int plen;				int spaceLeft;				if(p==NULL) p= temp, *p=0; 	//last filter				else p--, *p=',';		//not last filter				plen= strlen(p);				spaceLeft= (int)p - (int)temp + plen;				if(spaceLeft + newlen  >= GET_MODE_BUFFER_SIZE)				{					ppMode.error++;					break;				}				memmove(p + newlen, p, plen+1);				memcpy(p, replaceTable[2*i + 1], newlen);				filterNameOk=1;			}		}		for(i=0; filters[i].shortName!=NULL; i++)		{//			printf("Compareing %s, %s, %s\n", filters[i].shortName,filters[i].longName, filterName);			if(   !strcmp(filters[i].longName, filterName)			   || !strcmp(filters[i].shortName, filterName))			{				ppMode.lumMode &= ~filters[i].mask;				ppMode.chromMode &= ~filters[i].mask;				filterNameOk=1;				if(!enable) break; // user wants to disable it				if(q >= filters[i].minLumQuality)					ppMode.lumMode|= filters[i].mask;				if(chrom==1 || (chrom==-1 && filters[i].chromDefault))					if(q >= filters[i].minChromQuality)						ppMode.chromMode|= filters[i].mask;				if(filters[i].mask == LEVEL_FIX)				{					int o;					ppMode.minAllowedY= 16;					ppMode.maxAllowedY= 234;					for(o=0; options[o]!=NULL; o++)					{						if(  !strcmp(options[o],"fullyrange")						   ||!strcmp(options[o],"f"))						{							ppMode.minAllowedY= 0;							ppMode.maxAllowedY= 255;							numOfUnknownOptions--;						}					}				}				else if(filters[i].mask == TEMP_NOISE_FILTER)				{					int o;					int numOfNoises=0;					ppMode.maxTmpNoise[0]= 150;					ppMode.maxTmpNoise[1]= 200;					ppMode.maxTmpNoise[2]= 400;					for(o=0; options[o]!=NULL; o++)					{						char *tail;						ppMode.maxTmpNoise[numOfNoises]=							strtol(options[o], &tail, 0);						if(tail!=options[o])						{							numOfNoises++;							numOfUnknownOptions--;							if(numOfNoises >= 3) break;						}					}				}				else if(filters[i].mask == V_DEBLOCK || filters[i].mask == H_DEBLOCK)				{					int o;					ppMode.maxDcDiff=1;//					hFlatnessThreshold= 40;//					vFlatnessThreshold= 40;					for(o=0; options[o]!=NULL && o<2; o++)					{						char *tail;						int val= strtol(options[o], &tail, 0);						if(tail==options[o]) break;						numOfUnknownOptions--;						if(o==0) ppMode.maxDcDiff= val;						else hFlatnessThreshold=						     vFlatnessThreshold= val;					}				}				else if(filters[i].mask == FORCE_QUANT)				{					int o;					ppMode.forcedQuant= 15;					for(o=0; options[o]!=NULL && o<1; o++)					{						char *tail;						int val= strtol(options[o], &tail, 0);						if(tail==options[o]) break;						numOfUnknownOptions--;						ppMode.forcedQuant= val;					}				}			}		}		if(!filterNameOk) ppMode.error++;		ppMode.error += numOfUnknownOptions;	}#ifdef HAVE_ODIVX_POSTPROCESS	if(ppMode.lumMode & H_DEBLOCK) ppMode.oldMode |= PP_DEBLOCK_Y_H;	if(ppMode.lumMode & V_DEBLOCK) ppMode.oldMode |= PP_DEBLOCK_Y_V;	if(ppMode.chromMode & H_DEBLOCK) ppMode.oldMode |= PP_DEBLOCK_C_H;	if(ppMode.chromMode & V_DEBLOCK) ppMode.oldMode |= PP_DEBLOCK_C_V;	if(ppMode.lumMode & DERING) ppMode.oldMode |= PP_DERING_Y;	if(ppMode.chromMode & DERING) ppMode.oldMode |= PP_DERING_C;#endif	if(verbose) printf("lumMode=%X, chromMode=%X\n", ppMode.lumMode, ppMode.chromMode);	return ppMode;}