From 166e7b4b202bc8febb13b59710579fbbd724e2b6 Mon Sep 17 00:00:00 2001 From: Pierre-Anthony Lemieux Date: Tue, 17 Dec 2019 12:05:00 -0800 Subject: - Added support for optional CPF, CAP and PRF segments - Fixed encoding of J2KExtendedCapabilities --- src/JP2K_Codestream_Parser.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/JP2K_Codestream_Parser.cpp') diff --git a/src/JP2K_Codestream_Parser.cpp b/src/JP2K_Codestream_Parser.cpp index 43665e6..9d55409 100755 --- a/src/JP2K_Codestream_Parser.cpp +++ b/src/JP2K_Codestream_Parser.cpp @@ -101,6 +101,12 @@ ASDCP::JP2K::ParseMetadataIntoDesc(const FrameBuffer& FB, PictureDescriptor& PDe const byte_t* p = FB.RoData(); const byte_t* end_p = p + FB.Size(); + /* initialize optional items */ + + PDesc.ExtendedCapabilities.N = JP2K::NoExtendedCapabilitiesSignaled; + PDesc.Profile.N = 0; + PDesc.CorrespondingProfile.N = 0; + while ( p < end_p && ASDCP_SUCCESS(result) ) { result = GetNextMarker(&p, NextMarker); @@ -185,19 +191,14 @@ ASDCP::JP2K::ParseMetadataIntoDesc(const FrameBuffer& FB, PictureDescriptor& PDe PDesc.ExtendedCapabilities.Pcap = CAP_.pcap(); - for(i32_t b = 32, i = 1; b > 0; b--) { - - if ( (PDesc.ExtendedCapabilities.Pcap >> (b - 1)) & 0x1 ) { + PDesc.ExtendedCapabilities.N = CAP_.N(); - PDesc.ExtendedCapabilities.Ccap[32 - b] = CAP_.ccap(i++); + for (i32_t i = 0; i < CAP_.N(); i++) { - } else { - - PDesc.ExtendedCapabilities.Ccap[32 - b] = 0; - - } + PDesc.ExtendedCapabilities.Ccap[i] = CAP_.ccap(i); } + } break; -- cgit v1.2.3