Compare commits

..

2 Commits

Author SHA1 Message Date
6a53282cd9 a better singlepass 2021-01-14 14:15:42 +01:00
8a1b164ea7 add timer test 2021-01-14 13:52:04 +01:00
6 changed files with 37 additions and 9 deletions

View File

@ -12,7 +12,7 @@ OBJS = fonctions.o sfx.o crapulator.o glitches.o metriques.o \
DEPS = fonctions.h crapulator.h metriques.h glitches.h sfx.h \ DEPS = fonctions.h crapulator.h metriques.h glitches.h sfx.h \
filterstack.h crapdef.h crapstr.h single.h filterstack.h crapdef.h crapstr.h single.h
all: fonderie interpolator t all: fonderie interpolator singlepass t
# --------------------------------------------------------- # ---------------------------------------------------------

View File

@ -31,8 +31,8 @@ convert -delay 200 /tmp/fstack*.png foo.gif
essai_singlepass () essai_singlepass ()
{ {
MP4="/home/tth/Essais/FondageDePlomb/foo.mp4" MP4="/home/tth/Essais/FondageDePlomb/foo.mp4"
INPUT="/home/tth/Essais/FondageDePlomb/capture/???[04]0.fimg" INPUT="/home/tth/Essais/FondageDePlomb/capture/??090.fimg"
FILTRE="water:water:liss3x3" FILTRE="water:liss3x3"
OUTDIR="/tmp/x8/" OUTDIR="/tmp/x8/"
echo '********* essai single *********' echo '********* essai single *********'

View File

@ -230,6 +230,7 @@ for (;;) {
fprintf(stderr, "%s: err %d add\n", fprintf(stderr, "%s: err %d add\n",
__func__, foo); __func__, foo);
} }
continue;
} }
} }

View File

@ -65,7 +65,7 @@ fprintf(stderr, ">>> %s ( %p )\n", __func__, pimg);
strncpy(line, destination, 100); strncpy(line, destination, 100);
if ('/' != line[strlen(line)-1]) { if ('/' != line[strlen(line)-1]) {
fprintf(stderr, "adding '/'\n"); // fprintf(stderr, "adding '/'\n");
strcat(line, "/"); strcat(line, "/");
} }

View File

@ -29,6 +29,7 @@ FloatImg image = { 0 };
int idx, foo; int idx, foo;
glob_t globbuf; glob_t globbuf;
char *fname; char *fname;
double elapsed;
#if DEBUG_LEVEL #if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__, fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__,
@ -37,6 +38,8 @@ fprintf(stderr, ">>> %s ( '%s' '%s' %d )\n", __func__,
// filterstack_list(fchain, "Run the single pass"); // filterstack_list(fchain, "Run the single pass");
(void)fimg_timer_set(0);
foo = single_init(0, destdir, fchain); foo = single_init(0, destdir, fchain);
if (foo) { if (foo) {
fprintf(stderr, "erreur %d single_init\n", foo); fprintf(stderr, "erreur %d single_init\n", foo);
@ -96,16 +99,21 @@ for (idx=0; idx<globbuf.gl_pathc; idx++) {
} }
fprintf(stderr, "\n"); fprintf(stderr, "\n");
single_print_state("end of run :)", 0);
fimg_destroy(&image); fimg_destroy(&image);
single_print_state("end of run :)", 0);
return -1; elapsed = fimg_timer_get(0);
fprintf(stderr, " %d frames, elapsed %.3f s, %.3f fps\n",
globbuf.gl_pathc, elapsed,
(double)globbuf.gl_pathc/elapsed);
return 0;
} }
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
static void help(void) static void help(void)
{ {
puts("--- Single pass serial filter ---\nusage:"); puts("------ Single pass serial filter ------\nusage:");
puts("\t-F\tdefine:the:filter:chain"); puts("\t-F\tdefine:the:filter:chain");
puts("\t-g\tinput glob pattern"); puts("\t-g\tinput glob pattern");

23
lib/t.c
View File

@ -13,6 +13,22 @@
int verbosity; int verbosity;
/* ---------------------------------------------------------------- */
int essai_timer(int uuuh)
{
double A, B;
fprintf(stderr, ">>> %s ( %d )\n", __func__, uuuh);
A = fimg_timer_set(uuuh);
sleep(4);
B = fimg_timer_get(uuuh);
fprintf(stderr, " %f %f\n", A, B);
return 0;
}
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
int essai_normalize(void) int essai_normalize(void)
{ {
@ -20,6 +36,7 @@ FloatImg A;
float val; float val;
int foo; int foo;
#if 0
foo = fimg_create(&A, 512, 512, FIMG_TYPE_RGB); foo = fimg_create(&A, 512, 512, FIMG_TYPE_RGB);
if (foo) { if (foo) {
fprintf(stderr, "%s err create A %d\n", __func__, foo); fprintf(stderr, "%s err create A %d\n", __func__, foo);
@ -43,6 +60,8 @@ fprintf(stderr, "AFTER max pixel %f\n", val);
fimg_destroy(&A); fimg_destroy(&A);
#endif
return 0; return 0;
} }
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
@ -280,8 +299,8 @@ if (verbosity) {
// foo = essai_clone_et_copy(0); // foo = essai_clone_et_copy(0);
// fprintf(stderr, "retour essai clone'n'copy -> %d\n", foo); // fprintf(stderr, "retour essai clone'n'copy -> %d\n", foo);
foo = essai_get_values("quux.fimg"); foo = essai_timer(0);
fprintf(stderr, "retour essai interpolate -> %d\n", foo); fprintf(stderr, "retour essai -> %d\n", foo);
return 0; return 0;
} }