Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

System.TypeLoadException in JPEG Decoder

diggi62
Beginner
617 Views
Hi

I use the decoder from the JPEG-Viewer example in my own Visual Studio managed C++ project, but I get always a System.TypeLoadException for DecodeHuffmanState.

I get this calling ippiDecodeHuffmanStateInit_JPEG_8u().
The JPEG Viewer is working properly, so I think there is no library missing.

Is there any idea how to solve this?

Regards

Thomas
0 Kudos
2 Replies
Vladimir_Dudnik
Employee
617 Views

Hi Thomas,

I'm not sure I understood your issue. You said that you get exception on ippiDecodeHuffmanStateInit_JPEG_8u function, but at the same time you said that JPEGViewer is working properly. It should not work if this function work incorrectly.

By the way, what processor and OS do you use? Is it EM64T based system?

Regards,
Vladimir

0 Kudos
Vladimir_Dudnik
Employee
617 Views

Just in case, there is some comments from out expert

According C# documentation

TypeLoadException is thrown when the common language runtime cannot find the assembly, the type within the assembly, or cannot load the type.

in our IPP sample we did that in such a way

[StructLayout(LayoutKind.Sequential)] public struct IppiDecodeHuffmanState {}; // hidden or own structure

// decoder

public IppiDecodeHuffmanState* m_state;
int size;
ippiDecodeHuffmanStateGetBufSize_JPEG_8u(&size);
byte[] buf = new byte[size];
fixed( byte* p=buf ) m_state = (IppiDecodeHuffmanState*)p;
ippiDecodeHuffmanStateInit_JPEG_8u(m_state);

Regards,
Vladimir

0 Kudos
Reply