Video or image coding method and apparatus therefor

By constructing motion information candidate list and residual processing, and using entropy decoder and predictor to generate efficient image decoding methods, the problem of high resolution image transmission and storage costs is solved, the image compression efficiency is improved and the encoding complexity is reduced.

CN119835446APending Publication Date: 2025-04-15LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510054336.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-04-15

AI Technical Summary

Technical Problem

The prior art 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 requires efficient image compression technology.

Method used

By constructing a motion information candidate list, the motion information and residual information of the current block are derived, the image decoding efficiency is improved by using an entropy decoder, predictor and residual processor, and the reconstructed samples are generated in combination with the adder to achieve simplified residual data encoding.

Benefits of technology

Improved residual coding efficiency, improved overall image/video compression efficiency and reduced encoding complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835446A_ABST
    Figure CN119835446A_ABST
Patent Text Reader

Abstract

The invention relates to a video or image coding method and a device therefor. An image decoding method performed according to a decoding device of the present document comprises the steps of: obtaining image information including a motion information candidate index and residual information through a bitstream; guiding out motion information of the current block based on the motion information candidate cable; deriving a prediction sample based on the motion information; deriving a current residual coefficient based on a residual syntax element for the current residual coefficient in the current block; deriving a residual sample based on the current residual coefficient; and deriving a reconstructed sample of the current block based on the 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 202080060173.6 (PCT / KR2020 / 011412), which was submitted to the China Patent Office on February 24, 2022, with an international application date of August 26, 2020, and the invention name is “Video or image compilation method and device thereof”. Technical Field

[0002] The present disclosure relates to a video or image coding method and a device thereof. Background Art

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

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

[0005] Technical issues

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

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

[0008] Technical Solution

[0009] According to an embodiment of this document, there is provided an image decoding method performed by a decoding device. The method includes obtaining image information including a motion information candidate index and residual information through a bitstream, constructing a motion information candidate list based on neighboring blocks of a current block, deriving motion information of the current block based on a motion information candidate indicated by the motion information candidate index among motion information candidates in the motion information candidate list, deriving a prediction sample of the current block based on the motion information, deriving a current residual coefficient based on a residual syntax element for a current residual coefficient in the current block, deriving a residual sample based on the current residual coefficient, and deriving a reconstructed sample of the current block based on the prediction sample and the residual sample.

[0010] According to another embodiment of this document, a decoding device for performing image decoding is provided. The decoding device includes: an entropy decoder configured to obtain image information including motion information candidate indexes and residual information through a bitstream; a predictor configured to construct a motion information candidate list based on neighboring blocks of a current block, derive motion information of the current block based on motion information candidates indicated by the motion information candidate index among motion information candidates in the motion information candidate list, and derive prediction samples of the current block based on the motion information; a residual processor configured to derive a current residual coefficient based on a residual syntax element for a current residual coefficient in the current block, and derive a residual sample based on the current residual coefficient; and an adder configured to derive a reconstructed sample of the current block based on the prediction sample and the residual sample.

[0011] According to another embodiment of this document, a video encoding method performed by an encoding device is provided. The method includes: constructing a motion information candidate list based on neighboring blocks of a current block, selecting a motion information candidate from among the motion information candidates in the motion information candidate list, deriving motion information of the current block based on the selected motion information candidate, deriving a prediction sample of the current block based on the motion information, deriving a residual sample of the current block based on the prediction sample, deriving a current residual coefficient based on the residual sample, and encoding image information including a motion information candidate index indicating the selected motion information candidate and a residual syntax element for the current residual coefficient.

[0012] According to another embodiment of this document, a video encoding device is provided. The encoding device includes a predictor configured to construct a motion information candidate list based on neighboring blocks of a current block, select a motion information candidate from the motion information candidates in the motion information candidate list, derive motion information of the current block based on the selected motion information candidate, and derive a prediction sample of the current block based on the motion information; a residual processor configured to derive a residual sample of the current block based on the prediction sample, and derive a current residual coefficient based on the residual sample; and an entropy encoder configured to encode image information, the image information including a motion information candidate index indicating the selected motion information candidate and a residual syntax element for the current residual coefficient.

[0013] Beneficial Effects

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

[0015] According to the present disclosure, overall image / video compression efficiency may be improved and coding complexity may 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 a configuration of a video / image encoding device to which an embodiment of the present disclosure can be applied.

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

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

[0020] Figure 5 An example of a video / image encoding method based on intra-frame prediction is illustrated.

[0021] Figure 6 The intra prediction process is schematically illustrated.

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

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

[0024] Fig. 9 The inter-frame prediction process is schematically illustrated.

[0025] Fig.10 Context-Adaptive Binary Arithmetic Coding (CABAC) for encoding syntax elements is exemplarily shown.

[0026] Fig.11 is a diagram showing exemplary transform coefficients within a 4×4 block.

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

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

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

[0030] Fig.15 The image encoding method performed by the encoding device according to the present disclosure is briefly illustrated.

[0031] Fig.16A coding device for performing an image coding method according to the present disclosure is briefly illustrated.

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

[0033] Fig.18 A decoding device for performing an image decoding method according to the present disclosure is briefly illustrated.

[0034] Fig.19 The present invention is a structural diagram of a content streaming system to which the present invention is applied. DETAILED DESCRIPTION

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0052] A slash ( / ) or a comma 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".

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

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

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

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

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

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

[0059] refer to Figure 2 , the encoding device 200 includes an image segmenter 210, a predictor 220, a residual processor 230 and an entropy encoder 240, an adder 250, a filter 260 and a memory 270. The predictor 220 may include an inter-frame predictor 221 and an intra-frame predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234 and an inverse transformer 235. The residual processor 230 may also include a subtractor 231. The adder 250 may be called a reconstructor or a reconstructed block generator. According to an embodiment, the image segmenter 210, the predictor 220, the residual processor 230, the entropy encoder 240, the adder 250 and the filter 260 may be composed of at least one hardware component (e.g., an encoder chipset or processor). In addition, the memory 270 may include a decoded picture buffer (DPB) or may be composed of a digital storage medium. The hardware component may also include the memory 270 as an internal / external component.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0074] refer 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 composed of hardware components (e.g., a decoder chipset or processor). In addition, the memory 360 may include a decoded picture buffer (DPB), or may be composed of a digital storage medium. The hardware component may also include the memory 360 as an internal / external component.

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

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

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

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

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

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

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

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

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

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

[0085] Additionally, luminance mapping and chroma scaling (LMCS) can be applied during picture decoding.

[0086] 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 may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0103] refer to Figure 4 , the encoding device performs intra prediction on the current block (S400). The encoding device derives the intra prediction mode / type of the current block, derives the adjacent reference samples of the current block, and generates prediction samples in the current block based on the intra prediction mode / type and the adjacent reference samples. Here, the intra prediction mode / type determination, adjacent reference sample derivation, and prediction sample generation processes may be performed simultaneously, or one process may be performed before the other. The encoding device may determine a mode / type to be applied to the current block from a plurality of intra prediction modes / types. The encoding device may compare the RD costs of the intra prediction modes / types and determine the optimal intra prediction mode / type for the current block.

[0104] At the same time, the encoding device may perform a prediction sample filtering process. Prediction sample filtering may be referred to as post-filtering. Some or all prediction samples may be filtered by the prediction sample filtering process. In some cases, the prediction sample filtering process may be omitted.

[0105] The encoding apparatus generates residual samples of the current block based on the (filtered) prediction samples (S410). The encoding apparatus may compare the prediction samples among the original samples of the current block based on a phase and derive the residual samples.

[0106] The encoding device may encode image information including information about intra prediction (prediction information) and residual information about residual samples (S420). The prediction information may include intra prediction mode information and intra prediction type information. The encoding device may output the encoded image information in the form of a bit stream. The output bit stream may be sent to a decoding device via a storage medium or a network.

[0107] The residual information may include a residual coding syntax described later. The encoding device may transform / quantize the residual samples to derive quantized transform coefficients. The residual information may include information about the quantized transform coefficients.

[0108] At the same time, as described above, the encoding device can generate a reconstructed picture (including reconstructed samples and reconstructed blocks). To this end, the encoding device can derive (modified) residual samples by performing inverse quantization / inverse transformation on the quantized transform coefficients again. The reason for performing inverse quantization / inverse transformation again after transforming / quantizing the residual samples in this way is to derive the same residual samples as the residual samples derived in the above-mentioned decoding device. The encoding device can generate a reconstructed block including reconstructed samples for the current block based on the predicted samples and the (modified) residual samples. A reconstructed picture for the current picture can be generated based on the reconstructed block. As described above, the in-loop filtering process can be further applied to the reconstructed picture.

[0109] Figure 5 An example of a video / image encoding method based on intra-frame prediction is illustrated.

[0110] The decoding device may perform operations corresponding to those performed by the encoding device.

[0111] Prediction information and residual information may be obtained from a bitstream. Residual samples of a current block may be derived based on the residual information. Specifically, transform coefficients may be derived by performing inverse quantization based on quantized transform coefficients derived from the residual information, and residual samples of the current block may be derived by performing inverse transformation on the transform coefficients.

[0112] Specifically, the decoding device may derive the intra prediction mode / type of the current block based on the received prediction information (intra prediction mode / type information) (S500). The decoding device may derive the adjacent reference samples of the current block (S510). The decoding device generates the prediction samples in the current block based on the intra prediction mode / type and the adjacent reference samples (S520). In this case, the decoding device may perform a prediction sample filtering process. Prediction sample filtering may be referred to as post filtering. Some or all prediction samples may be filtered by the prediction sample filtering process. In some cases, the prediction sample filtering process may be omitted.

[0113] The decoding device generates residual samples for the current block based on the received residual information (S530). The decoding device may generate reconstructed samples of the current block based on the prediction samples and the residual samples, and may derive a reconstructed block including the reconstructed samples (S540). A reconstructed picture of the current picture may be generated based on the reconstructed block. As described above, the in-loop filtering process may be further applied to the reconstructed picture.

[0114] The intra-frame prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether MPM (most probable mode) is applied to the current block or whether the remaining mode is applied, and when MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra-frame prediction mode candidates (MPM candidates). The intra-frame prediction mode candidates (MPM candidates) may be composed of an MPM candidate list or an MPM list. In addition, when MPM is not applied to the current block, the intra-frame prediction mode information includes remaining mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra-frame prediction modes other than the intra-frame prediction mode candidates (MPM candidates). The decoding device may determine the intra-frame prediction mode of the current block based on the intra-frame prediction mode information.

[0115] In addition, the intra-frame prediction type information can be implemented in various forms. For example, the intra-frame prediction type information may include intra-frame prediction type index information indicating one of the intra-frame prediction types. As another example, the intra-frame prediction type information may include at least one of the following: reference sample line information indicating whether MRL is applied to the current block, and if applied, which reference sample line is used (e.g., intra_luma_ref_idx), ISP flag information indicating whether ISP is applied to the current block (e.g., intra_subpartitions_mode_flag), ISP type information indicating the split type of the sub-partition when ISP is applied (e.g., intra_subpartitions_split_flag), flag information indicating whether PDPC is applied, or flag information indicating whether LIP is applied. In addition, the intra-frame prediction type information may include a MIP flag indicating whether matrix-based intra-frame prediction (MIP) is applied to the current block.

[0116] The intra-frame prediction mode information and / or the intra-frame prediction type information may be encoded / decoded by the coding method described in the present disclosure. For example, the intra-frame prediction mode information and / or the intra-frame prediction type information may be encoded / decoded by entropy coding (eg, CABAC, CAVLC).

[0117] Figure 6 The intra prediction process is schematically illustrated.

[0118] refer to Figure 6As described above, the intra prediction process may include a step of determining an intra prediction mode / type, a step of deriving adjacent reference samples, and a step of performing intra prediction (generating prediction samples). The intra prediction process may be performed by the encoding device and the decoding device as described above. In the present disclosure, the coding device may include an encoding device and / or a decoding device.

[0119] refer to Figure 6 , the coding device determines the intra prediction mode / type S600.

[0120] The encoding device may determine the intra-prediction mode / type applied to the current block from the various intra-prediction modes / types described above, and may generate prediction related information. The prediction related information may include intra-prediction mode information indicating the intra-prediction mode applied to the current block and / or intra-prediction type information indicating the intra-prediction type applied to the current block. The decoding device may determine the intra-prediction mode / type applied to the current block based on the prediction related information.

[0121] The intra-frame prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether the most probable mode (MPM) is applied to the current block or the residual mode is applied, and when the MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra-frame prediction mode candidates (MPM candidates). The intra-frame prediction mode candidates (MPM candidates) may be composed of an MPM candidate list or an MPM list. In addition, when the MPM is not applied to the current block, the intra-frame prediction mode information may further include residual mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra-frame prediction modes other than the intra-frame prediction mode candidates (MPM candidates). The decoding device may determine the intra-frame prediction mode of the current block based on the intra-frame prediction mode information.

[0122] In addition, the intra-frame prediction type information can be implemented in various forms. For example, the intra-frame prediction type information may include intra-frame prediction type index information indicating one of the intra-frame prediction types. As another example, the intra-frame prediction type information may include at least one of the following: reference sample line information indicating whether MRL is applied to the current block, and if applied, which reference sample line is used (e.g., intra_luma_ref_idx), ISP flag information indicating whether ISP is applied to the current block (e.g., intra_subpartitions_mode_flag), ISP type information indicating the split type of the sub-partition when ISP is applied (e.g., intra_subpartitions_split_flag), flag information indicating whether PDPC is applied, or flag information indicating whether LIP is applied. In addition, the intra-frame prediction type information may include a MIP flag indicating whether matrix-based intra-frame prediction (MIP) is applied to the current block.

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

[0124] For example, it can be indicated based on an MPM flag (e.g., intra_luma_mpm_flag) whether the intra prediction mode applied to the current block is among the MPM candidates (and planar mode) or among the remaining modes. An MPM flag with a value of 1 can indicate that the intra prediction mode of the current block is within the MPM candidates (and planar mode), while an MPM flag with a value of 0 can indicate that the intra prediction mode of the current block is not within the MPM candidates (and planar mode). A non-planar flag with a value of 0 (e.g., intra_luma_not_planar_flag) can indicate that the intra prediction mode of the current block is a planar mode, and a non-planar flag with a value of 1 can indicate that the intra prediction mode of the current block is not a planar mode. The MPM index can be signaled in the form of an mpm_idx or intra_luma_mpm_idx syntax element, and the remaining intra prediction mode information can be signaled in the form of a rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element. For example, the remaining intra prediction mode information may indicate one of the remaining intra prediction modes that is not included in the MPM candidates (and planar mode) among all intra prediction modes by indexing in order of the prediction mode number. The intra prediction mode may be an intra prediction mode of a luminance component (sample). Hereinafter, the intra prediction mode information may include at least one of 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 may be referred to by a variety of terms, such as an MPM candidate list and candModeList.

[0125] When a MIP is applied to a current block, a separate MPM flag (eg, intra_mip_mpm_flag), an MPM index (eg, intra_mip_mpm_idx), and remaining intra prediction mode information (eg, intra_mip_mpm_remainder) for the MIP may be signaled, and a non-planar flag may not be signaled.

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

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

[0128] The encoding device may perform prediction based on various intra prediction modes, and may determine the best intra prediction mode based on rate distortion optimization (RDO) therefrom. In this case, the encoding device may determine the best intra prediction mode by using only the MPM candidates and plane mode configured in the MPM list, or by further using the remaining intra prediction modes and the MPM candidates and plane mode configured in the MPM list. Specifically, for example, if the intra prediction type of the current block is a specific type other than the normal intra prediction type (e.g., LIP, MRL, or ISP), the encoding device may determine the best intra prediction mode by considering only the MPM candidates and plane mode as intra prediction mode candidates for the current block. That is, in this case, the intra prediction mode of the current block may be determined only from the MPM candidates and plane mode, and in this case, encoding / signaling of the MPM flag may not be performed. In this case, the decoding device may infer that the MPM flag is 1 without separately signaling the MPM flag.

[0129] Meanwhile, generally, when the intra prediction mode of the current block is not the planar mode but one of the MPM candidates in the MPM list, the encoding device generates an MPM index (mpm idx) indicating one of the MPM candidates. When the intra prediction mode of the current block is not included in the MPM list, the encoding device generates MPM residual information (remaining intra prediction mode information) indicating the same mode as the intra prediction mode of the current block among the remaining intra prediction modes not included in the MPM list (and the planar mode). The MPM residual information may include, for example, the intra_luma_mpm_remainder syntax element.

