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

Fix chroma encoding in NTSCEncoder #789

Merged
merged 1 commit into from
Aug 29, 2022

Conversation

atsampson
Copy link
Collaborator

This should fix the encoding problem identified in the discussion for #787 - I ended up reworking how it figures out the phase offset for each sample, and fixing how it outputs phaseID to the metadata. This includes @oyvindln's change to Comb from #787 so the tests will pass (but the other change in #787 should rebase cleanly on top of this).

(Note that the output is still offset to the right when compared with ld-decode's output for both PAL and NTSC - this is because it's following SMPTE 244M/EBU Tech 3280 by having each line contain all the blanking samples, then all the active samples, whereas ld-decode starts each line with the sample immediately before 0H.)

CC @oyvindln and @ifb.

The 33-degree (or 57-degree) phase offset wasn't being added
consistently, so the output samples didn't have the phase relationship
the non-adaptive NTSC encoder expected. Rework prevCycles so that it's
taken care of there, which then makes the rest of the code look more
like the PAL version.

Output the phaseID metadata field as 1-based, not 0-based -- this was
the reason for the odd behaviour with the third field.

For both PAL and NTSC, add a note about which samples are included in
each line and how it differs from what ld-decode outputs.

Finally, remove the 10-degree offset in Comb, since the phase
relationship between the burst and chroma is now correct (patch from
@oyvindln).
@atsampson atsampson added bug ld-decode-tools An issue only affecting the ld-decode-tools labels Aug 29, 2022
@atsampson atsampson added this to the Revision 7 milestone Aug 29, 2022
@ifb
Copy link
Contributor

ifb commented Aug 29, 2022

Looks good to me. Thanks!

@atsampson atsampson merged commit 34557d8 into happycube:master Aug 29, 2022
@atsampson atsampson deleted the ntscencoderfix branch August 29, 2022 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ld-decode-tools An issue only affecting the ld-decode-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants