📄 fiplay.c
字号:
else//Other YUV format
{
//printf("Other YUV format\n");
sts = FALSE;
}
}
}
else//Parsing header error or image size not in range
{
//printf("Parsing header error or image size not in range\n");
sts = FALSE;
}
}
else//JFIF or other
{
if (Jpeg_Exif_Format == K_JFIF_IMAGE_FORMAT)
{
if (sts == FALSE)
{
//Image information
ImagePara.Height = 0;
ImagePara.Width = 0;
ImagePara.Size = 0;
ImagePara.Addr = 0;
ImagePara.DataType = 0;
//Thumbnail information
ThumbPara.Height = 0;
ThumbPara.Width = 0;
ThumbPara.Size = 0;
ThumbPara.Addr = 0;
ThumbPara.DataType = 0;
DRI_MCU_Num = 0;
sts = M_Card_File_Read(fHandle,K_DOS_DstDram,G_DOS_FileSize,DramAddr,0);
if (sts)
{
sts = EXIFHDR_Parsing_ExifFile(DramAddr,0,DateTime,&ImagePara,&ThumbPara);
File_Close(fHandle, name, K_DOS_ReadFile, 0);
//patch 4.4-7@wyeo@remove debug message
//M_Card_Printf("File is closed!\n");
}
if (sts)
{
if (ImagePara.DataType == K_File_DataType_YUV411)//YUV411
{
if (((ImagePara.Width % 16) == 0x00) && ((ImagePara.Height % 16) == 0x00) && (ImagePara.Width < 2048) && (ImagePara.Height < 2048))
{
//patch5.0@richie@sdram mapping begin
L2_DeCompress(ImagePara.Addr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackBufAddr, 0x00, 0x05, DRI_MCU_Num);
L2_TransYUV420toYUV422(K_SDRAM_ImagePlaybackBufAddr, ImagePara.Width, ImagePara.Height);
if (G_Playback_Mode == K_PLAYBACK_MODE_NINE)
{
if ((ImagePara.Width != G_TmbWidth) || (ImagePara.Height != G_TmbHeight))
{
L1_ScaleImage(K_SDRAM_ImagePlaybackBufAddr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackDisplayBufAddr, G_TmbWidth, G_TmbHeight, K_SDRAM_ImagePlaybackGeneralBufAddr);
}
}
//patch5.0@richie@sdram mapping end
}
else
{
if ((ImagePara.Width % 16) != 0x00)
{
TempWidth = (((ImagePara.Width + 16) >> 4) << 4);
}
else
{
TempWidth = ImagePara.Width;
}
if ((ImagePara.Height % 16) != 0x00)
{
TempHeight = (((ImagePara.Height + 16) >> 4) << 4);
}
else
{
TempHeight = ImagePara.Height;
}
//patch5.0@richie@sdram mapping begin
L2_DeCompress(ImagePara.Addr, TempWidth, TempHeight, K_SDRAM_ImagePlaybackBufAddr, 0x00, 0x05, DRI_MCU_Num);
L2_TransYUV420toYUV422(K_SDRAM_ImagePlaybackBufAddr, TempWidth, TempHeight);
if (G_Playback_Mode == K_PLAYBACK_MODE_NINE)
{
if ((TempWidth != G_TmbWidth) || (TempHeight != G_TmbHeight))
{
L1_ScaleImage(K_SDRAM_ImagePlaybackBufAddr, TempWidth, TempHeight, K_SDRAM_ImagePlaybackDisplayBufAddr, G_TmbWidth, G_TmbHeight, K_SDRAM_ImagePlaybackGeneralBufAddr);
}
}
//patch5.0@richie@sdram mapping end
}
}
else//YUV422 or other YUV format
{
if (ImagePara.DataType == K_File_DataType_YUV422)//YUV422
{
if (((ImagePara.Width % 8) == 0x00) && ((ImagePara.Height % 8) == 0x00) && (ImagePara.Width < 2048) && (ImagePara.Height < 2048))
{
//patch5.0@richie@sdram mapping begin
L2_DeCompress(ImagePara.Addr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackBufAddr , 0x00, 0x04, DRI_MCU_Num);
if (G_Playback_Mode == K_PLAYBACK_MODE_NINE)
{
if ((ImagePara.Width != G_TmbWidth) || (ImagePara.Height != G_TmbHeight))
{
L1_ScaleImage(K_SDRAM_ImagePlaybackBufAddr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackDisplayBufAddr, G_TmbWidth, G_TmbHeight, K_SDRAM_ImagePlaybackGeneralBufAddr);
}
}
//patch5.0@richie@sdram mapping end
}
else
{
//patch4.5.2@ada@Fix the bug to play non-uniform size image begin
//if ((ThumbPara.Width % 8) != 0x00)
//{
// TempWidth = (((ThumbPara.Width + 8) >> 3) << 3);
//}
if ((ImagePara.Width % 16) != 0x00)
{
TempWidth = (((ImagePara.Width + 16) >> 4) << 4);
}
//patch4.5.2@ada@Fix the bug to play non-uniform size image end
else
{
TempWidth = ImagePara.Width;
}
if ((ImagePara.Height % 8) != 0x00)
{
TempHeight = (((ImagePara.Height + 8) >> 3) << 3);
}
else
{
TempHeight = ImagePara.Height;
}
//patch5.0@richie@sdram mapping begin
L2_DeCompress(ImagePara.Addr, TempWidth, TempHeight, K_SDRAM_ImagePlaybackBufAddr , 0x00, 0x04, DRI_MCU_Num);
if (G_Playback_Mode == K_PLAYBACK_MODE_NINE)
{
if ((TempWidth != G_TmbWidth) || (TempHeight != G_TmbHeight))
{
L1_ScaleImage(K_SDRAM_ImagePlaybackBufAddr, TempWidth, TempHeight, K_SDRAM_ImagePlaybackDisplayBufAddr, G_TmbWidth, G_TmbHeight, K_SDRAM_ImagePlaybackGeneralBufAddr);
}
}
//patch5.0@richie@sdram mapping end
}
}
else//Other YUV format
{
sts = FALSE;
}
}
}
else//Reopen file error or parsing header error or image size not in range
{
sts = FALSE;
}
}
else//Not defined
{
sts = FALSE;
}
}
else//Other image format,not support
{
//printf("Other image format Jpeg_Exif_Format = %bx,not support\n",Jpeg_Exif_Format);
sts = FALSE;
}
}
}
else//Show whole image
{
if (sts)
{
if (ImagePara.DataType == K_File_DataType_YUV411)//YUV411
{
if (((ImagePara.Width % 16) == 0x00) && ((ImagePara.Height % 16) == 0x00) && (ImagePara.Width < 2048) && (ImagePara.Height < 2048))
{
//patch5.0@richie@sdram mapping begin
L2_DeCompress(ImagePara.Addr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackBufAddr, 0x00, 0x05, DRI_MCU_Num);
L2_TransYUV420toYUV422(K_SDRAM_ImagePlaybackBufAddr, ImagePara.Width, ImagePara.Height);
if ((ImagePara.Width != G_DSPHsize) || (ImagePara.Height != G_DSPVsize))
{
//herb for Playback bug @03/04/21 start
if(((G_DisplayType < 8)&&(reset_display == 1)&&(avi_play==0))||(SmallSizeAvi==1))
//L2_TurnOnOffDisplay(0);
L2_CtrlScreen(3);
//herb for Playback bug @03/04/21 end
L1_ScaleImage(K_SDRAM_ImagePlaybackBufAddr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackDisplayBufAddr, G_DSPHsize, G_DSPVsize, K_SDRAM_ImagePlaybackGeneralBufAddr);
}
//patch5.0@richie@sdram mapping end
}
else
{
if ((ImagePara.Width % 16) != 0x00)
{
TempWidth = (((ImagePara.Width + 16) >> 4) << 4);
}
else
{
TempWidth = ImagePara.Width;
}
if ((ImagePara.Height % 16) != 0x00)
{
TempHeight = (((ImagePara.Height + 16) >> 4) << 4);
}
else
{
TempHeight = ImagePara.Height;
}
//patch5.0@richie@sdram mapping begin
L2_DeCompress(ImagePara.Addr, TempWidth, TempHeight, K_SDRAM_ImagePlaybackBufAddr, 0x00, 0x05, DRI_MCU_Num);
L2_TransYUV420toYUV422(K_SDRAM_ImagePlaybackBufAddr, TempWidth, TempHeight);
if ((TempWidth != G_DSPHsize) || (TempHeight != G_DSPVsize))
{
//herb for Playback bug @03/04/21 start
if(((G_DisplayType < 8)&&(reset_display == 1)&&(avi_play==0))||(SmallSizeAvi==1))
//L2_TurnOnOffDisplay(0);
L2_CtrlScreen(3);
//herb for Playback bug @03/04/21 end
L1_ScaleImage(K_SDRAM_ImagePlaybackBufAddr, TempWidth, TempHeight, K_SDRAM_ImagePlaybackDisplayBufAddr, G_DSPHsize, G_DSPVsize, K_SDRAM_ImagePlaybackGeneralBufAddr);
}
//patch5.0@richie@sdram mapping end
}
}
else//YUV422 format or other YUV format
{
if (ImagePara.DataType == K_File_DataType_YUV422)//YUV422
{
if (((ImagePara.Width % 8) == 0x00) && ((ImagePara.Height % 8) == 0x00) && (ImagePara.Width < 2048) && (ImagePara.Height < 2048))
{
//patch5.0@richie@sdram mapping begin
L2_DeCompress(ImagePara.Addr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackBufAddr , 0x00, 0x04, DRI_MCU_Num);
//patch4.2@yichang@0520 for improving display speed
if ((ImagePara.Width != G_DSPHsize) || (ImagePara.Height != G_DSPVsize))
{
//herb for Playback bug @03/04/21 start
if(((G_DisplayType < 8)&&(reset_display == 1)&&(avi_play==0))||(SmallSizeAvi==1))
//L2_TurnOnOffDisplay(0);
L2_CtrlScreen(3);
//herb for Playback bug @03/04/21 end
L1_ScaleImage(K_SDRAM_ImagePlaybackBufAddr, ImagePara.Width, ImagePara.Height, K_SDRAM_ImagePlaybackDisplayBufAddr, G_DSPHsize, G_DSPVsize, K_SDRAM_ImagePlaybackGeneralBufAddr);
}
//patch5.0@richie@sdram mapping end
}
else
{
//patch4.5.2@ada@Fix the bug to play non-uniform size image begin
//if ((ThumbPara.Width % 8) != 0x00)
//{
// TempWidth = (((ThumbPara.Width + 8) >> 3) << 3);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -