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

Can give me jpeg2000 decode sample from memory?

mozartisme
Beginner
278 Views

Dear Sir:

I want to decode jpeg2000 codestream from network. I can find the decode sample from Intel which only can decode from a file.

jp2Stream.Open(options.SrcFileName());

....

I had tried to edit it to decode the data from network. But I can not success. I hope you can help me. give me a sample code.

Thanks a lot!

mozart

0 Kudos
1 Reply
Mikhail_Kulikov__Int
New Contributor I
278 Views

Dear Mozart:

jp2Stream is an instance of MapFileBoundedInputBE, soit's not network stream:)
But nothing special with network as well, you just need towrap your own stream with Read/Write functionality named as required (for example look into .srccommonstreammemorystream.h), something like the following

class NetworkInput {
...
Ipp8u Read8u() { ... /* obtain byte from network*/ }
void Read(Ipp8u *dst, unsigned int size) { ... /* fill buffer by data from network */ }

Than you need to add to your stream ready-made functionality of BELE:

typedef ByteInputSigned > NetworkInputBE;

After this just put some work-around about nested data boundary problem:

class NetworkBoundedInputBE : public ByteInputBoundService
{
public:
...
void Connect(...) { NetworkInput::Connect(...); PushSize(0xFFFFFFFF); }
void Disconnect() { NetworkInput::Disconnect(); PopSize(); }
};

Now it's ready to substitute in decoder:

DJP2Codestream j2kCodestream;

an you may work with it to read and decode JPEG 2000 data from network.

With Best Regards,
Mikhail

0 Kudos
Reply