WO2007100616A1 - Accelerated video encoding - Google Patents

Accelerated video encoding Download PDF

Info

Publication number
WO2007100616A1
WO2007100616A1 PCT/US2007/004638 US2007004638W WO2007100616A1 WO 2007100616 A1 WO2007100616 A1 WO 2007100616A1 US 2007004638 W US2007004638 W US 2007004638W WO 2007100616 A1 WO2007100616 A1 WO 2007100616A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
encoding
encode
acceleration
pipeline
Prior art date
Application number
PCT/US2007/004638
Other languages
French (fr)
Inventor
Anand Ganesh
Donald J. Munsil
Gary J. Sullivan
Glenn F. Evans
Shyam Sadhwani
Stephen J. Estrop
Original Assignee
Microsoft Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Microsoft Corporation filed Critical Microsoft Corporation
Priority to CN2007800065644A priority Critical patent/CN101390397B/en
Priority to KR1020087020009A priority patent/KR101183429B1/en
Priority to BRPI0708265-7A priority patent/BRPI0708265B1/en
Priority to EP07751404A priority patent/EP1987674A4/en
Priority to JP2008556422A priority patent/JP5420254B2/en
Publication of WO2007100616A1 publication Critical patent/WO2007100616A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/127Prioritisation of hardware or computational resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/156Availability of hardware or computational resources, e.g. encoding based on power-saving criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/242Synchronization processes, e.g. processing of PCR [Program Clock References]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/647Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
    • H04N21/64784Data processing by the network

