<<

DirectX Video Acceleration Specification of Additional Restricted- Mode Profiles for MPEG-1 VLD and Combined MPEG-1 and MPEG-2 VLD Video Decoding

Gary J. Sullivan and Yongjun Wu Corporation March 2011

Applies to:  DirectX Video Acceleration

Summary: Defines extensions to DirectX Video Acceleration (DXVA) to support variable-length decoding (VLD) modes for MPEG-1 and MPEG-2 video.

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.

MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE INFORMATION IN THIS DOCUMENT.

Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

Unless otherwise noted, the example companies, organizations, products, domain names, e- addresses, logos, , places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place or event is intended or should be inferred.

Microsoft does not make any representation or warranty regarding specifications in this document or any product or item developed based on these specifications. Microsoft disclaims all express and implied warranties, including but not limited to the implied warranties or merchantability, fitness for a particular purpose and freedom from infringement. Without limiting the generality of the foregoing, Microsoft does not make any warranty of any kind that any item developed based on these specifications, or any portion of a specification, will not infringe any copyright, patent, trade secret or other intellectual property right of any person or entity in any country. It is your responsibility to seek licenses for such intellectual property rights where appropriate. Microsoft shall not be liable for any damages arising out of or in connection with the use of these specifications, including liability for lost profit, business interruption, or any other damages whatsoever. Some states do not allow the exclusion or limitation of liability or consequential or incidental damages; the above limitation may not apply to you.

© 2011 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, , Windows NT, Windows , , , ActiveSync, ActiveX, , DirectDraw, DirectInput, DirectMusic, DirectPlay, DirectShow, DirectSound, DirectX, Expression, FrontPage, HighMAT, Explorer, JScript, , MSN, NetShow, Outlook, PlaysForSure logo, PowerPoint, SideShow, , Visual C++, Visual InterDev, Visual J++, Visual Studio, WebTV, Win32, and are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Contents Contents ...... 3 1. Introduction and Scope ...... 4 2. Modifications Common to the Additional Modes ...... 4 2.1 Configuration Parameters ...... 4 2.2 Revisions to the DXVA_PictureParameters Data Structure ...... 5 3. Restricted-Mode Specifications ...... 6 3.1 MPEG1_VLD profile ...... 6 Restrictions on DXVA_ConnectMode ...... 6 3.2 MPEG2and1_VLD Profile ...... 6 Restrictions on DXVA_ConnectMode ...... 7 For More Information...... 7

1. Introduction and Scope This specification defines DirectX Video Acceleration (DXVA) operations for MPEG-1 video decoding and combined MPEG-1 and MPEG-2 video decoding, using only -based VLD-mode bitstream decoding operations. The specification defines new restricted-mode DXVA profiles for MPEG-1 VLD decoding. In these profiles, the accelerator performs bitstream parsing, inverse quantization scaling, inverse transform processing, and motion compensation, according to the MPEG-1 specification.

The MPEG-1 specification, ISO/IEC 11172-2:1993, Information technology — Coding of moving pictures and associated audio for digital storage media at up to about 1,5 Mbit/s — Part 2: Video, is available at http://www.iso.org/iso/catalogue_detail.htm?csnumber=22411.

All aspects of DXVA operation that are not specified herein are identical to the prior specification for MPEG-1 and MPEG-2 DXVA usage, as specified in the Windows SDK and DDK. The meanings of the structure members are unchanged for MPEG-1 VLD video decoding. The DXVA syntax structures are documented in the DXVA 1.0 and DXVA 2.0 documentation (see “For More Information,” in this specification). 2. Modifications Common to the Additional Modes This section describes modifications to the DXVA specifications that apply to all the restricted-mode profiles described in this document.

2.1 Configuration Parameters

This section describes the configuration parameters for MPEG-1 VLD video decoding. Configuration is performed by using the same "probe and lock" process that was defined previously for DXVA. The existing DXVA configuration structures are used:

 DXVA 1 configuration uses the DXVA_ConfigPictureDecode structure.  DXVA 2 configuration uses the DXVA2_ConfigPictureDecode structure.

The meaning of the structure members is unchanged for MPEG-1 VLD DXVA. The following table lists restrictions on the structure members in this context.

