The present disclosure relates to an image encoding/decoding method and apparatus, and a recording medium storing a bitstream.
Recently, the demand for high-resolution and high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images has been increasing in various application fields, and accordingly, highly efficient image compression technologies are being discussed.
There are a variety of technologies such as inter-prediction technology that predicts a pixel value included in a current picture from a picture before or after a current picture with video compression technology, intra-prediction technology that predicts a pixel value included in a current picture by using pixel information in a current picture, entropy coding technology that allocates a short sign to a value with high appearance frequency and a long sign to a value with low appearance frequency, etc. and these image compression technologies may be used to effectively compress image data and transmit or store it.
The present disclosure provides a method and a device for deriving a motion vector according to a merge inter mode.
The present disclosure provides a method and a device for correcting a motion vector according to a merge inter mode.
The present disclosure provides a method and a device for converting the resolution of a motion vector according to a merge inter mode.
An image decoding method and apparatus according to the present disclosure may derive a motion vector of a current block based on a merge inter mode, generate a first prediction block and a second prediction block of the current block based on the first motion vector and the second motion vector, respectively, and generate a prediction block of the current block based on at least one of the first prediction block or the second prediction block. Here, the motion vector of the current block may include a first motion vector in a first direction and a second motion vector in a second direction. The first motion vector may be derived based on a first inter prediction mode, and the second motion vector may be derived based on a second inter prediction mode.
In an image decoding method and apparatus according to the present disclosure, the first inter prediction mode may be an AMVP mode, and the second inter prediction mode may be a merge mode.
In an image decoding method and apparatus according to the present disclosure, the first prediction block may be generated based on the first motion vector and a motion vector difference signaled from a bitstream.
An image decoding method and apparatus according to the present disclosure may obtain an index for adaptive motion vector resolution of a current block from a bitstream. Here, the index may indicate any one of a plurality of motion vector resolution candidates pre-defined in a decoding apparatus.
In an image decoding method and apparatus according to the present disclosure, the first motion vector in the first direction and the motion vector difference may be converted to have motion vector resolution according to the index.
In an image decoding method and apparatus according to the present disclosure, the second motion vector in the second direction may not be converted to have motion vector resolution according to the index.
In an image decoding method and apparatus according to the present disclosure, the index may be obtained for at least one of the first motion vector in the first direction or the motion vector difference, and the index may be shared for a motion vector in the second direction.
In an image decoding method and apparatus according to the present disclosure, at least one of the first motion vector in the first direction or the motion vector difference may be converted based on an index for adaptive motion vector resolution, and the index may indicate any one of a plurality of motion vector resolution candidates pre-defined in a decoding apparatus.
In an image decoding method and apparatus according to the present disclosure, the index may be derived based on any one of a plurality of merge candidates belonging to a merge candidate list according to the merge mode.
In an image decoding method and apparatus according to the present disclosure, an index for adaptive motion vector resolution of the current block may be propagated to a block with later decoding order than the current block.
An image encoding method and apparatus according to the present disclosure may derive a motion vector of a current block based on a merge inter mode, generate a first prediction block and a second prediction block of the current block based on the first motion vector and the second motion vector, respectively, and generate a prediction block of the current block based on at least one of the first prediction block or the second prediction block. Here, the motion vector of the current block may include a first motion vector in a first direction and a second motion vector in a second direction. The first motion vector may be derived based on a first inter prediction mode, and the second motion vector may be derived based on a second inter prediction mode.
A computer-readable digital storage medium storing encoded video/image information that causes performing the image decoding method by a decoding apparatus according to the present disclosure is provided.
A computer-readable digital storage medium storing video/image information generated according to the image encoding method according to the present disclosure is provided.
A method and a device for transmitting video/image information generated according to an image encoding method according to the present disclosure are provided.
According to the present disclosure, it is possible to efficiently derive a motion vector according to a merge inter mode in terms of a decoding apparatus, while minimizing signaling of information for deriving a motion vector.
According to the present disclosure, the accuracy of a motion vector may be improved through correction based on bilateral matching or template matching.
According to the present disclosure, the resolution of a motion vector according to a merge inter mode may be adaptively converted.
Since the present disclosure may make various changes and have several embodiments, specific embodiments will be illustrated in a drawing and described in detail in a detailed description. However, it is not intended to limit the present disclosure to a specific embodiment, and should be understood to include all changes, equivalents and substitutes included in the spirit and technical scope of the present disclosure. While describing each drawing, similar reference numerals are used for similar components.
A term such as first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The terms are used only to distinguish one component from other components. For example, a first component may be referred to as a second component without departing from the scope of a right of the present disclosure, and similarly, a second component may also be referred to as a first component. A term of and/or includes any of a plurality of related stated items or a combination of a plurality of related stated items.
When a component is referred to as “being connected” or “being linked” to another component, it should be understood that it may be directly connected or linked to another component, but another component may exist in the middle. On the other hand, when a component is referred to as “being directly connected” or “being directly linked” to another component, it should be understood that there is no another component in the middle.
A term used in this application is just used to describe a specific embodiment, and is not intended to limit the present disclosure. Singular expressions include plural expressions unless the context clearly dictates otherwise. In this application, it should be understood that a term such as “include” or “have”, etc. is intended to designate the presence of features, numbers, steps, operations, components, parts or combinations thereof described in the specification, but does not exclude in advance the possibility of presence or addition of one or more other features, numbers, steps, operations, components, parts or combinations thereof.
The present disclosure relates to video/image coding. For example, a method/an embodiment disclosed herein may be applied to a method disclosed in the versatile video coding (VVC) standard. In addition, a method/an embodiment disclosed herein may be applied to a method disclosed in the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the 2nd generation of audio video coding standard (AVS2) or the next-generation video/image coding standard (ex. H.267 or H. 268, etc.).
This specification proposes various embodiments of video/image coding, and unless otherwise specified, the embodiments may be performed in combination with each other.
Herein, a video may refer to a set of a series of images over time. A picture generally refers to a unit representing one image in a specific time period, and a slice/a tile is a unit that forms part of a picture in coding. A slice/a tile may include at least one coding tree unit (CTU). One picture may consist of at least one slice/tile. One tile is a rectangular region composed of a plurality of CTUs within a specific tile column and a specific tile row of one picture. A tile column is a rectangular region of CTUs having the same height as that of a picture and a width designated by a syntax requirement of a picture parameter set. A tile row is a rectangular region of CTUs having a height designated by a picture parameter set and the same width as that of a picture. CTUs within one tile may be arranged consecutively according to CTU raster scan, while tiles within one picture may be arranged consecutively according to raster scan of a tile. One slice may include an integer number of complete tiles or an integer number of consecutive complete CTU rows within a tile of a picture that may be included exclusively in a single NAL unit. Meanwhile, one picture may be divided into at least two sub-pictures. A sub-picture may be a rectangular region of at least one slice within a picture.
A pixel, a pixel or a pel may refer to the minimum unit that constitutes one picture (or image). In addition, ‘sample’ may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, and may represent only a pixel/a pixel value of a luma component, or only a pixel/a pixel value of a chroma component.
A unit may represent a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to a corresponding region. One unit may include one luma block and two chroma (ex. cb, cr) blocks. In some cases, a unit may be used interchangeably with a term such as a block or an region, etc. In a general case, a M×N block may include a set (or an array) of transform coefficients or samples (or sample arrays) consisting of M columns and N rows.
Herein, “A or B” may refer to “only A”, “only B” or “both A and B.” In other words, herein, “A or B” may be interpreted as “A and/or B.” For example, herein, “A, B or C” may refer to “only A”, “only B”, “only C” or “any combination of A, B and C)”.
A slash (/) or a comma used herein may refer to “and/or.” For example, “A/B” may refer to “A and/or B.” Accordingly, “A/B” may refer to “only A”, “only B” or “both A and B.” For example, “A, B, C” may refer to “A, B, or C”.
Herein, “at least one of A and B” may refer to “only A”, “only B” or “both A and B”. In addition, herein, an expression such as “at least one of A or B” or “at least one of A and/or B” may be interpreted in the same way as “at least one of A and B”.
In addition, herein, “at least one of A, B and C” may refer to “only A”, “only B”, “only C”, or “any combination of A, B and C”. In addition, “at least one of A, B or C” or “at least one of A, B and/or C” may refer to “at least one of A, B and C”.
In addition, a parenthesis used herein may refer to “for example.” Specifically, when indicated as “prediction (intra prediction)”, “intra prediction” may be proposed as an example of “prediction”. In other words, “prediction” herein is not limited to “intra prediction” and “intra prediction” may be proposed as an example of “prediction.” In addition, even when indicated as “prediction (i.e., intra prediction)”, “intra prediction” may be proposed as an example of “prediction.”
Herein, a technical feature described individually in one drawing may be implemented individually or simultaneously.
Referring to
A source device may transmit encoded video/image information or data in a form of a file or streaming to a receiving device through a digital storage medium or a network. The source device may include a video source, an encoding apparatus and a transmission unit. The receiving device may include a reception unit, a decoding apparatus and a renderer. The encoding apparatus may be referred to as a video/image encoding apparatus and the decoding apparatus may be referred to as a video/image decoding apparatus. A transmitter may be included in an encoding apparatus. A receiver may be included in a decoding apparatus. A renderer may include a display unit, and a display unit may be composed of a separate device or an external component.
A video source may acquire a video/an image through a process of capturing, synthesizing or generating a video/an image. A video source may include a device of capturing a video/an image and a device of generating a video/an image. A device of capturing a video/an image may include at least one camera, a video/image archive including previously captured videos/images, etc. A device of generating a video/an image may include a computer, a tablet, a smartphone, etc. and may (electronically) generate a video/an image. For example, a virtual video/image may be generated through a computer, etc., and in this case, a process of capturing a video/an image may be replaced by a process of generating related data.
An encoding apparatus may encode an input video/image. An encoding apparatus may perform a series of procedures such as prediction, transform, quantization, etc. for compression and coding efficiency. Encoded data (encoded video/image information) may be output in a form of a bitstream.
A transmission unit may transmit encoded video/image information or data output in a form of a bitstream to a reception unit of a receiving device through a digital storage medium or a network in a form of a file or streaming. A digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmission unit may include an element for generating a media file through a predetermined file format and may include an element for transmission through a broadcasting/communication network. A reception unit may receive/extract the bitstream and transmit it to a decoding apparatus.
A decoding apparatus may decode a video/an image by performing a series of procedures such as dequantization, inverse transform, prediction, etc. corresponding to an operation of an encoding apparatus.
A renderer may render a decoded video/image. A rendered video/image may be displayed through a display unit.
Referring to
An image partitioner 210 may partition an input image (or picture, frame) input to an encoding apparatus 200 into at least one processing unit. As an example, the processing unit may be referred to as a coding unit (CU). In this case, a coding unit may be partitioned recursively according to a quad-tree binary-tree ternary-tree (QTBTTT) structure from a coding tree unit (CTU) or the largest coding unit (LCU).
For example, one coding unit may be partitioned into a plurality of coding units with a deeper depth based on a quad tree structure, a binary tree structure and/or a ternary structure. In this case, for example, a quad tree structure may be applied first and a binary tree structure and/or a ternary structure may be applied later. Alternatively, a binary tree structure may be applied before a quad tree structure. A coding procedure according to this specification may be performed based on a final coding unit that is no longer partitioned. In this case, based on coding efficiency, etc. according to an image characteristic, the largest coding unit may be directly used as a final coding unit, or if necessary, a coding unit may be recursively partitioned into coding units of a deeper depth, and a coding unit with an optimal size may be used as a final coding unit. Here, a coding procedure may include a procedure such as prediction, transform, and reconstruction, etc. described later.
As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be divided or partitioned from a final coding unit described above, respectively. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving a transform coefficient and/or a unit for deriving a residual signal from a transform coefficient.
In some cases, a unit may be used interchangeably with a term such as a block or an region, etc. In a general case, a M×N block may represent a set of transform coefficients or samples consisting of M columns and N rows. A sample may generally represent a pixel or a pixel value, and may represent only a pixel/a pixel value of a luma component, or only a pixel/a pixel value of a chroma component. A sample may be used as a term that makes one picture (or image) correspond to a pixel or a pel.
An encoding apparatus 200 may subtract a prediction signal (a prediction block, a prediction sample array) output from an inter predictor 221 or an intra predictor 222 from an input image signal (an original block, an original sample array) to generate a residual signal (a residual signal, a residual sample array), and a generated residual signal is transmitted to a transformer 232. In this case, a unit that subtracts a prediction signal (a prediction block, a prediction sample array) from an input image signal (an original block, an original sample array) within an encoding apparatus 200 may be referred to as a subtractor 231.
A predictor 220 may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including prediction samples for the current block. A predictor 220 may determine whether intra prediction or inter prediction is applied in a unit of a current block or a CU. A predictor 220 may generate various information on prediction such as prediction mode information, etc. and transmit it to an entropy encoder 240 as described later in a description of each prediction mode. Information on prediction may be encoded in an entropy encoder 240 and output in a form of a bitstream.
An intra predictor 222 may predict a current block by referring to samples within a current picture. The samples referred to may be positioned in the neighborhood of the current block or may be positioned a certain distance away from the current block according to a prediction mode. In intra prediction, prediction modes may include at least one nondirectional mode and a plurality of directional modes. A nondirectional mode may include at least one of a DC mode or a planar mode. A directional mode may include 33 directional modes or 65 directional modes according to a detail level of a prediction direction. However, it is an example, and more or less directional modes may be used according to a configuration. An intra predictor 222 may determine a prediction mode applied to a current block by using a prediction mode applied to a neighboring block.
An inter predictor 221 may derive a prediction block for a current block based on a reference block (a reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in an inter prediction mode, motion information may be predicted in a unit of a block, a sub-block or a sample based on the correlation of motion information between a neighboring block and a current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter prediction, a neighboring block may include a spatial neighboring block existing in a current picture and a temporal neighboring block existing in a reference picture. A reference picture including the reference block and a reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc., and a reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, an inter predictor 221 may configure a motion information candidate list based on neighboring blocks and generate information indicating which candidate is used to derive a motion vector and/or a reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, for a skip mode and a merge mode, an inter predictor 221 may use motion information of a neighboring block as motion information of a current block. For a skip mode, unlike a merge mode, a residual signal may not be transmitted. For a motion vector prediction (MVP) mode, a motion vector of a neighboring block is used as a motion vector predictor and a motion vector difference is signaled to indicate a motion vector of a current block.
A predictor 220 may generate a prediction signal based on various prediction methods described later. For example, a predictor may not only apply intra prediction or inter prediction for prediction for one block, but also may apply intra prediction and inter prediction simultaneously. It may be referred to as a combined inter and intra prediction (CIIP) mode. In addition, a predictor may be based on an intra block copy (IBC) prediction mode or may be based on a palette mode for prediction for a block. The IBC prediction mode or palette mode may be used for content image/video coding of a game, etc. such as screen content coding (SCC), etc. IBC basically performs prediction within a current picture, but it may be performed similarly to inter prediction in that it derives a reference block within a current picture. In other words, IBC may use at least one of inter prediction techniques described herein. A palette mode may be considered as an example of intra coding or intra prediction. When a palette mode is applied, a sample value within a picture may be signaled based on information on a palette table and a palette index. A prediction signal generated through the predictor 220 may be used to generate a reconstructed signal or a residual signal.
A transformer 232 may generate transform coefficients by applying a transform technique to a residual signal. For example, a transform technique may include at least one of Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), Karhunen-Loève Transform (KLT), Graph-Based Transform (GBT) or Conditionally Non-linear Transform (CNT). Here, GBT refers to transform obtained from this graph when relationship information between pixels is expressed as a graph. CNT refers to transform obtained based on generating a prediction signal by using all previously reconstructed pixels. In addition, a transform process may be applied to a square pixel block in the same size or may be applied to a non-square block in a variable size.
A quantizer 233 may quantize transform coefficients and transmit them to an entropy encoder 240 and an entropy encoder 240 may encode a quantized signal (information on quantized transform coefficients) and output it as a bitstream. Information on the quantized transform coefficients may be referred to as residual information. A quantizer 233 may rearrange quantized transform coefficients in a block form into an one-dimensional vector form based on coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form.
An entropy encoder 240 may perform various encoding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. An entropy encoder 240 may encode information necessary for video/image reconstruction (e.g., a value of syntax elements, etc.) other than quantized transform coefficients together or separately.
Encoded information (ex. encoded video/image information) may be transmitted or stored in a unit of a network abstraction layer (NAL) unit in a bitstream form. The video/image information may further include information on various parameter sets such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS) or a video parameter set (VPS), etc. In addition, the video/image information may further include general constraint information. Herein, information and/or syntax elements transmitted/signaled from an encoding apparatus to a decoding apparatus may be included in video/image information. The video/image information may be encoded through the above-described encoding procedure and included in the bitstream. The bitstream may be transmitted through a network or may be stored in a digital storage medium. Here, a network may include a broadcasting network and/or a communication network, etc. and a digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmission unit (not shown) for transmitting and/or a storage unit (not shown) for storing a signal output from an entropy encoder 240 may be configured as an internal/external element of an encoding apparatus 200, or a transmission unit may be also included in an entropy encoder 240.
Quantized transform coefficients output from a quantizer 233 may be used to generate a prediction signal. For example, a residual signal (a residual block or residual samples) may be reconstructed by applying dequantization and inverse transform to quantized transform coefficients through a dequantizer 234 and an inverse transformer 235. An adder 250 may add a reconstructed residual signal to a prediction signal output from an inter predictor 221 or an intra predictor 222 to generate a reconstructed signal (a reconstructed picture, a reconstructed block, a reconstructed sample array). When there is no residual for a block to be processed like when a skip mode is applied, a predicted block may be used as a reconstructed block. An adder 250 may be referred to as a reconstructor or a reconstructed block generator. A generated reconstructed signal may be used for intra prediction of a next block to be processed within a current picture, and may be also used for inter prediction of a next picture through filtering as described later. Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in a picture encoding and/or reconstruction process.
A filter 260 may improve subjective/objective image quality by applying filtering to a reconstructed signal. For example, a filter 260 may generate a modified reconstructed picture by applying various filtering methods to a reconstructed picture, and may store the modified reconstructed picture in a memory 270, specifically in a DPB of a memory 270. The various filtering methods may include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. A filter 260 may generate various information on filtering and transmit it to an entropy encoder 240. Information on filtering may be encoded in an entropy encoder 240 and output in a form of a bitstream.
A modified reconstructed picture transmitted to a memory 270 may be used as a reference picture in an inter predictpr 221. When inter prediction is applied through it, an encoding apparatus may avoid prediction mismatch in an encoding apparatus 200 and a decoding apparatus, and may also improve encoding efficiency.
A DPB of a memory 270 may store a modified reconstructed picture to use it as a reference picture in an inter predictor 221. A memory 270 may store motion information of a block from which motion information in a current picture is derived (or encoded) and/or motion information of blocks in a pre-reconstructed picture. The stored motion information may be transmitted to an inter predictor 221 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. A memory 270 may store reconstructed samples of reconstructed blocks in a current picture and transmit them to an intra predictor 222.
Referring to
According to an embodiment, the above-described entropy decoder 310, residual processor 320, predictor 330, adder 340 and filter 350 may be configured by one hardware component (e.g., a decoder chipset or a processor). In addition, a memory 360 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include a memory 360 as an internal/external component.
When a bitstream including video/image information is input, a decoding apparatus 300 may reconstruct an image in response to a process in which video/image information is processed in an encoding apparatus of
A decoding apparatus 300 may receive a signal output from an encoding apparatus of
Meanwhile, a decoding apparatus according to this specification may be referred to as a video/image/picture decoding apparatus, and the decoding apparatus may be divided into an information decoder (a video/image/picture information decoder) and a sample decoder (a video/image/picture sample decoder). The information decoder may include the entropy decoder 310 and the sample decoder may include at least one of dequantizer 321, the inverse transformer 322, the adder 340, the filter 350, the memory 360, the inter predictor 332 and the intra predictor 331.
A dequantizer 321 may dequantize quantized transform coefficients and output transform coefficients. A dequantizer 321 may rearrange quantized transform coefficients into a two-dimensional block form. In this case, the rearrangement may be performed based on coefficient scan order performed in an encoding apparatus. A dequantizer 321 may perform dequantization on quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain transform coefficients.
An inverse transformer 322 inversely transforms transform coefficients to obtain a residual signal (a residual block, a residual sample array).
A predictor 320 may perform prediction on a current block and generate a predicted block including prediction samples for the current block. A predictor 320 may determine whether intra prediction or inter prediction is applied to the current block based on the information on prediction output from an entropy decoder 310 and determine a specific intra/inter prediction mode.
A predictor 320 may generate a prediction signal based on various prediction methods described later. For example, a predictor 320 may not only apply intra prediction or inter prediction for prediction for one block, but also may apply intra prediction and inter prediction simultaneously. It may be referred to as a combined inter and intra prediction (CIIP) mode. In addition, a predictor may be based on an intra block copy (IBC) prediction mode or may be based on a palette mode for prediction for a block. The IBC prediction mode or palette mode may be used for content image/video coding of a game, etc. such as screen content coding (SCC), etc. IBC basically performs prediction within a current picture, but it may be performed similarly to inter prediction in that it derives a reference block within a current picture. In other words, IBC may use at least one of inter prediction techniques described herein. A palette mode may be considered as an example of intra coding or intra prediction. When a palette mode is applied, information on a palette table and a palette index may be included in the video/image information and signaled.
An intra predictor 331 may predict a current block by referring to samples within a current picture. The samples referred to may be positioned in the neighborhood of the current block or may be positioned a certain distance away from the current block according to a prediction mode. In intra prediction, prediction modes may include at least one nondirectional mode and a plurality of directional modes. An intra predictor 331 may determine a prediction mode applied to a current block by using a prediction mode applied to a neighboring block.
An inter predictor 332 may derive a prediction block for a current block based on a reference block (a reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in an inter prediction mode, motion information may be predicted in a unit of a block, a sub-block or a sample based on the correlation of motion information between a neighboring block and a current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter prediction, a neighboring block may include a spatial neighboring block existing in a current picture and a temporal neighboring block existing in a reference picture. For example, an inter predictor 332 may configure a motion information candidate list based on neighboring blocks and derive a motion vector and/or a reference picture index of the current block based on received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information on prediction may include information indicating an inter prediction mode for the current block.
An adder 340 may add an obtained residual signal to a prediction signal (a prediction block, a prediction sample array) output from a predictor (including an inter predictor 332 and/or an intra predictor 331) to generate a reconstructed signal (a reconstructed picture, a reconstructed block, a reconstructed sample array). When there is no residual for a block to be processed like when a skip mode is applied, a prediction block may be used as a reconstructed block.
An adder 340 may be referred to as a reconstructor or a reconstructed block generator. A generated reconstructed signal may be used for intra prediction of a next block to be processed in a current picture, may be output through filtering as described later or may be used for inter prediction of a next picture. Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in a picture decoding process.
A filter 350 may improve subjective/objective image quality by applying filtering to a reconstructed signal. For example, a filter 350 may generate a modified reconstructed picture by applying various filtering methods to a reconstructed picture and transmit the modified reconstructed picture to a memory 360, specifically a DPB of a memory 360. The various filtering methods may include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.
The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter predictor 332. A memory 360 may store motion information of a block from which motion information in a current picture is derived (or decoded) and/or motion information of blocks in a pre-reconstructed picture. The stored motion information may be transmitted to an inter predictor 260 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. A memory 360 may store reconstructed samples of reconstructed blocks in a current picture and transmit them to an intra predictor 331.
Herein, embodiments described in a filter 260, an inter predictor 221 and an intra predictor 222 of an encoding apparatus 200 may be also applied equally or correspondingly to a filter 350, an inter predictor 332 and an intra predictor 331 of a decoding apparatus 300, respectively.
Referring to
A motion vector of a current block may include a motion vector for bilateral prediction, i.e., a motion vector in a first direction and a motion vector in a second direction. Here, a first direction may refer to a LX direction, and a second direction may refer to a L(1−X) direction, respectively (X is 0 or 1). A motion vector in a first direction may be derived based on a first inter prediction mode among the inter prediction modes pre-defined in a decoding apparatus, and motion information in a second direction may be derived based on a second inter prediction mode among the inter prediction modes pre-defined in a decoding apparatus.
Based on information showing whether a first inter prediction mode is applied to a L0 direction or whether a second inter prediction mode is applied to a L0 direction, a first direction to which a first inter prediction mode is applied and a second direction to which a second inter prediction mode is applied may be specified. As an example, when the information is a first value, a first inter prediction mode may be applied to a L0 direction, and a second inter prediction mode may be applied to a L1 direction. On the other hand, when the information is a second value, a first inter prediction mode may be applied to a L1 direction and a second inter prediction mode may be applied to a L0 direction.
Alternatively, regardless of the above-described information, a direction to which a first inter prediction mode or a second inter prediction mode is applied may be pre-defined in the same way for an encoding apparatus and a decoding apparatus. As an example, it may be defined that a first inter prediction mode is applied to a L0 direction, and a second inter prediction mode is applied to a L1 direction. Conversely, it may be also defined that a second inter prediction mode is applied to a L0 direction and a first inter prediction mode is applied to a L1 direction.
Hereinafter, for convenience of a description, it is assumed that a first inter prediction mode is an AMVP mode and a second inter prediction mode is a merge mode.
In an AMVP mode, a motion vector in a first direction may be derived as any one of a plurality of candidate motion vectors belonging to a motion prediction candidate list. A plurality of candidate motion vectors may include at least one of a motion vector of at least one spatial neighboring block adjacent to a current block or a motion vector of a temporal neighboring block of a current block.
Any one of the plurality of candidate motion vectors may be specified based on a candidate index. The candidate index may indicate any one of a plurality of candidate motion vectors. Here, a candidate index may be signaled through a bitstream.
Alternatively, any one of the plurality of candidate motion vectors may be specified based on a template matching-based cost. Specifically, for each of a plurality of candidate motion vectors belonging to a motion prediction candidate list, a sample difference (e.g., SAD, sum of absolute difference) between a template region of a spatial or temporal neighboring block with a corresponding candidate motion vector and a template region of a current block may be calculated, and a calculated sample difference may be used as a cost. In this case, a motion vector in the first direction may be derived as a candidate motion vector with the smallest sample difference among the calculated sample differences.
Alternatively, the template matching-based cost may be calculated for only some of a plurality of candidate motion vectors belonging to a motion prediction candidate list. Here, some candidate motion vectors may refer to M top candidate motion vectors with the smallest candidate index among a plurality of candidate motion vectors. M is an integer of 1, 2, 3 or higher, and may be smaller than the number of candidate motion vectors belonging to a motion prediction candidate list. Alternatively, some candidate motion vectors may refer to motion vectors of one or more spatial neighboring blocks excluding a motion vector of a temporal neighboring block among a plurality of candidate motion vectors. Alternatively, some candidate motion vectors may refer to a candidate motion vector at a position pre-defined equally for an encoding apparatus and a decoding apparatus. Here, a pre-defined position may include at least one of the top or the left of a current block.
When the template region is available, a motion vector in a first direction may be derived based on a template matching-based cost, and signaling of a candidate index may be omitted. On the other hand, when the template region is not available, the candidate index may be signaled, and a motion vector in a first direction may be derived based on a signaled candidate index.
In a merge mode, a motion vector in a second direction may be derived based on any one of a plurality of merge candidates belonging to a merge candidate list. A plurality of merge candidates may include at least one of at least one spatial merge candidate adjacent to a current block or a temporal merge candidate of a current block.
Any one of the plurality of merge candidates may be specified based on a merge index. The merge index may indicate any one of a plurality of merge candidates. Here, a merge index may be signaled through a bitstream.
Alternatively, any one of the plurality of merge candidates may be specified based on a bilateral matching-based cost.
As an example, for each of a plurality of merge candidates belonging to a merge candidate list, a sample difference (e.g., SAD) between a first reference block specified by motion information in a first direction and a second reference block specified by motion information of a corresponding merge candidate may be calculated, and a calculated sample difference may be used as a cost. In this case, a motion vector in the second direction may be derived as a motion vector of a merge candidate with the smallest sample difference among the calculated sample differences. The first reference block may be specified based on a reference picture indicated by a motion vector in a first direction derived above and a reference picture index in a first direction. The second reference block may be specified based on a reference picture indicated by a motion vector in a second direction of a corresponding merge candidate and a reference picture index in a second direction of a corresponding merge candidate.
Alternatively, the bilateral matching-based cost may be calculated for only some of a plurality of merge candidates belonging to a merge candidate list. Here, some merge candidates may refer to N top merge candidates with the smallest merge index among a plurality of merge candidates. N is an integer of 1, 2, 3 or higher, and may be smaller than the number of merge candidates belonging to a merge candidate list. Alternatively, some merge candidates may refer to one or more spatial merge candidates excluding a temporal merge candidate among a plurality of merge candidates. Alternatively, some merge candidates may refer to a merge candidate at a position pre-defined equally for an encoding apparatus and a decoding apparatus. Here, a pre-defined position may include at least one of the top or the left of a current block.
A motion vector in a second direction may be derived by selectively using any one of a merge index or a bilateral matching-based cost described above. A flag showing whether a bilateral matching-based cost is used for the selective use may be used. Here, a flag may be signaled through a bitstream, or may be implicitly derived based on a parameter of a current block. Here, a parameter may include at least one of a size, a shape, a partition type, a component type, the maximum number of merge candidates belonging to a merge candidate list, or whether a spatial/temporal neighboring block is available.
Referring to
A delta motion vector may be used to correct a motion vector of a current block according to a merge inter mode. The delta motion vector may be determined based on any one of bilateral matching or template matching, which is described in detail below.
A decoding apparatus may calculate a SAD array by performing a search based on a position of a reference block of a current block within a predetermined search range.
A reference block of the current block may include a reference block in a first direction (hereinafter, referred to as a first reference block) and a reference block in a second direction (hereinafter, referred to as a second reference block). A first reference block may be specified by motion information according to an AMVP mode described above. In other words, a first reference block may be specified based on a reference picture indicated by a motion vector in a first direction and a reference picture index in a first direction. A reference picture index in a first direction may be signaled for a current block through a bitstream. A second reference block may be specified by motion information according to a merge mode described above. In other words, a second reference block may be specified based on a reference picture indicated by a motion vector in a second direction and a reference picture index in a second direction. A reference picture index in a second direction may be a reference picture index of a merge candidate specified in S400.
The SAD array may be composed of a plurality of SADs calculated per search position within the search range. Each SAD may be calculated as a sample difference between at least two blocks searched in both directions. In this case, a block searched in a first direction is called a LX block, and a block searched in a second direction is called a L(1−X) block. The SAD may be calculated based on all samples belonging to LX and L(1−X) blocks, or may be calculated based on some samples within LX and L(1−X) blocks.
Here, some samples refer to a sub-block of LX and L(1−X) blocks, and at least one of a width or a height of a sub-block may be half a width or a height of LX and L(1−X) blocks. In other words, LX and L(1−X) blocks have a size of W×H, and the some samples may be a sub-block with a size of W×H/2, W/2×H or W/2×H/2. In this case, when some samples are a sub-block of W×H/2, some samples may be a top sub-block (or a bottom sub-block) within LX and L(1−X) blocks. When some samples is a sub-block of W/2×H, some samples may be a left sub-block (or a right sub-block) within LX and L(1−X) blocks. When some samples is a sub-block of W/2×H/2, some samples may be a top-left sub-block within LX and L(1−X) blocks, but are not limited thereto.
Alternatively, some samples may be defined as at least one of even-numbered sample lines or at least one of odd-numbered sample lines of LX and L(1−X) blocks. In this case, a sample line may be a vertical sample line, or a horizontal sample line.
Alternatively, some samples may refer to a sample at a position pre-defined equally for encoding/decoding apparatus. For example, a sample at the pre-defined position may refer to at least one of a top-left sample, a top-right sample, a bottom-left sample, a bottom-right sample, a center sample, a center sample of a sample column/row adjacent to a boundary of a current block, or a sample positioned on a diagonal line within a current block within LX and L(1−X) blocks.
A search position within the search range may be a position shifted by p in a x-axis direction and by q in a y-axis direction from a position of a reference block of a current block. For example, when p and q are an integer belonging to a range between −1 and 1, the number of search positions in a unit of an integer pel within a search range may be up to 9. Alternatively, when p and q are an integer belonging to a range between −2 and 2, the number of search positions in a unit of an integer pel within a search range may be up to 25. However, it is not limited thereto, and p and q may be between integers whose size (or, absolute value) is greater than 2, and a search may be performed in a unit of a fractional pel.
A search position within the search range may be determined based on an offset pre-defined equally for an encoding apparatus and a decoding apparatus. In other words, an offset may be defined as a variant vector between a search position and a position of a reference block of a current block. The offset may include at least one of a non-directional offset or a directional offset. The directional offset may include an offset for at least one direction of the left, the right, the top, the bottom, the top-left, the top-right, the bottom-left or the bottom-right. The non-directional offset refers to an offset whose size is 0, and the directional offset refers to an offset that a size (or, an absolute value) of at least one of a x-component or a y-component of an offset is greater than or equal to 1.
As an example, an offset may be defined as in Table 1 below
Table 1 defines an offset specifying a search position for each index, wherein dX[i] may refer to a x-component of a i-th offset and dY[i] may refer to a y-component of a i-th offset. An offset according to Table 1 may include a non-directional offset of (0,0) and eight directional offsets. However, an index in Table 1 is only for distinguishing an offset, and it does not limit a position of an offset corresponding to an index or a priority between offsets. In addition, Table 1 shows a case in which a size of a x-component and a y-component of an offset is 1, but it is just an example, and an offset in which a size of at least one of a x-component or a y-component is greater than or equal to 2 may be defined.
The offset may be defined for a L0 direction and a L1 direction, respectively. An offset for search in a L1 direction may be determined dependently on an offset for search in a L0 direction. As an example, when an offset for search in a L0 direction is (p,q), an offset for search in a L1 direction may be configured as (−p,−q) through mirroring. Alternatively, an offset for search in a L1 direction may be determined independently from an offset for search in a L0 direction.
Information about a size and/or a direction of an offset described above may be pre-defined in the same way for an encoding apparatus and a decoding apparatus, or may be encoded in an encoding apparatus and signaled to a decoding apparatus. The information may be variably determined by considering the above-described block attribute.
Through the above-described method, a SAD corresponding to a search position (or, each pre-defined offset) within a search range may be calculated. Among a plurality of SADs in a SAD array, a SAD with the minimum value may be identified, and a delta motion vector may be determined based on an offset corresponding to an identified SAD. A motion vector in a L0 direction may be corrected based on a delta motion vector (deltaMV), and a motion vector in a L1 direction may be corrected based on a mirrored delta motion vector (−deltaMV).
A decoding apparatus may calculate a SAD array by performing a search based on a position of a reference block of a current block within a predetermined search range. Here, a SAD array may be composed of a plurality of SADs calculated for each search position within a search range. Each SAD may be calculated as a sample difference between a template region of a current block and template region at a search position. A template region at the search position may refer to a template region of a block that has a sample at the search position as a top-left sample.
The SAD may be calculated based on all samples belonging to a template region at a search position and a current block, or may be calculated based on some samples within a template region.
Here, some samples may refer to at least one of even-numbered sample lines or at least one of odd-numbered sample lines within a template region. In this case, a sample line may be a vertical sample line, or a horizontal sample line.
Alternatively, a template region may include at least one of a top region, a left region, a top-left region, a bottom-left region or a top-right region adjacent to a block (i.e., a current block, a block at a search position). In this case, some samples may be limited to a sample belonging to a region at a specific position within a template region. As an example, a region at a specific position may include at least one of a top region or a left region.
Alternatively, a template region may include a neighboring sample line adjacent to a block and/or at least one non-neighboring sample line. In this case, some samples may be limited to a sample belonging to a sample line at a specific position within a template region. As an example, a sample line at a specific position is pre-defined equally for an encoding apparatus and a decoding apparatus, and may include at least one of a neighboring sample line, a non-neighboring sample line 1-sample away from a boundary of a block, or a non-neighboring sample line 2-sample away from a boundary of a block. Information indicating a sample line at the specific position may be signaled through a bitstream.
A search position within the search range may be a position shifted by p in a x-axis direction and by q in a y-axis direction from a position of a reference block of a current block, and may be determined based on an offset pre-defined equally for an encoding apparatus and a decoding apparatus. It is the same as described above in ‘Bilateral Matching-based Correction Method’, and here, an overlapping description is omitted.
Through the above-described method, a SAD array may be calculated for each of a first direction and a second direction. Among a plurality of SADs belonging to a SAD array in a first direction, a SAD with the minimum value may be identified, and a delta motion vector in a first direction may be determined based on an offset corresponding to an identified SAD. Based on the determined delta motion vector in a first direction, a first motion vector according to an AMVP mode may be corrected. Likewise, among a plurality of SADs belonging to a SAD array in a second direction, a SAD with the minimum value may be identified, and a delta motion vector in a second direction may be determined based on an offset corresponding to an identified SAD. Based on the determined delta motion vector in a second direction, a second motion vector according to a merge mode may be corrected.
According to whether a current block satisfies a predetermined condition, any one of a bilateral matching-based correction method or a template matching-based correction method described above may be selectively used.
As an example, when a POC difference between a current picture including a current block and a first reference picture including a first reference block is the same as a POC difference between a current picture and a second reference picture including a second reference block, a bilateral matching-based correction method may be used, and otherwise, a template matching-based correction method may be used.
Referring to
A corrected motion vector may include a corrected first motion vector and a corrected second motion vector. A prediction block in a first direction (hereinafter, referred to as a first prediction block) may be generated based on the corrected first motion vector, and a prediction block in a second direction (hereinafter, referred to as a second prediction block) may be generated based on the corrected second motion vector. Below, a method for generating a prediction block in each direction is described in detail.
For a first prediction block in a first direction, a final first motion vector may be derived based on a corrected first motion vector and a motion vector difference (mvd). The motion vector difference may be signaled through a bitstream. A first prediction block of a current block may be generated based on a final first motion vector.
To derive a final first motion vector, at least one of a corrected first motion vector or a motion vector difference may be converted through a shift operation based on a predetermined variable (hereinafter, referred to as AmvrShift) for adaptive motion vector resolution. It may be a process of adjusting the resolution (or, precision) of a corrected first motion vector and a signaled motion vector. The final first motion vector may be derived based on the sum of the converted first motion vector and a motion vector difference.
The variable AmvrShift may be determined based on at least one of a flag regarding adaptive motion vector resolution (hereinafter, referred to as an AMVR flag) or an index regarding adaptive motion vector resolution (hereinafter, referred to as an AMVR index). Here, the AMVR flag may indicate whether adaptive motion vector resolution is applied to a current block. Alternatively, the AMVR flag may be defined as indicating whether a motion vector difference of a current block has pre-defined default resolution (e.g., a unit of a ¼ sample). The AMVR index may indicate any one of a plurality of motion vector resolution candidates that are pre-defined equally for an encoding apparatus and a decoding apparatus. The plurality of motion vector resolution candidates may include at least two of a unit of a 1/16 sample, a unit of a ⅛ sample, a unit of a ¼ sample, a unit of a ½ sample, a unit of a 1 sample or a unit of 4 samples. The maximum number of motion vector resolution candidates available for the current block may be 3, 4, 5 or 6. The AMVR flag and AMVR index may be obtained for a first direction.
As an example, the variable AmvrShift may be determined as in Table 2 below.
In Table 2, amvr_flag corresponds to a flag regarding adaptive motion vector resolution described above, and may refer to whether adaptive motion vector resolution is applied to a current block. amvr_precision_idx corresponds to an index regarding adaptive motion vector resolution described above, and may indicate any one of a plurality of pre-defined motion vector resolution candidates.
According to Table 2, when amvr_flag is 0, adaptive motion vector resolution is not applied to a current block, and a variable AmvrShift is determined to be 2. It may mean that a corrected first motion vector and a motion vector difference of a current block is converted to have default resolution (i.e., resolution in a unit of a ¼ sample).
Meanwhile, when amvr_flag is 1, adaptive motion vector resolution may be applied to a current block. In this case, a variable AmvrShift may be determined to be 3, 4 or 6 based on amvr_precision_idx.
In other words, when amvr_precision_idx is 0, a variable AmvrShift is determined to be 3, and a corrected first motion vector and a motion vector difference of a current block may be converted to have resolution in a unit of a ½ sample. By bit-shifting a corrected first motion vector and a motion vector difference of a current block by 3 to the left, a first motion vector and a motion vector difference with resolution in a unit of a ½ sample may be obtained, respectively. Likewise, when amvr_precision_idx is 1, a variable AmvrShift is determined to be 4, and a corrected first motion vector and a motion vector difference of a current block may be converted to have resolution in a unit of a 1 sample. By bit-shifting a corrected first motion vector and a motion vector difference of a current block by 4 to the left, a first motion vector and a motion vector difference with resolution in a unit of a 1 sample may be obtained, respectively. When amvr_precision_idx is 2, a variable AmvrShift is determined to be 6, and a corrected first motion vector and a motion vector difference of a current block may be converted to have resolution in a unit of 4 samples. By bit-shifting a corrected first motion vector and a motion vector difference of a current block by 6 to the left, a first motion vector and a motion vector difference with resolution in a unit of 4 samples may be obtained, respectively.
At least one of the AMVR flag or AMVR index may be signaled through a bitstream only when a predetermined condition is satisfied. Here, a predetermined condition may include at least one of conditions described later.
Based on a first flag indicating whether adaptive motion vector resolution is allowed for an image unit to which a current block belongs, the AMVR flag and/or AMVR index may be signaled through a bitstream. The image unit may refer to at least one of a sequence, a picture or a slice. The first flag may be signaled in at least one of a sequence parameter set, a picture parameter set, a picture header or a slice header of a bitstream.
As an example, when the first flag is a first value, the AMVR flag and/or AMVR index may be signaled through a bitstream, and when the first flag is a second value, the AMVR flag and/or AMVR index may not be signaled through a bitstream.
Based on whether a motion vector difference signaled for a current block is greater than a predetermined threshold value, the AMVR flag and/or AMVR index may be signaled through a bitstream. Here, a threshold value may be a value pre-defined equally for an encoding apparatus and a decoding apparatus.
As an example, when a motion vector difference signaled for a current block is greater than 0, the AMVR flag and/or AMVR index may be signaled through a bitstream, and otherwise, an AMVR flag and/or an AMVR index may not be signaled through a bitstream.
Based on whether a current block is a block encoded in a merge inter mode, the AMVR flag and/or AMVR index may be signaled through a bitstream.
As an example, when a current block is a block encoded in a merge inter mode, the AMVR flag and/or AMVR index may be signaled through a bitstream, and otherwise (e.g., when a current block is a block encoded in a merge mode), the AMVR flag and/or AMVR index may not be signaled through a bitstream.
When all of the above-described predetermined conditions are satisfied, the AMVR flag and/or AMVR index may be signaled through a bitstream, and when any one of the above-described predetermined conditions is not satisfied, the AMVR flag and/or AMVR index may not be signaled through a bitstream. Alternatively, when any one of the above-described predetermined conditions is satisfied, the AMVR flag and/or AMVR index may be signaled through a bitstream, and when all of the above-described predetermined conditions are not satisfied, the AMVR flag and/or AMVR index may not be signaled through a bitstream.
At least one of an AMVR flag or an AMVR index for the first direction may be derived from any one selected among a plurality of merge candidates belonging to the above-described merge candidate list. An AMVR flag and an AMVR index for a first direction may be configured to an AMVR flag and an AMVR index of the selected merge candidate, respectively.
As an example, a merge candidate having a second motion vector in a second direction of a current block may be selected among a plurality of merge candidates belonging to a merge candidate list, and at least one of an AMVR flag or an AMVR index for the first direction may be derived from a selected merge candidate.
Alternatively, a merge candidate encoded in an AMVP mode and/or a merge inter mode may be selected among a plurality of merge candidates belonging to a merge candidate list, and at least one of an AMVR flag or an AMVR index for the first direction may be derived from a selected merge candidate. However, there may be a plurality of merge candidates encoded in an AMVP mode and/or a merge inter mode. In this case, a merge candidate with the highest priority among a plurality of merge candidates encoded in an AMVP mode and/or a merge inter mode may be selected according to a priority pre-defined equally for an encoding apparatus and a decoding apparatus. At least one of an AMVR flag or an AMVR index for the first direction may be derived from the selected merge candidate. The priority may be in the order of a top neighboring block, a left neighboring block, a top-right neighboring block and a top-left neighboring block, or may be in the order of a left neighboring block, a top neighboring block, a top-right neighboring block and a top-left neighboring block.
Alternatively, a merge candidate at a position pre-defined equally for an encoding apparatus and a decoding apparatus may be selected among a plurality of merge candidates belonging to a merge candidate list, and at least one of an AMVR flag or an AMVR index for the first direction may be derived from a selected merge candidate. The pre-defined position may be the top or the left of a current block.
Meanwhile, for a second prediction block in a second direction, a final second motion vector may be derived based on a corrected second motion vector, and a second prediction block of a current block may be generated based on the final second motion vector.
For a second direction, at least one of an AMVR flag or an AMVR index may be derived to 0. The corrected second motion vector may not be converted through a shift operation based on the above-described variable AmvrShift. In other words, a final second motion vector may be configured to be the same as a corrected second motion vector. A corrected second motion vector in a second direction may have a different AMVR index from a corrected first motion vector in a first direction. In other words, the resolution of a motion vector in a first direction may be different from the resolution of a motion vector in a second direction.
Alternatively, at least one of an AMVR flag or an AMVR index obtained for a first direction may be shared for a second direction. The corrected second motion vector may be converted to have the resolution of a motion vector specified by at least one of an AMVR flag or an AMVR index for a first direction. Then, a second prediction block of a current block may be generated based on the converted second motion vector.
As an example, when a corrected second motion vector in a second direction obtained based on a merge mode has resolution in a unit of a 1/16 sample, but the resolution of a motion vector specified by an AMVR index is not resolution in a unit of a 1/16 sample (e.g., resolution in a unit of ½, 1 or 4 samples), a corrected second motion vector in a second direction may be converted to the resolution of a motion vector specified by an AMVR index.
At least one of an AMVR flag or an AMVR index used by a current block may be stored in a current block, which may be propagated to a block with encoding/decoding order later than a current block.
At least one of an AMVR flag or an AMVR index used by a current block may be stored for a first direction and a second direction, respectively. Alternatively, at least one of an AMVR flag or an AMVR index used by a current block may be stored only for any one of a first direction or a second direction. As an example, an AMVR flag and/or an AMVR index for a first direction may be stored, and an AMVR flag and/or an AMVR index for a second direction may not be stored. Alternatively, an AMVR flag and/or an AMVR index for a L0 direction may be stored, and an AMVR flag and/or an AMVR index for a L1 direction may not be stored.
The above-described embodiments assume that a correction step in S410 is performed, but a motion vector correction process in S410 may be omitted. In this case, a prediction block generation process in S420 may be performed based on first and second motion vectors derived in S400.
A prediction block of a current block may be generated based on at least one of the generated first prediction block or second prediction block. As an example, a prediction block of a current block may be generated through a weighted sum of a first prediction block and a second prediction block. In this case, a weight applied to a first prediction block and a weight applied to a second prediction block may be the same. Alternatively, a ratio of a weight applied to a first prediction block and a weight applied to a second prediction block may be 1:1, 2:1, 1:2, 3:1, 1:3, 5:3, 3:5, 5:−1, or −1:5. The weight for a weighted sum may be determined based on a predetermined weight index. The weight index may specify any one of a plurality of weight candidates that are pre-defined equally for an encoding apparatus and a decoding apparatus. At least one of a plurality of weight candidates may have at least one of the above-described weight ratios. The weight index may be signaled through a bitstream. Alternatively, the weight index may be implicitly derived by considering the existence/number/position of neighboring blocks encoded in an intra mode, the existence/number/position of neighboring blocks encoded in an inter mode, a type of an inter prediction mode, the number/position of neighboring blocks encoded in an AMVP mode, the number/position of neighboring blocks encoded in a merge mode, etc.
Referring to
Specifically, a motion vector deriver 500 may derive a motion vector of a current block based on a merge inter mode. Here, a motion vector of a current block includes a motion vector for bilateral prediction, i.e., a motion vector in a first direction and a motion vector in a second direction, and a motion vector in a first direction and a second direction may be derived based on a different inter prediction mode. As an example, a motion vector deriver 500 may derive a motion vector in a first direction based on an AMVP mode, and may derive a motion vector in a second direction based on a merge mode. It is the same as described by referring to
A motion vector corrector 510 may correct a motion vector of the current block based on a predetermined delta motion vector. In this case, a delta motion vector may be determined based on any one of a bilateral matching-based correction method or a template matching-based correction method. It is the same as described by referring to
According to whether a current block satisfies a predetermined condition, any one of a bilateral matching-based correction method or a template matching-based correction method described above may be selectively used. As an example, when a POC difference between a current picture including a current block and a first reference picture including a first reference block is the same as a POC difference between a current picture and a second reference picture including a second reference block, a bilateral matching-based correction method may be used, and otherwise, a template matching-based correction method may be used.
A prediction block generator 520 may generate a prediction block of a current block based on a corrected motion vector. Here, a corrected motion vector includes a corrected first motion vector and a corrected second motion vector, and a first prediction block in a first direction and a second prediction block in a second direction may be generated respectively based on corrected first and second motion vectors. A method for generating a prediction block in each direction is the same as described by referring to
Alternatively, when a motion vector of a current block is not corrected, a prediction block generator 520 may generate a prediction block of a current block by equally applying the above-described prediction block generation method based on a motion vector pre-derived according to a merge inter mode.
Referring to
A motion vector of a current block may include a motion vector for bilateral prediction, i.e., a motion vector in a first direction and a motion vector in a second direction. Here, a motion vector of a current block includes a motion vector for bilateral prediction, i.e., a motion vector in a first direction and a motion vector in a second direction, and a motion vector in a first direction and a second direction may be derived based on a different inter prediction mode.
As an example, a motion vector in a first direction may be derived based on an AMVP mode, and a motion vector in a second direction may be derived based on a merge mode.
Specifically, a motion vector in a first direction according to an AMVP mode may be derived as any one of a plurality of candidate motion vectors belonging to a motion prediction candidate list. A candidate index indicating any one of the plurality of candidate motion vectors may be encoded and inserted into a bitstream. Alternatively, any one of the plurality of candidate motion vectors may be specified based on a template matching-based cost. It is the same as described by referring to
However, when a template region is available, a motion vector in a first direction may be derived based on a template matching-based cost, and in this case, encoding of a candidate index may be omitted. On the other hand, when a template region is not available, the candidate index may be encoded.
A motion vector in a second direction according to a merge mode may be derived based on any one of a plurality of merge candidates belonging to a merge candidate list. A merge index indicating any one of the plurality of merge candidates may be encoded and inserted into a bitstream. Alternatively, any one of the plurality of merge candidates may be specified based on a bilateral matching-based cost. It is the same as described by referring to
Referring to
A delta motion vector may be used to correct a motion vector of a current block according to a merge inter mode. The delta motion vector may be determined based on any one of bilateral matching or template matching, which is the same as described by referring to
Meanwhile, according to whether a current block satisfies a predetermined condition, any one of a bilateral matching-based correction method or a template matching-based correction method may be selectively used. As an example, when a POC difference between a current picture including a current block and a first reference picture including a first reference block is the same as a POC difference between a current picture and a second reference picture including a second reference block, a bilateral matching-based correction method may be used, and otherwise, a template matching-based correction method may be used.
Referring to
A corrected motion vector may include a corrected first motion vector and a corrected second motion vector. A prediction block in a first direction (hereinafter, referred to as a first prediction block) may be generated based on the corrected first motion vector, and a prediction block in a second direction (hereinafter, referred to as a second prediction block) may be generated based on the corrected second motion vector. Below, a method for generating a prediction block in each direction is described in detail.
For a first prediction block in a first direction, an optimal motion vector may be calculated for a first direction of a current block, and a motion vector difference (mvd) may be calculated through a difference between the optimal motion vector and a corrected first motion vector. A variable AmvrShift for adaptive motion vector resolution may be determined for the motion vector difference. According to the determined variable AmvrShift, at least one of a flag regarding adaptive motion vector resolution (hereinafter, referred to as AMVR flag) or an index regarding adaptive motion vector resolution (hereinafter, referred to as AMVR index) may be encoded and inserted into a bitstream. Here, an AMVR flag may indicate whether adaptive motion vector resolution is applied to a current block. Alternatively, an AMVR flag may be defined as indicating whether a motion vector difference of a current block has pre-defined default resolution (e.g., a unit of a ¼ sample). An AMVR index may indicate any one of a plurality of motion vector resolution candidates that are pre-defined equally for an encoding apparatus and a decoding apparatus. The plurality of motion vector resolution candidates may include at least two of a unit of a 1/16 sample, a unit of a ⅛ sample, a unit of a ¼ sample, a unit of a ½ sample, a unit of a 1 sample or a unit of 4 samples. The maximum number of motion vector resolution candidates available for the current block may be 3, 4, 5 or 6.
As an example, referring to Table 2, when a variable AmvrShift is determined to be 2, amvr_flag may be encoded as 0, and amvr_precision_idx may not be encoded. When a variable AmvrShift is determined to be 3, amvr_flag may be encoded as 1, and amvr_precision_idx may be encoded as 0. When a variable AmvrShift is determined to be 4, amvr_flag may be encoded as 1, and amvr_precision_idx may be encoded as 1. When a variable AmvrShift is determined to be 6, amvr_flag may be encoded as 1, and amvr_precision_idx may be encoded as 2.
A first prediction block in a first direction may be generated based on the corrected first motion vector and a motion vector difference, which are converted to have resolution corresponding to the determined variable AmvrShift.
At least one of the AMVR flag or AMVR index is encoded only when it satisfies a predetermined condition, which may be inserted into a bitstream. As an example, at least one of the AMVR flag or AMVR index may be encoded adaptively based on at least one of a first flag indicating whether adaptive motion vector resolution is allowed for an image unit to which a current block belongs, whether a motion vector difference encoded for a current block is greater than a predetermined threshold value, or whether a current block is a block encoded in a merge inter mode. It is the same as described by referring to
Alternatively, at least one of an AMVR flag or an AMVR index for the first direction may be derived from any one selected from a plurality of merge candidates belonging to the above-described merge candidate list. A specific derivation method is the same as described by referring to
Meanwhile, for a second prediction block in a second direction, a final second motion vector may be derived based on a corrected second motion vector, and a second prediction block of a current block may be generated based on the final second motion vector.
For a second direction, at least one of an AMVR flag or an AMVR index may be derived to 0. The corrected second motion vector may not be converted through a shift operation based on the above-described variable AmvrShift. In other words, a final second motion vector may be configured to be the same as a corrected second motion vector. A corrected second motion vector in a second direction may have a different AMVR index from a corrected first motion vector in a first direction. In other words, the resolution of a motion vector in a first direction may be different from the resolution of a motion vector in a second direction.
Alternatively, at least one of an AMVR flag or an AMVR index obtained for a first direction may be shared for a second direction. The corrected second motion vector may be converted to have the resolution of a motion vector specified by at least one of an AMVR flag or an AMVR index for a first direction. Then, a second prediction block of a current block may be generated based on the converted second motion vector.
At least one of an AMVR flag or an AMVR index used by a current block may be stored in a current block, which may be propagated to a block with encoding/decoding order later than a current block. In addition, as described above, at least one of an AMVR flag or an AMVR index used by a current block may be stored for a first direction and a second direction, respectively, or may be stored only for any one of a first direction or a second direction.
The above-described embodiments assume that a correction step in S610 is performed, but a motion vector correction process in S610 may be omitted. In this case, a prediction block generation process in S620 may be performed based on first and second motion vectors derived in S600.
A prediction block of a current block may be generated based on at least one of the generated first prediction block or second prediction block. As an example, a prediction block of a current block may be generated through a weighted sum of a first prediction block and a second prediction block. In this case, a weight for a weighted sum may be any one of a plurality of weight candidates that are pre-defined equally for an encoding apparatus and a decoding apparatus. To this end, a weight index that specifies any one of the plurality of weight candidates may be encoded and inserted into a bitstream. Alternatively, the weight index may be implicitly derived by considering the existence/number/position of neighboring blocks encoded in an intra mode, the existence/number/position of neighboring blocks encoded in an inter mode, a type of an inter prediction mode, the number/position of neighboring blocks encoded in an AMVP mode, the number/position of neighboring blocks encoded in a merge mode, etc.
Referring to
Specifically, a motion vector deriver 700 may derive a motion vector of a current block based on a merge inter mode. Here, a motion vector of a current block includes a motion vector for bilateral prediction, i.e., a motion vector in a first direction and a motion vector in a second direction, and a motion vector in a first direction and a second direction may be derived based on a different inter prediction mode. As an example, a motion vector deriver 700 may derive a motion vector in a first direction based on an AMVP mode, and may derive a motion vector in a second direction based on a merge mode. It is the same as described by referring to
A motion vector corrector 710 may correct a motion vector of the current block based on a predetermined delta motion vector. In this case, a delta motion vector may be determined based on any one of a bilateral matching-based correction method or a template matching-based correction method. It is the same as described by referring to
A prediction block generator 720 may generate a prediction block of a current block based on a corrected motion vector. Here, a corrected motion vector includes a corrected first motion vector and a corrected second motion vector, and a first prediction block in a first direction and a second prediction block in a second direction may be generated respectively based on corrected first and second motion vectors. A method for generating a prediction block in each direction is the same as described by referring to
Alternatively, when a motion vector of a current block is not corrected, a prediction block generator 720 may generate a prediction block of a current block by equally applying the above-described prediction block generation method based on a motion vector pre-derived according to a merge inter mode.
In the above-described embodiment, methods are described based on a flowchart as a series of steps or blocks, but a corresponding embodiment is not limited to the order of steps, and some steps may occur simultaneously or in different order with other steps as described above. In addition, those skilled in the art may understand that steps shown in a flowchart are not exclusive, and that other steps may be included or one or more steps in a flowchart may be deleted without affecting the scope of embodiments of the present disclosure.
The above-described method according to embodiments of the present disclosure may be implemented in a form of software, and an encoding apparatus and/or a decoding apparatus according to the present disclosure may be included in a device which performs image processing such as a TV, a computer, a smartphone, a set top box, a display device, etc.
In the present disclosure, when embodiments are implemented as software, the above-described method may be implemented as a module (a process, a function, etc.) that performs the above-described function. A module may be stored in a memory and may be executed by a processor. A memory may be internal or external to a processor, and may be connected to a processor by a variety of well-known means. A processor may include an application-specific integrated circuit (ASIC), another chipset, a logic circuit and/or a data processing device. A memory may include a read-only memory (ROM), a random access memory (RAM), a flash memory, a memory card, a storage medium and/or another storage device. In other words, embodiments described herein may be performed by being implemented on a processor, a microprocessor, a controller or a chip. For example, functional units shown in each drawing may be performed by being implemented on a computer, a processor, a microprocessor, a controller or a chip. In this case, information for implementation (ex. information on instructions) or an algorithm may be stored in a digital storage medium.
In addition, a decoding apparatus and an encoding apparatus to which embodiment(s) of the present disclosure are applied may be included in a multimedia broadcasting transmission and reception device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device like a video communication, a mobile streaming device, a storage medium, a camcorder, a device for providing video on demand (VOD) service, an over the top video (OTT) device, a device for providing Internet streaming service, a three-dimensional (3D) video device, a virtual reality (VR) device, an argumente reality (AR) device, a video phone video device, a transportation terminal (ex. a vehicle (including an autonomous vehicle) terminal, an airplane terminal, a ship terminal, etc.) and a medical video device, etc., and may be used to process a video signal or a data signal. For example, an over the top video (OTT) device may include a game console, a blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.
In addition, a processing method to which embodiment(s) of the present disclosure are applied may be produced in a form of a program executed by a computer and may be stored in a computer-readable recording medium. Multimedia data having a data structure according to embodiment(s) of the present disclosure may be also stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices that store computer-readable data. The computer-readable recording medium may include, for example, a blu-ray disk (BD), an universal serial bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, a magnetic tape, a floppy disk and an optical media storage device. In addition, the computer-readable recording medium includes media implemented in a form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by an encoding method may be stored in a computer-readable recording medium or may be transmitted through a wired or wireless communication network.
In addition, embodiment(s) of the present disclosure may be implemented by a computer program product by a program code, and the program code may be executed on a computer by embodiment(s) of the present disclosure. The program code may be stored on a computer-readable carrier.
Referring to
The encoding server generates a bitstream by compressing contents input from multimedia input devices such as a smartphone, a camera, a camcorder, etc. into digital data and transmits it to the streaming server. As another example, when multimedia input devices such as a smartphone, a camera, a camcorder, etc. directly generate a bitstream, the encoding server may be omitted.
The bitstream may be generated by an encoding method or a bitstream generation method to which embodiment(s) of the present disclosure are applied, and the streaming server may temporarily store the bitstream in a process of transmitting or receiving the bitstream.
The streaming server transmits multimedia data to a user device based on a user's request through a web server, and the web server serves as a medium to inform a user of what service is available. When a user requests desired service from the web server, the web server delivers it to a streaming server, and the streaming server transmits multimedia data to a user. In this case, the contents streaming system may include a separate control server, and in this case, the control server controls a command/a response between each device in the content streaming system.
The streaming server may receive contents from a media storage and/or an encoding server. For example, when contents is received from the encoding server, the contents may be received in real time. In this case, in order to provide smooth streaming service, the streaming server may store the bitstream for a certain period of time.
An example of the user device may include a mobile phone, a smart phone, a laptop computer, a digital broadcasting terminal, a personal digital assistants (PDAs), a portable multimedia players (PMP), a navigation, a slate PC, a Tablet PC, an ultrabook, a wearable device (e.g., a smartwatch, a smart glass, a head mounted display (HMD), a digital TV, a desktop, a digital signage, etc.
Each server in the contents streaming system may be operated as a distributed server, and in this case, data received from each server may be distributed and processed.
The claims set forth herein may be combined in various ways. For example, a technical characteristic of a method claim of the present disclosure may be combined and implemented as a device, and a technical characteristic of a device claim of the present disclosure may be combined and implemented as a method. In addition, a technical characteristic of a method claim of the present disclosure and a technical characteristic of a device claim may be combined and implemented as a device, and a technical characteristic of a method claim of the present disclosure and a technical characteristic of a device claim may be combined and implemented as a method.
This application is the National Stage filing under 35 U.S.C. 371 of International Application No. PCT/KR2023/000298, filed on Jan. 6, 2023, which claims the benefit of earlier filing date and right of priority to U.S. provisional application No. 63/297,788, filed on Jan. 9, 2022, the contents of which are all incorporated by reference herein in their entireties.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/KR2023/000298 | 1/6/2023 | WO |
Number | Date | Country | |
---|---|---|---|
63297788 | Jan 2022 | US |