Image decoding method and apparatus for residual coding

By using the dependent quantization enable flag and conversion skip residual encoding method in the image encoding system, the problem of low coding efficiency of high-resolution image is solved, and more efficient image encoding is achieved.

JP7656127B2Active Publication Date: 2025-04-02LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024083849
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-02-05
Filing Date
2024-05-23
Publication Date
2025-04-02
Estimated Expiration
2041-02-05

AI Technical Summary

Technical Problem

The prior art is difficult to improve the encoding efficiency of high resolution and high-quality images, resulting in increased transmission and storage costs.

Method used

By introducing a quantization-dependent enable flag and conversion skip residual coding method in the image encoding system, the processing of prediction-related information and residual information is optimized and the encoding efficiency is improved.

Benefits of technology

The efficiency of image encoding is improved, especially in residual encoding, and the required number of bits is reduced and the overall encoding efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007656127000061
    Figure 0007656127000061
  • Figure 0007656127000062
    Figure 0007656127000062
  • Figure 0007656127000063
    Figure 0007656127000063
Patent Text Reader

Abstract

To provide an image decoding method performed by a decoding device.SOLUTION: The method includes the steps of: acquiring prediction-related information for a current block; acquiring a dependent quantification enable flag related to whether dependent quantification is available; acquiring, on the basis of the dependent quantization enable flag, a transform skip residual coding (TSRC) enable flag related to whether TSRC is available; acquiring residual information of residual coding syntax for the current block, which has been derived on the basis of the TSRC enable flag; deriving motion information of the current block on the basis of the prediction-related information; deriving a prediction sample of the current block on the basis of the motion information; deriving a residual sample of the current block on the basis of the residual information; and generating a reconstructed picture on the basis of the prediction sample and the residual sample.SELECTED DRAWING: Figure 13
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This document relates to an image coding technology, and more particularly to an image decoding method and apparatus for coding flag information indicating whether TSRC is enabled when coding residual data of a current block in an image coding system. [Background technology]

[0002] Recently, the demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing in various fields. As the image data has higher resolution and quality, the amount of information or bits to be transmitted increases relatively compared to existing image data, so that when the image data is transmitted using a medium such as an existing wired or wireless broadband line or when the image data is stored using an existing recording medium, the transmission cost and storage cost increase.

[0003] Thereby, highly efficient image compression techniques are required to effectively transmit, store and reproduce high resolution, high quality image information. Summary of the Invention [Problem to be solved by the invention]

[0004] The technical problem of this document is to provide a method and apparatus for increasing image coding efficiency.

[0005] Another technical problem of this document is to provide a method and apparatus for improving the efficiency of residual coding. [Means for solving the problem]

[0006] According to an embodiment of the present document, there is provided an image decoding method executed by a decoding device, the method comprising the steps of: obtaining prediction related information for a current block; obtaining a dependent quantization enabled flag regarding whether dependent quantization is enabled; obtaining a TSRC enabled flag regarding whether Transform Skip Residual Coding (TSRC) is enabled based on the dependent quantization enabled flag; obtaining residual information of a residual coding syntax for the current block derived based on the TSRC enabled flag; deriving motion information of the current block based on the prediction related information; deriving a prediction sample of the current block based on the motion information; deriving a residual sample of the current block based on the residual information; and generating a reconstructed picture based on the prediction sample and the residual sample.

[0007] According to another embodiment of the present document, there is provided a decoding device for performing image decoding, the decoding device comprising: an entropy decoding (decoding) unit for obtaining prediction related information for a current block, obtaining a dependent quantization enabled flag regarding whether dependent quantization is enabled, obtaining a TSRC enabled flag regarding whether Transform Skip Residual Coding (TSRC) is enabled based on the dependent quantization enabled flag, and obtaining residual information of a residual coding syntax for the current block derived based on the TSRC enabled flag, a prediction unit for deriving motion information for the current block based on the prediction related information and deriving a prediction sample for the current block based on the motion information, a residual processing unit for deriving a residual sample for the current block based on the residual information, and an adder for generating a reconstructed picture based on the prediction sample and the residual sample.

[0008] According to yet another embodiment of the present document, there is provided a video encoding method executed by an encoding device, the method comprising the steps of: deriving a prediction sample of a current block based on inter prediction, encoding prediction related information for the current block, encoding a dependent quantization enabled flag regarding whether dependent quantization is enabled, encoding a TSRC enabled flag regarding whether Transform Skip Residual Coding (TSRC) is enabled based on the dependent quantization enabled flag, determining a residual coding syntax for the current block based on the TSRC enabled flag, encoding residual information of the determined residual coding syntax for the current block, and generating a bitstream including the prediction related information, the dependent quantization enabled flag, the TSRC enabled flag, and the residual information.

[0009] According to yet another embodiment of the present document, there is provided a video encoding device, comprising: a prediction unit configured to derive a prediction sample of a current block based on inter prediction; and an entropy encoding unit configured to encode prediction-related information for the current block, to encode a dependent quantization enabled flag regarding whether dependent quantization is enabled, to encode a TSRC enabled flag regarding whether Transform Skip Residual Coding (TSRC) is enabled based on the dependent quantization enabled flag, to determine a residual coding syntax for the current block based on the TSRC enabled flag, to encode residual information of the determined residual coding syntax for the current block, and to generate a bitstream including the prediction-related information, the dependent quantization enabled flag, the TSRC enabled flag, and the residual information.

[0010] According to yet another embodiment of the present document, there is provided a computer-readable digital storage medium having stored thereon a bitstream having image information for causing an image decoding method to be performed, the computer-readable digital storage medium comprising the steps of: obtaining prediction-related information for a current block; obtaining a dependent quantization enabled flag indicating whether dependent quantization is enabled; obtaining a TSRC enabled flag indicating whether Transform Skip Residual Coding (TSRC) is enabled based on the dependent quantization enabled flag; obtaining residual information of a residual coding syntax for the current block derived based on the TSRC enabled flag; deriving motion information for the current block based on the prediction-related information; deriving prediction samples for the current block based on the motion information; deriving residual samples for the current block based on the residual information; and generating a reconstructed picture based on the prediction samples and the residual samples. Effect of the Invention

[0011] According to this document, the efficiency of image coding performed based on inter prediction and / or residual coding can be improved.

[0012] According to this document, the efficiency of residual coding can be improved.

[0013] According to this document, a signaling relationship can be established between the dependent quantization available flag and the TSRC available flag to signal the TSRC available flag when dependent quantization is not available, thereby improving coding efficiency by preventing dependent quantization from being used when TSRC is not available and RRC syntax is coded for a transform skip block, thereby reducing the amount of coded bits and improving overall residual coding efficiency.

[0014] According to this document, the TSRC available flag can be signaled only when dependent quantization is not used, thereby preventing overlapping between coding of the RRC syntax and the use of dependent quantization for the transform skip block, and allowing the TSRC available flag to be coded more effectively (efficiently), thereby reducing the amount of bits and improving overall residual coding efficiency. [Brief description of the drawings]

[0015] [Figure 1] FIG. 1 illustrates a schematic diagram of an example of a video / image coding system in which embodiments of the present document may be applied. [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video / image encoding device to which the embodiments of this document can be applied. [Diagram 3] FIG. 1 is a diagram illustrating the configuration of a video / image decoding device to which an embodiment of the present document can be applied. [Figure 4] FIG. 1 illustrates an example of an inter-prediction based video / image encoding method. [Diagram 5] FIG. 2 illustrates an example of an inter-prediction based video / image decoding method. [Figure 6] FIG. 13 is a diagram exemplarily illustrating an inter prediction procedure. [Figure 7]FIG. 2 is a diagram illustrating an example of Context-Adaptive Binary Arithmetic Coding (CABAC) for encoding syntax elements. [Figure 8] A diagram illustrating examples of transform coefficients in a 4x4 block. [Figure 9] FIG. 2 is a diagram illustrating an example of a scalar quantizer used in dependent quantization. [Figure 10] FIG. 2 is an exemplary diagram illustrating state transitions and quantizer selection for dependent quantization. [Figure 11] FIG. 2 is a diagram illustrating an image encoding method according to the encoding device of the present document. [Figure 12] FIG. 1 is a schematic diagram of an encoding device for performing the image encoding method according to the present document; [Figure 13] FIG. 2 is a diagram illustrating an image decoding method using a decoding device according to the present document. [Figure 14] FIG. 1 is a schematic diagram of a decoding device for performing the image decoding method according to the present document; [Figure 15] FIG. 1 is an exemplary diagram illustrating a content streaming system structure to which an embodiment of the present document is applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] This document may have various modifications and may have various embodiments, and a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to a specific embodiment. Commonly used terms in this specification are used merely to describe a specific embodiment, and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, terms such as "include" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0017] Meanwhile, each configuration in the drawings described in this document is illustrated independently for the convenience of explaining the different characteristic functions, and does not mean that each configuration is realized by separate hardware or software. For example, two or more of each configuration may be combined to form one configuration, and one configuration may be divided into multiple configurations. An embodiment in which each configuration is integrated and / or separated is also included in the scope of this document as long as it does not deviate from the essence of this document.

[0018] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, the same reference numerals will be used for the same components in the drawings, and duplicated descriptions of the same components may be omitted.

[0019] FIG. 1 illustrates a schematic diagram of an example of a video / image coding system in which embodiments of the present document may be applied.

[0020] As shown in Figure 1, the video / image coding system may include a first device (source device) and a second device (receiving device). The source device may transmit encoded video / image information or data to the receiving device in a file or streaming form via a digital recording medium or a network.

[0021] The source device may comprise a video source, an encoding device, and a sending unit. The receiving device may comprise a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may comprise a display unit, which may also be a separate device or an external component.

[0022] A video source may acquire video / images through a video / image capture, synthesis, or generation process, etc. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may comprise, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may comprise, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated via a computer, etc., in which case the video / image capture process may be replaced by a process in which the associated data is generated.

[0023] An encoding device can encode an input video / image. The encoding device can perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0024] The transmitting unit may transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital recording medium or a network in the form of a file or streaming. The digital recording medium may include various recording media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit may include elements for generating a media file through a predetermined file format and may include elements for transmission via a broadcasting / communication network. The receiving unit may receive / extract the bitstream and transmit it to a decoding device.

[0025] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, prediction, etc., which correspond to the operations of the encoding device.

[0026] The renderer can render the decoded video / images. The rendered video / images can be displayed via a display unit.

[0027] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document can be applied to methods disclosed in the Versatile Video Coding (VVC) standard, the Essential Video Coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the 2nd Generation of Audio Video Coding Standard (AVS2), or next-generation video / image coding standards (such as H.267 or H.268).

[0028] In this document, various embodiments relating to video / image coding are presented, and unless otherwise stated, said embodiments can also be implemented in combination with each other.

[0029] In this document, a video may mean a collection of a series of images over time. A picture generally means a unit showing one image at a particular time, and a subpicture / slice / tile is a unit constituting a part of a picture in coding. A subpicture / slice / tile may include one or more coding tree units (CTUs). A picture may be composed of one or more subpictures / slice / tiles. A picture may be composed of one or more groups of tiles. A tile group may include one or more tiles. A brick may represent a rectangular region of CTU rows within a tile in a picture. A tile may be partitioned into multiple bricks, each of which consisting of one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick.A brick scan is a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in CTU raster scan in a brick, bricks within a tile are ordered consecutively in a raster scan of the bricks of the tile, and tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. Additionally, a subpicture may represent a rectangular region of one or more slices within a picture. That is, a subpicture contains one or more slices that collectively cover a rectangular region of a picture. A tile is a rectangular region of CTUs within a particular tile column and a particular tile row in a picture.The tile column is a rectangular region of CTUs having a height equal to the height of the picture and a width specified by syntax elements in the picture parameter set. The tile row is a rectangular region of CTUs having a height specified by syntax elements in the picture parameter set and a width equal to the width of the picture. A tile scan is a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in CTU raster scan in a tile whereas tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture.A slice includes an integer number of bricks of a picture that maybe exclusively contained in a single NAL unit. A slice may consist of either a number of complete tiles or only a consecutive sequence of complete bricks of one tile. In this document, the terms tile group and slice may be used interchangeably. For example, in this document, tile group / tile group header may be referred to as slice / slice header.

[0030] A pixel or a pel may refer to the smallest unit that constitutes one picture (or image). A term corresponding to a pixel may be "sample." 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.

[0031] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. A unit may include one luma block and two chroma (e.g., cb, cr) blocks. A unit may be mixed with terms such as block or area in some cases. In a general case, an M×N block may include a sample (or sample array) consisting of M columns and N rows, or a set (or array) of transform coefficients.

[0032] In the present specification, "A or B" may mean "A only," "B only," or "both A and B." In other words, in the present specification, "A or B" may be interpreted as "A and / or B." For example, in the present specification, "A, B or C" may mean "A only," "B only," "C only," or "any combination of A, B and C."

[0033] As used herein, a slash ( / ) or a comma may mean "and / or." For example, "A / B" may mean "A and / or B." Thus, "A / B" may mean "A only," "B only," or "both A and B." For example, "A, B, C" may mean "A, B, or C."

[0034] In this specification, "at least one of A and B" may mean "only A," "only B," or "both A and B." In addition, in this specification, the expressions "at least one of A or B" and "at least one of A and / or B" may be interpreted similarly to "at least one of A and B."

[0035] In addition, in this specification, "at least one of A, B and C" can mean "A only," "B only," "C only," or "any combination of A, B and C." Furthermore, "at least one of A, B or C" and "at least one of A, B and / or C" can mean "at least one of A, B and C."

[0036] In addition, parentheses used in this specification may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction." In other words, "prediction" in this specification is not limited to "intra prediction," and "intra prediction" may be proposed as an example of "prediction." In addition, even when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction."

[0037] Technical features described separately in one drawing in this specification may be realized separately or simultaneously.

[0038] The following drawings are created to explain a specific example of the present specification. The names of specific devices and names of specific signals / messages / fields described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.

[0039] 2 is a diagram for explaining the configuration of a video / image encoding device to which the embodiments of this document can be applied. Hereinafter, the video encoding device may include an image encoding device.

[0040] As shown in FIG. 2, the encoding device 200 may be configured to include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 210, the prediction unit 220, the residual processing unit 230, the entropy encoding unit 240, the addition unit 250, and the filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chip set or a processor) depending on the embodiment. In addition, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital recording medium. The above hardware components may further include the memory 270 as an internal / external component.

[0041] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. As an example, the processing unit may be called a coding unit (CU). In this case, the coding unit may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary tree structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure and / or the ternary tree structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present document may be performed based on the final coding unit that is not further divided. In this case, the largest coding unit may be immediately used as the final coding unit based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit described above.The prediction unit is a unit of sample prediction, and the transform unit is a unit for deriving (inducing) transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.

[0042] The unit may be mixed with terms such as block or area in some cases. In the general case, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally refer to a pixel or pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to a pixel or pel of one picture (or image).

[0043] The encoding device 200 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 221 or the intra prediction unit 222 from an input image signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoder 200 may be called a subtraction unit 231. The prediction unit may perform prediction on a processing target block (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 240, as will be described later in the description of each prediction mode. The prediction information can be encoded by the entropy encoder 240 and output in the form of a bitstream.

[0044] The intra prediction unit 222 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 away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional mode may include, for example, a DC mode and a planar mode. The directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of granularity of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction mode applied to the neighboring block.

[0045] The inter prediction unit 221 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the 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 inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include a spatial neighboring block present in the current picture and a temporal neighboring block 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., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 221 may generate information indicating which candidate is used to construct a motion information candidate list based on neighboring blocks and derive a motion vector and / or a reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 221 may use the motion information of the neighboring block as the motion information of the current block. In the case of the skip mode, unlike the 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 can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.

[0046] The prediction unit 220 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, or may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). The prediction unit may also be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, such as Screen Content Coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information regarding a palette table and a palette index.

[0047] The prediction signal generated through the prediction unit (including the inter prediction unit 221 and / or the intra prediction unit 222) may be used to generate a reconstruction signal or may be used to generate a residual signal. The transform unit 232 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 when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or may be applied to non-square, variable-sized blocks.

[0048] The quantizer 233 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoder 240, which may encode the quantized signal (information on the quantized transform coefficients) and output the quantized signal as a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 240 may perform various encoding methods, such as exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC). The entropy encoder 240 may encode information required for video / image restoration (e.g., values ​​of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in Network Abstraction Layer (NAL) 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 further include general constraint information. Information and / or syntax elements transmitted / signaled from an encoding device to a decoding device in this document may be included in the video / image information. The video / image information may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or may be stored in a digital recording medium. Here, the network may include a broadcasting network and / or a communication network, and the digital recording medium may include various recording media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting and / or a storage unit (not shown) for storing the signal output from the entropy encoding unit 240 may be configured as an internal / external element of the encoding device 200, or the transmitting unit may be included in the entropy encoding unit 240.

[0049] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be restored by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. The adder 250 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 221 or the intra prediction unit 222. When there is no residual for the current block, such as when a skip mode is applied, the predicted block may be used as the reconstructed block. The adder 250 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering, as described below.

[0050] Meanwhile, Luma Mapping with Chroma Scaling (LMCS) may be applied during picture encoding and / or restoration.

[0051] The filtering unit 260 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 260 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 270, specifically, in the DPB of the memory 270. The various filtering methods may include, for example, deblock filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc. The filtering unit 260 may generate various information related to filtering and transmit the information to the entropy encoding unit 240, as will be described later in relation to each filtering method. The information related to filtering may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0052] The modified reconstructed picture transmitted to the memory 270 may be used as a reference picture in the inter prediction unit 221. Through this, when inter prediction is applied, the encoding apparatus may avoid a prediction mismatch between the encoding apparatus 200 and the decoding apparatus 300, and may also improve encoding efficiency.

[0053] The memory 270DPB may store the modified reconstructed picture for use as a reference picture in the inter prediction unit 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 221 to be utilized as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and may transmit them to the intra prediction unit 222.

[0054] FIG. 3 is a diagram illustrating a schematic configuration of a video / image decoding device to which the embodiments of this document can be applied.

[0055] As shown in FIG. 3, the decoding device 300 may be configured to include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter predictor 331 and an intra predictor 332. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. The entropy decoder 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. In addition, the memory 360 may include a decoded picture buffer (DPB) and may be configured as a digital recording medium. The above hardware components may further include a memory 360 as an internal / external component.

[0056] When a bitstream including video / image information is input, the decoding device 300 can restore an image corresponding to the process in which the video / image information is processed by the encoding device of FIG. 2. For example, the decoding device 300 can derive a unit / block based on block division related information obtained from the bitstream. The decoding device 300 can perform decoding using a processing unit applied in the encoding device. Thus, the processing unit of the decoding is, for example, a coding unit, and the coding unit can be divided according to a quadtree structure, a binary tree structure, and / or a ternary tree structure from a coding tree unit or a maximal coding unit. One or more transform units can be derived from the coding unit. Then, the restored image signal decoded and output by the decoding device 300 can be reproduced by a reproduction device.

[0057] The decoding device 300 may receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. 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). In addition, the video / image information may further include general constraint information. The decoding device may further decode pictures based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be decoded via the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 310 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, quantized values ​​of transform coefficients related to residuals, etc. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element in the bitstream, determine a context model using syntax element information to be decoded, and decode information of neighboring and to-be-decoded blocks, or information of symbols / bins decoded in a previous step, predict the occurrence probability of bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element. In this case, the CABAC entropy decoding method may update the context model using information of the decoded symbols / bins for the context model of the next symbol / bin after determining the context model.Among the information decoded by the entropy decoding unit 310, information related to prediction is provided to a prediction unit (inter prediction unit 332 and intra prediction unit 331), and residual values ​​entropy-decoded by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to a residual processing unit 320. The residual processing unit 320 may derive a residual signal (residual block, residual sample, residual sample array). Also, among the information decoded by the entropy decoding unit 310, information related to filtering may be provided to a filtering unit 350. Meanwhile, a receiving unit (not shown) for receiving a signal output from an encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to this document may be called a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the addition unit 340, the filtering unit 350, the memory 360, the inter prediction unit 332, and the intra prediction unit 331.

[0058] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scan order performed in the encoding device. The inverse quantization unit 321 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.

[0059] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0060] 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 on the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.

[0061] The prediction unit 320 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). In addition, the prediction unit may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, such as Screen Content Coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, information regarding a palette table and a palette index may be included in the video / image information and signaled.

[0062] The intra prediction unit 331 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 away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine the prediction mode applied to the current block using the prediction mode applied to the neighboring blocks.

[0063] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted from the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between 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 inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. 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 332 may configure 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 the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information regarding the prediction may include information indicating a mode of inter prediction for the current block.

[0064] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including the inter prediction unit 332 and / or the intra prediction unit 331). When there is no residual for a current block, such as when a skip mode is applied, the predicted block may be used as a reconstructed block.

[0065] The adder 340 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of a next block to be processed in the current picture, and may be output after filtering as described below, or may be used for inter prediction of a next picture.

[0066] Meanwhile, Luma Mapping with Chroma Scaling (LMCS) can be applied during the picture decoding process.

[0067] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transmit the modified reconstructed picture to the memory 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblock filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.

[0068] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter prediction unit 332. The memory 360 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 prediction unit 260 to be utilized as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 360 can store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 331.

[0069] In this specification, the embodiments described for the filtering unit 260, inter prediction unit 221, and intra prediction unit 222 of the encoding device 200 can be applied identically or correspondingly to the filtering unit 350, inter prediction unit 332, and intra prediction unit 331 of the decoding device 300, respectively.

[0070] In this document, at least one of quantization / dequantization and / or transform / inverse transform can be omitted. When the quantization / dequantization is omitted, the quantized transform coefficients can be called transform coefficients. When the transform / inverse transform is omitted, the transform coefficients can be called coefficients or residual coefficients, or can still be called transform coefficients for uniformity of expression.

[0071] In this document, the quantized transform coefficients and the transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, the residual information may include information about the transform coefficient(s), and the information about the transform coefficient(s) may be signaled via a residual coding syntax. A transform coefficient may be derived based on the residual information (or information about the transform coefficient(s)), and a scaled transform coefficient may be derived via an inverse transform (scaling) on ​​the transform coefficient. A residual sample may be derived based on an inverse transform (transform) on the scaled transform coefficient. This may be similarly applied / expressed in other parts of this document.

[0072] As described above, in performing video coding, prediction is performed to improve compression efficiency. Through this, a predicted block including predicted samples for a current block, which is a block to be coded, can be generated. Here, the predicted block includes predicted samples in a spatial domain (or pixel domain). The predicted block is derived in the same way in an encoding device and a decoding device, and the encoding device can improve image coding efficiency by signaling information (residual information) on a residual between the original block and the predicted block, which is not an original sample value of the original block, to a decoding device. The decoding device can derive a residual block including residual samples based on the residual information, combine the residual block and the predicted block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.

[0073] The residual information may be generated through a transform and quantization procedure. For example, an encoding device may derive a residual block between the original block and the predicted block, perform a transform procedure on residual samples (residual sample array) included in the residual block to derive transform coefficients, perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and signal related residual information to a decoding device (via a bitstream). Here, the residual information may include information such as value information, position information, transform technique, transform kernel, and quantization parameter of the quantized transform coefficients. The decoding device may perform an inverse quantization / inverse transform procedure based on the residual information to derive residual samples (or residual blocks). The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device may further inverse quantize / inverse transform the quantized transform coefficients to derive a residual block for reference for inter-prediction of a subsequent picture, and generate a reconstructed picture based thereon.

[0074] When inter prediction is applied, the prediction unit of the encoding device / decoding device can perform inter prediction on a block-by-block basis to derive a prediction sample. Inter prediction can represent a prediction derived in a manner that is dependent on data elements (e.g., sample values ​​or motion information) of picture(s) other than the current picture. When inter prediction is applied to the current block, a predicted block (prediction sample array) for the current block can be derived based on a reference block (reference sample array) identified by a motion vector on a reference picture pointed to by a reference picture index. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information of the current block can be predicted on a block, sub-block, or sample basis based on the correlation of motion information between a neighboring block and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include inter prediction type (L0 prediction, L1 prediction, Bi prediction, etc.) information. When inter prediction is applied, the neighboring blocks may include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing 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., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic).For example, a motion information candidate list may be constructed based on neighboring blocks of the current block, and flag or index information indicating which candidate is selected (used) to derive the motion vector and / or reference picture index of the current block may be signaled. Inter prediction may be performed based on various prediction modes, and for example, in the case of skip mode and merge mode, the motion information of the current block may be the same as the motion information of the selected neighboring block. In the case of skip mode, unlike the merge mode, a residual signal may not be transmitted. In the case of a Motion Vector Prediction (MVP) mode, the motion vector of the selected neighboring block may be used as a motion vector predictor, and a motion vector difference may be signaled. In this case, the motion vector of the current block may be derived using the sum of the motion vector predictor and the motion vector difference.

[0075] The motion information may include L0 motion information and / or L1 motion information depending on the inter prediction type (L0 prediction, L1 prediction, Bi prediction, etc.). A motion vector in the L0 direction may be referred to as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be referred to as an L1 motion vector or MVL1. A prediction based on an L0 motion vector may be referred to as an L0 prediction, a prediction based on an L1 motion vector may be referred to as an L1 prediction, and a prediction based on both the L0 motion vector and the L1 motion vector may be referred to as a pairwise (Bi) prediction. Here, the L0 motion vector may represent a motion vector associated with a reference picture list L0 (L0), and the L1 motion vector may represent a motion vector associated with a reference picture list L1 (L1). The reference picture list L0 may include pictures that are earlier (previous) than the current picture in output order as reference pictures, and the reference picture list L1 may include pictures that are later (following) than the current picture in output order. The previous picture may be referred to as a forward (reference) picture, and the subsequent picture may be referred to as a backward (reference) picture. The reference picture list L0 may further include a subsequent picture in output order from the current picture as a reference picture. In this case, the previous picture may be indexed first in the reference picture list L0, and the subsequent picture may be indexed next. The reference picture list L1 may further include a previous picture in output order from the current picture as a reference picture. In this case, the subsequent picture may be indexed first in the reference picture list 1 (L1), and the previous picture may be indexed next. Here, the output order may correspond to a Picture Order Count (POC) order.

[0076] A video / image encoding procedure based on inter prediction may generally include, for example:

[0077] FIG. 4 illustrates an example of an inter-prediction based video / image encoding method.

[0078] The encoding apparatus performs inter prediction on a current block (S400). The encoding apparatus may derive an inter prediction mode and motion information of the current block and generate a prediction sample of the current block. Here, the inter prediction mode determination, motion information derivation, and prediction sample generation procedures may be performed simultaneously, or any one procedure may be performed prior to the other procedures. For example, the inter prediction unit of the encoding apparatus may include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit, and the prediction mode determination unit may determine a prediction mode for the current block, the motion information derivation unit may derive motion information of the current block, and the prediction sample derivation unit may derive a prediction sample of the current block. For example, the inter prediction unit of the encoding apparatus may search for a block similar to the current block within a certain area (search area) of a reference picture through motion estimation, and derive a reference block whose difference with 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 encoding apparatus can determine a mode to be applied to the current block from among various prediction modes. The encoding apparatus can compare RD costs for the various prediction modes and determine an optimal prediction mode for the current block.

[0079] For example, when a skip mode or a merge mode is applied to the current block, the encoding apparatus may construct a merge candidate list (to be described later) and derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion from 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 a decoding apparatus. Motion information of the current block may be derived using motion information of the selected merge candidate.

[0080] As another example, when the (A)MVP mode is applied to the current block, the encoding apparatus may construct an (A)MVP candidate list described later, and may use a motion vector of a selected MVP candidate among the MVP (motion vector predictor) candidates included in the (A)MVP candidate list as the MVP of the current block. In this case, for example, a motion vector indicating a reference block derived by the above-mentioned 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 among the MVP candidates may become 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, information regarding the MVD may be signaled to the decoding apparatus. In addition, when the (A)MVP mode is applied, the value of the reference picture index may be configured as reference picture index information and separately signaled to the decoding apparatus.

