-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed BMP buffer of shorts to chars and increased MCU buffer size #12
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only one part of the change - the main focus of the change should be reducing the data copied from the DPU by half. Let's wait for the rest of the change before merging this.
src/dpu/dpu-jpeg-decode.c
Outdated
@@ -5,7 +5,7 @@ | |||
#include "jpeg-host.h" | |||
#include "dpu-jpeg.h" | |||
|
|||
__mram_noinit short MCU_buffer[NR_TASKLETS][MEGABYTE(16) / NR_TASKLETS]; | |||
__mram_noinit short MCU_buffer[NR_TASKLETS][MEGABYTE(23) / NR_TASKLETS]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did you get 23 megabytes from? That is considerably shorter than 16M shorts (=32 MB)
src/bmp.c
Outdated
@@ -40,7 +40,7 @@ static void initialize_bmp_header(BmpObject *image) { | |||
image->header.size = image->header.data + image->win_header.length; | |||
} | |||
|
|||
static void initialize_bmp_body(BmpObject *image, uint32_t image_padding, uint32_t mcu_width, short *MCU_buffer) { | |||
static void initialize_bmp_body(BmpObject *image, uint32_t image_padding, uint32_t mcu_width, short *MCU_buffer) { //CHANGING BUFF TO SHORT CAUSES ERRORS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These "errors" are what you are supposed to fix
The data coming from the DPU is an array of shorts. Casting everything to char doesn't change how the data is stored, which is what we are trying to do.
Changed the buffer array in bmp.c from a short type to a char type. Also increased the MCU buffer size in dpu-jpeg-decode.c to reduce artifacting in outputted .bmp files.