--- branches/dev-api-4/xvidcore/vfw/src/codec.c 2003/12/01 13:16:43 1234 +++ branches/dev-api-4/xvidcore/vfw/src/codec.c 2003/12/17 15:16:16 1267 @@ -285,7 +285,7 @@ * builds and that activates lot of other debug printfs. We only * want these all the time */ char buf[1024]; - sprintf(buf, "[%5i] type=%c Q:%2i length:%6i", + sprintf(buf, "[%6i] type=%c Q:%2i length:%6i", data->frame_num, type2char(data->type), data->quant, @@ -384,7 +384,7 @@ pass2.max_overflow_improvement = codec->config.twopass_max_overflow_improvement; pass2.max_overflow_degradation = codec->config.twopass_max_overflow_degradation; pass2.kfreduction = codec->config.kfreduction; - pass2.min_key_interval = codec->config.min_key_interval; + pass2.kfthreshold = codec->config.kfthreshold; pass2.container_frame_overhead = 24; /* AVI */ plugins[create.num_plugins].func = xvid_plugin_2pass2; @@ -489,9 +489,11 @@ int i; for (i=0; inum_zones && config->zones[i].frame <= framenum; i++) ; - i--; - frame->type = config->zones[i].type; + if (--i < 0) return; /* there are no zones, or we're before the first zone */ + + if (framenum == config->zones[i].frame) + frame->type = config->zones[i].type; if (config->zones[i].greyscale) { frame->vop_flags |= XVID_VOP_GREYSCALE; @@ -555,6 +557,28 @@ if ((profiles[codec->config.profile].flags & PROFILE_INTERLACE) && codec->config.interlacing) frame.vol_flags |= XVID_VOL_INTERLACING; + if (codec->config.display_aspect_ratio !=0) { + int ar_x; + int ar_y; + + if (codec->config.display_aspect_ratio == 1) { + ar_x = 4; + ar_y = 3; + } + if (codec->config.display_aspect_ratio == 2) { + ar_x = 16; + ar_y = 9; + } + + /* custom pixel aspect ratio -> calculated from DAR */ + frame.par = XVID_PAR_EXT; + frame.par_width = (100 * inhdr->biHeight) / ar_y; + frame.par_height= (100 * inhdr->biWidth) / ar_x; + } else { + /* assuming defaults for now... */ + frame.par = XVID_PAR_11_VGA; + } + /* vop stuff */ frame.vop_flags |= XVID_VOP_HALFPEL;