diff --git a/pysstv/examples/codegen.py b/pysstv/examples/codegen.py index 2eb7985..feeb37f 100644 --- a/pysstv/examples/codegen.py +++ b/pysstv/examples/codegen.py @@ -113,6 +113,7 @@ def test(): from datetime import datetime import struct exe = './codegen-test-executable' + img_file = '320x256rgb.png' if not path.exists('stb_image.h'): from urllib import urlretrieve urlretrieve('https://raw.githubusercontent.com/nothings/stb/master/stb_image.h', 'stb_image.h') @@ -127,10 +128,10 @@ def test(): gen_elapsed = datetime.now() - start print ' - gengcc took', gen_elapsed start = datetime.now() - gen = check_output([exe]) + gen = check_output([exe, img_file]) native_elapsed = datetime.now() - start print ' - native took', native_elapsed - img = Image.open("320x256rgb.png") + img = Image.open(img_file) sstv = sstv_class(img, 44100, 16) start = datetime.now() try: diff --git a/pysstv/examples/codeman.c b/pysstv/examples/codeman.c index fce6b05..11ac0c0 100644 --- a/pysstv/examples/codeman.c +++ b/pysstv/examples/codeman.c @@ -5,9 +5,9 @@ #include "stb_image.h" #include "codegen.c" -int main() { +int main(int argc, char **argv) { int x, y, n; - unsigned char *img = stbi_load("320x256rgb.png", &x, &y, &n, 0); + unsigned char *img = stbi_load(argv[1], &x, &y, &n, 0); float freqs[FREQ_COUNT], msecs[FREQ_COUNT];