Video decoding method and apparatus

The video decoding method optimizes residual coding efficiency by using transform skip availability flags to reduce coded bits, addressing the increased data demands of high-resolution video.

JP7559186B2Active Publication Date: 2024-10-01LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023203949
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-02-25
Filing Date
2023-12-01
Publication Date
2024-10-01
Estimated Expiration
2041-02-25

AI Technical Summary

Technical Problem

The increasing demand for high-resolution, high-quality video has led to a surge in the amount of data, resulting in higher transmission and storage costs, necessitating more efficient video coding methods, particularly in residual coding.

Method used

A video decoding method that includes obtaining a transform skip availability flag, deriving prediction and residual information based on this flag, and generating a reconstructed picture, while signaling the flag to indicate whether transform skip residual coding is available, thereby optimizing coding efficiency.

Benefits of technology

This approach enhances residual coding efficiency by reducing the amount of coded bits and improving overall coding efficiency through strategic signaling of availability flags.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007559186000069
    Figure 0007559186000069
  • Figure 0007559186000070
    Figure 0007559186000070
  • Figure 0007559186000071
    Figure 0007559186000071
Patent Text Reader

Abstract

To provide an image decoding method for coding flag information indicating whether TSRC is available.SOLUTION: An image decoding method performed by a decoding apparatus according to the present document includes steps of: acquiring a transform skip available flag; acquiring a TSRC available flag on the basis of the transform skip available flag; acquiring prediction-related information regarding a current block; deriving a prediction sample of the current block on the basis of the prediction-related information; acquiring residual information of a residual coding syntax for the current block, derived on the basis of the TSRC available flag; deriving a residual sample of the current block on the basis of the residual information; and generating a reconstructed picture on the basis of the prediction sample and the residual sample.SELECTED DRAWING: Figure 16
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

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

[0002] In recent years, demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images has been increasing in various fields. As the resolution and quality of image data increases, the amount of information or bits to be transmitted increases compared to existing image data. Therefore, when transmitting image data using existing media such as wired or wireless broadband lines or storing image data using existing storage media, the costs of transmission and storage increase.

[0003] Therefore, highly efficient video compression technology is required to effectively transmit, store and play back high-resolution, high-quality video information. Summary of the Invention [Problem 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 improving the efficiency of residual coding. [Means for solving the problem]

[0006] According to one embodiment of the present document, there is provided a video decoding method performed by a decoding device, the method including: obtaining a transform skip available flag; obtaining a transform skip residual coding (TSRC) available flag based on the transform skip available flag; obtaining prediction-related information for a current block; deriving predicted samples of the current block based on the prediction-related information; obtaining residual information of a residual coding syntax for the current block derived based on the TSRC available flag; deriving residual samples of the current block based on the residual information; and generating a reconstructed picture based on the predicted samples and the residual samples, wherein the transform skip available flag is information regarding whether a transform skip is available, and the TSRC available flag is information regarding whether TSRC is available, and the TSRC available flag is obtained based on the transform skip available flag having a value of 1.

[0007] According to another embodiment of the present document, there is provided a decoding device for decoding video, the decoding device including: an entropy decoding unit that acquires a transform skip available flag, acquires a transform skip residual coding (TSRC) available flag based on the transform skip available flag, acquires prediction-related information for a current block, and acquires residual information of a residual coding syntax for the current block derived based on the TSRC available flag, a prediction unit that derives predicted samples of the current block based on the prediction-related information, a residual processing unit that derives residual samples of the current block based on the residual information, and an adder that generates a reconstructed picture based on the predicted samples and the residual samples, wherein the transform skip available flag is information regarding whether a transform skip is available, and the TSRC available flag is information regarding whether TSRC is available, and the TSRC available flag is acquired based on the transform skip available flag having a value of 1.

[0008] According to yet another embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including: deriving prediction samples of a current block based on inter prediction or intra prediction, deriving residual samples of the current block based on the prediction samples, encoding prediction-related information for the current block, encoding a transform skip available flag indicating whether a transform skip is available and a Transform Skip Residual Coding (TSRC) available flag indicating whether a transform skip is available, encoding residual information of a residual coding syntax for the residual sample derived based on the TSRC available flag, and generating a bitstream including the prediction-related information, the transform skip available flag, the TSRC available flag, and the residual information, wherein the TSRC available flag is encoded based on the transform skip available flag having a value of 1.

[0009] According to yet another embodiment of the present document, there is provided a video encoding apparatus, including: a prediction unit that derives prediction samples of a current block based on inter prediction or intra prediction; a residual processing unit that derives residual samples of the current block based on the prediction samples; and an entropy encoding unit that encodes prediction-related information for the current block, encodes a transform skip availability flag indicating whether a transform skip is available and a Transform Skip Residual Coding (TSRC) availability flag indicating whether TSRC is available, encodes residual information of a residual coding syntax for the residual sample derived based on the TSRC availability flag, and generates a bitstream including the prediction-related information, the transform skip availability flag, the TSRC availability flag, and the residual information, wherein the TSRC availability flag is encoded based on the transform skip availability flag having a value of 1.

[0010] According to yet another embodiment of the present document, there is provided a computer-readable digital storage medium storing a bitstream including video information for performing a video decoding method, wherein the video decoding method includes the steps of: acquiring a transform skip available flag; acquiring a transform skip residual coding (TSRC) available flag based on the transform skip available flag; acquiring prediction-related information for a current block; deriving predicted samples of the current block based on the prediction-related information; acquiring residual information of a residual coding syntax for the current block derived based on the TSRC available flag; deriving residual samples of the current block based on the residual information; and generating a reconstructed picture based on the predicted samples and the residual samples, wherein the transform skip available flag is information regarding whether a transform skip is available, and the TSRC available flag is information regarding whether TSRC is available, and the TSRC available flag is obtained based on the transform skip available flag having a value of 1. [Effects of the Invention]

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

[0012] According to this document, by establishing a signaling relationship between the dependent quantization available flag and the TSRC available flag and signaling the TSRC available flag when dependent quantization is not available, dependent quantization is not used when TSRC is not available and RRC syntax is coded for a transform skip block, thereby improving coding efficiency, reducing the amount of coded bits and improving overall residual coding efficiency.

[0013] According to this document, by establishing a signaling relationship between the transform skip available flag and the TSRC available flag and signaling the TSRC available flag when transform skip is available, the amount of coded bits can be reduced and the overall residual coding efficiency can be improved. [Brief explanation of the drawings]

[0014] [Figure 1] FIG. 1 illustrates a schematic diagram of an example video / image coding system to which embodiments of the present document may be applied.

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

[0016] [Figure 3] 1 is a diagram illustrating the configuration of a video / image decoding device to which an embodiment of this document can be applied.

[0017] [Figure 4] FIG. 1 illustrates an example of an intra-prediction based video / image encoding method.

[0018] [Figure 5] FIG. 1 illustrates an example of an intra-prediction based video / image encoding method.

[0019] [Figure 6] FIG. 1 illustrates an intra-prediction procedure.

[0020] [Figure 7] FIG. 1 illustrates an example of an inter-prediction based video / image encoding method.

[0021] [Figure 8] FIG. 1 illustrates an example of an inter-prediction based video / picture decoding method.

[0022] [Figure 9] FIG. 1 illustrates an inter-prediction procedure.

[0023] [Figure 10] FIG. 1 illustrates a context-adaptive binary arithmetic coding (CABAC) scheme for encoding syntax elements.

[0024] [Figure 11] FIG. 10 is a diagram illustrating an example of transform coefficients within a 4x4 block.

[0025] [Figure 12] FIG. 1 illustrates a scalar quantizer used in dependent quantization.

[0026] [Figure 13] FIG. 1 illustrates state transitions and quantizer selection for dependent quantization.

[0027] [Figure 14] 1 is a diagram illustrating a video encoding method using an encoding device according to the present document;

[0028] [Figure 15] 1 is a diagram illustrating a schematic diagram of an encoding device for performing a video encoding method according to the present document.

[0029] [Figure 16] 1 is a diagram illustrating a video decoding method according to a decoding device according to the present document;

[0030] [Figure 17] 1 is a diagram illustrating a decoding device for performing a video decoding method according to the present document;

[0031] [Figure 18]FIG. 1 illustrates the structure of a content streaming system to which the embodiments of this document are applied. DETAILED DESCRIPTION OF THE INVENTION

[0032] This document may be modified in various ways and may have various embodiments. A specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit the embodiments of this document to the specific embodiment. Common terms used in this document are used only to describe specific embodiments and are not intended to limit the technical ideas of this document. Unless otherwise specified in the context, singular expressions also include plural expressions. In this specification, terms such as "comprise" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood as not precluding the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0033] Meanwhile, each component in the drawings described in this document is shown independently for the convenience of describing the different characteristic functions, and does not mean that each component is embodied as separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Implementations in which each component is integrated and / or separated are also within the scope of this document as long as they do not deviate from the essence of this document.

[0034] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. In the following, the same components in the drawings will be designated by the same reference numerals, and duplicated descriptions of the same components will be omitted.

[0035] FIG. 1 shows a schematic diagram of an example video / image coding system to which embodiments of this document may be applied.

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

[0037] The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be called a video / video encoding device, and the decoding device may be called a video / video 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 an external component.

[0038] A video source can acquire video / video through a video / video capture, synthesis, or generation process. A video source can include a video / video capture device and / or a video / video generation device. A video / video capture device can include, for example, one or more cameras, a video / video archive containing previously captured video / video, etc. A video / video generation device can include, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate video / video. For example, a virtual video / video can be generated by a computer, etc., in which case the process of generating related data can replace the video / video capture process.

[0039] An encoding device may encode input video / images. The encoding device may 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.

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

[0041] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transform, and prediction, which correspond to the operations of the encoding device.

[0042] The renderer can render the decoded video / image, which can then be displayed on a display unit.

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

[0044] This document presents various embodiments relating to video / image coding, which may be performed in combination with one another unless otherwise specified.

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

[0046] A pixel or PEL (pel) can mean the smallest unit that constitutes one picture (or image). A term corresponding to a pixel may also be used: "sample." A sample generally represents a pixel or a pixel value, and may represent only a pixel / pixel value of a luma component, or may represent only a pixel / pixel value of a chroma component.

[0047] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to that region. One unit may include 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 may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.

[0048] As used herein, "A or B" can mean "A only," "B only," or "both A and B." In other words, as used herein, "A or B" can be interpreted as "A and / or B." For example, as used herein, "A, B, or C" can mean "A only," "B only," "C only," or "any combination of A, B, and C."

[0049] As used herein, a slash ( / ) or a comma can mean "and / or." For example, "A / B" can mean "A and / or B." Thus, "A / B" can mean "A only," "B only," or "both A and B." For example, "A, B, C" can mean "A, B, or C."

[0050] 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" can be interpreted as the same as "at least one of A and B."

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

[0052] Furthermore, parentheses used in this specification may 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." Furthermore, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction."

[0053] In this specification, technical features described separately in one drawing may be embodied separately or simultaneously.

[0054] The following drawings are created to explain a specific example of the present specification. The names of specific devices or names of specific signals / messages / fields shown in the drawings are provided for illustrative purposes only, and the technical features of the present specification are not limited to the specific names in the following drawings.

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

[0056] Referring to FIG. 2, the encoding apparatus 200 may 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 adder 250 may also be referred to as a reconstructor or a reconstructed block generator. The above-described image divider 210, predictor 220, residual processor 230, entropy encoder 240, adder 250, and filterer 260 may be configured by one or more hardware components (e.g., an encoder chipset or a processor) depending on the embodiment. In addition, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.

[0057] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. For example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) using a quad-tree, binary-tree, ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into multiple coding units of deeper depths 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, and then the binary tree structure and / or the tannery structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure described herein may be performed based on the final coding unit that is not further divided. In this case, based on coding efficiency according to video characteristics, the largest coding unit may be immediately used as the final coding unit, or the coding unit may be recursively divided into coding units of lower depths as needed, and the coding unit of the optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be divided or partitioned from the final coding unit. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.

[0058] The term "unit" may 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 generally represents a pixel or a pixel value, or can represent only a pixel / pixel value of a luma component, or can represent only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to one picture (or image) for a pixel or pel.

[0059] The encoding apparatus 200 may subtract a prediction signal (prediction block, prediction sample array) output from the inter prediction unit 221 or the intra prediction unit 222 from an input video signal (original block, original sample array) to generate a residual signal (residual block, residual sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, in the encoding apparatus 200, as shown in the figure, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input video signal (original block, original sample array) may be referred to as a subtraction unit 231. The prediction unit may predict a target block (hereinafter referred to as a current block) and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is to be applied for the current block or CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 240, as will be described later in the description of each prediction mode. The prediction information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0060] The intra prediction unit 222 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located far away, depending on the prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, DC mode and planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of precision of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction modes applied to neighboring blocks.

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

[0062] The prediction unit 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for predicting a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The prediction unit may also use an intra block copy (IBC) prediction mode or a palette mode for predicting a block. The IBC prediction mode or palette mode may be used for coding content images / moving images, such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but may be similar to inter prediction in that it derives a reference block within the current picture. That is, IBC may use at least one of the inter prediction methods described herein. The palette mode may be considered an example of intra coding or intra prediction. When the palette mode is applied, a sample value within the picture may be signaled based on information about a palette table and a palette index.

[0063] 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 transform unit 232 may generate transform coefficients by applying a transform method to the residual signal. For example, the transform method may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, GBT refers to a transform obtained from a graph representing relationship information between pixels. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size or to blocks of variable sizes other than a square.

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

[0065] The quantized transform coefficients output from the quantization unit 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients in the inverse quantization unit 234 and the inverse transform unit 235. The adder 250 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to a prediction signal output from the inter prediction unit 221 or the intra prediction unit 222. When there is no residual for the current block, such as when a skip mode is applied, a predicted block may be used as a reconstructed block. The adder 250 may be referred to as a reconstruction unit or a 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 may be used for inter prediction of the next picture after filtering, as described below.

[0066] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during the picture encoding and / or reconstruction process.

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

[0068] The modified reconstructed picture transmitted to the memory 270 may be used as a reference picture in the inter prediction unit 221. This allows the encoding apparatus to avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus 300 when inter prediction is applied, and also improves coding efficiency.

[0069] The DPB of the memory 270 may store the modified reconstructed picture to be used as a reference picture in the inter prediction unit 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block already reconstructed in the picture. The stored motion information may be transmitted to the inter prediction unit 221 to be used as motion information of a spatially neighboring block or motion information of a temporally neighboring block. The memory 270 may store reconstructed samples of a block reconstructed in the current picture and transmit them to the intra prediction unit 222.

[0070] FIG. 3 is a diagram illustrating the configuration of a video / image decoding device to which the embodiments of this document can be applied.

[0071] Referring to FIG. 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. Depending on the embodiment, the entropy decoding unit 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be implemented as a single hardware component (e.g., a decoder chipset or processor). The memory 360 may include a decoded picture buffer (DPB) and may be implemented as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.

[0072] When a bitstream including video / picture information is input, the decoding apparatus 300 can reconstruct an image corresponding to the process by which the video / picture information was processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive units / blocks based on block division-related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied by the encoding apparatus. Accordingly, the processing unit for decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a tannery tree structure. One or more transform units may be derived from the coding unit. The reconstructed video signal decoded and output by the decoding apparatus 300 may be played back by a playback device.

[0073] The decoding apparatus 300 may receive a signal output from the encoding apparatus of FIG. 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 may parse the bitstream and derive information (e.g., video / video information) necessary for video restoration (or picture restoration). The video / video information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / video information may also include general constraint information. The decoding apparatus may decode pictures further based on the information on the parameter sets and / or the general constraint information. 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 may decode information in a bitstream based on a coding method such as Exponential-Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element from the bitstream, determines a context model using information on the syntax element to be decoded, decoding information on neighboring and current blocks, or information on symbols / bins decoded in a previous step, predicts the occurrence probability of the bins based on the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element. In this case, after determining the context model, the CABAC entropy decoding method may update the context model using information on the decoded symbols / bins for the context model of the next symbol / bin.Among the information decoded by the entropy decoding unit 310, information related to prediction is provided to the prediction unit 330 (inter prediction unit 332 and intra prediction unit 331), and residual values ​​entropy decoded by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 320. The residual processing unit 320 may derive a residual signal (residual block, residual sample, residual sample array). In addition, among the information decoded by the entropy decoding unit 310, information related to filtering may be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) that receives a signal output from the encoding apparatus may be further configured as an internal / external element of the decoding apparatus 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to this document may be referred to as a video / image / picture decoding device, and the decoding device may be divided 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, the inverse transform unit 322, the addition unit 340, the filtering unit 350, the memory 360, the inter prediction unit 332, and the intra prediction unit 331.

[0074] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in the form of a two-dimensional block. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding apparatus. The inverse quantization unit 321 may inverse quantize the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.

[0075] The inverse transform unit 322 performs inverse transform on the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0076] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on the prediction information output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.

[0077] The prediction unit 320 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for predicting a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as a combined inter and intra prediction (CIIP) mode. The prediction unit may also use an intra block copy (IBC) prediction mode or a palette mode for predicting a block. The IBC prediction mode or palette mode may be used for coding content images / moving images, such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but may be similar to inter prediction in that it derives a reference block within the current picture. That is, IBC may use at least one of the inter prediction methods described herein. The palette mode may be considered an example of intra coding or intra prediction. When the palette mode is applied, information about a palette table and a palette index may be included in the video / picture information and signaled.

[0078] The intra prediction unit 331 can predict a current block by referring to samples in a current picture. The referenced samples may be located in the neighborhood of the current block or may be located far away from the current block depending on the prediction mode. In intra prediction, prediction modes can include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 can also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.

[0079] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector in a reference picture. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction information (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). In inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 332 may construct a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index for the current block based on received candidate selection information. Inter prediction may be performed based on various prediction modes, and the prediction information may include information indicating the inter prediction mode for the current block.

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

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

[0082] Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture decoding process.

[0083] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transmit the modified reconstructed 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, an adaptive loop filter, a bilateral filter, etc.

[0084] The (modified) reconstructed picture stored in the DPB of the memory 360 may be used as a reference picture in the inter prediction unit 332. The memory 360 may store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 260 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 360 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 331.

[0085] 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 also be applied identically or correspondingly to the filtering unit 350, inter prediction unit 332, and intra prediction unit 331 of the decoding device 300, respectively.

[0086] In this document, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When the quantization / dequantization is omitted, the quantized transform coefficients may be referred to as transform coefficients. When the transform / inverse transform is omitted, the transform coefficients may be referred to as coefficients or residual coefficients, or may still be referred to as transform coefficients for consistency of expression.

[0087] In this document, quantized transform coefficients and transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, residual information may include information about transform coefficients, and the information about the transform coefficients may be signaled by a residual coding syntax. Transform coefficients may be derived based on the residual information (or information about the transform coefficients), and scaled transform coefficients may be derived by inverse transform (scaling) of the transform coefficients. Residual samples may be derived based on inverse transform (transform) of the scaled transform coefficients. This may be equally applied / expressed in other parts of this document.

[0088] As described above, prediction is performed to improve compression efficiency during video coding. This allows for the generation of a predicted block including predicted samples for a current block, which is a block to be coded. Here, the predicted block includes predicted samples in the spatial domain (or pixel domain). The predicted block is derived in the same way by an encoding device and a decoding device. The encoding device can improve video coding efficiency by signaling to the decoding device information (residual information) regarding the residual between the original block and the predicted block, rather than the original sample values ​​of the original block themselves. The decoding device can derive a residual block including residual samples based on the residual information, combine the residual block with the predicted block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.

[0089] The residual information may be generated through a transform and quantization procedure. For example, an encoding device may derive a residual block between the original block and the predicted block, perform a transform procedure on residual samples (residual sample array) included in the residual block to derive transform coefficients, and perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and then signal the related residual information (using a bitstream) to a decoding device. Here, the residual information may include information such as value information, position information, transform method, kernel, and quantization parameter of the quantized transform coefficients. The decoding device may derive residual samples (or residual blocks) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device may also derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a subsequent picture, and generate a reconstructed picture based on the residual block.

[0090] Intra prediction may refer to a prediction that generates prediction samples for a current block based on reference samples in a picture (hereinafter, "current picture") to which the current block belongs. When intra prediction is applied to the current block, neighboring reference samples used for intra prediction of the current block may be derived. The neighboring reference samples of the current block may include samples adjacent to the left boundary and bottom-left of the current block having a size of nWxnH, a total of 2xnH samples, 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 neighboring reference samples of the current block may include multiple columns of upper neighboring samples and multiple rows of left neighboring samples. In addition, the surrounding reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.

[0091] However, some of the neighboring reference samples of the current block may not yet be decoded or may not be available. In this case, the decoder may substitute the unavailable samples with available samples to construct neighboring reference samples to be used for prediction, or may construct neighboring reference samples to be used for prediction using interpolation of available samples.

[0092] When neighboring reference samples are derived, (i) a predicted sample can be derived based on an average or interpolation of neighboring reference samples of the current block, or (ii) the predicted sample can be derived based on a reference sample that exists in a specific (prediction) direction with respect to the predicted sample among the neighboring reference samples of the current block. (i) can be called a non-directional mode or a non-angular mode, and (ii) can be called a directional mode or an angular mode.

[0093] In addition, the prediction sample may be generated by interpolating a first neighboring sample located in a prediction direction of an intra prediction mode of the current block and a second neighboring sample located in a direction opposite to the prediction direction based on a prediction sample of the current block among the neighboring reference samples. This may be called linear interpolation intra prediction (LIP). Alternatively, a chroma prediction sample may be generated based on a luma sample using a linear model (LM). This may be called an LM mode or a CCLM (chroma component LM) mode.

[0094] In addition, a provisional prediction sample of the current block may be derived based on filtered neighboring reference samples, and the prediction sample of the current block may be derived by weighted summing the provisional prediction sample and at least one reference sample derived according to the intra prediction mode from the existing neighboring reference samples, i.e., unfiltered neighboring reference samples. This may be called Position Dependent Intra Prediction (PDPC).

[0095] In addition, intra-prediction coding can be performed by selecting a reference sample line with the highest prediction accuracy from among multiple reference sample lines surrounding the current block, deriving a prediction sample using a reference sample located in the prediction direction of the selected line, and signaling the used reference sample line to a decoding device. This method can be called multi-reference line intra-prediction or MRL-based intra-prediction.

[0096] In addition, the current block may be divided into vertical or horizontal sub-partitions, and intra prediction may be performed based on the same intra prediction mode, with neighboring reference samples derived and used for each sub-partition. That is, in this case, the intra prediction mode for the current block is uniformly applied to the sub-partitions, but by deriving and using neighboring reference samples for each sub-partition, intra prediction performance may be improved in some cases. This prediction method may be called intra sub-partitions (ISP)-based intra prediction.

[0097] The above-described intra prediction methods may be referred to as intra prediction types, distinguished from intra prediction modes. The intra prediction types may be referred to by various terms, such as intra prediction techniques or additional intra prediction modes. For example, the intra prediction types (or additional intra prediction modes, etc.) may include at least one of the above-described LIP, PDPC, MRL, and ISP. A general intra prediction method other than the specific intra prediction types, such as LIP, PDPC, MRL, and ISP, may be referred to as a normal intra prediction type. The normal intra prediction type may be generally applied when the above-described specific intra prediction types are not applicable, and prediction may be performed based on the above-described intra prediction modes. Meanwhile, post-processing filtering may be performed on the derived prediction samples, if necessary.

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

[0099] FIG. 4 illustrates an example of an intra-prediction based video / image encoding method.

[0100] Referring to FIG. 4, an encoding apparatus performs intra prediction on a current block (S400). The encoding apparatus may derive an intra prediction mode / type for the current block, derive neighboring reference samples for the current block, and generate intra-prediction samples for the current block based on the intra prediction mode / type and the neighboring reference samples. Here, the steps of determining the intra prediction mode / type, deriving neighboring reference samples, and generating prediction samples may be performed simultaneously, or one step may be performed before the other steps. The encoding apparatus may determine a mode / type to be applied to the current block from among a plurality of intra prediction modes / types. The encoding apparatus may compare RD costs for the intra prediction modes / types to determine an optimal intra prediction mode / type for the current block.

[0101] Meanwhile, the encoding apparatus may also perform a prediction sample filtering procedure, which may 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.

[0102] The encoding apparatus generates residual samples for the current block based on the (filtered) predicted samples (S410). The encoding apparatus may derive the residual samples by comparing the predicted samples with the original samples of the current block on a phase basis.

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

[0104] The residual information may include a residual coding syntax, which will be described later. An encoding apparatus may transform / quantize the residual samples to derive quantized transform coefficients. The residual information may include information about the quantized transform coefficients.

[0105] Meanwhile, as described above, the encoding apparatus may generate a reconstructed picture (including reconstructed samples and reconstructed blocks). To this end, the encoding apparatus may again inverse-quantize / inverse-transform the quantized transform coefficients to derive (modified) residual samples. The reason for again performing inverse-quantization / inverse-transformation on the residual samples after transforming / quantizing them is to derive residual samples that are the same as the residual samples derived in the decoding apparatus, as described above. The encoding apparatus may generate a reconstructed block including reconstructed samples for the current block based on the predicted samples and the (modified) residual samples. A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, an in-loop filtering procedure or the like may further be applied to the reconstructed picture.

[0106] FIG. 5 illustrates an example of an intra-prediction based video / image encoding method.

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

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

[0109] Specifically, the decoding apparatus may derive an intra-prediction mode / type for a current block based on received prediction information (intra-prediction mode / type information) (S500). The decoding apparatus may derive neighboring reference samples for the current block (S510). The decoding apparatus generates intra-prediction samples for the current block based on the intra-prediction mode / type and the neighboring reference samples (S520). In this case, the decoding apparatus may perform a prediction sample filtering procedure. The prediction sample filtering may be referred to as 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.

[0110] The decoding apparatus generates residual samples for the current block based on the received residual information (S530). The decoding apparatus generates reconstructed samples for the current block based on the predicted samples and the residual samples, and may derive a reconstructed block including the reconstructed samples (S540). A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, an in-loop filtering procedure may be further applied to the reconstructed picture.

[0111] The intra prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether a most probable mode (MPM) or a 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). A decoding apparatus may determine the intra prediction mode of the current block based on the intra prediction mode information.

[0112] Also, the intra prediction type information may be implemented in various forms. For example, the intra prediction type information may include intra prediction type index information indicating one of the intra prediction types. For another example, the intra prediction type information may include at least one of 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 a subpartition division type when the ISP is applied, flag information indicating whether PDPC is applied, or flag information indicating whether LIP is applied. Also, the intra prediction type information may include an MIP flag indicating whether matrix-based intra prediction (MIP) is applied to the current block.

[0113] The intra-prediction mode information and / or the intra-prediction type information may be encoded / decoded by a coding method 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).

[0114] FIG. 6 illustrates an intra prediction procedure.

[0115] 6, as described above, the intra prediction procedure may include an intra prediction mode / type determination step, a neighboring reference sample derivation step, and an intra prediction execution (prediction sample generation) step. The intra prediction procedure may be performed in an encoding device and a decoding device as described above. In this document, a coding device may include an encoding device and / or a decoding device.

[0116] Referring to FIG. 6, the coding apparatus determines an intra-prediction mode / type (S600).

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

[0118] The intra prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether a most probable mode (MPM) or a 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. Also, 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). A decoding apparatus may determine the intra prediction mode of the current block based on the intra prediction mode information.

[0119] Also, 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. For another example, the intra prediction type information may include at least one of 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 a subpartition type when the ISP is applied, and flag information indicating whether PDPC is applied or flag information indicating whether LIP is applied. Also, the intra prediction type information may include an MIP flag indicating whether matrix-based intra prediction (MIP) is applied to the current block.

[0120] For example, when intra prediction is applied, the intra prediction mode to be applied to the current block may be determined using the intra prediction mode of a neighboring block. For example, the coding device may select one of MPM candidates in an MPM (most probable mode) list derived based on the intra prediction modes of neighboring blocks (e.g., neighboring blocks to the left and / or above) of the current block and / or additional candidate modes based on the received MPM index, or may select one of the remaining intra prediction modes not included in the MPM candidates (and the planar mode) based on MPM remainder information (remaining intra prediction mode information). The MPM list may be configured to include or not include a planar mode as a candidate. For example, if the MPM list includes a planar mode as a candidate, the MPM list may have six candidates, and if the MPM list does not include a planar mode as a candidate, the MPM list may have five candidates. If the MPM list does not include a planar mode as a candidate, a not planar flag (e.g., intra_luma_not_planar_flag) indicating whether the intra prediction mode of the current block is not a planar mode may be signaled. For example, the MPM flag may be signaled first, and the MPM index and the not planar flag may be signaled if the MPM flag has a value of 1. Also, the MPM index may be signaled if the not planar flag has a value of 1. Here, the reason why the MPM list is configured not to include a planar mode as a candidate is that, rather than the planar mode not being an MPM, the planar mode is always considered as an MPM, and therefore a flag (not planar flag) is first signaled to first confirm whether the mode is a planar mode.

[0121] For example, whether the intra prediction mode applied to the current block is among the MPM candidates (and planar mode) or among the remaining modes may be indicated based on an 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 among the MPM candidates (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 among the MPM candidates (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 may indicate one of the remaining intra prediction modes that are not included in the MPM candidates (and planar mode) among all intra prediction modes by indexing them in order of prediction mode number. The intra prediction mode may be an intra prediction mode for a luma component (sample). Hereinafter, the intra prediction mode information may include at least one of 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), and 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 an MPM candidate list, a candModeList, etc.

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

[0123] In other words, when an image is generally divided into blocks, the current block to be coded and neighboring blocks have similar image characteristics. Therefore, the current block and neighboring blocks are likely to have the same or similar intra-prediction modes. Therefore, an encoder can use the intra-prediction modes of neighboring blocks to encode the intra-prediction mode of the current block.

[0124] A coding apparatus may configure an MPM (Most Probable Modes) list for a current block. The MPM list may also be referred to as an MPM candidate list. Here, MPM may refer to a mode used to improve coding efficiency by considering similarities between a current block and neighboring blocks during intra-prediction mode coding. As described above, the MPM list may be configured to include or exclude the planar mode. For example, if the MPM list includes the planar mode, the number of candidates in the MPM list may be six. Also, if the MPM list does not include the planar mode, the number of candidates in the MPM list may be five.

[0125] The encoding apparatus may perform prediction based on various intra prediction modes and determine an optimal intra prediction mode based on rate-distortion optimization (RDO). In this case, the encoding apparatus may determine the optimal intra prediction mode using only the MPM candidates and planar mode configured in the MPM list, or may determine the optimal intra prediction mode using the remaining intra prediction modes in addition to the MPM candidates and planar mode 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 apparatus may determine the optimal intra prediction mode by considering only the MPM candidates and planar mode 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 mode, 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.

[0126] Meanwhile, in general, if the intra prediction mode of the current block is not a planar mode but is one of the MPM candidates in the MPM list, the encoding apparatus generates an mpm index (mpm idx) indicating one of the MPM candidates. If the intra prediction mode of the current block is not included in the MPM list, the encoding apparatus generates MPM remainder information (remaining intra prediction mode information) indicating the same mode as the intra prediction mode of the current block from the remaining intra prediction modes not included in the MPM list (and planar modes). The MPM remainder information may include, for example, an intra_luma_mpm_remainder syntax element.

[0127] The decoding apparatus may obtain intra-prediction mode information from a bitstream. The intra-prediction mode information may include at least one of an MPM flag, a not planar flag, an MPM index, and MPM remainder information (remaining intra-prediction mode information), as described above. The decoding apparatus may construct an MPM list. The MPM list may be configured identically to the MPM list constructed by the encoding apparatus. That is, the MPM list may include intra-prediction modes of neighboring blocks, and may further include a specific intra-prediction mode according to a predetermined method.

[0128] A decoding device may determine the intra prediction mode of the current block based on the MPM list and the intra prediction mode information. For example, when the MPM flag has a value of 1, the decoding device may derive a planar mode as the intra prediction mode of the current block (not based on the planar flag), or may derive a candidate indicated by the MPM index from among MPM candidates in the MPM list as the intra prediction mode of the current block. Here, the MPM candidate may refer to only candidates included in the MPM list, or may include not only the candidates included in the MPM list but also planar modes applicable when the MPM flag has a value of 1.

[0129] As another example, when the value of the MPM flag is 0, the decoding device may derive the intra prediction mode indicated by the remaining intra prediction mode information (which may be referred to as mpm remainder 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. Meanwhile, as yet another example, when the intra prediction type of the current block is a specific type (e.g., LIP, MRL, or ISP), the decoding device may derive the planar mode or a candidate indicated by the MPM flag in the MPM list as the intra prediction mode of the current block without parsing / decoding / checking the MPM flag.

[0130] The coding apparatus derives neighboring reference samples for a current block (S610). When intra prediction is applied to the current block, neighboring reference samples used for intra prediction of the current block may be derived. The neighboring reference samples for the current block may include samples adjacent to the left boundary and bottom-left of the current block having a size of nWxnH, a total of 2xnH samples, 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 neighboring reference samples for the current block may include multiple columns of upper neighboring samples and multiple rows of left neighboring samples. In addition, the neighboring reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block having a size of nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.

[0131] On the other hand, when MRL is applied (i.e., when the value of the MRL index is greater than 0), the neighboring reference samples may be located on lines 1 and 2 other than line 0 adjacent to the current block on the left / top side, and in this case, the number of neighboring reference samples may be increased.On the other hand, when ISP is applied, the neighboring reference samples may be derived in sub-partition units.

[0132] The coding apparatus performs intra prediction on the current block to derive prediction samples (S620). The coding apparatus may derive the prediction samples based on the intra prediction mode / type and the surrounding samples. The coding apparatus may derive reference samples according to the intra prediction mode of the current block from surrounding reference samples of the current block, and may derive prediction samples of the current block based on the reference samples.

[0133] Meanwhile, when inter prediction is applied, a prediction unit of an encoding / decoding apparatus may perform inter prediction on a block-by-block basis to derive prediction samples. Inter prediction may refer to prediction derived in a manner dependent on data elements (e.g., sample values ​​or motion information) of a picture other than the current picture. When inter prediction is applied to a current block, a predicted block (prediction sample array) for the current block may be derived based on a reference block (reference sample array) identified by a motion vector in a reference picture indicated by a reference picture index. In this case, to reduce the amount of motion information transmitted in the inter prediction mode, motion information of the current block may be predicted on a block, sub-block, or sample-by-block basis based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include information on an inter prediction type (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). When inter prediction is applied, neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal surrounding block may be the same or different. The temporal surrounding block may be called a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal surrounding block may be called a collocated picture (colPic). For example, a motion information candidate list may be constructed based on the surrounding blocks of the current block, and 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.Inter prediction 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 the same as that of a selected neighboring block. Unlike merge mode, in skip mode, a residual signal may not be transmitted. In motion vector prediction (MVP) mode, the motion vector of a selected neighboring block may be used as a motion vector predictor, and a motion vector difference may be signaled. In this case, the motion vector of the current block may be derived using the sum of the motion vector predictor and the motion vector difference.

[0134] The motion information may include L0 motion information and / or L1 motion information depending on the inter-prediction type (such as L0 prediction, L1 prediction, or Bi prediction). A motion vector in the L0 direction may be referred to as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be referred to as an L1 motion vector or MVL1. Prediction based on an L0 motion vector may be referred to as L0 prediction, prediction based on an L1 motion vector may be referred to as L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be referred to as pairwise (Bi) prediction. Here, the L0 motion vector may represent a motion vector associated with a reference picture list L0 (L0), and the L1 motion vector may represent a motion vector associated with a reference picture list L1 (L1). The reference picture list L0 may include pictures prior to the current picture in output order as reference pictures, and the reference picture list L1 may include pictures subsequent to the current picture in output order. The previous picture may be referred to as a forward (reference) picture, and the subsequent picture may be referred to as a backward (reference) picture. The reference picture list L0 may further include, as reference pictures, pictures that are later than the current picture in output order. In this case, the earlier 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, as reference pictures, pictures that are earlier than the current picture in output order. In this case, the later picture may be indexed first in the reference picture list L1, and the earlier picture may be indexed next. Here, the output order may correspond to a picture order count (POC) order.

[0135] A video / picture encoding procedure based on inter prediction may generally include, for example:

[0136] FIG. 7 illustrates an example of an inter-prediction based video / picture encoding method.

[0137] The encoding apparatus performs inter prediction on a current block (S700). The encoding apparatus may derive an inter prediction mode and motion information of the current block and generate a predicted sample for the current block. Here, the inter prediction mode determination, motion information derivation, and predicted sample generation procedures may be performed simultaneously, or one procedure may be performed before the other procedures. For example, the inter prediction unit of the encoding apparatus may include a prediction mode determination unit, a motion information derivation unit, and a predicted sample derivation unit, in which the prediction mode determination unit may determine a prediction mode for the current block, the motion information derivation unit may derive motion information for the current block, and the predicted sample derivation unit may derive a predicted sample for the current block. For example, the inter prediction unit of the encoding apparatus may search for a block similar to the current block within a certain region (search region) of a reference picture using motion estimation, and derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion. Based on this, a reference picture index indicating a reference picture in which the reference block is located can be derived, and a motion vector can be derived based on a position difference between the reference block and the current block. The encoding apparatus can determine a mode to be applied to the current block from various prediction modes. The encoding apparatus can compare RD costs for the various prediction modes to determine an optimal prediction mode for the current block.

[0138] For example, when a skip mode or a merge mode is applied to the current block, the encoding apparatus may construct a merge candidate list (described below) and derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion among reference blocks indicated by merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to the decoding apparatus. Motion information of the current block may be derived using motion information of the selected merge candidate.

[0139] As another example, when the (A)MVP mode is applied to the current block, the encoding apparatus may construct an (A)MVP candidate list (described below) and use a motion vector of an MVP (motion vector predictor) candidate selected from the MVP candidates included in the (A)MVP candidate list as the MVP of the current block. In this case, for example, a motion vector indicating a reference block derived by the above-described motion estimation may be used as the motion vector of the current block, and the MVP candidate having the smallest difference from the motion vector of the current block among the MVP candidates may be the selected MVP candidate. A motion vector difference (MVD), 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 apparatus. Furthermore, 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 apparatus.

[0140] The encoding apparatus may derive residual samples based on the predicted samples (S710) by comparing the original samples of the current block with the predicted samples.

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

[0142] The output bitstream may be stored on a (digital) storage medium and transmitted to a decoding device, or may be transmitted to a decoding device over a network.

[0143] Meanwhile, as described above, the encoding apparatus can generate a reconstructed picture (including reconstructed samples and reconstructed blocks) based on the reference samples and the residual samples. This is because the encoding apparatus derives the same prediction result as that performed by the decoding apparatus, thereby improving coding efficiency. Therefore, the encoding apparatus can store the reconstructed picture (or reconstructed samples, reconstructed blocks) in memory and use it as a reference picture for inter-prediction. As described above, an in-loop filtering procedure or the like may further be applied to the reconstructed picture.

[0144] A video / picture decoding procedure based on inter prediction may generally include, for example:

[0145] FIG. 8 illustrates an example of an inter-prediction based video / picture decoding method.

[0146] 8, the decoding apparatus may perform operations corresponding to those performed by the encoding apparatus, such as performing prediction on the current block based on received prediction information and deriving predicted samples.

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

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

[0149] The decoding apparatus derives motion information of the current block based on the determined inter prediction mode (S810). For example, when a skip mode or a merge mode is applied to the current block, the decoding apparatus may construct a merge candidate list (described below) 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. Motion information of the selected merge candidate may be used to derive motion information of the current block. The motion information of the selected merge candidate may be used as motion information of the current block.

[0150] As another example, when the (A)MVP mode is applied to the current block, the decoding apparatus may construct an (A)MVP candidate list (described below) and use a motion vector of a selected MVP (motion vector predictor) candidate from among the MVP 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 may be derived based on information related to the MVD, and the motion vector of the current block may be derived based on the MVP of the current block and the MVD. Furthermore, the decoding apparatus may derive a reference picture index of the current block based on the reference picture index information. A picture indicated by the reference picture index in the reference picture list for the current block may be derived as a reference picture referenced for inter-prediction of the current block.

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

[0152] The decoding apparatus may generate predictive samples for the current block based on the motion information of the current block (S820). In this case, the reference picture may be derived based on the reference picture index of the current block, and the predictive samples of the current block may be derived using samples of the reference block indicated in the reference picture by the motion vector of the current block. In this case, as described below, a predictive sample filtering procedure may be further performed on all or some of the predictive samples of the current block, depending on the circumstances.

[0153] For example, the inter-prediction unit of the decoding device may include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit, and may determine a prediction mode for the current block based on prediction mode information received by the prediction mode determination unit, derive motion information (such as a motion vector and / or a reference picture index) of the current block based on information regarding the motion information received by the motion information derivation unit, and derive a prediction sample of the current block by the prediction sample derivation unit.

[0154] The decoding apparatus generates residual samples for the current block based on the received residual information (S830). The decoding apparatus generates reconstructed samples for the current block based on the predicted samples and the residual samples, and generates a reconstructed picture based on the reconstructed samples (S840). Thereafter, an in-loop filtering procedure may be further applied to the reconstructed picture, as described above.

[0155] FIG. 9 shows an example of an inter prediction procedure.

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

[0157] Referring to FIG. 9, a coding apparatus determines an inter prediction mode for a current block (S900). Various inter prediction modes may be used for predicting a current block in a picture. For example, various modes such as merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, sub-block merge mode, and merge with MVD (MMVD) mode may be used. Decoder side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, bi-prediction with CU-level weight (BCW), bi-directional optical flow (BDOF), etc. may be used in addition to or instead of the accompanying mode. The affine mode may be referred to as an affine motion prediction mode. The MVP mode may be referred to as an advanced motion vector prediction mode. In this document, some modes and / or motion information candidates derived by some modes may be included as one of the motion information-related candidates of 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 can be called an HMVP merge candidate.

[0158] Prediction mode information indicating the inter prediction mode of the current block may be signaled from the encoding apparatus to the decoding apparatus. The prediction mode information may be included in a bitstream and received by the decoding apparatus. 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 the skip mode is applied, and if the skip mode is not applied, a merge flag may be signaled to indicate whether the merge mode is applied, and if the merge mode is not applied, an MVP mode may be applied, or a flag for additional classification may be further signaled. The affine mode may be signaled as an independent mode or as a mode dependent on the merge mode, MVP mode, etc. For example, the affine mode may include affine merge mode and affine MVP mode.

[0159] The coding apparatus derives motion information for the current block (S910). The motion information may be derived based on the inter prediction mode.

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

[0161] The coding apparatus performs inter prediction based on motion information for the current block (S920). The coding apparatus may derive predictive samples for the current block based on the motion information. The current block including the predictive samples may be referred to as a predicted block.

[0162] Meanwhile, as described above, the encoding device can perform various encoding methods such as exponential Golomb, CAVLC (context-adaptive variable length coding), CABAC (context-adaptive binary arithmetic coding), etc. Also, the decoding device can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to residuals.

[0163] For example, the coding method described above may be performed as follows:

[0164] FIG. 10 illustrates an example of CABAC (context-adaptive binary arithmetic coding) for encoding a syntax element. For example, in a CABAC encoding process, if an input signal is a syntax element that is not a binary value, an encoding device may binarize the input signal to convert it into a binary value. Alternatively, if the input signal is already a binary value (i.e., the value of the input signal is a binary value), binarization may be bypassed. Here, each binary digit 0 or 1 constituting a binary value may be referred to as a bin. For example, if the binary string after binarization is 110, each of 1, 1, and 0 is referred to as a bin. The bin for a syntax element may indicate the value of the syntax element.

[0165] The binarized bins of the syntax elements may then be input to a regular encoding engine or a bypass encoding engine. The regular encoding engine of the encoding device may assign a context model reflecting a probability value to the bin and encode the bin based on the assigned context model. The regular encoding engine of the encoding device may update the context model for each bin after encoding the bin. Bins encoded as described above may be referred to as context-coded bins.

[0166] Meanwhile, when the binarized bins of the syntax element are input to the bypass encoding engine, they may be coded as follows. For example, the bypass encoding engine of the encoding device omits the steps of estimating the probability for the input bin and updating the probability model applied to the bin 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. Bins encoded as described above can be called bypass bins.

[0167] Entropy decoding can refer to the process of performing the above-described entropy encoding process in reverse order.

[0168] For example, when a syntax element is decoded based on a context model, a decoding device may receive a bin corresponding to the syntax element through a bitstream, determine a context model using the syntax element and decoding information of a block to be decoded or a neighboring block, or information on a symbol / bin decoded in a previous step, predict an occurrence probability of the received bin based on the determined context model, and perform arithmetic decoding of the bin to derive a value of the syntax element. Thereafter, the context model of a bin to be decoded next may be updated to the determined context model.

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

[0170] As described above, residual samples may be derived as quantized transform coefficients through a transform and quantization process. Quantized transform coefficients may also be referred to as transform coefficients. In this case, the transform coefficients within a block may be signaled in the form of residual information. The residual information may include a residual coding syntax. That is, an encoding device may construct a residual coding syntax using the residual information, encode the syntax, and output it in the form of a bitstream. A decoding device may decode the residual coding syntax from the bitstream to derive residual (quantized) transform coefficients. The residual coding syntax may include syntax elements indicating whether a transform has been applied to the block, the position of the last significant transform coefficient within the block, whether significant transform coefficients exist within a sub-block, and the size / sign of the significant transform coefficients, as will be described below.

[0171] For example, syntax elements related to residual data encoding / decoding can be represented as follows:

[0172] [Table 1-1]

[0173] [Table 1-2]

[0174] [Table 1-3]

[0175] Transform_skip_flag indicates whether transform is skipped for an associated block. The transform_skip_flag may be a syntax element for a transform skip flag. The associated block may be a coding block (CB) or a transform block (TB). The terms CB and TB may be used interchangeably in the transform (and quantization) and residual coding procedures. For example, as described above, residual samples may be derived for the CB, and (quantized) transform coefficients may be derived by transforming and quantizing the residual samples. Information (e.g., syntax elements) efficiently indicating the position, size, sign, etc. of the (quantized) transform coefficients may be generated and signaled in the residual coding procedure. Quantized transform coefficients may be simply referred to as transform coefficients. 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 this case, the target block to be transformed (and quantized) and residual coded may be referred to as the CB or the TB. On the other hand, if CB is larger than the maximum TB, the target block to be transformed (and quantized) and residually coded can be referred to as a TB. Hereinafter, syntax elements related to residual coding will be described as being signaled in units of transform blocks (TB), but this is merely an example, and as mentioned above, the TB may be used in the same sense as a coding block (CB).

[0176] Meanwhile, the syntax elements signaled after the conversion skip flag is signaled may be the same as the syntax elements disclosed in Table 2 and / or Table 3 described below, and a detailed description of the syntax elements will be provided below.

[0177]

Table 2-1

[0178]

Table 2-2

[0179]

Table 2-3

[0180]

Table 2-4

[0181]

Table 2-5

[0182]

Table 2-6

[0183]

Table 3-1

[0184]

Table 3-2

[0185]

Table 3-3

[0186] According to this embodiment, as shown in Table 1, residual coding may be branched according to the value of the syntax element transform_skip_flag of the transform skip flag. That is, different syntax elements may be used for residual coding depending on the value of the transform skip flag (whether or not there is a transform skip). Residual coding used when a transform skip is not applied (i.e., a transform is applied) may be referred to as regular residual coding (RRC), and residual coding used when a transform skip is applied (i.e., no transform is applied) may be referred to as transform skip residual coding (TSRC). The regular residual coding may also be referred to as general residual coding. The regular residual coding may also be referred to as a regular residual coding syntax structure, and the transform skip residual coding may also be referred to as a transform skip residual coding syntax structure. Table 2 may represent the syntax elements of residual coding when the value of transform_skip_flag is 0, i.e., when a transform is applied, and Table 3 may represent the syntax elements of residual coding when the value of transform_skip_flag is 1, i.e., when a transform is not applied.

[0187] Specifically, for example, a transform skip flag indicating whether to skip transform of a transform block may be parsed, and it may be determined whether the transform skip flag is 1. If the value of the transform skip flag is 0, 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 residual coefficients of the transform 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, or the parsing order may be changed. Furthermore, the abs_level_gtx_flag may represent abs_level_gt1_flag and / or abs_level_gt3_flag. For example, abs_level_gtx_flag[n][0] may be an example of the first transform coefficient level flag (abs_level_gt1_flag), and the abs_level_gtx_flag[n][1] may be an example of the second transform coefficient level flag (abs_level_gt3_flag).

[0188] 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. Meanwhile, sb_coded_flag may also be expressed as coded_sub_block_flag.

[0189] In one embodiment, the encoding device may encode (x, y) position information of the last non-zero transform coefficient in a transform block based on 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, the last_sig_coeff_x_prefix represents a prefix of the column position of the last significant coefficient in the scanning order within the transform block, the last_sig_coeff_y_prefix represents a prefix of the row position of the last significant coefficient in the scanning order within the transform block, the last_sig_coeff_x_suffix represents a suffix of the column position of the last significant coefficient in the scanning order within the transform block, and the last_sig_coeff_y_suffix represents a suffix of the row position of the last significant coefficient in the scanning order within the transform block. The significant coefficients may represent the non-zero coefficients. The scan order may be a diagonal scan order from top right to bottom 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 current block (CB or CB including TB) and / or a specific intra / inter prediction mode.

[0190] The encoding device then divides the transform block into 4x4 sub-blocks, and for each 4x4 sub-block, can use a 1-bit syntax element coded_sub_block_flag to indicate whether there are any non-zero coefficients in the current sub-block.

[0191] 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 current sub-block. Conversely, if the value of coded_sub_block_flag is 1, the encoding device can continue the encoding process for sig_coeff_flag. Since the last sub-block containing a non-zero coefficient does not require coding for coded_sub_block_flag, and since sub-blocks containing DC information of transform blocks are likely to contain non-zero coefficients, coded_sub_block_flag is not coded and its value may be assumed to be 1.

[0192] If it is determined that a non-zero coefficient exists in the current sub-block because the value of coded_sub_block_flag is 1, the encoding apparatus may encode sig_coeff_flag having a binary value in the reverse scanning order. The encoding apparatus may encode a 1-bit syntax element sig_coeff_flag for each transform coefficient in the scanning order. If the value of the transform coefficient at the current scanning position is non-zero, the value of sig_coeff_flag may be 1. In the case of a sub-block including the last non-zero coefficient, sig_coeff_flag does not need to be encoded for the last non-zero coefficient, so the encoding process for the sub-block may be omitted. Level information encoding may be performed only if 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] may indicate whether the level (value) of the corresponding transform coefficient at each transform coefficient position (xC, yC) in the current TB is non-zero. In one embodiment, the sig_coeff_flag may correspond to an example of a syntax element of a significance coefficient flag indicating whether the quantized transform coefficient is a significance coefficient that is not zero.

[0193] The remaining level value after encoding for sig_coeff_flag may be derived as follows: That is, a syntax element remAbsLevel indicating the level value that must be encoded may be derived as follows: remAbsLevel = sig_coeff_flag + remAbsLevel + remAbsLevel + remAbsLevel + remAbsLevel + remAbsLevel + remAbsLevel

[0194]

number

[0195] Here, coeff means the actual conversion coefficient value.

[0196] Furthermore, abs_level_gt1_flag may indicate whether the remAbsLevel at the corresponding scanning position (n) is greater than 1. For example, if the value of abs_level_gt1_flag is 0, the absolute value of the transform coefficient at the corresponding position may be 1. Furthermore, if the value of abs_level_gt1_flag is 1, the remAbsLevel, which indicates the level value that must be coded later, may be updated as follows:

[0197]

number

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

[0199]

number

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

[0201] The transform coefficient level value remAbsLevel that must be encoded after par_level_flag encoding may be updated as follows:

[0202]

number

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

[0204]

number

[0205] The following table also provides examples related to Equation 5 above.

[0206] [Table 4]

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

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

[0209] On the other hand, CABAC offers high performance but suffers from poor throughput. This is due to the regular encoding engine of CABAC. Regular encoding (i.e., encoding using the regular encoding engine of CABAC) uses the probability state and range updated by encoding the previous bin, which exhibits high data dependency and can take a long time to read the probability interval and determine the current state. The throughput issue of CABAC can be resolved by limiting the number of context-coded bins. For example, as shown in Table 2 above, the sum of the 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 based on the size of the block. Also, for example, as 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 depending on the size of the block. As an 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 may be indicated by remBinsPass1 or RemCcbs. Alternatively, for example, for a higher CABAC throughput, the number of context coded bins may be limited for a block (CB or TB) including a 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 size of the current block 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.

[0210] In this case, when the limited number of context coding bins are all used for encoding the context elements, the encoding apparatus may perform bypass coding by binarizing the remaining coefficients using a binarization method for the coefficients described below without using context coding. In other words, for example, when the number of context coded bins coded for 4x4 CG becomes 32 (or, for example, 28), or the number of context coded bins coded for 2x2 CG becomes 8 (or, for example, 7), sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded in the context coding bins may not be coded any more, and may be directly coded in dec_abs_level. Or, for example, if the number of context coded bins coded for a 4x4 block is limited to 1.75 times the number of pixels in the entire block, i.e., 28, then sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded into the context coded bins do not need to be coded, and may be immediately coded into dec_abs_level as shown in Table 5 below.

[0211] [Table 5]

[0212] may be derived based on dec_abs_level. In this case, the transform coefficient value |coeff| may be derived as follows:

[0213]

number

[0214] Also, the coeff_sign_flag may indicate the sign of the transform coefficient level at the corresponding scanning position (n), i.e., the coeff_sign_flag may indicate the sign of the transform coefficient at the corresponding scanning position (n).

[0215] FIG. 8 is a diagram showing an example of transform coefficients within a 4x4 block.

[0216] The 4x4 blocks in Figure 8 represent an example of quantized coefficients. The blocks shown in Figure 8 may be 4x4 transform blocks or 4x4 sub-blocks of 8x8, 16x16, 32x32, or 64x64 transform blocks. The 4x4 blocks in Figure 8 may represent luma or chroma blocks.

[0217] Meanwhile, as described above, when an input signal is a syntax element that is not a binary value, the encoding apparatus can binarize the value of the input signal to convert the input signal into a binary value. Furthermore, the decoding apparatus can decode the syntax element to derive a binarized value (i.e., a binarized bin) of the syntax element, and can debinarize the binarized value to derive the value of the syntax element. The binarization process may be a truncated Rice (TR) binarization process, a k-th order Exp-Golomb (EGk) binarization process, a k-th order limited Exp-Golomb (Limited k-th order Exp-Golomb, Limited EGk), a fixed-length (FL) binarization process, or the like, which will be described later. Also, the inverse binarization process may represent a process of deriving the value of the syntax element based on the TR binarization process, the EGk binarization process, or the FL binarization process.

[0218] For example, the TR binarization process may be performed as follows:

[0219] The input of the TR binarization process may be the TR binarization request and the syntax element cMax and cRiceParam, and the output of the TR binarization process may be the TR binarization for the value symbolVal corresponding to the bin string.

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

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

[0222]

number

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

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

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

[0226]

Table 6

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

[0228] Also, when cMax is greater than symbolVal and cRiceParam is greater than 0, a suffix bit string of the TR bit string may exist. For example, the suffix bit string may be derived as described below.

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

[0230]

Equation

[0234] Also, for example, the EGk binarization process may be performed as follows: The syntax elements coded by ue(v) may be Exp-Golomb coded syntax elements.

[0235] As an example, a 0-th order Exp-Golomb (EG0) binarization process may be performed as follows:

[0236] The parsing process for the syntax element may begin by reading bits including the first non-zero bit starting from the current position in the bitstream and counting the number of leading bits such as 0. This process can be represented as follows:

[0237] [Table 7]

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

[0239]

number

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

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

[0242] [Table 8]

[0243] The "prefix" bits may be the bits parsed as described above for the leadingZeroBits calculation and may be represented by a bit string of 0 or 1 in Table 8. That is, a bit string represented by 0 or 1 in Table 8 above may represent a prefix bit string. The "suffix" bits may be the bits parsed in the codeNum calculation and may be represented by xi in Table 8 above. That is, a bit string represented by xi in Table 8 above may represent a suffix bit string, where i may be a value ranging from 0 to LeadingZeroBits-1. Also, each xi may be equal to 0 or 1.

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

[0245] [Table 9]

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

[0247] Also, for example, the EGk binarization process may be performed as follows.

[0248] An input of the EGk binarization process may be a request for EGk binarization, and an output of the EGk binarization process may be an EGk binarization for a value symbolVal corresponding to a bin string.

[0249] The bit string for the EGk binarization process for symbolVal may be derived as follows:

[0250] [Table 10]

[0251] Referring to Table 10 above, each call to put(X) can be used to add a binary value X to the end of the bin string, where X can be 0 or 1.

[0252] Also, for example, the limited EGk binarization process may be performed as follows.

[0253] The input of the limited EGk binarization process may be a request for limited EGk binarization and 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. Also, the output of the limited EGk binarization process may be limited EGk binarization for a value symbolVal corresponding to a bin string.

[0254] The bit string of the limited EGk binarization process for symbolVal may be derived as follows:

[0255] [Table 11]

[0256] Also, for example, the FL binarization process may be performed as follows.

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

[0258] The FL binarization may be performed using a bit string having a number of bits that is a fixed length of the symbol value symbolVal. Here, the fixed length bit string may be an unsigned integer bit string. That is, the FL binarization may derive a bit string for the symbol value symbolVal, and the bit length (i.e., the number of bits) of the bit string may be a fixed length.

[0259] For example, the fixed length may be derived as follows:

[0260]

number

[0261] Bin indexing for FL binarization may be in a manner that uses increasing values ​​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.

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

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

[0264] The output of the binarization process for the abs_remainder may be the binarization of the abs_remainder (i.e., a binarized bin string of the abs_remainder). The binarization process may derive an available bin string for the abs_remainder.

[0265] The Rice parameter cRiceParam for the abs_remainder[n] may be derived by a Rice parameter derivation process using 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 transform block, and log2TbHeight, which is the binary logarithm of the height of the transform block, as inputs. The Rice parameter derivation process will be described in detail below.

[0266] Also, for example, cMax for the currently coded abs_remainder[n] may be derived based on the Rice parameter cRiceParam. The cMax may be derived as follows:

[0267]

number

[0268] Meanwhile, the binarization for the abs_remainder, i.e., the bin string for the abs_remainder, may be the concatenation of a prefix bin string and a suffix bin string if a suffix bin string exists, or the bin string for the abs_remainder may be the prefix bin string if the suffix bin string does not exist.

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

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

[0271]

number

[0272] The prefix of the bin string in the abs_remainder[n] (ie, the prefix bin string) may be derived by a TR binarization process on the prefixVal using the cMax and the cRiceParam as inputs.

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

[0274] The Rice parameter derivation process for the abs_remainder[n] may be as follows.

[0275] Inputs of the Rice parameter derivation process may be a color component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of the transform block (log2TbWidth), and a binary logarithm of the height of the transform block (log2TbHeight). The luma position (x0, y0) may indicate the top-left sample of the current luma transform block based on the top-left luma sample of the picture. In addition, an output of the Rice parameter derivation process may be the Rice parameter cRiceParam.

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

[0277] [Table 12]

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

[0279] [Table 13]

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

[0281] Alternatively, for example, the Rice parameter cRiceParam may be determined based on whether or not the transformation of the current block is skipped. That is, when no transformation is applied to the current TB including the current CG, in other words, when a transform skip is applied to the current TB including the current CG, the Rice parameter cRiceParam may be derived as 1.

[0282] Also, the suffix value suffixVal of the abs_remainder may be derived as follows:

[0283]

number

[0284] The suffix bin string of the bin string of the abs_remainder may be derived by a limited EGk binarization process on the suffixVal with k set to cRiceParam+1, riceParam set to cRiceParam, log2TransformRange set to 15, and maxPreExtLen set to 11.

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

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

[0287] The output of the binarization process for the dec_abs_level may be the binarization of the dec_abs_level (i.e., a binarized bin string of the dec_abs_level). The binarization process may derive an available bin string for the dec_abs_level.

[0288] The Rice parameter cRiceParam for the dec_abs_level[n] may be derived by a Rice parameter derivation process using 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 transform block, and log2TbHeight, which is the binary logarithm of the height of the transform block, as inputs. The Rice parameter derivation process will be described in detail later.

[0289] Also, for example, cMax for the dec_abs_level[n] may be derived based on the Rice parameter cRiceParam. The cMax may be derived as follows:

[0290]

number

[0291] Meanwhile, the binarization for the dec_abs_level[n], i.e., the bin string for the dec_abs_level[n], may be the concatenation of a prefix bin string and a suffix bin string if a suffix bin string exists, or the bin string for the dec_abs_level[n] may be the prefix bin string if the suffix bin string does not exist.

[0292] For example, the prefix bin string may be derived as described below.

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

[0294]

number

[0295] The prefix of the bin string in the dec_abs_level[n] (ie, the prefix bin string) may be derived by a TR binarization process on the prefixVal using the cMax and the cRiceParam as inputs.

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

[0297] The Rice parameter derivation process for the dec_abs_level[n] may be as follows.

[0298] Inputs of the Rice parameter derivation process may be a color component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of the transform block (log2TbWidth), and a binary logarithm of the height of the transform block (log2TbHeight). The luma position (x0, y0) may indicate the top-left sample of the current luma transform block based on the top-left luma sample of the picture. In addition, an output of the Rice parameter derivation process may be the Rice parameter cRiceParam.

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

[0300] [Table 14]

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

[0302] [Table 15]

[0303] Also, 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 follows:

[0304]

number

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

[0306]

number

[0307] The suffix bin string of the bin string of the dec_abs_level[n] may be derived by a limited EGk binarization process on the suffixVal with k set to cRiceParam+1, truncSuffixLen set to 15, and maxPreExtLen set to 11.

[0308] Meanwhile, the above-mentioned RRC and TSRC may have the following differences.

[0309] 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 the lastAbsRemainder and the lastRiceParam as described above, but the Rice parameter cRiceParam of the syntax element abs_remainder[] in TSRC may be derived as 1. That is, for example, when a transform skip is applied to a current block (e.g., a current TB), the Rice parameter cRiceParam of the abs_remainder[] of TSRC for the current block may be derived as 1.

[0310] - Also, for example, referring to Tables 3 and 4, abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1] may be signaled in RRC, while abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3] and abs_level_gtx_flag[n][4] may be signaled in TSRC. Here, the abs_level_gtx_flag[n][0] can be represented as abs_level_gt1_flag or the first coefficient level flag, the abs_level_gtx_flag[n][1] can be represented as abs_level_gt3_flag or the second coefficient level flag, the abs_level_gtx_flag[n][2] can be represented as abs_level_gt5_flag or the third coefficient level flag, the abs_level_gtx_flag[n][3] can be represented as abs_level_gt7_flag or the fourth coefficient level flag, and the 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, compared to RRC, TSRC can further 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].

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

[0312] Furthermore, dependent quantization can be proposed for the quantization process of residual samples. Dependent quantization can refer to a scheme in which a set of allowable reconstruction values ​​for a current transform coefficient depends on the value (value of the transform coefficient level) of the transform coefficient preceding the current transform coefficient in the reconstruction order. That is, for example, dependent quantization can be realized by (a) defining two scalar quantizers with different reconstruction levels and (b) defining a process for switching between these scalar quantizers. Compared to existing independent scalar quantization, the dependent quantization can have the effect of allowing more densely packed reconstruction vectors in an N-dimensional vector space. Here, N can represent the number of transform coefficients in a transform block.

[0313] FIG. 12 illustrates an example of a scalar quantizer used in dependent quantization. Referring to FIG. 12, the position of the available reconstruction levels may be designated as a quantization step size Δ. Referring to FIG. 12, the scalar quantizers may be represented as Q0 and Q1. The scalar quantizer used may not be explicitly signaled in the bitstream but may be derived. For example, the quantizer used for a current transform coefficient may be determined by the parity of the transform coefficient level preceding the current transform coefficient in the coding / reconstruction order.

[0314] FIG. 13 illustrates state transitions and quantizer selection for dependent quantization.

[0315] 13, the transition between two scalar quantizers (Q0 and Q1) may be implemented by a state machine with four states. The four states may have four different values ​​(0, 1, 2, 3). The state for a current transform coefficient may be determined by the parity of the transform coefficient level preceding the current transform coefficient in the coding / decoding order.

[0316] For example, when an inverse quantization process for a transform block begins, a state for dependent quantization may be set to 0. Thereafter, transform coefficients for the transform block may be restored in scan order (i.e., the same order as entropy decoded). For example, after a current transform coefficient is restored, a state for dependent quantization may be updated as shown in FIG. 13. An inverse quantization process for transform coefficients restored after the current transform coefficient is restored in the scan order may be performed based on the updated state. k shown in FIG. 13 may represent a value of a transform coefficient, i.e., a transform coefficient level value. For example, when the current state is 0, if k (the value of the current transform coefficient) & 1 is 0, the state may be updated to 0, and when k & 1 is 1, the state may be updated to 2. Also, for example, when the current state is 1, if k & 1 is 0, the state may be updated to 2, and when k & 1 is 1, the state may be updated to 0. Also, for example, when the current state is 2, if k&1 is 0, the state may be updated to 1, and when k&1 is 1, the state may be updated to 3. Also, for example, when the current state is 3, if k&1 is 0, the state may be updated to 3, and when k&1 is 1, the state may be updated to 1. Referring to FIG. 13, when the state is one of 0 and 1, the scalar quantizer used in the inverse quantization process may be Q0, and when the state is one of 2 and 3, the scalar quantizer used in the inverse quantization process may be Q1. The transform coefficients may be inverse quantized in the scalar quantizer for the current state based on a quantization parameter for the restoration level of the transform coefficients.

[0317] Meanwhile, this document proposes embodiments related to residual data coding. The embodiments described in this document may be combined with each other. As described above, residual data coding methods include Regular Residual Coding (RRC) and Transform Skip Residual Coding (TSRC).

[0318] Of the two methods described above, the residual data coding method for the current 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 may indicate whether the TSRC is available. Therefore, even if the transform_skip_flag indicates that the transform is skipped, if the sh_ts_residual_coding_disabled_flag indicates that the TSRC is not available, a syntax element according to RRC may be signaled for the transform-skip block. That is, if the value of transform_skip_flag is 0 or the value of sh_ts_residual_coding_disabled_flag is 1, RRC may be used, and in other cases, TSRC may be used.

[0319] Although the slice_ts_residual_coding_disabled_flag can be used to achieve high coding efficiency in certain applications (e.g., lossless coding, etc.), existing video / picture coding standards do not propose any restrictions on when the slice_ts_residual_coding_disabled_flag is used together with the dependent quantization. That is, when dependent quantization is activated at a high level (e.g., sequence parameter set (SPS) syntax / video parameter set (VPS) syntax / decoding parameter set (DPS) syntax / picture header syntax / slice header syntax, etc.) or at a low level (CU / TU) and the slice_ts_residual_coding_disabled_flag is 1, a value depending on the state of dependent quantization in RRC may perform an unnecessary operation (i.e., an operation due to dependent quantization), resulting in degradation of coding performance or an unintended loss of coding performance due to incorrect setting in the encoding device. For this reason, in this embodiment, dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding the residual samples of the transform skip block in the current slice by RRC) are used together, and a method for setting dependencies / constraints between the two technologies is proposed to prevent unintended coding losses or malfunctions.

[0320] As an embodiment, this document proposes a method in which slice_ts_residual_coding_disabled_flag is subordinate to ph_dep_quant_enabled_flag. For example, the syntax elements proposed in this embodiment may be as shown in the following table.

[0321] [Table 16]

[0322] 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 may indicate whether dependent quantization is enabled. For example, when the value of the ph_dep_quant_enabled_flag is 1, the ph_dep_quant_enabled_flag may indicate that dependent quantization is enabled, and when the value of the ph_dep_quant_enabled_flag is 0, the ph_dep_quant_enabled_flag may indicate that dependent quantization is not enabled.

[0323] Therefore, according to this embodiment, slice_ts_residual_coding_disabled_flag may be signaled only when the dependent quantization is not available, and when the dependent quantization is available and the slice_ts_residual_coding_disabled_flag is not signaled, the slice_ts_residual_coding_disabled_flag may be regarded as 0 (infer). Meanwhile, the ph_dep_quant_enabled_flag and the slice_ts_residual_coding_disabled_flag may be signaled in a picture header syntax and / or a slice header syntax, or may be signaled in a High Level Syntax (HLS) other than the picture header syntax and slice header syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or a low level (CU / TU). If the ph_dep_quant_enabled_flag is signaled in a syntax other than the picture header syntax, it may be called something else, for example, the ph_dep_quant_enabled_flag may be expressed as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or sps_dep_quant_enabled_flag.

[0324] Furthermore, this document proposes another embodiment for setting a dependency / constraint between dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding residual samples of a transform skip block in the current slice by RRC). For example, this embodiment proposes a solution for not using the state of dependent quantization in coding the level values ​​of transform coefficients when the value of slice_ts_residual_coding_disabled_flag is 1, in order to prevent unintended coding loss or malfunction when both dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 are used. The residual coding syntax according to this embodiment may be as shown in the following table.

[0325] [Table 17-1]

[0326] [Table 17-2]

[0327] [Table 17-3]

[0328] [Table 17-4]

[0329] [Table 17-5]

[0330] [Table 17-6]

[0331] Referring to Table 17 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, a QState may be derived, and a transform coefficient value (transform coefficient level) may be derived based on the QState. For example, referring to Table 17, the transform 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 transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] is a syntax element of the sign flag indicating the sign of the transform coefficient, and (QState>1?1:0) can represent 1 if the value of the state QState is greater than 1, i.e., if the value of the state QState is 2 or 3, or 0 if the value of the state QState is 1 or less, i.e., if the value of the state QState is 0 or 1.

[0332] Also, referring to Table 17 above, when the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. For example, referring to Table 17, the transform 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 transform coefficient derived based on the syntax element of the transform coefficient, and coeff_sign_flag[n] may be a syntax element of a sign flag indicating the sign of the transform coefficient.

