Video decoding method and apparatus

The video decoding method improves residual coding efficiency by using TSRC availability flags to optimize video compression, addressing the increased costs associated with high-resolution video data transmission and storage.

JP2026110630APending Publication Date: 2026-07-02LG ELECTRONICS INC

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
LG ELECTRONICS INC
Filing Date
2026-04-16
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

The increasing demand for high-resolution and high-quality videos has led to a surge in video data transmission and storage costs due to the increased amount of information, necessitating a more efficient video compression technology.

Method used

A video decoding method and apparatus that utilize Transform Skip Residual Coding (TSRC) availability flags to determine whether dependent quantization and sign data hiding are available, allowing for improved residual coding efficiency by reducing the number of bits encoded.

Benefits of technology

The method enhances residual coding efficiency by establishing a signaling relationship between TSRC availability flags and other flags, thereby reducing the amount of bits coded and improving overall coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026110630000001_ABST
    Figure 2026110630000001_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for improving the efficiency of residual coding in a video coding system. [Solution] The video decoding method performed by the decoding device according to this document is characterized by including the steps of: obtaining a dependent quantization availability flag to determine whether dependent quantization is available; obtaining a sign data hiding availability flag to determine whether sign data hiding is available; and obtaining a TSRC availability flag to determine whether transform skip residual coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

Background Art

[0002] In recent years, the demand for high-resolution and high-quality videos such as HD (High Definition) videos and UHD (Ultra High Definition) videos has been increasing in various fields. As video data becomes higher in resolution and quality, the amount of information or bits to be transmitted increases more compared to existing video data. Therefore, when transmitting video data using a medium such as an existing wired or wireless broadband line or storing video data using an existing storage medium, the costs associated with transmission and storage increase.

[0003] For this reason, a highly efficient video compression technology is required to effectively transmit, store, and reproduce information of high-resolution and high-quality videos.

Summary of the Invention

Problems to be Solved by the Invention

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

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

Means for Solving the Problems

[0006] According to one embodiment of this document, a video decoding method performed by a decoding device is provided. The method includes the steps of: obtaining a dependent quantization availability flag to determine whether dependent quantization is available; obtaining a sign data hiding availability flag to determine whether sign data hiding is available; obtaining a Transform Skip Residual Coding (TSRC) availability flag based on the dependent quantization availability flag and the sign data hiding availability flag; obtaining residual information for the current block based on the TSRC availability flag; deriving a residual sample of the current block based on the residual information; and generating a restored picture based on the residual sample, wherein the TSRC availability flag is obtained based on the dependent quantization availability flag, which has a value of 0, and the sign data hiding availability flag, which has a value of 0.

[0007] According to other embodiments of this document, a decoding device for video decoding is provided. The decoding device includes an entropy decoding unit that acquires a dependent quantization availability flag to determine whether dependent quantization is available, a sign data hiding availability flag to determine whether sign data hiding is available, an entropy decoding unit that acquires a transform skip residual coding (TSRC) availability flag based on the dependent quantization availability flag and the sign data hiding availability flag to determine whether transform skip residual coding (TSRC) is available, and acquires residual information for the current block based on the TSRC availability flag, a residual processing unit that derives a residual sample of the current block based on the residual information, and an addition unit that generates a restored picture based on the residual sample, wherein the TSRC availability flag is acquired based on the dependent quantization availability flag which has a value of 0 and the sign data hiding availability flag which has a value of 0.

[0008] Another embodiment of this document provides a video encoding method performed by an encoding device. The method includes the steps of: encoding a dependent quantization availability flag for whether dependent quantization is available; encoding a sign data hiding availability flag for whether sign data hiding is available; encoding a Transform Skip Residual Coding (TSRC) availability flag based on the dependent quantization availability flag and the sign data hiding availability flag; encoding residual information for the current block based on the TSRC availability flag; and generating a bitstream containing the dependent quantization availability flag, the sign data hiding availability flag, the TSRC availability flag and the residual information, wherein the TSRC availability flag is encoded based on the dependent quantization availability flag, which has a value of 0, and the sign data hiding availability flag, which has a value of 0.

[0009] Another embodiment of this document provides a video encoding device. The encoding device includes an entropy encoding unit that encodes a dependent quantization availability flag for whether dependent quantization is available or not, a sign data hiding availability flag for whether sign data hiding is available or not, a Transform Skip Residual Coding (TSRC) availability flag for whether transform skip residual coding (TSRC) is available or not based on the dependent quantization availability flag and the sign data hiding availability flag, encodes residual information for the current block based on the TSRC availability flag, and generates a bitstream containing the dependent quantization availability flag, the sign data hiding availability flag, the TSRC availability flag and the residual information, wherein the TSRC availability flag is encoded based on the dependent quantization availability flag which has a value of 0 and the sign data hiding availability flag which has a value of 0.

[0010] Another embodiment of this document provides a computer-readable digital storage medium storing a bitstream containing video information for performing a video decoding method. In the computer-readable digital storage medium, the video decoding method includes the steps of: obtaining a dependent quantization availability flag to determine whether dependent quantization is available; obtaining a sign data hiding availability flag to determine whether sign data hiding is available; obtaining a TSRC availability flag to determine whether transform skip residual coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag; obtaining residual information for the current block based on the TSRC availability flag; deriving a residual sample of the current block based on the residual information; and generating a restored picture based on the residual sample, wherein the TSRC availability flag is obtained based on the dependent quantization availability flag, which has a value of 0, and the sign data hiding availability flag, which has a value of 0. [Effects of the Invention]

[0011] According to this document, the efficiency of residual coding can be increased.

[0012] According to this document, a signaling relationship is established between the sign data hiding availability flag and the TSRC availability flag. By signaling the TSRC availability flag when sign data hiding is unavailable, sign data hiding is not used when TSRC is unavailable and RRC syntax is coded for conversion skip blocks. This improves coding efficiency, reduces the amount of bits coded, and improves overall residual coding efficiency.

[0013] According to this document, a signaling relationship is established between the dependent quantization availability flag and the TSRC availability flag. By signaling the TSRC availability flag when dependent quantization is unavailable, dependent quantization is prevented from being used when TSRC is unavailable and the RRC syntax is coded for the conversion skip block. This improves coding efficiency, reduces the amount of bits coded, and improves overall residual coding efficiency.

[0014] According to this document, by establishing a signaling relationship between the conversion skip availability flag and the TSRC availability flag, and signaling the TSRC availability flag when conversion skipping is available, the amount of bits encoded can be reduced, thereby improving overall residual coding efficiency. [Brief explanation of the drawing]

[0015] [Figure 1] This diagram schematically illustrates an example of a video / image coding system to which the embodiments described in this document can be applied. [Figure 2] This figure schematically illustrates the configuration of a video / image encoding device to which the embodiments described in this document can be applied. [Figure 3] This figure schematically illustrates the configuration of a video / image decoding device to which the embodiments described in this document can be applied. [Figure 4] This figure shows an example of an intra-predictive-based video / image encoding method. [Figure 5] This figure shows an example of an intra-predictive-based video / image decoding method. [Figure 6] This diagram illustrates the intra-prediction procedure. [Figure 7] This figure shows an example of an interpretation-based video / image encoding method. [Figure 8] This figure shows an example of an interpretation-based video / image decoding method. [Figure 9] This diagram illustrates the interpretation prediction procedure. [Figure 10]A diagram illustrating CABAC (context-adaptive binary arithmetic coding) for encoding syntax elements. [Figure 11] A diagram showing an example of intra-block transform coefficients in a 4x4 block. [Figure 12] A diagram illustrating a scalar quantizer used in dependent quantization. [Figure 13] A diagram illustrating state transition and quantizer selection for dependent quantization. [Figure 14] A diagram schematically showing a video encoding method by an encoding device according to this document. [Figure 15] A diagram schematically showing an encoding device for performing a video encoding method according to this document. [Figure 16] A diagram schematically showing a video decoding method by a decoding device according to this document. [Figure 17] A diagram schematically showing a decoding device for performing a video decoding method according to this document. [Figure 18] A diagram illustrating the structure of a content streaming system to which an embodiment of this document is applied.

Modes for Carrying Out the Invention

[0016] This document may be modified in various ways and may have various embodiments; however, specific embodiments are illustrated in the drawings and described in detail. This is not intended to limit the embodiments described herein to specific embodiments. The terms used herein are used solely to describe specific embodiments and are not intended to limit the technical ideas of this document. Singular expressions include plural expressions unless otherwise specified in the context. In this specification, terms such as "includes" or "has" are used to specify the existence of features, figures, stages, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preemptively exclude the possibility of the existence or addition of one or more other features, figures, stages, operations, components, parts, or combinations thereof.

[0017] On the other hand, each configuration shown in the diagrams described in this document is shown independently for the convenience of explaining its different characteristic functions, and does not mean that each configuration is embodied as separate hardware or separate software. For example, two or more of the configurations may be combined to form a single configuration, and a single configuration may be divided into multiple configurations. Embodiments in which each configuration is integrated and / or separated are also included within the scope of the rights of this document, as long as they do not deviate from the essence of this document.

[0018] The preferred embodiments of this document will be described in more detail below with reference to the attached drawings. Hereafter, identical components in the drawings will be denoted by the same reference numerals, and redundant descriptions of identical components will be omitted.

[0019] Figure 1 schematically shows an example of a video / image coding system to which the embodiments described in this document can be applied.

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

[0021] 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 also be called a video / image encoding device, and the decoding device may also be called 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 also include a display unit, which may be configured as a separate device or external component.

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

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

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

[0025] A decoding device can decode video / images by performing a series of steps, such as inverse quantization, inverse transformation, and prediction, corresponding to the operation of an encoding device.

[0026] The renderer can render the decoded video / image. The rendered video / image may be displayed on the display unit.

[0027] This document relates to video / image coding. For example, the methods / examples disclosed in this document may be applied to methods disclosed in the VVC (versatile video coding) standard, EVC (essential video coding) standard, AV1 (AOMedia Video1) standard, AVS2 (2nd generation of audio video coding standard), or next-generation video / image coding standards (e.g., H.267 or H.268).

[0028] This document presents various embodiments of video / image coding, and unless otherwise specified, these embodiments may be combined with each other.

[0029] In this document, "video" can mean a collection of images over time. "Picture" generally refers to a unit representing a single image at a specific time point, while "subpicture," "slice," and "tile" are units that constitute part of a picture in coding. A subpicture, slice, or tile can contain one or more coding tree units (CTUs). A single picture may consist of one or more subpictures, slices, or tiles. A single picture may consist of one or more tile groups. A tile group can contain one or more tiles. A brick can represent a rectangular area of ​​a CTU row within a picture tile. A tile may be partitioned into multiple bricks, and each brick may consist of one or more CTU rows within that tile. A tile that is not partitioned into multiple bricks can also be called a brick. A brick scan can represent a specific sequential ordering of CTUs that partition a picture, where these CTUs may be aligned by a CTU raster scan within a brick, where bricks within a tile may be aligned consecutively by a raster scan of the bricks in the tile, and where tiles within a picture may be aligned consecutively by a raster scan of the tiles in the picture. A subpicture can represent a rectangular area of ​​one or more slices within a picture; that is, a subpicture may include one or more slices that collectively cover a rectangular area of ​​the picture. A tile is a rectangular area of ​​CTUs within a specific tile row and a specific tile column in a picture. The tile column is a rectangular area of ​​CTUs, where the rectangular area has the same height as the height of the picture, and its width may be specified by a syntax element in the picture parameter set. The tile row is a rectangular area of ​​CTUs, where the rectangular area has the width specified by a syntax element in the picture parameter set, and its height may be the same as the height of the picture.A tile scan can represent a specific sequential ordering of CTUs that partition a picture, wherein the CTUs may be aligned consecutively within the tile by a CTU raster scan, and the tiles within the picture may be aligned consecutively by a raster scan of the tiles in the picture. A slice may contain an integer number of bricks of a picture, wherein the integer number of bricks may be contained in a single NAL unit. A slice may consist of multiple complete tiles, or a consecutive sequence of complete bricks of a single tile. In this document, tile group and slice may be used interchangeably. For example, in this document, tile group / tile group header may be referred to as slice / slice header.

[0030] A pixel or PEL (pel) can refer to the smallest unit that makes up a picture (or image). Alternatively, the term "sample" may be used as a counterpart to "pixel." A sample can generally represent a pixel or a pixel value, and may represent only the luma component pixel / pixel value, or only the chroma component pixel / pixel value.

[0031] A unit can represent a basic unit of image processing. A unit can contain at least one of the following: a specific region of a picture and information associated with that region. A unit can contain one luma block and two chroma (e.g., cb, cr) blocks. The term unit may be used interchangeably with terms such as block or area. In general, an MxN block can contain a sample (or sample array) or a set (or array) of transform coefficients consisting of M columns and N rows.

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

[0033] As used herein, slashes ( / ) and commas can mean "and / or". For example, "A / B" can mean "A and / or B". Therefore, "A / B" can mean "A only", "B only", or "both A and B". For example, "A, B, C" can mean "A, B or C".

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

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

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

[0037] In this specification, technical features described individually in a single drawing may be embodied individually or simultaneously.

[0038] The following drawings are provided to illustrate a specific example of this specification. The names of specific devices or signals / messages / fields shown in the drawings are presented illustratively, and the technical features of this specification are not limited to the specific names shown in the following drawings.

[0039] Figure 2 is a schematic diagram illustrating the configuration of a video / image encoding device to which the embodiments described in this document can be applied. Hereinafter, the term "video encoding device" may include an image encoding device.

[0040] Referring to Figure 2, the encoding device 200 may be configured to include an image partitioner (210), a predictor (220), a residual processor (230), an entropy encoder (240), an adder (250), a filter (260), and a memory (270). The predictor (220) may include an inter-predictor (221) and an intra-predictor (222). The residual processor (230) may include a transformer (232), a quantizer (233), a dequantizer (234), and an inverse transformer (235). The residual processor (230) may further include a subtractor (231). The addition unit 250 may also be called a reconstructor or a reconstructed block generator. The video splitting unit 210, prediction unit 220, residual processing unit 230, entropy encoding unit 240, addition unit 250, and filtering unit 260 described above may be composed of one or more hardware components (e.g., an encoder chipset or processor) depending on the embodiment. The memory 270 may also include a DPB (decoded picture buffer) and may be composed of a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.

[0041] The video splitting unit 210 can split the input video (or picture, frame) input to the encoding device 200 into one or more processing units. For example, the processing units can be called coding units (CUs). In this case, the coding units may be recursively split from a coding tree unit (CTU) or the largest coding unit (LCU) using a QTBTTT (Quad-tree binary-tree ternary-tree) structure. For example, one coding unit may be split into multiple coding units of deeper depth based on a quad-tree structure, a binary tree structure, and / or a Tannery structure. In this case, for example, the quad-tree structure may be applied first, followed by the binary tree structure and / or the Tannery structure. Alternatively, the binary tree structure may be applied first. The coding procedure according to this document may be performed based on the final coding unit that is not further split. In this case, based on coding efficiency due to video characteristics, the largest coding unit may be immediately used as the final coding unit, or, if necessary, the coding unit may be recursively divided into coding units of lower depth, and the coding unit of optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and reconstruction, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may be divided or partitioned from the final coding unit described above. The prediction unit may be a unit of sample prediction, and the transformation unit may be a unit that derives transformation coefficients and / or a unit that derives a residual signal from transformation coefficients.

[0042] The term "unit" may, depending on the context, be used interchangeably with terms such as "block" or "area." In general, an MxN block can represent a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally represent a pixel or a pixel value, and may represent only the pixel / pixel value of the lumen component, or only the pixel / pixel value of the chroma component. A sample may be used as a term corresponding to a single picture (or image) for a pixel or pel.

[0043] The encoding device 200 can generate a residual signal (residual block, residual sample array) by subtracting the prediction signal (prediction block, prediction sample array) output from the inter-prediction unit 221 or intra-prediction unit 222 from the input video signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, as shown in the figure, the unit in the encoding device 200 that subtracts the prediction signal (prediction block, prediction sample array) from the input video signal (original block, original sample array) may be called the subtraction unit 231. The prediction unit can make predictions for the block to be processed (hereinafter referred to as the current block) and generate a predicted block that includes predicted samples for the current block. The prediction unit can determine whether intra-prediction or inter-prediction is applied on a current block or CU basis. As will be described later in the explanation of each prediction mode, the prediction unit can generate various prediction-related information such as prediction mode information and transmit it to the entropy encoding unit 240. Information regarding the prediction may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0044] The intra-prediction unit 222 can predict the current block by referring to a sample in the current picture. The referenced sample may be located in the vicinity (neighbor) or at a distance from the current block, depending on the prediction mode. In intra-prediction, the prediction mode can include multiple non-directional modes and multiple directional modes. Non-directional modes can include, for example, DC mode and planar mode. Directional modes can include, for example, 33 directional prediction modes or 65 directional prediction modes, depending on the degree of detail of the prediction direction. However, this is an example, and more or fewer directional prediction modes may be used depending on the settings. The intra-prediction unit 222 can also determine the prediction mode to be applied to the current block using the prediction modes applied to the surrounding blocks.

[0045] The interprediction unit 221 can guide a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on the reference picture. At this time, in order to reduce the amount of motion information transmitted in interprediction mode, motion information can be predicted in units of blocks, subblocks, or samples based on the correlation of motion information between the surrounding block and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include interprediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). In interprediction, the surrounding block may include a spatial neighboring block existing in the current picture and a temporal neighboring block existing in the reference picture. The reference picture containing the reference block and the reference picture containing the temporal neighboring block may be the same or different. The temporal neighboring block may also be called a collocated reference block, colCU, etc., and the reference picture containing the temporal neighboring block may also be called a collocated picture (colPic). For example, the interpretation unit 221 can construct a motion information candidate list based on surrounding blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Interpretation may be performed based on various prediction modes; for example, in skip mode and merge mode, the interpretation unit 221 can use the motion information of surrounding blocks as the motion information of the current block. In skip mode, unlike merge mode, the residual signal does not need to be transmitted.In motion vector prediction (MVP) mode, the motion vectors of surrounding blocks are used as motion vector predictors, and the motion vector difference is signaled to indicate the motion vector of the current block.

[0046] The prediction unit 220 can generate prediction signals based on various prediction methods described later. For example, the prediction unit can apply intra-prediction or inter-prediction for prediction of a single block, or it can apply intra-prediction and inter-prediction simultaneously. This can be called CIIP (combined inter and intra prediction). The prediction unit may also be based on an intra-block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for coding content video / moving images such as games, for example, in SCC (screen content coding). IBC basically performs prediction within the current picture, but it may be performed similarly to inter-prediction in that it derives a reference block within the current picture. That is, IBC can use at least one of the inter-prediction methods described in this document. Palette mode can be considered an example of intra-coding or intra-prediction. When palette mode is applied, in-picture sample values ​​can be signaled based on information about the palette table and palette index.

[0047] The prediction signal generated by the prediction unit (including the inter-prediction unit 221 and / or the intra-prediction unit 222) may be used to generate a reconstructed signal or a residual signal. The transformation unit 232 can generate transformation coefficients by applying a transformation method to the residual signal. For example, the transformation method may include at least one of DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), KLT (Karhunen-Loeve Transform), GBT (Graph-Based Transform), or CNT (Conditionally Non-linear Transform). Here, GBT means a transformation obtained from a graph when the relationship information between pixels is represented by this graph. CNT means a transformation obtained by generating a prediction signal using all previously reconstructed pixels and based on that. Furthermore, the transformation process may be applied to pixel blocks of the same size that are square, or to blocks of variable size other than squares.

[0048] The quantization unit 233 quantizes the conversion coefficients and transmits them to the entropy encoding unit 240, which can encode the quantized signal (information about the quantized conversion coefficients) and output it as a bitstream. The information about the quantized conversion coefficients can be called residual information. The quantization unit 233 can rearrange the block-shaped quantized conversion coefficients into a one-dimensional vector based on the coefficient scan order, and can also generate information about the quantized conversion coefficients based on the one-dimensional vector-shaped quantized conversion coefficients. The entropy encoding unit 240 can perform various encoding methods, such as exponential Golomb, CAVLC (context-adaptive variable length coding), and CABAC (context-adaptive binary arithmetic coding). In addition to the quantized conversion coefficients, the entropy encoding unit 240 can also encode information necessary for video / image restoration (e.g., the values ​​of syntax elements) together with or separately from the quantized conversion coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in units of network abstraction layer (NAL) units. The video / image information may further include information about various parameter sets, such as an adaptation parameter set (APS), picture parameter set (PPS), sequence parameter set (SPS), or video parameter set (VPS). The video / image information may also further include general constraint information. In this document, information and / or syntax elements transmitted / signaled by the encoding device to the decoding device may be included in the video / image information. The video / image information may be encoded by the encoding procedure described above and included in the bitstream.The bitstream may be transmitted over a network or stored in a digital storage medium. Here, the network may include broadcasting networks and / or communication networks, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, and SSD. A transmitting unit (not shown) that transmits the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) that stores it may be configured as an internal / external element of the encoding device 200, or the transmitting unit may be included in the entropy encoding unit 240.

[0049] The quantized conversion coefficients output from the quantization unit 233 may be used to generate a prediction signal. For example, the residual signal (residual block or residual sample) can be reconstructed by applying inverse quantization and inverse transformation to the quantized conversion coefficients in the inverse quantization unit 234 and the inverse transformation unit 235. The adder unit 250 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter-prediction unit 221 or the intra-prediction unit 222. When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block may be used as the reconstructed block. The adder unit 250 may be called the reconstruction unit or the reconstructed block generation unit. The generated reconstructed signal may be used for intra-prediction of the next block to be processed in the current picture, or, as described later, may be used for inter-prediction of the next picture after filtering.

[0050] On the other hand, LMCS (luma mapping with chroma scaling) may be applied during the picture encoding and / or restoration process.

[0051] The filtering unit 260 can improve subjective / objective image quality by applying filtering to the restored signal. For example, the filtering unit 260 can apply various filtering methods to the restored picture to generate a modified restored picture, and the modified restored picture can be stored in the memory 270, specifically in the DPB of the memory 270. The various filtering methods can include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, and bilateral filter. The filtering unit 260 can generate various filtering-related information and transmit it to the entropy encoding unit 240, as will be described later in the description of each filtering method. The filtering-related information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0052] The corrected restored picture transmitted to memory 270 may be used as a reference picture in the interpretation unit 221. This allows the encoding device to avoid prediction mismatches between the encoding device 200 and the decoding device 300 when interpretation is applied, and also improves encoding efficiency.

[0053] The DPB in memory 270 can store the corrected restored picture for use as a reference picture in the inter-prediction unit 221. Memory 270 can store motion information of blocks from which motion information in the picture has been derived (or encoded) and / or motion information of blocks in the picture that have already been restored. The stored motion information can be transmitted to the inter-prediction unit 221 for use as motion information of spatially surrounding blocks or motion information of temporally surrounding blocks. Memory 270 can store restored samples of blocks that have been restored in the picture and transmit them to the intra-prediction unit 222.

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

[0055] Referring to Figure 3, the decoding device 300 may include an entropy decoder (310), a residual processor (320), a predictor (330), an adder (340), a filter (350), and a memory (360). The predictor (330) may include an inter-predictor (331) and an intra-predictor (332). The residual processor (320) may include a dequantizer (321) and an inverse transformer (322). The entropy decoder (310), residual processor (320), predictor (330), adder (340), and filter (350) described above may be configured by a single hardware component (e.g., a decoder chipset or processor) depending on the embodiment. The memory (360) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The aforementioned hardware component may further include memory 360 as an internal / external component.

[0056] When a bitstream containing video / image information is input, the decoding device 300 can reconstruct the image in a manner corresponding to the process by which the video / image information was processed in the encoding device shown in Figure 2. For example, the decoding device 300 can derive units / blocks based on block division-related information obtained from the bitstream. The decoding device 300 can perform decoding using the processing units applied in the encoding device. Therefore, the decoding processing unit may be, for example, a coding unit, which may be divided into a quad-tree structure, a binary tree structure, and / or a Tannerly tree structure from a coding tree unit or a maximum coding unit. One or more conversion units may be derived from the coding unit. The reconstructed video signal decoded and output by the decoding device 300 may then be played back by a playback device.

[0057] The decoding device 300 can receive the signal output from the encoding device shown in Figure 2 in the form of a bitstream, and the received signal may be decoded by the entropy decoding unit 310. For example, the entropy decoding unit 310 can parse the bitstream and derive information necessary for video restoration (or picture restoration) (e.g., video / image information). The video / image information may further include information about various parameter sets such as the adaptation parameter set (APS), picture parameter set (PPS), sequence parameter set (SPS), or video parameter set (VPS). The video / image information may also further include general constraint information. The decoding device can decode the picture based on the parameter set information and / or the general constraint information. The signaling / received information and / or syntax elements described later in this document may be decoded by the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 310 can decode information within a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of syntax elements necessary for image restoration and the quantized values ​​of conversion coefficients related to the residual. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element from the bitstream, determines a context model using the syntax element information to be decoded, the decoding information of the surrounding and decoded blocks, or the symbol / bin information decoded in a previous stage, predicts the probability of bin occurrence based on the determined context model, performs arithmetic decoding of the bins, and generates symbols corresponding to the values ​​of each syntax element. At this time, after determining the context model, the CABAC entropy decoding method can update the context model using the symbol / bin information decoded for the context model of the next symbol / bin.Information related to prediction from the information decoded by the entropy decoding unit 310 is provided to the prediction unit 330 (inter-prediction unit 332 and intra-prediction unit 331), and residual values ​​that have been entropy decoded by the entropy decoding unit 310, i.e., quantized conversion coefficients and related parameter information, may be input to the residual processing unit 320. The residual processing unit 320 can derive residual signals (residual blocks, residual samples, residual sample arrays). In addition, information related to filtering from the information decoded by the entropy decoding unit 310 may be provided to the filtering unit 350. On the other hand, a receiving unit (not shown) that receives signals output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. On the other hand, the decoding device relating to this document can be called a video / image / picture decoding device, and the decoding device can be distinguished into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, inverse transformation unit 322, addition unit 340, filtering unit 350, memory 360, inter-prediction unit 332, and intra-prediction unit 331.

[0058] The inverse quantization unit 321 can inverse quantize the quantized transformation coefficients and output the transformation coefficients. The inverse quantization unit 321 can rearrange the quantized transformation coefficients in the form of two-dimensional blocks. In this case, the rearrangement can be performed based on the coefficient scan order performed by the encoding device. The inverse quantization unit 321 can perform inverse quantization on the quantized transformation coefficients using quantization parameters (e.g., quantization step size information) and obtain the transformation coefficients.

[0059] In the inverse conversion unit 322, the conversion coefficients are inversely converted to obtain residual signals (residual blocks, residual sample arrays).

[0060] The prediction unit can make predictions for the current block and generate a predicted block containing prediction samples for the current block. Based on the prediction information output from the entropy decoding unit 310, the prediction unit can determine whether intra-prediction or inter-prediction is applied to the current block and determine a specific intra / inter-prediction mode.

[0061] The prediction unit 320 can generate prediction signals based on various prediction methods described later. For example, the prediction unit can apply intra-prediction or inter-prediction for prediction of a single block, or it can apply intra-prediction and inter-prediction simultaneously. This can be called CIIP (combined inter and intra prediction) mode. The prediction unit may also be based on intra-block copy (IBC) prediction mode or palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for coding content video / moving images such as games, for example, as in SCC (screen content coding). IBC basically performs prediction within the current picture, but it may be performed similarly to inter-prediction in that it derives a reference block within the current picture. That is, IBC can use at least one of the inter-prediction methods described in this document. Palette mode can be considered an example of intra-coding or intra-prediction. When palette mode is applied, information regarding the palette table and palette index may be included in the video / image information and signaled.

[0062] The intra-prediction unit 331 can predict the current block by referring to a sample in the current picture. Depending on the prediction mode, the referenced sample may be located in the vicinity (neighbor) of the current block or at a distance. In intra-prediction, the prediction mode may include multiple non-directional modes and multiple directional modes. The intra-prediction unit 331 can also determine the prediction mode to be applied to the current block using the prediction modes applied to the surrounding blocks.

[0063] The interprediction unit 332 can derive a predicted block relative to the current block based on a reference block (reference sample array) identified by motion vectors on the reference picture. In this case, in order to reduce the amount of motion information transmitted in interprediction mode, motion information can be predicted in units of blocks, subblocks, or samples based on the correlation of motion information between surrounding blocks and the current block. The motion information may include motion vectors and reference picture indices. The motion information may further include interprediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). In interprediction, surrounding blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the interprediction unit 332 can construct a motion information candidate list based on surrounding blocks and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Interprediction may be performed based on various prediction modes, and the prediction information may include information indicating the interprediction mode for the current block.

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

[0065] The summing unit 340 can be called a restoration unit or a restoration block generation unit. The generated restoration signal may be used for intra-prediction of the next block to be processed in the current picture, and may be output after filtering as described later, or may be used for intra-prediction of the next picture.

[0066] On the other hand, LMCS (luma mapping with chroma scaling) may be applied during the picture decoding process.

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

[0068] The restored picture stored (modified) in the DPB of memory 360 may be used as a reference picture in the inter-prediction unit 332. Memory 360 can store motion information of blocks from which motion information in the current picture has been derived (or decoded), and / or motion information of blocks in the picture that have already been restored. This stored motion information can be transmitted to the inter-prediction unit 260 for use as motion information of spatially surrounding blocks or motion information of temporally surrounding blocks. Memory 360 can store restored samples of restored blocks in the current picture and transmit them to the intra-prediction unit 331.

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

[0070] In this document, at least one of quantization / inverse quantization and / or transformation / inverse transformation may be omitted. When quantization / inverse quantization is omitted, the quantized transformation coefficient may be called a transformation coefficient. When transformation / inverse transformation is omitted, the transformation coefficient may also be called a coefficient or residual coefficient, or may continue to be called a transformation coefficient for consistency of expression.

[0071] Furthermore, in this document, quantized transformation coefficients and transformation coefficients can be referred to as transformation coefficients and scaled transformation coefficients, respectively. In this case, residual information may include information about the transformation coefficients, and such information about the transformation coefficients may be signaled by residual coding syntax. Transformation coefficients may be derived based on the residual information (or information about the transformation coefficients), and scaled transformation coefficients may be derived by an inverse transformation (scaling) of the transformation coefficients. Residual samples may be derived based on an inverse transformation (transformation) of the scaled transformation coefficients. This may be applied / expressed identically in other parts of this document.

[0072] As described above, when performing video coding, prediction is made to improve compression efficiency. This allows for the generation of a predicted block containing predicted samples for the current block, which is the block to be coded. Here, the predicted block contains predicted samples in the spatial domain (or pixel domain). The predicted block is derived identically by the encoding and decoding devices, and the encoding device can improve video coding efficiency by signaling the decoding device information about the residual between the original block and the predicted block (residual information), rather than the original sample values ​​of the original block themselves. Based on the residual information, the decoding device can derive a residual block containing residual samples, and by combining the residual block and the predicted block, it can generate a restored block containing restored samples, and thus generate a restored picture containing the restored block.

[0073] The residual information may be generated by transformation and quantization procedures. For example, the encoding device can signal the relevant residual information (using a bitstream) to the decoding device by deriving a residual block between the original block and the predicted block, performing a transformation procedure on the residual samples (residual sample array) contained in the residual block to derive transformation coefficients, and performing a quantization procedure on the transformation coefficients to derive quantized transformation coefficients. Here, the residual information may include information such as the value information, position information, transformation method, kernel, and quantization parameters of the quantized transformation coefficients. The decoding device can perform an inverse quantization / inverse transformation procedure based on the residual information to derive a residual sample (or residual block). The decoding device can generate a reconstructed picture based on the predicted block and the residual block. The encoding device can also derive a residual block by inverse quantization / inverse transformation of the quantized transformation coefficients for reference for subsequent interpretation of pictures, and generate a reconstructed picture based on this.

[0074] Intra prediction can represent a prediction that generates prediction samples for the current block based on reference samples within the picture to which the current block belongs (hereinafter, the current picture). When intra prediction is applied to the current block, peripheral reference samples used for the intra prediction of the current block may be derived. The peripheral reference samples of the current block may include a total of 2 x nH samples adjacent to the left boundary and bottom-left of the nW x nH size current block, a total of 2 x nW samples adjacent to the top boundary and top-right of the current block, and one sample adjacent to the top-left of the current block. Alternatively, the peripheral reference samples of the current block may include upper peripheral samples in multiple columns and left peripheral samples in multiple rows. Furthermore, the surrounding reference samples of the current block may also include a total of nH samples adjacent to the right boundary of the current block, which is nW x nH in size, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right side of the current block.

[0075] However, some of the surrounding reference samples in a block may not yet be decoded or available. In this case, the decoder can substitute the unavailable samples with available samples to construct the surrounding reference samples used for prediction. Alternatively, it can construct the surrounding reference samples used for prediction by interpolating the available samples.

[0076] When neighboring reference samples are derived, (i) predicted samples can be derived based on the average or interpolation of neighboring reference samples of the current block, or (ii) predicted samples can be derived based on reference samples from the neighboring reference samples of the current block that are located in a specific (predicted) direction relative to the predicted sample. Case (i) can be called a non-directional mode or non-angular mode, and case (ii) can be called a directional mode or angular mode.

[0077] Alternatively, the predicted sample may be generated by interpolation between a first peripheral sample located in the prediction direction of the current block's intra-prediction mode and a second peripheral sample located in the opposite direction of the prediction direction, based on the predicted sample of the current block from among the peripheral reference samples. In this case, it can be called linear interpolation intra-prediction (LIP). Alternatively, a chroma prediction sample may be generated based on a chroma sample using a linear model (LM). In this case, it can be called LM mode or CCLM (chroma component LM) mode.

[0078] Furthermore, temporary predicted samples for the current block can be derived based on filtered peripheral reference samples, and predicted samples for the current block can be derived by performing a weighted sum on the temporary predicted samples and at least one reference sample derived by the intra-prediction mode from the existing peripheral reference samples, i.e., the unfiltered peripheral reference samples. In this case, it can be called PDPC (Position dependent intra-prediction).

[0079] Furthermore, intra-predictive coding can be performed by selecting the reference sample line with the highest prediction accuracy from among the surrounding multi-reference sample lines of the current block, deriving a predicted sample using the reference sample located in the prediction direction on that line, and then instructing (signaling) the decoding device to use the reference sample line used. In this case, it can be called multi-reference line intra-prediction or MRL-based intra-prediction.

[0080] Furthermore, the current block is divided into vertical or horizontal subpartitions, and intra-prediction is performed based on the same intra-prediction mode, but peripheral reference samples can be derived and used on a subpartition-by-subpartition basis. In other words, in this case, the intra-prediction mode for the current block is applied identically to the subpartition, but by deriving and using peripheral reference samples on a subpartition-by-subpartition basis, the intra-prediction performance can be improved in some cases. Such a prediction method can be called ISP (intra sub-partitions) based intra-prediction.

[0081] The intra-prediction method described above can be called an intra-prediction type, distinct from the intra-prediction mode. The intra-prediction type can be referred to by various terms such as intra-prediction method or additional intra-prediction mode. For example, the intra-prediction type (or additional intra-prediction mode, etc.) may include at least one of the LIP, PDPC, MRL, and ISP described above. General intra-prediction methods other than the specific intra-prediction types such as LIP, PDPC, MRL, and ISP can be called normal intra-prediction types. Normal intra-prediction types may be generally applied when the specific intra-prediction types described above are not applicable, and predictions may be made based on the intra-prediction modes described above. On the other hand, post-processing filtering may be performed on the derived prediction samples as needed.

[0082] Specifically, the intra-prediction procedure may include an intra-prediction mode / type determination stage, a peripheral reference sample derivation stage, and an intra-prediction mode / type-based prediction sample derivation stage. Additionally, a post-filtering stage may be performed on the derived prediction samples as needed.

[0083] Figure 4 shows an example of an intra-predictive-based video / image encoding method.

[0084] Referring to Figure 4, the encoding device performs intraprediction for the current block (S400). The encoding device can derive an intraprediction mode / type for the current block, derive peripheral reference samples for the current block, and generate predicted samples within the current block based on the intraprediction mode / type and the peripheral reference samples. Here, the steps of determining the intraprediction mode / type, deriving peripheral reference samples, and generating predicted samples may be performed simultaneously, or one of the steps may be performed before the others. The encoding device can determine which mode / type to apply to the current block from among a plurality of intraprediction modes / types. The encoding device can compare the RD costs (RD costs) for the intraprediction modes / types and determine the optimal intraprediction mode / type for the current block.

[0085] On the other hand, the encoding device can also perform a predictive sample filtering procedure. This predictive sample filtering can be called post-filtering. Some or all of the predictive samples may be filtered by this predictive sample filtering procedure. In some cases, this predictive sample filtering procedure may be omitted.

[0086] The encoding device generates a residual sample for the current block based on the (filtered) predicted sample (S410). The encoding device can derive the residual sample by comparing the predicted sample with the original sample of the current block on a phase basis.

[0087] The encoding device can encode video information including information relating to the intra prediction (prediction information) and residual information relating to the residual sample (S420). The prediction information may include the intra prediction mode information and the intra prediction type information. The encoding device can output the encoded video information in the form of a bitstream. The output bitstream may be transmitted to a decoding device via a storage medium or a network.

[0088] The residual information may include the residual coding syntax described later. The encoding device can transform / quantize the residual samples and derive quantized transformation coefficients. The residual information may include information regarding the quantized transformation coefficients.

[0089] On the other hand, as described above, the encoding device can generate a restored picture (including restored samples and restored blocks). To do this, the encoding device can decrypt the quantized conversion coefficients again by inverse quantization / inverse transformation to derive (corrected) residual samples. The reason for decrypting / inversely transforming the residual samples again after transformation / quantization is to derive the same residual samples as those derived by the decoding device, as described above. Based on the predicted samples and the (corrected) residual samples, the encoding device can generate a restored block containing restored samples for the current block. Based on the restored block, a restored picture for the current picture may be generated. As described above, further in-loop filtering procedures and the like may be applied to the restored picture.

[0090] Figure 5 shows an example of an intra-predictive-based video / image decoding method.

[0091] The decoding device can perform operations corresponding to those performed by the encoding device.

[0092] Predictive information and residual information may be obtained from the bitstream. Based on the residual information, a residual sample for the current block may be derived. Specifically, based on the quantized conversion coefficients derived from the residual information, inverse quantization can be performed to derive conversion coefficients, and an inverse transformation can be performed on the conversion coefficients to derive a residual sample for the current block.

[0093] Specifically, the decoding device can derive an intra-prediction mode / type for the current block based on the received prediction information (intra-prediction mode / type information) (S500). The decoding device can derive surrounding reference samples for the current block (S510). The decoding device generates prediction samples within the current block based on the intra-prediction mode / type and the surrounding reference samples (S520). In this case, the decoding device can perform a prediction sample filtering procedure. Prediction sample filtering can be called post-filtering. Some or all of the prediction samples may be filtered by the prediction sample filtering procedure. In some cases, the prediction sample filtering procedure may be omitted.

[0094] The decoding device generates a residual sample for the current block based on the received residual information (S530). The decoding device can generate a restored sample for the current block based on the predicted sample and the residual sample, and derive a restored block containing the restored sample (S540). A restored picture may be generated for the current picture based on the restored block. As described above, an in-loop filtering procedure or the like may be further applied to the restored picture.

[0095] The intra prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether the MPM (most probable mode) or the remaining mode is applied to the current block. If the MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be configured as an MPM candidate list or an MPM list. If the MPM is not applied to the current block, the intra prediction mode information may further include remaining mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes excluding the intra prediction mode candidates (MPM candidates). The decoding device can determine the intra prediction mode of the current block based on the intra prediction mode information.

[0096] Furthermore, the intra-prediction type information may be embodied in various forms. For example, the intra-prediction type information may include intra-prediction type index information indicating one of the intra-prediction types. As another example, the intra-prediction type information may include reference sample line information (e.g., intra_luma_ref_idx) indicating whether the MRL is applied to the current block and, if so, which reference sample line is used; ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether the ISP is applied to the current block; ISP type information (e.g., intra_subpartitions_split_flag) indicating the subpartition splitting type if the ISP is applied; flag information indicating whether PDPC is applied; or flag information indicating whether LIP is applied. The intra-prediction type information may also include an MIP flag indicating whether MIP (matrix-based intra prediction) is applied to the current block.

[0097] The intra-prediction mode information and / or the intra-prediction type information may be encoded / decoded by the coding methods described in this document. For example, the intra-prediction mode information and / or the intra-prediction type information may be encoded / decoded by entropy coding (e.g., CABAC, CAVLC).

[0098] Figure 6 illustrates the intra-prediction procedure.

[0099] Referring to Figure 6, as described above, the intra-prediction procedure may include an intra-prediction mode / type determination stage, a peripheral reference sample derivation stage, and an intra-prediction execution (prediction sample generation) stage. The intra-prediction procedure may be performed by an encoding device and a decoding device as described above. In this document, the coding device may include an encoding device and / or a decoding device.

[0100] Referring to Figure 6, the coding device determines the intra-prediction mode / type (S600).

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

[0102] The intra prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether the MPM (most probable mode) or the remaining mode is applied to the current block. If the MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be configured as an MPM candidate list or an MPM list. If the MPM is not applied to the current block, the intra prediction mode information may further include remaining mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes excluding the intra prediction mode candidates (MPM candidates). The decoding device can determine the intra prediction mode of the current block based on the intra prediction mode information.

[0103] Furthermore, the intra-prediction type information may be embodied in various forms. For example, the intra-prediction type information may include intra-prediction type index information indicating one of the intra-prediction types. As another example, the intra-prediction type information may include reference sample line information (e.g., intra_luma_ref_idx) indicating whether the MRL is applied to the current block and, if so, which reference sample line is used; ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether the ISP is applied to the current block; ISP type information (e.g., intra_subpartitions_split_flag) indicating the subpartition splitting type if the ISP is applied; flag information indicating whether PDPC is applied or flag information indicating whether LIP is applied. The intra-prediction type information may also include an MIP flag indicating whether MIP (matrix-based intra prediction) is applied to the current block.

[0104] For example, when intra-prediction is applied, the intra-prediction mode applied to the current block may be determined using the intra-prediction modes of the surrounding blocks. For example, the coding device may select one of the MPM (most probable mode) candidates in the MPM (most probable mode) list derived based on the intra-prediction modes and / or additional candidate modes of the surrounding blocks of the current block (e.g., the surrounding blocks to the left and / or above) based on the received MPM index, or it may select one of the remaining intra-prediction modes not included in the MPM candidates (and planner modes) based on MPM retainer information (remaining intra-prediction mode information). The MPM list may or may not include planar mode as a candidate. For example, if the MPM list includes planar mode as a candidate, the MPM list may have 6 candidates, and if the MPM list does not include planar mode as a candidate, the MPM list may have 5 candidates. If the MPM list does not include planar mode as a candidate, a not-planar flag (e.g., intra_luma_not_planar_flag) indicating whether the current block's intra-prediction mode is not planar mode may be signaled. For example, the MPM flag may be signaled first, and the MPM index and not-planar flag may be signaled if the value of the MPM flag is 1. Also, the MPM index may be signaled if the value of the not-planar flag is 1. Here, the reason why the MPM list is configured not to include planar mode as a candidate is not because planar mode is not an MPM, but because planar mode is always considered as an MPM, so the flag (not-planar flag) is signaled first to check whether it is planar mode or not.

[0105] For example, whether the intra-prediction mode currently applied to a block is in MPM candidate (and planar mode) or remaining mode may be indicated based on the MPM flag (e.g., intra_luma_mpm_flag). A value of 1 for the MPM flag may indicate that the intra-prediction mode for the current block is in MPM candidate (and planar mode), and a value of 0 for the MPM flag may indicate that the intra-prediction mode for the current block is not in MPM candidate (and planar mode). A value of 0 for the not-planar flag (e.g., intra_luma_not_planar_flag) may indicate that the intra-prediction mode for the current block is planar mode, and a value of 1 for the not-planar flag may indicate that the intra-prediction mode for the current block is not planar mode. The MPM index may be signaled in the form of an mpm_idx or intra_luma_mpm_idx syntax element, and the remaining intra-prediction mode information may be signaled in the form of a rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element. For example, the remaining intra-prediction mode information can be one of the remaining intra-prediction modes from the overall intra-prediction modes that are not included in the MPM candidate (and planar mode), indexed in order of prediction mode number. The intra-prediction mode may be an intra-prediction mode for a luma component (sample). The intra-prediction mode information may include at least one of the following: the MPM flag (e.g., intra_luma_mpm_flag), the not-planar flag (e.g., intra_luma_not_planar_flag), the MPM index (e.g., mpm_idx or intra_luma_mpm_idx), or the remaining intra-prediction mode information (rem_intra_luma_pred_mode or intra_luma_mpm_remainder). In this document, the MPM list may be referred to by various terms such as MPM candidate list, candModeList, etc.

[0106] When MIP is applied to the current block, a separate mpm flag for MIP (e.g., intra_mip_mpm_flag), an mpm index (e.g., intra_mip_mpm_idx), and remaining intra prediction mode information (e.g., intra_mip_mpm_remainder) may be signaled, while the not-planar flag may not be signaled.

[0107] In other words, generally, when a block is divided into segments, the current block and neighboring blocks to be coded have similar video characteristics. Therefore, there is a high probability that the current block and neighboring blocks have the same or similar intra-prediction modes. Thus, the encoder can use the intra-prediction mode of the neighboring block to encode the intra-prediction mode of the current block.

[0108] The coding device can configure an MPM (most probable modes) list for the current block. This MPM list can also be referred to as an MPM candidate list. Here, MPM can mean a mode used to improve coding efficiency by considering the similarity between the current block and surrounding blocks during intra predictive mode coding. As described above, the MPM list may include planar modes or may exclude them. For example, if the MPM list includes planar modes, the number of candidates in the MPM list may be six. If the MPM list does not include planar modes, the number of candidates in the MPM list may be five.

[0109] The encoding device can perform predictions based on various intra-prediction modes and determine the optimal intra-prediction mode based on the resulting RDO (rate-distortion optimization). In this case, the encoding device can determine the optimal intra-prediction mode using only the MPM candidates and planar modes configured in the MPM list, or it can determine the optimal intra-prediction mode using the remaining intra-prediction modes in addition to the MPM candidates and planar modes configured in the MPM list. Specifically, for example, if the intra-prediction type of the current block is not a normal intra-prediction type but a specific type (e.g., LIP, MRL, or ISP), the encoding device can determine the optimal intra-prediction mode by considering only the MPM candidates and planar modes as intra-prediction mode candidates for the current block. That is, in this case, the intra-prediction mode for the current block may be determined only from the MPM candidates and planar modes, and in this case, the mpm flag does not need to be encoded / signaled. In this case, the decoding device can infer that the mpm flag is 1, even if the mpm flag is not separately signaled.

[0110] On the other hand, generally, if the intra prediction mode of the current block is not planar mode but one of the MPM candidates in the MPM list, the encoding device generates an mpm index (mpm idx) indicating one of the MPM candidates. If the intra prediction mode of the current block does not exist in the MPM list either, the device generates MPM retainer information (remaining intra prediction mode information) indicating the same mode as the intra prediction mode of the current block from among the remaining intra prediction modes not included in the MPM list (and planar mode). The MPM retainer information may include, for example, an intra_luma_mpm_remainder syntax element.

[0111] The decoding device obtains intra-prediction mode information from the bitstream. The intra-prediction mode information may include at least one of the following: the MPM flag, the not-planar flag, the MPM index, and the MPM retainer information (remaining intra-prediction mode information). The decoding device may configure an MPM list. The MPM list is configured identically to the MPM list configured by the encoding device. That is, the MPM list may include intra-prediction modes of surrounding blocks, and may further include specific intra-prediction modes by a predetermined method.

[0112] The decoding device can determine the intra-prediction mode of the current block based on the MPM list and the intra-prediction mode information. For example, if the value of the MPM flag is 1, the decoding device can derive the planar mode as the intra-prediction mode of the current block (not planar flag based), or it can derive the candidate indicated by the MPM index from among the MPM candidates in the MPM list as the intra-prediction mode of the current block. Here, the MPM candidates may represent only the candidates included in the MPM list, or they may include the candidates included in the MPM list as well as the planar mode applicable when the value of the MPM flag is 1.

[0113] As another example, if the value of the MPM flag is 0, the decoding device can derive the intra-prediction mode indicated by the remaining intra-prediction mode information (which may be called mpm retainer information) from among the remaining intra-prediction modes not included in the MPM list and planar mode as the intra-prediction mode of the current block. On the other hand, as yet another example, if the intra-prediction type of the current block is a specific type (e.g., LIP, MRL, or ISP), the decoding device can derive the candidate indicated by the MPM flag in the planar mode or the MPM list as the intra-prediction mode of the current block without parsing / decoding / verifying the MPM flag.

[0114] The coding device derives the peripheral reference samples of the current block (S610). If intraprediction is applied to the current block, peripheral reference samples to be used for intraprediction of the current block may be derived. The peripheral reference samples of the current block may include a total of 2 x nH samples adjacent to the left boundary and bottom-left of the current block of size nW x nH, a total of 2 x nW samples adjacent to the top boundary and top-right of the current block, and one sample adjacent to the top-left of the current block. Alternatively, the peripheral reference samples of the current block may include upper peripheral samples of multiple columns and left peripheral samples of multiple rows. Furthermore, the surrounding reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block, which is of size nW x nH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right side of the current block.

[0115] On the other hand, when MRL is applied (i.e., when the value of the MRL index is greater than 0), the peripheral reference samples may be located on lines 1 and 2, other than line 0 adjacent to the current block on the left / above side, in which case the number of peripheral reference samples may increase. On the other hand, when ISP is applied, the peripheral reference samples may be derived on a subpartition basis.

[0116] The coding device performs intraprediction on the current block and derives a predicted sample (S620). The coding device can derive the predicted sample based on the intraprediction mode / type and the surrounding samples. The coding device can derive a reference sample from the surrounding reference samples of the current block based on the intraprediction mode of the current block, and can derive a predicted sample of the current block based on the reference sample.

[0117] On the other hand, when interpretation is applied, the prediction unit of the encoding / decoding device can perform interpretation on a block-by-block basis to derive predicted samples. Interpretation can represent predictions derived in a manner that depends on data elements of pictures other than the current picture (e.g., sample values ​​or motion information). When interpretation is applied to the current block, a predicted block (predicted sample array) for the current block can be derived based on a reference block (reference sample array) identified by motion vectors on the reference picture indicated by the reference picture index. At this time, in order to reduce the amount of motion information transmitted in interpretation mode, the motion information of the current block can be predicted on a block, subblock, or sample basis based on the correlation of motion information between the surrounding block and the current block. The motion information may include motion vectors and the reference picture index. The motion information may further include interpretation type information (L0 prediction, L1 prediction, Bi prediction, etc.). When interpretation is applied, the surrounding block may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture containing the reference block and the reference picture containing the temporally surrounding block may be the same or different. The temporally surrounding block may be called a collocated reference block (colCU), a collocated CU, etc., and the reference picture containing the temporally surrounding block may be called a collocated picture (colPic). For example, a list of motion information candidates may be constructed based on the surrounding blocks of the current block, and a flag or index information indicating which candidate is selected (used) to derive the motion vector and / or reference picture index of the current block may be signaled.Interpretation may be performed based on various prediction modes. For example, in skip mode and merge mode, the motion information of the current block may be identical to the motion information of the selected surrounding block. In skip mode, unlike merge mode, the residual signal does not need to be transmitted. In motion vector prediction (MVP) mode, the motion vector of the selected surrounding block is used as the motion vector predictor, and the motion vector difference may be signaled. In this case, the motion vector of the current block can be derived using the sum of the motion vector predictor and the motion vector difference.

[0118] The motion information may include L0 motion information and / or L1 motion information depending on the interpretation type (L0 prediction, L1 prediction, Bi prediction, etc.). A motion vector in the L0 direction may be called an L0 motion vector or MVL0, and a motion vector in the L1 direction may be called an L1 motion vector or MVL1. A prediction based on the L0 motion vector may be called an L0 prediction, a prediction based on the L1 motion vector may be called an L1 prediction, and a prediction based on both the L0 motion vector and the L1 motion vector may be called a paired (Bi) prediction. Here, the L0 motion vector may represent a motion vector associated with the reference picture list L0 (L0), and the L1 motion vector may represent a motion vector associated with the reference picture list L1 (L1). The reference picture list L0 may include a picture earlier than the current picture in the output order as a reference picture, and the reference picture list L1 may include a picture later than the current picture in the output order. The earlier picture may be called a forward (reference) picture, and the later picture may be called a backward (reference) picture. The reference picture list L0 may further include pictures that appear later than the current picture in the output order as reference pictures. In this case, the previous picture may be indexed first in the reference picture list L0, and the later picture may be indexed next. The reference picture list L1 may further include pictures that appear earlier than the current picture in the output order as reference pictures. In this case, the later picture may be indexed first in the reference picture list L1, and the previous picture may be indexed next. Here, the output order may correspond to the picture order count (POC) order.

[0119] Interpretation-based video / image encoding procedures can broadly include, for example, the following:

[0120] Figure 7 shows an example of an interpretation-based video / image encoding method.

[0121] The encoding device performs interpretation for the current block (S700). The encoding device can derive the interpretation mode and motion information of the current block and generate a predicted sample of the current block. Here, the interpretation mode determination, motion information derivation, and predicted sample generation procedures may be performed simultaneously, or one of the procedures may be performed before the others. For example, the interpretation unit of the encoding device may include a prediction mode determination unit, a motion information derivation unit, and a predicted sample derivation unit. The prediction mode determination unit can determine the prediction mode for the current block, the motion information derivation unit can derive the motion information of the current block, and the predicted sample derivation unit can derive a predicted sample of the current block. For example, the interpretation unit of the encoding device can search for blocks similar to the current block within a certain area (search area) of the reference picture by motion estimation and derive a reference block whose difference from the current block is the minimum or below a certain standard. Based on this, a reference picture index indicating the reference picture where the reference block is located can be derived, and a motion vector can be derived based on the positional difference between the reference block and the current block. The encoding device can determine which of the various prediction modes is applied to the current block. The encoding device can compare the RD costs for the various prediction modes and determine the optimal prediction mode for the current block.

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

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

[0124] The encoding device can derive a residual sample based on the predicted sample (S710). The encoding device can derive the residual sample by comparing the original sample of the current block with the predicted sample.

[0125] The encoding device encodes video information including prediction information and residual information (S720). The encoding device can output the encoded video information in the form of a bitstream. The prediction information may include prediction mode information (e.g., skip flag, merge flag, or model index) and motion information as information related to the prediction procedure. The motion information may include candidate selection information (e.g., merge index, mvp flag, or mvp index) which is information for deriving a motion vector. The motion information may also include the above-mentioned MVD information and / or reference picture index information. Furthermore, the motion information may include information indicating whether L0 prediction, L1 prediction, or paired (bi) prediction is applied. The residual information is information about the residual sample. The residual information may include information about the quantized conversion coefficients for the residual sample.

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

[0127] On the other hand, as described above, the encoding device can generate a reconstructed picture (including reconstructed samples and reconstructed blocks) based on the reference sample and the residual sample. This is because the encoding device derives the same prediction results as the decoding device, thereby increasing coding efficiency. Therefore, the encoding device can store the reconstructed picture (or reconstructed sample, reconstructed block) in memory and use it as a reference picture for interpretation. As described above, in-loop filtering procedures and the like may be further applied to the reconstructed picture.

[0128] An interpretation-based video / image decoding procedure could, in general, include the following:

[0129] Figure 8 shows an example of an interpretation-based video / image decoding method.

[0130] Referring to Figure 8, the decoding device can perform operations corresponding to those performed by the encoding device. Based on the received prediction information, the decoding device can make predictions for the current block and derive prediction samples.

[0131] Specifically, the decoding device can determine a prediction mode for the current block based on the received prediction information (S800). Based on the prediction mode information in the prediction information, the decoding device can determine which inter-prediction mode is applied to the current block.

[0132] For example, based on the merge flag, it can be determined whether the merge mode is applied to the current block or whether the (A)MVP mode is determined. Alternatively, based on the mode index, one of several inter-prediction mode candidates can be selected. The inter-prediction mode candidates may include skip mode, merge mode and / or (A)MVP mode, or may include various inter-prediction modes as described later.

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

[0134] As another example, when the (A)MVP mode is applied to the current block, the decoding device can configure the (A)MVP candidate list described later, and use the motion vector of the selected mvp candidate from among the mvp (motion vector predictor) candidates included in the (A)MVP candidate list as the mvp of the current block. The selection may be made based on the selection information (mvp flag or mvp index) described above. In this case, the MVD of the current block can be derived based on the information regarding the MVD, and the motion vector of the current block can be derived based on the mvp of the current block and the MVD. Furthermore, the reference picture index of the current block can be derived based on the reference picture index information. The picture indicated by the reference picture index in the reference picture list for the current block may be derived as the reference picture referenced for interpretation of the current block.

[0135] On the other hand, as will be described later, the movement information of the current block may be derived without constructing a candidate list, in which case the movement information of the current block may be derived by the procedure disclosed in the prediction mode described later. In this case, the candidate list construction described above may be omitted.

[0136] The decoding device can generate predicted samples for the current block based on the motion information of the current block (S820). In this case, the reference picture can be derived based on the reference picture index of the current block, and the predicted samples for the current block can be derived using the reference block sample indicated on the reference picture by the motion vector of the current block. In this case, as will be described later, a further predicted sample filtering procedure may be performed on all or part of the predicted samples for the current block.

[0137] For example, the interpretation unit of the decoding device may include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit. The prediction mode determination unit determines the prediction mode for the current block based on the prediction mode information received, the motion information derivation unit derives motion information (such as motion vectors and / or reference picture indices) for the current block based on the motion information received, and the prediction sample derivation unit derives prediction samples for the current block.

[0138] The decoding device generates a residual sample for the current block based on the received residual information (S830). The decoding device generates a restored sample for the current block based on the predicted sample and the residual sample, and can generate a restored picture based on this (S840). As described above, further procedures such as in-loop filtering may be applied to the restored picture thereafter.

[0139] Figure 9 illustrates the interpretation prediction procedure.

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

[0141] Referring to Figure 9, the coding device determines the interpretation mode for the current block (S900). Various interpretation modes may be used to predict the current block in the picture. For example, various modes such as merge mode, skip mode, MVP (motion vector prediction) mode, affine mode, subblock merge mode, and MMVD (merge with MVD) mode may be used. DMVR (Decoder side motion vector refinement) mode, AMVR (adaptive motion vector resolution) mode, BCW (Bi-prediction with CU-level weight), and BDOF (Bi-directional optical flow) may be used as additional or alternative modes. The affine mode can be called the affine motion prediction mode. The MVP mode can be called the AMVP (advanced motion vector prediction) mode. In this document, motion information candidates derived by some modes and / or some modes may be included as one of the motion information related candidates for other modes. For example, an HMVP candidate may be added as a merge candidate in the merge / skip mode, or as an mvp candidate in the MVP mode. When the HMVP candidate is used as a motion information candidate in the merge mode or skip mode, the HMVP candidate may be called an HMVP merge candidate.

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

[0143] The coding device derives motion information for the current block (S910). The motion information can be derived based on the inter-prediction mode.

[0144] The coding device can perform interpretation using the motion information of the current block. The encoding device can derive optimal motion information for the current block through a motion estimation procedure. For example, the encoding device can use the original block within the original picture for the current block to search for highly correlated similar reference blocks in fractional pixel units within a defined search range in the reference picture, thereby deriving motion information. Block similarity can be derived based on the difference in phase-based sample values. For example, block similarity may be calculated based on the SAD between the current block (or the template of the current block) and the reference block (or the template of the reference block). In this case, motion information can be derived based on the reference block with the smallest SAD within the search area. The derived motion information may be signaled to the decoding device in various ways based on the interpretation prediction mode.

[0145] The coding device performs interpretation based on motion information for the current block (S920). The coding device can derive predicted samples for the current block based on the motion information. The current block containing the predicted samples can be called a predicted block.

[0146] On the other hand, as described above, the encoding device can perform various encoding methods such as exponential Golomb, CAVLC (context-adaptive variable length coding), and CABAC (context-adaptive binary arithmetic coding). 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 values ​​of the syntax elements necessary for image restoration and the quantized values ​​of the conversion coefficients related to the residual.

[0147] For example, the coding method described above may be carried out as described later.

[0148] Figure 10 illustrates CABAC (context-adaptive binary arithmetic coding) for encoding a syntax element. For example, in the CABAC encoding process, if the input signal is a syntax element that is not a binary value, the encoding device can convert the input signal into a binary value by binaryizing the value of the input signal. If the input signal is already a binary value (i.e., the value of the input signal is a binary value), binaryization may be bypassed. Here, each binary digit 0 or 1 that makes up the binary value can be called a bin. For example, if the binary string after binaryization is 110, then 1, 1, and 0 are each called one bin. The bins for a syntax element can represent the value of the syntax element.

[0149] Subsequently, the binary-encoded bins of the syntax elements may be input to a regular encoding engine or a bypass encoding engine. The regular encoding engine of the encoding device can assign a context model that reflects probability values ​​to the bins and encode the bins based on the assigned context model. The regular encoding engine of the encoding device can update the context model for each bin after encoding it. The bins encoded as described above can be called context-coded bins.

[0150] On the other hand, when the binary-evolved bins of the syntax elements are input to the bypass encoding engine, they may be encoded as follows: For example, the bypass encoding engine of the encoding device omits the steps of estimating probabilities for the input bins and updating the probability model applied to the bins after encoding. When bypass encoding is applied, the encoding device can encode the input bins by applying a uniform probability distribution instead of assigning a context model, thereby improving the encoding speed. The bins encoded as described above can be called bypass bins.

[0151] Entropy decoding can be described as a process that performs the steps in entropy encoding described above in reverse order.

[0152] For example, when a syntax element is decoded based on a context model, the decoding device can receive a bin corresponding to the syntax element via a bitstream, determine a context model using the syntax element and the decoding information of the block to be decoded or surrounding blocks, or symbol / bin information decoded in a previous step, predict the probability of the received bin occurring based on the determined context model, perform arithmetic decoding of the bin, and derive the value of the syntax element. Subsequently, the context model of the next bin to be decoded may be updated to the determined context model.

[0153] Furthermore, for example, when a syntax element is bypass-decoded, the decoding device can receive the bins corresponding to the syntax element using a bitstream and decode the input bins by applying a uniform probability distribution. In this case, the decoding device can omit the procedure for deriving the context model of the syntax element and the procedure for updating the context model applied to the bins after decoding.

[0154] As described above, the residual sample may be derived as a quantized transformation coefficient through a transformation and quantization process. The quantized transformation coefficient can also be called the transformation coefficient. In this case, the transformation coefficient within a block may be signaled in the form of residual information. The residual information may include residual coding syntax. That is, an encoding device can construct residual coding syntax with the residual information, encode it, and output it in the form of a bitstream, and a decoding device can decode the residual coding syntax from the bitstream to derive the residual (quantized) transformation coefficient. The residual coding syntax may include syntax elements that indicate whether a transformation was applied to the block, the position of the last effective transformation coefficient within the block, whether effective transformation coefficients exist within subblocks, the size / sign of the effective transformation coefficients, etc., as will be described later.

[0155] For example, syntax elements related to residual data encoding / decoding can be represented as shown in the following table.

[0156] [Table 1-1]

[0157] [Table 1-2]

[0158] [Table 1-3]

[0159] The transform_skip_flag indicates whether a transformation is omitted in the associated block. The transform_skip_flag may be a syntax element of the transformation skip flag. The associated block may be a CB (coding block) or a TB (Transform block). With respect to transformation (and quantization) and residual coding procedures, CB and TB may be used interchangeably. For example, as mentioned above, a residual sample may be derived for a CB, and a (quantized) transformation coefficient may be derived by transformation and quantization of the residual sample. The residual coding procedure may generate and signal information (e.g., a syntax element) that efficiently indicates the position, size, sign, etc., of the (quantized) transformation coefficient. The quantized transformation coefficient can simply be called the transformation coefficient. In general, if the CB is not larger than the maximum TB, the size of the CB may be the same as the size of the TB, in which case the block to be transformed (and quantized) and residual coded can be called the CB or TB. On the other hand, if the CB is greater than the maximum TB, the block that is transformed (and quantized) and resistively coded can be called the TB. Below, the syntax elements related to resistive coding will be explained assuming that they are signaled in units of transformed blocks (TB), but this is an example, and as mentioned above, the TB may be used interchangeably with the coding block (CB).

[0160] On the other hand, the syntax elements that are signaled after the conversion skip flag is signaled may be the same as the syntax elements disclosed in Table 2 and / or Table 3, which will be described later. A specific description of the syntax elements will be given later.

[0161] Table 2-1

[0162] Table 2-2

[0163] Table 2-3

[0164] Table 2-4

[0165] Table 2-5

[0166] Table 2-6

[0167] Table 3-1

[0168] Table 3-2

[0169] Table 3-3

[0170] In this embodiment, as shown in Table 1, residual coding may be branched based on the value of the transform_skip_flag syntax element. That is, different syntax elements may be used for residual coding based on the value of the transform_skip_flag (whether or not a transform is skipped). Residual coding used when a transform skip is not applied (i.e., when a transform is applied) can be called Regular Residual Coding (RRC), and residual coding used when a transform skip is applied (i.e., when a transform is not applied) can be called Transform Skip Residual Coding (TSRC). Regular residual coding can also be called general residual coding. Regular residual coding can also be called a Regular Residual Coding syntax structure, and transform skip residual coding can also be called a Transform Skip Residual Coding syntax structure. Table 2 can represent the syntax elements of the residual coding when the value of transform_skip_flag is 0, i.e., when the transformation is applied, and Table 3 can represent the syntax elements of the residual coding when the value of transform_skip_flag is 1, i.e., when the transformation is not applied.

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

[0172] Referring to Table 2 above, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, abs_remainder, coeff_sign_flag, and / or dec_abs_level may be encoded / decoded. On the other hand, sb_coded_flag can also be represented as coded_sub_block_flag.

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

[0174] Subsequently, the encoding device divides the conversion block into 4x4 sub-blocks, and then uses a 1-bit syntax element, coded_sub_block_flag, for each 4x4 sub-block to indicate whether or not there are currently non-zero coefficients within the sub-block.

[0175] If the value of coded_sub_block_flag is 0, there is no further information to transmit, and the encoding device can terminate the encoding process for the subblock. Conversely, if the value of coded_sub_block_flag is 1, the encoding device can continue the encoding process for sig_coeff_flag. Subblocks containing the last non-zero coefficient do not require encoding of coded_sub_block_flag, and subblocks containing DC information of the conversion block are highly likely to contain non-zero coefficients, so coded_sub_block_flag is not encoded and its value can be assumed to be 1.

[0176] If the value of coded_sub_block_flag is 1, and it is determined that there is a non-zero coefficient in the subblock, the encoding device can encode sig_coeff_flag, which has a binary value, in the reverse scan order. The encoding device can encode a 1-bit syntax element sig_coeff_flag for each conversion coefficient in the scan order. If the value of the conversion coefficient at the current scan position is not 0, the value of sig_coeff_flag can be 1. Here, in the case of a subblock containing the last non-zero coefficient, there is no need to encode sig_coeff_flag for the last non-zero coefficient, so the encoding process for that subblock may be omitted. Level information encoding may be performed only when sig_coeff_flag is 1, and four syntax elements may be used in the level information encoding process. More specifically, each sig_coeff_flag[xC][yC] can indicate whether the level (value) of the conversion coefficient at each conversion coefficient position (xC,yC) in the current TB is non-zero. In one embodiment, the sig_coeff_flag may be an example of a syntax element of an effectiveness coefficient flag that indicates whether the quantized conversion coefficient is a non-zero effectiveness coefficient.

[0177] The remaining level value after encoding for sig_coeff_flag may be derived as follows. That is, the syntax element remAbsLevel, which indicates the level value that must be encoded, may be derived as follows.

[0178]

number

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

[0180] Furthermore, abs_level_gt1_flag can indicate whether the remAbsLevel at the scanning position (n) is greater than 1. For example, if the value of abs_level_gt1_flag is 0, the absolute value of the conversion coefficient at that position may be 1. Also, if the value of abs_level_gt1_flag is 1, the remAbsLevel, which indicates the level value that must be encoded later, may be updated as shown in the following formula.

[0181]

number

[0182] Furthermore, the least significant coefficient (LSB) value of remAbsLevel described in Equation 2 above may be encoded by par_level_flag as shown in Equation 3 below.

[0183]

number

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

[0185] The conversion coefficient level value remAbsLevel, which must be encoded after par_leve_flag encoding, may be updated as follows:

[0186]

number

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

[0188]

number

[0189] The following table also shows examples related to Equation 5 described above.

[0190] [Table 4]

[0191] Here, |coeff| represents the conversion coefficient level (value), and may be denoted as AbsLevel for the conversion coefficient. Furthermore, the sign of each coefficient may be encoded using a 1-bit symbol, coeff_sign_flag.

[0192] Furthermore, for example, if the value of the conversion skip flag is 1, the syntax elements sb_coded_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag, par_level_flag and / or abs_remainder for the residual coefficients of the conversion block may be parsed, as shown in Table 3, and the residual coefficients 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. Also, abs_level_gtx_flag can represent abs_level_gt1_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag and / or abs_level_gt9_flag. For example, abs_level_gtx_flag[n][j] may be a flag indicating whether the absolute value or level (value) of the conversion coefficient at scanning position n is greater than (j<<1)+1. The (j<<1)+1 may be replaced by predetermined critical values ​​such as the first critical value and the second critical value, depending on the circumstances.

[0193] On the other hand, while CABAC offers high performance, it suffers from poor throughput. This is due to CABAC's normal encoding engine, which uses previously updated probabilistic states and ranges through bin encoding, resulting in high data dependency and potentially long processing times to read the probabilistic intervals and determine the current state. CABAC's throughput problem can be solved by limiting the number of context-coded bins. For example, as shown in Table 2 above, the sum of bins used to represent sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag may be limited to a number determined by the size of the block. Furthermore, as shown in Table 3 above, the sum of the bins used to represent sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag, and abs_level_gt9_flag may be limited to a number determined by the size of the block. For example, if the block is a 4x4 size 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, for example, 28), and if the block is a 2x2 size 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, for example, 7).The limited number of bins can be indicated by remBinsPass1 or RemCcbs. Alternatively, for example, to increase CABAC processing capacity, the number of context coded bins may be limited for a block (CB or TB) containing the CG to be coded. In other words, the number of context coded bins may be limited on a block (CB or TB) basis. For example, if the current block size is 16x16, the number of context coded bins for the current block may be limited to 1.75 times the number of pixels in the current block, i.e., 448, regardless of the current CG.

[0194] In this case, if the encoding device has used all of the limited number of context coding bins to encode the context elements, it can bypass coding the remaining coefficients by binary coding them using the binary coding method for the coefficients described below, without using context coding. In other words, for example, if the number of context coding bins coded for a 4x4 CG is 32 (or, for example, 28), or the number of context coding bins coded for a 2x2 CG is 8 (or, for example, 7), then sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag that would otherwise be coded into context coding bins do not need to be coded further and may be immediately coded into dec_abs_level. Alternatively, for example, if the number of context-coded bins coded for a 4x4 block is limited to 1.75 times the total number of pixels in the block, i.e., 28, then any further sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded into context-coded bins do not need to be coded, and may be immediately coded into dec_abs_level as shown in Table 5 below.

[0195] [Table 5]

[0196] The |coeff| value may be derived based on dec_abs_level. In this case, the conversion coefficient value |coeff| may be derived as shown in the following equation.

[0197]

number

[0198] Furthermore, the coeff_sign_flag can indicate the sign of the conversion coefficient level at the scanning position (n). In other words, the coeff_sign_flag can indicate the sign of the conversion coefficient at the scanning position (n).

[0199] Figure 11 shows an example of the conversion coefficients within a 4x4 block.

[0200] The 4x4 block in Figure 11 represents an example of quantized coefficients. The block shown in Figure 11 may be a 4x4 transformation block, or a 4x4 subblock of an 8x8, 16x16, 32x32, or 64x64 transformation block. The 4x4 block in Figure 11 can represent a luma block or a chroma block.

[0201] On the other hand, as described above, if the input signal is a syntax element that is not a binary value, the encoding device can convert the input signal to a binary value by binaryizing the value of the input signal. The decoding device can decode the syntax element and derive the binaryized value of the syntax element (i.e., the binaryized bin), and can derive the value of the syntax element by inverse binaryizing the binaryized value. The binaryization process may be carried out using the truncated rice (TR) binary process, the k-th order Exp-Golomb (EGk) binary process, the k-th order limited Exp-Golomb (EGk), or the fixed-length (FL) binary process, as described later. Furthermore, the inverse binary evolution process can represent a process that derives the value of the syntax element based on the TR binary evolution process, the EGk binary evolution process, or the FL binary evolution process.

[0202] For example, the TR binary evolution process may be carried out as follows.

[0203] The input to the TR binary process may be a request for the TR binary and cMax and cRiceParam for the syntax element. The output to the TR binary process may be the TR binary for the value symbolVal corresponding to the binstring.

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

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

[0206]

number

[0207] Here, prefixVal can represent the prefix value of symbolVal. The prefix of the TR binstring of the syntax element (i.e., the prefix binstring) may be derived as described below.

[0208] For example, if prefixVal is less than cMax>>cRiceParam, the prefix binstring may be a bit string of length prefixVal+1 that is indexed by binIdx. That is, if prefixVal is less than cMax>>cRiceParam, the prefix binstring may be a bit string of prefixVal+1 bits indicated by binIdx. The bin for a binIdx smaller than prefixVal may be the same as 1. Also, the bin for a binIdx that is the same as prefixVal may be the same as 0.

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

[0210]

Table 6

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

[0212] Also, when cMax is larger than symbolVal and cRiceParam is larger than 0, a suffix bin string of the TR bin string may exist. For example, the suffix bin string may be derived as follows.

[0213] The suffix value of the symbolVal for the syntax element may be derived as follows.

[0214]

Equation

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

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

[0217] On the other hand, if the value of the input parameter cRiceParam is 0, the TR binary may be exactly truncated unary binarization, and the same cMax value as the maximum possible value of the syntax element being decoded may always be used.

[0218] Furthermore, for example, the EGk binary evolution process may be carried out as follows: The syntax element coded in ue(v) may be an Exp-Golomb coded syntax element.

[0219] As an example, the 0th-order Exp-Golomb (EG0) binary evolution process may be carried out as follows.

[0220] The parsing process for the syntax element may begin by reading the bits containing the first non-zero bit, starting from the current position of the bitstream, and counting the number of leading bits such as zero. This process can be represented as shown in the following table.

[0221] [Table 7]

[0222] Furthermore, the variable codeNum may be derived as follows:

[0223]

number

[0224] Here, the value returned by read_bits(leadingZeroBits), that is, the value indicated by read_bits(leadingZeroBits), can be interpreted as the binary representation of the unsigned integer for the most significant bit that was recorded first.

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

[0226] [Table 8]

[0227] The "prefix" bits may be the bits parsed as described above for the leadingZeroBits calculation and may be represented as 0 or 1 in the bit string in Table 8. That is, the bit strings represented as 0 or 1 in Table 8 can represent the prefix bit string. The "suffix" bits may be the bits parsed in the codeNum calculation and may be represented as xi in Table 8. That is, the bit strings represented as xi in Table 8 can represent the suffix bit string. Here, i may be a value in the range of 0 to LeadingZeroBits-1. Also, each xi may be the same as 0 or 1.

[0228] The bit string assigned to the aforementioned codeNum may be as shown in the following table.

[0229] [Table 9]

[0230] When the descriptor of a syntax element is ue(v), that is, when the syntax element is coded with ue(v), the value of the syntax element may be the same as codeNum.

[0231] Furthermore, for example, the EGk binary evolution process may be carried out as follows.

[0232] The input to the EGk binary process may be a request for EGk binary. The output to the EGk binary process may be EGk binary for the value symbolVal corresponding to the binstring.

[0233] The bit string of the EGk binary evolution process for symbolVal may be derived as follows:

[0234] [Table 10]

[0235] Referring to Table 10 above, each call of put(X) can be used to append the binary value X to the end of the binstring. Here, X can be 0 or 1.

[0236] Furthermore, for example, the limited EGk binary evolution process may be carried out as follows.

[0237] The input to the limitedEGk binary process may be a request for the limitedEGk binary, a rice parameter riceParam, a variable log2TransformRange representing the binary logarithm of the maximum value, and a variable maxPreExtLen representing the maximum prefix extension length. The output to the limitedEGk binary process may be the limitedEGk binary for the value symbolVal corresponding to the binstring.

[0238] The bit string of the limited EGk evolution process for symbolVal may be derived as follows.

[0239] [Table 11]

[0240] Also, for example, the FL evolution process may be performed as follows.

[0241] The input of the FL evolution process may be the requirements for FL evolution and cMax for the syntax element. Also, the output of the FL evolution process may be the FL evolution for the value symbolVal corresponding to the bit string.

[0242] The FL evolution may be configured using a bit string having a number of bits that is the fixed length of the symbol value symbolVal. Here, the fixed-length bits may be an unsigned integer bit string. That is, a bit string for the symbol value symbolVal may be derived by FL evolution, and the bit length (i.e., the number of bits) of the bit string may be a fixed length.

[0243] For example, the fixed length may be derived as follows.

[0244] [Equation]

[0245] The bin indexing for FL evolution may be a method that uses 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.

[0246] On the other hand, for example, the binary evolution process for the syntax element abs_remainder among the residual information may be carried out as follows.

[0247] The input to the binary evolution process for the abs_remainder may be the binary evolution request for the syntax element abs_remainder[n], the color component cIdx, and the luma position (x0, y0). The luma position (x0, y0) can indicate the top-left sample of the current luma transformation block, relative to the top-left luma sample of the picture.

[0248] The output of the binary evolution process for the abs_remainder may be the binary evolution of the abs_remainder (i.e., the binary evolution binstring of the abs_remainder). The binary evolution process may derive the available binstring for the abs_remainder.

[0249] The Rice parameter cRiceParam for the abs_remainder[n] may be derived by a Rice parameter derivation process that takes the hue component cIdx, luma position (x0, y0), current coefficient scan position (xC, yC), log2TbWidth (the binary logarithm of the width of the transformation block), and log2TbHeight (the binary logarithm of the height of the transformation block) as inputs. A detailed explanation of the Rice parameter derivation process will be given later.

[0250] Furthermore, for example, the cMax for the currently coded abs_remainder[n] may be derived based on the rice parameter cRiceParam. The cMax may be derived as follows:

[0251]

number

[0252] On the other hand, the binary representation of abs_remainder, that is, the binstring for abs_remainder, may be a concatenation of a prefix binstring and a suffix binstring if a suffix binstring exists. Also, if the suffix binstring does not exist, the binstring for abs_remainder may be the prefix binstring.

[0253] For example, the prefix binstring may be derived as described below.

[0254] The prefix value prefixVal of abs_remainder[n] may be derived as follows:

[0255]

number

[0256] The prefix of the binstring in abs_remainder[n] (i.e., the prefix binstring) may be derived by a TR binary process on prefixVal using cMax and cRiceParam as inputs.

[0257] If the prefix binstring is identical to a bitstring where all bits are 1 and the bit length is 6, then a suffix binstring of the binstring in abs_remainder[n] may exist and may be derived as described below.

[0258] The process for deriving the Rice parameter for abs_remainder[n] can be as follows.

[0259] The input of the rice parameter derivation process may be the hue component index (colour component index) cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), the binary logarithm (binary logarithm) of the width of the transform block log2TbWidth, and the binary logarithm index of the height of the transform block log2TbHeight. 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. Also, the output of the rice parameter derivation process may be the rice parameter cRiceParam.

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

[0261] [Table 12]

[0262] Subsequently, based on the given variable locSumAbs, the rice parameter cRiceParam may be derived as shown in the following table.

[0263] [Table 13]

[0264] Also, for example, in the rice parameter derivation process for abs_remainder[n], baseLevel may be set to 4.

[0265] Alternatively, the rice parameter cRiceParam may be determined based on whether or not the transformation of the current block is skipped. That is, if no transformation is applied to the current TB containing the current CG, in other words, if a transform skip is applied to the current TB containing the current CG, the rice parameter cRiceParam may be derived as 1.

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

[0267]

number

[0268] The suffix binstring of the abs_remainder may be derived by a limited EGk binary evolution process for the suffixVal, where k is set to cRiceParam+1, riceParam is set to cRiceParam, log2TransformRange is set to 15, and maxPreExtLen is set to 11.

[0269] On the other hand, for example, the binary evolution process for the syntax element dec_abs_level among the residual information may be carried out as follows.

[0270] The input to the binary evolution process for dec_abs_level may be the binary evolution request for the syntax element dec_abs_level[n], the color component cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), log2TbWidth which is the binary logarithm of the width of the transformation block, and log2TbHeight which is the binary logarithm of the height of the transformation block. The luma position (x0, y0) can indicate the top-left sample of the current luma transformation block relative to the top-left luma sample of the picture.

[0271] The output of the binary evolution process for dec_abs_level may be the binary evolution of dec_abs_level (i.e., the binary evolution of the dec_abs_level binstring). The binary evolution process may derive an available binstring for dec_abs_level.

[0272] The Rice parameter cRiceParam for dec_abs_level[n] may be derived by a Rice parameter derivation process that takes the hue component cIdx, luma position (x0, y0), current coefficient scan position (xC, yC), log2TbWidth (the binary logarithm of the width of the transformation block), and log2TbHeight (the binary logarithm of the height of the transformation block) as inputs. A detailed explanation of the Rice parameter derivation process will be given later.

[0273] Furthermore, for example, cMax for dec_abs_level[n] may be derived based on the rice parameter cRiceParam. cMax may be derived as follows:

[0274]

number

[0275] On the other hand, the binary representation of dec_abs_level[n], that is, the binstring for dec_abs_level[n], may be a concatenation of a prefix binstring and a suffix binstring if a suffix binstring exists. Also, if the suffix binstring does not exist, the binstring for dec_abs_level[n] may be the prefix binstring.

[0276] For example, the prefix binstring may be derived as described below.

[0277] The prefix value prefixVal of dec_abs_level[n] may be derived as follows:

[0278]

number

[0279] The prefix of the binstring in dec_abs_level[n] (i.e., the prefix binstring) may be derived by a TR binary process on prefixVal using cMax and cRiceParam as inputs.

[0280] If the prefix binstring is identical to a bitstring where all bits are 1 and the bit length is 6, then a suffix binstring of the binstring in dec_abs_level[n] may exist and may be derived as described below.

[0281] The process for deriving the Rice parameter for the aforementioned dec_abs_level[n] is as follows:

[0282] The inputs to the Rice parameter derivation process may be the color component index cIdx, the luma position (x0, y0), the current coefficient scan position (xC, yC), the binary logarithm of the width of the transformation block log2TbWidth, and the binary logarithm of the height of the transformation block log2TbHeight. The luma position (x0, y0) can indicate the upper left sample of the current luma transformation block, relative to the upper left luma sample of the picture. The output of the Rice parameter derivation process may be the Rice parameter cRiceParam.

[0283] For example, based on the array AbsLevel[x][y] for a transformation block having a given component index cIdx and the upper left corner position (x0, y0), the variable locSumAbs may be derived as shown in the pseudocode in the following table.

[0284] [Table 14]

[0285] Subsequently, based on the given variable locSumAbs, the rice parameter cRiceParam may be derived as shown in the following table.

[0286] [Table 15]

[0287] Furthermore, for example, in the process of deriving the Rice parameter for dec_abs_level[n], baseLevel may be set to 0, and ZeroPos[n] may be derived as shown in the following formula.

[0288]

number

[0289] Furthermore, the suffix value suffixVal of dec_abs_level[n] may be derived as follows:

[0290]

number

[0291] The suffix binstring of the binstring in dec_abs_level[n] may be derived by a limited EGk binary process for the suffixVal, where k is set to cRiceParam+1, trunkSuffixLen is set to 15, and maxPreExtLen is set to 11.

[0292] On the other hand, the RRC and TSRC mentioned above may have the following differences.

[0293] - For example, in TSRC, the rice parameter for the syntax element abs_remainder[] may be derived as 1. In RRC, the rice parameter cRiceParam of the syntax element abs_remainder[] 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 the current block (e.g., the current TB), the rice parameter cRiceParam for abs_remainder[] in TSRC for the current block may be derived as 1.

[0294] - Also, for example, referring to Tables 3 and 4, RRC may signal abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1], while TSRC may signal 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]KA. Here, abs_level_gtx_flag[n][0] can be represented as abs_level_gt1_flag or the first coefficient level flag, abs_level_gtx_flag[n][1] can be represented as abs_level_gt3_flag or the second coefficient level flag, abs_level_gtx_flag[n][2] can be represented as abs_level_gt5_flag or the third coefficient level flag, abs_level_gtx_flag[n][3] can be represented as abs_level_gt7_flag or the fourth coefficient level flag, and abs_level_gtx_flag[n][4] can be represented as abs_level_gt9_flag or the fifth coefficient level flag. Specifically, the first coefficient level flag may be a flag indicating whether the coefficient level is greater than a first critical value (e.g., 1), the second coefficient level flag may be a flag indicating whether the coefficient level is greater than a second critical value (e.g., 3), the third coefficient level flag may be a flag indicating whether the coefficient level is greater than a third critical value (e.g., 5), the fourth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fourth critical value (e.g., 7), and the fifth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fifth critical value (e.g., 9).As described above, TSRC can include abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], and abs_level_gtx_flag[n][4] in addition to abs_level_gtx_flag[n][0] and abs_level_gtx_flag[n][1], compared to RRC.

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

[0296] Furthermore, a dependent quantization can be proposed for the quantization process of residual samples. Dependent quantization can represent a method in which the set of allowed restoration values ​​for the current transformation coefficients depends on the values ​​of the transformation coefficients that precede the current transformation coefficients in the restoration order (values ​​of the transformation coefficient level). That is, for example, dependent quantization can be realized by (a) defining two scalar quantizers with different restoration levels, and (b) defining a process for transitioning between these scalar quantizers. Compared to existing independent scalar quantization, this dependent quantization may have the effect of making the allowed restoration vectors more densely packed in the N-dimensional vector space, where N can represent the number of transformation coefficients in the transformation block.

[0297] Figure 12 illustrates scalar quantizers used in dependent quantization. Referring to Figure 12, the position of the available restoration level may be specified by the quantization step size Δ. Referring to Figure 12, the scalar quantizers can be represented as Q0 and Q1. The scalar quantizers used may not be explicitly signaled in the bitstream but may be derived. For example, the quantizer used for the current transformation coefficient may be determined by the parity of the transformation coefficient level preceding the current transformation coefficient in the coding / restoration order.

[0298] Figure 13 illustrates the state transition and quantizer selection for dependent quantization.

[0299] Referring to Figure 13, the transition between two scalar quantizers (Q0 and Q1) may be realized by a state machine with four states. The four states can have four distinct values ​​(0, 1, 2, 3). In the coding / reconstruction sequence, the state for the current transformation coefficient may be determined by the parity of the transformation coefficient levels prior to the current transformation coefficient.

[0300] For example, when the inverse quantization process for a transformation block begins, the state for dependent quantization may be set to 0. Subsequently, the transformation coefficients for the transformation block may be restored in scan order (i.e., the same order in which they were entropy-decoded). For example, after the current transformation coefficients are restored, the state for dependent quantization may be updated as shown in Figure 13. The inverse quantization process for the transformation coefficients restored after the current transformation coefficients are restored in the scan order may be performed based on the updated state. k in Figure 13 can represent the value of the transformation coefficient, i.e., the transformation coefficient level value. For example, if the current state is 0, and k (value of the current transformation coefficient)&1 is 0, the state may be updated to 0, and if k&1 is 1, the state may be updated to 2. Also, for example, if the current state is 1, and k&1 is 0, the state may be updated to 2, and if k&1 is 1, the state may be updated to 0. Furthermore, for example, if the current state is 2, and k&1 is 0, the state may be updated to 1, and if k&1 is 1, the state may be updated to 3. Also, for example, if the current state is 3, and k&1 is 0, the state may be updated to 3, and if k&1 is 1, the state may be updated to 1. Referring to Figure 13, when the state is either 0 or 1, the scalar quantizer used in the inverse quantization process may be Q0, and when the state is either 2 or 3, the scalar quantizer used in the inverse quantization process may be Q1. The transformation coefficients may be inversely quantized in the scalar quantizer for the current state based on the quantization parameter for the restoration level of the transformation coefficients.

[0301] On the other hand, this document proposes embodiments related to residual data coding. The embodiments described herein may be combined with each other. As described above, residual data coding methods may include regular residual coding (RRC) and transform-skip residual coding (TSRC).

[0302] Of the two methods described above, the current residual data coding method for a block may be determined based on the values ​​of transform_skip_flag and sh_ts_residual_coding_disabled_flag, as shown in Table 1. Here, the syntax element sh_ts_residual_coding_disabled_flag can indicate whether or not the TSRC is available. Therefore, even if transform_skip_flag indicates that the transformation will be skipped, if sh_ts_residual_coding_disabled_flag indicates that the TSRC is not available, the syntax element RRC may be signaled to the transformation skip block. That is, RRC may be used when the value of transform_skip_flag is 0 or the value of sh_ts_residual_coding_disabled_flag is 1, and TSRC may be used in other cases.

[0303] While high coding efficiency can be achieved in specific applications (e.g., lossless coding) using the aforementioned slice_ts_residual_coding_disabled_flag, existing video / image coding standards do not propose any constraints when the dependent quantization and slice_ts_residual_coding_disabled_flag are used together. In other words, when dependent quantization is activated at high levels (e.g., SPS (sequence parameter set) syntax / VPS (video parameter set) syntax / DPS (Decoding parameter set) syntax / picture header syntax / slice header syntax, etc.) or low levels (CU / TU), and slice_ts_residual_coding_disabled_flag is set to 1, the RRC may perform unnecessary operations (i.e., operations due to dependent quantization), which can lead to a decrease in coding performance or unintended loss of coding performance due to incorrect settings in the encoding device. Therefore, in this embodiment, dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., currently coding the residual samples of the transformation skip blocks in the slice with RRC) are both used, and we propose a method of setting dependencies / constraints between the two techniques to prevent unintended coding losses or malfunctions.

[0304] This document proposes, as one embodiment, a method in which slice_ts_residual_coding_disabled_flag is dependent on ph_dep_quant_enabled_flag. For example, the syntax elements proposed in this embodiment may be as shown in the following table.

[0305] [Table 16]

[0306] According to this embodiment, the slice_ts_residual_coding_disabled_flag may be signaled when the value of the ph_dep_quant_enabled_flag is 0. Here, the ph_dep_quant_enabled_flag can indicate whether dependent quantization is available or not. For example, when the value of the ph_dep_quant_enabled_flag is 1, the ph_dep_quant_enabled_flag can indicate that dependent quantization is available, and when the value of the ph_dep_quant_enabled_flag is 0, the ph_dep_quant_enabled_flag can indicate that dependent quantization is not available.

[0307] Therefore, according to this embodiment, slice_ts_residual_coding_disabled_flag may be signaled only when dependent quantization is not available, and if dependent quantization is available and slice_ts_residual_coding_disabled_flag is not signaled, slice_ts_residual_coding_disabled_flag may be considered 0 (infer). On the other hand, ph_dep_quant_enabled_flag and slice_ts_residual_coding_disabled_flag may be signaled in picture header syntax and / or slice header syntax, or in other high-level syntax (HLS) (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low-level (CU / TU) syntax other than picture header syntax and slice header syntax. If the ph_dep_quant_enabled_flag is signaled using a syntax other than the picture header syntax, it may be given a different name. For example, the ph_dep_quant_enabled_flag can also be represented as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or sps_dep_quant_enabled_flag.

[0308] Furthermore, this document proposes other embodiments that establish dependencies / constraints between dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding the residual samples of the transformation skip blocks in the current slice with RRC). For example, this embodiment proposes a method to prevent unintended coding losses or malfunctions that may occur when both dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 are used, by ensuring that the state of dependent quantization is not used in coding the level values ​​of the transformation coefficients when the value of slice_ts_residual_coding_disabled_flag is 1. The residual coding syntax according to this embodiment may be as shown in the following table.

[0309] [Table 17-1]

[0310] [Table 17-2]

[0311] [Table 17-3]

[0312] [Table 17-4]

[0313] [Table 17-5]

[0314] [Table 17-6]

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

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

[0317] Furthermore, according to this embodiment, when the value of slice_ts_residual_coding_disabled_flag is 1, the dependent quantization state is not used in coding the level values ​​of the conversion coefficients, and the state update does not need to be performed. For example, the residual coding syntax according to this embodiment may be as shown in the following table.

[0318] [Table 18-1]

[0319] [Table 18-2]

[0320] [Table 18-3]

[0321] [Table 18-4]

[0322] [Table 18-5]

[0323] [Table 18-6]

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

[0325] Furthermore, referring to Table 18 above, if the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, the value of the conversion coefficient (conversion coefficient level) may be derived based on the QState. For example, referring to Table 18, the conversion coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived as (2*AbsLevel[xC][yC]-(QState>11:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] is the absolute value of the conversion coefficient derived based on the syntax element of the conversion coefficient, coeff_sign_flag[n] is the syntax element of the sign flag indicating the sign of the conversion coefficient, and (QState>1?1:0) can represent 1 if the value of state QState is greater than 1, i.e., if the value of state QState is 2 or 3, and 0 if the value of state QState is 1 or less, i.e., if the value of state QState is 0 or 1.

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

[0327] Furthermore, this document proposes other embodiments for setting dependencies / constraints between dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding residual samples of transform skip blocks in the slice in RRC). For example, this embodiment proposes a way to add a constraint using transform_skip_flag to the process of deriving the value of the transform coefficient (transform coefficient level) in the RRC by updating the state of dependent quantization or depending on the state. That is, this embodiment proposes a way to prevent the process of deriving the value of the transform coefficient (transform coefficient level) in the RRC by updating the state of dependent quantization and / or depending on the state from being used based on the transform_skip_flag. The residual coding syntax according to this embodiment may be as shown in the following table.

[0328] [Table 19-1]

[0329] [Table 19-2]

[0330] [Table 19-3]

[0331] [Table 19-4]

[0332] [Table 19-5]

[0333] [Table 19-6]

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

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

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

[0337] Furthermore, this document proposes, for example, the following embodiments.

[0338]

Table 20

[0339] Referring to Table 20, a method for deriving the ZeroPos of dec_abs_level based on ph_dep_quant_enabled_flag and transform_skip_flag may be selected. For example, if the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 1, the ZeroPos of dec_abs_level may be derived based on an equation that does not use the state value of dependent quantization. For example, as shown in Table 20 described above, ZeroPos may be derived as 1<<cRiceParam.

[0340] On the other hand, for example, if the value of ph_dep_quant_enabled_flag is 0 or the value of transform_skip_flag is 0, the ZeroPos of dec_abs_level may be derived depending on the state value of dependent quantization.

[0341] In addition, this document proposes various embodiments related to the signaling of the above-mentioned syntax element sh_ts_residual_coding_disabled_flag.

[0342] For example, as described above, since sh_ts_residual_coding_disabled_flag is a syntax element that defines whether TSRC is available or not, it may not be signaled when the transform skip block is not used. That is, it may be meaningful to signal the sh_ts_residual_coding_disabled_flag only when the syntax element for whether the transform skip block is used indicates that the transform skip block is used.

[0343] Therefore, this document proposes an implementation in which sh_ts_residual_coding_disabled_flag is signaled only when sps_transform_skip_enabled_flag is 1. The syntax according to this implementation is shown in the following table.

[0344] [Table 21]

[0345] Referring to Table 21, when sps_transform_skip_enabled_flag is 1, sh_ts_residual_coding_disabled_flag may be signaled, and when sps_transform_skip_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may not be signaled. Here, for example, sps_transform_skip_enabled_flag can indicate whether or not a transformation skip block is used. That is, for example, sps_transform_skip_enabled_flag can indicate whether or not transformation skipping is available. For example, if the value of sps_transform_skip_enabled_flag is 1, sps_transform_skip_enabled_flag can indicate that a transform_skip_flag may exist in the transform unit syntax, and if the value of sps_transform_skip_enabled_flag is 0, sps_transform_skip_enabled_flag can indicate that a transform_skip_flag does not exist in the transform unit syntax. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be considered 0 (infer). Furthermore, the aforementioned sps_transform_skip_enabled_flag may be signaled in SPS, or in other high-level syntax (such as VPS, PPS, picture header syntax, slice header syntax, etc.) or low-level syntax (such as slice data syntax, coding unit syntax, transformation unit syntax, etc.).Furthermore, this signal may be sent before slice_ts_residual_coding_disabled_flag.

[0346] Furthermore, this document proposes an embodiment that combines the above-described embodiments in relation to the signaling of sh_ts_residual_coding_disabled_flag. For example, an embodiment that signals sh_ts_residual_coding_disabled_flag as shown in the following table may be proposed.

[0347] [Table 22]

[0348] Referring to Table 22, sh_ts_residual_coding_disabled_flag may be signaled if sps_transform_skip_enabled_flag is 1 or ph_dep_quant_enabled_flag is 0, and may not be signaled otherwise. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0349] Alternatively, for example, an implementation that signals sh_ts_residual_coding_disabled_flag as shown in the following table may be proposed.

[0350] [Table 23]

[0351] Referring to Table 23, the sh_ts_residual_coding_disabled_flag may be signaled in the picture header. The aforementioned sh_ts_residual_coding_disabled_flag can be represented as ph_ts_residual_coding_disabled_flag. Also referring to Table 23, the ph_dep_quant_enabled_flag may be signaled in the picture header.

[0352] For example, referring to Table 23, ph_ts_residual_coding_disabled_flag may be signaled when ph_dep_quant_enabled_flag is 0 and sps_transform_skip_enabled_flag is 1, and in all other cases, ph_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if ph_ts_residual_coding_disabled_flag is not signaled, ph_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0353] On the other hand, in relation to the syntax elements described in the examples of this document, existing video / image coding standards may signal the ph_dep_quant_enabled_flag with picture header syntax, and the sh_ts_residual_coding_disabled_flag with slice header syntax. In connection with this, this document proposes an example in which both syntax elements are signaled with the same high-level syntax or low-level syntax.

[0354] For example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and sh_ts_residual_coding_disabled_flag are signaled in the picture header syntax. In this case, sh_ts_residual_coding_disabled_flag can be called ph_ts_residual_coding_disabled_flag.

[0355] Alternatively, for example, an embodiment may be proposed in which both the ph_dep_quant_enabled_flag and the sh_ts_residual_coding_disabled_flag are signaled in the slice header syntax. In this case, the ph_dep_quant_enabled_flag may be called sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or slice_dep_quant_enabled_flag, etc.

[0356] Alternatively, for example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled with the same HLS, but ph_ts_residual_coding_disabled_flag is signaled only when the value of ph_dep_quant_enabled_flag is 0. For example, an example in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled with picture header syntax is shown in the following table.

[0357] [Table 24]

[0358] Referring to Table 24, the ph_dep_quant_enabled_flag may be signaled in the picture header syntax, and if the value of the ph_dep_quant_enabled_flag is 0, the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax, and if the value of the ph_dep_quant_enabled_flag is 1, the ph_ts_residual_coding_disabled_flag may not be signaled. For example, if the ph_ts_residual_coding_disabled_flag is not signaled, the ph_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0359] On the other hand, as an example of the above-mentioned embodiment, it may be proposed that the ph_dep_quant_enabled_flag and the ph_ts_residual_coding_disabled_flag are signaled using high-level syntax other than picture header syntax (such as VPS, SPS, PPS, slice header syntax) or low-level syntax (such as slice data syntax, coding unit syntax, or conversion unit syntax).

[0360] Furthermore, an embodiment may be proposed in which, for example, both ph_ts_residual_coding_disabled_flag and ph_dep_quant_enabled_flag are signaled in the same HLS, but ph_dep_quant_enabled_flag is signaled only when the value of ph_ts_residual_coding_disabled_flag is 0.

[0361] [Table 25]

[0362] Referring to Table 25, the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax, and if the value of the ph_ts_residual_coding_disabled_flag is 0, the ph_dep_quant_enabled_flag may be signaled in the picture header syntax, and if the value of the ph_ts_residual_coding_disabled_flag is 1, the ph_dep_quant_enabled_flag may not be signaled. For example, if the ph_dep_quant_enabled_flag is not signaled, the ph_dep_quant_enabled_flag may be considered 0 (infer).

[0363] On the other hand, as an example of the above-described embodiment, it may be proposed that the ph_ts_residual_coding_disabled_flag and the ph_dep_quant_enabled_flag are signaled using a high-level syntax other than picture header syntax (such as VPS, SPS, PPS, slice header syntax) or a low-level syntax (such as slice data syntax, coding unit syntax, or conversion unit syntax).

[0364] Furthermore, for example, embodiments combining the embodiments described above may be proposed. For example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS, but ph_ts_residual_coding_disabled_flag is signaled only when the value of ph_dep_quant_enabled_flag is 0 or the value of sps_transform_skip_enabled_flag is 1.

[0365] [Table 26]

[0366] Referring to Table 26, the ph_dep_quant_enabled_flag may be signaled in the picture header syntax, and the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax if the value of the ph_dep_quant_enabled_flag is 0 or the value of the sps_transform_skip_enabled_flag is 1, otherwise the ph_ts_residual_coding_disabled_flag does not need to be signaled. Here, for example, the sps_transform_skip_enabled_flag can indicate whether or not a transformation skip block is used. That is, for example, the sps_transform_skip_enabled_flag can indicate whether or not transformation skipping is available. For example, if the value of sps_transform_skip_enabled_flag is 1, sps_transform_skip_enabled_flag can indicate that a transform_skip_flag may exist in the transform unit syntax, and if the value of sps_transform_skip_enabled_flag is 0, sps_transform_skip_enabled_flag can indicate that a transform_skip_flag does not exist in the transform unit syntax. For example, if ph_ts_residual_coding_disabled_flag is not signaled, ph_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0367] Furthermore, an embodiment may be proposed in which, for example, both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS (e.g., slice header syntax), but ph_ts_residual_coding_disabled_flag is signaled only when the value of ph_dep_quant_enabled_flag is 0 and the value of sps_transform_skip_enabled_flag is 1.

[0368] [Table 27]

[0369] Referring to Table 27, the ph_dep_quant_enabled_flag may be signaled in the picture header syntax, and the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax when the value of the ph_dep_quant_enabled_flag is 0 and the value of the sps_transform_skip_enabled_flag is 1, but otherwise the ph_ts_residual_coding_disabled_flag does not need to be signaled. For example, if the ph_ts_residual_coding_disabled_flag is not signaled, the ph_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0370] Furthermore, an embodiment may be proposed in which, for example, both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled by the same HLS, but ph_ts_residual_coding_disabled_flag is signaled only when the value of sps_transform_skip_enabled_flag is 1, and ph_dep_quant_enabled_flag is signaled only when the value of ph_ts_residual_coding_disabled_flag is 0.

[0371] [Table 28]

[0372] Referring to Table 28, when the value of sps_transform_skip_enabled_flag is 1, ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax, and when the value of ph_ts_residual_coding_disabled_flag is 0, ph_dep_quant_enabled_flag may be signaled in the picture header syntax. For example, when the value of sps_transform_skip_enabled_flag is 0, ph_ts_residual_coding_disabled_flag does not have to be signaled. For example, when ph_ts_residual_coding_disabled_flag is not signaled, ph_ts_residual_coding_disabled_flag may be considered 0 (infer). Furthermore, for example, if the value of ph_ts_residual_coding_disabled_flag is 1, the ph_dep_quant_enabled_flag does not need to be signaled. For example, if the ph_dep_quant_enabled_flag is not signaled, the ph_dep_quant_enabled_flag may be considered 0 (infer).

[0373] On the other hand, as described above, the syntax table information (syntax elements) disclosed in this document may be included in video information and may be composed / encoded by an encoding device and transmitted by a decoding device in the form of a bitstream. The decoding device can parse / decode the relevant syntax table information (syntax elements). The decoding device can perform block / video restoration procedures based on the decoded information.

[0374] Furthermore, this document proposes various implementations related to the signaling of the syntax element sh_ts_residual_coding_disabled_flag mentioned above.

[0375] For example, as mentioned above, high coding efficiency can be obtained in specific applications (e.g., lossless coding) using the slice_ts_residual_coding_disabled_flag, but existing video / image coding standards do not propose any constraints when sign data hiding (SDH) is used in conjunction with the slice_ts_residual_coding_disabled_flag.

[0376] Here, the method for omitting the sign data may be as follows: When deriving the transformation coefficient, the sign of the transformation coefficient may be derived based on a 1-bit sign flag (the syntax element coeff_sign_flag mentioned above). In connection with this, SDH can demonstrate a technique for omitting the explicit signaling of coeff_sign_flag for the first effective transformation coefficient in a Coefficient Group (CG) in order to improve coding efficiency. Here, the value of coeff_sign_flag for the first effective transformation coefficient may be derived based on the sum of the absolute levels (i.e., absolute values) of the effective transformation coefficients in the subblock / coefficient group. That is, the sign of the first effective transformation coefficient may be derived based on the sum of the absolute levels of the effective transformation coefficients in the subblock / coefficient group. On the other hand, an effective transformation coefficient can mean a non-zero transform coefficient whose (absolute) value is not zero. For example, if the sum of the absolute levels of the effective conversion coefficients is even, the value of coeff_sign_flag for the first effective conversion coefficient may be derived as 1, and if the sum of the absolute levels of the effective conversion coefficients is odd, the value of coeff_sign_flag for the first effective conversion coefficient may be derived as 0. In other words, for example, if the sum of the absolute levels of the effective conversion coefficients is even, the sign of the first effective conversion coefficient may be derived as a negative value, and if the sum of the absolute levels of the effective conversion coefficients is odd, the sign of the first effective conversion coefficient may be derived as a positive value. Alternatively, for example, if the sum of the absolute levels of the effective conversion coefficients is even, the value of coeff_sign_flag for the first effective conversion coefficient may be derived as 0, and if the sum of the absolute levels of the effective conversion coefficients is odd, the value of coeff_sign_flag for the first effective conversion coefficient may be derived as 1.In other words, for example, if the sum of the absolute levels of the effective conversion coefficients is even, the sign of the first effective conversion coefficient may be derived to be positive, and if the sum of the absolute levels of the effective conversion coefficients is odd, the sign of the first effective conversion coefficient may be derived to be negative.

[0377] For example, the SDH in the residual syntax can be shown in the following table.

[0378] [Table 29]

[0379] Referring to Table 29, the variable signHiddenFlag can indicate whether or not the SDH applies. The variable signHiddenFlag may also be called signHidden. For example, if the value of the variable signHiddenFlag is 0, it can indicate that the SDH does not apply, and if the value of the variable signHiddenFlag is 1, it can indicate that the SDH applies. For example, the value of the variable signHiddenFlag may be set based on signaled flag information (e.g., sh_sign_data_hiding_used_flag or pic_sign_data_hiding_enabled_flag or sps_sign_data_hiding_enabled_flag). Alternatively, for example, the value of the variable signHiddenFlag may be set based on lastSigScanPosSb and firstSigScanPosSb. Here, lastSigScanPosSb can indicate the last effective conversion coefficient position searched within the subblock / coefficient group by the scan order, and firstSigScanPosSb can indicate the first effective conversion coefficient position searched within the subblock / coefficient group by the scan order. Generally, lastSigScanPosSb may be located in a higher frequency component region than firstSigScanPosSb. Therefore, if lastSigScanPosSb-firstSigScanPosSb is greater than a predetermined critical value, the signHidden value may be derived to be 1 (i.e., SDH applied), and otherwise, the signHidden value may be derived to be 0 (i.e., SDH not applied). Here, for example, referring to Table 29, the critical value may be set to 3.

[0380] On the other hand, when the above-mentioned sign data hiding is activated in high-level syntax (VPS, SPS, PPS, slice header syntax, etc.) or low-level syntax (slice data syntax, coding unit syntax, conversion unit syntax, etc.), and slice_ts_residual_coding_disabled_flag is 1, the RRC sign data hiding process may be used for lossless coding. Therefore, lossless coding may become impossible due to incorrect settings in the encoding device. Alternatively, when loss coding (i.e., an irreversible coding method) is applied instead of lossless coding, and BDPCM is applied simultaneously while a residual signal with conversion skipping applied is coded with RRC, coding loss may occur because BDPCM performs SDH in accordance with the SDH application conditions, even though there are more intervals where the residual value becomes 0 due to the difference between residuals compared to the general case. Specifically, for example, if there are effective conversion coefficients (non-zero resistive data) at positions 0 and 15 within the CG, and the conversion coefficients at the remaining positions within the CG are 0, then SDH may be applied to the CG according to the SDH application conditions described above. Therefore, the sign data (i.e., the coding of the sign flag) for the first effective conversion coefficient of the CG may be omitted. Consequently, in this case, due to the omission of the sign data, the parity of the only two resistive data in the CG may be adjusted during the quantization stage, and a greater coding loss may occur compared to when SDH is not applied. Such cases can also occur in blocks to which BDPCM is not applied, but due to the characteristics of BDPCM, the level is reduced by the difference with the surrounding resistive data, so unfavorable situations when applying SDH may occur more frequently.

[0381] Therefore, this document proposes an implementation that sets dependencies / constraints between the two techniques to prevent unintended coding loss or malfunctions that may occur when SDH and residual coding (i.e., coding residual samples of transformation skip blocks in the slice with RRC) are used together when slice_ts_residual_coding_disabled_flag=1.

[0382] For example, this embodiment proposes a configuration in which slice_ts_residual_coding_disabled_flag is subordinate to pic_sign_data_hiding_enabled_flag. The residual coding syntax according to this embodiment may be as shown in the following table.

[0383] [Table 30]

[0384] Here, slice_ts_residual_coding_disabled_flag may be signaled in the slice header syntax, or in other high-level syntax (HLS) other than the slice header syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low-level (CU / TU). Similarly, pic_sign_data_hiding_enabled_flag may be signaled in the picture header syntax, or in other high-level syntax (HLS) other than the picture header syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low-level (CU / TU). For example, if the pic_sign_data_hiding_enabled_flag is signaled in syntax other than the picture header syntax, it may be given a different name. For example, the aforementioned pic_sign_data_hiding_enabled_flag may also be represented as sps_sign_data_hiding_enabled_flag.

[0385] Furthermore, sps_sign_data_hiding_enabled_flag may be a flag indicating whether or not sign data hiding is enabled. That is, for example, sps_sign_data_hiding_enabled_flag can indicate whether or not the sign data hiding is enabled. For example, if the value of sps_sign_data_hiding_enabled_flag is 1, sps_sign_data_hiding_enabled_flag can indicate that the sign data hiding is enabled, and if the value of sps_sign_data_hiding_enabled_flag is 0, sps_sign_data_hiding_enabled_flag can indicate that the sign data hiding is not enabled.

[0386] According to Table 30 disclosing this embodiment, slice_ts_residual_coding_disabled_flag may be signaled only when sign data hiding is unavailable. Also, when sign data hiding is available, slice_ts_residual_coding_disabled_flag does not need to be signaled, and the value of slice_ts_residual_coding_disabled_flag may be considered as 0 (currently coding the residual samples of the conversion skip blocks in the slice with TSRC syntax) or 1 (currently coding the residual samples of the conversion skip blocks in the slice with RRC syntax) (infer).

[0387] Furthermore, this document proposes a combination of the above-described examples in relation to the signaling of sh_ts_residual_coding_disabled_flag. For example, an example of signaling sh_ts_residual_coding_disabled_flag may be proposed as shown in the following table.

[0388] [Table 31]

[0389] Referring to Table 31, sh_ts_residual_coding_disabled_flag may be signaled when sps_transform_skip_enabled_flag is 1, ph_dep_quant_enabled_flag is 0, and pic_sign_data_hiding_enabled_flag is 0; otherwise, sh_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0390] On the other hand, the examples in Table 31 are illustrative, and examples may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and ph_ts_residual_coding_disabled_flag are all signaled in the same HLS (e.g., slice header syntax).

[0391] Alternatively, for example, an embodiment that signals sh_ts_residual_coding_disabled_flag may be proposed, as shown in the following table.

[0392] [Table 32]

[0393] Referring to Table 32, sh_ts_residual_coding_disabled_flag may be signaled when ph_dep_quant_enabled_flag is 0 and pic_sign_data_hiding_enabled_flag is 0, and may not be signaled otherwise. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0394] On the other hand, the examples in Table 32 are illustrative, and examples may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and ph_ts_residual_coding_disabled_flag are all signaled using the same HLS (e.g., slice header syntax).

[0395] Alternatively, for example, an embodiment that signals sh_ts_residual_coding_disabled_flag may be proposed, as shown in the following table.

[0396] [Table 33]

[0397] Referring to Table 33, sh_ts_residual_coding_disabled_flag may be signaled if ph_dep_quant_enabled_flag is 0 or pic_sign_data_hiding_enabled_flag is 0, and may not be signaled otherwise. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be considered 0 (infer).

[0398] Furthermore, this document proposes an example in which the syntax elements ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and slice_ts_residual_coding_disabled_flag described above are signaled using the same high-level or low-level syntax.

[0399] For example, an embodiment may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and slice_ts_residual_coding_disabled_flag are all signaled in the picture header syntax, as shown in the following table.

[0400] [Table 34]

[0401] In this case, the slice_ts_residual_coding_disabled_flag can be called ph_ts_residual_coding_disabled_flag.

[0402] Referring to Table 34, ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax. If the value of ph_ts_residual_coding_disabled_flag is 0 and the value of sps_dep_quant_enabled_flag is 1, then ph_dep_quant_enabled_flag may be signaled in the picture header syntax. Also, if the value of ph_ts_residual_coding_disabled_flag is 0, and the value of sps_sign_data_hiding_enabled_flag is 1, then pic_sign_data_hiding_enabled_flag may be signaled in the picture header syntax. On the other hand, for example, if the value of ph_ts_residual_coding_disabled_flag is 1, then ph_dep_quant_enabled_flag and pic_sign_data_hiding_enabled_flag do not need to be signaled.

[0403] Alternatively, for example, an embodiment may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and slice_ts_residual_coding_disabled_flag are all signaled in the picture header syntax, as shown in the following table.

[0404] [Table 35]

[0405] Referring to Table 35, if the value of sps_transform_skip_enabled_flag is 1, ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax. Also, for example, if the value of sps_transform_skip_enabled_flag is 0, ph_ts_residual_coding_disabled_flag may not be signaled. If ph_ts_residual_coding_disabled_flag is not signaled, ph_ts_residual_coding_disabled_flag may be considered 0 in the decoding device (infer).

[0406] Furthermore, referring to Table 35, if the value of ph_ts_residual_coding_disabled_flag is 0 and the value of sps_dep_quant_enabled_flag is 1, then ph_dep_quant_enabled_flag may be signaled in the picture header syntax. Also, if the value of ph_ts_residual_coding_disabled_flag is 0, and the value of sps_sign_data_hiding_enabled_flag is 1 and ph_dep_quant_enabled_flag is 0, then pic_sign_data_hiding_enabled_flag may be signaled in the picture header syntax. On the other hand, for example, if the value of ph_ts_residual_coding_disabled_flag is 1, then ph_dep_quant_enabled_flag and pic_sign_data_hiding_enabled_flag do not need to be signaled. Furthermore, for example, if ph_dep_quant_enabled_flag is not signaled, ph_dep_quant_enabled_flag may be considered 0 in the decoding device (infer). Also, for example, if pic_sign_data_hiding_enabled_flag is not signaled, pic_sign_data_hiding_enabled_flag may be considered 0 in the decoding device (infer).

[0407] On the other hand, the above-described examples are illustrative, and it may be proposed that ph_ts_residual_coding_disabled_flag, ph_dep_quant_enabled_flag, and pic_sign_data_hiding_enabled_flag are signaled using other high-level syntax (such as VPS, SPS, PPS, slice header syntax) or low-level syntax (such as slice data syntax, coding unit syntax, or conversion unit syntax) other than picture header syntax.

[0408] On the other hand, as described above, the information (syntax elements) in the syntax table disclosed in this document may be included in video information and may be composed / encoded by an encoding device and transmitted to a decoding device in the form of a bitstream. The decoding device can parse / decode the information (syntax elements) in the syntax table. The decoding device can perform block / video restoration procedures based on the decoded information.

[0409] Figure 14 schematically shows a video encoding method using the encoding device relating to this document. The method disclosed in Figure 11 may be performed using the encoding device disclosed in Figure 2. Specifically, for example, S1100 in Figure 11 may be performed by the prediction unit of the encoding device, S1110 in Figure 11 may be performed by the subtraction unit of the encoding device, and S1120 to S1140 in Figure 11 may be performed by the entropy encoding unit of the encoding device. Furthermore, although not shown, the process of generating a restored sample and a restored picture for the current block based on the residual sample and predicted sample for the current block may be performed by the addition unit of the encoding device.

[0410] The encoding device encodes a dependent quantization availability flag indicating whether or not dependent quantization is available (S1400). The encoding device can encode a dependent quantization availability flag indicating whether or not dependent quantization is available. Video information can include a dependent quantization availability flag. For example, the encoding device can determine whether or not dependent quantization is available for a block of pictures in a sequence, and can encode a dependent quantization availability flag indicating whether or not dependent quantization is available. For example, the dependent quantization availability flag may be a flag indicating whether or not dependent quantization is available. For example, the dependent quantization availability flag can indicate whether or not dependent quantization is available for a block of pictures in a sequence. For example, the dependent quantization enabled flag can indicate whether or not a dependent quantization usage flag exists, which indicates whether or not dependent quantization is currently used for a slice. For example, a value of 1 for the dependent quantization enabled flag can indicate that dependent quantization is enabled, and a value of 0 for the dependent quantization enabled flag can indicate that dependent quantization is not enabled. Alternatively, the dependent quantization enabled flag may be signaled in the SPS syntax or slice header syntax, for example. The syntax element of the dependent quantization enabled flag may be the sps_dep_quant_enabled_flag described above. The sps_dep_quant_enabled_flag can be called sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.

[0411] The encoding device encodes a sign data hiding availability flag indicating whether or not sign data hiding is available (S1410). The encoding device can encode a sign data hiding availability flag indicating whether or not sign data hiding is available. Video information can include a sign data hiding availability flag. For example, the encoding device can determine whether or not sign data hiding is available for a block of picture in a sequence and encode a sign data hiding availability flag indicating whether or not sign data hiding is available. For example, the sign data hiding availability flag may be a flag indicating whether or not sign data hiding is available. For example, the sign data hiding availability flag can indicate whether or not sign data hiding is available for a block of picture in a sequence. For example, the sign data hiding availability flag can indicate whether or not a sign data hiding usage flag exists, which indicates whether or not sign data hiding is currently used for a slice. For example, a value of 1 for the sign data hiding availability flag can indicate that sign data hiding is available, and a value of 0 for the sign data hiding availability flag can indicate that sign data hiding is not available. For example, a value of 1 for the sign data hiding availability flag can indicate that a sign data hiding usage flag may exist, and a value of 0 for the sign data hiding availability flag can indicate that a sign data hiding usage flag does not exist. Alternatively, for example, the sign data hiding availability flag may be signaled using SPS (Sequence Parameter Set) syntax.Alternatively, for example, the sign data hiding enabled flag may be signaled using picture header syntax or slice header syntax. The syntax element of the sign data hiding enabled flag may be the sps_sign_data_hiding_enabled_flag described above.

[0412] The encoding device encodes a TSRC availability flag indicating whether or not Transform Skip Residual Coding (TSRC) is available, based on the dependent quantization availability flag and the sign data hiding availability flag (S1420). The video information may include the TSRC availability flag.

