forge
Explore
Log in

Don't you dare go Hollow

Update silk dispatch delay

Browse files at this commit

43dd76be34fbf956b11622d74836c96d8a30593cAhmet Kaan GümüşParent: 80636c6
  • test
    • update silk dispatch delay
Show full message
test(ec-opus): update silk dispatch delay
crates/ec-opus/src/encoder.rsmodified+7 -5
@@ -700,10 +700,10 @@ mod tests {
700700 assert_eq!(e.look_ahead(960), 60);
701701 }
702702
703- /// `look_ahead` must use the same mono/10-or-20 ms-frame predicate
704- /// dispatch does (`silk_choice`/`hybrid_choice`), not just `wants_silk`:
705- /// 2.5/5 ms frames and stereo still code as CELT, while mono 10 ms
706- /// speech follows SILK.
703+ /// `look_ahead` must use the same 10-or-20 ms-frame predicate dispatch
704+ /// does (`silk_choice`/`hybrid_choice`), not just `wants_silk`: 2.5/5 ms
705+ /// frames still code as CELT, while 10/20 ms speech follows SILK and
706+ /// hybrid follows CELT's overlap.
707707 #[test]
708708 fn look_ahead_matches_the_frame_size_dispatch_actually_uses() {
709709 let mut e = Encoder::new(48000, 1, Application::Voip).unwrap();
@@ -720,6 +720,8 @@ mod tests {
720720
721721 let mut e = Encoder::new(48000, 2, Application::Voip).unwrap();
722722 e.set_bitrate(8000);
723- assert_eq!(e.look_ahead(960), 120, "stereo never codes as SILK/Hybrid");
723+ assert_eq!(e.look_ahead(960), 58, "stereo 20ms NB SILK");
724+ e.set_bitrate(64_000);
725+ assert_eq!(e.look_ahead(960), 120, "stereo 20ms hybrid");
724726 }
725727 }