diff options
| author | Pierre-Anthony Lemieux <pal@palemieux.com> | 2019-12-17 12:05:00 -0800 |
|---|---|---|
| committer | Pierre-Anthony Lemieux <pal@palemieux.com> | 2019-12-17 12:05:07 -0800 |
| commit | 166e7b4b202bc8febb13b59710579fbbd724e2b6 (patch) | |
| tree | bc373d2105a9ef67b8cd4e3ca5593c0bca9a1c24 /src/JP2K_Codestream_Parser.cpp | |
| parent | dd3acfff947ca52e1a3260243cb38f7035626282 (diff) | |
- Added support for optional CPF, CAP and PRF segments
- Fixed encoding of J2KExtendedCapabilities
Diffstat (limited to 'src/JP2K_Codestream_Parser.cpp')
| -rwxr-xr-x | src/JP2K_Codestream_Parser.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
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; |
