def ScoreCpuPsnr(target_bitrate, result):

  # There are cases where we don't know a target bitrate.
  # Return a negative score for these.
  if target_bitrate == 0.0:
    return -1.0
  score = result['psnr']
  # We penalize bitrates that exceed the target bitrate.
  # Score reduction is 0.1 dB per percentage point over target.
  if result['bitrate'] > int(target_bitrate):
    percent_overshoot = 100.0 * ((result['bitrate'] - float(target_bitrate))
        / float(target_bitrate))
    score -= 0.1 * percent_overshoot
  # We penalize CPU usage that exceeds clip time.
  used_time = result['encode_cputime']
  available_time = result['cliptime']

  if used_time > available_time:
    badness = (used_time - available_time) / available_time
    score -= badness * 100
  return score
Returns the score relevant to interactive usage.
dataset/ETHPy150Open google/compare-codecs/lib/score_tools.py/ScoreCpuPsnr