Method for residual-compiled decoded video and apparatus therefor

By obtaining residual information and prediction mode information in image decoding, deducing the prediction mode and residual coefficients of the current block, simplifying the compilation of residual data, solving the problem of high-resolution image transmission and storage costs, and achieving efficient image compression.

CN120390083APending Publication Date: 2025-07-29LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510496672.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-08-31
Filing Date
2020-08-26
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

When transmitting and storing high-resolution and high-quality images, the increase in the amount of information leads to high transmission and storage costs, and it is necessary to improve image compilation efficiency.

Method used

Residual information and prediction mode information are obtained through the bitstream, the prediction mode and residual coefficient of the current block are derived, and image decoding is performed using an entropy decoder, predictor and residual processor to avoid level mapping and simplify residual data compilation.

Benefits of technology

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

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120390083A_ABST
    Figure CN120390083A_ABST
Patent Text Reader

Abstract

The present invention provides a method for residual-coded decoded video and an apparatus therefor. A method for decoding a video performed by a decoding device according to the present document is characterized by comprising: a step for acquiring video information including prediction mode information and residual information through a bitstream; a step of deriving a prediction mode of the current block on the basis of the prediction mode information; a step for deriving a prediction sample on the basis of the prediction mode; a step for deriving a current residual coefficient on the basis of a residual syntax element for the current residual coefficient in the current block; a step for deriving a residual sample on the basis of the current residual coefficient; and a step for deriving a reconstructed sample of the current block on the basis of the prediction sample and the residual sample.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application with application number 202080061204.X (PCT / KR2020 / 011418), application date August 26, 2020, and title "Method and Apparatus for Decoding Video for Residual Compilation", which was filed on February 28, 2022. Technical Field

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

[0003] Recently, in various fields, the demand for high-resolution and high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing. Since image data has high resolution and high quality, the amount of information or bits to be transmitted increases compared to traditional image data. Therefore, when transmitting image data using a medium such as a traditional wired / wireless broadband line or storing image data using an existing storage medium, the transmission cost and storage cost increase.

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

[0005] Technical Problem

[0006] The present disclosure provides a method and apparatus for improving image compilation efficiency.

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

[0008] Technical Solution

[0009] According to an embodiment of this document, an image decoding method performed by a decoding device is provided. 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 prediction samples based on the prediction mode, deriving current residual coefficients based on residual syntax elements for current residual coefficients in the current block, deriving residual samples based on the current residual coefficients, and deriving reconstructed samples of the current block based on the residual samples and the prediction samples.

[0010] According to another embodiment of this 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 bitstream; a predictor that derives a prediction mode of a current block based on the prediction mode information and derives prediction samples 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 residual samples based on the current residual coefficient; and an adder that derives a reconstructed sample of the current block based on the residual samples and the prediction samples.

[0011] According to yet another embodiment of this document, a video encoding method performed by an encoding device is provided. The method includes: deriving prediction samples of a 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 samples; and encoding 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] According to yet another embodiment of this document, a video encoding device is provided. The encoding device includes: a predictor that derives prediction samples of a current block based on inter-frame prediction or intra-frame prediction; a residual processor that derives residual samples of the current block based on the prediction samples and derives a current residual coefficient based on the residual samples; and an entropy encoder that encodes image information including a residual syntax element for the current residual coefficient and prediction mode information indicating a prediction mode of the current block.

[0013] Advantageous Effects

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

[0015] 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

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

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

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

[0019] Figure 4 Illustrates an example of a video / image encoding method based on inter-frame prediction.

[0020] Figure 5 Illustrates an example of a video / image decoding method based on inter-frame prediction.

[0021] Figure 6 Schematically shows the inter-frame prediction process.

[0022] Figure 7 Exemplarily shows context adaptive binary arithmetic coding (CABAC) for encoding syntax elements.

[0023] Figure 8 Is a diagram showing exemplary transform coefficients within a 4×4 block.

[0024] Figure 9 Illustrates an example of simplified residual data coding for a CG, transform block, or coding block.

[0025] Figure 10 Illustrates another example of simplified residual data coding for a CG, transform block, or coding block.

[0026] Figure 11 Illustrates another example of simplified residual data coding for a CG, transform block, or coding block.

[0027] Figure 12 Briefly illustrates an image coding method performed by an encoding device according to the present disclosure.

[0028] Figure 13 Briefly illustrates an encoding device for performing an image coding method according to the present disclosure.

[0029] Figure 14 Briefly illustrates an image decoding method performed by a decoding device according to the present disclosure.

[0030] Figure 15 Briefly illustrates a decoding device for performing an image decoding method according to the present disclosure.

[0031] Figure 16 Illustrates a structural diagram of a content stream transmission system applying the present disclosure. Detailed Description

[0032] 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 for describing specific embodiments and are not intended to limit the present disclosure. As long as it is clearly understood in a different way, singular expressions include plural expressions. Terms such as "including" and "having" are intended to indicate the presence of the features, numbers, steps, operations, elements, components, or combinations thereof used in the following description, and thus 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.

[0033] In addition, the elements in the accompanying drawings described in the present disclosure are independently drawn for the convenience of explaining different specific functions, and it does not mean that these elements are embodied by independent hardware or independent software. For example, two or more of the elements can be combined to form a single element, or one 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.

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

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

[0036] Referring to Figure 1 , the video / image compilation system can include a first device (source device) and a second device (receiving device). The source device can send encoded video / image information or data to the receiving device in the form of a file or a stream via a digital storage medium or a network.

[0037] The source device can include a video source, an encoding device, and a transmitter. The receiving device can include a receiver, a decoding device, and a renderer. The encoding device can be referred to as a video / image encoding device, and the decoding device can be referred to as a video / image decoding device. The transmitter can be included in the encoding device. The receiver can be included in the decoding device. The renderer can include a display, and the display can be configured as a separate device or an external component.

[0038] The video source can obtain video / images through processes such as capturing, synthesizing, or generating video / images. The video source can include video / image capture devices and / or video / image generation devices. The video / image capture devices can include, for example, one or more cameras, video / image archives including previously captured video / images, etc. The video / image generation devices can include, for example, computers, tablets, and smart phones, and can (electronically) generate video / images. For example, virtual video / images can be generated by a computer or the like. In this case, the video / image capture process can be replaced by a process of generating relevant data.

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

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

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

[0042] The renderer can render the decoded video / images. The rendered video / images can be displayed through a display.

[0043] This disclosure relates to video / image compilation. For example, the methods / embodiments disclosed in this disclosure can be applied to the methods disclosed in Versatile Video Coding (VVC), Efficient Video Coding (EVC) standard, AOMedia Video 1 (AV1) standard, Second Generation Audio Video Coding Standard (AVS2), or next-generation video / image compilation standards (e.g., H.267, or H.268, etc.).

[0044] This disclosure presents various embodiments of video / image compilation, and unless otherwise mentioned, the embodiments can be executed in combination with each other.

[0045] 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 forms part of a picture being compiled. A sub-picture / slice / tile may include one or more Compilation Tree Units (CTUs). A picture may be composed of one or more sub-pictures / slices / tile. 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 CTU rows within a tile in a picture. A tile may be partitioned into multiple bricks, each brick consisting of one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick. Brick scan may sort CTUs in a specific order for CTUs partitioning a picture, where CTUs are sorted consecutively in raster scan order within a brick, bricks within a tile are sorted consecutively in raster scan order of the tile's bricks, and tiles in a picture are sorted consecutively in raster scan order of the picture's tiles. Additionally, 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 jointly cover a rectangular area of the picture. A tile is a rectangular area of CTUs within a specific tile column and a specific tile row in a picture. A tile column is a rectangular area of CTUs, the height of which is equal to the height of the picture and the width of which is specified by a syntax element in the picture parameter set. A tile row is a rectangular area of CTUs, the height of which is specified by a syntax element in the picture parameter set and the width of which is equal to the width of the picture. Tile scan is a specific order sorting of CTUs partitioning a picture, where CTUs may be sorted consecutively in raster scan order within a tile, while tiles in a picture may be sorted consecutively in raster scan order of the picture's tiles. A slice includes an integral number of bricks that can be exclusively contained in a single NAL unit of a picture. A slice may consist of multiple complete tiles or only of a consecutive sequence of complete bricks of one tile. In the present disclosure, tile group and slice 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.

[0046] A pixel or pel may represent the smallest unit that makes up a picture (or image). Additionally, "sample" may be used as a term corresponding to a pixel. A sample generally may 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.

[0047] 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 a region. In general, an M×N block may include a set (or array) of samples (or sample arrays) or transform coefficients in M columns and N rows.

[0048] 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".

[0049] The slashes ( / ) or commas used in this specification may mean "and / or". For example, "A / B" may mean "A and / or B". Therefore, "A / B" may mean "only A", "only B", or "A and B". For example, "A, B, C" may mean "A, B, or C".

[0050] In this specification, "at least one of A and B" may mean "only A", "only B", or "both A and B". Additionally, in this specification, the expressions "at least one of A or B" or "at least one of A and / or B" may be interpreted the same as "at least one of A and B".

[0051] Additionally, in this specification, "at least one of A, B, and C" means "only A", "only B", "only C", or "any combination of A, B, and C". Furthermore, "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".

[0052] Furthermore, the parentheses used in this specification may mean "for example". Specifically, when indicating "prediction (intra prediction)", "intra prediction" may be presented as an example of "prediction". In other words, "prediction" in this specification is not limited to "intra prediction", and "intra prediction" may be presented as an example of "prediction". Additionally, even when indicating "prediction (i.e., intra prediction)", "intra prediction" may also be presented as an example of "prediction".

[0053] In this specification, the technical features separately described in a figure may be implemented separately or may be implemented simultaneously.

[0054] The following drawings 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 drawings are presented by way of example, the technical features of this specification are not limited to the specific names used in the following drawings.

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

[0056] Referring to Figure 2 , the encoding device 200 includes an image splitter 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter-frame predictor 221 and an intra-frame predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, an inverse quantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstruction block generator. According to an embodiment, the image splitter 210, the predictor 220, the residual processor 230, the entropy encoder 240, the adder 250, and the filter 260 may be constituted by at least one hardware component (e.g., an encoder chipset or a processor). Additionally, the memory 270 may include a decoded picture buffer (DPB) or may be constituted by a digital storage medium. The hardware component may further include the memory 270 as an internal / external component.

[0057] The image splitter 210 may split an 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 compile unit (CU). In this case, the compile unit may be recursively split from a compile tree unit (CTU) or a largest compile unit (LCU) according to a quadtree binary tree ternary tree (QTBTTT) structure. For example, a compile unit may be split into multiple deeper compile units based on a quadtree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quadtree structure may be applied first, and then the binary tree structure and / or the ternary structure may be applied. Alternatively, the binary tree structure may be applied first. The compiling process according to the present disclosure may be performed based on the final compile unit that is no longer split. In this case, the largest compile unit may be used as the final compile unit based on the image characteristics and the compiling efficiency, or if necessary, the compile unit may be recursively split into deeper compile units and the compile unit having the optimal size may be used as the final compile unit. Here, the compiling process may include processes of prediction, transformation, and reconstruction, which will be described later. As another example, the processor may further include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may be separated or split from the above-mentioned final compile unit. The prediction unit may be a unit for sample prediction, and the transformation unit may be a unit for deriving transformation coefficients and / or a unit for deriving a residual signal from the transformation coefficients.

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

[0059] In the encoding device 200, a prediction signal (prediction block, prediction sample array) output from the inter-frame predictor 221 or the intra-frame 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 in the encoder 200 for subtracting the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) may be referred to as the subtractor 231. The predictor may 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 is capable of determining whether to apply intra-frame prediction or inter-frame prediction based on the current block or CU. As described later in the description of each prediction mode, the predictor may 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 may be encoded in the entropy encoder 240 and output in the form of a bitstream.

[0060] The intra-frame predictor 222 may predict the current block by referring to the samples in the current picture. Depending on the prediction mode, the samples referred to may be located near the current block or may be far from the current block. In intra-frame prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, the DC mode and the planar mode. Depending on the level of detail of the prediction direction, the directional modes 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 settings. The intra-frame predictor 222 may determine the prediction mode applied to the current block by using the prediction mode applied to the adjacent blocks.

[0061] The inter-frame predictor 221 can derive a predicted 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 transmitted in the inter-frame prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between adjacent blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can also include inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-frame prediction, the adjacent blocks can include spatially adjacent blocks present in the current picture and temporally adjacent blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporally adjacent blocks can be the same or different. The temporally adjacent blocks can be referred to as collocated reference blocks, co-located CUs (colCUs), etc., and the reference picture including the temporally adjacent blocks can be referred to as a collocated picture (colPic). For example, the inter-frame predictor 221 can configure a motion information candidate list based on adjacent blocks, and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. The inter-frame prediction can be performed based on various prediction modes. For example, in the case of the skip mode and the merge mode, the inter-frame predictor 221 can use the motion information of the adjacent blocks as the motion information of the current block. In the skip mode, different from the merge mode, the residual signal may not be sent. In the case of the motion vector prediction (MVP) mode, the motion vector of the adjacent block can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling a motion vector difference.

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

[0063] The prediction signal generated by a predictor (including an inter-frame predictor 221 and / or an intra-frame predictor 222) may be used to generate a reconstructed signal or to generate a residual signal. The transformer 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a karhunen-loève transform (KLT), a graph-based transform (GBT), or a conditional non-linear transform (CNT). Here, GBT represents a transform obtained from a graph when the relationship information between pixels is represented by the graph. CNT refers to a transform generated based on a prediction signal generated using all previously reconstructed pixels. Additionally, the transform processing may be applied to square pixel blocks of the same size, or may be applied to blocks of variable size that are not square.

[0064] Quantizer 233 can quantize the transform coefficients and send them to entropy encoder 240, and entropy encoder 240 can encode the quantized signal (information about the quantized transform coefficients) and output a bitstream. The information about the quantized transform coefficients can be referred to as residual information. Quantizer 233 can rearrange the block type quantized transform coefficients into a one-dimensional vector form based on the coefficient scan 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 can be generated. Entropy encoder 240 can perform various encoding methods, such as, for example, exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. Entropy encoder 240 can encode the information required for video / image reconstruction other than the quantized transform coefficients (e.g., the values of syntax elements, etc.) together or separately. The encoded information (e.g., encoded video / image information) can be sent or stored in units of NAL (network abstraction layer) in the form of a bitstream. The video / image information can also include information about various parameter sets such as adaptive parameter set (APS), picture parameter set (PPS), sequence parameter set (SPS), or video parameter set (VPS). Additionally, the video / image information can also include general constraint information. In the present disclosure, the information and / or syntax elements sent / signaled from the encoding device to the decoding device can be included in the video / picture information. The video / image information can be encoded through the above encoding process and included in the bitstream. The bitstream can be sent through a network or stored in a digital storage medium. 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. A transmitter (not shown) for sending the signal output from entropy encoder 240 and / or a storage unit (not shown) for storing the signal can be included as internal / external elements of encoding device 200, and alternatively, the transmitter can be included in entropy encoder 240.

[0065] 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 by 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 in the case where the skip mode is applied), the predicted block can be used as the reconstructed block. The adder 250 can be referred to as 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 through filtering as described below.

[0066] In addition, during picture encoding and / or reconstruction, luminance mapping and chrominance scaling (LMCS) can be applied.

[0067] 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). The various filtering methods can 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 the various filtering methods. The information related to filtering can be encoded by the entropy encoder 240 and output in the form of a bitstream.

[0068] The modified reconstructed picture sent to the memory 270 can 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 can be avoided and the encoding efficiency can be improved.

[0069] The DPB of the memory 270 can store the modified reconstructed picture used as a reference picture in the inter-frame predictor 221. The memory 270 can store the motion information of the block from which the motion information in the current picture is derived (or encoded) and / or the motion information of the reconstructed blocks in the picture. The stored motion information can be sent to the inter-frame predictor 221 and used as the motion information of spatially adjacent blocks or temporally adjacent blocks. The memory 270 can store the reconstructed samples of the reconstructed blocks in the current picture and can transfer the reconstructed samples to the intra-frame predictor 222.

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

[0071] Referring to 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 constituted by hardware components (e.g., a decoder chipset or a processor). Additionally, the memory 360 may include a decoded picture buffer (DPB), or may be constituted by a digital storage medium. The hardware components may also include the memory 360 as an internal / external component.

[0072] When the input is a bitstream including video / image information, the decoding device 300 may reconstruct an image corresponding to the processing of the video / image information in the Figure 2 encoding device. For example, the decoding device 300 may derive units / blocks based on the block segmentation-related information obtained from the bitstream. The decoding device 300 may use the processor applied in the encoding device to perform decoding. Thus, the decoding processor may be, for example, a compilation unit, and may divide the compilation unit from a compilation tree unit or a largest compilation unit according to a quadtree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the compilation unit. The reconstructed image signal decoded and output by the decoding device 300 may be reproduced by a reproduction device.

[0073] The decoding device 300 may receive, in the form of a bitstream, from Figure 2The signal output by the encoding device, and the received signal can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse the bitstream to derive the information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information can also include information about various parameter sets such as Adaptive Parameter Set (APS), Picture Parameter Set (PPS), Sequence Parameter Set (SPS), or Video Parameter Set (VPS). Additionally, the video / image information can also include general constraint information. The decoding device can also decode the picture based on the information about the parameter sets and / or the general constraint information. The signaled / received information and / or syntax elements described later in the present disclosure can be decoded through the decoding process and obtained from the bitstream. For example, the entropy decoder 310 decodes the information in the bitstream based on coding methods such as Exponential Golomb coding, CAVLC, or CABAC, and outputs the syntax elements required for image reconstruction and the quantization values of the transformed coefficients of the residuals. More specifically, the CABAC entropy decoding method can receive the bin corresponding to each syntax element in the bitstream, use the information of the syntax element to be decoded, the decoding information of the block to be decoded, or the information of the symbol / bin decoded at the previous stage to determine the context model, and perform arithmetic decoding on the bin by predicting the occurrence probability of the bin according to the determined context model, and generate the 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 predictors (inter-frame predictor 332 and intra-frame predictor 331), and the residual values (i.e., the quantized transform coefficients and the related parameter information) for which entropy decoding has been performed in the entropy decoder 310 can be input to the residual processor 320. The residual processor 320 can derive the residual signal (residual block, residual sample, residual sample array). Additionally, the information about filtering among the information decoded by the entropy decoder 310 can be provided to the filter 350. Furthermore, the receiver (not shown) for receiving the signal output by the encoding device can be further configured as an internal / external component of the decoding device 300, or the receiver can be a component of the entropy decoder 310. Additionally, the decoding device according to the present disclosure can be referred to as a video / image / picture decoding device, and the decoding device can be classified into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder can include the entropy decoder 310, and the sample decoder can include at least one of a dequantizer 321, an inverse transformer 322, an adder 340, a filter 350, a memory 360, an inter-frame predictor 332, and an intra-frame predictor 331.

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

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

[0076] The predictor can perform prediction on 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 to the current block based on the information about prediction output from the entropy decoder 310, and can determine a specific intra / inter prediction mode.

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

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

[0079] The inter - frame predictor 332 can derive a prediction block for 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 transmitted in the inter - frame prediction mode, the motion information can be predicted in units of blocks, sub - blocks, or samples based on the correlation of the motion information between adjacent blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can also include inter - frame prediction direction (L0 prediction, L1 prediction, Bi - prediction, etc.) information. In the case of inter - frame prediction, adjacent blocks can include spatially adjacent blocks present in the current picture and temporally adjacent blocks present in the reference picture. For example, the inter - frame predictor 332 can configure a motion information candidate list based on adjacent blocks and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. The inter - frame prediction can be performed based on various prediction modes, and the information about the prediction can include information indicating the mode of inter - frame prediction for the current block.

[0080] 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 a predictor (including the inter - frame predictor 332 and / or the intra - frame predictor 331). If the block to be processed has no residual (e.g., when the skip mode is applied), the prediction block can be used as the reconstructed block.

[0081] The adder 340 can be referred to as 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, can be output through filtering as described below, or can be used for inter - frame prediction of the next picture.

[0082] In addition, luminance mapping and chrominance scaling (LMCS) can be applied during the picture decoding process.

[0083] 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). The various filtering methods can include, for example, de - blocking filtering, sample - adaptive offset, adaptive loop filter, bilateral filter, etc.

[0084] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter predictor 332. The memory 360 can store the motion information of the blocks from which the motion information in the current picture is derived (or decoded) and / or the motion information of the reconstructed blocks in the picture. The stored motion information can be sent to the inter predictor 332 to be utilized as the motion information of spatially adjacent blocks or temporally adjacent blocks. The memory 360 can store the reconstructed samples of the reconstructed blocks in the current picture and can transmit the reconstructed samples to the intra predictor 331.

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

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

[0087] In the present disclosure, the quantized transform coefficients and the transform coefficients can be respectively referred to as transform coefficients and scaled transform coefficients. In this case, the residual information can include information about the transform coefficients, and the information about the transform coefficients can be signaled through the residual coding syntax. The transform coefficients can be derived based on the residual information (or the information about the transform coefficients), and the scaled transform coefficients can be derived by inverse-transforming (scaling) the transform coefficients. The residual samples can be derived based on inverse-transforming (transforming) the scaled transform coefficients. This can also be applied / expressed in other parts of the present disclosure.

[0088] Meanwhile, as described above, when performing video encoding, prediction is performed to improve the compression efficiency. By doing so, a prediction block including prediction samples for a current block can be generated as a block to be encoded (i.e., an encoding 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 information (residual information) about the residual between the original block and the prediction block to the decoding device instead of the original sample values of the original block, thereby improving the image encoding 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.

[0089] The residual information can be generated through a transform and quantization process. For example, the encoding device can derive a residual block between the original block and the prediction block, can perform a transform process on the residual samples (residual sample array) included in the residual block to derive transform coefficients, can perform a quantization process on the transform coefficients to derive quantized transform coefficients, and can signal the relevant residual information (through a bitstream) to the decoding device. Here, the residual information can include value information such as the value information of the quantized transform coefficients, position information, transform technique, transform core, and quantization parameters. The decoding device can perform an inverse quantization / inverse transform process based on the residual information and derive the residual samples (or the residual block). The decoding device can generate a reconstructed picture based on the prediction block and the residual block. In addition, for reference in inter-frame prediction of future reference pictures, the encoding device can inverse quantize / inverse transform the quantized transform coefficients to derive the residual block and generate a reconstructed picture based on this.

[0090] Intra-frame prediction may refer to generating a prediction of prediction samples for a current block based on reference samples in the picture to which the current block belongs (hereinafter referred to as the current picture). When applying intra-frame prediction to the current block, adjacent reference samples to be used for the intra-frame prediction of the current block can be derived. The adjacent reference samples of the current block can include a total of 2×nH samples adjacent to the left boundary of the current block of size nW×nH and adjacent to the lower left of the current block, samples adjacent to the upper boundary of the current block and a total of 2×nW 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 can include multiple columns of adjacent samples above and multiple rows of adjacent samples to the left. In addition, the adjacent reference samples of the current block can include a total of nH samples adjacent to the right boundary of the current block of size nW×nH, 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.

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

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

[0093] Additionally, a predicted sample may be generated by interpolation between a first neighboring sample located in the prediction direction of the intra prediction mode of the current block and a second neighboring sample located in the direction opposite to the prediction direction among the neighboring reference samples. The above case may be referred to as linear interpolation intra prediction (LIP). Further, a chrominance predicted sample may be generated based on luminance samples using a linear model (LM). This case may be referred to as the LM mode or chrominance component LM (CCLM) mode.

[0094] Additionally, a temporary predicted sample of the current block is derived based on filtered neighboring reference samples, and the predicted sample of the current block may also be derived by weighted summation of the temporary predicted sample and at least one reference sample derived according to the intra prediction mode among the existing neighboring reference samples (i.e., unfiltered neighboring reference samples). The above case may be referred to as position-dependent intra prediction (PDPC).

[0095] Additionally, a reference sample line with the highest prediction accuracy among multiple neighboring reference sample lines of the current block is selected, and the predicted sample is derived using the reference sample located in the prediction direction in the selected line. In this case, intra prediction coding may be performed by indicating (signaling) the reference sample line used. The above case may be referred to as multi-reference line intra prediction or MRL-based intra prediction.

[0096] Additionally, the current block is divided into vertical or horizontal sub-partitions and intra prediction is performed based on the same intra prediction mode, but neighboring reference samples can be derived and used on a sub-partition basis. That is, in this case, the intra prediction mode of the current block also applies to the sub-partitions, but in some cases, the intra prediction performance can be improved by deriving and using neighboring reference samples on a sub-partition basis. This prediction method may be referred to as intra prediction based on intra sub-partition (ISP).

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

[0098] 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.

[0099] When intra prediction is applied, the intra prediction mode of adjacent blocks may be used to determine the intra prediction mode applied to the current block. For example, the decoding device may select one of the MPM candidates in the most - probable mode (MPM) list derived based on the intra prediction mode of the adjacent blocks (e.g., left and / or upper adjacent blocks) of the current block and additional candidate modes or select one of the remaining intra prediction modes not included in the MPM candidates (and the planar mode) based on the remaining intra prediction mode information. The MPM list may be configured to include or not include the planar mode as a candidate. For example, when the MPM list includes the planar mode as a candidate, the MPM list may have 6 candidates, and when the MPM list does not include the planar mode as a candidate, the MPM list may have 5 candidates. When the MPM list does not include the planar 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 the planar mode may be signaled. For example, the MPM flag may be signaled first, and when the value of the MPM flag is 1, the MPM index and the non - planar flag may be signaled. In addition, when the value of the non - planar flag is 1, the MPM index may be signaled. Here, the fact that the MPM list is configured not to include the planar mode as a candidate means that the planar mode is always considered an MPM rather than not an MPM. Therefore, the flag (non - planar flag) is signaled first to check whether it is the planar mode.

[0100] For example, based on an MPM flag (e.g., intra_luma_mpm_flag), it can be indicated whether the intra prediction mode applied to the current block is among the MPM candidates (and the 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 the 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 the 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 the 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 the planar mode. The MPM index can be signaled in the form of the mpm_idx or intra_luma_mpm_idx syntax element, and the remaining intra prediction mode information can be signaled in the form of the rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element. For example, the remaining intra prediction mode information can indicate one of the remaining intra prediction modes not included in the MPM candidates (and the planar mode) among all the intra prediction modes by indexing in the order of the prediction mode numbers. The intra prediction mode can be the intra prediction mode of the luminance component (samples). Hereinafter, the intra prediction mode information can 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 the remaining intra prediction mode information (rem_intra_luma_luma_mpm_mode or intra_luma_mpminder). In the present disclosure, the MPM list can be referred to by various terms such as the MPM candidate list and the candModeList. When applying MIP to the current block, a separate mpm flag (e.g., intra_mip_mpm_flag), an mpm index (e.g., intra_mip_mpm_idx), and the remaining intra prediction mode information (e.g., intra_mip_mpm_remainder) for MIP can be signaled, and the non-planar flag can be not signaled.

[0101] In other words, generally, when performing block segmentation for an image, the current block to be compiled and the adjacent blocks have similar image features. Therefore, it is highly likely that the current block and the adjacent blocks have the same or similar intra prediction modes. Thus, the encoder can use the intra prediction mode of the adjacent blocks to encode the intra prediction mode of the current block.

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

[0103] The encoder / decoder may construct an MPM list including 5 or 6 MPMs.

[0104] To construct the MPM list, three modes such as the default in-frame mode, adjacent in-frame mode, and derived in-frame mode may be considered.

[0105] For the adjacent in-frame mode, two adjacent blocks, namely the left adjacent block and the upper adjacent block, may be considered.

[0106] As described above, if the MPM list is constructed to exclude the planar mode, the planar mode may be excluded from the list, and the number of MPM list candidates may be set to 5.

[0107] In addition, the non-directional mode (or non-angle mode) in the in-frame prediction mode may include a DC mode based on the average of adjacent reference samples of the current block or an interpolated planar mode.

[0108] Meanwhile, when inter-frame prediction is applied, the predictor of the encoding device / decoding device can derive predicted samples by performing inter-frame prediction on a block-by-block basis. When performing prediction on the current block, inter-frame prediction can be applied. That is, the predictor of the encoding / decoding device (more specifically, the inter-frame predictor) can derive predicted samples by performing inter-frame prediction on a block-by-block basis. Inter-frame prediction can represent prediction derived by a method that depends 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 predicted block (predicted sample array) for the current block can 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 transmitted in the inter-frame prediction mode, the motion information of the current block can be predicted on a block, sub-block, or sample basis based on the correlation of the motion information between adjacent blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter-frame prediction type (L0 prediction, L1 prediction, Bi prediction, etc.). In the case where inter-frame prediction is applied, adjacent blocks can include spatially adjacent blocks present in the current picture and temporally adjacent blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporally adjacent block can be the same as or different from each other. The temporally adjacent block can be referred to by names such as a collocated reference block, a collocated CU (ColCU), etc., and the reference picture including the temporally adjacent block can be referred to as a collocated picture (ColPic). For example, a motion information candidate list can be configured based on adjacent blocks of the current block, and a flag or index information indicating which candidate is selected (used) can be signaled in order to derive the motion vector and / or reference picture index of the current block. Inter-frame prediction can be performed based on various prediction modes, and for example, in the case of the skip mode and the merge mode, the motion information of the current block can be the same as the motion information of the selected adjacent block. In the case of the skip mode, different from the merge mode, the residual signal may not be sent. In the case of the motion vector prediction (MVP) mode, the motion vector of the selected adjacent block can be used as a motion vector predictor, and the motion vector difference can be signaled. In this case, the motion vector of the current block can be derived by using the sum of the motion vector predictor and the motion vector difference.

[0109] Depending on the inter-frame 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. The prediction based on the L0 motion vector may be referred to as L0 prediction, the prediction based on the L1 motion vector may be referred to as L1 prediction, and the 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 pictures before the current picture in the output order, and the reference picture list L1 may include pictures after the current picture in the output order, as reference pictures. 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 pictures after the current picture in the output order as reference pictures. In this case, the previous pictures may be indexed first in the reference picture list L0, and then the subsequent pictures may be indexed. The reference picture list L1 may further include pictures before the current picture in the output order as reference pictures. In this case, the subsequent pictures may be indexed first in the reference picture list L1, and then the previous pictures may be indexed. Here, the output order may correspond to the picture order count (POC) order.

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

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

[0112] The encoding device performs inter prediction on the current block (S400). The encoding device can derive the inter prediction mode and motion information of the current block and generate the prediction samples of the current block. Herein, the inter prediction mode determination process, the motion information derivation process, and the prediction sample generation process can be performed simultaneously, and any one of the processes can be performed earlier than the other processes. For example, the inter prediction unit of the encoding device can include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit. The prediction mode determination unit can determine the prediction mode for the current block, the motion information derivation unit can derive the motion information of the current block, and the prediction sample derivation unit can derive the prediction samples of the current block. For example, the inter prediction unit of the encoding device can 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 with the smallest difference from the current block or a difference equal to or less than a predetermined criterion. The reference picture index indicating the reference picture where the reference block is located can be derived based on this, and the motion vector can be derived based on the position difference between the reference block and the current block. The encoding device can determine the mode applied to the current block among various prediction modes. The encoding device can compare the RD costs of various prediction modes and determine the best prediction mode for the current block.

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

[0114] As another example, when the (A)MVP mode is applied to the current block, the encoding device can 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 of the reference block derived through motion estimation can be used as the motion vector of the current block, and the mvp candidate with the smallest difference from the motion vector of the current block among the mvp candidates can become the selected mvp candidate. The motion vector difference (MVD), which is the difference obtained by subtracting the mvp from the motion vector of the current block, can be derived. In this case, the information about the MVD can be signaled to the decoding device. In addition, when the (A)MVP mode is applied, the value of the reference picture index can be configured as the reference picture index information and signaled to the decoding device separately.

[0115] The encoding device can derive a residual sample based on a prediction sample (S410). The encoding device can derive a residual sample by comparing the original sample of the current block and the prediction sample.

[0116] The encoding device encodes 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 can include information about prediction mode information (e.g., skip flag, merge flag, or mode index, etc.) and information about motion information, as information related to the prediction process. The information about motion information can include candidate selection information (e.g., merge index, mvp flag, or mvp index), which is information used to derive a motion vector. In addition, the information about motion information can include information about MVD and / or reference picture index information. In addition, the information about motion information can include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information about the residual sample. The residual information can include information about the quantization transform coefficients for the residual sample.

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

[0118] Meanwhile, as described above, the encoding device can generate a reconstructed picture (including reconstructed samples and reconstructed blocks) based on the reference sample and the residual sample. This is to derive the same prediction result as the prediction result executed by the decoding device, and as a result, the compilation efficiency can be improved. Therefore, the encoding device can store the reconstructed picture (or reconstructed sample or reconstructed block) in the memory and use the reconstructed picture as a reference picture. As described above, in-loop filtering processing can be further applied to the reconstructed picture.

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

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

[0121] Referring to Figure 5 , the decoding device can perform operations corresponding to the operations performed by the encoding device. The decoding device can perform prediction on the current block based on the received prediction information and derive a prediction sample.

[0122] Specifically, the decoding device can determine the prediction mode of the current block based on the received prediction information (S500). The decoding device can determine which inter-frame prediction mode is applied to the current block based on the prediction mode information in the prediction information.

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

[0124] The decoding device derives motion information for 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 can configure a merge candidate list to be described below and select one merge candidate among the merge candidates included in the merge candidate list. Here, the selection can be performed based on selection information (merge index). The motion information of the current block can be derived by using the motion information of the selected merge candidate. The motion information of the selected merge candidate can be used as the motion information of the current block.

[0125] As another example, when the (A)MVP mode is applied to the current block, the decoding device can configure an (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 can be performed based on selection information (mvp flag or mvp index). In this case, the MVD of the current block can be derived based on information about the MVD, and the motion vector of the current block can be derived based on the mvp and MVD of the current block. In addition, the reference picture index of the current block can 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 can be derived as the reference picture referred to for the inter prediction of the current block.

[0126] Meanwhile, as described below, it is possible to derive the motion information of the current block without configuring a candidate list, and in this case, the motion information of the current block can be derived according to the process disclosed in the prediction mode. In this case, the candidate list configuration can be omitted.

[0127] The decoding device can generate a prediction sample for the current block based on the motion information of the current block (S520). In this case, the reference picture can be derived based on the reference picture index of the current block, and the prediction sample of the current block can be derived by using the samples 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 of the prediction samples of the current block can be further performed.

[0128] 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. The prediction mode determination unit may determine a prediction mode for a 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 information about the received motion information. And the prediction sample derivation unit may derive the prediction sample of the current block.

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

[0130] Figure 6 The inter-frame prediction process is schematically illustrated.

[0131] Reference 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 process (prediction sample generation) step based on the derived motion information. The inter-frame prediction process may be executed by the encoding device and the decoding device as described above. Herein, the compiling device may include an encoding device and / or a decoding device.

[0132] Refer to Figure 6 , the compiling device determines the inter-frame prediction mode of the current block (S600). Various inter-frame prediction modes may be used for the prediction of the current block in a picture. For example, various modes such as a merge mode, a skip mode, a motion vector prediction (MVP) mode, an affine mode, a sub-block merge mode, a merge with MVD (MMVD) mode, and a history motion vector prediction (HMVP) mode may be used. A decoder-side motion vector refinement (DMVR) mode, an adaptive motion vector resolution (AMVR) mode, a bi-prediction with CU-level weight (BCW), and a bi-directional optical flow (BDOF), etc. may be further used as additional modes. The affine mode may also be referred to as an affine motion prediction mode. The MVP mode may also be referred to as an advanced motion vector prediction (AMVP) mode. Herein, some modes and / or motion information candidates derived from some modes may also be included in one of the motion information-related candidates in other modes. For example, an HMVP candidate may be added to the merge candidates of the merge / skip mode, or added to the mvp candidates of the MVP mode. If the HMVP candidate is used as a motion information candidate for the merge mode or the skip mode, the HMVP candidate may be referred to as an HMVP merge candidate.

[0133] Prediction mode information indicating the inter - prediction mode of the current block can be signaled from the encoding device to the decoding device. In this case, the prediction mode information can be included in the bitstream and received by the decoding device. The prediction mode information can include index information indicating one of a plurality of candidate modes. Alternatively, the inter - prediction mode can be indicated by hierarchical signaling of flag information. In this case, the prediction mode information can include one or more flags. For example, it can be signaled whether to apply the skip mode by signaling a skip flag. When the skip mode is not applied, it can be signaled whether to apply the merge mode by signaling a merge flag, and when the merge mode is not applied, it is indicated to apply the MVP mode or additional flags for further differentiation can be signaled. The affine mode can be signaled as an independent mode or as a dependent mode with respect to the merge mode or the MVP mode. For example, the affine mode can include an affine merge mode and an affine MVP mode.

[0134] The encoding device derives motion information for the current block (S610). The motion information derivation can be based on the inter - prediction mode.

[0135] The encoding device can use the motion information of the current block to perform inter - prediction. The encoding device can derive the best motion information for the current block through a motion estimation process. For example, the encoding device can search for a similar reference block with high correlation in a predetermined search range in the reference picture using the original block in the original picture for the current block, in units of fractional pixels, and derive the motion information from the searched reference block. The similarity of the blocks can be derived based on the difference in sample values based on the phase. For example, the similarity of the blocks can be calculated based on the sum of absolute differences (SAD) between the current block (or a template of the current block) and the reference block (or a template of the reference block). In this case, the motion information can be derived based on the reference block with the minimum SAD in the search area. The derived motion information can be signaled to the decoding device according to various methods based on the inter - prediction mode.

[0136] The encoding device performs inter - prediction based on the motion information for the current block (S620). The encoding device can derive the (one or more) prediction samples for the current block based on the motion information. The current block including the prediction samples can be referred to as a prediction block.

[0137] Meanwhile, as described above, the encoding device can perform various encoding methods such as Exponential Golomb, Context - Adaptive Variable - Length Coding (CAVLC), and Context - Adaptive Binary Arithmetic Coding (CABAC). Additionally, the decoding device can decode the information in the bitstream based on an encoding method such as Exponential Golomb coding, CAVLC, or CABAC, and output the values of the syntax elements required for image reconstruction and the quantization values of the transform coefficients related to the residuals.

[0138] For example, the above compilation method can be performed as described below.

[0139] Figure 7 Context Adaptive Binary Arithmetic Coding (CABAC) for encoding syntax elements is exemplarily shown. For example, during 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. Additionally, when the input signal is already a binary value (i.e., when the value of the input signal is a binary value), binarization may not be performed and binarization can be bypassed. Here, each binary number 0 or 1 that constitutes a binary value can be referred to as a bin. For example, if the binary string after binarization is 110, each of 1, 1, and 0 is called a bin. The bins for a syntax element can indicate the value of the syntax element.

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

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

[0142] Entropy decoding can represent a process of performing the same process as the above entropy coding in the reverse order.

[0143] For example, when decoding a syntax element based on a context model, the decoding device can receive the bins corresponding to the syntax element through a bitstream, can use the syntax element and the decoding information of the decoding target block or adjacent blocks or the information of the previously decoded symbol / bin to determine the context model, and can 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 can be used to update the context model of the next decoded bin.

[0144] In addition, for example, when bypassing the decoding of syntax elements, the decoding device may receive bins corresponding to the syntax elements through the bitstream and may decode the input bins by applying a uniform probability distribution. In this case, the decoding device may omit the process of deriving the context model for the syntax elements and the process of updating the context model applied to the bins after decoding.

[0145] As described above, the residual samples can be derived as quantized transform coefficients through the transform and quantization processes. The 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 a residual compilation syntax. That is, the encoding device may configure the residual compilation syntax using the residual information, encode the residual compilation syntax, and output it in the form of a bitstream, and the decoding device may decode the residual compilation syntax from the bitstream and derive the residual (quantized) transform coefficients. The residual compilation syntax may include syntax elements indicating whether a transform is applied to the corresponding block, the position of the last significant transform coefficient in the block, whether there are valid transform coefficients in the sub-blocks, the size / symbol of the valid transform coefficients, etc., as described later.

[0146] For example, (quantized) transform coefficients (i.e., residual information) may be encoded and / or decoded 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 the residual data encoding / decoding may be represented as shown in the following table.

[0147] [Table 1]

[0148]

[0149]

[0150]

[0151]

[0152] The transform_skip_flag indicates whether to skip the transformation in the associated block. The transform_skip_flag can be a syntax element of the transform skip flag. The associated block can be a compilation block (CB) or a transform block (TB). Regarding the transformation (and quantization) and the residual compilation process, the CB and the TB can be used interchangeably. For example, as described above, residual samples can be derived for the CB, and (quantized) transform coefficients can be derived through the transformation and quantization of the residual samples, and through the residual compiler, information (such as syntax elements) that effectively indicates the position, magnitude, sign, etc. of the (quantized) transform coefficients can be generated and signaled. The quantized transform coefficients can simply be referred to as transform coefficients. Generally, when the CB is not larger than the maximum TB, the size of the CB can be the same as the size of the TB, and in this case, the target block to be transformed (and quantized) and residual-compiled can be referred to as the CB or the TB. At the same time, when the CB is larger than the maximum TB, the target block to be transformed (and quantized) and residual-compiled can be referred to as the TB. Hereinafter, syntax elements related to residual compilation will be signaled in units of transform blocks (TBs), but this is an example, and the TB can be used interchangeably with the compilation block (CB) as described above.

[0153] At the same time, the syntax elements signaled after signaling the transform skip flag can be the same as the syntax elements disclosed in Table 2 below, and a detailed description of the syntax elements will be described below.

[0154] [Table 2]

[0155]

[0156]

[0157]

[0158] [Table 3]

[0159]

[0160]

[0161]

[0162]

[0163]

[0164]

[0165] [Table 4]

[0166]

[0167]

[0168]

[0169] According to this embodiment, as shown in Table 2, residual compilation can 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 can be used for residual compilation. The residual compilation used when transform skipping is not applied (i.e., when the transform is applied) can be referred to as regular residual compilation (RRC), while the residual compilation used when transform skipping is applied (i.e., when the transform is not applied) can be referred to as transform skip residual compilation (TSRC). In addition, regular residual compilation can be referred to as general residual compilation. In addition, regular residual compilation can be referred to as the regular residual compilation syntax structure, while transform skip residual compilation can be referred to as the transform skip residual compilation syntax structure. Table 3 above can show the syntax elements of the residual compilation when the value of transform_skip_flag is 0 (i.e., when the transform is applied), and Table 4 above can show the syntax elements of the residual compilation when the value of transform_skip_flag is 1 (i.e., when the transform is not applied).

[0170] Specifically, for example, a transform skip flag indicating whether to skip the transform of a transform block can be parsed, and it can be determined whether the transform skip flag is 1. If the value of the transform skip flag is 0, as shown in Table 3, 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 for the residual coefficients of the transform block can be parsed, and the residual coefficients can be derived based on the syntax elements. In this case, the syntax elements can be parsed sequentially, and the parsing order can be changed. Additionally, abs_level_gtx_flag can represent abs_level_gt1_flag and / or abs_level_gt3_flag. For example, abs_level_gtx_flag[n][0] can be an example of the first transform coefficient level flag (abs_level_gt1_flag), and abs_level_gtx_flag[n][1] can be an example of the second transform coefficient level flag (abs_level_gt3_flag).

[0171] 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 can be encoded / decoded. At the same time, sb_coded_flag can be represented as coded_sub_block_flag.

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

[0173] Thereafter, the encoding device 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.

[0174] If the value of coded_sub_block_flag is 0, there is no more information to be sent, and thus, the encoding device may terminate the encoding process for the current sub-block. Conversely, if the value of coded_sub_block_flag is 1, the encoding device may continuously perform an encoding process on sig_coeff_flag. Since the sub-block including the last non-zero coefficient does not need to encode coded_sub_block_flag, and the sub-block 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 compiled, and its value may be assumed to be 1.

[0175] If the value of coded_sub_block_flag is 1 and it is thus determined that there are non-zero coefficients in the current sub-block, the coding device may code sig_coeff_flag having a binary value according to the reverse scan order. The coding device may code the 1-bit syntax element sig_coeff_flag for each transform coefficient according to the scan order. If the value of the transform coefficient at the current scan 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 code sig_coeff_flag for the last non-zero coefficient, and thus the compilation process of the sub-block may be omitted. The level information compilation 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 valid coefficient flag indicating whether a quantized transform coefficient is a non-zero valid coefficient.

[0176] The remaining level values after coding sig_coeff_flag may be derived as shown in the following equation. That is, the syntax element remAbsLevel indicating the level value to be coded may be derived from the following equation.

[0177] [Equation 1]

[0178]

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

[0180] In addition, abs_level_gt1_flag may indicate whether remAbsLevel at the corresponding scan 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 at the corresponding position may be 1. In addition, when the value of abs_level_gt1_flag is 1, remAbsLevel indicating the level value to be coded later may be updated as shown in the following equation.

[0181] [Equation 2]

[0182]

[0183] In addition, the least significant bit (LSB) value of remAbsLevel described in Equation 2 above may be coded by par_level_flag as in the following Equation 3.

[0184] [Equation 3]

[0185]

[0186] Here, par_level_flag[n] can indicate the parity of the transform coefficient level (value) at scan position n.

[0187] The transform coefficient level value remAbsLevel to be encoded after performing par_level_flag encoding can be updated as shown in the following equation below.

[0188] [Equation 4]

[0189]

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

[0191] [Equation 5]

[0192]

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

[0194] [Table 5]

[0195]

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

[0197] 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 for the residual coefficients of the transform block can be parsed, and the residual coefficients can be derived based on the syntax elements. In this case, the syntax elements can be parsed sequentially, and the parsing order can be changed. Additionally, abs_level_gtx_flag can 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] can be a flag indicating whether the absolute value or level (value) of the transform coefficient at scan position n is greater than (j << 1) + 1. The condition (j << 1) + 1 can optionally be replaced with a specific threshold such as a first threshold, a second threshold, etc.

[0198] Meanwhile, CABAC provides high performance but, disadvantageously, has poor throughput performance. This is caused by the conventional compilation engine of CABAC. Conventional encoding (i.e., compilation by the conventional compilation engine of CABAC) shows high data correlation because it uses probability states and ranges updated by the compilation of previous bins, and reading probability intervals and determining the current state takes a lot of time. The throughput problem of CABAC can be solved by limiting the number of context-compiled bins. For example, as shown in Table 1 or Table 3 above, the sum of the bins used to represent 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. In addition, for example, as shown in Table 4 above, the sum of the bins that can 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 can 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 the 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 can be limited to 32 (or 28 in the example), and if the corresponding block is a 2×2-sized block, the sum of the bins for sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag can be limited to 8 (or 7 in the example). The limited number of bins can be represented by remBinsPass1 or RemCcbs. Alternatively, for higher CABAC throughput, the number of context-compiled bins can be limited for the block (CB or TB) including the compilation target CG. In other words, the number of context-compiled bins can be limited on a block (CB or TB) basis.For example, when the size of the current block is 16×16, the number of context - compiled bins for the current block can be limited to 1.75 times the number of pixels in the current block, i.e., 448, regardless of the current CG.

[0199] In this case, if all context - compiled bins with a limited number are used when compiling context elements, the encoding device can binarize the remaining coefficients by the method of binarizing coefficients as described below, instead of using context compilation, and can perform bypass encoding. In other words, for example, if the number of context - compiled bins for 4×4 CG compilation is 32 (or 28 in the example), or if the number of context - compiled bins for 2×2 CG compilation is 8 (or 7 in the example), then sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag compiled with context - compiled bins can no longer be compiled and can be directly compiled into dec_abs_level. Or, for example, when the number of context - compiled bins for 4×4 block compilation is 1.75 times the number of pixels in the entire block, i.e., when limited to 28, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag compiled as context - compiled bins can no longer be compiled and can be directly compiled into dec_abs_level, as shown in Table 6 below.

[0200] [Table 6]

[0201]

[0202] The value |coeff| can be derived based on dec_abs_level. In this case, the transform coefficient value (i.e., |coeff|) can be derived as shown in the following equation.

[0203] [Equation 6]

[0204]

[0205] In addition, coeff_sign_flag can indicate the sign of the transform coefficient level at the corresponding scan position n. That is, coeff_sign_flag can indicate the sign of the transform coefficient at the corresponding scan position n.

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

[0207] Figure 8The 4×4 block represents an example of quantization coefficients. Figure 8 The block can 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 The 4×4 block can represent a luminance block or a chrominance block.

[0208] Meanwhile, as described above, when the input signal is not a binary value but a syntax element, the encoding device can transform the input signal into a binary value by binarizing the value of the input signal. Additionally, the decoding device can decode the syntax element to derive the binarized value of the syntax element (e.g., the binarized bin), and can de-binarize the binarized value to derive the value of the syntax element. The binarization process can be performed as a Truncated Rice (TR) binarization process, a k-th order Exponential Golomb (EGk) binarization process, a finite k-th order Exponential Golomb (finite EGk), a Fixed Length (FL) binarization process, etc. Additionally, the de-binarization process can represent a process performed based on the TR binarization process, the EGk binarization process, or the FL binarization process to derive the value of the syntax element.

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

[0210] The input to the TR binarization process can be cMax and cRiceParam for the syntax element and a request for TR binarization. Additionally, the output of the TR binarization process can be the TR binarization for symbolVal, where symbolVal is the value corresponding to the bin string.

[0211] Specifically, for example, in the presence of a suffix bin string for the syntax element, the TR bin string for the syntax element can be the concatenation of the prefix bin string and the suffix bin string, and in the absence of a suffix bin string, the TR bin string for the syntax element can be the prefix bin string. For example, the prefix bin string can be derived as described below.

[0212] The prefix value for symbolVal for the syntax element can be derived as shown in the following equation.

[0213] [Equation 7]

[0214]

[0215] Here, prefixVal can represent the prefix value of symbolVal. The prefix of the TR bin string for the syntax element (i.e., the prefix bin string) can be derived as described below.

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

[0217] For example, the bin string derived by the unary binary conversion of prefixVal can be as shown in the following table.

[0218] [Table 7]

[0219]

[0220] Meanwhile, if prefixVal is not less than cMax >> cRiceParam, the prefix bin string can be a bit string of length cMax >> cRiceParam and all bits are 1.

[0221] Additionally, if cMax is greater than symbolVal and if cRiceParam is greater than 0, there may be a bin suffix bin string for the TR bin string. For example, the suffix bin string can be derived as follows.

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

[0223] [Equation 8]

[0224]

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

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

[0227] Meanwhile, if the value of the input parameter (i.e., cRiceParam) is 0, the TR binary conversion can be an exact truncation unary binary conversion, and the value cMax that is always the same as the possible maximum value of the syntax element to be decoded can be used.

[0228] In addition, for example, the EGk binarization process can be performed as follows. The syntax element compiled with ue(v) can be a syntax element that undergoes exponential Golomb compilation.

[0229] For example, the 0th order exponential Golomb (EG0) binarization process can be performed as follows.

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

[0231] [Table 8]

[0232]

[0233] In addition, the variable "codeNum" can be derived as shown in the following equation.

[0234] [Equation 9]

[0235]

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

[0237] The structure of the exponential-Golomb code in which the bitstring is divided into "prefix" bits and "suffix" bits can be represented as shown in the following table.

[0238] [Table 9]

[0239]

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

[0241] The bitstring assigned to CodeNum can be as shown in the following table.

[0242] [Table 10]

[0243]

[0244] If the descriptor of a syntax element is ue(v), i.e., if the syntax element is encoded with ue(v), the value of the syntax element can be equal to codeNum.

[0245] Additionally, for example, the EGk binarization process can be performed as follows.

[0246] The input to the EGk binarization process can be a request for EGk binarization. Additionally, the output of the EGk binarization process can be the EGk binarization for symbolVal (i.e., the value corresponding to the bin string).

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

[0248] [Table 11]

[0249]

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

[0251] Additionally, for example, the finite EGk binarization process can be performed as follows.

[0252] The input to the finite EGk binarization process can be a request for finite EGk binarization, the Rice parameter riceParam, the variable log2TransformRange which is the base-2 logarithm representing the maximum value, and the variable maxPreExtLen which is the variable representing the maximum prefix extension length. Additionally, the output of the finite EGk binarization process can be the finite EGk binarization for symbolVal which is the value corresponding to the empty string.

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

[0254] [Table 12]

[0255]

[0256] Additionally, for example, the FL binarization process can be performed as follows.

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

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

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

[0260] [Equation 10]

[0261]

[0262] The index of the bin for FL binarization can be a method using values that increase in order from the most significant bit to the least significant bit. For example, the bin index related to the most significant bit can be binIdx = 0.

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

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

[0265] The output of the binarization process for abs_remainder can be the binarization of abs_remainder (i.e., the binarized bin string of abs_remainder). The available bin string for abs_remainder can be derived through the binarization process.

[0266] The Rice parameter cRiceParam for abs_remainer[n] can be derived through a Rice parameter derivation process performed via the input color component cIdx, luminance position (x0, y0), 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.

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

[0268] [Equation 11]

[0269]

[0270] Meanwhile, the binarization for abs_remainder (i.e., the bin string for abs_remainder) can be the concatenation of a prefix bin string and a suffix bin string in the presence of a suffix bin string. Additionally, in the absence of a suffix bin string, the bin string for abs_remainder can be the prefix bin string.

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

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

[0273] [Equation 12]

[0274]

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

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

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

[0278] The inputs to the Rice parameter derivation process can be the color component index cIdx, 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. The luminance position (x0, y0) can indicate the top-left sample of the current luminance transform block based on the top-left luminance sample of the picture. Additionally, the output of the Rice parameter derivation process can be the Rice parameter cRiceParam.

[0279] For example, based on the array AbsLevel[x][y] of transform blocks with a given component index cIdx and top-left luminance position (x0, y0), the variable locSumAbs can be derived similar to the pseudocode disclosed in the following table.

[0280] [Table 13]

[0281]

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

[0283] [Table 14]

[0284]

[0285] In addition, for example, during the derivation of the Rice parameter for abs_remainder[n], baseLevel can be set to 4.

[0286] 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.

[0287] In addition, the suffix value suffixVal of abs_remainder can be derived as shown in the following equation.

[0288] [Equation 13]

[0289]

[0290] The suffix bin string of the bin string of abs_remainder can be derived through the 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.

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

[0292] The input for the binarization process for dec_abs_level can be a request for binarization of the syntax element dec_abs_level[n], color component cIdx, luminance position (x0, y0), 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. The luminance position (x0, y0) can indicate the top-left sample of the current luminance transform block based on the top-left luminance sample of the picture.

[0293] The output of the binarization process for dec_abs_level can be the binarization of dec_abs_level (i.e., the binary string of the binarization of dec_abs_level). The available binary strings for dec_abs_level can be derived through the binarization process.

[0294] The Rice parameter cRiceParam for dec_abs_level[n] can be derived through a Rice parameter derivation process performed using the inputs of color component cIdx, luminance position (x0, y0), 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. The Rice parameter derivation process will be described in detail below.

[0295] 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.

[0296] [Equation 14]

[0297]

[0298] Meanwhile, the binarization for dec_abs_level[n] (i.e., the binary string for dec_abs_level[n]) can be the concatenation of a prefix binary string and a suffix binary string in the presence of a suffix binary string. Additionally, in the absence of a suffix binary string, the binary string for dec_abs_level[n] can be the prefix binary string.

[0299] For example, the prefix binary string can be derived as described below.

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

[0301] [Equation 15]

[0302]

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

[0304] If the prefix bin string is the same as the bit string with all bits being 1 and a bit length of 6, the suffix bin string of the bin string of dec_abs_level[n] can exist and can be derived as described below.

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

[0306] The inputs to the Rice parameter derivation process can be the color component index cIdx, 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. The luminance position (x0, y0) can indicate the top-left sample of the current luminance transform block based on the top-left luminance sample of the picture. In addition, the output of the Rice parameter derivation process can be the Rice parameter cRiceParam.

[0307] For example, the variable locSumAbs can be derived based on the array AbsLevel[x][y] of transform blocks with a given component index cIdx and top-left luminance position (x0, y0), similar to the pseudo-code disclosed in the following table.

[0308] [Table 15]

[0309]

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

[0311] [Table 16]

[0312]

[0313] 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.

[0314] [Equation 16]

[0315]

[0316] In addition, the suffix value suffixVal of dec_abs_level[n] can be derived as shown in the following equations.

[0317] [Equation 17]

[0318]

[0319] 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.

[0320] Meanwhile, RRC and TSRC can have the following differences.

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

[0322] In addition, for example, referring to Tables 3 and 4, in RRC, abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1] can 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] can be signaled. Here, abs_level_gtx_flag[n][0] can be expressed as abs_level_gt1_flag or the first coefficient level flag, abs_level_gtx_flag[n][1] can be expressed as abs_level_gt3_flag or the second coefficient level flag, abs_level_gtx_flag[n][2] can be expressed as abs_level_gt5_flag or the third coefficient level flag, abs_level_gtx_flag[n][3] can be expressed as abs_level_gt7_flag or the fourth coefficient level flag, and abs_level_gtx_flag[n][4] can be expressed as abs_level_gt9_flag or the fifth coefficient level flag. Specifically, the first coefficient level flag can be a flag indicating whether the coefficient level is greater than a first threshold (e.g., 1), the second coefficient level flag can be a flag indicating whether the coefficient level is greater than a second threshold (e.g., 3), the third coefficient level flag can be a flag indicating whether the coefficient level is greater than a third threshold (e.g., 5), the fourth coefficient level flag can be a flag indicating whether the coefficient level is greater than a fourth threshold (e.g., 7), and the fifth coefficient level flag can be a flag indicating whether the coefficient level is greater than a fifth threshold (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], and abs_level_gtx_flag[n][4] can also be included.

[0323] - In addition, for example, in RRC, the syntax element coeff_sign_flag can be bypass-compiled, but in TSRC, the syntax element coeff_sign_flag can be bypass-compiled or context-compiled.

[0324] Meanwhile, the present disclosure proposes a method of applying level mapping technology in a simplified residual data coding structure for transform skip blocks. Herein, a transform skip block may represent a block to which no transform is applied. Additionally, the level mapping technology may refer to a technology of mapping an absolute coefficient level (i.e., absCoeffLevel) to a modified level coded by a method based on (quantized) left and upper residual samples of a current residual sample (i.e., a current residual coefficient) when block-based differential pulse coding modulation (BDPCM) in the quantized residual domain is not applied to a current block (e.g., a CU). Under specific conditions such as lossless coding or near-lossless coding, the simplified residual data coding structure may be used for a 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 available for residual (data) coding within a TU (transform unit, TU) may be limited to a specific threshold, and when all the context coding bins available for residual coding of the TU are exhausted (i.e., when the number of context coding bins available for residual coding of the TU is equal to the specific threshold), the simplified residual data coding structure may be used.

[0325] Figure 9 An example of simplified residual data coding for a CG, a transform block, or a coding block is illustrated. With the simplified residual coding, the syntax elements sig_coeff_flag, coeff_sign_flag, and abs_remainder may be coded. The syntax elements for the residual coefficients in the CG, the transform block, or the coding block may be coded in the top-down order as shown in Figure 9 . That is, the syntax elements for the residual coefficients in the CG, the transform block, or the coding block may be coded in the order of sig_coeff_flag, coeff_sign_flag, and abs_remainder.

[0326] sig_coeff_flag can represent a syntax element for an active coefficient flag. sig_coeff_flag can indicate whether the residual coefficients of the current block (CG, transform block, or coding block) are non-zero residual coefficients. For example, if the value of the residual coefficient at the corresponding position is 0, sig_coeff_flag can have the value 0, and if it is not 0, sig_coeff_flag can have the value 1. Also, coeff_sign_flag can represent a syntax element for the sign flag of the residual coefficients. sig_coeff_flag can indicate the sign of the residual coefficients. For example, coeff_sign_flag can refer to the sign value of the residual coefficient at the corresponding position. There can be various methods 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 non-zero residual coefficients, when the residual coefficient at the corresponding position is negative, coeff_sign_flag can have the value 1 (or 0), and when the residual coefficient at the corresponding position is positive, coeff_sign_flag can have the value 0 (or 1). Alternatively, regardless of the value of sig_coeff_flag of the residual coefficient, when the residual coefficient is negative, coeff_sign_flag can have the value 1 (or 0), and when the residual coefficient is positive or 0, coeff_sign_flag can have the value 0 (or 1). Alternatively, when the residual coefficient is positive, coeff_sign_flag can have the value 1 (or 0), and when the residual coefficient is negative or 0, coeff_sign_flag can have the value 0 (or 1). In addition, abs_remainder can represent a syntax element for residual level value information or coefficient value related information. For example, abs_remainder can refer to the 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 can have the value obtained by subtracting 1 from the absolute value of the residual coefficient (absolute value - 1).

[0327] Meanwhile, even when performing regular residual coding, if a specific condition is satisfied, it can be converted to Figure 9The simplified residual data compilation shown. For example, a particular condition can be a situation where all context compilation bins that can be used are exhausted when the residual information of the corresponding compilation block is losslessly or nearly losslessly compiled and / or when the TU-level context compilation bin constraint algorithm is applied.

[0328] Figure 10 Another example of simplified residual data compilation for a CG, transform block, or compilation block is shown. With simplified residual compilation, the syntax elements dec_abs_level and coeff_sign_flag can be compiled. As Figure 10 shown, the syntax elements for the residual coefficients in a CG, transform block, or compilation block can be compiled in top-to-bottom order. That is, the syntax elements for the residual coefficients in a CG, transform block, or compilation block can be compiled in the order of dec_abs_level, coeff_sign_flag.

[0329] Referring to Figure 10 , dec_abs_level can represent a syntax element for coefficient value-related information, and coeff_sign_flag can represent a syntax element for the sign flag of the residual coefficient. For example, according to the structure shown in Figure 10 , 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. Additionally, for example, coeff_sign_flag can refer to the sign value of the residual coefficient at the corresponding position. There can be various ways to apply coeff_sign_flag. For example, when the residual coefficient at the corresponding position is 0, coeff_sign_flag may not be compiled. And for a non-zero residual coefficient, when the residual coefficient at the corresponding position is negative, coeff_sign_flag can have a value of 1 (or 0), and when the residual coefficient at the corresponding position is positive, coeff_sign_flag can have a value of 0 (or 1). Alternatively, regardless of the dec_abs_level of the residual coefficient, coeff_sign_flag can be compiled. When the residual coefficient is negative, coeff_sign_flag can have a value of 1 (or 0), and when the residual coefficient is positive or 0, coeff_sign_flag can have a value of 0 (or 1). Alternatively, when the residual coefficient is positive, coeff_sign_flag can have a value of 1 (or 0), and when the residual coefficient is negative or 0, coeff_sign_flag can have a value of 0 (or 1).

[0330] Meanwhile, even when performing conventional residual compilation, if specific conditions are met, it can be converted to Figure 10 the simplified residual data compilation shown. For example, the specific conditions can be a situation where, when the residual information of the corresponding compilation block is losslessly or nearly losslessly compiled and / or when applying the TU-level context compilation bin constraint algorithm, all context compilation bins that can be used are exhausted.

[0331] Figure 11 Another example of the simplified residual data compilation for a CG, transform block, or compilation block is shown. With the simplified residual compilation, the syntax elements coeff_sign_flag and dec_abs_level can be compiled. It can be as Figure 11 shown, compile the syntax elements for the residual coefficients in the CG, transform block, or compilation block in a top-down order. That is, the syntax elements for the residual coefficients in the CG, transform block, or compilation block can be compiled in the order of coeff_sign_flag and dec_abs_level.

[0332] Referring to Figure 11 , coeff_sign_flag can represent the syntax element for the sign flag of the residual coefficient, and dec_abs_level can represent the syntax element for the information related to the coefficient value. For example, when the residual coefficient at the position to be compiled is negative, coeff_sign_flag can have the value 1 (or 0), and when the residual coefficient is positive or 0, coeff_sign_flag can have the value 0 (or 1). Alternatively, for example, when the residual coefficient is positive, coeff_sign_flag can have the value 1 (or 0), and when the residual coefficient is negative or 0, coeff_sign_flag can have the value 0 (or 1).

[0333] Meanwhile, even when performing conventional residual compilation, if specific conditions are met, it can be converted to Figure 11 the simplified residual data compilation shown. For example, the specific conditions can be as follows: where, when the residual information of the corresponding compilation block is losslessly or nearly losslessly compiled and / or when applying the TU-level context compilation bin constraint algorithm, all context compilation bins that can be used are exhausted.

[0334] Meanwhile, as described above, level mapping techniques for transforming skip modes can be used. For example, in level mapping techniques, the value of abs_level_gtx_flag[0] can be used as a value indicating whether to perform level mapping. That is, whether to map levels can be determined based on the value of abs_level_gtx_flag[0]. Therefore, in a simplified residual data compilation structure that does not compile abs_level_gtx_flag[0], the decoding of residual coefficients to which level mapping is applied cannot be correctly performed. Therefore, the present disclosure proposes a method that does not use level mapping for a compilation block, transform block, coefficient group, and / or residual coefficient to which simplified residual data compilation is applied, such that Figure 9 , Figure 10 or Figure 11 the simplified residual data compilation structure and level mapping can be used together. According to an embodiment of the present disclosure, the simplified residual data compilation structure and level mapping can be combined without problems in residual compilation for transform skip blocks.

[0335] For example, in a compilation block, the residual data compilation method of the transform skip block shown in Table 4 and the simplified residual data compilation method can be mixed. When applying the residual data compilation for the transform skip block, the level mapping technique shown in Table 4 can be applied as it is, and when applying the simplified residual data compilation, the level mapping technique can be applied.

[0336] Tables 17 and 18 described below exemplarily show the syntax for applying the embodiments proposed in the present disclosure.

[0337] [Table 17]

[0338]

[0339] [Table 18]

[0340]

[0341] Table 17 can represent a syntax structure for preventing the execution of level mapping when applying the context compilation bin constraint algorithm, the available context compilation bins (MaxCcbs represents the number of context compilation bins that can be used) are exhausted and converted into a simplified residual data compilation structure. Additionally, Table 18 can represent a syntax structure for applying the method proposed in the present disclosure when the simplified residual data compilation structure is used for lossless compilation blocks. Here, for example, transquant_bypass_flag shown in Table 18 can be a syntax element indicating whether to apply lossless compilation. transquant_bypass_flag can be signaled at the CU or TU or picture level.

[0342] Meanwhile, 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 implementing a simplified residual data compilation structure, in order to encode / decode the residual coefficients of level mapping, a process of not performing correction encoding / decoding levels is proposed. That is, for example, a method can be proposed that, when compiling bins using all contexts for the current block, derives the residual coefficients of the current block using a simplified residual data compilation structure without deriving the residual coefficients through level mapping. The simplified residual data compilation structure can be as described above. For example, when compiling bins using all contexts for the current block, the residual coefficients 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.

[0343] Figure 12 Briefly illustrated is an image encoding method performed by an encoding device according to the present disclosure. Figure 12 The method disclosed in Figure 2 can be performed by the encoding device disclosed in Figure 12 Specifically, for example, Figure 12 S₁₂₀₀ of

[0344] The encoding device derives prediction samples for the current block based on inter-frame prediction or intra-frame prediction (S₁₂₀₀). The encoding device can derive prediction samples for the current block based on the prediction mode. In this case, various prediction methods disclosed in this document, such as inter-frame prediction or intra-frame prediction, can be applied.

[0345] For example, the encoding device can determine whether to perform inter-frame prediction or intra-frame prediction on the current block, and based on the RD cost, determine a specific inter-frame prediction mode or a specific intra-frame prediction mode. According to the determined mode, the encoding device can derive prediction samples for the current block.

[0346] The encoding device derives residual samples for the current block based on the prediction samples (S₁₂₁₀). For example, the encoding device can derive residual samples by subtracting the prediction samples from the original samples for the current block.

[0347] 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 a transform to the current block considering the compilation efficiency. For example, the encoding device may determine not to apply a transform to the current block. A block to which no transform is applied may be referred to as a transform skip block. That is, for example, the current block may be a transform skip block.

[0348] If no transform is applied to the current block, that is, if no transform is applied to the residual sample, the encoding device may derive the derived residual sample as the current residual coefficient. Additionally, if a transform is applied to the current block, that is, if a transform is applied to the residual sample, the encoding device may derive the current residual coefficient by performing a 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 the current coefficient group (CG). Additionally, 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.

[0349] Here, the current block may be a compilation block (CB) or a transform block (TB). Additionally, the residual coefficient may be referred to as a transform coefficient.

[0350] Meanwhile, for example, the current residual coefficient can be derived without performing level mapping. For example, the number of context-compiled residual syntax elements of the residual coefficients before the current residual coefficient among the residual coefficients for the current block can be equal to the maximum number of context-compiled bins for the current block, and the residual syntax elements for the current residual coefficient can include the absolute level information for the current residual coefficient and the sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. Herein, deriving the current residual coefficient using only the absolute level information and the sign flag can be expressed as simplified residual data compilation. That is, the residual coefficient can be derived based on the simplified residual data compilation. Additionally, for example, all the context-compiled bins for the current block can be used as the bins of the context-compiled residual syntax elements of the residual coefficients before the current residual coefficient among the residual coefficients for the current block, and the residual syntax elements for the current residual coefficient can include the coefficient level information for the current residual coefficient and the 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-compiled bins for the current block are used for the residual syntax elements of the previous residual coefficient for the current residual coefficient in scan order, and the residual syntax elements for the current residual coefficient can include the coefficient level information for the current residual coefficient and the sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. Furthermore, for example, the residual coefficient before the current residual coefficient can be derived by performing level mapping.

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

[0352] [Table 19]

[0353]

[0354] Herein, X0 can 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 can represent the upper absolute coefficient level of the current residual coefficient (i.e., the coefficient level of the upper residual sample (upper residual coefficient)). Additionally, absCoefff can represent the absolute level coefficient of the current residual coefficient, and absCoeffMod can represent the level of the level mapping through the above process.

[0355] For example, the level mapping can represent the following process: deriving the maximum value among 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 of the residual coefficient and the absolute level.

[0356] The encoding device encodes image information including prediction mode information representing the prediction mode of the current block and residual syntax elements for the current residual coefficients (S1230). The encoding device may encode image information including prediction mode information representing the prediction mode of the current block and residual syntax elements for the current residual coefficients. For example, the encoding device may generate and encode prediction-related information for the current block. The prediction-related information may include prediction mode information. Additionally, the encoding device may encode residual information including residual syntax elements for the current residual coefficients of the current block. The image information may include the 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 bitstream. The bitstream may be sent to the decoding device via a network or a storage medium.

[0357] Furthermore, for example, the number of context-coded residual syntax elements for the residual coefficients before the current residual coefficient among the residual coefficients for the current block may be equal to the maximum number of context-coded bins for the current block. That is, for example, all of the context-coded bins for the current block may be used as bins for the context-coded residual syntax elements for the residual coefficients before the current residual coefficient among the residual coefficients for the current block. In other words, for example, all of the maximum number of context-coded bins for the current block may be used for the residual syntax elements of the previous residual coefficients for the current residual coefficient in scan order. Meanwhile, for example, the maximum number of context-coded bins for the current block may be derived based on the width and height of the current block.

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

[0359] 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 representing 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 the 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 the 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. [[ID=!]] [[ID=!]]

[0360] In addition, for example, an encoding device may generate residual information for a current block based on 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 before the current residual coefficient in scan 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.

[0361] For example, context-compiled residual syntax elements may include a valid coefficient flag indicating whether a 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 for the residual coefficient, a first coefficient level flag indicating whether the coefficient level is greater than a first threshold, and / or a second coefficient level flag indicating whether the coefficient level is greater than a second threshold. In addition, for example, context-compiled residual syntax elements may include a third coefficient level flag indicating whether the coefficient level is greater than a third threshold, a fourth coefficient level flag indicating whether the coefficient level of the residual coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag indicating whether the coefficient level of the residual coefficient is greater than a fifth threshold. Here, the valid 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. In addition, 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.

[0362] In addition, for example, the residual information may include bypass-based compiled syntax elements for the residual coefficients of the current block. The bypass-compiled syntax elements may include coefficient level information regarding the value of the current residual coefficient. The coefficient level information may be abs_remainder or dec_abs_level. In addition, the bypass-compiled syntax elements may include a sign flag.

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

[0364] Meanwhile, the bitstream may be sent to the decoding device via a network or a (digital) storage medium. Here, 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.

[0365] Figure 13 Briefly illustrated is an encoding device for performing an image encoding method according to the present disclosure. Figure 12 The method disclosed in Figure 13 may be performed by the encoding device disclosed in Figure 13 Specifically, for example, the predictor of the encoding device in Figure 12 may perform S1200 in Figure 13 the residual processor of the encoding device in Figure 12 may perform S1210 to S1220 in Figure 13 and the entropy encoder of the encoding device in Figure 12 may perform S1230 in

[0366] Figure 14 Briefly illustrated is an image decoding method performed by a decoding device according to the present disclosure. Figure 14 The method disclosed in Figure 3 may be performed by the decoding device disclosed in Figure 14 Specifically, for example, S1400 in

[0367] The decoding device obtains image information including prediction mode information and residual information from a bitstream (S1400). The decoding device may obtain image information including prediction mode information and residual information for a current block from 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.

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

[0369] In addition, for example, the current block may be a transform skip block.

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

[0371] 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 representing 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 the 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 the 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.

[0372] In addition, for example, the image information may include the residual information for the current block. For example, the residual information may include residual syntax elements for the residual coefficients prior to the current residual coefficient in scan 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.

[0373] For example, the context-compiled residual syntax element may include a valid 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 indicating whether the coefficient level is greater than a first threshold, and / or a second coefficient level flag indicating whether the coefficient level is greater than a second threshold. Additionally, for example, the context-compiled residual syntax element may include a third coefficient level flag indicating whether the coefficient level is greater than a third threshold, a fourth coefficient level flag indicating whether the coefficient level of the residual coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag indicating whether the coefficient level of the residual coefficient is greater than a fifth threshold. Here, the valid 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. Additionally, 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.

[0374] Furthermore, for example, the residual information may include a bypass-based compiled syntax element for the residual coefficient of the current block. The bypass-compiled syntax element may include coefficient level information regarding the value of the current residual coefficient. The coefficient level information may be abs_remainder or dec_abs_level. Additionally, the bypass-compiled syntax element may include a sign flag.

[0375] The decoding device derives the prediction mode of the current block based on the prediction mode information (S1410). The decoding device 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 on this.

[0376] The decoding device derives the predicted samples based on the prediction mode (S1420).

[0377] For example, the decoding device may derive a prediction mode applied to a current block based on prediction mode information, and may derive a prediction sample of the current block based on the prediction mode. For example, when applying inter prediction to the current block, the decoding device may derive motion information of the current block based on prediction-related information included in the picture information, and may derive a prediction sample of the current block based on the motion information. Additionally, for example, when applying intra prediction to the current block, the decoding device may derive reference samples based on neighboring samples of the current block, and may derive a prediction sample of the current block based on the reference samples and the intra prediction mode of the current block. The reference samples 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 samples may be P[-1][0] to P[-1][2N-1], and the upper reference samples may be P[0][-1] to P[2N-1][-1].

[0378] The decoding device derives a current residual coefficient based on a residual syntax element for the current residual coefficient in the current block (S1430). The decoding device 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.

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

[0380] Meanwhile, for example, the current residual coefficient can be derived without performing level mapping. For example, the number of context-compiled residual syntax elements of the residual coefficient before the current residual coefficient in the residual coefficients for the current block can be equal to the maximum number of context-compiled bins for the current block, and the residual syntax elements for the current residual coefficient can include the absolute level information for the current residual coefficient and the sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. Herein, deriving the current residual coefficient using only the absolute level information and the sign flag can be expressed as simplified residual data compilation. That is, the residual coefficient can be derived based on the simplified residual data compilation. Additionally, for example, all the context-compiled bins for the current block can be used as the bins of the context-compiled residual syntax elements of the residual coefficient before the current residual coefficient among the residual coefficients for the current block, and the residual syntax elements for the current residual coefficient can include the coefficient level information for the current residual coefficient and the 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-compiled bins for the current block are used for the residual syntax elements of the previous residual coefficient for the current residual coefficient in scan order, the residual syntax elements for the current residual coefficient can include the coefficient level information for the current residual coefficient and the sign flag of the residual coefficient, and the current residual coefficient can be derived without performing level mapping. Furthermore, for example, the residual coefficient before the current residual coefficient can be derived by performing level mapping.

[0381] Meanwhile, for example, the level mapping can represent the method shown in Table 19 above. For example, the level mapping can refer to the following process: deriving the maximum value among 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 of the residual coefficient and the absolute level.

[0382] The decoding device derives a residual sample based on a current residual coefficient (S1440). The decoding device may derive a residual sample of a current block based on the current residual coefficient. That is, the decoding device may derive a residual sample of the current block based on the current residual coefficient. For example, when it is derived based on a transform skip flag that no transform is applied to the current block, i.e., 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 a transform skip flag that no transform is applied to the current block, i.e., 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 a transform skip flag that a transform is applied to the current block, i.e., when the value of the transform skip flag is zero (0), the decoding device may derive the residual sample of the current block by performing an inverse transform on the current residual coefficient. Alternatively, for example, when it is derived based on a transform skip flag that a transform is applied to the current block, i.e., when the value of the transform skip flag is 0, the decoding device may derive the residual sample of the current block by dequantizing the current residual coefficient and performing an inverse transform on the dequantized coefficient.

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

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

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

[0386] Figure 15 Schematically represents a decoding device for performing an image decoding method according to this document. Figure 14 The method disclosed in Figure 15 may be performed by the decoding device disclosed in Figure 15 Specifically, for example, Figure 14 the entropy decoder of the decoding device of Figure 15 may perform Figure 14 S1400 of Figure 15 the predictor of the decoding device of Figure 14 may perform Figure 15 S1410 to S1420 of Figure 14 the residual processor of the decoding device of

[0387] According to the present disclosure above, the efficiency of residual compilation can be improved.

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

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

[0390] In the above embodiments, the method is described based on a flowchart having a series of steps or blocks. The present disclosure is not limited to the order of the above steps or blocks. Some steps or blocks may be executed in a different order from other steps or blocks described above or simultaneously. In addition, those skilled in the art will understand that the steps shown in the flowchart are not exclusive and may further include other steps, or one or more steps in the flowchart may be deleted without affecting the scope of the present disclosure.

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

[0392] In addition, the decoding device and encoding device applying the present disclosure can be included in the following devices: a multimedia broadcast transmission / reception device, a mobile communication terminal, a home theater video device, a digital cinema video device, a surveillance camera, a video chat device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a portable camera, a VoD service providing device, an over-the-top (OTT) video device, an Internet streaming service providing device, a three-dimensional (3D) video device, a videoconference video device, a transportation user device (e.g., a vehicle user device, an aircraft user device, and a ship user device), and a medical video device; and the decoding device and encoding device applying the present disclosure can be used to process video signals or data signals. For example, an over-the-top (OTT) video device can include a game console, a Blu-ray player, an Internet-connected television, a home theater system, a smart phone, a tablet computer, a digital video recorder (DVR), etc.

[0393] In addition, the processing method of the present disclosure can be generated in the form of a computer-executable program and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to the present disclosure 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 can include, for example, BD, universal serial bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage devices. 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 through a wired / wireless communication network.

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

[0395] Figure 16 The structural diagram of a content stream system to which the content of the present disclosure is applied is illustrated.

[0396] The content stream system applying the embodiments of this document can mainly include an encoding server, a stream server, a network server, a media storage, a user device, and a multimedia input device.

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

[0398] The bit stream can be generated by an encoding method or a bit stream generation method applying the embodiments of the present disclosure, and the stream server can temporarily store the bit stream during the process of sending or receiving the bit stream.

[0399] The stream server sends multimedia data to the user device through the network server based on a user request, and the network server serves as a medium for notifying the user of the service. When the user requests a required service from the network server, the network server delivers the request to the stream server, and the stream server sends multimedia data to the user. In this case, the content stream system can include a separate control server. In this case, the control server is used to control the commands / responses between the devices within the content stream system.

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

[0401] Examples of user devices may include mobile phones, smartphones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigators, touchscreen PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, 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, and in this case, the data received from each server may be distributed.

[0402] 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 of this disclosure 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 of this disclosure may be combined to be implemented as a method.

Claims

1. An image decoding method performed by a decoding device, the method comprising: Obtaining image information including prediction mode information and residual information through a bitstream; Deriving a prediction mode of a current block based on the prediction mode information; Deriving prediction samples based on the prediction mode; Deriving current residual coefficients based on residual syntax elements for the current residual coefficients in the current block; Deriving residual samples based on the current residual coefficients; And Deriving reconstructed samples of the current block based on the residual samples and the prediction samples.

2. The image decoding method according to claim 1, Among them, The residual information includes the residual syntax elements for the current residual coefficients, wherein the number of context-coded residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients for the current block is equal to the maximum number of context-coded bins of the current block, wherein the residual syntax elements for the current residual coefficients include 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 the value indicated by the coefficient level information for the current residual coefficient, and the sign of the current residual coefficient is derived as the sign indicated by the sign flag, wherein the current residual coefficient is derived without performing level mapping, wherein the residual coefficients before the current residual coefficient are derived by performing the level mapping, and wherein the level mapping for a target residual coefficient includes: Deriving the maximum value among the absolute level of the left residual coefficient of the target residual coefficient and the absolute level of the upper residual coefficient of the target residual coefficient; Comparing the absolute level of the target residual coefficient with the maximum value; and Deriving a modified absolute level of the target residual coefficient based on the comparison.

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

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

5. The image decoding method according to claim 2, wherein, Deriving the maximum number of context-coded bins of the current block based on the width and height of the current block.

6. The image decoding method according to claim 2, wherein, All the context-coded bins for the current block are used as bins for the context-coded residual syntax elements for the residual coefficients before the current residual coefficient.

7. The image decoding method according to claim 2, wherein, The context-coded residual syntax elements include a valid 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 indicating whether the coefficient level is greater than a first threshold, and a second coefficient level flag indicating whether the coefficient level is greater than a second threshold.

8. An image encoding method performed by an encoding device, the method comprising: Deriving prediction samples of a current block based on inter-frame prediction or intra-frame prediction; Deriving residual samples of the current block based on the prediction samples; Derive a current residual coefficient based on the residual sample; and Encode image information, where the image information includes prediction mode information representing a prediction mode of the current block and residual syntax elements for the current residual coefficient.

9. The image encoding method according to claim 7, Among them, The number of context-compiled residual syntax elements for residual coefficients before the current residual coefficient among the residual coefficients for the current block is equal to the maximum number of context-compiled bins of the current block, wherein the residual syntax elements for the current residual coefficient include coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, wherein the coefficient level information represents the absolute value of the coefficient level of the current residual coefficient, and the sign flag of the current residual coefficient represents the sign of the current residual coefficient, wherein the current residual coefficient is derived without performing level mapping, wherein the residual coefficients before the current residual coefficient are derived by performing the level mapping, and wherein the level mapping for a target residual coefficient includes: Derive the maximum value among the absolute level of the left residual coefficient of the target residual coefficient and the absolute level of the upper residual coefficient of the target residual coefficient; Compare the absolute level of the target residual coefficient with the maximum value; and Derive a modified absolute level of the target residual coefficient based on the comparison.

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

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

12. The image encoding method according to claim 8, wherein, Derive the maximum number of context-compiled bins of the current block based on the width and height of the current block.

13. The image encoding method according to claim 8, wherein, All of the context-compiled bins for the current block are used as bins for the context-compiled residual syntax elements for the residual coefficients before the current residual coefficient.

14. The image encoding method according to claim 8, wherein, The context-compiled residual syntax elements include a valid 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 representing the sign for the residual coefficient, a first coefficient level flag indicating whether the coefficient level is greater than a first threshold, and a second coefficient level flag indicating whether the coefficient level is greater than a second threshold.

15. A non-transitory computer-readable storage medium, which stores a bitstream generated by a method, the method including: Derive a prediction sample of a current block based on inter-frame prediction or intra-frame prediction; Derive a residual sample of the current block based on the prediction sample; Derive a current residual coefficient based on the residual sample; Encode image information, where the image information includes prediction mode information representing a prediction mode of the current block and residual syntax elements for the current residual coefficient; and Generate the bitstream including the image information.

16. A method for transmitting data of an image, the method including: Obtain a bitstream of image information, where the image information includes prediction mode information indicating a prediction mode of a current block and residual syntax elements for current residual coefficients in the current block; And Transmit the data of the bitstream including the image information, where the image information includes the prediction mode information and the residual syntax elements, wherein a 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 the inter-frame prediction or the intra-frame prediction is applied to the current block as a prediction mode of the current block, wherein the current residual coefficients are derived based on residual samples of the current block, and the residual samples are derived based on prediction samples of the current block.