[0081] The encoding apparatus may derive residual samples based on the predicted samples (S410). The encoding apparatus may derive the residual samples through a comparison between original samples of the current block and the predicted samples.

[0082] The encoding apparatus encodes image information including prediction information and residual information (S420). The encoding apparatus may output the encoded image information in a bitstream form. The prediction information may include prediction mode information (e.g., skip flag, merge flag or mode index, etc.) and information on motion information as information related to the prediction procedure. The information on the motion information may include candidate selection information (e.g., merge index, mvp flag or mvp index) which is information for deriving a motion vector. In addition, the information on the motion information may include information on the above-mentioned MVD and / or reference picture index information. In addition, the information on the motion information may include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information on the residual sample. The residual information may include information on quantized transform coefficients for the residual sample.

[0083] The output bitstream can be stored on a (digital) recording medium and transmitted to the decoding device, or can be transmitted to the decoding device via a network.

[0084] Meanwhile, as described above, the encoding apparatus can generate a reconstructed picture (including reconstructed samples and reconstructed blocks) based on the reference samples and the residual samples. This is because the encoding apparatus derives the same prediction result as that performed by the decoding apparatus, thereby improving coding efficiency. Therefore, the encoding apparatus can store the reconstructed picture (or reconstructed samples, reconstructed blocks) in a memory and use it as a reference picture for inter prediction. As described above, an in-loop filtering procedure, etc. can be further applied to the reconstructed picture.

[0085] A video / image decoding procedure based on inter prediction may generally include, for example:

[0086] FIG. 5 shows an example of an inter-prediction based video / image decoding method.

[0087] As shown in Figure 5, the decoding device may perform operations corresponding to those performed by the encoding device. The decoding device may perform prediction for a current block based on received prediction information and derive a prediction sample.

[0088] Specifically, the decoding device may determine a prediction mode for the current block based on received prediction information (S500). The decoding device may determine which inter prediction mode is applied to the current block based on prediction mode information in the prediction information.

[0089] For example, it may determine whether the merge mode is applied to the current block or whether the (A)MVP mode is determined based on the merge flag. Alternatively, 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 (A)MVP mode, or may include various inter prediction modes described below.

[0090] The decoding apparatus derives motion information of the current block based on the determined inter prediction mode (S510). For example, when a skip mode or a merge mode is applied to the current block, the decoding apparatus may form a merge candidate list (described later) and select one merge candidate from among the merge candidates included in the merge candidate list. The selection may be made based on the above-mentioned selection information (merge index). The motion information of the selected merge candidate may be used to derive motion information of the current block. The motion information of the selected merge candidate may be used as motion information of the current block.

[0091] As another example, when the (A)MVP mode is applied to the current block, the decoding apparatus may construct an (A)MVP candidate list described later, and may use a motion vector of a selected MVP candidate among the MVP (motion vector predictor) candidates included in the (A)MVP candidate list as the MVP of the current block. The selection may be made based on the above-mentioned selection information (mvp flag or mvp index). In this case, the MVD of the current block may be derived based on information on the MVD, and the motion vector of the current block may be derived based on the mvp of the current block and the MVD. Also, the reference picture index of the current block may be derived based on the reference picture index information. A picture pointed to by the reference picture index in a reference picture list for the current block may be derived as a reference picture referenced for inter prediction of the current block.

[0092] On the other hand, as described below, the motion information of the current block may be derived without constructing a candidate list, and in this case, the motion information of the current block may be derived according to a procedure disclosed in a prediction mode described below. In this case, the candidate list construction as described above may be omitted.

[0093] The decoding apparatus may generate a prediction sample for the current block based on the motion information of the current block (S520). In this case, the reference picture may be derived based on the reference picture index of the current block, and the prediction sample for the current block may be derived using a sample of a reference block to which the motion vector of the current block points on the reference picture. In this case, as described below, a prediction sample filtering procedure may be further performed on all or some of the prediction samples of the current block, depending on the circumstances.

[0094] For example, the inter prediction unit of the decoding device may include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit, and may determine a prediction mode for the current block based on the prediction mode information received by the prediction mode determination unit, derive motion information (such as a motion vector and / or a reference picture index) of the current block based on information regarding the motion information received by the motion information derivation unit, and derive a prediction sample for the current block in the prediction sample derivation unit.

[0095] The decoding apparatus generates a residual sample for the current block based on the received residual information (S530). The decoding apparatus generates a reconstructed sample for the current block based on the prediction sample and the residual sample, and can generate a reconstructed picture based on the reconstructed sample (S540). Thereafter, an in-loop filtering procedure or the like can be further applied to the reconstructed picture, as described above.

[0096] FIG. 6 exemplarily illustrates an inter prediction procedure.

[0097] 6, as described above, the inter prediction procedure may include an inter prediction mode determination step, a motion information derivation step according to the determined prediction mode, and a prediction execution step (prediction sample generation) step based on the derived motion information. The inter prediction procedure may be performed by an encoding device and a decoding device as described above. In this document, a coding device may include an encoding device and / or a decoding device.

[0098] As shown in FIG. 6, the coding device determines an inter prediction mode for a current block (S600). Various inter prediction modes may be used for prediction of a current block in a picture. For example, various modes may be used, such as merge mode, skip mode, Motion Vector Prediction (MVP) mode, Affine mode, sub-block merge mode, MMVD (Merge with MVD) mode, etc. Decoder side Motion Vector Refinement (DMVR) mode, Adaptive Motion Vector Resolution (AMVR) mode, Bi-prediction with CU-level Weight (BCW), Bi-Directional Optical Flow (BDOF), etc. may be used in addition or instead as an additional mode. Affine mode may also be referred to as affine motion prediction mode. MVP mode may also be referred to as Advanced Motion Vector Prediction (AMVP) mode. Motion information candidates derived by some modes and / or some modes in this document may also be included as one of the motion information related candidates of other modes. For example, an HMVP candidate can be added as a merge candidate of the merge / skip mode, or can be added as an MVP candidate of the MVP mode. When the HMVP candidate is used as a motion information candidate of the merge mode or skip mode, the HMVP candidate can be called an HMVP merge candidate.

[0099] Prediction mode information indicating an inter prediction mode of a current block may be signaled from an encoding device to a decoding device. The prediction mode information may be included in a bitstream and received by the decoding device. The prediction mode information may include index information indicating one of a plurality of candidate modes. Alternatively, the inter prediction mode may be indicated through hierarchical signaling of flag information. In this case, the prediction mode information may include one or more flags. For example, a skip flag may be signaled to indicate whether a skip mode can be applied, and if the skip mode is not applied, a merge flag may be signaled to indicate whether a merge mode can be applied, and if the merge mode is not applied, an MVP mode may be applied, or a flag for additional division may be further signaled. The affine mode may be signaled in an independent mode, or may be signaled in a mode dependent on the merge mode or MVP mode. For example, the affine mode may include an affine merge mode and an affine MVP mode.

[0100] The coding apparatus derives motion information for the current block (S610). The motion information may be derived based on the inter prediction mode.

[0101] The coding apparatus may perform inter prediction using motion information of the current block. The encoding apparatus may derive optimal motion information for the current block through a motion estimation procedure. For example, the encoding apparatus may 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 determined search range in the reference picture, and may derive motion information through this. The similarity of the blocks may be derived based on a difference in phase-based sample values. For example, the similarity of the blocks may be calculated based on the SAD between the current block (or the template of the current block) and the reference block (or the template of the reference block). In this case, the motion information may be derived based on the reference block with the smallest SAD in the search space. The derived motion information may be signaled to the decoding apparatus by various methods based on the inter prediction mode.

[0102] The coding apparatus performs inter prediction based on motion information for the current block (S620). The coding apparatus may derive predictive sample(s) for the current block based on the motion information. The current block including the predictive samples may be referred to as a predicted block.

[0103] Meanwhile, as described above, the encoding device can execute various encoding methods, for example, Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), Context-Adaptive Binary Arithmetic Coding (CABAC), etc. Also, the decoding device can 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, quantized values ​​of transform coefficients related to residuals, etc.

[0104] For example, the above coding method can be performed as described below.

[0105] FIG. 7 exemplarily illustrates a Context-Adaptive Binary Arithmetic Coding (CABAC) for encoding a syntax element. For example, in a CABAC encoding process, if an input signal is a syntax element that is not a binary value, an encoding apparatus may binarize the value of the input signal to convert the input signal into a binary value. Also, if the input signal is already a binary value (i.e., the value of the input signal is a binary value), binarization may not be performed and may be bypassed. Here, each binary digit 0 or 1 constituting a binary value may be referred to as a bin. For example, if a binary string after binarization is 110, each of 1, 1, and 0 is referred to as one bin. The bin(s) for one syntax element may represent the value of the syntax element.

[0106] Thereafter, the binarized bins of the syntax elements may be input to a regular encoding engine or a bypass encoding engine. The regular encoding engine of the encoding device may assign a context model reflecting a probability value to the bin and encode the bin based on the assigned context model. The regular encoding engine of the encoding device may update the context model for each bin after encoding the bin. The bins encoded as described above may be referred to as context-coded bins.

[0107] Meanwhile, when the binarized bins of the syntax elements are input to the bypass encoding engine, they can be coded as follows. For example, the bypass encoding engine of the encoding device omits a procedure of estimating a probability for an input bin and a procedure of updating a probability model applied to the bin after encoding. When bypass encoding is applied, the encoding device can encode the input bin by applying a uniform probability distribution instead of allocating a context model, thereby improving the encoding speed. The bins encoded as described above can be referred to as bypass bins.

[0108] Entropy decoding can refer to a process of performing the same process as the entropy encoding in reverse order.

[0109] For example, when a syntax element is decoded based on a context model, a decoding device can receive a bin corresponding to the syntax element through a bitstream, determine a context model using the syntax element and decoding information of a block to be decoded or a neighboring block or information of a symbol / bin decoded in a previous step, predict the occurrence probability of the received bin according to the determined context model, and derive the value of the syntax element by performing arithmetic decoding of the bin. Then, the context model of the bin to be decoded next can be updated to the determined context model.

[0110] Also, for example, when a syntax element is bypass decoded, the decoding device may receive a bin corresponding to the syntax element through a bitstream and may decode the input bin by applying a uniform probability distribution. In this case, the decoding device may omit a procedure of deriving a context model of the syntax element and a procedure of updating the context model applied to the bin after decoding.

[0111] As described above, the residual samples may be derived as quantized transform coefficients through a transform and quantization process. The quantized transform coefficients may also be referred to as transform coefficients. In this case, the transform coefficients in a block may be signaled in the form of residual information. The residual information may include a residual coding syntax. That is, an encoding device may construct a residual coding syntax as the residual information, encode the residual coding syntax, and output the residual coding syntax in the form of a bitstream, and a decoding device may decode the residual coding syntax from the bitstream to derive residual (quantized) transform coefficients. The residual coding syntax may include syntax elements indicating whether a transform has been applied to the block, where the last valid transform coefficient in the block is located, whether a valid transform coefficient exists in a sub-block, and what the magnitude / sign of the valid transform coefficient is, as described below.

[0112] For example, the syntax elements for encoding / decoding residual data can be represented as in the following table.

[0113] [Table 1-1]

[0114] [Table 1-2]

[0115] [Table 1-3]

[0116] The transform_skip_flag indicates whether or not a transform is skipped in an associated block. The transform_skip_flag may be a syntax element of a transform skip flag. The associated block may be a coding block (CB) or a transform block (TB). With respect to the transform (and quantization) and residual coding procedures, the CB and the TB may be mixed. For example, as described above, a residual sample may be derived for the CB, and a (quantized) transform coefficient may be derived through transform and quantization for the residual sample, and information (e.g., syntax elements, etc.) efficiently indicating the position, magnitude, sign, etc. of the (quantized) transform coefficient may be generated and signaled through the residual coding procedure. The quantized transform coefficient may be simply referred to as a transform coefficient. In general, if the CB is not larger than the maximum TB, the size of the CB may be the same as the size of the TB, in which case the target block to be transformed (and quantized) and residual coded may be referred to as a CB or a TB. On the other hand, if CB is greater than the maximum TB, the target block to be transformed (and quantized) and residual coded may be called a TB. Hereinafter, it will be described that syntax elements related to residual coding are signaled in units of a transform block TB, but this is merely an example, and as described above, the TB may be used interchangeably with a coding block CB.

[0117] Meanwhile, the syntax elements signaled after the conversion skip flag is signaled are the same as the syntax elements disclosed in Table 2 and / or Table 3 described below, and a detailed description of the above syntax elements is provided below.

[0118] [Table 2-1]

[0119] [Table 2-2]

[0120] [Table 2-3]

[0121] [Table 2-4]

[0122] [Table 2-5]

[0123] [Table 2-6]

[0124] [Table 3-1]

[0125] [Table 3-2]

[0126] [Table 3-3]

[0127] According to the present embodiment, as shown in Table 1, residual coding may be branched according to the value of the syntax element transform_skip_flag of the transform skip flag. That is, different syntax elements may be used for residual coding based on the value of the transform skip flag (based on whether the transform skip is available). Residual coding used when the transform skip is not applied (i.e., when the transform is applied) may be called Regular Residual Coding (RRC), and residual coding used when the transform skip is applied (i.e., when the transform is not applied) may be called Transform Skip Residual Coding (TSRC). The regular residual coding may also be called general residual coding. The regular residual coding may also be called general residual coding. The regular residual coding may also be called a syntax structure of regular residual coding, and the transform skip residual coding may also be called a syntax structure of transform skip residual coding. Table 2 above may represent the syntax elements for residual coding when the value of transform_skip_flag is 0, i.e., when a transform is applied, and Table 3 may represent the syntax elements for residual coding when the value of transform_skip_flag is 1, i.e., when a transform is not applied.

[0128] Specifically, for example, a transform skip flag indicating whether transform skip of a transform block is available may be parsed, and it may be determined whether the transform skip flag is 1. If the value of the transform skip flag is 0, syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gtx_flag, par_level_flag, abs_remainder, coeff_sign_flag, and / or dec_abs_level related to residual coefficients of the transform block may be parsed, as shown in Table 2, and the residual coefficients may be derived based on the syntax elements. In this case, the syntax elements may be parsed sequentially, or the order of parsing may be changed. Furthermore, the abs_level_gtx_flag may represent abs_level_gt1_flag and / or abs_level_gt3_flag. For example, abs_level_gtx_flag[n][0] may be an example of a first transform coefficient level flag (abs_level_gt1_flag), and the abs_level_gtx_flag[n][1] may be an example of a second transform coefficient level flag (abs_level_gt3_flag).

[0129] Referring to Table 2 above, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, abs_remainder, coeff_sign_flag, and / or dec_abs_level may be encoded / decoded. Meanwhile, the sb_coded_flag may also be expressed as coded_sub_block_flag.

[0130] In one embodiment, the encoding device may encode (x, y) position information of the last non-zero transform coefficient in a transform block based on syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. More specifically, the last_sig_coeff_x_prefix represents a prefix of the column position of the last significant coefficient in the scanning order in the transform block, the last_sig_coeff_y_prefix represents a prefix of the row position of the last significant coefficient in the scanning order in the transform block, the last_sig_coeff_x_suffix represents a suffix of the column position of the last significant coefficient in the scanning order in the transform block, and the last_sig_coeff_y_suffix represents a suffix of the row position of the last significant coefficient in the scanning order in the transform block. Here, the significant coefficient may represent the non-zero coefficient. In addition, the scan order may be a top right diagonal scan order. Alternatively, the scan order may be a horizontal scan order or a vertical scan order. The scan order may be determined based on whether intra / inter prediction is applied to the current block (CB, or CB including TB) and / or a specific intra / inter prediction mode.

[0131] Next, the encoding device divides the transform block into 4x4 sub-blocks, etc., and then can use a 1-bit syntax element coded_sub_block_flag for each 4x4 sub-block to indicate whether or not there is a non-zero coefficient in the current sub-block.

[0132] If the value of coded_sub_block_flag is 0, there is no more information to transmit, so the encoding device can end the encoding process for the current sub-block. Conversely, if the value of coded_sub_block_flag is 1, the encoding device can continue the encoding process for sig_coeff_flag. Since the last sub-block containing a non-zero coefficient does not need to be coded for coded_sub_block_flag, and since the sub-block containing DC information of the transform block is highly likely to contain a non-zero coefficient, coded_sub_block_flag can be assumed to be 1 without being coded.

[0133] If the value of coded_sub_block_flag is 1 and it is determined that a non-zero coefficient exists in the current sub-block, the encoding apparatus may encode sig_coeff_flag having a binary value according to a reverse scanning order. The encoding apparatus may encode a 1-bit syntax element sig_coeff_flag for each transform coefficient according to the scanning order. If the value of the transform coefficient at the current scanning position is not 0, the value of sig_coeff_flag may be 1. Here, in the case of a sub-block including the last non-zero coefficient, since sig_coeff_flag does not need to be encoded for the last non-zero coefficient, the encoding process for the sub-block may be omitted. Level information encoding may be performed only when sig_coeff_flag is 1, and four syntax elements may be used in the level information encoding process. More specifically, each sig_coeff_flag[xC][yC" may indicate whether the level (value) of the transform coefficient at each transform coefficient position (xC, yC) in the current TB is non-zero. In one embodiment, the sig_coeff_flag may be an example of a syntax element of a significant coefficient flag indicating whether the quantized transform coefficient is a significant coefficient other than zero.

[0134] The remaining level value after encoding for sig_coeff_flag may be derived as follows: That is, a syntax element remAbsLevel representing a level value to be encoded may be derived as follows: remAbsLevel=[sig_coeff_flag+remAbsLevel+remAbsLevel]=[sig_coeff_flag+remAbsLevel].

[0135] <Formula 1>

number

[0136] Here, coeff means the actual transform coefficient value.

[0137] Furthermore, abs_level_gt1_flag may indicate whether the remAbsLevel at the corresponding scan position (n) is greater than 1. For example, if the value of abs_level_gt1_flag is 0, the absolute value of the transform coefficient at the corresponding position may be 1. Furthermore, if the value of abs_level_gt1_flag is 1, the remAbsLevel representing the level value to be coded thereafter may be updated according to the following formula.

[0138] <Formula 2>

number

[0139] In addition, the least significant coefficient (LSB) value of remAbsLevel described in the above Equation 2 can be encoded as shown in the following Equation 3 via par_level_flag.

[0140] <Formula 3>

number

[0141] Here, par_level_flag[n] may represent the parity of the transform coefficient level (value) at scan position n.

[0142] The level value remAbsLevel of the transform coefficient to be encoded after encoding par_level_flag can be updated according to the following formula.

[0143] <Formula 4>

number

[0144] abs_level_gt3_flag may indicate whether the remAbsLevel at the corresponding scan position (n) is greater than 3. Encoding for abs_remainder can be performed only if abs_level_gt3_flag is 1. The relationship between the actual transform coefficient value coeff and each syntax element is as follows:

[0145] <Formula 5>

number

[0146] The following table also shows an example related to Equation 5 above.

[0147] [Table 4]

[0148] Here, |coeff| represents the level (value) of a transform coefficient, and may be expressed as AbsLevel for the transform coefficient. Also, the sign of each coefficient may be encoded using coeff_sign_flag, which is a 1-bit symbol.

[0149] Also, for example, when the value of the transform skip flag is 1, the syntax elements sb_coded_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag, par_level_flag, and / or abs_remainder related to the residual coefficients of the transform block may be parsed, and the residual coefficients may be derived based on the syntax elements, as shown in Table 3. In this case, the syntax elements may be parsed sequentially, or the order of parsing may be changed. Also, the abs_level_gtx_flag may represent abs_level_gt1_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag, and / or abs_level_gt9_flag. For example, abs_level_gtx_flag[n][j] may be a flag indicating whether the absolute value or level (value) of a transform coefficient at scan position n is greater than (j<<1)+1, where (j<<1)+1 may be replaced with a predetermined threshold value such as a first threshold value, a second threshold value, etc., depending on the case.

[0150] On the other hand, CABAC provides high performance but has a drawback of poor throughput performance. This is due to the regular encoding engine of CABAC, and regular encoding (i.e., encoding via the regular encoding engine of CABAC) uses probability states and ranges updated through encoding of previous bins, so it shows high data dependency and may take a long time to read the probability interval and determine the current state. The throughput problem of CABAC can be solved by limiting the number of context-coded bins. For example, as shown in Table 2 above, the sum of bins used to express sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag may be limited to a number according to the size of the block. Also, for example, as in Table 3 above, the sum of the bins used to represent sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag abs_level_gt5_flag, abs_level_gt7_flag, and abs_level_gt9_flag may be limited to a number depending on the size of the block. As an example, if the block is a 4x4 size block, the sum of the bins for the above sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag or sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag abs_level_gt5_flag, abs_level_gt7_flag, abs_level_gt9_flag may be limited to 32 (or, for example, 28), and if the block is a 2x2 size block, the sum of the bins for the above sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag may be limited to 8 (or, for example, 7).The limited number of bins may be represented by remBinsPass1 or RemCcbs. Alternatively, for example, for higher CABAC throughput, the number of context coded bins may be limited for a block (CB or TB) including a CG to be coded. In other words, the number of context coded bins may be limited on a block (CB or TB) basis. For example, if the size of the current block is 16x16, the number of context coded bins for the current block may be limited to 1.75 times the number of pixels of the current block, i.e., 448, regardless of the current CG.

[0151] In this case, when the encoding apparatus uses all of the limited number of context coding bins for coding the context elements, it may perform bypass coding by binarizing the remaining coefficients through a binarization method for the coefficients described below without using context coding. In other words, for example, when the number of context coding bins coded for a 4x4 CG is 32 (or, for example, 28), or the number of context coding bins coded for a 2x2 CG is 8 (or, for example, 7), sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded at the context coding bins may not be coded any more, and may be coded at dec_abs_level immediately. Alternatively, for example, if the number of context coded bins coded for a 4x4 block is limited to 1.75 times the number of pixels in the entire block, i.e., 28, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded in the context coding bins may not be coded any further, and may be immediately coded in dec_abs_level as shown in Table 5 below.

[0152] [Table 5]

[0153] A |coeff| value may be derived based on dec_abs_level. In this case, the transform coefficient value |coeff| may be derived as follows:

[0154] <Formula 6>

number

[0155] Furthermore, the coeff_sign_flag indicates the sign of the transform coefficient level at the scan position (n). That is, the coeff_sign_flag indicates the sign of the transform coefficient at the scan position (n).

[0156] FIG. 8 is a diagram showing an example of transform coefficients in a 4×4 block.

[0157] The 4x4 blocks in Figure 8 show an example of quantized coefficients. The blocks shown in Figure 8 may be 4x4 transform blocks or 4x4 sub-blocks of 8x8, 16x16, 32x32, 64x64 transform blocks. The 4x4 blocks in Figure 8 show luma or chroma blocks.

[0158] Meanwhile, as described above, when an input signal is a syntax element that is not a binary value, the encoding apparatus can binarize the value of the input signal to convert the input signal into a binary value. Also, the decoding apparatus can decode the syntax element to derive a binarized value (i.e., a binarized bin) of the syntax element, and can de-binarize the binarized value to derive the value of the syntax element. The binarization process can be performed as a Truncated Rice (TR) binarization process, a k-th order Exp-Golomb (EGk) binarization process, a k-th order Limited Exp-Golomb (Limited k-th order Exp-Golomb, Limited EGk), or a Fixed-Length (FL) binarization process, which will be described later. Also, the inverse binarization process may represent a process of deriving the value of the syntax element based on the TR binarization process, the EGk binarization process, or the FL binarization process.

[0159] For example, the above TR binarization process can be performed as follows.

[0160] The input of the TR binarization process may be the request for TR binarization and the syntax elements cMax and cRiceParam, and the output of the TR binarization process may be the TR binarization for the value symbolVal corresponding to the bin string.

[0161] Specifically, as an example, if a suffix bin string exists for a syntax element, the TR bin string for the syntax element may be a concatenation of a prefix bin string and a suffix bin string, and if the suffix bin string does not exist, the TR bin string for the syntax element may be the prefix bin string. For example, the prefix bin string may be derived as described below.

[0162] The prefix value of the symbolVal for the syntax element can be derived as follows:

[0163] <Formula 7>

number

[0164] Here, prefixVal may represent a prefix value of the symbolVal. The prefix of the TR bin string of the syntax element (ie, the prefix bin string) may be derived as described below.

[0165] For example, if prefixVal is less than cMax>>cRiceParam, the prefix bin string can be a bit string of length prefixVal+1 indexed by binIdx. That is, if prefixVal is less than cMax>>cRiceParam, the prefix bin string can be a bit string of prefixVal+1 bits pointed to by binIdx. The bin for binIdx less than prefixVal can be equal to 1. Also, the bin for binIdx equal to prefixVal can be equal to 0.

[0166] For example, the bin string derived by unary binarization for the above prefixVal can be as shown in the following table.

[0167] [Table 6]

[0168] On the other hand, when the above prefixVal is not smaller than cMax >> cRiceParam, the prefix bit string can be a bit string with a length of cMax >> cRiceParam and all bits being 1.

[0169] Also, when cMax is larger than symbolVal and cRiceParam is larger than 0, a suffix bit string of the TR bin string may exist. For example, the above suffix bit string can be derived as described later.

[0170] The suffix value of the above symbolVal for the above syntax element can be derived as in the following formula.

[0171] <Formula 8> [Number]

[0172] Here, suffixVal can represent the suffix value of the above symbolVal.

[0173] The suffix of the TR bin string (i.e., the suffix bit string) can be derived based on the FL binarization process for suffixVal where the cMax value is (1 << cRiceParam) - 1.

[0174] On the other hand, if the value of the input parameter cRiceParam is 0, the TR binarization can be a exactly truncated unary binarization, and a cMax value equal to the maximum possible value of the syntax element being decoded can always be used.

[0175] Also, for example, the EGk binarization process can be performed as follows: The syntax elements coded in ue(v) can be Exp-Golomb coded syntax elements.

[0176] As an example, a 0-th order Exp-Golomb (EG0) binarization process can be performed as follows.

[0177] The parsing process for the above syntax element can begin by starting from the current position in the bitstream, reading the bits including the first non-zero bit, and counting the number of leading bits such as 0. The above process can be represented as follows:

[0178] [Table 7]

[0179] Moreover, the variable codeNum can be derived using the following formula:

[0180] <Formula 9>

number

[0181] Here, the value returned by read_bits(leadingZeroBits), i.e., the value represented by read_bits(leadingZeroBits), can be interpreted as a binary representation of an unsigned integer for the most significant bit recorded first.

[0182] The structure of the Exp-Golomb code, which separates a bit string into "prefix" bits and "suffix" bits, can be represented as in the following table.

[0183] [Table 8]

[0184] The "prefix" bits are the bits parsed as described above for the leadingZeroBits calculation and may be denoted as 0 or 1 in the bit string in Table 8 above. That is, a bit string starting with 0 or 1 in Table 8 above may indicate a prefix bit string. The "suffix" bits are the bits parsed in the codeNum calculation and are denoted as xi in Table 8 above. That is, a bit string starting with xi in Table 8 above may indicate a suffix bit string, where i may be a value ranging from 0 to LeadingZeroBits-1. Also, each xi may be equal to 0 or 1.

[0185] The bit strings assigned to the above codeNum are as follows:

[0186] [Table 9]

[0187] If the descriptor of a syntax element is ue(v), i.e., if the syntax element is coded with ue(v), the value of the syntax element may be the same as codeNum.

[0188] Also, for example, the above EGk binarization process can be performed as follows.

[0189] An input of the EGk binarization process may be a request for EGk binarization, and an output of the EGk binarization process may be an EGk binarization for a value symbolVal corresponding to a bin string.

[0190] The bit string of the EGk binarization process for symbolVal can be derived as follows:

[0191] [Table 10]

[0192] Referring to Table 10 above, a binary value X can be added to the end of the bin string via each call to put(x), where x can be 0 or 1.

[0193] Also, for example, the Limited EGk binarization process can be performed as follows.

[0194] The input of the Limited EGk binarization process may be the request for Limited EGk binarization and the Rice parameter riceParam, a variable representing the binary logarithm of the maximum value log2TransformRange, and a variable representing the maximum prefix extension length maxPreExtLen, and the output of the Limited EGk binarization process may be the Limited EGk binarization for the value symbolVal corresponding to the bin string.

[0195] The bit string of the Limited EGk binarization process for symbolVal can be derived as follows:

[0196] [Table 11]

[0197] Also, for example, the above FL binarization process can be performed as follows.

[0198] The input of the FL binarization process may be a request for FL binarization and cMax for the syntax element, and the output of the FL binarization process may be the FL binarization for the value symbolVal corresponding to the bin string.

[0199] The FL binarization may be implemented using a bit string having a number of bits that is a fixed length of the symbol value symbolVal, where the fixed length bits may be an unsigned integer bit string. That is, the FL binarization may derive a bit string for the symbol value symbolVal, and the bit length (i.e., the number of bits) of the bit string may be a fixed length.

[0200] For example, the fixed length can be derived as follows:

[0201] <Formula 10>

number

[0202] The indexing of bins for FL binarization may be a scheme using values ​​that increase in order from the most significant bit to the least significant bit. For example, the bin index associated with the most significant bit may be binIdx=0.

[0203] Meanwhile, for example, a binarization process for the syntax element abs_remainder of the residual information may be performed as follows.

[0204] The input of the binarization process for the abs_remainder may be a binarization request for the syntax element abs_remainder[n], a color component cIdx, and a luma position (x0, y0), which may refer to the top left sample of the current luma transform block relative to the top left luma sample of the picture.

[0205] The output of the binarization process for the abs_remainder may be the binarization of the abs_remainder (i.e., a binarized bin string of the abs_remainder). The binarization process may derive a usable bin string for the abs_remainder, etc.

[0206] The Rice parameter cRiceParam for the abs_remainder[n] may be derived through a Rice parameter derivation process that is performed using the hue component cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), log2TbWidth, which is the binary logarithm of the width of the transform block, and log2TbHeight, which is the binary logarithm of the height of the transform block, as inputs. A detailed description of the Rice parameter derivation process will be given later.

