[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 355, Thu Aug 1 12:56:29 2002 UTC revision 361, Mon Aug 5 18:26:31 2002 UTC
# Line 59  Line 59 
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_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 |
61          PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8          PMV_EARLYSTOP8 | PMV_HALFPELREFINE8 | PMV_HALFPELDIAMOND8
62    //      | PMV_USESQUARES16
63  };  };
64    
65  /*      return xvid compatbile colorspace,  /*      return xvid compatbile colorspace,
# Line 385  Line 386 
386          frame.intra = -1;          frame.intra = -1;
387    
388          frame.general |= XVID_HALFPEL;          frame.general |= XVID_HALFPEL;
389    //      frame.general |= XVID_ME_EPZS;
390    
391          if (codec->config.motion_search > 4)          if (codec->config.motion_search > 4)
392                  frame.general |= XVID_INTER4V;                  frame.general |= XVID_INTER4V;
# Line 395  Line 397 
397          if (codec->config.interlacing)          if (codec->config.interlacing)
398                  frame.general |= XVID_INTERLACING;                  frame.general |= XVID_INTERLACING;
399    
400  // added by koepi for gruel's greyscale_mode  // added by koepi for credits greyscale
401          if (codec->config.greyscale)          check_greyscale_mode(&codec->config, &frame, codec->framenum);
                 frame.general |= XVID_GREYSCALE;  
   
402  // end of koepi's addition  // end of koepi's addition
403    
404  // fix 1pass modes/hinted MV by koepi  // fix 1pass modes/hinted MV by koepi
# Line 740  Line 740 
740          case DLG_MODE_VBR_QUAL :          case DLG_MODE_VBR_QUAL :
741                  if (codec_is_in_credits(&codec->config, codec->framenum))                  if (codec_is_in_credits(&codec->config, codec->framenum))
742                  {                  {
743    // added by koepi for credits greyscale
744                            check_greyscale_mode(&codec->config, frame, codec->framenum);
745    // end of koepi's addition
746                          switch (codec->config.credits_mode)                          switch (codec->config.credits_mode)
747                          {                          {
748                          case CREDITS_MODE_RATE :                          case CREDITS_MODE_RATE :
# Line 757  Line 760 
760                  }                  }
761                  else                  else
762                  {                  {
763    // added by koepi for credits greyscale
764                            check_greyscale_mode(&codec->config, frame, codec->framenum);
765    // end of koepi's addition
766                          frame->quant = codec_get_vbr_quant(&codec->config, codec->config.quality);                          frame->quant = codec_get_vbr_quant(&codec->config, codec->config.quality);
767                  }                  }
768                  return ICERR_OK;                  return ICERR_OK;
# Line 764  Line 770 
770          case DLG_MODE_VBR_QUANT :          case DLG_MODE_VBR_QUANT :
771                  if (codec_is_in_credits(&codec->config, codec->framenum))                  if (codec_is_in_credits(&codec->config, codec->framenum))
772                  {                  {
773    // added by koepi for credits greyscale
774                            check_greyscale_mode(&codec->config, frame, codec->framenum);
775    // end of koepi's addition
776                          switch (codec->config.credits_mode)                          switch (codec->config.credits_mode)
777                          {                          {
778                          case CREDITS_MODE_RATE :                          case CREDITS_MODE_RATE :
# Line 783  Line 792 
792                  }                  }
793                  else                  else
794                  {                  {
795    // added by koepi for credits greyscale
796                            check_greyscale_mode(&codec->config, frame, codec->framenum);
797    // end of koepi's addition
798                          frame->quant = codec->config.quant;                          frame->quant = codec->config.quant;
799                  }                  }
800                  return ICERR_OK;                  return ICERR_OK;
801    
802          case DLG_MODE_2PASS_1 :          case DLG_MODE_2PASS_1 :
803    // added by koepi for credits greyscale
804                    check_greyscale_mode(&codec->config, frame, codec->framenum);
805    // end of koepi's addition
806                  if (codec->config.credits_mode == CREDITS_MODE_QUANT)                  if (codec->config.credits_mode == CREDITS_MODE_QUANT)
807                  {                  {
808                          if (codec_is_in_credits(&codec->config, codec->framenum))                          if (codec_is_in_credits(&codec->config, codec->framenum))
# Line 878  Line 893 
893          return quant;          return quant;
894  }  }
895    
896    // added by koepi for credits greyscale
897    int check_greyscale_mode(CONFIG* config, XVID_ENC_FRAME* frame, int framenum)
898    {
899            if ((codec_is_in_credits(config, framenum)) && (config->mode!=DLG_MODE_CBR))
900            {
901                    if (config->credits_greyscale)
902                    {
903                            if ((frame->general && XVID_GREYSCALE))  // use only if not already in greyscale
904                                    frame->general |= XVID_GREYSCALE;
905                    } else {
906                            if (!(frame->general && XVID_GREYSCALE))  // if movie is in greyscale, switch back
907                                    frame->general |= XVID_GREYSCALE;
908                    }
909            } else {
910                    if (config->greyscale)
911                    {
912                            if ((frame->general && XVID_GREYSCALE))  // use only if not already in greyscale
913                                    frame->general |= XVID_GREYSCALE;
914                    } else {
915                            if (!(frame->general && XVID_GREYSCALE))  // if credits is in greyscale, switch back
916                                    frame->general |= XVID_GREYSCALE;
917                    }
918            }
919            return 0;
920    }
921    // end of koepi's addition

Legend:
Removed from v.355  
changed lines
  Added in v.361

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