CVS: main/postproc postprocess.c,1.58,1.59
Update of /cvsroot/mplayer/main/postproc In directory mplayer:/var/tmp.root/cvs-serv17310/postproc Modified Files: postprocess.c Log Message: Added reverting support for -pp and -npp options Index: postprocess.c =================================================================== RCS file: /cvsroot/mplayer/main/postproc/postprocess.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- postprocess.c 19 Jan 2002 05:14:46 -0000 1.58 +++ postprocess.c 19 Jan 2002 17:01:03 -0000 1.59 @@ -75,6 +75,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <errno.h> #ifdef HAVE_MALLOC_H #include <malloc.h> #endif @@ -148,6 +149,7 @@ extern int divx_quality; int newPPFlag=0; //is set if -npp is used struct PPMode gPPMode[GET_PP_QUALITY_MAX+1]; +static int firstTime = 0, firstTime2 = 0; extern int verbose; @@ -759,7 +761,7 @@ /** * Check and load the -npp part of the cmd line */ -int readPPOpt(void *conf, char *arg) +int readNPPOpt(void *conf, char *arg) { int quality; @@ -778,10 +780,37 @@ newPPFlag=1; //divx_quality is passed to postprocess if autoq if off - divx_quality= GET_PP_QUALITY_MAX; + divx_quality= GET_PP_QUALITY_MAX; + firstTime = firstTime2 = 1; return 1; } +int readPPOpt(void *conf, char *arg) +{ + int val; + + if(arg == NULL) + return -2; // ERR_MISSING_PARAM + errno = 0; + val = (int)strtol(arg,NULL,0); + if(errno != 0) + return -4; // What about include cfgparser.h and use ERR_* defines */ + if(val < 0) + return -3; // ERR_OUT_OF_RANGE + + divx_quality = val; + firstTime = firstTime2 = 1; + + return 1; +} + +void revertPPOpt(void *conf, char* opt) +{ + newPPFlag=0; + divx_quality=0; +} + + /** * Obsolete, dont use it, use postprocess2() instead * this will check newPPFlag automatically and use postprocess2 if it is set @@ -795,7 +824,6 @@ { struct PPMode ppMode; static QP_STORE_T zeroArray[2048/8]; - static int firstTime=1; if(newPPFlag) { @@ -882,7 +910,6 @@ { QP_STORE_T quantArray[2048/8]; - static int firstTime=1; if(QP_store==NULL || (mode->lumMode & FORCE_QUANT)) { @@ -895,10 +922,10 @@ for(i=0; i<2048/8; i++) quantArray[i]= 1; } - if(firstTime && verbose) + if(firstTime2 && verbose) { printf("using npp filters 0x%X/0x%X\n", mode->lumMode, mode->chromMode); - firstTime=0; + firstTime2=0; } #ifdef HAVE_ODIVX_POSTPROCESS
participants (1)
-
Alban Bedel CVS