[0207] Also, for example, cMax for the currently coded abs_remainder[n] may be derived based on the Rice parameter cRiceParam. The cMax may be derived as follows:

[0208] <Formula 11>

number

[0209] Meanwhile, the binarization for the abs_remainder, i.e., the bin string for the abs_remainder, may be the concatenation of a prefix bin string and a suffix bin string if a suffix bin string exists, and may be the prefix bin string if the suffix bin string does not exist.

[0210] For example, the prefix bin string may be derived as described below.

[0211] The prefix value prefixVal of the abs_remainder[n] can be derived as follows:

[0212] <Formula 12>

number

[0213] A prefix of the bin string of the abs_remainder[n] (ie, a prefix bin string) may be derived through a TR binarization process on the prefixVal using the cMax and the cRiceParam as inputs.

[0214] If the prefix bin string is the same as a bit string with all bits being 1 and bit length being 6, then there may be a suffix bin string of the bin string of abs_remainder[n], which may be derived as described below.

[0215] The process of deriving the Rice parameter for abs_remainder[n] is as follows.

[0216] The input of the Rice parameter derivation process may be a colour component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of the transform block, log2TbWidth, and a binary logarithm of the height of the transform block, log2TbHeight. The luma position (x0, y0) may refer to the top-left sample of the current luma transform block relative to the top-left luma sample of the picture. And, the output of the Rice parameter derivation process may be the Rice parameter cRiceParam.

[0217] For example, based on a given component index cIdx and an array AbsLevel[x][y] for a transform block having the upper left luma position (x0, y0), the variable locSumAbs can be derived as shown in the pseudo code disclosed in the following table.

[0218] [Table 12]

[0219] Then, based on the given variable locSumAbs, the rice parameter cRiceParam can be derived as shown in the following table.

[0220] [Table 13]

[0221] Also, for example, in the process of deriving the Rice parameter for abs_remainder[n], baseLevel can be set to 4.

[0222] Alternatively, the Rice parameter cRiceParam may be determined based on whether a transform skip is enabled for the current block, for example, i.e., if no transform is applied to the current TB containing the current CG, in other words, if a transform skip is applied to the current TB containing the current CG, the Rice parameter cRiceParam may be derived to be 1.

[0223] In addition, the suffix value suffixVal of the abs_remainder can be derived as follows:

[0224] <Formula 13>

number

[0225] The suffix bin string of the bin string of the abs_remainder may be derived by a Limited EGk binarization process on the suffixVal where k is set to cRiceParam+1, riceParam is set to cRiceParam, log2TransformRange is set to 15, and maxPreExtLen is set to 11.

[0226] Meanwhile, for example, a binarization process for the syntax element dec_abs_level of the residual information may be performed as follows.

[0227] The input of the binarization process for the dec_abs_level may be a binarization request of the syntax element dec_abs_level[n], a color component cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of the transform block, log2TbWidth, and a binary logarithm of the height of the transform block, log2TbHeight. The luma position (x0, y0) may refer to the top left sample of the current luma transform block with respect to the top left luma sample of the picture.

[0228] The output of the binarization process for the dec_abs_level may be the binarization of the dec_abs_level (i.e., the binarized bin string of the dec_abs_level). The binarization process may derive a usable bin string for the dec_abs_level, etc.

[0229] The Rice parameter cRiceParam for the dec_abs_level[n] can be derived through a Rice parameter derivation process that is performed using the hue component cIdx, luma position (x0, y0), current coefficient scan position (xC, yC), log2TbWidth, which is the binary logarithm of the width of the transform block, and log2TbHeight, which is the binary logarithm of the height of the transform block, as inputs. The Rice parameter derivation process will be described in detail later.

[0230] Also, for example, cMax for the dec_abs_level[n] can be derived based on the Rice parameter cRiceParam. The cMax can be derived as follows:

[0231] <Formula 14>

number

[0232] Meanwhile, the binarization for the dec_abs_level[n], i.e., the bin string for the dec_abs_level[n], may be a concatenation of a prefix bin string and a suffix bin string if a suffix bin string exists, or, if the suffix bin string does not exist, the bin string for the dec_abs_level[n] may be the prefix bin string.

[0233] For example, the prefix bin string can be derived as described below.

[0234] The prefix value prefixVal of the dec_abs_level[n] can be derived as follows:

[0235] <Formula 15>

number

[0236] The prefix of the bin string of the dec_abs_level[n] (ie, the prefix bin string) may be derived by a TR binarization process on the prefixVal using the cMax and the cRiceParam as input.

[0237] If the prefix bin string is identical to a bit string with all bits being 1 and bit length being 6, then a suffix bin string of the bin string of dec_abs_level[n] may exist and may be derived as described below.

[0238] The Rice parameter derivation process for dec_abs_level[n] can be as follows.

[0239] The input of the Rice parameter derivation process may be a color component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of a transform block, log2TbWidth, and a binary logarithm of the height of a transform block, log2TbHeight. The luma position (x0, y0) may refer to the top left sample of a current luma transform block based on the top left luma sample of a picture. Also, an output of the Rice parameter derivation process may be the Rice parameter cRiceParam.

[0240] For example, based on a given component index cIdx and an array AbsLevel[x][y] for a transform block having the top left luma position (x0, y0), the variable locSumAbs can be derived as shown in the pseudo code disclosed in the following table.

[0241] [Table 14]

[0242] Then, based on the given variable locSumAbs, the rice parameter cRiceParam can be derived as shown in the following table.

[0243] [Table 15]

[0244] Also, for example, in the process of deriving the Rice parameter for dec_abs_level[n], baseLevel can be set to 0, and ZeroPos[n] can be derived as follows:

[0245] <Formula 16>

number

[0246] In addition, the suffix value suffixVal of the dec_abs_level[n] can be derived as follows:

[0247] <Formula 17>

number

[0248] The suffix bin string of the bin string of the dec_abs_level[n] may be derived through a Limited EGk binarization process on the suffixVal, where k is set to cRiceParam+1, truncSuffixLen is set to 15, and maxPreExtLen is set to 11.

[0249] Meanwhile, the above-mentioned RRC and TSRC may have the following differences.

[0250] For example, the Rice parameter cRiceParam of the syntax elements abs_remainder[] and dec_abs_level[] in the RRC may be derived based on the locSumAbs, look-up table, and / or baseLevel as described above, but the Rice parameter cRiceParam of the syntax element abs_remainder[] in the TSRC may be derived as 1. That is, for example, if a transform skip is applied to a current block (e.g., a current TB), the Rice parameter cRiceParam for abs_remainder[] of the TSRC for the current block may be derived as 1.

[0251] - Also, for example, referring to Tables 3 and 4, in RRC, abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1] may be signaled, while in TSRC, abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3] and abs_level_gtx_flag[n][4] may be signaled. Here, the above abs_level_gtx_flag[n][0] may be expressed as abs_level_gt1_flag or the first coefficient level flag, the above abs_level_gtx_flag[n][1] may be expressed as abs_level_gt3_flag or the second coefficient level flag, the above abs_level_gtx_flag[n][2] may be expressed as abs_level_gt5_flag or the third coefficient level flag, the above abs_level_gtx_flag[n][3] may be expressed as abs_level_gt7_flag or the fourth coefficient level flag, and the above abs_level_gtx_flag[n][4] may be expressed as abs_level_gt9_flag or the fifth coefficient level flag. Specifically, the first coefficient level flag may be a flag regarding whether the coefficient level is greater than a first threshold (e.g., 1), the second coefficient level flag may be a flag regarding whether the coefficient level is greater than a second threshold (e.g., 3), the third coefficient level flag may be a flag regarding whether the coefficient level is greater than a third threshold (e.g., 5), the fourth coefficient level flag may be a flag regarding whether the coefficient level is greater than a fourth threshold (e.g., 7), and the fifth coefficient level flag may be a flag regarding whether the coefficient level is greater than a fifth threshold (e.g., 9). As described above, the TSRC may further include abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], and abs_level_gtx_flag[n][4] in addition to abs_level_gtx_flag[n][0] and abs_level_gtx_flag[n][1], in comparison with the RRC.

[0252] - Also, for example, the syntax element coeff_sign_flag may be bypass coded in RRC, but the syntax element coeff_sign_flag may be bypass coded or context coded in TSRC.

[0253] Also, for the quantization process of the residual samples, dependent quantization may be proposed. Dependent quantization may refer to a scheme in which a set of permitted reconstruction values ​​for a current transform coefficient depends on the value (value of a transform coefficient level) of a transform coefficient preceding the current transform coefficient in the reconstruction order. That is, for example, dependent quantization may be realized by (a) defining two scalar quantizers for which a reconstruction level is different, and (b) defining a process for switching between the scalar quantizers. The dependent quantization may have an effect that permitted reconstruction vectors are more densely packed in an N-dimensional vector space than the existing independent scalar quantization, where N may represent the number of transform coefficients of a transform block.

[0254] FIG. 9 exemplarily illustrates a scalar quantizer used in dependent quantization. Referring to FIG. 9, the location of the available reconstruction levels may be specified as the size of the quantization step Δ. Referring to FIG. 9, the scalar quantizers may be represented as Q0 and Q1. The scalar quantizer used may be derived without being explicitly signaled in the bitstream. For example, the quantizer used for a current transform coefficient may be determined by the parity of the transform coefficient level preceding the current transform coefficient in the coding / reconstruction order.

[0255] FIG. 10 illustrates an exemplary state transition and quantizer selection for dependent quantization.

[0256] 10, switching between two scalar quantizers (Q0 and Q1) can be realized by a state machine having four states. The four states can have four different values ​​(0, 1, 2, 3). The state for a current transform coefficient can be determined by the parity of the transform coefficient level before the current transform coefficient in the coding / reconstruction order.

[0257] For example, when an inverse quantization process for a transform block is started, a state for dependent quantization may be set to 0. Then, the transform coefficients for the transform block may be restored in a scan order (i.e., the same order as those entropy decoded). For example, after a current transform coefficient is restored, a state for dependent quantization may be updated as shown in FIG. 10. In the scan order, an inverse quantization process for a transform coefficient restored after the current transform coefficient is restored may be performed based on the updated state. k shown in FIG. 10 may represent a value of a transform coefficient, i.e., a level value of a transform coefficient. For example, if the current state is 0, if k (value of the current transform coefficient) & 1 is 0, the state may be updated to 0, and if k & 1 is 1, the state may be updated to 2. Also, for example, if the current state is 1, if k & 1 is 0, the state may be updated to 2, and if k & 1 is 1, the state may be updated to 0. Also, for example, if the current state is 2, if k&1 is 0, the state may be updated to 1, and if k&1 is 1, the state may be updated to 3. Also, for example, if the current state is 3, if k&1 is 0, the state may be updated to 3, and if k&1 is 1, the state may be updated to 1. Referring to FIG. 10, if the state is one of 0 and 1, the scalar quantizer used in the inverse quantization process may be Q0, and if the state is one of 2 and 3, the scalar quantizer used in the inverse quantization process may be Q1. The transform coefficients may be inverse quantized based on a quantization parameter for the restoration level of the transform coefficient with the scalar quantizer for the current state.

[0258] Meanwhile, this document proposes embodiments related to residual data coding. The embodiments described in this document may be combined with each other. As mentioned above, the residual data coding method may include Regular Residual Coding (RRC) and Transform Skip Residual Coding (TSRC).

[0259] Of the above two methods, the residual data coding method for the current block may be determined based on the values ​​of transform_skip_flag and sh_ts_residual_coding_disabled_flag, as shown in Table 1. Here, the syntax element sh_ts_residual_coding_disabled_flag may indicate whether the TSRC is available. Thus, even if the transform_skip_flag indicates that the transform is skipped, if the sh_ts_residual_coding_disabled_flag indicates that the TSRC is not available, a syntax element by RRC may be signaled for the transform skipped block. That is, if the value of transform_skip_flag is 0 or the value of slice_ts_residual_coding_disabled_flag is 1, RRC may be used, and otherwise TSRC may be used.

[0260] Although the slice_ts_residual_coding_disabled_flag can be used to achieve high coding efficiency in certain applications (e.g., lossless coding), existing video / image coding standards do not propose any constraints on when the aforementioned dependent quantization and the slice_ts_residual_coding_disabled_flag are used together. That is, when dependent quantization is activated at a higher level (e.g., Sequence Parameter Set (SPS) syntax / Video Parameter Set (VPS) syntax / Decoding Parameter Set (DPS) syntax / picture header syntax / slice header syntax, etc.) or at a lower level (CU / TU) and the slice_ts_residual_coding_disabled_flag is 1, a value that depends on the state of dependent quantization in RRC may perform an unnecessary operation (i.e., an operation due to dependent quantization), resulting in a decrease in coding performance, or an unintentional loss of coding performance may occur due to incorrect settings in the encoding device. Therefore, in this embodiment, a proposal is proposed to set dependencies / constraints between dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding residual samples of transform skip blocks in the current slice by RRC) in order to prevent them from being used together, causing unintended coding loss or malfunction.

[0261] In one embodiment, this document proposes a method in which slice_ts_residual_coding_disabled_flag is subordinate to ph_dep_quant_enabled_flag. For example, the syntax elements proposed in this embodiment are as shown in the following table.

[0262] [Table 16]

[0263] According to the present embodiment, the slice_ts_residual_coding_disabled_flag may be signaled when the value of the ph_dep_quant_enabled_flag is 0. Here, the ph_dep_quant_enabled_flag may indicate whether dependent quantization is enabled. For example, when the value of the ph_dep_quant_enabled_flag is 1, the ph_dep_quant_enabled_flag may indicate that dependent quantization is enabled, and when the value of the ph_dep_quant_enabled_flag is 0, the ph_dep_quant_enabled_flag may indicate that dependent quantization is not enabled.

[0264] Therefore, according to the present embodiment, the slice_ts_residual_coding_disabled_flag may be signaled only when the dependent quantization is not enabled, and when the dependent quantization is enabled and the slice_ts_residual_coding_disabled_flag is not signaled, the slice_ts_residual_coding_disabled_flag may be regarded as 0 (infer). Meanwhile, the ph_dep_quant_enabled_flag and the slice_ts_residual_coding_disabled_flag may be signaled in a picture header syntax and / or a slice header syntax, or may be signaled in other higher level syntax (High Level Syntax, HLS) (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or lower level (CU / TU) other than the picture header syntax and slice header syntax. If the ph_dep_quant_enabled_flag is signaled in a syntax other than the picture header syntax, it may be referred to by other names, for example, the ph_dep_quant_enabled_flag may be represented as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or sps_dep_quant_enabled_flag.

[0265] In addition, this document proposes another embodiment for setting a dependency / constraint between dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding residual samples of a transform skip block in a current slice by RRC). For example, this embodiment proposes a scheme for not using the dependent quantization state in coding of level values ​​of transform coefficients when the value of slice_ts_residual_coding_disabled_flag is 1, in order to prevent unintended coding loss or malfunction caused by the combined use of dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding residual samples of a transform skip block in a current slice by RRC). The syntax of residual coding according to this embodiment is as shown in the following table.

[0266] [Table 17-1]

[0267] [Table 17-2]

[0268] [Table 17-3]

[0269] [Table 17-4]

[0270] [Table 17-5]

[0271] [Table 17-6]

[0272] Referring to Table 17 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, a QState may be derived, and a transform coefficient value (transform coefficient level) may be derived based on the QState. For example, referring to Table 17, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived by (2*AbsLevel[xC][yC]-(QState>1?1:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] may be a sign flag syntax element representing the sign of the transform coefficient, and (QState>1?1:0) may represent that the value is 1 when the value of the state QState is greater than 1, i.e., when the value of the state QState is 2 or 3, and 0 when the value of the state QState is less than or equal to 1, i.e., when the value of the state QState is 0 or 1.

[0273] Also, referring to Table 17, when the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. For example, referring to Table 17, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived by AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, and coeff_sign_flag[n] may be a syntax element of a sign flag representing the sign of the transform coefficient.

[0274] Also, according to the present embodiment, when the value of slice_ts_residual_coding_disabled_flag is 1, the dependent quantization state is not used in coding the level value of the transform coefficient, and the update of the state may not be performed. For example, the syntax of the residual coding according to the present embodiment is as shown in the following table.

[0275] [Table 18-1]

[0276] [Table 18-2]

[0277] [Table 18-3]

[0278] [Table 18-4]

[0279] [Table 18-5]

[0280] [Table 18-6]

[0281] Referring to Table 18 above, if the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, the QState may be updated. For example, if the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, the QState may be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC]&1] or QStateTransTable[QState][AbsLevel[xC][yC]&1]. Also, if the value of slice_ts_residual_coding_disabled_flag is 1, the process of updating the QState may not be performed.

[0282] Also, referring to Table 18 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, the value of the transform coefficient (transform coefficient level) may be derived based on the QState. For example, referring to Table 18, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived by (2*AbsLevel[xC][yC]-(QState>1?1:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] may be a sign flag syntax element representing the sign of the transform coefficient, and (QState>1?1:0) may represent that the value is 1 when the value of the state QState is greater than 1, i.e., when the value of the state QState is 2 or 3, and 0 when the value of the state QState is less than or equal to 1, i.e., when the value of the state QState is 0 or 1.

[0283] Also, referring to Table 18 above, when the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. For example, referring to Table 18, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived by AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, and coeff_sign_flag[n] may be a syntax element of a sign flag representing the sign of the transform coefficient.

[0284] This document also proposes another embodiment for setting a dependency / constraint between dependent quantization and residual coding (i.e., coding residual samples of transform skip blocks in the current slice by RRC) when slice_ts_residual_coding_disabled_flag=1. For example, this embodiment proposes a scheme for adding a constraint using transform_skip_flag to a process of deriving a value of a transform coefficient (transform coefficient level) depending on a state update or state of dependent quantization in RRC. That is, this embodiment proposes a scheme for not using a process of deriving a value of a transform coefficient (transform coefficient level) depending on a state update and / or state of dependent quantization in RRC based on the transform_skip_flag. The syntax of residual coding according to this embodiment is as shown in the following table.

[0285] [Table 19-1]

[0286] [Table 19-2]

[0287] [Table 19-3]

[0288] [Table 19-4]

[0289] [Table 19-5]

[0290] [Table 19-6]

[0291] Referring to Table 19 above, if the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, the QState may be updated. For example, if the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, the QState may be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC]&1] or QStateTransTable[QState][AbsLevel[xC][yC]&1]. Also, if the value of transform_skip_flag is 1, the process of updating the QState may not be performed.

[0292] Also, referring to Table 19 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, a QState may be derived, and a transform coefficient value (transform coefficient level) may be derived based on the QState. For example, referring to Table 19, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived by (2*AbsLevel[xC][yC]-(QState>1?1:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] may be a sign flag syntax element representing the sign of the transform coefficient, and (QState>1?1:0) may represent that the value is 1 when the value of the state QState is greater than 1, i.e., when the value of the state QState is 2 or 3, and 0 when the value of the state QState is less than or equal to 1, i.e., when the value of the state QState is 0 or 1.

[0293] Also, referring to Table 19, when the value of transform_skip_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. Therefore, when residual data by RRC is coded for a transform skip block, the value of the transform coefficient may be derived without using QState. For example, referring to Table 19, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived by AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be an absolute value of the transform coefficient derived based on the syntax element of the transform coefficient, and coeff_sign_flag[n] may be a syntax element of a sign flag representing the sign of the transform coefficient.

[0294] Meanwhile, as mentioned above, the information (syntax elements) in the syntax tables disclosed in this document can be included in image / video information, configured / encoded by an encoding device, and transmitted to a decoding device in the form of a bitstream. The decoding device can parse / decode the information (syntax elements) in the syntax tables. The decoding device can perform a block / image / video reconstruction procedure based on the decoded information.

[0295] FIG. 11 is a schematic diagram of an image encoding method by an encoding device according to the present document. The method disclosed in FIG. 11 can be performed by the encoding device disclosed in FIG. 2. Specifically, for example, S1100 in FIG. 11 can be performed by a prediction unit of the encoding device, and S1110 to S1160 in FIG. 11 can be performed by an entropy coding unit of the encoding device. Also, although not shown, a process of deriving residual samples for the current block based on original samples and predicted samples for the current block can be performed by a subtraction unit of the encoding device, and a process of generating reconstructed samples and reconstructed pictures for the current block based on residual samples and predicted samples for the current block can be performed by an addition unit of the encoding device.

[0296] The encoding apparatus derives a prediction sample of a current block based on inter prediction (S1100). For example, the encoding apparatus may derive an inter prediction mode and motion information of a current block, and generate a prediction sample of the current block. Here, the steps of determining an inter prediction mode, deriving motion information, and generating a prediction sample may be performed simultaneously as described above, or any step may be performed prior to the other steps. For example, the encoding apparatus may search for a block similar to the current block within a certain area (search area) of a reference picture through motion estimation, and derive a reference block whose difference with the current block is minimum or equal to or less than a certain criterion. Based on this, the encoding apparatus may derive an index of a reference picture indicating a reference picture in which the reference block is located, and may derive a motion vector based on a position difference between the reference block and the current block. The encoding apparatus may determine an inter prediction mode to be applied to the current block from among various inter prediction modes. For example, the encoding apparatus may compare RD costs for the various inter prediction modes and determine an optimal inter prediction mode for the current block.

[0297] For example, the encoding device may construct a motion information candidate list for the current block, and 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 motion information candidates included in the motion information candidate list. In this case, a motion information candidate associated with the derived reference block may be selected, and motion information of the current block may be derived based on the motion information of the selected motion information candidate.

[0298] The encoding device encodes prediction related information for the current block (S1110). The image information may include prediction related information for the current block. For example, the prediction related information is information related to the prediction procedure and may include prediction mode information and information about the motion information of the current block. The information about the motion information may include index information of motion information candidates, which is information for deriving a motion vector. Also, for example, the information about the motion information may include information about the above-mentioned MVD (Motion Vector Difference, MVD) and / or index information of a reference picture.

[0299] The encoding device encodes a dependent quantization enabled flag regarding whether dependent quantization is enabled (S1120). The encoding device can encode the dependent quantization enabled flag regarding whether dependent quantization is enabled. The image information may include the dependent quantization enabled flag. For example, the encoding device can determine whether dependent quantization is enabled for a block of an intra-sequence picture, and can encode a dependent quantization enabled flag regarding whether dependent quantization is enabled. For example, the dependent quantization enabled flag may be a flag regarding whether dependent quantization is enabled. For example, the dependent quantization enabled flag may indicate whether dependent quantization is enabled. That is, for example, the dependent quantization enabled flag may indicate whether dependent quantization is enabled for a block of an intra-sequence picture. For example, the dependent quantization enabled flag may indicate whether a dependent quantization used flag may be present, indicating whether dependent quantization is used for the current slice. For example, the dependent quantization enabled flag with a value of 1 may indicate that the dependent quantization is enabled, and the dependent quantization enabled flag with a value of 0 may indicate that the dependent quantization is not enabled. Also, for example, the dependent quantization enabled flag may be signaled in an SPS syntax or a slice header syntax, etc. The syntax element of the dependent quantization enabled flag may be the aforementioned sps_dep_quant_enabled_flag. The sps_dep_quant_enabled_flag may be referred to as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.

[0300] The encoding apparatus encodes a TSRC enable flag regarding whether Transform Skip Residual Coding (TSRC) is enabled based on the dependent quantization enable flag (S1130). The image information may include a TSRC enable flag.

[0301] For example, an encoding device may encode the TSRC available flag based on the dependent quantization available flag. For example, the TSRC available flag may be encoded based on the dependent quantization available flag having a value of 0. That is, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be encoded. In other words, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be signaled. Also, for example, when the value of the dependent quantization available flag is 1, the TSRC available flag may not be encoded, and the value of the TSRC available flag may be derived as 0 in a decoding device. That is, for example, if the value of the dependent quantization available flag is 1 (e.g., dependent quantization is applied (or used) to the current block), the TSRC available flag may not be signaled and the value of the TSRC available flag may be derived as 0 in the decoding device. Thus, for example, if dependent quantization is not available for the current block, the TSRC available flag may be signaled (or encoded). If dependent quantization is available for the current block, the TSRC available flag may not be signaled (or encoded) and the value of the TSRC available flag may be derived as 0 in the decoding device. Here, the current block may be a coding block (CB) or a transform block (TB).

[0302] Here, for example, the TSRC available flag may be a flag regarding whether TSRC is available. That is, for example, the TSRC available flag may be a flag indicating whether TSRC is available for a block in a slice. For example, the TSRC available flag having a value of 1 may indicate that the TSRC is not available, and the TSRC available flag having a value of 0 may indicate that the TSRC is available. Also, for example, the TSRC available flag may be signaled in a slice header syntax. A syntax element of the TSRC available flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.

[0303] The encoding device determines a syntax of residual coding for the current block based on the TSRC enabled flag (S1140). The encoding device may determine a syntax of residual coding for the current block based on the TSRC enabled flag. For example, the encoding device may determine a syntax of residual coding for the current block as one of a syntax of Regular Residual Coding (RRC) and a syntax of Transform Skip Residual Coding (TSRC) based on the TSRC enabled flag. The RRC syntax may represent a syntax according to RRC, and the TSRC syntax may represent a syntax according to TSRC.

[0304] For example, based on the TSRC enable flag having a value of 1, the syntax of the residual coding for the current block may be determined as a syntax of Regular Residual Coding (RRC). In this case, for example, a transform skip flag regarding whether transform skip of the current block is enabled may be encoded, and the value of the transform skip flag may be 1. For example, the image information may include a transform skip flag for the current block. The transform skip flag may indicate whether transform skip of the current block is enabled. That is, the transform skip flag may indicate whether a transform is applied to the transform coefficients of the current block. The syntax element representing the transform skip flag may be the above-mentioned transform_skip_flag. For example, when the value of the transform skip flag is 1, the transform skip flag may indicate that no transform is applied to the current block (i.e., transform skipped), and when the value of the transform skip flag is 0, the transform skip flag may indicate that a transform is applied to the current block. For example, when the current block is a transform skip block, the value of the transform skip flag for the current block may be 1.

[0305] Also, for example, based on the TSRC enable flag being a value of 0, the syntax of the residual coding for the current block may be determined as a syntax of transform skip residual coding (TSRC). Also, for example, a transform skip flag regarding whether transform skip is enabled for the current block may be encoded, and based on the transform skip flag being a value of 1 and the TSRC enable flag being a value of 0, the syntax of the residual coding for the current block may be determined as a syntax of transform skip residual coding (TSRC). Also, for example, a transform skip flag regarding whether transform skip is enabled for the current block may be encoded, and based on the transform skip flag being a value of 0 and the TSRC enable flag being a value of 0, the syntax of the residual coding for the current block may be determined as a syntax of regular residual coding (RRC).

[0306] The encoding device encodes residual information of the determined residual coding syntax for the current block (S1150). The encoding device may derive residual samples for the current block and may encode the residual information of the determined residual coding syntax for the residual samples of the current block. The image information may include the residual information.

[0307] For example, an encoding device may derive residual samples for the current block via subtraction of the predicted samples and original samples for the current block.

[0308] Thereafter, for example, an encoding device may derive transform coefficients of the current block based on the residual samples. For example, an encoding device may determine whether a transform is applied to the current block. That is, an encoding device may determine whether a transform is applied to the residual samples of the current block. An encoding device may determine whether a transform is applicable to the current block, taking into account coding efficiency. For example, an encoding device may determine that a transform is not applied to the current block. A block to which the transform is not applied may be referred to as a transform skip block. That is, for example, the current block may be a transform skip block.

[0309] When no transform is applied to the current block, i.e., when no transform is applied to the residual sample, the encoding apparatus may derive the derived residual sample as the transform coefficient. When a transform is applied to the current block, i.e., when a transform is applied to the residual sample, the encoding apparatus may perform a transform on the residual sample to derive the transform coefficient. The current block may include a plurality of sub-blocks or coefficient groups (CG). Also, the size of the sub-blocks of the current block may be 4x4 size or 2x2 size. That is, the sub-blocks of the current block may include up to 16 non-zero transform coefficients or up to 4 non-zero transform coefficients. Here, the current block may be a coding block (CB) or a transform block (TB). Also, a transform coefficient may be expressed as a residual coefficient.

[0310] Meanwhile, the encoding apparatus may determine whether dependent quantization is applied to the current block. For example, if the dependent quantization is applied to the current block, the encoding apparatus may perform the dependent quantization process on the transform coefficients to derive the transform coefficients of the current block. For example, if the dependent quantization is applied to the current block, the encoding apparatus may update a state (Qstate) for dependent quantization based on a coefficient level of a transform coefficient immediately before the current transform coefficient in the scan order, derive a coefficient level of the current transform coefficient based on the updated state and a syntax element related to the current transform coefficient, and quantize the derived coefficient level to derive the current transform coefficient. For example, the current transform coefficient may be quantized based on a quantization parameter for a reconstruction level of the current transform coefficient by a scalar quantizer for the updated state.

[0311] For example, if the syntax of the residual coding for the current block is determined as the RRC syntax, an encoding device may encode the residual information of the RRC syntax for the current block. For example, the residual information of the RRC syntax may include the syntax elements disclosed in Table 2 above.

[0312] For example, the residual information of the RRC syntax may include a syntax element related to a transform coefficient of a current block, where a transform coefficient may also be referred to as a residual coefficient.

[0313] For example, the syntax elements may include syntax elements such as last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, par_level_flag, abs_level_gtX_flag (e.g., abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1]), abs_remainder, dec_abs_level, and / or coeff_sign_flag.

[0314] Specifically, for example, the syntax element may include position information representing a position of a last non-zero transform coefficient in an array of residual coefficients of the current block. That is, the syntax element may include position information representing a position of a last non-zero transform coefficient in a scanning order of the current block. The position information may include information representing a prefix of a column position of the last non-zero transform coefficient, information representing a prefix of a row position of the last non-zero transform coefficient, information representing a suffix of a column position of the last non-zero transform coefficient, and information representing a suffix of a row position of the last non-zero transform coefficient. The syntax elements related to the position information may be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. Meanwhile, the non-zero transform coefficient may be referred to as a significant coefficient.

[0315] Also, for example, the syntax element may include a coded sub-block flag indicating whether a current sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag regarding whether a coefficient level for the transform coefficient is greater than a first threshold, a parity level flag regarding the parity of the coefficient level, and / or a second coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a second threshold. Here, the coded sub-block flag may be sb_coded_flag or coded_sub_block_flag, the significant coefficient flag may be sig_coeff_flag, the first coefficient level flag may be abs_level_gt1_flag or abs_level_gtx_flag, the parity level flag may be par_level_flag, and the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag.

[0316] Also, for example, the syntax elements may include coefficient value related information for values ​​of transform coefficients of the current block, where the coefficient value related information may be abs_remainder and / or dec_abs_level.

[0317] Also, for example, the syntax element may include a sign flag indicating a sign of the transform coefficient. The sign flag may be coeff_sign_flag.

[0318] For example, if the syntax of the residual coding for the current block is determined as the TSRC syntax, the encoding apparatus may encode the residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax may include the syntax elements disclosed in Table 3 above.

[0319] For example, the residual information of the TSRC syntax may include a syntax element related to a transform coefficient of the current block, where the transform coefficient may also be referred to as a residual coefficient.

[0320] For example, the syntax elements may include context coded and / or bypass coded syntax elements for transform coefficients. The syntax elements may include syntax elements such as sig_coeff_flag, coeff_sign_flag, par_level_flag, abs_level_gtX_flag (e.g., abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], and / or abs_level_gtx_flag[n][4]), abs_remainder, and / or coeff_sign_flag.

[0321] For example, the context coded syntax element for the transform coefficient may include a significant coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient, a sign flag indicating a sign for the transform coefficient, a first coefficient level flag regarding whether a coefficient level for the transform coefficient is greater than a first threshold, and / or a parity level flag regarding the parity of a coefficient level for the transform coefficient. Also, for example, the context coded syntax element may include a second coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a second threshold, a third coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a third threshold, a fourth coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a fifth threshold. Here, the significance coefficient flag may be sig_coeff_flag, the sign flag may be ceff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, the parity level flag may be par_level_flag, the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag, the third coefficient level flag may be abs_level_gt5_flag or abs_level_gtx_flag, the fourth coefficient level flag may be abs_level_gt7_flag or abs_level_gtx_flag, and the fifth coefficient level flag may be abs_level_gt9_flag or abs_level_gtx_flag.

[0322] Also, for example, the bypass coded syntax element for the transform coefficient may include coefficient level information regarding a value (or coefficient level) of the transform coefficient and / or a sign flag indicating a sign for the transform coefficient. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be ceff_sign_flag.

[0323] The encoding apparatus generates a bitstream including the prediction related information, the dependent quantization enabled flag, the TSRC enabled flag, and the residual information (S1160). For example, the encoding apparatus may output image information including the prediction related information, the dependent quantization enabled flag, the TSRC enabled flag, and the residual information in a bitstream. The bitstream may include the prediction related information, the dependent quantization enabled flag, the TSRC enabled flag, and the residual information.

[0324] Meanwhile, the bitstream can be transmitted to the decoding device via a network or a (digital) storage medium, where the network can include a broadcast network and / or a communication network, and the digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[0325] FIG. 12 is a schematic diagram of an encoding device that performs the image encoding method according to the present document. The method disclosed in FIG. 11 can be executed by the encoding device disclosed in FIG. 12. Specifically, for example, the prediction unit of the encoding device of FIG. 12 can execute S1100 of FIG. 11, and the entropy coding unit of the encoding device of FIG. 12 can execute S1110 to S1160 of FIG. 11. Although not shown, the process of deriving residual samples for the current block based on original samples and predicted samples for the current block can be executed by a subtraction unit of the encoding device, and the process of generating reconstructed samples and reconstructed pictures for the current block based on residual samples and predicted samples for the current block can be executed by an addition unit of the encoding device.

[0326] Fig. 13 is a schematic diagram showing an image decoding method by the decoding device according to the present document. The method disclosed in Fig. 13 can be executed by the decoding device disclosed in Fig. 3. Specifically, for example, S1300 to S1330 in Fig. 13 can be executed by an entropy decoding unit of the decoding device, (S1300 to) S1340 to S1350 in Fig. 13 can be executed by a prediction unit of the decoding device, S1360 in Fig. 13 can be executed by a residual processing unit of the decoding device, and S1370 can be executed by an adder unit of the decoding device.

[0327] The decoding device obtains prediction related information for a current block (S1300). The decoding device may obtain the prediction related information for the current block via a bitstream. For example, the image information may include prediction related information for the current block. For example, the prediction related information may include prediction mode information for the current block. The decoding device may determine which inter prediction mode is applied to the current block based on the prediction mode information. For example, the inter prediction mode may include a skip mode, a merge mode, and / or an (A)MVP mode, or may include the various inter prediction modes mentioned above.

[0328] The decoding device obtains a dependent quantization enabled flag regarding whether dependent quantization is enabled (S1310). The decoding device may obtain image information including the dependent quantization enabled flag via a bitstream. The image information may include the dependent quantization enabled flag. For example, the dependent quantization enabled flag may be a flag regarding whether dependent quantization is enabled. For example, the dependent quantization enabled flag may indicate whether dependent quantization is enabled. That is, for example, the dependent quantization enabled flag may indicate whether dependent quantization is enabled for a block of an intra-sequence picture. For example, the dependent quantization enabled flag may indicate whether a dependent quantization used flag indicating whether dependent quantization is used for a current slice may exist. For example, the dependent quantization enabled flag having a value of 1 may indicate that the dependent quantization is enabled, and the dependent quantization enabled flag having a value of 0 may indicate that the dependent quantization is not enabled. Also, for example, the dependent quantization enabled flag may be signaled in an SPS syntax or a slice header syntax, etc. The syntax element of the dependent quantization enabled flag may be the above-mentioned sps_dep_quant_enabled_flag. The sps_dep_quant_enabled_flag may be referred to as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.

[0329] The decoding apparatus obtains a TSRC enable flag regarding whether Transform Skip Residual Coding (TSRC) is enabled based on the dependent quantization enable flag (S1320). The image information may include a TSRC enable flag.

[0330] For example, the decoding apparatus may obtain the TSRC available flag based on the dependent quantization available flag. For example, the TSRC available flag may be obtained based on the dependent quantization available flag having a value of 0. That is, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be obtained. In other words, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be signaled. Also, for example, when the value of the dependent quantization available flag is 1, the TSRC available flag may not be obtained, and the value of the TSRC available flag may be derived as 0. That is, for example, if the value of the dependent quantization enabled flag is 1 (e.g., dependent quantization is applied (or used) for the current block), the TSRC enabled flag may not be signaled and the value of the TSRC enabled flag may be derived as 0. Thus, for example, if dependent quantization is not enabled for the current block, the TSRC enabled flag may be signaled (or obtained). If dependent quantization is enabled for the current block, the TSRC enabled flag may not be signaled (or obtained) and the value of the TSRC enabled flag may be derived as 0. Here, the current block may be a coding block (CB) or a transform block (TB).

[0331] Here, for example, the TSRC available flag may be a flag regarding whether TSRC is available. That is, for example, the TSRC available flag may be a flag indicating whether TSRC is available for a block in a slice. For example, the TSRC available flag having a value of 1 may indicate that the TSRC is not available, and the TSRC available flag having a value of 0 may indicate that the TSRC is available. Also, for example, the TSRC available flag may be signaled in a slice header syntax. A syntax element of the TSRC available flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.

[0332] The decoding device obtains residual information of a residual coding syntax for the current block derived based on the TSRC enable flag (S1330). The decoding device may derive one of a Regular Residual Coding (RRC) syntax and a TSRC syntax as a residual coding syntax for the current block based on the TSRC enable flag, and may obtain the residual information of the derived residual coding syntax.

[0333] For example, the decoding device may derive a syntax of residual coding for the current block based on the TSRC enable flag. For example, the decoding device may derive a syntax of residual coding for the current block as one of a syntax of Regular Residual Coding (RRC) and a syntax of Transform Skip Residual Coding (TSRC) based on the TSRC enable flag. The RRC syntax may represent a syntax according to RRC, and the TSRC syntax may represent a syntax according to TSRC.

[0334] For example, based on the TSRC enable flag having a value of 1, the syntax of the residual coding for the current block may be derived as a syntax of Regular Residual Coding (RRC). In this case, for example, a transform skip flag regarding whether transform skip of the current block is enabled may be obtained, and the value of the transform skip flag may be 1. For example, the image information may include a transform skip flag for the current block. The transform skip flag may indicate whether transform skip of the current block is enabled. That is, the transform skip flag may indicate whether a transform is applied to the transform coefficients of the current block. The syntax element representing the transform skip flag may be the above-mentioned transform_skip_flag. For example, when the value of the transform skip flag is 1, the transform skip flag may indicate that no transform is applied to the current block (i.e., transform skipped), and when the value of the transform skip flag is 0, the transform skip flag may indicate that a transform is applied to the current block. For example, when the current block is a transform skip block, the value of the transform skip flag for the current block may be 1.

[0335] Also, for example, based on the TSRC enable flag having a value of 0, the syntax of the residual coding for the current block may be derived as a syntax of transform skip residual coding (TSRC). Also, for example, a transform skip flag regarding whether transform skip is enabled for the current block may be obtained, and based on the transform skip flag having a value of 1 and the TSRC enable flag having a value of 0, the syntax of the residual coding for the current block may be derived as a syntax of transform skip residual coding (TSRC). Also, for example, a transform skip flag regarding whether transform skip is enabled for the current block may be obtained, and based on the transform skip flag having a value of 0 and the TSRC enable flag having a value of 0, the syntax of the residual coding for the current block may be derived as a syntax of regular residual coding (RRC).

[0336] Thereafter, for example, a decoding device may obtain residual information of the derived residual coding syntax for the current block. The image information may include the residual information.

[0337] For example, if the syntax of the residual coding for the current block is derived as the RRC syntax, the decoding device may obtain residual information of the RRC syntax for the current block. For example, the residual information of the RRC syntax may include the syntax elements disclosed in Table 2 above.

[0338] For example, the residual information of the RRC syntax may include a syntax element related to a transform coefficient of a current block, where a transform coefficient may also be referred to as a residual coefficient.

[0339] For example, the syntax elements may include syntax elements such as last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, par_level_flag, abs_level_gtX_flag (e.g., abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1]), abs_remainder, dec_abs_level, and / or coeff_sign_flag.

[0340] Specifically, for example, the syntax element may include position information representing a position of a last non-zero transform coefficient in an array of residual coefficients of the current block. That is, the syntax element may include position information representing a position of a last non-zero transform coefficient in a scanning order of the current block. The position information may include information representing a prefix of a column position of the last non-zero transform coefficient, information representing a prefix of a row position of the last non-zero transform coefficient, information representing a suffix of a column position of the last non-zero transform coefficient, and information representing a suffix of a row position of the last non-zero transform coefficient. The syntax elements related to the position information may be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. Meanwhile, the non-zero transform coefficient may be referred to as a significant coefficient.

[0341] Also, for example, the syntax element may include a coded sub-block flag indicating whether a current sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag regarding whether a coefficient level for the transform coefficient is greater than a first threshold, a parity level flag regarding the parity of the coefficient level, and / or a second coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a second threshold. Here, the coded sub-block flag may be sb_coded_flag or coded_sub_block_flag, the significant coefficient flag may be sig_coeff_flag, the first coefficient level flag may be abs_level_gt1_flag or abs_level_gtx_flag, the parity level flag may be par_level_flag, and the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag.

[0342] Also, for example, the syntax elements may include coefficient value related information regarding values ​​of transform coefficients of the current block, where the coefficient value related information may be abs_remainder and / or dec_abs_level.

[0343] Also, for example, the syntax element may include a sign flag indicating a sign of the transform coefficient. The sign flag may be coeff_sign_flag.

[0344] For example, if the syntax of the residual coding for the current block is derived as the TSRC syntax, the decoding device may obtain residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax may include the syntax elements disclosed in Table 3 above.

[0345] For example, the residual information of the TSRC syntax may include a syntax element related to a transform coefficient of the current block, where the transform coefficient may also be referred to as a residual coefficient.

[0346] For example, the syntax elements may include context coded and / or bypass coded syntax elements for transform coefficients. The syntax elements may include syntax elements such as sig_coeff_flag, coeff_sign_flag, par_level_flag, abs_level_gtX_flag (e.g., abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], and / or abs_level_gtx_flag[n][4]), abs_remainder, and / or coeff_sign_flag.

[0347] For example, the context coded syntax element for the transform coefficient may include a significant coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient, a sign flag indicating a sign for the transform coefficient, a first coefficient level flag regarding whether a coefficient level for the transform coefficient is greater than a first threshold, and / or a parity level flag regarding the parity of a coefficient level for the transform coefficient. Also, for example, the context coded syntax element may include a second coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a second threshold, a third coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a third threshold, a fourth coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag regarding whether the coefficient level of the transform coefficient is greater than a fifth threshold. Here, the significance coefficient flag may be sig_coeff_flag, the sign flag may be ceff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, the parity level flag may be par_level_flag, the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag, the third coefficient level flag may be abs_level_gt5_flag or abs_level_gtx_flag, the fourth coefficient level flag may be abs_level_gt7_flag or abs_level_gtx_flag, and the fifth coefficient level flag may be abs_level_gt9_flag or abs_level_gtx_flag.

[0348] Also, for example, the bypass coded syntax element for the transform coefficient may include coefficient level information regarding a value (or coefficient level) of the transform coefficient and / or a sign flag indicating a sign for the transform coefficient. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be ceff_sign_flag.

[0349] The decoding device derives motion information of the current block based on the prediction related information (S1340). For example, the decoding device may derive the motion information of the current block based on an inter prediction mode determined based on the prediction related information. For example, the decoding device may construct a motion information candidate list for the current block, select one motion information candidate in the motion information candidate list based on index information of the motion information candidate included in the prediction related information, and derive the motion information of the current block based on the selected motion information candidate.

[0350] The decoding device derives a predictive sample of the current block based on the motion information (S1350). For example, the decoding device may derive a reference picture of the current block based on an index of the reference picture of the current block, and may derive a predictive sample of the current block based on a sample of a reference block to which a motion vector of the current block points on the reference picture. The motion information may include an index of the reference picture of the current block and the motion vector.

[0351] The decoding device derives residual samples of the current block based on the residual information (S1360). For example, the decoding device may derive transform coefficients of the current block based on the residual information, and may derive residual samples of the current block based on the transform coefficients.

[0352] For example, the decoding device may derive transform coefficients of the current block based on syntax elements of the residual information. Then, the decoding device may derive residual samples of the current block based on the transform coefficients. As an example, if it is derived based on the transform skip flag that a transform is not applied to the current block, i.e., if the value of the transform skip flag is 1, the decoding device may derive the transform coefficients as the residual samples of the current block. Alternatively, for example, if it is derived based on the transform skip flag that a transform is not applied to the current block, i.e., if the value of the transform skip flag is 1, the decoding device may inversely quantize the transform coefficients and derive the residual samples of the current block. Alternatively, for example, if it is derived based on the transform skip flag that a transform is applied to the current block, i.e., if the value of the transform skip flag is 0, the decoding device may inversely transform the transform coefficients and derive the residual samples of the current block. Alternatively, for example, if it is derived based on the transform skip flag that a transform has been applied to the current block, i.e., if the value of the transform skip flag is 0, the decoding device may inverse quantize the transform coefficients and inverse transform the inverse quantized transform coefficients to derive the residual samples of the current block.

[0353] Meanwhile, for example, it may be determined whether the dependent quantization is applied to the current block based on the dependent quantization enabled flag. For example, if the value of the dependent quantization enabled flag is 1 (i.e., if the dependent quantization enabled flag indicates that the dependent quantization is enabled), dependent quantization may be applied to the current block. For example, if the dependent quantization is applied to the current block, the decoding device may perform the dependent quantization process on the transform coefficients to derive the residual samples of the current block. That is, for example, if the dependent quantization is applied to the current block, the decoding device may derive the residual samples of the current block based on the dependent quantization on the transform coefficients. For example, when the dependent quantization is applied to the current block, the decoding device may update a state (Qstate) for dependent quantization based on a coefficient level of a transform coefficient immediately preceding the current transform coefficient in the scan order, derive a coefficient level of the current transform coefficient based on the updated state and a syntax element for the current transform coefficient, and dequantize the derived coefficient level to derive a residual sample. For example, the current transform coefficient may be dequantized based on a quantization parameter for a reconstruction level of the current transform coefficient in a scalar quantizer for the updated state, where the reconstruction level may be derived based on a syntax element for the current transform coefficient.

[0354] Also, for example, if the dependent quantization is not applied to the current block, the decoding device may derive coefficient levels of the transform coefficients based on syntax elements related to the transform coefficients of the current block, and may inverse quantize the coefficient levels to derive residual samples. That is, for example, if the dependent quantization is not applied to the current block, the decoding device may not perform a state (Qstate) update process based on the coefficient level of the transform coefficient immediately before the current transform coefficient in the scan order.

[0355] The decoding device generates a reconstructed picture based on the prediction sample and the residual sample (S1370). For example, the decoding device can generate a reconstructed sample and / or a reconstructed picture of the current block based on the prediction sample and the residual sample. For example, the decoding device can generate the reconstructed sample through addition of the prediction sample and the residual sample.

[0356] Hereafter, as mentioned above, if necessary, in-loop filtering procedures such as deblock filtering, SAO and / or ALF procedures may be applied to the reconstructed picture in order to improve the subjective / objective image quality.

[0357] Fig. 14 is a schematic diagram of a decoding device that performs the image decoding method according to the present document. The method disclosed in Fig. 13 can be executed by the decoding device disclosed in Fig. 14. Specifically, for example, the entropy decoding unit of the decoding device of Fig. 14 can execute S1300 to S1330 of Fig. 13, the prediction unit of the decoding device of Fig. 14 can execute S1340 to S1350 of Fig. 13, the residual processing unit of the decoding device of Fig. 14 can execute S1360 of Fig. 13, and the addition unit of the decoding device of Fig. 14 can execute S1370 of Fig. 13.

[0358] According to the aforementioned document, the efficiency of residual coding can be increased.

[0359] In addition, according to this document, a signaling relationship can be established between the dependent quantization available flag and the TSRC available flag, and the TSRC available flag can be signaled when dependent quantization is not available, thereby preventing dependent quantization from being used when TSRC is not available and RRC syntax is coded for a transform skip block, thereby improving coding efficiency and reducing the amount of coded bits, thereby improving overall residual coding efficiency.

[0360] In addition, according to this document, the TSRC available flag can be signaled only when dependent quantization is not used, thereby preventing overlapping between coding of the RRC syntax and use of dependent quantization for the transform skip block, and allowing the TSRC available flag to be coded more effectively (efficiently), thereby reducing the amount of bits and improving overall residual coding efficiency.

[0361] In the above-described embodiments, the method is described based on a flow chart with a series of steps or blocks, but this document is not limited to the order of steps, and certain steps may occur in different steps and orders than described above or simultaneously. Also, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, and other steps may be included, or one or more steps of the flow chart may be deleted without affecting the scope of this document.

[0362] The embodiments described in this document may be implemented and executed on a processor, a microprocessor, a controller, or a chip. For example, the functional units illustrated in each drawing may be implemented and executed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information (e.g., information on instructions) or an algorithm for implementation may be stored in a digital recording medium.

[0363] In addition, the decoding device and the encoding device to which the embodiment of this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as video communication, a mobile streaming device, a recording medium, a camcorder, a video on demand (VoD) service providing device, an OTT video (Over The Top video) device, an Internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, a transportation terminal (e.g., a vehicle terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, etc., and may be used to process a video signal or a data signal. For example, the OTT video (Over The Top video) device may include a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a DVR (Digital Video Recorder), etc.

[0364] In addition, the processing method to which the embodiments of this document are applied can be produced in the form of a program executed by a computer and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to this document can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all kinds of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium can include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable recording medium also includes a medium realized in the form of a carrier wave (e.g., transmission via the Internet). Also, a bit stream generated by the encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0365] Also, the embodiments of the present document may be implemented in a computer program product by program code, which may be executed by a computer according to the embodiments of the present document. The program code may be stored on a computer readable carrier.

[0366] FIG. 15 exemplarily illustrates a structural diagram of a content streaming system to which the embodiments of this document are applied.

[0367] A content streaming system to which the embodiments of this document are applied can broadly include an encoding server, a streaming server, a web server, a media storage device, a user device, and a multimedia input device.

[0368] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc., 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, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.

[0369] The bitstream may be generated by an encoding method or a bitstream generation method to which an embodiment of this document is applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0370] 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 a medium to inform 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, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server serves to control commands / responses between devices in the content streaming system.

[0371] The streaming server may receive the content from a media storage device and / or an encoding server. For example, when receiving the 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 in order to provide a smooth streaming service.

[0372] Examples of the user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, PDAs (Personal Digital Assistants), PMPs (Portable Multimedia Players), navigation systems, slate PCs, tablet PCs, ULTRABOOK (registered trademark), wearable devices (e.g., smart watches, smart glasses, Head Mounted Displays (HMDs)), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system can be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.

[0373] The claims described in this specification may be combined in various ways. For example, the technical features of the method claims in this specification may be combined to be realized as an apparatus, and the technical features of the device claims in this specification may be combined to be realized as a method. In addition, the technical features of the method claims and the technical features of the device claims in this specification may be combined to be realized as an apparatus, and the technical features of the method claims and the technical features of the device claims in this specification may be combined to be realized as a method.

Claims

1. An image decoding method performed by a decoding device, comprising: obtaining a dependent quantization enable flag regarding whether dependent quantization is enabled; obtaining a TSRC disable flag according to the dependent quantization enable flag, the TSRC disable flag being related to whether TSRC is enabled; obtaining residual information of a residual coding syntax for a current block derived based on the TSRC invalid flag; deriving residual samples for the current block based on the residual information; generating a reconstructed picture based on the residual samples; The image decoding method, wherein the TSRC disable flag is obtained based on the dependent quantization enable flag having a value of 0.

2. 1. An image encoding method performed by an encoding device, comprising: encoding a dependent quantization enabled flag regarding whether dependent quantization is enabled; encoding a TSRC disable flag regarding whether TSRC is available based on the dependent quantization available flag; determining a residual coding syntax for the current block based on the TSRC invalid flag; encoding residual information of the determined residual coding syntax for the current block; generating a bitstream including the dependent quantization enabled flag, the TSRC disabled flag, and the residual information; A method for encoding an image, wherein the TSRC disabled flag is encoded based on the dependent quantization enabled flag having a value of 0.

3. 1. A method of transmission of data including a bitstream of image information, comprising: Obtaining the bitstream of the image information including residual information, the bitstream comprising: encoding a dependent quantization enabled flag regarding whether dependent quantization is enabled; encoding a TSRC disable flag regarding whether TSRC is available based on the dependent quantization available flag; determining a residual coding syntax for the current block based on the TSRC invalid flag; encoding the residual information in the determined residual coding syntax for the current block; generating a bitstream including the dependent quantization enabled flag, the TSRC disabled flag, and the residual information; transmitting the data including the bitstream of the image information including the residual information; A method of transmission, wherein the TSRC disabled flag is encoded based on the dependent quantization enabled flag having a value of 0.