(&mut self, quality: Quality)
| 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() }; |
nothing calls this directly
no test coverage detected