[svn] / branches / dev-api-3 / vfw / src / 2pass.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/vfw/src/2pass.c

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

revision 343, Sat Jul 27 21:38:19 2002 UTC revision 365, Wed Aug 7 06:13:18 2002 UTC
# Line 930  Line 930 
930    
931          twopass->desired_bytes2 = bytes2;          twopass->desired_bytes2 = bytes2;
932    
933          if (frame->intra)          // if this keyframe is too close to the next,
934            // reduce it's byte allotment
935            if (frame->intra && !credits_pos)
936          {          {
937                  KFdistance = codec->twopass.keyframe_locations[codec->twopass.KF_idx] -                  KFdistance = codec->twopass.keyframe_locations[codec->twopass.KF_idx] -
938                          codec->twopass.keyframe_locations[codec->twopass.KF_idx - 1];                          codec->twopass.keyframe_locations[codec->twopass.KF_idx - 1];
# Line 1135  Line 1137 
1137                          codec->twopass.quant_count[frame->quant]++;                          codec->twopass.quant_count[frame->quant]++;
1138                          if ((codec->twopass.nns1.quant & NNSTATS_KEYFRAME))                          if ((codec->twopass.nns1.quant & NNSTATS_KEYFRAME))
1139                          {                          {
1140                                    // calculate how much to distribute per frame in
1141                                    // order to make up for this keyframe's overflow
1142    
1143                                  codec->twopass.overflow += codec->twopass.KFoverflow;                                  codec->twopass.overflow += codec->twopass.KFoverflow;
1144                                  codec->twopass.KFoverflow = codec->twopass.desired_bytes2 - frame->length;                                  codec->twopass.KFoverflow = codec->twopass.desired_bytes2 - frame->length;
1145    
# Line 1157  Line 1162 
1162                          }                          }
1163                          else                          else
1164                          {                          {
1165                                    // distribute part of the keyframe overflow
1166    
1167                                  codec->twopass.overflow += codec->twopass.desired_bytes2 - frame->length +                                  codec->twopass.overflow += codec->twopass.desired_bytes2 - frame->length +
1168                                          codec->twopass.KFoverflow_partial;                                          codec->twopass.KFoverflow_partial;
1169                                  codec->twopass.KFoverflow -= codec->twopass.KFoverflow_partial;                                  codec->twopass.KFoverflow -= codec->twopass.KFoverflow_partial;

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

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