MediaSDK icon indicating copy to clipboard operation
MediaSDK copied to clipboard

vaapi: set AYUV mfxFrameData by XYUV VAImage

Open xhaihao opened this issue 4 years ago • 2 comments

The latest media driver may use XYUV for 444 8bit decoding.

xhaihao avatar Aug 27 '21 05:08 xhaihao

@dmitryermilov any comment for this PR ?

xhaihao avatar Sep 01 '21 05:09 xhaihao

Hi @xhaihao ,

Let me double check. Trying to understand the whole story. Please comment :

  1. Okay, e.g. we’re decoding 444 HEVC stream. MSDK DecodeHeader() reports MFX_FOURCC_AYUV.
  2. Let’s consider external (from MSDK perspective) video memory case. Ffmpeg owns vaSurfaceID allocation. Will ffmpeg allocate VA_FOURCC_XYUV surfaces instead of VA_FOURCC_AYUV and pretend it passes VA_FOURCC_AYUV? No changes on MSDK side required here, right?
  3. Let’s consider external (from MSDK perspective) system memory case. vaSurface's need to be allocates inside MSDK. a. How ffmpeg will force MSDK to VA_FOURCC_XYUV surfaces instead of VA_FOURCC_AYUV? I’m confused because I can’t find corresponding changes in your PR … b. Plus, I can’t find allocation of VA_FOURCC_XYUV inside MSDK allocator, you added code which can handle mapping, not allocation..
  4. I guess your current PR is need for item 3 above, right?

dmitryermilov avatar Sep 06 '21 14:09 dmitryermilov

Hi @xhaihao ,

Let me double check. Trying to understand the whole story. Please comment :

1. Okay, e.g. we’re decoding 444 HEVC stream. MSDK DecodeHeader() reports MFX_FOURCC_AYUV.

2. Let’s consider external (from MSDK perspective) video memory case. Ffmpeg owns vaSurfaceID allocation. Will ffmpeg allocate VA_FOURCC_XYUV surfaces instead of VA_FOURCC_AYUV and pretend it passes VA_FOURCC_AYUV? No changes on MSDK side required here, right?

3. Let’s consider external (from MSDK perspective) system memory case. vaSurface's need to be allocates inside MSDK.
   a. How ffmpeg will force MSDK to VA_FOURCC_XYUV surfaces instead of VA_FOURCC_AYUV? I’m confused because I can’t find corresponding changes in your PR …
   b. Plus, I can’t find allocation of VA_FOURCC_XYUV inside MSDK allocator, you added code which can handle mapping, not allocation..

4. I guess your current PR is need for item 3 above, right?

Yes, this PR handles mapping, not allocation.

xhaihao avatar Aug 29 '22 06:08 xhaihao

@dmitryermilov ping

uartie avatar Aug 30 '22 17:08 uartie

@lwan108 could you find someone to take a look?

Sherry-Lin avatar Aug 31 '22 03:08 Sherry-Lin