Image decoding method and device for residual data coding in image coding system

By employing the Transform Skip Residual Compilation (TSRC) method in the image compilation system, the residual data compilation structure is optimized, and a syntax element-priority compilation order is used, which solves the problem of high transmission and storage costs for high-resolution images and improves compilation efficiency.

CN119299726APending Publication Date: 2025-01-10LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411420861.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-08-31
Filing Date
2020-08-31
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Existing technologies, when transmitting and storing high-resolution, high-quality images, result in high transmission and storage costs due to the increased amount of information, necessitating improvements in image processing efficiency.

Method used

By employing the Transform Skip Residual Compilation (TSRC) method in the image compilation system, the residual data compilation structure is optimized. The compilation order prioritizes syntax elements rather than coefficient positions, reducing the number of bins for context compilation and lowering compilation complexity.

Benefits of technology

It improves the efficiency of residual compilation, reduces the complexity of bypass compilation, and improves the overall compilation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299726A_ABST
    Figure CN119299726A_ABST
Patent Text Reader

Abstract

The invention relates to an image decoding method for residual data coding in an image coding system and an apparatus therefor. An image decoding method performed by a decoding device according to the present document comprises the steps of: acquiring a syntax element for first to nth transform coefficients of a current block, wherein the syntax element is a syntax element of a first residual data coding structure according to TSRC; and acquiring a syntax element for the (n + 1) th transform coefficient to the last transform coefficient of the current block, the syntax element being a syntax element of a second residual data compilation structure according to the TSRC, wherein the number of syntax elements for context coding of the first to n-th transform coefficients is equal to the maximum number of bins for context coding of the current block, and the syntax elements according to the second residual data coding structure include coefficient level information and symbol flags for the transform coefficients.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with application number 202080068572.7 (PCT / KR2020 / 011616), which was submitted to the China Patent Office on March 30, 2022, with an international application date of August 31, 2020, and the invention name is "Image decoding method and device for residual data compilation in image compilation system". Technical Field

[0002] The present disclosure relates to an image coding technology, and more specifically, to an image coding method and an apparatus thereof, which are used to code residual data according to the TSRC of a current block in an image coding system, and to code subsequent residual data according to a simplified residual data coding structure when all bins for maximum available context coding of the current block are used. 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 technical purpose of the present disclosure is to provide a method and device 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 syntax elements for a first transform coefficient to an nth transform coefficient of a current block, wherein the syntax elements are syntax elements of a first residual data coding structure according to transform skip residual coding (TSRC), obtaining syntax elements for an n+1th transform coefficient to a last transform coefficient of the current block, wherein the syntax elements are syntax elements of a second residual data coding structure according to TSRC, deriving transform coefficients of the current block based on syntax elements according to the first residual data coding structure and syntax elements according to the second residual data coding structure, deriving residual samples of the current block based on the transform coefficients, and generating a reconstructed picture based on the residual samples, wherein the number of syntax elements for context coding of the first transform coefficient to the nth transform coefficient is equal to the maximum number of bins of context coding of the current block, and wherein the syntax elements according to the second residual data coding structure include coefficient level information and sign flags for the transform coefficients.

[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 syntax elements for the first transform coefficient to the nth transform coefficient of the current block, wherein the syntax elements are syntax elements of a first residual data coding structure according to transform skip residual coding (TSRC), and obtain syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block, wherein the syntax elements are syntax elements of a second residual data coding structure according to TSRC; a residual processor configured to derive the transform coefficient of the current block based on the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure, and derive the residual samples of the current block based on the transform coefficients; and an adder configured to generate a reconstructed picture based on the residual samples.

[0011] According to another embodiment of this document, there is provided an image encoding method performed by an encoding device. The method includes: deriving a transform coefficient for a current block; generating a syntax element for a first transform coefficient to an nth transform coefficient of the current block, wherein the syntax element is a syntax element of a first residual data coding structure according to transform skip residual coding (TSRC), generating a syntax element for an n+1th transform coefficient to a last transform coefficient of the current block, wherein the syntax element is a syntax element of a second residual data coding structure according to TSRC, and encoding image information including syntax elements according to the first residual data coding structure and syntax elements according to the second residual data coding structure, wherein the number of syntax elements for context coding of the first transform coefficient to the nth transform coefficient is equal to the maximum number of bins of context coding of the current block, and wherein the syntax element according to the second residual data coding structure includes coefficient level information and a sign flag for the transform coefficient.

[0012] According to another embodiment of this document, an image encoding device is provided. The encoding device includes: a residual processor configured to derive a transform coefficient for a current block; and an entropy encoder configured to generate syntax elements for a first transform coefficient to an nth transform coefficient of the current block, wherein the syntax elements are syntax elements of a first residual data coding structure according to transform skip residual coding (TSRC), generate syntax elements for an n+1th transform coefficient to a last transform coefficient of the current block, wherein the syntax elements are syntax elements of a second residual data coding structure according to TSRC, and encode image information including syntax elements according to the first residual data coding structure and syntax elements according to the second residual data coding structure, wherein the number of syntax elements for context coding of the first transform coefficient to the nth transform coefficient is equal to the maximum number of bins of context coding of the current block, and wherein the syntax elements according to the second residual data coding structure include coefficient level information and sign flags for the transform coefficients.

[0013] According to another embodiment of this document, a non-transitory computer-readable storage medium storing a bitstream is provided, the bitstream including image information that enables an image decoding method to be performed. In the non-transitory computer-readable storage medium, the image decoding method includes: obtaining syntax elements for a first transform coefficient to an nth transform coefficient of a current block, wherein the syntax elements are syntax elements of a first residual data coding structure according to transform skip residual coding (TSRC), obtaining syntax elements for an n+1th transform coefficient to a last transform coefficient of the current block, wherein the syntax elements are syntax elements of a second residual data coding structure according to TSRC, deriving a transform coefficient of the current block based on the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure, deriving a residual sample of the current block based on the transform coefficient, and generating a reconstructed picture based on the residual sample, wherein the number of context-coded syntax elements of the first transform coefficient to the nth transform coefficient is equal to the maximum number of context-coded bins of the current block, and wherein the syntax elements according to the second residual data coding structure include coefficient level information and a sign flag for the transform coefficient.

[0014] Beneficial Effects

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

[0016] According to the present disclosure, when the maximum number of context-coded bins for the current block is consumed in TSRC, syntax elements according to a simplified residual data coding structure can be signaled, and by doing so, the coding complexity of bypass-coded syntax elements is reduced and the overall residual coding efficiency can be improved.

[0017] According to the present disclosure, as the coding order of bypass-coded syntax elements, an order of syntax element priority may be used, and by doing so, the coding efficiency of bypass-coded syntax elements may be improved, and the overall residual coding efficiency may be improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

[0023] Figure 6 An example is illustrated in which syntax elements are compiled in TSRC.

[0024] Figure 7 Another example in which syntax elements are coded in TSRC is illustrated.

[0025] Figure 8 Another example in which syntax elements are coded in TSRC is illustrated.

[0026] Fig. 9 An example is shown in which bypass-coded syntax elements are coded in a TSRC in a syntax element-first coding order rather than a coefficient position-first coding order.

[0027] Fig.10 An example is shown in which bypass-coded syntax elements are coded in a TSRC in a syntax element-first coding order rather than a coefficient position-first coding order.

[0028] Fig.11 An example is illustrated in which syntax elements are coded in a simplified residual data coding structure.

[0029] Fig.12 An example of coding bypass-coded syntax elements in a simplified residual data coding structure in a syntax element-first coding order rather than a coefficient position-first coding order is illustrated.

[0030] Fig.13a and Fig.13b An embodiment in which syntax elements are coded in a simplified residual data coding structure is illustrated.

[0031] Fig.14a and Fig.14b An example of coding bypass-coded syntax elements in a simplified residual data coding structure in a syntax element-first coding order rather than a coefficient position-first coding order is illustrated.

[0032] Fig.15 An embodiment in which syntax elements are coded in a simplified residual data coding structure is illustrated.

[0033] Fig.16 An example of coding bypass-coded syntax elements in a simplified residual data coding structure in a syntax element-first coding order rather than a coefficient position-first coding order is illustrated.

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

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

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

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

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

[0039] 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, quantities, 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, quantities, steps, operations, elements, components, or combinations thereof is not excluded.

[0040] 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 the combined elements and / or the divided elements belong to the present disclosure without departing from the concept of the present disclosure.

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

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

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

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

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

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

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

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

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

[0050] The present disclosure relates to video / image coding. For example, the methods / embodiments 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.).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0065] In some cases, unit can be used interchangeably with terms such as block or region. In general, an M×N block can represent a set of samples or transform coefficients consisting of M columns and N rows. Samples can generally represent pixels or pixel values, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chrominance component. Sample can be used as a term corresponding to one picture (or image) of a pixel or pixel.

[0066] 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 based on the current block or CU. As described later in the description of each prediction mode, the predictor can generate various information related to the prediction, such as prediction mode information, and send the generated information to the entropy encoder 240. Information about the prediction can be encoded in the entropy encoder 240 and output in the form of a bitstream.

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

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

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

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

[0071] 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. Encoded 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.

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

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

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

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

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

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

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

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

[0080] 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 corresponding to each syntax element in a 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.

[0081] 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 perform dequantization on the quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficients.

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

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

[0084] The predictor 330 may generate a prediction signal based on various prediction methods described below. For example, the predictor may not only apply intra prediction or inter prediction to predict a block, but may also apply intra prediction and inter prediction at the same time. This may be referred to as combined inter and intra prediction (CIIP). In addition, the predictor may predict a block based on an intra block copy (IBC) prediction mode or a palette mode. The IBC prediction mode or the palette mode may be used for content image / video coding of games, etc., such as screen content coding (SCC). IBC basically performs prediction in the current picture, but 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 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.

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

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

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

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

[0089] In addition, luma mapping with chroma scaling (LMCS) may be applied in the picture decoding process.

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

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

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

[0093] In the present disclosure, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When quantization / dequantization 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.

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

[0095] As described above, the encoding device can perform various encoding methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC), and context adaptive binary arithmetic coding (CABAC). In addition, the decoding device can decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the value of the syntax element required for image reconstruction and the quantized value of the transform coefficient related to the residual.

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

[0097] Figure 4Context-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 used for a syntax element may indicate the value of the syntax element.

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

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

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

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

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

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

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

[0105] [Table 1]

[0106]

[0107]

[0108]

[0109]

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

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

[0112] [Table 2]

[0113]

[0114]

[0115]

[0116] [Table 3]

[0117]

[0118]

[0119]

[0120]

[0121]

[0122]

[0123] [Table 4]

[0124]

[0125]

[0126]

[0127] 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).

[0128] 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).

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

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

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

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

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

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

[0135] [Equation 1]

[0136]

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

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

[0139] [Equation 2]

[0140]

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

[0142] [Equation 3]

[0143]

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

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

[0146] [Equation 4]

[0147]

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

[0149] [Equation 5]

[0150]

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

[0152] [Table 5]

[0153]

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

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

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

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

[0158] [Table 6]

[0159]

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

[0161] [Equation 6]

[0162]

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

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

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

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

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

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

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

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

[0171] [Equation 7]

[0172]

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

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

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

[0176] [Table 7]

[0177]

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

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

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

[0181] [Equation 8]

[0182]

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

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

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

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

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

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

[0189] [Table 8]

[0190]

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

[0192] [Equation 9]

[0193]

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

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

[0196] [Table 9]

[0197]

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

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

[0200] [Table 10]

[0201]

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

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

[0204] 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).

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

[0206] [Table 11]

[0207]

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

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

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

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

[0212] [Table 12]

[0213]

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

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

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

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

[0218] [Equation 10]

[0219]

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

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

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

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

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

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

[0226] [Equation 11]

[0227]

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

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

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

[0231] [Equation 12]

[0232]

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

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

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

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

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

[0238] [Table 13]

[0239]

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

[0241] [Table 14]

[0242]

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

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

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

[0246] [Equation 13]

[0247]

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

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

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

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

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

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

[0254] [Equation 14]

[0255]

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

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

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

[0259] [Equation 15]

[0260]

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

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

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

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

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

[0266] [Table 15]

[0267]

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

[0269] [Table 16]

[0270]

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

[0272] [Equation 16]

[0273]

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

[0275] [Equation 17]

[0276]

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

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

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

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

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

[0282] Meanwhile, in residual data coding of a transform skip block (ie, a transform skip block) to which a syntax element is applied, when a syntax element is bypass coded, the present disclosure proposes a method for coding bypass coded bins by grouping bypass coded bins for each syntax element.

[0283] As a proposed embodiment, the number of context coded bins available for transform skipped residual coding (i.e., transform skipped residual coding (TSRC) described above) in a TU can be limited to a specific threshold, and when all context coded bins available for the TU are consumed, and then, the syntax elements of the TU are coded as bypass bins, a method of using a syntax element-first coding order instead of a coefficient position-first existing coding order is proposed.

[0284] In particular, for example, in a conventional TSRC, coding of syntax elements sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], par_level_flag, abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], abs_level_gtx_flag[n][4], and / or abs_remainder is included. The above syntax elements may be coded in the order shown in the following figure.

[0285] Figure 6 An example of coding syntax elements in TSRC is shown.

