Mercurial > libavcodec.hg
comparison libpostproc/postprocess.c @ 202:fbe0398a7a4d libavcodec
dont print -npp parser debug info if only -v
print "using pp filters ..." if -v
author | michael |
---|---|
date | Sun, 13 Jan 2002 20:51:49 +0000 |
parents | 8fceccef5804 |
children | c2b6d68a0671 |
comparison
equal
deleted
inserted
replaced
201:91ed656e7339 | 202:fbe0398a7a4d |
---|---|
578 struct PPMode ppMode= {0,0,0,0,0,0,{150,200,400}}; | 578 struct PPMode ppMode= {0,0,0,0,0,0,{150,200,400}}; |
579 char *filterToken; | 579 char *filterToken; |
580 | 580 |
581 strncpy(temp, name, GET_MODE_BUFFER_SIZE); | 581 strncpy(temp, name, GET_MODE_BUFFER_SIZE); |
582 | 582 |
583 if(verbose) printf("%s\n", name); | 583 if(verbose>1) printf("pp: %s\n", name); |
584 | 584 |
585 for(;;){ | 585 for(;;){ |
586 char *filterName; | 586 char *filterName; |
587 int q= 1000000; //GET_PP_QUALITY_MAX; | 587 int q= 1000000; //GET_PP_QUALITY_MAX; |
588 int chrom=-1; | 588 int chrom=-1; |
595 | 595 |
596 filterToken= strtok(p, filterDelimiters); | 596 filterToken= strtok(p, filterDelimiters); |
597 if(filterToken == NULL) break; | 597 if(filterToken == NULL) break; |
598 p+= strlen(filterToken) + 1; // p points to next filterToken | 598 p+= strlen(filterToken) + 1; // p points to next filterToken |
599 filterName= strtok(filterToken, optionDelimiters); | 599 filterName= strtok(filterToken, optionDelimiters); |
600 if(verbose) printf("%s::%s\n", filterToken, filterName); | 600 if(verbose>1) printf("pp: %s::%s\n", filterToken, filterName); |
601 | 601 |
602 if(*filterName == '-') | 602 if(*filterName == '-') |
603 { | 603 { |
604 enable=0; | 604 enable=0; |
605 filterName++; | 605 filterName++; |
607 | 607 |
608 for(;;){ //for all options | 608 for(;;){ //for all options |
609 option= strtok(NULL, optionDelimiters); | 609 option= strtok(NULL, optionDelimiters); |
610 if(option == NULL) break; | 610 if(option == NULL) break; |
611 | 611 |
612 if(verbose) printf(" option: %s\n", option); | 612 if(verbose>1) printf("pp: option: %s\n", option); |
613 if(!strcmp("autoq", option) || !strcmp("a", option)) q= quality; | 613 if(!strcmp("autoq", option) || !strcmp("a", option)) q= quality; |
614 else if(!strcmp("nochrom", option) || !strcmp("y", option)) chrom=0; | 614 else if(!strcmp("nochrom", option) || !strcmp("y", option)) chrom=0; |
615 else if(!strcmp("chrom", option) || !strcmp("c", option)) chrom=1; | 615 else if(!strcmp("chrom", option) || !strcmp("c", option)) chrom=1; |
616 else | 616 else |
617 { | 617 { |
749 if(ppMode.chromMode & V_DEBLOCK) ppMode.oldMode |= PP_DEBLOCK_C_V; | 749 if(ppMode.chromMode & V_DEBLOCK) ppMode.oldMode |= PP_DEBLOCK_C_V; |
750 if(ppMode.lumMode & DERING) ppMode.oldMode |= PP_DERING_Y; | 750 if(ppMode.lumMode & DERING) ppMode.oldMode |= PP_DERING_Y; |
751 if(ppMode.chromMode & DERING) ppMode.oldMode |= PP_DERING_C; | 751 if(ppMode.chromMode & DERING) ppMode.oldMode |= PP_DERING_C; |
752 #endif | 752 #endif |
753 | 753 |
754 if(verbose) printf("lumMode=%X, chromMode=%X\n", ppMode.lumMode, ppMode.chromMode); | 754 if(verbose>1) printf("pp: lumMode=%X, chromMode=%X\n", ppMode.lumMode, ppMode.chromMode); |
755 return ppMode; | 755 return ppMode; |
756 } | 756 } |
757 | 757 |
758 /** | 758 /** |
759 * Check and load the -npp part of the cmd line | 759 * Check and load the -npp part of the cmd line |
792 QP_STORE_T *QP_store, int QP_stride, | 792 QP_STORE_T *QP_store, int QP_stride, |
793 int mode) | 793 int mode) |
794 { | 794 { |
795 struct PPMode ppMode; | 795 struct PPMode ppMode; |
796 static QP_STORE_T zeroArray[2048/8]; | 796 static QP_STORE_T zeroArray[2048/8]; |
797 static int firstTime=1; | |
797 | 798 |
798 if(newPPFlag) | 799 if(newPPFlag) |
799 { | 800 { |
800 ppMode= gPPMode[mode]; | 801 ppMode= gPPMode[mode]; |
801 // printf("%d \n",QP_store[5]); | 802 // printf("%d \n",QP_store[5]); |
802 postprocess2(src, src_stride, dst, dst_stride, | 803 postprocess2(src, src_stride, dst, dst_stride, |
803 horizontal_size, vertical_size, QP_store, QP_stride, &ppMode); | 804 horizontal_size, vertical_size, QP_store, QP_stride, &ppMode); |
804 | 805 |
805 return; | 806 return; |
806 } | 807 } |
807 | 808 |
809 if(firstTime && verbose) | |
810 { | |
811 printf("using pp filters 0x%X\n", mode); | |
812 firstTime=0; | |
813 } | |
814 | |
808 if(QP_store==NULL) | 815 if(QP_store==NULL) |
809 { | 816 { |
810 QP_store= zeroArray; | 817 QP_store= zeroArray; |
811 QP_stride= 0; | 818 QP_stride= 0; |
812 } | 819 } |
872 QP_STORE_T *QP_store, int QP_stride, | 879 QP_STORE_T *QP_store, int QP_stride, |
873 struct PPMode *mode) | 880 struct PPMode *mode) |
874 { | 881 { |
875 | 882 |
876 QP_STORE_T quantArray[2048/8]; | 883 QP_STORE_T quantArray[2048/8]; |
884 static int firstTime=1; | |
885 | |
877 if(QP_store==NULL || (mode->lumMode & FORCE_QUANT)) | 886 if(QP_store==NULL || (mode->lumMode & FORCE_QUANT)) |
878 { | 887 { |
879 int i; | 888 int i; |
880 QP_store= quantArray; | 889 QP_store= quantArray; |
881 QP_stride= 0; | 890 QP_stride= 0; |
882 if(mode->lumMode & FORCE_QUANT) | 891 if(mode->lumMode & FORCE_QUANT) |
883 for(i=0; i<2048/8; i++) quantArray[i]= mode->forcedQuant; | 892 for(i=0; i<2048/8; i++) quantArray[i]= mode->forcedQuant; |
884 else | 893 else |
885 for(i=0; i<2048/8; i++) quantArray[i]= 1; | 894 for(i=0; i<2048/8; i++) quantArray[i]= 1; |
895 } | |
896 | |
897 if(firstTime && verbose) | |
898 { | |
899 printf("using npp filters 0x%X/0x%X\n", mode->lumMode, mode->chromMode); | |
900 firstTime=0; | |
886 } | 901 } |
887 | 902 |
888 #ifdef HAVE_ODIVX_POSTPROCESS | 903 #ifdef HAVE_ODIVX_POSTPROCESS |
889 // Note: I could make this shit outside of this file, but it would mean one | 904 // Note: I could make this shit outside of this file, but it would mean one |
890 // more function call... | 905 // more function call... |