diff --git a/src/omv/boards/OPENMV2/omv_boardconfig.h b/src/omv/boards/OPENMV2/omv_boardconfig.h index b16a0bba2..19f7167f4 100644 --- a/src/omv/boards/OPENMV2/omv_boardconfig.h +++ b/src/omv/boards/OPENMV2/omv_boardconfig.h @@ -41,6 +41,10 @@ // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (160*120*2) +// Low and high JPEG QS. +#define JPEG_QUALITY_LOW 35 +#define JPEG_QUALITY_HIGH 60 + // Linker script constants (see the linker script template stm32fxxx.ld.S). // Note: fb_alloc is a stack-based, dynamically allocated memory on FB. // The maximum available fb_alloc memory = FB_ALLOC_SIZE + FB_SIZE - (w*h*bpp). diff --git a/src/omv/boards/OPENMV3/omv_boardconfig.h b/src/omv/boards/OPENMV3/omv_boardconfig.h index d8abfaa9e..474b21469 100644 --- a/src/omv/boards/OPENMV3/omv_boardconfig.h +++ b/src/omv/boards/OPENMV3/omv_boardconfig.h @@ -41,6 +41,10 @@ // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (160*120*2) +// Low and high JPEG QS. +#define JPEG_QUALITY_LOW 35 +#define JPEG_QUALITY_HIGH 60 + // Linker script constants (see the linker script template stm32fxxx.ld.S). // Note: fb_alloc is a stack-based, dynamically allocated memory on FB. // The maximum available fb_alloc memory = FB_ALLOC_SIZE + FB_SIZE - (w*h*bpp). diff --git a/src/omv/boards/OPENMV4/omv_boardconfig.h b/src/omv/boards/OPENMV4/omv_boardconfig.h index 5f2884bd0..d6a9904a8 100644 --- a/src/omv/boards/OPENMV4/omv_boardconfig.h +++ b/src/omv/boards/OPENMV4/omv_boardconfig.h @@ -44,6 +44,10 @@ // This is only used for JPEG images sent to the IDE not normal compression. #define JPEG_QUALITY_THRESH (320*240*2) +// Low and high JPEG QS. +#define JPEG_QUALITY_LOW 50 +#define JPEG_QUALITY_HIGH 90 + // Linker script constants (see the linker script template stm32fxxx.ld.S). // Note: fb_alloc is a stack-based, dynamically allocated memory on FB. // The maximum available fb_alloc memory = FB_ALLOC_SIZE + FB_SIZE - (w*h*bpp). diff --git a/src/omv/framebuffer.c b/src/omv/framebuffer.c index 4b3973598..4825127a5 100644 --- a/src/omv/framebuffer.c +++ b/src/omv/framebuffer.c @@ -78,8 +78,8 @@ void fb_update_jpeg_buffer() overflow_count--; } // No buffer overflow, increase quality up to max quality based on frame size - if (overflow_count == 0 && - JPEG_FB()->quality < ((fb_buffer_size() > JPEG_QUALITY_THRESH) ? 35:60)) { + if (overflow_count == 0 && JPEG_FB()->quality + < ((fb_buffer_size() > JPEG_QUALITY_THRESH) ? JPEG_QUALITY_LOW:JPEG_QUALITY_HIGH)) { JPEG_FB()->quality++; } // Set FB from JPEG image