ref: 7db26934e4156597cb0586bb4d2e44dccdde1a59
parent: ff6dea5e1a72b8a2aeb7fc3656857d86a420ab89
author: Jan Buethe <jan.buethe@gmx.net>
date: Wed Oct 16 06:51:45 EDT 2024
fix for buffer size calculation in osce.c update to osce evaluation script
--- a/dnn/osce.c
+++ b/dnn/osce.c
@@ -110,7 +110,7 @@
int arch
)
{
- float input_buffer[4 * IMAX(LACE_COND_DIM, LACE_HIDDEN_FEATURE_DIM)];
+ float input_buffer[IMAX(4 * IMAX(LACE_COND_DIM, LACE_HIDDEN_FEATURE_DIM), LACE_NUM_FEATURES + LACE_PITCH_EMBEDDING_DIM + 2*LACE_NUMBITS_EMBEDDING_DIM)];
float output_buffer[4 * IMAX(LACE_COND_DIM, LACE_HIDDEN_FEATURE_DIM)];
float numbits_embedded[2 * LACE_NUMBITS_EMBEDDING_DIM];
int i_subframe;
--- a/dnn/torch/osce/stndrd/evaluation/run_osce_test.py
+++ b/dnn/torch/osce/stndrd/evaluation/run_osce_test.py
@@ -15,6 +15,7 @@
parser.add_argument('outputdir', type=str, help='Output folder')
parser.add_argument('bitrate', type=int, help='bitrate to test')
parser.add_argument('--reference_opus_demo', type=str, default='./opus_demo', help='reference opus_demo binary for generating bitstreams and reference output')
+parser.add_argument('--encoder_options', type=str, default="", help='encoder options (e.g. -complexity 5)')
parser.add_argument('--test_opus_demo', type=str, default='./opus_demo', help='opus_demo binary under test')
parser.add_argument('--test_opus_demo_options', type=str, default='-dec_complexity 7', help='options for test opus_demo (e.g. "-dec_complexity 7")')
parser.add_argument('--verbose', type=int, default=0, help='verbosity level: 0 for quiet (default), 1 for reporting individual test results, 2 for reporting per-item scores in failed tests')
@@ -94,7 +95,7 @@
except:
return 1
-def process_clip_factory(ref_opus_demo, test_opus_demo, test_options):
+def process_clip_factory(ref_opus_demo, test_opus_demo, enc_options, test_options):
def process_clip(clip_path, processdir, bitrate):
# derive paths
clipname = os.path.splitext(os.path.split(clip_path)[1])[0]
@@ -107,7 +108,7 @@
sox(clip_path, pcm_path)
# run encoder
- run_opus_encoder(ref_opus_demo, pcm_path, bitstream_path, "voip", 16000, 1, bitrate)
+ run_opus_encoder(ref_opus_demo, pcm_path, bitstream_path, "voip", 16000, 1, bitrate, enc_options)
# run decoder
run_opus_decoder(ref_opus_demo, bitstream_path, ref_path, 16000, 1)
@@ -121,7 +122,7 @@
return process_clip
-def main(inputdir, outputdir, bitrate, reference_opus_demo, test_opus_demo, test_option_string, verbose):
+def main(inputdir, outputdir, bitrate, reference_opus_demo, test_opus_demo, enc_option_string, test_option_string, verbose):
# load clips list
with open(os.path.join(inputdir, 'clips.yml'), "r") as f:
@@ -128,9 +129,10 @@
clips = yaml.safe_load(f)
# parse test options
+ enc_options = enc_option_string.split()
test_options = test_option_string.split()
- process_clip = process_clip_factory(reference_opus_demo, test_opus_demo, test_options)
+ process_clip = process_clip_factory(reference_opus_demo, test_opus_demo, enc_options, test_options)
os.makedirs(outputdir, exist_ok=True)
processdir = os.path.join(outputdir, 'process')
@@ -189,5 +191,6 @@
args.bitrate,
args.reference_opus_demo,
args.test_opus_demo,
+ args.encoder_options,
args.test_opus_demo_options,
args.verbose)
--
⑨