[0286] Meanwhile, in the present disclosure, a layer may mean a group / unit in which syntax elements are continuously compiled in a single repetition sentence, and may be described in the same meaning in other elements below. Figure 6 In the example, “sig” may represent sig_coeff_flag, “sign” may represent coeff_sign_flag, gt0 may represent abs_level_gtx_flag[n][0], “par” may represent par_level_flag, gt1 may represent abs_level_gtx_flag[n][1], gt2 may represent abs_level_gtx_flag[n][2], gt3 may represent abs_level_gtx_flag[n][3], gt4 may represent abs_level_gtx_flag[n][4], and “rem” may represent abs_remainder.

[0287] For example, according to Figure 6 In the case of the TSRC of the present embodiment shown in FIG. 1 , the syntax elements may be coded in the order of priority of the position of the coefficients in a single layer. That is, for example, referring to Figure 6 , in the first layer, a specific coefficient (e.g., Coeff 0 ) of sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], and par_level_flag, and the next coefficient (for example, Coeff 1 ) is encoded. Later, for example, in the second layer, for a specific coefficient (e.g., Coeff 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] are encoded, and the next coefficient (e.g., Coeff 1 ) 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] of the sub-block. Then, in the third layer, all coefficients of the sub-block (e.g., from Coeff 0 To Coeff n-1 ) to compile abs_remainder.

[0288] Meanwhile, in the TSRC of the VVC standard, as described above, the maximum number of bins available for context coding is limited to a specific threshold value for residual data coding (e.g., RemCcbs or MaxCcbs represented in Table 4), and the specific threshold value may be derived based on the number of samples included in the transform block or the width and / or height of the transform block, etc. For example, the specific threshold value may be derived as represented by the following equation.

[0289] [Equation 18]

[0290]

[0291] Here, "c" can represent any real value. In the present disclosure, the c value is not limited to a specific value. For example, c can have an integer value such as 2 or a decimal value such as 1.5, 1.75, or 1.25. In addition, for example, a threshold value that limits the maximum number of available context-coded bins can also be derived based on whether the transform block is a chroma block and the number of samples included in the transform block and the width and / or height of the transform block. In addition, the threshold value (RemCcbs) can be initialized in units of transform blocks, and the threshold value can be reduced by as much as the number of context-coded bins for coding of syntax elements used for residual data coding.

[0292] Meanwhile, in TSRC, syntax elements sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], par_level_flag, abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], abs_level_gtx_flag[n][4] and / or abs_remainder may be context coded but may also be bypass coded.

[0293] For example, ctxInc for the above syntax elements may be allocated as shown in the following table.

[0294] [Table 17]

[0295]

[0296] As represented in Table 17, when the syntax element sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], par_level_flag, abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], or abs_level_gtx_flag[n][4] is coded, when the threshold (e.g., RemCcbs or MaxCcbs) is greater than 0, the syntax element can be coded as a context coded bin, and when the threshold is less than or equal to 0, the syntax element can be coded as a bypass bin using a uniform probability distribution.

[0297] Figure 7 Another example of coding a syntax element in TSRC is shown. For example, Figure 7It can be shown that when coding any sub-block / coefficient group in the transform block, 0 The threshold becomes zero after the coeff_sign_flag is compiled into the context bin. In this case, refer to Figure 7 , including for Coeff 0 abs_level_gtx_flag[n][0] is used for Coeff 0 The syntax elements coded after coeff_sign_flag can be coded as bypass bins because the remaining threshold is zero, that is, no remaining context coding bins are available. Figure 6 The compilation order of the illustrated embodiment can be maintained without any changes in Figure 7 In the embodiment shown.

[0298] Figure 8 Another example of coding a syntax element in TSRC is shown. In addition, for example, Figure 8 It can be shown that when coding any sub-block / coefficient group in the transform block, 0 After abs_level_gtx_flag[n][2] is compiled as a bin for the context compilation, the threshold becomes zero. In this case, refer to Figure 8 , including for Coeff 0 abs_level_gtx_flag[n][3] is used for Coeff 0 The syntax elements coded after abs_level_gtx_flag[n][2] can be coded as bypassed bins because the remaining threshold is zero, that is, there are no remaining context coding bins available. Figure 6 The compilation order of the embodiment shown in can be maintained without any changes in Figure 8 In the embodiment shown.

[0299] As described above, in the process of coding the TSRC of a block in TSRC, when all available remaining context coded bins of the block are used, subsequent syntax elements can be bypass coded. However, in conventional TSRC, when all available remaining context coded bins are used and syntax elements are coded as bypass bins, as described above, syntax elements can be coded in a coding order of coefficient position priority. Therefore, the present disclosure proposes an embodiment of coding syntax elements with bypass coding in a coding order of syntax element priority instead of the existing coding order of coefficient position priority. Through this, the advantages of a bypass coding engine with high throughput can be maximized, and the residual data coding efficiency of an image can be improved.

[0300] Specifically, for example, the entropy encoder / entropy decoder may include a binarization unit, a conventional coding engine, and a bypass coding engine. For example, the value of a syntax element may be input to a binarization unit. The binarization unit may transform the value of a syntax element into a bin string and output the bin string. Here, a bin string may mean a binary sequence or a binary code consisting of one or more bins. A bin may mean that when the value of a code element and / or a syntax element is represented as a binary sequence (or binary code) by binarization, the value (0 or 1) of each digital number constituting the binary sequence (or binary code).

[0301] Later, the binarization signal (bin string) can be input to a conventional compilation engine or a bypass compilation engine. The conventional compilation engine can assign a context reflecting the probability value of the corresponding bin and compile the corresponding bin based on the assigned context. The conventional compilation engine can perform compilation on each bin and then update the probability and / or context of the bin. The bin compiled using the conventional compilation engine can be called a context compiled bin.

[0302] In addition, the bypass compilation engine can bypass the process of estimating the probability of the input bin and the process of updating the probability applied to the bin after compilation. In bypass mode, the context is not assigned according to the input bin, but the input bin is simply compiled, so that the throughput can be improved. For example, in bypass mode, the compilation process can be performed by applying a uniform probability distribution (0.5). The bin compiled using the bypass compilation engine can be called a bypass compiled bin or a bypass bin.

[0303] In general, bypass mode has better throughput performance than context-coded bins. To compile one context-coded bin, one or more processing cycles may be required. However, for the bypass-coding engine, only one cycle is required to compile n bypass-coded bins. Here, n may be greater than 1. In order to improve the throughput of entropy coding, it may be beneficial to change the coding order (i.e., grouping) so that the bypass-coded bins are compiled continuously. In particular, in the case of grouping the bypass-coded bins, it may be beneficial to group the bypass-coded bins for each syntax element from the perspective of throughput and hardware complexity.

[0304] Fig. 9 The diagram shows an example of coding bypass coded syntax elements in TSRC in a syntax element-first coding order rather than a coefficient position-first coding order. Fig. 9 It can be shown that in the coding of any sub-block / coefficient group in the transform block, 0coeff_sign_flag is compiled into the context compiled bin, the threshold becomes zero. In this case, refer to Fig. 9 , including for Coeff 0 abs_level_gtx_flag[n][0] is used for Coeff 0 The syntax elements compiled after coeff_sign_flag can be compiled as bypass bins because the remaining threshold is 0, that is, no remaining context coding bins are available. For example, refer to Fig. 9 , in the first layer, Coeff 0 The remaining context elements (abs_level_gtx_flag[n][0] and par_level_flag) of the context coding can be bypassed according to the existing coding order, but later, for the coefficient Coeff 1 To Coeff n-1 The syntax elements of can be coded in the syntax element order. In other words, later, the coefficients Coeff 1 To Coeff n-1 The sig_coeff_flag of the 1 To Coeff n-1 Next, the coefficient Coeff 1 To Coeff n-1 abs_level_gtx_flag[n][0] is bypassed, and then the coefficient Coeff 1 To Coeff n-1 par_level_flag of bypass compilation. In addition, for example, refer to Fig. 9 , for coding syntax elements in subsequent layers after the first layer, the recommended coding order of syntax element priority can be maintained.

[0305] Fig.10 The diagram shows an example of coding bypass coded syntax elements in TSRC in a syntax element-first coding order rather than a coefficient position-first coding order. Fig.10 It can be shown that in the coding of any sub-block / coefficient group in the transform block, 0 abs_level_gtx_flag[n][2] is compiled as a bin for the context compilation, and the threshold becomes zero. In this case, refer to Fig.10 , including for Coeff 0abs_level_gtx_flag[n][3] is used for Coeff 0 The syntax elements compiled after abs_level_gtx_flag[n][2] can be compiled as bypass bins because the remaining threshold is 0, that is, there are no remaining context-coded bins available. Fig.10 , as the Coeff 0 The remaining context elements (abs_level_gtx_flag[n][3] and abs_level_gtx_flag[n][4]) of context compilation can be bypassed according to the existing compilation order, but later, for the coefficient Coeff 1 To Coeff n-1 The syntax elements of can be coded in the syntax element order. In other words, later, for the coefficient Coeff 1 To Coeff n-1 abs_level_gtx_flag[n][1] can be bypassed continuously and subsequently used for the coefficient Coeff 1 To Coeff n-1 The abs_level_gtx_flag[n][2] of can be bypassed continuously. Next, the coefficient Coeff 1 To Coeff n-1 abs_level_gtx_flag[n][3] is bypassed, and then, the coefficient Coeff 1 To Coeff n-1 abs_level_gtx_flag[n][4] is bypassed. In addition, for example, refer to Fig.10 , even for coding the syntax element in a subsequent layer after the second layer, the suggested coding order that takes precedence over the syntax element may be maintained.

[0306] In addition, the present disclosure proposes a method for coding bypass-coded bins by grouping the bypass-coded bins of each syntax element when the syntax elements are bypass-coded in a simplified residual data coding structure. Under certain conditions, there are advantages in coding performance such as lossless coding or near-lossless coding, and the simplified residual coding structure can be used for a single coding block or a transform block. In this case, by using the method proposed in the present disclosure, a syntax element-prioritized coding order can be used instead of the existing coding order of coefficient position priority.

[0307] In addition, because the number of context coded bins available for residual coding in a TU may be limited to a specific threshold, all the context coded bins available for the TU are consumed, and then the syntax elements for the TU are coded as bypass bins. In the case, one embodiment in the present disclosure proposes a method of using a syntax element-first coding order instead of a coefficient position-first existing coding order. At the same time, the existing simplified residual data coding structure may be the same as those shown in the following figures and descriptions for the figures.

[0308] Fig.11 An example in which syntax elements are coded in a simplified residual data coding structure is shown. Fig.11 , the existing simplified residual data coding may include the coding of syntax elements sig_coeff_flag, coeff_sign_flag and abs_remainder. Fig.11 The syntax element coding order of the simplified residual data coding structure having the existing coding order of coefficient position priority for one subblock / coefficient group / transform block / coding block may be illustrated.

[0309] For example, refer to Fig.11, in the first layer, sig_coeff_flag and coeff_sign_flag for a specific coefficient may be coded, sig_coeff_flag and coeff_sign_flag for the next coefficient after the specific coefficient may be coded, and sig_coeff_flag and coeff_sign_flag for coefficients up to the last coefficient position in the scan order may be coded. Later, in the second layer, coding of abs_remainder for all coefficients in the subblock may be performed in scan order. Here, in the case where the value of the coefficient of the position is zero, the value of sig_coeff_flag may be zero, and in the case where the value of the coefficient of the position is non-zero, the value of sig_coeff_flag may be 1. In addition, coeff_sign_flag may indicate the sign of the coefficient of the position. For example, in the case where the coefficient of the position is zero, that is, in the case where the sig_coeff_flag for the coefficient is zero, the coeff_sign_flag for the coefficient may not be coded. Further, in the case where the coefficient is non-zero and negative, the coeff_sign_flag value for the coefficient may be 1 (or zero), and in the case where the coefficient is non-zero and positive, the coeff_sign_flag value for the coefficient may be zero (or 1). Alternatively, in the case where the coefficient is negative regardless of the sig_coeff_flag of the coefficient, the coeff_sign_flag value for the coefficient may be 1 (or zero), and in the case where the coefficient is positive or zero, the coeff_sign_flag value for the coefficient may be zero (or 1). Alternatively, in the case where the coefficient is positive regardless of the sig_coeff_flag of the coefficient, the coeff_sign_flag value for the coefficient may be 1 (or zero), and in the case where the coefficient is negative or zero, the coeff_sign_flag value for the coefficient may be zero (or 1).

[0310] Meanwhile, the present disclosure proposes a method for coding and grouping each syntax element to generate advantages in CABAC throughput and hardware complexity in a simplified residual data coding structure.

[0311] Fig.12 The diagram shows an example of coding the syntax elements that are bypass-coded in the simplified residual data coding structure in a syntax element-first coding order rather than a coefficient position-first coding order. Fig.12 As shown in , in the first layer, Coeff 0 sig_coeff_flag to the last coefficient Coeff in the scan order n-1The sig_coeff_flag of the bypass compiler is continuously executed, and then, the Coeff 0 coeff_sign_flag to the last coefficient Coeff in the scan order n-1 The coeff_sign_flag of 0 abs_remainder to the last coefficient Coeff in the scan order n-1 The abs_remainder is continuously executed to bypass compilation.

[0312] At the same time, the simplified residual data coding structure can have the same Fig.11 For example, the simplified residual data coding structure shown in the following figure can be compiled.

[0313] Fig.13a and Fig.13b An embodiment in which syntax elements are coded in a simplified residual data coding structure is illustrated. Fig.13a and Fig.13b , simplified residual data coding may include coding of syntax elements dec_abs_level and coeff_sign_flag. Fig.13a and Fig.13b The syntax element coding order of the simplified residual data coding structure with the existing coding order of coefficient position priority for one sub-block / coefficient group / transform block / coding block can be illustrated. Fig.13a , in a layer, dec_abs_level and coeff_sign_flag for a specific coefficient may be coded, dec_abs_level and coeff_sign_flag for a next coefficient after the specific coefficient may be coded, and dec_abs_level and coeff_sign_flag for coefficients up to the last coefficient position in the scan order may be coded. In addition, for example, referring to Fig.13b , in a layer, coeff_sign_flag and dec_abs_level for a specific coefficient may be coded, coeff_sign_flag and dec_abs_level for the next coefficient after the specific coefficient may be coded, and coeff_sign_flag and dec_abs_level for coefficients up to the last coefficient position in the scan order may be coded.

[0314] Here, in the case where the value of the coefficient of the position is zero, the value of dec_abs_level may be zero, and in the case where the value of the coefficient of the position is not zero, the value of dec_abs_level may be the absolute value of the coefficient. In addition, coeff_sign_flag may indicate the sign of the coefficient of the position. For example, in the case where the coefficient of the position is zero, that is, in the case where the dec_abs_level for the coefficient is zero, the coeff_sign_flag for the coefficient may not be coded. Further, in the case where the coefficient is non-zero and negative, the coeff_sign_flag value for the coefficient may be 1 (or zero), and in the case where the coefficient is non-zero and positive, the coeff_sign_flag value for the coefficient may be zero (or 1). Alternatively, in the case where the coefficient is negative regardless of the dec_abs_level for the coefficient, the coeff_sign_flag value for the coefficient may be 1 (or zero), and in the case where the coefficient is positive or zero, the coeff_sign_flag value for the coefficient may be zero (or 1). Alternatively, in the case where the coefficient is positive regardless of the dec_abs_level for the coefficient, the coeff_sign_flag value for the coefficient may be 1 (or zero), and in the case where the coefficient is negative or zero, the coeff_sign_flag value for the coefficient may be zero (or 1).

[0315] At the same time, a simplified residual data coding structure can be used when the specific conditions in the above RRC or TSRC are met. For example, when the current block is losslessly coded or nearly losslessly coded, or when all available context coding bins are consumed for the current block, the residual data can be coded in a simplified residual data coding structure.

[0316] For example, the present disclosure proposes a method for coding syntax elements of coefficients of a current block in a simplified residual data coding structure when all available context-coded bins of the current block are consumed in the TSRC of the current block.

[0317] In particular, for example, the syntax elements according to the TSRC for the current block can be parsed. In this case, the maximum number of bins that can be used for context coding of the current block can be derived, and when all the maximum number of context-coded bins for the current block are used to code the syntax elements of the previous transform coefficient of the current transform coefficient in the scan order, the syntax elements of the subsequent transform coefficients of the current transform coefficient and the current transform coefficient in the scan order can be coded in the simplified residual data coding structure. Therefore, the syntax elements of the current transform coefficient and the subsequent transform coefficients of the current transform coefficient in the scan order may include coefficient level information and a sign flag for the transform coefficient. The decoding device can derive the transform coefficient based on the syntax elements of the transform coefficient coded in the simplified residual data coding structure. For example, the coefficient level information can represent the absolute value of the coefficient level of the transform coefficient. In addition, the sign flag can represent the sign of the current transform coefficient. The decoding device can derive the coefficient level of the transform coefficient based on the coefficient level information and derive the sign of the transform coefficient based on the sign flag.

[0318] Meanwhile, in order to generate advantages in CABAC throughput and hardware complexity, the present disclosure proposes a method for coding and grouping syntax elements that are bypass-coded in the simplified residual data coding structure shown in FIG. 13 for each syntax element.

[0319] Fig.14a and Fig.14b The diagram shows an example of coding the syntax elements bypass-coded in the simplified residual data coding structure in a syntax element-first coding order rather than a coefficient position-first coding order. Fig.14a As shown in , in the layer, Coeff 0 dec_abs_level to the last coefficient Coeff in the scanning order n-1 The dec_abs_level is continuously executed to bypass the compilation, and then, from Coeff 0 coeff_sign_flag to the last coefficient Coeff in the scan order n-1 Alternatively, for example, according to this embodiment, as Fig.14b As shown in , in the layer, Coeff 0 coeff_sign_flag to the last coefficient Coeff in the scan order n-1 The coeff_sign_flag of the bypass compiler is executed continuously, and then, from the Coeff 0 dec_abs_level to the last coefficient Coeff in the scanning order n-1According to the present embodiment, the bypass coded bins may be grouped and continuously coded for each syntax element, and effects such as improving the throughput of entropy coding and reducing hardware complexity may be produced.

[0320] At the same time, the simplified residual data coding structure can have the same Fig.11 , Fig.13a as well as Fig.13b For example, the simplified residual data coding structure shown in the following figure can be compiled.

[0321] Fig.15 An embodiment in which syntax elements are coded in a simplified residual data coding structure is illustrated. Fig.15 , simplified residual data coding may include coding of syntax elements sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], par_level_flag, and abs_remainder. Fig.15 The syntax element coding order of the simplified residual data coding structure with the existing coding order of coefficient position priority for one sub-block / coefficient group / transform block / coding block can be illustrated. Fig.15 , in the first layer, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], and par_level_flag of a specific coefficient may be coded, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], and par_level_flag for a next coefficient after the specific coefficient may be coded, and sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag[n][0], and par_level_flag of coefficients up to the last coefficient position in the scan order may be coded. Later, in the second layer, coding of abs_remainder for all coefficients in a subblock may be performed in scan order.

[0322] At the same time, in order to produce advantages in CABAC throughput and hardware complexity, the present disclosure proposes a method for Fig.15 A method for coding and grouping syntax elements for bypass coding in a simplified residual data coding structure shown in FIG.

[0323] Fig.16The diagram shows an example of coding the syntax elements bypass-coded in the simplified residual data coding structure in a syntax element-first coding order rather than a coefficient position-first coding order. Fig.16 As shown in , in the first layer, Coeff 0 sig_coeff_flag to the last coefficient Coeff in the scan order n-1 The sig_coeff_flag of the command is continuously executed to bypass the compilation, and then the 0 coeff_sign_flag to the last coefficient Coeff in the scan order n-1 The coeff_sign_flag is executed continuously, and then the 0 abs_level_gtx_flag[n][0] to the last coefficient Coeff in the scan order n-1 abs_level_gtx_flag[n][0] is executed continuously, and then from Coeff 0 par_level_flag to the last coefficient Coeff in the scan order n-1 Later, in the second layer, you can 0 abs_remainder to the last coefficient Coeff in the scan order n-1 According to the present embodiment, the bins of the bypass coding can be grouped and continuously coded for each syntax element, and the effects such as improving the throughput of the entropy coding and reducing the hardware complexity can be produced.

