sipeed / Maixduino

Arduino port on Maix board ( k210 )
https://maixduino.sipeed.com
Other
213 stars 93 forks source link

ov2640 idea of optimization of reverse_u32pixel function #138

Open dimitre opened 1 month ago

dimitre commented 1 month ago

Flipping the first bit of IMAGE_MODE register it can give you the image in the right channel position.

 { IMAGE_MODE, IMAGE_MODE_RGB565 | 0b00000001 }, // or changing the IMAGE_MODE_RGB565 register itself

so the image doesn't need reverse_u32pixel. in fact it still needs a simplified version just to invert the odd and even column pixels, like

 *(addr) = ((data & 0x0000FFFF) << 16) | ((data & 0xFFFF0000) >> 16);

of even removing reverse_u32pixel if there are other configurations of image format in DVP