optimize speed a bit
This commit is contained in:
parent
fdafcdb95b
commit
bc14ee2c7a
|
@ -52,3 +52,4 @@ Module.symvers
|
||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
|
.ccls-cache/
|
20
main.c
20
main.c
|
@ -122,14 +122,18 @@ static unsigned interval_ms = 1000 / FRAME_RATE;
|
||||||
|
|
||||||
static uint8_t frame_buffer[FRAME_WIDTH * FRAME_HEIGHT * 2];
|
static uint8_t frame_buffer[FRAME_WIDTH * FRAME_HEIGHT * 2];
|
||||||
static void get_frame(uint8_t *buffer) {
|
static void get_frame(uint8_t *buffer) {
|
||||||
for (int i = 0; i < FRAME_HEIGHT; i++) {
|
uint8_t *ptr = buffer;
|
||||||
for (int j = 0; j < FRAME_WIDTH * 2; j += 4) {
|
int offset, i, j;
|
||||||
uint8_t c =
|
uint8_t c;
|
||||||
config.image_buf[(2 + 320 - 2 * i) * 324 + (2 + 40 + 2 * (j / 2))];
|
|
||||||
buffer[2 * FRAME_WIDTH * i + j] = c;
|
for (i = 0; i < FRAME_HEIGHT; i++) {
|
||||||
buffer[2 * FRAME_WIDTH * i + j + 1] = 128;
|
offset = (-648 * i) + 104370;
|
||||||
buffer[2 * FRAME_WIDTH * i + j + 2] = c;
|
for (j = 0; j < FRAME_WIDTH * 2; j += 4) {
|
||||||
buffer[2 * FRAME_WIDTH * i + j + 3] = 128;
|
c = config.image_buf[offset + j];
|
||||||
|
*ptr++ = c;
|
||||||
|
*ptr++ = 128;
|
||||||
|
*ptr++ = c;
|
||||||
|
*ptr++ = 128;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue