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

Option to auto-adjust the level of 0 IRE based on the back porch #163

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

Stefan-Olt
Copy link

@Stefan-Olt Stefan-Olt commented Aug 31, 2024

This introduces the new option --ire0_adjust, which will calculate the value of 0 IRE like this:

  • It's all done in the hz_to_output function
  • The position of the back porch is set as an fixed attribute in the FieldNTSCShared and FieldPALShared classes
  • Calculate the median value of the back porch in each line (median is a better choice than mean, if there is for example a spike in the signal it will have no influence)
  • Sort the all median values and calculate the mean of the middle third. This will remove all values with very high/low back porch median (noise, tbc didn't work, sync lines) and only uses the "best third" for calculating the average
  • This value is used instead of the default ire0 value when subtracting ire0. This is only done when the input is a complete field, not for a single value
  • It deliberately does not do any calculation over multiple fields (floating average etc.), as formats like VHS-HQ or S-VHS have an offset every other field. This code is able to fully compensate that.

Proposal: As the VHS-HQ track_ire0_offset does not work reliable, as the track phase derived from chroma is not related to the track_ire0_offset phase and there doesn't seem to be away to figure the phase out, this code could be removed and selecting the VHS-HQ format could just result in turning on --ire0_adjust

@oyvindln oyvindln merged commit 6ebada8 into oyvindln:vhs_decode Sep 6, 2024
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

Successfully merging this pull request may close these issues.

2 participants