[svn] / trunk / vfw / src / codec.c Repository:
ViewVC logotype

Diff of /trunk/vfw/src/codec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 324, Sun Jul 21 03:49:47 2002 UTC revision 364, Wed Aug 7 01:10:01 2002 UTC
# Line 56  Line 56 
56  int pmvfast_presets[7] = {  int pmvfast_presets[7] = {
57          0, PMV_QUICKSTOP16, PMV_EARLYSTOP16, PMV_EARLYSTOP16 | PMV_EARLYSTOP8,          0, PMV_QUICKSTOP16, PMV_EARLYSTOP16, PMV_EARLYSTOP16 | PMV_EARLYSTOP8,
58          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8,          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8,
59          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8,          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 | PMV_HALFPELDIAMOND8 |
60          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 |          PMV_ADVANCEDDIAMOND16, PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 |
61          PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8          PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8 | PMV_USESQUARES16
62  };  };
63    
64  /*      return xvid compatbile colorspace,  /*      return xvid compatbile colorspace,
# Line 385  Line 385 
385          frame.intra = -1;          frame.intra = -1;
386    
387          frame.general |= XVID_HALFPEL;          frame.general |= XVID_HALFPEL;
388    //      frame.general |= XVID_ME_EPZS;
389    
390    
391          if (codec->config.motion_search > 4)          if (codec->config.motion_search > 4)
392                  frame.general |= XVID_INTER4V;                  frame.general |= XVID_INTER4V;
# Line 394  Line 396 
396    
397          if (codec->config.interlacing)          if (codec->config.interlacing)
398                  frame.general |= XVID_INTERLACING;                  frame.general |= XVID_INTERLACING;
399    
400    
401    
402    // added by koepi for credits greyscale
403    
404            check_greyscale_mode(&codec->config, &frame, codec->framenum);
405    
406    // end of koepi's addition
407    
408    
409  // fix 1pass modes/hinted MV by koepi  // fix 1pass modes/hinted MV by koepi
410          if (codec->config.hinted_me && (codec->config.mode == DLG_MODE_CBR || codec->config.mode == DLG_MODE_VBR_QUAL || codec->config.mode == DLG_MODE_VBR_QUANT))          if (codec->config.hinted_me && (codec->config.mode == DLG_MODE_CBR || codec->config.mode == DLG_MODE_VBR_QUAL || codec->config.mode == DLG_MODE_VBR_QUANT))
411          {          {
# Line 733  Line 745 
745          case DLG_MODE_VBR_QUAL :          case DLG_MODE_VBR_QUAL :
746                  if (codec_is_in_credits(&codec->config, codec->framenum))                  if (codec_is_in_credits(&codec->config, codec->framenum))
747                  {                  {
748    // added by koepi for credits greyscale
749    
750                            check_greyscale_mode(&codec->config, frame, codec->framenum);
751    
752    // end of koepi's addition
753    
754                          switch (codec->config.credits_mode)                          switch (codec->config.credits_mode)
755                          {                          {
756                          case CREDITS_MODE_RATE :                          case CREDITS_MODE_RATE :
# Line 750  Line 768 
768                  }                  }
769                  else                  else
770                  {                  {
771    // added by koepi for credits greyscale
772    
773                            check_greyscale_mode(&codec->config, frame, codec->framenum);
774    
775    // end of koepi's addition
776    
777                          frame->quant = codec_get_vbr_quant(&codec->config, codec->config.quality);                          frame->quant = codec_get_vbr_quant(&codec->config, codec->config.quality);
778                  }                  }
779                  return ICERR_OK;                  return ICERR_OK;
# Line 757  Line 781 
781          case DLG_MODE_VBR_QUANT :          case DLG_MODE_VBR_QUANT :
782                  if (codec_is_in_credits(&codec->config, codec->framenum))                  if (codec_is_in_credits(&codec->config, codec->framenum))
783                  {                  {
784    // added by koepi for credits greyscale
785    
786                            check_greyscale_mode(&codec->config, frame, codec->framenum);
787    
788    // end of koepi's addition
789    
790                          switch (codec->config.credits_mode)                          switch (codec->config.credits_mode)
791                          {                          {
792                          case CREDITS_MODE_RATE :                          case CREDITS_MODE_RATE :
# Line 776  Line 806 
806                  }                  }
807                  else                  else
808                  {                  {
809    // added by koepi for credits greyscale
810    
811                            check_greyscale_mode(&codec->config, frame, codec->framenum);
812    
813    // end of koepi's addition
814    
815                          frame->quant = codec->config.quant;                          frame->quant = codec->config.quant;
816                  }                  }
817                  return ICERR_OK;                  return ICERR_OK;
818    
819          case DLG_MODE_2PASS_1 :          case DLG_MODE_2PASS_1 :
820    // added by koepi for credits greyscale
821    
822                    check_greyscale_mode(&codec->config, frame, codec->framenum);
823    
824    // end of koepi's addition
825    
826                  if (codec->config.credits_mode == CREDITS_MODE_QUANT)                  if (codec->config.credits_mode == CREDITS_MODE_QUANT)
827                  {                  {
828                          if (codec_is_in_credits(&codec->config, codec->framenum))                          if (codec_is_in_credits(&codec->config, codec->framenum))
# Line 871  Line 913 
913          return quant;          return quant;
914  }  }
915    
916    // added by koepi for credits greyscale
917    
918    int check_greyscale_mode(CONFIG* config, XVID_ENC_FRAME* frame, int framenum)
919    
920    {
921    
922            if ((codec_is_in_credits(config, framenum)) && (config->mode!=DLG_MODE_CBR))
923    
924            {
925    
926                    if (config->credits_greyscale)
927    
928                    {
929    
930                            if ((frame->general && XVID_GREYSCALE))  // use only if not already in greyscale
931    
932                                    frame->general |= XVID_GREYSCALE;
933    
934                    } else {
935    
936                            if (!(frame->general && XVID_GREYSCALE))  // if movie is in greyscale, switch back
937    
938                                    frame->general |= XVID_GREYSCALE;
939    
940                    }
941    
942            } else {
943    
944                    if (config->greyscale)
945    
946                    {
947    
948                            if ((frame->general && XVID_GREYSCALE))  // use only if not already in greyscale
949    
950                                    frame->general |= XVID_GREYSCALE;
951    
952                    } else {
953    
954                            if (!(frame->general && XVID_GREYSCALE))  // if credits is in greyscale, switch back
955    
956                                    frame->general |= XVID_GREYSCALE;
957    
958                    }
959    
960            }
961    
962            return 0;
963    
964    }
965    
966    // end of koepi's addition
967    

Legend:
Removed from v.324  
changed lines
  Added in v.364

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4