Commit 774b0d1 1 parent f4c00d2 commit 774b0d1 Copy full SHA for 774b0d1
File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -569,6 +569,7 @@ pub struct FrameInvariants {
569
569
pub me_range_scale : u8 ,
570
570
pub use_tx_domain_distortion : bool ,
571
571
pub inter_cfg : Option < InterPropsConfig > ,
572
+ pub enable_early_exit : bool ,
572
573
}
573
574
574
575
impl FrameInvariants {
@@ -642,6 +643,7 @@ impl FrameInvariants {
642
643
me_range_scale : 1 ,
643
644
use_tx_domain_distortion : use_tx_domain_distortion,
644
645
inter_cfg : None ,
646
+ enable_early_exit : true ,
645
647
}
646
648
}
647
649
@@ -2422,7 +2424,7 @@ fn encode_partition_bottomup(
2422
2424
2423
2425
if cost != std:: f64:: MAX {
2424
2426
rd_cost += cost;
2425
- if rd_cost >= best_rd || rd_cost >= ref_rd_cost {
2427
+ if fi . enable_early_exit && ( rd_cost >= best_rd || rd_cost >= ref_rd_cost) {
2426
2428
assert ! ( cost != std:: f64 :: MAX ) ;
2427
2429
early_exit = true ;
2428
2430
if partition == PartitionType :: PARTITION_SPLIT { break ; }
Original file line number Diff line number Diff line change @@ -970,7 +970,6 @@ pub fn rdo_partition_decision(
970
970
let mut best_partition = cached_block. part_type ;
971
971
let mut best_rd = cached_block. rd_cost ;
972
972
let mut best_pred_modes = cached_block. part_modes . clone ( ) ;
973
- let mut early_exit;
974
973
975
974
let cw_checkpoint = cw. checkpoint ( ) ;
976
975
let w_pre_checkpoint = w_pre_cdef. checkpoint ( ) ;
@@ -981,9 +980,9 @@ pub fn rdo_partition_decision(
981
980
if partition == cached_block. part_type {
982
981
continue ;
983
982
}
984
- early_exit = false ;
985
983
let mut cost: f64 = 0.0 ;
986
984
let mut child_modes = std:: vec:: Vec :: new ( ) ;
985
+ let mut early_exit = false ;
987
986
988
987
match partition {
989
988
PartitionType :: PARTITION_NONE => {
@@ -1050,7 +1049,7 @@ pub fn rdo_partition_decision(
1050
1049
1051
1050
rd_cost_sum += mode_decision. rd_cost ;
1052
1051
1053
- if rd_cost_sum > best_rd {
1052
+ if fi . enable_early_exit && rd_cost_sum > best_rd {
1054
1053
early_exit = true ;
1055
1054
break ;
1056
1055
}
You can’t perform that action at this time.
0 commit comments