MCPcopy Create free account
hub / github.com/Recordscript/recordscript / base_bitrate

Function base_bitrate

libs/scrap/src/common/codec.rs:881–895  ·  view source on GitHub ↗
(width: u32, height: u32)

Source from the content-addressed store, hash-verified

879}
880
881pub fn base_bitrate(width: u32, height: u32) -> u32 {
882 #[allow(unused_mut)]
883 let mut base_bitrate = ((width * height) / 1000) as u32; // same as 1.1.9
884 if base_bitrate == 0 {
885 base_bitrate = 1920 * 1080 / 1000;
886 }
887 #[cfg(target_os = "android")]
888 {
889 // fix when android screen shrinks
890 let fix = crate::Display::fix_quality() as u32;
891 log::debug!("Android screen, fix quality:{}", fix);
892 base_bitrate = base_bitrate * fix;
893 }
894 base_bitrate
895}
896
897pub fn codec_thread_num(limit: usize) -> usize {
898 let max: usize = num_cpus::get();

Callers 8

newMethod · 0.85
set_qualityMethod · 0.85
newMethod · 0.85
set_qualityMethod · 0.85
newMethod · 0.85
set_qualityMethod · 0.85
enc_cfgFunction · 0.85
set_qualityMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected