Image encoding / decoding method and device for performing weighted prediction, and bitstream transmission method
The image encoding/decoding method enhances efficiency by employing weighted prediction and bitstream generation, addressing the cost challenges of high-resolution image transmission and storage.
Patent Information
- Application Number
- JP2024018803
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-08-22
- Filing Date
- 2024-02-09
- Publication Date
- 2026-02-05
- Estimated Expiration
- 2040-08-20
AI Technical Summary
The increasing demand for high-resolution, high-quality images leads to a significant increase in transmission and storage costs due to the higher amount of information required, necessitating highly efficient image compression techniques.
An image encoding/decoding method and apparatus that performs weighted prediction, including Bi-prediction with CU-level weights (BCW), and generates a bitstream for efficient transmission and storage, with options for default or explicit weighted prediction based on flags and indices.
Improves encoding/decoding efficiency and enables effective transmission and storage of high-resolution images by utilizing weighted prediction and bitstream generation, reducing costs and maintaining image quality.
Smart Images

Figure 0007811601000026 
Figure 0007811601000027 
Figure 0007811601000028
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to an image encoding / decoding method, an apparatus, and a method for transmitting a bitstream, and more particularly to an image encoding / decoding method, an apparatus, and a method for transmitting a bitstream generated by the image encoding method / apparatus of the present disclosure that perform weighted prediction taking into account PROF (Prediction Refinement with Optical Flow). [Background technology]
[0002] Recently, demand for high-resolution, high-quality images, such as HD (High Definition) images and UHD (Ultra High Definition) images, has been increasing in various fields. As image data becomes higher in resolution and quality, the amount of information or bits to be transmitted increases relatively compared to conventional image data. The increase in the amount of information or bits to be transmitted results in an increase in transmission costs and storage costs.
[0003] This requires highly efficient image compression techniques for effectively transmitting, storing, and reproducing high-resolution, high-quality image information. Summary of the Invention [Problem to be solved by the invention]
[0004] An object of the present disclosure is to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.
[0005] Another object of the present disclosure is to provide an image encoding / decoding method and apparatus that performs weighted prediction.
[0006] Another object of the present disclosure is to provide an image encoding / decoding method and apparatus that performs weighted prediction or BCW (Bi-prediction with CU-level weight) taking PROF into consideration.
[0007] Another object of the present disclosure is to provide a method for transmitting a bitstream generated by the image encoding method or apparatus according to the present disclosure.
[0008] Another object of the present disclosure is to provide a recording medium storing a bitstream generated by the image encoding method or apparatus according to the present disclosure.
[0009] Another object of the present disclosure is to provide a recording medium storing a bitstream that is received by an image decoding device according to the present disclosure, decoded, and used to restore an image.
[0010] The technical problems to be solved by the present disclosure are not limited to the above-mentioned technical problems, and other technical problems not mentioned above will be clearly understood by a person having ordinary skill in the technical field to which the present disclosure pertains from the following description. [Means for solving the problem]
[0011] An image decoding method according to one aspect of the present disclosure may include the steps of: inducing a first flag indicating whether weighted prediction is to be performed on a current block and a BCW (Bi-prediction with CU-level Weight) weight index (BcwIdx) for the current block; determining whether to perform default weighted prediction or explicit weighted prediction on the current block based on the first flag and the BcwIdx; and performing the determined method to generate a predicted block for the current block.
[0012] In the image decoding method according to the present disclosure, the first flag may be determined differently based on the slice type of the current slice to which the current block belongs.
[0013] In the image decoding method according to the present disclosure, if the slice type of the current slice is a P slice, the first flag can be induced to the value of pps_weighted_pred_flag signaled in the PPS, and if the slice type of the current slice is a B slice, the first flag can be induced to the value of pps_weighted_bipred_flag signaled in the PPS.
[0014] In the image decoding method according to the present disclosure, the BcwIdx is derived based on the syntax element bcw_idx signaled via the bitstream, and if the bcw_idx is not present in the bitstream, the BcwIdx can be derived to 0.
[0015] In the image decoding method according to the present disclosure, the bcw_idx can be parsed from the bitstream based on a weighted prediction flag of a reference picture of the current block.
[0016] In the image decoding method according to the present disclosure, the bcw_idx can be parsed from the bitstream if the weighted prediction flags of the reference picture of the current block are all 0.
[0017] In the image decoding method according to the present disclosure, when the first flag is 0 or the BcwIdx is not 0, default weighted prediction can be performed on the current block.
[0018] In the image decoding method according to the present disclosure, when the first flag is 1 and the BcwIdx is 0, explicit weighted prediction can be performed on the current block.
[0019] In the image decoding method according to the present disclosure, the default weighted prediction can perform BCW or average sum based on the BcwIdx.
[0020] In the image decoding method according to the present disclosure, when the BcwIdx is 0, an average sum is performed on the current block, and when the BcwIdx is not 0, BCW can be performed on the current block.
[0021] In the image decoding method according to the present disclosure, the explicit weighted prediction can be performed based on weighting parameters (weight and offset) for the reference picture of the current block.
[0022] In the image decoding method according to the present disclosure, the weighting parameters can be explicitly signaled via the bitstream.
[0023] An image decoding device according to another aspect of the present disclosure includes a memory and at least one processor, wherein the at least one processor induces a first flag indicating whether weighted prediction is to be performed on a current block and a BCW (Bi-prediction with CU-level Weight) weight index (BcwIdx) for the current block, determines whether to perform default weighted prediction or explicit weighted prediction on the current block based on the first flag and the BcwIdx, and performs the determined method to generate a predicted block for the current block.
[0024] An image encoding method according to another aspect of the present disclosure may include the steps of determining a first flag indicating whether weighted prediction is to be performed on a current block and a weight index (BcwIdx) of BCW (Bi-prediction with CU-level Weight) for the current block, determining whether to perform default weighted prediction or explicit weighted prediction on the current block based on the first flag and the BcwIdx, and performing the determined method to generate a predicted block for the current block.
[0025] A computer-readable recording medium according to another aspect of the present disclosure can store a bitstream generated by the image encoding method or image encoding device of the present disclosure.
[0026] The features described above in this brief summary of the present disclosure are merely exemplary aspects of the detailed description of the present disclosure that follows and are not intended to limit the scope of the present disclosure. [Effects of the Invention]
[0027] According to the present disclosure, an image encoding / decoding method and apparatus with improved encoding / decoding efficiency can be provided.
[0028] Furthermore, according to the present disclosure, an image encoding / decoding method and apparatus that perform weighted prediction can be provided.
[0029] Furthermore, according to the present disclosure, an image encoding / decoding method and apparatus for performing weighted prediction or BCW in consideration of PROF can be provided.
[0030] The present disclosure also provides a method for transmitting a bitstream generated by the image encoding method or apparatus according to the present disclosure.
[0031] Furthermore, according to the present disclosure, a recording medium storing a bitstream generated by the image encoding method or apparatus according to the present disclosure can be provided.
[0032] Furthermore, according to the present disclosure, it is possible to provide a recording medium that stores a bitstream that is received by the image decoding device according to the present disclosure, decoded, and used to restore an image.
[0033] The effects obtained by the present disclosure are not limited to the effects described above, and other effects not described above will be clearly understood by those having ordinary skill in the art to which the present disclosure pertains from the following description. [Brief explanation of the drawings]
[0034] [Figure 1] 1 is a diagram illustrating a schematic diagram of a video coding system to which embodiments of the present disclosure can be applied. [Figure 2] 1 is a diagram schematically illustrating an image encoding device to which an embodiment of the present disclosure can be applied. [Figure 3] FIG. 1 is a diagram schematically illustrating an image decoding device to which an embodiment of the present disclosure can be applied. [Figure 4] 1 is a flowchart illustrating a video / image coding method based on inter prediction. [Figure 5] 10 is a diagram illustrating an example configuration of an inter prediction unit 180 according to the present disclosure. [Figure 6] 1 is a flowchart illustrating a video / image decoding method based on inter prediction. [Figure 7] FIG. 10 is a diagram illustrating an example configuration of an inter prediction unit 260 according to the present disclosure. [Figure 8] FIG. 10 is a diagram illustrating neighboring blocks used as spatial merging candidates. [Figure 9] FIG. 1 is a diagram illustrating a merge candidate list construction method according to an example of the present disclosure. [Figure 10] FIG. 10 illustrates candidate pairs for redundancy checks performed on spatial candidates. [Figure 11]FIG. 10 is a diagram illustrating a method for scaling motion vectors of temporal candidates. [Figure 12] FIG. 10 is a diagram for explaining a position to which a time candidate is guided. [Figure 13] FIG. 2 is a diagram illustrating a motion vector predictor candidate list construction method according to an example of the present disclosure. [Figure 14] FIG. 10 is a diagram for explaining a parameter model of an affine mode. [Figure 15] FIG. 10 is a diagram illustrating a method for generating an affine merge candidate list. [Figure 16] FIG. 10 is a diagram for explaining CPMV induced from surrounding blocks. [Figure 17] FIG. 10 is a diagram illustrating neighboring blocks for deriving combined affine merge candidates. [Figure 18] FIG. 10 is a diagram illustrating a method for generating an affine MVP candidate list. [Figure 19] FIG. 10 is a diagram for explaining peripheral blocks in sub-block-based TMVP mode. [Figure 20] A diagram for explaining a method of deriving a motion vector field according to a sub-block-based TMVP mode. [Figure 21] FIG. 10 is a diagram showing an expanded CU for performing BDOF. [Figure 22] FIG. 10 is a diagram showing the relationship between Δv(i,j), v(i,j) and sub-block motion vectors. [Figure 23] 10 is a flowchart illustrating an example of performing PROF, BCW, WP, and / or average sum according to the present disclosure. [Figure 24] 10 is a flowchart illustrating another example of performing PROF, BCW, WP, and / or average sum according to the present disclosure. [Figure 25] 10 is a flowchart showing an example of performing BCW or WP using the method of Table 7. [Figure 26] 10 is a flowchart showing an example of performing BCW or WP using the method of Table 8. [Figure 27] 10 is a flowchart showing an example of performing BCW or WP using the method of Table 9. [Figure 28] 10 is a flowchart showing an example of performing BCW or WP using the method of Table 10. [Figure 29] FIG. 1 illustrates a content streaming system to which an embodiment of the present disclosure can be applied. DETAILED DESCRIPTION OF THE INVENTION
[0035] The present disclosure will be described in detail below with reference to the accompanying drawings, so that those skilled in the art can easily implement the present disclosure. However, the present disclosure may be embodied in various different forms and is not limited to the embodiments described herein.
[0036] In describing the embodiments of the present disclosure, if it is determined that a detailed description of a known configuration or function may obscure the gist of the present disclosure, the detailed description thereof will be omitted. In addition, in the drawings, parts that are not related to the description of the present disclosure will be omitted, and similar parts will be designated by similar reference numerals.
[0037] In this disclosure, when a component is referred to as being "coupled," "coupled," or "connected" to another component, this includes not only a direct connection, but also an indirect connection where another component exists between them. Furthermore, when a component is referred to as "including" or "having" another component, this does not mean that the other component is excluded, but that the component can further include the other component, unless otherwise specified.
[0038] In this disclosure, terms such as "first" and "second" are used only to distinguish one component from another component, and do not limit the order or importance of the components unless otherwise specified. Therefore, within the scope of this disclosure, a first component in one embodiment may be referred to as a second component in another embodiment, and similarly, a second component in one embodiment may be referred to as a first component in another embodiment.
[0039] In this disclosure, components that are distinguished from one another are used to clearly describe the characteristics of each component and do not necessarily mean that the components are separate. In other words, multiple components may be integrated into a single hardware or software unit, or a single component may be distributed into multiple hardware or software units. Therefore, even if not otherwise specified, such integrated or distributed embodiments are also included within the scope of this disclosure.
[0040] In this disclosure, the components described in various embodiments are not necessarily essential components, and some may be optional components. Therefore, an embodiment consisting of a subset of the components described in one embodiment is also within the scope of this disclosure. Furthermore, an embodiment including other components in addition to the components described in various embodiments is also within the scope of this disclosure.
[0041] The present disclosure relates to image encoding and decoding, and terms used in this disclosure may have their ordinary meaning in the technical field to which the present disclosure belongs unless they are newly defined in this disclosure.
[0042] In this disclosure, a "picture" generally refers to a unit representing any one image in a specific time period, and a slice / tile is a coding unit constituting a part of a picture, and one picture may be composed of one or more slices / tiles. Furthermore, a slice / tile may include one or more coding tree units (CTUs).
[0043] In this disclosure, "pixel" or "pel" may refer to the smallest unit constituting one picture (or image). Also, "sample" may be used as a term corresponding to pixel. A sample may generally indicate a pixel or a pixel value, may indicate only a pixel / pixel value of a luma component, or may indicate only a pixel / pixel value of a chroma component.
[0044] In this disclosure, the term "unit" may refer to a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to that region. The term "unit" may be used interchangeably with terms such as "sample array," "block," or "area," depending on the situation. In general, an M×N block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.
[0045] In the present disclosure, a "current block" may refer to any one of a "current coding block," a "current coding unit," a "block to be coded," a "block to be decoded," or a "block to be processed." When prediction is performed, a "current block" may refer to a "current predicted block" or a "block to be predicted." When transformation (inverse transformation) / quantization (inverse quantization) is performed, a "current block" may refer to a "current transformed block" or a "block to be transformed." When filtering is performed, a "current block" may refer to a "block to be filtered."
[0046] In the present disclosure, " / " and "," can be interpreted as "and / or." For example, "A / B" and "A, B" can be interpreted as "A and / or B." Also, "A / B / C" and "A, B, C" can mean "at least one of A, B, and / or C."
[0047] In this disclosure, "or" can be interpreted as "and / or." For example, "A or B" can mean 1) only "A," 2) only "B," or 3) "A and B." Alternatively, in this disclosure, "or" can mean "additionally or alternatively."
[0048] Video Coding System Overview
[0049] FIG. 1 is a diagram illustrating a video coding system according to this disclosure.
[0050] A video coding system according to one embodiment may include an encoding device 10 and a decoding device 20. The encoding device 10 may transmit encoded video and / or image information or data to the decoding device 20 in a file or streaming format via a digital storage medium or a network.
[0051] An encoding device 10 according to an embodiment may include a video source generation unit 11, an encoding unit 12, and a transmission unit 13. A decoding device 20 according to an embodiment may include a reception unit 21, a decoding unit 22, and a rendering unit 23. The encoding unit 12 may be referred to as a video / image encoding unit, and the decoding unit 22 may be referred to as a video / image decoding unit. The transmission unit 13 may be included in the encoding unit 12. The reception unit 21 may be included in the decoding unit 22. The rendering unit 23 may include a display unit, which may be configured as a separate device or an external component.
[0052] The video source generation unit 11 can acquire video / images through a video / image capture, synthesis, or generation process. The video source generation unit 11 can include a video / image capture device and / or a video / image generation device. The video / image capture device can include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. The video / image generation device can include, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate video / images. For example, virtual video / images can be generated via a computer, etc., in which case the video / image capture process can be replaced with a process in which related data is generated.
[0053] The encoder 12 may encode the input video / image. The encoder 12 may perform a series of steps such as prediction, transformation, and quantization for compression and coding efficiency. The encoder 12 may output the encoded data (encoded video / image information) in a bitstream format.
[0054] The transmitter 13 may transmit the encoded video / image information or data output in a bitstream format to the receiver 21 of the decoding device 20 in a file or streaming format via a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray®, HDD, and SSD. The transmitter 13 may include elements for generating a media file in a predetermined file format and elements for transmitting via a broadcasting / communication network. The receiver 21 may extract / receive the bitstream from the storage medium or network and transmit it to the decoder 22.
[0055] The decoding unit 22 can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, and prediction corresponding to the operations of the encoding unit 12.
[0056] The rendering unit 23 can render the decoded video / images, and the rendered video / images can be displayed via the display unit.
[0057] Overview of the image encoding device
[0058] FIG. 2 is a diagram schematically illustrating an image encoding device to which an embodiment of the present disclosure can be applied.
[0059] 2, the image encoding device 100 may include an image division unit 110, a subtraction unit 115, a transform unit 120, a quantization unit 130, an inverse quantization unit 140, an inverse transform unit 150, an addition unit 155, a filtering unit 160, a memory 170, an inter prediction unit 180, an intra prediction unit 185, and an entropy encoding unit 190. The inter prediction unit 180 and the intra prediction unit 185 may be collectively referred to as a "prediction unit." The transform unit 120, the quantization unit 130, the inverse quantization unit 140, and the inverse transform unit 150 may be included in a residual processing unit. The residual processing unit may further include a subtraction unit 115.
[0060] Depending on the embodiment, all or at least some of the components constituting the image encoding device 100 may be realized by a single hardware component (e.g., an encoder or a processor). Also, the memory 170 may include a decoded picture buffer (DPB) and may be realized by a digital storage medium.
[0061] The image division unit 110 may divide an input image (or picture, frame) input to the image encoding device 100 into one or more processing units. As an example, the processing units may be called coding units (CUs). The coding units may be obtained by recursively dividing a coding tree unit (CTU) or a largest coding unit (LCU) using a QT / BT / TT (quad-tree / binary-tree / ternary-tree) structure. For example, one coding unit may be divided into multiple coding units at deeper depths based on a quad-tree structure, a binary-tree structure, and / or a ternary-tree structure. To divide the coding units, the quad-tree structure may be applied first, and then the binary-tree structure and / or the ternary-tree structure may be applied later. The coding procedure according to the present disclosure may be performed based on the final coding unit that is not further divided. The maximum coding unit may be used as the final coding unit, or a lower-depth coding unit obtained by dividing the maximum coding unit may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and / or reconstruction, which will be described later. As another example, a processing unit of the coding procedure may be a prediction unit (PU) or a transform unit (TU). The prediction unit and the transform unit may be divided or partitioned from the final coding unit, respectively. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0062] The prediction unit (inter prediction unit 180 or intra prediction unit 185) may perform prediction on a current block (current block) to generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block or CU. The prediction unit may generate various information related to prediction of the current block and transmit it to the entropy coding unit 190. The prediction information may be coded by the entropy coding unit 190 and output in a bitstream format.
[0063] The intra prediction unit 185 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located far away from the current block according to the intra prediction mode and / or intra prediction technique. The intra prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the granularity of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 185 may also determine the prediction mode to be applied to the current block using the prediction modes applied to neighboring blocks.
[0064] The inter prediction unit 180 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation between the motion information of neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include information on the inter prediction direction (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (colCU), etc. The reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter predictor 180 may construct 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 for the current block. Inter prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter predictor 180 may use motion information of neighboring blocks as motion information for the current block. In the case of skip mode, unlike in merge mode, a residual signal may not be transmitted.In the case of a motion vector prediction (MVP) mode, the motion vector of a neighboring block is used as a motion vector predictor, and the motion vector of the current block can be signaled by encoding a motion vector difference and an indicator for the motion vector predictor. The motion vector difference may mean the difference between the motion vector of the current block and the motion vector predictor.
[0065] The predictor may generate a prediction signal based on various prediction methods and / or prediction techniques, which will be described later. For example, the predictor may apply intra prediction or inter prediction to predict the current block, or may simultaneously apply intra prediction and inter prediction. A prediction method that simultaneously applies intra prediction and inter prediction to predict the current block may be referred to as combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) to predict the current block. Intra block copy can be used for content image / video coding, such as games, such as screen content coding (SCC). IBC is a method of predicting a current block using an already reconstructed reference block in a current picture that is located a predetermined distance away from the current block. When IBC is applied, the position of the reference block in the current picture may be coded as a vector (block vector) corresponding to the predetermined distance.
[0066] The prediction signal generated by the prediction unit may be used to generate a restored signal or a residual signal. The subtraction unit 115 may subtract the prediction signal (predicted block, predicted sample array) output from the prediction unit from the input image signal (original block, original sample array) to generate a residual signal (residual signal, residual block, residual sample array). The generated residual signal may be transmitted to the conversion unit 120.
[0067] The transform unit 120 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph representing inter-pixel relationship information. The CNT refers to a transform obtained based on a predicted signal generated using all previously reconstructed pixels. The transform process may be applied to pixel blocks having the same square size or to non-square blocks of variable size.
[0068] The quantization unit 130 may quantize the transform coefficients and transmit the quantized transform coefficients to the entropy coding unit 190. The entropy coding unit 190 may encode the quantized signal (information about the quantized transform coefficients) and output the encoded signal in a bitstream format. The information about the quantized transform coefficients may be referred to as residual information. The quantization unit 130 may rearrange the quantized transform coefficients in a block format into a one-dimensional vector format based on a coefficient scan order, and may generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector format.
[0069] The entropy coding unit 190 may perform various coding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy coding unit 190 may also code information necessary for video / image restoration (e.g., values of syntax elements) together with or separately from the quantized transform coefficients. The coded information (e.g., coded video / image information) may be transmitted or stored in a bitstream format in network abstraction layer (NAL) unit units. 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). The video / image information may also include general constraint information. The signaling information, transmitted information and / or syntax elements mentioned in this disclosure may be encoded through the above-described encoding procedure and included in the bitstream.
[0070] The bitstream may be transmitted via a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) that transmits and / or a storing unit (not shown) that stores the signal output from the entropy encoding unit 190 may be provided as an internal / external element of the image encoding device 100, or the transmitting unit may be provided as a component of the entropy encoding unit 190.
[0071] The quantized transform coefficients output from the quantization unit 130 can be used to generate a residual signal. For example, the residual signal (residual block or residual sample) can be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantization unit 140 and the inverse transform unit 150.
[0072] The adder 155 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit 180 or the intra prediction unit 185. When there is no residual for the current block to be processed, such as when a skip mode is applied, the predicted block may be used as the reconstructed block. The adder 155 may be referred to as a reconstruction unit or a reconstructed block generation unit. The generated reconstructed signal may be used for intra prediction of the next current block to be processed in the current picture, and may also be used for inter prediction of the next picture after filtering, as will be described later.
[0073] Meanwhile, as will be described later, LMCS (luma mapping with chroma scaling) can be applied during the picture encoding process.
[0074] The filtering unit 160 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 160 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture and store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc. The filtering unit 160 may generate various information related to filtering and transmit it to the entropy coding unit 190, as will be described later in connection with each filtering method. The filtering information may be coded by the entropy coding unit 190 and output in a bitstream format.
[0075] The modified reconstructed picture transmitted to the memory 170 can be used as a reference picture in the inter prediction unit 180. When inter prediction is applied through this, the image encoding device 100 can avoid a prediction mismatch between the image encoding device 100 and the image decoding device, and can also improve encoding efficiency.
[0076] The DPB in the memory 170 may store modified reconstructed pictures for use as reference pictures in the inter predictor 180. The memory 170 may store motion information of blocks from which motion information in the current picture is derived (or coded) and / or motion information of already reconstructed intra-picture blocks. The stored motion information may be transmitted to the inter predictor 180 to be used as motion information of spatially surrounding blocks or temporally surrounding blocks. The memory 170 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 185.
[0077] Overview of the image decoding device
[0078] FIG. 3 is a diagram schematically illustrating an image decoding device to which an embodiment of the present disclosure can be applied.
[0079] 3, the image decoding apparatus 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an adder 235, a filtering unit 240, a memory 250, an inter prediction unit 260, and an intra prediction unit 265. The inter prediction unit 260 and the intra prediction unit 265 may be collectively referred to as a "prediction unit." The inverse quantization unit 220 and the inverse transform unit 230 may be included in a residual processing unit.
[0080] Depending on the embodiment, all or at least some of the components constituting the image decoding device 200 may be realized by a single hardware component (e.g., a decoder or a processor). Also, the memory 170 may include a DPB and may be realized by a digital storage medium.
[0081] The image decoding device 200, which receives a bitstream including video / image information, can reconstruct an image by performing a process corresponding to the process performed by the image encoding device 100 of FIG. 1. For example, the image decoding device 200 can perform decoding using a processing unit applied in the image encoding device. Therefore, the decoding processing unit can be, for example, a coding unit. The coding unit can be obtained by dividing a coding tree unit or a maximum coding unit. The reconstructed image signal decoded and output by the image decoding device 200 can be reproduced by a reproduction device (not shown).
[0082] The image decoding apparatus 200 may receive a signal output from the image encoding apparatus of FIG. 1 in the form of a bitstream. The received signal may be decoded via an entropy decoding unit 210. For example, the entropy decoding unit 210 may parse the bitstream to derive information (e.g., video / image information) necessary for image reconstruction (or picture reconstruction). 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). The video / image information may also include general constraint information. The image decoding apparatus may further use the information on the parameter sets and / or the general constraint information to decode an image. The signaling information, received information, and / or syntax elements referred to in the present disclosure may be obtained from the bitstream by being decoded via the decoding procedure. For example, the entropy decoding unit 210 may decode information in a bitstream based on a coding method such as Exponential-Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element from the bitstream, determines a context model using information on the syntax element to be decoded and decoded information on neighboring blocks and the block to be decoded, or information on symbols / bins decoded in a previous step, predicts the occurrence probability of the bins based on the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element. After determining the context model, the CABAC entropy decoding method may update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin.Among the information decoded by the entropy decoding unit 210, information related to prediction is provided to the prediction units (inter prediction unit 260 and intra prediction unit 265), and residual values entropy decoded by the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, may be input to the inverse quantization unit 220. Also, among the information decoded by the entropy decoding unit 210, information related to filtering may be provided to the filtering unit 240. Meanwhile, a receiving unit (not shown) for receiving a signal output from the image encoding device may be further provided as an internal / external element of the image decoding device 200, or the receiving unit may be provided as a component of the entropy decoding unit 210.
[0083] Meanwhile, the image decoding apparatus according to the present disclosure may be referred to as a video / image / picture decoding apparatus. The image decoding apparatus may include an information decoder (video / image / picture information decoder) and / or a sample decoder (video / image / picture sample decoder). The information decoder may include an entropy decoding unit 210, and the sample decoder may include at least one of an inverse quantization unit 220, an inverse transform unit 230, an adder 235, a filtering unit 240, a memory 250, an inter prediction unit 260, and an intra prediction unit 265.
[0084] The inverse quantization unit 220 may inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit 220 may rearrange the quantized transform coefficients in a two-dimensional block format. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the image encoding device. The inverse quantization unit 220 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0085] The inverse transform unit 230 can inversely transform the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0086] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on information about the prediction output from the entropy decoding unit 210, and may determine a specific intra / inter prediction mode (prediction technique).
[0087] The prediction unit can generate a prediction signal based on various prediction methods (techniques) described below, as described in the description of the prediction unit of the image encoding device 100.
[0088] The intra predictor 265 may predict the current block by referring to samples in the current picture. The description of the intra predictor 185 may also be applied to the intra predictor 265.
[0089] The inter prediction unit 260 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on correlations between motion information of neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include information on an inter prediction direction (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 260 may construct a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index for the current block based on received candidate selection information. Inter prediction may be performed based on various prediction modes (techniques), and the prediction information may include information indicating the inter prediction mode (technique) for the current block.
[0090] The adder 235 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a predicted signal (predicted block, predicted sample array) output from a prediction unit (including the inter prediction unit 260 and / or the intra prediction unit 265). The description of the adder 155 may also be applied to the adder 235.
[0091] Meanwhile, as will be described later, LMCS (luma mapping with chroma scaling) can be applied during picture decoding.
[0092] The filtering unit 240 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 240 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may store the modified reconstructed picture in the memory 250, specifically, in a DPB of the memory 250. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.
[0093] The (modified) reconstructed picture stored in the DPB of the memory 250 can be used as a reference picture in the inter predictor 260. The memory 250 can store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information can be transmitted to the inter predictor 260 to be used as motion information of a spatially surrounding block or a temporally surrounding block. The memory 250 can store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 265.
[0094] In this specification, the embodiments described for the filtering unit 160, inter prediction unit 180 and intra prediction unit 185 of the image encoding device 100 can also be applied in a similar or corresponding manner to the filtering unit 240, inter prediction unit 260 and intra prediction unit 265 of the image decoding device 200, respectively.
[0095] Inter Prediction Overview
[0096] An image encoding / decoding apparatus may perform inter prediction on a block-by-block basis to derive a prediction sample. Inter prediction may refer to a prediction technique derived in a manner dependent on data elements of picture(s) other than the current picture. When inter prediction is applied to a current block, a prediction block for the current block may be derived based on a reference block identified by a motion vector on a reference picture.
[0097] In this case, to reduce the amount of motion information transmitted in the inter prediction mode, motion information of the current block may be derived based on correlations between motion information of neighboring blocks and the current block, and the motion information may be derived in units of blocks, sub-blocks, or samples. In this case, the motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction type information. Here, the inter prediction type information may represent direction information of inter prediction. The inter prediction type information may indicate that the current block is predicted using any one of L0 prediction, L1 prediction, and Bi prediction.
[0098] When inter prediction is applied to a current block, neighboring blocks of the current block may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in a reference picture. In this case, a reference picture including a reference block for the current block and a reference picture including the temporal neighboring blocks may be the same or different. The temporal neighboring blocks may be called collocated reference blocks, collocated coding units (colCUs), etc. A reference picture including the temporal neighboring blocks may be called a collocated picture (colPic).
[0099] On the other hand, a motion information candidate list can be constructed based on the surrounding blocks of the current block, and in this case, flag or index information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block can be signaled.
[0100] The motion information may include L0 motion information and / or L1 motion information based on the inter prediction type. A motion vector in the L0 direction may be defined as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be defined as an L1 motion vector or MVL1. Prediction based on the L0 motion vector may be defined as L0 prediction, prediction based on the L1 motion vector may be defined as L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be defined as bi-prediction. Here, the L0 motion vector may refer to a motion vector associated with the reference picture list L0, and the L1 motion vector may refer to a motion vector associated with the reference picture list L1.
[0101] The reference picture list L0 may include, as reference pictures, pictures that are earlier in output order than the current picture, and the reference picture list L1 may include pictures that are later in output order than the current picture. In this case, the earlier pictures may be defined as forward (reference) pictures, and the later pictures may be defined as backward (reference) pictures. Meanwhile, the reference picture list L0 may further include pictures that are later in output order than the current picture. In this case, the earlier pictures may be indexed first in the reference picture list L0, and the later pictures may be indexed next. The reference picture list L1 may further include pictures that are earlier in output order than the current picture. In this case, the later pictures may be indexed first in the reference picture list L1, and the earlier pictures may be indexed next. Here, the output order may correspond to a picture order count (POC) order.
[0102] FIG. 4 is a flow chart diagram illustrating a video / image coding method based on inter prediction.
[0103] FIG. 5 is a diagram illustrating an example configuration of the inter prediction unit 180 according to the present disclosure.
[0104] The encoding method of FIG. 4 may be performed by the image encoding apparatus of FIG. 2. Specifically, step S410 may be performed by the inter prediction unit 180, and step S420 may be performed by the residual processing unit. Specifically, step S420 may be performed by the subtraction unit 115. Step S430 may be performed by the entropy encoding unit 190. The prediction information of step S430 may be derived by the inter prediction unit 180, and the residual information of step S430 may be derived by the residual processing unit. The residual information may include information about quantized transform coefficients for the residual samples. As described above, the residual samples may be derived as transform coefficients via the transform unit 120 of the image encoding apparatus, and the transform coefficients may be derived as quantized transform coefficients via the quantization unit 130. Information about the quantized transform coefficients may be coded by the entropy encoding unit 190 through a residual coding procedure.
[0105] The image encoding apparatus may perform inter prediction on a current block (S410). The image encoding apparatus may derive an inter prediction mode and motion information of the current block and generate a prediction sample for the current block. Here, the steps of determining the inter prediction mode, deriving the motion information, and generating the prediction sample may be performed simultaneously, or one step may be performed before the other steps. For example, as shown in FIG. 5, the inter prediction unit 180 of the image encoding apparatus may include a prediction mode determination unit 181, a motion information derivation unit 182, and a prediction sample derivation unit 183. The prediction mode determination unit 181 may determine a prediction mode for the current block, the motion information derivation unit 182 may derive motion information of the current block, and the prediction sample derivation unit 183 may derive a prediction sample for the current block. For example, the inter prediction unit 180 of the image encoding apparatus may search for a block similar to the current block within a certain region (search area) of a reference picture through motion estimation and derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion. Based on this, a reference picture index indicating a reference picture in which the reference block is located can be derived, and a motion vector can be derived based on a position difference between the reference block and the current block. The image encoding apparatus can determine a mode to be applied to the current block from various prediction modes. The image encoding apparatus can compare rate-distortion (RD) costs for the various inter prediction modes to determine an optimal prediction mode for the current block. However, the method by which the image encoding apparatus determines the inter prediction mode for the current block is not limited to the above example, and various methods can be used.
[0106] For example, the inter prediction mode for the current block can be determined as at least one of merge mode, skip mode, MVP mode (Motion Vector Prediction mode), SMVD mode (Symmetric Motion Vector Difference), affine mode, subblock-based merge mode, AMVR mode (Adaptive Motion Vector Resolution mode), HMVP mode (History-based Motion Vector Predictor mode), bi-predictive merge mode (Pair-wise average merge mode), MMVD mode (Merge mode with Motion Vector Differences mode), DMVR mode (Decoder side Motion Vector Refinement mode), CIIP mode (Combined Inter and Intra Prediction mode), and GPM (Geometric Partitioning mode).
[0107] For example, when a skip mode or a merge mode is applied to a current block, the image encoding apparatus may derive merge candidates from neighboring blocks of the current block and construct a merge candidate list using the derived merge candidates. Furthermore, the image encoding apparatus may derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion among reference blocks indicated by merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to the image decoding apparatus. Motion information of the current block may be derived using motion information of the selected merge candidate.
[0108] As another example, when the MVP mode is applied to the current block, the image encoding apparatus may derive motion vector predictor (MVP) candidates from neighboring blocks of the current block and construct an MVP candidate list using the induced MVP candidates. The image encoding apparatus may also use a motion vector of an MVP candidate selected from the MVP candidates included in the MVP candidate list as the MVP of the current block. In this case, for example, a motion vector pointing to a reference block derived by the above-described motion estimation may be used as the motion vector of the current block, and an MVP candidate having a motion vector with the smallest difference from the motion vector of the current block may be the selected MVP candidate. A motion vector difference (MVD), which is a difference obtained by subtracting the MVP from the motion vector of the current block, may be derived. In this case, index information indicating the selected MVP candidate and information regarding the MVD may be signaled to the image decoding apparatus. When the MVP mode is applied, the value of the reference picture index may be configured as reference picture index information and separately signaled to the image decoding apparatus.
[0109] The image encoding apparatus may derive residual samples based on the predicted samples (S420). The image encoding apparatus may derive the residual samples by comparing the original samples of the current block with the predicted samples. For example, the residual samples may be derived by subtracting corresponding predicted samples from the original samples.
[0110] The image encoding apparatus may encode image information including prediction information and residual information (S430). The image encoding apparatus may output the encoded image information in a bitstream format. The prediction information may be information related to the prediction procedure and may include prediction mode information (e.g., a skip flag, a merge flag, or a mode index) and information about motion information. Among the prediction mode information, the skip flag is information indicating whether a skip mode is applied to a current block, and the merge flag is information indicating whether a merge mode is applied to the current block. Alternatively, the prediction mode information may be information indicating one of a plurality of prediction modes, such as a mode index. If the skip flag and the merge flag are both 0, it may be determined that the MVP mode is applied to the current block. The information about the motion information may include candidate selection information (e.g., a merge index, an MVP flag, or an MVP index) that is information for deriving a motion vector. Among the candidate selection information, the merge index may be signaled when a merge mode is applied to the current block, and may be information for selecting one of merge candidates included in a merge candidate list. Among the candidate selection information, the MVP flag or MVP index may be signaled when the MVP mode is applied to the current block, and may be information for selecting one of the MVP candidates included in the MVP candidate list. Specifically, the MVP flag may be signaled using a syntax element mvp_l0_flag or mvp_l1_flag. In addition, the information related to the motion information may include the above-mentioned information related to MVD and / or reference picture index information. In addition, the information related to the motion information may include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information related to the residual sample.The residual information may include information about quantized transform coefficients for the residual samples.
[0111] The output bitstream can be stored in a (digital) storage medium and transmitted to the image decoding device, or can be transmitted to the image decoding device via a network.
[0112] Meanwhile, as described above, the image coding apparatus can generate a reconstructed picture (a picture including reconstructed samples and reconstructed blocks) based on the reference samples and the residual samples. This is because the image coding apparatus derives the same prediction result as that performed by the image decoding apparatus, thereby improving coding efficiency. Therefore, the image coding apparatus can store the reconstructed picture (or reconstructed samples, reconstructed blocks) in a memory and use it as a picture for inter prediction. As described above, an in-loop filtering procedure can be further applied to the reconstructed picture.
[0113] FIG. 6 is a flowchart illustrating a video / image decoding method based on inter prediction.
[0114] FIG. 7 is a diagram illustrating an example configuration of the inter prediction unit 260 according to the present disclosure.
[0115] The image decoding apparatus may perform operations corresponding to those performed by the image encoding apparatus, such as performing prediction on a current block based on received prediction information and deriving predicted samples.
[0116] The decoding method of FIG. 6 may be performed by the image decoding apparatus of FIG. 3. Steps S610 to S630 may be performed by the inter prediction unit 260, and the prediction information of step S610 and the residual information of step S640 may be obtained from a bitstream by the entropy decoding unit 210. The residual processing unit of the image decoding apparatus may derive residual samples for the current block based on the residual information (S640). Specifically, the inverse quantization unit 220 of the residual processing unit may derive transform coefficients by performing inverse quantization on the quantized transform coefficients derived based on the residual information, and the inverse transform unit 230 of the residual processing unit may derive residual samples for the current block by performing inverse transform on the transform coefficients. Step S650 may be performed by the adder 235 or a reconstruction unit.
[0117] Specifically, the image decoding apparatus may determine a prediction mode for the current block based on received prediction information (S610). The image decoding apparatus may determine which inter prediction mode is applied to the current block based on prediction mode information in the prediction information.
[0118] For example, it may determine whether the skip mode is applied to the current block based on the skip flag. Also, it may determine whether the merge mode or the MVP mode is applied to the current block based on the merge flag. Or, it may select one of various inter prediction mode candidates based on the mode index. The inter prediction mode candidates may include skip mode, merge mode, and / or MVP mode, or may include various inter prediction modes described below.
[0119] The image decoding apparatus may derive motion information of the current block based on the determined inter prediction mode (S620). For example, when a skip mode or a merge mode is applied to the current block, the image decoding apparatus may construct a merge candidate list (described below) and select one of the merge candidates included in the merge candidate list. The selection may be made based on the candidate selection information (merge index) described above. The image decoding apparatus may derive motion information of the current block using motion information of the selected merge candidate. For example, the motion information of the selected merge candidate may be used as motion information of the current block.
[0120] As another example, when the MVP mode is applied to the current block, the image decoding apparatus may construct an MVP candidate list and use a motion vector of an MVP candidate selected from the MVP candidates included in the MVP candidate list as the MVP of the current block. The selection may be made based on the candidate selection information (MVP flag or MVP index). In this case, the MVD of the current block may be derived based on information about the MVD, and the motion vector of the current block may be derived based on the MVP of the current block and the MVD. Furthermore, the image decoding apparatus may derive a reference picture index of the current block based on the reference picture index information. A picture pointed to by the reference picture index in the reference picture list for the current block may be derived as a reference picture referenced for inter prediction of the current block.
[0121] The image decoding apparatus may generate prediction samples for the current block based on the motion information of the current block (S630). In this case, the reference picture may be derived based on a reference picture index of the current block, and the prediction samples of the current block may be derived using samples of a reference block pointed to in the reference picture by the motion vector of the current block. Depending on the case, a prediction sample filtering procedure may further be performed on all or some of the prediction samples of the current block.
[0122] 7, the inter prediction unit 260 of the image decoding apparatus may include a prediction mode determination unit 261, a motion information derivation unit 262, and a prediction sample derivation unit 263. The inter prediction unit 260 of the image decoding apparatus may determine a prediction mode for the current block based on prediction mode information received by the prediction mode determination unit 261, derive motion information (such as a motion vector and / or a reference picture index) of the current block based on information related to the motion information received by the motion information derivation unit 262, and derive a prediction sample of the current block by the prediction sample derivation unit 263.
[0123] The image decoding apparatus may generate residual samples for the current block based on the received residual information (S640). The image decoding apparatus may generate reconstructed samples for the current block based on the predicted samples and the residual samples, and generate a reconstructed picture based on the reconstructed samples (S650). Thereafter, an in-loop filtering procedure may be further applied to the reconstructed picture, as described above.
[0124] As described above, the inter prediction procedure may include an inter prediction mode determination step, a motion information deriving step according to the determined prediction mode, and a prediction execution step (prediction sample generation) based on the derived motion information. The inter prediction procedure may be performed in an image encoding device and an image decoding device, as described above.
[0125] The step of deriving motion information according to a prediction mode will be described in more detail below.
[0126] As described above, inter prediction can be performed using motion information of a current block. The image coding apparatus can derive optimal motion information for the current block through a motion estimation procedure. For example, the image coding apparatus can search for a similar reference block with high correlation using an original block in an original picture for the current block in a fractional pixel unit within a predetermined search range in the reference picture, thereby deriving motion information. The similarity of blocks can be calculated based on the sum of absolute differences (SAD) between the current block and the reference block. In this case, motion information can be derived based on the reference block with the smallest SAD within the search range. The derived motion information can be signaled to the image decoding apparatus in various ways based on the inter prediction mode.
[0127] When a merge mode is applied to a current block, the motion information of the current block is not directly transmitted, but is derived using the motion information of neighboring blocks. Therefore, the motion information of the current predicted block can be indicated by transmitting flag information indicating that the merge mode is used and candidate selection information (e.g., a merge index) indicating which neighboring blocks are used as merge candidates. In this disclosure, since the current block is a unit of prediction execution, the current block can be used in the same sense as a current predicted block, and the neighboring blocks can be used in the same sense as neighboring predicted blocks.
[0128] The image encoding apparatus may search for merge candidate blocks to be used to derive motion information of the current block to perform the merge mode. For example, but not limited to, up to five merge candidate blocks may be used. The maximum number of merge candidate blocks may be transmitted from a slice header or a tile group header, but is not limited to this. After finding the merge candidate blocks, the image encoding apparatus may generate a merge candidate list and select the merge candidate block with the smallest RD cost as the final merge candidate block.
[0129] The present disclosure provides various embodiments for the merge candidate blocks that make up the merge candidate list. The merge candidate list can use, for example, five merge candidate blocks. For example, four spatial merge candidates and one temporal merge candidate can be used.
[0130] FIG. 8 is a diagram illustrating neighboring blocks used as spatial merge candidates.
[0131] FIG. 9 is a diagram illustrating a method for constructing a merge candidate list according to an example of the present disclosure.
[0132] The image encoding / decoding apparatus may search for spatial neighboring blocks of the current block and insert the derived spatial merge candidates into a merge candidate list (S910). As shown in FIG. 8, the spatial neighboring blocks may include a lower-left corner neighboring block A0, a left-side neighboring block A1, a right-side neighboring block B0, an upper-right corner neighboring block B1, and an upper-left corner neighboring block B2 of the current block. However, this is merely an example, and additional neighboring blocks such as a right-side neighboring block, a lower-side neighboring block, and a lower-right neighboring block may also be used as the spatial neighboring blocks. The image encoding / decoding apparatus may search the spatial neighboring blocks based on priority to detect available blocks and derive motion information of the detected blocks as the spatial merge candidates. For example, the image encoding / decoding apparatus may search the five blocks shown in FIG. 8 in the order of A1, B1, B0, A0, and B2, and sequentially index the available candidates to construct a merge candidate list.
[0133] The image encoding / decoding apparatus may search for temporal peripheral blocks of the current block and insert derived temporal merge candidates into the merge candidate list (S920). The temporal peripheral blocks may be located on a reference picture that is a different picture from the current picture in which the current block is located. The reference picture in which the temporal peripheral blocks are located may be called a collocated picture or col picture. The temporal peripheral blocks may be searched for in the order of the lower right corner peripheral block and the lower right center block of the co-located block with respect to the current block on the col picture. Meanwhile, when motion data compression is applied to reduce memory load, specific motion information may be stored as representative motion information for each predetermined storage unit for the col picture. In this case, it is not necessary to store motion information for all blocks within the predetermined storage unit, thereby achieving the effect of motion data compression. In this case, the predetermined storage unit may be predetermined, for example, a 16x16 sample unit or an 8x8 sample unit, or size information for the predetermined storage unit may be signaled from the image encoding apparatus to the image decoding apparatus. When the motion data compression is applied, the motion information of the temporal peripheral block can be replaced with the representative motion information of the certain storage unit where the temporal peripheral block is located. In other words, in this case, from the viewpoint of implementation, the temporal merge candidate can be derived based on the motion information of the prediction block that covers the position arithmetically shifted left after arithmetically shifting a certain value based on the coordinates (upper left sample position) of the temporal peripheral block, rather than the prediction block located at the coordinates of the temporal peripheral block. For example, if the certain storage unit is 2 n ×2 nWhen it is in the sample unit, if the coordinates of the temporal neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the corrected position ((xTnb>>n)<<n), (yTnb>>n)<<n)) can be used for the temporal merge candidate. Specifically, for example, when the fixed storage unit is 16×16 sample units, if the coordinates of the temporal neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the corrected position ((xTnb>>4)<<4), (yTnb>>4)<<4)) can be used for the temporal merge candidate. Or, for example, when the fixed storage unit is 8×8 sample units, if the coordinates of the temporal neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the corrected position ((xTnb>>3)<<3), (yTnb>>3)<<3)) can be used for the temporal merge candidate.
[0134] Referring to FIG. 9 again, the image encoding device / image decoding device can check whether the number of current merge candidates is smaller than the number of maximum merge candidates (S930). The number of the maximum merge candidates can be predefined or signaled from the image encoding device to the image decoding device. For example, the image encoding device can generate information regarding the number of the maximum merge candidates, encode it, and transmit it to the image decoding device in the form of a bit stream. When all of the number of the maximum merge candidates are satisfied, the subsequent candidate addition process (S940) cannot be performed.
[0135] If it is determined in step S930 that the number of current merge candidates is less than the maximum number of merge candidates, the image encoding / decoding apparatus may derive additional merge candidates based on a predetermined scheme and insert them into the merge candidate list (S940). The additional merge candidates may include, for example, at least one of history-based merge candidate(s), pair-wise average merge candidate(s), ATMVP, combined bi-predictive merge candidate (if the slice / tile group type of the current slice / tile group is type B), and / or zero vector merge candidate.
[0136] If, as a result of the check in step S930, the number of current merge candidates is not less than the maximum number of merge candidates, the image encoding device / image decoding device may terminate construction of the merge candidate list. In this case, the image encoding device may select an optimal merge candidate from among the merge candidates constituting the merge candidate list based on the RD cost, and may signal candidate selection information (e.g., a merge candidate index) indicating the selected merge candidate to the image decoding device. The image decoding device may select the optimal merge candidate based on the merge candidate list and the candidate selection information.
[0137] As described above, the motion information of the selected merging candidate may be used as the motion information of the current block, and the predicted sample of the current block may be derived based on the motion information of the current block. The image encoding apparatus may derive residual samples of the current block based on the predicted sample and signal residual information regarding the residual sample to the image decoding apparatus. As described above, the image decoding apparatus may generate reconstructed samples based on the residual samples derived based on the residual information and the predicted sample, and generate a reconstructed picture based on the reconstructed samples.
[0138] When the skip mode is applied to the current block, the motion information of the current block can be derived in the same manner as when the merge mode is applied to the previous block. However, when the skip mode is applied, the residual signal for the current block is omitted. Therefore, the predicted samples can be used directly as reconstructed samples. The skip mode can be applied, for example, when the value of cu_skip_flag is 1.
[0139] A method for deriving spatial candidates in the merge mode and / or skip mode will be described below. The spatial candidates may indicate the spatial merge candidates described above.
[0140] Derivation of spatial candidates may be performed based on spatially neighboring blocks. For example, up to four spatial candidates may be derived from candidate blocks located at positions shown in FIG. 8. The order in which spatial candidates are derived may be A1 → B1 → B0 → A0 → B2. However, the order in which spatial candidates are derived is not limited to the above order and may be, for example, B1 → A1 → B0 → A0 → B2. The last position in the order (position B2 in the above example) may be considered when at least one of the preceding four positions (A1, B1, B0, and A0 in the above example) is unavailable. In this case, the unavailability of a block at a certain position may include the case where the block belongs to a different slice or a different tile from the current block, or the case where the block is an intra-predicted block. When a spatial candidate is derived from the first position in the order (A1 or B1 in the above example), a redundancy check may be performed on spatial candidates at subsequent positions. For example, if the motion information of a subsequent spatial candidate is identical to the motion information of a spatial candidate already included in the merge candidate list, the subsequent spatial candidate may not be included in the merge candidate list, thereby improving coding efficiency. Redundancy checks for subsequent spatial candidates may be performed only for some candidate pairs, rather than for all candidate pairs, thereby reducing computational complexity.
[0141] FIG. 10 is a diagram illustrating candidate pairs for redundancy checking performed on spatial candidates.
[0142] In the example shown in Figure 10, a redundancy check for spatial candidates at the B0 position can only be performed on spatial candidates at the A0 position. Also, a redundancy check for spatial candidates at the B1 position can only be performed on spatial candidates at the B0 position. Also, a redundancy check for spatial candidates at the A1 position can only be performed on spatial candidates at the A0 position. Finally, a redundancy check for spatial candidates at the B2 position can only be performed on spatial candidates at the A0 and B0 positions.
[0143] The example shown in Fig. 10 is an example in which the order of guiding space candidates is A0 → B0 → B1 → A1 → B2. However, the example is not limited to this, and even if the order of guiding space candidates is changed, redundancy check can be performed only on some candidate pairs, as in the example shown in Fig. 10.
[0144] In the following, a method for deriving temporal candidates in merge mode and / or skip mode will be described. The temporal candidates may indicate the temporal merge candidates described above. In addition, the motion vectors of the temporal candidates may correspond to the temporal candidates in MVP mode.
[0145] Only one temporal candidate can be included in the merge candidate list. In the process of deriving a temporal candidate, the motion vector of the temporal candidate can be scaled. For example, the scaling can be performed based on a co-located block (CU) (hereinafter referred to as a "col block") belonging to a collocated reference picture (colPic) (hereinafter referred to as a "col picture"). The reference picture list used to derive the col block can be explicitly signaled in the slice header.
[0146] FIG. 11 is a diagram for explaining a method for scaling motion vectors of temporal candidates.
[0147] In FIG. 11, curr_CU and curr_pic indicate the current block and current picture, and col_CU and col_pic indicate the col block and col picture. col_ref indicates the reference picture of the col block. tb indicates the distance between the reference picture of the current block and the current picture, and td indicates the distance between the reference picture of the col block and the col picture. tb and td may be expressed as values corresponding to the difference in POC (Picture Order Count) between pictures. Scaling of the motion vector of a temporal candidate may be performed based on tb and td. The reference picture index of a temporal candidate may be set to 0.
[0148] FIG. 12 is a diagram for explaining positions to which time candidates are guided.
[0149] In Figure 12, a block with a thick solid line indicates a current block. Temporal candidates can be derived from a block in the col picture corresponding to the C0 position (lower right position) or the C1 position (center position) in Figure 12. First, it is determined that the C0 position is available. If the C0 position is available, temporal candidates can be derived based on the C0 position. If the C0 position is not available, temporal candidates can be derived based on the C1 position. For example, if the block in the col picture at the C0 position is an intra-predicted block or exists outside the current CTU row, it can be determined that the C0 position is not available.
[0150] As described above, when motion data compression is applied, the motion vector of the Col block can be stored for each predetermined unit block. In this case, the C0 or C1 position can be modified to derive the motion vector of the block covering the C0 or C1 position. For example, if the predetermined unit block is an 8x8 block and the C0 or C1 position is (xColCi, yColCi), the position for deriving the temporal candidate can be modified to ((xColCi>>3)<<3, (yColCi>>3)<<3).
[0151] Hereinafter, a method for deriving history-based candidates in the merge mode and / or skip mode will be described. History-based candidates can be expressed as history-based merge candidates.
[0152] History-based candidates may be added to the merge candidate list after spatial and temporal candidates are added to the merge candidate list. For example, motion information of a previously encoded / decoded block is stored in a table and can be used as a history-based candidate for the current block. The table may store multiple history-based candidates during the encoding / decoding process. The table may be initialized when a new CTU row begins. Initializing the table may mean that all history-based candidates stored in the table are deleted and the table becomes empty. For each inter-predicted block, associated motion information may be added to the table as the last entry. In this case, the inter-predicted block may not be a block predicted based on a sub-block. The motion information added to the table may be used as a new history-based candidate.
[0153] The history-based candidate table can have a predetermined size. For example, the size can be 5. In this case, the table can store up to five history-based candidates. When a new candidate is added to the table, a limited first-in-first-out (FIFO) rule can be applied, in which a redundancy check is first performed to determine whether the same candidate already exists in the table. If the same candidate already exists in the table, the same candidate is deleted from the table, and the positions of all subsequent history-based candidates can be moved forward.
[0154] History-based candidates can be used in the process of constructing a merge candidate list. In this case, the history-based candidates most recently included in the table are checked sequentially and can be included in the merge candidate list at a position after the temporal candidate. When a history-based candidate is included in the merge candidate list, a redundancy check with spatial or temporal candidates already included in the merge candidate list can be performed. If a history-based candidate overlaps with a spatial or temporal candidate already included in the merge candidate list, the history-based candidate can be excluded from the merge candidate list. The redundancy check can be simplified as follows to reduce the amount of calculation.
[0155] The number of history-based candidates used to generate the merge candidate list can be set to (N<=4)?M:(8-N), where N represents the number of candidates already included in the merge candidate list and M represents the number of available history-based candidates stored in the table. That is, if the merge candidate list contains four or fewer candidates, the number of history-based candidates used to generate the merge candidate list is M. If the merge candidate list contains N candidates (more than four), the number of history-based candidates used to generate the merge candidate list can be set to (8-N).
[0156] When the total number of available merge candidates reaches (maximum allowed number of merge candidates - 1), construction of the merge candidate list using history-based candidates can be terminated.
[0157] Hereinafter, a method for deriving pair-wise average candidates in the merge mode and / or skip mode will be described. The pair-wise average candidates can be expressed as pair-wise average merge candidates or pair-wise candidates.
[0158] Pair-wise average candidates can be generated by obtaining predefined candidate pairs from candidates included in the merge candidate list and averaging them. The predefined candidate pairs are {(0,1), (0,2), (1,2), (0,3), (1,3), (2,3)}, and the numbers constituting each candidate pair may be indices in the merge candidate list. That is, the predefined candidate pair (0,1) refers to a pair of candidate index 0 and candidate index 1 in the merge candidate list, and the pair-wise average candidate can be generated by averaging candidate index 0 and candidate index 1. Pair-wise average candidates can be derived in the order of the predefined candidate pairs. That is, after deriving a pair-wise average candidate for candidate pair (0,1), a pair-wise average candidate derivation process can be performed in the order of candidate pair (0,2) and candidate pair (1,2). The pair-wise average candidate derivation process can be performed until the construction of the merge candidate list is completed. For example, the pair-wise average candidate derivation process may be performed until the number of merge candidates included in the merge candidate list reaches the maximum number of merge candidates.
[0159] Pair-wise average candidates can be calculated separately for each reference picture list. If two motion vectors are available for one reference picture list (L0 list or L1 list), the average of these two motion vectors can be calculated. In this case, the average of the two motion vectors can be calculated even if the two motion vectors point to different reference pictures. If only one motion vector is available for one reference picture list, the available motion vector can be used as the motion vector for the pair-wise average candidate. If not all two motion vectors are available for one reference picture list, the reference picture list can be determined to be invalid.
[0160] If the construction of the merge candidate list is not complete even after the pair-wise average candidate is included in the merge candidate list, zero vectors can be added to the merge candidate list until the maximum number of merge candidates is reached.
[0161] When the MVP mode is applied to the current block, a motion vector predictor (MVP) candidate list can be generated using the motion vectors of reconstructed spatial surrounding blocks (e.g., surrounding blocks shown in FIG. 8) and / or motion vectors corresponding to temporal surrounding blocks (or Col blocks). That is, the motion vectors of reconstructed spatial surrounding blocks and / or motion vectors corresponding to temporal surrounding blocks can be used as motion vector predictor candidates for the current block. When bi-prediction is applied, an MVP candidate list for deriving L0 motion information and an MVP candidate list for deriving L1 motion information can be generated and used separately. Prediction information (or prediction information) for the current block may include candidate selection information (e.g., an MVP flag or an MVP index) indicating an optimal motion vector predictor candidate selected from the motion vector predictor candidates included in the MVP candidate list. In this case, the prediction unit can select a motion vector predictor for the current block from the motion vector predictor candidates included in the MVP candidate list using the candidate selection information. A prediction unit of an image encoding device can obtain a motion vector differential (MVD) between a motion vector of a current block and a motion vector predictor, encode the obtained MVD, and output the MVD in a bitstream format. That is, the MVD can be obtained by subtracting the motion vector predictor from the motion vector of the current block. A prediction unit of an image decoding device can obtain a motion vector differential included in information related to the prediction, and derive the motion vector of the current block by adding the motion vector differential and the motion vector predictor. The prediction unit of an image decoding device can obtain or derive a reference picture index, etc., indicating a reference picture, from information related to the prediction.
[0162] FIG. 13 is a diagram illustrating a motion vector predictor candidate list construction method according to an example of the present disclosure.
[0163] First, spatial candidate blocks for the current block are searched for and available candidate blocks are inserted into the MVP candidate list (S1010). Then, it is determined whether the MVP candidate list contains less than two MVP candidates (S1020). If there are two, the construction of the MVP candidate list can be completed.
[0164] In step S1020, if there are less than two spatial candidate blocks available, the temporal candidate blocks of the current block can be searched for and the available candidate blocks can be inserted into the MVP candidate list (S1030). If no temporal candidate blocks are available, the construction of the MVP candidate list can be completed by inserting a zero motion vector into the MVP candidate list (S1040).
[0165] On the other hand, when the MVP mode is applied, the reference picture index may be explicitly signaled. In this case, a picture index (refidxL0) for L0 prediction and a reference picture index (refidxL1) for L1 prediction may be separately signaled. For example, when the MVP mode is applied and bi-prediction (BI prediction) is applied, information about refidxL0 and information about refidxL1 may both be signaled.
[0166] As described above, when the MVP mode is applied, information about the MVD derived from the image coding apparatus can be signaled to the image decoding apparatus. The information about the MVD can include, for example, information indicating x and y components of the MVD absolute value and sign. In this case, information indicating whether the MVD absolute value is greater than 0, whether it is greater than 1, and the rest of the MVD can be signaled in stages. For example, information indicating whether the MVD absolute value is greater than 1 can be signaled only when the value of flag information indicating whether the MVD absolute value is greater than 0 is 1.
[0167] Affine mode overview
[0168] Affine mode, an example of an inter prediction mode, will now be described in detail. Conventional video encoding / decoding systems use only one motion vector to represent motion information of a current block. However, this method only represents optimal motion information in block units, and is unable to represent optimal motion information in pixel units. To address this issue, affine mode has been proposed, which defines motion information of a block in pixel units. According to the affine mode, a motion vector for each pixel / sub-block of a block can be determined using two to four motion vectors associated with the current block.
[0169] While conventional motion information is expressed using the translation (or displacement) of pixel values, the affine mode can express pixel-specific motion information using at least one of translation, scaling, rotation, and shear. Among these, an affine mode in which pixel-specific motion information is expressed using displacement, scaling, or rotation can be defined as a similarity or simplified affine mode. In the following description, the affine mode can refer to the similarity or simplified affine mode.
[0170] Motion information in affine mode can be expressed using two or more Control Point Motion Vectors (CPMVs). A motion vector for a specific pixel position of the current block can be derived using the CPMV. In this case, a set of pixel-specific and / or sub-block-specific motion vectors of the current block can be defined as an Affine Motion Vector Field (Affine MVF).
[0171] FIG. 14 is a diagram for explaining a parameter model of the affine mode.
[0172] When an affine mode is applied to a current block, an affine MVF can be derived using either a 4-parameter model or a 6-parameter model. In this case, the 4-parameter model refers to a model type in which two CPMVs are used, and the 6-parameter model refers to a model type in which three CPMVs are used. Figures 14(a) and 14(b) are diagrams illustrating CPMVs used in the 4-parameter model and the 6-parameter model, respectively.
[0173] When the position of the current block is defined as (x, y), a motion vector according to a pixel position can be derived according to the following Equation 1 or 2. For example, a motion vector according to a 4-parameter model can be derived according to Equation 1, and a motion vector according to a 6-parameter model can be derived according to Equation 2.
[0174]
number
[0175]
number
[0176] In Equation 1 and Equation 2, mv0={mv_0x, mv_0y} may be a CPMV at the upper left corner of the current block, v1={mv_1x, mv_1y} may be a CPMV at the upper right corner of the current block, and mv2={mv_2} may be a CPMV at the lower left corner of the current block, where W and H correspond to the width and height of the current block, respectively, and mv={mv_x, mv_y} may represent a motion vector at pixel position {x, y}.
[0177] During the encoding / decoding process, the affine MVF may be determined in pixel units and / or in predefined sub-block units. When the affine MVF is determined in pixel units, a motion vector may be derived based on each pixel value. On the other hand, when the affine MVF is determined in sub-block units, a motion vector for the sub-block may be derived based on the central pixel value of the sub-block. The central pixel value may refer to a virtual pixel located at the center of the sub-block, or the pixel located at the bottom right of the four central pixels. Alternatively, the central pixel value may be a specific pixel within the sub-block that represents the sub-block. In this disclosure, the affine MVF will be described as being determined in 4x4 sub-block units. However, this is for convenience of explanation, and the size of the sub-block may be variously changed.
[0178] That is, when affine prediction is available, motion models applicable to the current block can include three: a translational motion model, a 4-parameter affine motion model, and a 6-parameter affine motion model. Here, the translational motion model can refer to a model in which a conventional block-based motion vector is used, the 4-parameter affine motion model can refer to a model in which two CPMVs are used, and the 6-parameter affine motion model can refer to a model in which three CPMVs are used. The affine mode can be divided into detailed modes depending on the method of encoding / decoding motion information. For example, the affine mode can be further subdivided into an affine MVP mode and an affine merge mode.
[0179] When the affine merge mode is applied to the current block, the CPMV can be derived from the neighboring blocks of the current block that are encoded / decoded in the affine mode. When at least one of the neighboring blocks of the current block is encoded / decoded in the affine mode, the affine merge mode can be applied to the current block. That is, when the affine merge mode is applied to the current block, the CPMV of the current block can be derived using the CPMV of the neighboring blocks. For example, the CPMV of the neighboring blocks can be determined as the CPMV of the current block, or the CPMV of the current block can be derived based on the CPMV of the neighboring blocks. When the CPMV of the current block is derived based on the CPMV of the neighboring blocks, at least one of the coding parameters of the current block or the neighboring blocks can be used. For example, the CPMV of the neighboring blocks can be modified based on the size of the neighboring blocks and the size of the current block, and then used as the CPMV of the current block.
[0180] Meanwhile, in the case of affine merge in which MVs are derived on a subblock basis, this may be referred to as subblock merging mode, which may be indicated by merge_subblock_flag having a first value (e.g., “1”). In this case, an affine merging candidate list (described later) may also be referred to as a subblock merging candidate list. In this case, the subblock merging candidate list may further include candidates derived by SbTMVP (described later). In this case, the candidate derived by sbTMVP may be used as the candidate with the zeroth index in the subblock merging candidate list. In other words, the candidate derived by sbTMVP may be positioned before inherited affine candidates and constructed affine candidates (described later) in the subblock merging candidate list.
[0181] As an example, an affine mode flag can be defined to indicate whether affine mode is applicable to the current block, which can be signaled at at least one level above the current block, such as a sequence, picture, slice, tile, tile group, brick, etc. For example, the affine mode flag can be named sps_affine_enabled_flag.
[0182] When the affine merge mode is applied, an affine merge candidate list can be constructed for CPMV derivation of the current block. The affine merge candidate list can include at least one of inherited affine merge candidates, combined affine merge candidates, and zero merge candidates. The inherited affine merge candidate can refer to a candidate derived using the CPMV of a neighboring block of the current block when the neighboring block is encoded / decoded in affine mode. The combined affine merge candidate can refer to a candidate whose CPMV is derived based on the motion vector of the neighboring block of each control point (CP). Meanwhile, the zero merge candidate can refer to a candidate whose CPMV is zero-sized. In the following description, a CP can refer to a specific position of a block used to derive a CPMV. For example, a CP can be the position of each vertex of a block.
[0183] FIG. 15 is a diagram for explaining a method for generating an affine merge candidate list.
[0184] Referring to the flowchart in Figure 15, affine merge candidates can be added to the affine merge candidate list in the following order: inheritance affine merge candidate (S1210), combined affine merge candidate (S1220), and zero merge candidate (S1230). Zero merge candidates can be added when the number of candidates in the candidate list does not reach the maximum number of candidates, even after all inheritance affine merge candidates and combined affine merge candidates have been added to the affine merge candidate list. In this case, zero merge candidates can be added until the number of candidates in the affine merge candidate list reaches the maximum number of candidates.
[0185] FIG. 16 is a diagram for explaining CPMV induced from surrounding blocks.
[0186] As an example, up to two inherited affine merge candidates can be derived, and each candidate can be derived based on at least one of the left neighboring block and the upper neighboring block. Neighboring blocks for deriving inherited affine merge candidates will be described with reference to FIG. 8. The inherited affine merge candidate derived based on the left neighboring block can be derived based on at least one of A0 and A1, and the inherited affine merge candidate derived based on the upper neighboring block can be derived based on at least one of B0, B1, and B2. In this case, the scan order of each neighboring block can be, but is not limited to, A0 to A1 and B0 to B1 to B2. The inherited affine merge candidate can be derived based on the first neighboring block available in the scan order for the left and upper sides, respectively. In this case, redundancy checking may not be performed between the candidates derived from the left neighboring block and the upper neighboring block.
[0187] For example, as shown in FIG. 16, if the left neighboring block A is coded / decoded in the affine mode, at least one of motion vectors v2, v3, and v4 corresponding to the CP of neighboring block A can be derived. If neighboring block A is coded / decoded using a 4-parameter affine model, the inherited affine merge candidate can be derived using v2 and v3. On the other hand, if neighboring block A is coded / decoded using a 6-parameter affine model, the inherited affine merge candidate can be derived using v2, v3, and v4.
[0188] FIG. 17 is a diagram for explaining surrounding blocks for deriving combined affine merge candidates.
[0189] A combined affine candidate may refer to a candidate whose CPMV is derived using a combination of general motion information of neighboring blocks. Motion information for each CP may be derived using spatial or temporal neighboring blocks of the current block. In the following description, CPMVk may refer to the motion vector representing the kth CP. For example, referring to FIG. 17, CPMV1 may be determined as the first available motion vector among the motion vectors B2, B3, and A2, and the scan order may be B2, B3, and A2. CPMV2 may be determined as the first available motion vector among the motion vectors B1 and B0, and the scan order may be B1, B0. CPMV3 may be determined as the first available motion vector among the motion vectors A1 and A0, and the scan order may be A1, A0. If TMVP is applicable to the current block, CPMV4 may be determined as the motion vector of T, a temporal neighboring block.
[0190] After four motion vectors for each CP are derived, a combined affine merge candidate can be derived based on the four motion vectors. The combined affine merge candidate can include at least two motion vectors selected from the four derived motion vectors for each CP. For example, the combined affine merge candidate can be configured in the following order: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, and {CPMV1, CPMV3}. A combined affine candidate consisting of three motion vectors can be a candidate for a six-parameter affine model. In contrast, a combined affine candidate consisting of two motion vectors can be a candidate for a four-parameter affine model. To avoid a motion vector scaling process, if the reference picture indexes of the CPs are different, the associated CPMV combinations can be ignored and not used in deriving the combined affine candidate.
[0191] When the affine MVP mode is applied to the current block, the image coding apparatus can derive two or more CPMV predictors and CPMV for the current block and derive CPMV differences based on the CPMV predictors and CPMV differences. In this case, the CPMV differences can be signaled from the coding apparatus to the decoding apparatus. The image decoding apparatus can derive CPMV predictors for the current block, restore the signaled CPMV differences, and then derive CPMV for the current block based on the CPMV predictors and CPMV differences.
[0192] Meanwhile, the affine MVP mode can be applied to the current block only if the affine merge mode or sub-block-based TMVP mode is not applied to the current block. Meanwhile, the affine MVP mode can also be expressed as the affine CP MVP mode.
[0193] When affine MVP is applied to the current block, an affine MVP candidate list can be constructed for guiding CPMV for the current block, where the affine MVP candidate list can include at least one of inheritance affine MVP candidates, combination affine MVP candidates, translation affine MVP candidates, and zero MVP candidates.
[0194] In this case, the inherited affine MVP candidate may refer to a candidate derived based on the CPMV of a neighboring block when the neighboring block of the current block is encoded / decoded in affine mode. The combined affine MVP candidate may refer to a candidate derived by generating a CPMV combination based on the motion vector of the CP neighboring block. The zero MVP candidate may refer to a candidate consisting of a CPMV value of 0. The methods and features of deriving the inherited affine MVP candidate and the combined affine MVP candidate are the same as those of the inherited affine candidate and the combined affine candidate described above, and therefore will not be described here.
[0195] If the maximum number of candidates in the affine MVP candidate list is 2, combined affine MVP candidates, translation affine MVP candidates, and zero MVP candidates can be added if the current number of candidates is less than 2. In particular, translation affine MVP candidates can be derived according to the following order:
[0196] As an example, if the number of candidates included in the affine MVP candidate list is less than two and the combined affine MVP candidate CPMV0 is valid, CPMV0 can be used as the affine MVP candidate. That is, an affine MVP candidate whose motion vectors for CP0, CP1, and CP2 are all CPMV0 can be added to the affine MVP candidate list.
[0197] Next, if the number of candidates in the affine MVP candidate list is less than two and the combined affine MVP candidate CPMV1 is valid, CPMV1 can be used as the affine MVP candidate. That is, an affine MVP candidate whose motion vectors for CP0, CP1, and CP2 are all CPMV1 can be added to the affine MVP candidate list.
[0198] Next, if the number of candidates in the affine MVP candidate list is less than two and the combined affine MVP candidate CPMV2 is valid, CPMV2 can be used as the affine MVP candidate. That is, an affine MVP candidate whose motion vectors CP0, CP1, and CP2 are all CPMV2 can be added to the affine MVP candidate list.
[0199] Despite the above conditions, if the number of candidates in the affine MVP candidate list is less than two, the TMVP (temporal motion vector predictor) of the current block can be added to the affine MVP candidate list.
[0200] If the number of candidates in the affine MVP candidate list is less than two despite the addition of the translation affine MVP candidate, a zero MVP candidate can be added to the affine MVP candidate list.
[0201] FIG. 18 is a diagram for explaining a method for generating an affine MVP candidate list.
[0202] 18, candidates can be added to the affine MVP candidate list in the following order: inheritance affine MVP candidate (S1610), combination affine MVP candidate (S1620), translation affine MVP candidate (S1630), and zero MVP candidate (S1640). As described above, steps S1620 to S1640 can be performed depending on whether the number of candidates included in the affine MVP candidate list at each step is less than two.
[0203] The scan order of inherited affine MVP candidates may be the same as the scan order of inherited affine merge candidates. However, for inherited affine MVP candidates, only neighboring blocks that reference the same reference picture as the current block's reference picture can be considered. When adding an inherited affine MVP candidate to the affine MVP candidate list, redundancy checks may not be performed.
[0204] To derive a combined affine MVP candidate, only the spatially neighboring blocks shown in Figure 17 can be considered. The scan order of the combined affine MVP candidate can be the same as the scan order of the combined affine merge candidate. To derive a combined affine MVP candidate, the reference picture indexes of the neighboring blocks are checked, and the first neighboring block in the scan order that is inter-coded and references the same reference picture as the current block's reference picture can be used.
[0205] Overview of Subblock-based TMVP (SbTMVP) mode
[0206] Hereinafter, a sub-block-based TMVP mode, which is an example of an inter prediction mode, will be described in detail. In the sub-block-based TMVP mode, a motion vector field (MVF) for a current block is derived, so that a motion vector can be derived in units of sub-blocks.
[0207] Unlike the conventional TMVP mode, which is performed on a coding unit basis, a coding unit to which the sub-block-based TMVP mode is applied can encode / decode motion vectors on a sub-coding unit basis. Furthermore, while the conventional TMVP mode derives temporal motion vectors from collocated blocks, the sub-block-based TMVP mode derives motion vector fields from reference blocks indicated by motion vectors derived from neighboring blocks of the current block. Hereinafter, the motion vector derived from the neighboring blocks may be referred to as the motion shift or representative motion vector of the current block.
[0208] FIG. 19 is a diagram for explaining peripheral blocks in the sub-block-based TMVP mode.
[0209] When the sub-block-based TMVP mode is applied to the current block, neighboring blocks for determining the motion shift can be determined. As an example, scanning of neighboring blocks for determining the motion shift can be performed in the order of A1, B1, B0, and A0 blocks in FIG. 19. As another example, neighboring blocks for determining the motion shift can be limited to specific neighboring blocks of the current block. For example, the neighboring block for determining the motion shift can always be determined as block A1. If a neighboring block has a motion vector that references a col picture, the motion vector can be determined as the motion shift. The motion vector determined as the motion shift can also be referred to as a temporal motion vector. On the other hand, if the above motion vector cannot be derived from a neighboring block, the motion shift can be set to (0,0).
[0210] FIG. 20 is a diagram for explaining a method for deriving a motion vector field according to the sub-block-based TMVP mode.
[0211] Next, a reference block in the co-located picture indicated by the motion shift can be determined. For example, by adding the motion shift to the coordinates of the current block, sub-block-based motion information (motion vector, reference picture index) can be obtained from the col picture. In the example shown in FIG. 20, the motion shift is assumed to be the motion vector of block A1. By applying the motion shift to the current block, sub-blocks (col sub-blocks) in the col picture corresponding to each sub-block constituting the current block can be identified. Then, motion information for each sub-block of the current block can be derived using motion information of the corresponding sub-block (col sub-block) in the col picture. For example, motion information for the corresponding sub-block can be obtained from the center position of the corresponding sub-block. In this case, the center position may be the position of the bottom right sample among the four samples located in the center of the corresponding sub-block. If motion information for a specific sub-block of the col block corresponding to the current block is not available, motion information for the central sub-block of the col block can be determined as the motion information for that sub-block. Once the motion information for the corresponding sub-block is derived, the motion vector and reference picture index for the current sub-block can be switched, similar to the TMVP process described above. That is, when a sub-block-based motion vector is derived, the motion vector can be scaled taking into account the POC of the reference picture of the reference block.
[0212] As described above, sub-block-based TMVP candidates for the current block can be derived using the motion vector field or motion information of the current block derived based on the sub-blocks.
[0213] Hereinafter, a merge candidate list configured in subblock units is defined as a subblock-based merge candidate list. The above-mentioned affine merge candidates and subblock-based TMVP candidates can be merged to form a subblock-based merge candidate list.
[0214] Meanwhile, a sub-block-based TMVP mode flag can be defined to indicate whether sub-block-based TMVP mode is applicable to the current block. This can be signaled at at least one level above the current block, such as sequence, picture, slice, tile, tile group, or brick. For example, the sub-block-based TMVP mode flag can be named sps_sbtmvp_enabled_flag. If sub-block-based TMVP mode is applicable to the current block, sub-block-based TMVP candidates can be added first to the sub-block-based merge candidate list. Then, affine merge candidates can be added to the sub-block-based merge candidate list. Meanwhile, the maximum number of candidates that can be included in the sub-block-based merge candidate list can be signaled. For example, the maximum number of candidates that can be included in the sub-block-based merge candidate list can be 5.
[0215] The size of the sub-blocks used to derive the sub-block-wise merge candidate list can be signaled or can be pre-set to M×N. For example, M×N can be 8×8. Therefore, affine mode or sub-block-based TMVP mode can be applied to the current block only if the size of the current block is 8×8 or larger.
[0216] An example of a predictive execution method according to the present disclosure will be described below. The predictive execution method described below can be performed in step S410 of FIG. 4 or step S630 of FIG.
[0217] A predicted block for the current block may be generated based on motion information derived according to a prediction mode. The predicted block (prediction block) may include prediction samples (prediction sample array) of the current block. If the motion vector of the current block points to a fractional sample unit, an interpolation procedure may be performed, thereby deriving prediction samples of the current block based on reference samples in fractional sample units within a reference picture. If affine inter-prediction is applied to the current block, prediction samples may be generated based on sample / sub-block unit MVs. If bi-prediction is applied, prediction samples derived by a weighted sum or weighted average (by phase) of prediction samples derived based on L0 prediction (i.e., prediction using a reference picture in reference picture list L0 and MVL0) and prediction samples derived based on L1 prediction (i.e., prediction using a reference picture in reference picture list L1 and MVL1) may be used as prediction samples of the current block. When bi-prediction is applied, if the reference picture used for L0 prediction and the reference picture used for L1 prediction are located in different time directions relative to the current picture (i.e., if it is bi-predictive but corresponds to bidirectional prediction), this can be called true bi-prediction.
[0218] In the image decoding device, reconstructed samples and reconstructed pictures can be generated based on the derived predicted samples, and then procedures such as in-loop filtering can be performed. Also, in the image coding device, residual samples can be derived based on the derived predicted samples, and image information including prediction information and residual information can be coded.
[0219] Bi-prediction with CU-level weight (BCW)
[0220] As described above, when bi-prediction is applied to the current block, a predicted sample may be derived based on a weighted average. Conventionally, a bi-predictive signal (i.e., a bi-predictive sample) may be derived through a simple average of an L0 predicted signal (L0 predicted sample) and an L1 predicted signal (L1 predicted sample). That is, a bi-predictive sample is derived by averaging an L0 predicted sample based on an L0 reference picture and MVL0 and an L1 predicted sample based on an L1 reference picture and MVL1. However, according to the present disclosure, when bi-prediction is applied, a bi-predictive signal (bi-predictive sample) may be derived through a weighted average of an L0 predicted signal and an L1 predicted signal as follows:
[0221]
number
[0222] In the above formula 3, P bi-pred denotes the bi-predictive signal (bi-predictive block) derived by weighted averaging, P0 and P1 denote the L0 predicted sample (L0 predicted block) and the L1 predicted sample (L1 predicted block), respectively, and (8-w) and w denote the weights applied to P0 and P1, respectively.
[0223] In generating a bi-predictive signal using weighted averaging, five weights are allowed. For example, the weight w can be selected from {-2, 3, 4, 5, 10}. For each bi-predicted CU, the weight w can be determined in one of two ways. In the first of these two ways, if the current CU is not in merge mode (non-merge CU), a weight index can be signaled along with the motion vector differential. For example, the bitstream can include information about the weight index after information about the motion vector differential. In the second of these two ways, if the current CU is in merge mode (merge CU), the weight index can be derived from neighboring blocks based on merge candidate indexes (merge indexes).
[0224] Generation of a bi-predictive signal using weighted averaging may be limited to be applied only to CUs having a size including 256 or more samples (luma component samples). That is, weighted averaging bi-prediction may be performed only on CUs whose current block width and height product is 256 or more. Furthermore, the weight w may be one of the five weights described above, or one of a different number of weights. For example, five weights may be used for a low-delay picture and three weights may be used for a non-low-delay picture depending on the characteristics of the current picture. In this case, the three weights may be {3, 4, 5}.
[0225] The image encoding apparatus can determine the weight indexes without significantly increasing complexity by applying a fast search algorithm. In this case, the fast search algorithm can be summarized as follows: Hereinafter, unequal weights may mean that weights applied to P0 and P1 are not equal. Also, equal weights may mean that weights applied to P0 and P1 are equal.
[0226] -When the AMVR mode, in which the motion vector resolution is adaptively changed, is applied together, if the current picture is a low-delay picture, only unequal weights can be conditionally checked for each of the 1-pel motion vector resolution and the 4-pel motion vector resolution.
[0227] If affine modes are applied together and an affine mode is selected as the optimal mode for the current block, the image coding apparatus can perform affine motion estimation (ME) for each of the unequal weights.
[0228] If the two reference pictures used for bi-prediction are identical, only unequal weights can be conditionally checked.
[0229] The unequal weights may not be checked if a predetermined condition is met, which may be based on the POC distance between the current picture and the reference picture, the quantization parameter (QP), the temporal level, etc.
[0230] The weight index of the BCW can be coded using one context coding bin followed by one or more bypass coded bins. The first context coding bin indicates whether equal weights are used. If unequal weights are used, additional bins can be bypass coded and signaled. The additional bins can be signaled to indicate which weights are used.
[0231] Weighted prediction (WP) is a tool for efficiently coding images that include fading. According to weighted prediction, weighting parameters (weight and offset) can be signaled for each reference picture included in each of the reference picture lists L0 and L1. Then, when motion compensation is performed, the weight(s) and offset(s) can be applied to the corresponding reference picture(s). Weighted prediction and BCW can be used for different types of images. To avoid interactions between weighted prediction and BCW, the BCW weight index can not be signaled for a CU that uses weighted prediction. In this case, the weight can be inferred to be 4, i.e., equal weighting can be applied.
[0232] For a CU with merge mode applied, the weight index can be inferred from neighboring blocks based on the merge candidate index, which is applicable for both normal merge mode and inherited affine merge mode.
[0233] In the combined affine merge mode, affine motion information can be configured based on the motion information of up to three blocks. In this case, the following process can be performed to derive a BCW weight index for a CU using the combined affine merge mode.
[0234] (1) First, the range of BCW weight index {0,1,2,3,4} can be divided into three groups: {0}, {1,2,3}, and {4}. If the BCW weight indexes of all CPs are derived from the same group, the BCW weight index can be derived by the following step (2). Otherwise, the BCW weight index can be set to 2.
[0235] (2) If at least two CPs have the same BCW weight index, the same BCW weight index can be assigned as the weight index of the combined affine merge candidate. Otherwise, the weight index of the combined affine merge candidate can be set to 2.
[0236] Bi-directional optical flow (BDOF)
[0237] According to the present disclosure, BDOF can be used to refine a bi-prediction signal. When bi-prediction is applied to a current block (e.g., CU), BDOF is used to calculate improved motion information and generate predicted samples. Therefore, the process of calculating improved motion information by applying BDOF may be included in the above-mentioned motion information derivation step.
[0238] For example, BDOF can be applied at a 4x4 sub-block level, i.e., BDOF can be performed in units of 4x4 sub-blocks within the current block.
[0239] BODF can be applied to CUs that meet the following conditions, for example:
[0240] 1) If the height of the CU is not 4 and the size of the CU is not 4x8
[0241] 2) When the CU is not in affine mode or ATMVP merge mode
[0242] 3) When the CU is coded in true bi-prediction mode, i.e., when one of the two reference pictures temporally precedes the current picture and the other temporally follows the current picture.
[0243] Furthermore, BDOF can be applied only to the luma component, but is not limited to this, and BDOF may be applied only to the chroma component, or may be applied to both the luma component and the chroma component.
[0244] The BDOF mode is based on the concept of optical flow, i.e., it assumes that the object motion is smooth. When BDOF is applied, for each 4x4 sub-block, a motion refinement (v x ,v y ) can be calculated. An improved motion vector can be calculated by minimizing the difference between the L0 predicted sample and the L1 predicted sample. The improved motion vector can be used to adjust the bi-predicted sample values within a 4x4 sub-block.
[0245] The process of performing BDOF will be described in more detail below.
[0246] First, the horizontal gradients of the two prediction signals TIFF0007811601000004.tif15140 and vertical gradient TIFF0007811601000005.tif14149 can be calculated, where k can be 0 or 1. The gradient can be calculated by directly calculating the difference between two adjacent samples, as shown in Equation 4 below.
[0247]
number
[0248] In the above formula 4, I (k) (i,j) means the sample value of the predicted signal at coordinate (i,j) in list k (k=0, 1). For example, I (0) (i,j) means the sample value at the (i,j) position in the L0 prediction block, and I (1) (i,j) may refer to the sample value at the (i,j) position in the L1 prediction block.
[0249] In Equation 4 above, the difference between two samples is right shifted by 4. However, without being limited thereto, the amount of right shift (shift1) can be determined based on the bit depth of the luma component. For example, when the bit depth of the luma component is bitDepth, shift1 can be determined as max(6, bitDepth-6). Alternatively, it can simply be determined as a fixed value of 6. In Equation 4 above, to calculate the gradient, the difference between two samples is first calculated and then a right shift operation is applied to the difference value. However, without being limited thereto, the gradient can also be calculated by applying a right shift operation to the values of two samples and then calculating the difference between the values obtained by the right shift operation.
[0250] After the gradients are calculated as described above, the auto- and cross-correlations S1, S2, S3, S5 and S6 between the gradients can be calculated as follows:
[0251]
number
[0252] The improved motion vector (v x ,v y ) can be derived as follows:
[0253]
number
[0254] Based on the derived, refined motion vectors and gradients, the following adjustments can be made to each sample in the 4x4 sub-block:
[0255]
number
[0256] Finally, the predicted samples (pred) of the CU with BDOF applied are adjusted by adjusting the bi-predicted samples of the CU as follows: BDOF ) can be calculated.
[0257]
number
[0258] In the above formula, n a , n b and n S2 can be 3, 6, and 12, respectively. These values can be selected so that the multiplier in the BDOF process does not exceed 15 bits and the bit-width of the intermediate parameters can be kept within 32 bits.
[0259] To derive the gradient values, we use the predicted sample I in list k (k = 0, 1) that is currently outside the CU. (k) (i,j) can be generated. Figure 21 shows the CU expanded to perform BDOF.
[0260] As shown in FIG. 21, extended rows / columns around the CU boundary can be used to perform BDOF. To control the computational complexity for generating out-of-boundary predicted samples, predicted samples within the extended region (white region in FIG. 21) can be generated using a bilinear filter, while predicted samples within the CU (gray region in FIG. 21) can be generated using a normal 8-tap motion compensation interpolation filter. The sample values at the extended positions can be used only for gradient calculation. When sample values and / or gradient values located outside the CU boundary are needed to perform the remaining steps of the BDOF process, the nearest neighboring sample values and / or gradient values can be used as padding (repeated).
[0261] If the width and / or height of a CU is greater than 16 luma samples, the CU may be divided into sub-blocks each having a width and / or height of 16 luma samples. The boundaries of each sub-block may be treated the same as the CU boundaries described above in the BDOF process. The maximum unit size for which the BDOF process is performed may be limited to 16x16.
[0262] If BCW is available for the current block, for example, if the BCW weight index indicates unequal weights, BDOF may not be applied. Similarly, if WP is available for the current block, for example, if luma_weight_lx_flag for at least one of the two reference pictures is 1, BDOF may not be applied. In this case, luma_weight_lx_flag may be information indicating whether WP weighting factors for the luma component of lx prediction (x is 0 or 1) are present in the bitstream. Alternatively, it may be information indicating whether WP is applied to the luma component of lx prediction. If the CU is coded in SMVD mode, BDOF may not be applied.
[0263] Prediction refinement with optical flow(PROF)
[0264] The following describes a method for applying optical flow to improve sub-block-based affine motion compensation predicted blocks. Prediction samples generated by sub-block-based affine motion compensation can be improved based on the difference induced by the optical flow equation. This improvement of prediction samples can be referred to as prediction refinement with optical flow (PROF) in this disclosure. PROF can achieve pixel-level granularity inter-prediction without increasing memory access bandwidth.
[0265] The parameters of the affine motion model can be used to derive a motion vector for each pixel in a CU. However, pixel-based affine motion compensation prediction results in high complexity and increased memory access bandwidth, so subblock-based affine motion compensation prediction can be performed. When subblock-based affine motion compensation prediction is performed, a CU is divided into 4x4 subblocks, and a motion vector can be determined for each subblock. In this case, the motion vector for each subblock can be derived from the CPMV of the CU. Subblock-based affine motion compensation has a trade-off between coding efficiency, complexity, and memory access bandwidth. Because motion vectors are derived on a subblock-by-subblock basis, complexity and memory access bandwidth are reduced, but prediction accuracy is lower.
[0266] Therefore, by applying optical flow to improve sub-block-based affine motion compensation prediction, improved granularity of motion compensation can be achieved.
[0267] As mentioned above, after sub-block-based affine motion compensation is performed, the luma prediction samples can be improved by adding the difference induced by the optical flow equation. More specifically, PROF can be performed in the following four steps:
[0268] Step 1) Sub-block based affine motion compensation is performed to generate a predicted sub-block I(i,j).
[0269] Step 2) The spatial gradients of the predicted sub-blocks, g x (i,j) and g y (i,j) is calculated at each sample location. A 3-tap filter can be used, and the filter coefficients can be [-1,0,1]. For example, the spatial gradient can be calculated as follows:
[0270]
number
[0271] To compute the gradients, the predicted sub-block can be extended by one pixel on each side. In this case, to reduce memory bandwidth and complexity, the extended boundary pixels can be copied from the nearest integer pixel in the reference picture. Thus, additional interpolation for the padding area can be omitted.
[0272] Step 3) The luma prediction refinement (ΔI(i,j)) can be calculated by the optical flow equation. For example, the following formula can be used:
[0273]
number
[0274] In the above formula, Δv(i,j) means the difference between the pixel motion vector (pixel MV, v(i,j)) calculated at sample position (i,j) and the sub-block motion vector (sub-block MV) of the sub-block to which sample (i,j) belongs.
[0275] FIG. 22 is a diagram showing the relationship between Δv(i,j), v(i,j) and sub-block motion vectors.
[0276] In the example shown in FIG. 22, for example, the motion vector v(i,j) at the upper left sample position of the current sub-block and the motion vector v(i,j) at the upper left sample position of the current sub-block are SB The difference between these can be expressed by a thick dashed arrow, and the vector indicated by the thick dashed arrow can correspond to Δv(i,j).
[0277] The affine model parameters and pixel position from the center of the sub-block are not changed. Therefore, Δv(i,j) is calculated only for the first sub-block and can be reused for different sub-blocks within the same CU. If the horizontal and vertical offsets from the pixel position to the center of the sub-block are x and y, respectively, Δv(x,y) can be derived as follows:
[0278]
number
[0279] In the above, (v 0x ,v 0y ), (v 1x ,v 1y ) and (v 2x ,v 2y ) correspond to the upper left CPMV, upper right CPMV, and lower left CPMV, and w and h represent the width and height of the CU.
[0280] Step 4) Finally, a final predicted block I'(i,j) can be generated based on the calculated luma prediction improvement ΔI(i,j) and the predicted sub-block I(i,j). For example, the final predicted block I' can be generated as follows:
[0281]
number
[0282] As described above, BDOF is applied in the inter prediction process and reference samples are improved in the motion compensation process, thereby improving image compression performance. BDOF can be performed in general mode. That is, BDOF is not performed in affine mode, GPM mode, CIIP mode, etc.
[0283] For blocks coded in affine mode, PROF can be performed in a manner similar to BDOF. As described above, by improving the reference samples within each 4x4 sub-block through PROF, the compression performance of the image can be improved.
[0284] Since both PROF and BDOF utilize characteristics of optical flow, whether to apply PROF can be determined according to conditions similar to those for applying BDOF. Also, various embodiments of WP and BCW can be provided according to the present disclosure.
[0285] In the present disclosure, setting or guiding any information (e.g., a flag) to true can mean that the information is induced to a first value (e.g., "1"). Also, when any information is set to true, it can indicate that a process indicated by the information (e.g., BDOF, PROF, WP, etc.) is to be performed. Conversely, in the present disclosure, setting or guiding any information (e.g., a flag) to false can mean that the information is induced to a second value (e.g., "0"). Also, when any information is set to false, it can indicate that a process indicated by the information is not to be performed.
[0286] When various conditions are met, bdofFlag is set to true and BDOF can be performed in the motion compensation process.
[0287] [Table 1]
[0288] The BDOF execution conditions listed in Table 1 above can be written as shown in Table 2 below.
[0289] [Table 2]
[0290] However, the conditions for performing BDOF are not limited to the examples in Tables 1 and 2. Some of these conditions may be omitted. In addition, other conditions may also be considered.
[0291] If BDOF is not applied to the current block according to the above conditions, for example, if the prediction mode of the current block is affine mode, PROF can be applied in the same way as BDOF. For example, if the prediction mode of the current block is affine mode, it is determined whether to apply PROF (cbProfFlagLX), and if cbProfFlagLX is true, PROF can be performed.
[0292] BDOF determines sample offsets using optical flow features. Therefore, if the brightness values between reference pictures are different, i.e., if BCW or WP (weighted prediction) is applied, BDOF is not performed. However, although PROF uses optical flow features to determine sample offsets, it can be performed regardless of whether BCW or WP is applied.
[0293] According to an embodiment of the present disclosure, in order to harmonize BDOF and PROF from a design perspective, PROF may not be applied to a block to which BCW or WP is applied. For example, when BcwIdx is not 0, or when luma_weight_l0_flag[refIdxL0] is 1, or when luma_weight_l1_flag[refIdxL1] is 1, information cbProfFlagLX indicating whether PROF is applied may be set to false. When BcwIdx is not 0, it may mean that BCW is applied to the current block, and when luma_weight_lX_flag[refIdxLX] (X=0 or 1) is 1, it may mean that WP is applied to the current block. In the present disclosure, when BcwIdx is 0, it may mean that an equal weight is applied, that is, it may mean that a bidirectionally predicted block is generated by averaging the L0 predicted block and the L1 predicted block. Therefore, by adding the above condition when setting cbProfFlagLX, it is possible to control so that PROF is not applied if BCW or WP is applied to the current block.
[0294] The following table shows an example of setting cbProfFlagLX according to the present disclosure, where the underlined parts indicate the added conditions.
[0295] [Table 3]
[0296] The following table shows other examples of setting cbProfFlagLX according to the present disclosure, where the underlined parts indicate the added conditions.
[0297] [Table 4]
[0298] As described above, whether PROF is applied to the current block can be determined. For example, cbProfFlagLX (X=0 or 1) may indicate whether PROF is applied to the L0 prediction direction or the L1 prediction direction, and the cbProfFlagLX may be determined based on at least one of bcwIdx, luma_weighted_l0_flag, and / or luma_weighted_l1_flag according to the method of Table 3. As another example, the cbProfFlagLX may be determined based on at least one of bcwIdx, slice_type, pps_weighted_pred_flag, and / or pps_weighted_bipred_flag according to the method of Table 4. The slice_type indicates the slice type of the current slice to which the current picture belongs, the pps_weighted_pred_flag is a PPS (Picture Parameter Set) parameter indicating whether WP is applied to the P slice that references the PPS, and the pps_weighted_bipred_flag is a PPS (Picture Parameter Set) parameter indicating whether WP is applied to the B slice that references the PPS.
[0299] According to another embodiment of the present disclosure, PROF can be applied when BCW or WP (explicit weighted prediction) is performed.
[0300] Generally, the BCW weight index (bcw_idx) is signaled only when the WP is not available. Therefore, the bcw_idx and the WP weighting factor are not signaled at the same time. The following table shows an example of a syntax structure for signaling the bcw_idx.
[0301] [Table 5]
[0302] According to Table 5 above, the condition for signaling bcw_idx is to check whether the weighted prediction flags (e.g., luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, chroma_weight_l1_flag) of the reference pictures pointed to by the reference picture indexes (ref_idx_l0, ref_idx_l1) of the CU are all 0. Therefore, according to Table 5, even if the WP application flag (e.g., pps_weighted_pred_flag and / or pps_weighted_bipre_flag) transmitted from the PPS is TRUE, bcw_idx can be signaled if the weighted prediction flag of a specific reference picture index is 0. That is, according to the example of Table 5, bcw_idx can be signaled even if WP is applied.
[0303] FIG. 23 is a flow chart illustrating an example of performing PROF, BCW, WP and / or average sum according to the present disclosure.
[0304] 23, first, cbProfFlag (e.g., cbProfFlagLX) indicating whether PROF is applied to the current block can be derived (S2310). cbProfFlag can be derived based on various methods described in this disclosure.
[0305] Then, in step S2320, it is determined whether cbProfFlag is TRUE. If it is TRUE, PROF can be performed on the current block in step S2330. PROF can be performed using the method described above. As a result of performing PROF, an improved predicted sample for the current block can be obtained. If cbProfFlag is FALSE in step S2320, step S2330 can be skipped.
[0306] Next, in step S2340, weightedPredFlag, which indicates whether weighted prediction (WP) is applied to the current block, is derived, and it can be checked whether its value is TRUE. A method for deriving weightedPredFlag will be described later. If weightedPredFlag is TRUE, it is determined that weighted prediction is applied to the current block, and weighted prediction can be performed on the current block (S2350). Weighted prediction for the current block can be performed based on weighting parameters (weight and offset) for the reference picture of the current block. As described above, the weighting parameters for the reference picture can be explicitly signaled via the bitstream.
[0307] If weightedPredFlag is False, it is determined that weighted prediction is not to be applied to the current block, and it is possible to check whether bcwIdx is 0 (S2360). bcwIdx may be derived differently depending on the prediction mode of the current block. For example, if the prediction mode of the current block is skip mode or merge mode, bcwIdx for the current block may be derived to bcwIdx for a merge candidate indicated by the merge candidate index of the current block. If the prediction mode of the current block is not merge mode, for example, MVP mode, bcwIdx for the current block may be restored by parsing the syntax element bcw_idx signaled via the bitstream. If bcw_idx is not signaled via the bitstream, the bcwIdx value may be inferred to 0. If bcwIdx is 0, it may indicate that BCW is not applied to the current block. As mentioned above, bcwIdx being 0 means that equal weighting is applied, i.e., it can mean that a bidirectional prediction block is generated by averaging the L0 prediction block and the L1 prediction block.
[0308] If bcwIdx is not 0 in step S2360, it is determined that BCW is to be applied to the current block, and BCW can be performed on the current block based on the weight indicated by bcwIdx (S2370). If bcwIdx is 0 in step S2360, it is determined that BCW is not to be applied to the current block, and average sum can be performed on the current block (S2380).
[0309] Table 6 shows an example of inducing weightedPredFlag according to the present disclosure, thereby performing WP or BCW.
[0310] [Table 6]
[0311] According to the method of Table 6, weightedPredFlag may be derived based on the slice type of the current slice to which the current block belongs and the WP application flag (e.g., pps_weighted_pred_flag, pps_weighted_bipred_flag) signaled via the PPS. Specifically, if the slice type of the current block is a P slice, weightedPredflag may be determined to be the value of pps_weighted_pred_flag. Also, if the slice type of the current block is a B slice, weightedPredflag may be determined to be the value of pps_weighted_bipred_flag.
[0312] According to the method of Table 6, if weightedPredFlag determined as described above is false, default weighted prediction is performed, and if bcwIdx is not 0, average sum can be performed if BCW or bcwIdx is 0. Also, if weightedPredFlag is true, explicit weighted prediction can be performed based on the signaled weighting parameters.
[0313] According to the method of Table 6, weightedPredFlag is determined only by the slice type of the current slice and PPS information, not the weighted prediction flag for each reference picture (e.g., luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, chroma_weight_l1_flag), whereas bcw_idx can be signaled based on the weighted prediction flag for each reference picture (e.g., luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, chroma_weight_l1_flag), as shown in Table 5.
[0314] Therefore, bcw_idx can be signaled even when weightedPredFlag is determined to be TRUE according to the method of Table 6. In this case, even if bcw_idx is not 0 (default), WP (explicit weighted prediction) is always performed.
[0315] The embodiment described with reference to FIG. 23 and Tables 5 and 6 involves the problem that WP is performed even when bcw_idx is not default. Below, other embodiments of the present disclosure for solving this problem will be described.
[0316] FIG. 24 is a flow chart illustrating another example of performing PROF, BCW, WP, and / or average sum according to the present disclosure.
[0317] 24, first, cbProfFlag indicating whether PROF is applied to the current block can be derived (S2410). cbProfFlag can be derived based on various methods described in this disclosure.
[0318] Then, in step S2420, it is determined whether cbProfFlag is TRUE. If it is TRUE, PROF can be performed on the current block in step S2430. PROF can be performed using the method described above. As a result of performing PROF, an improved prediction sample for the current block can be obtained. If cbProfFlag is FALSE in step S2420, step S2430 can be skipped.
[0319] Thereafter, in step S2440, it may be determined whether bcwIdx is 0. bcwIdx may be derived differently depending on the prediction mode of the current block. For example, if the prediction mode of the current block is skip mode or merge mode, bcwIdx for the current block may be derived to bcwIdx for the merge candidate indicated by the merge candidate index of the current block. If the prediction mode of the current block is not merge mode, for example, MVP mode, bcwIdx for the current block may be restored by parsing the syntax element bcw_idx signaled via the bitstream. If bcw_idx is not signaled via the bitstream, the bcwIdx value may be inferred to be 0. If bcwIdx is not 0 in step S2440, it may be determined that BCW is to be applied to the current block, and BCW may be performed on the current block based on the weight indicated by bcwIdx (S2450).
[0320] In step S2440, if bcwIdx is 0, it is determined that BCW is not applied to the current block, and then in step S2460, it can be checked whether weightedPredFlag, which indicates whether weighted prediction (WP) is applied to the current block, is TRUE.
[0321] If weightedPredFlag is TRUE in step S2460, it is determined that weighted prediction is applied to the current block, and weighted prediction may be performed on the current block (S2470). Weighted prediction for the current block may be performed based on weighting parameters (weight and offset) for the reference picture of the current block. As described above, the weighting parameters for the reference picture may be explicitly signaled via the bitstream.
[0322] If weightedPredFlag is False in step S2460, it is determined that weighted prediction is not applied to the current block, and an average sum can be performed on the current block (S2480).
[0323] According to the embodiment described with reference to FIG. 24, when both explicit weighted prediction (WP) and BCW are applicable to the current block, BCW can be applied preferentially.
[0324] Table 7 shows another example of inducing weightedPredFlag and thereby performing WP or BCW according to the present disclosure.
[0325] [Table 7]
[0326] The method of deriving weightedPredFlag is the same as the method of Table 6 and the method of Table 7, so a detailed description will be omitted. According to the method of Table 7, if the weightedPredFlag determined as described above is false or bcwIdx is not 0, default weighted prediction is performed, and BCW or average sum can be performed depending on the bcwIdx value. Also, if weightedPredFlag is true and bcwIdx is 0, explicit weighted prediction can be performed based on the signaled weighting parameters.
[0327] According to the method of Table 7, if weightedPredFlag is true and bcwIdx is not 0, that is, if both explicit weighted prediction (WP) and BCW are applicable to the current block, BCW can be applied preferentially.
[0328] FIG. 25 is a flowchart showing an example of performing BCW or WP using the method of Table 7.
[0329] First, the slice type of the current slice to which the current block belongs can be determined (S2510). If the slice type is a P slice, weightedPredFlag can be set to pps_weighted_pred_flag (S2520). If the slice type is a B slice, weightedPredFlag can be set to pps_weighted_bipred_flag (S2530).
[0330] Then, in step S2540, it is determined whether weightedPredFlag is 0 or BcwIdx is not 0. bcwIdx may be derived differently depending on the prediction mode of the current block. For example, if the prediction mode of the current block is skip mode or merge mode, bcwIdx for the current block may be derived to bcwIdx for the merge candidate indicated by the merge candidate index of the current block. If the prediction mode of the current block is not merge mode, for example, MVP mode, bcwIdx for the current block may be restored by parsing the syntax element bcw_idx signaled via the bitstream. If bcw_idx is not signaled via the bitstream, the bcwIdx value may be inferred to be 0.
[0331] If weightedPredFlag is 0 or BcwIdx is not 0, default weighted prediction can be performed (S2550). At this time, if BcwIdx is 0, the average sum described in step S2380 or step S2480 can be performed. If BcwIdx is not 0, BCW described in step S2370 or step S2450 can be performed.
[0332] If weightedPredFlag is not 0 and BcwIdx is 0, explicit weighted prediction can be performed (S2560). At this time, the WP described in step S2350 or step S2470 can be performed.
[0333] Table 8 shows another example of inducing weightedPredFlag and thereby performing WP or BCW according to the present disclosure.
[0334] [Table 8]
[0335] According to the method of Table 8, weightedPredFlag can be derived by further considering bcwIdx. Specifically, if bcwIdx for the current block is not 0, weightedPredFlag can be derived to false. If bcwIdx for the current block is 0, weightedPredFlag can be derived based on the slice type of the current slice to which the current block belongs and the WP application flag (e.g., pps_weighted_pred_flag, pps_weighted_bipred_flag) signaled via PPS according to the method of Table 6. According to the method of Table 8, if weightedPredFlag determined as described above is false (second value, e.g., 0), default weighted prediction is performed, and BCW or average sum can be performed according to the bcwIdx value. Also, if weightedPredFlag is true (first value, e.g., 1), explicit weighted prediction can be performed based on the signaled weighting parameters.
[0336] According to the method of Table 8, if bcwIdx is not 0, by inducing weightedPredFlag to false, if both explicit weighted prediction (WP) and BCW are applicable to the current block, BCW can be applied preferentially.
[0337] FIG. 26 is a flowchart showing an example of performing BCW or WP using the method of Table 8.
[0338] First, it is determined whether BcwIdx is not 0 (S2610). bcwIdx can be derived differently depending on the prediction mode of the current block. For example, if the prediction mode of the current block is skip mode or merge mode, bcwIdx for the current block can be derived to bcwIdx for a merge candidate indicated by the merge candidate index of the current block. If the prediction mode of the current block is not merge mode, for example, MVP mode, bcwIdx for the current block can be restored by parsing the syntax element bcw_idx signaled via the bitstream. If bcw_idx is not signaled via the bitstream, the bcwIdx value can be inferred to be 0.
[0339] If BcwIdx is not 0, weightedPredFlag can be set to 0 (S2620). Then, after the determination of step S2660, default weighted prediction can be performed (S2670). Alternatively, steps S2620 and S2660 can be skipped and step S2670 can be performed directly. Step S2670 is performed in the same manner as step S2550, so a detailed description will be omitted.
[0340] If BcwIdx is 0, the slice type of the current slice to which the current block belongs can be determined (S2630). If the slice type is a P slice, weightedPredFlag can be set to pps_weighted_pred_flag (S2640). If the slice type is a B slice, weightedPredFlag can be set to pps_weighted_bipred_flag (S2650).
[0341] Thereafter, in step S2660, it can be determined whether weightedPredFlag is 0.
[0342] If weightedPredFlag is 0, default weighted prediction can be performed (S2670). If weightedPredFlag is not 0, explicit weighted prediction can be performed (S2680). Steps S2670 and S2680 are performed in the same manner as steps S2550 and S2560, respectively, and detailed description thereof will be omitted.
[0343] Table 9 shows another example of inducing weightedPredFlag and thereby performing WP or BCW according to the present disclosure.
[0344] [Table 9]
[0345] According to the method of Table 9, weightedPredFlag can be derived in consideration of the slice type of the current slice to which the current block belongs and the weighted prediction flags (e.g., luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, chroma_weight_l1_flag) of the reference picture pointed to by the reference picture index (ref_idx_l0, ref_idx_l1) of the current block. Specifically, if the current slice to which the current block belongs is a P slice and the weighted prediction flags for the L0 direction (e.g., luma_weight_l0_flag, chroma_weight_l0_flag) are all 0, weightedPredFlag can be derived to 0. Furthermore, if the current slice to which the current block belongs is a P slice and at least one of the weighted prediction flags for the L0 direction (eg, luma_weight_l0_flag, chroma_weight_l0_flag) is not 0, weightedPredFlag can be set to 1.
[0346] If the current slice to which the current block belongs is a B slice and the weighted prediction flags for the L0 direction and the L1 direction (e.g., luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, chroma_weight_l1_flag) are all 0, weightedPredFlag can be induced to 0. Also, if the current slice to which the current block belongs is a B slice and at least one of the weighted prediction flags for the L0 direction and the L1 direction (e.g., luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, chroma_weight_l1_flag) is not 0, weightedPredFlag can be induced to 1.
[0347] According to the method of Table 9, if weightedPredFlag determined as described above is false (second value, e.g., 0), default weighted prediction is performed, and BCW or average sum can be performed according to the bcwIdx value. Also, if weightedPredFlag is true (first value, e.g., 1), explicit weighted prediction can be performed based on the signaled weighting parameters.
[0348] According to the method of Table 9, weightedPredFlag is induced based on the condition that bcw_idx is signaled. That is, by inducing weightedPredFlag to false when bcw_idx is signaled, if explicit weighted prediction (WP) and BCW are both applicable to the current block, BCW can be applied preferentially.
[0349] FIG. 27 is a flowchart showing an example of performing BCW or WP using the method of Table 9.
[0350] First, the slice type of the current slice to which the current block belongs can be determined (S2710). If the slice type is a P slice, weightedPredFlag can be derived based on luma_weight_I0_flag and / or chroma_weight_I0_flag, as described with reference to Table 9 (S2720). If the slice type is a B slice, weightedPredFlag can be derived based on luma_weight_I0_flag, chroma_weight_I0_flag, luma_weight_I1_flag and / or chroma_weight_I1_flag (S2730).
[0351] Thereafter, in step S2740, it can be determined whether weightedPredFlag is 0.
[0352] If weightedPredFlag is 0, default weighted prediction can be performed (S2750). If weightedPredFlag is not 0, explicit weighted prediction can be performed (S2760). Steps S2750 and S2760 are performed in the same manner as steps S2550 and S2560, respectively, and therefore detailed description thereof will be omitted.
[0353] Table 10 shows another example of inducing weightedPredFlag and thereby performing WP or BCW according to the present disclosure.
[0354] [Table 10]
[0355] The method of deriving weightedPredFlag is the same in the method of Table 9 and the method of Table 10, so a detailed description will be omitted. According to the method of Table 10, if the weightedPredFlag determined as described above is false (second value, for example, 0) or bcwIdx is not 0, default weighted prediction is performed, and BCW or average sum can be performed according to the bcwIdx value. Also, if weightedPredFlag is true (first value, for example, 1) and bcwIdx is 0, explicit weighted prediction can be performed based on the signaled weighting parameters.
[0356] According to the method of Table 10, weightedPredFlag is induced based on the condition that bcw_idx is signaled. That is, by inducing weightedPredFlag to false when bcw_idx is signaled, if both explicit weighted prediction (WP) and BCW are applicable to the current block, BCW can be applied preferentially.
[0357] Also, according to the method of Table 10, if weightedPredFlag is true and bcwIdx is not 0, that is, if both explicit weighted prediction (WP) and BCW are applicable to the current block, BCW can be applied preferentially.
[0358] FIG. 28 is a flowchart showing an example of performing BCW or WP using the method in Table 10.
[0359] Steps S2810 to S2830 in FIG. 28 are the same as steps S2710 to S2730 in FIG. 27, respectively, and therefore a detailed description thereof will be omitted.
[0360] 28, thereafter, in step S2840, it is determined whether weightedPredFlag is 0 or BcwIdx is not 0, and based on the determination result, default weighted prediction in step S2850 or explicit weighted prediction in step S2860 can be performed. Steps S2840 to S2860 in Fig. 28 are the same as steps S2540 to S2560 in Fig. 25, respectively, and therefore detailed description thereof will be omitted.
[0361] As described above, the embodiment described with reference to FIG. 23 and Tables 5 and 6 involves the problem that WP is performed even when bcw_idx is not default. Below, we will describe other embodiments of the present disclosure to solve this problem.
[0362] PROF is also applied when BCW or WP (explicit weighted prediction) is performed. Generally, bcw_idx is parsed from the bitstream only when WP is not available, so BCW and WP cannot exist simultaneously. However, as shown in the syntax structure in Table 5, to parse bcw_idx from the bitstream, only the weighted prediction flag (e.g., luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, chroma_weight_l1_flag) of the reference picture pointed to by the reference picture index of the current block is checked. Also, as shown in Table 6, weightedPredFlag is derived based on the slice type of the current slice to which the current block belongs and the WP application flag (e.g., pps_weighted_pred_flag, pps_weighted_bipred_flag) signaled via PPS. Therefore, even if the WP application flag is true, bcw_idx is parsed if the weighted prediction flag for a specific reference picture is 0. After all, there may be cases where WP and BCW apply simultaneously.
[0363] Table 11 shows a modified syntax structure for parsing bcw_idx according to another example of the present disclosure.
[0364] [Table 11]
[0365] The syntax structure of Table 11 modifies the parsing condition of bcw_idx in consideration of the induction condition of weightedPredFlag in Table 6, so that if bcw_idx is parsed, weightedPredFlag is induced to false, and only if bcw_idx is not parsed, weightedPredFlag is induced to true, thereby eliminating cases where WP and BCW are applied simultaneously. For example, the embodiment described with reference to FIG. 23 and Tables 5 and 6 can solve the above-mentioned problem by replacing Table 5 with Table 11.
[0366] Although the exemplary method of the present disclosure is expressed as a series of operations for clarity of explanation, this is not intended to limit the order in which the steps are performed, and the steps may be performed simultaneously or in a different order if necessary. To achieve the method according to the present disclosure, the steps illustrated may include other steps, or some steps may be omitted and the remaining steps may be included, or some steps may be omitted and additional other steps may be included.
[0367] In the present disclosure, an image encoding device or an image decoding device that performs a predetermined operation (step) can perform the operation (step) to check the execution conditions and circumstances of the operation (step). For example, if it is described that a predetermined operation is performed when a predetermined condition is satisfied, the image encoding device or the image decoding device can perform the predetermined operation after performing an operation to check whether the predetermined condition is satisfied.
[0368] The various embodiments of the present disclosure are not intended to enumerate all possible combinations, but are intended to describe representative aspects of the present disclosure, and the matters described in the various embodiments may be applied independently or in combination of two or more.
[0369] Additionally, various embodiments of the present disclosure may be implemented using hardware, firmware, software, or a combination thereof, etc. In the case of a hardware implementation, the implementation may be using one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general processors, controllers, microcontrollers, microprocessors, etc.
[0370] In addition, an image decoding apparatus and an image encoding apparatus to which an embodiment of the present disclosure is applied may be included in a multimedia broadcast transmitting / receiving apparatus, a mobile communication terminal, a home cinema video apparatus, a digital cinema video apparatus, a surveillance camera, a video conversation apparatus, a real-time communication apparatus such as video communication, a mobile streaming apparatus, a storage medium, a camcorder, a video on demand (VoD) service providing apparatus, an over-the-top (OTT) video apparatus, an internet streaming service providing apparatus, a three-dimensional (3D) video apparatus, an image telephone video apparatus, a medical video apparatus, etc., and may be used to process a video signal or a data signal. For example, an over-the-top (OTT) video apparatus 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.
[0371] FIG. 29 is a diagram illustrating a content streaming system to which an embodiment of the present disclosure can be applied.
[0372] As shown in FIG. 29, a content streaming system to which an embodiment of the present disclosure is applied can broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
[0373] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, or camcorder into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, or video camera directly generates a bitstream, the encoding server can be omitted.
[0374] The bitstream can be generated by an image encoding method and / or image encoding device to which an embodiment of the present disclosure is applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0375] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server serves as an intermediary for informing the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, which then transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, which may control commands and responses between devices in the content streaming system.
[0376] The streaming server may receive content from a media storage and / or an encoding server. For example, when receiving content from the encoding server, the content may be received in real time. In this case, the streaming server may store the bitstream for a certain period of time to provide a smooth streaming service.
[0377] Examples of the user device include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), a navigation system, a slate PC, a tablet PC, an ultrabook, a wearable device such as a smartwatch, smart glass, a head mounted display (HMD), a digital TV, a desktop computer, and digital signage.
[0378] Each server in the content streaming system can be operated as a distributed server, in which case data received from each server can be processed in a distributed manner.
[0379] The scope of the present disclosure includes software or machine-executable commands (e.g., operating systems, applications, firmware, programs, etc.) that cause operations according to the methods of various embodiments to be performed on a device or computer, and non-transitory computer-readable medium on which such software or commands can be stored and executed on a device or computer. [Industrial Applicability]
[0380] Embodiments according to the present disclosure can be used to encode / decode images.
Claims
1. An image decoding method performed by an image decoding device, comprising: receiving a bitstream; deriving a first flag indicating whether a bi-directional optical flow (BDOF) is applied to a current block of a picture based on the received bitstream; performing a BDOF process on the current block based on the first flag indicating that the BDOF is applied to the current block; based on the first flag indicating that the BDOF does not apply to the current block, Based on the received bitstream, checking (i) a second flag indicating whether weighted prediction is to be performed on the current block, and (ii) a weight index BcwIdx for performing Bi-prediction with CU-level Weight (BCW) on the current block; determining whether to perform default weighted prediction or explicit weighted prediction on the current block based on the second flag and the weight index BcwIdx; The default weighted prediction is performed on the current block based on whether the second flag is equal to 0 or the weight index BcwIdx is not equal to 0; The explicit weighted prediction is performed on the current block based on the second flag being equal to 1 and the weight index BcwIdx being equal to 0; Based on the weight index BcwIdx being equal to 0, the default weighted prediction performs an average sum on the current block; Based on the weight index BcwIdx not being equal to 0, the default weighted prediction performs the BCW on the current block; performing the explicit weighted prediction based on weighting parameters (weight and offset) for the current block relative to a reference picture.
2. The image decoding method of claim 1 , wherein the second flag is determined to be different based on a slice type of a current slice to which the current block belongs.
3. Based on the slice type of the current slice being a P slice, the second flag is derived as a value of pps_weighted_pred_flag signaled in a picture parameter set (PPS); The image decoding method according to claim 2 , wherein the second flag is derived as a value of pps_weighted_bipred_flag signaled in the PPS based on the slice type of the current slice being a B slice.
4. the weight index BcwIdx is derived based on a syntax element bcw_idx signaled via the bitstream; The image decoding method of claim 1 , wherein the weight index BcwIdx is derived as 0 based on the syntax element bcw_idx not being present in the bitstream.
5. The image decoding method of claim 4 , wherein the syntax element bcw_idx is parsed from the bitstream based on a weighted prediction flag of a reference picture of the current block.
6. The image decoding method of claim 4 , wherein the syntax element bcw_idx is parsed from the bitstream based on all weighted prediction flags of reference pictures of the current block being equal to 0.
7. The image decoding method of claim 1 , wherein the weighting parameters are explicitly signaled via the bitstream.
8. An image coding method performed by an image coding device, comprising: deriving a first flag indicating whether bi-directional optical flow (BDOF) is applied to a current block of a picture; performing a BDOF process on the current block based on the first flag indicating that the BDOF is applied to the current block; based on the first flag indicating that the BDOF does not apply to the current block, (i) checking a second flag indicating whether weighted prediction is performed on the current block, and (ii) checking a weight index BcwIdx for performing Bi-prediction with CU-level Weight (BCW) on the current block; determining whether to perform default weighted prediction or explicit weighted prediction on the current block based on the second flag and the weight index BcwIdx; The default weighted prediction is performed on the current block based on whether the second flag is equal to 0 or the weight index BcwIdx is not equal to 0; performing the explicit weighted prediction on the current block based on the second flag being equal to 1 and the weight index BcwIdx being equal to 0; encoding information relating to the first flag, the second flag, and the weight index BcwIdx, Based on the weight index BcwIdx being equal to 0, the default weighted prediction performs an average sum on the current block; Based on the weight index BcwIdx not being equal to 0, the default weighted prediction performs the BCW on the current block; performing the explicit weighted prediction based on weighting parameters (weight and offset) for the current block relative to a reference picture.
9. 1. A method for transmitting a bitstream, comprising: generating a bitstream, The bitstream comprises: deriving a first flag indicating whether bi-directional optical flow (BDOF) is applied to a current block of a picture; performing a BDOF process on the current block based on the first flag indicating that the BDOF is applied to the current block; based on the first flag indicating that the BDOF does not apply to the current block, (i) checking a second flag indicating whether weighted prediction is performed on the current block, and (ii) checking a weight index BcwIdx for performing Bi-prediction with CU-level Weight (BCW) on the current block; determining whether to perform default weighted prediction or explicit weighted prediction on the current block based on the second flag and the weight index BcwIdx; The default weighted prediction is performed on the current block based on whether the second flag is equal to 0 or the weight index BcwIdx is not equal to 0; performing the explicit weighted prediction on the current block based on the second flag being equal to 1 and the weight index BcwIdx being equal to 0; encoding information relating to the first flag, the second flag, and the weight index BcwIdx, Based on the weight index BcwIdx being equal to 0, the default weighted prediction performs an average sum on the current block; Based on the weight index BcwIdx not being equal to 0, the default weighted prediction performs the BCW on the current block; the explicit weighted prediction is performed based on weighting parameters (weight and offset) for the current block relative to a reference picture; transmitting the bitstream.