iparam*=1000;
int videoCodecConfigureAVI(  char *cmdString,uint32_t optSize, uint8_t *opt){	COMPRES_PARAMS *param;#define UNSET_COMPRESSION_MODE (COMPRESSION_MODE)0xff#define NO_COMPRESSION_MODE    (COMPRESSION_MODE)0xfe		int  iparam,equal=0xfff;		COMPRESSION_MODE compmode=UNSET_COMPRESSION_MODE;		char *cs = cmdString;		char *go = cmdString;		while( *go ){			// search the =			for(unsigned int i=0;i<strlen(cs);i++)			{				if(*(cs+i)=='=')				{						equal=i;						break;				}			}			if(equal==0xfff)			{				printf("\n I did not understand the args for video conf.\n");				return 0;			}			go = cs+equal+1;			*(cs+equal)=0;			iparam=atoi(cs+equal+1);			printf("codec conf is %s\n",cs);			// search the codec			if(!strcasecmp(cs,"cq"))				{						compmode=COMPRESS_CQ;						aprintf("cq Mode\n");				}			if(!strcasecmp(cs,"cbr"))				{						compmode=COMPRESS_CBR;						iparam*=1000;						aprintf("cbr Mode\n");				}			if(!strcasecmp(cs,"2pass"))				{						compmode=COMPRESS_2PASS;						aprintf("2pass\n");				}			if(!strcasecmp(cs,"follow"))				{						compmode=COMPRESS_SAME;						aprintf("Follow mode\n");				}			// search for other options			if(!strcasecmp(cs,"mbr")){			   compmode = NO_COMPRESSION_MODE;			   iparam = (iparam*1000)>>3;			   switch( current_codec ){			      case CodecSVCD:			         SVCDExtra.maxBitrate = (int)iparam;			         break;			      case CodecDVD:			         DVDExtra.maxBitrate = (int)iparam;			         break;			      default:			         break;			   }			}			if(!strcasecmp(cs,"matrix")){			   compmode = NO_COMPRESSION_MODE;			   switch( current_codec ){			      case CodecSVCD:			         SVCDExtra.user_matrix = (int)iparam;			         break;			      case CodecDVD:			         DVDExtra.user_matrix = (int)iparam;			         break;			      default:			         break;			   }			}			if(compmode==UNSET_COMPRESSION_MODE)			{				printf("\n ***** Unknown mode for video codec (%s)\n",cmdString);				return 0;			}			if( compmode != NO_COMPRESSION_MODE ){				aprintf("param:%d\n",iparam);				setVideoEncoderSettings(compmode, iparam,optSize,opt);			}			// find next option			for(;*go != '\0';go++){                                if( *go == ',' ){					cs = go + 1;					break;                                }                        }		}		return 1;}