[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 1333, Mon Jan 26 03:16:53 2004 UTC revision 1346, Sat Jan 31 14:03:26 2004 UTC
# Line 346  Line 346 
346          return 0;          return 0;
347  }  }
348    
349    /* constant-quant zones for fixed quant encoding */
350  static void  static void
351  prepare_cquant_zones(CONFIG * config) {  prepare_cquant_zones(CONFIG * config) {
352    
# Line 378  Line 378 
378                  }                  }
379  }  }
380    
381    /* full first pass zones */
382    static void
383    prepare_full1pass_zones(CONFIG * config) {
384    
385            int i = 0;
386            if (config->num_zones == 0 || config->zones[0].frame != 0) {
387                    /* first zone does not start at frame 0 or doesn't exist */
388    
389                    if (config->num_zones >= MAX_ZONES) config->num_zones--; /* we scrifice last zone */
390    
391                    config->zones[config->num_zones].frame = 0;
392                    config->zones[config->num_zones].mode = RC_ZONE_QUANT;
393                    config->zones[config->num_zones].weight = 100;
394                    config->zones[config->num_zones].quant = 200;
395                    config->zones[config->num_zones].type = XVID_TYPE_AUTO;
396                    config->zones[config->num_zones].greyscale = 0;
397                    config->zones[config->num_zones].chroma_opt = 0;
398                    config->zones[config->num_zones].bvop_threshold = 0;
399                    config->num_zones++;
400    
401                    sort_zones(config->zones, config->num_zones, &i);
402            }
403    
404            /* step 2: let's change all weight zones into quant zones */
405    
406            for(i = 0; i < config->num_zones; i++)
407                    if (config->zones[i].mode == RC_ZONE_WEIGHT) {
408                            config->zones[i].mode = RC_ZONE_QUANT;
409                            config->zones[i].quant = 200;
410                    }
411    }
412    
413    
414  LRESULT compress_begin(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiOutput)  LRESULT compress_begin(CODEC * codec, BITMAPINFO * lpbiInput, BITMAPINFO * lpbiOutput)
415  {  {
# Line 431  Line 463 
463                  memset(&pass1, 0, sizeof(pass1));                  memset(&pass1, 0, sizeof(pass1));
464                  pass1.version = XVID_VERSION;                  pass1.version = XVID_VERSION;
465                  pass1.filename = codec->config.stats;                  pass1.filename = codec->config.stats;
466                    if (codec->config.full1pass)
467                            prepare_full1pass_zones(&tmpCfg);
468                  plugins[create.num_plugins].func = xvid_plugin_2pass1_func;                  plugins[create.num_plugins].func = xvid_plugin_2pass1_func;
469                  plugins[create.num_plugins].param = &pass1;                  plugins[create.num_plugins].param = &pass1;
470                  create.num_plugins++;                  create.num_plugins++;

Legend:
Removed from v.1333  
changed lines
  Added in v.1346

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