Skip to content

Commit 7db2693

Browse files
fix for buffer size calculation in osce.c
update to osce evaluation script
1 parent ff6dea5 commit 7db2693

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

dnn/osce.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static void lace_feature_net(
110110
int arch
111111
)
112112
{
113-
float input_buffer[4 * IMAX(LACE_COND_DIM, LACE_HIDDEN_FEATURE_DIM)];
113+
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)];
114114
float output_buffer[4 * IMAX(LACE_COND_DIM, LACE_HIDDEN_FEATURE_DIM)];
115115
float numbits_embedded[2 * LACE_NUMBITS_EMBEDDING_DIM];
116116
int i_subframe;

dnn/torch/osce/stndrd/evaluation/run_osce_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
parser.add_argument('outputdir', type=str, help='Output folder')
1616
parser.add_argument('bitrate', type=int, help='bitrate to test')
1717
parser.add_argument('--reference_opus_demo', type=str, default='./opus_demo', help='reference opus_demo binary for generating bitstreams and reference output')
18+
parser.add_argument('--encoder_options', type=str, default="", help='encoder options (e.g. -complexity 5)')
1819
parser.add_argument('--test_opus_demo', type=str, default='./opus_demo', help='opus_demo binary under test')
1920
parser.add_argument('--test_opus_demo_options', type=str, default='-dec_complexity 7', help='options for test opus_demo (e.g. "-dec_complexity 7")')
2021
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 @@ def sox(*call_args):
9495
except:
9596
return 1
9697

97-
def process_clip_factory(ref_opus_demo, test_opus_demo, test_options):
98+
def process_clip_factory(ref_opus_demo, test_opus_demo, enc_options, test_options):
9899
def process_clip(clip_path, processdir, bitrate):
99100
# derive paths
100101
clipname = os.path.splitext(os.path.split(clip_path)[1])[0]
@@ -107,7 +108,7 @@ def process_clip(clip_path, processdir, bitrate):
107108
sox(clip_path, pcm_path)
108109

109110
# run encoder
110-
run_opus_encoder(ref_opus_demo, pcm_path, bitstream_path, "voip", 16000, 1, bitrate)
111+
run_opus_encoder(ref_opus_demo, pcm_path, bitstream_path, "voip", 16000, 1, bitrate, enc_options)
111112

112113
# run decoder
113114
run_opus_decoder(ref_opus_demo, bitstream_path, ref_path, 16000, 1)
@@ -121,16 +122,17 @@ def process_clip(clip_path, processdir, bitrate):
121122

122123
return process_clip
123124

124-
def main(inputdir, outputdir, bitrate, reference_opus_demo, test_opus_demo, test_option_string, verbose):
125+
def main(inputdir, outputdir, bitrate, reference_opus_demo, test_opus_demo, enc_option_string, test_option_string, verbose):
125126

126127
# load clips list
127128
with open(os.path.join(inputdir, 'clips.yml'), "r") as f:
128129
clips = yaml.safe_load(f)
129130

130131
# parse test options
132+
enc_options = enc_option_string.split()
131133
test_options = test_option_string.split()
132134

133-
process_clip = process_clip_factory(reference_opus_demo, test_opus_demo, test_options)
135+
process_clip = process_clip_factory(reference_opus_demo, test_opus_demo, enc_options, test_options)
134136

135137
os.makedirs(outputdir, exist_ok=True)
136138
processdir = os.path.join(outputdir, 'process')
@@ -189,5 +191,6 @@ def main(inputdir, outputdir, bitrate, reference_opus_demo, test_opus_demo, test
189191
args.bitrate,
190192
args.reference_opus_demo,
191193
args.test_opus_demo,
194+
args.encoder_options,
192195
args.test_opus_demo_options,
193196
args.verbose)

0 commit comments

Comments
 (0)