-
Notifications
You must be signed in to change notification settings - Fork 512
IMPROVEMENT: 1. simplified verify_parity function. 2.Improved documentat… #1921
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
base: master
Are you sure you want to change the base?
IMPROVEMENT: 1. simplified verify_parity function. 2.Improved documentat… #1921
Conversation
…ion for public function validate_cc_pair. 3. Added constant for 0x7F.
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit ec30a79...:
Your PR breaks these cases:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the improvements! The verify_parity simplification and the documentation are helpful.
However, there's a semantic issue with the constant usage. The value 0x7F is used for two different purposes in this code:
- As the solid blank character (0x7F = DEL/solid blank in CEA-608) - your constant is correct here
- As a parity bit mask (
& 0x7Fstrips bit 7) - this should NOT useCC_SOLID_BLANK
In do_cb_dtvcc, the expression (cc_block[1] & 0x7F) == 0 is masking off the parity bit to check if the 7 data bits are zero. This isn't related to the "solid blank" character - it's just that the mask happens to have the same value.
Please revert the changes in do_cb_dtvcc (lines ~315-316 in your diff) to keep & 0x7F as a literal, or create a separate PARITY_MASK constant. The constant usage in validate_cc_pair is correct.
Also, consider using /// for Rust doc comments instead of //.
That makes sense. It is definitely confusing to use the blank character constant when performing bit masking. I’ll define a separate PARITY_MASK constant for this usage. Resolving the documentation comments too. |
bbd398d to
f5f4768
Compare
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit fd15528...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
…ion for public function validate_cc_pair. 3. Added constant for 0x7F.
[IMPROVEMENT]
In raising this pull request, I confirm the following
My familiarity with the project is as follows:
##Changes Made
CC_BLANK_SPACE.validate_cc_pair.##Tests
✅ All existing tests passed.