save some time

master
Steffen Pohle 3 years ago
parent 21b771a025
commit d9c22be57e

@ -2,10 +2,10 @@
TARGET = $(APP)
CPP = c++
CPPFLAGS = -std=c++11 -ggdb -Wall -Werror -O0 `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` -Wl,--export-dynamic -I/usr/include -DBUILD_LINUX=1
CPPFLAGS = -std=c++11 -pg -ggdb -Wall -Werror -O0 `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` -Wl,--export-dynamic -I/usr/include -DBUILD_LINUX=1
INCLUDES =
LDFLAGS =
LIBS = `pkg-config --libs gtk+-3.0 gmodule-export-2.0` -L/usr/lib -ljpeg -ltiff
LIBS = `pkg-config --libs gtk+-3.0 gmodule-export-2.0` -L/usr/lib -ljpeg -ltiff -pg
OBJECTS =

@ -346,8 +346,11 @@ int Convert (ConvertData *cdata, VideoFrame *dest, unsigned char *ptrsrc, int sr
break;
case (V4L2_PIX_FMT_SGRBG16):
// GG RR
// BB GG
// GG RR GG RR
// BB GG BB GG
// GG RR GG RR
// BB GG BB GG
uint16_t t;
for (ys = 0, yd = 0; ys < (signed int)srch; ys++) {

@ -112,6 +112,11 @@ void cb_histogramda_draw(GtkWidget *area, cairo_t *cr, int w, int h, gpointer da
* test function
*/
void histogram_update(VideoFrame *vf) {
// save some time
static int to = 0;
if ((++to) % 8 == 0) to = 0;
int chan, i, x, y;
if (vf == NULL) return;
@ -123,7 +128,7 @@ void histogram_update(VideoFrame *vf) {
for (i = 0, x = 0; x < vf->w; x++) {
for (y = 0; y < vf->h; y++) {
for (chan = 0; chan < 3; chan++) {
histogram[chan][vf->data[3*(y*vf->w+x) + chan]]++;
histogram[chan][vf->data[i++]]++;
}
}
}

Loading…
Cancel
Save