MCPcopy Create free account
hub / github.com/Proryanator/encoder-benchmark / check_encode_quality

Function check_encode_quality

engine/src/permutation_engine.rs:273–303  ·  view source on GitHub ↗
(
    p: &mut Permutation,
    ctrl_channel: &Result<Receiver<()>, Error>,
    verbose: bool,
    perm_num: usize,
)

Source from the content-addressed store, hash-verified

271}
272
273fn check_encode_quality(
274 p: &mut Permutation,
275 ctrl_channel: &Result<Receiver<()>, Error>,
276 verbose: bool,
277 perm_num: usize,
278) -> Option<c_float> {
279 let mut quality_val = None;
280 for attempt in 0..MAX_ATTEMPTS_CALC_QUALITY {
281 if verbose {
282 print!("[ ATTEMPT {}/{} ] ", attempt + 1, MAX_ATTEMPTS_CALC_QUALITY);
283 }
284 quality_val = calc_vmaf_score(p, &ctrl_channel, verbose, attempt, perm_num);
285 match quality_val {
286 Some(val) => {
287 quality_val = Some(val);
288 break;
289 }
290
291 None => println!("Check encode quality failed. Retrying..."),
292 }
293 }
294
295 if quality_val.is_none() {
296 panic!(
297 "Error, Failed to calc encode quality after {} attempts",
298 MAX_ATTEMPTS_CALC_QUALITY
299 );
300 }
301
302 return quality_val;
303}
304
305fn will_be_duplicate(duplicates: &Vec<PermutationResult>, next_permutation: &Permutation) -> bool {
306 for dup in duplicates {

Callers 1

runMethod · 0.85

Calls 1

calc_vmaf_scoreFunction · 0.85

Tested by

no test coverage detected