Hi,
I am using OpenJPEG to acts as the decoder for an mpeg transport stream containing a stream of jpeg2000 images that is being received over UDP. I have decapsulated the data from the transport stream, and can decode each image with a sequence of opj_create_decompress, opj_read_header and opj_decode (I have a simple stream implementation that allows OpenJPEG to read the data form memory so I don't need to go via the disk).
To try to improve performance, I was hoping to only perform the obj_create_decompress and opj_read_header steps once on the first frame, and to then just repeatedly call opj_decode on that and all subsequent frames. If I try that, then no errors are returned, but I just continually get back the first decoded frame. It looks like opj_j2k_read_tile_header is returning due to the decode state being J2K_STATE_EOC.
So should I be expecting to run the decoder in this way, or is the correct approach to just create a brand new decoder for every frame?
Cheers,
Steve