[0324] Fig.17 An image encoding method performed by an encoding device according to the present disclosure is briefly illustrated. Fig.17 The method proposed in can be Figure 2 Specifically, for example, step S1700 may be performed by a residual processor of the encoding device, and steps S1710 to S1730 may be performed by an entropy encoder of the encoding device. In addition, although not shown, the process of deriving the prediction sample may be performed by a predictor of the encoding device, the process of deriving the residual sample of the current block based on the original sample and the prediction sample of the current block may be performed by a subtractor of the encoding device, and the process of deriving the reconstructed sample of the current block based on the residual sample and the prediction sample of the current block may be performed by an adder of the encoding device.

[0325] The encoding device derives the transform coefficient of the current block (step S1700). For example, the encoding device may determine whether to perform inter-frame prediction or intra-frame prediction on the current block, and determine a specific inter-frame prediction mode or a specific intra-frame prediction mode based on the RD cost. According to the determined mode, the encoding device may derive the prediction sample of the current block, and may derive the residual sample by subtraction between the original sample of the current block and the prediction sample.

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

[0327] When the transform is not applied to the current block, that is, when the transform is not applied to the residual sample, the encoding device may derive the derived residual sample as the current transform coefficient. In addition, when the transform is applied to the current block, that is, when the transform is applied to the residual sample, the encoding device may derive the transform coefficient by performing the transform on the residual sample. The current block may include a plurality of sub-blocks or coefficient groups (CGs). In addition, the size of the sub-block of the current block may be 4x4 or 2x2. That is, the sub-block of the current block may include a maximum of 16 non-zero transform coefficients or a maximum of 4 non-zero transform coefficients.

[0328] Here, the current block may be a coding block (CB) or a transform block (TB). In addition, the transform coefficient may also be expressed as a residual coefficient.

[0329] The encoding device generates syntax elements for the first transform coefficient to the nth transform coefficient of the current block (step S1710). The encoding device may generate syntax elements for the first transform coefficient to the nth transform coefficient of the current block and encode them. The residual information of the current block may include syntax elements for the first transform coefficient to the nth transform coefficient of the current block.

[0330] For example, the residual information may include syntax elements for the first transform coefficient to the nth transform coefficient of the current block. Here, for example, the syntax element may be a syntax element of a first residual data coding structure according to transform skip residual coding (TSRC). The syntax elements according to the first residual data coding structure may include syntax elements for context coding of the transform coefficient and / or syntax elements for bypass coding. The syntax elements according to the first residual data coding structure may include syntax elements such as sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, abs_remainder and / or coeff_sign_flag.

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

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

[0333] In addition, the number of context-coded syntax elements for the first transform coefficient to the nth transform coefficient may be the same as the maximum number of context-coded bins for the current block. That is, for example, all context-coded bins of the current block may be used as bins for context-coded syntax elements for the first transform coefficient to the nth transform coefficient. For example, the maximum number of context-coded bins for the current block may be derived based on the width and height of the current block. For example, the maximum number of context-coded bins for the current block may be derived as a value of the number of samples of the current block multiplied by a specific value. Here, the number of samples may be derived as a value multiplied by the width and height of the current block. In addition, the specific value may have an integer value such as 2 or a decimal value such as 1.5, 1.75, or 1.25.

[0334] At the same time, for example, the syntax elements according to the first residual data coding structure may be coded in a coding order according to the coefficient position. The coding order according to the coefficient position may be a scanning order of the transform coefficients. For example, the scanning order may be a raster scanning order. For example, the raster scanning order may represent an order of scanning from the top row downwards in sequence and from left to right in each row. For example, the syntax elements according to the first residual data coding structure may be coded in an order from the syntax elements of the first transform coefficient to the syntax elements of the nth transform coefficient. In addition, for example, when the current block includes a plurality of sub-blocks or coefficient groups (CGs), the plurality of sub-blocks or coefficient groups may be coded in a scanning order, and the syntax elements of the transform coefficients in each sub-block or coefficient group may be coded in a scanning order.

[0335] Meanwhile, for example, the residual information may include a transform skip flag of 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 transform coefficients of the current block. The syntax element indicating the transform skip flag may be the above-mentioned 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 of the current block may be 1.

[0336] The encoding device generates syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block (step S1720). The encoding device may generate and encode syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block. The residual information of the current block may include syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block.

[0337] For example, the residual information may include syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block. Here, for example, the syntax element may be a syntax element of a second residual data coding structure according to transform skip residual coding (TSRC). The syntax element according to the second residual data coding structure may be referred to as a syntax element according to a simplified residual data coding structure. For example, when all context-coded bins of the current block are used as bins for context-coded syntax elements for the first transform coefficient to the nth transform coefficient, that is, for example, when the number of context-coded syntax elements for the first transform coefficient to the nth transform coefficient is equal to or greater than the maximum number of context-coded bins of the current block, the encoding device may generate and encode syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block, which are syntax elements of the second residual data coding structure according to TSRC.

[0338] For example, the syntax elements according to the second residual data coding structure may include syntax elements for bypass coding of transform coefficients. For example, the syntax elements according to the second residual data coding structure may include coefficient level information and a sign flag for transform coefficients. For example, the syntax elements according to the second residual data coding structure may include coefficient level information for the absolute value of the coefficient level of the transform coefficient and a sign flag for the sign of the transform coefficient. The syntax elements of the transform coefficients may be coded based on bypass. That is, the residual syntax elements of the transform coefficients may be coded based on a uniform probability distribution. For example, the coefficient level information may represent the absolute value of the coefficient level of the transform coefficient. In addition, the sign flag may represent the sign of the transform coefficient. For example, when the value of the sign flag is 0, the sign flag may indicate that the coefficient level of the transform 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 transform coefficient is a negative value. The coefficient level information may be the above-mentioned abs_remainder, and the sign flag may be the above-mentioned coeff_sign_flag.

[0339] At the same time, for example, the syntax elements according to the second residual data coding structure may be coded in a coding order according to the coefficient position. The coding order according to the coefficient position may be a scanning order of the transform coefficients. For example, the scanning order may be a raster scanning order. For example, the raster scanning order may represent an order of scanning from the top row downwards in sequence and from left to right in each row. For example, the syntax elements according to the second residual data coding structure may be coded in an order of syntax elements from the n+1th transform coefficient to the last transform coefficient. In addition, for example, when the current block includes a plurality of sub-blocks or coefficient groups (CGs), the plurality of sub-blocks or coefficient groups may be coded in a scanning order, and the syntax elements of the transform coefficients in each sub-block or coefficient group may be coded in a scanning order.

