Skip to content
Snippets Groups Projects
Unverified Commit 7db26934 authored by Jan Buethe's avatar Jan Buethe
Browse files

fix for buffer size calculation in osce.c

update to osce evaluation script
parent ff6dea5e
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@ static void lace_feature_net(
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;
......
......@@ -15,6 +15,7 @@ parser.add_argument('inputdir', type=str, help='Input folder with test items')
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 @@ def sox(*call_args):
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 @@ def process_clip_factory(ref_opus_demo, test_opus_demo, test_options):
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,16 +122,17 @@ def process_clip_factory(ref_opus_demo, test_opus_demo, test_options):
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:
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 @@ if __name__ == "__main__":
args.bitrate,
args.reference_opus_demo,
args.test_opus_demo,
args.encoder_options,
args.test_opus_demo_options,
args.verbose)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment