uint8 u8mulv(uint8* in1, uint8* in2, int size)
{
  uint8 out = 0;
  int i = 0;
  
  for (i = 0 ; i < size ; ++i)
    {
      out += u8muls(in1[i], in2[i]);
    }

  return out;
}
Esempio n. 2
0
void u8columnproda(uint8 *in, int lines, int columns, uint8 * out) {
  int i = 0;

  /*
  ** First assign first row, just in case
  ** out contains non-zero's elements.
  */
  for (i = 0 ; i < lines; ++i)
    {
      out[i] = (uint8)in[i];
    }
  /*
  ** Then accumulate in each row.
  */
  for (i = lines ; i < lines * columns ; ++i)
    {
      out[i % lines] = (uint8)u8muls(out[i % lines] , in[i]);
    }
}
Esempio n. 3
0
void u8rowproda(uint8 *in, int lines, int columns, uint8 * out) {
  int i = 0;

  /*
  ** First assign first row, just in case
  ** out contains non-zero's elements.
  */
  for (i = 0 ; i < columns; ++i)
    {
      out[i] = (uint8)in[i * lines];
    }
  /*
  ** Then accumulate in each column.
  */
  for (i = 1 ; i <= (lines - 1) * columns ; ++i)
    {
      out[(i - 1) % columns] = (uint8)u8muls( out[(i - 1) % columns] ,
				      in[((i - 1) % columns) * lines + 1 + (i - 1) / columns]);
    }
}