[svn] / branches / dev-api-4 / xvidcore / vfw / src / codec.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/vfw/src/codec.c

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

revision 1193, Tue Oct 28 23:42:09 2003 UTC revision 1245, Sat Dec 6 14:54:00 2003 UTC
# Line 49  Line 49 
49    
50  #include <windows.h>  #include <windows.h>
51  #include <vfw.h>  #include <vfw.h>
52    #include <stdio.h>
53  #include "vfwext.h"  #include "vfwext.h"
54    
55  #include <xvid.h>  #include <xvid.h>
# Line 280  Line 281 
281                  {                  {
282                          xvid_plg_data_t *data = (xvid_plg_data_t *) param1;                          xvid_plg_data_t *data = (xvid_plg_data_t *) param1;
283    
284                          DPRINTF("[%5i]   type=%c   Q:%2i   length:%6i",                          /* We don't use DPRINTF here because it's active only for _DEBUG
285                             * builds and that activates lot of other debug printfs. We only
286                             * want these all the time */
287                            char buf[1024];
288                            sprintf(buf, "[%5i]   type=%c   Q:%2i   length:%6i",
289                                     data->frame_num,                                     data->frame_num,
290                     type2char(data->type),                     type2char(data->type),
291                     data->quant,                     data->quant,
292                     data->length);                     data->length);
293                            OutputDebugString(buf);
294    
295                          return 0;                          return 0;
296                  }                  }
297          }          }
# Line 371  Line 378 
378                  pass2.filename = codec->config.stats;                  pass2.filename = codec->config.stats;
379    
380          pass2.keyframe_boost = codec->config.keyframe_boost;   /* keyframe boost percentage: [0..100...]; */          pass2.keyframe_boost = codec->config.keyframe_boost;   /* keyframe boost percentage: [0..100...]; */
         pass2.payback_method = codec->config.bitrate_payback_method;  
         pass2.bitrate_payback_delay = codec->config.bitrate_payback_delay;  
381          pass2.curve_compression_high = codec->config.curve_compression_high;          pass2.curve_compression_high = codec->config.curve_compression_high;
382          pass2.curve_compression_low = codec->config.curve_compression_low;          pass2.curve_compression_low = codec->config.curve_compression_low;
383                    pass2.overflow_control_strength = codec->config.overflow_control_strength;
384          pass2.max_overflow_improvement = codec->config.twopass_max_overflow_improvement;          pass2.max_overflow_improvement = codec->config.twopass_max_overflow_improvement;
385          pass2.max_overflow_degradation = codec->config.twopass_max_overflow_degradation;          pass2.max_overflow_degradation = codec->config.twopass_max_overflow_degradation;
         pass2.kftreshold = codec->config.kftreshold;  
386              pass2.kfreduction = codec->config.kfreduction;              pass2.kfreduction = codec->config.kfreduction;
387          pass2.min_key_interval = codec->config.min_key_interval;          pass2.kfthreshold = codec->config.kfthreshold;
388          pass2.container_frame_overhead = 24;    /* AVI */          pass2.container_frame_overhead = 24;    /* AVI */
389    
390          plugins[create.num_plugins].func = xvid_plugin_2pass2;          plugins[create.num_plugins].func = xvid_plugin_2pass2;
# Line 484  Line 489 
489      int i;      int i;
490    
491      for (i=0; i<config->num_zones && config->zones[i].frame <= framenum; i++) ;      for (i=0; i<config->num_zones && config->zones[i].frame <= framenum; i++) ;
     i--;  
492    
493        if (--i < 0) return; /* there are no zones, or we're before the first zone */
494    
495        if (framenum == config->zones[i].frame)
496      frame->type = config->zones[i].type;      frame->type = config->zones[i].type;
497    
498      if (config->zones[i].greyscale) {      if (config->zones[i].greyscale) {
# Line 570  Line 577 
577    
578          if (codec->config.cartoon_mode) {          if (codec->config.cartoon_mode) {
579                  frame.vop_flags |= XVID_VOP_CARTOON;                  frame.vop_flags |= XVID_VOP_CARTOON;
 #if 0 /* Seems to cause crashes with P4 cpus */  
580                  frame.motion |= XVID_ME_DETECT_STATIC_MOTION;                  frame.motion |= XVID_ME_DETECT_STATIC_MOTION;
 #endif  
581          }          }
582    
583          frame.motion |= pmvfast_presets[codec->config.motion_search];          frame.motion |= pmvfast_presets[codec->config.motion_search];
# Line 634  Line 639 
639    
640          // force keyframe spacing in 2-pass 1st pass          // force keyframe spacing in 2-pass 1st pass
641          if (codec->config.motion_search == 0)          if (codec->config.motion_search == 0)
         {  
642                  frame.type = XVID_TYPE_IVOP;                  frame.type = XVID_TYPE_IVOP;
         }  
         else if (codec->keyspacing < codec->config.min_key_interval && codec->framenum)  
         {  
                 DPRINTF("current frame forced to p-frame");  
                 frame.type = XVID_TYPE_PVOP;  
         }  
643    
644      /* frame-based stuff */      /* frame-based stuff */
645      apply_zone_modifiers(&frame, &codec->config, codec->framenum);      apply_zone_modifiers(&frame, &codec->config, codec->framenum);

Legend:
Removed from v.1193  
changed lines
  Added in v.1245

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