[0130] The decoding device obtains intra-frame prediction mode information from the bitstream. As described above, the intra-frame prediction mode information may include at least one of an MPM flag, a non-plane flag, an MPM index, and MPM residual information (residual intra-frame prediction mode information). The decoding device may construct an MPM list. The construction of the MPM list is the same as the MPM list constructed in the encoding device. That is, the MPM list may include intra-frame prediction modes of neighboring blocks, or may further include a specific intra-frame prediction mode according to a predetermined method.

[0131] The decoding device can determine the intra-frame prediction mode of the current block based on the MPM list and the intra-frame prediction mode information. For example, when the value of the MPM flag is 1, the decoding device can (based on the non-planar flag) export the plane mode as the intra-frame prediction mode of the current block, or export the candidate indicated by the MPM index among the MPM candidates in the MPM list as the intra-frame prediction mode of the current block. Here, the MPM candidate may only represent the candidates included in the MPM list, or may include not only the candidates included in the MPM list, but also the plane mode applicable when the value of the MPM flag is 1.

[0132] For another example, when the value of the MPM flag is 0, the decoding device can derive the intra prediction mode indicated by the remaining intra prediction mode information (which can be referred to as mpm remaining information) among the remaining intra prediction modes not included in the MPM list and the plane mode as the intra prediction mode of the current block. At the same time, as another example, when the intra prediction type of the current block is a specific type (such as LIP, MRL or ISP, etc.), the decoding device can derive the candidate indicated by the MPM flag in the plane mode or the MPM list as the intra prediction mode of the current block without parsing / decoding / checking the MPM flag.

[0133] The coding device derives neighboring reference samples of the current block (S610). When intra prediction is applied to the current block, neighboring reference samples to be used for intra prediction of the current block may be derived. The neighboring reference samples of the current block may include samples adjacent to the left boundary of the current block of size nWxnH and a total of 2xnH samples adjacent to the lower left of the current block, samples adjacent to the upper boundary of the current block and a total of 2xnW samples adjacent to the upper right, and samples adjacent to the upper left of the current block. Alternatively, the neighboring reference samples of the current block may include multiple columns of upper neighboring samples and multiple rows of left neighboring samples. In addition, the neighboring reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the lower boundary of the current block, and samples adjacent to the lower right of the current block.

[0134] On the other hand, when MRL is applied (ie, when the value of the MRL index is greater than 0), the neighboring reference sample may be located on line 1 to 2 instead of line 0 adjacent to the current block on the left / upper side, and in this case, the number of neighboring reference samples can be further increased. Meanwhile, when ISP is applied, the neighboring reference sample can be derived in units of sub-partitions.

[0135] The coding device derives a prediction sample by performing intra prediction on the current block (S620). The coding device may derive the prediction sample based on the intra prediction mode / type and the neighboring samples. The coding device may derive the reference sample according to the intra prediction mode of the current block among the neighboring reference samples of the current block, and may derive the prediction sample of the current block based on the reference sample.

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

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

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

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

[0140] The encoding device performs inter prediction on the current block (S700). The encoding device may derive the inter prediction mode and motion information of the current block, and generate a prediction sample of the current block. Here, the inter prediction mode determination process, the motion information derivation process, and the prediction sample generation process may be performed simultaneously, and any one process may be performed earlier than the other processes. For example, the inter prediction unit of the encoding device may include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit, and the prediction mode determination unit may determine the prediction mode of the current block, the motion information derivation unit may derive the motion information of the current block, and the prediction sample derivation unit may derive the prediction sample of the current block. For example, the inter prediction unit of the encoding device may search for a block similar to the current block in a predetermined area (search area) of the reference picture through motion estimation, and derive a reference block with the smallest difference from the current block or equal to or less than a predetermined criterion. Based on this, a reference picture index indicating the reference picture where the reference block is located may be derived, and a motion vector may be derived based on the position difference between the reference block and the current block. The encoding device may determine a mode applied to the current block among various prediction modes. The encoding apparatus may compare the RD costs of various prediction modes and determine an optimal prediction mode for the current block.

[0141] For example, when the skip mode or merge mode is applied to the current block, the encoding device may configure a merge candidate list to be described below, and derive a reference block having the smallest difference with the current block or being 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, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to the decoding device. The motion information of the current block may be derived by using the motion information of the selected merge candidate.

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

[0143] The encoding apparatus may derive residual samples based on the prediction samples (S710). The encoding apparatus may derive residual samples by comparing original samples and prediction samples of the current block.

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

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

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

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

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

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

[0150] Specifically, the decoding apparatus may determine a prediction mode of the current block based on the received prediction information (S800). The decoding apparatus may determine which inter prediction mode to apply to the current block based on prediction mode information in the prediction information.

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

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

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

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

[0155] The decoding device may generate a prediction sample for the current block based on the motion information of the current block (S820). In this case, a reference picture may be derived based on a reference picture index of the current block, and a prediction sample of the current block may be derived by using a sample of the reference block indicated by a motion vector of the current block on the reference picture. In this case, in some cases, a prediction sample filtering process for all or some prediction samples of the current block may be further performed.

[0156] For example, the inter-frame prediction unit of the decoding device may include a prediction mode determination unit, a motion information export unit and a prediction sample export unit, and the prediction mode determination unit can determine the prediction mode of the current block based on the received prediction mode information, the motion information export unit can export the motion information (motion vector and / or reference picture index) of the current block based on the information about the received motion information, and the prediction sample export unit can export the prediction sample of the current block.

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

[0158] Fig. 9 The inter-frame prediction process is schematically illustrated.

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

[0160] refer to Fig. 9 , the coding device determines the inter prediction mode of the current block (S900). Various inter prediction modes may be used for the prediction of the current block in the picture. For example, various modes such as merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, sub-block merge mode, merge with MVD (MMVD) mode, and historical motion vector prediction (HMVP) mode may be used. Decoder-side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, dual prediction with CU-level weights (BCW), and bidirectional optical flow (BDOF) may be further used as additional modes. Affine mode may also be referred to as affine motion prediction mode. MVP mode may also be referred to as advanced motion vector prediction (AMVP) mode. In this article, 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 a merge candidate of a merge / skip mode, or to an MVP candidate of an MVP mode. If the HMVP candidate is used as a motion information candidate for a merge mode or a skip mode, the HMVP candidate may be referred to as an HMVP merge candidate.

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

[0162] The coding apparatus derives motion information of a current block (S910). The motion information may be derived based on an inter prediction mode.

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

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

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

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

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

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

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

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

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

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

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

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

[0175] [Table 1]

[0176]

[0177]

[0178]

[0179]

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

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

[0182] [Table 2]

[0183]

[0184]

[0185]

[0186] [Table 3]

[0187]

[0188]

[0189]

[0190]

[0191]

[0192]

[0193] [Table 4]

[0194]

[0195]

[0196]

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

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

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

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

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

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

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

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

[0205] [Equation 1]

[0206]

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

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

[0209] [Equation 2]

[0210]

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

[0212] [Equation 3]

[0213]

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

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

[0216] [Equation 4]

[0217]

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

[0219] [Equation 5]

[0220]

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

[0222] [Table 5]

[0223]

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

[0225] In addition, if the value of the transform skip flag is 1, as shown in Table 4, the syntax elements sb_coded_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag, par_level_flag, and / or abs_remainder of the residual coefficient of the transform block may be parsed, and the residual coefficient may be derived based on the syntax elements. In this case, the syntax elements may be parsed sequentially, and the parsing order may be changed. In addition, abs_level_gtx_flag may represent abs_level_gt1_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag, and / or abs_level_gt9_flag. For example, abs_level_gtx_flag[n][j] may be a flag indicating whether the absolute value or level (value) of the transform coefficient at the scan position n is greater than (j<<1)+1. The condition (j<<1)+1 may optionally be replaced with a specific threshold value such as a first threshold value, a second threshold value, or the like.

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

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

[0228] [Table 6]

[0229]

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

[0231] [Equation 6]

[0232]

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

[0234] Fig.11 An example of transform coefficients in a 4x4 block is shown.

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

[0236] At the same time, 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. In addition, the decoding device can decode the syntax element to derive the binarized value (e.g., binarized bin) of the syntax element, and can debinarize 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-order exponential Golomb (EGk) binarization process, a finite k-order exponential Golomb (finite EGk), a fixed length (FL) binarization process, etc. In addition, the debinarization process can represent a process performed based on a TR binarization process, an EGk binarization process, or a FL binarization process to derive the value of a syntax element.

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

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

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

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

[0241] [Equation 7]

[0242]

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

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

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

[0246] [Table 7]

[0247]

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

[0249] In addition, 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 may be derived as follows.

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

[0251] [Equation 8]

[0252]

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

[0254] The suffix of the TR bin string (ie, the suffix bin string) may be derived based on the FL binarization process for suffixVal, and the value cMax of suffixVal is (1 << cRiceParam)-1.

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

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

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

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

[0259] [Table 8]

[0260]

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

[0262] [Equation 9]

[0263]

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

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

[0266] [Table 9]

[0267]

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

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

[0270] [Table 10]

[0271]

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

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

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

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

[0276] [Table 11]

[0277]

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

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

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

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

[0282] [Table 12]

[0283]

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

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

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

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

[0288] [Equation 10]

[0289]

[0290] The index of the bin used for FL binarization may be a method of using values ​​that increase sequentially from the most significant bit to the least significant bit. For example, the bin index associated with the most significant bit may be binIdx=0.

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

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

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

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

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

[0296] [Equation 11]

[0297]

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

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

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

[0301] [Equation 12]

[0302]

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

[0304] If the prefix bin string is identical to a bit string with all bits set to 1 and a bit length of 6, then the suffix bin string of the bin string of abs_remainder[n] may 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 input of the Rice parameter derivation process can be the color component index cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), log2TbWidth as the base 2 logarithm of the width of the transform block, and log2TbHeight as the base 2 logarithm of the height of the transform block. The luma position (x0, y0) can indicate the upper left sample of the current luma transform block based on the upper left luma sample of the picture. In addition, the output of the Rice parameter derivation process can be the Rice parameter cRiceParam.

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

[0308] [Table 13]

[0309]

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

[0311] [Table 14]

[0312]

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

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

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

[0316] [Equation 13]

[0317]

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

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

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

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

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

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

[0324] [Equation 14]

[0325]

[0326] Meanwhile, binarization for dec_abs_level[n] (ie, bin string for dec_abs_level[n]) may be a concatenation of a prefix bin string and a suffix bin string if a suffix bin string exists. In addition, if a suffix bin string does not exist, the bin string for dec_abs_level[n] may be a prefix bin string.

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

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

[0329] [Equation 15]

[0330]

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

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

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

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

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

[0336] [Table 15]

[0337]

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

[0339] [Table 16]

[0340]

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

[0342] [Equation 16]

[0343]

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

[0345] [Equation 17]

[0346]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0365] [Table 17]

[0366]

[0367] [Table 18]

[0368]

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

[0370] 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 a simplified residual data coding structure is executed, in order to encode / decode the residual coefficients of the level map, it is proposed that a process of not performing the correction encoding / decoding level is performed. That is, for example, a method of deriving the residual coefficients of the current block using a simplified residual data coding structure without deriving the residual coefficients through level mapping when using bins for all context coding of the current block can be proposed. The simplified residual data coding structure can be as described above. For example, when using bins for all context coding of 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.

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

[0372] The encoding device constructs a motion information candidate list based on the neighboring blocks of the current block (S1500). The encoding device may construct the motion information candidate list based on the neighboring blocks of the current block. For example, the encoding device may derive the motion information of the neighboring blocks of the current block as motion information candidates, and may construct a motion information candidate list including the motion information candidates. For example, the neighboring blocks may include spatial neighboring blocks and temporal neighboring blocks. The motion information of the neighboring blocks may include a reference picture index and / or a motion vector of the neighboring blocks. Here, for example, the motion information candidate list may indicate the above-mentioned merge candidate list, and the motion information candidate may indicate the above-mentioned merge candidate, etc.

[0373] The encoding device selects a motion information candidate from among the motion information candidates in the motion information candidate list (S1510). The encoding device may select one motion information candidate from among the motion information candidates in the motion information candidate list. For example, the encoding device may derive a reference block whose difference with the current block is the minimum value or less than a specific standard among the reference blocks indicated by the motion information candidates included in the motion information candidate list. In this case, the encoding device may select a motion information candidate associated with the derived reference block.

[0374] The encoding device derives motion information of the current block based on the selected motion information candidate (S1520). The encoding device may derive motion information of the current block based on the selected motion information candidate. For example, the encoding device may derive the motion vector and / or reference picture index of the selected motion information candidate as the motion vector and / or reference picture index of the current block.

[0375] The encoding apparatus derives a prediction sample of the current block based on the motion information (S1530). For example, the encoding apparatus may derive a prediction sample of the current block based on the motion information.

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

[0377] The encoding device derives a current residual coefficient based on the residual sample (S1550). For example, the encoding device may derive a current residual coefficient of the current block based on the residual sample. For example, the encoding device may determine whether to apply a transform to the current block. That is, the encoding device may determine whether to apply a transform to the residual sample of the current block. The encoding device may determine whether to apply a transform to the current block in consideration of coding efficiency. For example, the encoding device may determine not to apply a transform to the current block. A block to which a transform is not applied may be referred to as a transform skip block. That is, for example, the current block may be a transform skip block.

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

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

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

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

[0382] [Table 19]

[0383]

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

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

[0386] For example, a first residual coefficient that is one of the residual coefficients before the current residual coefficient may be derived by performing level mapping. For example, an absolute level of the first residual coefficient may be derived based on a residual syntax element for the first residual coefficient, and a maximum value among an absolute level of a left residual coefficient of the first residual coefficient and an absolute level of an upper residual coefficient of the residual coefficient may be derived. Thereafter, a modified absolute level of the first residual coefficient may be derived by comparing the absolute level of the first residual coefficient with the maximum value. For example, if the absolute level of the first residual coefficient and the maximum value are equal to each other, one (1) may be derived as the modified absolute level; if the absolute level of the first residual coefficient is not equal to the maximum value and the absolute level of the first residual coefficient is less than the maximum value, a value obtained by adding 1 to the absolute level of the first residual coefficient may be derived as the modified absolute level; and if the absolute level of the first residual coefficient is not equal to the maximum value and the absolute level of the first residual coefficient is not less than the maximum value, the absolute level of the first residual coefficient may be derived as the modified absolute level. The first residual coefficient may be one of the residual coefficients before the current residual coefficient. The residual information of the current block may include a residual syntax element for the first residual coefficient.

[0387] The encoding device encodes the image information including the motion information candidate index indicating the selected motion information candidate and the residual syntax element for the current residual coefficient (S1560). The encoding device may encode the image information including the motion information candidate index indicating the selected motion information candidate and the residual syntax element for the current residual coefficient. For example, the encoding device may generate and encode prediction related information for the current block. The prediction related information may include the motion information candidate index. In addition, the encoding device may encode the residual information including the residual syntax element for the current residual coefficient of the current block. The image information may include residual information. For example, the encoding device may encode the image information including the residual information and output the encoded image information in the form of a bit stream. The bit stream may be sent to the decoding device through a network or a storage medium.

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

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

[0390] And, for example, the residual information may include a transform skip flag for the current block. The transform skip flag may indicate whether a transform is applied to the current block. That is, the transform skip flag may indicate whether a transform is applied to the residual coefficients of the current block. The syntax element indicating the transform skip flag may be transform_skip_flag. For example, when the value of the transform skip flag is 0, the transform skip flag may indicate that a transform is not applied to the current block, and when the value of the transform skip flag is 1, the transform skip flag may indicate that a transform is applied to the current block. For example, when the current block is a transform skip block, the value of the transform skip flag for the current block may be 1.

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

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

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

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

[0395] At the same time, the bit stream can be sent to the decoding device via a network or a (digital) storage medium. Here, the network can include a broadcast network and / or a communication network, and the digital storage medium can include various storage media, such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[0396] Fig.16 An encoding device for performing an image encoding method according to the present disclosure is briefly illustrated. Fig.15 The method disclosed in can be Fig.16 Specifically, for example, Fig.16 The predictor of the encoding device can perform Fig.15 Steps S1500 to S1530; Fig.16 The residual processor of the encoding device may perform Fig.15 S1540 to S1550; and Fig.16 The entropy encoder of the encoding device can perform Fig.15 In addition, although not shown, a process of generating a reconstructed picture and reconstructed samples for the current block based on the prediction samples and residual samples for the current block may be performed by an adder of the encoding device.

[0397] Fig.17 The following briefly illustrates an image decoding method performed by a decoding device according to the present disclosure. Fig.17 The method disclosed in can be Figure 3 Specifically, for example, Fig.17 S1700 may be performed by an entropy decoder of a decoding device; S1710 to S1730 may be performed by a predictor of a decoding device; S1740 to S1750 may be performed by a residual processor of a decoding device; and S1760 may be performed by an adder of a decoding device.

[0398] The decoding device obtains image information including motion information candidate index and residual information through a bitstream (S1700). The decoding device may obtain image information including residual information and prediction related information for the current block through a bitstream. For example, the image information may include prediction related information for the current block. For example, the prediction related information may include a motion information candidate index. The motion information candidate index may indicate a motion information candidate among motion information candidates in a motion information candidate list of the current block. Here, for example, the motion information candidate index may represent the above-mentioned merge index, etc. In addition, for example, the motion information candidate list may indicate the above-mentioned merge candidate list, and the motion information candidate may indicate the above-mentioned merge candidate, etc.

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

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

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

[0402] And, for example, the residual information may include a transform skip flag for the current block. The transform skip flag may indicate whether a transform is applied to the current block. That is, the transform skip flag may indicate whether a transform is applied to the residual coefficients of the current block. The syntax element indicating the transform skip flag may be transform_skip_flag. For example, when the value of the transform skip flag is 0, the transform skip flag may indicate that a transform is not applied to the current block, and when the value of the transform skip flag is 1, the transform skip flag may indicate that a transform is applied to the current block. For example, when the current block is a transform skip block, the value of the transform skip flag for the current block may be 1.

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

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

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

[0406] The decoding device constructs a motion information candidate list based on the neighboring blocks of the current block (S1710). The decoding device may construct the motion information candidate list based on the neighboring blocks of the current block. For example, the decoding device may derive the motion information of the neighboring blocks of the current block as motion information candidates, and may construct the motion information candidate list including the motion information candidates. For example, the neighboring blocks may include spatial neighboring blocks and temporal neighboring blocks. The motion information of the neighboring blocks may include reference picture indexes and / or motion vectors of the neighboring blocks.

[0407] The decoding device derives motion information of the current block based on the motion information candidate indicated by the motion information candidate index among the motion information candidates in the motion information candidate list (S1720). The decoding device may derive the motion information of the current block based on the motion information candidate indicated by the motion information candidate index. For example, the decoding device may derive the reference picture index and / or motion vector of the motion information candidate indicated by the motion information candidate index as the reference picture index and / or motion vector of the current block.

[0408] The decoding apparatus derives a prediction sample of the current block based on the motion information (S1730). For example, the decoding apparatus may derive a prediction sample of the current block based on the motion information.

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

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

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

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

[0413] For example, a first residual coefficient that is one of the residual coefficients before the current residual coefficient may be derived by performing level mapping. For example, an absolute level of the first residual coefficient may be derived based on a residual syntax element for the first residual coefficient, and a maximum value among an absolute level of a left residual coefficient of the first residual coefficient and an absolute level of an upper residual coefficient of the residual coefficient may be derived. Thereafter, a modified absolute level of the first residual coefficient may be derived by comparing the absolute level of the first residual coefficient with the maximum value. For example, if the absolute level of the first residual coefficient and the maximum value are equal to each other, one (1) may be derived as the modified absolute level; if the absolute level of the first residual coefficient is not equal to the maximum value and the absolute level of the first residual coefficient is less than the maximum value, a value obtained by adding 1 to the absolute level of the first residual coefficient may be derived as the modified absolute level; and if the absolute level of the first residual coefficient is not equal to the maximum value and the absolute level of the first residual coefficient is not less than the maximum value, the absolute level of the first residual coefficient may be derived as the modified absolute level. The first residual coefficient may be one of the residual coefficients before the current residual coefficient. The residual information may include a residual syntax element for the first residual coefficient.

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

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

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

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

[0418] Fig.18 A decoding device for performing an image decoding method according to the present disclosure is briefly illustrated. Fig.17 The method disclosed in can be Fig.18 Specifically, for example, Fig.18 The entropy decoder of the decoding device can perform Fig.17 S1700; Fig.18 The predictor of the decoding device can perform Fig.17 S1710 to S1730; Fig.18 The residual processor of the decoding device may perform Fig.17 S1740 to S1750; and Fig.18 The adder of the decoding device can perform Fig.17 The S1760.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Claims

1. A method for decoding an image performed by a decoding device, the method comprising: Obtaining image information including motion information candidate indexes and residual information through a bitstream; Based on the neighboring blocks of the current block, a motion information candidate list is constructed; deriving the motion information of the current block based on the motion information candidate indicated by the motion information candidate index among the motion information candidates in the motion information candidate list; Based on the motion information, deriving a prediction sample of the current block; deriving a current residual coefficient based on a residual syntax element for the current residual coefficient in the current block; deriving residual samples based on the current residual coefficients; as well as Based on the prediction samples and the residual samples, deriving reconstructed samples of the current block, The residual information includes a residual syntax element for the current residual coefficient, wherein the number of residual syntax elements for context coding of residual coefficients before the current residual coefficient among the residual coefficients of the current block is equal to the maximum number of bins for context coding of the current block, The residual syntax element for the current residual coefficient includes coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, wherein the absolute level of the current residual coefficient is derived as a value indicated by the coefficient level information for the current residual coefficient, and the sign of the current residual coefficient is derived as a sign indicated by the sign flag, wherein the current residual coefficient is derived without performing level mapping, wherein a first residual coefficient is derived by performing the level mapping, and The first residual coefficient is one of the residual coefficients before the current residual coefficient, wherein, based on the residual syntax element for the first residual coefficient, the absolute level of the first residual coefficient is derived, the maximum value among the absolute level of the left residual coefficient of the first residual coefficient and the absolute level of the upper residual coefficient of the first residual coefficient is derived, and the modified absolute level of the first residual coefficient is derived by comparing the absolute level of the first residual coefficient with the maximum value.

2. The image decoding method according to claim 1, wherein: The bins used for the context coding of the current block are all used as bins of residual syntax elements used for context coding of the residual coefficient before the current residual coefficient.

3. A method for encoding an image performed by an encoding device, the method comprising: Building a motion information candidate list based on neighboring blocks of the current block; selecting a motion information candidate from among the motion information candidates in the motion information candidate list; deriving motion information of the current block based on the selected motion information candidate; Based on the motion information, deriving a prediction sample of the current block; Based on the prediction samples, deriving residual samples of the current block; Based on the residual samples, deriving current residual coefficients; as well as encoding picture information including a motion information candidate index indicating the selected motion information candidate and a residual syntax element for the current residual coefficient, wherein the number of residual syntax elements for context coding of residual coefficients before the current residual coefficient among the residual coefficients of the current block is equal to the maximum number of bins for context coding of the current block, The residual syntax element for the current residual coefficient includes coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, The coefficient level information indicates the absolute value of the coefficient level of the current residual coefficient, and the sign flag of the current residual coefficient indicates the sign of the current residual coefficient. wherein the current residual coefficient is encoded without performing level mapping, wherein the first residual coefficient is encoded by performing the level mapping, and The first residual coefficient is one of the residual coefficients before the current residual coefficient, wherein, based on the residual syntax element for the first residual coefficient, the absolute level of the first residual coefficient is derived, the maximum value among the absolute level of the left residual coefficient of the first residual coefficient and the absolute level of the upper residual coefficient of the first residual coefficient is derived, and the modified absolute level of the first residual coefficient is derived by comparing the absolute level of the first residual coefficient with the maximum value.

4. The image encoding method according to claim 3, wherein: The bins used for the context coding of the current block are all used as bins of residual syntax elements used for context coding of the residual coefficient before the current residual coefficient.

5. A non-transitory computer-readable storage medium storing a bitstream generated by a method, the method comprising: Building a motion information candidate list based on neighboring blocks of the current block; selecting a motion information candidate from among the motion information candidates in the motion information candidate list; deriving motion information of the current block based on the selected motion information candidate; Based on the motion information, deriving a prediction sample of the current block; Based on the prediction samples, deriving residual samples of the current block; Based on the residual samples, deriving current residual coefficients; encoding picture information including a motion information candidate index indicating the selected motion information candidate and a residual syntax element for the current residual coefficient, generating said bitstream including said image information, wherein the number of residual syntax elements for context coding of residual coefficients before the current residual coefficient among the residual coefficients of the current block is equal to the maximum number of bins for context coding of the current block, The residual syntax element for the current residual coefficient includes coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, The coefficient level information indicates the absolute value of the coefficient level of the current residual coefficient, and the sign flag of the current residual coefficient indicates the sign of the current residual coefficient. wherein the current residual coefficient is encoded without performing level mapping, wherein the first residual coefficient is encoded by performing the level mapping, The first residual coefficient is one of the residual coefficients before the current residual coefficient, wherein a maximum value among the absolute level of the left residual coefficient of the first residual coefficient and the absolute level of the upper residual coefficient of the first residual coefficient is derived, and a modified absolute level of the first residual coefficient is derived by comparing the absolute level of the first residual coefficient with the maximum value, and the modified absolute level of the first residual coefficient is encoded based on the residual syntax element for the first residual coefficient.

6. A method for transmitting image data, the method comprising: Building a motion information candidate list based on neighboring blocks of the current block; selecting a motion information candidate from among the motion information candidates in the motion information candidate list; deriving motion information of the current block based on the selected motion information candidate; Based on the motion information, deriving a prediction sample of the current block; Based on the prediction samples, deriving residual samples of the current block; Based on the residual samples, deriving current residual coefficients; encoding picture information including a motion information candidate index indicating the selected motion information candidate and a residual syntax element for the current residual coefficient to generate a bitstream; as well as sending said data comprising said bit stream, wherein the number of residual syntax elements for context coding of residual coefficients before the current residual coefficient among the residual coefficients of the current block is equal to the maximum number of bins for context coding of the current block, The residual syntax element for the current residual coefficient includes coefficient level information for the current residual coefficient and a sign flag of the current residual coefficient, The coefficient level information indicates the absolute value of the coefficient level of the current residual coefficient, and the sign flag of the current residual coefficient indicates the sign of the current residual coefficient. wherein the current residual coefficient is encoded without performing level mapping, wherein the first residual coefficient is encoded by performing the level mapping, and The first residual coefficient is one of the residual coefficients before the current residual coefficient, wherein a maximum value among the absolute level of the left residual coefficient of the first residual coefficient and the absolute level of the upper residual coefficient of the first residual coefficient is derived, and a modified absolute level of the first residual coefficient is derived by comparing the absolute level of the first residual coefficient with the maximum value, and the modified absolute level of the first residual coefficient is encoded based on the residual syntax element for the first residual coefficient.