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

Method add_result

engine/src/permutation_engine.rs:139–164  ·  view source on GitHub ↗
(
        &mut self,
        result: PermutationResult,
        is_bitrate_permutation_over: bool,
        is_checking_quality: bool,
        allow_duplicates: bool,
    )

Source from the content-addressed store, hash-verified

137 }
138
139 fn add_result(
140 &mut self,
141 result: PermutationResult,
142 is_bitrate_permutation_over: bool,
143 is_checking_quality: bool,
144 allow_duplicates: bool,
145 ) {
146 // only do this duplicate mapping during the first bitrate permutation
147 // notice how we do not add this for overloaded results
148 if !allow_duplicates
149 && is_checking_quality
150 && !result.was_overloaded
151 && !is_bitrate_permutation_over
152 {
153 let score_str = result.vmaf_score.to_string();
154 if !self.vmaf_scores.contains(&score_str) {
155 self.results.push(result);
156 self.vmaf_scores.insert((*score_str).parse().unwrap());
157 } else {
158 self.dup_results.push(result);
159 }
160 } else {
161 // always keep results; any duplicates will be ignored already
162 self.results.push(result);
163 }
164 }
165}
166
167fn calc_vmaf_score(

Callers 1

runMethod · 0.80

Calls 1

to_stringMethod · 0.45

Tested by

no test coverage detected