cancel
Showing results for 
Search instead for 
Did you mean: 

libjpeg for DCMI

ANDRES RODRIGUEZ
Associate II
Posted on April 16, 2018 at 00:03

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 #stm32f4
4 REPLIES 4
Imen.D
ST Employee
Posted on April 16, 2018 at 14:29

Hello

RODRIGUEZ.ANDRES

,

I recommend you to reviewLibJPEG examples within

STM32Cube 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\LibJPEG

You can also useSTM32CubeMx tool forLibjpeg configuration,take a look to this user Manual

http://www.st.com/content/ccc/resource/technical/document/user_manual/10/c5/1a/43/3a/70/43/7d/DM001047pdf/files/DM001047pdf/jcr:content/translations/en.DM001047pdf

in the section 'B.3.7 Libjpeg'.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on April 16, 2018 at 15:40

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ANDRES RODRIGUEZ
Associate II
Posted on April 16, 2018 at 17:16

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

Posted on April 16, 2018 at 18:35

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;

}
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..