Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tris9
Copy link
Collaborator

@tris9 tris9 commented Mar 10, 2022

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.

Copy link
Contributor

@jnider jnider left a 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.

@@ -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];
Copy link
Contributor

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants