Closed Bug 1470386 Opened 2 years ago Closed 2 years ago

Recycle TextureClient at IMFYCbCrImage

Categories

(Core :: Graphics: Layers, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: sotaro, Assigned: sotaro)

References

Details

Attachments

(1 file, 3 obsolete files)

It seems that we do not need to use IMFYCbCrImage. We could use D3D11YCbCrImage instead of IMFYCbCrImage.
attachment 8987007 [details] [diff] [review] just calls VideoData::CreateAndCopyData() with mKnowsCompositor. With it, VideoData::CreateAndCopyData() creates D3D11YCbCrImage if it is possible.
 https://dxr.mozilla.org/mozilla-central/source/dom/media/MediaData.cpp#326
Blocks: 1468873
Attachment #8987007 - Flags: review?(nical.bugzilla)
Comment on attachment 8987007 [details] [diff] [review]
patch - Remove IMFYCbCrImage usage in WMFVideoMFTManager::CreateBasicVideoFrame()

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

Sounds good to me in principle but I don't know that well the implications. Deferring the review to Matt.
Attachment #8987007 - Flags: review?(nical.bugzilla) → review?(matt.woodrow)
The difference between these two is that IMFYCbCrImage just takes a reference to the IMFMediaBuffer in the constructor, instead of making a copy/upload. The upload is done when we request the TextureData.

This moves the upload time from the decoder thread to the image bridge child thread, and (at least when I wrote it) gave us better throughput, since we can start decoding the next frame without waiting. It was noticeable when decoding 4k videos in software.

We only get to use that image type for one path though, since most decoders don't give us a refcounted handle to the image data.
Intent of this bug was to recycle ID3D11Texture2D during doing h.264 software decoding. I am going to try another way.
Attachment #8987007 - Flags: review?(matt.woodrow)
Summary: Remove IMFYCbCrImage usage in WMFVideoMFTManager::CreateBasicVideoFrame() → Recycle IMFYCbCrImage at IMFYCbCrImage
Summary: Recycle IMFYCbCrImage at IMFYCbCrImage → Recycle TextureClient at IMFYCbCrImage
Attachment #8987007 - Attachment is obsolete: true
Rebased.
Attachment #8987774 - Attachment is obsolete: true
With attachment 8988045 [details] [diff] [review], IMFYCbCrImage becomes to use D3D11YCbCrRecycleAllocator and DXGIYCbCrTextureAllocationHelper to allocate DXGIYCbCrTextureData.
Attachment #8988045 - Flags: review?(matt.woodrow)
Attachment #8988045 - Flags: review?(matt.woodrow) → review+
Pushed by sikeda@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b0227fc53bf6
Recycle TextureClient at IMFYCbCrImage r=mattwoodrow
https://hg.mozilla.org/mozilla-central/rev/b0227fc53bf6
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.