AnsweredAssumed Answered

JPEG encoder library - missing files? Can't get examples to work.

Question asked by ExtrasensorySystems on May 18, 2011
Latest reply on May 31, 2011 by ExtrasensorySystems

Dear all -  (sweet, clever, beautiful, nice, lovely all)
I'm in a pinch.


I have been trying to get the JPEG libraries to work for a couple of days now. I am not super experienced in the VisualDSP++ details around linking, so I have had a few challenges.


I am trying to get the JPEG Encode library examples or my own code to run on my own board, which is a pretty plain vanilla BF533 with a 16M16 SDRAM chip. I have the SDRAM working and I get an image stream in ... I just can't figure out how to encode the images.


When I try my own application, I run into a problem in the memory allocation. The function to allocate the encoder


if(JPEG_EncodeSequentialImage(lBaseJpegEnc, &NumBytes) != 1) {
       perror("Encoding process failed.\n");


kicks out and I speculate it is because I don't have the right sizes of heap etc. I have tried to find a good .ldf example to copy, but something may be wrong with what I am doing. I have:


   MEM_L1_SCRATCH          { TYPE(RAM) START(0xFFB00000) END(0xFFB00FFF) WIDTH(8) }
   MEM_L1_CODE             { TYPE(RAM) START(0xFFA00000) END(0xFFA13FFF) WIDTH(8) }
   MEM_L1_DATA_A           { TYPE(RAM) START(0xFF800000) END(0xFF807FFF) WIDTH(8) }
   MEM_L1_DATA_B           { TYPE(RAM) START(0xFF900000) END(0xFF907FFF) WIDTH(8) }
   MEM_SDRAM0_BANK1  { TYPE(RAM) WIDTH(8) START(0x00000004) END(0x003fffff) }
   MEM_SDRAM0_BANK2  { TYPE(RAM) WIDTH(8) START(0x00800000) END(0x00Bfffff) }
   MEM_SDRAM0_BANK3  { TYPE(RAM) WIDTH(8) START(0x01000000) END(0x013fffff) }
   MEM_SDRAM0_BANK4  { TYPE(RAM) WIDTH(8) START(0x01800000) END(0x01Bfffff) }


-   in MEM_L1_CODE


- in MEM_L1_DATA_A
   RESERVE(heaps_and_stack_in_L1_data_a, heaps_and_stack_in_L1_data_a_length = 2048,4)




         RESERVE_EXPAND(heaps_and_stack_in_L1_data_a, heaps_and_stack_in_L1_data_a_length , 0, 4)
         ldf_stack_space = heaps_and_stack_in_L1_data_a;
         ldf_stack_end = (ldf_stack_space + (heaps_and_stack_in_L1_data_a_length - 4)) & 0xfffffffc;
      } > MEM_L1_DATA_A


I am calling JPEG_EncodeSequentialImage(lBaseJpegEnc, &NumBytes)  and have eliminated the unused symbols, so the data should be big enough..

I have also tried other things, like putting a 24K L1_data_a_stack_heap in SDRAM. The call to create the JPEG encoder still fails.

Then I threw myself at the examples from the SDK 4.10 and the JPEG release 3.1.1

None can compile with update 9 of VisualDSP++ 5.0 Not even a clean install on another machine.


In each case I get:

[Error li1040] ".\JPEG_Enc_FileIO_BF533.ldf":299 Out of memory in output section 'L1_data_a_1' in processor 'p0'
        Total of 0x6000 word(s) were not mapped.

The .ldf file appears to have allocated

MEM_L1_DATA_A           { TYPE(RAM) START(0xFF800000) END(0xFF803FFF) WIDTH(8) }


yet tries to get 24K out of the 16K in the later line...


RESERVE(heaps_and_stack_in_L1_data_a, heaps_and_stack_in_L1_data_a_length = 24576,4)
      } > MEM_L1_DATA_A


On one machine, I am completely missing adi_dev_class.c - the examples can't find it. The entire directory is not there.

On my Windows7 clean install - they are there !!



Could somebody please, please help me make a dent in this?