[0333] Also, 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 transform coefficients, and the state update may not be performed. For example, the residual coding syntax according to this embodiment may be as shown in the following table.

[0334] [Table 18-1]

[0335] [Table 18-2]

[0336] [Table 18-3]

[0337] [Table 18-4]

[0338] [Table 18-5]

[0339] [Table 18-6]

[0340] Referring to Table 18 above, QState may be updated when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0. For example, when 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, when the value of slice_ts_residual_coding_disabled_flag is 1, the process of updating QState may not be performed.

[0341] Also, referring to Table 18 above, when 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 transform coefficient (transform coefficient level) may be derived based on the QState. For example, referring to Table 18, the transform 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 transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] is a syntax element of the sign flag indicating the sign of the transform coefficient, and (QState>1?1:0) can represent 1 if the value of the state QState is greater than 1, i.e., if the value of the state QState is 2 or 3, and 0 if the value of the state QState is 1 or less, i.e., if the value of the state QState is 0 or 1.

[0342] Also, referring to Table 18 above, when the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. For example, referring to Table 18, the transform 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 transform coefficient derived based on the syntax element of the transform coefficient, and coeff_sign_flag[n] may be a syntax element of a sign flag indicating the sign of the transform coefficient.

[0343] This document also proposes another embodiment for setting a dependency / constraint between dependent quantization and residual coding (i.e., coding residual samples of transform skip blocks in the current slice by RRC) when slice_ts_residual_coding_disabled_flag=1. For example, this embodiment proposes a scheme for adding a constraint using transform_skip_flag to the process of deriving values ​​of transform coefficients (transform coefficient levels) depending on the state update or state of dependent quantization in RRC. That is, this embodiment proposes a scheme for disabling the process of deriving values ​​of transform coefficients (transform coefficient levels) depending on the state update and / or state of dependent quantization in RRC based on the transform_skip_flag. The residual coding syntax according to this embodiment may be as shown in the following table.

[0344] [Table 19-1]

[0345] [Table 19-2]

[0346] [Table 19-3]

[0347] [Table 19-4]

[0348] [Table 19-5]

[0349] [Table 19-6]

[0350] Referring to Table 19 above, QState may be updated when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0. For example, when 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, when the value of transform_skip_flag is 1, the process of updating QState may not be performed.

[0351] Also, referring to Table 19 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, a QState may be derived, and a transform coefficient value (transform coefficient level) may be derived based on the QState. For example, referring to Table 19, the transform 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 transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] is a syntax element of the sign flag indicating the sign of the transform coefficient, and (QState>1?1:0) can represent 1 if the value of the state QState is greater than 1, i.e., if the value of the state QState is 2 or 3, or 0 if the value of the state QState is 1 or less, i.e., if the value of the state QState is 0 or 1.

[0352] Also, referring to Table 19 above, when the value of transform_skip_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. Therefore, when residual data by RRC is coded for a transform skip block, the value of the transform coefficient may be derived without using QState. For example, referring to Table 19, the transform 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 transform coefficient derived based on the syntax element of the transform coefficient, and coeff_sign_flag[n] may be a syntax element of a sign flag indicating the sign of the transform coefficient.

[0353] This document also proposes various embodiments related to the signaling of the above-mentioned syntax element sh_ts_residual_coding_disabled_flag.

[0354] For example, as described above, sh_ts_residual_coding_disabled_flag is a syntax element that defines whether TSRC is unavailable, and therefore does not need to be signaled if transform skip blocks are not used. That is, it may be meaningful to signal sh_ts_residual_coding_disabled_flag only when a syntax element for whether transform skip blocks are used indicates that transform skip blocks are used.

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

[0356] [Table 20]

[0357] Referring to Table 20, if sps_transform_skip_enabled_flag is 1, sh_ts_residual_coding_disabled_flag may be signaled, and if sps_transform_skip_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may not be signaled. Here, for example, the sps_transform_skip_enabled_flag may indicate whether a transform skip block is used. That is, for example, the sps_transform_skip_enabled_flag may indicate whether transform skip is enabled. For example, if the value of the sps_transform_skip_enabled_flag is 1, the sps_transform_skip_enabled_flag may indicate that a transform skip flag may exist in the transform unit syntax, and if the value of the sps_transform_skip_enabled_flag is 0, the sps_transform_skip_enabled_flag may indicate that a transform skip flag does not exist in the transform unit syntax. On the other hand, if the sh_ts_residual_coding_disabled_flag is not signaled, the sh_ts_residual_coding_disabled_flag may be inferred as 0. In addition, the above-mentioned sps_transform_skip_enabled_flag may be signaled in the SPS, or may be signaled in other high-level syntaxes (VPS, PPS, picture header syntax, slice header syntax, etc.) or low-level syntaxes (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than the SPS.It may also be signaled prior to slice_ts_residual_coding_disabled_flag.

[0358] This document also proposes an embodiment that combines the above-mentioned embodiments in relation to signaling 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.

[0359] [Table 21]

[0360] Referring to Table 21, if sps_transform_skip_enabled_flag is 1 or ph_dep_quant_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may be signaled, 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 inferred as 0.

[0361] Alternatively, for example, an embodiment may be proposed in which sh_ts_residual_coding_disabled_flag is signaled as shown in the following table.

[0362] [Table 22]

[0363] Referring to Table 22, sh_ts_residual_coding_disabled_flag may be signaled in the picture header. The sh_ts_residual_coding_disabled_flag may be expressed as ph_ts_residual_coding_disabled_flag. Also referring to Table 22, ph_dep_quant_enabled_flag may be signaled in the picture header.

[0364] For example, referring to Table 22, if ph_dep_quant_enabled_flag is 0 and sps_transform_skip_enabled_flag is 1, ph_ts_residual_coding_disabled_flag may be signaled, otherwise 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 inferred as 0.

[0365] Meanwhile, in relation to the syntax elements described in the embodiments of this document, in existing video / picture coding standards, the ph_dep_quant_enabled_flag may be signaled in a picture header syntax, and the sh_ts_residual_coding_disabled_flag may be signaled in a slice header syntax. In this regard, this document proposes an embodiment in which both syntax elements are signaled in the same high-level syntax or low-level syntax.

[0366] 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 picture header syntax, in which case the sh_ts_residual_coding_disabled_flag may be referred to as ph_ts_residual_coding_disabled_flag.

[0367] 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 a slice header syntax, in which case the ph_dep_quant_enabled_flag may be referred to as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, slice_dep_quant_enabled_flag, or the like.

[0368] 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 in the same HLS, but the ph_ts_residual_coding_disabled_flag is signaled only if the value of the ph_dep_quant_enabled_flag is 0. For example, an example in which both the ph_dep_quant_enabled_flag and the ph_ts_residual_coding_disabled_flag are signaled in the picture header syntax may be as shown in the following table.

[0369] [Table 23]

[0370] Referring to Table 23, 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 inferred as 0.

[0371] Meanwhile, as an example of the above-mentioned embodiment, an example may be proposed in which the ph_dep_quant_enabled_flag and the ph_ts_residual_coding_disabled_flag are signaled in other high-level syntax (VPS, SPS, PPS, slice header syntax, etc.) or low-level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than picture header syntax.

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

[0373] [Table 24]

[0374] Referring to Table 24, 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 inferred as 0.

[0375] Meanwhile, the above-mentioned embodiment may, as an example, be proposed in which the ph_ts_residual_coding_disabled_flag and the ph_dep_quant_enabled_flag are signaled in other high-level syntax (VPS, SPS, PPS, slice header syntax, etc.) or low-level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than picture header syntax.

[0376] Also, for example, an embodiment combining the above-mentioned embodiments may be proposed, such as an embodiment in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS, but the ph_ts_residual_coding_disabled_flag is signaled only if the value of the ph_dep_quant_enabled_flag is 0 or the value of the sps_transform_skip_enabled_flag is 1.

[0377] [Table 25]

[0378] Referring to Table 25, 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 or the value of the sps_transform_skip_enabled_flag is 1, the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax; otherwise, the ph_ts_residual_coding_disabled_flag may not be signaled. Here, for example, the sps_transform_skip_enabled_flag may indicate whether a transform skip block is used. That is, for example, the sps_transform_skip_enabled_flag may indicate whether transform skip is enabled. For example, if the value of the sps_transform_skip_enabled_flag is 1, the sps_transform_skip_enabled_flag may indicate that a transform skip flag may be present in the transform unit syntax, and if the value of the sps_transform_skip_enabled_flag is 0, the sps_transform_skip_enabled_flag may indicate that a transform skip flag is not present in the transform unit syntax. For example, if the ph_ts_residual_coding_disabled_flag is not signaled, the ph_ts_residual_coding_disabled_flag may be inferred to be 0.

[0379] Also, 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 (e.g., slice header syntax), but the ph_ts_residual_coding_disabled_flag is signaled only when the value of the ph_dep_quant_enabled_flag is 0 and the value of the sps_transform_skip_enabled_flag is 1.

[0380] [Table 26]

[0381] 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 and the value of the sps_transform_skip_enabled_flag is 1; otherwise, 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 inferred as 0.

[0382] Also, 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 the ph_ts_residual_coding_disabled_flag is signaled only when the value of the sps_transform_skip_enabled_flag is 1, and the ph_dep_quant_enabled_flag is signaled only when the value of the ph_ts_residual_coding_disabled_flag is 0.

[0383] [Table 27]

[0384] Referring to Table 27, if the value of the sps_transform_skip_enabled_flag is 1, 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. For example, if the value of the sps_transform_skip_enabled_flag is 0, 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 inferred as 0. Also, for example, the ph_dep_quant_enabled_flag may not be signaled when the value of the ph_ts_residual_coding_disabled_flag is 1. For example, when the ph_dep_quant_enabled_flag is not signaled, the ph_dep_quant_enabled_flag may be inferred as 0.

[0385] Meanwhile, as described above, the information in the syntax table (syntax elements) disclosed in this document may be included in image / video information, may be constructed / encoded by an encoding device, and may be transmitted to a decoding device in the form of a bitstream. The decoding device may parse / decode the information in the corresponding syntax table (syntax elements). The decoding device may perform a block / image / video restoration procedure based on the decoded information.

[0386] Figure 14 schematically illustrates a video encoding method by an encoding device according to the present disclosure. The method disclosed in Figure 14 may be performed by the encoding device disclosed in Figure 2. Specifically, for example, step S1400 of Figure 14 may be performed by a prediction unit of the encoding device, step S1410 of Figure 14 may be performed by a residual processing unit of the encoding device, and steps S1420 to S1450 of Figure 14 may be performed by an entropy encoding unit of the encoding device. Also, although not shown, a process of generating reconstructed samples and reconstructed pictures for the current block based on residual samples and predicted samples for the current block may be performed by an adder of the encoding device.

[0387] The encoding apparatus derives predicted samples of the current block based on inter prediction or intra prediction (S1400). The encoding apparatus may derive the predicted samples of the current block based on a prediction mode. In this case, various prediction methods disclosed herein, such as inter prediction or intra prediction, may be applied.

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

[0389] The encoding apparatus derives residual samples of the current block based on the predicted samples (S1410). For example, the encoding apparatus may derive the residual samples by subtracting the predicted samples from original samples for the current block.

[0390] The encoding apparatus may encode prediction-related information for the current block (S1420). For example, the encoding apparatus may generate and encode prediction-related information for the current block. The prediction-related information may include prediction mode information indicating a prediction mode of the current block.

[0391] The encoding apparatus encodes a transform skip availability flag indicating whether a transform skip is available and a TSRC availability flag indicating whether a transform skip residual coding (TSRC) is available (S1430).

[0392] For example, the encoding apparatus may encode a transform skip availability flag indicating whether a transform skip is available. The video information may include a transform skip availability flag. For example, the encoding apparatus may determine whether a transform skip is available for a block of a picture in a sequence, and encode a transform skip availability flag indicating whether a transform skip is available. For example, the transform skip availability flag may be a flag indicating whether a transform skip is available. For example, the transform skip availability flag may indicate whether a transform skip is available for a block of a picture in a sequence. For example, the transform skip availability flag may indicate whether a transform skip flag is present. For example, the transform skip availability flag having a value of 1 may indicate that the transform skip is available, and the transform skip availability flag having a value of 0 may indicate that the transform skip is not available. That is, for example, the transform skip enabled flag having a value of 1 may indicate that the transform skip flag may be present, and the transform skip enabled flag having a value of 0 may indicate that the transform skip flag is not present. Also, for example, the transform skip enabled flag may be signaled using a Sequence Parameter Set (SPS) syntax. A syntax element of the transform skip enabled flag may be the above-mentioned sps_transform_skip_enabled_flag.

[0393] Also, for example, the encoding apparatus may encode a TSRC availability flag indicating whether Transform Skip Residual Coding (TSRC) is available. The video information may include a TSRC availability flag.

[0394] For example, the encoding device may encode the TSRC available flag based on the transform skip available flag. For example, the TSRC available flag may be encoded based on the transform skip available flag having a value of 1. That is, for example, when the value of the transform skip available flag is 1 (i.e., when the transform skip available flag indicates that transform skip is available), the TSRC available flag may be encoded. In other words, for example, when the value of the transform skip available flag is 1 (i.e., when the transform skip available flag indicates that transform skip is available), the TSRC available flag may be signaled. Also, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be encoded. That is, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be signaled, and the value of the TSRC available flag may be derived as 0 in the decoding device.

[0395] Here, for example, the TSRC availability flag may be a flag indicating whether TSRC is available. That is, for example, the TSRC availability flag may be a flag indicating whether TSRC is available for a block in a slice. For example, the TSRC availability flag having a value of 1 may indicate that the TSRC is not available, and the TSRC availability flag having a value of 0 may indicate that the TSRC is available. Also, for example, the TSRC availability flag may be signaled in a slice header syntax. A syntax element of the transform skip availability flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.

[0396] Meanwhile, for example, the encoding apparatus may determine whether dependent quantization is available for a current block and encode a dependent quantization available flag indicating whether dependent quantization is available. For example, the video information may include a dependent quantization available flag. For example, the dependent quantization available flag may be a flag indicating whether dependent quantization is available, and the TSRC available flag may be encoded based on the transform skip available flag and the dependent quantization available flag. For example, the TSRC available flag may be encoded based on the dependent quantization available flag having a value of 0 and the transform skip available flag having a value of 1. That is, for example, when the value of the dependent quantization available flag is 0 (i.e., the dependent quantization available flag indicates that dependent quantization is not available) and the value of the transform skip available flag is 1 (i.e., the transform skip available flag indicates that the transform skip is available), the TSRC available flag may be encoded (or signaled). Also, for example, if the value of the dependent quantization available flag is 1, the TSRC available flag does not need to be encoded. That is, for example, if the value of the dependent quantization available flag is 1, the TSRC available flag does not need to be signaled, and the value of the TSRC available flag may be derived as 0 in a decoding device.

[0397] Here, for example, the dependent quantization available flag may be a flag indicating whether the dependent quantization is available. That is, for example, the dependent quantization available flag may indicate whether the dependent quantization is available. For example, the dependent quantization available flag having a value of 1 may indicate that the dependent quantization is available, and the dependent quantization available flag having a value of 0 may indicate that the dependent quantization is not available. Also, for example, the dependent quantization available flag may be signaled in an SPS syntax or a slice header syntax. A syntax element of the dependent quantization available flag may be the above-mentioned sps_dep_quant_enabled_flag. The sps_dep_quant_enabled_flag may be referred to as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.

[0398] The encoding apparatus encodes residual information of the residual coding syntax for the residual sample derived based on the TSRC availability flag (S1440).

[0399] For example, a residual coding syntax for the residual sample may be derived based on the TSRC availability flag. For example, an encoding apparatus may determine the residual coding syntax for the current block as one of a Regular Residual Coding (RRC) syntax and a Transform Skip Residual Coding (TSRC) syntax based on the TSRC availability flag. The RRC syntax may represent a syntax according to RRC, and the TSRC syntax may represent a syntax according to TSRC.

[0400] For example, based on the TSRC available flag having a value of 1, the residual coding syntax for the current block may be derived as a Regular Residual Coding (RRC) syntax. In this case, based on the transform skip available flag having a value of 1, for example, a transform skip flag indicating whether the current block is transform skipped may be encoded, 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 may indicate whether the current block is transform skipped. That is, the transform skip flag may indicate whether a transform has been applied to transform coefficients of the current block. A syntax element representing the transform skip flag may be the above-mentioned transform_skip_flag. For example, when the transform skip flag has a value of 1, the transform skip flag may indicate that no transform is applied to the current block (i.e., that the current block is transform skipped), and when the transform skip flag has a value of 0, the transform skip flag may indicate that a transform is applied to the current block. For example, if the current block is a transform skip block, the value of the transform skip flag for the current block may be 1.

[0401] For example, based on the TSRC availability flag being 0, the residual coding syntax for the current block may be derived as a Transform Skip Residual Coding (TSRC) syntax. For example, a transform skip flag indicating whether the current block is transform skipped may be encoded, and based on the transform skip flag being 1 and the TSRC availability flag being 0, the residual coding syntax for the current block may be derived as a Transform Skip Residual Coding (TSRC) syntax. For example, a transform skip flag indicating whether the current block is transform skipped may be encoded, and based on the transform skip flag being 0 and the TSRC availability flag being 0, the residual coding syntax for the current block may be derived as a Regular Residual Coding (RRC) syntax.

[0402] Then, for example, an encoding apparatus may encode residual information of the derived residual coding syntax for the residual samples of the current block. The video information may include residual information.

[0403] For example, the encoding apparatus may derive transform coefficients of the current block based on residual samples of the current block. For example, the encoding apparatus may determine whether a transform is applied to the current block. That is, the encoding apparatus may determine whether a transform is applied to the residual samples of the current block. The encoding apparatus may determine whether a transform is applied to the current block in consideration of coding efficiency. For example, the encoding apparatus may determine that a transform is not applied to the current block. The block to which a transform is not applied may be referred to as a transform skip block. That is, for example, the current block may be a transform skip block.

[0404] When a transform is not applied to the current block, i.e., when a transform is not applied to the residual sample, the encoding apparatus may derive the derived residual sample as the current transform coefficient. When a transform is applied to the current block, i.e., when a transform is applied to the residual sample, the encoding apparatus may derive the transform coefficient by performing a transform on the residual sample. The current block may include a plurality of sub-blocks or coefficient groups (CG). Furthermore, the size of the sub-blocks of the current block may be 4x4 or 2x2. That is, the sub-blocks of the current block may include up to 16 non-zero transform coefficients or up to 4 non-zero transform coefficients. Here, the current block may be a coding block (CB) or a transform block (TB). Transform coefficients may also be referred to as residual coefficients.

[0405] Meanwhile, an encoding apparatus may determine whether dependent quantization is applied to the current block. For example, if dependent quantization is applied to the current block, the encoding apparatus may perform the dependent quantization process on the transform coefficients to derive the transform coefficients of the current block. For example, if dependent quantization is applied to the current block, the encoding apparatus may update a state (Qstate) for dependent quantization based on a coefficient level of a transform coefficient immediately preceding the current transform coefficient in scanning order, derive a coefficient level of the current transform coefficient based on the updated state and a syntax element for the current transform coefficient, and quantize the derived coefficient level to derive the current transform coefficient. For example, the current transform coefficient may be quantized based on a quantization parameter for a restoration level of the current transform coefficient in a scalar quantizer for the updated state.

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

[0407] For example, the residual information of the RRC syntax may include a syntax element for a transform coefficient of the current block, where the transform coefficient may also be referred to as a residual coefficient.

[0408] For example, the syntax elements 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.

[0409] Specifically, for example, the syntax element may include position information indicating the position of the last non-zero transform coefficient in a residual coefficient array of the current block. That is, the syntax element may include position information indicating the position of the last non-zero transform coefficient in a scanning order of the current block. The position information may include information indicating a prefix of a column position of the last non-zero transform coefficient, information indicating a prefix of a row position of the last non-zero transform coefficient, information indicating a suffix of a column position of the last non-zero transform coefficient, and information indicating a suffix of a row position of the last non-zero transform coefficient. The syntax elements for the 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. Meanwhile, non-zero transform coefficients may also be called significant coefficients.

[0410] Further, for example, the syntax element may include a coded sub-block flag indicating whether the current sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether the transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag indicating whether the coefficient level for the transform coefficient is greater than a first critical value, a parity level flag for the parity of the coefficient level, and / or a second coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a second critical value. Here, the coded sub-block flag may be sb_coded_flag or coded_sub_block_flag, the significant 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.

[0411] Also, for example, the syntax element may include coefficient value related information for values ​​of the transform coefficients of the current block, which may be abs_remainder and / or dec_abs_level.

[0412] Also, for example, the syntax element may include a sign flag indicating the sign of the transform coefficient, and the sign flag may be coeff_sign_flag.

[0413] For example, if the residual coding syntax for the current block is derived from the TSRC syntax, the encoding apparatus may encode 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.

[0414] For example, the residual information of the TSRC syntax may include a syntax element for a transform coefficient of the current block, where the transform coefficient may also be referred to as a residual coefficient.

[0415] For example, the syntax elements may include context-coded syntax elements and / or bypass-coded syntax elements for transform coefficients. The syntax elements 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.

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

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

[0418] The encoding apparatus generates a bitstream including the prediction-related information, the transform skip available flag, the TSRC available flag, and the residual information (S1450). For example, the encoding apparatus may output video information including the prediction-related information, the transform skip available flag, the TSRC available flag, and the residual information as a bitstream. The bitstream may include the prediction-related information, the transform skip available flag, the TSRC available flag, and the residual information.

[0419] Meanwhile, the bitstream may be transmitted to the decoding device via a network or a (digital) storage medium, where the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[0420] FIG. 15 schematically illustrates an encoding device that performs the video encoding method according to the present document. The method disclosed in FIG. 14 may be performed by the encoding device disclosed in FIG. 15. Specifically, for example, a prediction unit of the encoding device of FIG. 15 may perform S1400 of FIG. 14, a residual processing unit of the encoding device of FIG. 15 may perform S1410 of FIG. 14, and an entropy encoding unit of the encoding device of FIG. 15 may perform S1420 to S1450 of FIG. 14. Also, although not shown, a process of generating reconstructed samples and reconstructed pictures for the current block based on residual samples and predicted samples for the current block may be performed by an adder of the encoding device.

[0421] FIG. 16 schematically illustrates a video decoding method by a decoding device according to the present document. The method disclosed in FIG. 10 may be performed by the decoding device disclosed in FIG. 3. Specifically, for example, steps S1000 to S1030 of FIG. 10 may be performed by an entropy decoding unit of the decoding device, step S1040 of FIG. 10 may be performed by a residual processing unit of the decoding device, and step S1050 may be performed by an adder of the decoding device. Also, although not shown, the step of receiving prediction information for a current block may be performed by an entropy decoding unit of the decoding device, and the step of deriving a prediction sample of the current block may be performed by a prediction unit of the decoding device.

[0422] A decoding apparatus acquires a transform skip available flag (S1600). The decoding apparatus may acquire video information including the transform skip available flag using a bitstream. The video information may include the transform skip available flag. Here, the current block may be a coding block (CB) or a transform block (TB). For example, the transform skip available flag may be a flag indicating whether a transform skip is available. For example, the transform skip available flag may indicate whether a transform skip is available for a block of a picture in a sequence. For example, the transform skip available flag may indicate whether a transform skip flag is present. For example, the transform skip available flag having a value of 1 may indicate that the transform skip is available, and the transform skip available flag having a value of 0 may indicate that the transform skip is not available. That is, for example, the transform skip enabled flag having a value of 1 may indicate that the transform skip flag may be present, and the transform skip enabled flag having a value of 0 may indicate that the transform skip flag is not present. Also, for example, the transform skip enabled flag may be signaled using a Sequence Parameter Set (SPS) syntax. A syntax element of the transform skip enabled flag may be the above-mentioned sps_transform_skip_enabled_flag.

[0423] The decoding apparatus acquires a Transform Skip Residual Coding (TSRC) availability flag based on the Transform Skip availability flag (S1610). The video information may include a TSRC availability flag.

[0424] For example, the decoding device may acquire the TSRC available flag based on the transform skip available flag. For example, the TSRC available flag may be acquired based on the transform skip available flag having a value of 1. That is, for example, when the value of the transform skip available flag is 1 (i.e., when the transform skip available flag indicates that transform skip is available), the TSRC available flag may be acquired. In other words, for example, when the value of the transform skip available flag is 1 (i.e., when the transform skip available flag indicates that transform skip is available), the TSRC available flag may be signaled. Also, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be acquired, and the value of the TSRC available flag may be derived as 0. That is, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be signaled, and the value of the TSRC available flag may be derived as 0.

[0425] Here, for example, the TSRC availability flag may be a flag indicating whether TSRC is available. That is, for example, the TSRC availability flag may be a flag indicating whether TSRC is available for a block in a slice. For example, the TSRC availability flag having a value of 1 may indicate that the TSRC is not available, and the TSRC availability flag having a value of 0 may indicate that the TSRC is available. Also, for example, the TSRC availability flag may be signaled in a slice header syntax. A syntax element of the transform skip availability flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.

[0426] Meanwhile, for example, the decoding device may acquire a dependent quantization available flag. For example, the video information may include a dependent quantization available flag. For example, the dependent quantization available flag may be a flag indicating whether dependent quantization is available, and the TSRC available flag may be acquired based on the transform skip available flag and the dependent quantization available flag. For example, the TSRC available flag may be acquired based on the dependent quantization available flag having a value of 0 and the transform skip available flag having a value of 1. That is, for example, when the value of the dependent quantization available flag is 0 (i.e., the dependent quantization available flag indicates that dependent quantization is not available) and the value of the transform skip available flag is 1 (i.e., the transform skip available flag indicates that the transform skip is available), the TSRC available flag may be acquired (or signaled). Also, for example, when the value of the dependent quantization available flag is 1, the TSRC available flag does not need to be acquired, and the value of the TSRC available flag may be derived as 0. That is, for example, when the value of the dependent quantization available flag is 1, the TSRC available flag does not need to be signaled, and the value of the TSRC available flag may be derived as 0.

[0427] Here, for example, the dependent quantization available flag may be a flag indicating whether the dependent quantization is available. That is, for example, the dependent quantization available flag may indicate whether the dependent quantization is available. For example, the dependent quantization available flag having a value of 1 may indicate that the dependent quantization is available, and the dependent quantization available flag having a value of 0 may indicate that the dependent quantization is not available. Also, for example, the dependent quantization available flag may be signaled in an SPS syntax or a slice header syntax. A syntax element of the dependent quantization available flag may be the above-mentioned sps_dep_quant_enabled_flag. The sps_dep_quant_enabled_flag may be referred to as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.

[0428] The decoding apparatus acquires prediction-related information for the current block (S1620). The decoding apparatus may acquire the prediction-related information for the current block using a bitstream. For example, the video information may include prediction-related information for the current block. For example, the prediction-related information may include prediction mode information for the current block. The prediction mode information may indicate whether inter prediction or intra prediction is applied to the current block.

[0429] The decoding apparatus derives predicted samples of the current block based on the prediction-related information (S1630). The decoding apparatus may determine whether inter prediction or intra prediction is applied to the current block based on the prediction-related information, and perform prediction based on the determination.

[0430] For example, the decoding apparatus may derive a prediction mode to be applied to the current block based on the prediction-related information, and may derive predicted samples of the current block based on the prediction mode. For example, if inter prediction is applied to the current block, the decoding apparatus may derive motion information of the current block based on the prediction-related information, and may derive the predicted samples of the current block based on the motion information. Furthermore, for example, if intra prediction is applied to the current block, the decoding apparatus may derive reference samples based on neighboring samples of the current block, and may derive the predicted samples of the current block based on the reference samples and the intra prediction mode of the current block. The reference samples may include an upper reference sample and a left reference sample of the current block. For example, if the size of the current block is NxN and the x component and y component of the top-left sample position of the current block are 0 and 0, respectively, the left reference samples may be p[-1][0] to p[-1][2N-1], and the upper reference samples may be p[0][-1] to p[2N-1][-1].

[0431] The decoding apparatus acquires residual information of the residual coding syntax for the current block derived based on the TSRC availability flag (S1640). For example, the decoding apparatus may acquire residual information of the residual coding syntax for the current block derived based on the TSRC availability flag. The video information may include residual information. For example, the decoding apparatus may derive the residual coding syntax for the current block based on the TSRC availability flag. For example, the decoding apparatus may derive the residual coding syntax for the current block as one of a Regular Residual Coding (RRC) syntax and a Transform Skip Residual Coding (TSRC) syntax based on the TSRC availability flag. The RRC syntax may represent an RRC-based syntax, and the TSRC syntax may represent a TSRC-based syntax.

[0432] For example, based on the TSRC availability flag having a value of 1, the residual coding syntax for the current block may be derived as a Regular Residual Coding (RRC) syntax. In this case, the residual information may be residual information of the RRC syntax. That is, a decoding device may acquire residual information of the RRC syntax for the current block. For example, if the current block is a transform skip block and the TSRC availability flag has a value of 1, the residual information may be residual information of a Regular Residual Coding (RRC) syntax. In this case, for example, a transform skip flag indicating whether the current block is transform skipped may be acquired, 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 may indicate whether the current block is transform skipped. That is, the transform skip flag may indicate whether a transform has been applied to transform coefficients of the current block. The syntax element indicating the transform skip flag may be the above-mentioned transform_skip_flag. For example, if the value of the transform skip flag is 1, the transform skip flag may indicate that no transform is applied to the current block (i.e., the transform is skipped), and if the value of the transform skip flag is 0, the transform skip flag may indicate that a transform is applied to the current block. For example, if the current block is a transform skip block, the value of the transform skip flag for the current block may be 1. Meanwhile, the transform skip flag may be acquired if the value of the transform skip available flag is 1.

[0433] For example, the residual information of the RRC syntax may include the syntax elements disclosed in Table 2. For example, the residual information of the RRC syntax may include syntax elements for transform coefficients of the current block. Here, a transform coefficient may also be referred to as a residual coefficient.

[0434] For example, the syntax elements 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.

[0435] Specifically, for example, the syntax element may include position information indicating the position of the last non-zero transform coefficient in a residual coefficient array of the current block. That is, the syntax element may include position information indicating the position of the last non-zero transform coefficient in a scanning order of the current block. The position information may include information indicating a prefix of a column position of the last non-zero transform coefficient, information indicating a prefix of a row position of the last non-zero transform coefficient, information indicating a suffix of a column position of the last non-zero transform coefficient, and information indicating a suffix of a row position of the last non-zero transform coefficient. The syntax elements for the 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. Meanwhile, non-zero transform coefficients may also be called significant coefficients.

[0436] Further, for example, the syntax element may include a coded sub-block flag indicating whether the current sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether the transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag indicating whether the coefficient level for the transform coefficient is greater than a first critical value, a parity level flag for the parity of the coefficient level, and / or a second coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a second critical value. Here, the coded sub-block flag may be sb_coded_flag or coded_sub_block_flag, the significant 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.

[0437] Also, for example, the syntax element may include coefficient value related information for values ​​of the transform coefficients of the current block, which may be abs_remainder and / or dec_abs_level.

[0438] Also, for example, the syntax element may include a sign flag indicating the sign of the transform coefficient, and the sign flag may be coeff_sign_flag.

[0439] Also, for example, based on the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be derived as a Transform Skip Residual Coding (TSRC) syntax. In this case, the residual information may be residual information of a Transform Skip Residual Coding (TSRC) syntax. That is, a decoding apparatus may acquire residual information of the TSRC syntax for the current block. Also, for example, a transform skip flag indicating whether the current block is transform skipped may be acquired, 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 derived as a Transform Skip Residual Coding (TSRC) syntax. In this case, the residual information may be residual information of a TSRC syntax. Also, for example, a transform skip flag indicating whether the current block is transform skipped may be obtained, and the residual coding syntax for the current block may be derived as a Regular Residual Coding (RRC) syntax based on the transform skip flag being 0 and the TSRC available flag being 0. In this case, the residual information may be residual information of an RRC syntax.

[0440] For example, the residual information of the TSRC syntax may include the syntax elements disclosed in Table 3. For example, the residual information of the TSRC syntax may include syntax elements for transform coefficients of the current block. Here, a transform coefficient may also be referred to as a residual coefficient.

[0441] For example, the syntax elements may include context-coded syntax elements and / or bypass-coded syntax elements for transform coefficients. The syntax elements 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.

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

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

[0444] The decoding device derives residual samples of the current block based on the residual information (S1650). For example, the decoding device may derive transform coefficients of the current block based on the residual information, and may derive residual samples of the current block based on the transform coefficients.

[0445] For example, a decoding device may derive transform coefficients of the current block based on the residual information syntax element. Then, the decoding device may derive residual samples of the current block based on the transform coefficients. For example, if it is determined based on the transform skip flag that no transform is applied to the current block, i.e., if the transform skip flag has a value of 1, the decoding device may derive the transform coefficients as the residual samples of the current block. Alternatively, if it is determined based on the transform skip flag that no transform is applied to the current block, i.e., if the transform skip flag has a value of 1, the decoding device may dequantize the transform coefficients to derive the residual samples of the current block. Alternatively, if it is determined based on the transform skip flag that a transform is applied to the current block, i.e., if the transform skip flag has a value of 0, the decoding device may inverse transform the transform coefficients to derive the residual samples of the current block. Alternatively, for example, if it is determined based on the transform skip flag that a transform has been applied to the current block, i.e., if the value of the transform skip flag is 0, the decoding device can dequantize the transform coefficients and inverse transform the dequantized transform coefficients to derive the residual samples of the current block.

[0446] Meanwhile, when the dependent quantization is applied to the current block, the decoding apparatus may perform the dependent quantization process on the transform coefficients to derive the residual samples of the current block. For example, when the dependent quantization is applied to the current block, the decoding apparatus may update a state (Qstate) for dependent quantization based on a coefficient level of a transform coefficient immediately preceding the current transform coefficient in scanning order, derive a coefficient level of the current transform coefficient based on the updated state and a syntax element for the current transform coefficient, and dequantize the derived coefficient level to derive a residual sample. For example, the current transform coefficient may be dequantized in a scalar quantizer for the updated state based on a quantization parameter for a restoration level of the current transform coefficient. Here, the restoration level may be derived based on a syntax element for the current transform coefficient.

[0447] The decoding device generates a reconstructed picture based on the predicted samples and the residual samples (S1660). For example, the decoding device may generate reconstructed samples and / or a reconstructed picture of the current block based on the predicted samples and the residual samples. For example, the decoding device may generate the reconstructed samples by adding the predicted samples and the residual samples.

[0448] As mentioned above, thereafter, if necessary, in-loop filtering procedures such as deblocking filtering, SAO and / or ALF procedures may be applied to the reconstructed picture to improve the subjective / objective image quality.

[0449] Figure 17 schematically illustrates a decoding device that performs the video decoding method according to the present document. The method disclosed in Figure 16 may be performed by the decoding device disclosed in Figure 17. Specifically, for example, an entropy decoding unit of the decoding device of Figure 17 may perform steps S1600 to S1620 and S1640 of Figure 16, a prediction unit of the decoding device of Figure 17 may perform step S1630 of Figure 16, a residual processing unit of the decoding device of Figure 17 may perform step S1650 of Figure 16, and an adder of the decoding device of Figure 17 may perform step S1660 of Figure 16.

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

[0451] In addition, this document establishes a signaling relationship between the dependent quantization available flag and the TSRC available flag, and signals the TSRC available flag when dependent quantization is not available, so that dependent quantization is not used when TSRC is not available and RRC syntax is coded for a transform skip block, thereby improving coding efficiency and reducing the amount of coded bits, thereby improving overall residual coding efficiency.

[0452] In addition, this document establishes a signaling relationship between the transform skip available flag and the TSRC available flag, and by signaling the TSRC available flag when transform skip is available, the amount of coded bits can be reduced and the overall residual coding efficiency can be improved.

[0453] In the above-described embodiments, the method is a series of steps or blocks and is described based on a flowchart, but this document is not limited to the order of 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 flowchart are not exclusive, and other steps may be included, or one or more steps of the flowchart may be omitted, without affecting the scope of this document.

[0454] The embodiments described herein may be embodied and performed on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in the figures may be embodied and performed on a computer, processor, microprocessor, controller, or chip. In this case, information (e.g., information on instructions) or algorithms for the implementation may be stored in a digital storage medium.

[0455] In addition, the decoding device and encoding device to which the embodiments of this document are applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top (OTT) video (over-the-top) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, a vehicle terminal (e.g., a vehicle terminal, an airplane terminal, a ship terminal, etc.), a medical video device, etc., and may be used to process video signals or data signals. For example, over-the-top (OTT) video (over-the-top) video devices include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.

[0456] Furthermore, a processing method to which the embodiments of this document are applied may be produced in the form of a computer-executable program and stored in a computer-readable recording medium. Multimedia data having a data structure according to this document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes any type of storage device or distributed storage device in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable recording medium may also include media embodied in the form of a carrier wave (e.g., transmission via the Internet). The bitstream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0457] Furthermore, the embodiments of the present document may be embodied as a computer program product by program code, which may be executed by a computer according to the embodiments of the present document. The program code may be stored on a computer-readable carrier.

