From c3a2de833308b7873e446edeaf6b04bb5086bbc5 Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Sun, 14 Apr 2024 11:47:51 +0300 Subject: [PATCH] C: precalculate `PRODUCT` in the Python script --- bytebeat_compiler.py | 1 + src/template.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bytebeat_compiler.py b/bytebeat_compiler.py index 7685e43..f5600e8 100644 --- a/bytebeat_compiler.py +++ b/bytebeat_compiler.py @@ -211,6 +211,7 @@ if __name__ == "__main__": "fp_return_type": args.floating_point, "channels": args.channels, "length": samples, + "wav_product": args.channels * samples, "sequential_mode": args.mode == "sequential", "block_size": args.block_size, "silent_mode": args.silent, diff --git a/src/template.c b/src/template.c index 8e40942..aafb0a0 100644 --- a/src/template.c +++ b/src/template.c @@ -38,7 +38,7 @@ const char* ANSI_CLEAR = __ANSI_CLEAR_STRING; # endif #endif -#define PRODUCT (LENGTH * CHANNELS) +#define PRODUCT `wav_product` #define FREQUENCY_OF_STATUS_REPORTING 5000 #define SEQUENTIAL_MODE `sequential_mode`