A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
Techniques and tools for encoding and decoding reference frame distances are described. For example, an encoder signals a reference frame distance for a field-coded interlaced video frame.
Digital video consumes large amounts of storage and transmission capacity. A typical raw digital video sequence includes 15 or 30 frames per second. Each frame can include tens or hundreds of thousands of pixels (also called pels), where each pixel represents a tiny element of the picture. In raw form, a computer commonly represents a pixel as a set of three samples totaling 24 bits. For instance, a pixel may include an eight-bit luminance sample (also called a luma sample, as the terms “luminance” and “luma” are used interchangeably herein) that defines the grayscale component of the pixel and two eight-bit chrominance samples (also called chroma samples, as the terms “chrominance” and “chroma” are used interchangeably herein) that define the color component of the pixel. Thus, the number of bits per second, or bit rate, of a typical raw digital video sequence may be 5 million bits per second or more.
Many computers and computer networks lack the resources to process raw digital video. For this reason, engineers use compression (also called coding or encoding) to reduce the bit rate of digital video. Compression decreases the cost of storing and transmitting video by converting the video into a lower bit rate form. Decompression (also called decoding) reconstructs a version of the original video from the compressed form. A “codec” is an encoder/decoder system. Compression can be lossless, in which the quality of the video does not suffer, but decreases in bit rate are limited by the inherent amount of variability (sometimes called entropy) of the video data. Or, compression can be lossy, in which the quality of the video suffers, but achievable decreases in bit rate are more dramatic. Lossy compression is often used in conjunction with lossless compression—the lossy compression establishes an approximation of information, and the lossless compression is applied to represent the approximation.
In general, video compression techniques include “intra-picture” compression and “inter-picture” compression, where a picture is, for example, a progressively scanned video frame, a frame-coded interlaced video frame (having alternating lines for video fields), or an interlaced video field. Intra-picture compression techniques compress individual pictures (typically called I-pictures or key pictures), and inter-picture compression techniques compress pictures (typically called predicted pictures, P-pictures, or B-pictures) with reference to preceding and/or following pictures (typically called reference or anchor pictures).
Intra-picture compression techniques often use a frequency transform and quantization to exploit spatial redundancy within a picture. For example, an encoder divides an intra-coded picture into 8×8 pixel blocks. To each 8×8 block, the encoder applies a frequency transform, which generates a set of frequency domain (i.e., spectral) coefficients. The resulting spectral coefficients are quantized and entropy encoded. During decoding, a decoder typically performs the inverse of the encoder operations. For example, the decoder performs entropy decoding, inverse quantization, and an inverse frequency transform.
Inter-picture compression techniques often use motion estimation and motion compensation to exploit temporal redundancy between pictures. For example, for motion estimation an encoder divides a current predicted picture into 16×16 macroblocks. For a macroblock of the current picture, a similar area in a reference picture is found for use as a predictor. A motion vector indicates the location of the predictor in the reference picture. In other words, the motion vector for the macroblock of the current picture indicates the displacement between the spatial location of the macroblock in the current picture and the spatial location of the predictor in the reference picture. The encoder computes the sample-by-sample difference between the current macroblock and the predictor to determine a residual (also called error signal). To blocks of the residual, the encoder applies a frequency transform. The resulting spectral coefficients are quantized and entropy encoded. During decoding, a decoder typically performs the inverse of various encoder operations. For example, for a residual, the decoder performs entropy decoding, an inverse quantization, and an inverse frequency transform. The decoder also performs motion compensation and combines the predictors with reconstructed residuals. If an intra-coded or inter-coded picture is used as a reference for subsequent motion compensation, the encoder also reconstructs the picture.
I. Interlaced Video and Progressive Video
A video frame contains lines of spatial information of a video signal. For progressive video, lines of an entire frame are scanned in raster scan fashion (left to right, top to bottom) starting at a single time instant. The lines are successive and non-alternating.
The raster scan of an interlaced video frame is performed in two passes by scanning alternate lines in each pass. For example, the first scan is made up of the even lines of the frame and the second scan is made up of the odd lines of the scan. So, in an interlaced video frame, the even-numbered lines (top field) may be scanned starting at one time (e.g., time t), with the odd-numbered lines (bottom field) scanned starting at a different (typically later) time (e.g., time t+1). This can create jagged tooth-like features in regions of an interlaced video frame where motion is present when the two fields are scanned starting at different times. For this reason, interlaced video frames can be rearranged according to a field structure, with the odd lines grouped together in one field, and the even lines grouped together in another field. This arrangement, known as field coding, is useful in high-motion pictures for reduction of such jagged edge artifacts. On the other hand, in stationary regions, image detail in the interlaced video frame may be more efficiently preserved without such a rearrangement. Accordingly, frame coding is often used in stationary or low-motion interlaced video frames, in which the original alternating field line arrangement is preserved.
II. Motion Vector Prediction in Windows Media Video, Versions 8 and 9
Microsoft Corporation's Windows Media Video, Version 8 [“WMV8”] includes a video encoder and a video decoder. The WMV8 encoder uses intra- and inter-compression, and the WMV8 decoder uses intra- and inter-decompression. Windows Media Video, Version 9 [“WMV9”] uses a similar architecture for many operations.
The WMV8 and WMV9 codecs use motion vector prediction to reduce the bit rate associated with signaling of motion vector information. The value of a motion vector for a current block or macroblock is often correlated with the values of motion vectors for spatially surrounding blocks or macroblocks. Motion vector compression can be achieved by determining or selecting a motion vector predictor from neighboring macroblocks or blocks, and predicting the motion vector for the current macroblock or block using the motion vector predictor. The encoder then encodes the differential between the motion vector and the motion vector predictor. For example, the encoder computes the difference between the horizontal component of the motion vector and the horizontal component of the motion vector predictor, computes the difference between the vertical component of the motion vector and the vertical component of the motion vector predictor, and encodes the differences.
A corresponding decoder uses motion vector prediction when reconstructing the motion vector. For a motion vector, the decoder determines a motion vector predictor from neighboring macroblocks or blocks (as was done in the encoder, using the same contextual information), decodes a differential for the motion vector, and reconstructs the motion vector from the motion vector predictor and differential.
Motion vector prediction in WMV8 and WMV9 varies depending on the location of the current macroblock (or block) in the current picture (e.g., top row, left column, interior) and whether neighbors have motion vectors for blocks or macroblocks. In WMV9, motion vector prediction also varies depending on video picture type (e.g., progressive frame, interlaced frame). Motion vector prediction in WMV8 and WMV9 provides good performance in many cases. Separate coding of fields of interlaced video frames is not supported in WMV8 and WMV9, however, so the motion vector prediction mechanisms in WMV8 and WMV9 do not address the particular requirements of motion vector prediction for separately coded fields.
III. Motion Vector Prediction in Standards
Aside from previous WMV encoders and decoders, several international standards relate to video compression and decompression. These standards include the Motion Picture Experts Group [“MPEG”] 1, 2, and 4 standards and the H.261, H.262 (another name for MPEG 2), H.263, and H.264 standards from the International Telecommunication Union [“ITU”]. Each of these standards specifies some form of motion vector prediction, although the details of the motion vector prediction vary widely between the standards.
Motion vector prediction is simplest in the H.261 standard, for example, in which the motion vector predictor for the motion vector of a current macroblock is generally the motion vector of the previously coded/decoded macroblock. [H.261 standard, section 4.2.3.4.] Motion vector prediction is similar in the MPEG-1 standard. [MPEG-1 standard, sections 2.4.4.2 and D.6.2.3.]
H.262 specifies more complex motion vector prediction. For a given macroblock, motion vector predictors may be tracked for the forward and backward directions for the whole macroblock or for each of the top and bottom halves of the macroblock. [H.262 standard, section 7.6.3.] For a given motion vector, the motion vector predictor is still typically determined from a single neighbor. Even though separate coding of fields of interlaced video frames is supported in H.262, motion vector prediction for such separately coded fields does not effectively account for polarity changes or changes in distance between a current field and reference field(s).
Other standards (such as H.263, MPEG-4, draft JVT-D157 of H.264) determine a motion vector predictor from multiple different neighbors with different candidate motion vector predictors. [H.263 standard, sections 6.1.1; MPEG-4 standard, sections 7.5.5 and 7.6.2; and F.2; JVT-D157, section 8.4.1.] These are efficient for some kinds of motion. Even when separate coding of fields of interlaced video frames is supported, however, motion vector prediction for separately coded fields does not effectively account for polarity changes or changes in distance between the current field and reference field(s).
Given the critical importance of video compression and decompression to digital video, it is not surprising that video compression and decompression are richly developed fields. Whatever the benefits of previous video compression and decompression techniques, however, they do not have the advantages of the following techniques and tools.
In summary, the detailed description is directed to various techniques and tools for encoding and decoding reference frame distances. The reference frame distances are used, for example, to improve motion vector prediction for separately coded fields of interlaced video frames. The described techniques and tools include, but are not limited to, the following:
A tool such as a video encoder or decoder processes a code for a reference frame distance for a current field-coded interlaced video frame. The code indicates a count of frames between the current frame and a preceding reference frame. The count may be, for example, a count of bi-directionally predicted field-coded interlaced video frames between the current frame and reference frame. Or, the count may be an arbitrary value selected so as to improve the performance of operations that are based on the count.
Or, a tool such as a video encoder or decoder processes a first syntax element that indicates whether reference frame distances for multiple frames are signaled or have a default value. For each of the frames, if reference frame distances are signaled, then the tool processes a second syntax element per frame that indicates a reference frame distance for the frame. On the other hand, if reference frame distances have the default value, then the tool uses the default value.
The various techniques and tools can be used in combination or independently.
Additional features and advantages will be made apparent from the following detailed description of different embodiments that proceeds with reference to the accompanying drawings.
The present application relates to techniques and tools for encoding and decoding reference frame distance information, along with corresponding signaling techniques for use with a bitstream format or syntax comprising different layers or levels (e.g., sequence, frame, field, slice, macroblock, and/or block).
The various techniques and tools can be used in combination or independently. Different embodiments implement one or more of the described techniques and tools. The techniques and tools described herein can be used in a video encoder or decoder, or in some other system not specifically limited to video encoding or decoding.
I. Computing Environment
With reference to
A computing environment may have additional features. For example, the computing environment (100) includes storage (140), one or more input devices (150), one or more output devices (160), and one or more communication connections (170). An interconnection mechanism (not shown) such as a bus, controller, or network interconnects the components of the computing environment (100). Typically, operating system software (not shown) provides an operating environment for other software executing in the computing environment (100), and coordinates activities of the components of the computing environment (100).
The storage (140) may be removable or non-removable, and includes magnetic disks, magnetic tapes or cassettes, CD-ROMs, DVDs, or any other medium which can be used to store information and which can be accessed within the computing environment (100). The storage (140) stores instructions for the software (180) implementing the video encoder or decoder.
The input device(s) (150) may be a touch input device such as a keyboard, mouse, pen, or trackball, a voice input device, a scanning device, or another device that provides input to the computing environment (100). For audio or video encoding, the input device(s) (150) may be a sound card, video card, TV tuner card, or similar device that accepts audio or video input in analog or digital form, or a CD-ROM or CD-RW that reads audio or video samples into the computing environment (100). The output device(s) (160) may be a display, printer, speaker, CD-writer, or another device that provides output from the computing environment (100).
The communication connection(s) (170) enable communication over a communication medium to another computing entity. The communication medium conveys information such as computer-executable instructions, audio or video input or output, or other data in a modulated data signal. A modulated data signal is a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media include wired or wireless techniques implemented with an electrical, optical, RF, infrared, acoustic, or other carrier.
The techniques and tools can be described in the general context of computer-readable media. Computer-readable media are any available media that can be accessed within a computing environment. By way of example, and not limitation, with the computing environment (100), computer-readable media include memory (120), storage (140), communication media, and combinations of any of the above.
The techniques and tools can be described in the general context of computer-executable instructions, such as those included in program modules, being executed in a computing environment on a target real or virtual processor. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The functionality of the program modules may be combined or split between program modules as desired in various embodiments. Computer-executable instructions for program modules may be executed within a local or distributed computing environment.
For the sake of presentation, the detailed description uses terms like “estimate,” “determine,” “predict,” and “apply” to describe computer operations in a computing environment. These terms are high-level abstractions for operations performed by a computer, and should not be confused with acts performed by a human being. The actual computer operations corresponding to these terms vary depending on implementation.
II. Generalized Video Encoder and Decoder
The relationships shown between modules within the encoder and decoder indicate the main flow of information in the encoder and decoder; other relationships are not shown for the sake of simplicity. In particular,
The encoder (200) and decoder (300) process video pictures, which may be video frames, video fields or combinations of frames and fields. The bitstream syntax and semantics at the picture and macroblock levels may depend on whether frames or fields are used. There may be changes to macroblock organization and overall timing as well. The encoder (200) and decoder (300) are block-based and use a 4:2:0 macroblock format for frames, with each macroblock including four 8×8 luminance blocks (at times treated as one 16×16 macroblock) and two 8×8 chrominance blocks. For fields, the same or a different macroblock organization and format may be used. The 8×8 blocks may be further sub-divided at different stages, e.g., at the frequency transform and entropy encoding stages. Example video frame organizations are described in the next section.
Depending on implementation and the type of compression desired, modules of the encoder or decoder can be added, omitted, split into multiple modules, combined with other modules, and/or replaced with like modules. In alternative embodiments, encoders or decoders with different modules and/or other configurations of modules perform one or more of the described techniques.
A. Video Frame Organizations
In some implementations, the encoder (200) and decoder (300) process video frames organized as follows. A frame contains lines of spatial information of a video signal. For progressive video, these lines contain samples starting from one time instant and continuing through successive lines to the bottom of the frame. A progressive video frame is divided into macroblocks with four 8×8 luminance blocks (Y1 through Y4) and two 8×8 chrominance blocks that are co-located with the four luminance blocks but half resolution horizontally and vertically, following the conventional 4:2:0 macroblock format. A progressive I-frame is an intra-coded progressive video frame. A progressive P-frame is a progressive video frame coded using forward prediction, and a progressive B-frame is a progressive video frame coded using bi-directional prediction. Progressive P- and B-frames may include intra-coded macroblocks as well as different types of predicted macroblocks.
An interlaced video frame consists of two scans of a frame—one comprising the even lines of the frame (the top field) and the other comprising the odd lines of the frame (the bottom field). The two fields may represent two different time periods or they may be from the same time period.
The term picture generally refers to source, coded or reconstructed image data. For progressive video, a picture is a progressive video frame. For interlaced video, a picture may refer to an interlaced video frame, the top field of the frame, or the bottom field of the frame, depending on the context.
Alternatively, the encoder (200) and decoder (300) are object-based, use a different macroblock or block format, or perform operations on sets of pixels of different size or configuration than 8×8 blocks and 16×16 macroblocks.
B. Video Encoder
The encoder system (200) compresses predicted pictures and key pictures. For the sake of presentation,
A predicted picture (also called p-picture, b-picture for bi-directional prediction, or inter-coded picture) is represented in terms of prediction (or difference) from one or more other pictures. A prediction residual is the difference between what was predicted and the original picture. In contrast, a key picture (also called an I-picture or intra-coded picture) is compressed without reference to other pictures.
If the current picture (205) is a forward-predicted picture, a motion estimator (210) estimates motion of macroblocks or other sets of pixels of the current picture (205) with respect to a reference picture, which is a reconstructed previous picture (225) buffered in the picture store (220). Or, the reference picture is a later picture or the current picture is bi-directionally predicted. The motion estimator (210) can estimate motion by pixel, ½-pixel, ¼-pixel, or other increments, and can switch the precision of the motion estimation on a picture-by-picture basis or other basis. The precision of the motion estimation can be the same or different horizontally and vertically. The motion estimator (210) outputs as side information motion information (215) such as motion vectors. A motion compensator (230) applies the motion information (215) to the reconstructed previous picture (225) to form a motion-compensated current picture (235). The prediction is rarely perfect, however, and the difference between the motion-compensated current picture (235) and the original current picture (205) is the prediction residual (245). Alternatively, a motion estimator and motion compensator apply another type of motion estimation/compensation.
A frequency transformer (260) converts the spatial domain video information into frequency domain (i.e., spectral) data. For block-based video pictures, the frequency transformer (260) applies a DCT or variant of DCT to blocks of the pixel data or prediction residual data, producing blocks of DCT coefficients. Alternatively, the frequency transformer (260) applies another conventional frequency transform such as a Fourier transform or uses wavelet or subband analysis. The frequency transformer (260) applies an 8×8, 8×4, 4×8, or other size frequency transform (e.g., DCT) to prediction residuals for predicted pictures.
A quantizer (270) then quantizes the blocks of spectral data coefficients. The quantizer applies uniform, scalar quantization to the spectral data with a step-size that varies on a picture-by-picture basis or other basis. Alternatively, the quantizer applies another type of quantization to the spectral data coefficients, for example, a non-uniform, vector, or non-adaptive quantization, or directly quantizes spatial domain data in an encoder system that does not use frequency transformations. In addition to adaptive quantization, the encoder (200) can use frame dropping, adaptive filtering, or other techniques for rate control.
If a given macroblock in a predicted picture has no information of certain types (e.g., no motion information for the macroblock and no residual information), the encoder (200) may encode the macroblock as a skipped macroblock. If so, the encoder signals the skipped macroblock in the output bitstream of compressed video information (295).
When a reconstructed current picture is needed for subsequent motion estimation/compensation, an inverse quantizer (276) performs inverse quantization on the quantized spectral data coefficients. An inverse frequency transformer (266) then performs the inverse of the operations of the frequency transformer (260), producing a reconstructed prediction residual (for a predicted picture) or reconstructed samples (for an intra-coded picture). If the picture (205) being encoded is an intra-coded picture, then the reconstructed samples form the reconstructed current picture (not shown). If the picture (205) being encoded is a predicted picture, the reconstructed prediction residual is added to the motion-compensated predictions (235) to form the reconstructed current picture. The picture store (220) buffers the reconstructed current picture for use in predicting a next picture. The encoder may apply a deblocking filter to adaptively smooth discontinuities between blocks.
The entropy coder (280) compresses the output of the quantizer (270) as well as certain side information (e.g., motion information (215), quantization step size). Typical entropy coding techniques include arithmetic coding, differential coding, Huffman coding, run length coding, LZ coding, dictionary coding, and combinations of the above. The entropy coder (280) typically uses different coding techniques for different kinds of information (e.g., DC coefficients, AC coefficients, different kinds of side information), and can choose from among multiple code tables within a particular coding technique.
The entropy coder (280) puts compressed video information (295) in the buffer (290). A buffer level indicator is fed back to bit rate adaptive modules. The compressed video information (295) is depleted from the buffer (290) at a constant or relatively constant bit rate and stored for subsequent streaming at that bit rate. Therefore, the level of the buffer (290) is primarily a function of the entropy of the filtered, quantized video information, which affects the efficiency of the entropy coding. Alternatively, the encoder system (200) streams compressed video information immediately following compression, and the level of the buffer (290) also depends on the rate at which information is depleted from the buffer (290) for transmission.
Before or after the buffer (290), the compressed video information (295) can be channel coded for transmission over the network. The channel coding can apply error detection and correction data to the compressed video information (295).
C. Video Decoder
The decoder system (300) decompresses predicted pictures and key pictures. For the sake of presentation,
A buffer (390) receives the information (395) for the compressed video sequence and makes the received information available to the entropy decoder (380). The buffer (390) typically receives the information at a rate that is fairly constant over time, and includes a jitter buffer to smooth short-term variations in bandwidth or transmission. The buffer (390) can include a playback buffer and other buffers as well. Alternatively, the buffer (390) receives information at a varying rate. Before or after the buffer (390), the compressed video information can be channel decoded and processed for error detection and correction.
The entropy decoder (380) entropy decodes entropy-coded quantized data as well as entropy-coded side information (e.g., motion information (315), quantization step size), typically applying the inverse of the entropy encoding performed in the encoder. Entropy decoding techniques include arithmetic decoding, differential decoding, Huffman decoding, run length decoding, LZ decoding, dictionary decoding, and combinations of the above. The entropy decoder (380) frequently uses different decoding techniques for different kinds of information (e.g., DC coefficients, AC coefficients, different kinds of side information), and can choose from among multiple code tables within a particular decoding technique.
If the picture (305) to be reconstructed is a forward-predicted picture, a motion compensator (330) applies motion information (315) to a reference picture (325) to form a prediction (335) of the picture (305) being reconstructed. For example, the motion compensator (330) uses a macroblock motion vector to find a macroblock in the reference picture (325). A picture buffer (320) stores previous reconstructed pictures for use as reference pictures. The motion compensator (330) can compensate for motion at pixel, ½-pixel, ¼-pixel, or other increments, and can switch the precision of the motion compensation on a picture-by-picture basis or other basis. The precision of the motion compensation can be the same or different horizontally and vertically. Alternatively, a motion compensator applies another type of motion compensation. The prediction by the motion compensator is rarely perfect, so the decoder (300) also reconstructs prediction residuals.
An inverse quantizer (370) inverse quantizes entropy-decoded data. In general, the inverse quantizer applies uniform, scalar inverse quantization to the entropy-decoded data with a step-size that varies on a picture-by-picture basis or other basis. Alternatively, the inverse quantizer applies another type of inverse quantization to the data, for example, a non-uniform, vector, or non-adaptive inverse quantization, or directly inverse quantizes spatial domain data in a decoder system that does not use inverse frequency transformations.
An inverse frequency transformer (360) converts the quantized, frequency domain data into spatial domain video information. For block-based video pictures, the inverse frequency transformer (360) applies an IDCT or variant of IDCT to blocks of the DCT coefficients, producing pixel data or prediction residual data for key pictures or predicted pictures, respectively. Alternatively, the frequency transformer (360) applies another conventional inverse frequency transform such as a Fourier transform or uses wavelet or subband synthesis. The inverse frequency transformer (360) applies an 8×8, 8×4, 4×8, or other size inverse frequency transform (e.g., IDCT) to prediction residuals for predicted pictures.
When the decoder needs a reconstructed picture for subsequent motion compensation, the picture store (320) buffers the reconstructed picture for use in predicting a next picture. The decoder may apply a deblocking filter to adaptively smooth discontinuities between blocks.
III. Signaling Reference Frame Distances
According to one set of definitions, for interlaced video, a “current frame” is the frame that contains the field currently being coded or decoded, and a “reference frame” is a frame that contains at least one field used as a motion compensation reference for a field of the current frame.
In some embodiments, an encoder encodes and signals reference frame distance information, and a decoder performs corresponding parsing and decoding of the information. A reference frame distance indicates the distance between a current frame and the reference frame that contains the field(s) used as reference(s) for field(s) of the current frame. For example, the distance is represented in terms of the count of frames between the current frame and the reference frame. Alternatively, the reference frame distance is represented in other terms.
Typically, the intermediate frames between a current frame and its reference frame contain bi-directionally predicted fields, and the current frame contains either intra-coded or forward predicted fields. For example, each intermediate frame is some combination of interlaced B- and BI-fields (B/B, B/BI, BI/B, or BI/BI), and the current frame is some combination of interlaced I- and P-fields (I/I, I/P, P/I, or P/P). An encoder and decoder use reference frame distance information when scaling motion vectors for motion vector prediction. Alternatively, reference frame distance information is signaled for other picture types and/or used for some other purpose.
Alternatively, instead of an actual count of frames (e.g., frames with B- or BI-fields) between the current frame and the reference frame, the reference frame distance is an arbitrary value selected so as to improve the performance of subsequent operations that use the reference frame distance. In other words, the reference frame distance for a particular frame can have any value that is allowed in an implementation. For example, an encoder selects the value so as to improve the prediction accuracy of motion vectors produced by scaling operations in motion vector prediction. The selected number is often the actual count of B-frames, but it does not have to be. If using a different, notional value for reference frame distance produces better results, the encoder may choose the different value.
A. Syntax and Code Examples
Various signaling innovations help reduce the bit rate associated with signaling reference frame distance information. These may be used in combination or separately.
First, reference frame distances may be represented with variable length codes [“VLCs”]. For example, Huffman codes may be used for possible reference frame distances, with or without escape coding. Or, variable length coding and decoding can occur according to the rules shown in the table in
Second, reference frame distances may be signaled for some kinds of frames but not other kinds of frames. For example, reference frame distances are signaled for frames containing forwarded-predicted fields and/or intra-coded fields but not for frames containing bi-directionally predicted fields. In the REFDIST example, REFDIST is signaled in frame headers for some kinds of field-coded interlaced video frames (namely, I/I, I/P, P/I, and P/P) but not for other kinds of field-coded interlaced video frames (namely, B/B, B/BI, BI/B, and BI/BI). Alternatively, reference frame distances are signaled according to another rule.
Third, reference frame distances may be signaled only some times for a set of frames, with a default value for reference frame distance used the rest of the time. For example, a one-bit flag or other code for a sequence, entry point segment, or other set of pictures indicates whether reference frame distances are signaled or take a default value for the set of pictures. In the REFDIST example, the one-bit syntax element REFDIST_FLAG may be signaled in the entry point header for an entry point segment. If REFDIST_FLAG has one binary value, a default value is used for the reference frame distances of frames in the entry point segment, and reference frame distance information is not signaled per frame. If REFDIST_FLAG has the other binary value, reference frame distances are signaled for frames in the entry point segment. Alternatively, no default values are used reference frame distances, and reference frame distances are always signaled.
B. Encoding
An encoder such as the encoder (200) of
For a frame, the encoder determines (610) whether reference frame distances are currently signaled or instead take a default value. For example, the encoder checks the value of a flag previously signaled in an entry point header or sequence header, and the flag value indicates whether the encoder should signal a reference frame distance per frame or use the default value. Alternatively, the encoder makes the decision based upon other information.
If reference frame distance signaling is used, the encoder encodes and signals (620) a reference frame distance syntax element for the frame. For example, the syntax element is REFDIST and is signaled in a frame header. Alternatively, the reference frame distance syntax element is another VLC or FLC or is signaled elsewhere. If reference frame distance signaling is not used, the encoder uses (630) the default value for reference frame distance and does not encode or signal a reference frame distance syntax element for the frame.
The encoder then encodes (640) the frame (more specifically, for a field-coded interlaced video frame, it encodes the two separate interlaced fields of the frame). In the encoding, the encoder uses the reference frame distance (either signaled or default value) for operations such as scaling of motion vectors in motion vector prediction.
C. Decoding
A decoder such as the decoder (300) of
For a frame, the decoder determines (660) whether reference frame distances are currently signaled or instead take a default value. For example, the decoder checks the value of a flag previously parsed from an entry point header or sequence header, and the flag value indicates whether the decoder should parse a reference frame distance per frame or use the default value. Alternatively, the decoder makes the decision based upon other information.
If reference frame distance signaling is used, the decoder parses and decodes (670) a reference frame distance syntax element for the frame. For example, the syntax element is REFDIST and is signaled in a frame header. Alternatively, the reference frame distance syntax element is another VLC or FLC or is signaled elsewhere. If reference frame distance signaling is not used, the decoder uses (680) the default value for reference frame distance and does not parse or decode a reference frame distance syntax element for the frame.
The decoder then decodes (690) the frame (more specifically, for a field-coded interlaced video frame, it decodes the two separate interlaced fields of the frame). In the decoding, the decoder uses the reference frame distance (either signaled or default value) for operations such as scaling of motion vectors in motion vector prediction.
IV. Combined Implementation
Syntax, semantics, and decoding are now described for one detailed combined implementation. Alternatively, the above-described techniques are used in conjunction with other implementations having different syntax, semantics, and decoding.
A compressed video sequence is made up of data structured into hierarchical layers: the picture layer, macroblock layer, and block layer. A sequence layer precedes the sequence, and entry point layers may be interspersed in the sequence.
A. Bitstream Syntax, Semantics, and Decoding for REFDIST
A sequence-level header contains sequence-level parameters used to decode the sequence of compressed pictures. In some profiles, sequence-related metadata is communicated to the decoder by the transport layer or other means. For the profile with field-coded interlaced video frames (the advanced profile), however, this header syntax is part of the video data bitstream. In the sequence layer, the PROFILE and LEVEL elements specify the profile used to encode the sequence and the encoding level in the profile, respectively. The INTERLACE element is a one-bit syntax element that signals whether the source content is progressive (INTERLACE=0) or interlaced (INTERLACE=1). The individual frames may still be coded using the progressive or interlaced syntax when INTERLACE=1.
An entry-point header may be present in the advanced profile. An entry point has two purposes. First, it is used to signal a random access point within the bitstream. Second, it is used to signal changes in the coding control parameters.
Data for a picture consists of a picture header followed by data for the macroblock layer.
The frame coding mode FCM (721) element is present only in the advanced profile and only if INTERLACE has the value 1. FCM (721) indicates whether a frame is coded as progressive, field-interlaced (i.e., two interlaced fields), or frame-interlaced. The table in
The field picture type FPTYPE (722) element is a three-bit syntax element present in picture headers for interlaced field pictures. FPTYPE is decoded according to the table in
The reference distance REFDIST (724) element is a variable-size syntax element present in interlaced field picture headers if the entry-level flag REFDIST_FLAG is 1 and if the picture type is not B/B, B/BI, BI/B, or BI/BI. If REFDIST_FLAG is 0, REFDIST (724) is given the default value of 0. REFDIST (724) indicates the number of frames between the current frame (that includes the two separately coded fields) and the previous reference frame. The table in
BFRACTION (723) is a variable-sized syntax element present in headers for B/B, B/BI, and BI/B frames. BFRACTION (723) signals one of a limited set of fractional values between 0 and 1, denoting the relative temporal position of the B-frame within the interval formed by its anchors. The mapping of BFRACTION (723) is shown in the table in
The field picture layer FIELDPICLAYER (725) element is data for one of the separate interlaced fields of the frame. For a P/P frame, for example, the bitstream includes two FIELDPICLAYER (725) elements for the two interlaced P-fields. The syntax and semantics of the field picture layer (and macroblock, block, and sub-block layers) vary depending on picture type. For additional detail on example syntax and semantics, see U.S. Provisional Patent Application No. 60/501,081.
B. Uses of REFDIST
REFDIST (724) is used for various motion vector scaling operations in motion vector prediction for interlaced P-fields and interlaced B-fields. A brief description of example uses of reference frame distance is provided for the sake of completeness.
1. Motion Vector Prediction for Interlaced P-Fields
An interlaced P-field may refer to the two most recent reference fields. For a current, two-reference field interlaced P-field, two motion vector predictors may be computed for each motion vector. One motion vector predictor is from the reference field of the same polarity as the current P-field, and the other motion vector predictor is from the reference field with the opposite polarity.
The pseudocode in
The pseudocode in
For example, if REFDIST is 0 (no intermediate B-frames), the distance between the same polarity reference field and the current field is double the distance between the opposite polarity reference field and the current field. So, horizontal scaling from an opposite polarity motion vector predictor to a same polarity motion vector predictor basically results in a doubling, and horizontal scaling from same to opposite basically results in a halving. The vertical scaling also accounts for interlacing offsets. If REFDIST is 1 (one intermediate B-frame), however, the relative distances between the current field and the respective reference fields change, and the scaling factors change accordingly. For example, the distance is three fields from a current, top field to the opposite polarity reference field and four fields from the current, top field to the same polarity reference field.
For additional detail about these motion vector scaling operations and other motion vector scaling operations for interlaced P-fields that use REFDIST (724), see, e.g., U.S. patent application Ser. No. 10/934,905.
2. Motion Vector Prediction for Interlaced B-Fields
As another example of the use of REFDIST (724), an interlaced B-field refers to up to two reference fields for forward prediction and two reference fields for backward prediction. Forward motion vector prediction for a B-field is basically the same as P-field motion vector prediction as described above, but does have a few differences. The reference frame distance is derived from BFRACTION (723) in the B-field's frame header and the REFDIST (724) element in the backward reference frame header. The forward reference frame distance [“FRFD”] for the B-field is computed as: FRFD=NINT((BFRACTION numerator/BFRACTION denominator)*Reference Frame Distance)−1. If FRFD<0, then FRFD=0. NINT is the nearest integer operator, and the BFRACTION numerator and BFRACTION denominator are derived from BFRACTION (723). Reference Frame Distance is computed from REFDIST (724) of the backward reference frame as REFDIST+1.
Backward motion vector prediction for the second B-field in an interlaced frame is basically the same as P-field motion vector prediction as described above.
Backward motion vector prediction for the first B-field in an interlaced frame is also basically the same as P-field motion vector prediction, but the motion vector scaling is different. For this case, scaleforopposite_x, scaleforopposite_y, scaleforsame_x and scaleforsame_y are defined as shown in
Backward reference frame distance is computed from BFRACTION (723) in the B-field's frame header and REFDIST (724) in the backward reference frame header. The backward reference frame distance [“BRFD”] is computed as: BRFD=Reference Frame Distance−FRFD−1. Reference Frame Distance is computed from REFDIST (724) of the backward reference frame as REFDIST+1.
Having described and illustrated the principles of our invention with reference to various embodiments, it will be recognized that the various embodiments can be modified in arrangement and detail without departing from such principles. It should be understood that the programs, processes, or methods described herein are not related or limited to any particular type of computing environment, unless indicated otherwise. Various types of general purpose or specialized computing environments may be used with or perform operations in accordance with the teachings described herein. Elements of embodiments shown in software may be implemented in hardware and vice versa.
In various embodiments, an encoder and decoder use flags and/or signals in a bitstream. While specific flags and signals are described, it should be understood that this manner of description encompasses different conventions (e.g., 0s rather than 1s) for the flags and signals.
In view of the many possible embodiments to which the principles of our invention may be applied, we claim as our invention all such embodiments as may come within the scope and spirit of the following claims and equivalents thereto.
The present application is a continuation-in-part of U.S. patent application Ser. No. 10/934,905, filed Sep. 2, 2004, which claims the benefit of U.S. Provisional Patent Application No. 60/501,081, filed Sep. 7, 2003. U.S. patent application Ser. No. 10/934,905 is also a continuation-in-part of U.S. patent application Ser. No. 10/857,473, filed May 27, 2004, which claims the benefit of U.S. Provisional Patent Application No. 60/501,081, filed Sep. 7, 2003. The present application is also a continuation-in-part of U.S. patent application Ser. No. 10/882,135, filed Jun. 29, 2004, which claims the benefit of U.S. Provisional Patent Application No. 60/501,081, filed Sep. 7, 2003. The disclosures of U.S. patent application Ser. Nos. 10/934,905, 10/857,473, and 10/882,135 and U.S. Provisional Patent Application No. 60/501,081 are hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
60501081 | Sep 2003 | US | |
60501081 | Sep 2003 | US | |
60501081 | Sep 2003 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 10934905 | Sep 2004 | US |
Child | 10990236 | Nov 2004 | US |
Parent | 10857473 | May 2004 | US |
Child | 10990236 | Nov 2004 | US |
Parent | 10882135 | Jun 2004 | US |
Child | 10990236 | Nov 2004 | US |