1515parser .add_argument ('outputdir' , type = str , help = 'Output folder' )
1616parser .add_argument ('bitrate' , type = int , help = 'bitrate to test' )
1717parser .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)' )
1819parser .add_argument ('--test_opus_demo' , type = str , default = './opus_demo' , help = 'opus_demo binary under test' )
1920parser .add_argument ('--test_opus_demo_options' , type = str , default = '-dec_complexity 7' , help = 'options for test opus_demo (e.g. "-dec_complexity 7")' )
2021parser .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