Does anybody have an idea on how to stream image data line by line into an accelerated function, instead of pixel by pixel?
Here is what I currently have:
Code: Select all
#pragma SDS data mem_attribute(input_img:PHYSICAL_CONTIGUOUS|NON_CACHEABLE)
#pragma SDS data mem_attribute(output_img:PHYSICAL_CONTIGUOUS|NON_CACHEABLE)
#pragma SDS data access_pattern(input_img:SEQUENTIAL, output_img:SEQUENTIAL)
#pragma SDS data data_mover(input_img:AXIDMA_SIMPLE)
#pragma SDS data data_mover(output_img:AXIDMA_SIMPLE)
#pragma SDS data copy(input_img[0:IMG_HEIGHT*IMG_WIDTH])
#pragma SDS data copy(output_img[0:IMG_HEIGHT*IMG_WIDTH])
void acc_function_px(unsigned char* input_img, unsigned char* output_img)
{
// ...
for(y = 0; y < IMG_HEIGHT; y++)
{
for(x = 0; x < IMG_WIDTH; x++)
{
in_pix = input_img[y * IMG_WIDTH + x];
// ...
}
}
// ...
}
This is what I aim for, but I don't know if it does what I want:
Code: Select all
void acc_function_line(unsigned char* input_line, unsigned char* output_line)
{
// ...
for(x = 0; x < IMG_WIDTH; x++)
{
in_pix = input_line[x];
// ...
}
// ...
}
void some_other_function(unsigned char* input_img, unsigned char* output_img)
{
// ...
for(y = 0; y < IMG_HEIGHT; y++)
{
acc_function_line(&input_img[y * IMG_WIDTH], &output_img[y * IMG_WIDTH]);
// ...
}
// ...
}
Anyone an idea?
\Boitumelo