diff options
| author | Pierre-Anthony Lemieux <pal@palemieux.com> | 2019-11-28 10:58:15 -0800 |
|---|---|---|
| committer | Pierre-Anthony Lemieux <pal@palemieux.com> | 2019-11-28 10:58:15 -0800 |
| commit | 2a1a0da4f67debb7dcfd01b885dad35279f27663 (patch) | |
| tree | a9d63ba3ca95aa0b7837310b61685312b3d12824 /src/JP2K_Codestream_Parser.cpp | |
| parent | 20c2f749a4593c418259bcf8b5f6f0775b70d910 (diff) | |
Added support for CAP, PRF and CPF markers
Improved Marker vs Marker Segment discrimination
Diffstat (limited to 'src/JP2K_Codestream_Parser.cpp')
| -rwxr-xr-x | src/JP2K_Codestream_Parser.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/JP2K_Codestream_Parser.cpp b/src/JP2K_Codestream_Parser.cpp index 0ed2649..43665e6 100755 --- a/src/JP2K_Codestream_Parser.cpp +++ b/src/JP2K_Codestream_Parser.cpp @@ -178,6 +178,71 @@ ASDCP::JP2K::ParseMetadataIntoDesc(const FrameBuffer& FB, PictureDescriptor& PDe memcpy(&PDesc.QuantizationDefault, NextMarker.m_Data, NextMarker.m_DataSize); PDesc.QuantizationDefault.SPqcdLength = NextMarker.m_DataSize - 1; break; + + case MRK_CAP: + { + Accessor::CAP CAP_(NextMarker); + + PDesc.ExtendedCapabilities.Pcap = CAP_.pcap(); + + for(i32_t b = 32, i = 1; b > 0; b--) { + + if ( (PDesc.ExtendedCapabilities.Pcap >> (b - 1)) & 0x1 ) { + + PDesc.ExtendedCapabilities.Ccap[32 - b] = CAP_.ccap(i++); + + } else { + + PDesc.ExtendedCapabilities.Ccap[32 - b] = 0; + + } + + } + } + break; + + case MRK_PRF: + { + Accessor::PRF PRF_(NextMarker); + + ui16_t n = PRF_.N(); + + if ( n > MaxPRFN ) + { + DefaultLogSink().Error("Number (%d) of Pprf^i exceeds maximum supported\n", n); + return RESULT_RAW_FORMAT; + } + + PDesc.Profile.N = n; + + for(i32_t i = 0; i < n ; i++) { + + PDesc.Profile.Pprf[i] = PRF_.pprf(i+1); + } + } + break; + + case MRK_CPF: + { + Accessor::CPF CPF_(NextMarker); + + ui16_t n = CPF_.N(); + + if ( n > MaxCPFN ) + { + DefaultLogSink().Error("Number (%d) of Pcpf^i exceeds maximum supported\n", n); + return RESULT_RAW_FORMAT; + } + + PDesc.CorrespondingProfile.N = n; + + for(i32_t i = 0; i < n; i++) { + + PDesc.CorrespondingProfile.Pcpf[i] = CPF_.pcpf(i+1); + } + } + break; + } } |
