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_format_idc value for baseline profile #103

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

hsnks100
Copy link
Contributor

@hsnks100 hsnks100 commented Jan 9, 2024

There is a bug in sps in h.264 base, main, and extended that does not provide accurate values when estimating resolution (width, height).

The default value of chroma_format_idc for 66, 77, 88 (base, main, extended) should be set to 1 (4:2:0).

Height(....) {
...
var cropUnitY uint32
if chromaArrayType == 0 {
cropUnitY = 2 - frameMbsOnlyFlagUint32
} else {
cropUnitY = subHeightC * (2 - frameMbsOnlyFlagUint32)
}
}

Correctly estimates cropUnitY.

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3937359) 84.35% compared to head (9f2ad56) 84.24%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #103      +/-   ##
==========================================
- Coverage   84.35%   84.24%   -0.11%     
==========================================
  Files          72       72              
  Lines        5580     5580              
==========================================
- Hits         4707     4701       -6     
- Misses        650      652       +2     
- Partials      223      227       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines -125 to +126
1084,
1080,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1080 is the correct value

@aler9
Copy link
Member

aler9 commented Jan 10, 2024

hello, thanks for spotting the error, i checked the specification (ITU-T H264) and it confirms that when chroma_format_idc is not set, its value shall be 1.

@aler9 aler9 merged commit 1e7cfdf into bluenviron:main Jan 10, 2024
7 of 8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants