Time QR decoding and add kdmukai's speedups

240x240 image decoding goes from 1800ms to 406ms. Thanks, @kdmukai!
This commit is contained in:
Thomas Farstrike
2025-07-06 00:35:11 +02:00
parent d0444f10cb
commit 8102a74084
2 changed files with 16 additions and 0 deletions
+12
View File
@@ -21,6 +21,18 @@ target_sources(usermod_c_mpos INTERFACE ${MPOS_C_SOURCES})
# Add include directories.
target_include_directories(usermod_c_mpos INTERFACE ${MPOS_C_INCLUDES})
target_compile_definitions(usermod_c_mpos INTERFACE
# force quirc to use single precision floating point math
-DQUIRC_FLOAT_TYPE=float
-DQUIRC_USE_TGMATH=1
)
# Be sure to set the -O2 "optimize" flag!!
target_compile_options(usermod_c_mpos INTERFACE
-O2
)
# Link our INTERFACE library to the usermod target.
target_link_libraries(usermod INTERFACE usermod_c_mpos)
@@ -171,11 +171,15 @@ class CameraApp(Activity):
def qrdecode_one(self):
try:
import qrdecode
import utime
before = utime.ticks_ms()
result = qrdecode.qrdecode_rgb565(self.current_cam_buffer, self.width, self.height)
after = utime.ticks_ms()
#result = bytearray("INSERT_QR_HERE", "utf-8")
if not result:
self.status_label.set_text(self.status_label_text_searching)
else:
print(f"SUCCESSFUL QR DECODE TOOK: {after-before}ms")
result = remove_bom(result)
result = print_qr_buffer(result)
print(f"QR decoding found: {result}")