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

Diff of /trunk/vfw/src/2pass.c

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

revision 342, Fri Jul 26 19:58:22 2002 UTC revision 343, Sat Jul 27 21:38:19 2002 UTC
# Line 710  Line 710 
710          int overflow;          int overflow;
711          int credits_pos;          int credits_pos;
712          int capped_to_max_framesize = 0;          int capped_to_max_framesize = 0;
713            int KFdistance, KF_min_size;
714    
715          if (codec->framenum == 0)          if (codec->framenum == 0)
716          {          {
# Line 929  Line 930 
930    
931          twopass->desired_bytes2 = bytes2;          twopass->desired_bytes2 = bytes2;
932    
933            if (frame->intra)
934            {
935                    KFdistance = codec->twopass.keyframe_locations[codec->twopass.KF_idx] -
936                            codec->twopass.keyframe_locations[codec->twopass.KF_idx - 1];
937    
938                    if (KFdistance < codec->config.kftreshold)
939                    {
940                            KFdistance = KFdistance - codec->config.min_key_interval;
941    
942                            if (KFdistance >= 0)
943                            {
944                                    KF_min_size = bytes2 * (100 - codec->config.kfreduction) / 100;
945                                    if (KF_min_size < 1)
946                                            KF_min_size = 1;
947    
948                                    bytes2 = KF_min_size + (bytes2 - KF_min_size) * KFdistance /
949                                            (codec->config.kftreshold - codec->config.min_key_interval);
950    
951                                    if (bytes2 < 1)
952                                            bytes2 = 1;
953                            }
954                    }
955            }
956    
957          // Foxer: scale overflow in relation to average size, so smaller frames don't get          // Foxer: scale overflow in relation to average size, so smaller frames don't get
958          // too much/little bitrate          // too much/little bitrate
959          overflow = (int)((double)overflow * bytes2 / twopass->average_frame);          overflow = (int)((double)overflow * bytes2 / twopass->average_frame);

Legend:
Removed from v.342  
changed lines
  Added in v.343

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