[0413] For example, an encoding device can encode the TSRC availability flag based on the dependent quantization availability flag and the sign data hiding availability flag. For example, the TSRC availability flag may be encoded based on the dependent quantization availability flag, which has a value of 0, and the sign data hiding availability flag, which has a value of 0. That is, for example, the TSRC availability flag may be encoded when the value of the dependent quantization availability flag is 0 (i.e., the dependent quantization availability flag indicates that dependent quantization is not available) and the value of the sign data hiding availability flag is 0 (i.e., the sign data hiding availability flag indicates that sign data hiding is not available). In other words, for example, the TSRC availability flag may be signaled when the value of the dependent quantization availability flag is 0 (i.e., the dependent quantization availability flag indicates that dependent quantization is not available) and the value of the sign data hiding availability flag is 0 (i.e., the sign data hiding availability flag indicates that sign data hiding is not available). Also, for example, when the value of the sign data hiding availability flag is 1, the TSRC availability flag does not need to be encoded, and the decoding device may derive the value of the TSRC availability flag as 0. That is, for example, when the value of the sign data hiding availability flag is 1, the TSRC availability flag does not need to be signaled, and the decoding device may derive the value of the TSRC availability flag as 0. Also, for example, when the value of the dependent quantization availability flag is 1, the TSRC availability flag does not need to be encoded, and the decoding device may derive the value of the TSRC availability flag as 0. In other words, for example, if the value of the dependent quantization availability flag is 1 (for example, if dependent quantization is applied (or used) to the current block), the TSRC availability flag does not need to be signaled, and the decoding device may derive the value of the TSRC availability flag as 0. Therefore, for example, if dependent quantization and sign data hiding are not available to the current block, the TSRC availability flag may be signaled (or encoded).If dependent quantization and / or sign data hiding is available for the current block, the TSRC availability flag does not need to be signaled (or encoded), and the decoding device may derive the value of the TSRC availability flag as 0. Here, the current block may be a coding block (CB) or a transform block (TB).

[0414] Here, for example, the TSRC availability flag may be a flag indicating whether or not TSRC is available. That is, for example, the TSRC availability flag may be a flag indicating whether or not TSRC is available for a block in a slice. For example, a value of 1 for the TSRC availability flag may indicate that TSRC is not available, and a value of 0 for the TSRC availability flag may indicate that TSRC is available. Alternatively, for example, the TSRC availability flag may be signaled in the slice header syntax. The syntax element of the TSRC availability flag may be the sh_ts_residual_coding_disabled_flag described above.

[0415] On the other hand, for example, an encoding device can encode a transform skip availability flag indicating whether or not transform skipping is available. Video information can include a transform skip availability flag. For example, an encoding device can determine whether or not transform skipping is available for a block of pictures in a sequence, and can encode a transform skip availability flag indicating whether or not transform skipping is available. For example, the transform skip availability flag may be a flag indicating whether or not transform skipping is available. For example, the transform skip availability flag can indicate whether or not transform skipping is available for a block of pictures in a sequence. For example, the transform skip availability flag can indicate whether or not a transform skip flag may exist. For example, a transform skip availability flag with a value of 1 can indicate that the transform skipping is available, and a transform skip availability flag with a value of 0 can indicate that the transform skipping is not available. That is, for example, a transformation skip enable flag with a value of 1 can indicate that the transformation skip flag may exist, and a transformation skip enable flag with a value of 0 can indicate that the transformation skip flag does not exist. Also, for example, the transformation skip enable flag may be signaled using SPS (Sequence Parameter Set) syntax. The syntax element of the transformation skip enable flag may be the sps_transform_skip_enabled_flag described above.

[0416] Furthermore, for example, the TSRC availability flag may be encoded based on the sign data hiding availability flag, the dependent quantization availability flag, and / or the conversion skip availability flag. For example, the TSRC availability flag may be encoded based on the sign data hiding availability flag having a value of 0, the dependent quantization availability flag having a value of 0, and the conversion skip availability flag having a value of 1. That is, for example, the TSRC availability flag may be encoded (or signaled) when the value of the sign data hiding availability flag is 0 (i.e., the sign data hiding availability flag indicates that sign data hiding is not available), the value of the dependent quantization availability flag is 0 (i.e., the dependent quantization availability flag indicates that dependent quantization is not available), and the value of the conversion skip availability flag is 1 (i.e., the conversion skip availability flag indicates that conversion skipping is available). Furthermore, for example, if the value of the dependent quantization enable flag is 1, the TSRC enable flag does not need to be encoded, and the decoding device may derive the value of the TSRC enable flag as 0. That is, for example, if the value of the dependent quantization enable flag is 1, the TSRC enable flag does not need to be signaled, and the decoding device may derive the value of the TSRC enable flag as 0. Furthermore, for example, if the value of the conversion skip enable flag is 0, the TSRC enable flag does not need to be encoded, and the value of the TSRC enable flag may derive as 0. That is, for example, if the value of the conversion skip enable flag is 0, the TSRC enable flag does not need to be signaled, and the value of the TSRC enable flag may derive as 0.

[0417] The encoding device encodes the residual information for the current block based on the TSRC availability flag (S1430). The encoding device can encode the residual information for the current block based on the TSRC availability flag.

[0418] For example, an encoding device can determine the residual coding syntax for the current block based on the TSRC availability flag. For example, an encoding device can determine the residual coding syntax for the current block based on the TSRC availability flag to be one of the following: Regular Residual Coding (RRC) syntax and Transform Skip Residual Coding (TSRC) syntax. RRC syntax can represent syntax using RRC, and TSRC syntax can represent syntax using TSRC.

[0419] For example, based on the TSRC availability flag, which has a value of 1, the residual coding syntax for the current block may be determined to be Regular Residual Coding (RRC) syntax. In this case, for example, a conversion skip flag indicating whether or not to skip the transformation of the current block may be encoded, and the value of the conversion skip flag may be 1. For example, the video information may include a conversion skip flag for the current block. The conversion skip flag can indicate whether or not the transformation of the current block is skipped. That is, the conversion skip flag can indicate whether or not a transformation has been applied to the transformation coefficients of the current block. The syntax element indicating the conversion skip flag may be the transform_skip_flag described above. For example, if the value of the conversion skip flag is 1, the conversion skip flag can indicate that no transformation is applied to the current block (i.e., the transformation is skipped), and if the value of the conversion skip flag is 0, the conversion skip flag can indicate that a transformation is applied to the current block. For example, if the current block is a transformation skip block, the value of the conversion skip flag for the current block may be 1.

[0420] Furthermore, for example, based on the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined to be Transform Skip Residual Coding (TSRC) syntax. Furthermore, for example, a transform skip flag indicating whether or not the transformation of the current block is skipped may be encoded, and based on the transform skip flag having a value of 1 and the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined to be Transform Skip Residual Coding (TSRC) syntax. Furthermore, for example, a transform skip flag indicating whether or not the transformation of the current block is skipped may be encoded, and based on the transform skip flag having a value of 0 and the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined to be Regular Residual Coding (RRC) syntax.

[0421] Subsequently, for example, the encoding device can encode the residual information of the determined residual coding syntax for the current block. The encoding device can derive the residual sample for the current block and encode the residual information of the determined residual coding syntax for the residual sample of the current block. For example, the residual information of the Regular Residual Coding (RRC) syntax may be encoded based on the TSRC availability flag having a value of 1, or the residual information of the TSRC syntax may be encoded based on the TSRC availability flag having a value of 0. The video information may include the residual information.

[0422] For example, the encoding device can decide whether to perform interpretation or intrapretation on the current block, and can determine a specific interpretation mode or a specific intrapretation mode based on the RD cost. Depending on the determined mode, the encoding device can derive predicted samples for the current block, and can derive residual samples for the current block by subtracting the original samples and the predicted samples for the current block.

[0423] Subsequently, for example, the encoding device can derive the conversion coefficients for the current block based on the residual samples. For example, the encoding device can determine whether or not a conversion is applied to the current block. That is, the encoding device can determine whether or not a conversion is applied to the residual samples of the current block. The encoding device can determine whether or not a conversion is applied to the current block, taking coding efficiency into consideration. For example, the encoding device can determine that no conversion is applied to the current block. Blocks to which no conversion is applied can be called conversion-skip blocks. That is, for example, the current block may be a conversion-skip block.

[0424] If no transformation is applied to the current block, that is, if no transformation is applied to the residual sample, the encoding device can derive the derived residual sample as the current transformation coefficient. If a transformation is applied to the current block, that is, if a transformation is applied to the residual sample, the encoding device can perform a transformation on the residual sample to derive the transformation coefficient. The current block may contain a plurality of subblocks or coefficient groups (CG). The size of the subblocks of the current block may be 4x4 or 2x2. That is, the subblocks of the current block may contain up to 16 non-zero transformation coefficients or up to 4 non-zero transformation coefficients. Here, the current block may be a coding block (CB) or a transform block (TB). The transform coefficient can also be expressed as a residual coefficient.

[0425] On the other hand, the encoding device can determine whether or not dependent quantization is applied to the current block. For example, if dependent quantization is applied to the current block, the encoding device can perform the dependent quantization process on the transformation coefficients to derive the transformation coefficients of the current block. For example, if dependent quantization is applied to the current block, the encoding device can update the state (Qstate) for dependent quantization based on the coefficient level of the transformation coefficient immediately preceding the current transformation coefficient in the scanning order, derive the coefficient level of the current transformation coefficient based on the updated state and the syntax element for the current transformation coefficient, and quantize the derived coefficient level to derive the current transformation coefficient. For example, the current transformation coefficient may be quantized in a scalar quantizer for the updated state based on a quantization parameter for the restoration level of the current transformation coefficient.

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

[0427] For example, the residual information of the RRC syntax may include syntax elements for the transformation coefficient of the current block. Here, the transform coefficient can also be expressed as the residual coefficient.

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

[0429] Specifically, for example, the syntax element may include position information indicating the position of the last non-zero conversion coefficient in the current block's residual coefficient array. That is, the syntax element may include position information indicating the position of the last non-zero conversion coefficient in the current block's scanning order. The position information may include information indicating the column position prefix of the last non-zero conversion coefficient, information indicating the row position prefix of the last non-zero conversion coefficient, information indicating the column position suffix of the last non-zero conversion coefficient, and information indicating the row position suffix of the last non-zero conversion coefficient. The syntax elements for the aforementioned position information are last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. On the other hand, the non-zero conversion coefficient can also be called the significant coefficient.

[0430] Furthermore, for example, the syntax element may include a coded subblock flag indicating whether the current subblock of the current block contains a non-zero conversion coefficient, an effective coefficient flag indicating whether the conversion coefficient of the current block is a non-zero conversion coefficient, a first coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a first critical value, a parity level flag indicating the parity of the coefficient level, and / or a second coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a second critical value. Here, the coded subblock flag may be sb_coded_flag or coded_sub_block_flag, the effective coefficient flag may be sig_coeff_flag, the first coefficient level flag may be abs_level_gt1_flag or abs_level_gtx_flag, the parity level flag may be par_level_flag, and the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag.

[0431] Furthermore, for example, the syntax element may include coefficient value-related information for the conversion coefficients of the current block. The coefficient value-related information may be abs_remainder and / or dec_abs_level.

[0432] Furthermore, for example, the syntax element may include a sign flag indicating the sign of the conversion coefficient. The sign flag may be coeff_sign_flag.

[0433] On the other hand, for example, when the sign data hiding is applied to the current block, the sign flag of the first effective conversion coefficient of the current CG (coefficient group) within the current block does not need to be encoded and signaled. That is, for example, when the sign data hiding is applied to the current block, the syntax element does not need to include a sign flag indicating the sign of the first effective conversion coefficient. On the other hand, for example, whether or not the sign data hiding is applied to the current block may be derived based on the sign data hiding enabled flag and / or the position of the first and last effective conversion coefficients in the current CG. For example, the sign data hiding may be applied to the current CG of the current block if the value of the sign data hiding enabled flag is 1 and the value obtained by subtracting the first effective conversion coefficient position from the last effective conversion coefficient position is greater than 3 (i.e., the value of the sign data hiding enabled flag is 1 and the number of effective conversion coefficients in the current CG is greater than 3).

[0434] Furthermore, for example, if the residual coding syntax for the current block is determined to be the TSRC syntax, the encoding device can encode the residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax may include the syntax elements disclosed in Table 3 above.

[0435] For example, the residual information of the TSRC syntax may include syntax elements for the transformation coefficients of the current block. Here, the transformation coefficient can also be called the residual coefficient.

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

[0437] For example, the context-coded syntax element for the conversion coefficient may include a valid coefficient flag indicating whether the conversion coefficient is a non-zero conversion coefficient, a sign flag indicating the sign of the conversion coefficient, a first coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a first critical value, and / or a parity level flag indicating the parity of the coefficient level of the conversion coefficient. Furthermore, for example, the context-coded syntax element may include a second coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a second critical value, a third coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a third critical value, a fourth coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a fourth critical value, and / or a fifth coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a fifth critical value. Here, the effective coefficient flag may be sig_coeff_flag, the sign flag may be coeff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, and the parity level flag may be par_level_flag. Also, 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.

[0438] Furthermore, for example, the bypass-coded syntax element for the conversion coefficient may include coefficient level information for the value (or coefficient level) of the conversion coefficient and / or a sign flag indicating the sign for the conversion coefficient. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be coeff_sign_flag.

[0439] The encoding device generates a bitstream including the dependent quantization enable flag, the sign data hiding enable flag, the TSRC enable flag, and the residual information (S1440). For example, the encoding device can output video information including the dependent quantization enable flag, the sign data hiding enable flag, the TSRC enable flag, and the residual information as a bitstream. The bitstream may include the dependent quantization enable flag, the sign data hiding enable flag, the TSRC enable flag, and the residual information. The bitstream may further include the conversion skip enable flag.

[0440] On the other hand, the video information may include prediction-related information for the current block. The prediction-related information may include prediction mode information for the inter-prediction mode or intra-prediction mode performed on the current block.

[0441] On the other hand, the bitstream may be transmitted to a decoding device via a network or (digital) storage medium. Here, the network may include broadcast networks and / or communication networks, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[0442] Figure 15 schematically shows an encoding device that performs the video encoding method relating to this document. The method disclosed in Figure 14 may be performed by the encoding device disclosed in Figure 15. Specifically, for example, the entropy encoding unit of the encoding device in Figure 15 can perform steps S1400 to S1440 in Figure 14. Furthermore, although not shown, the process of deriving the predicted sample may be performed by the prediction unit of the encoding device, the process of deriving the residual sample for the current block based on the original sample and predicted sample for the current block may be performed by the subtraction unit of the encoding device, and the process of generating the restored sample and restored picture for the current block based on the residual sample and predicted sample for the current block may be performed by the addition unit of the encoding device.

[0443] Figure 16 schematically shows a video decoding method using a decoding device relating to this document. The method disclosed in Figure 16 may be performed using the decoding device disclosed in Figure 3. Specifically, for example, steps S1600 to S1630 in Figure 16 may be performed by the entropy decoding unit of the decoding device, step S1640 in Figure 16 may be performed by the residual processing unit of the decoding device, and step S1650 in Figure 16 may be performed by the addition unit of the decoding device. Furthermore, although not shown, the process of receiving prediction information for the current block may be performed by the entropy decoding unit of the decoding device, and the process of deriving the prediction sample for the current block may be performed by the prediction unit of the decoding device.

[0444] The decoding device obtains a dependent quantization availability flag (S1600) indicating whether dependent quantization is available or not. The decoding device can obtain video information including the dependent quantization availability flag using the bitstream. The video information may include the dependent quantization availability flag. For example, the dependent quantization availability flag may be a flag indicating whether dependent quantization is available or not. For example, the dependent quantization availability flag may indicate whether dependent quantization is available for a block of pictures in a sequence. For example, the dependent quantization availability flag may indicate whether a dependent quantization usage flag exists that indicates whether dependent quantization is currently used for a slice. For example, a dependent quantization enabled flag with a value of 1 can indicate that dependent quantization is enabled, and a dependent quantization enabled flag with a value of 0 can indicate that dependent quantization is disabled. Alternatively, the dependent quantization enabled flag may be signaled using SPS syntax or slice header syntax, for example. The syntax element of the dependent quantization enabled flag may be the sps_dep_quant_enabled_flag described above. The sps_dep_quant_enabled_flag can also be called sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.

[0445] The decoding device obtains a sign data hiding availability flag (S1610) to determine whether sign data hiding is available. The decoding device can obtain video information including the sign data hiding availability flag using a bitstream. The video information may include the sign data hiding availability flag. For example, the sign data hiding availability flag may be a flag indicating whether sign data hiding is available. For example, the sign data hiding availability flag may indicate whether sign data hiding is available for a block of pictures in a sequence. For example, the sign data hiding availability flag may indicate whether a sign data hiding usage flag exists that indicates whether sign data hiding is currently used for a slice. For example, a sign data hiding enabled flag with a value of 1 can indicate that sign data hiding is enabled, and a sign data hiding enabled flag with a value of 0 can indicate that sign data hiding is disabled. For example, a sign data hiding enabled flag with a value of 1 can indicate that the sign data hiding usage flag may exist, and a sign data hiding enabled flag with a value of 0 can indicate that the sign data hiding usage flag does not exist. Alternatively, for example, the sign data hiding enabled flag may be signaled using SPS (Sequence Parameter Set) syntax. Or, for example, the sign data hiding enabled flag may be signaled using picture header syntax or slice header syntax. The syntax element of the sign data hiding enabled flag may be the sps_sign_data_hiding_enabled_flag described above.

[0446] The decoding device obtains a TSRC availability flag (S1620) indicating whether or not Transform Skip Residual Coding (TSRC) is available, based on the dependent quantization availability flag and the sign data hiding availability flag. The video information may include the TSRC availability flag.

[0447] For example, the decoding device can obtain the TSRC availability flag based on the dependent quantization availability flag and the sign data hiding availability flag. For example, the TSRC availability flag may be obtained based on the dependent quantization availability flag, which has a value of 0, and the sign data hiding availability flag, which has a value of 0. That is, for example, the TSRC availability flag may be obtained when the value of the dependent quantization availability flag is 0 (i.e., the dependent quantization availability flag indicates that dependent quantization is not available) and the value of the sign data hiding availability flag is 0 (i.e., the sign data hiding availability flag indicates that sign data hiding is not available). In other words, for example, the TSRC availability flag may be signaled when the value of the dependent quantization availability flag is 0 (i.e., the dependent quantization availability flag indicates that dependent quantization is not available) and the value of the sign data hiding availability flag is 0 (i.e., the sign data hiding availability flag indicates that sign data hiding is not available). Also, for example, when the value of the sign data hiding availability flag is 1, the TSRC availability flag does not need to be acquired, and the value of the TSRC availability flag may be derived to be 0. That is, for example, when the value of the sign data hiding availability flag is 1, the TSRC availability flag does not need to be signaled, and the value of the TSRC availability flag may be derived to be 0. Also, for example, when the value of the dependent quantization availability flag is 1, the TSRC availability flag does not need to be acquired, and the value of the TSRC availability flag may be derived to be 0. In other words, for example, if the value of the dependent quantization availability flag is 1 (for example, if dependent quantization is applied (or used) to the current block), the TSRC availability flag does not need to be signaled, and the value of the TSRC availability flag may be derived to be 0. Therefore, for example, if dependent quantization and sign data hiding are not available to the current block, the TSRC availability flag may be signaled (or acquired).The TSRC availability flag may be signaled (or acquired) if dependent quantization and / or sign data hiding is available for the current block, and the value of the TSRC availability flag may be derived to be 0. Here, the current block may be a coding block (CB) or a transform block (TB).

[0448] Here, for example, the TSRC availability flag may be a flag indicating whether or not TSRC is available. That is, for example, the TSRC availability flag may be a flag indicating whether or not TSRC is available for a block within a slice. For example, a value of 1 for the TSRC availability flag may indicate that TSRC is not available, and a value of 0 for the TSRC availability flag may indicate that TSRC is available. Alternatively, for example, the TSRC availability flag may be signaled in the slice header syntax. The syntax element of the TSRC availability flag may be the sh_ts_residual_coding_disabled_flag described above.

[0449] On the other hand, for example, a decoding device can obtain a transform skip enable flag. The decoding device can obtain video information including the transform skip enable flag using a bitstream. The video information may include the transform skip enable flag. Here, the current block may be a coding block (CB) or a transform block (TB). For example, the transform skip enable flag may be a flag indicating whether or not a transform skip is enabled. For example, the transform skip enable flag can indicate whether or not a transform skip is enabled for a block of pictures in a sequence. For example, the transform skip enable flag can indicate whether or not a transform skip flag may exist. For example, a transform skip enable flag with a value of 1 can indicate that the transform skip is enabled, and a transform skip enable flag with a value of 0 can indicate that the transform skip is disabled. That is, for example, a transformation skip enable flag with a value of 1 can indicate that the transformation skip flag may exist, and a transformation skip enable flag with a value of 0 can indicate that the transformation skip flag does not exist. Also, for example, the transformation skip enable flag may be signaled using SPS (Sequence Parameter Set) syntax. The syntax element of the transformation skip enable flag may be the sps_transform_skip_enabled_flag described above.