Structure Member Value ConfigBitstreamRaw 1 ConfigMBcontrolRasterOrder 0 (because ConfigBitstreamRaw is 1) ConfigResidDiffHost 0 (because ConfigBitstreamRaw is 1) ConfigSpatialResid8 0 (because ConfigResidDiffHost is 0) ConfigResid8Subtraction 0 (because ConfigResidDiffHost is 0) ConfigSpatialHost8or9Clipping 0 (because ConfigResidDiffHost is 0) ConfigSpatialResidInterleaved 0 (because ConfigResidDiffHost is 0) ConfigIntraResidUnsigned 0 (because ConfigResidDiffHost is 0) ConfigResidDiffAccelerator 0 (because ConfigBitstreamRaw is 1) ConfigHostInverseScan 0 (because ConfigResidDiffAccelerator is 0) ConfigSpecificIDCT 0 (because ConfigResidDiffAccelerator is 0) Config4GroupedCoefs 0 (because ConfigResidDiffAccelerator is 0) ConfigDecoderSpecific 0

© 2011 Microsoft Corporation. All rights reserved. DXVA for MPEG-1 VLD and Combined MPEG-1 and MPEG-2 VLD Video Decoding 5

2.2 Revisions to the DXVA_PictureParameters Data Structure

For the DXVA_PictureParameters data structure, the following member semantics are replaced as follows: bReservedBits Must be zero for all video types other than the new MPEG1_VLD and MPEG2and1_VLD modes involving MPEG-1 (see Section 3). If MPEG1_VLD or MPEG2and1_VLD mode is used, this structure member is interpreted as follows:  0: The associated bitstream data buffers are encoded in the MPEG-2 format.  1: The associated bitstream data buffers are encoded in the MPEG-1 formats. wBitstreamPCEelements If the bConfigBitstreamRaw member of the DXVA_ConfigPictureDecode structure is 1, this member contains a set of flags for the bitstream decoding process for MPEG-1 or MPEG-2 video. If bConfigBitstreamRaw is zero, wBitstreamPCEelements is not used and must be zero. For all video types other than MPEG-2 and the new MPEG1_VLD and MPEG2and1_VLD modes involving MPEG-1, wBitstreamPCEelements is not used and must be zero. When wBitstreamPCEelements is used, the bits are defined by their correspondence with bitstream elements of the MPEG-2 picture coding extension and MPEG-1 syntax, as follows: Bits Description Value for MPEG-1 14,15 Equal to intra_dc_precision. 0 12,13 Equal to picture_structure. The value must be picture_structure equal to the bPicStructure member of the DXVA_PictureParameters structure. 11 Equal to top_field_first. 1 10 Equal to frame_pred_frame_dct. 1 9 Equal to concealment_motion_vectors. 0 8 Equal to q_scale_type. 0 7 Equal to intra_vlc_format. 0 6 Equal to alternate_scan. 0 5 Equal to repeat_first_field. (This value is not 0 needed by the accelerator.) 4 Equal to chroma_420_type. For MPEG-2, it is 1 restricted to be equal to progressive_frame. (This value is not needed by the accelerator.) 3 Equal to progressive_frame. 1 2 For MPEG-2, this bit is reserved and should full_pel_forward_vector equal zero. For MPEG-1, this bit is equal to full_pel_forward_vector. 1 For MPEG-2, this bit is reserved and should full_pel_backward_vector equal zero. For MPEG-1, this bit is equal to full_pel_backward_vector. 0 Reserved bit. Should equal zero. 0

© 2011 Microsoft Corporation. All rights reserved. DXVA for MPEG-1 VLD and Combined MPEG-1 and MPEG-2 VLD Video Decoding 6

3. Restricted-Mode Specifications This section describes the new restricted-mode profiles.

3.1 MPEG1_VLD profile The MPEG1_VLD restricted-mode profile contains a set of features required to support MPEG-1 video (ISO/IEC 11172-2). In this profile, the accelerator performs bitstream parsing, inverse quantization scaling, inverse transform processing, and motion compensation according to the MPEG-1 specification.

In this mode, the bitstream data buffers shall not contain MPEG-1 D-pictures. If present in a source bitstream, the host decoder shall remove any such pictures before passing bitstream data buffers to the accelerator. However, the accelerator shall ignore any such pictures if present, without affecting the decoding and output of any other pictures.

