Streaming image data line by line

Available to be read by all.
Boitumelo_Ruf
Posts: 61
Joined: Thu Jun 09, 2016 4:28 pm

Streaming image data line by line

Postby Boitumelo_Ruf » Tue Jul 18, 2017 9:23 am

Hi,

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

Return to “FAQ about Tulipp Development Platform”

Who is online

Users browsing this forum: No registered users and 2 guests