Skip to content

fix(yuv): set luma offset default to 0 for proper scale behavior#679

Open
for13to1 wants to merge 1 commit into
IENT:developfrom
for13to1:fix/luma-offset-default
Open

fix(yuv): set luma offset default to 0 for proper scale behavior#679
for13to1 wants to merge 1 commit into
IENT:developfrom
for13to1:fix/luma-offset-default

Conversation

@for13to1

Copy link
Copy Markdown
Contributor

fix(yuv): set luma offset default to 0 for proper scale behavior

Problem

Luma scale adjustment has no visible effect on image brightness.

Root Cause

Default Luma offset is 125 (limited range center). Transform formula newValue = (value - offset) * scale + offset uses offset as pivot, so pixels near 125 are minimally affected.

Solution

Changed default Luma offset from 125 to 0, so scale adjustments affect all pixels proportionally.

Changes

  • videoHandlerYUV.cpp: Updated 3 locations (constructor, setSrcPixelFormat, calculateDifference)

Effect

  • Luma scale now produces visible brightness changes
  • Chroma offset remains at 128 (correct for UV)
  • Users can still manually adjust offset via UI

When luma offset is 125 (limited range center), adjusting scale only
changes contrast without affecting overall brightness. Setting offset
to 0 ensures scale adjustments produce visible brightness changes.
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