Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pcap field bit 15 #10

Closed
boxerab opened this issue Dec 26, 2019 · 5 comments
Closed

Pcap field bit 15 #10

boxerab opened this issue Dec 26, 2019 · 5 comments

Comments

@boxerab
Copy link
Contributor

boxerab commented Dec 26, 2019

This line:

Pcap = 0x00020000; //for jph, Pcap^15 must be set

Here, you are setting 17th bit of Pcap.

Also, is the Pcap field not 16 bits ?

@aous72
Copy link
Owner

aous72 commented Dec 26, 2019

Pcap is 32 bits. Whenever a Pcap bit is set, a corresponding Ccap field shall be included in the CAP header; Ccap is 16 bits.

Pcap bits are counted from the most significant bit; perhaps, this is due to the big-endianness. For HTJ2K, Pcap^15 should be set. Perhaps the comment can be improved by saying "for jph, Pcap^15 must be set; the 15th MSB bit." I know this might seem weird, but this is how it is.

Cheers,
Aous

@aous72 aous72 closed this as completed Dec 26, 2019
aous72 added a commit that referenced this issue Dec 26, 2019
@boxerab
Copy link
Contributor Author

boxerab commented Dec 26, 2019

Thanks, Aous. Yes, it is weird :) It's not clear from the standard that this is the case, and I couldn't find where it specifies that Pcap is 32 bits. Thanks for clarifying this :)

@boxerab
Copy link
Contributor Author

boxerab commented Dec 26, 2019

Actually, I still don't think this is correct :) Even if it is big endian, the 15th MSB bit set should be
0x00008000 rather than 0x00020000 which is the 17th MSB.

@aous72
Copy link
Owner

aous72 commented Dec 27, 2019

Pcap is not in the original Part 1. It was added later. It is in the latest edition of Part 1.

The attached picture should make it clear; Pcap15 indicates JPH -- Perhaps describing it as 15th MSB is still not very clear.
Screen Shot 2019-12-27 at 11 28 58 am

It is weird because it is counted from the MSB, and because it starts with 1, not 0.
Cheers,
Aous.

Edit: corrected "addition" to "edition"

@boxerab
Copy link
Contributor Author

boxerab commented Dec 27, 2019

Alright, I think I understand :) , but yes, I find this unusual.
Thanks,
Aaron

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants