Update silk dispatch delay
Browse files at this commit43dd76be34fbf956b11622d74836c96d8a30593cParent: 80636c6- test
- update silk dispatch delay
1 changed file +7 -5
crates/ec-opus/src/encoder.rsmodified+7 -5
| @@ -700,10 +700,10 @@ mod tests { | ||
| 700 | 700 | assert_eq!(e.look_ahead(960), 60); |
| 701 | 701 | } |
| 702 | 702 | |
| 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. | |
| 707 | 707 | #[test] |
| 708 | 708 | fn look_ahead_matches_the_frame_size_dispatch_actually_uses() { |
| 709 | 709 | let mut e = Encoder::new(48000, 1, Application::Voip).unwrap(); |
| @@ -720,6 +720,8 @@ mod tests { | ||
| 720 | 720 | |
| 721 | 721 | let mut e = Encoder::new(48000, 2, Application::Voip).unwrap(); |
| 722 | 722 | 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"); | |
| 724 | 726 | } |
| 725 | 727 | } |