完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
请教下,使用 STM32f7x的硬件 jpeg 解码功能,图片不能够横屏显示?? 但是 显示字符,画图等完全可以横屏显示(四个方向可以任意显示), 还有在图片上显示字符,具体见下面程序的描述 貌似设置横竖屏显示的函数就在下面这个函数里面,但是不知道该如果修改 ???? static uint32_t JPEG_MCU_YCbCr420_ARGB_ConvertBlocks(uint8_t *pInBuffer, uint8_t *pOutBuffer, uint32_t BlockIndex, uint32_t DataCount, uint32_t *ConvertedDataCount) { uint32_t numberMCU; uint32_t i,j,k, currentMCU, xRef,yRef; uint32_t refline; int32_t ycomp, crcomp, cbcomp; int32_t c_red, c_blue, c_green; uint8_t *pOutAddr, *pOutAddr2; uint8_t *pChrom, *pLum; numberMCU = DataCount / YCBCR_420_BLOCK_SIZE; currentMCU = BlockIndex; while(currentMCU < (numberMCU + BlockIndex)) { xRef = ((currentMCU *16) / JPEG_ConvertorParams.WidthExtend)*16; yRef = ((currentMCU *16) % JPEG_ConvertorParams.WidthExtend); refline = JPEG_ConvertorParams.ScaledWidth * xRef + (JPEG_BYTES_PER_PIXEL*yRef); currentMCU++; pChrom = pInBuffer + 256; /* pChroma = pInBuffer + 4*64 */ pLum = pInBuffer; for(i= 0; i < 16; i+=2) { if(i == 8) { pLum = pInBuffer + 128; } if(refline < JPEG_ConvertorParams.ImageSize_Bytes) { pOutAddr = pOutBuffer + refline; pOutAddr2 = pOutAddr + JPEG_ConvertorParams.ScaledWidth; for(k= 0; k<2; k++) { for(j=0; j < 8; j+=2) { cbcomp = (int32_t)(*(pChrom)); c_blue = (int32_t)(*(CB_BLUE_LUT + cbcomp)); crcomp = (int32_t)(*(pChrom + 64)); c_red = (int32_t)(*(CR_RED_LUT + crcomp)); c_green = ((int32_t)(*(CR_GREEN_LUT + crcomp)) + (int32_t)(*(CB_GREEN_LUT + cbcomp))) >> 16; #if (JPEG_RGB_FORMAT == JPEG_ARGB8888) ycomp = (int32_t)(*(pLum +j)); *(__IO uint32_t *)pOutAddr = (CLAMP(ycomp + c_red) << JPEG_RED_OFFSET) | (CLAMP( ycomp + c_green) << JPEG_GREEN_OFFSET) | (CLAMP(ycomp + c_blue) << JPEG_BLUE_OFFSET); /**********/ ycomp = (int32_t)(*(pLum +j +1)); *((__IO uint32_t *)(pOutAddr + 4)) = (CLAMP(ycomp + c_red) << JPEG_RED_OFFSET) | (CLAMP( ycomp + c_green) << JPEG_GREEN_OFFSET) | (CLAMP(ycomp + c_blue) << JPEG_BLUE_OFFSET); /**********/ ycomp = (int32_t)(*(pLum +j +8)); *(__IO uint32_t *)pOutAddr2 = (CLAMP(ycomp + c_red) << JPEG_RED_OFFSET) | (CLAMP( ycomp + c_green) << JPEG_GREEN_OFFSET) | (CLAMP(ycomp + c_blue) << JPEG_BLUE_OFFSET); /**********/ ycomp = (int32_t)(*(pLum +j +8 +1)); *((__IO uint32_t *)(pOutAddr2 +4)) = (CLAMP(ycomp + c_red) << JPEG_RED_OFFSET) | (CLAMP( ycomp + c_green) << JPEG_GREEN_OFFSET) | (CLAMP(ycomp + c_blue) << JPEG_BLUE_OFFSET); #elif (JPEG_RGB_FORMAT == JPEG_RGB888) ycomp = (int32_t)(*(pLum +j)); pOutAddr[JPEG_RED_OFFSET/8] = CLAMP(ycomp + c_red); pOutAddr[JPEG_GREEN_OFFSET/8] = CLAMP(ycomp + c_green); pOutAddr[JPEG_BLUE_OFFSET/8] = CLAMP(ycomp + c_blue); /**********/ ycomp = (int32_t)(*(pLum +j +1)); pOutAddr[3 + JPEG_RED_OFFSET/8] = CLAMP(ycomp + c_red); pOutAddr[3 + JPEG_GREEN_OFFSET/8] = CLAMP(ycomp + c_green); pOutAddr[3 + JPEG_BLUE_OFFSET/8] = CLAMP(ycomp + c_blue); /**********/ ycomp = (int32_t)(*(pLum +j +8)); pOutAddr2[JPEG_RED_OFFSET/8] = CLAMP(ycomp + c_red); pOutAddr2[JPEG_GREEN_OFFSET/8] = CLAMP(ycomp + c_green); pOutAddr2[JPEG_BLUE_OFFSET/8] = CLAMP(ycomp + c_blue); /**********/ ycomp = (int32_t)(*(pLum +j +8 +1)); pOutAddr2[3+ JPEG_RED_OFFSET/8] = CLAMP(ycomp + c_red); pOutAddr2[3 + JPEG_GREEN_OFFSET/8] = CLAMP(ycomp + c_green); pOutAddr2[3 + JPEG_BLUE_OFFSET/8] = CLAMP(ycomp + c_blue); #elif (JPEG_RGB_FORMAT == JPEG_RGB565) // 使用rgb565模式,地址设置貌似就在此处,但是如果按照显示画图形的方法来设置地址的话,那这个 x, y又该如何获取啊 ??? ycomp = (int32_t)(*(pLum +j)); *(__IO uint16_t *)pOutAddr = ((CLAMP(ycomp + c_red) >> 3) << JPEG_RED_OFFSET) | ((CLAMP( ycomp + c_green) >> 2) << JPEG_GREEN_OFFSET) | ((CLAMP(ycomp + c_blue) >> 3) << JPEG_BLUE_OFFSET); /**********/ ycomp = (int32_t)(*(pLum +j +1)); *((__IO uint16_t *)(pOutAddr + 2)) = ((CLAMP(ycomp + c_red) >> 3) << JPEG_RED_OFFSET) | ((CLAMP( ycomp + c_green) >> 2) << JPEG_GREEN_OFFSET) | ((CLAMP(ycomp + c_blue) >> 3) << JPEG_BLUE_OFFSET); /**********/ ycomp = (int32_t)(*(pLum +j +8)); *(__IO uint16_t *)pOutAddr2 = ((CLAMP(ycomp + c_red) >> 3) << JPEG_RED_OFFSET) | ((CLAMP( ycomp + c_green) >> 2) << JPEG_GREEN_OFFSET) | ((CLAMP(ycomp + c_blue) >> 3) << JPEG_BLUE_OFFSET); /**********/ ycomp = (int32_t)(*(pLum +j +8 +1)); *((__IO uint16_t *)(pOutAddr2 +2)) = ((CLAMP(ycomp + c_red) >> 3) << JPEG_RED_OFFSET) | ((CLAMP( ycomp + c_green) >> 2) << JPEG_GREEN_OFFSET) | ((CLAMP(ycomp + c_blue) >> 3) << JPEG_BLUE_OFFSET); #endif /* JPEG_RGB_FORMAT */ pOutAddr += JPEG_BYTES_PER_PIXEL * 2; pOutAddr2 += JPEG_BYTES_PER_PIXEL * 2; pChrom++; } pLum += 64; } pLum = pLum - 128 + 16; refline += 2*JPEG_ConvertorParams.ScaledWidth; } } pInBuffer += YCBCR_420_BLOCK_SIZE; } return numberMCU; } 显示效果图片如下: 正常的竖屏显示, 竖屏 180 度 显示图片如下: 这个竖屏 180度显示,字符汉字都已经正常显示了,唯独图片没有 ?? 旋转180度显示图片的地址计算我是参考我的 图形显示参数修改的,显示图形任意方向显示是没有问题的 // 使用rgb565模式,地址设置貌似就在此处,但是如果按照显示画图形的方法来设置地址的话,那这个 x, y又该如何获取啊 ??? |
|
相关推荐
5个回答
|
|
F7没搞过,帮顶!!!!!!!!
|
|
|
|
|
|
|
|
好大的LCD,1280*720 分辨率?是MIPI接口吗?
|
|
|
|
我的是 800*1280的 lvds 屏, 请教有没有关于 这个硬件解码 jpg 进行 横竖屏显示的历程啊 ?? |
|
|
|
不懂 帮顶
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
238 浏览 0 评论
如何解决MPU-9250与STM32通讯时,出现HAL_ERROR = 0x01U
734 浏览 1 评论
hal库中i2c卡死在HAL_I2C_Master_Transmit
1128 浏览 1 评论
LL库F030进行3个串口收发,2个串口为232,一个为485,长时间后,会出现串口1停止运行,另外两个正常,只有重启复原
1600 浏览 1 评论
538 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-8 18:28 , Processed in 0.734892 second(s), Total 82, Slave 65 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号