各位好!
想请问各位,在JPEG Codec 的部分,我参考了官方硬体解码的程序,发现解码的空间好像并没有完全解完,导致图片显示不完整。
不知道各位是否能协助要如何将JPEG解码两次,并把后续没有解码成功的部份显示出来。
- uint32_t JPEG_Decode_DMA(JPEG_HandleTypeDef *hjpeg, FIL *file, uint32_t DestAddress)
- {
- uint32_t i;
-
- pFile = file;
- FrameBufferAddress = DestAddress;
-
- /* Read from JPG file and fill input buffers */
- for(i = 0; i < NB_INPUT_DATA_BUFFERS; i++)
- {
- if(f_read (pFile, Jpeg_IN_BufferTab[i].DataBuffer , CHUNK_SIZE_IN, (UINT*)(&Jpeg_IN_BufferTab[i].DataBufferSize)) == FR_OK)
- {
- Jpeg_IN_BufferTab[i].State = JPEG_BUFFER_FULL;
- }
- else
- {
- Error_Handler();
- }
- }
- /* Start JPEG decoding with DMA method */
- HAL_JPEG_Decode_DMA(hjpeg ,Jpeg_IN_BufferTab[0].DataBuffer ,Jpeg_IN_BufferTab[0].DataBufferSize ,(uint8_t *)FrameBufferAddress ,CHUNK_SIZE_OUT);
-
-
- return 0;
- }
复制代码
先前发表帖子:https://www.stmcu.org.cn/module/forum/forum.php?mod=viewthread&tid=622771&highlight=JPEG
感谢各位!
|