Skip to content

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

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

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.
@ChristianFeldmann

Copy link
Copy Markdown
Member

Well this depends a bit on how you want the scale to work. By default, YUView scales around the middle point which basically extends the gamma. If this is not what you expect, then you can change the offset in the UI to 0 or 255 or whatever your preference is. But I don't think that 0 should be the default.

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