AnsweredAssumed Answered

Anybody using the Blackfin JPEG Decoder v3.1.1 ?

Question asked by StevenJAckerman on Aug 12, 2009
Latest reply on Aug 14, 2009 by StevenJAckerman

I'm having problems with the decoder function: JPEG_DecodeSequentialImage() corrupting the heap.

 

Running a BF-531 on our own hardware: http://www.cfsound.com

 

I've added TRACE information via printfs to the user interface and main functions and it appears that the decoder is corrupting the heap:

 

JPEG Decoder Test v1.0 on Aug 11 2009 10:47:59
Jpeg2wFrameBuffer()

_heap_print_heaps: __nheaps: 0

JPEG_Param_INIT(0x809AD4) Success !
JPEG_MemAlloc_NEW(950)
JPEG_MemAlloc_NEW(950, 1, 0) Success !

_heap_print_heaps: __nheaps: 3
Heap: 0 (UID: 0), 0x01804020 -> 0x019ffffb (0x001fbfdc bytes, 0x00000200 claimed)
Free blocks in heap:
0x01804038, 0x000001f0 bytes
Heap: 1 (UID: 1), 0x01a00020 -> 0x01bffffb (0x001fffdc bytes, 0x00000000 claimed)
Heap: 2 (UID: 2), 0x01800020 -> 0x01803ffb (0x00003fdc bytes, 0x000003c0 claimed)

JPEG_MemAlloc_ADDRESS(0x1804028)
JPEG_Param_CONFIG(0x809AD4, 6, 8428224)
JPEG_Decoder_NEW(0x809AD4)
JPEG_MemAlloc_NEW(1, 496, 2)
JPEG_MemAlloc_ADDRESS(0x1804038)
JPEG_McuBuffer_NEW()
JPEG_MemAlloc_NEW(1, 120, 2)
JPEG_MemAlloc_ADDRESS(0x1804048)
JPEG_MemAlloc_NEW(20, 4, 2)
JPEG_BitsBuffer_NEW()
JPEG_MemAlloc_NEW(1, 88, 2)
JPEG_MemAlloc_ADDRESS(0x1804068)
JPEG_MemAlloc_NEW(1, 1024, 0)
JPEG_MemAlloc_ADDRESS(0x1804078)
JPEG_MemAlloc_NEW(1, 1024, 0)
JPEG_MemAlloc_ADDRESS(0x1804088)
JPEG_BitsBuffer_CONFIG(0x18006C0, 1, 0)
JPEG_BitsBuffer_CONFIG(0x18006C0, 0, 8428224)
JPEG_BitsBuffer_INIT(0x18006C0)
JPEG_MemAlloc_NEW(1, 40, 1)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x1804098)
JPEG_MemAlloc_NEW(1, 20, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x18040A8) Success ! => JpegDecoder:0x18003E8

_heap_print_heaps: __nheaps: 3
Heap: 0 (UID: 0), 0x01804020 -> 0x019ffffb (0x001fbfdc bytes, 0x00000200 claimed)
Free blocks in heap:
0x018040b8, 0x00000170 bytes
Heap: 1 (UID: 1), 0x01a00020 -> 0x01bffffb (0x001fffdc bytes, 0x00000000 claimed)
Heap: 2 (UID: 2), 0x01800020 -> 0x01803ffb (0x00003fdc bytes, 0x00000fd0 claimed)
Free blocks in heap:
0x01800f80, 0x00000078 bytes

JPEG_ProcessHeader(0x18003E8, 0x809AD4)
JPEG_MemAlloc_NEW(1, 2496, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x18040B8)
JPEG_MemAlloc_NEW(1, 48, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x18040C8)
JPEG_MemAlloc_NEW(1, 52, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x18040D8)
JPEG_MemAlloc_NEW(1, 96, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x18040E8)
JPEG_MemAlloc_NEW(1, 2496, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x18040F8)
JPEG_MemAlloc_NEW(1, 704, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x1804108)
JPEG_MemAlloc_NEW(1, 708, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x1804118)
JPEG_MemAlloc_NEW(1, 1408, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x1804128)
JPEG_BitsBuffer_RESET(0x18006C0)
JPEG_BitsBuffer_READ(0x18006C0)
JPEG_BitsBuffer_PROCESS(0x18006C0, 0x1800F44)
JPEG_ApplicationSegParse(0xFF8056D8,    65504, 0x1800560) => Marker: ffe0, Identifier:JFIF, Length:14 bytes
JPEG_ApplicationSegParse(0xFF8056D8,    65505, 0x1800560) => Marker: ffe1, Identifier:Exif, Length:100 bytes
JPEG_MemAlloc_NEW(1, 288, 2)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_ADDRESS(0x1804138) Success !

