BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: JPEG conversion with EVE Asset Builder to output format PNG/JPEG  (Read 10212 times)

rsc

  • Newbie
  • *
  • Posts: 10
    • View Profile
JPEG conversion with EVE Asset Builder to output format PNG/JPEG
« on: September 10, 2019, 12:21:46 PM »

Hello,
I have noticed the following:
We use a 32bit PIC and the FT813. The communication takes place via the SPI bus with 10Mbaud.
When I convert a jpeg image in the EVE Asset Builder 1.0 with the output format PNG / JPEG, then convert the image in HxD into a hexfile and embed it in the program, the image is displayed correctly. However, the end address of the file is read out incorrectly. There is always the start address again in it. The width and height of the picture are returned correctly.
The end addresses of the png files are correctly returned (conversion in the EVE Asset Builder 1.0 to output format RGB565). The following pictures then overlay the picture because they get wrong start address.
Is that a bug or am I doing something wrong?

Best regards
rsc
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 742
    • View Profile
Re: JPEG conversion with EVE Asset Builder to output format PNG/JPEG
« Reply #1 on: September 11, 2019, 09:39:13 AM »

Hi,

Could you advise which code you use to load the file, to check the end address, and to display the image? Could you also attach (or send to our support address support.emea@brtchip.com) an example folder with the pre- and post- converted files.

Best Regards,
BRT Community
Logged

rsc

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: JPEG conversion with EVE Asset Builder to output format PNG/JPEG
« Reply #2 on: September 11, 2019, 12:52:42 PM »

Hi,

as already described, if i read out the end address i get the start address. See lines:
ParameterAddr = ((Reg_Cmd_Write_Offset - 12) & 4095);                       // Go back by 12 bytes to get end address parameter
End_Address = EVE_MemRead32((RAM_CMD + ParameterAddr));

used pic:
home_v4.jpg JPEG to show on display
home_v4_converted.jpg generated with EAB 1.0 in Output Format: PNG/JPEG (EVE Product Range: FT81x)
home_v4_converted.h generated with HxD tool

// var
extern unsigned char u8f_MainHomeJPG_60x60[2649]; // home_v4_converted.h converted and generated header file for home_v4.jpg

//code
void main(void)
{
    uint32_t u32_ErrorCode = (uint32_t)e_NO_ERROR;
   
    u32_ErrorCode = u32_MCUconfig_SystemInit(); // RSC timer 1 active!!!
       
    if ( (uint32_t)e_NO_ERROR == u32_ErrorCode )
    {
        v_MCUconfig_App();  // MCU app init
       
        APP_Init();         // EVE initialisation
    }
   
   
    if ( (uint32_t)e_NO_ERROR == u32_ErrorCode )
    {
 
        APP_LoadImageRSC_JPG();

    }
   
   
    while ( 1 )
    {

    }//end of while   
   
}

//----------------------------------------------------------------------------------------------------------

void APP_LoadImageRSC_JPG(void)
{
    uint16_t Reg_Cmd_Write_Offset = 0;
    uint16_t ParameterAddr = 0;
    uint32_t End_Address = 0;
    uint32_t Width = 0;
    uint32_t Height = 0;
    uint32_t StartAddress = 0;
       
    API_LIB_BeginCoProList();                                                   // Begin new co-processor list
    API_CMD_LOADIMAGE(StartAddress,0);                                          // Load image command. Extract data to RAM_G + 0, options = 0
    API_LIB_EndCoProList();                                                     // Finish the co-processor list
    API_LIB_WriteDataToCMD(u8f_MainHomeJPG_60x60, sizeof(u8f_MainHomeJPG_60x60)); // Send data immediately after the command (since we don't select MEDIAFIFO as source in Options))
    API_LIB_AwaitCoProEmpty();                                                  // Await completion of the Load Image. Image will now be in RAM_G
       
    // ###### Check parameters of decompressed image ########
    API_LIB_BeginCoProList();                                                   // Begin co-pro list
    API_CMD_GETPROPS(0, 0, 0);                                                  // GetProps command with three dummy 32-bit values
    API_LIB_EndCoProList();                                                     // Finish the co-processor list
    API_LIB_AwaitCoProEmpty();                                                  // Await the command completion

    Reg_Cmd_Write_Offset = EVE_MemRead16(REG_CMD_WRITE);                        // Check current pointer value

    ParameterAddr = ((Reg_Cmd_Write_Offset - 12) & 4095);                       // Go back by 12 bytes to get end address parameter
    End_Address = EVE_MemRead32((RAM_CMD + ParameterAddr));

    ParameterAddr = ((Reg_Cmd_Write_Offset - 8) & 4095);                        // Go back by 8 bytes to get width parameter
    Width = EVE_MemRead32((RAM_CMD+ParameterAddr));   

    ParameterAddr = ((Reg_Cmd_Write_Offset - 4) & 4095);                        // Go back by 4 bytes to get height parameter
    Height = EVE_MemRead32((RAM_CMD+ParameterAddr));   
   
    // ######################################################     

    API_LIB_BeginCoProList();                                                   // Begin new screen
    API_CMD_DLSTART();                                                          // Tell co-processor to create new Display List
    API_CLEAR_COLOR_RGB(0, 0, 0);                                               // Specify color to clear screen to
    API_CLEAR(1,1,1);                                                           // Clear color, stencil, and tag buffer
    API_COLOR_RGB(255,255,255);                                                 // White colour will display image with original colours
   
    API_BITMAP_HANDLE(0);                                                       // Tell FT81x the properties of the bitmap we will display.
    API_CMD_SETBITMAP( 0, RGB565, Width, Height); // source (RAMG), Format, size_x, size_y
       
    API_BEGIN(BITMAPS);     
    API_VERTEX2II( 100, 100, 0, 0); // x, y, handle, cell                                                // Display image at (200,200)
    API_END();
   
    // ###### OPTIONAL SECTION - print parameters of decompressed image ########
//    API_COLOR_RGB(255,255,255);                                                 // Print labels
//    API_CMD_TEXT(300, 200, 28, 0, "End Addr");
//    API_CMD_TEXT(300, 240, 28, 0, "Width");   
//    API_CMD_TEXT(300, 280, 28, 0, "Height");   
//   
//    API_CMD_NUMBER(400, 200, 28, 0, End_Address);                               // Print associated values
//    API_CMD_NUMBER(400, 240, 28, 0, Width);
//    API_CMD_NUMBER(400, 280, 28, 0, Height);
//    API_CMD_SETBASE(16);
//    API_CMD_NUMBER(500, 200, 28, 0, End_Address);
    // ######  END OF OPTIONAL SECTION - print parameters of decompressed image ########

    API_DISPLAY();                                                              // Tell EVE that this is end of list
    API_CMD_SWAP();                                                             // Swap buffers in EVE to make this list active
    API_LIB_EndCoProList();                                                     // Finish the co-processor list burst write
    API_LIB_AwaitCoProEmpty();                                                  // Wait until co-processor has consumed all commands
   
   //APP_SnapShot2PPM();                                                        // Un-comment to take snapshot (see BRT_AN_014)
   
    while(1)
    {
    }
}

Thanks.

Best Regards
rsc
Logged

BRT Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 742
    • View Profile
Re: JPEG conversion with EVE Asset Builder to output format PNG/JPEG
« Reply #3 on: September 12, 2019, 10:41:16 AM »

Thanks, we will try it here and report back,
Best Regards, BRT Community
Logged