File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
- use std:: cmp:: min;
2
1
use std:: collections:: BTreeMap ;
3
2
use std:: io:: stderr;
4
3
use std:: sync:: { mpsc, Arc , Mutex } ;
@@ -483,15 +482,15 @@ fn compare_videos_inner<D: Decoder + 'static, E: Decoder + 'static>(
483
482
} ;
484
483
485
484
let mut results = BTreeMap :: new ( ) ;
486
- let mut avg = 0f64 ;
485
+ let mut rolling_mean = 0f64 ;
487
486
for score in result_rx {
488
487
if verbose {
489
488
println ! ( "Frame {}: {:.8}" , score. 0 , score. 1 ) ;
490
489
}
491
490
492
491
results. insert ( score. 0 , score. 1 ) ;
493
- avg = avg + ( score. 1 - avg ) / ( min ( results. len ( ) , 10 ) as f64 ) ;
494
- progress. set_message ( format ! ( ", avg : {:.1$}" , avg , 2 ) ) ;
492
+ rolling_mean = rolling_mean + ( score. 1 - rolling_mean ) / ( results. len ( ) as f64 ) ;
493
+ progress. set_message ( format ! ( ", mean : {rolling_mean:.2}" ) ) ;
495
494
progress. inc ( 1 ) ;
496
495
}
497
496
You can’t perform that action at this time.
0 commit comments