Closed Bug 1497294 Opened Last year Closed Last year

Native support for MFVideoFormat_P010 / DXGI_FORMAT_P010

Categories

(Core :: Graphics: Layers, enhancement)

x86
Windows
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: jya, Assigned: jya)

References

()

Details

Attachments

(8 files)

Bug 1495025 added support for 10/16 bits hardware decoding. The texture coming out of the decoder are DXGI_FORMAT_P010.

Right now, those are immediately converted into RGBA and then passed to the compositor.

Like with did for DXGI_FORMAT_NV12 we should natively handle those without requiring the need for a RGB conversion on hardware supporting it.
Using an Intel 630 playing https://mega.nz/#!hJdFEIBI!uSOjZtkkjIVYSfqD9aSfONf1yq__uQvlsf47pCtFvdQ (The World in HDR) shows the GPU decoder hitting 67.3% and the videoprocessing hitting 70.5% (numbers retrieved using DXVA checker).

Playback stats shows about 15% of the frames are dropped by the compositor. So it's not super smooth.

Interestingly Chrome really struggles playing this video, it uses the software decoder for some reasons and playback experience is much worse than Firefox (with bug 1495025 in)
Will have a shot at it.
Assignee: nobody → jyavenard
The methods BytesPerPixel, SurfaceFormatForColorDepth, BitDepthForColorDepth, ColorDepthForBitDepth and RescalingFactorForColorDepth all directly depends on the types defined in Types.h, they also return constant values.

As such it makes more sense to have them defined at the same level where the types themselves are declared.

Depends on D8065
Wasn't having any impact whatsoever as hr would have been E_FAILED.

Depends on D8073
This allows to more easily construct it and add new values as needed.

The other bool members could be made to be part of the set, but this would require more significant code change.

Depends on D8082
This is only used with DXVA decoder. P016 is just like NV12 but with 16 bits data..

Depends on D8129
Attachment #9015513 - Attachment description: Bug 1497294 - P3. Fix type in AL D3D11 compositor → Bug 1497294 - P3. Fix typo in AL D3D11 compositor
The Windows' hardware decoder always return an image whose dimensions are multiple of 16 pixels. As such, the image coming out of the decoder is typically bigger than the wanted image.

The D3D11 documentation states that " If you try and copy outside the destination resource or specify a source box that is larger than the source resource, the behavior of CopySubresourceRegion is undefined."

We've always copied from a bigger texture into a smaller one without specifying clipping. It seems to have always worked but falls into the undefined behaviour category.

So to be extra safe, we clip the source so that it matches the dimension of the destination texture.

Depends on D8129
Attachment #9015850 - Attachment description: Bug 1497294 - P4. Clip source to destination size when copying the D3D11 texture. → Bug 1497294 - P5. Clip source to destination size when copying the D3D11 texture.
Attachment #9015667 - Attachment description: Bug 1497294 - P4. Add P016 surface format support. → Bug 1497294 - P6. Add P016 surface format support.
It just doesn't work.
We add the preference media.wmf.force.allow-p010-format to force enable it.

Depends on D8136
Attachment #9015667 - Attachment description: Bug 1497294 - P6. Add P016 surface format support. → Bug 1497294 - P6. Add P016 and P010 surface format support.
Attachment #9015667 - Attachment description: Bug 1497294 - P6. Add P016 and P010 surface format support. → Bug 1497294 - P7. Add P016 and P010 surface format support.
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a6481e1de633
P1. Remove duplicated method. r=nical
https://hg.mozilla.org/integration/autoland/rev/da3c96e21a15
P2. Move type related constant methods to Types.h r=nical
https://hg.mozilla.org/integration/autoland/rev/45cbc8ce2df1
P3. Fix typo in AL D3D11 compositor r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/7a75881a8684
P4. Use EnumSet with D3D11DeviceStatus and checks for P010 and P016 support. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/e62671b3410d
P5. Clip source to destination size when copying the D3D11 texture. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/227a0a6ae1df
P6. Fix NV12 playback on legacy D3D11 compositor. r=mattwoodrow
https://hg.mozilla.org/integration/autoland/rev/1b12b56178b6
P7. Add P016 and P010 surface format support. r=jgilbert
https://hg.mozilla.org/integration/autoland/rev/c2666a1b9efc
P8. Disable P010 surface type with nvidia adapters. r=mattwoodrow
Depends on: 1498788
You need to log in before you can comment on or make changes to this bug.