reconfinement fonderie first release

master
Tonton Th 2 years ago
parent e0d154c37e
commit 9febaea3ae
  1. 6
      Fonderie/Makefile
  2. 21
      Fonderie/fonctions.c
  3. 2
      Fonderie/fonderie.c

@ -1,4 +1,6 @@
#
# compilation de la fonderie
#
COPT = -g -no-pie -Wall -DDEBUG_LEVEL=0 -Werror=parentheses
LIBS = -lfloatimg -lpnglite -lm
@ -11,7 +13,7 @@ fonderie: fonderie.c ${DEPS} ${OBJS} Makefile
crapulator.o: crapulator.c ${DEPS} Makefile
gcc ${COPT} -c $<
fonctions.o: fonctions.c ${DEPS} Makefile
fonctions.o: fonctions.c fonctions.h Makefile
gcc ${COPT} -c $<
sfx.o: sfx.c ${DEPS} Makefile

@ -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);

@ -61,7 +61,7 @@ puts("");
return 0;
}
/* -------------------------------------------------------------- */
#define BLANK 30
#define BLANK 50
int demarre_la_machine(char *pattern, char *outdir, int szfifo,
int infx, int outfx, int step)

Loading…
Cancel
Save