Commit Graph

167 Commits

Author SHA1 Message Date
Yuan Tong
83f1c42ade Bug 1654461 - Make ConvertYCbCrToRGB32 color range aware r=jbauman,aosmond
Fix for ConvertYCbCrToRGB32 to use full range convert functions for full range data.

Some changes of libyuv are backported from newer version, to get support of full range BT.709 and BT.2020 colorspace.

Differential Revision: https://phabricator.services.mozilla.com/D105937
2021-05-19 18:03:43 +00:00
Jon Bauman
5dda2d92af Bug 1684688 - Fix alpha support in nsAVIFDecoder. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D102852
2021-01-26 00:24:57 +00:00
Chun-Min Chang
2225ffe0a0 Bug 1683108 - Fix typo r=aosmond
Fix a typo caused by Bug 1654462. The mistake is made in: https://hg.mozilla.org/mozilla-central/rev/c1478d03a451c946784194a781bb1ec2ef3621a6#l3.52

In Bug 1654462, we move the main logic of `ConvertYCbCrToRGB` to
`ConvertYCbCrToRGBInternal` and leave `gfx::SwizzleData` behind.
The `gfx::SwizzleData` needs a `IntSize` parameter to perform the task.
However, the initial parameter is from a variable that is moved from
`ConvertYCbCrToRGB` to `ConvertYCbCrToRGBInternal`. The `IntSize`
parameter represents the picture size (`PlanarYCbCrData::mPicSize`) of
the picture of the passed image data. which won't be changed after
`ConvertYCbCrToRGBInternal` is performed (see:
https://hg.mozilla.org/mozilla-central/file/301cb0eb1e488475ab9f48210c12b87887d7ae0b/gfx/ycbcr/YCbCrUtils.cpp#l120).
Therefore, we can pass the original picture size of the image data to
the `gfx::SwizzleData`. That should do the same job as before.

Differential Revision: https://phabricator.services.mozilla.com/D100030
2020-12-17 17:39:25 +00:00
Chun-Min Chang
b7811b117b Bug 1654462 - Add alpha support in nsAVIFDecoder r=jbauman
This patch implements the transparency support for AVIF image files.

To convert the decoded YCbCr and Alpha data to RGBA, a function named
`ConvertYCbCrAToARGB` is created to do this job in the following
procedure:

ConvertYCbCrAToARGB:
  If the layout of the YCbCr is I420
    Calling libyuv::I420AlphaToARGB
  Else
    Fill RGB data converted by ConvertYCbCrToRGB in ARGB buffer first
    Insert the alpha data to ARGB buffer

On the other hand, this patch refactors the nsAVIFDecoder a bit to make
the lifetime of the parsed data and decoded image data clearer. They
won't live longer than Parser object and {Dav1d, AOM}Decoder object.
This should improve the code readability.

This patch also adds a transparent image test (TransparentAVIFTestCase)
to check the FLAG_HAS_TRANSPARENCY is posted or not. The test image file
`transparent.avif` is from Bug 1654462.

Differential Revision: https://phabricator.services.mozilla.com/D98951
2020-12-16 01:27:14 +00:00
Thomas Daede
6c973bd604 Bug 1553289 - Add identity conversion to ConvertYCbCrToRGB32. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D85961
2020-08-10 21:39:13 +00:00
Jon Bauman
83307586cc Bug 1639409 - AVIF (AV1 Image File Format): decode with dav1d. r=aosmond
Also, add `clang-format off` directives to files which are ignored by
.clang-format-ignore so that the editor isn't trying to reformat them

Differential Revision: https://phabricator.services.mozilla.com/D76217
2020-05-22 19:00:17 +00:00
Jeff Walden
e57173377f Bug 1439659 - Make |MOZ_{LITTLE,BIG}_ENDIAN| into function macros so that invoking them inside |#if| conditions when they haven't been defined yet is a compile error. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D57038

--HG--
extra : moz-landing-system : lando
2019-12-13 20:51:04 +00:00
A. Wilcox
f40d806c0d Bug 1511604 - Swizzle YCbCr->RGB data on big-endian machines. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D46134

--HG--
extra : moz-landing-system : lando
2019-09-17 17:47:17 +00:00
Nicholas Nethercote
18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Nicholas Nethercote
54aaa29a52 Bug 1561491 - Make gl.* static prefs follow the naming convention. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D35976

--HG--
extra : rebase_source : 0e054c5ac565d30c3bd9621d82d41075bdfddd5b
2019-06-26 13:05:06 +10:00
Nicholas Nethercote
ca8e78069d Bug 1561491 - Make gfx.* static prefs follow the naming convention. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D35975

--HG--
extra : rebase_source : 9090ac828f1da9582510975047d5ad59a228dda5
2019-06-26 10:38:09 +10:00
Jean-Yves Avenard
04a34db033 Bug 1550422 - P12. Convert Live gfxPrefs into StaticPrefs. r=jrmuizel
gfxPrefs Live preferences are almost identical to StaticPrefs.

We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.

Differential Revision: https://phabricator.services.mozilla.com/D31256

--HG--
extra : moz-landing-system : lando
2019-05-26 14:29:42 +00:00
Gurzau Raul
967bc2a754 Backed out 31 changesets (bug 1552643, bug 1550422) for xpcshell crash on a CLOSED TREE.
Backed out changeset e30c1aa75529 (bug 1552643)
Backed out changeset caadcd7e02d3 (bug 1552643)
Backed out changeset aa7086ab09be (bug 1552643)
Backed out changeset 0b4029671710 (bug 1550422)
Backed out changeset a16295296035 (bug 1550422)
Backed out changeset 3b70307c0db5 (bug 1550422)
Backed out changeset 69df7818d4a3 (bug 1550422)
Backed out changeset d98dfc565927 (bug 1550422)
Backed out changeset 6f0997976944 (bug 1550422)
Backed out changeset 0edd264464c2 (bug 1550422)
Backed out changeset 9ea6da7a74ec (bug 1550422)
Backed out changeset f855f9309c8b (bug 1550422)
Backed out changeset 1033546224a7 (bug 1550422)
Backed out changeset ade7384c6186 (bug 1550422)
Backed out changeset 75b04de7e99c (bug 1550422)
Backed out changeset 91c3acdb2454 (bug 1550422)
Backed out changeset 77d2f80257d1 (bug 1550422)
Backed out changeset e0cd10d35327 (bug 1550422)
Backed out changeset 097091082423 (bug 1550422)
Backed out changeset 2f328853c1ab (bug 1550422)
Backed out changeset f92f2cc29cb1 (bug 1550422)
Backed out changeset 6dc82f88333d (bug 1550422)
Backed out changeset c20f66494d69 (bug 1550422)
Backed out changeset 2ba22cddeb6f (bug 1550422)
Backed out changeset 3aa72f89e295 (bug 1550422)
Backed out changeset ab4c4e806977 (bug 1550422)
Backed out changeset 72e5de040dda (bug 1550422)
Backed out changeset 7d3c2d486706 (bug 1550422)
Backed out changeset 132e0b8d8468 (bug 1550422)
Backed out changeset 54c85ac75dd0 (bug 1550422)
Backed out changeset d7ba4a18dd54 (bug 1550422)
2019-05-25 09:07:49 +03:00
Jean-Yves Avenard
af5790cf9b Bug 1550422 - P12. Convert Live gfxPrefs into StaticPrefs. r=jrmuizel
gfxPrefs Live preferences are almost identical to StaticPrefs.

We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.

Differential Revision: https://phabricator.services.mozilla.com/D31256

--HG--
extra : moz-landing-system : lando
2019-05-25 00:03:32 +00:00
Gurzau Raul
74c555539e Backed out 28 changesets (bug 1550422) for marionette AssertionError and failing browser_policy_hardware_acceleration.js on a CLOSED TREE.
Backed out changeset 5dd10a365ba9 (bug 1550422)
Backed out changeset 529f5be01ab9 (bug 1550422)
Backed out changeset b6861d3badf8 (bug 1550422)
Backed out changeset 059cff1a3dde (bug 1550422)
Backed out changeset 6ada1116b241 (bug 1550422)
Backed out changeset ca67e8e45262 (bug 1550422)
Backed out changeset a1961a51ae44 (bug 1550422)
Backed out changeset 1c90b9cb3ad4 (bug 1550422)
Backed out changeset 285fa46e4f26 (bug 1550422)
Backed out changeset e2938a444234 (bug 1550422)
Backed out changeset 7a930fc51125 (bug 1550422)
Backed out changeset 898ed02804fe (bug 1550422)
Backed out changeset e1b7abc99ae9 (bug 1550422)
Backed out changeset f781d415cef6 (bug 1550422)
Backed out changeset 2fef10a7cce5 (bug 1550422)
Backed out changeset ea64b4d8d4ff (bug 1550422)
Backed out changeset 86a8ba1b755c (bug 1550422)
Backed out changeset 9c0c9e80f309 (bug 1550422)
Backed out changeset 10c153ddbaea (bug 1550422)
Backed out changeset 60fe635ec2c9 (bug 1550422)
Backed out changeset a38796266b28 (bug 1550422)
Backed out changeset 2db647dcdf1c (bug 1550422)
Backed out changeset 952ddac02972 (bug 1550422)
Backed out changeset ba46b53643ec (bug 1550422)
Backed out changeset ca47ef6c59f7 (bug 1550422)
Backed out changeset f45f471a1a40 (bug 1550422)
Backed out changeset 371b4da5b771 (bug 1550422)
Backed out changeset 02fc78890032 (bug 1550422)
2019-05-23 05:59:44 +03:00
Jean-Yves Avenard
2c0ce1b3ca Bug 1550422 - P12. Convert Live gfxPrefs into StaticPrefs. r=jrmuizel
gfxPrefs Live preferences are almost identical to StaticPrefs.

We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.

Differential Revision: https://phabricator.services.mozilla.com/D31256

--HG--
extra : moz-landing-system : lando
2019-05-22 12:43:42 +00:00
Jean-Yves Avenard
3ae43eb506 Bug 1493898 - P6. Move YUVColorSpace definition in the gfx namespace. r=mattwoodrow.
YUVColorSpace is inseparable from the bit depth as the matrix coefficients to be calculated need the bit depth information.

So let's put the two types together. gfx namespace also makes more sense as that's where we find IntRect, IntSize and other.

The extent of the changes highlight how much similar data structures are duplicated across the code, to the point it's scary.

Differential Revision: https://phabricator.services.mozilla.com/D25347

--HG--
extra : moz-landing-system : lando
2019-04-11 12:41:33 +00:00
Jean-Yves Avenard
fd742471ad Bug 1493898 - P4. Add BT2020 YUV->RGB conversion. r=jgilbert
This is used by the basic compositor.
Re-using existing logic, however as with other conversion it only handles limited 8 bits ranges (16-235) and to make things worse is rounded aggressively as the focus is on speed.

Differential Revision: https://phabricator.services.mozilla.com/D25345

--HG--
extra : moz-landing-system : lando
2019-04-11 16:57:39 +00:00
Mike Hommey
ef3ad686ee Bug 1512504 - Remove support for MSVC. r=froydnj
Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

Differential Revision: https://phabricator.services.mozilla.com/D19615

--HG--
extra : moz-landing-system : lando
2019-02-14 21:45:27 +00:00
David Major
07a3f14163 Bug 1505819: Don't use yuv_row_win64.cpp on aarch64 clang-cl builds. r=jrmuizel
The _win64.cpp really means "Win64 with SSE" which arm64 can't use.

--HG--
extra : rebase_source : a88f285a4f8e70bffd71cea4159dca7e084652ca
2018-11-08 14:04:11 -05:00
Jean-Yves Avenard
b10364a15f Bug 1493198 - P2. Use enum for describing color depth. r=mattwoodrow
Depends on D6662

Differential Revision: https://phabricator.services.mozilla.com/D6663

--HG--
extra : moz-landing-system : lando
2018-09-25 20:44:55 +00:00
Mike Hommey
64ac4a2be7 Bug 1478269 - Fix the outputs and clobbers of inline assembly blocks in yuv_row_posix.cpp. r=jrmuizel
While the current code compiles fine with the file as it is, with LTO
enabled, some functions end up inlined into their callers and their
callers, recursively, and the compiler doesn't know some of the
registers have been modified by the assembly, leading to bad decisions,
and bad behavior at runtime. The same problem would likely happen if we
were using UNIFIED_SOURCES in the directory.

Differential Revision: https://phabricator.services.mozilla.com/D4200
2018-08-29 14:00:26 +09:00
Mike Hommey
ce34440dd4 Bug 1478269 - Use symbolic names as input operands. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D4199
2018-08-29 13:59:14 +09:00
Mike Hommey
0706265ea0 Bug 1478269 - Remove ycbcr update script and patches. r=jrmuizel
ycbcr is dead upstream, and has been for almost as long as the code in
the gecko tree hasn't been updated. Let's not pretend that we can
actually run the update script and that having the patches separated
matters, because there's no upstream to apply those patches to anymore.

Update README accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D4198
2018-08-29 13:59:05 +09:00
Dorel Luca
0c1495fc0b Backed out 3 changesets (bug 1478269) for Mochitest failures on dom/canvas/test/test_imagebitmap_extensions.html
Backed out changeset 5766f5561af0 (bug 1478269)
Backed out changeset a4c212f5e8c4 (bug 1478269)
Backed out changeset 07d50175fed9 (bug 1478269)
2018-08-29 05:10:37 +03:00
Mike Hommey
7731ae9fb2 Bug 1478269 - Fix the outputs and clobbers of inline assembly blocks in yuv_row_posix.cpp. r=jrmuizel
While the current code compiles fine with the file as it is, with LTO
enabled, some functions end up inlined into their callers and their
callers, recursively, and the compiler doesn't know some of the
registers have been modified by the assembly, leading to bad decisions,
and bad behavior at runtime. The same problem would likely happen if we
were using UNIFIED_SOURCES in the directory.

Differential Revision: https://phabricator.services.mozilla.com/D4200
2018-08-29 07:28:04 +09:00
Mike Hommey
620d9ab59d Bug 1478269 - Use symbolic names as input operands. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D4199
2018-08-29 07:27:56 +09:00
Mike Hommey
a6d9b02dff Bug 1478269 - Remove ycbcr update script and patches. r=jrmuizel
ycbcr is dead upstream, and has been for almost as long as the code in
the gecko tree hasn't been updated. Let's not pretend that we can
actually run the update script and that having the patches separated
matters, because there's no upstream to apply those patches to anymore.

Update README accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D4198
2018-08-29 07:27:23 +09:00
Nathan Froyd
5b13d58730 Bug 1486068 - add aarch64 windows cases to ycbcr's chromium_types.h; r=jrmuizel 2018-08-28 16:53:27 -04:00
Nathan Froyd
309ddc0be2 Bug 1477048 - part 2 - remove non-ipc/chromium moz.build uses of OS_TEST; r=gps
The deletions in xptcall are when we don't even have support for the CPU
in moz.configure, so I assume that people haven't been compiling on
those architectures for quite some time.
2018-07-24 16:08:56 -04:00
David Major
b3e88506ef Bug 1422368: Use intrinsics-based YUV functions from Win64 under Win32 clang-cl. r=jrmuizel 2018-04-04 08:41:36 -04:00
David Major
9a28e89f4e Backed out changeset 737b602f4c6f864b34080d0fe57c2ff75de3b909 because I shouldn't back out the original fix until the better one lands. 2018-04-02 17:22:06 -04:00
David Major
152a7fc82e Backed out bug 1422368 fixes because they weren't sufficient. 2018-04-02 17:20:35 -04:00
Sylvestre Ledru
5de63ef061 Bug 1394734 - Replace CONFIG['MSVC'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 5orfnoude7h

--HG--
extra : rebase_source : 1ed9a6b56e1d27221a07624767a7fb0e6147117f
2017-12-08 13:46:13 +01:00
David Major
1bb3a226c5 Bug 1422368 - Work around a clang-cl complilation bug in yuv_row_win.cpp harder. r=jrmuizel
--HG--
extra : histedit_source : f55f9b6a92b88d72a83bf0e2f0da973f445aa47a
2017-12-06 12:24:53 -05:00
Sebastian Hengst
b485da50e4 Backed out changeset 5f90362bbc80 (bug 1422368) for Windows static bustage (unresolved externals). r=backout 2017-12-06 20:20:54 +02:00
David Major
d68fefde32 Bug 1422368 - Work around a clang-cl complilation bug in yuv_row_win.cpp harder. r=jrmuizel 2017-12-06 12:24:53 -05:00
David Major
c6c7ce4333 Bug 1422368 - Work around a clang-cl bug in yuv_row_win.cpp. r=jrmuizel 2017-12-01 16:46:21 -05:00
Jean-Yves Avenard
0fc33ae81a Bug 1215089 - P5: Convert 10/12 bits YUV image to 8 bits prior conversion to RGB. r=mattwoodrow
For now, convert 10/12 bits YUV image to 8 bits. Native support will be tracked in bug 1379948

MozReview-Commit-ID: LOr9X5xxKY7

--HG--
extra : rebase_source : 279e00832543501616af0a4a5958917b72533a4c
2017-09-29 13:43:09 +02:00
Sebastian Hengst
d0f721b4ef Backed out changeset 9c974e493c3f (bug 1215089) 2017-10-04 16:25:57 +02:00
Jean-Yves Avenard
e54f0e8c27 Bug 1215089 - P4: Convert 10/12 bits YUV image to 8 bits prior conversion to RGB. r=mattwoodrow
For now, convert 10/12 bits YUV image to 8 bits. Native support will be tracked in bug 1379948

MozReview-Commit-ID: LOr9X5xxKY7

--HG--
extra : rebase_source : 90b39f46cbc9d5233965e3693c620466557eb8e7
2017-09-29 13:43:09 +02:00
Makoto Kato
5a2c91137e Bug 1360429 - Part 1. inline arm assember for YCBCR should be on arm only. r=sotaro
ycvcr_to_rgb565 uses inline assember for arm neon.  Since it is different for aarch64's assembler, we should define HAVE_YCBCR_TO_RGB565 on arm32 only.

MozReview-Commit-ID: 4c2n1luvVvC

--HG--
extra : rebase_source : 8ae3f9deb6d0f4e3ab6036b7ce7ec57e0c7e1b57
2017-04-28 13:22:07 +09:00
Randell Jesup
492e274bf6 Bug 1341543: don't use internal-only I4xxToARGBMatrix() functions from libyuv r=sotaro
MozReview-Commit-ID: H0o6ufAlnGx
2017-02-24 14:01:56 -05:00
Randell Jesup
635c96d539 Bug 1341543: Update SIMD_ALIGNED in gfx to match libyuv's definition r=sotaro
MozReview-Commit-ID: 35D3W0Dqrc8
2017-02-24 14:01:56 -05:00
Randell Jesup
8ad25a673c Bug 1284800: Fix build fallout from moving libyuv into a subdirectory r=ted
MozReview-Commit-ID: CDMDXqpGueS
2017-02-24 14:01:56 -05:00
sotaro
176fe53134 Bug 1329383 - Update YUVColorSpace handling in ConvertYCbCrToRGB32() r=nical 2017-01-10 10:09:19 +09:00
karo
00b8886839 Bug 1321076 - Added util functions to help with YUVA to BGRA conversion. r=jya
MozReview-Commit-ID: JZDdbM2gt0g

--HG--
extra : rebase_source : 572dbf59e8a3b41e6c7366d1579a28e365062260
2016-12-21 15:00:46 +13:00
Sotaro Ikeda
1d3ceeff04 Bug 1306521 - Handle VP9 colorspace BT.709 on BasicCompositor r=nical,jwwang,jya,jrmuizel 2016-10-11 19:46:28 -07:00
Sotaro Ikeda
5d8ae5cfad Bug 1295927 - Disable libyuv SIMD scaling on 64bit win r=jrmuizel 2016-08-19 06:18:08 -07:00
Sotaro Ikeda
64b45af818 Bug 1254010 - Scaling during RGB -> YUV conversion with BasicCompositor if possible. basic_compositor_video improved on windows. r=jrmuizel 2016-08-15 18:54:17 -07:00