Skip to content

Expand VIF UNPACK V4-5 channels - #232

Open
GTTeancum wants to merge 1 commit into
ran-j:mainfrom
GTTeancum:codex/vif-v4-5-expansion
Open

Expand VIF UNPACK V4-5 channels#232
GTTeancum wants to merge 1 commit into
ran-j:mainfrom
GTTeancum:codex/vif-v4-5-expansion

Conversation

@GTTeancum

Copy link
Copy Markdown

Summary

  • expand VIF UNPACK V4-5 RGB channels from five bits into bits 3-7 of each 32-bit lane
  • expand the one-bit alpha channel into bit 7
  • add a focused packed-channel regression test

Why

The VIF V4-5 format does not return raw 0-31 and 0-1 channel values. Each packed channel is positioned in the high bits of its destination byte (R5G5B5A1 becomes R8G8B8A8 with low bits zero). The previous implementation omitted that expansion, producing colors and alpha at 1/8 and 1/128 of their expected magnitudes.

PCSX2's VIF unpack implementation uses the equivalent shifts (X << 3, Y >> 2, Z >> 7, W >> 8).

Verification

  • Windows x64 Release build
  • ps2x_tests: 426 passed, 0 failed

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