Thanks. But it is not decoding JPEG to RGB565 format. Here is the output for your reference:
Code: Select all
[1B][0;32mI (428) jped decode: jpeg decode to rgb565, data in 0x3d803604[1B][0m
[1B][0;32mI (479) jped decode: jpeg decode to rgb888, data in 0x3d803604[1B][0m
Code: Select all
static void print_rgb565_img(uint8_t *img, int width, int height)
{
uint16_t *p = (uint16_t *)img;
const char temp2char[17] = "@MNHQ&#UJ*x7^i;.";
for (size_t j = 0; j < height; j++) {
for (size_t i = 0; i < width; i++) {
uint32_t c = p[j * width + i];
uint8_t r = c >> 11;
uint8_t g = (c >> 6) & 0x1f;
uint8_t b = c & 0x1f;
c = (r + g + b) / 3;
c >>= 1;
printf("%" PRIu32 ,c); //"\n"
//printf("%c", temp2char[15 - c]);
}
printf("\n");
}
}