locked
Using Hardware accelerator with DXVA2.0 RRS feed

  • Question

  • Hi

     

    I'm trying to use H.264 hardware accelerator with VC++ 2005, DXVA2.0 and Geforce 8600 GTS on Vista.

     

    After GetDecoderDeviceGuids() and GetDecoderRenderTargets(), it seems to succeed GetDecoderConfigurations().

    But "guidConfigBitstreamEncryption", "guidConfigMBcontrolEncryption" and "guidConfigResidDiffEncryption" in all DXVA2_ConfigPictureDecode structures are alway "DXVA2_NoEncrypt".

    And "ConfigBitstreamRaw" is 1 or 2. There are no explanation in the case of 2 on the document "DXVA2_ConfigPicture Structure".

     

    I expect that at least one of "guidCondig*" is DXVA2_ModeH264_?.

     

    Could anyone teach me what happen?

     

    Or Do I misunderstand the way to use hardware accelerator?

    Tuesday, May 29, 2007 6:58 AM

Answers

  • Hi Junya,

     

     

    You wold have to send the following dxva structures in order to get the VLD mode decoding

     

      A set of buffers for compressed picture decoding with off-host parsing as follows

            One picture parameters data buffer   DXVA_PicParams_H264

            One quantization matrix data buffer   DXVA_Qmatrix_H264

            One slice control data buffer   DXVA_Slice_H264_Short OR DXVA_Slice_H264_Long

            One bitstream data buffer

     

    The document which contains information on DXVA H.264 is currently not public (under  NDA), and we have plans to make it available on MSDN soon. If you need them asap, please email Askdxva@microsoft.com with your details and somebody shoul be able to assist you in getting the doc.

     

     

    Thanks

    -MH

    Friday, June 1, 2007 2:31 AM

All replies

  • Hi Junya Suzuki-san,

    The decoding capability (DXVA2_ModeH264_?, DXVA2_ModeMPEG2_?,...) of the accelerator is obtained by IDirectXVideoDecoderService::GetDecoderDeviceGuids().

    "guidConfigXXX" explains what encryption protocol is applied to send partially decoded data to the accelerator. For example, it is used to prevent any unexpected access to premium contents.

    By the way, DXVA2_ConfigPictureDecode::ConfigBitstreamRaw should be 0 or 1. I can't figure out.

    Regards,
    Tuesday, May 29, 2007 12:41 PM
  • Thank you for your reply.

     

    Unfortunatly, I haven't resolved my problem yet.

     

    According to IDirectXVideoDecoderService::GetDecoderDeviceGuids(), my GPU has DXVA2_ModeH264_E.

    And IDirectXVideoDecoderService::GetDecoderConfigurations() gives me two DXVA2_ConfigPictureDecode structures as output when i pass DXVA2_ModeH264_E  to the function as the GUID.Two structures are alomost same except DXVA2_ConfigPictureDecode::ConfigBitstreamRaw as I wrote before.

     

    In my understanding, "DXVA2_ConfigPictureDecode::guidConfigBitstreamEncryption" should be "DXVA2_ModeH264_E" and DXVA2_ConfigPictureDecode::ConfigBitstreamRaw should be 1 , when GPU decode full (not partially) decoded data. And I have to call IDirectXVideoDecoder::GetBuffer() with DXVA2_PictureParametersBufferType.

     

    Is this right understanding?

    Wednesday, May 30, 2007 4:44 AM
  • Hi Junya,

     

    For DXVA H.264/Mpeg-4 AVC

    The value 2 for bConfigBitstreamRaw has the same meaning as the value 1, except as follows:

            If bConfigBitstreamRaw is equal to 2, the slice control data structure that is used is the DXVA_Slice_H264_Short data structure.

            Otherwise (bConfigBitstreamRaw is not equal to 2), the slice control data structure that is used is the DXVA_Slice_H264_Long data structure. 

    NOTE – The DXVA_Slice_H264_Long data structure is also used when bConfigBitstreamRaw is equal to 0.

     

    And as Eijit mentioned that the decoding capabilities of the accelerator are obtained by IDirectXVideoDecoderService::GetDecoderDeviceGuids(), And "guidConfigXXX" defines the encryption

    protocol type for the 3 data buffers passed to the accelerator. "For example, it is used to prevent any unexpected access to premium contents" is absolutely correct.

     

    Thus in your case, the accelerator supports 2 decode configurations (i.e. decoding via Long and short Slice data structures) for the mode DXVA2_ModeH264_E.(DXVA2_ModeH264_VLD_NoFGT)

     

    I hope this helps, let me know if you have any other concerns in this regards.

     

    Thanks

    -MH

    Wednesday, May 30, 2007 6:42 PM
  • Hi Mustafa,

     

    Thanks to your help, it's getting clear.

     

    According to "http://msdn2.microsoft.com/en-us/library/aa965266.aspx" and some othre documents,  following procedure are needed to decode one frame.

    ----------------------------------------------------------------------------------

    step 1. IDirectXVideoDecoderService::CreateVideoDecoder

    step 2. IDirectXVideoDecoder::BeginFrame

    step 3. <one or more times>

                  step 3-1. IDirectXVideoDecoder::GetBuffer

                  step 3-2. IDirectXVideoDecoder::ReleaseBuffer

                  step 3-3. IDirectXVideoDecoder::Execute

    step 4.IDirectXVideoDecoder::EndFrame

    ----------------------------------------------------------------------------------

     

    My code seems to succeed step 2 with intentional RenderTarget.

    But I'm not sure if I send a stream to the accelerator correctly.

     

    My next pucedure is as follows:

    -(step 3-1)call IDirectXVideoDecoder::GetBuffer with BufferType"DXVA2_BitStreamDateBufferType".

    -Fill the obtained buffer with H.264 stream, which is encoded by JM12.1 (H.264 reference codec SW) using baseline profile.

    -(step 3-2)call IDirectXVideoDecoder::ReleaseBuffer

    -set DXVA2_DecodeExecuteParams Structure

    -(step 3-3)call IDIrectXVideoDecoder::Execute

     

    However, the return from IDIrectXVideoDecoder::Execute is S_NOTIMPL, even though other steps return S_OK.

     

    Do I have to divide H.264 to some parts(slices or macroblock)?

     

    BTW, in <dxva.h>, there are some H.264 related structures such as DXVA_Slice_H264_short.

    Do I have to set them? Or are they used internally by dxva api?

     

    Sorry for many questions.

     

    Best Regards,

    Thursday, May 31, 2007 4:47 AM
  • In addition:

     

    Or could anybody introduce me useful documents, please.

     

    Thanks

    Thursday, May 31, 2007 4:52 AM
  • Hi Junya,

     

     

    You wold have to send the following dxva structures in order to get the VLD mode decoding

     

      A set of buffers for compressed picture decoding with off-host parsing as follows

            One picture parameters data buffer   DXVA_PicParams_H264

            One quantization matrix data buffer   DXVA_Qmatrix_H264

            One slice control data buffer   DXVA_Slice_H264_Short OR DXVA_Slice_H264_Long

            One bitstream data buffer

     

    The document which contains information on DXVA H.264 is currently not public (under  NDA), and we have plans to make it available on MSDN soon. If you need them asap, please email Askdxva@microsoft.com with your details and somebody shoul be able to assist you in getting the doc.

     

     

    Thanks

    -MH

    Friday, June 1, 2007 2:31 AM
  • Hi Mustafa,

     

    Thank you for you help.

     

    I've gotton in touch with them.

     

    Best regards,

    Friday, June 1, 2007 6:03 AM
  • mark
    Thursday, August 14, 2014 8:56 PM