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

Method set_quality

libs/scrap/src/common/aom.rs:276–289  ·  view source on GitHub ↗
(&mut self, quality: Quality)

Source from the content-addressed store, hash-verified

274 }
275
276 fn set_quality(&mut self, quality: Quality) -> ResultType<()> {
277 let mut c = unsafe { *self.ctx.config.enc.to_owned() };
278 let (q_min, q_max, b) = Self::convert_quality(quality);
279 if q_min > 0 && q_min < q_max && q_max < 64 {
280 c.rc_min_quantizer = q_min;
281 c.rc_max_quantizer = q_max;
282 }
283 let bitrate = base_bitrate(self.width as _, self.height as _) * b / 100;
284 if bitrate > 0 {
285 c.rc_target_bitrate = bitrate;
286 }
287 call_aom!(aom_codec_enc_config_set(&mut self.ctx, &c));
288 Ok(())
289 }
290
291 fn bitrate(&self) -> u32 {
292 let c = unsafe { *self.ctx.config.enc.to_owned() };

Callers

nothing calls this directly

Calls 1

base_bitrateFunction · 0.85

Tested by

no test coverage detected