Index: webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py |
diff --git a/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py b/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..50ee17252d482c99979ea43a983a562ba74208a1 |
--- /dev/null |
+++ b/webrtc/modules/audio_processing/test/py_quality_assessment/quality_assessment/eval_scores.py |
@@ -0,0 +1,59 @@ |
+# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
+# |
+# Use of this source code is governed by a BSD-style license |
+# that can be found in the LICENSE file in the root of the source |
+# tree. An additional intellectual property rights grant can be found |
+# in the file PATENTS. All contributing project authors may |
+# be found in the AUTHORS file in the root of the source tree. |
+ |
+class EvaluationScore(object): |
+ |
+ NAME = None |
+ |
ivoc
2017/02/24 14:41:47
Remove empty line please.
AleBzk
2017/03/01 09:07:12
Acknowledged.
|
+ REGISTERED_CLASSES = {} |
+ |
+ def __init__(self): |
+ pass |
+ |
+ @classmethod |
+ def register_class(cls, class_to_register): |
+ """ |
+ Decorator with which automatically register the classes that extend |
ivoc
2017/02/24 14:41:47
I would rephrase as: Decorator to automatically ..
AleBzk
2017/03/01 09:07:12
Acknowledged.
|
+ NoiseGenerator. |
+ """ |
+ cls.REGISTERED_CLASSES[class_to_register.NAME] = class_to_register |
+ |
+ |
+@EvaluationScore.register_class |
+class AudioLevelScore(EvaluationScore): |
+ """ |
+ Compute the difference between the average audio level of the tested and |
+ the reference signals. |
+ |
+ Unit: dB |
+ Ideal: 0 dB |
+ Worst case: +/-inf dB |
+ """ |
+ |
+ NAME = 'audio_level' |
+ |
+ def __init__(self): |
+ super().__init__() |
+ |
+ |
+@EvaluationScore.register_class |
+class PolqaScore(EvaluationScore): |
+ """ |
+ Compute the POLQA score. It requires that the POLQA_PATH environment variable |
+ points to the PolqaOem64 executable. |
+ |
+ Unit: MOS |
+ Ideal: 4.5 |
+ Worst case: 1.0 |
+ """ |
+ |
+ NAME = 'polqa' |
+ |
+ def __init__(self): |
+ super().__init__() |
+ |