Method and device for decoding video for residual coding

By deriving samples based on prediction mode and residual syntax elements in the image decoding method, the problem of low compilation efficiency of high-resolution image is solved, and efficient image compression and compilation are achieved.

CN114303373BActive Publication Date: 2025-05-09LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080061204.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-08-31
Filing Date
2020-08-26
Publication Date
2025-05-09
Estimated Expiration
2040-08-26

AI Technical Summary

Technical Problem

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

Method used

In the image decoding method, the predicted samples are derived based on the prediction mode and the residual samples are derived based on the residual syntax elements, efficient decoding and compilation of the image is achieved.

Benefits of technology

Improves the efficiency of residual compilation, improves the overall image/video compression efficiency, and reduces the compilation complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114303373B_ABST
    Figure CN114303373B_ABST
Patent Text Reader

Abstract

A method for decoding video performed by a decoding device according to the present document, characterized in that it includes: a step for obtaining video information including prediction mode information and residual information through a bitstream; a step for deriving a prediction mode of a current block based on the prediction mode information; a step for deriving a prediction sample based on the prediction mode; a step for deriving a current residual coefficient based on a residual syntax element for a current residual coefficient in the current block; a step for deriving a residual sample based on the current residual coefficient; and a step for deriving a reconstructed sample of the current block based on the prediction sample and the residual sample.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to an image coding technology, and more particularly, to an image decoding method and apparatus thereof for coding simplified residual data without performing level mapping in an image coding system. Background Art

[0002] Recently, in various fields, the demand for high-resolution, high-quality images such as HD (high definition) images and UHD (ultra high definition) images is growing. Because image data has high resolution and high quality, the amount of information or bits to be transmitted increases relative to conventional image data. Therefore, when image data is transmitted using a medium such as a conventional wired / wireless broadband line or stored using an existing storage medium, its transmission cost and storage cost increase.

[0003] Therefore, there is a need for efficient image compression technology for effectively transmitting, storing and reproducing information of high-resolution and high-quality images. Summary of the invention

[0004] Technical issues

[0005] The present disclosure provides a method and apparatus for improving image coding efficiency.

[0006] The present disclosure also provides a method and apparatus for improving residual coding efficiency.

[0007] Technical Solution

[0008] According to an embodiment of the present document, there is provided an image decoding method performed by a decoding device. The method includes: obtaining image information including residual information and prediction mode information through a bitstream, deriving a prediction mode of a current block based on the prediction mode information, deriving a prediction sample based on the prediction mode, deriving a current residual coefficient based on a residual syntax element for a current residual coefficient in the current block, deriving a residual sample based on the current residual coefficient, and deriving a reconstructed sample of the current block based on the residual sample and the prediction sample.

[0009] According to another embodiment of the present document, a decoding device for performing image decoding is provided. The decoding device includes: an entropy decoder that obtains image information including residual information and prediction mode information through a bit stream; a predictor that derives a prediction mode of a current block based on the prediction mode information, and derives a prediction sample based on the prediction mode; a residual processor that derives a current residual coefficient based on a residual syntax element for a current residual coefficient in the current block, and derives a residual sample based on the current residual coefficient; and an adder that derives a reconstructed sample of the current block based on the residual sample and the prediction sample.

[0010] According to another embodiment of the present document, a video encoding method performed by an encoding device is provided. The method includes: deriving a prediction sample of a current block based on inter-frame prediction or intra-frame prediction; deriving a residual sample of the current block based on the prediction sample; deriving a current residual coefficient based on the residual sample; and encoding image information, the image information including a residual syntax element for the current residual coefficient and prediction mode information indicating a prediction mode of the current block.

[0011] According to another embodiment of the present document, a video encoding device is provided. The encoding device includes: a predictor that derives a prediction sample of a current block based on inter-frame prediction or intra-frame prediction; a residual processor that derives a residual sample of the current block based on the prediction sample, and derives a current residual coefficient based on the residual sample; and an entropy encoder that encodes image information, the image information including a residual syntax element for the current residual coefficient and prediction mode information indicating a prediction mode of the current block.

[0012] Beneficial Effects

[0013] According to the present disclosure, the efficiency of residual coding can be improved.

[0014] According to the present disclosure, the overall image / video compression efficiency can be improved and the coding complexity can be reduced by deriving residual coefficients to which simplified residual data coding is applied without performing level mapping. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 An example of a video / image coding device to which embodiments of the present disclosure can be applied is briefly illustrated.

[0016] Figure 2 is a schematic diagram illustrating a configuration of a video / image encoding device to which an embodiment of the present disclosure can be applied.

[0017] Figure 3 is a schematic diagram illustrating a configuration of a video / image decoding device to which an embodiment of the present disclosure can be applied.

[0018] Figure 4 An example of a video / image encoding method based on inter-frame prediction is illustrated.

[0019] Figure 5 An example of a video / image decoding method based on inter-frame prediction is illustrated.

[0020] Figure 6 The inter-frame prediction process is schematically shown.

[0021] Figure 7Context-Adaptive Binary Arithmetic Coding (CABAC) for encoding syntax elements is exemplarily shown.

[0022] Figure 8 is a diagram showing exemplary transform coefficients within a 4×4 block.

[0023] Fig. 9 The diagram illustrates an example of simplified residual data coding for a CG, transform block, or coding block.

[0024] Fig.10 Another example of simplified residual data coding for one CG, transform block or coding block is illustrated.

[0025] Fig.11 Another example of simplified residual data coding for one CG, transform block or coding block is illustrated.

[0026] Fig.12 An image encoding method performed by an encoding device according to the present disclosure is briefly illustrated.

[0027] Fig.13 The following briefly illustrates an encoding device for executing the image encoding method according to the present disclosure.

[0028] Fig.14 The following briefly illustrates an image decoding method performed by a decoding device according to the present disclosure.

[0029] Fig.15 A decoding device for executing the image decoding method according to the present disclosure is briefly illustrated.

[0030] Fig.16 The diagram shows a structural diagram of a content streaming system to which the present disclosure is applied. DETAILED DESCRIPTION

[0031] The present disclosure can be modified in various forms, and its specific embodiments will be described and illustrated in the accompanying drawings. However, the embodiments are not intended to limit the present disclosure. The terms used in the following description are only used to describe specific embodiments and are not intended to limit the present disclosure. As long as it is clearly understood in different ways, the expression of the singular includes the expression of the plural. Terms such as "including" and "having" are intended to indicate the presence of features, numbers, steps, operations, elements, components, or combinations thereof used in the following description, and therefore it should be understood that the possibility of the presence or addition of one or more different features, numbers, steps, operations, elements, components, or combinations thereof is not excluded.

[0032] In addition, the elements in the drawings described in the present disclosure are drawn independently for the convenience of explaining different specific functions, and do not mean that these elements are embodied by independent hardware or independent software. For example, two or more elements in the elements can be combined to form a single element, or an element can be divided into multiple elements. The embodiments of combining elements and / or dividing elements belong to the present disclosure without departing from the concept of the present disclosure.

[0033] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In addition, throughout the accompanying drawings, like reference numerals are used to indicate like elements, and the same description of the like elements will be omitted.

[0034] Figure 1 An example of a video / image coding device to which embodiments of the present disclosure can be applied is briefly illustrated.

[0035] Reference Figure 1 The video / image coding system may include a first device (source device) and a second device (receiving device). The source device may send coded video / image information or data to the receiving device in the form of a file or stream via a digital storage medium or a network.

[0036] The source device may include a video source, an encoding device, and a transmitter. The receiving device may include a receiver, 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 include a display, and the display may be configured as a separate device or an external component.

[0037] The video source can obtain the video / image by capturing, synthesizing or generating the process of the video / image. The video source may include a video / image capturing device and / or a video / image generating device. The video / image capturing device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generating device may include, for example, a computer, a tablet computer and a smart phone, and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capturing process may be replaced by a process that generates relevant data.

[0038] The encoding device can encode the input video / image. The encoding device can perform a series of processes such as prediction, transformation and quantization to achieve compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0039] The transmitter may transmit the encoded image / image information or data output in the form of a bit stream to a receiver of a receiving device in the form of a file or stream via a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter may include an element for generating a media file in a predetermined file format, and may include an element for transmitting via a broadcast / communication network. The receiver may receive / extract a bit stream and transmit the received bit stream to a decoding device.

[0040] The decoding device may decode the video / image by performing a series of processes such as dequantization, inverse transformation, and prediction corresponding to the operations of the encoding device.

[0041] The renderer may render the decoded video / image. The rendered video / image may be displayed by a display.

[0042] The present disclosure relates to video / image coding. For example, the methods / implementations disclosed in the present disclosure may be applied to methods disclosed in Versatile Video Coding (VVC), EVC (Basic Video Coding) standard, AOMedia Video 1 (AV1) standard, 2nd generation Audio Video Coding standard (AVS2) or next generation video / image coding standard (e.g., H.267, or H.268, etc.).

[0043] The present disclosure presents various embodiments of video / image coding, and unless otherwise mentioned, the embodiments may be performed in combination with each other.

[0044] In the present disclosure, a video may refer to a series of images over time. Generally, a picture refers to a unit representing an image in a specific time zone, and a sub-picture / slice / tile is a unit that constitutes a part of a picture in coding. A sub-picture / slice / tile may include one or more coding tree units (CTUs). A picture may be composed of one or more sub-pictures / slices / tiles. A picture may be composed of one or more tile groups. A tile group may include one or more tiles. A brick may represent a rectangular area of ​​a CTU row within a tile in a picture. A tile may be partitioned into a plurality of tiles, each tile consisting of one or more CTU rows within a tile. Tiles that are not partitioned into a plurality of tiles may also be referred to as tiles. A tile scan may sort the CTUs partitioned in a picture in a specific order, wherein the CTUs are sorted continuously in the tile by a CTU raster scan, the tiles within the tile are sorted continuously by a raster scan of the tile, and the tiles in the picture are sorted continuously by a raster scan of the tile of the picture. In addition, a sub-picture may represent a rectangular area of ​​one or more slices within a picture. That is, a sub-picture contains one or more slices that cover a rectangular area of ​​a picture together. A tile is a rectangular area of ​​a CTU within a specific tile column and a specific tile row in a picture. A tile column is a rectangular area of ​​a CTU whose height is equal to the height of the picture and whose width is specified by a syntax element in a picture parameter set. A tile row is a rectangular area of ​​a CTU whose height is specified by a syntax element in a picture parameter set and whose width is equal to the width of the picture. Tile scanning is a specific order sorting of CTUs that partition a picture, wherein CTUs may be sorted continuously in a tile by a CTU raster scan, and tiles in a picture may be sorted continuously by a raster scan of tiles of a picture. A slice includes an integer number of tiles of a picture that may be exclusively contained in a single NAL unit. A slice may consist of multiple complete tiles or only of a complete sequence of tiles of a continuous sequence. In the present disclosure, tile groups and slices may be used interchangeably. For example, in the present disclosure, a tile group / tile group header may be referred to as a slice / slice header.

[0045] A pixel or a picture element (pel) may represent the smallest unit constituting a picture (or image). In addition, a "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component.

[0046] A unit may represent a basic unit of image processing. A unit may include at least one of a specific area of ​​a picture and information related to the area. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. In some cases, a unit may be used interchangeably with terms such as a block or an area. In general, an M×N block may include a set (or array) of samples (or sample arrays) or transform coefficients of M columns and N rows.

[0047] In this specification, "A or B" may mean "only A", "only B", or "A and B". In other words, in this specification, "A or B" may be interpreted as "A and / or B". For example, "A, B or C" herein means "only A", "only B", "only C", or "any one and any combination of A, B, and C".

[0048] A slash ( / ) or a comma used in this specification may mean "and / or". For example, "A / B" may mean "A and / or B". Thus, "A / B" may mean "only A", "only B", or "A and B". For example, "A,B,C" may mean "A, B, or C".

[0049] In the present specification, "at least one of A and B" may mean "only A", "only B", or "both A and B". In addition, in the present specification, the expression "at least one of A or B" or "at least one of A and / or B" may be interpreted as being the same as "at least one of A and B".

[0050] In addition, in the present specification, "at least one of A, B, and C" means "only A", "only B", "only C", or "any combination of A, B, and C". In addition, "at least one of A, B, or C" or "at least one of A, B and / or C" may mean "at least one of A, B, and C".

[0051] In addition, brackets used in this specification may refer to "for example". Specifically, when "prediction (intra-frame prediction)" is indicated, "intra-frame prediction" may be proposed as an example of "prediction". In other words, "prediction" in this specification is not limited to "intra-frame prediction", and "intra-frame prediction" may be proposed as an example of "prediction". In addition, even when "prediction (i.e., intra-frame prediction)" is indicated, "intra-frame prediction" may be proposed as an example of "prediction".

[0052] In this specification, technical features described separately in one figure may be implemented separately or may be implemented simultaneously.

[0053] The following figures are created to explain specific examples of this specification. Since the names of specific devices or the names of specific signals / messages / fields described in the figures are presented by way of example, the technical features of this specification are not limited to the specific names used in the following figures.

[0054] Figure 2 is a schematic diagram illustrating a configuration of a video / image encoding device to which an embodiment of the present disclosure can be applied. Hereinafter, a video encoding device may include an image encoding device.

[0055] Reference Figure 2 , the encoding device 200 includes an image segmenter 210, a predictor 220, a residual processor 230 and an entropy encoder 240, an adder 250, a filter 260 and a memory 270. The predictor 220 may include an inter-frame predictor 221 and an intra-frame 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 also include a subtractor 231. The adder 250 may be called a reconstructor or a reconstructed block generator. According to an embodiment, the image segmenter 210, the predictor 220, the residual processor 230, the entropy encoder 240, the adder 250 and the filter 260 may be composed of at least one hardware component (e.g., an encoder chipset or processor). In addition, the memory 270 may include a decoded picture buffer (DPB) or may be composed of a digital storage medium. The hardware component may also include a memory 270 as an internal / external component.

[0056] The image divider 210 may divide the input image (or picture or frame) input to the encoding device 200 into one or more processors. For example, the processor may be referred to as a coding unit (CU). In this case, the coding unit may be recursively divided from a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QTBTTT) structure. For example, a coding unit may be divided into a plurality of coding units with a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary structure. In this case, for example, a quadtree structure may be applied first, and then a binary tree structure and / or a ternary structure may be applied. Alternatively, a binary tree structure may be applied first. The coding process according to the present disclosure may be performed based on a final coding unit that is no longer divided. In this case, the maximum coding unit may be used as the final coding unit based on coding efficiency according to image characteristics, or if necessary, the coding unit may be recursively divided into coding units with a deeper depth and a coding unit with an optimal size may be used as the final coding unit. Here, the coding process may include a process of prediction, transformation, and reconstruction, which will be described later. As another example, the processor may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be separated or partitioned from the above-mentioned final coding unit. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient.

[0057] In some cases, a unit may be used interchangeably with terms such as a block or region. In general, an M×N block may represent a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally represent a pixel or a pixel value, may represent a pixel / pixel value of a luminance component only, or may represent a pixel / pixel value of a chrominance component only. A sample may be used as a term corresponding to a picture (or image) of a pixel or a pixel element.

[0058] In the encoding device 200, the prediction signal (prediction block, prediction sample array) output from the inter predictor 221 or the intra predictor 222 is subtracted from the input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array) and the generated residual signal is sent to the transformer 232. In this case, as shown in the figure, the unit for subtracting the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) in the encoder 200 can be called a subtractor 231. The predictor can perform prediction on the block to be processed (hereinafter referred to as the current block) and generate a prediction block including the prediction samples of the current block. The predictor can determine whether to apply intra prediction or inter prediction based on the current block or CU. As described later in the description of each prediction mode, the predictor can generate various information related to the prediction, such as prediction mode information, and send the generated information to the entropy encoder 240. The information about the prediction can be encoded in the entropy encoder 240 and output in the form of a bit stream.

[0059] The intra-frame predictor 222 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the referenced sample can be located near the current block, or can be far away from the current block. In intra-frame prediction, the prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the level of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or fewer directional prediction modes may be used depending on the setting. The intra-frame predictor 222 may determine the prediction mode applied to the current block by using the prediction mode applied to the adjacent block.

[0060] The inter-frame predictor 221 may derive a prediction block of the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between the adjacent blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-frame prediction, the adjacent blocks may include spatial adjacent blocks present in the current picture and temporal adjacent blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal adjacent block may be the same or different. The temporal adjacent block may be referred to as a collocated reference block, a co-located CU (colCU), etc., and the reference picture including the temporal adjacent block may be referred to as a collocated picture (colPic). For example, the inter-frame predictor 221 may configure a motion information candidate list based on the adjacent blocks, and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter-frame prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter-frame predictor 221 may use the motion information of the neighboring block as the motion information of the current block. In skip mode, unlike merge mode, a residual signal may not be transmitted. In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor, and the motion vector of the current block may be indicated by signaling a motion vector difference.

[0061] The predictor 220 may generate a prediction signal based on various prediction methods described below. For example, the predictor may not only apply intra prediction or inter prediction to predict a block, but may also apply both intra prediction and inter prediction at the same time. This may be referred to as inter-frame intra combined prediction (CIIP). In addition, the predictor may predict a block based on an intra-block copy (IBC) prediction mode or a palette mode. The IBC prediction mode or the palette mode may be used for content image / video coding of games, etc., such as screen content coding (SCC). IBC basically performs prediction in the current picture, but may be performed similarly to inter prediction because the reference block is derived in the current picture. That is, IBC may use at least one of the inter prediction techniques described in the present disclosure. The palette mode may be considered as an example of intra coding or intra prediction. When the palette mode is applied, the sample values ​​within the picture may be signaled based on information about the palette table and the palette index.

[0062] The prediction signal generated by the predictor (including the inter-frame predictor 221 and / or the intra-frame predictor 222) can be used to generate a reconstruction signal or to generate a residual signal. The transformer 232 can generate a transform coefficient 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-loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT represents a transform obtained from a graph when the relationship information between pixels is represented by a graph. CNT refers to a transform generated based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process can be applied to square pixel blocks of the same size, or can be applied to blocks of variable size rather than square.

[0063] The quantizer 233 may quantize the transform coefficients and send them to the entropy encoder 240, and the entropy encoder 240 may encode the quantized signal (information about the quantized transform coefficients) and output a bitstream. Information about the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the block type quantized transform coefficients into a one-dimensional vector form based on the coefficient scanning order, and generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. Information about the transform coefficients may be generated. The entropy encoder 240 may perform various encoding methods, such as, for example, exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 240 may encode information required for video / image reconstruction (e.g., values ​​of syntax elements, etc.) other than the quantized transform coefficients together or separately. Encoding information (e.g., encoded video / image information) may be transmitted or stored in units of NAL (network abstraction layer) in the form of a bitstream. The video / image information may also include information about various parameter sets such as an adaptive 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 also include general constraint information. In the present disclosure, information and / or syntax elements sent / signaled from the encoding device to the decoding device may be included in the video / picture information. The video / image information may be encoded and included in the bitstream through the above-mentioned encoding process. The bitstream may be sent through a network, or may be stored in a digital storage medium. The network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) that sends a signal output from the entropy encoder 240 and / or a storage unit (not shown) that stores the signal may be included as an internal / external element of the encoding device 200, and alternatively, the transmitter may be included in the entropy encoder 240.

[0064] The quantized transform coefficients output from the quantizer 233 can be used to generate a prediction signal. For example, the residual signal (residual block or residual sample) can be reconstructed by applying dequantization and inverse transformation to the quantized transform coefficients using the dequantizer 234 and the inverse transformer 235. The adder 250 adds the reconstructed residual signal to the prediction signal output from the inter-frame predictor 221 or the intra-frame predictor 222 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). If the block to be processed has no residual (such as the case where the skip mode is applied), the prediction block can be used as a reconstructed block. The adder 250 can be called a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture by filtering as described below.

[0065] Furthermore, during picture encoding and / or reconstruction, luma mapping and chroma scaling (LMCS) may be applied.

[0066] The filter 260 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 260 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 270 (specifically, the DPB of the memory 270). Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filter 260 can generate various information related to filtering, and send the generated information to the entropy encoder 240, as described later in the description of various filtering methods. The information related to filtering can be encoded by the entropy encoder 240 and output in the form of a bit stream.

[0067] The modified reconstructed picture sent to the memory 270 may be used as a reference picture in the inter-frame predictor 221. When inter-frame prediction is applied by the encoding device, prediction mismatch between the encoding device 200 and the decoding device may be avoided, and coding efficiency may be improved.

[0068] The DPB of the memory 270 may store a modified reconstructed picture used as a reference picture in the inter-frame predictor 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 reconstructed block in the picture. The stored motion information may be sent to the inter-frame predictor 221 and used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 270 may store reconstructed samples of a reconstructed block in the current picture and may transmit the reconstructed samples to the intra-frame predictor 222.

[0069] Figure 3 is a schematic diagram illustrating a configuration of a video / image decoding device to which an embodiment of the present disclosure can be applied.

[0070] Reference Figure 3 , the decoding device 300 may 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-frame predictor 332 and an intra-frame predictor 331. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. According to an embodiment, the entropy decoder 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be composed of hardware components (e.g., a decoder chipset or a processor). In addition, the memory 360 may include a decoded picture buffer (DPB), or may be composed of a digital storage medium. The hardware component may also include a memory 360 as an internal / external component.

[0071] When a bit stream including video / image information is input, the decoding apparatus 300 can be used with Figure 2 The image is reconstructed correspondingly to the processing of the video / image information in the encoding device. For example, the decoding device 300 can derive the unit / block based on the block segmentation related information obtained from the bit stream. The decoding device 300 can perform decoding using a processor applied in the encoding device. Therefore, the decoding processor can be, for example, a coding unit, and the coding unit can be segmented from a coding tree unit or a maximum coding unit according to a quadtree structure, a binary tree structure and / or a ternary tree structure. One or more transform units can be derived from the coding unit. The reconstructed image signal decoded and output by the decoding device 300 can be reproduced by a reproduction device.

[0072] The decoding device 300 may receive the bit stream from Figure 2The received signal can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets such as an adaptive 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 also include general constraint information. The decoding device may also decode the picture based on the information about the parameter set and / or the general constraint information. The signaled / received information and / or syntax elements described later in this disclosure may be decoded by a decoding process and obtained from the bitstream. For example, the entropy decoder 310 decodes the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and outputs syntax elements required for image reconstruction and quantized values ​​of the transform coefficients of the residual. More specifically, the CABAC entropy decoding method can receive a bin corresponding to each syntax element in the bitstream, use the decoding target syntax element information, the decoding information of the decoding target block, or the information of the symbol / bin decoded in the previous stage to determine the context model, and arithmetically decode the bin by predicting the probability of occurrence of the bin according to the determined context model, and generate a symbol corresponding to the value of each syntax element. In this case, after determining the context model, the CABAC entropy decoding method can update the context model by using the information of the decoded symbol / bin for the context model of the next symbol / bin. The information related to prediction among the information decoded by the entropy decoder 310 can be provided to the predictor (inter-frame predictor 332 and intra-frame predictor 331), and the residual value (that is, quantized transform coefficients and related parameter information) for which entropy decoding is performed in the entropy decoder 310 can be input to the residual processor 320. The residual processor 320 can derive a residual signal (residual block, residual sample, residual sample array). In addition, the information about filtering among the information decoded by the entropy decoder 310 can be provided to the filter 350. In addition, a receiver (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiver may be a component of the entropy decoder 310. In addition, the decoding device according to the present disclosure may be referred to as a video / image / picture decoding device, and the decoding device may be classified 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 decoder 310, and the sample decoder may include at least one of the dequantizer 321, the inverse transformer 322, the adder 340, the filter 350, the memory 360, the inter-frame predictor 332, and the intra-frame predictor 331.

[0073] The dequantizer 321 may dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 321 may rearrange the quantized transform coefficients in the form of two-dimensional blocks. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding device. The dequantizer 321 may dequantize the quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficients.

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

[0075] The predictor may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The predictor may determine whether to apply intra prediction or inter prediction to the current block based on information on prediction output from the entropy decoder 310, and may determine a specific intra / inter prediction mode.

[0076] The predictor 330 may generate a prediction signal based on various prediction methods described below. For example, the predictor may not only apply intra prediction or inter prediction to predict a block, but may also apply intra prediction and inter prediction at the same time. This may be referred to as combined inter and intra prediction (CIIP). In addition, the predictor may predict a block based on an intra block copy (IBC) prediction mode or a palette mode. The IBC prediction mode or the palette mode may be used for content image / video coding of games, etc., such as screen content coding (SCC). IBC basically performs prediction in the current picture, but may be performed similarly to inter prediction because a reference block is derived in the current picture. That is, IBC may use at least one of the inter prediction techniques described in the present disclosure. The palette mode may be considered an example of intra coding or intra prediction. When the palette mode is applied, the sample values ​​within the picture may be signaled based on information about the palette table and the palette index.

[0077] The intra-frame predictor 331 can predict the current block by referring to samples in the current picture. Depending on the prediction mode, the referenced sample can be located near the current block, or can be far away from the current block. In intra-frame prediction, the prediction mode can include multiple non-directional modes and multiple directional modes. The intra-frame predictor 331 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.

[0078] The inter-frame predictor 332 may derive a prediction block of the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information sent in the inter-frame 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 adjacent blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-frame prediction, the adjacent blocks may include spatial adjacent blocks present in the current picture and temporal adjacent blocks present in the reference picture. For example, the inter-frame predictor 332 may configure a motion information candidate list based on adjacent blocks, and derive a motion vector and / or a reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating a mode of inter-frame prediction for the current block.

[0079] The adder 340 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor (including the inter-frame predictor 332 and / or the intra-frame predictor 331). If the block to be processed has no residual (for example, when the skip mode is applied), the prediction block can be used as the reconstructed block.

[0080] The adder 340 may be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next block to be processed in the current picture, may be output through filtering as described below, or may be used for inter prediction of the next picture.

[0081] In addition, luma mapping and chroma scaling (LMCS) can be applied during picture decoding.

[0082] The filter 350 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 350 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 360 (specifically, the DPB of the memory 360). Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.

[0083] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter-frame predictor 332. The memory 360 can store the motion information of the block from which the motion information in the current picture is derived (or decoded) and / or the motion information of the reconstructed block in the picture. The stored motion information can be sent to the inter-frame predictor 332 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 360 can store the reconstructed samples of the reconstructed block in the current picture, and can transmit the reconstructed samples to the intra-frame predictor 331.

[0084] In the present disclosure, the embodiments described in the filter 260, the inter-frame predictor 221, and the intra-frame predictor 222 of the encoding device 200 may be the same as the filter 350, the inter-frame predictor 332, and the intra-frame predictor 331 of the decoding device 300 or may be respectively applied to correspond to the filter 350, the inter-frame predictor 332, and the intra-frame predictor 331 of the decoding device 300. The same contents may also be applied to the inter-frame predictor 332 and the intra-frame predictor 331.

[0085] In the present disclosure, at least one of quantization / inverse quantization and / or transform / inverse transform may be omitted. When quantization / inverse quantization is omitted, the quantized transform coefficient may be referred to as a transform coefficient. When transform / inverse transform is omitted, the transform coefficient may be referred to as a coefficient or a residual coefficient, or may still be referred to as a transform coefficient for the sake of uniformity of expression.

[0086] In the present disclosure, the quantized transform coefficient and the transform coefficient may be referred to as a transform coefficient and a scaled transform coefficient, respectively. In this case, the residual information may include information about the transform coefficient, and the information about the transform coefficient may be signaled by the residual coding syntax. The transform coefficient may be derived based on the residual information (or information about the transform coefficient), and the scaled transform coefficient may be derived by inversely transforming (scaling) the transform coefficient. The residual sample may be derived based on inversely transforming (transforming) the scaled transform coefficient. This may also be applied / expressed in other parts of the present disclosure.

[0087] At the same time, as described above, when performing video coding, prediction is performed to improve compression efficiency. In this way, a prediction block including prediction samples for the current block can be generated as a block to be coded (ie, a coding target block). Here, the prediction block includes prediction samples in the spatial domain (or pixel domain). The prediction block is derived in the same manner in the encoding device and the decoding device, and the encoding device can signal the decoding device with information about the residual between the original block and the prediction block (residual information) instead of the original sample value of the original block, thereby improving image coding efficiency. The decoding device can derive a residual block including residual samples based on the residual information, add the residual block and the prediction block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.

[0088] The residual information may be generated by a transformation and quantization process. For example, the encoding device may derive a residual block between the original block and the prediction block, may perform a transformation process on the residual samples (residual sample array) included in the residual block to derive the transformation coefficients, may perform a quantization process on the transformation coefficients to derive the quantized transformation coefficients, and may signal the relevant residual information (through a bitstream) to the decoding device. Here, the residual information may include value information, position information, transformation technology, transformation core, and value information of quantization parameters, etc. of the quantized transformation coefficients. The decoding device may perform a dequantization / inverse transformation process based on the residual information and derive residual samples (or residual blocks). The decoding device may generate a reconstructed picture based on the prediction block and the residual block. In addition, for reference for inter-frame prediction of a reference picture later, the encoding device may dequantize / inverse transform the quantized transformation coefficients to derive the residual block, and generate a reconstructed picture based on this.

[0089] Intra-frame prediction may refer to generating a prediction of a prediction sample for a current block based on a reference sample in a picture to which the current block belongs (hereinafter referred to as the current picture). When intra-frame prediction is applied to the current block, adjacent reference samples to be used for intra-frame prediction of the current block may be derived. The adjacent reference samples of the current block may include samples adjacent to the left boundary of the current block of size nWxnH and a total of 2xnH samples adjacent to the lower left of the current block, samples adjacent to the upper boundary of the current block and a total of 2xnW samples adjacent to the upper right, and samples adjacent to the upper left of the current block. Alternatively, the adjacent reference samples of the current block may include multiple columns of upper adjacent samples and multiple rows of left adjacent samples. In addition, the adjacent reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the lower boundary of the current block, and samples adjacent to the lower right of the current block.

[0090] However, some neighboring reference samples of the current block have not been decoded or may not be available. In this case, the decoder can construct neighboring reference samples to be used for prediction by replacing unavailable samples with available samples. Alternatively, the neighboring reference samples to be used for prediction can be configured by interpolation of available samples.

[0091] When deriving the neighboring reference samples, (i) the prediction samples may be derived based on an average or interpolation of the neighboring reference samples of the current block, or (ii) the prediction samples may be derived based on reference samples present in a specific (prediction) direction relative to the prediction samples in the neighboring reference samples of the current block. Case (i) may be referred to as a non-directional mode or a non-angular mode, and case (ii) may be referred to as a directional mode or an angular mode.

[0092] In addition, the prediction sample can be generated by interpolating the first adjacent sample located in the prediction direction of the intra prediction mode of the current block based on the prediction sample of the current block among the adjacent reference samples and the second adjacent sample located in the direction opposite to the prediction direction. The above situation can be called linear interpolation intra prediction (LIP). In addition, a linear model (LM) can be used to generate chroma prediction samples based on luma samples. This situation can be called LM mode or chroma component LM (CCLM) mode.

[0093] In addition, a temporary prediction sample of the current block is derived based on the filtered adjacent reference sample, and the prediction sample of the current block can also be derived by weighted summing the temporary prediction sample with at least one reference sample derived according to the intra prediction mode in the existing adjacent reference sample (i.e., the unfiltered adjacent reference sample). The above situation can be called position-dependent intra prediction (PDPC).

[0094] In addition, a reference sample line with the highest prediction accuracy among multiple adjacent reference sample lines of the current block is selected, and a prediction sample is derived using a reference sample located in the prediction direction in the selected line. In this case, intra-frame prediction encoding can be performed by indicating (signaling) the reference sample line used to the decoding device. The above situation can be referred to as multi-reference line intra-frame prediction or MRL-based intra-frame prediction.

[0095] In addition, the current block is divided into vertical or horizontal sub-partitions and performs intra prediction based on the same intra prediction mode, but it is possible to derive and use adjacent reference samples in units of sub-partitions. That is, in this case, the intra prediction mode of the current block is also applicable to the sub-partitions, but in some cases, the intra prediction performance can be improved by deriving and using adjacent reference samples in units of sub-partitions. This prediction method can be called intra prediction based on intra sub-partition (ISP).

[0096] The above-mentioned intra-frame prediction method may be referred to as an intra-frame prediction type to distinguish it from an intra-frame prediction mode. The intra-frame prediction type may be referred to by various terms, such as an intra-frame prediction technique or an additional intra-frame prediction mode. For example, the intra-frame prediction type (or additional intra-frame prediction mode, etc.) may include at least one of the above-mentioned LIP, PDPC, MRL, and ISP. A general intra-frame prediction method excluding specific intra-frame prediction types such as LIP, PDPC, MRL, and ISP may be referred to as a normal intra-frame prediction type. When the above-mentioned specific intra-frame prediction type is not applied, a normal intra-frame prediction type may generally be applied, and prediction may be performed based on the above-mentioned intra-frame prediction mode. At the same time, if necessary, post-processing filtering may be performed on the derived prediction samples.

[0097] Specifically, the intra prediction process may include an intra prediction mode / type determination step, an adjacent reference sample derivation step, and a prediction sample derivation step based on the intra prediction mode / type. In addition, if necessary, a post-filtering step may be performed on the derived prediction samples.

[0098] When intra prediction is applied, the intra prediction mode of the neighboring blocks can be used to determine the intra prediction mode applied to the current block. For example, the decoding device can select one of the MPM candidates in the most likely mode (MPM) list derived based on the intra prediction mode of the neighboring blocks (e.g., left and / or upper neighboring blocks) of the current block and the additional candidate mode, or select one of the remaining intra prediction modes not included in the MPM candidates (and the plane mode) based on the remaining intra prediction mode information. The MPM list can be configured to include or exclude the plane mode as a candidate. For example, when the MPM list includes the plane mode as a candidate, the MPM list can have 6 candidates, and when the MPM list does not include the plane mode as a candidate, the MPM list can have 5 candidates. When the MPM list does not include the plane mode as a candidate, a non-planar flag (e.g., intra_luma_not_planar_flag) indicating whether the intra prediction mode of the current block is not a plane mode can be signaled. For example, the MPM flag can be signaled first, and when the value of the MPM flag is 1, the MPM index and the non-planar flag can be signaled. In addition, the MPM index may be signaled when the value of the non-planar flag is 1. Here, the fact that the MPM list is configured to not include the planar mode as a candidate is that the planar mode is always considered to be the MPM rather than considering the planar mode not to be the MPM, and therefore, the flag (non-planar flag) is first signaled to check whether it is the planar mode.

[0099] For example, it can be indicated based on an MPM flag (e.g., intra_luma_mpm_flag) whether the intra prediction mode applied to the current block is among the MPM candidates (and planar mode) or among the remaining modes. An MPM flag with a value of 1 can indicate that the intra prediction mode for the current block is within the MPM candidates (and planar mode), and an MPM flag with a value of 0 can indicate that the intra prediction mode of the current block is not within the MPM candidates (and planar mode). A non-planar flag with a value of 0 (e.g., intra_luma_not_planar_flag) can indicate that the intra prediction mode for the current block is a planar mode, and a non-planar flag with a value of 1 can indicate that the intra prediction mode for the current block is not a planar mode. The MPM index can be signaled in the form of an mpm_idx or intra_luma_mpm_idx syntax element, and the remaining intra prediction mode information can be signaled in the form of a rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element. For example, the remaining intra prediction mode information may indicate one of the remaining intra prediction modes that is not included in the MPM candidates (and planar mode) among all intra prediction modes by indexing in order of the prediction mode number. The intra prediction mode may be an intra prediction mode of a luminance component (sample). In the following, the intra prediction mode information may include at least one of the following: an MPM flag (e.g., intra_luma_mpm_flag), a non-planar flag (e.g., intra_luma_not_planar_flag), an MPM index (e.g., mpm_idx or intra_luma_mpm_idx), or remaining intra prediction mode information (rem_intra_luma_luma_mpm_mode or intra_luma_mpminder). In the present disclosure, the MPM list may be referred to by a variety of terms such as MPM candidate list and candModeList. When a MIP is applied to a current block, a separate mpm flag (eg, intra_mip_mpm_flag), an mpm index (eg, intra_mip_mpm_idx), and remaining intra prediction mode information (eg, intra_mip_mpm_remainder) for the MIP may be signaled, and a non-planar flag may not be signaled.

[0100] In other words, in general, when block segmentation for an image is performed, the current block to be coded and the adjacent block have similar image features. Therefore, the possibility that the current block and the adjacent block have the same or similar intra-frame prediction mode is high. Therefore, the encoder can use the intra-frame prediction mode of the adjacent block to encode the intra-frame prediction mode of the current block.

[0101] For example, the encoding device / decoding device may construct a most probable mode (MPM) list for the current block. The MPM list may be referred to as an MPM candidate list. Here, MPM may refer to a mode for improving coding efficiency by considering the similarity between the current block and the adjacent blocks during intra-frame prediction mode coding. As described above, the MPM list may be constructed to include a planar mode, or may be constructed to exclude a planar mode. For example, when the MPM list includes a planar mode, the number of candidates in the MPM list may be 6. And when the MPM list does not include a planar mode, the number of candidates in the MPM list may be 5.

[0102] The encoder / decoder can construct an MPM list consisting of 5 or 6 MPMs.

[0103] To construct the MPM list, three modes may be considered, such as default intra mode, neighboring intra mode, and derived intra mode.

[0104] For the adjacent intra mode, two adjacent blocks may be considered, namely the left adjacent block and the above adjacent block.

[0105] As described above, if the MPM list is constructed not to include the planar mode, the planar mode may be excluded from the list and the number of MPM list candidates may be set to five.

[0106] In addition, the non-directional mode (or non-angular mode) in the intra prediction mode may include a DC mode based on an average of neighboring reference samples of the current block or a planar mode based on interpolation.

[0107] Meanwhile, when inter-frame prediction is applied, the predictor of the encoding device / decoding device may derive prediction samples by performing inter-frame prediction in units of blocks. When performing prediction on the current block, inter-frame prediction may be applied. That is, the predictor of the encoding / decoding device (more specifically, the inter-frame predictor) may derive prediction samples by performing inter-frame prediction in units of blocks. Inter-frame prediction may represent a prediction derived by a method depending on data elements (e.g., sample values ​​or motion information) of (one or more) pictures other than the current picture. When inter-frame prediction is applied to the current block, a prediction block (prediction sample array) for the current block may be derived based on a reference block (reference sample array) specified by a motion vector on a reference picture indicated by a reference picture index. In this case, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information of the current block may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between adjacent 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-frame prediction type (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of applying inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same as or different from each other. The temporal neighboring block may be referred to as a name such as a collocated reference block, a collocated CU (ColCU), etc., and the reference picture including the temporal neighboring block may be referred to as a collocated picture (ColPic). For example, a motion information candidate list may be configured based on the neighboring blocks of the current block, and a flag or index information indicating which candidate is selected (used) may be signaled to derive the motion vector and / or reference picture index of the current block. Inter-frame prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a 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 the skip mode, unlike the merge mode, a residual signal may not be sent. 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 the motion vector difference may be signaled. In this case, the motion vector of the current block may be derived by using the sum of the motion vector predictor and the motion vector difference.

[0108] According to the inter prediction type (L0 prediction, L1 prediction, Bi prediction, etc.), the motion information may further include L0 motion information and / or L1 motion information. The L0 direction motion vector may be referred to as the L0 motion vector or MVL0, and the L1 direction motion vector may be referred to as the L1 motion vector or MVL1. Prediction based on the L0 motion vector may be referred to as the L0 prediction, prediction based on the L1 motion vector may be referred to as the L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be referred to as bi-prediction. Here, the L0 motion vector may indicate a motion vector associated with the reference picture list L0, and the L1 motion vector may indicate a motion vector associated with the reference picture list L1. The reference picture list L0 may include a picture before the current picture in output order, and the reference picture list L1 may include a picture after the current picture in output order as a reference picture. 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 picture after the current picture in output order as a reference picture. In this case, the previous picture may be indexed first in the reference picture list L0, and then the subsequent picture may be indexed. The reference picture list L1 may further include a picture before the current picture in the output order as a reference picture. In this case, the subsequent picture may be indexed first in the reference picture list L1, and then the previous picture may be indexed. Here, the output order may correspond to a picture order count (POC) order.

[0109] The video / image encoding process based on inter-frame prediction may schematically include, for example, the following contents.

[0110] Figure 4 An example of a video / image encoding method based on inter-frame prediction is illustrated.

[0111] The encoding device performs inter prediction on the current block (S400). The encoding device may derive the 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 process, the motion information derivation process, and the prediction sample generation process may be performed simultaneously, and any one process may be performed earlier than the other processes. For example, the inter prediction unit of the encoding device 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 the prediction mode for the current block, the motion information derivation unit may derive the motion information of the current block, and the prediction sample derivation unit may derive the prediction sample of the current block. For example, the inter prediction unit of the encoding device may search for a block similar to the current block in a predetermined area (search area) of the reference picture through motion estimation, and derive a reference block whose difference with the current block is the smallest or equal to or less than a predetermined standard. A reference picture index indicating the reference picture where the reference block is located may be derived based on this, and a motion vector may be derived based on the position difference between the reference block and the current block. The encoding device may determine a mode applied to the current block among various prediction modes. The encoding apparatus may compare the RD costs of various prediction modes and determine an optimal prediction mode for the current block.

[0112] For example, when the skip mode or merge mode is applied to the current block, the encoding device may configure a merge candidate list to be described below, and derive a reference block whose difference with the current block is the smallest or equal to or less than a predetermined standard among the reference blocks indicated by the merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to the decoding device. The motion information of the current block may be derived by using the motion information of the selected merge candidate.

[0113] As another example, when the (A)MVP mode is applied to the current block, the encoding device may configure the (A)MVP candidate list to be described below, and use the motion vector of the selected MVP candidate among the motion vector predictor (MVP) candidates included in the (A)MVP candidate list as the MVP of the current block. In this case, for example, the motion vector indicating the reference block derived by motion estimation may be used as the motion vector of the current block, and the MVP candidate having the motion vector with the minimum difference from the motion vector of the current block among the MVP candidates may become the selected MVP candidate. A motion vector difference (MVD) may be derived, which is the difference obtained by subtracting the MVP from the motion vector of the current block. In this case, information about the MVD may be signaled to the decoding device. 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 signaled to the decoding device separately.

[0114] The encoding apparatus may induce residual samples based on the prediction samples (S410). The encoding apparatus may induce residual samples by comparing original samples and prediction samples of the current block.

[0115] The encoding device encodes the image information including prediction information and residual information (S420). The encoding device can output the encoded image information in the form of a bitstream. The prediction information may include information about prediction mode information (e.g., a skip flag, a merge flag, or a mode index, etc.) and information about motion information as information related to the prediction process. The information about the motion information may include candidate selection information (e.g., a merge index, an mvp flag, or an mvp index), which is information for deriving a motion vector. In addition, the information about the motion information may include information about the MVD and / or reference picture index information. In addition, the information about the motion information may include information indicating whether L0 prediction, L1 prediction, or dual prediction is applied. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficients used for the residual sample.

[0116] The output bitstream may be stored in a (digital) storage medium and transmitted to a decoding device, or transmitted to a decoding device via a network.

[0117] At the same time, as described above, the encoding device can generate a reconstructed picture (including a reconstructed sample and a reconstructed block) based on the reference sample and the residual sample. This is to derive the same prediction result as the prediction result performed by the decoding device, and as a result, the coding efficiency can be improved. Therefore, the encoding device can store the reconstructed picture (or reconstructed sample or reconstructed block) in a memory and use the reconstructed picture as a reference picture. As described above, the in-loop filtering process can be further applied to the reconstructed picture.

[0118] The video / image decoding process based on inter-frame prediction may schematically include, for example, the following contents.

[0119] Figure 5 An example of a video / image decoding method based on inter-frame prediction is illustrated.

[0120] Reference Figure 5 The decoding device may perform an operation corresponding to the operation performed by the encoding device. The decoding device may perform prediction on the current block based on the received prediction information and derive a prediction sample.

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

[0122] For example, it may be determined based on a merge flag whether a merge mode or (A) MVP mode is applied to the current block. Alternatively, one of various inter prediction mode candidates may be selected based on a mode index. Inter prediction mode candidates may include skip mode, merge mode, and / or (A) MVP mode, or may include various inter prediction modes described below.

[0123] The decoding device derives motion information of the current block based on the determined inter prediction mode (S510). For example, when the skip mode or merge mode is applied to the current block, the decoding device may configure a merge candidate list to be described below, and select a merge candidate from among the merge candidates included in the merge candidate list. Here, the selection may be performed based on the selection information (merge index). The motion information of the current block may be derived by using the motion information of the selected merge candidate. The motion information of the selected merge candidate may be used as the motion information of the current block.

[0124] As another example, when the (A)MVP mode is applied to the current block, the decoding device may configure the (A)MVP candidate list to be described below, and use the motion vector of the selected mvp candidate among the motion vector predictor (mvp) candidates included in the (A)MVP candidate list as the mvp of the current block. Here, the selection may be performed based on the selection information (mvp flag or mvp index). In this case, the MVD of the current block may be derived based on the information about the MVD, and the motion vector of the current block may be derived based on the mvp and MVD of the current block. In addition, the reference picture index of the current block may be derived based on the reference picture index information. The picture indicated by the reference picture index in the reference picture list for the current block may be derived as the reference picture referenced by the inter-frame prediction of the current block.

[0125] Meanwhile, as described below, the motion information of the current block may be derived without a candidate list configuration, and in this case, the motion information of the current block may be derived according to the process disclosed in the prediction mode. In this case, the candidate list configuration may be omitted.

[0126] The decoding device 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 of the current block may be derived by using the sample of the reference block indicated by the motion vector of the current block on the reference picture. In this case, in some cases, a prediction sample filtering process for all or some prediction samples of the current block may be further performed.

[0127] For example, the inter-frame 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 the prediction mode determination unit may determine the prediction mode for the current block based on the received prediction mode information, the motion information derivation unit may derive the motion information (motion vector and / or reference picture index) of the current block based on the information about the received motion information, and the prediction sample derivation unit may derive the prediction sample of the current block.

[0128] The decoding device generates residual samples for the current block based on the received residual information (S530). The decoding device may generate reconstructed samples for the current block based on the predicted samples and the residual samples, and generate a reconstructed picture based on the generated reconstructed samples (S540). Thereafter, as described above, the in-loop filtering process may be further applied to the reconstructed picture.

[0129] Figure 6 The inter-frame prediction process is schematically shown.

[0130] refer to Figure 6 As described above, the inter-frame prediction process may include an inter-frame prediction mode determination step, a motion information derivation step according to the determined prediction mode, and a prediction processing (prediction sample generation) step based on the derived motion information. The inter-frame prediction process may be performed by the encoding device and the decoding device as described above. In this article, the coding device may include an encoding device and / or a decoding device.

[0131] Reference Figure 6 , the coding device determines the inter prediction mode of the current block (S600). Various inter prediction modes can be used for the prediction of the current block in the picture. For example, various modes such as merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, sub-block merge mode, merge with MVD (MMVD) mode and historical motion vector prediction (HMVP) mode can be used. Decoder-side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, dual prediction with CU-level weights (BCW) and bidirectional optical flow (BDOF) can be further used as additional modes. Affine mode can also be referred to as affine motion prediction mode. MVP mode can also be referred to as advanced motion vector prediction (AMVP) mode. In this article, some modes and / or motion information candidates derived from some modes can also be included in one of the motion information related candidates in other modes. For example, HMVP candidates can be added to the merge candidates of merge / skip mode, or to the MVP candidates of MVP mode. If the HMVP candidate is used as a motion information candidate for a merge mode or a skip mode, the HMVP candidate may be referred to as an HMVP merge candidate.

[0132] Prediction mode information indicating the inter-frame prediction mode of the current block can be signaled to the decoding device from the encoding device. In this case, the prediction mode information can be included in the 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-frame prediction mode may be indicated by hierarchical signaling of flag information. In this case, the prediction mode information may include one or more flags. For example, whether the skip mode is applied may be indicated by signaling a skip flag, when the skip mode is not applied, whether the merge mode is applied may be indicated by signaling a merge flag, and when the merge mode is not applied, the MVP mode may be indicated to be applied or a flag for additional distinction may be further signaled. The affine mode may be signaled as an independent mode, or signaled as a subordinate mode with respect to the merge mode or the MVP mode. For example, the affine mode may include an affine merge mode and an affine MVP mode.

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

[0134] The coding device may perform inter-frame prediction using the motion information of the current block. The coding device may derive the best motion information for the current block through a motion estimation process. For example, the coding device may search for a similar reference block with high correlation in units of fractional pixels within a predetermined search range in a reference picture by using an original block in an original picture for the current block, and derive motion information through the searched reference block. The similarity of the blocks may be derived based on the difference in sample values ​​based on the phase. For example, the similarity of the blocks may be calculated based on the sum of absolute differences (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 minimum SAD in the search area. The derived motion information may be signaled to the decoding device according to various methods based on the inter-frame prediction mode.

[0135] The coding apparatus performs inter prediction based on the motion information for the current block (S620). The coding apparatus may derive (one or more) prediction samples for the current block based on the motion information. The current block including the prediction samples may be referred to as a prediction block.

[0136] Meanwhile, as described above, the encoding device may perform various encoding methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC). In addition, the decoding device may decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of the syntax elements required for image reconstruction and the quantized values ​​of the transform coefficients associated with the residual.

[0137] For example, the above compilation method may be performed as follows.

[0138] Figure 7 Context-Adaptive Binary Arithmetic Coding (CABAC) for encoding syntax elements is exemplarily shown. For example, in the CABAC coding process, when the input signal is a syntax element rather than a binary value, the encoding device can convert the input signal into a binary value by binarizing the value of the input signal. In addition, when the input signal is already a binary value (that is, when the value of the input signal is a binary value), binarization may not be performed and binarization may be bypassed. Here, each binary number 0 or 1 constituting a binary value may be referred to as a bin. For example, if the binary string after binarization is 110, each of 1, 1, and 0 is referred to as a bin. The bin for a syntax element may indicate the value of the syntax element.

[0139] Thereafter, the binarized bin of the syntax element may be input to a conventional coding engine or a bypass coding engine. The conventional coding engine of the encoding device may assign a context model reflecting a probability value to the corresponding bin, and may encode the corresponding bin based on the assigned context model. After encoding each bin, the conventional coding engine of the encoding device may update the context model for the corresponding bin. The encoding bin as described above may be referred to as a context coding bin.

[0140] Meanwhile, when the binarized bins of the syntax elements are input to the bypass coding engine, they may be coded as follows. For example, the bypass coding engine of the coding device omits the process of estimating the probability of the input bins and the process of updating the probability model applied to the bins after coding. When bypass coding is applied, the coding device may encode the input bins by applying a uniform probability distribution instead of assigning a context model, thereby increasing the coding speed. The coded bins as described above may be referred to as bypass bins.

[0141] Entropy decoding may mean a process of performing the same process as the above-described entropy encoding in reverse order.

[0142] For example, when decoding a syntax element based on a context model, the decoding device may receive a bin corresponding to the syntax element through a bitstream, may use the syntax element and decoding information of a decoding target block or a neighboring block or information of a symbol / bin decoded in a previous step to determine the context model, and may derive the value of the syntax element by predicting the occurrence probability of the received bin according to the determined context model and performing arithmetic decoding on the bin. Thereafter, the determined context model may be used to update the context model of the next decoded bin.

[0143] In addition, for example, when bypass decoding of a syntax element, 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 process for deriving a context model for the syntax element and a process for updating the context model applied to the bin after decoding.

[0144] As described above, the residual samples can be derived as quantized transform coefficients through a transform and quantization process. Quantized transform coefficients may also be referred to as transform coefficients. In this case, the transform coefficients in the block may be signaled in the form of residual information. The residual information may include residual coding syntax. That is, the encoding device may configure the residual coding syntax using the residual information, encode the residual coding syntax, and output it in the form of a bitstream, and the decoding device may decode the residual coding syntax from the bitstream and derive the residual (quantized) transform coefficients. The residual coding syntax may include syntax elements indicating whether the transform is applied to the corresponding block, the position of the last valid transform coefficient in the block, whether there are valid transform coefficients in the sub-block, the size / sign of the valid transform coefficient, etc., as described later.

[0145] For example, the transform coefficient (ie, residual information) may be encoded and / or decoded (quantized) based on syntax elements such as transform_skip_flag, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, coded_sub_block_flag, sig_coeff_flag, par_level_flag, abs_level_gt1_flag, abs_level_gt3_flag, abs_remaind, coeff_sign_flag, dec_abs_level, mts_idx. The syntax elements related to residual data encoding / decoding may be represented as shown in the following table.

[0146] [Table 1]

[0147]

[0148]

[0149]

[0150]

[0151] Transform_skip_flag indicates whether the transform is skipped in the associated block. 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 processes, CB and TB may be used interchangeably. For example, as described above, residual samples may be derived for CB, and transform coefficients may be derived (quantized) by transform and quantization for the residual samples, and information (e.g., syntax elements) that effectively indicate the position, magnitude, sign, etc. of the (quantized) transform coefficients may be generated and signaled by the residual coding procedure. The quantized transform coefficients may be simply referred to as transform coefficients. Typically, when the CB is not larger than the maximum TB, the size of the CB may be the same as the size of the TB, and in this case, the target block to be transformed (and quantized) and residually coded may be referred to as a CB or a TB. Meanwhile, when the CB is larger than the maximum TB, the target block to be transformed (and quantized) and residually coded may be referred to as a TB. Hereinafter, signaling of syntax elements related to residual coding in units of transform blocks (TBs) will be described, but this is an example and TBs may be used interchangeably with coding blocks (CBs) as described above.

[0152] Meanwhile, the syntax elements signaled after the transform skip flag is signaled may be the same as the syntax elements disclosed in the following Table 2, and a detailed description about the syntax elements is described below.

[0153] [Table 2]

[0154]

[0155]

[0156]

[0157] [Table 3]

[0158]

[0159]

[0160]

[0161]

[0162]

[0163] [Table 4]

[0164]

[0165]

[0166]

[0167] According to the present embodiment, as shown in Table 2, residual coding may be divided according to the value of the syntax element transform_skip_flag of the transform skip flag. That is, based on the value of the transform skip flag (based on whether the transform is skipped), different syntax elements may be used for residual coding. The residual coding used when the transform skip is not applied (i.e., when the transform is applied) may be referred to as regular residual coding (RRC), and the residual coding used when the transform skip is applied (i.e., when the transform is not applied) may be referred to as transform skip residual coding (TSRC). In addition, regular residual coding may be referred to as general residual coding. In addition, regular residual coding may be referred to as regular residual coding syntax structure, and transform skip residual coding may be referred to as transform skip residual coding syntax structure. Table 3 above may show the syntax elements of residual coding when the value of transform_skip_flag is 0 (i.e., when the transform is applied), and Table 4 above may show the syntax elements of residual coding when the value of transform_skip_flag is 1 (i.e., when the transform is not applied).

[0168] Specifically, for example, a transform skip flag indicating whether to skip the transform of the transform block 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, as shown in Table 3, the 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 of the residual coefficient of the transform block may be parsed, and the residual coefficient may be derived based on the syntax elements. In this case, the syntax elements may be parsed sequentially, and the parsing order may be changed. In addition, 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 abs_level_gtx_flag[n][1] may be an example of a second transform coefficient level flag (abs_level_gt3_flag).

[0169] Referring to Table 3 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, sb_coded_flag may be expressed as coded_sub_block_flag.

[0170] In an embodiment, the encoding device may encode the (x, y) position information of the last non-zero transform coefficient in the transform block based on the 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, last_sig_coeff_x_prefix represents the prefix of the column position of the last significant coefficient in the scan order within the transform block, last_sig_coeff_y_prefix represents the prefix of the row position of the last significant coefficient in the scan order within the transform block, last_sig_coeff_x_suffix represents the suffix of the column position of the last significant coefficient in the scan order within the transform block, and last_sig_coeff_y_suffix represents the suffix of the row position of the last significant coefficient in the scan order within the transform block. Here, the significant coefficient may represent a non-zero coefficient. In addition, the scan order may be a right diagonal scan order. Alternatively, the scanning order may be a horizontal scanning order or a vertical scanning order.The scanning order may be determined based on whether intra / inter prediction is applied to a target block (CB or CB including TB) and / or a specific intra / inter prediction mode.

[0171] Thereafter, the encoding apparatus may divide the transform block into 4×4 sub-blocks, and then for each 4×4 sub-block, use a 1-bit syntax element coded_sub_block_flag to indicate whether there is a non-zero coefficient in the current sub-block.

[0172] If the value of coded_sub_block_flag is 0, there is no more information to be transmitted, and therefore, the encoding device may terminate the encoding process of the current subblock. On the contrary, if the value of coded_sub_block_flag is 1, the encoding device may continuously perform the encoding process on sig_coeff_flag. Since the subblock including the last non-zero coefficient does not need to encode coded_sub_block_flag, and the subblock including the DC information of the transform block has a high probability of including a non-zero coefficient, coded_sub_block_flag may not be encoded, and its value may be assumed to be 1.

[0173] If the value of coded_sub_block_flag is 1, and it is therefore determined that there is a non-zero coefficient in the current sub-block, the encoding device may encode the sig_coeff_flag having a binary value according to the reverse scanning order. The encoding device may encode the 1-bit syntax element sig_coeff_flag of 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, it is not necessary to encode sig_coeff_flag for the last non-zero coefficient, so the coding process of the sub-block may be omitted. Level information coding may be performed only when sig_coeff_flag is 1, and four syntax elements may be used in the level information coding process. More specifically, each sig_coeff_flag[xC][yC] may indicate whether the level (value) of the corresponding transform coefficient at each transform coefficient position (xC, yC) in the current TB is non-zero. In an embodiment, sig_coeff_flag may correspond to an example of a syntax element of a significant coefficient flag indicating whether a quantized transform coefficient is a non-zero significant coefficient.

[0174] The level value remaining after encoding sig_coeff_flag may be derived as shown in the following equation: That is, the syntax element remAbsLevel indicating the level value to be encoded may be derived from the following equation.

[0175] [Equation 1]

[0176] remAbsLevel=|coeff|-1

[0177] Here, coeff represents the actual transform coefficient value.

[0178] In addition, abs_level_gt1_flag may indicate whether the remAbsLevel of the corresponding scanning position (n) is greater than 1. For example, when the value of abs_level_gt1_flag is 0, the absolute value of the transform coefficient of the corresponding position may be 1. In addition, when the value of abs_level_gt1_flag is 1, remAbsLevel indicating a level value to be encoded later may be updated as shown in the following equation.

[0179] [Equation 2]

[0180] remAbsLevel=remAbsLevel-1

[0181] In addition, the least significant coefficient (LSB) value of remAbsLevel described in the above Equation 2 may be encoded through par_level_flag as in the following Equation 3.

[0182] [Equation 3]

[0183] par_level_flag = |coeff|&1

[0184] Here, par_level_flag[n] may indicate the parity of the transform coefficient level (value) at the scanning position n.

[0185] The transform coefficient level value remAbsLevel to be encoded after performing par_level_flag encoding may be updated as shown in the following equation as follows.

[0186] [Equation 4]

[0187] remAbsLevel=remAbsLeve1>>1

[0188] abs_level_gt3_flag may indicate whether the remAbsLevel of the corresponding scanning position (n) is greater than 3. Encoding of abs_remainder may be performed only if rem_abs_gt3_flag is equal to 1. The relationship between the actual transform coefficient value coeff and each syntax element may be as shown below in the following equation.

[0189] [Equation 5]

[0190] |coeff|=sig_coeff_flag+abs_level_gt1_flag+par_level_flag+2*(abs_level_gt3_flag+abs_remainder)

[0191] In addition, the following table indicates examples related to the above-mentioned Equation 5.

[0192] [Table 5]

[0193]

[0194] Here, |coeff| indicates a transform coefficient level (value), and may also be indicated as AbsLevel for the transform coefficient. In addition, the sign of each coefficient may be encoded by using coeff_sign_flag which is a 1-bit symbol.

[0195] In addition, if the value of the transform skip flag is 1, as shown in Table 4, the syntax elements sb_coded_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag, par_level_flag, and / or abs_remainder of the residual coefficient of the transform block may be parsed, and the residual coefficient may be derived based on the syntax elements. In this case, the syntax elements may be parsed sequentially, and the parsing order may be changed. In addition, 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 the transform coefficient at the scan position n is greater than (j<<1)+1. The condition (j<<1)+1 may optionally be replaced with a specific threshold value such as a first threshold value, a second threshold value, or the like.

[0196] At the same time, CABAC provides high performance, but disadvantageously has poor throughput performance. This is caused by the conventional compilation engine of CABAC. Conventional encoding (i.e., compiled by the conventional compilation engine of CABAC) shows high data dependency because it uses the probability state and range updated by the compilation of the previous bin, and it takes a lot of 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 compilation bins. For example, as shown in Table 1 or Table 3 above, the sum of the bins for representing sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag can be limited to the number of bins depending on the size of the corresponding block. Furthermore, for example, as shown in Table 4 above, the sum of bins that may be 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, abs_level_gt9_flag may be limited to the number of bins depending on the size of the corresponding block. For example, if the corresponding block is a 4×4 sized block, the sum of bins for 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 28 for example), and if the corresponding block is a 2×2 sized block, the sum of bins for sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag may be limited to 8 (or 7 for example). The limited number of bins may be represented by remBinsPass1 or RemCcbs. Alternatively, for example, for higher CABAC throughput, the number of context coding bins may be limited for a block (CB or TB) including a coding target CG. In other words, the number of context coding bins may be limited in units of blocks (CB or TB).For example, when the size of the current block is 16×16, the number of context coding bins for the current block may be limited to 1.75 times the number of pixels of the current block, ie, 448, regardless of the current CG.

[0197] In this case, if a limited number of all context coding bins are used when coding the context element, the encoding device can binarize the remaining coefficients by the method of binarizing the coefficients as described below, instead of using context coding, and bypass coding can be performed. In other words, for example, if the number of context coding bins for 4×4CG coding is 32 (or 28 in the example), or if the number of context coding bins for 2×2CG coding is 8 (or 7 in the example), sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag coded with the context coding bins can no longer be coded, and can be directly coded into dec_abs_level. Alternatively, for example, when the number of context coding bins for 4×4 block coding is 1.75 times the number of pixels of the entire block, that is, when limited to 28, sig_coeff_flag, abs_level_gt1_flag, par_level_flag and abs_level_gt3_flag coded as context coding bins may no longer be coded and may be directly coded as dec_abs_level, as shown in Table 6 below.

[0198] [Table 6]

[0199] |coeff[n]| dec_abs_level[n] 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 ... ...

[0200] The value |coeff| may be derived based on dec_abs_level. In this case, the transform coefficient value (ie, |coeff|) may be derived as shown in the following equation.

[0201] [Equation 6]

[0202] _coeff_=dec_abs_level

[0203] In addition, coeff_sign_flag may indicate the sign of the transform coefficient level at the corresponding scanning position n. That is, coeff_sign_flag may indicate the sign of the transform coefficient at the corresponding scanning position n.

[0204] Figure 8 An example of transform coefficients in a 4x4 block is shown.

[0205] Figure 8The 4×4 block represents an example of quantized coefficients. Figure 8 The block may be a 4×4 transform block, or a 4×4 sub-block of an 8×8, 16×16, 32×32, or 64×64 transform block. Figure 8 A 4×4 block can represent a luma block or a chroma block.

[0206] Meanwhile, as described above, when the input signal is not a binary value but a syntax element, the encoding device may transform the input signal into a binary value by binarizing the value of the input signal. In addition, the decoding device may decode the syntax element to derive the binarized value (e.g., binarized bin) of the syntax element, and may debinarize the binarized value to derive the value of the syntax element. The binarization process may be performed as a truncated Rice (TR) binarization process, a k-order exponential Golomb (EGk) binarization process, a finite k-order exponential Golomb (finite EGk), a fixed length (FL) binarization process, etc. In addition, the debinarization process may represent a process performed based on a TR binarization process, an EGk binarization process, or a FL binarization process to derive the value of a syntax element.

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

[0208] The input of the TR binarization process may be the cMax and cRiceParam for the syntax element and a request for TR binarization. In addition, the output of the TR binarization process may be the TR binarization for symbolVal, which is the value corresponding to the bin string.

[0209] Specifically, for example, in the case where there is a suffix bin string for a syntax element, the TR bin string for the syntax element may be a concatenation of the prefix bin string and the suffix bin string, and in the case where there is no suffix bin string, the TR bin string for the syntax element may be a prefix bin string. For example, the prefix bin string may be derived as described below.

[0210] The prefix value for symbolVal of a syntax element may be derived as shown in the following equation.

[0211] [Equation 7]

[0212] prefixVal=symbolVal>>cRiceParam

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

[0214] For example, if prefixVal is less than cMax>>cRiceParam, the prefix bin string may be a bit string of length prefixVal+1 indexed by binIdx. That is, if prefixVal is less than cMax>>cRiceParam, the prefix bin string may be a bit string of length prefixVal+1 indicated by binIdx. The bin for a binIdx less than prefixVal may be equal to 1. Additionally, the bin for the same binIdx as prefixVal may be equal to 0.

[0215] For example, the bin string derived by unary binarization of prefixVal may be as shown in the following table.

[0216] [Table 7]

[0217]

[0218] Meanwhile, if prefixVal is not less than cMax>>cRiceParam, the prefix bin string may be a bit string with a length of cMax>>cRiceParam and all bits being 1.

[0219] In addition, if cMax is greater than symbolVal and if cRiceParam is greater than 0, there may be a bin suffix bin string of the TR bin string. For example, the suffix bin string may be derived as follows.

[0220] The suffix value of symbolVal for a syntax element can be derived as shown in the following equation.

[0221] [Equation 8]

[0222] suffixVal=symbolVal-((prefixVal)<<cRiceParam)

[0223] Here, suffixVal may represent the suffix value of symbolVal.

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

[0225] Meanwhile, if the value of the input parameter (ie, cRiceParam) is 0, the TR binarization may be an exact truncated unary binarization, and may always use the same value cMax as the possible maximum value of the syntax element to be decoded.

[0226] In addition, for example, the EGk binarization process may be performed as follows: The syntax element coded with ue(v) may be a syntax element subjected to exponential Golomb coding.

[0227] For example, a 0th-order Exponential Golomb (EG0) binarization process may be performed as follows.

[0228] The parsing process for a syntax element may start by reading the bits including the first non-zero bit starting at the current position of the bitstream and counting the number of leading bits equal to 0. The process may be represented as shown in the following table.

[0229] [Table 8]

[0230]

[0231] Additionally, the variable "codeNum" may be derived as shown in the following equation.

[0232] [Equation 9]

[0233] codeNum=2 leadingZeroBits -1+read_bits(leadingZeroBits)

[0234] Here, the value returned from read_bits(leadingZeroBits), that is, the value indicated by read_bits(leadingZeroBits), may be interpreted as a binary representation of an unsigned integer with the most significant bit recorded first.

[0235] The structure of the Exponential-Golomb code in which the bit string is divided into "prefix" bits and "suffix" bits can be represented as shown in the following table.

[0236] [Table 9]

[0237]

[0238] The "prefix" bits may be bits parsed as described above to calculate leadingZeroBits, and may be represented by 0 or 1 of the bit string in Table 9. That is, the bit string disclosed by 0 or 1 in Table 9 above may represent the prefix bit string. The "suffix" bits may be bits parsed in the calculation of codeNum, and may be represented by xi in Table 9 above. That is, the bit string disclosed as xi in Table 9 above may represent the suffix bit string. Here, i may be a value in the range of LeadingZeroBits-1. In addition, each xi may be equal to 0 or 1.

[0239] The bit string assigned to CodeNum may be as shown in the following table.

[0240] [Table 10]

[0241]

[0242] If the descriptor of the syntax element is ue(v), that is, if the syntax element is coded with ue(v), the value of the syntax element may be equal to codeNum.

[0243] In addition, for example, the EGk binarization process can be performed as follows.

[0244] The input of the EGk binarization process may be a request for EGk binarization. Additionally, the output of the EGk binarization process may be the EGk binarization for symbolVal (ie, the value corresponding to the bin string).

[0245] The bit string used for the EGk binarization process of symbolVal can be derived as follows.

[0246] [Table 11]

[0247]

[0248] Referring to Table 11 above, a binary value X can be added to the end of the bin string by each call of put(X). Here, X can be 0 or 1.

[0249] In addition, for example, the finite EGk binarization process can be performed as follows.

[0250] The input of the limited EGk binarization process can be a request for limited EGk binarization, a rice parameter riceParam, a log2TransformRange as a variable representing the base 2 logarithm of the maximum value, and a maxPreExtLen as a variable representing the maximum prefix extension length. In addition, the output of the limited EGk binarization process can be a limited EGk binarization for symbolVal as a value corresponding to the empty string.

[0251] The bit string for the finite EGk binarization process of symbolVal can be derived as follows.

[0252] [Table 12]

[0253]

[0254] In addition, for example, the FL binarization process can be performed as follows.

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

[0256] FL binarization can be configured by using a bit string of symbolVal with a fixed length of bits. Here, the fixed length bit may be an unsigned integer bit string. That is, a bit string for symbolVal as a symbol value can be derived by FL binarization, and the bit length (ie, the number of bits) of the bit string may be a fixed length.

[0257] For example, the fixed length may be derived as shown in the following equation.

[0258] [Equation 10]

[0259] fixedLength=Ceil(Log2(cMax+1))

[0260] The index of the bin used for FL binarization may be a method of using values ​​that increase sequentially 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.

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

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

[0263] The output of the binarization process for abs_remainder may be the binarization of abs_remainder (ie, the binarized bin string of abs_remainder). A usable bin string for abs_remainder may be derived through the binarization process.

[0264] The Rice parameter cRiceParam for abs_remainer[n] may be derived through a Rice parameter derivation process performed via the input color component cIdx and the luminance position (x0, y0), the current coefficient scan position (xC, yC), log2TbWidth (which is the base 2 logarithm of the width of the transform block), and log2TbHeight (which is the base 2 logarithm of the height of the transform block). A detailed description of the rice parameter derivation process will be described later.

[0265] In addition, for example, cMax for abs_remainder[n] currently to be compiled can be derived based on the Rice parameter cRiceParam. cMax can be derived as shown in the following equation.

[0266] [Equation 11]

[0267] cMax=6<<cRiccParam

[0268] Meanwhile, the binarization for abs_remainder (ie, the bin string for abs_remainder) may be the concatenation of the prefix bin string and the suffix bin string when there is a suffix bin string. In addition, the bin string for abs_remainder may be the prefix bin string when there is no suffix bin string.

[0269] For example, the prefix bin string may be derived as follows.

[0270] The prefix value prefixVal of abs_remainder[n] can be derived as shown in the following equation.

[0271] [Equation 12]

[0272] prefixVal=Min(cMax, abs_remainder[n])

[0273] The prefix of the bin string of abs_remainder[n] (ie, the prefix bin string) can be derived through the TR binarization process for prefixVal, where cMax and cRiceParam are used as input.

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

[0275] The derivation process of Rice parameters for dec_abs_level[n] can be as follows.

[0276] The input of the Rice parameter derivation process can be the color component index cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), the log2TbWidth as the base 2 logarithm of the width of the transform block, and the log2TbHeight as the base 2 logarithm of the height of the transform block. The luma position (x0, y0) can indicate the upper left sample of the current luma transform block based on the upper left luma sample of the picture. In addition, the output of the Rice parameter derivation process can be the Rice parameter cRiceParam.

[0277] For example, the variable locSumAbs may be derived based on the array AbsLevel[x][y] of a transform block with a given component index cIdx and an upper left luma position (x0, y0), similar to the pseudo code disclosed in the following table.

[0278] [Table 13]

[0279]

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

[0281] [Table 14]

[0282] locSumAbs 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 criccParam 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 locSumAbs 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 cRiceParam 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3

[0283] Additionally, for example, baseLevel can be set to 4 during the derivation of Rice parameters for abs_remainder[n].

[0284] Alternatively, for example, the Rice parameter cRiceParam can be determined based on whether the transform skip is applied to the current block. That is, if the transform is not applied to the current TB including the current CG, in other words, if the transform skip is applied to the current TB including the current CG, then the Rice parameter cRiceParam can be derived as 1.

[0285] Furthermore, the suffix value suffixVal of abs_remainder may be derived as shown in the following equation.

[0286] [Equation 13]

[0287] suffixVal=abs_remainder[n]-cMax

[0288] The suffix bin string of the bin string of abs_remainder can be derived through a finite EGk binarization process for suffixVal, where k is set to cRiceParam+1, riceParam is set to cRiceParam, log2TransformRange is set to 15, and maxPreExtLen is set to 11.

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

[0290] The input to the binarization process for dec_abs_level may be a request for binarization of the syntax element dec_abs_level[n], the color component cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), log2TbWidth as the base 2 logarithm of the width of the transform block, and log2TbHeight as the base 2 logarithm of the height of the transform block. The luma position (x0, y0) may indicate the top left sample of the current luma transform block based on the top left luma sample of the picture.

[0291] The output of the binarization process for dec_abs_level may be the binarization of dec_abs_level (ie, the binarized bin string of dec_abs_level). An available bin string for dec_abs_level may be derived through the binarization process.

[0292] The Rice parameter cRiceParam for dec_abs_level[n] can be derived by a Rice parameter derivation process performed using the color component cIdx, the luminance position (x0, y0), the current coefficient scan position (xC, yC), log2TbWidth as the base 2 logarithm of the width of the transform block, and log2TbHeight as the base 2 logarithm of the height of the transform block. Hereinafter, the Rice parameter derivation process will be described in detail.

[0293] In addition, for example, cMax for dec_abs_level[n] can be derived based on the Rice parameter cRiceParam. cMax can be derived as shown in the following table.

[0294] [Equation 14]

[0295] cMax=6<<cRiccParam

[0296] Meanwhile, binarization for dec_abs_level[n] (ie, bin string for dec_abs_level[n]) may be a concatenation of a prefix bin string and a suffix bin string when there is a suffix bin string. In addition, when there is no suffix bin string, the bin string for dec_abs_level[n] may be a prefix bin string.

[0297] For example, the prefix bin string may be derived as follows.

[0298] The prefix value prefixVal of dec_abs_level[n] may be derived as shown in the following equation.

[0299] [Equation 15]

[0300] prefixVal=Min(cMax, dec_abs_level[n])

[0301] The prefix of the bin string of dec_abs_level[n] (ie, the prefix bin string) can be derived through the TR binarization process for prefixVal, where cMax and cRiceParam are used as inputs.

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

[0303] The derivation process of Rice parameters for dec_abs_level[n] can be as follows.

[0304] The input of the Rice parameter derivation process can be the color component index cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), the log2TbWidth as the base 2 logarithm of the width of the transform block, and the log2TbHeight as the base 2 logarithm of the height of the transform block. The luma position (x0, y0) can indicate the upper left sample of the current luma transform block based on the upper left luma sample of the picture. In addition, the output of the Rice parameter derivation process can be the Rice parameter cRiceParam.

[0305] For example, the variable locSumAbs may be derived based on the array AbsLevel[x][y] of a transform block with a given component index cIdx and an upper left luma position (x0, y0), similar to the pseudo code disclosed in the following table.

[0306] [Table 15]

[0307]

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

[0309] [Table 16]

[0310] locSumAbs 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 criccParam 0 0 0 0 0 0 0 1 1 1 1 1 1 1 2 2 locSumAbs 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 cRiceParam 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3

[0311] In addition, for example, in the Rice parameter derivation process for dec_abs_level[n], baseLevel can be set to 0, and ZeroPos[n] can be derived as follows.

[0312] [Equation 16]

[0313] ZeroPos[n]=(QState<2?1:2)<<cRiceParam

[0314] In addition, the suffix value suffixVal of dec_abs_level[n] may be derived as shown in the following equation.

[0315] [Equation 17]

[0316] suffixVal=dec_abs_level[n]-cMax

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

[0318] Meanwhile, RRC and TSRC may have the following differences.

[0319] For example, in TSRC, the Rice parameter for the syntax element abs_remainder[] may be derived as 1. The Rice parameter cRiceParam of the syntax element abs_remainder[] in RRC may be derived based on LastAbsRemainder and lastRiceParam as described above, but the Rice parameter cRiceParam of the syntax element abs_remainder[] in TSRC may be derived as 1. That is, for example, when a transform skip is applied to a current block (e.g., a current TB), the Rice parameter cRiceParam of abs_remainder[] of the TSRC for the current block may be derived as 1.

[0320] In addition, for example, referring to Table 3 and Table 4, in RRC, abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1] may be signaled, but 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, abs_level_gtx_flag[n][0] may be expressed as abs_level_gt1_flag or a first coefficient level flag, abs_level_gtx_flag[n][1] may be expressed as abs_level_gt3_flag or a second coefficient level flag, abs_level_gtx_flag[n][2] may be expressed as abs_level_gt5_flag or a third coefficient level flag, abs_level_gtx_flag[n][3] may be expressed as abs_level_gt7_flag or a fourth coefficient level flag, and abs_level_gtx_flag[n][4] may be expressed as abs_level_gt9_flag or a fifth coefficient level flag. Specifically, the first coefficient level flag may be a flag indicating whether the coefficient level is greater than a first threshold value (e.g., 1), the second coefficient level flag may be a flag indicating whether the coefficient level is greater than a second threshold value (e.g., 3), the third coefficient level flag may be a flag indicating whether the coefficient level is greater than a third threshold value (e.g., 5), the fourth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fourth threshold value (e.g., 7), and the fifth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fifth threshold value (e.g., 9). As described above, in TSRC, compared with RRC, abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], abs_level_gtx_flag[n][4] may also be included.

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

[0322] At the same time, the present disclosure proposes a method for applying a level mapping technique in a simplified residual data coding structure for a transform skip block. Here, the transform skip block may represent a block to which a transform is not applied. In addition, the level mapping technique may refer to a technique for mapping an absolute coefficient level (i.e., absCoeffLevel) to a modified level coded by a method based on (quantized) left residual samples and upper residual samples of a current residual sample (i.e., current residual coefficient) when block-based quantized residual domain differential pulse coding modulation (BDPCM) is not applied to a current block (e.g., CU). Under specific conditions such as lossless coding or near-lossless coding, the simplified residual data coding structure may be used for one coding block or an entire transform block or some sub-blocks / coefficient groups (CGs). Alternatively, in the proposed method, the number of context coding bins that can be used for residual (data) coding within one TU (transform unit, TU) can be limited to a specific threshold, and when all context coding bins available for residual coding of the TU are exhausted (i.e., when the number of context coding bins for residual coding of the TU is equal to the specific threshold), a simplified residual data coding structure can be used.

[0323] Fig. 9 The figure shows an example of simplified residual data coding for one CG, transform block or coding block. With simplified residual coding, the syntax elements sig_coeff_flag, coeff_sign_flag and abs_remainder can be coded. Fig. 9 As shown in , the syntax elements for the residual coefficients in the CG, transform block or coding block are coded in order from top to bottom. That is, the syntax elements for the residual coefficients in the CG, transform block or coding block can be coded in the order of sig_coeff_flag, coeff_sign_flag and abs_remainder.

[0324] sig_coeff_flag may represent a syntax element for a significant coefficient flag. sig_coeff_flag may represent whether the residual coefficient of the current block (CG, transform block, or coding block) is a non-zero residual coefficient. For example, if the value of the residual coefficient at the corresponding position is 0, sig_coeff_flag may have a value of 0, and if it is not 0, sig_coeff_flag may have a value of 1. And, coeff_sign_flag may represent a syntax element for a sign flag of a residual coefficient. sig_coeff_flag may represent the sign of the residual coefficient. For example, coeff_sign_flag may refer to the sign value of the residual coefficient at the corresponding position. Various methods may exist for applying coeff_sign_flag. For example, when the residual coefficient at the corresponding position is 0, that is, when the value of sig_coeff_flag for the residual coefficient is 0, coeff_sign_flag may not be coded. And, for a non-zero residual coefficient, when the residual coefficient of the corresponding position is a negative value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient of the corresponding position is a positive value, coeff_sign_flag may have a value of 0 (or 1). Alternatively, regardless of the value of sig_coeff_flag of the residual coefficient, when the residual coefficient is a negative value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient is a positive value or 0, coeff_sign_flag may have a value of 0 (or 1). Alternatively, when the residual coefficient is a positive value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient is a negative value or 0, coeff_sign_flag may have a value of 0 (or 1). In addition, abs_remainder may represent a syntax element for residual level value information or coefficient value related information. For example, abs_remainder may refer to a residual level value. For example, when the value of sig_coeff_flag for the residual coefficient is 0, abs_remainder for the residual coefficient may not be coded, and when the value of sig_coeff_flag for the residual coefficient is 1, abs_remainder may have a value obtained by subtracting 1 (absolute value -1) from the absolute value of the residual coefficient.

[0325] Meanwhile, even when performing regular residual compilation, if certain conditions are met, it can be converted to Fig. 9For example, a specific condition may be a situation where all context coding bins that can be used are exhausted when the residual information of the corresponding coding block is losslessly or nearly losslessly coded and / or when a TU-level context coding bin constraint algorithm is applied.

[0326] Fig.10 Another example of simplified residual data coding for one CG, transform block or coding block is shown. With simplified residual coding, the syntax elements dec_abs_level, coeff_sign_flag can be coded. Fig.10 As shown in , the syntax elements for the residual coefficients in the CG, transform block or coding block are coded in a top-to-bottom order. That is, the syntax elements for the residual coefficients in the CG, transform block or coding block can be coded in the order of dec_abs_level, coeff_sign_flag.

[0327] refer to Fig.10 , dec_abs_level may represent a syntax element for coefficient value related information, and coeff_sign_flag may represent a syntax element for a sign flag of a residual coefficient. Fig.10 In the structure shown, when the residual coefficient is 0, the value of dec_abs_level can be 0, and when the residual coefficient is not 0, the value of dec_abs_level can be the absolute value of the residual coefficient. In addition, for example, coeff_sign_flag can refer to the sign value of the residual coefficient at the corresponding position. Various methods for applying coeff_sign_flag may exist. For example, when the residual coefficient at the corresponding position is 0, coeff_sign_flag may not be encoded. And, for a non-zero residual coefficient, when the residual coefficient at the corresponding position is a negative value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient at the corresponding position is a positive value, coeff_sign_flag may have a value of 0 (or 1). Alternatively, regardless of the dec_abs_level of the residual coefficient, coeff_sign_flag may be coded, and when the residual coefficient is a negative value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient is a positive value or 0, coeff_sign_flag may have a value of 0 (or 1). Alternatively, when the residual coefficient is a positive value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient is a negative value or 0, coeff_sign_flag may have a value of 0 (or 1).

[0328] Meanwhile, even when performing regular residual compilation, if certain conditions are met, it can be converted to Fig.10 For example, a specific condition may be a situation where all context coding bins that can be used are exhausted when the residual information of the corresponding coding block is losslessly or nearly losslessly coded and / or when a TU-level context coding bin constraint algorithm is applied.

[0329] Fig.11 The figure shows another example of simplified residual data coding for one CG, transform block or coding block. With simplified residual coding, the syntax elements coeff_sign_flag, dec_abs_level can be coded. Fig.11 As shown in , the syntax elements for the residual coefficients in the CG, transform block or coding block are coded in a top-to-bottom order. That is, the syntax elements for the residual coefficients in the CG, transform block or coding block can be coded in the order of coeff_sign_flag, dec_abs_level.

[0330] refer to Fig.11 , coeff_sign_flag may represent a syntax element for a sign flag of a residual coefficient, and dec_abs_level may represent a syntax element for coefficient value related information. For example, when the residual coefficient of the position to be coded is a negative value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient is a positive value or 0, coeff_sign_flag may have a value of 0 (or 1). Alternatively, for example, when the residual coefficient is a positive value, coeff_sign_flag may have a value of 1 (or 0), and when the residual coefficient is a negative value or 0, coeff_sign_flag may have a value of 0 (or 1).

[0331] Meanwhile, even when performing regular residual compilation, if certain conditions are met, it can be converted to Fig.11 For example, the specific condition may be a case where all context coding bins that can be used are exhausted when the residual information of the corresponding coding block is losslessly or nearly losslessly coded and / or when a TU-level context coding bin constraint algorithm is applied.

[0332] At the same time, as described above, a level mapping technique for transform skip mode may be used. For example, in the level mapping technique, the value of abs_level_gtx_flag[0] may be used as a value indicating whether level mapping is performed. That is, whether to map the level may be determined based on the value of abs_level_gtx_flag[0]. Therefore, in a simplified residual data coding structure in which abs_level_gtx_flag[0] is not coded, decoding of residual coefficients to which level mapping is applied cannot be performed correctly. Therefore, the present disclosure proposes a method for not using level mapping for coding blocks, transform blocks, coefficient groups, and / or residual coefficients to which simplified residual data coding is applied, so that Fig. 9 , Fig.10 or Fig.11 The simplified residual data coding structure and level map can be used together. According to an embodiment of the present disclosure, the simplified residual data coding structure and level map can be combined without problems in residual coding for transform skip blocks.

[0333] For example, in one coding block, the residual data coding method for the transform skip block and the simplified residual data coding method shown in Table 4 can be mixed, when the residual data coding for the transform skip block is applied, the level mapping technology shown in Table 4 can be applied as is, and when the simplified residual data coding is applied, the level mapping technology can be applied.

[0334] Table 17 and Table 18, which will be described below, exemplarily show syntax to which the embodiments proposed in the present disclosure are applied.

[0335] [Table 17]

[0336]

[0337] [Table 18]

[0338]

[0339] Table 17 may represent a syntax structure for preventing level mapping from being performed when a context coding bin constraint algorithm is applied, available context coding bins (MaxCcbs represents the number of context coding bins that can be used) are exhausted and converted into a simplified residual data coding structure. In addition, Table 18 may represent a syntax structure for applying the method proposed in the present disclosure when a simplified residual data coding structure is used for a lossless coding block. Here, for example, transquant_bypass_flag shown in Table 18 may be a syntax element indicating whether lossless coding is applied. transquant_bypass_flag may be signaled at a CU or TU or picture level.

[0340] At the same time, Tables 17 and 18 are merely examples of applying the embodiments proposed in the present disclosure, and are not limited thereto. In the present disclosure, as an embodiment, when a simplified residual data coding structure is executed, in order to encode / decode the residual coefficients of the level map, it is proposed that a process of not performing the correction coding / decoding level is performed. That is, for example, a method can be proposed in which a residual coefficient of the current block is derived using a simplified residual data coding structure when all context coding bins for the current block are used without deriving the residual coefficients through level mapping. The simplified residual data coding structure can be as described above. For example, when all context coding bins for the current block are used, the residual coefficient can be derived based on the value of the information representing the absolute value and the sign information. In addition, for example, Table 4 can represent an example of applying the embodiments proposed in the present disclosure.

[0341] Fig.12 An image encoding method performed by an encoding device according to the present disclosure is briefly illustrated. Fig.12 The method disclosed in can be Figure 2 Specifically, for example, Fig.12 S1200 may be performed by a predictor of an encoding device; Fig.12 S1210 to S1220 of the encoding device may be performed by a residual processor of the encoding device; and S1230 may be performed by an entropy encoder of the encoding device. In addition, although not shown, the process of generating a reconstructed picture and a reconstructed sample for the current block based on the predicted sample and the residual sample for the current block may be performed by an adder of the encoding device.

[0342] The encoding device derives a prediction sample for the current block based on inter prediction or intra prediction (S1200). The encoding device may derive a prediction sample for the current block based on a prediction mode. In this case, various prediction methods disclosed in this document, such as inter prediction or intra prediction, may be applied.

[0343] For example, the encoding device may determine whether to perform inter prediction or intra prediction on the current block, and may determine a specific inter prediction mode or a specific intra prediction mode based on the RD cost. According to the determined mode, the encoding device may derive a prediction sample for the current block.

[0344] The encoding apparatus derives residual samples of the current block based on the prediction samples (S1210). For example, the encoding apparatus may derive residual samples by subtracting the original samples and the prediction samples for the current block.

[0345] The encoding device derives the current residual coefficient based on the residual sample (S1220). For example, the encoding device may derive the current residual coefficient of the current block based on the residual sample. For example, the encoding device may determine whether a transform is applied to the current block. That is, the encoding device may determine whether a transform is applied to the residual sample of the current block. The encoding device may determine whether to apply the transform to the current block in consideration of coding efficiency. For example, the encoding device may determine that a transform is not applied to the current block. A block to which a 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.

[0346] If the transform is not applied to the current block, that is, if the transform is not applied to the residual sample, the encoding device may derive the derived residual sample as the current residual coefficient. In addition, if the transform is applied to the current block, that is, if the transform is applied to the residual sample, the encoding device may derive the current residual coefficient by performing the transform on the residual sample. The current residual coefficient may be included in the current sub-block of the current block. The current sub-block may be referred to as a current coefficient group (CG). In addition, the size of the current sub-block of the current block may be 4×4 size or 2×2 size. That is, the current sub-block of the current block may include up to 16 non-zero residual coefficients or up to 4 non-zero residual coefficients.

[0347] Here, the current block may be a coding block (CB) or a transform block (TB). In addition, the residual coefficient may be referred to as a transform coefficient.

[0348] At the same time, for example, the current residual coefficient can be derived without performing level mapping. For example, the number of context coded residual syntax elements for the residual coefficient before the current residual coefficient among the residual coefficients of the current block can be equal to the maximum number of context coded bins of the current block, and the residual syntax element for the current residual coefficient can include absolute level information for the current residual coefficient and a sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. Here, deriving the current residual coefficient using only absolute level information and a sign flag can be represented as simplified residual data coding. That is, the residual coefficient can be derived based on simplified residual data coding. In addition, for example, the context coded bins for the current block can all be used as bins for the context coded residual syntax elements for the residual coefficient before the current residual coefficient among the residual coefficients of the current block, and the residual syntax element for the current residual coefficient can include coefficient level information for the current residual coefficient and a sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. For example, when all the maximum number of context coding bins of the current block are used for the residual syntax element of the previous residual coefficient of the current residual coefficient in the scanning order, and the residual syntax element for the current residual coefficient may include coefficient level information for the current residual coefficient and a sign flag of the residual coefficient, and the current residual coefficient may be derived without performing level mapping. In addition, for example, the residual coefficient before the current residual coefficient may be derived by performing level mapping.

[0349] Meanwhile, for example, the level mapping may represent the method shown in Table 19.

[0350] [Table 19]

[0351]

[0352] Here, X0 may represent the left absolute coefficient level of the current residual coefficient (i.e., the coefficient level of the left residual sample (left residual coefficient)), and X1 may represent the upper absolute coefficient level of the current residual coefficient (i.e., the coefficient level of the upper residual sample (upper residual coefficient)). In addition, absCoefff may represent the absolute level coefficient of the current residual coefficient, and absCoeffMod may represent the level of the level mapping through the above process.

[0353] For example, level mapping may represent the following process: deriving the maximum value among the absolute levels of the left residual coefficients of the residual coefficients and the absolute levels of the upper residual coefficients of the residual coefficients, and modifying the absolute level of the residual coefficients based on the maximum value by comparing the maximum value and the absolute level of the residual coefficients.

[0354] The encoding device encodes the image information including the prediction mode information representing the prediction mode of the current block and the residual syntax element for the current residual coefficient (S1230). The encoding device may encode the image information including the prediction mode information representing the prediction mode of the current block and the residual syntax element for the current residual coefficient. For example, the encoding device may generate and encode the prediction related information for the current block. The prediction related information may include the prediction mode information. In addition, the encoding device may encode the residual information including the residual syntax element for the current residual coefficient of the current block. The image information may include residual information. For example, the encoding device may encode the image information including the residual information and output the encoded image information in the form of a bit stream. The bit stream may be sent to the decoding device via a network or a storage medium.

[0355] In addition, for example, the number of context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block may be equal to the maximum number of context coding bins of the current block. That is, for example, the context coding bins for the current block may all be used as bins for context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block. In other words, for example, all the maximum number of context coding bins for the current block may be used for residual syntax elements for the previous residual coefficients of the current residual coefficient in the scanning order. At the same time, for example, the maximum number of context coding bins for the current block may be derived based on the width and height of the current block.

[0356] For example, the number of context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block may be equal to the maximum number of context coded bins of the current block, and the residual syntax element for the current residual coefficient may include absolute level information for the current residual coefficient and a sign flag of the current residual coefficient. For example, all context coded bins for the current block may be used as bins for context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block, and the residual syntax element for the current residual coefficient may include coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient. For example, when all maximum number of context coded bins for the current block are used for residual syntax elements for the previous residual coefficients of the current residual coefficient in the scanning order, the residual syntax element for the current residual coefficient may include coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient. The residual syntax element for the current residual coefficient is encoded based on bypass. That is, the residual syntax element for the current residual coefficient may be encoded based on a uniform probability distribution. For example, the coefficient level information may indicate an absolute value of the coefficient level of the current residual coefficient. In addition, the sign flag may indicate a sign of the current residual coefficient. For example, when the value of the sign flag is 0, the sign flag may indicate that the coefficient level of the current residual coefficient is a positive value, and when the value of the sign flag is 1, the sign flag may indicate that the coefficient level of the current residual coefficient is a negative value. The coefficient level information may be abs_remainder, and the sign flag may be coeff_sign_flag.

[0357] In addition, for example, the residual information may include a transform skip flag for the current block. The transform skip flag may indicate whether a transform is applied to the current block. That is, the transform skip flag may indicate whether a transform is applied to the residual coefficients of the current block. The syntax element indicating the transform skip flag may be transform_skip_flag. For example, when the value of the transform skip flag is 0, the transform skip flag may indicate that a transform is not applied to the current block, and when the value of the transform skip flag is 1, 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.

[0358] In addition, for example, the encoding device may generate residual information of the current block based on the residual samples of the current block. For example, the image information may include residual information for the current block. For example, the residual information may include residual syntax elements for residual coefficients that precede the current residual coefficient in the scanning order. For example, the residual syntax elements may include syntax elements such as coded_sub_block_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, abs_remainder, and / or coeff_sign_flag.

[0359] For example, the context coded residual syntax element may include a significant coefficient flag indicating whether the residual coefficient is a non-zero residual coefficient, a parity level flag for the parity of the coefficient level of the residual coefficient, a sign flag indicating the sign of the residual coefficient, a first coefficient level flag for whether the coefficient level is greater than a first threshold, and / or a second coefficient level flag for whether the coefficient level is greater than a second threshold. In addition, for example, the context coded residual syntax element may include a third coefficient level flag for whether the coefficient level is greater than a third threshold, a fourth coefficient level flag for whether the coefficient level of the residual coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag for whether the coefficient level of the residual coefficient is greater than a fifth threshold. Here, the significant coefficient flag may be sig_coeff_flag, the parity level flag may be par_level_flag, the sign flag may be coeff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, and the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag. Furthermore, 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.

[0360] In addition, for example, the residual information may include a bypass-based coding syntax element for a residual coefficient of the current block. The bypass coding syntax element may include coefficient level information about the value of the current residual coefficient. The coefficient level information may be abs_remainder or dec_abs_level. In addition, the bypass coding syntax element may include a sign flag.

[0361] In addition, for example, the encoding device may generate prediction information for the current block. The image information may include prediction information for the current block. The prediction information may include information for an inter-frame prediction mode or an intra-frame prediction mode performed on the current block. The decoding device may perform inter-frame prediction or intra-frame prediction on the current block based on the prediction information received through the bitstream, and may derive a prediction sample of the current block.

[0362] At the same time, the bit stream can be sent to the decoding device via a network or a (digital) storage medium. Here, 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.

[0363] Fig.13 An encoding device for performing an image encoding method according to the present disclosure is briefly illustrated. Fig.12 The method disclosed in can be Fig.13 Specifically, for example, Fig.13 The predictor of the encoding device can perform Fig.12 S1200, Fig.13 The residual processor of the encoding device may perform Fig.12 S1210 to S1220, and Fig.13 The entropy encoder of the encoding device can perform Fig.12 In addition, although not shown, the process of generating a reconstructed picture and reconstructed samples for the current block based on the prediction samples and residual samples for the current block may be performed by an adder of the encoding device.

[0364] Fig.14 The following briefly illustrates an image decoding method performed by a decoding device according to the present disclosure. Fig.14 The method disclosed in can be Figure 3 Specifically, for example, Fig.14 S1400 may be performed by an entropy decoder of a decoding device; S1410 to S1420 may be performed by a predictor of a decoding device; S1430 to S1440 may be performed by a residual processor of a decoding device; and S1450 may be performed by an adder of a decoding device.

[0365] The decoding device obtains image information including prediction mode information and residual information through a bitstream (S1400). The decoding device may obtain image information including prediction mode information and residual information for a current block through a bitstream. For example, the image information may include prediction mode information for the current block. For example, the image information may include prediction related information for the current block, and the prediction related information may include prediction mode information. The prediction mode information may indicate whether inter prediction or intra prediction is applied to the current block.

[0366] In addition, for example, the residual information may include a residual syntax element for a current residual coefficient in the current block. In addition, for example, the residual information may include a residual syntax element for a residual coefficient in the current block. Here, the current block may be a coding block (CB) or a transform block (TB). In addition, the residual coefficient may be referred to as a transform coefficient.

[0367] Furthermore, for example, the current block may be a transform skip block.

[0368] In addition, for example, the number of context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block may be equal to the maximum number of context coding bins of the current block, and the residual syntax element for the current residual coefficient may include absolute level information for the current residual coefficient and a sign flag of the current residual coefficient. The maximum number of context coding bins of the current block may be derived based on the width and height of the current block. For example, the maximum context coding bins for the current block may all be used as bins for context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block, and the residual syntax element for the current residual coefficient may include coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient. For example, when all the maximum number of context coding bins for the current block are used for residual syntax elements for the previous residual coefficient of the current residual coefficient in the scanning order, the residual syntax element for the current residual coefficient may include coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient. The residual syntax element for the current residual coefficient is decoded based on bypass. That is, the residual syntax element for the current residual coefficient can be decoded based on the uniform probability distribution. For example, the coefficient level information can represent the absolute value of the coefficient level of the current residual coefficient. In addition, the sign flag can represent the sign of the current residual coefficient. For example, when the value of the sign flag is 0, the sign flag can represent that the coefficient level of the current residual coefficient is a positive value, and when the value of the sign flag is 1, the sign flag can represent that the coefficient level of the current residual coefficient is a negative value. The coefficient level information can be abs_remainder, and the sign flag can be coeff_sign_flag.

[0369] In addition, for example, the residual information may include a transform skip flag for the current block. The transform skip flag may indicate whether a transform is applied to the current block. That is, the transform skip flag may indicate whether a transform is applied to the residual coefficients of the current block. The syntax element indicating the transform skip flag may be transform_skip_flag. For example, when the value of the transform skip flag is 0, the transform skip flag may indicate that a transform is not applied to the current block, and when the value of the transform skip flag is 1, 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.

[0370] In addition, for example, the image information may include residual information for the current block. For example, the residual information may include a residual syntax element for a residual coefficient that precedes the current residual coefficient in the scanning order. For example, the residual syntax element may include syntax elements such as coded_sub_block_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, abs_remainder, and / or coeff_sign_flag.

[0371] For example, the context coded residual syntax element may include a significant coefficient flag indicating whether the residual coefficient is a non-zero residual coefficient, a parity level flag for the parity of the coefficient level of the residual coefficient, a sign flag indicating the sign of the residual coefficient, a first coefficient level flag for whether the coefficient level is greater than a first threshold, and / or a second coefficient level flag for whether the coefficient level is greater than a second threshold. In addition, for example, the context coded residual syntax element may include a third coefficient level flag for whether the coefficient level is greater than a third threshold, a fourth coefficient level flag for whether the coefficient level of the residual coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag for whether the coefficient level of the residual coefficient is greater than a fifth threshold. Here, the significant coefficient flag may be sig_coeff_flag, the parity level flag may be par_level_flag, the sign flag may be coeff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, and the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag. Furthermore, 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.

[0372] In addition, for example, the residual information may include a bypass-based coding syntax element for a residual coefficient of the current block. The bypass coding syntax element may include coefficient level information about the value of the current residual coefficient. The coefficient level information may be abs_remainder or dec_abs_level. In addition, the bypass coding syntax element may include a sign flag.

[0373] The decoding apparatus derives a prediction mode of the current block based on the prediction mode information (S1410). The decoding apparatus may determine whether to apply inter prediction or intra prediction to the current block based on the prediction mode information, and may perform prediction based thereon.

[0374] The decoding apparatus derives a prediction sample based on the prediction mode ( S1420 ).

[0375] For example, the decoding device may derive the prediction mode applied to the current block based on the prediction mode information, and may derive the prediction sample of the current block based on the prediction mode. For example, when inter-frame prediction is applied to the current block, the decoding device may derive the motion information of the current block based on the prediction related information included in the image information, and may derive the prediction sample of the current block based on the motion information. In addition, for example, when intra-frame prediction is applied to the current block, the decoding device may derive the reference sample based on the adjacent samples of the current block, and may derive the prediction sample of the current block based on the reference sample and the intra-frame prediction mode of the current block. The reference sample may include an upper reference sample and a left reference sample of the current block. For example, when the size of the current block is N×N, and the x component of the upper left sample position of the current block is 0, and its y component is 0, the left reference sample may be P[-1][0] to P[-1][2N-1], and the upper reference sample may be P[0][-1] to P[2N-1][-1].

[0376] The decoding apparatus derives the current residual coefficient based on the residual syntax element for the current residual coefficient in the current block (S1430). The decoding apparatus may derive the current residual coefficient based on the residual syntax element. The residual syntax element may include coefficient level information for the current residual coefficient and a sign flag of the residual coefficient.

[0377] For example, the absolute level of the current residual coefficient may be derived as a value indicated by the coefficient level information for the current residual coefficient, and the sign of the current residual coefficient may be derived as a sign indicated by the sign flag.

[0378] At the same time, for example, the current residual coefficient can be derived without performing level mapping. For example, the number of context coded residual syntax elements for the residual coefficient before the current residual coefficient among the residual coefficients of the current block can be equal to the maximum number of context coded bins of the current block, and the residual syntax element for the current residual coefficient can include absolute level information for the current residual coefficient and a sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. Here, deriving the current residual coefficient using only absolute level information and a sign flag can be represented as simplified residual data coding. That is, the residual coefficient can be derived based on simplified residual data coding. In addition, for example, the context coded bins for the current block can all be used as bins for the context coded residual syntax elements for the residual coefficient before the current residual coefficient among the residual coefficients of the current block, and the residual syntax element for the current residual coefficient can include coefficient level information for the current residual coefficient and a sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. For example, when all the maximum number of context coding bins for the current block are used for the residual syntax element of the previous residual coefficient of the current residual coefficient in the scanning order, the residual syntax element for the current residual coefficient may include coefficient level information for the current residual coefficient and a sign flag of the residual coefficient, and the current residual coefficient may be derived without performing level mapping. In addition, for example, the residual coefficient before the current residual coefficient may be derived by performing level mapping.

[0379] Meanwhile, for example, the level mapping may represent the method shown in the above Table 19. For example, the level mapping may refer to the following process: deriving the maximum value of the absolute level of the left residual coefficient of the residual coefficient and the absolute level of the upper residual coefficient of the residual coefficient, and modifying the absolute level of the residual coefficient based on the maximum value by comparing the maximum value and the absolute level of the residual coefficient.

[0380] The decoding device derives residual samples based on the current residual coefficient (S1440). The decoding device may derive residual samples of the current block based on the current residual coefficient. That is, the decoding device may derive residual samples of the current block based on the current residual coefficient. For example, when it is derived based on the transform skip flag that the transform is not applied to the current block, that is, when the value of the transform skip flag is one (1), the decoding device may derive the current residual coefficient as the residual sample of the current block. Alternatively, for example, when it is derived based on the transform skip flag that the transform is not applied to the current block, that is, when the value of the transform skip flag is 1, the decoding device may derive the residual sample of the current block by dequantizing the current residual coefficient. Alternatively, for example, when it is derived based on the transform skip flag that the transform is applied to the current block, that is, when the value of the transform skip flag is zero (0), the decoding device may derive the residual sample of the current block by inverse transforming the current residual coefficient. Alternatively, for example, when it is derived based on the transform skip flag that a transform is applied to the current block, that is, when the value of the transform skip flag is 0, the decoding device may derive residual samples of the current block by dequantizing the current residual coefficients and inverse transforming the dequantized coefficients.

[0381] The decoding apparatus derives a reconstructed sample of the current block based on the residual sample and the prediction sample (S1450).

[0382] For example, the decoding device may derive the reconstructed sample of the current block based on the residual sample and the prediction sample. For example, the decoding device may generate the reconstructed sample by adding the prediction sample and the residual sample.

[0383] Thereafter, optionally, an in-loop filtering process such as deblocking filtering, SAO and / or ALF process may be applied to the reconstructed picture as described above in order to improve the subjective / objective picture quality.

[0384] Fig.15 A decoding device for performing the image decoding method according to the present document is schematically represented. Fig.14 The method disclosed in can be Fig.15 Specifically, for example, Fig.15 The entropy decoder of the decoding device can perform Fig.14 S1400; Fig.15 The predictor of the decoding device can perform Fig.14 S1410 to S1420; Fig.15 The residual processor of the decoding device may perform Fig.14 S1430 to S1440; and Fig.15 The adder of the decoding device can perform Fig.14 S1450.

[0385] According to the above disclosure, the efficiency of residual coding can be improved.

[0386] In addition, according to the present disclosure, the overall image / video compression efficiency can be improved and the coding complexity can be reduced by deriving residual coefficients to which simplified residual data coding is applied without performing level mapping.

[0387] In addition, according to the present disclosure, the residual coefficients to which the simplified residual data coding is applied may have low correlation with the adjacent residual coefficients, and thus the efficiency of the level mapping performed based on the adjacent residual coefficients may be low. Therefore, the coding complexity can be reduced and the overall residual coding efficiency can be improved without performing level mapping on the residual coefficients to which the simplified residual data coding is applied.

[0388] In the above embodiments, the method is described based on a flow chart with a series of steps or boxes. The present disclosure is not limited to the order of the above steps or boxes. Some steps or boxes may be performed in an order different from other steps or boxes mentioned above or performed simultaneously. In addition, it will be appreciated by those skilled in the art that the steps shown in the flow chart are not exclusive, and other steps may also be included, or one or more steps in the flow chart may be deleted without affecting the scope of the present disclosure.

[0389] The embodiments described in this specification may be implemented on a processor, a microprocessor, a controller or a chip. For example, the functional units shown in each figure may be implemented on a computer, a processor, a microprocessor, a controller or a chip. In this case, information (e.g., information about instructions) or algorithms for implementation may be stored in a digital storage medium.

[0390] In addition, the decoding device and encoding device of the present disclosure can be included in the following devices: multimedia broadcast sending / receiving devices, mobile communication terminals, home theater video devices, digital theater video devices, surveillance cameras, video chat devices, real-time communication devices such as video communication, mobile streaming devices, storage media, portable cameras, VoD service providers, over-the-top (OTT) video devices, Internet streaming service providers, three-dimensional (3D) video devices, teleconferencing video devices, transportation user devices (e.g., vehicle user devices, aircraft user devices, and ship user devices) and medical video equipment; and the decoding device and encoding device of the present disclosure can be used to process video signals or data signals. For example, over-the-top (OTT) video devices may include game consoles, Blu-ray players, Internet access televisions, home theater systems, smart phones, tablet computers, digital video recorders (DVRs), etc.

[0391] In addition, the processing method of the present invention can be generated in the form of a program executed by a computer and can be stored in a computer-readable recording medium. The multimedia data with a data structure according to the present invention can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, BD, universal serial bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, magnetic tape, floppy disk and optical data storage device. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier wave (e.g., transmission via the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable recording medium or transmitted via a wired / wireless communication network.

[0392] In addition, the embodiments of the present disclosure may be implemented using a computer program product according to a program code, and the program code may be executed in a computer through the embodiments of the present disclosure. The program code may be stored on a computer readable carrier.

[0393] Fig.16 A structural diagram of a content streaming system to which the present disclosure is applied is illustrated.

[0394] The content streaming system to which the embodiments of this document are applied may mainly include an encoding server, a streaming server, a network server, a media storage, a user device, and a multimedia input device.

[0395] The encoding server compresses the content input from a multimedia input device such as a smartphone, a camera, or a camcorder into digital data to generate a bitstream and sends the bitstream to the streaming server. As another example, when a multimedia input device such as a smartphone, a camera, or a camcorder directly generates a bitstream, the encoding server can be omitted.

[0396] A bitstream may be generated by an encoding method or a bitstream generating method to which an embodiment of the present disclosure is applied, and a streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0397] The streaming server sends multimedia data to the user device through the network server based on the user request, and the network server is used as a medium to notify the user of the service. When the user requests the required service from the network server, the network server delivers the request to the streaming server, and the streaming server sends the multimedia data to the user. In this case, the content streaming system may include a separate control server. In this case, the control server is used to control the command / response between the devices within the content streaming system.

[0398] The streaming server can receive content from a media storage and / or encoding server. For example, when receiving content from an encoding server, the content can be received in real time. In this case, in order to provide a stable streaming service, the streaming server can store the bitstream for a predetermined period of time.

[0399] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigators, touch screen PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, and head mounted displays), digital TVs, desktop computers, and digital signage, etc. Each server within the content streaming system may operate as a distributed server, in which case data received from each server may be distributed.

[0400] The claims described in this disclosure may be combined in various ways. For example, the technical features of the method claims of this disclosure may be combined to be implemented as a device, and the technical features of the device claims of this disclosure may be combined to be implemented as a method. In addition, the technical features of the method claims of this disclosure and the technical features of the device claims may be combined to be implemented as a device, and the technical features of the method claims of this disclosure and the technical features of the device claims may be combined to be implemented as a method.

Claims

1. A method for decoding an image performed by a decoding device, the method comprising: Obtaining image information including prediction mode information and residual information through a bit stream; deriving a prediction mode of a current block based on the prediction mode information; deriving a prediction sample based on the prediction model; deriving a current residual coefficient based on a residual syntax element for a current residual coefficient in the current block; deriving residual samples based on the current residual coefficients; as well as deriving a reconstructed sample of the current block based on the residual sample and the predicted sample, The residual information includes a residual syntax element for the current residual coefficient, wherein the number of context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block is equal to the maximum number of context coded bins of the current block, The residual syntax element for the current residual coefficient includes coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, wherein the absolute level of the current residual coefficient is derived as a value indicated by the coefficient level information for the current residual coefficient, and the sign of the current residual coefficient is derived as a sign indicated by the sign flag, wherein the current residual coefficients are derived without performing level mapping, and The residual coefficient before the current residual coefficient is derived by performing the level mapping.

2. The image decoding method according to claim 1, wherein: The current block is a transform skip block.

3. The image decoding method according to claim 2, wherein: The image information includes a transform skip flag indicating whether a transform is applied to the current block, and The value of the transform skip flag for the current block is 1.

4. The image decoding method according to claim 1, wherein: A maximum number of the context coding bins of the current block is derived based on a width and a height of the current block.

5. The image decoding method according to claim 1, wherein: The context coding bins for the current block are all used as bins for the context coded residual syntax elements for the residual coefficients preceding the current residual coefficient.

6. The image decoding method according to claim 1, wherein: The context-coded residual syntax element includes a significant coefficient flag indicating whether the residual coefficient is a non-zero residual coefficient, a parity level flag for the parity of the coefficient level for the residual coefficient, a sign flag indicating the sign for the residual coefficient, a first coefficient level flag for whether the coefficient level is greater than a first threshold, and a second coefficient level flag for whether the coefficient level is greater than a second threshold.

7. An image encoding method performed by an encoding device, the method comprising: Derivation of prediction samples of the current block based on inter-frame prediction or intra-frame prediction; deriving residual samples of the current block based on the prediction samples; deriving a current residual coefficient based on the residual sample; as well as encoding image information, the image information comprising prediction mode information indicating a prediction mode of the current block and a residual syntax element for the current residual coefficient, wherein the number of context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block is equal to the maximum number of context coded bins of the current block, The residual syntax element for the current residual coefficient includes coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, The coefficient level information indicates the absolute value of the coefficient level of the current residual coefficient, and the sign flag of the current residual coefficient indicates the sign of the current residual coefficient. wherein the current residual coefficient is encoded without performing level mapping, and Wherein, the residual coefficients before the current residual coefficient are encoded by performing the level mapping.

8. The image encoding method according to claim 7, wherein: The current block is a transform skip block.

9. The image encoding method according to claim 8, wherein: The image information includes a transform skip flag indicating whether a transform is applied to the current block, and The value of the transform skip flag for the current block is 1.

10. The image encoding method according to claim 7, wherein: A maximum number of the context coding bins of the current block is derived based on a width and a height of the current block.

11. The image encoding method according to claim 7, wherein: The context coding bins for the current block are all used as bins for the context coded residual syntax elements for the residual coefficients preceding the current residual coefficient.

12. The image encoding method according to claim 7, wherein: The context-coded residual syntax element includes a significant coefficient flag indicating whether the residual coefficient is a non-zero residual coefficient, a parity level flag for the parity of the coefficient level for the residual coefficient, a sign flag indicating the sign for the residual coefficient, a first coefficient level flag for whether the coefficient level is greater than a first threshold, and a second coefficient level flag for whether the coefficient level is greater than a second threshold.

13. A method for transmitting image data, the method comprising: Obtaining a bitstream of image information, the image information comprising prediction mode information indicating a prediction mode of a current block and a residual syntax element for a current residual coefficient in the current block; as well as sending data of a bitstream including the image information, the image information including the prediction mode information and the residual syntax element, wherein the prediction sample of the current block is derived based on inter-frame prediction or intra-frame prediction, and the prediction mode information is information on whether inter-frame prediction or intra-frame prediction is applied to the current block as the prediction mode of the current block, wherein the current residual coefficient is derived based on the residual sample of the current block, and the residual sample is derived based on the predicted sample of the current block, wherein the number of context coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients of the current block is equal to the maximum number of context coded bins of the current block, The residual syntax element for the current residual coefficient includes coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, The coefficient level information indicates the absolute value of the coefficient level of the current residual coefficient, and the sign flag of the current residual coefficient indicates the sign of the current residual coefficient. wherein the current residual coefficient is encoded without performing level mapping, and Wherein, the residual coefficients before the current residual coefficient are encoded by performing the level mapping.