Closed Bug 1304330 Opened 8 years ago Closed 8 years ago

BT.709 YUV to RGB of libyuv seems not correct

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: sotaro, Assigned: sotaro)

References

Details

Attachments

(1 file, 2 obsolete files)

I faced this during Bug 1210357. libyuv::H420ToARGB() result seemed not correct.

The formula in the following seems not correct.
  https://dxr.mozilla.org/mozilla-central/source/media/libyuv/source/row_common.cc#1145

But libyuv master is still same.
  https://chromium.googlesource.com/libyuv/libyuv/+/master/source/row_common.cc#1145
Assignee: nobody → sotaro.ikeda.g
Version: 49 Branch → Trunk
Blocks: 1210357
Attachment #8793261 - Flags: review?(jmuizelaar)
Comment on attachment 8793261 [details] [diff] [review]
patch - Update YuvConstants of BT.709 YUV

Review of attachment 8793261 [details] [diff] [review]:
-----------------------------------------------------------------

Randal is probably a more appropriate reviewer than me.
Attachment #8793261 - Flags: review?(jmuizelaar) → review?(rjesup)
Comment on attachment 8793261 [details] [diff] [review]
patch - Update YuvConstants of BT.709 YUV

Review of attachment 8793261 [details] [diff] [review]:
-----------------------------------------------------------------

Please file and issue and patch for upstream as well.  Thanks!
Attachment #8793261 - Flags: review?(rjesup) → review+
The difference comes from full range vs constrained range.
Looking into the chromium media code (which I wrote), they choose to do constrained range BT709.  erg.  Can't we move forward to a good colorspace?!

Internally its implemented via a matrix, so you could define a custom matrix and call the low levels.

But I agree we should update the constants to match.
Your patch only updated the constants for YUV to RGB, but not RGB to YUV.  So the unittests fail.  I'll follow up in the libyuv bug report.
Thanks!
Apply the comment in https://bugs.chromium.org/p/libyuv/issues/detail?id=639.
Attachment #8793261 - Attachment is obsolete: true
Attachment #8795576 - Flags: review+
Update a comment.
Attachment #8795576 - Attachment is obsolete: true
Attachment #8795959 - Flags: review+
Pushed by sikeda@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c15a77349bc7
Update YuvConstants of BT.709 YUV r=jesup
https://hg.mozilla.org/mozilla-central/rev/c15a77349bc7
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Blocks: 1284803
See Also: → 1305510
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: