reconfinement fonderie first release
This commit is contained in:
@@ -23,7 +23,22 @@ extern int verbosity;
|
||||
static A_Fifo g_fifo;
|
||||
|
||||
/* -------------------------------------------------------------- */
|
||||
static int big_adder(FloatImg *from, FloatImg *to)
|
||||
{
|
||||
int size, idx;
|
||||
|
||||
size = from->width * from->height;
|
||||
|
||||
for (idx=0; idx<size; idx++) to->R[idx] += from->R[idx];
|
||||
for (idx=0; idx<size; idx++) to->G[idx] += from->G[idx];
|
||||
for (idx=0; idx<size; idx++) to->B[idx] += from->B[idx];
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/*
|
||||
* 97% of the total run time was in that function \o_
|
||||
*/
|
||||
int faire_la_somme(A_Fifo *pfifo, FloatImg *destination, int step)
|
||||
{
|
||||
int idx, foo;
|
||||
@@ -36,7 +51,11 @@ else {
|
||||
|
||||
fimg_clear(pdest);
|
||||
for (idx=0; idx<pfifo->nbslots; idx += step) {
|
||||
foo = fimg_add_2(&(pfifo->slots[idx]), pdest);
|
||||
/***************************************
|
||||
* Here was the giant bootleneck *
|
||||
***************************************/
|
||||
// HERE -> foo = fimg_add_2(&(pfifo->slots[idx]), pdest);
|
||||
foo = big_adder(&(pfifo->slots[idx]), pdest);
|
||||
if (foo)
|
||||
{
|
||||
fprintf(stderr, "%s: err %d on add_2\n", __func__, foo);
|
||||
|
||||
Reference in New Issue
Block a user