[0458] FIG. 13 is a structural diagram illustrating a content streaming system to which the embodiments of this document are applied.

[0459] A content streaming system to which the embodiments of this document are applied can broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0460] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.

[0461] The bitstream may be generated by an encoding method or a bitstream generation method to which an embodiment of this document is applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0462] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, which then transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, which controls commands and responses between devices in the content streaming system.

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

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

[0465] The claims described herein may be combined in various ways. For example, technical features of method claims herein may be combined and embodied as an apparatus, and technical features of apparatus claims herein may be combined and embodied as a method. Furthermore, technical features of method claims herein and technical features of apparatus claims herein may be combined and embodied as an apparatus, and technical features of method claims herein and technical features of apparatus claims herein may be combined and embodied as a method.

Claims

1. A video decoding method performed by a decoding device, comprising: obtaining a conversion skip available flag; obtaining a dependent quantization available flag; obtaining a transform skip residual coding (TSRC) disabled flag based on the transform skip available flag and the dependent quantization available flag; obtaining prediction-related information for a current block; deriving a predicted sample of the current block based on the prediction related information; obtaining residual information for the current block based on the TSRC disabled flag; deriving a residual sample of the current block based on the residual information; generating a reconstructed picture based on the prediction samples and the residual samples; The conversion skip availability flag is information on whether a conversion skip is available, The dependent quantization available flag is information on whether dependent quantization is used, The TSRC disabled flag is information on whether TSRC is used or not, The TSRC disabled flag is obtained from a bitstream based on the transform skip available flag and the dependent quantization available flag; If the transform skip is available and the dependent quantization is not used, the TSRC disabled flag is obtained from the bitstream; When the transform skip is available and the dependent quantization is used, the TSRC disabled flag is not obtained from the bitstream, and a value of the TSRC disabled flag is deemed to be 0, indicating that the TSRC is used for transform skip blocks.

2. The method of claim 1 , wherein if the TSRC disabled flag is equal to a value of 1, the residual information for the current block is obtained from a regular residual coding (RRC) syntax.

3. The video decoding method of claim 2 , wherein a transform skip flag indicating whether the transform skip is applied to the current block or not is obtained from the bitstream in response to the transform skip available flag being equal to 1.

4. The image decoding method of claim 2 , wherein if the TSRC disabled flag is equal to 0, the residual information for the current block is obtained from a TSRC syntax.

5. The video decoding method of claim 1, wherein the dependent quantization available flag and the TSRC disabled flag are signaled through the same syntax.

6. The transform skip enabled flag is signaled through a sequence parameter set (SPS) syntax; The video decoding method of claim 5 , wherein both the dependent quantization available flag and the TSRC disabled flag are signaled through a slice header syntax.

7. A video encoding method performed by an encoding device, comprising: deriving a predicted sample of a current block based on inter prediction or intra prediction; deriving a residual sample of the current block based on the predicted sample; encoding prediction related information for the current block; encoding a transform skip available flag for whether transform skip is available, a dependent quantization available flag for whether dependent quantization is used, and a transform skip residual coding (TSRC) disabled flag for whether TSRC is used; encoding residual information for the residual sample based on the TSRC disabled flag; generating a bitstream including the prediction related information, the transform skip available flag, the TSRC disabled flag, and the residual information; Based on the transform skip available flag and the dependent quantization available flag, the TSRC disabled flag is encoded in the bitstream; If the transform skip is available and the dependent quantization is not used, the TSRC disabled flag is encoded in the bitstream; When the transform skip is available and the dependent quantization is used, the TSRC disabled flag is not encoded in the bitstream, and a value of the TSRC disabled flag is considered to be 0, which indicates that the TSRC is used for transform skip blocks.

8. The video encoding method of claim 7 , wherein in response to the TSRC disabled flag having a value equal to one, the residual information for the current block is encoded in a regular residual coding (RRC) syntax.

9. The method of claim 8 , wherein, in response to a value of the TSRC disabled flag being equal to 0, the residual information for the current block is encoded in a TSRC syntax.

10. The transform skip enabled flag is signaled through a sequence parameter set (SPS) syntax; The video encoding method of claim 7 , wherein both the dependent quantization available flag and the TSRC disabled flag are signaled through a slice header syntax.

11. A method for transmitting data for a video, comprising the steps of: obtaining a bitstream for the image, the bitstream being generated by deriving a prediction sample of a current block based on inter prediction or intra prediction, deriving a residual sample of the current block based on the prediction sample, encoding prediction related information for the current block, encoding a transform skip available flag indicating whether a transform skip is available, a dependent quantization available flag indicating whether dependent quantization is used, and a TSRC disabled flag indicating whether transform skip residual coding (TSRC) is used, and encoding residual information for the residual sample based on the TSRC disabled flag; transmitting the data including the bitstream for the video; Based on the transform skip available flag and the dependent quantization available flag, the TSRC disabled flag is encoded in the bitstream; If the transform skip is available and the dependent quantization is not used, the TSRC disabled flag is encoded in the bitstream; wherein, depending on when the transform skip is available and the dependent quantization is used, the TSRC disabled flag is not encoded in the bitstream, and a value of the TSRC disabled flag is considered to be 0, which indicates that the TSRC is used for transform skip blocks.