Closed Bug 1543359 Opened 1 year ago Closed 1 year ago

Dynamically generate color matrix coefficient when converting YUV to RGB - Part 1

Categories

(Core :: GFX: Color Management, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jya, Assigned: jya)

References

(Blocks 2 open bugs)

Details

Attachments

(15 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

In bug 1540581, we now have support for all color spaces on all platforms, image type.

However, the compositors treat all color spaces as if it was 8 bits YCbCr with limited range (16-235).

We should no longer use static tables, and instead generates them as needed.

This change will also fix 10/12 bits colorspace conversion and limited vs full range conversion.

Assignee: nobody → jyavenard

This will allow to differentiate full range vs limite range YUV.

Additionally with this commit as fly-by fixes:

  • Fix constness
  • Replace FOURCC codes with official macOS constant

Depends on D27210

Add code for YCbCr buffer and IOSurface backend.

Depends on D27212

Still non-functional.

Depends on D27213

This is used by the OGL and D3D11 compositors.

The priority flag is not set for this bug.
:jbonisteel, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jbonisteel)
Flags: needinfo?(jbonisteel)
Priority: -- → P2
Priority: P2 → P3
Attachment #9057763 - Attachment description: Bug 1543359 - P1. Add mFullRange info to YCbCrBufferData. r?bryce → Bug 1543359 - P1. Add mColorRange info to YCbCrBufferData. r?bryce

Depends on D27210

Attachment #9057764 - Attachment description: Bug 1543359 - P2. Add kCVPixelFormatType_420YpCbCr8BiPlanarFullRange support to MacIOSurface. r?mattwoodrow → Bug 1543359 - P3. Add kCVPixelFormatType_420YpCbCr8BiPlanarFullRange support to MacIOSurface. r?mattwoodrow
Attachment #9057765 - Attachment description: Bug 1543359 - P3. Add YUV Full Range info to AppleVTDecoder. r?bryce → Bug 1543359 - P4. Add YUV Full Range info to AppleVTDecoder. r?bryce
Attachment #9057766 - Attachment description: Bug 1543359 - P4. Add backend for yuv full range flag. r?mattwoodrow. → Bug 1543359 - P6. Add backend for color range information. r?mattwoodrow.
Attachment #9057767 - Attachment description: Bug 1543359 - P5. Plumb YUV Ful Range info in Windows' Image types. r?mattwoodrow → Bug 1543359 - P7. Plumb YUV Color Range info in Windows' Image types. r?mattwoodrow
Attachment #9057806 - Attachment description: Bug 1543359 - P6. Fill YUV range information with decoders. r?bryce → Bug 1543359 - P8. Fill YUV color range information with decoders. r?bryce
Attachment #9057815 - Attachment description: Bug 1543359 - P7. Add YUV range information to NV12Effect and YCbCrEffect. r?mattwoodrow → Bug 1543359 - P9. Add YUV range information to NV12Effect and YCbCrEffect. r?mattwoodrow
Attachment #9057816 - Attachment description: Bug 1543359 - P8. Add full range info to GPU and WR texture host. r?mattwoodrow → Bug 1543359 - P10. Add color range info to GPU and WR texture host. r?mattwoodrow

It got missed in an earlier change

Depends on D27243

Attachment #9057826 - Attachment description: Bug 1543359 - P9. Fix colorspace rendering with IOSurface and basic compositor. r?mattwoodrow → Bug 1543359 - P12. Fix colorspace rendering with IOSurface and basic compositor. r?mattwoodrow

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:jya, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(jyavenard)

(In reply to Release mgmt bot [:sylvestre / :calixte] from comment #15)

There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:jya, could you have a look please?
For more information, please visit auto_nag documentation.

There aren't finished and I got sidetracked on other bugs.

Flags: needinfo?(jyavenard)

When unknown, we rely on the picture height and assume that anything less than 720p is 601 and 709 otherwise. It's not perfect but it's the best we can do.

Depends on D27248

Summary: Dynamically generate color matrix coefficient when converting YUV to RGB → Dynamically generate color matrix coefficient when converting YUV to RGB - Part 1
Blocks: 1568745
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ca660ab1e0c1
P0. Make video range info an enum. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/a63968f077e3
P1. Add mColorRange info to YCbCrBufferData. r=bryce
https://hg.mozilla.org/integration/autoland/rev/b2ce591ca398
P2. Fix constness. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/90fff717198b
P3. Add kCVPixelFormatType_420YpCbCr8BiPlanarFullRange support to MacIOSurface. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/7c3a1f23baa8
P4. Add YUV Full Range info to AppleVTDecoder. r=bryce
https://hg.mozilla.org/integration/autoland/rev/496f206d03d6
P5. Use C++11 initializers. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/bf238b58c694
P6. Add backend for color range information. r=mattwoodrow.
https://hg.mozilla.org/integration/autoland/rev/0d316ef8c668
P7. Plumb YUV Color Range info in Windows' Image types. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/2f4eb6501552
P8. Fill YUV color range information with decoders. r=bryce
https://hg.mozilla.org/integration/autoland/rev/d9e937f5caf4
P9. Add YUV range information to NV12Effect and YCbCrEffect. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/348e748e3451
P10. Add color range info to GPU and WR texture host. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/101ac87ff017
P11. Remove redundant virtual keyword. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/cd0afc5758ba
P12. Fix colorspace rendering with IOSurface and basic compositor. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/87c99ef85813
P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&resultStatus=busted&fromchange=87c99ef858131b4ae906f33428e2929d3c8432b2&tochange=8da7c093ea3ac57d7edcc3e975e8057eebd8cb42&selectedJob=258441946

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=258441946&repo=autoland&lineNumber=28745
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=258441942&repo=autoland&lineNumber=7862

Backout link: https://hg.mozilla.org/integration/autoland/rev/8da7c093ea3ac57d7edcc3e975e8057eebd8cb42

[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - [style 0.0.1] cargo:rerun-if-changed=properties/data.py
[task 2019-07-26T04:38:15.682Z] 04:38:15 ERROR - error[E0277]: the trait bound display_item::ColorRange: std::default::Default is not satisfied
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - --> gfx/wr/webrender_api/src/display_item.rs:1056:5
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - |
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - 1056 | pub color_range: ColorRange,
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait std::default::Default is not implemented for display_item::ColorRange
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - |
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - = note: required by std::default::Default::default
[task 2019-07-26T04:38:15.682Z] 04:38:15 ERROR - error: aborting due to previous error
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - For more information about this error, try rustc --explain E0277.
[task 2019-07-26T04:38:15.682Z] 04:38:15 ERROR - error: Could not compile webrender_api.
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - Caused by:
[task 2019-07-26T04:38:15.682Z] 04:38:15 INFO - process didn't exit successfully: CARGO_MANIFEST_DIR=/builds/worker/workspace/build/src/gfx/wr/webrender_api CARGO_PKG_DESCRIPTION='Public API for WebRender' LD_LIBRARY_PATH='/builds/worker/workspace/build/src/obj-firefox/release/deps:/builds/worker/workspace/build/src/rustc/lib:/builds/worker/workspace/build/src/clang/lib' CARGO=/builds/worker/workspace/build/src/rustc/bin/cargo CARGO_PKG_VERSION_MINOR=60 CARGO_PKG_HOMEPAGE= CARGO_PKG_REPOSITORY='https://github.com/servo/webrender' CARGO_PKG_NAME=webrender_api CARGO_PKG_VERSION_PRE= CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION=0.60.0 CARGO_PKG_AUTHORS='Glenn Watson <gw@intuitionlibrary.com>' /builds/worker/workspace/build/src/sccache/sccache /builds/worker/workspace/build/src/rustc/bin/rustc --edition=2018 --crate-name webrender_api gfx/wr/webrender_api/src/lib.rs --color never --crate-type lib --emit=dep-info,metadata,link -C opt-level=2 -C panic=abort -C codegen-units=1 --cfg 'feature="serialize"' -C metadata=8facccdb9c4ee983 -C extra-filename=-8facccdb9c4ee983 --out-dir /builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps --target x86_64-apple-darwin -L dependency=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps -L dependency=/builds/worker/workspace/build/src/obj-firefox/release/deps --extern app_units=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libapp_units-b22e5f2d5fc9c87a.rlib --extern bitflags=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libbitflags-746ad2933d47a280.rlib --extern byteorder=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libbyteorder-5f4e5fa8f97e523f.rlib --extern core_foundation=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libcore_foundation-0e147a0559f768ca.rlib --extern core_graphics=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libcore_graphics-c14bdc05e4e37c00.rlib --extern derive_more=/builds/worker/workspace/build/src/obj-firefox/release/deps/libderive_more-33146efcb0fa95b6.so --extern euclid=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libeuclid-8da5043fbabd1137.rlib --extern malloc_size_of_derive=/builds/worker/workspace/build/src/obj-firefox/release/deps/libmalloc_size_of_derive-aa236ec3a08cce72.so --extern peek_poke=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libpeek_poke-cd1b3c91056b339f.rlib --extern serde=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libserde-f9e3738c89a2c7b2.rlib --extern serde_bytes=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libserde_bytes-7038a64420cf8daf.rlib --extern serde_derive=/builds/worker/workspace/build/src/obj-firefox/release/deps/libserde_derive-9b2e6dd419d4b685.so --extern time=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libtime-3dd43d0b30044a9f.rlib --extern malloc_size_of=/builds/worker/workspace/build/src/obj-firefox/x86_64-apple-darwin/release/deps/libwr_malloc_size_of-d1bff41bc2440771.rlib -C opt-level=2 -C debuginfo=2 -C force-frame-pointers=yes -Dwarnings (exit code: 1)
[task 2019-07-26T04:38:15.683Z] 04:38:15 INFO - warning: build failed, waiting for other jobs to finish...
[task 2019-07-26T04:38:15.683Z] 04:38:15 INFO - [style 0.0.1] cargo:rerun-if-changed=build_gecko.rs

Flags: needinfo?(jyavenard)
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fa6792c1c2e8
P0. Make video range info an enum. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/52187d9320b1
P1. Add mColorRange info to YCbCrBufferData. r=bryce
https://hg.mozilla.org/integration/autoland/rev/b22b0eb708b8
P2. Fix constness. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/48eb0ebf9f2e
P3. Add kCVPixelFormatType_420YpCbCr8BiPlanarFullRange support to MacIOSurface. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/095bca5c9b1a
P4. Add YUV Full Range info to AppleVTDecoder. r=bryce
https://hg.mozilla.org/integration/autoland/rev/b576317853e9
P5. Use C++11 initializers. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/a85bd4691bea
P6. Add backend for color range information. r=mattwoodrow.
https://hg.mozilla.org/integration/autoland/rev/98b968443458
P7. Plumb YUV Color Range info in Windows' Image types. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/fb9b71ed9f4b
P8. Fill YUV color range information with decoders. r=bryce
https://hg.mozilla.org/integration/autoland/rev/4eb933d55d88
P9. Add YUV range information to NV12Effect and YCbCrEffect. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/210eee703fd9
P10. Add color range info to GPU and WR texture host. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/d742d80b892f
P11. Remove redundant virtual keyword. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/1c7ca95a2a9b
P12. Fix colorspace rendering with IOSurface and basic compositor. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/c9585e9d9f3c
P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
Attachment #9080843 - Attachment description: Bug 1543359 - P14. Fix "Wrench" test → Bug 1543359 - P14. Fix "Wrench" test on a CLOSED TREE
Flags: needinfo?(jyavenard)
Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/548006270186
P14. Fix "Wrench" test. a=wrench-fix  CLOSED TREE
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4bf222be42c8
P14. Fix "Wrench" test on a CLOSED TREE
Backout by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a2585dd7e2a5
Backed out changeset 4bf222be42c8 wrench bustages. CLOSED TREE
Attachment #9080843 - Attachment description: Bug 1543359 - P14. Fix "Wrench" test on a CLOSED TREE → Bug 1543359 - P14. Fix "Wrench" test
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d6e0affa247c
P0. Make video range info an enum. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/6f4c7904cda8
P1. Add mColorRange info to YCbCrBufferData. r=bryce
https://hg.mozilla.org/integration/autoland/rev/a22e5c4c5e62
P2. Fix constness. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/f911d343c0b4
P3. Add kCVPixelFormatType_420YpCbCr8BiPlanarFullRange support to MacIOSurface. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/b4d7e436a9c8
P4. Add YUV Full Range info to AppleVTDecoder. r=bryce
https://hg.mozilla.org/integration/autoland/rev/85885d3c9c39
P5. Use C++11 initializers. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/53be9821c60a
P6. Add backend for color range information. r=mattwoodrow.
https://hg.mozilla.org/integration/autoland/rev/b3a51726113e
P7. Plumb YUV Color Range info in Windows' Image types. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/af31a653ca4d
P8. Fill YUV color range information with decoders. r=bryce
https://hg.mozilla.org/integration/autoland/rev/7727d1d55859
P9. Add YUV range information to NV12Effect and YCbCrEffect. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/0a7fa4cf7206
P10. Add color range info to GPU and WR texture host. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/51c63183fd62
P11. Remove redundant virtual keyword. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/e9fee399f163
P12. Fix colorspace rendering with IOSurface and basic compositor. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/597d690469ee
P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/f55f4e73ed7e
P14. Fix "Wrench" test r=nical
Flags: needinfo?(jyavenard)
You need to log in before you can comment on or make changes to this bug.