_heap_print_heaps: __nheaps: 3
Heap: 0 (UID: 0), 0x01804020 -> 0x019ffffb (0x001fbfdc bytes, 0x00000200 claimed)
Free blocks in heap:
0x01804148, 0x000000e0 bytes
Heap: 1 (UID: 1), 0x01a00020 -> 0x01bffffb (0x001fffdc bytes, 0x00000000 claimed)
Heap: 2 (UID: 2), 0x01800020 -> 0x01803ffb (0x00003fdc bytes, 0x00003080 claimed)
Free blocks in heap:
0x01803038, 0x00000070 bytes

JPEG_Param_STATUS(0x809AD4) => Width:16, Height:16, FrameFormat:1, CodingType:1
JPEG_MemAllow_NEW(384)
JPEG_MemAlloc_NEW(384, 1, 0) Success ! => 0x1804148

_heap_print_heaps: __nheaps: 3
Heap: 0 (UID: 0), 0x01804020 -> 0x019ffffb (0x001fbfdc bytes, 0x00000200 claimed)
Free blocks in heap:
0x01804158, 0x000000d0 bytes
Heap: 1 (UID: 1), 0x01a00020 -> 0x01bffffb (0x001fffdc bytes, 0x00000000 claimed)
Heap: 2 (UID: 2), 0x01800020 -> 0x01803ffb (0x00003fdc bytes, 0x00003280 claimed)
Free blocks in heap:
0x018031c0, 0x000000e8 bytes

JPEG_MemAlloc_ADDRESS(0x1804148)
JPEG_Param_CONFIG(0x809AD4, 7, 8428240)
JPEG_DecodeSequentialImage(0x18003E8, 0x809AD4)
JPEG_McuBuffer_CONFIG(0x18005E8, 9, 0) => MCU_ENCODER: 0
JPEG_McuBuffer_CONFIG(0x18005E8, 3, 16) => MCU_FRAME_WIDTH: 16
JPEG_McuBuffer_CONFIG(0x18005E8, 4, 16) => MCU_FRAME_HEIGHT: 16
JPEG_McuBuffer_CONFIG(0x18005E8, 8, 1) => MCU_ENCODING_MODE: 1
JPEG_McuBuffer_CONFIG(0x18005E8, 6, 8) => MCU_ORIGINAL_FRAME_WIDTH: 8
JPEG_McuBuffer_CONFIG(0x18005E8, 7, 8) => MCU_ORIGINAL_FRAME_HEIGHT: 8
JPEG_McuBuffer_CONFIG(0x18005E8, 5, 1) => MCU_IMAGE_FORMAT: 1
JPEG_McuBuffer_CONFIG(0x18005E8, 0, 8428240) => MCU_POINTER_C1: 0x809AD0
JPEG_McuBuffer_INIT(0x18005E8)
JPEG_MemAlloc_NEW(1, 32, 2)
JPEG_MemAlloc_ADDRESS(0x1804158)
JPEG_MemAlloc_NEW(1, 3072, 0)
JPEG_MemAlloc_ADDRESS(0x1804168)
JPEG_McuBuffer_RESET(0x18005E8)
JPEG_McuBuffer_REQUEST(0x18005E8)
JPEG_BitsBuffer_RELEASE(0x18006C0)
JPEG_BitsBuffer_READ(0x18006C0)
JPEG_BitsBuffer_PROCESS(0x18006C0, 0x1800F44)
JPEG_McuBuffer_WRITE(0x18005E8)
sStore420McuBuffer(0x18005E8)
sStoreMcuBuffer(0x809AD0, 0x1A00028, 0, 0, 16)
sStoreMcuBuffer(0x809AD0, 0x1A00068, 8, 0, 16)
sStoreMcuBuffer(0x809AD0, 0x1A000A8, 0, 8, 16)
sStoreMcuBuffer(0x809AD0, 0x1A000E8, 8, 8, 16)
sStoreMcuBuffer(0x809BD0, 0x1A00128, 0, 0, 8)
sStoreMcuBuffer(0x809C10, 0x1A00168, 0, 0, 8)

_heap_print_heaps: __nheaps: 2324335242

JPEG_Param_STATUS(0x809AD4) => Width:16, Height:16, FrameFormat:1280068684
Success RGB image !

_heap_print_heaps: __nheaps: 2324335242

JPEG_Decoder_DELETE(0x18003E8)
JPEG_MemAlloc_ADDRESS(0x1804058)
JPEG_MemAlloc_DELETE(0x1804138)Exception 0x0000c024 at PC=0x31B6
Misaligned data access at PC=0x31B6
while reading address 0x8A8A8A98 via DAG1

 

Is anybody using this decoder and can provide some direction ?

 

Thank you.

Outcomes