don't know how to make the upscaler
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
COPT = -Wall -fpic -g -pg -DDEBUG_LEVEL=1
|
||||
COPT = -Wall -fpic -g -pg -no-pie -DDEBUG_LEVEL=1
|
||||
DEPS = ../floatimg.h ../libfloatimg.a Makefile
|
||||
|
||||
all: grabvidseq t
|
||||
@@ -18,7 +18,7 @@ v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile
|
||||
gcc ${COPT} -c $<
|
||||
|
||||
grabvidseq: grabvidseq.c Makefile rgb2fimg.o
|
||||
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@
|
||||
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lm -lv4l2 -o $@
|
||||
|
||||
video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o
|
||||
gcc -Wall -g $< funcs.o v4l2_pr_structs.o -o $@
|
||||
|
||||
@@ -38,13 +38,8 @@
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
||||
#define CLEAR(x) memset(&(x), 0, sizeof(x))
|
||||
|
||||
|
||||
|
||||
|
||||
struct buffer {
|
||||
void *start;
|
||||
size_t length;
|
||||
@@ -194,6 +189,9 @@ foo = fimg_create(&cumul,
|
||||
fimg_clear(&cumul);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
xioctl(fd, VIDIOC_STREAMON, &type);
|
||||
|
||||
|
||||
@@ -5,6 +5,32 @@
|
||||
|
||||
#include "funcs.h"
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
int x_upscaler(unsigned char *src, int w, int h, FloatImg *d)
|
||||
{
|
||||
int x, y, xx, yy;
|
||||
float *rp, *gp, *bp;
|
||||
float r, g, b;
|
||||
static unsigned short modz;
|
||||
|
||||
rp = d->R, gp = d->G, bp = d->B;
|
||||
|
||||
for (y=0; y<h; y++) {
|
||||
yy = (y*2) + ! (modz & 1);
|
||||
for (x=0; x<w; x++) {
|
||||
xx = (x*2) + ! (modz & 2);
|
||||
r = (float)*src++;
|
||||
g = (float)*src++;
|
||||
b = (float)*src++;
|
||||
fimg_plot_rgb(d, xx, yy, r, g, b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
modz++;
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
int x_rgb2fimg(unsigned char *src, int w, int h, FloatImg *d)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user