[0450] Furthermore, for example, the TSRC availability flag may be obtained based on the sign data hiding availability flag, the dependent quantization availability flag, and / or the conversion skip availability flag. For example, the TSRC availability flag may be obtained based on the sign data hiding availability flag having a value of 0, the dependent quantization availability flag having a value of 0, and the conversion skip availability flag having a value of 1. That is, for example, the TSRC availability flag may be obtained (or signaled) when the value of the sign data hiding availability flag is 0 (i.e., the sign data hiding availability flag indicates that sign data hiding is not available), the value of the dependent quantization availability flag is 0 (i.e., the dependent quantization availability flag indicates that dependent quantization is not available), and the value of the conversion skip availability flag is 1 (i.e., the conversion skip availability flag indicates that conversion skipping is available). Furthermore, for example, if the value of the dependent quantization availability flag is 1, the TSRC availability flag does not need to be acquired, and the value of the TSRC availability flag may be derived to be 0. That is, for example, if the value of the dependent quantization availability flag is 1, the TSRC availability flag does not need to be signaled, and the value of the TSRC availability flag may be derived to be 0. Furthermore, for example, if the value of the conversion skip availability flag is 0, the TSRC availability flag does not need to be acquired, and the value of the TSRC availability flag may be derived to be 0. That is, for example, if the value of the conversion skip availability flag is 0, the TSRC availability flag does not need to be signaled, and the value of the TSRC availability flag may be derived to be 0.

[0451] The decoding device obtains residual information for the current block based on the TSRC availability flag (S1630). The decoding device can obtain residual information for the current block based on the TSRC availability flag.

[0452] For example, a decoding device can determine the residual coding syntax for the current block based on the TSRC availability flag. For example, based on the TSRC availability flag, the decoding device can determine the residual coding syntax for the current block to be one of the following: Regular Residual Coding (RRC) syntax and Transform Skip Residual Coding (TSRC) syntax. RRC syntax can represent syntax using RRC, and TSRC syntax can represent syntax using TSRC.

[0453] For example, based on the TSRC availability flag, which has a value of 1, the residual coding syntax for the current block may be determined to be Regular Residual Coding (RRC) syntax. In this case, for example, based on the transform skip availability flag, which has a value of 1, a transform skip flag may be obtained indicating whether or not to skip the transformation of the current block, and the value of the transform skip flag may be 1. For example, the video information may include a transform skip flag for the current block. The transform skip flag can indicate whether or not to skip the transformation of the current block. That is, the transform skip flag can indicate whether or not a transformation has been applied to the transformation coefficients of the current block. The syntax element representing the transform skip flag may be the transform_skip_flag described above. For example, if the value of the transform skip flag is 1, the transform skip flag can indicate that no transformation is applied to the current block (i.e., the transformation is skipped), and if the value of the transform skip flag is 0, the transform skip flag can indicate that a transformation is applied to the current block. For example, if the current block is a conversion skip block, the value of the conversion skip flag for the current block may be 1.

[0454] Furthermore, for example, based on the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined to be Transform Skip Residual Coding (TSRC) syntax. Also, for example, a transform skip flag may be obtained to indicate whether or not to skip the transformation of the current block, and based on the transform skip flag having a value of 1 and the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined to be Transform Skip Residual Coding (TSRC) syntax. Also, for example, a transform skip flag may be obtained to indicate whether or not to skip the transformation of the current block, and based on the transform skip flag having a value of 0 and the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined to be Regular Residual Coding (RRC) syntax.

[0455] Subsequently, for example, the decoding device can obtain residual information for the determined residual coding syntax for the current block. For example, residual information for the Regular Residual Coding (RRC) syntax may be obtained based on the TSRC availability flag having a value of 1, or residual information for the TSRC syntax may be obtained based on the TSRC availability flag having a value of 0. The video information may include residual information.

[0456] For example, if the residual coding syntax for the current block is determined to be the RRC syntax, the decoding device can obtain the residual information for the RRC syntax for the current block. For example, the residual information for the RRC syntax may include the syntax elements disclosed in Table 2 above.

[0457] For example, the residual information of the RRC syntax may include syntax elements for the transformation coefficient of the current block. Here, the transform coefficient can also be expressed as the residual coefficient.

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

[0459] Specifically, for example, the syntax element may include position information indicating the position of the last non-zero conversion coefficient in the current block's residual coefficient array. That is, the syntax element may include position information indicating the position of the last non-zero conversion coefficient in the current block's scanning order. The position information may include information indicating the column position prefix of the last non-zero conversion coefficient, information indicating the row position prefix of the last non-zero conversion coefficient, information indicating the column position suffix of the last non-zero conversion coefficient, and information indicating the row position suffix of the last non-zero conversion coefficient. The syntax elements for the aforementioned position information may be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. On the other hand, the non-zero conversion coefficient can also be called the significant coefficient.

[0460] Furthermore, for example, the syntax element may include a coded subblock flag indicating whether the current subblock of the current block contains a non-zero conversion coefficient, an effective coefficient flag indicating whether the conversion coefficient of the current block is a non-zero conversion coefficient, a first coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a first critical value, a parity level flag indicating the parity of the coefficient level, and / or a second coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a second critical value. Here, the coded subblock flag may be sb_coded_flag or coded_sub_block_flag, the effective coefficient flag may be sig_coeff_flag, the first coefficient level flag may be abs_level_gt1_flag or abs_level_gtx_flag, the parity level flag may be par_level_flag, and the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag.

[0461] Furthermore, for example, the syntax element may include coefficient value-related information for the conversion coefficients of the current block. The coefficient value-related information may be abs_remainder and / or dec_abs_level.

[0462] Furthermore, for example, the syntax element may include a sign flag indicating the sign of the conversion coefficient. The sign flag may be coeff_sign_flag.

[0463] On the other hand, for example, when the sign data hiding is applied to the current block, the sign flag of the first effective conversion coefficient of the current CG (coefficient group) within the current block does not need to be signaled. That is, for example, when the sign data hiding is applied to the current block, the syntax element does not need to include a sign flag indicating the sign of the first effective conversion coefficient. On the other hand, for example, whether or not the sign data hiding is applied to the current block may be derived based on the sign data hiding enabled flag and / or the position of the first and last effective conversion coefficients in the current CG. For example, the sign data hiding may be applied to the current CG of the current block if the value of the sign data hiding enabled flag is 1 and the value obtained by subtracting the first effective conversion coefficient position from the last effective conversion coefficient position is greater than 3 (i.e., the value of the sign data hiding enabled flag is 1 and the number of effective conversion coefficients in the current CG is greater than 3).

[0464] Furthermore, for example, if the residual coding syntax for the current block is determined to be the TSRC syntax, the decoding device can obtain the residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax may include the syntax elements disclosed in Table 3 above.

[0465] For example, the residual information of the TSRC syntax may include syntax elements for the transformation coefficient of the current block. Here, the transformation coefficient can also be expressed as the residual coefficient.

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

[0467] For example, the context-coded syntax element for the conversion coefficient may include a valid coefficient flag indicating whether the conversion coefficient is a non-zero conversion coefficient, a sign flag indicating the sign of the conversion coefficient, a first coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a first critical value, and / or a parity level flag indicating the parity of the coefficient level of the conversion coefficient. Furthermore, for example, the context-coded syntax element may include a second coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a second critical value, a third coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a third critical value, a fourth coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a fourth critical value, and / or a fifth coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a fifth critical value. Here, the effective coefficient flag may be sig_coeff_flag, the sign flag may be coeff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, and the parity level flag may be par_level_flag. Also, 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.

[0468] Furthermore, for example, the bypass-coded syntax element for the conversion coefficient may include coefficient level information for the value (or coefficient level) of the conversion coefficient and / or a sign flag indicating the sign for the conversion coefficient. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be coeff_sign_flag.

[0469] The decoding device derives the residual sample of the current block based on the residual information (S1640). For example, the decoding device can derive a conversion coefficient of the current block based on the residual information, and can derive the residual sample of the current block based on the conversion coefficient.

[0470] For example, the decoding device can derive the conversion coefficients of the current block based on the syntax elements of the residual information. The decoding device can then derive the residual sample of the current block based on the conversion coefficients. For example, if it is derived from the conversion skip flag that no conversion is applied to the current block, i.e., if the value of the conversion skip flag is 1, the decoding device can derive the conversion coefficients as the residual sample of the current block. Alternatively, for example, if it is derived from the conversion skip flag that no conversion is applied to the current block, i.e., if the value of the conversion skip flag is 1, the decoding device can de-quantize the conversion coefficients to derive the residual sample of the current block. Alternatively, for example, if it is derived from the conversion skip flag that a conversion has been applied to the current block, i.e., if the value of the conversion skip flag is 0, the decoding device can de-transform the conversion coefficients to derive the residual sample of the current block. Alternatively, for example, if it is derived that a transformation has been applied to the current block based on the transformation skip flag, i.e., if the value of the transformation skip flag is 0, the decoding device can de-quantize the transformation coefficients and de-transform the de-quantized transformation coefficients to derive the residual sample of the current block.

[0471] On the other hand, when the dependent quantization is applied to the current block, the decoding device can perform the dependent quantization process on the transformation coefficients to derive the residual sample of the current block. For example, when the dependent quantization is applied to the current block, the decoding device can update the state (Qstate) for the dependent quantization based on the coefficient level of the transformation coefficient immediately preceding the current transformation coefficient in the scanning sequence, derive the coefficient level of the current transformation coefficient based on the updated state and the syntax element for the current transformation coefficient, and derive the residual sample by inverse quantization of the derived coefficient level. For example, the current transformation coefficient may be inverse quantized in a scalar quantizer for the updated state based on a quantization parameter for the restored level of the current transformation coefficient. Here, the restored level may be derived based on the syntax element for the current transformation coefficient.

[0472] On the other hand, for example, when the sign data hiding is applied to the current block, the sign of the first effective conversion coefficient of the current CG within the current block may be derived based on the sum of the absolute values ​​of the effective conversion coefficients within the current CG. For example, if the sum of the absolute values ​​of the effective conversion coefficients is even, the sign of the first effective conversion coefficient may be derived as a positive value, and if the sum of the absolute values ​​of the effective conversion coefficients is odd, the sign of the first effective conversion coefficient may be derived as a negative value.

[0473] The decoding device generates a restored picture based on the residual sample (S1650). For example, the decoding device can generate a restored sample and / or restored picture of the current block based on the residual sample. For example, the decoding device can derive a predicted sample by performing an inter-prediction mode or intra-prediction mode for the current block based on predicted information received by the bitstream, and generate the restored sample by adding the predicted sample and the residual sample.

[0474] As mentioned above, subsequently, in-loop filtering procedures such as deblocking filtering, SAO, and / or ALF procedures may be applied to the restored picture to improve subjective / objective image quality as needed.

[0475] Figure 17 schematically shows a decoding device that performs the video decoding method relating to this document. The method disclosed in Figure 16 may be performed by the decoding device disclosed in Figure 17. Specifically, for example, the entropy decoding unit of the decoding device in Figure 17 can perform S1600 to S1630 of Figure 16, the residual processing unit of the decoding device in Figure 17 can perform S1640 of Figure 16, and the adder unit of the decoding device in Figure 17 can perform S1650 of Figure 16. Furthermore, although not shown, the process of receiving prediction information for the current block may be performed by the entropy decoding unit of the decoding device in Figure 17, and the process of deriving the prediction sample for the current block may be performed by the prediction unit of the decoding device in Figure 17.

[0476] According to the document mentioned above, the efficiency of residual coding can be increased.

[0477] Furthermore, according to this document, a signaling relationship is established between the sign data hiding availability flag and the TSRC availability flag. By not signaling the TSRC availability flag when sign data hiding is unavailable, sign data hiding is not used when TSRC is unavailable and RRC syntax is coded for conversion skip blocks. This improves coding efficiency, reduces the amount of bits coded, and improves overall residual coding efficiency.

[0478] Furthermore, according to this document, by establishing a signaling relationship between the dependent quantization availability flag and the TSRC availability flag, and signaling the TSRC availability flag when dependent quantization is unavailable, dependent quantization is prevented from being used when TSRC is unavailable and the RRC syntax is coded for the conversion skip block. This improves coding efficiency, reduces the amount of bits coded, and improves overall residual coding efficiency.

[0479] Furthermore, according to this document, by establishing a signaling relationship between the conversion skip availability flag and the TSRC availability flag, and signaling the TSRC availability flag when conversion skipping is available, the amount of bits encoded can be reduced, thereby improving overall residual coding efficiency.

[0480] In the embodiments described above, the method is a series of steps or blocks and is explained based on a sequence diagram. However, this document is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Furthermore, those skilled in the art will understand that the steps shown in the sequence diagram are not exclusive, and other steps may be included, or one or more steps in the sequence diagram may be omitted without affecting the scope of this document.

[0481] The embodiments described herein may be implemented and performed on a processor, microprocessor, controller, or chip. For example, the functional units shown in each figure may be implemented and performed on a computer, processor, microprocessor, controller, or chip. In this case, information on instructions or algorithms for implementation may be stored on a digital storage medium.

[0482] Furthermore, the decoding and encoding devices to which the embodiments of this document apply may include multimedia broadcasting transceivers, mobile communication terminals, home cinema video equipment, digital cinema video equipment, surveillance cameras, video conferencing equipment, real-time communication equipment such as video communications, mobile streaming equipment, storage media, CAM coders, video-on-demand (VoD) service providers, OTT video (Over the Top) video equipment, internet streaming service providers, 3D video equipment, image-phone video equipment, transportation terminals (e.g., vehicle terminals, airplane terminals, ship terminals, etc.), and medical video equipment, and may be used to process video signals or data signals. For example, OTT video (Over the Top) equipment may include game consoles, Blu-ray players, internet-connected TVs, home theater systems, smartphones, tablet PCs, DVRs (Digital Video Recorders), etc.

[0483] Furthermore, the processing methods to which the embodiments of this document apply may be produced in the form of programs executed on a computer and stored on a computer-readable recording medium. Multimedia data having the data structure according to this document may also be stored on a computer-readable recording medium. The computer-readable recording medium includes all kinds of storage devices and distributed storage devices that store computer-readable data. The computer-readable recording medium may include, for example, Blu-ray discs (BDs), general-purpose serial buses (USBs), ROMs, PROMs, EPROMs, EEPROMs, RAMs, CD-ROMs, magnetic tapes, floppy disks, and optical data storage devices. The computer-readable recording medium also includes media embodied in the form of carrier waves (e.g., transmission over the Internet). Furthermore, a bitstream generated by an encoding method may be stored on a computer-readable recording medium and transmitted over a wireless communication network.

[0484] Furthermore, the embodiments described in this document may be embodied as computer program products in the form of program code, and the program code may be executed on a computer according to the embodiments described in this document. The program code may be stored on a computer-readable carrier.

[0485] Figure 18 illustrates a content streaming system structure diagram to which the embodiments described in this document apply.

[0486] The content streaming system to which the embodiments described herein apply may broadly include an encoding server, a streaming server, a web server, media storage, user equipment, and multimedia input devices.

[0487] The encoding server is responsible for compressing content input from multimedia input devices such as smartphones, cameras, and CAM coders into digital data, generating a bitstream, and transmitting it to the streaming server. In other cases, the encoding server may be omitted if the multimedia input device, such as a smartphone, camera, or CAM coder, directly generates the bitstream.

[0488] The bitstream may be generated by an encoding method or bitstream generation method to which the embodiments of this document apply, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0489] The streaming server transmits multimedia data to user devices based on user requests via a web server, and the web server acts as an intermediary to inform users about available services. When a user requests a desired service from the web server, the web server transmits it to the streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, in which case the control server is responsible for controlling the commands and responses between each device in the content streaming system.

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

[0491] Examples of user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, PDAs (personal digital assistants), PMPs (portable multimedia players), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, HMDs (head-mounted displays)), digital TVs, desktop computers, and digital signage. Each server in the content streaming system may be operated as a distributed server, in which case the data received by each server may be processed in a distributed manner.

[0492] The claims described herein may be combined in various ways. For example, the technical features of the method claims herein may be combined to embody an apparatus, and the technical features of the apparatus claims herein may be combined to embody a method. Furthermore, the technical features of the method claims and the technical features of the apparatus claims herein may be combined to embody an apparatus, and the technical features of the method claims and the technical features of the apparatus claims herein may be combined to embody a method.

Claims

1. A video decoding method performed by a decoding device, A step to obtain a dependent quantization availability flag to determine whether dependent quantization is available, The step of obtaining a sign data hiding availability flag to determine whether sign data hiding is available, A step of obtaining a TSRC disabled flag indicating whether the TSRC (Transform Skip Residual Coding) syntax is used, based on the dependent quantization enabled flag and the sign data hiding enabled flag, The steps include obtaining residual information for the current block based on the aforementioned TSRC disabled flag, The steps include: deriving the current block's residual sample based on the residual information; The step of generating a reconstructed picture based on the said residual sample, A video decoding method in which the TSRC disabled flag is obtained from a bitstream based on the value of the dependent quantization enabled flag being equal to 0.

2. A dependent quantization availability flag equal to 1 indicates that the dependent quantization is available. The video decoding method according to claim 1, wherein a dependent quantization availability flag equal to 0 indicates that dependent quantization is unavailable.

3. The TSRC disabled flag, which is equal to 1, indicates that the TSRC syntax is not used. The video decoding method according to claim 1, wherein the TSRC disabled flag, which is equal to 0, indicates that the TSRC syntax is used.

4. The video decoding method according to claim 3, wherein, based on the value of the TSRC disabled flag being equal to 1, the residual information for the current block is obtained from the residual coding syntax.

5. A conversion skip flag is obtained from the bitstream to determine whether a conversion skip is applied to the current block. The video decoding method according to claim 4, wherein the value of the conversion skip flag is 1.

6. The video decoding method according to claim 3, wherein the current block is a conversion skip block and the value of the TSRC disabled flag is equal to 0, and the residual information for the current block is obtained from the TSRC syntax.

7. The residual information of the TSRC syntax includes context-coded syntax elements for conversion coefficients, The context-coded syntax element is: An effectiveness factor flag indicating whether the aforementioned conversion coefficient is a non-zero conversion coefficient, A parity level flag for the parity of the coefficient level for the conversion coefficient, A sign flag indicating the sign of the conversion coefficient, A first coefficient level flag indicating whether the coefficient level is greater than the first critical value, and The video decoding method according to claim 6, further comprising a second coefficient level flag indicating whether the coefficient level of the conversion coefficient is greater than a second critical value.

8. Based on the fact that dependent quantization is available for the current block, the TSRC disabled flag is not obtained from the bitstream. The video decoding method according to claim 1, wherein the value of the TSRC disabled flag is derived to be 0.

9. A video encoding method performed by an encoding device, The steps include encoding a dependent quantization availability flag to indicate whether dependent quantization is available, The step of encoding a sign data hiding availability flag to indicate whether sign data hiding is available, A step of encoding a TSRC disabled flag indicating whether the TSRC (Transform Skip Residual Coding) syntax is used, based on the dependent quantization enabled flag and the sign data hiding enabled flag, The steps include encoding the residual information for the current block based on the aforementioned TSRC disabled flag, The step of generating a bitstream including the dependent quantization enable flag, the sign data hiding enable flag, the TSRC disabled flag, and the residual information, A video encoding method in which the TSRC disabled flag is encoded in the bitstream based on the value of the dependent quantization enabled flag being equal to 0.

10. A method for transmitting video data, The step of generating a bitstream relating to the aforementioned video, wherein the bitstream is: The steps include encoding a dependent quantization availability flag to indicate whether dependent quantization is available, The step of encoding a sign data hiding availability flag to indicate whether sign data hiding is available, A step of encoding a TSRC disabled flag indicating whether the TSRC (Transform Skip Residual Coding) syntax is used, based on the dependent quantization enabled flag and the sign data hiding enabled flag, A step of encoding residual information for the current block based on the TSRC disabled flag, and a step of generating by, The step of transmitting the data including the bitstream, A method in which the TSRC disabled flag is encoded in the bitstream based on the value of the dependent quantization available flag being equal to 0.