Skip to content

encoder: default msbShift for >8-bit input#222

Open
crmurillo wants to merge 1 commit into
KhronosGroup:mainfrom
crmurillo:fix_10bit_msbshift
Open

encoder: default msbShift for >8-bit input#222
crmurillo wants to merge 1 commit into
KhronosGroup:mainfrom
crmurillo:fix_10bit_msbshift

Conversation

@crmurillo

Copy link
Copy Markdown
Contributor

Description

The compute-filter input path only shifts 10/12-bit samples into the most-significant bits when input.msbShift > 0, but the default is -1. So without an explicit --msbShift, high bit-depth input reached the encoder LSB-aligned and encoded to garbage.

This has side-effects as well if the encoder library is used by other application like Vulkan CTS. If the application does not pass --msbShift explicitly, the result is also corrupted.

Also add explicit --msbShift 6 to the H.265 Main10 and AV1 Main 10-bit encode samples.

Type of change

bug fix

Tests

AMD Radeon RX 7600 (RADV NAVI33) / radv Mesa 26.1.3 (git-6984e91b5f) / Ubuntu 24.04.4 LTS

Total Tests: 86
Passed: 71
Crashed: 0
Failed: 0
Not Supported: 11
Skipped: 4 (in skip list)
Success Rate: 100.0%

Additional Details (optional)

The issue is reproducible running the following command:
python3 vvs_test_runner.py -t av1_main_profile_10bit --keep-files

This will create the ivf file in:
$VVS_DIR/tests/results/test_output_av1_main_profile_10bit.ivf

The generated video test_output_av1_main_profile_10bit.ivf can be played back using ffplay or another application. The result is a green video.

The compute-filter input path only shifts 10/12-bit samples into the
most-significant bits (P010/X6) when input.msbShift > 0, but the default is
-1. So without an explicit --msbShift, high bit-depth input reached the
encoder LSB-aligned and encoded to garbage.

Also add explicit --msbShift 6 to the H.265 Main10 and AV1 Main 10-bit
encode samples.
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.

1 participant