mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
imlib/draw: Fix fb_alloc aligned size.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
parent
62984c8342
commit
ab3770cd2b
@ -3135,14 +3135,11 @@ void imlib_draw_image(image_t *dst_img,
|
|||||||
t_src_img.data = src_img->data;
|
t_src_img.data = src_img->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Query available on-chip RAM.
|
// Allocate a buffer to hold chunks of the transposed image.
|
||||||
uint32_t size;
|
size_t size = fb_avail();
|
||||||
void *data = fb_alloc_all(&size, FB_ALLOC_PREFER_SPEED | FB_ALLOC_CACHE_ALIGN);
|
size = (size & ~(OMV_ALLOC_ALIGNMENT - 1)) - OMV_ALLOC_ALIGNMENT;
|
||||||
fb_free();
|
|
||||||
|
|
||||||
// Allocate a buffer to hold chunks of the transposed image while not using all of the on-chip RAM.
|
|
||||||
size = IM_MIN(size, image_size(&t_src_img));
|
size = IM_MIN(size, image_size(&t_src_img));
|
||||||
data = fb_alloc(size, FB_ALLOC_PREFER_SPEED | FB_ALLOC_CACHE_ALIGN);
|
void *data = fb_alloc(size, FB_ALLOC_PREFER_SPEED | FB_ALLOC_CACHE_ALIGN);
|
||||||
|
|
||||||
// line_num stores how many lines we can do at a time with on-chip RAM.
|
// line_num stores how many lines we can do at a time with on-chip RAM.
|
||||||
image_t temp = {.w = t_roi.w, .h = t_roi.h, .pixfmt = t_src_img.pixfmt};
|
image_t temp = {.w = t_roi.w, .h = t_roi.h, .pixfmt = t_src_img.pixfmt};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user