[0340] In addition, for example, the syntax elements according to the second residual data coding structure can be coded in a coding order according to the syntax elements. That is, for example, the syntax elements according to the second residual data coding structure can be coded in a coding order in which the syntax elements are prioritized. For example, the coefficient level information of the n+1th transform coefficient to the last transform coefficient can be coded, and thereafter, the sign flag of the n+1th transform coefficient to the last transform coefficient can be coded. Specifically, for example, the coefficient level information can be coded in an order from the coefficient level information for the n+1th transform coefficient to the coefficient level information of the last transform coefficient, and later, the sign flag can be coded in an order from the sign flag of the n+1th transform coefficient to the sign flag of the last transform coefficient.

[0341] The encoding device encodes the image information including the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure (step S1730). The encoding device may encode the image information including the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure. For example, the image information may include residual information of the current block. The residual information may include the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure. For example, the encoding device may encode the image information including the residual information and output the image information in a bitstream format. The bitstream may be sent to the decoding device via a network or a storage medium.

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

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

[0344] Fig.18 A coding apparatus for executing the image coding method according to the present disclosure is briefly illustrated. Fig.17 The method proposed in can be Fig.18 In particular, for example, the residual processor of the encoding device may perform Fig.17 The entropy encoder of the encoding device may perform step S1700 shown in the figure, and the entropy encoder of the encoding device may perform steps S1710 to S1730. In addition, although not shown in the drawings, the process of deriving the prediction sample may be performed by the predictor of the encoding device, the process of deriving the residual sample of the current block based on the original sample and the prediction sample of the current block may be performed by the subtractor of the encoding device, and the process of deriving the reconstructed sample of the current block based on the residual sample and the prediction sample of the current block may be performed by the adder of the encoding device.

[0345] Fig.19 The following briefly illustrates an image decoding method performed by a decoding device according to the present disclosure. Fig.19 The method proposed in can be Figure 3 Specifically, for example, Fig.19 Steps S1900 and S1910 shown in the figure may be performed by an entropy decoder of a decoding device, Fig.19 Steps S1920 and S1930 shown in the figure can be performed by the residual processor of the decoding device, and step S1940 can be performed by the adder of the decoding device. In addition, although not shown in the drawings, the process of receiving the prediction information of the current block can be performed by the entropy decoder of the decoding device, and the process of deriving the prediction sample of the current block can be performed by the predictor of the decoding device.

[0346] The decoding device obtains syntax elements for the first transform coefficient to the nth transform coefficient of the current block (step S1900). The decoding device may obtain image information including residual information for the current block. The residual information may include syntax elements for the transform coefficient of the current block. Here, the current block may be a coding block (CB) or a transform block (TB). In addition, the transform coefficient may also be expressed as a residual coefficient.

[0347] For example, the residual information may include syntax elements for the first transform coefficient to the nth transform coefficient of the current block. That is, for example, the decoding device obtains syntax elements for the first transform coefficient to the nth transform coefficient of the current block. Here, for example, the syntax element may be a syntax element of a first residual data coding structure according to transform skip residual coding (TSRC). The syntax elements according to the first residual data coding structure may include syntax elements for context coding of transform coefficients and / or syntax elements for bypass coding. The syntax elements according to the first residual data coding structure may include syntax elements such as sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flag, abs_remainder and / or coeff_sign_flag.

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

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

[0350] In addition, the number of context-coded syntax elements for the first transform coefficient to the nth transform coefficient may be the same as the maximum number of context-coded bins for the current block. That is, for example, all context-coded bins of the current block may be used as bins for context-coded syntax elements for the first transform coefficient to the nth transform coefficient. For example, the maximum number of context-coded bins for the current block may be derived based on the width and height of the current block. For example, the maximum number of context-coded bins for the current block may be derived as the number of samples of the current block multiplied by a specific value. Here, the number of samples may be derived as the value of the width and height of the current block multiplied. In addition, the specific value may have an integer value such as 2 or a decimal value such as 1.5, 1.75, or 1.25.

[0351] At the same time, for example, the syntax elements according to the first residual data coding structure may be encoded in a coding order according to the coefficient position. The coding order according to the coefficient position may be a scanning order of the transform coefficients. For example, the scanning order may be a raster scanning order. For example, the raster scanning order may represent an order of scanning from the top row downwards in sequence and from left to right in each row. For example, the syntax elements according to the first residual data coding structure may be coded in an order from the syntax elements of the first transform coefficient to the syntax elements of the nth transform coefficient. In addition, for example, when the current block includes a plurality of sub-blocks or coefficient groups (CGs), the plurality of sub-blocks or coefficient groups may be coded in a scanning order, and the syntax elements of the transform coefficients in each sub-block or coefficient group may be coded in a scanning order.

[0352] In addition, for example, the residual information may include a transform skip flag of 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 transform coefficients of the current block. The syntax element indicating the transform skip flag may be the above-mentioned 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 of the current block may be 1.

[0353] The decoding apparatus obtains syntax elements for an (n+1)th transform coefficient to a last transform coefficient of a current block (step S1910 ).

[0354] For example, the residual information may include syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block. That is, for example, the decoding device may obtain syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block. Here, for example, the syntax element may be a syntax element of a second residual data coding structure according to transform skip residual coding (TSRC). The syntax element according to the second residual data coding structure may be referred to as a syntax element according to a simplified residual data coding structure. For example, when all context-coded bins for the current block are used as bins for syntax elements for context coding of the first transform coefficient to the nth transform coefficient, that is, for example, when the number of syntax elements for context coding of the first transform coefficient to the nth transform coefficient is equal to or greater than the maximum number of context-coded bins of the current block, the decoding device may obtain syntax elements for the n+1th transform coefficient to the last transform coefficient of the current block, which are syntax elements of the second residual data coding structure according to TSRC.

[0355] For example, the syntax elements according to the second residual data coding structure may include syntax elements for bypass coding of transform coefficients. For example, the syntax elements according to the second residual data coding structure may include coefficient level information and a sign flag for transform coefficients. For example, the syntax elements according to the second residual data coding structure may include coefficient level information for the absolute value of the coefficient level of the transform coefficient and a sign flag for the sign of the transform coefficient. The syntax elements of the transform coefficients may be coded based on bypass. That is, the residual syntax elements of the transform coefficients may be coded based on a uniform probability distribution. For example, the coefficient level information may represent the absolute value of the coefficient level of the transform coefficient. In addition, the sign flag may represent the sign of the transform coefficient. For example, when the value of the sign flag is 0, the sign flag may indicate that the coefficient level of the transform 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 transform coefficient is a negative value. The coefficient level information may be the above-mentioned abs_remainder, and the sign flag may be the above-mentioned coeff_sign_flag.