The GUID and restricted-mode constant for this profile are currently not defined in the Windows SDK. To use this profile, use the following declarations:

// {6F3EC719-3735-42cc-8063-65CC3CB36616} DEFINE_GUID(DXVA_ModeMPEG1_VLD, 0x6f3ec719, 0x3735, 0x42cc, 0x80, 0x63, 0x65, 0xcc, 0x3c, 0xb3, 0x66, 0x16);

#define DXVA_RESTRICTED_MODE_MPEG1_VLD 0x10

The MPEG1_VLD profile has the same restrictions on DXVA data structure values as the existing MPEG1_A profile (http://go.microsoft.com/fwlink/?LinkId=210874), except as specified herein. The following additional constraints are also imposed.

Restrictions on DXVA_ConnectMode

The following restriction on the DXVA_ConnectMode structure applies when the bDXVA_Func variable defined in the dwFunction member of the DXVA_ConfigPictureDecode structure is equal to 1.

Structure Member Value wRestrictedMode DXVA_RESTRICTED_MODE_MPEG1_VLD

3.2 MPEG2and1_VLD Profile The MPEG2and1_VLD restricted-mode profile contains a set of features required to support MPEG-2 Main Profile video (H.262; ISO/IEC 13818-2) and MPEG-1 video (ISO/IEC 11172-2). In this profile, the accelerator performs bitstream parsing, inverse quantization scaling, inverse transform processing, and motion compensation according to the MPEG-2 Main Profile or MPEG-1 specification.

In this mode, the bitstream data buffers shall not contain MPEG-1 D-pictures. If present in a source bitstream, the host software decoder shall remove any such pictures before passing bitstream data buffers to the accelerator. However, the accelerator shall ignore any such pictures if present, without affecting the decoding and output of any other pictures.

© 2011 Microsoft Corporation. All rights reserved. DXVA for MPEG-1 VLD and Combined MPEG-1 and MPEG-2 VLD Video Decoding 7

When this profile is used, the accelerator shall support switching between the MPEG-2 Main Profile and MPEG-1 video formats for picture decoding and output.

The GUID and restricted-mode constant for this profile are currently not defined in the Windows SDK. To use this profile, use the following declarations:

// {86695F12-340E-4f04-9FD3-9253DD327460} DEFINE_GUID(DXVA_ModeMPEG2and1_VLD, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);

#define DXVA_RESTRICTED_MODE_MPEG2and1_VLD 0x11

In the MPEG2and1_VLD profile, when the bReservedBits member of DXVA_PictureParameters is 0, the profile has the same restrictions on DXVA data structure values as the existing MPEG2_C profile (http://go.microsoft.com/fwlink/?LinkId=210875), except as specified herein.

When the bReservedBits member of DXVA_PictureParameters is 1, the profile has the same restrictions on DXVA data structure values as the existing MPEG1_A profile (http://go.microsoft.com/fwlink/?LinkId=210874), except as specified herein.

The following additional constraints are also imposed.

Restrictions on DXVA_ConnectMode

The following restriction on the DXVA_ConnectMode structure applies when the bDXVA_Func variable defined in the dwFunction member of the DXVA_ConfigPictureDecode structure is equal to 1.

Structure Member Value wRestrictedMode DXVA_RESTRICTED_MODE_MPEG2and1_VLD

The requirements for supporting this profile are a superset of those needed to support the MPEG-1 video restricted-mode profile and the MPEG-2 Main Profile restricted-mode profile in VLD operation. Therefore, if a hardware accelerator driver supports this profile, it should also indicate support for DXVA_ModeMPEG1_VLD restricted-mode profile. In addition, it should indicate support for either DXVA2_ModeMPEG2_VLD or DXVA_ModeMPEG2_C restricted-mode profile. For More Information  DXVA 1.0 specification: http://go.microsoft.com/fwlink/?LinkId=93647  DXVA interfaces: http://go.microsoft.com/fwlink/?LinkId=210876  DXVA configuration: http://go.microsoft.com/fwlink/?LinkId=210877  (WDK) documentation for DXVA: http://msdn.microsoft.com/en-us/library/ff55386.aspx  DXVA 2.0: http://go.microsoft.com/fwlink/?LinkId=94771

Web addresses can change, so you might be unable to connect to the or sites mentioned here.

© 2011 Microsoft Corporation. All rights reserved.