Definitions

  • Patent Application serial no. 11/276,336 filed on February 24, 2006, titled “Accelerated Video Encoding", and hereby incorporated by reference.
  • Multimedia content production and distribution operations typically include video encoding.
  • Video encoding processes are typically very data and computationally intensive. As a result, video encoding processes can be very time consuming. For example, it may take several tens-of hours for a software encoder to encode a high-quality high definition movie. Since quality and speed of video encoding processes are significant factors for successful multimedia content production and distribution pipelines, systems and techniques to increase the speed at which high quality video content can be encoded would be useful.
  • a video encoding acceleration service to increase one or more of the speed and quality of video encoding.
  • the service acts as an intermediary between an arbitrary video encoder computer program application and arbitrary video acceleration hardware.
  • the service receives one or more queries from the video encoder to identify implementation specifics of the video acceleration hardware.
  • the service interfaces with the video acceleration hardware to obtain the implementation specifics.
  • the service communicates the implementation specifics to the video encoder.
  • the implementation specifics enable the video encoder to: (a) determine whether one or more of speed and quality of software encoding operations associated with the video encoder can be increased with implementation of a pipeline of one or more supported encoding pipeline configurations and capabilities, and (b) implement the pipeline by interfacing with the service.
  • FIG. 1 illustrates an exemplary system for accelerated video encoding, according to one embodiment.
  • FIG. 2 shows an exemplary embodiment of a video encoding pipeline configuration, wherein some of the encoding processes are accelerated in hardware.
  • FIG. 3 shows an exemplary procedure for accelerated video encoding, according to one embodiment.
  • Fig. 4 in the Appendix shows an exemplary video encoder application to illustrate the manner in which video encoding acceleration application programming interfaces can be utilized, according to one embodiment.
  • Fig. 5 in the Appendix shows an exemplary video encoding pipeline configuration, wherein acceleration hardware accelerates motion estimation, transform, quantization, and the inverse process to produce encoded images, according to one embodiment.
  • Fig. 6 in the Appendix shows an exemplary video encoding pipeline configuration in which hardware accelerates only motion estimation, according to one embodiment.
  • Fig. 7 in the Appendix shows several exemplary motion estimation parameters, according to one embodiment.
  • Fig. 8 in the Appendix shows exemplary motion vector data stored in a Display 3-Dimensional (D3D) surface, according to one embodiment.
  • Fig- 9 in the Appendix shows an exemplary diagram indicating that width of a luma surface matches an original YCbCr image, according to one embodiment.
  • Fig. 10 in the Appendix shows an exemplary diagram indicating that the number of residue value per line of video is Vz width of the original video image, according to one embodiment.
  • Fig. 11 in the Appendix shows an exemplary diagram indicating that the width of the residue surface is 1 A the width of the original progressive frame, according to one embodiment.
  • Systems and methods for accelerated video encoding provide a video encoding acceleration service.
  • This service allows an arbitrary video encoder application to interface, in a device independent manner, with arbitrary video acceleration hardware to define and implement a substantially optimal video encoding pipeline.
  • the service exposes video acceleration (VA) application program interfaces (APIs).
  • VA video acceleration
  • APIs application program interfaces
  • These APIs encapsulate a model of the video encoding process.
  • the video encoder application uses the VA APIs to query implementation specifics (e.g., capabilities, etc.) of available video (graphics) acceleration hardware.
  • the video encoder evaluates these specifics in view of the application's particular video encoding architecture (software- implemented) to identify any encoding operations that could benefit (e.g., speed and/or quality benefits) from being accelerated in hardware.
  • Such operations include, for example, motion estimation, transform, and quantization operations and inverse operations such as Motion compensation, inverse transforms and inverse quantization.
  • the API also allows the video encoder to design an encoding pipeline that substantially minimizes dataflow transitions across buses and processors associated with the host computing device and the acceleration hardware, and thereby, further increase encoding speeds.
  • the API also allows the acceleration hardware to influence the location of the data to improve local caching (e.g. the video acceleration hardware may functional more efficiently on memory local to the video hardware).
  • the video encoder designs a customized video encoding pipeline that performs some number of encoding operations in software and some number of encoding operations using the acceleration hardware (i.e., at least a subset of the operations that could benefit from being hardware accelerated).
  • the encoder application then uses the API to create the pipeline and encode video content.
  • This customized pipeline is substantially optimized as compared to a completely software-implemented pipeline because certain encoding operations are accelerated and data transitions between the host and the acceleration hardware are minimized. Additionally, processing time freed up by accelerating certain aspects of the encoding process and minimizing data transitions allow the host processor(s) to perform higher-quality encoding operations with freed-up processing cycles.
  • the API is also designed to allow components to operate in parallel so that computational resource usage can be maximized.
  • Program modules generally include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types.
  • Fig. 1 shows an exemplary system 100 for accelerated video encoding, according to one embodiment.
  • System 100 includes host computing device 102.
  • Host computing device 102 represents any type of computing device such as a personal computer, a laptop, a server, handheld or mobile computing device, etc.
  • Host computing device 102 includes one or more processihg units 104 coupled across a bus 103 to system memory 106.
  • System memory 106 includes computer-program modules ("program modules") 108 and program data 110.
  • a processor 104 fetches and executes computer- program instructions from respective ones of the program modules 108.
  • Program modules 108 include video processing modules 112 for processing video content, and other program modules 114 such as an operating system, device drivers (e.g., for interfacing to video encoding acceleration hardware, etc.), and/or so on.
  • Video processing modules 112 include, for example, video encoder 116, video encoding acceleration service 118, and other processing modules 120, for example, a video decoder, video filter(s), a video renderer, etc.
  • video encoder 116 is an arbitrary video encoder. This means that the particular architecture, operation, data formats, etc, implemented and/or utilized by video encoder 116 are arbitrary. For example, video encoder 116 may be distributed by a third party, an OEM, etc. Additionally, although Fig. 1 shows video encoding acceleration service 118 independent of the operating system portion of "other program modules" 114, in one implementation, video encoding acceleration service 118 is part of the operating system.
  • Video processing modules 112 receive compressed or uncompressed input video data 122.
  • video processing modules 112 decode the input video data 122 to produce decoded source video data.
  • decoding operations are performs by a decoder module.
  • partially decoded data could also be retained to further assist the encoding process.
  • a decoder module is shown as a respective portion of "other video processing modules" 120.
  • decoded source video data is represented either by input video data 122 that was received in a decoded state, or represented with results of decoding input video data 122 that was received in an encoded state.
  • Decoded source video data is shown as a respective portion of "other program data" 124.
  • video encoder 116 interfaces with video encoding acceleration service 118 via video acceleration (VA) APIs 128.
  • VA video acceleration
  • One exemplary implementation of multiple possible implementations of VA APIs 128 is described in the Appendix.
  • the video encoder application uses respective ones of the VA API 128 (e.g., please see the Appendix, ⁇ 3.4, IVideoEncoderService) to obtain implementation specifics of available acceleration hardware 130.
  • Such implementation specifics include, for example:
  • video encoding acceleration service 118 queries the video acceleration hardware 130 for the requested implementation specifics and returns information associated with the corresponding responses from the acceleration hardware 130 to the video encoder 116.
  • Video encoding acceleration service 118 interfaces with the video acceleration hardware 130 using a corresponding device driver. Such a device driver is shown as respective portion of "other program modules" 114.
  • Video encoder 116 evaluates the implementation specifics supported by acceleration hardware 130 in view of the application's particular video encoding architecture (software-implemented) to identify any encoding operations that could benefit (e.g., speed and/or quality benefits) from being accelerated in hardware, select a search profile to encapsulate a trade-off between video encoding quality and speed, minimize data transitions across buses and between processors, etc.
  • exemplary operations that may benefit from hardware acceleration include, for example, motion estimation, transform, and quantization. For example, one reason to perform quantization in hardware is to minimize dataflow between pipeline stages.
  • Fig. 2 shows an exemplary embodiment of a video encoding pipeline configuration, wherein some of the encoding processes are accelerated in hardware.
  • operations and data flow associated with Fig. 2 are described with respect to particular ones of the components of Fig. 1.
  • the left-most number of a reference numeral indicates where the particular figure where the component/data path/referenced item was first introduced.
  • the left-most number of pipeline 200 is say "2", indicating that it is first introduced in Fig. 2.
  • encoding pipeline 200 was configured/customized by video encoder 116 (Fig. 1) interfacing with video encoding service 118 such that respective ones of host 102 implemented processing operations are accelerated in hardware 130.
  • processing- operations illustrated on the right side of the bold dotted line in Fig. 2 are accelerated by hardware (e.g., acceleration hardware 130 of Fig. 1) and processing-operations illustrated on the left side of the figure are performed by the host computing device 102 (Fig. 1).
  • hardware e.g., acceleration hardware 130 of Fig. 1
  • processing-operations illustrated on the left side of the figure are performed by the host computing device 102 (Fig. 1).
  • optional configured data access pathways are shown with non-bolded dotted lines.
  • Ovals 204 and 212 represent respective original and coded picture memory stores.
  • video encoder 116 takes as input some form of compressed or uncompressed video data 202 (please also see input video data 122 of Fig. 1).
  • the exemplary pipeline configuration of Fig. 2 does not copy input source video 202 ("raw video source") to the host computing device 102 if the source 202 is not originating from the host 102 and if the host decision making engine (e.g., video encoder 116) does not use the source video. For example, if quantization decisions do not require the host to touch the video data, the data will not be transferred.
  • pipeline 200 is configured to convert the input data 202 to another compressed form using the respective operations of blocks 206, 208 and 214 through 218.
  • Such operations may include converting uncompressed (YUV) video data to compressed MPEG-2, or it may include transcoding video data from MPEG-2 data format to WMV data format.
  • the transcoding operations include a full or partial decompression stage followed by an encode stage (there are more efficient models which by-pass decompression and work purely in the transform (DCT) space).
  • DCT transform
  • a number of video compression formats make use of motion estimation, transform and quantization to achieve compression.
  • motion estimation is typically the slowest step, including a massive search operation where an encoder (e.g., video encoder 116) attempts to find the closest matching reference macroblock for macroblocks in a given image.
  • the encoder 116 computes the differential residues (e.g., via block 208) based on the previously coded image and the optimal motion vector.
  • the motion vector, along with the differential residue is a compact representation of the current image.
  • the motion vector data is further represented differentially.
  • the host encoder can optionally request the re-evaluation of motion vectors by the video acceleration hardware to find a macroblock with a smaller combined motion vector and/or residual.
  • the resulting differential motion vector data, and the residual data are compacted (e.g., via block 218), for example, using techniques like run-length encoding (RLE) and differential coding (e.g.: Huffman and Arithmetic coding) to generate the final coded stream of bits (encoded video data 126) to communicate to a destination (block 218) for presentation to a user.
  • RLE run-length encoding
  • differential coding e.g.: Huffman and Arithmetic coding
  • blocks 206, 208 and 214 through 218 e.g., operations such as motion estimation (206), mode decision, motion vector (MV) selection and rate control (208), prediction formation (210), transform and quantization operations (214), quantizer inversion and transform and version (216) and entropy coding (218)
  • 206 motion estimation
  • MV motion vector
  • 208 motion vector selection and rate control
  • 210 prediction formation
  • transform and quantization operations 214
  • quantizer inversion and transform and version 216
  • entropy coding entropy coding
  • video encoder 116 is a multi-threaded application providing for full utilization of acceleration hardware 130.
  • video encoder 116 may structure the particular pipeline configuration such that both processor 104 and acceleration hardware 130 is fully utilized.
  • the pipeline may be configured to perform entropy (or arithmetic or Huffman) coding operations in software by the host, on a different frame of video data.
  • An exemplary single motion vector pipeline representing the particular pipeline configuration selected/structured is described below in the Appendix in section 5.1.1.
  • Exemplary multiple motion vector (relatively complex) pipelines wherein video encoder 116 requests multiple motion vectors from acceleration hardware 130 and selects one motion vector pipeline based on various parameters is described below in the Appendix in section 5.1.2.
  • the quality of motion vectors refers to a bitrate of a stream generated by the use of the motion vectors. High quality motion vectors are associated with low bitrate streams. The quality is determined by the completeness of the block search, the quality of the algorithm, the distance metric used, etc. High quality motion vectors should be used to perform high quality video encode operations.
  • video encoding acceleration service 118 provides a generic construct called a search profile to encapsulate a trade-off between quality and time.
  • the search profile also includes meta-data to identify the search algorithm used by the acceleration hardware 130, etc.
  • Video encoder 116 chooses a particular search profile based on the particular requirements of the encoder's implementation.
  • an encode process implemented by a video encoding pipeline configuration will typically include several processing stages, each of which may or may not be accelerated via acceleration hardware 130.
  • video encoder 116 determines to utilize hardware acceleration in successive stages of the encode pipeline, it may not be necessary to move data from acceleration hardware 130 based memory 132 to the system memory 106 associated with the host computing device 102, and then back to acceleration hardware based memory 132 for the next stage, and so on..
  • pointers to various types of video and motion vector data may be transferred back and forth between the host computing device 102 and the acceleration hardware 130
  • actual data is copied to system memory 106 only when the data pointer (a D3D9 Surface pointer) is explicitly locked using, for example, IDirect3DSurface9::LockRect.
  • IDirect3DSurface9::LockRect Exemplary interfaces for locking a surface are known (e.g., the well-known EDirect3DSurface9::LockRect.interface).
  • video encoder 116 design a video encoding pipeline that substantially minimizes data transfers across buses and between processors, and thereby, further increase video encoding speeds.
  • video encoder 116 has evaluated the implementation specifics supported by acceleration hardware 130 in view of the application's particular video encoding architecture (software- implemented) to identify any encoding operations that could benefit from being accelerated in hardware, selected a search profile, minimized data transitions across buses and between processors, and/or so on. Based on these determinations, video encoder 116 selects a particular pipeline configuration to encode decoded source video data, and thereby, generate encoded video data 126.
  • video encoder 116 interfaces with video encoding acceleration service 118 to create an encoder object to implement the selected pipeline (please see the Appendix, CreateVideoEncoder API, ⁇ 3.4.6).
  • an encoder object e.g., a regular COM object
  • a format for the output encoded bitstream is created by identifying the selected pipeline configuration and one or more of the following: a format for the output encoded bitstream, the number of input and output data streams associated with the . pipeline configuration, static configuration properties, a suggested number of buffers (surfaces) for association with the different I/O streams based on the selected pipeline configuration, and a driver specified allocator queue size based on resources a graphics device driver is able to gather, and other parameters.
  • Quadeue size and the number of data buffers are essentially referring to the same thing; one is "suggested", the other is "actual").
  • video encoder 116 uses the created encoder object to interface with the video encoding acceleration service 118 to encode the decoded source video data. To this end, the encoder object submits execute requests to acceleration hardware 130 (please see the Appendix, IVideoEncode:Execute API, ⁇ 3.2.3).
  • system 100 allows arbitrary implementations of video encoder applications 116 to define and create video encoding pipeline configurations during runtime to take full advantage of available video encoding acceleration hardware to increase encoding speed and quality.
  • the video encoder 116 can use VA APIs 128 to specify that the encoding pipeline is to implement iterative directed searching (multiple search passes of increasing refinement), define and use generically selectable search strategies (e.g., selecting a search algorithm based on quality metrics independent of any knowledge of details about the actual algorithm been employed), utilize format independent methodologies (e.g., where a video encoder 116 is unaware of the particular image format of input video data 122 and the acceleration hardware 130 is unaware of the compressed output format for the encoded video data 126) to control searching, adapt data sizes (e.g., where the video encoder 116 selects a macro block size based on a search algorithm), and so on.
  • Fig. 3 shows an exemplary procedure 300 for accelerated video encoding, according to one embodiment.
  • the operations of the procedure are described with respect to components of system 100 of Fig. 1.
  • the leftmost numeral of a component reference number indicates the particular figure where the component is first described.
  • video encoder 116 receives input video data 122. If the input video data 122 is not compressed, the input video data represents decoded source video data. At block 304, if the input video data 122 is compressed, video encoder 116 decompresses the input video data to generate decoded source video data. At block 306, video encoder 116 interfaces with VA API 128 to query acceleration hardware 130 for capabilities and video encoding pipeline configuration implementation specifics.
  • video encoder 116 evaluates the supported capabilities and implementation specifics within the context of the implementation of the video encoder 116, to identify video encoding operations associated with the particular implementation of the video encoder 116 that may benefit from hardware acceleration, make encoding speed and/or quality decisions, minimize data transitions across busses and between processors, and/or so on. [0040] At block 310, video encoder 116 creates an encoding object that implements an encoding pipeline configured to execute the identified video encoding operations that may benefit from hardware acceleration in acceleration hardware 130, implement the speed/quality tradeoffs (e.g., via a selected search profile), and minimize data flow transitions.
  • speed/quality tradeoffs e.g., via a selected search profile
  • video encoder uses the created encoder object to encode the decoded source video data according to the sequence of operations and encoding architecture delineated by the customized video encoding pipeline generated at block 310. These encoding operations of block 312 generate encoded video data 126 (Fig.
  • APIs 128 of Fig. 1 have been described within the context of encoding video data, APIs 128 can be used outside of the encoding context for hardware acceleration of other functions such as edge detection, motion-vector based noise reduction, image stabilization, sharpening, frame rate conversion, velocity computation for computer vision applications, etc.
  • video encoder 116 Fig. 1 computes motion vectors for all macroblocks of decoded source image data. Then, video encoder 116 utilizes motion magnitude, direction, and correlation to motion vectors of surrounding macroblocks to determine whether there is a local object motion in the input image.
  • the video encoder 116 of then utilizes the magnitude of the vector to direct object tracking / filtering aggressiveness or average shifts of a particular object to reduce statically random noise.
  • video encoder 116 computes motion vectors for all macroblocks and decoded source data. Video encoder 116 then determines whether there is global motion in the image. This is accomplished by correlating all motion vector values and determining whether the correlated values are similar. If so, then video encoder 116 concludes that there is global motion. Alternatively the video encoder 116 utilizes a large macroblock size and determines if there is overall motion of the large macroblock.
  • video encoder 116 After determining whether global motion is present, if video encoder 116 also finds that the global motion vector tends to be jerky across frames, video encoder 116 concludes that there is camera jerkiness and compensates for this before starting noise filtering and encoding operations.
  • APIs 128 are designed to enable encoding and video processing applications (e.g., a video encoder module 1 16) to leverage acceleration hardware 130 (e.g., a GPU) support for accelerating Motion Estimation, Residue Computation, Motion Compensation and Transform.
  • Fig. 5 shows an exemplary video encoder application to illustrate the manner in which video encoding acceleration APIs can be utilized, according to one embodiment.
  • video encoder 116 is implemented in the form of a DMO or MFT.
  • Fig. 5 shows the input data (corresponding to a "Receive") and output data after several stages of processing.
  • the boxes represent data while the circles represent API functions invoked by the encoder application. The circles thus represent the core of the API as seen by the encoder application.
  • Acceleration hardware is viewed as a pipeline, and a pipeline GUID is used to describe the most basic configuration elements of the pipeline.
  • the goal of encode speed-up may be thought of intimately connected to the goal of pipeline efficiency.
  • the design allows for split (or multi-stage) pipelines where data goes back and forth between the host PC and the hardware, before the final output is obtained.
  • No multi-stage pipeline configuration has been designed yet, the configurations below describe nonsplit, single stage pipelines.
  • Fig. 6 shows an exemplary video encoding pipeline configuration, wherein acceleration hardware accelerates Motion Estimation, Transform, Quantization, and the inverse process to produce decoded images, according to one embodiment.
  • the hardware produces as output Motion Vectors, Residues (luma and chroma) and a Decoded Image.
  • the Decoded Image need not be transferred to system memory as its sole purpose is to compute Motion Vectors for the next frame.
  • NumStreams For this pipeline configuration, NumStreams is five. The actual Streamlds are shown in the diagram in parentheses.
  • StreamType_* is an abbreviation for VA2_Encode_StreamType_*.
  • the stream ID is one, and the stream type is StreamTypeJVideo. This stream represents the image for which motion data is sought.
  • the allocator for this stream is negotiable - either the current interface can supply one, or an external APPENDIX
  • a Exemplary Video Encode Acceleration API allocator can be used. The choice of allocator is made at the time of creation, and if an external allocator is chosen, a stream ID of one will be considered an illegal input value for GetBuffer.
  • the stream ID is two, and the stream type is StreamType_Video.
  • This stream represents a list of reference images used to compute motion vectors.
  • the current interface does not supply a separate allocator for this stream.
  • the Stream ID is three, and the stream type is StreamTy ⁇ e_MV.
  • This stream represents an output parameter containing motion vector data. Buffers for this stream are obtained via GetBuffer only. Residues
  • the stream ID is four, and stream type is StreamType_Residues. This stream represents an output parameter containing residue values for all three planes.
  • the stream ID is five, and the stream type is StreamType_Video.
  • This stream represents an output parameter containing the decoded image obtained from the quantized residues and motion vector values. Buffers for this stream are obtained via GetBuffer only.
  • Fig. 7 shows an exemplary video encoding pipeline configuration in which hardware accelerates only Motion Estimation, according to one embodiment.
  • This pipeline configuration takes a set of reference images as input, and dumps Motion Vectors as output.
  • the Decoded Image in this case has to be generated and supplied by the host software.
  • VA2_Encode_ExecuteDataParameter** pOutputData, tin] UINT32 NumConfigurationParameters, [in, sxze_is (NumConfigurationParameters]
  • StreamType Specifies the type of buffer to be returned.
  • the stream type will be implied by the Streamld, and negotiated at the time of creation. If StreamType is not consistent with Streamld, the function returns an error value.
  • the data buffer is interpreted (typecast) based on the value of StreamType as described by the table in the remarks section.
  • Pointer to a data buffer to be released via ReleaseBuffer The pointer is recast (interpreted) based on the StreamType parameter, and this is described in the table in the remarks section below.
  • Streamld is invalid. GetBuffer does not supply buffers for the specified Stream ID. Allowed values for Streamld are described as part of the pipeline configuration. For the specified stream ID, the allocator may be external, or there may be no allocator at all. EJFAIL
  • this function Normally, this function returns control very soon as the buffers are already present in the allocator queue. The only conditions under which this function should block (or return APPENDIX A Exemplary Video Encode Acceleration API
  • E_NOTA VAILABLE are when all buffers from the allocator queue have been submitted to the device, or being consumed by the application, and hence not released.
  • This function is used to release a surface back into the allocator queue for reuse via GetBuffer.
  • This function is used to submit requests to the hardware. It contains input and output data buffers obtained via GetBuffer, as well as some configuration information.
  • the function is asynchronous and its completion is indicated by the event being signalled. The completion status is indicated using the pStatus parameter which is allocated on the heap, and checked only after the event has been signalled.
  • the buffers supplied as parameters to this function are not be read from (eg: via LockRect), or written to by the application till the function has truly completed. True completion is implied by an error value being returned by the function, or if this function returns success, then by the signalling of hEvent (parameter to this function).
  • hEvent parameter to this function.
  • the pointer to a surface in use by Execute may still be APPENDIX
  • this parameter ident ⁇ es the specific stage of the split pipeline. The numbering is one-based, and for non-split pipelines this parameter is ignored. NumlnputDataParameters
  • Event handle signalling that the output data is ready.
  • a Exemplary Video Encode Acceleration API contain any useful data. This parameter is allocated on the heap, and the return value is checked only after hEvent has been signalled.
  • the event handle gets signalled, it means that LockRect should complete instantly when called on any of the output surfaces since they are ready.
  • the LockRect call is expected to not block for any length of time by waiting on any event handles. Nor is it allowed to waste CPU time through busy spins.
  • the Execute call has data parameters and configuration parameters. Specific data parameters can be thought of as deriving from VA2_Encode_ExecuteDataParameter base class (or structure) and specific configuration parameters can be thought of as deriving from VA2_Encode_ExecuteConfigurationParameter base class (or structure).
  • the buffer formats are negotiated at creation time using the StreamDescription parameter.
  • This structure acts as a base type for more specialized configuration information.
  • the base type is typecast to a more specialized type based on the Conf ⁇ gurationType parameter.
  • the mapping between ConfigurationType and the specialized structures is described in the table below.
  • VA2_Encode_MVSurface pMVSurface; ⁇ VA2_Encode_ExecuteDataParameter_MotionVectors ;
  • VA2_Encode_ResidueSurface pResidueSurfaceY
  • the ID of the data stream as defined in the pipeline configuration This can be used to infer whether the data is input or output. . pResidueSurfaceY
  • Residue surface containing chroma Cr values Residue surface containing chroma Cr values.
  • Pointer to a structure containing the input image D3D Surface. This is the surface for which motion vectors are sought.
  • Array of reference images on which to base the motion vectors For simple formats like MPEG-2 only one progressive frame (or two fields) may be used. On the other hand, formats like H.264 and VC-I support motion vectors spanning several frames.
  • a P-Frame in MPEG-2 uses only one reference image while a B-frame with interlaced video, and field type motion might use 4 images each of which may refer to a frame or a field.
  • DataType APPENDIX A Exemplary Video Encode Acceleration API pYCbCrlmage
  • Output decoded image obtained after inverse quantization, inverse transform and motion compensation.
  • the associated D3D Surface should not be locked, or the data transferred to system memory unnecessarily.
  • the surface pointers can stil be used as a Reference Image.
  • a value of one indicates that the surface contains a field of video data, and the data is assumed to be interlaced. Zero indicates a full progressive frame. Interlaced
  • a value of one indicates that the image data is interlaced. This flag should be used only when Field (above parameter) is set to one. If Field is set to one, the data is assumed to be interlaced. Window
  • Pointer to a structure definining various parameters governing motion search including search window, etc.
  • Fig. 8 shows several exemplary Motion Estimation parameters, according to one embodiment. These parameters are for use in the structures below.
  • APPENDIX A Exemplary Video Encode Acceleration API
  • VA2_Encode_SearchReBolution_QuarterPixel VA2_Encode_SearchResolution
  • Motion Vectors are calculated in full pixel units.
  • Motion Vectors are calculated in quarter pixel units.
  • a Motion Vector value of (10, 10) refers to a macroblock of data that is (2.5, 2.5) pixels away.
  • the encoder estimates luma and chroma values using interpolation.
  • the specific interpolation scheme is format dependent, and the following GUIDs (part of static configuration) control the interpolation scheme.
  • a value of one indicates that all Macroblocks in the current image have the same size. This may not be true for formats like H.264. MBWidth
  • Width of a macroblock Valid only if bConstantMBSize is one. MBHeight
  • Hint about the expected direction of motion to guide the motion search. This refer to the overall motion in the image and may not be applicable on a per MB basis. HintY
  • Hint about the expected direction of motion to guide the motion search refer to the overall motion in the image and may not be applicable on a per MB basis.
  • Step size to be used when performing quantization This design allows only one step size to be used for entire portion of the image for which Motion Vectors and Residues were requested in this call.
  • the methods in this interface allow an application to query the hardware for its capabilities and create an encoder object with a given configuration.
  • GUIDs An array of GUIDs describing the various pipeline configurations supported by the device.
  • the memory is allocated by the callee, and should be released by the caller using CoTaskMemFree.
  • GUIDs An array of GUIDs describing the various formats supported by the device (eg: WMV9, MPEG-2, etc.).
  • the memory is allocated by the callee, and should be released by the caller using CoTaskMemFree.
  • GUIDs An array of GUIDs describing the various search metrics supported by the device for motion estimation.
  • the memory is allocated by the callee, and is released by the caller using CoTaskMemFree.
  • GUIDs representing the search profiles supported by the device.
  • the search- profiles allow the codec application time-quality trade-offs more effectively.
  • the memory is allocated by the callee, and is released by the caller using CoTaskMemFree.
  • a pointer to the Motion Estimation capabilities of the device This includes information about the size of image the device can handle, the maximum search window size and whether the device supports variable maeroblock sizes.
  • the memory for this is allocated by the caller.
  • This function creates an instance of IVideoEncoder.
  • a GUID representing the pipeline configuration desired The list of configurations is obtained via GetCapabilities, and each of the GUIDs is associated with public documentation that describes necessary details about the configuration. FormatGuid
  • the caller (codec application) suggests a certain number of buffers (surfaces) to be associated with the different streams based on its pipeline design.
  • the driver specifies the actual allocator queue size based on resources it is able to gather, and other considerations. The assumption is that the application will abort use of this interface if it cannot build an efficient pipeline with the buffering (allocator queue size) available. ppEncode
  • a value of one indicates that the hardware supports variable macroblock sizes when performing motion estimation.
  • a value of one indicates that the hardware is capable of using some hints from the caller in its motion search algorithm.
  • the caller may set the HintX and HintY members of VA2_Encode_ModeType which is an Execute configuration parameter. MaxSearch WindowX
  • VA2_Encode_SearchBounds which is a Motion Estimation configuration parameter.
  • VA2_Encode_SearchBounds which is a Motion Estimation configuration parameter.
  • VA2_Encode_MVLayout MVLayout VA2_Encode_ResidueLayout ResLayout ; ⁇ VA2_Encode_StaticConfiguration;
  • the bilinear and bicubic interpolation systems have a number of coefficients that are format specific. Quantization
  • This base structure is typecast to a derived type on the StreamType field.
  • the typecasts are described in the documentation for VA2_Encode_StreamType.
  • the associated stream description structure may be cast to
  • the associated stream description structure may be cast to
  • the associated stream description structure may be cast to VA2_Encode_StreamDescription_Residues.
  • Describes various properties of the video stream including the dimensions, frame rate, color primaries, etc.
  • VA2_Encode_MVType MVType VA2_Encode_MVType MVType
  • ChromaCrWidth ChromaCrWidth
  • Fig. 9 shows exemplary motion vector data stored in a D3D surface, according to one embodiment.
  • Each of the cells described as "MV” is a Motion Vector structure. Different representations are used depending on the values of VA2_Encode_MVType and VA2_Encode_MVLayout. The actual structures and layouts are described below
  • D3DFMT_MOTIONVECTOR16 105
  • D3DFMT_MOTIONVECTOR32 106
  • D3DFMT_RESIDUE16 107
  • Motion Vectors Surfaces and Residue Surfaces are associated with the above new D3D Format types which indicate the size of individual Motion Vectors and Residues. This size information is used by the driver when the application creates surfaces using one of the surface or resource creation APIs provided by .
  • the resource flag associated with encode surfaces is VA2_EncodeBuffer.
  • This structure is effectively derived from IDirect3DSurface9, and carries state information that allows one to interpret the contents of the embedded D3D surface.
  • the distance metric is used to identify the closest macroblock, and hence the optimal motion vector.
  • This enumeration value is used to decode the contents of the Motion Vector D3D9 Surface.
  • Motion Vector one of several different Motion Vector structures is used to interpret the contents of the surface.
  • typedef enura ⁇ APPENDIX A Exemplary Video Encode Acceleration API
  • VA2_Encode_MVType_Simple8 VA2_Encode_MVType_Sitnplel6 , VA2_Encode_MVType_Extended8 , VA2_Encode_MVType_Bxtendedl6 ⁇ VA2_Encode_MVType ;
  • the Motion Vector structure is VA2_Encode_MotionVector8.
  • the Motion Vector structure is VA2_Encode_MotionVectorl6.
  • the Motion Vector structure is VA2_Encode_MotionVectorEx8.
  • the Motion Vector structure is VA2_Encode_MotionVectorExl6.
  • the actual D3D surface is an array of Motion Vector structures indexed by
  • VA2_Encode_MotionVector16 typedef struct _VA2_Encode_MotionVectorl6 ⁇
  • APPENDIX A Exemplary Video Encode Acceleration API y y-coordinate of the Motion Vector.
  • VA_Encode_MVSurface It measures the distance of the current macroblock with the reference macroblock referred to by the actual motion vector (x, y)
  • VA_Encode_MVSurface It measures the distance of the current macroblock with the reference macroblock referred to by the actual motion vector (x, y)
  • the width of a residue surface is the number of residue values in a line.
  • a 640x480 progressive image with 4:2:2 sampling has 640 luma values and 320 chroma values per line.
  • the size of associated the luma surface is 640x480x2 and that of the chroma surface is 320x480x2 bytes.
  • Residue Surfaces are created using the D3DFMT_RESIDUE16 format flag and VA2_EncodeBuffer resource type.
  • Fig. 10 shows an exemplary diagram indicating that width of the luma surface matches the original YCbCr image.
  • a 640x480 image has 480 luma values per line, and so the width of the luma surface is 480. So the size of the luma surface is 640x480x2 bytes.
  • Fig. 11 shows an exemplary diagram indicating that the number of residue value per line of video is half with width of the original video image, according to one embodiment.
  • the number of residue values per line and hence the width of the surface is 320.
  • VA2_Encode_Residue_U or VA_Encode_Residue_V Sampling VA2_Encode_SamplingType_422
  • the width of the residue surface is one half the width of the original progressive frame, and the height is one half as well.
  • the chroma surface itself would be 320 wide and 240 long.
  • VA2_Encode_Residue_U or VA_Encode_Residue_V Sampling VA2_Encode_SamplingType_420
  • Extension Devices are a pass-through mechanism provided by the VA Interfaces in order to add new functionality besides the existing Video Decoder and Video Processor functions. For example, they will be used to support a new Video Encoder function.
  • Extension Devices act like an untyped funnel through which the application can send/receive data to/from the driver.
  • the meaning of the data is unknown to the VA stack, APPENDIX A Exemplary Video Encode Acceleration API and is interpreted by the driver based on the pGuid parameter of the CreateExtensionDevice call, and the Function parameter of ExtensionExecute.
  • VA Encode uses the following GUID value (same as the uuid of IVideoEncoder):
  • Extension Devices are enumerated using the FND3DDDI_GETCAPS with the type parameter being set to GETEXTENSIONGUIDCOUNT or GETEXTENSIONGUIDS.
  • the codec application looks for VA_Encoder_Extension in the list of extension guids returned by GETEXTENSIONGUIDS to determine whether VA Encode support is available.
  • the GETEXTENSIONCAPS is used with the following structure as plnfo in the D3DDDIARG_GETCAPS structure.
  • VADDI_QUERYEXTENSIONCAPSINPUT is set to VA_Encoder_Extension.
  • the output of GETEXTENSIONCAPS is encapsulated in thepData parameter of D3 DDDIARG jGETCAPS.
  • the pData parameter is interpreted as follows:
  • DataSize sizeof(GUID) * guid_count.
  • extension unit functions are invoked via a D3DDDI_EXTENSIONEXECUTE call.
  • the instance of the Extension Unit is already associated with a GUID, so the type of the extension unit is already known when the execute call is made.
  • the only additional parameter is Function which indicates the particular operation to perform.
  • an Extension Device of type Encoder may support MotionEstimation as one of its functions.
  • the Extension Device will have a GetCaps function of its own that enumerates the capabilities of the Extension Device. typedef struct _D3DDDIARG_EXTENSIONEXECUTE
  • VADDI_PRIVATEBUFFER* pBuffers ⁇ D3DDDIARG_EXTENSI0NEXECUTE;
  • the pBuffers parameter is not used by VA Encode, and should be considered a reserved parameter.
  • the Function parameter takes the following values for VA Encode:
  • D3DDDIARG_EXTENSIONEXECUTE are used to encapsulate the parameters of the Execute API call.
  • the encode specific parameters embedded in the input and output parameters below have not yet been mapped from API land to DDI land - but that's just a matter of renaming, and we might be able to manage with a single definition.
  • This parameter contains the input parameters to the Execute API call. typedef struct _VADDI_Encode_Function_Execute_Input ⁇
  • This structure encapsulates the output data from the Execute call. typedef struct VADDI Encode Function Execute Output
  • VADDI_PRIVATEBUFFER* pBuffers ⁇ D3DDDIARG_EXTENSIONEXECUT ⁇ ; typedef HRESULT
  • the hDevice parameter refers to a D3D9 device, and it is created using a call to D3DDDI_CJRJEATEDEVICE.
  • D3D structures and callback represent a generic D3D mechanism to obtain the capabilities of an extension device.
  • D3DDDICAPS_GETEXTENSIONCAPS 33, ⁇ D3DDDICAPS_TYPE; typedef struct _D3DDDIARG_GETCAPS
  • the encoder application is structured in such a way that both the CPU as well as the graphics hardware is fully utilized.
  • Motion Estimation is in progress for a certain frame, it might be beneficial to run the Quantization Step on a different frame.
  • Processlnput above may be considered a wrapper around Execute and GetBuffer, while ProcessOutput may be considered a wrapper around a Wait on the execute event, followed up with appropriate ReleaseBuffer calls.
  • the goal of the application should be to maximize time spent in SoftwareThread without blocking on ProcessOutput. In other words the application should be working on the VLEQ and Bitstrearn() functions most of the time. If the hardware is very slow, then Process ⁇ utput() will block despite the allocator size of "k". Software will always be "ahead”.
  • the above pipeline is efficient only to the extent that the hardware takes about as much time to process a buffer as software takes to run VLE and Bitstreani. AU that the buffering of "k" achieves is to pad for jitters.
  • the following code fragment shows a sketchy implementation of GetBuffer and ReleaseBuffer.
  • IvideoEncoder :GetBuffer (Type, ppBuffer, Blocking) ⁇ if (Empty) if (Blocking) Wait (NotEmptyEvent) ; else return STATUS_EMPTY ; ⁇
  • IVideoEncoder :ReleaseBuffer (Type, pBuffer)
  • GetBuffer (TypeMotionVector, pMVBuffer, true) ; GetBuffer (TypeResidues, pResidueBuffer, true) ; memcpy (pYUVBuffer, plnput . Image) ;
  • ReleaseBuffer (TypeUncompreased, pYUVBuffer) ; ReleaseBuffer(TypeMotionVector, pMVBuffer) ; ReleaseBuffer (TypeResiduea, pResidueBuf fer) ,- return S_OK; ⁇
  • Codec :ProcessInput that is non-blocking as is the norm.

Abstract

A video encoding acceleration service to increase one or more of the speed and quality of video encoding is described. The service acts as an intermediary between an arbitrary video encoder computer program application and arbitrary video acceleration hardware. The service receives one or more queries from the video encoder to identify implementation specifics of the video acceleration hardware. The service interfaces with the video acceleration hardware to obtain the implementation specifics. The service communicates the implementation specifics to the video encoder. The implementation specifics enable the video encoder to: (a) determine whether one or more of speed and quality of software encoding operations associated with the video encoder can be increased with implementation of a pipeline of one or more supported encoding pipeline configurations and capabilities, and (b) implement the pipeline by interfacing with the service.

Description

ACCELERATED VIDEO ENCODING
RELATED APPLICATIONS
[0001J This application is a continuation-in-part of co-pending U.S.
Patent Application serial no. 11/276,336 filed on February 24, 2006, titled "Accelerated Video Encoding", and hereby incorporated by reference.
BACKGROUND
[0002] Multimedia content production and distribution operations typically include video encoding. Video encoding processes are typically very data and computationally intensive. As a result, video encoding processes can be very time consuming. For example, it may take several tens-of hours for a software encoder to encode a high-quality high definition movie. Since quality and speed of video encoding processes are significant factors for successful multimedia content production and distribution pipelines, systems and techniques to increase the speed at which high quality video content can be encoded would be useful.
SUMMARY
[0003] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
[0004] In view of the above, a video encoding acceleration service to increase one or more of the speed and quality of video encoding is described. The service acts as an intermediary between an arbitrary video encoder computer program application and arbitrary video acceleration hardware. The service receives one or more queries from the video encoder to identify implementation specifics of the video acceleration hardware. The service interfaces with the video acceleration hardware to obtain the implementation specifics. The service communicates the implementation specifics to the video encoder. The implementation specifics enable the video encoder to: (a) determine whether one or more of speed and quality of software encoding operations associated with the video encoder can be increased with implementation of a pipeline of one or more supported encoding pipeline configurations and capabilities, and (b) implement the pipeline by interfacing with the service.
BRIEF DESCRIPTION OF THE DRAWINGS
[0005] In the Figures, the left-most digit of a component reference number identifies the particular Figure in which the component first appears.
[0006] Fig. 1 illustrates an exemplary system for accelerated video encoding, according to one embodiment.
[0007] Fig. 2 shows an exemplary embodiment of a video encoding pipeline configuration, wherein some of the encoding processes are accelerated in hardware.
[0008] Fig. 3 shows an exemplary procedure for accelerated video encoding, according to one embodiment.
[0009] Fig. 4 in the Appendix shows an exemplary video encoder application to illustrate the manner in which video encoding acceleration application programming interfaces can be utilized, according to one embodiment.
[0010] Fig. 5 in the Appendix shows an exemplary video encoding pipeline configuration, wherein acceleration hardware accelerates motion estimation, transform, quantization, and the inverse process to produce encoded images, according to one embodiment.
[0011] Fig. 6 in the Appendix shows an exemplary video encoding pipeline configuration in which hardware accelerates only motion estimation, according to one embodiment.
[0012] Fig. 7 in the Appendix shows several exemplary motion estimation parameters, according to one embodiment.
[0013] Fig. 8 in the Appendix shows exemplary motion vector data stored in a Display 3-Dimensional (D3D) surface, according to one embodiment. [0014] Fig- 9 in the Appendix shows an exemplary diagram indicating that width of a luma surface matches an original YCbCr image, according to one embodiment.
[0015] Fig. 10 in the Appendix shows an exemplary diagram indicating that the number of residue value per line of video is Vz width of the original video image, according to one embodiment.
[0016] Fig. 11 in the Appendix shows an exemplary diagram indicating that the width of the residue surface is 1A the width of the original progressive frame, according to one embodiment.
DETAILED DESCRIPTION Overview
[0017] Systems and methods for accelerated video encoding provide a video encoding acceleration service. This service allows an arbitrary video encoder application to interface, in a device independent manner, with arbitrary video acceleration hardware to define and implement a substantially optimal video encoding pipeline. To accomplish this, the service exposes video acceleration (VA) application program interfaces (APIs). These APIs encapsulate a model of the video encoding process. To define an encoding pipeline, the video encoder application uses the VA APIs to query implementation specifics (e.g., capabilities, etc.) of available video (graphics) acceleration hardware. The video encoder evaluates these specifics in view of the application's particular video encoding architecture (software- implemented) to identify any encoding operations that could benefit (e.g., speed and/or quality benefits) from being accelerated in hardware. Such operations include, for example, motion estimation, transform, and quantization operations and inverse operations such as Motion compensation, inverse transforms and inverse quantization. The API also allows the video encoder to design an encoding pipeline that substantially minimizes dataflow transitions across buses and processors associated with the host computing device and the acceleration hardware, and thereby, further increase encoding speeds. The API also allows the acceleration hardware to influence the location of the data to improve local caching (e.g. the video acceleration hardware may functional more efficiently on memory local to the video hardware).
[0018] Based on these evaluations the video encoder designs a customized video encoding pipeline that performs some number of encoding operations in software and some number of encoding operations using the acceleration hardware (i.e., at least a subset of the operations that could benefit from being hardware accelerated). The encoder application then uses the API to create the pipeline and encode video content. This customized pipeline is substantially optimized as compared to a completely software-implemented pipeline because certain encoding operations are accelerated and data transitions between the host and the acceleration hardware are minimized. Additionally, processing time freed up by accelerating certain aspects of the encoding process and minimizing data transitions allow the host processor(s) to perform higher-quality encoding operations with freed-up processing cycles. The API is also designed to allow components to operate in parallel so that computational resource usage can be maximized.
[0019] These and other aspects of the systems and methods for accelerated video encoding are now described in greater detail. An Exemplary System
[0020] Although not required, the systems and methods for accelerated video encoding are described in the general context of computer-executable instructions (program modules) being executed by a computing device such as a personal computer and graphics (video) encoding acceleration hardware. Program modules generally include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types.
[0021] Fig. 1 shows an exemplary system 100 for accelerated video encoding, according to one embodiment. System 100 includes host computing device 102. Host computing device 102 represents any type of computing device such as a personal computer, a laptop, a server, handheld or mobile computing device, etc. Host computing device 102 includes one or more processihg units 104 coupled across a bus 103 to system memory 106. System memory 106 includes computer-program modules ("program modules") 108 and program data 110. A processor 104 fetches and executes computer- program instructions from respective ones of the program modules 108. Program modules 108 include video processing modules 112 for processing video content, and other program modules 114 such as an operating system, device drivers (e.g., for interfacing to video encoding acceleration hardware, etc.), and/or so on. Video processing modules 112 include, for example, video encoder 116, video encoding acceleration service 118, and other processing modules 120, for example, a video decoder, video filter(s), a video renderer, etc.
[0022] In this implementation, video encoder 116 is an arbitrary video encoder. This means that the particular architecture, operation, data formats, etc, implemented and/or utilized by video encoder 116 are arbitrary. For example, video encoder 116 may be distributed by a third party, an OEM, etc. Additionally, although Fig. 1 shows video encoding acceleration service 118 independent of the operating system portion of "other program modules" 114, in one implementation, video encoding acceleration service 118 is part of the operating system.
[0023] Video processing modules 112 receive compressed or uncompressed input video data 122. When input video data 122 is compressed (already encoded), video processing modules 112 decode the input video data 122 to produce decoded source video data. Such decoding operations are performs by a decoder module. In another implementation, partially decoded data could also be retained to further assist the encoding process. For purposes of exemplary illustration, such a decoder module is shown as a respective portion of "other video processing modules" 120. Thus, decoded source video data is represented either by input video data 122 that was received in a decoded state, or represented with results of decoding input video data 122 that was received in an encoded state. Decoded source video data is shown as a respective portion of "other program data" 124. [0024] To design and implement a customized video encoding pipeline that can be used to encode decoded source video data into encoded video data 126, video encoder 116 interfaces with video encoding acceleration service 118 via video acceleration (VA) APIs 128. One exemplary implementation of multiple possible implementations of VA APIs 128 is described in the Appendix. To define an encoding pipeline, the video encoder application uses respective ones of the VA API 128 (e.g., please see the Appendix, §3.4, IVideoEncoderService) to obtain implementation specifics of available acceleration hardware 130. Such implementation specifics include, for example:
• an enumerated array identifying supported video encoding pipeline configurations of the acceleration hardware 130 (e.g., obtained via the GetCapabilities interface described in the Appendix, §3.4.1);
• an indication of supported video formats (e.g., MPEG, WMV, etc; please see the Appendix, GetSupportedFormats, §3.4.2);
• supported search metrics for motion estimation (ME) operations (please see the Appendix, GetDistanceMetrics, §3.4.3);
• supported search profiles for processing time vs. quality tradeoff decisions (please see the Appendix, GetSearchProfiles, §3.4.4); and/or
• supported ME capabilities, for example, image size information, maximum search window size, variable macroblock support indication, etc. (please see the Appendix, GetMECapabilities, §3.4.5)
[0025] Responsive to receiving such requests from the video encoder 116, video encoding acceleration service 118 queries the video acceleration hardware 130 for the requested implementation specifics and returns information associated with the corresponding responses from the acceleration hardware 130 to the video encoder 116. Video encoding acceleration service 118 interfaces with the video acceleration hardware 130 using a corresponding device driver. Such a device driver is shown as respective portion of "other program modules" 114. [0026] Video encoder 116 evaluates the implementation specifics supported by acceleration hardware 130 in view of the application's particular video encoding architecture (software-implemented) to identify any encoding operations that could benefit (e.g., speed and/or quality benefits) from being accelerated in hardware, select a search profile to encapsulate a trade-off between video encoding quality and speed, minimize data transitions across buses and between processors, etc. Exemplary operations that may benefit from hardware acceleration include, for example, motion estimation, transform, and quantization. For example, one reason to perform quantization in hardware is to minimize dataflow between pipeline stages.
[0027] Fig. 2 shows an exemplary embodiment of a video encoding pipeline configuration, wherein some of the encoding processes are accelerated in hardware. For purposes of exemplary illustration and description, operations and data flow associated with Fig. 2 are described with respect to particular ones of the components of Fig. 1. In the description, the left-most number of a reference numeral indicates where the particular figure where the component/data path/referenced item was first introduced. For example, the left-most number of pipeline 200 is say "2", indicating that it is first introduced in Fig. 2. In this example, encoding pipeline 200 was configured/customized by video encoder 116 (Fig. 1) interfacing with video encoding service 118 such that respective ones of host 102 implemented processing operations are accelerated in hardware 130. For purposes of illustration, processing- operations illustrated on the right side of the bold dotted line in Fig. 2 are accelerated by hardware (e.g., acceleration hardware 130 of Fig. 1) and processing-operations illustrated on the left side of the figure are performed by the host computing device 102 (Fig. 1). In encoding pipeline 200, optional configured data access pathways are shown with non-bolded dotted lines. Ovals 204 and 212 represent respective original and coded picture memory stores.
[0028] In this example implementation, video encoder 116 (Fig. 1) takes as input some form of compressed or uncompressed video data 202 (please also see input video data 122 of Fig. 1). Please note that the exemplary pipeline configuration of Fig. 2 does not copy input source video 202 ("raw video source") to the host computing device 102 if the source 202 is not originating from the host 102 and if the host decision making engine (e.g., video encoder 116) does not use the source video. For example, if quantization decisions do not require the host to touch the video data, the data will not be transferred. In this example, pipeline 200 is configured to convert the input data 202 to another compressed form using the respective operations of blocks 206, 208 and 214 through 218.
[0029J Such operations may include converting uncompressed (YUV) video data to compressed MPEG-2, or it may include transcoding video data from MPEG-2 data format to WMV data format. For purposes of exemplary illustration, assume that the transcoding operations include a full or partial decompression stage followed by an encode stage (there are more efficient models which by-pass decompression and work purely in the transform (DCT) space). A number of video compression formats make use of motion estimation, transform and quantization to achieve compression. Of the compression stages, motion estimation is typically the slowest step, including a massive search operation where an encoder (e.g., video encoder 116) attempts to find the closest matching reference macroblock for macroblocks in a given image.
[0030] Once the optimal motion vectors are determined (e.g., via block 206) for each of the macroblocks, the encoder 116 computes the differential residues (e.g., via block 208) based on the previously coded image and the optimal motion vector. The motion vector, along with the differential residue is a compact representation of the current image. The motion vector data is further represented differentially. The host encoder can optionally request the re-evaluation of motion vectors by the video acceleration hardware to find a macroblock with a smaller combined motion vector and/or residual. The resulting differential motion vector data, and the residual data are compacted (e.g., via block 218), for example, using techniques like run-length encoding (RLE) and differential coding (e.g.: Huffman and Arithmetic coding) to generate the final coded stream of bits (encoded video data 126) to communicate to a destination (block 218) for presentation to a user. In this example, the operations of blocks 206, 208 and 214 through 218 (e.g., operations such as motion estimation (206), mode decision, motion vector (MV) selection and rate control (208), prediction formation (210), transform and quantization operations (214), quantizer inversion and transform and version (216) and entropy coding (218)) are well-known in the art and are thus not described further herein.
[0031] Referring again to Fig. 1, in one implementation, video encoder 116 is a multi-threaded application providing for full utilization of acceleration hardware 130. In this implementation, when determining which video encoding operations are to be accelerated in hardware, video encoder 116 may structure the particular pipeline configuration such that both processor 104 and acceleration hardware 130 is fully utilized. For example, when video encoding pipeline motion estimation operations are being performed by hardware for a particular frame of video data, the pipeline may be configured to perform entropy (or arithmetic or Huffman) coding operations in software by the host, on a different frame of video data. An exemplary single motion vector pipeline representing the particular pipeline configuration selected/structured is described below in the Appendix in section 5.1.1. Exemplary multiple motion vector (relatively complex) pipelines wherein video encoder 116 requests multiple motion vectors from acceleration hardware 130 and selects one motion vector pipeline based on various parameters is described below in the Appendix in section 5.1.2.
[0032] With respect to selecting a search profile, the quality of motion vectors refers to a bitrate of a stream generated by the use of the motion vectors. High quality motion vectors are associated with low bitrate streams. The quality is determined by the completeness of the block search, the quality of the algorithm, the distance metric used, etc. High quality motion vectors should be used to perform high quality video encode operations. To address this, video encoding acceleration service 118 provides a generic construct called a search profile to encapsulate a trade-off between quality and time. The search profile also includes meta-data to identify the search algorithm used by the acceleration hardware 130, etc. Video encoder 116 chooses a particular search profile based on the particular requirements of the encoder's implementation.
[0033] With respect to minimizing data transitions across buses and between processors, an encode process implemented by a video encoding pipeline configuration will typically include several processing stages, each of which may or may not be accelerated via acceleration hardware 130. In cases where video encoder 116 determines to utilize hardware acceleration in successive stages of the encode pipeline, it may not be necessary to move data from acceleration hardware 130 based memory 132 to the system memory 106 associated with the host computing device 102, and then back to acceleration hardware based memory 132 for the next stage, and so on..
[0034] More particularly, while pointers to various types of video and motion vector data may be transferred back and forth between the host computing device 102 and the acceleration hardware 130, in one implementation, actual data is copied to system memory 106 only when the data pointer (a D3D9 Surface pointer) is explicitly locked using, for example, IDirect3DSurface9::LockRect. Exemplary interfaces for locking a surface are known (e.g., the well-known EDirect3DSurface9::LockRect.interface). Thus, in cases where two encoding pipeline stages follow one another, and host computing device 102 does not need to do perform any intermediate processing, host computing device 102 can decide not to "Lock" the allocated buffer between the processing stages. This will prevent a redundant memory copy of data, and thereby, avoid unnecessary data movement/transfers. In this manner, video encoder 116 design a video encoding pipeline that substantially minimizes data transfers across buses and between processors, and thereby, further increase video encoding speeds. [00351 At this point, video encoder 116 has evaluated the implementation specifics supported by acceleration hardware 130 in view of the application's particular video encoding architecture (software- implemented) to identify any encoding operations that could benefit from being accelerated in hardware, selected a search profile, minimized data transitions across buses and between processors, and/or so on. Based on these determinations, video encoder 116 selects a particular pipeline configuration to encode decoded source video data, and thereby, generate encoded video data 126. Next, video encoder 116 interfaces with video encoding acceleration service 118 to create an encoder object to implement the selected pipeline (please see the Appendix, CreateVideoEncoder API, §3.4.6). In this implementation, an encoder object (e.g., a regular COM object) is created by identifying the selected pipeline configuration and one or more of the following: a format for the output encoded bitstream, the number of input and output data streams associated with the . pipeline configuration, static configuration properties, a suggested number of buffers (surfaces) for association with the different I/O streams based on the selected pipeline configuration, and a driver specified allocator queue size based on resources a graphics device driver is able to gather, and other parameters. (Queue size and the number of data buffers are essentially referring to the same thing; one is "suggested", the other is "actual").
[0036] Next, video encoder 116 uses the created encoder object to interface with the video encoding acceleration service 118 to encode the decoded source video data. To this end, the encoder object submits execute requests to acceleration hardware 130 (please see the Appendix, IVideoEncode:Execute API, §3.2.3).
[0037] In view of the above, system 100 allows arbitrary implementations of video encoder applications 116 to define and create video encoding pipeline configurations during runtime to take full advantage of available video encoding acceleration hardware to increase encoding speed and quality. As part of these runtime configuration operations, the video encoder 116 can use VA APIs 128 to specify that the encoding pipeline is to implement iterative directed searching (multiple search passes of increasing refinement), define and use generically selectable search strategies (e.g., selecting a search algorithm based on quality metrics independent of any knowledge of details about the actual algorithm been employed), utilize format independent methodologies (e.g., where a video encoder 116 is unaware of the particular image format of input video data 122 and the acceleration hardware 130 is unaware of the compressed output format for the encoded video data 126) to control searching, adapt data sizes (e.g., where the video encoder 116 selects a macro block size based on a search algorithm), and so on.
An Exemplary Procedure
[0038] Fig. 3 shows an exemplary procedure 300 for accelerated video encoding, according to one embodiment. For purposes of exemplary description, the operations of the procedure are described with respect to components of system 100 of Fig. 1. The leftmost numeral of a component reference number indicates the particular figure where the component is first described.
[0039] At block 302, video encoder 116 (Fig. 1) receives input video data 122. If the input video data 122 is not compressed, the input video data represents decoded source video data. At block 304, if the input video data 122 is compressed, video encoder 116 decompresses the input video data to generate decoded source video data. At block 306, video encoder 116 interfaces with VA API 128 to query acceleration hardware 130 for capabilities and video encoding pipeline configuration implementation specifics. At block 308, video encoder 116 evaluates the supported capabilities and implementation specifics within the context of the implementation of the video encoder 116, to identify video encoding operations associated with the particular implementation of the video encoder 116 that may benefit from hardware acceleration, make encoding speed and/or quality decisions, minimize data transitions across busses and between processors, and/or so on. [0040] At block 310, video encoder 116 creates an encoding object that implements an encoding pipeline configured to execute the identified video encoding operations that may benefit from hardware acceleration in acceleration hardware 130, implement the speed/quality tradeoffs (e.g., via a selected search profile), and minimize data flow transitions. At block 312, video encoder uses the created encoder object to encode the decoded source video data according to the sequence of operations and encoding architecture delineated by the customized video encoding pipeline generated at block 310. These encoding operations of block 312 generate encoded video data 126 (Fig.
Conclusion
[0041] Although the systems and methods for accelerated video encoding have been described in language specific to structural features and/or methodological operations or actions, it is understood that the implementations defined in the appended claims are not necessarily limited to the specific features or actions described.
[0042] For example, although API's 128 of Fig. 1 have been described within the context of encoding video data, APIs 128 can be used outside of the encoding context for hardware acceleration of other functions such as edge detection, motion-vector based noise reduction, image stabilization, sharpening, frame rate conversion, velocity computation for computer vision applications, etc. For instance with respect to noise reduction, in one implementation video encoder 116 (Fig. 1) computes motion vectors for all macroblocks of decoded source image data. Then, video encoder 116 utilizes motion magnitude, direction, and correlation to motion vectors of surrounding macroblocks to determine whether there is a local object motion in the input image. In this implementation, the video encoder 116 of then utilizes the magnitude of the vector to direct object tracking / filtering aggressiveness or average shifts of a particular object to reduce statically random noise. [0043] In another example with respect to image stabilization, in one implementation video encoder 116 computes motion vectors for all macroblocks and decoded source data. Video encoder 116 then determines whether there is global motion in the image. This is accomplished by correlating all motion vector values and determining whether the correlated values are similar. If so, then video encoder 116 concludes that there is global motion. Alternatively the video encoder 116 utilizes a large macroblock size and determines if there is overall motion of the large macroblock. After determining whether global motion is present, if video encoder 116 also finds that the global motion vector tends to be jerky across frames, video encoder 116 concludes that there is camera jerkiness and compensates for this before starting noise filtering and encoding operations.
[0044] Accordingly, the specific features and operations of system 100 are disclosed as exemplary forms of implementing the claimed subject matter.
APPENDIX A Exemplary Video Encode Acceleration API
Video Encode
This Appendix describes aspects of an exemplary implementation of the video encoding acceleration APIs 128 (Fig. 1) for accelerated video encoding, also referred to as VA Encode. In this implementation, APIs 128 are designed to enable encoding and video processing applications (e.g., a video encoder module 1 16) to leverage acceleration hardware 130 (e.g., a GPU) support for accelerating Motion Estimation, Residue Computation, Motion Compensation and Transform.
1 Table of Contents
Video Encode 15 •
1 Table of Contents 15 ■
2 Exemplary Design 17 -
2 1
Figure imgf000017_0001
T ΛΛ/rγnf" -.———...——— —__.... ...... _ ■ „__._. 1 7
2.2 Pipeline or Mode Configurations 17 ■
2.2.1 VA2_EncodePipe JFuIl 17 -
2.2.2 VA2_EncodePipe_MotionEstimation 18 •
3 Exemplary API 18 -
3.1 Interface Definition 18 -
3.1.1 IVideoEncoder 18 -
3.1.2 IVideoEncoderService 19 -
3.2 Methods: IVideoEncoder 19 -
3.2.1 GetBuffer 19 ■
3.2.2 ReleaseBuffer 21 •
3.2.3 Execute 21 •
3.3 Data Structures: Execute 23 •
3.3.1 VA2_Encode_ExecuteDataParameter 23 ■
3.3.2 VA2_Encode_ExecuteConfϊgurationPararneter 23 ■
3.3.3 DataParameterJMotionVectors 24
3.3.4 DataPararneter_Residues 24 ■
3.3.5 DataParameter_InputImage 24
3.3.6 DataParameter_ReferenceImages 7 25
3.3.7 DataParameter_DecodedImage 25
3.3.8 VA2_Encode_ImageInfo 26
3.3.9 ConfigurationParameter_MotionEstimation 26
3.3.10 VA2_Encode_SearchResolution 27
3.3.11 VA2_Encode_SearchProfϊle 27
3.3.12 VA2_Encode_MBDescription 28
3.3.13 VA2_Encode_SearchBounds 28
3.3.14 VA2_Encode_ModeType 29
3.3.15 ConfϊgurationParameter_Quantization 29
3.4 Methods: IVideoEncoderService 29
3.4.1 GetPipelineConfigurations 30
3.4.2 GetFormats 30
3.4.3 GetDistanceMetrics 30
3.4.4 GetSearchProfiles 31 APPENDIX A Exemplary Video Encode Acceleration API
3.4.5 GetMECapabilities 31 -
3.4.6 CreateVideoEncoder 32 -
3.5 Data Structures: IVideoEncoderService 33 ■
3.5.1 VA2_Encode_MECaps 33 -
3.5.2 VA2_Encode_StaticConfiguration 33 -
3.5.3 VA2_Encode_AUocator 34 -
3.5.4 VA2_Encode_StreamDescription 34 -
3.5.5 VA2_Encode_StreamType 35 -
3.5.6 VA2_Encode_StreamDescription_Video 35 ■
3.5.7 VA2_Encode_StreamDescription_MV 35 -
3.5.8 VA2_Encode_StreaτnDescription_Residues 36 ■
3.6 Data Structures: Motion Vectors 36 -
3.6.1 Motion Vector Layout 36 ■
3.6.2 New D3D Formats 36 -
3.6.3 VA2_Encode_MVSurface 37 ■
3.6.4 VA2_Encode_MVType 37 -
3.6.5 VA2_Encode_MVLayout 38
3.6.6 VA2_Encode_MotionVector8 38 -
3.6.7 VA2_Encode_MotionVectorl 6 38 ■
3.6.8 VA2_Encode_MotionVectorEx8 39 ■
3.6.9 VA2_Encode_MotionVectorExl6 39
3.7 Data Structures: Residues 39 -
3.7.1 Luma plane 40
3.7.2 Chroma 4:2:2 40 ■
3.7.3 Chroma 4:2:0 - 40 ■ Exemplary DDI Documentation 40 ■
4.1 Enumeration and Capabilities 41 •
4.1.1 FND3DDDI_GETCAPS 41 •
4.1.2 VADDI-QUERYEXTENSIONCAPSINPUT 41 ■
4.1.3 03DDDIARG-CREATEEXTENSIONDEVICE 42 ■
4.2 Encode Functionality 43 ■
4.2.1 VADDI_Encode_Function_Execute_Input 43 ■
4.2.2 VADDI_Encode_Function_Execute_Output 43 ■
4.3 Extension Device Structures 43 •
4.3.1 VADDI_PRIVATEBUFFER- 44 •
4.3.2 D3DDDIARG_EXTENSIONEXECUTE 44 •
4.3.3 FNDSDDDIJDESTROYEXTENSIONDEVICE 44 ■
4.3.4 FNDSDDDI^EXTENSIONEXECUTE 44
4.3.5 D3DDDI_DEVTCEFUNCS 44
4.4 D3D9 Structures and Functions 45 Exemplary Programming Model 45
5.1 Pipeline Efficiency 45
5.1.1 Example: Single Motion Vector (Pipeline Full) 45
5.1.2 Example: Multiple Motion Vectors 47 APPENDIX A Exemplary Video Encode Acceleration API
2 Exemplary Design
2.1 Encoder Layout
Fig. 5 shows an exemplary video encoder application to illustrate the manner in which video encoding acceleration APIs can be utilized, according to one embodiment. In this example, video encoder 116 is implemented in the form of a DMO or MFT. Fig. 5 shows the input data (corresponding to a "Receive") and output data after several stages of processing. The boxes represent data while the circles represent API functions invoked by the encoder application. The circles thus represent the core of the API as seen by the encoder application.
2.2 Pipeline or Mode Configurations
Acceleration hardware is viewed as a pipeline, and a pipeline GUID is used to describe the most basic configuration elements of the pipeline. The goal of encode speed-up may be thought of intimately connected to the goal of pipeline efficiency.
The design allows for split (or multi-stage) pipelines where data goes back and forth between the host PC and the hardware, before the final output is obtained. No multi-stage pipeline configuration has been designed yet, the configurations below describe nonsplit, single stage pipelines.
2.2.1 VA2_EncodePipe_Full
// {BFC87EA2-63B6-4378-A619-5B451EDCB940} cpp_quote( "DEFINE_GUID(VA2_EncodePipe_Full, 0xbfc87ea2, 0x63b6, 0x4378, 0xa6, 0x19, OxSb,
0X45, OxIe, Oxdc, 0xb9, 0x40);" )
Fig. 6 shows an exemplary video encoding pipeline configuration, wherein acceleration hardware accelerates Motion Estimation, Transform, Quantization, and the inverse process to produce decoded images, according to one embodiment. The hardware produces as output Motion Vectors, Residues (luma and chroma) and a Decoded Image. The Decoded Image need not be transferred to system memory as its sole purpose is to compute Motion Vectors for the next frame.
Later documentation will refer to a parameter called NumStreams. For this pipeline configuration, NumStreams is five. The actual Streamlds are shown in the diagram in parentheses.
This is a single stage, non-split pipeline, and hence the Stage parameter of Execute does not apply.
Stream Descriptions
Note that StreamType_* is an abbreviation for VA2_Encode_StreamType_*.
Input Image
The stream ID is one, and the stream type is StreamTypeJVideo. This stream represents the image for which motion data is sought. The allocator for this stream is negotiable - either the current interface can supply one, or an external APPENDIX A Exemplary Video Encode Acceleration API allocator can be used. The choice of allocator is made at the time of creation, and if an external allocator is chosen, a stream ID of one will be considered an illegal input value for GetBuffer. Reference Images
The stream ID is two, and the stream type is StreamType_Video. This stream represents a list of reference images used to compute motion vectors. The current interface does not supply a separate allocator for this stream. The input surfaces are recycled from the decoded image stream (ID = 5), or obtained from elsewhere. Motion Vectors
The Stream ID is three, and the stream type is StreamTyρe_MV. This stream represents an output parameter containing motion vector data. Buffers for this stream are obtained via GetBuffer only. Residues
The stream ID is four, and stream type is StreamType_Residues. This stream represents an output parameter containing residue values for all three planes.
Buffers for this stream are obtained via GetBuffer only. Decoded Image
The stream ID is five, and the stream type is StreamType_Video. This stream represents an output parameter containing the decoded image obtained from the quantized residues and motion vector values. Buffers for this stream are obtained via GetBuffer only.
2.2.2 VA2_EncodePipe_MotionEstimation
// { F18B3D19-CA3E-4a6b-AC10- 53F86D509E04 } cpp_quote ( "DEFINE_J3UID (VA2_EncodePipe_MotionEstimafc ion , 0xfl8b3dl9 , 0xca3e , 0x4a6b, Oxac ,
0x10 , 0x53 , 0x£8 , 0x6d , 0x50 , 0x9e , 0x4 ) ; " )
Fig. 7 shows an exemplary video encoding pipeline configuration in which hardware accelerates only Motion Estimation, according to one embodiment. This pipeline configuration takes a set of reference images as input, and dumps Motion Vectors as output. The Decoded Image in this case has to be generated and supplied by the host software.
NumStreams for this pipeline configuration is three. The Strearnlds for the various streams are show in the diagram in paranthesis.
This is a single stage, non-split pipeline and the Stage parameter of Execute does not apply.
3 Exemplary API 3.1 Interface Definition 3.1.1 IVideoEncoder interface IVideoEncoder : iunknown
{
HRESULT GetBuffer (
[in] UINT8 Streamld, [in] UINT32 StreamType, [in] BCKDL Blocking, [ouc] PVOID pβuffer APPENDIX A Exemplary Video Encode Acceleration API
);
HRESULT ReleaseBuffer ( [in] UINTB screamld, [in] UINT32 StreamType, tin] PVOID pBuffer >;
HRESULT Execute (
[in] UINT8 stage,
[in] UINT32 NumlnputDataParameters,
[in, θize_xs(NumInputDataPararaeterB)]
VA2_Encode_ExecuteDataParameter** plnputData, [in] UINT32 NumoutpuCDataParamecers, [out, size_is (NumOutputDataParameters]
VA2_Encode_ExecuteDataParameter** pOutputData, tin] UINT32 NumConfigurationParameters, [in, sxze_is (NumConfigurationParameters]
VA2_Encode_BxeσuteConfigurationParameter** pConfiguration, [in] HANDLE hEvent, tout] HRESULT* pStatus ) , >
3.1.2 IVideoEncoderService interface IVideoEncoderService IVideoAccelerationService {
HRESULT GetPipelineConf xgurations {
[out] UINT32* pCount ,
[out , unique, size_is (*pCount) ] GUID** pGuids
) ,
HRESULT GetFormats (
[out] UINT32* pCount ,
[out , unique , size_is ( *pcount) ] GUID** pGuids
) ,
HRESLΓLT GetDistanceMetricsC [out] UINT32* pCount,
[out, unique, size_is (*pCount) ) GUID** pGuids ) ,
HRESULT GetSearchProfilest [out] UINT32* pCount,
[out, unique, size_is (*pcσunt) ] VA2_Encode_SearcnProflie** pSearchProflies ),
HRESULT GetMECapabxlities(
[out] VA2_Encode_MECaps* pMECaps ),
HRESULT CreateVideoEncoder(
[in! REFGUID PipelineGuid, tin] REFGUID FormatGuid, [in] UINT32 NumStreams,
[inj VA2_Encode_StaticConfα9uration* pConfiguratxon,
[in, size_is (NumStreams) ] VA2_Encode_DataDescπption* pDataDescription, tin, Bize_is (NumStreams) ] VA2_Encode_Allocator* SuggestedAllocatorProperties, [out, size_iB (NumStreamo) ] VA2_Encode_Allocator* pActualAllocatorProperties, [out] IVideoEncoder** ppEncode ) ; },
3.2 Methods: IVideoEncoder 3.2.1 GetBuffer
This function returns buffers (encode surfaces) for use in the Execute call. The buffers are released promptly after use by calling ReleaseBuffer, to avoid stalling the pipeline. APPENDIX A Exemplary Video Encode Acceleration API
HRESUX/T GetBuffer t
[in] UINT8 Streamld, [in] UIWT32 StrearaType, [in] BOOL Blocking, [out] PVOID pBuf fer ) ;
((def ine E_NOTAVAILABLE HRESULT_FROM_WIN32 (ERROR_INSUFFICIENT_BUFFER)
^def ine E_INVALIDPARAMETER HRESUI>T_FROM_WIN32 (ERROR_INVAL,ID_PARAMETER)
Parameters
Streamld
Refers to the particular stream for which buffers are desired. Depending on the particular stream, different types of buffers like Input Image buffers, Motion Vector buffers, etc. will be returned. Not all stream IDs for a given configuration are valid inputs to this function. Allowed values for Streamld are specified as part of the pipeline configuration.
StreamType
Specifies the type of buffer to be returned. Typically, the stream type will be implied by the Streamld, and negotiated at the time of creation. If StreamType is not consistent with Streamld, the function returns an error value. The data buffer is interpreted (typecast) based on the value of StreamType as described by the table in the remarks section.
Blocking
Specifies the behaviour of the function when there is starvation, or some other need for throttling. A value of True indicates that the function should block, while False indicates that the function should return E_NOTAVAILABLE. pBuffer
Pointer to a data buffer to be released via ReleaseBuffer. The pointer is recast (interpreted) based on the StreamType parameter, and this is described in the table in the remarks section below.
Return Values s_oκ
Function succeeded. E_NOTAVAILABLE
This is returned when the driver is starved for buffers, and the Blocking flag was set to false. EJNVALIDPARAMETER
The input parameters were incorrect. This may be used, for example, when StreamType does not match the expected value for the given Streamld. VFW_E_UNSUPPORTED_STREAM
Streamld is invalid. GetBuffer does not supply buffers for the specified Stream ID. Allowed values for Streamld are described as part of the pipeline configuration. For the specified stream ID, the allocator may be external, or there may be no allocator at all. EJFAIL
Function failed.
Remarks
Normally, this function returns control very soon as the buffers are already present in the allocator queue. The only conditions under which this function should block (or return APPENDIX A Exemplary Video Encode Acceleration API
E_NOTA VAILABLE) are when all buffers from the allocator queue have been submitted to the device, or being consumed by the application, and hence not released.
Stream Ty es and Buffer Formats
Figure imgf000023_0001
3.2.2 ReleaseBuffer
This function is used to release a surface back into the allocator queue for reuse via GetBuffer.
HRESULT ReleaseBuffer (
[in] UINT8 Streamld, [in] UINT8 StrearaType , [in] PVOID pBuf fer ) ;
Parameters
Streamlet
Stream ID associated with the buffer. StreamType
Stream type for the buffer. pBuffer
Buffer to be released back into the allocator queue.
Return Values s_oκ
Function succeeded. E_FAIL
Function failed.
3.2.3 Execute
This function is used to submit requests to the hardware. It contains input and output data buffers obtained via GetBuffer, as well as some configuration information. The function is asynchronous and its completion is indicated by the event being signalled. The completion status is indicated using the pStatus parameter which is allocated on the heap, and checked only after the event has been signalled.
The buffers supplied as parameters to this function are not be read from (eg: via LockRect), or written to by the application till the function has truly completed. True completion is implied by an error value being returned by the function, or if this function returns success, then by the signalling of hEvent (parameter to this function). When the same buffer is input to several instances of the Execute call, it is not be accessed to till all associated Execute calls have completed. The pointer to a surface in use by Execute may still be APPENDIX A Exemplary Video Encode Acceleration API supplied as a parameter to VA functions like Execute since this doesn't require the data to be locked. This last rule explains how the same input image may be used in multiple Execute calls at the same time.
The buffers supplied to this call obey the allocator semantics negotiated at creation time. If an external allocator is used when GetBuffer is expected to be used, this function will return E_FAIL.
HRESULT Execute (
[in] UINT8 Stage,
[in] UINT32 NumlnputDataParameters,
[in, size_is (NumlnputDataParatneters) ]
VA2_Encode_ExecuteDataParameter** plnputData, [inJ UINT32 NumOutputDataParameters, [ouc, size_is (NumOutputDataParameters) ]
VA2_Encode_ExeouteDataParameter** pOutputData, [in] UINT32 NumConfigurationParameters, [in, size_iβ (NumConfigurationParameters]
VA2_Encode_ExecuteCon£igurationParameter** pConfiguration, [in] HANDLE hEvent, [out] HRESULT* pStatus ) ;
Parameters
Stage
For split pipeline configurations, this parameter identϊes the specific stage of the split pipeline. The numbering is one-based, and for non-split pipelines this parameter is ignored. NumlnputDataParameters
Size of the input data array (next parameter). plnputData
Array of pointers to input data values. Individual data pointers are recast appropriately based on the Streamld value which has an associated StreamDescription specified on creation. The data buffers are allocated on creation, and obtained during the streaming process by calling GetBuffer. NumOutputDataParameters
Size of the output data array (next parameter). pOutputData
Array of pointeres to output data values. Individual data pointers are recast appropriately based on the Streamld value which has an associated StreamDescription specified on creation. The data buffers are allocated on creation, and obtained during the streaming process by calling GetBuffer. NumConfigurationParameters
Size of the configuration array (next parameter) pConfiguration
Array of configuration parameters controlling the execution of the pipeline. The overall configuration is the union of this structure along with static configuration parameters supplied when the encoder was created. hEvent
Event handle signalling that the output data is ready. pStatus
Status indicating whether the requested operation completed successfully. Allowed values include S_OK (successful completion), E_TIMEOUT (if TimeLimit was exceeded) and E_SCENECHANGE (if scene change detection was enabled and detected). In both cases of error, none of the output surfaces APPENDIX A Exemplary Video Encode Acceleration API contain any useful data. This parameter is allocated on the heap, and the return value is checked only after hEvent has been signalled.
Return Values s_oκ
Function succeeded. E_FAIL
Function failed.
Remarks
If the event handle gets signalled, it means that LockRect should complete instantly when called on any of the output surfaces since they are ready. In particular, the LockRect call is expected to not block for any length of time by waiting on any event handles. Nor is it allowed to waste CPU time through busy spins.
3.3 Data Structures: Execute
The Execute call has data parameters and configuration parameters. Specific data parameters can be thought of as deriving from VA2_Encode_ExecuteDataParameter base class (or structure) and specific configuration parameters can be thought of as deriving from VA2_Encode_ExecuteConfigurationParameter base class (or structure).
3.3.1 VA2_Encode_ExecuteDataParameter typedef struct _VA2_Encode_ExecuteDataParameter {
UINT32 Length ,-
UINT32 Sfcreamld ;
} VA2_Encode_ExecuteDataParameter;
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. The buffer formats are negotiated at creation time using the StreamDescription parameter.
3.3.2 VA2_Encode_ExecuteConfigurationParameter typedef struct _VA2_Encode_ExecuteConfigurationParameter {
UINT32 Length,-
UINT32 Streamld;
UINT32 ConfigurationType,- } VA2_Encode_ExecuteConfigurationParameter,- tfdefine VA2_Encode_ConfigurationType_MotionEstimation 0x1 ftdefine VA2_Encode_ConfigurationType_Quantization 0x2
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. Configuration Type
This parameter describes the configuration parameter, and is used to typecast the current structure appropriately. APPENDIX A Exemplary Video Encode Acceleration API
Remarks
This structure acts as a base type for more specialized configuration information. The base type is typecast to a more specialized type based on the ConfϊgurationType parameter. The mapping between ConfigurationType and the specialized structures is described in the table below.
Confi uration T es
Figure imgf000026_0001
3.3.3 DataParameter_MotϊonVectors typedef struct _VA2_Encode_ExecuteDataParameter_Mot±onVectors {
UINT32 Length; ~
UINT32 Streamld;
VA2_Encode_MVSurface» pMVSurface; } VA2_Encode_ExecuteDataParameter_MotionVectors ;
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. pMVSurface
Pointer to a structure containing the Motion Vector D3D Surface.
3.3.4 DataParameter_Residιιes typedef struct _VA2_Encode_ExecuteDataParameter_Residues {
UIKT32 Length;
UINT32 Streamld;
VA2_Encode_ResidueSurface» pResidueSurfaceY;
VA2_Encode_ResidueΞurface* pResidueSurfaceCb;
VA2_Encode_ResidueSurface* pResidueSurfaceCr; } VA2_Encode_ExecuteDataPararaeter_Residues;
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. . pResidueSurfaceY
Residue surface containing luma values. pResidueSurfaceCb
Residue surface containing chroma Cb values. pResidueSurfaceCr
Residue surface containing chroma Cr values.
3.3.5 DataParameteMnputlmage typedef struct _VA2_Encode_ExecuteDataParameter_InputImage { UINT32 Length; ~~
UINT32 Streamld; APPENDIX A Exemplary Video Encode Acceleration API
VA2_Encαde_ImageInfo* plmageData; } VA2_Encode_ExecuteDataParameter_ϊnputImage;
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. plmageData
Pointer to a structure containing the input image D3D Surface. This is the surface for which motion vectors are sought.
3.3.6 DataParameter_Referencelmages typedef struct _VA2_Encode_ExecuteDataParameter_ReferenceImages {
UINT32 Length,-
UINT32 Streamld,-
UINT32 ' NumReferenceImages ,-
VA2_Encode_IraageInfo* pReferenceImages } VA2_Encode_ExecuteDataParameter_ReferenceImages;
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. DataType NumReferencelmages
Size of reference images array (next parameter) pReferencelmages
Array of reference images on which to base the motion vectors. For simple formats like MPEG-2 only one progressive frame (or two fields) may be used. On the other hand, formats like H.264 and VC-I support motion vectors spanning several frames. A P-Frame in MPEG-2 uses only one reference image while a B-frame with interlaced video, and field type motion might use 4 images each of which may refer to a frame or a field.
3.3.7 DataParameter Decodedlmage typedef struct _VA2_Encode_ExecutεDataParameter_DecodedImage {
UINT32 Length;
UINT32 Streamld;
VA2_Encode_ImageInfo* pYCbCrlmage ; } VA2_Encode_ExecuteDataParameter_DecodedImage;
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. DataType APPENDIX A Exemplary Video Encode Acceleration API pYCbCrlmage
Output decoded image obtained after inverse quantization, inverse transform and motion compensation. For good pipelining, the associated D3D Surface should not be locked, or the data transferred to system memory unnecessarily. The surface pointers can stil be used as a Reference Image.
3.3.8 VA2_Encode_lmagelnfo typedef struct _VA2_Encode_ImageInJ:o {
IDxrect3DSur£aσe9* pSurface;
BOOL Field;
BOOL Interlaced;
RECT Window;
} VA2_Encode_ImageInfo,-
Members pSurface
Pointer to a D3D surface containing the image in YCbCr format. Field
A value of one indicates that the surface contains a field of video data, and the data is assumed to be interlaced. Zero indicates a full progressive frame. Interlaced
A value of one indicates that the image data is interlaced. This flag should be used only when Field (above parameter) is set to one. If Field is set to one, the data is assumed to be interlaced. Window
A rectangle within the image. This might be used to restrict the Motion Estimation call to return motion vectors for just a rectangle within the entire image.
3.3.9 CoπfigurationParameter_MotionEstimation typedeE struct _VA2_Encode_ExecuteConEigurationParameter_MotionEstimation {
UINT32 Length,
UINT32 Streamld;
UINT32 ConfigurationType,
VA2_Encode__MEParameters* pMEParams; } VA2_Encode_ExecuteConfigurationParameter_MotionEstimation;
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. ConfigurationType pMEParams
Pointer to a structure definining various parameters governing motion search including search window, etc.
Remarks
Fig. 8 shows several exemplary Motion Estimation parameters, according to one embodiment. These parameters are for use in the structures below. APPENDIX A Exemplary Video Encode Acceleration API
3.3.10 VA2_Encode_SearchResolution typedef enum {
VA2_Encode_SearchReaolution_FullPixel,
VA2_Encode_SearchResolution_HalfPixel,
VA2_Encode_SearchReBolution_QuarterPixel } VA2_Encode_SearchResolution;
Description
FullPixel
Motion Vectors are calculated in full pixel units. Hal/Pixel
Motion Vectors are calculated in half-pixel units. Thus a Motion Vector value of (5,
5) refers to a macroblock of data that is (2.5, 2.5) pixels away. QuarterPixel
Motion Vectors are calculated in quarter pixel units. Thus a Motion Vector value of (10, 10) refers to a macroblock of data that is (2.5, 2.5) pixels away.
In computing sub-pixel motion vector values, the encoder estimates luma and chroma values using interpolation. The specific interpolation scheme is format dependent, and the following GUIDs (part of static configuration) control the interpolation scheme.
// {E9AF78CB-7A8A-4dS2-887F-B6A418364C79} cpp_quote( "DEFINE_GUID(VA2_Encode_Interpolation_MPEG2Bilinear, 0xe9af78cb, 0x7a8a, 0x4dS2,
0x88, 0x7f, 0xb6, 0xa4 , OxIS, 0x367 0x4c , 0x79);" )
// {A94BBFCB-1BF1-475C-92DE-67298AF56BB0} cpp_quote( "DEFINE_GUID<VA2_Eπcode_Interpolation_MPEG2Bicubic, 0xa94bbfcb, Oxlbfl, 0x475c,
0x92, Oxde, 0x67, 0x29, 0x8a, OxfδT 0x6b, OxbO);" )
3.3.11 VA2_Encode_Search Profile typedef struct _VA2_Encode_SearchProfile {
UINT8 QualityLevel,-
UINTB TimeTaken,-
GUID SearchTechnique;
GUID Subpixellnterpolation; } VA2_Encode_SearchProfile;
Members
QualityLevel
A number in the range [0-100] that indicates the relative quality of Motion Vectors among the different profiles supported by the device. TimeTaken
A number in the range [0-100] that indicates the relative time taken for different search profiles. This enables the application to make a reasonable time-quality trade-off. SearchTechnique >
A GUID indicating the search algorithm used. Subpixellnterpolation
A GUID indicating the subpixel interpolation scheme used.
Remarks
There is no universally accepted definition of absolute quality, so we are settling for a relative measure. The values indicated against TimeTaken should follow a strict APPENDIX A Exemplary Video Encode Acceleration API proportion rule. If profile 1 takes 10ms and profile 2 takes 20ms, the TimeTaken values should be in the ratio 20/10 = 2.
3.3.12 VA2_Encode_MBDescription typedeC struct _VA2_Encode_MBDescription {
BOOL ConstantMBSize;
UINT32 MBWidth;
UIKT32 MBHeight;
UINT32 MBCount;
RECT* pMBRectangles ; } VA2_Encode_MBDescription;
Members
ConstantMBSize
A value of one indicates that all Macroblocks in the current image have the same size. This may not be true for formats like H.264. MBWidth
Width of a macroblock. Valid only if bConstantMBSize is one. MBHeight
Height of a macroblock. Valid only if bConstantMBSize is one. MBCount
If bConstantMBSize is zero, then the macroblocks (or segments) in the image are described using an array of rectangles. This parameter describes the size in elements of the following pMBRectangles parameter. pMBRectangles
An array of rectangles describing how the the image is to be cut up.
3.3.13 VA2_Encode_SearchBounds
Cypedef struct _VA2_Encode_SearchBounds {
BOOL DetectSceneChaπge;
UINT32 MaxDistancelnMetric ;
UINT32 TimeLimit;
UINT32 MaxSearchWindowX;
UINT32 MaxSearchwindowY;
} VA2_Encode_SearchBounds ,-
Members
DetectSceneChangβ
If this value is one, then scene change detection is being requested. In such a case, if scene change is detected no motion vectors will be computed by the Execute call, and hence no residues or decoded images will be computed either. This is indicated via the pStatus parameter of the Execute call which should be set to E_SCENECHANGE in this case.
MaxDista ncelnMetric
Refers to the difference between macroblocks when comparisons are made using the currently choice distance metric. If this distance exceeds this MaxDistancelnMetric value, then such a motion vector is rejected.
TimeLimit
Maximum time that the hardware is allowed to spend on the Motion Estimation stage. If it takes longer than this time, the pStatus parameter of the Execute call is set to E_TIMEOUT.
Search WindowX APPENDIX A Exemplary Video Encode Acceleration API
Maximum value of the x component of the returned motion vector. In other words, the size (along the x-dimension) of the search window. Search Window Y
Maximum value of the y component of the motion vector. In other words, the size
(along the y-dimension) of the search window.
Remarks
3.3.14 VA2_Encode_ModeType typedef struct _VA2_Encode_ModeType {
UINT32 SearchProfilelndex;
GUID DiscanceMetric;
INT16 HintX;
INT16 Hintϊ; } VA2_Encode_ModeType ;
Members
SearchProfilelndex
Index into the list of search profiles as returned by the GetSearchProfiles API call. DistanceMetric
Metric to use when comparing two macroblocks. Commonly used metrics include
SAD (Sum of Absolute Differences) and SSE (Sum of Squared Errors). HintX
Hint about the expected direction of motion to guide the motion search. This refer to the overall motion in the image and may not be applicable on a per MB basis. HintY
Hint about the expected direction of motion to guide the motion search. This refer to the overall motion in the image and may not be applicable on a per MB basis.
3.3.15 ConfigurationParameter Quantization typedef struct _VA2_Encode_ExecuteConfigurationParameter_Quantization {
UINT32 Length;
UINT32 streamld;
UINT32 ConfigurationType;
UINT32 StepSize,- } VA2_Encode_ExecuteConfigurationParameter_Quantization,-
Members
Length
Number of bytes in this structure. Provided for extensibility. Streamld
The ID of the data stream as defined in the pipeline configuration. This can be used to infer whether the data is input or output. ConfigurationType StepSize
Step size to be used when performing quantization. This design allows only one step size to be used for entire portion of the image for which Motion Vectors and Residues were requested in this call.
3.4 Methods: IVideoEncoderService APPENDIX A Exemplary Video Encode Acceleration API
The methods in this interface allow an application to query the hardware for its capabilities and create an encoder object with a given configuration.
3.4.1 GetPϊpelineConfigurations
HRES urations ( (*pCount) ] GUID** pGuids
Figure imgf000032_0001
Parameters pCount
Return value describes the size of pGuids array (next parameter) returned by the function. pGuids
An array of GUIDs describing the various pipeline configurations supported by the device. The memory is allocated by the callee, and should be released by the caller using CoTaskMemFree.
Return Values
SJOK function "was successful EJDUTOFMEMOR Y
Function was unable to allocate memory to return the list of GUIDs E_FAIL
Unable to determine the supported pipeline configurations because of some device error.
3.4.2 GetFormats
HRESULT GetFormatβ(
[out] UINT32* pCount,
[out, unique, size_is (*pCouπt) ] GUID** pGuids
) ;
Parameters pCount
Return value describes the size of pGuids array (next parameter) returned by the function. pGuids
An array of GUIDs describing the various formats supported by the device (eg: WMV9, MPEG-2, etc.). The memory is allocated by the callee, and should be released by the caller using CoTaskMemFree.
3.4.3 GetDistanceMetrics
HRESULT GetDistanceMetrics ( [out] UINT32* pCount, [out, unique, size_is (*pCount) ] GUID** pGuids
) ;
Parameters pCount
Return value describes the size of pGuids array (next parameter) returned by the function. APPENDIX A Exemplary Video Encode Acceleration API pGuids
An array of GUIDs describing the various search metrics supported by the device for motion estimation. The memory is allocated by the callee, and is released by the caller using CoTaskMemFree.
Return Values
SjDK
Function was successful EjJUTOFMEMORY
Function was unable to allocate memory to return the list of GUIDs E_FAIL
Unable to determine the supported metrics because of some device error.
3.4.4 GetSearchProfϊles
HRESULT GetSearchProfiles ( tout] UINT32 * pCount ,
[out , unique , si ze_is (*pCount) J VA2_Encode_SearchProfi le* * pSearchProfiles ) ;
Parameters pCount
Return value describes the size of pGuids array (next parameter) returned by the function. pSearchProfiles
An array of GUIDs representing the search profiles supported by the device. The search- profiles allow the codec application time-quality trade-offs more effectively. The memory is allocated by the callee, and is released by the caller using CoTaskMemFree.
Return Values s_oκ
Function was successful EJOUTOFMEMOR Y
Function was unable to allocate memory to return the list of GUIDs EJFAIL
Unable to determine the supported search profiles because of some device error.
3.4.5 GetMECapabilϊties
HRESULT GetMECapabilities (
[out] VA2_Encode_MECaps* pMECaps ) ;
Parameters pMECaps
A pointer to the Motion Estimation capabilities of the device. This includes information about the size of image the device can handle, the maximum search window size and whether the device supports variable maeroblock sizes. The memory for this is allocated by the caller. APPENDIX A Exemplary Video Encode Acceleration API
Return Values s_oκ
Function was successful EJFAIL
Function failed due to some device error.
3.4.6 Create VideoEncoder
This function creates an instance of IVideoEncoder.
HRESULT CreatevideoEncoder (
[in] REFGUID PipelineGuid,
[in] REFGUID FormatOuid,
[in] UINT32 Numscrearaa,
[in] VA2_Enoode_StaticConfiguration* pconfiguracion,
[in, size_is {NumStreams} ] VA2_Enoode_StreatnDeεcription* pStreatnDescription,
[in, size_is (NumStreams) ] VA2_Encode_Allocator* SuggestedAllocatorProperties,
[out, size_is (NumStreams) ] VA2_Encode_Allocator* pAcCualAllocatorProperties,
[out] IVideoEncoder** ppEncode
) ;
Parameters
PipelineGuid
A GUID representing the pipeline configuration desired. The list of configurations is obtained via GetCapabilities, and each of the GUIDs is associated with public documentation that describes necessary details about the configuration. FormatGuid
A GUID representing the format of the eventual encoded bitstream. Many of the encode operations like Transform and Quantization have format specific elements to them. While these format specific elements could be handled by the CPU with sufficient speed, the exchange of information will necessitate the use of extra pipeline stages and make it more difficult to achieve high pipeline efficiency. NumStreams
Number of input and output data streams associated with the pipeline configuration.
This is implied by the pipeline GUID in many cases. pConfiguration
A pointer to static configuration properties. pStreamDescription
An array of structures, one per stream, that describes the data flowing through that stream. SuggestedAllocatorProperties
The caller (codec application) suggests a certain number of buffers (surfaces) to be associated with the different streams based on its pipeline design. p A ctualAllocatorProperties
The driver specifies the actual allocator queue size based on resources it is able to gather, and other considerations. The assumption is that the application will abort use of this interface if it cannot build an efficient pipeline with the buffering (allocator queue size) available. ppEncode
Output encoder object. The caller should consider this to be a regular COM object to be released via IUnknown::Release. APPENDIX A Exemplary Video Encode Acceleration API
Return Values s_oκ
Function succeeded. E_FAIL
Function failed (probably for lack of resources)
3.5 Data Structures: IVideoEncoderService
3.5.1 VA2_Encode_MECaps typedef struct _VA2_Encode_MECaps {
BOOL VariableMBSizeΞupported,-
BOOL MotionVectorHiπCSupported;
UINT16 MaxSearchwindowX,-
UINT16 MaxSearchWindowY
UINT32 MaxImageWidth;
UINT32 MaxImageHeight;
UINT32 MaxMBSizeX,-
UINT32 MaxMBSizeY; } VA2_Encode_MECaps ;
Members
VariableMBSizeSupported
A value of one indicates that the hardware supports variable macroblock sizes when performing motion estimation. In particular, if variable macroblock sizes are supported, it is legal for the caller of this API to set ConstantMBSize to zero in the VA2_Encode_MBDescription structure, and to use the pMBRectangles parameter to describe the partitioning of the image. Motion VectorHintSupported
A value of one indicates that the hardware is capable of using some hints from the caller in its motion search algorithm. In particular, the caller may set the HintX and HintY members of VA2_Encode_ModeType which is an Execute configuration parameter. MaxSearch WindowX
Maximum legal value of SearchWindowX, a member of
VA2_Encode_SearchBounds, which is a Motion Estimation configuration parameter. MaxSearch WindowY
Maximum legal value of SearchWindowY, a member of
VA2_Encode_SearchBounds, which is a Motion Estimation configuration parameter. Maxlmage Width
Maximum allowed width of input image. MaxImageHeight
Maximum allowed height of input image. MaxMBSizeX
Maximum allowed width of macroblock. MaxMBSizeY
Maximum allowed height of macroblock.
3.5.2 VA2_Encode_StaticConfiguratϊon typedef struct _VA2_Encode_StaticCon£iguration { GUID TransformOperator,-
GUID ' Pixellnterpolation;
GUID Quantization;
UINT8 NumMotionVectorsPerMB; APPENDIX A Exemplary Video Encode Acceleration API
VA2_Encode_MVLayout MVLayout; VA2_Encode_ResidueLayout ResLayout ; } VA2_Encode_StaticConfiguration;
Members
TransformOperator
A GUID representing the Transform operator - one of MPEG-2 DCT, WMV9
Transform, etc. Pixellnterpolation
A GUID representing the sub-pixel interpolation scheme to be used. The bilinear and bicubic interpolation systems have a number of coefficients that are format specific. Quantization
A GUID representing the quantization scheme to be used. NumMotion VectorsPerMB
The number of Motion Vectors to be computer per macroblock. The simple pipeline configurations supported by early versions of this interface may require this value to be one. MVLayout
The layout of the Motion Vector surface. ResidueLayout
Layout of the residue surface.
3.5.3 VA2_Encode_Allocator cypedef struct _VA2_Encode_Allocator {
BOOL ExternalAl locator;
UINT32 NumSurf aces ; } VA2_Encode_Allocator ;
Members
ExternalAllocator
False indicates that buffers are obtained via GetBuffer while True indicates that buffers are obtained via an external allocator, or that there is no allocator associated with the stream in question. The pipeline configuration forces the value of this field in many cases (often to zero). A notable exception is in the Input Image stream that is allowed to come from an external allocator. NumSurfaces
Number of surfaces to be associated with the allocator queue.
3.5.4 VA2_Encode_StreamDescription typedef struct _VA2_Encode_StrearaDescription {
UINT32 Length ;
UINT32 StreamType ; } VA2_Encode_StreamDescription ;
Members.
Length
Length of the entire structure used to validate typecasts and allow for extensibility. StreamType
Describes the type of data associated with this stream.Used for typecasting. APPENDIX A Exemplary Video Encode Acceleration API
Remarks
This base structure is typecast to a derived type on the StreamType field. The typecasts are described in the documentation for VA2_Encode_StreamType.
3.5.5 VA2_Encode_StreamType lfdefine VA2_Encode_StreamType_Video 0x1 tldefine VA2_Encode_StreamType_MV 0x2 (♦define VA2_Encode_StreamType_Residues 0x3
Type Descriptions
VA2_Encode_Stream Type_ Video
The associated stream description structure may be cast to
VA2_Encode_StreamDescriρtion_Video. VA2_Encode_StreamType_MV
The associated stream description structure may be cast to
VA2_Encode_StreamDescription_MV. VA 2_Encode_Stream Type__Residues
The associated stream description structure may be cast to VA2_Encode_StreamDescription_Residues.
3.5.6 VA2_Encode_StreamDescription_Video typedef struct _VA2_Encode_StreamDescription {
UINT32 Length;
UINT32 StreamType;
VA2_VideoDeBc VideoDeacription; } VA2_Encode_StreamDescrαption;
Members
Length
Length of the entire structure used to validate typecasts and allow for extensibility. StreamType
Describes the type of data associated with this stream.Used for typecasting. VideoDescription
Describes various properties of the video stream including the dimensions, frame rate, color primaries, etc.
3.5.7 VA2_Encode_StreamDescription_MV typedef struct _VA2_Encode_StreaπiDescription {
UINT32 Length;
UINT32 StreamType;
VA2_Encode_MVType MVType ;
VA2_Encode_MVLayout MVLayout ; } VA2_Encode_StreamDescπption;
Members
Length
Length of the entire structure used to validate typecasts and allow for extensibility. StreamType
Describes the type of data associated with this stream.Used for typecasting. MVType
Describes the type of Motion Vector structure used to return motion data. Used in interpreting the contents of the Motion Vector surface. MVLayout APPENDIX A Exemplary Video Encode Acceleration API
Describes how the Motion Vector structures for a given input image are laid out in memory.
3.5.8 VA2_Encode_StrearnDescription_Residues cypedef struct _VA2_Encode_StreamDescription {
UINT32 Length;
UINT32 StreamType,-
VA2_Encode SamplingType SamplingType;
UINT32 LumaWidth;
UINT32 LumaHeight;
UINT32 ChromaCbWidth;
UINT32 ChromaCbHeight;
UINT32 ChromaCrWidth;
UINT32 ChromaCrHeight ,- } VA2_Encode_StrearoDescription;
Members
Length
Length of the entire structure used to validate typecasts and allow for extensibility. StreamType
Describes the type of data associated with this stream.Used for typecasting. SamplingType
Specifies whether the residue data is 4:4:4, 4:2:2, etc. LumaWidth
Width of the luma surface LumaHeight-
Height of the luma surface ChromaCbWidth
Width of the surface containing the Cb residue values. ChromaCbHeight
Height of the surface containing the Cb residue values. ChromaCrWidth
Width of the surface containing the Cr residue values. ChromaCrHeight
Height of the surface containing the Cr residue values.
3.6 Data Structures: Motion Vectors
3.6.1 Motion Vector Layout
Fig. 9 shows exemplary motion vector data stored in a D3D surface, according to one embodiment. Each of the cells described as "MV" is a Motion Vector structure. Different representations are used depending on the values of VA2_Encode_MVType and VA2_Encode_MVLayout. The actual structures and layouts are described below
3.6.2 New D3D Formats typedef enum _D3DFORMAT {
D3DFMT_MOTIONVECTOR16 = 105, D3DFMT_MOTIONVECTOR32 = 106, D3DFMT_RESIDUE16 = 107,
} D3DFORMAT,- APPENDIX A Exemplary Video Encode Acceleration API
Motion Vectors Surfaces and Residue Surfaces are associated with the above new D3D Format types which indicate the size of individual Motion Vectors and Residues. This size information is used by the driver when the application creates surfaces using one of the surface or resource creation APIs provided by . The resource flag associated with encode surfaces is VA2_EncodeBuffer.
// Buffer Type enum
{
VA2_Encode£tuffer = 7,
} ." typedef struct _D3DDDI_RESOURCEFIAGS { union
{ struct {
UINT TextApi : 1; // 0X20000000
UINT EncodeBuffer : 1; // 0x40000000
UINT Reserved : 1; // 0x80000000
};
UINT Value;
};
} D3 DDD I_RESOURCEFLAGS ;
3.6.3 VA2_Encode_MVSurface
This structure is effectively derived from IDirect3DSurface9, and carries state information that allows one to interpret the contents of the embedded D3D surface. typedef struct _VA2_Encode_MVSurface {
IDireσt3DSurface9* pMVSurface;
VA2_Encode_MVType MVType;
VA2_Encode_MVLayout MVLayout;
GUID DistaπceMetric;
} VA2_Encode_MVSurface ;
Members pMVSurface
Pointer to a D3D Surface containing Motion Vectors. MVType
This value is used to indentify the structure (VA2_Encode_MotionVector8, etc.) with which to interpret the individual motion vectors. MVLayout
This value identifies how the individual Motion Vector structures are laid out in the D3D Surface. DistanceMetric
A GUID representing the distance metric used to measure the distance between two macroblocks. The distance metric is used to identify the closest macroblock, and hence the optimal motion vector.
3.6.4 VA2_Encode_MVType
This enumeration value is used to decode the contents of the Motion Vector D3D9 Surface. Depending on the type of Motion Vector, one of several different Motion Vector structures is used to interpret the contents of the surface. typedef enura { APPENDIX A Exemplary Video Encode Acceleration API
VA2_Encode_MVType_Simple8 , VA2_Encode_MVType_Sitnplel6 , VA2_Encode_MVType_Extended8 , VA2_Encode_MVType_Bxtendedl6 } VA2_Encode_MVType ;
Description
VA2_Encode_MVType_Simple8
The Motion Vector structure is VA2_Encode_MotionVector8. VA2_Encode_MVType_Simplel 6
The Motion Vector structure is VA2_Encode_MotionVectorl6. VA2_Encode_MVType_Extendβd8
The Motion Vector structure is VA2_Encode_MotionVectorEx8. VA2_Encode_MVType_Extendedl 6
The Motion Vector structure is VA2_Encode_MotionVectorExl6.
3.6.5 VA2_Encode_MVLayout typedef enum {
VA2_Encode_MVIiayou e_A ,
VA2_Encode_MVI>ayou C_B ,
VA2_Encode_MVI«ayouC_C } VA2_Encode_MVl.ayouC ;
Description
Type A
The actual D3D surface is an array of Motion Vector structures indexed by
Macroblock Index and Row Index. Type B
This is a packed layout where the number of Motion Vectors per Macroblock is not constant. Details TBD. Type C
3.6.6 VA2_Encode_MotionVector8 cypedef struct _VA2_Encode_Motionvecεor8 {
INT8 X;
INT8 y;
} VA2_Encode_Mot ionVec torβ ;
Members x x-coordinate of the Motion Vector. y y-coordinate of the Motion Vector.
3.6.7 VA2_Encode_MotionVector16 typedef struct _VA2_Encode_MotionVectorl6 {
INT16 x;~
INT16 y;
} VA2_Bncode_MotionVectorl6;
Members
X x-coordinate of the Motion Vector. APPENDIX A Exemplary Video Encode Acceleration API y y-coordinate of the Motion Vector.
3.6.8 VA2_Encode_MotionVectorEx8 typedef struct _VA2_Encode_MotionVectorExβ {
INT8 x,-
INT8 y;
UINT8 Imagelndex; uiNTS Distance,- } VA2_Encode_MotionVectorEx8 ;
Members
X x-coordinate of the Motion Vector. y y-coordinate of the Motion Vector. Imagelndex a zero based index into the list of reference images that was provided in the call to
ComputeMotionVectors Distance the unit of measurement is specified by the DistanceMetric field of
VA_Encode_MVSurface. It measures the distance of the current macroblock with the reference macroblock referred to by the actual motion vector (x, y)
3.6.9 VA2_Encode_MotionVectorEx16 typedef struct _VA2_Encode_MotionVectorExl6 {
INT16 x ;
INT16 y;
UINT16 Imagelndex;
UINT16 Distance; } VA2_Encode_MotionVectorExl6;
Members x x-coordinate of the Motion Vector. y y-coordinate of the Motion Vector. Imagelndex a zero based index into the list of reference images that was provided in the call to
ComputeMotionVectors Distance the unit of measurement is specified by the DistanceMetric field of
VA_Encode_MVSurface. It measures the distance of the current macroblock with the reference macroblock referred to by the actual motion vector (x, y)
3.7 Data Structures: Residues
The residue surface is an array of signed integer values that are two bytes long - in other words they are of type INTl 6. This scheme appears to be adequate in all cases of practical importance. For example, MPEG-2 deals with 9 bit residue values and H.264 deals with 12 bit residues. Also, if the original data was YUY2, the luma values occupy one byte APPENDIX A Exemplary Video Encode Acceleration API each, and hence the residues use 9 bits (0 - 255 = -255). Further, applying a DCT-type transform increases the data requirement to 11 bits per residue value. All of these cases are handled adequately by using 2 byte long signed residue values.
The width of a residue surface is the number of residue values in a line. For example, a 640x480 progressive image with 4:2:2 sampling has 640 luma values and 320 chroma values per line. The size of associated the luma surface is 640x480x2 and that of the chroma surface is 320x480x2 bytes.
Residue Surfaces are created using the D3DFMT_RESIDUE16 format flag and VA2_EncodeBuffer resource type.
3.7.1 Luma plane
Fig. 10 shows an exemplary diagram indicating that width of the luma surface matches the original YCbCr image. For example, a 640x480 image has 480 luma values per line, and so the width of the luma surface is 480. So the size of the luma surface is 640x480x2 bytes.
Plane = VA2_Encode_Residue_Y Sampling = VA2_Encode_SamplingType_*
3.7.2 Chroma 4:2:2
Fig. 11 shows an exemplary diagram indicating that the number of residue value per line of video is half with width of the original video image, according to one embodiment. Thus for a 640x480 image, the number of residue values per line and hence the width of the surface is 320.
Plane = VA2_Encode_Residue_U or VA_Encode_Residue_V Sampling = VA2_Encode_SamplingType_422
3.7.3 Chroma 4:2:0
In this scenario, the width of the residue surface is one half the width of the original progressive frame, and the height is one half as well. Thus, for a 640x480 image, the chroma surface itself would be 320 wide and 240 long.
Plane = VA2_Encode_Residue_U or VA_Encode_Residue_V Sampling = VA2_Encode_SamplingType_420
4 Exemplary DDI Documentation
Extension Devices are a pass-through mechanism provided by the VA Interfaces in order to add new functionality besides the existing Video Decoder and Video Processor functions. For example, they will be used to support a new Video Encoder function.
Extension Devices act like an untyped funnel through which the application can send/receive data to/from the driver. The meaning of the data is unknown to the VA stack, APPENDIX A Exemplary Video Encode Acceleration API and is interpreted by the driver based on the pGuid parameter of the CreateExtensionDevice call, and the Function parameter of ExtensionExecute.
VA Encode uses the following GUID value (same as the uuid of IVideoEncoder):
{7AC3D93D-41FC-4C6C-A1CB-A875E4F57CA4}
DEFINE_GUID(VA_Encoder_Extension, 0x7ac3d93d, 0x41£c, 0x4c6c, Oxal, Oxcb, OxaB, 0x75, 0xe4,
OxfS, 0x7c, 0xa4);
4.1 Enumeration and Capabilities
Extension Devices are enumerated using the FND3DDDI_GETCAPS with the type parameter being set to GETEXTENSIONGUIDCOUNT or GETEXTENSIONGUIDS. The codec application looks for VA_Encoder_Extension in the list of extension guids returned by GETEXTENSIONGUIDS to determine whether VA Encode support is available.
4.1.1 FND3DDDI_GETCAPS typedef HRESULT
(APIBNTRY *PFND3DDDI_GETCAPS)
(
HANDLE hAdapter,
CONST D3DDDIARG_GETCAPS* );
When querying for capabilities of the extension device (the Encoder device), the GETEXTENSIONCAPS is used with the following structure as plnfo in the D3DDDIARG_GETCAPS structure.
4.1.2 VADDLQUERYEXTENSIONCAPSINPUT typedef struct _VADDI_QUERYEXTENSIONCAPSINPUT
{
CONST GUID* pGuid,-
UINT CapType,-
VADDI_PRIVATEDATA* pPrivate; } VADDI-QUERYEXTENSIONCAPSINPUT,-
The pGuid parameter of VADDI_QUERYEXTENSIONCAPSINPUT is set to VA_Encoder_Extension.
((define VADDI_Eπcode_Captype_Guids VADDI_EXTENSION_CAPTYPE_MIN
((define VADDI_Encode_Captype_DistanceMetrics VADDI_EXTENSION_CAPTYPE_MIN + 1
((define VADDI_Encode_Captype_SearchProfiles VADDI_EXTENSION_CAPTYPE_MIN + 2
((define VADDI_Encode_Captype_MECapa VADDI_EXTENSION_CAPTYPE_MIN + 3
The output of GETEXTENSIONCAPS is encapsulated in thepData parameter of D3 DDDIARG jGETCAPS. The pData parameter is interpreted as follows:
• Captype_Guids: Type = (GUID *) . DataSize = sizeof(GUID) * guid_count
• Captype_DistanceMetrics: Type = (GUID *). DataSize = sizeof(GUID) * guid_count.
• Captype_SearchProfiles: Type = (VADDI_Encode_SearchProfile *). DataSize = sizeof(VADDI_Encode_SearchProfile).
• Captype_MECaps: Type = (VADDI_Encode_MECaps). DataSize = sizeof(VADDI_Encode_MECaps). APPENDIX A Exemplary Video Encode Acceleration API
4.1.3 D3DDDIARG_CREATEEXTENSIONDEVICE
The actual creation happens via a DSDDDIJOREATEEXTENSIONDEVICE call, whose primary argument is shown below: typedef struct D3DDDIARG CRBATEEXTENSIONDEVICE {
CONST GUID* pGuid,-
VADDI-PRIVATBDATA* pPrivate;
HANDLE hExtension;
} D3DDDIARG_CREATEEXTENSIONDEVICE;
APPENDIX A Exemplary Video Encode Acceleration API
4.2 Encode Functionality
The actual extension unit functions are invoked via a D3DDDI_EXTENSIONEXECUTE call. The instance of the Extension Unit is already associated with a GUID, so the type of the extension unit is already known when the execute call is made. The only additional parameter is Function which indicates the particular operation to perform. For example an Extension Device of type Encoder, may support MotionEstimation as one of its functions. Typically, the Extension Device will have a GetCaps function of its own that enumerates the capabilities of the Extension Device. typedef struct _D3DDDIARG_EXTENSIONEXECUTE
{
HANDLE hExtension,-
UINT Function;
VADDI_PRIVATBDATA* pPrivatelnput;
VADDI~PRIVATEDATA* pPrivateOutput;
UINT NumBuffera ,-
VADDI_PRIVATEBUFFER* pBuffers; } D3DDDIARG_EXTENSI0NEXECUTE;
The pBuffers parameter is not used by VA Encode, and should be considered a reserved parameter. The Function parameter takes the following values for VA Encode:
#define VADDI_Encode_Function_Execute 1
The pPrivatelnput and pPrivateOutput parameters of
D3DDDIARG_EXTENSIONEXECUTE are used to encapsulate the parameters of the Execute API call. The encode specific parameters embedded in the input and output parameters below have not yet been mapped from API land to DDI land - but that's just a matter of renaming, and we might be able to manage with a single definition.
4.2.1 VADDl_Encode_Function_Execute_Jnput
This parameter contains the input parameters to the Execute API call. typedef struct _VADDI_Encode_Function_Execute_Input {
UINT32 NuπiDataParameters ;
VA2_Bncode_ExecuteDataParameter** pData;
UINT32 NumconfigurationParameters ;
VA2_Encode_ExecuteConfigurationParameter** pConfiguration; } VADDI_Encαde_Function_Execute_Input ;
4.2.2 VADDI_Eπcode_Function_Execute_Output
This structure encapsulates the output data from the Execute call. typedef struct VADDI Encode Function Execute Output
{
UINT32 NumDataParameters; VA2_Encode_ExecuteDataParameter** pData; } VADDI_Encode_Function_Execute_Output;
4.3 Extension Device Structures
The following sections describe various structures and function callbacks associated with the VA Extension mechanism. APPENDIX A Exemplary Video Encode Acceleration API
4.3.1 VADDI_PRIVATEBUFFER typedef struct VADDI PRIVATEBUFFER {
HANDLE hResource;
UINT SubResourcelndex;
UINT DataOffset ;
UINT DataSize; } VADDIJPRIVATEBUFFER; typedef struct VADDI PRIVATEDATA { ~
VOID* pData;
UINT DataSize;
} VADDI_PRIVATEDATA ;
4.3.2 D3DDDIARG_EXTENSIONEXECUTE typedef struct' _D3DDDIARG_BXTENSIONEXECUTE
{
HANDLE hExtension;
UINT Function;
VADDI_PRIVATEDATA* pPrivatelnput ;
VADDI_PRIVATEDATA* pPrivateOUtput;
UINT NumBuffers ;
VADDI_PRIVATEBUFFER* pBuffers; } D3DDDIARG_EXTENSIONEXECUTΞ; typedef HRESULT
(APIENTRY »PFND3DDDI_CREATEEXTENSIONDEVICE) C
HANDLE hDevice,
D3DDDIARG-CREATEEXTENSIONDEVICE* );
The hDevice parameter refers to a D3D9 device, and it is created using a call to D3DDDI_CJRJEATEDEVICE.
4.3.3 FNDSDDDLDESTROYEXTENSIONDEVICE typedef HRESULT
(APIENTRY *PFND3DDDI_DESTROYEXTENSIONDEVICE)
(
HANDLE hDevice,
HANDLE hExtension ) ;
4.3.4 FND3DDDI_EXTENSIONEXECUTE typedef HRESULT
(APIENTRY *PFND3DDDI_EXTENSI0NEXECUTE)
(
HANDLE hDevice,
CONST D3DDDIARG_EXTENSIONEXECUTE* >;
4.3.5 D3DDDL.DEVICEFUNCS typedef struct _D3DDDI DEVICEFUNCS
{
PFNDSDDDI-CREATEEXTENSIONDEVICE pfnCreateExtensionDevice;
PFND3DDDI_DESTROYEXTENSIONDEVICE pfnDestroyExtensionDevice ;
PFND3DDDI_EXTENSIONEXECUTE pfnExtenSiOnExecute ; } D3DDDI_DEVICEFUNCS,- APPENDIX A Exemplary Video Encode Acceleration API
4.4 D3D9 Structures and Functions
The following D3D structures and callback represent a generic D3D mechanism to obtain the capabilities of an extension device. typedef enum D3DDDICAPS_TYPE
{
03DDDICAPS-GETEXTENSIONGUIDCOUNT =3X,
D3DDDICAPS-GETEXTENSIONGUIDS =32,
D3DDDICAPS_GETEXTENSIONCAPS =33, } D3DDDICAPS_TYPE; typedef struct _D3DDDIARG_GETCAPS
D3DDDICAPS-TYPE Type; ■
VOID* plnfo;
VOID* pData;
UINT DataSize; } D3DDDIARG_GETCAPS ;
5 Exemplary Programming Model 5.1 Pipeline Efficiency
In order to achieve maximum efficiency, the encoder application is structured in such a way that both the CPU as well as the graphics hardware is fully utilized. Thus, while Motion Estimation is in progress for a certain frame, it might be beneficial to run the Quantization Step on a different frame.
Obtaining full hardware utilization is facilitated with a multi-threaded encoder. 5.1.1 Example: Single Motion Vector (Pipeline Full)
The following 2-threaded application (in pseudo-code) illustrates one way for the encoder to implement a 2-stage software pipeline, and offers some guidelines on how to use the VA Encode interfaces effectively. In particular it enforces a buffering of k = AllocatorSize as seen in the software thread. This accounts for the fact that there is asynchrony in the submission of a hardware request: the hardware thread submits requests while the software thread picks up the results after a while and processes them.
HardwareThread ( )
{ while (Streaming) {
LoadFrame (ppInputBuffer [n] ) ;
Codec->ProcessInput (ppInputBuffer [n] ) ; // blocking GetBuffer + Execute }
SoftwareThread (> { k = AllocatorSize O ; while (Streaming) {
// k represents the buffer between pipeline stages
Codec- >ProcessOutput {ppOutputBuffer fn-k] ); // Wait, ReleaseBuffer
VLE () ;
BitstreamO ,- } APPENDIX A Exemplary Video Encode Acceleration API
Processlnput above may be considered a wrapper around Execute and GetBuffer, while ProcessOutput may be considered a wrapper around a Wait on the execute event, followed up with appropriate ReleaseBuffer calls.
It is not clear how to determine the parameter k which represents the buffer between the pipeline stages. It denotes the allocator size, and as a starting point, we could use the same value used in the allocator negotiation between the Codec and the VA Encoder object (the queue length). If k is larger than the allocator size, then the Processlnput call is likely to block anyway even before the k buffers get used.
The goal of the application should be to maximize time spent in SoftwareThread without blocking on ProcessOutput. In other words the application should be working on the VLEQ and Bitstrearn() functions most of the time. If the hardware is very slow, then Processθutput() will block despite the allocator size of "k". Software will always be "ahead". The above pipeline is efficient only to the extent that the hardware takes about as much time to process a buffer as software takes to run VLE and Bitstreani. AU that the buffering of "k" achieves is to pad for jitters.
The following code fragment shows a sketchy implementation of GetBuffer and ReleaseBuffer.
IvideoEncoder: :GetBuffer (Type, ppBuffer, Blocking) { if (Empty) if (Blocking) Wait (NotEmptyEvent) ; else return STATUS_EMPTY ; }
*ppBuffer = pQueue [Type] [Head] ;
Head++ ; if (Head == Tail)
{
Empty » 1,-
ReseCEvent (NotEmptyEvent) ; } return S OK; }
IVideoEncoder: :ReleaseBuffer (Type, pBuffer)
{ if ((Tail == Head) &£ lEmpty) return STATUS-FULL; pQueue [Type] [Tail] «* pBuffer, Tail++; if (Empty) {
Empty » false,-
SetEvent (NotEmptyEvent) ,- } return S__OK; }
The following sketches out the codec's implementation of Processlnput and ProcessOutput:
// this implementation is blocking contrary to normal semantics
Codec: :ProceasInput (IMediaBuffer plnput)
{
GetBuffer (TypeUncompressed, pYUVBuffer, true) ,- APPENDIX A Exemplary Video Encode Acceleration API
GetBuffer (TypeMotionVector, pMVBuffer, true) ; GetBuffer (TypeResidues, pResidueBuffer, true) ; memcpy (pYUVBuffer, plnput . Image) ;
Execute (pYUVBuffer, pMVBuffer, pResidueBuffer, pEvent) ;
CodecQueue.Enqueue (pYUVBuffer, pMVBuffer, pResidueBuffer, pEvent),-
Codec: iProcessOutput (IMediaBuffer pOutput)
{ if (CodecQueue . Empty ( ) ) { pOutput .dwFlage = DMO-OUTPUTJDATABUFFERF-INCOMPIJETE, return S_FALSE ;
}
CodecQueue Dequeue (pYUVBuffer, pMVBuffer, pReaidueBuffer, pEvent);
Wait(pEvent) ; memcpy (pOuCput .MVBuffer, pMVBuffer) ; memcpy (poutput ResidueBuffer, pResidueBuffer) ,
ReleaseBuffer (TypeUncompreased, pYUVBuffer) ; ReleaseBuffer(TypeMotionVector, pMVBuffer) ; ReleaseBuffer (TypeResiduea, pResidueBuf fer) ,- return S_OK; }
Here is an alternate implementation of Codec: :ProcessInput that is non-blocking as is the norm.
Codec : : ProoessInput (IMediaBuf fer plnput) if (GetBuf fer (TypeUncompressed, pYUVBuf fer, false) == STATUS EMPTY) { return DMO E NOTACCEPTING,- } if (GetBuffer (TypeMotionVector, pMVBuffer, false) == STATUS EMPTY) { return DMO_E_NOTACCEPTING,- } if (GetBuffer(TypeResidues, pResidueBuffer, false) == STATUS_EMPTY> return DM0_E_NOTACCEPTING,- } memcpy (pYUVBuffer, plnput . Image) ;
Execute (pYUVBuffer, pMVBuffer, pResidueBuffer, pEvent) ;
CodecQueue.Enqueue (pYUVBuffer, pMVBuffer, pResidueBuffer, pEvent); }
5.1.2 Example: Multiple Motion Vectors
In this section we look a more complex pipeline where the encoder requests multiple motion vectors from hardware and chooses one based on various parameters and resubmits them for processing. The following code naively continues to use a 2-stage pipeline as before, requests multiple motion vectors and resubmits the best one. There is inherent serialization involved in this.
HardwareThread ( ) { while (Streaming) {
LoadFrame (pplnputBuf f er [n] ) , Processlnput (pplnputBuf f er [n] ) ; ProcessOutput (ppOutputBuf fer [n] ) ; APPENDIX A Exemplary Video Encode Acceleration API
SelectMV (ppOutputBuffer [n] , ppOutputBuffer2 [n] ) ; Processlnρut2 (ppOucputBuffer2 [n] ) ; n++; } }
SoftwareThread t ) { while (Streaming) {
ProcesBθutput2 (ppOucputBuf£er2 [n - Ic]) ; VLE (ppOutputBuffer2 [n - k] ) ; Bitstream(ppOutputBuffer2 [n - k] ) ; } >
In the above example, software will be blocked on ProcessOutput and Processθutρut2 half of the time, clearly bad for pipeline efficiency. On the other hand CPU utilization will be quite low, and the overall throughput is still higher than non-accelerated encode. A 3-stage pipeline based on 3 threads will solve the serialization problem as follows:
HardwareThreadl ( )
{ while (Streaming) {
LoadFrame (pplnputBuf fer [n] ) ;
ProcesB lnput (ppInputBuf f er [n] ) ; } }
HardwareThread2 ( )
{ while (Streaming)
{
ProcessOutput (ppOutputBuffer [n - kl] ) ;
SelectMV (ppOutputBuffer [n - kl] , ppOutputBuffer2 [n - kl] ) ;
Process Input2 (ppOutputBuffer2 [n - kl] ) ; } }
SoftwareThread ( )
{ while (Streaming)
{
ProcessOutput2 (ppOutputBuffer2 [n - kl - k2] ) ; VLE (ppOutputBuffer2 [n - kl - k2] ) ; Bitstrearn(ppOutputBuf-er2 [n - kl - k2] ) ; }
Since there are 3 pipeline stages, additional buffer is added to pad between the two hardware stages. Hence the two values kl and k2.

Claims

1. A method at least partially implemented by a computing device for a video encoding acceleration service, the method comprising: receiving, by the video encoding acceleration service, one or more queries from a video encoder to identify implementation specifics of acceleration hardware; responsive to receiving the one or more queries, the video encoding acceleration service: interfacing with the acceleration hardware to obtain the implementation specifics; responsive to receiving the implementation specifics, communicating the implementation specifics to the video encoder; and wherein the implementation specifics enable the video encoder during runtime to:
(a) determine whether one or more of speed and quality of software encoding operations associated with the video encoder can be increased with implementation of a particular encoding pipeline of one or more supported encoding pipeline configurations and capabilities; and
(b) implement the particular encoding pipeline by interfacing with the video encoding acceleration service.
2. The method claim I5 wherein the software encoding operations comprise one or more of motion estimation, residue computation, motion compensation, and transform operations.
3. The method claim 1, wherein the software encoding operations comprise one or more of noise reduction, image stabilization, edge detection, sharpening, and frame rate conversion operations.
4. The method claim 1, wherein the one or more queries comprise a get capabilities query, and wherein received implementation specifics include information associated with the one or more supported encoding pipeline configurations.
5. The method claim 1, wherein the one or more queries comprise a get distance metrics query, and wherein received implementation specifics include a description of one or more search metrics supported by the video encoding acceleration hardware for motion estimation operations.
6. The method claim 1, wherein the one or more queries comprise a get search profiles query, and wherein received implementation specifics include a description of one or more search profiles supported by the video encoding acceleration hardware, the one or more search profiles allowing the video encoder to evaluate implementation specific trade-offs between video encoding processing times and video encoding quality metrics.
7. The method claim 1, wherein the one or more queries comprise a get motion estimation capabilities query, and wherein received implementation specifics include data indicating one or more of maximum supported image size, maximum supported search window size, and an indication of whether acceleration hardware supports variable macro block sizes.
8. The method claim 1, further comprising: receiving, by the video encoding acceleration service, a request including a set of configuration parameters to create an object that implements the particular encoding pipeline; and responsive to receiving the request, creating the object based on the configuration parameters, the encoder object for encoding decoded source video data using the particular encoding pipeline.
9. The method claim 8, wherein the configuration parameters specify one or more of the particular encoding pipeline, an output format for encoded video, a number of FO data streams for association with the particular encoding pipeline, static configuration properties for interpolation of luma and chroma values, a suggested number of data buffers for the I/O data streams, and a device driver specified queue size based on available resources.
10. The method claim 1, further comprising: receiving, by the video encoding acceleration service, execute requests and a set of parameters from the video encoder, the execute requests corresponding to operations associated with the particular encoding pipeline to encode decoded source video data; responsive to receiving the execute requests, the video encoding acceleration service: communicating the execute requests and the parameters to the acceleration hardware; receiving responses associated with the communicated execute requests from the acceleration hardware; and forwarding the responses to the video encoder.
11. A computer-readable storage medium comprising computer-program instructions executable by a processor for: communicating, by a video encoder program module, one or more requests to a video encoding acceleration service to identify capabilities of one or more of video encoding pipeline configurations and capabilities supported by acceleration hardware; responsive to receiving the capabilities from the video encoding acceleration service, the video encoder: identifying, based on the capabilities, one or more video encoding operations associated with the video encoder that will benefit from one or more of speed and quality if implemented by the acceleration hardware; requesting, by the video encoder, the video encoding acceleration service to create a customized video encoding pipeline for implementing the one or more video encoding operations via the acceleration hardware such that any remaining video encoding operations are implemented in software.
12. The computer-readable storage medium of claim 11, wherein the one or more video encoding operations comprise one or more of motion estimation, residue computation, motion compensation, and transform operations.
13. The computer-readable storage medium of claim 11, wherein the one or more video encoding operations comprise one or more of noise reduction, image stabilization, edge detection, sharpening, and frame rate conversion operations.
14. The computer-readable storage medium of claim 11, wherein the computer-program instructions for requesting further comprise instructions for directing the video encoding acceleration service to create the customized video encoding pipeline such that data flow between system memory and graphics device memory is minimized.
15. The computer-readable storage medium of claim 11, further comprising computer-program instructions executable by the processor for: receiving, by the video encoder, encoded or decoded source video data; and if received source video data is encoded, at least partially decoding, by the video encoder, the source video data to generate decoded source video data for encoding by an encoding object created by the video encoding acceleration service, the encoding object implementing the customized video encoding pipeline.
16. The computer-readable storage medium of claim 11, wherein the computer-program instructions further comprise instructions for encoding decoded source video data using the customized video encoding pipeline.
17. A computing device comprising: interfacing means for a video encoding acceleration service to: receive one or more queries from a video encoder, the one or more queries requesting the video encoding acceleration service to identify implementation specifics of acceleration hardware, the implementation specifics for enabling the video encoder to: (a) determine whether one or more of speed and quality of software encoding operations associated with the video encoder can be increased with implementation of a particular encoding pipeline of one or more supported encoding pipeline configurations and capabilities, and (b) implement the particular encoding pipeline via the video encoding acceleration service to encode decoded source video data; query the acceleration hardware to obtain the implementation specifics; and communicate implementation specifics received from the acceleration hardware to the video encoder.
18. The computing device of claim 17, wherein the software encoding operations comprise one or more of motion estimation, residue computation, motion compensation, and transform operations.
19. The computing device of claim 17, wherein the software encoding operations comprise one or more of noise reduction, image stabilization, edge detection, sharpening, and frame rate conversion operations.
20. The computing device of claim 17, wherein the interfacing means further comprise means for the video encoding acceleration service to: receive a create encoder object request from the video encoder to create an encoder object that implements the particular encoding pipeline; receive one or more execute requests from the video encoder to implement operations- associated with the particular encoding pipeline in the acceleration hardware; and forward information associated with the one or more execute requests to the acceleration hardware to encode the decoded source video data.
PCT/US2007/004638 2006-02-24 2007-02-21 Accelerated video encoding WO2007100616A1 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
CN2007800065644A CN101390397B (en) 2006-02-24 2007-02-21 Accelerated video encoding
KR1020087020009A KR101183429B1 (en) 2006-02-24 2007-02-21 Accelerated video encoding
BRPI0708265-7A BRPI0708265B1 (en) 2006-02-24 2007-02-21 COMPUTER DEVICE AND METHOD IMPLEMENTED BY THE SAME
EP07751404A EP1987674A4 (en) 2006-02-24 2007-02-21 Accelerated video encoding
JP2008556422A JP5420254B2 (en) 2006-02-24 2007-02-21 Accelerated video coding

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
US11/276,336 2006-02-24
US11/276,336 US7929599B2 (en) 2006-02-24 2006-02-24 Accelerated video encoding
US11/673,423 2007-02-09
US11/673,423 US8654842B2 (en) 2006-02-24 2007-02-09 Accelerated video encoding

Publications (1)

Publication Number Publication Date
WO2007100616A1 true WO2007100616A1 (en) 2007-09-07

Family

ID=38443961

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2007/004638 WO2007100616A1 (en) 2006-02-24 2007-02-21 Accelerated video encoding

Country Status (7)

Country Link
US (2) US7929599B2 (en)
EP (1) EP1987674A4 (en)
JP (1) JP5420254B2 (en)
KR (1) KR101183429B1 (en)
CN (1) CN101390397B (en)
BR (1) BRPI0708265B1 (en)
WO (1) WO2007100616A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012508485A (en) * 2008-11-04 2012-04-05 アドバンスト・マイクロ・ディバイシズ・インコーポレイテッド Software video transcoder with GPU acceleration

Families Citing this family (58)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7725745B2 (en) * 2006-12-19 2010-05-25 Intel Corporation Power aware software pipelining for hardware accelerators
US8411734B2 (en) 2007-02-06 2013-04-02 Microsoft Corporation Scalable multi-thread video decoding
US20130101023A9 (en) * 2007-03-12 2013-04-25 Vixs Systems, Inc. Video encoder with video decoder reuse and method for use therewith
US9648325B2 (en) 2007-06-30 2017-05-09 Microsoft Technology Licensing, Llc Video decoding implementations for a graphics processing unit
US8677241B2 (en) 2007-09-10 2014-03-18 Vantrix Corporation Method and system for multimedia messaging service (MMS) to video adaptation
US8311058B2 (en) 2008-05-10 2012-11-13 Vantrix Corporation Modular transcoding pipeline
US8220051B2 (en) 2007-09-28 2012-07-10 Vantrix Corporation Generation and delivery of multimedia content-adaptation notifications
US7908632B2 (en) * 2008-01-08 2011-03-15 At&T Intellectual Property I, L.P. Method and system of diagnosing a video condition experienced at a customer premises
US8570441B2 (en) 2008-06-11 2013-10-29 Microsoft Corporation One pass video processing and composition for high-definition video
US8320448B2 (en) * 2008-11-28 2012-11-27 Microsoft Corporation Encoder with multiple re-entry and exit points
US8180165B2 (en) * 2008-12-19 2012-05-15 Microsoft Corp. Accelerated screen codec
US8594467B2 (en) * 2008-12-19 2013-11-26 Microsoft Corporation Interactive virtual display system for ubiquitous devices
US8069446B2 (en) * 2009-04-03 2011-11-29 Microsoft Corporation Parallel programming and execution systems and techniques
US10165286B2 (en) 2009-07-08 2018-12-25 Dejero Labs Inc. System and method for automatic encoder adjustment based on transport data
US8942215B2 (en) 2010-07-15 2015-01-27 Dejero Labs Inc. System and method for transmission of data from a wireless mobile device over a multipath wireless router
US9756468B2 (en) 2009-07-08 2017-09-05 Dejero Labs Inc. System and method for providing data services on vehicles
US10117055B2 (en) 2009-07-08 2018-10-30 Dejero Labs Inc. System and method for providing data services on vehicles
US9042444B2 (en) * 2010-07-15 2015-05-26 Dejero Labs Inc. System and method for transmission of data signals over a wireless network
US8718145B1 (en) 2009-08-24 2014-05-06 Google Inc. Relative quality score for video transcoding
US8516074B2 (en) * 2009-12-01 2013-08-20 Vantrix Corporation System and methods for efficient media delivery using cache
US8896715B2 (en) * 2010-02-11 2014-11-25 Microsoft Corporation Generic platform video image stabilization
US20110317762A1 (en) * 2010-06-29 2011-12-29 Texas Instruments Incorporated Video encoder and packetizer with improved bandwidth utilization
US8799405B2 (en) * 2010-08-02 2014-08-05 Ncomputing, Inc. System and method for efficiently streaming digital video
US8700796B2 (en) 2010-09-22 2014-04-15 Qualcomm Incorporated MAC data service enhancements
US9706214B2 (en) 2010-12-24 2017-07-11 Microsoft Technology Licensing, Llc Image and video decoding implementations
US9824426B2 (en) 2011-08-01 2017-11-21 Microsoft Technology Licensing, Llc Reduced latency video stabilization
US8731067B2 (en) 2011-08-31 2014-05-20 Microsoft Corporation Memory management for video decoding
US9819949B2 (en) 2011-12-16 2017-11-14 Microsoft Technology Licensing, Llc Hardware-accelerated decoding of scalable video bitstreams
US20150022536A1 (en) * 2012-01-05 2015-01-22 Google Inc. Heirarchy and hint based rendering pipeline selection
US20130208786A1 (en) * 2012-02-15 2013-08-15 Wei Xiong Content Adaptive Video Processing
US9002122B2 (en) 2012-07-19 2015-04-07 Omnivision Technologies, Inc. System and method for improving decoder performance using quantization control
US9112922B2 (en) 2012-08-28 2015-08-18 Vantrix Corporation Method and system for self-tuning cache management
US10699361B2 (en) * 2012-11-21 2020-06-30 Ati Technologies Ulc Method and apparatus for enhanced processing of three dimensional (3D) graphics data
CN103283250B (en) * 2012-12-13 2015-01-21 华为技术有限公司 Method, device and system of video redirection
US20140205012A1 (en) * 2013-01-21 2014-07-24 Mediatek Inc. Method and apparatus using software engine and hardware engine collaborated with each other to achieve hybrid video encoding
WO2014121477A1 (en) * 2013-02-07 2014-08-14 华为技术有限公司 Video redirection method, device and system, and computer readable medium
US9270999B2 (en) 2013-09-25 2016-02-23 Apple Inc. Delayed chroma processing in block processing pipelines
US9292899B2 (en) * 2013-09-25 2016-03-22 Apple Inc. Reference frame data prefetching in block processing pipelines
US9305325B2 (en) 2013-09-25 2016-04-05 Apple Inc. Neighbor context caching in block processing pipelines
US9299122B2 (en) 2013-09-25 2016-03-29 Apple Inc. Neighbor context processing in block processing pipelines
US9571846B2 (en) 2013-09-27 2017-02-14 Apple Inc. Data storage and access in block processing pipelines
US9218639B2 (en) 2013-09-27 2015-12-22 Apple Inc. Processing order in block processing pipelines
US9215472B2 (en) 2013-09-27 2015-12-15 Apple Inc. Parallel hardware and software block processing pipelines
KR102250088B1 (en) * 2013-10-24 2021-05-10 삼성전자주식회사 Method and Apparatus for decoding video stream
US9749642B2 (en) 2014-01-08 2017-08-29 Microsoft Technology Licensing, Llc Selection of motion vector precision
US9942560B2 (en) 2014-01-08 2018-04-10 Microsoft Technology Licensing, Llc Encoding screen capture data
US9774881B2 (en) 2014-01-08 2017-09-26 Microsoft Technology Licensing, Llc Representing motion vectors in an encoded bitstream
US10057590B2 (en) * 2014-01-13 2018-08-21 Mediatek Inc. Method and apparatus using software engine and hardware engine collaborated with each other to achieve hybrid video encoding
CN104159113B (en) * 2014-06-30 2018-08-10 北京奇艺世纪科技有限公司 The selection method and device of Video coding mode in Android system
US9807410B2 (en) 2014-07-02 2017-10-31 Apple Inc. Late-stage mode conversions in pipelined video encoders
US10582259B2 (en) 2015-06-30 2020-03-03 Gopro, Inc. Pipelined video interface for remote controlled aerial vehicle with camera
TWI546779B (en) 2015-11-06 2016-08-21 財團法人工業技術研究院 Method, apparatus and computer readable medium for encoding of streaming data
CN109217980B (en) * 2017-07-03 2020-11-06 腾讯科技(深圳)有限公司 Encoding and decoding capacity configuration method, device and computer storage medium
CN107948683A (en) * 2017-11-28 2018-04-20 北京潘达互娱科技有限公司 Network direct broadcasting media stream compatibility method, network main broadcaster end and client
WO2020098809A1 (en) * 2018-11-17 2020-05-22 Beijing Bytedance Network Technology Co., Ltd. Construction of affine candidates in video processing
EP4307667A3 (en) 2018-12-21 2024-03-20 Beijing Bytedance Network Technology Co., Ltd. Motion vector precision in merge with motion vector difference mode
US20220279204A1 (en) * 2021-02-26 2022-09-01 Qualcomm Incorporated Efficient video encoder architecture
US11729395B2 (en) * 2021-11-26 2023-08-15 Huawei Technologies Co., Ltd. Methods and devices for extracting motion vector data from compressed video data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5990958A (en) * 1997-06-17 1999-11-23 National Semiconductor Corporation Apparatus and method for MPEG video decompression
US6101276A (en) * 1996-06-21 2000-08-08 Compaq Computer Corporation Method and apparatus for performing two pass quality video compression through pipelining and buffer management
US6252905B1 (en) * 1998-02-05 2001-06-26 International Business Machines Corporation Real-time evaluation of compressed picture quality within a digital video encoder
WO2002007446A2 (en) * 2000-07-19 2002-01-24 Koninklijke Philips Electronics N.V. Method and device for generating a multiplexed mpeg signal

Family Cites Families (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4740073A (en) * 1982-12-27 1988-04-26 Meacham G B Kirby System for projecting three-dimensional images
US6044408A (en) 1996-04-25 2000-03-28 Microsoft Corporation Multimedia device interface for retrieving and exploiting software and hardware capabilities
US5926226A (en) * 1996-08-09 1999-07-20 U.S. Robotics Access Corp. Method for adjusting the quality of a video coder
US5805228A (en) * 1996-08-09 1998-09-08 U.S. Robotics Access Corp. Video encoder/decoder system
US6188381B1 (en) * 1997-09-08 2001-02-13 Sarnoff Corporation Modular parallel-pipelined vision system for real-time video processing
US6275527B1 (en) 1998-01-14 2001-08-14 Conexant Systems, Inc. Pre-quantization in motion compensated video coding
US6434196B1 (en) * 1998-04-03 2002-08-13 Sarnoff Corporation Method and apparatus for encoding video information
US6128026A (en) 1998-05-04 2000-10-03 S3 Incorporated Double buffered graphics and video accelerator having a write blocking memory interface and method of doing the same
SG82613A1 (en) 1999-05-21 2001-08-21 Inst Of Microelectronics Dynamic load-balancing between two processing means for real-time video encoding
US7072398B2 (en) * 2000-12-06 2006-07-04 Kai-Kuang Ma System and method for motion vector generation and analysis of digital video clips
US6891893B2 (en) 2000-04-21 2005-05-10 Microsoft Corp. Extensible multimedia application program interface and related methods
KR20020064893A (en) 2000-08-29 2002-08-10 코닌클리케 필립스 일렉트로닉스 엔.브이. Method of running an algorithm and a scalable programmable processing device
US20030052909A1 (en) 2001-06-25 2003-03-20 Arcsoft, Inc. Real-time rendering of edited video stream
FI110909B (en) * 2001-09-06 2003-04-15 Nokia Corp Method for performing motion estimation at video coding, video coding system and video coding device
KR100846769B1 (en) 2002-02-19 2008-07-16 삼성전자주식회사 Method for encoding motion image having fixed computational complexity and apparatus thereof
EP2309759A1 (en) 2002-03-18 2011-04-13 STMicroelectronics Limited Compression circuitry for generating an encoded bitstream from a plurality of video frames
US8284844B2 (en) * 2002-04-01 2012-10-09 Broadcom Corporation Video decoding system supporting multiple standards
US7451457B2 (en) * 2002-04-15 2008-11-11 Microsoft Corporation Facilitating interaction between video renderers and graphics device drivers
EP1620806A2 (en) * 2003-04-03 2006-02-01 Koninklijke Philips Electronics N.V. Runtime configurable virtual video pipeline
KR100512140B1 (en) 2003-05-12 2005-09-02 엘지전자 주식회사 Moving picture coding method
US7792806B2 (en) * 2003-06-27 2010-09-07 Microsoft Corporation Rate change
US7139002B2 (en) 2003-08-01 2006-11-21 Microsoft Corporation Bandwidth-efficient processing of video images
KR100594056B1 (en) 2003-09-01 2006-07-03 삼성전자주식회사 H.263/MPEG Video Encoder for Effective Bits Rate Control and Its Control Method
FR2859591A1 (en) 2003-09-08 2005-03-11 St Microelectronics Sa DVD and digital television image processing circuit includes external volatile memory for processing multiple video and graphical planes
US20050094730A1 (en) * 2003-10-20 2005-05-05 Chang Li F. Wireless device having a distinct hardware video accelerator to support video compression and decompression
US7634776B2 (en) * 2004-05-13 2009-12-15 Ittiam Systems (P) Ltd. Multi-threaded processing design in architecture with multiple co-processors
US7558428B2 (en) * 2004-09-13 2009-07-07 Microsoft Corporation Accelerated video encoding using a graphics processing unit

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6101276A (en) * 1996-06-21 2000-08-08 Compaq Computer Corporation Method and apparatus for performing two pass quality video compression through pipelining and buffer management
US5990958A (en) * 1997-06-17 1999-11-23 National Semiconductor Corporation Apparatus and method for MPEG video decompression
US6252905B1 (en) * 1998-02-05 2001-06-26 International Business Machines Corporation Real-time evaluation of compressed picture quality within a digital video encoder
WO2002007446A2 (en) * 2000-07-19 2002-01-24 Koninklijke Philips Electronics N.V. Method and device for generating a multiplexed mpeg signal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP1987674A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012508485A (en) * 2008-11-04 2012-04-05 アドバンスト・マイクロ・ディバイシズ・インコーポレイテッド Software video transcoder with GPU acceleration

Also Published As

Publication number Publication date
CN101390397B (en) 2010-09-15
CN101390397A (en) 2009-03-18
BRPI0708265B1 (en) 2020-03-03
KR20080106182A (en) 2008-12-04
BRPI0708265A2 (en) 2011-05-24
JP2009527991A (en) 2009-07-30
US7929599B2 (en) 2011-04-19
US8654842B2 (en) 2014-02-18
KR101183429B1 (en) 2012-09-14
EP1987674A4 (en) 2012-08-08
US20070204318A1 (en) 2007-08-30
US20070201562A1 (en) 2007-08-30
EP1987674A1 (en) 2008-11-05
JP5420254B2 (en) 2014-02-19

Similar Documents

Publication Publication Date Title
US8654842B2 (en) Accelerated video encoding
USRE48845E1 (en) Video decoding system supporting multiple standards
KR101187622B1 (en) Coordinating power management functions in a multi-media device
US7079147B2 (en) System and method for cooperative operation of a processor and coprocessor
US8320448B2 (en) Encoder with multiple re-entry and exit points
US20080126812A1 (en) Integrated Architecture for the Unified Processing of Visual Media
EP0871334A2 (en) Multimedia information processing apparatus
US20020170039A1 (en) System for operating system and platform independent digital stream handling and method thereof
JP2003204556A (en) Moving picture decoding processor for multimedia signal processing
US20170127074A1 (en) Video bit stream decoding
WO2014207439A1 (en) Efficient encoding of display data
EP4035335A1 (en) Compute resource estimation for function implementation on computing platform
US5903674A (en) Picture coding apparatus
US20120023148A1 (en) Applying Transcodings In A Determined Order To Produce Output Files From A Source File
Chang et al. Performance analysis and architecture evaluation of MPEG-4 video codec system
JP2004514352A (en) Dynamic adaptation of complexity in MPEG-2 scalable decoder
Ko et al. Modeling of block-based DSP systems
KR100984636B1 (en) A processor provided with a slow-down facility through programmed stall cycles
JP5236386B2 (en) Image decoding apparatus and image decoding method
US7778662B2 (en) Distribution of tasks as a function of the operating mode in mobile communication terminals having two or more microprocessors
US9336557B2 (en) Apparatus and methods for processing of media signals
JP2004538562A (en) Method and system for processing media files
Jakub Parallelization and Optimization of Image Processing applications. Brno, 2009

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2007751404

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 1020087020009

Country of ref document: KR

WWE Wipo information: entry into national phase

Ref document number: 2008556422

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 200780006564.4

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: PI0708265

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20080825