[0356] At the same time, for example, the syntax elements according to the second residual data coding structure may be coded in a coding order according to the coefficient position. The coding order according to the coefficient position may be a scanning order of the transform coefficients. For example, the scanning order may be a raster scanning order. For example, the raster scanning order may represent an order of scanning from the top row downwards in sequence and from left to right in each row. For example, the syntax elements according to the second residual data coding structure may be coded in an order of syntax elements from the n+1th transform coefficient to the last transform coefficient. In addition, for example, when the current block includes a plurality of sub-blocks or coefficient groups (CGs), the plurality of sub-blocks or coefficient groups may be coded in a scanning order, and the syntax elements of the transform coefficients in each sub-block or coefficient group may be coded in a scanning order.

[0357] In addition, for example, the syntax elements according to the second residual data coding structure can be coded in a coding order according to the syntax elements. That is, for example, the syntax elements according to the second residual data coding structure can be coded in a coding order in which the syntax elements are prioritized. For example, the coefficient level information from the n+1th transform coefficient to the last transform coefficient can be coded, and thereafter, the sign flags from the n+1th transform coefficient to the last transform coefficient can be coded. Specifically, for example, the coefficient level information can be coded in an order from the coefficient level information for the n+1th transform coefficient to the coefficient level information for the last transform coefficient, and later, the sign flags can be coded in an order from the sign flag of the n+1th transform coefficient to the sign flag of the last transform coefficient.

[0358] The decoding device derives the transform coefficient of the current block based on the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure (step S1920). The decoding device may derive the transform coefficient of the current block based on the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure.

[0359] For example, the decoding apparatus may derive first to n-th transform coefficients of the current block based on syntax elements according to the first residual data coding structure.

[0360] In addition, for example, the decoding device may derive the n+1th transform coefficient to the last transform coefficient based on the syntax element according to the second residual data coding structure. For example, the coefficient level of the transform coefficient may be derived as a value represented by the coefficient level information, and the sign of the transform coefficient may be derived as a sign represented by the sign flag. In this case, for example, the transform coefficient may be derived without performing level mapping.

[0361] The decoding device derives the residual samples of the current block based on the transform coefficients (step S1930). The decoding device may derive the residual samples of the current block based on the transform coefficients. In one 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 transform coefficients as the residual samples 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 samples of the current block by dequantizing the transform coefficients. 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, the decoding device may derive the residual samples of the current block by inversely transforming the transform coefficients. 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, the decoding device may derive the residual samples of the current block by dequantizing the transform coefficients and inversely transforming the dequantized transform coefficients.

[0362] The decoding device generates a reconstructed picture based on the residual sample (step S1940). For example, the decoding device may generate a reconstructed sample and / or a reconstructed picture based on the residual sample. For example, the decoding device may perform an inter-frame prediction mode or an intra-frame prediction mode on the current block based on the prediction information received through the bitstream and derive a prediction sample, and may generate a reconstructed sample by adding the prediction sample and the residual sample.

[0363] Later, as occasion demands, in order to improve subjective / objective image quality, the decoding apparatus may apply a loop filtering process, such as a deblocking filter, SAO and / or ALF process, to the reconstructed picture as described above.

[0364] Fig. 20 A decoding device for executing the image decoding method according to the present disclosure is briefly illustrated. Fig.19 The method proposed in can be Fig. 20 In particular, for example, the entropy decoder of the decoding device may perform Fig.19 In steps S1900 and S1910 shown in FIG. 1 , the residual processor of the decoding device may perform Fig.19 , and the adder of the decoding device may perform steps S1920 and S1930 shown in Fig.19 In addition, although not shown in the drawings, the process of receiving the prediction information of the current block can be performed by Fig. 20 The entropy decoder of the decoding device shown in is performed, and the process of deriving the prediction sample of the current block can be performed by Fig. 20 This is performed by the predictor of the decoding device shown in .

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

[0366] In addition, according to the present disclosure, when the maximum number of context coding bins of the current block is consumed in TSRC, syntax elements according to a simplified residual data coding structure can be sent by signaling, and by doing so, the coding complexity of the bypass-coded syntax elements is reduced and the overall residual coding efficiency can be improved.

[0367] In addition, according to the present disclosure, as the coding order of bypass-coded syntax elements, an order in which syntax elements are prioritized may be used, and by doing so, the coding efficiency of bypass-coded syntax elements may be improved, and the overall residual coding efficiency may be improved.

[0368] In the above embodiments, methods are 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.

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

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

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

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

[0373] Fig.21 The present invention is a structural diagram of a content streaming system to which the present invention is applied.

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

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

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

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

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

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

[0380] 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 decoding device for image decoding, the decoding device comprising: Memory; as well as at least one processor connected to the memory, the at least one processor being configured to: Obtaining syntax elements for first to nth transform coefficients of a current block, wherein the syntax elements are syntax elements of a first residual data coding structure according to transform skip residual coding TSRC; Obtaining syntax elements from the n+1th transform coefficient to the last transform coefficient of the current block, wherein the syntax elements are syntax elements of a second residual data coding structure according to the TSRC; deriving transform coefficients of the current block based on the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure; deriving residual samples of the current block based on the transform coefficients; and Generate a reconstructed picture based on the residual samples, wherein the number of syntax elements used for context coding of the first transform coefficient to the nth transform coefficient is equal to the maximum number of bins of context coding of the current block, and The syntax elements according to the second residual data coding structure include coefficient level information and sign flags for transform coefficients.

2. A coding device for image coding, the coding device comprising: Memory; as well as at least one processor connected to the memory, the at least one processor being configured to: deriving transform coefficients for a current block; Generate syntax elements for first to nth transform coefficients of the current block, wherein the syntax elements are syntax elements of a first residual data coding structure according to transform skip residual coding TSRC; generating syntax elements for an n+1th transform coefficient to a last transform coefficient of the current block, wherein the syntax elements are syntax elements of a second residual data coding structure according to the TSRC; encoding picture information including the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure, wherein the number of syntax elements used for context coding of the first transform coefficient to the nth transform coefficient is equal to the maximum number of bins of context coding of the current block, and The syntax elements according to the second residual data coding structure include coefficient level information and sign flags for transform coefficients.

3. An apparatus for transmitting data for an image, the apparatus comprising: at least one processor configured to obtain a bitstream for the image, wherein the bitstream is generated based on: deriving a transform coefficient for a current block, generating syntax elements for a first transform coefficient to an nth transform coefficient of the current block, wherein the syntax elements are syntax elements of a first residual data coding structure according to transform skip residual coding TSRC, generating syntax elements for an n+1th transform coefficient to a last transform coefficient of the current block, wherein the syntax elements are syntax elements of a second residual data coding structure according to the TSRC, and encoding image information including the syntax elements according to the first residual data coding structure and the syntax elements according to the second residual data coding structure; and a transmitter configured to transmit the data including the bit stream, wherein the number of syntax elements used for context coding of the first transform coefficient to the nth transform coefficient is equal to the maximum number of bins of context coding of the current block, and The syntax elements according to the second residual data coding structure include coefficient level information and sign flags for transform coefficients.