2018-04-15 03:03 PM
Good day,
I'm trying to find any info about the libjpeg for encoding a file in RGB565 obtained by the DCMI, I`m woriking with the periphereal library but I can not find anything, has anyone an idea about how to start this project, examples, anything.
I`m working with a STM32F446VE ARM.
Thanks.
Andr�s Felipe Rodr�guez.
#libjpeg #stm32-peripheral-library #dcmi #stm32f42018-04-16 05:29 AM
Hello
RODRIGUEZ.ANDRES
, I recommend you to reviewLibJPEG examples withinSTM32Cube F4 V1.0 firmware package:
STM32Cube_FW_F4_V1.0\Projects\STM32446E_EVAL\Applications\LibJPEG\LibJPEG_Encoding
and h
ave a look in: STM32Cube_FW_F4_V1.0\Middlewares\Third_Party\LibJPEGYou can also useSTM32CubeMx tool forLibjpeg configuration,take a look to this user Manual
in the section 'B.3.7 Libjpeg'.Best Regards
Imen
2018-04-16 06:40 AM
As Imen points out there are an assortment of examples under the HAL/Cube trees, you may need to port these to specific boards.
I haven't looked at the libraries, but I would suspect the JPEG stuff uses a different colour-space/palette than the display or capture devices, so you'll likely need to manage the conversion.
I would review and evaluate the examples as provided, once their behaviour is understood pivot to your use case.
2018-04-16 08:16 AM
Good day
I appreciate your answers, I'm working with the periphereal library and I can not find the libjpeg library, can you tell me where to find it?
Clive One, when you say to 'manage the conversion', Do you mean to change from RGB565 to RGB888?
Thanks.
ANDRES FELIPE RODR�GUEZ
2018-04-16 11:35 AM
The SPL?
The HAL has it here
STM32Cube_FW_F4_V1.19.0\Middlewares\Third_Party\LibJPEG
STM32Cube_FW_F4_V1.19.0\Projects\STM32446E_EVAL\Applications\LibJPEG\LibJPEG_Decoding
The mechanics of the software library should be the same.
If the library expects RGB888 then yes.
Like here from RGB888 to RGB565
/**
* @brief Copy decompressed data to display buffer. * @param Row: Output row buffer * @param DataLength: Row width in output buffer * @retval None */static uint8_t Jpeg_CallbackFunction(uint8_t* Row, uint32_t DataLength){ uint32_t i = 0; RGB_matrix = (RGB_typedef*)Row; uint16_t RGB16Buffer[IMAGE_WIDTH];for(i = 0; i < IMAGE_WIDTH; i++)
{ RGB16Buffer[i] = (uint16_t) ( ((RGB_matrix[i].R & 0x00F8) >> 3)| ((RGB_matrix[i].G & 0x00FC) << 3)| ((RGB_matrix[i].B & 0x00F8) << 8) );BSP_LCD_DrawPixel(i, line_counter, RGB16Buffer[i]);
} line_counter++; return 0;}