Image decoding method and apparatus for residual coding in image coding system
By using dependent quantized availability flags and TSRC availability flags in the image encoding system, the appropriate residual encoding syntax is determined, which solves the problem of low coding efficiency of high-resolution image encoding and more efficient image encoding and storage is achieved.
Patent Information
- Application Number
- JP2025025779
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2020-02-05
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2041-02-05
AI Technical Summary
The prior art is difficult to improve the encoding efficiency of high resolution and high-quality images, resulting in increased transmission and storage costs.
By introducing dependent quantized availability flags and TSRC availability flags in the image encoding system, appropriate residual encoding syntax is determined and restored images are generated to improve encoding efficiency.
Improves the efficiency of image encoding, reduces the number of bits required, and reduces the cost of transmission and storage.
Smart Images

Figure 2025071238000001_ABST
Abstract
Description
[Technical field]
[0001] This document relates to an image coding technology, and more particularly to an image decoding method and apparatus for coding flag information indicating whether a TSRC is available when coding residual data of a current block in an image coding system. [Background technology]
[0002] Recently, the demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing in various fields. As the image data has higher resolution and quality, the amount of information or bits to be transmitted increases relatively compared to existing image data, so that when the image data is transmitted using a medium such as an existing wired or wireless broadband line or when the image data is stored using an existing storage medium, the transmission cost and storage cost increase.
[0003] Thereby, in order to effectively transmit, store and reproduce high resolution, high quality image information, highly efficient image compression techniques are required. 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 image 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 an embodiment of the present document, there is provided an image decoding method executed by a decoding device, the method including the steps of: obtaining a dependent quantization available flag; obtaining a TSRC available flag based on the dependent quantization available flag; determining a residual coding syntax for a current block based on the TSRC available flag; obtaining residual information of the determined residual coding syntax for the current block; deriving a residual sample of the current block based on the residual information; and generating a reconstructed picture based on the residual sample, wherein the dependent quantization available flag is a flag indicating whether dependent quantization is available, the TSRC available flag is a flag indicating whether TSRC is available, and the TSRC available flag is obtained based on the dependent quantization available flag having a value of 0.
[0007] According to another embodiment of the present document, there is provided a decoding device for performing image decoding, the decoding device including: an entropy decoding unit for obtaining a dependent quantization available flag, obtaining a TSRC available flag based on the dependent quantization available flag, determining a syntax of residual coding for a current block based on the TSRC available flag, and obtaining residual information of the determined syntax of residual coding for the current block, a residual processing unit for deriving a residual sample of the current block based on the residual information, and an adder unit for generating a reconstructed picture based on the residual sample, wherein the dependent quantization available flag is a flag indicating whether dependent quantization is available, the TSRC available flag is a flag indicating whether TSRC is available, and the TSRC available flag is obtained based on the dependent quantization available flag having a value of 0.
[0008] According to yet another embodiment of the present document, there is provided a video encoding method executed by an encoding device, the method including the steps of: encoding a dependent quantization available flag; encoding a transform skip residual coding (TSRC) available flag based on the dependent quantization available flag; determining a syntax of residual coding for a current block based on the TSRC available flag; encoding residual information of the determined syntax of residual coding for the current block; and generating a bitstream including the dependent quantization available flag, the TSRC available flag, and the residual information, wherein the dependent quantization available flag is a flag indicating whether dependent quantization is available, the TSRC available flag is a flag indicating whether TSRC is available, and the TSRC available flag is encoded based on the dependent quantization available flag having a value of 0.
[0009] According to yet another embodiment of the present document, there is provided a video encoding device, the encoding device including an entropy encoding unit that encodes a dependent quantization available flag, encodes a transform skip residual coding (TSRC) available flag based on the dependent quantization available flag, determines a syntax of residual coding for a current block based on the TSRC available flag, encodes residual information of the determined syntax of residual coding for the current block, and generates a bitstream including the dependent quantization available flag, the TSRC available flag, and the residual information, wherein the dependent quantization available flag is a flag indicating whether dependent quantization is available, the TSRC available flag is a flag indicating whether TSRC is available, and the TSRC available flag is encoded based on the dependent quantization available flag having a value of 0.
[0010] According to yet another embodiment of the present document, there is provided a computer-readable digital storage medium having stored thereon a bitstream including image information for causing an image decoding method to be executed, the image decoding method including the steps of: obtaining a dependent quantization available flag; obtaining a transform skip residual coding (TSRC) available flag based on the dependent quantization available flag; determining a residual coding syntax for a current block based on the TSRC available flag; obtaining residual information of the determined residual coding syntax for the current block; deriving a residual sample of the current block based on the residual information; and generating a reconstructed picture based on the residual sample, wherein the dependent quantization available flag is a flag indicating whether dependent quantization is available, the TSRC available flag is a flag indicating whether TSRC is available, and the TSRC available flag is obtained based on the dependent quantization available flag having a value of 0. Effect of the Invention
[0011] According to this document, the efficiency of residual coding can be improved.
[0012] According to this document, a signaling relationship between the dependent quantization available flag and the TSRC available flag can be set to signal the TSRC available flag when dependent quantization is not available, thereby improving coding efficiency by not using dependent quantization when TSRC is not available and RRC syntax is coded for a transform skip block, and reducing the amount of coded bits to improve overall residual coding efficiency.
[0013] According to this document, the TSRC availability flag can be signaled only when dependent quantization is not used, thereby preventing overlapping between coding of the RRC syntax and the use of dependent quantization for the transform skip block, and allowing the TSRC availability flag to be coded more effectively, thereby reducing the amount of bits and improving overall residual coding efficiency. [Brief description of the drawings]
[0014] [Figure 1] 1 illustrates generally an example of a video / image coding system in which embodiments of the present document may be applied; [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video / image encoding device to which the embodiments of this document can be applied. [Diagram 3] FIG. 1 is a diagram illustrating the configuration of a video / image decoding device to which an embodiment of the present document can be applied. [Figure 4] Illustratively, CABAC (context-adaptive binary arithmetic coding) is used to encode syntax elements. [Diagram 5] A figure illustrating examples of transform coefficients etc. in a 4x4 block. [Figure 6] 1 shows an exemplary scalar quantizer used in dependent quantization. [Figure 7] 1 illustrates an exemplary state transition and quantizer selection for dependent quantization. [Figure 8] 1 illustrates a schematic diagram of an image encoding method using an encoding device according to the present document. [Figure 9] 1 shows a schematic diagram of an encoding device for performing an image encoding method according to the present document; [Figure 10] 1 illustrates an image decoding method using a decoding device according to the present document. [Figure 11] 1 shows a schematic diagram of a decoding device for performing an image decoding method according to the present document; [Figure 12] 1 exemplarily illustrates a structural diagram of a content streaming system to which an embodiment of the present document is applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] This document may have various modifications and may have various embodiments, and a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to a specific embodiment. Commonly used terms in this specification are used merely to describe a specific embodiment, and are not intended to limit the technical ideas of this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, terms such as "include" 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 not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0016] Meanwhile, each configuration in the drawings described in this document is illustrated independently for the convenience of explaining the different characteristic functions, and does not mean that each configuration is realized by separate hardware or software. For example, two or more of each configuration may be combined to form one configuration, and one configuration may be divided into multiple configurations. An embodiment in which each configuration is integrated and / or separated is also included in the scope of this document as long as it does not deviate from the essence of this document.
[0017] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, the same reference numerals will be used for the same components in the drawings, and duplicated descriptions of the same components may be omitted.
[0018] FIG. 1 illustrates a schematic diagram of an example of a video / image coding system in which embodiments of the present document may be applied.
[0019] As shown in Figure 1, the 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 a file or streaming form via a digital storage medium or a network.
[0020] The source device may comprise a video source, an encoding device, and a sending unit. The receiving device may comprise a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may comprise a display unit, which may be a separate device or an external component.
[0021] A video source may acquire video / images through a video / image capture, synthesis, or generation process, etc. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be replaced by a process in which the associated data is generated.
[0022] An encoding device can encode an input video / image. The encoding device can perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0023] The transmitting unit may transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit 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 transmitting unit may include elements for generating a media file through a predetermined file format and may include elements for transmission via a broadcasting / communication network. The receiving unit may receive / extract the bitstream and transmit it to a decoding device.
[0024] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, prediction, etc., which correspond to the operations of the encoding device.
[0025] The renderer can render the decoded video / images, and the rendered video / images can be displayed via a display unit.
[0026] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document can be applied to methods disclosed in the versatile video coding (VVC) standard, the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the 2nd generation of audio video coding standard (AVS2), or the next generation video / image coding standard (e.g., H.267 or H.268, etc.).
[0027] In this document, various embodiments relating to video / image coding are presented, which, unless otherwise stated, may also be implemented in combination with each other.
[0028] In this document, a video may mean a collection of a series of images over time. A picture generally means a unit showing one image at a particular time, and a subpicture / slice / tile is a unit constituting a part of a picture in coding. A subpicture / slice / tile may include one or more coding tree units (CTUs). A picture may consist of one or more subpictures / slices / tiles. A picture may consist of one or more groups of tiles. A tile group may include one or more tiles. A brick may represent a rectangular region of CTU rows within a tile in a picture. A tile may be partitioned into multiple bricks, each of which consisting of one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick.A brick scan is a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in CTU raster scan in a brick, bricks within a tile are ordered consecutively in a raster scan of the bricks of the tile, and tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. Additionally, a subpicture may represent a rectangular region of one or more slices within a picture. That is, a subpicture contains one or more slices that collectively cover a rectangular region of a picture. A tile is a rectangular region of CTUs within a particular tile column and a particular tile row in a picture.The tile column is a rectangular region of CTUs having a height equal to the height of the picture and a width specified by syntax elements in the picture parameter set. The tile row is a rectangular region of CTUs having a height specified by syntax elements in the picture parameter set and a width equal to the width of the picture. A tile scan is a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in CTU raster scan in a tile whereas tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture.A slice includes an integer number of bricks of a picture that maybe exclusively contained in a single NAL unit. A slice may consist of either a number of complete tiles or only a consecutive sequence of complete bricks of one tile. In this document, the terms 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.
[0029] A pixel or a pel may refer to the smallest unit that constitutes one picture (or image). A term corresponding to a pixel may be "sample." A sample may generally indicate a pixel or a pixel value, may indicate only a pixel / pixel value of a luma component, or may indicate only a pixel / pixel value of a chroma component.
[0030] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. A unit may include one luma block and two chroma (e.g., cb, cr) blocks. A unit may be used in combination with terms such as block or area, depending on the case. In a general case, an M×N block may include a sample (or sample array) consisting of M columns and N rows, or a set (or array) of transform coefficients.
[0031] In this specification, "A or B" may mean "A only," "B only," or "both A and B." In other words, in this specification, "A or B" may be interpreted as "A and / or B." For example, in this specification, "A, B or C" may mean "A only," "B only," "C only," or "any combination of A, B and C."
[0032] As used herein, a slash ( / ) or a comma may mean "and / or." For example, "A / B" may mean "A and / or B." Thus, "A / B" may mean "A only," "B only," or "both A and B." For example, "A, B, C" may mean "A, B, or C."
[0033] In this specification, "at least one of A and B" may mean "A only," "B only," or "both A and B." In addition, in this specification, the expressions "at least one of A or B" and "at least one of A and / or B" may be interpreted similarly to "at least one of A and B."
[0034] In addition, in this specification, "at least one of A, B and C" may mean "A only," "B only," "C only," or "any combination of A, B and C." Furthermore, "at least one of A, B or C" and "at least one of A, B and / or C" may mean "at least one of A, B and C."
[0035] In addition, 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." In addition, even when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction."
[0036] Technical features described separately in one drawing in this specification may be realized separately or simultaneously.
[0037] The following drawings are created to explain a specific example of the present specification. The names of specific devices and names of specific signals / messages / fields described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.
[0038] 2 is a diagram for explaining 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.
[0039] As shown in FIG. 2, the encoding device 200 may be configured to include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 210, the prediction unit 220, the residual processing unit 230, the entropy encoding unit 240, the addition unit 250, and the filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chip set or a processor) according to an 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.
[0040] 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. As an 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) according to a quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, a quad-tree structure may be applied first, and a binary tree structure and / or a ternary structure may be applied later. Alternatively, a binary tree structure may be applied first. The coding procedure according to this document may be performed based on a final coding unit that is not further divided. In this case, the largest coding unit may be used as the final coding unit immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an 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 each be divided or partitioned from the final coding unit described above.The prediction unit is a unit of sample prediction, and the transform unit is a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0041] The unit may be used interchangeably with terms such as block or area. In the general case, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally refer to a pixel or pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to a pixel or pel of one picture (or image).
[0042] The encoding device 200 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 221 or the intra prediction unit 222 from an input image signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoder 200 may be called a subtraction unit 231. The prediction unit may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of 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 can be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0043] 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 away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional mode may include, for example, a DC mode and a planar mode. The directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction mode applied to the neighboring block.
[0044] The inter prediction unit 221 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the 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 a neighboring block 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 (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 221 may generate information indicating which candidate is used to derive a motion vector and / or a reference picture index of the current block by forming a motion information candidate list based on neighboring blocks. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 221 may use motion information of a neighboring block as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of a motion vector prediction (MVP) mode, the motion vector of a neighboring block can be used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.
[0045] The prediction unit 220 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, or may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). The prediction unit may also be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information regarding a palette table and a palette index.
[0046] The prediction signal generated through the prediction unit (including the inter prediction unit 221 and / or the intra prediction unit 222) may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The 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 may be applied to non-square, variable-sized blocks.
[0047] The quantizer 233 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoder 240, which may encode the quantized signal (information on the quantized transform coefficients) and output the quantized signal as a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 240 may encode information required for video / image restoration (e.g., values of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in units of network abstraction layer (NAL) units. The video / image information may further include information 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 / image information may further include general constraint information. Information and / or syntax elements transmitted / signaled from an encoding device to a decoding device in this document may be included in the video / image information. The video / image information may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or may be stored in 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 a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) for storing the signal may be configured as an internal / external element of the encoding device 200, or the transmitter may be included in the entropy encoding unit 240.
[0048] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be restored by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. The adder 250 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit 221 or the intra prediction unit 222. When there is no residual for the 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 generator. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering, as described below.
[0049] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and / or reconstruction.
[0050] 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 may 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 relation to each filtering method. The information related to filtering may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0051] The modified reconstructed picture transmitted to the memory 270 may be used as a reference picture in the inter prediction unit 221. When inter prediction is applied through this, the encoding apparatus may avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus 300, and may also improve encoding efficiency.
[0052] The memory 270DPB 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 in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 221 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 222.
[0053] FIG. 3 is a diagram illustrating a schematic configuration of a video / image decoding device to which the embodiments of this document can be applied.
[0054] As shown in FIG. 3, the decoding device 300 may be configured to include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter predictor 331 and an intra predictor 332. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. The entropy decoder 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. Also, the memory 360 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.
[0055] When a bitstream including video / image information is input, the decoding apparatus 300 can restore an image corresponding to a process in which the video / image information is processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive a unit / block based on block division related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied in the encoding apparatus. Thus, the processing unit of the decoding is, for example, a coding unit, and the coding unit can be divided from a coding tree unit or a maximum coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the coding unit. Then, the restored image signal decoded and output by the decoding apparatus 300 can be reproduced by a reproduction device.
[0056] The decoding device 300 may receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image 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). In addition, the video / image information may further include general constraint information. The decoding device may further decode pictures based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be decoded via 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, quantized values of transform coefficients related to residuals, etc. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element in the bitstream, determine a context model using information on the syntax element to be decoded and decode information on the neighboring and blocks to be decoded, or information on symbols / bins decoded in a previous step, predict the occurrence probability of bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element. In this case, 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 after determining the context model.Among the information decoded by the entropy decoding unit 310, information related to prediction is provided to a prediction unit (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). Also, 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) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to this document may be called 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.
[0057] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scan order performed in the encoding device. The inverse quantization unit 321 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0058] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0059] 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 information on the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.
[0060] The prediction unit 320 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). In addition, the prediction unit may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, information regarding a palette table and a palette index may be included in the video / image information and signaled.
[0061] The intra prediction unit 331 may 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 away from the current block depending on a prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine a prediction mode to be applied to the current block using a prediction mode applied to a neighboring block.
[0062] 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 on a reference picture. In this case, in order to reduce the amount of motion information transmitted from an inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on 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 (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of 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 configure 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 the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information regarding the prediction may include information indicating a mode of inter prediction for the current block.
[0063] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted 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 a current block, such as when a skip mode is applied, the predicted block may be used as a reconstructed block.
[0064] 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 a current picture, and may be output after filtering as described below, or may be used for inter prediction of a next picture.
[0065] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during the picture decoding process.
[0066] 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.
[0067] 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 spatial neighboring block or motion information of a temporal 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.
[0068] 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 can 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.
[0069] 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 uniformity of expression.
[0070] In this document, the quantized transform coefficients and the transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, the residual information may include information on the transform coefficient(s), and the information on the transform coefficient(s) may be signaled via a residual coding syntax. A transform coefficient may be derived based on the residual information (or information on the transform coefficient(s)), and a scaled transform coefficient may be derived through an inverse transform (scaling) on the transform coefficient. A residual sample may be derived based on an inverse transform (transform) on the scaled transform coefficient. This may be similarly applied / expressed in other parts of this document.
[0071] As described above, the encoding device performs various encoding methods, such as exponential Golomb, CAVLC (context-adaptive variable length coding), CABAC (context-adaptive binary arithmetic coding), etc. The decoding device decodes information in a bitstream based on a coding method, such as exponential Golomb coding, CAVLC, or CABAC, and outputs values of syntax elements required for image restoration and quantized values of transform coefficients related to residuals.
[0072] For example, the above coding method can be performed as described below.
[0073] FIG. 4 illustrates an example of CABAC (context-adaptive binary arithmetic coding) for encoding a syntax element. For example, in the CABAC encoding process, if an input signal is a syntax element that is not a binary value, an encoding device may binarize the value of the input signal to convert the input signal into a binary value. Also, 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 may be referred to as one bin. The bin (etc.) for one syntax element may represent the value of the syntax element.
[0074] 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. The bins encoded as described above may be referred to as context-coded bins.
[0075] Meanwhile, when the binarized bins of the syntax elements are input to the bypass encoding engine, they can be coded as follows. For example, the bypass encoding engine of the encoding device omits a procedure of estimating a probability for an input bin and a procedure of updating a probability model applied to the bin after encoding. When bypass encoding is applied, the encoding device can encode the input bin by applying a uniform probability distribution instead of assigning a context model, thereby improving the encoding speed. The bins encoded as described above can be referred to as bypass bins.
[0076] Entropy decoding can refer to a process in which the above-mentioned entropy encoding process is performed in reverse order.
[0077] For example, when a syntax element is decoded based on a context model, a decoding device can 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 of a symbol / bin decoded in a previous step, predict an occurrence probability of the received bin according to the determined context model, and derive a value of the syntax element by performing arithmetic decoding of the bin. Then, the context model of the bin to be decoded next can be updated to the determined context model.
[0078] Also, for example, when a syntax element is bypass decoded, a decoding device may receive a bin corresponding to the syntax element through a bitstream and decode the input bin by applying a uniform probability distribution. In this case, the decoding device may omit a procedure of deriving a context model of the syntax element and a procedure of updating the context model applied to the bin after decoding.
[0079] As described above, the residual samples may be derived into quantized transform coefficients through a transform and quantization process. The quantized transform coefficients may also be referred to as transform coefficients. In this case, the transform coefficients in 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 as residual information, encode the residual coding syntax, and output the resulting bitstream, and 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, where the last valid transform coefficient in the block is located, whether a valid transform coefficient exists in a subblock, and what the magnitude / sign of the valid transform coefficient is, as described below.
[0080] For example, syntax elements related to encoding / decoding residual data can be expressed as shown in the following table.
[0081] [Table 1-1]
[0082] [Table 1-2]
[0083] [Table 1-3]
[0084] Transform_skip_flag indicates whether or not transform is skipped for an associated block. The transform_skip_flag may be a syntax element of a transform skip flag. The associated block may be a coding block (CB) or a transform block (TB). With respect to the transform (and quantization) and residual coding procedures, CB and TB may be used interchangeably. For example, as described above, residual samples may be derived for a CB, and (quantized) transform coefficients may be derived through transform and quantization for the residual samples. Through the residual coding procedure, information (e.g., syntax elements, etc.) efficiently indicating the position, magnitude, code, etc. of the (quantized) transform coefficients may be generated and signaled. The quantized transform coefficients may be simply referred to as transform coefficients, etc. 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, and in this case, the target block to be transformed (and quantized) and residual coded may be referred to as a CB or a TB. On the other hand, if CB is greater than the maximum TB, the target block to be transformed (and quantized) and residually coded may be called TB. Hereinafter, it will be described that syntax elements related to residual coding are signaled in units of transform blocks TB, but this is merely an example, and as described above, the TB may be used interchangeably with the coding block CB.
[0085] Meanwhile, the syntax elements signaled after the transformation skip flag is signaled are the same as the syntax elements disclosed in Table 2 and / or Table 3 described below, and a detailed description of the syntax elements is provided below.
[0086] [Table 2-1]
[0087] [Table 2-2]
[0088] [Table 2-3]
[0089] [Table 2-4]
[0090] [Table 2-5]
[0091] [Table 2-6]
[0092] [Table 3-1]
[0093] [Table 3-2]
[0094] [Table 3-3]
[0095] According to the present embodiment, as shown in Table 1, the 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 the residual coding depending on the value of the transform skip flag (based on whether the transform skip is enabled or disabled). Residual coding used when the transform skip is not applied (i.e., the transform is applied) may be called Regular Residual Coding (RRC), and residual coding used when the transform skip is applied (i.e., the transform is not applied) may be called Transform Skip Residual Coding (TSRC). The regular residual coding may also be called general residual coding. The regular residual coding may also be called a syntax structure of regular residual coding, and the transform skip residual coding may also be called a syntax structure of transform skip residual coding. Table 2 may represent syntax elements for residual coding when the value of transform_skip_flag is 0, i.e., when a transform is applied, and Table 3 may represent syntax elements for residual coding when the value of transform_skip_flag is 1, i.e., when a transform is not applied.
[0096] Specifically, for example, a transform skip flag indicating whether or not a transform block is to be skipped 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 order of parsing 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 a first transform coefficient level flag (abs_level_gt1_flag), and the abs_level_gtx_flag[n][1] may be an example of a second transform coefficient level flag (abs_level_gt3_flag).
[0097] 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, the sb_coded_flag may also be expressed as coded_sub_block_flag.
[0098] In one embodiment, the encoding apparatus 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 a column position of a last significant coefficient in a scanning order in a transform block, the last_sig_coeff_y_prefix represents a prefix of a row position of a last significant coefficient in the scanning order in the transform block, the last_sig_coeff_x_suffix represents a suffix of a column position of a last significant coefficient in the scanning order in the transform block, and the last_sig_coeff_y_suffix represents a suffix of a row position of a last significant coefficient in the scanning order in the transform block. Here, the significant coefficient may represent the non-zero coefficient. In addition, the scan order may be a top right diagonal scan order. Alternatively, the scan order may be a horizontal scan order or a vertical scan order. The scan order may be determined based on whether intra / inter prediction is applied to a current block (CB, or CB including TB) and / or a specific intra / inter prediction mode.
[0099] Next, the encoding device divides the transform block into 4x4 sub-blocks, etc., and then can use a 1-bit syntax element coded_sub_block_flag for each 4x4 sub-block to indicate whether or not there is a non-zero coefficient in the current sub-block.
[0100] If the value of coded_sub_block_flag is 0, there is no more information to transmit, and the encoding apparatus can end the encoding process for the current sub-block. Conversely, if the value of coded_sub_block_flag is 1, the encoding apparatus can continue the encoding process for sig_coeff_flag. Since the last sub-block containing a non-zero coefficient does not need to be coded for coded_sub_block_flag, and since the sub-block containing DC information of the transform block is highly likely to contain a non-zero coefficient, coded_sub_block_flag can be assumed to be 1 without being coded.
[0101] If the value of coded_sub_block_flag is 1 and it is determined that a non-zero coefficient exists in the current sub-block, the encoding apparatus may encode sig_coeff_flag having a binary value according to the reverse scanned order. The encoding apparatus may encode a 1-bit syntax element sig_coeff_flag for each transform coefficient according to the scan order. If the value of the transform coefficient at the current scan position is not 0, the value of sig_coeff_flag may be 1. Here, in the case of a sub-block including the last non-zero coefficient, since sig_coeff_flag does not need to be encoded for the last non-zero coefficient, the encoding process for the sub-block may be omitted. Level information encoding may be performed only when sig_coeff_flag is 1, and four syntax elements may be used in the level information encoding process. More specifically, each sig_coeff_flag[xC][yC" 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 significant coefficient flag indicating whether the quantized transform coefficient is a significant coefficient other than zero.
[0102] The remaining level value after encoding for sig_coeff_flag may be derived as follows: That is, a syntax element remAbsLevel representing a level value to be encoded may be derived as follows: remAbsLevel=[sig_coeff_flag+remAbsLevel+remAbsLevel]=[sig_coeff_flag+remAbsLevel].
[0103]
number
[0104] Here, coeff means the actual transform coefficient value.
[0105] Also, 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. Also, if the value of abs_level_gt1_flag is 1, the remAbsLevel, which indicates the level value to be coded thereafter, may be updated according to the following formula.
[0106]
number
[0107] In addition, the least significant coefficient (LSB) value of remAbsLevel described in the above equation 2 can be encoded via par_level_flag as shown in the following equation 3.
[0108]
number
[0109] Here, par_level_flag[n] may represent the parity of the transform coefficient level (value) at scanning position n.
[0110] The level value remAbsLevel of the transform coefficient to be encoded after encoding par_level_flag can be updated according to the following formula.
[0111]
number
[0112] abs_level_gt3_flag may indicate whether the remAbsLevel at the corresponding scanning position (n) is greater than 3. Encoding for abs_remainder can be performed only if abs_level_gt3_flag is 1. The relationship between the actual transform coefficient value coeff and each syntax element is as follows:
[0113]
number
[0114] The following table also shows examples related to the above number 5.
[0115] [Table 4]
[0116] Here, |coeff| represents the level (value) of a transform coefficient, and may be expressed as AbsLevel for the transform coefficient. Also, the sign of each coefficient may be encoded using coeff_sign_flag, which is a 1-bit symbol.
[0117] Also, for example, when 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 order of parsing 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 a 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, a second threshold value, etc., depending on the case.
[0118] On the other hand, CABAC provides high performance but has a drawback of poor throughput performance. This is due to the regular encoding engine of CABAC, and regular encoding (i.e., encoding via the regular encoding engine of CABAC) uses the probability state and range updated through encoding of the previous bin, so it shows high data dependency and may take a long time to read the probability interval and determine the current state. The throughput problem of CABAC can be solved by limiting the number of context-coded bins. For example, as shown in Table 2 above, the sum of bins used to express sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag may be limited to a number according to 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 the bins for sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag or sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag abs_level_gt5_flag, abs_level_gt7_flag, abs_level_gt9_flag may be limited to 32 (or, for example, 28), and if the block is a 2x2 size block, the sum of the 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 represented by remBinsPass1 or RemCcbs. Alternatively, for example, for higher CABAC throughput, the number of context coded bins may be limited for a block (CB or TB) including a 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 of the current block, i.e., 448, regardless of the current CG.
[0119] In this case, when the encoding apparatus uses all of the limited number of context coding bins for coding the context elements, it can perform bypass coding by binarizing the remaining coefficients through a binarization method for the coefficients described below without using context coding. In other words, for example, when the number of context coding bins coded for a 4x4 CG is 32 (or, for example, 28), or the number of context coding bins coded for a 2x2 CG is 8 (or, for example, 7), sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded at the context coding bins may not be coded any more, and may be coded at dec_abs_level immediately. Alternatively, 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, 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 further, and may be immediately coded in dec_abs_level as shown in Table 5 below.
[0120] [Table 5]
[0121] A |coeff| value may be derived based on dec_abs_level. In this case, the transform coefficient value |coeff| may be derived as follows:
[0122]
number
[0123] Moreover, the coeff_sign_flag indicates the sign of the transform coefficient level at the scanning position (n). That is, the coeff_sign_flag indicates the sign of the transform coefficient at the scanning position (n).
[0124] FIG. 5 is a diagram illustrating an example of transform coefficients in a 4×4 block.
[0125] The 4x4 block in Figure 5 shows an example of quantized coefficients. The block shown in Figure 5 may be a 4x4 transform block or a 4x4 sub-block of an 8x8, 16x16, 32x32, 64x64 transform block. The 4x4 block in Figure 5 may represent a luma block or a chroma block.
[0126] 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. Also, the decoding apparatus can decode the syntax element to derive a binarized value (i.e., a binarized bin) of the syntax element, and can de-binarize the binarized value to derive the value of the syntax element. The binarization process can be performed as a Truncated Rice (TR) binarization process, a k-th order Exp-Golomb (EGk) binarization process, a k-th order Limited Exp-Golomb (Limited k-th order Exp-Golomb, Limited EGk), or a Fixed-length (FL) binarization process, which will be described later. Also, a debinarization 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.
[0127] For example, the TR binarization process can be performed as follows.
[0128] The input of the TR binarization process may be the TR binarization request and syntax elements 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.
[0129] Specifically, as an example, if a suffix bin string exists for a syntax element, the TR bin string for the syntax element may be a 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.
[0130] The prefix value of the symbolVal for the syntax element can be derived as follows:
[0131]
number
[0132] Here, prefixVal may represent a prefix value of the symbolVal. The prefix of the TR bin string of the syntax element (ie, the prefix bin string) may be derived as described below.
[0133] For example, if the prefixVal is less than cMax>>cRiceParam, the prefix bin string can be a bit string of length prefixVal+1 indexed by binIdx. That is, if the prefixVal is less than cMax>>cRiceParam, the prefix bin string can be a bit string of prefixVal+1 bits pointed to by binIdx. The bin for binIdx less than prefixVal can be equal to 1. Also, the bin for binIdx equal to prefixVal can be equal to 0.
[0134] For example, the bin string derived by unary binarization for the prefixVal can be as shown in the following table.
[0135]
Table 6
[0136] On the other hand, when the prefixVal is not smaller than cMax >> cRiceParam, the prefix bit string can be a bit string with a length of cMax >> cRiceParam and all bits being 1.
[0137] Also, when cMax is larger than symbolVal and cRiceParam is larger than 0, a suffix bit string of the TR bit string may exist. For example, the suffix bit string can be derived as described later.
[0138] The suffix value of the symbolVal for the syntax element can be derived as in the following formula.
[0139]
Equation
[0140] Here, suffixVal can represent the suffix value of the symbolVal.
[0141] The suffix of the TR bit string (i.e., the suffix bit string) can be derived based on the FL binarization process for suffixVal where the cMax value is (1 << cRiceParam) - 1.
[0142] On the other hand, if the value of the input parameter cRiceParam is 0, the TR binarization can be exactly truncated unary binarization, and a cMax value equal to the maximum possible value of the syntax element being decoded can always be used.
[0143] Also, for example, the EGk binarization process can be performed as follows: The syntax elements coded in ue(v) can be Exp-Golomb coded syntax elements.
[0144] As an example, a 0-th order Exp-Golomb (EG0) binarization process can be performed as follows.
[0145] The parsing process for the syntax element may begin by reading the bits starting from the current position in the bitstream, including the first non-zero bit, and counting the number of leading bits such as 0. This process may be represented as follows:
[0146] [Table 7]
[0147] Moreover, the variable codeNum can be derived using the following formula:
[0148]
number
[0149] Here, the value returned by read_bits(leadingZeroBits), i.e., the value represented by read_bits(leadingZeroBits), can be interpreted as a binary representation of an unsigned integer for the first recorded most significant bit.
[0150] The structure of the Exp-Golomb code, which separates a bit string into "prefix" bits and "suffix" bits, can be represented as in the following table.
[0151] [Table 8]
[0152] The "prefix" bits are the bits parsed as described above for the leadingZeroBits calculation and may be represented as 0 or 1 in the bit string in Table 8 above. That is, a bit string starting with 0 or 1 in Table 8 above may indicate a prefix bit string. The "suffix" bits are the bits parsed in the codeNum calculation and are represented as xi in Table 8 above. That is, a bit string starting with xi in Table 8 above may indicate 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.
[0153] The bit strings assigned to the codeNum are as follows:
[0154] [Table 9]
[0155] If the descriptor of a syntax element is ue(v), i.e., if the syntax element is coded with ue(v), the value of the syntax element may be equal to codeNum.
[0156] Also, for example, the EGk binarization process can be performed as follows.
[0157] 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.
[0158] The bit string of the EGk binarization process for symbolVal can be derived as follows:
[0159] [Table 10]
[0160] Referring to Table 10 above, a binary value X can be added to the end of the bin string via each call to put(x), where x can be 0 or 1.
[0161] Also, for example, the Limited EGk binarization process can be performed as follows.
[0162] The input of the Limited EGk binarization process may be a request for Limited EGk binarization and a Rice parameter riceParam, a variable representing the binary logarithm of the maximum value log2TransformRange, and a variable representing the maximum prefix extension length maxPreExtLen, and the output of the Limited EGk binarization process may be Limited EGk binarization for a value symbolVal corresponding to a bin string.
[0163] The bit string of the Limited EGk binarization process for symbolVal can be derived as follows:
[0164] [Table 11]
[0165] Also, for example, the FL binarization process can be performed as follows.
[0166] An input of the FL binarization process may be a request for FL binarization and cMax for the syntax element, and an output of the FL binarization process may be an FL binarization for a value symbolVal corresponding to a bin string.
[0167] FL binarization may be implemented using a bit string having a number of bits that is a fixed length of the symbol value symbolVal, where the fixed length bit string may be an unsigned integer bit string. That is, a bit string for the symbol value symbolVal may be derived by FL binarization, and the bit length (i.e., the number of bits) of the bit string may be a fixed length.
[0168] For example, the fixed length can be derived as follows:
[0169]
number
[0170] The indexing of bins for FL binarization may be in a manner that uses values that increase in order from the most significant bit to the least significant bit. For example, the bin index associated with the most significant bit may be binIdx=0.
[0171] Meanwhile, for example, a binarization process for the syntax element abs_remainder of the residual information can be performed as follows.
[0172] The input 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 refer to the top left sample of the current luma transform block based on the top left luma sample of the picture.
[0173] An 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 result in an available bin string for the abs_remainder, etc.
[0174] The Rice parameter cRiceParam for the abs_remainder[n] may be derived through a Rice parameter derivation process that is performed using the hue 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. A detailed description of the Rice parameter derivation process will be given later.
[0175] 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:
[0176]
number
[0177] 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, and may be the prefix bin string if the suffix bin string does not exist.
[0178] For example, the prefix bin string may be derived as described below.
[0179] The prefix value prefixVal of the abs_remainder[n] can be derived as follows:
[0180]
number
[0181] The prefix of the bin string of the abs_remainder[n] (ie, the prefix bin string) may be derived through a TR binarization process on the prefixVal using the cMax and the cRiceParam as inputs.
[0182] If the prefix bin string is identical to a bit string with all bits being 1 and a bit length of 6, then there may be a suffix bin string of the bin string of the abs_remainder[n], which may be derived as described below.
[0183] The process of deriving the Rice parameter for abs_remainder[n] is as follows.
[0184] The input of the Rice parameter derivation process may be a colour component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of a width of a transform block, log2TbWidth, and a binary logarithm of a height of a transform block, log2TbHeight. The luma position (x0, y0) may refer to the top left sample of a current luma transform block based on the top left luma sample of a picture. Also, an output of the Rice parameter derivation process may be the Rice parameter cRiceParam.
[0185] 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 can be derived as shown in the pseudo code disclosed in the following table.
[0186] [Table 12]
[0187] Then, based on the given variable locSumAbs, the rice parameter cRiceParam can be derived as follows:
[0188] [Table 13]
[0189] Also, for example, in the process of deriving the Rice parameter for abs_remainder[n], baseLevel can be set to 4.
[0190] Alternatively, the Rice parameter cRiceParam may be determined based on whether or not a transform skip is applied to the current block. That is, when no transform 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.
[0191] In addition, the suffix value suffixVal of the abs_remainder can be derived as follows:
[0192]
number
[0193] The suffix bin string of the bin string of the abs_remainder can be derived by a Limited EGk binarization process on the suffixVal where k is set to cRiceParam+1, riceParam is set to cRiceParam, log2TransformRange is set to 15, and maxPreExtLen is set to 11.
[0194] Meanwhile, for example, a binarization process for the syntax element dec_abs_level of the residual information can be performed as follows.
[0195] Inputs of the binarization process for the dec_abs_level may be a binarization request for 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 refer to the top left sample of the current luma transform block based on the top left luma sample of the picture.
[0196] An output of the binarization process for the dec_abs_level may be the binarization of the dec_abs_level (i.e., the binarized bin string of the dec_abs_level). The binarization process may derive an available bin string for the dec_abs_level, etc.
[0197] The Rice parameter cRiceParam for the dec_abs_level[n] may be derived through a Rice parameter derivation process that is performed using the hue 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.
[0198] Also, for example, cMax for the dec_abs_level[n] can be derived based on the Rice parameter cRiceParam. The cMax can be derived as follows:
[0199]
number
[0200] Meanwhile, the binarization for the dec_abs_level[n], i.e., the bin string for the dec_abs_level[n], may be a concatenation of a prefix bin string and a suffix bin string if a suffix bin string exists, or, if the suffix bin string does not exist, the bin string for the dec_abs_level[n] may be the prefix bin string.
[0201] For example, the prefix bin string can be derived as described below.
[0202] The prefix value prefixVal of the dec_abs_level[n] can be derived as follows:
[0203]
number
[0204] The prefix of the bin string of 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.
[0205] If the prefix bin string is identical to a bit string with all bits being 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.
[0206] The Rice parameter derivation process for dec_abs_level[n] may be as follows.
[0207] The input 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 a width of a transform block, log2TbWidth, and a binary logarithm of a height of a transform block, log2TbHeight. The luma position (x0, y0) may refer to the top left sample of a current luma transform block based on the top left luma sample of a picture. Also, an output of the Rice parameter derivation process may be the Rice parameter cRiceParam.
[0208] 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 can be derived as shown in the pseudo code disclosed in the following table.
[0209] [Table 14]
[0210] Then, based on the given variable locSumAbs, the rice parameter cRiceParam can be derived as shown in the following table.
[0211] [Table 15]
[0212] Also, for example, in the process of deriving the Rice parameter for dec_abs_level[n], baseLevel can be set to 0, and the ZeroPos[n] can be derived as follows:
[0213]
number
[0214] In addition, the suffix value suffixVal of the dec_abs_level[n] can be derived as follows:
[0215]
number
[0216] The suffix bin string of the bin string of the dec_abs_level[n] may be derived through a Limited EGk binarization process on the suffixVal, where k is set to cRiceParam+1, truncSuffixLen is set to 15, and maxPreExtLen is set to 11.
[0217] Meanwhile, the above-mentioned RRC and TSRC may have the following differences.
[0218] For example, the Rice parameter cRiceParam of the syntax elements abs_remainder[] and dec_abs_level[] in the RRC may be derived based on the locSumAbs, look-up table, and / or baseLevel as described above, but the Rice parameter cRiceParam of the syntax element abs_remainder[] in the 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 for abs_remainder[] of the TSRC for the current block may be derived as 1.
[0219] - 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] may be expressed as abs_level_gt1_flag or the first coefficient level flag, the abs_level_gtx_flag[n][1] may be expressed as abs_level_gt3_flag or the second coefficient level flag, the abs_level_gtx_flag[n][2] may be expressed as abs_level_gt5_flag or the third coefficient level flag, the abs_level_gtx_flag[n][3] may be expressed as abs_level_gt7_flag or the fourth coefficient level flag, and the abs_level_gtx_flag[n][4] may be expressed 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 threshold value (e.g., 1), the second coefficient level flag may be a flag indicating whether the coefficient level is greater than a second threshold value (e.g., 3), the third coefficient level flag may be a flag indicating whether the coefficient level is greater than a third threshold value (e.g., 5), the fourth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fourth threshold value (e.g., 7), and the fifth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fifth threshold value (e.g., 9). As described above, the TSRC may 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], in comparison with the RRC.
[0220] - Also, for example, the syntax element coeff_sign_flag may be bypass coded in RRC, but the syntax element coeff_sign_flag may be bypass coded or context coded in TSRC.
[0221] Also, for the quantization process of the residual samples, dependent quantization can be proposed. Dependent quantization may refer to a scheme in which a set of permitted reconstruction values for a current transform coefficient depends on the value (value of a transform coefficient level) of a 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 for which a reconstruction level is different, and (b) defining a process for switching between the scalar quantizers. The dependent quantization may have an effect that permitted reconstruction vectors are more densely packed in an N-dimensional vector space than the existing independent scalar quantization, where N may represent the number of transform coefficients of a transform block.
[0222] FIG. 6 exemplarily illustrates a scalar quantizer used in dependent quantization. Referring to FIG. 6, the position of the available reconstruction levels may be designated as the size Δ of the quantization step. Referring to FIG. 6, the scalar quantizers may be represented as Q0 and Q1. The scalar quantizer used may be derived without being explicitly signaled in the bitstream. 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.
[0223] FIG. 7 shows an exemplary state transition and quantizer selection for dependent quantization.
[0224] 7, switching between two scalar quantizers (Q0 and Q1) can be realized by a state machine having four states. The four states can have four different values (0, 1, 2, 3). The state for a current transform coefficient can be determined by the parity of the transform coefficient level before the current transform coefficient in the coding / decompression order.
[0225] For example, when an inverse quantization process for a transform block is started, a state for dependent quantization may be set to 0. Then, the transform coefficients for the transform block may be restored in a scan order (i.e., the same order as those entropy decoded). For example, after a current transform coefficient is restored, a state for dependent quantization may be updated as shown in FIG. 7. An inverse quantization process for a transform coefficient restored after the current transform coefficient is restored in the scan order may be performed based on the updated state. k shown in FIG. 7 may represent a value of a transform coefficient, i.e., a level value of a transform coefficient. For example, if the current state is 0, if k (value of the current transform coefficient) & 1 is 0, the state may be updated to 0, and if k & 1 is 1, the state may be updated to 2. Also, for example, if the current state is 1, if k & 1 is 0, the state may be updated to 2, and if k & 1 is 1, the state may be updated to 0. Also, for example, if the current state is 2, if k&1 is 0, the state may be updated to 1, and if k&1 is 1, the state may be updated to 3. Also, for example, if the current state is 3, if k&1 is 0, the state may be updated to 3, and if k&1 is 1, the state may be updated to 1. Referring to FIG 7, if the state is one of 0 and 1, the scalar quantizer used in the inverse quantization process may be Q0, and if 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 based on a quantization parameter for a restoration level of the transform coefficients by the scalar quantizer for the current state.
[0226] 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, the residual data coding method may include Regular Residual Coding (RRC) and Transform Skip Residual Coding (TSRC).
[0227] Of the above two methods, 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. Thus, 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 skipped block. That is, if the value of transform_skip_flag is 0 or the value of slice_ts_residual_coding_disabled_flag is 1, RRC may be used, and otherwise TSRC may be used.
[0228] 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 / image coding standards do not propose any restrictions on when the aforementioned dependent quantization and the slice_ts_residual_coding_disabled_flag are used together. That is, when dependent quantization is activated at a higher 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 lower level (CU / TU), and the slice_ts_residual_coding_disabled_flag is 1, the coding performance may be degraded by performing an unnecessary operation (i.e., an operation by dependent quantization) depending on a state of dependent quantization in RRC, or an unintended loss of coding performance may occur due to an incorrect setting in the encoding device. Therefore, in this embodiment, a proposal is proposed to set a dependency / constraint between the two technologies in order to prevent unintended coding loss or malfunction caused by using both dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding the residual sample of the transform skip block in the current slice by RRC).
[0229] In one 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 are as shown in the following table.
[0230] [Table 16]
[0231] 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 available. 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 available, 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 available.
[0232] 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 other higher level syntax (High Level Syntax, HLS) (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or lower level (CU / TU) other than the picture header syntax and slice header syntax. If the ph_dep_quant_enabled_flag is signaled in a syntax other than the picture header syntax, it may be referred to by other names, for example, the ph_dep_quant_enabled_flag may be represented as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or sps_dep_quant_enabled_flag.
[0233] In addition, 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 a current slice by RRC). For example, this embodiment proposes a scheme for not using the state of the 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 caused by the combined use of dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding residual samples of a transform skip block in a current slice by RRC). The syntax of the residual coding according to this embodiment is as shown in the following table.
[0234] [Table 17-1]
[0235] [Table 17-2]
[0236] [Table 17-3]
[0237] [Table 17-4]
[0238] [Table 17-5]
[0239] [Table 17-6]
[0240] 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 by (2*AbsLevel[xC][yC]-(QState>1?1:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] may be a sign flag syntax element representing the sign of the transform coefficient, and (QState>1?1:0) may represent that the value is 1 when the value of the state QState is greater than 1, i.e., when the value of the state QState is 2 or 3, and 0 when the value of the state QState is less than or equal to 1, i.e., when the value of the state QState is 0 or 1.
[0241] Also, referring to Table 17, 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 by AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be an 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 representing the sign of the transform coefficient.
[0242] Also, according to the present embodiment, when the value of slice_ts_residual_coding_disabled_flag is 1, the dependent quantization state is not used in coding the level value of the transform coefficient, and the update of the state may not be performed. For example, the syntax of the residual coding according to the present embodiment is as shown in the following table.
[0243] [Table 18-1]
[0244] [Table 18-2]
[0245] [Table 18-3]
[0246] [Table 18-4]
[0247] [Table 18-5]
[0248] [Table 18-6]
[0249] Referring to Table 18 above, if the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, the QState may be updated. For example, if the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, the QState may be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC]&1] or QStateTransTable[QState][AbsLevel[xC][yC]&1]. Also, if the value of slice_ts_residual_coding_disabled_flag is 1, the process of updating the QState may not be performed.
[0250] 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>1?1:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] may be a sign flag syntax element representing the sign of the transform coefficient, and (QState>1?1:0) may represent that the value of the state QState is 1 when the value of the state QState is greater than 1, i.e., the value of the state QState is 2 or 3, and that the value of the state QState is 0 when the value of the state QState is less than or equal to 1, i.e., the value of the state QState is 0 or 1.
[0251] Also, referring to Table 18, 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 by AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be an 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.
[0252] This document also proposes another embodiment for setting dependency / constraint between dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding residual samples of transform skip blocks in the current slice by RRC). For example, this embodiment proposes a scheme for adding a constraint using transform_skip_flag to a process of updating the state of dependent quantization in RRC or deriving the value of transform coefficients (transform coefficient levels) depending on the state. That is, this embodiment proposes a scheme for not using a process of updating the state of dependent quantization in RRC and / or deriving the value of transform coefficients (transform coefficient levels) depending on the state based on the transform_skip_flag. The syntax of residual coding according to this embodiment is as shown in the following table.
[0253] [Table 19-1]
[0254] [Table 19-2]
[0255] [Table 19-3]
[0256] [Table 19-4]
[0257] [Table 19-5]
[0258] [Table 19-6]
[0259] Referring to Table 19 above, if the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, the QState may be updated. For example, if the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, the QState may be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC]&1] or QStateTransTable[QState][AbsLevel[xC][yC]&1]. Also, if the value of transform_skip_flag is 1, the process of updating the QState may not be performed.
[0260] 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 by (2*AbsLevel[xC][yC]-(QState>1?1:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] may be a sign flag syntax element representing the sign of the transform coefficient, and (QState>1?1:0) may represent that the value of the state QState is 1 when the value of the state QState is greater than 1, i.e., the value of the state QState is 2 or 3, and that the value of the state QState is 0 when the value of the state QState is less than or equal to 1, i.e., the value of the state QState is 0 or 1.
[0261] Also, referring to Table 19, 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 by AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be an 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 representing the sign of the transform coefficient.
[0262] Meanwhile, as mentioned above, the information (syntax elements) in the syntax table disclosed in this document can be included in the image / video information, configured / encoded by the encoding device, and transmitted to the decoding device in the form of a bitstream. The decoding device can parse / decode the information (syntax elements) in the syntax table. The decoding device can perform a block / image / video recovery procedure based on the decoded information.
[0263] FIG. 8 is a schematic diagram illustrating an image encoding method by an encoding device according to the present document. The method disclosed in FIG. 8 may be performed by the encoding device disclosed in FIG. 2. Specifically, for example, S800 to S840 in FIG. 8 may be performed by an entropy encoding unit of the encoding device. Also, although not shown, a process of deriving a predicted sample may be performed by a prediction unit of the encoding device, a process of deriving a residual sample for the current block based on an original sample and a predicted sample for the current block may be performed by a subtraction unit of the encoding device, and a process of generating a reconstructed sample and a reconstructed picture for the current block based on a residual sample and a predicted sample for the current block may be performed by an addition unit of the encoding device.
[0264] The encoding device encodes a dependent quantization available flag (S800). The encoding device may encode a dependent quantization available flag for whether dependent quantization is available. The image information may include the dependent quantization available flag. For example, the encoding device may determine whether dependent quantization is available for a block of a picture in a sequence, and may encode a dependent quantization available flag for whether dependent quantization is available. For example, the dependent quantization available flag may be a flag for whether dependent quantization is available. For example, the dependent quantization available flag may indicate whether dependent quantization is available. That is, for example, the dependent quantization available flag may indicate whether dependent quantization is available for a block of a picture in a sequence. For example, the dependent quantization available flag may indicate whether a dependent quantization use flag indicating whether dependent quantization is used for a current slice may exist. For example, the dependent quantization available flag with a value of 1 may indicate that the dependent quantization is available, and the dependent quantization available flag with 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, etc. The syntax element of the dependent quantization available flag may be the aforementioned 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.
[0265] The encoding apparatus encodes a Transform Skip Residual Coding (TSRC) availability flag based on the dependent quantization availability flag (S810). The image information may include a TSRC availability flag.
[0266] For example, the encoding device may encode the TSRC available flag based on 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. That is, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be encoded. In other words, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be signaled. Also, for example, when the value of the dependent quantization available flag is 1, the TSRC available flag may not be encoded, and the value of the TSRC available flag may be derived as 0 in the decoding device. That is, for example, when the value of the dependent quantization available flag is 1 (e.g., when dependent quantization is applied (or used) to the current block), 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. Thus, for example, when dependent quantization is not available for the current block, the TSRC available flag may be signaled (or encoded). When dependent quantization is available for the current block, the TSRC available flag may not be signaled (or encoded) and the value of the TSRC available flag may be derived as 0 in the decoding device. Here, the current block may be a coding block (CB) or a transform block (TB).
[0267] Here, for example, the TSRC available flag may be a flag for whether TSRC is available. That is, for example, the TSRC available flag may be a flag indicating whether TSRC is available for a block in a slice. For example, the TSRC available flag having a value of 1 may indicate that the TSRC is not available, and the TSRC available flag having a value of 0 may indicate that the TSRC is available. Also, for example, the TSRC available flag may be signaled in a slice header syntax. The syntax element of the TSRC available flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.
[0268] The encoding apparatus determines a syntax of residual coding for the current block based on the TSRC availability flag (S820). The encoding apparatus may determine a syntax of residual coding for the current block based on the TSRC availability flag. For example, the encoding apparatus may determine a syntax of residual coding for the current block to be one of a syntax of Regular Residual Coding (RRC) and a syntax of Transform Skip Residual Coding (TSRC) 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.
[0269] For example, based on the TSRC availability flag having a value of 1, the residual coding syntax for the current block may be determined to be a Regular Residual Coding (RRC) syntax. In this case, for example, a transform skip flag for whether or not the current block is transform skipped may be encoded, and the value of the transform skip flag may be 1. For example, the image information may include a transform skip flag for the current block. The transform skip flag may indicate whether or not the current block is transform skipped. That is, the transform skip flag may indicate whether or not a transform is applied to a transform coefficient of the current block. The syntax element representing the transform skip flag may be the above-mentioned transform_skip_flag. For example, if 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., transform skipped), and if 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.
[0270] Also, for example, the residual coding syntax for the current block may be determined to be a Transform Skip Residual Coding (TSRC) syntax based on the TSRC availability flag having a value of 0. Also, for example, a transform skip flag for whether or not the transform skip of the current block is enabled may be encoded, and the residual coding syntax for the current block may be determined to be a Transform Skip Residual Coding (TSRC) syntax based on the transform skip flag having a value of 1 and the TSRC availability flag having a value of 0. Also, for example, a transform skip flag for whether or not the transform skip of the current block is enabled may be encoded, and the residual coding syntax for the current block may be determined to be a Regular Residual Coding (RRC) syntax based on the transform skip flag having a value of 0 and the TSRC availability flag having a value of 0.
[0271] The encoding apparatus encodes residual information of the determined residual coding syntax for the current block (S830). The encoding apparatus may derive a residual sample for the current block and may encode the residual information of the determined residual coding syntax for the residual sample of the current block. The image information may include residual information.
[0272] 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 an RD cost. Depending on the determined mode, the encoding device may derive a prediction sample for the current block, and may derive a residual sample for the current block through subtraction of an original sample for the current block and the prediction sample.
[0273] Thereafter, for example, the encoding apparatus may derive transform coefficients of the current block based on the residual samples. 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.
[0274] 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 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 perform a transform on the residual sample to derive the transform coefficient. The current block may include a plurality of sub-blocks or coefficient groups (CG). Also, the size of the sub-blocks of the current block may be 4x4 size or 2x2 size. 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). Also, a transform coefficient may be expressed as a residual coefficient.
[0275] Meanwhile, the encoding apparatus may determine whether dependent quantization is applied to the current block. For example, if the 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 the 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 before the current transform coefficient in a 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 a 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 by a scalar quantizer for the updated state.
[0276] For example, if the syntax of the residual coding for the current block is determined to be the RRC syntax, the encoding device 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.
[0277] 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.
[0278] 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.
[0279] Specifically, for example, the syntax element may include position information representing a position of a last non-zero transform coefficient in an array of residual coefficients of the current block. That is, the syntax element may include position information representing a position of a last non-zero transform coefficient in a scanning order of the current block. The position information may include information representing a prefix of a column position of the last non-zero transform coefficient, information representing a prefix of a row position of the last non-zero transform coefficient, information representing a suffix of a column position of the last non-zero transform coefficient, and information representing 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, a non-zero transform coefficient may be referred to as a significant coefficient.
[0280] Also, for example, the syntax elements may include a coded sub-block flag indicating whether a current sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag indicating whether a coefficient level for the transform coefficient is greater than a first critical value, a parity level flag for 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.
[0281] Also, for example, the syntax element may include coefficient value related information for values of the transform coefficients of the current block, where the coefficient value related information may be abs_remainder and / or dec_abs_level.
[0282] 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.
[0283] For example, if the residual coding syntax for the current block is determined to be 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 syntax elements disclosed in Table 3 above.
[0284] 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.
[0285] 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.
[0286] 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 a sign for the transform coefficient, a first coefficient level flag indicating whether a coefficient level for the transform coefficient is greater than a first critical value, and / or a parity level flag indicating a parity of a coefficient level for 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 significance 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.
[0287] 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 representing 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.
[0288] The encoding device generates a bitstream including the dependent quantization available flag, the TSRC available flag, and the residual information (S840). For example, the encoding device may output image information including the dependent quantization available flag, the TSRC available flag, and the residual information in a bitstream. The bitstream may include the dependent quantization available flag, the TSRC available flag, and the residual information.
[0289] Meanwhile, the image information may include prediction related information for the current block, The prediction related information may include prediction mode information for an inter prediction mode or an intra prediction mode to be performed on the current block.
[0290] Meanwhile, the bitstream can be transmitted to the decoding device via a network or a (digital) storage medium, where the network can include a broadcast network and / or a communication network, and the digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.
[0291] FIG. 9 is a schematic diagram of an encoding device that performs an image encoding method according to the present document. The method disclosed in FIG. 8 can be performed by the encoding device disclosed in FIG. 9. Specifically, for example, the entropy encoding unit of the encoding device of FIG. 9 can perform S800 to S840 of FIG. 8. Although not shown, the process of deriving a predicted sample can be performed by a prediction unit of the encoding device, the process of deriving a residual sample for the current block based on the original sample and the predicted sample for the current block can be performed by a subtraction unit of the encoding device, and the process of generating a reconstructed sample and a reconstructed picture for the current block based on the residual sample and the predicted sample for the current block can be performed by an addition unit of the encoding device.
[0292] FIG. 10 is a schematic diagram showing an image 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, S1000 to S1030 in FIG. 10 may be performed by an entropy decoding unit of the decoding device, S1040 in FIG. 10 may be performed by a residual processing unit of the decoding device, and S1050 may be performed by an adder unit of the decoding device. Also, although not shown, the process of receiving prediction information for a current block may be performed by an entropy decoding unit of the decoding device, and the process of deriving a prediction sample of the current block may be performed by a prediction unit of the decoding device.
[0293] A decoding device obtains a dependent quantization available flag (S1000). The decoding device may obtain image information including the dependent quantization available flag through a bitstream. The image information may include the dependent quantization available flag. For example, the dependent quantization available flag may be a flag for whether dependent quantization is available. For example, the dependent quantization available flag may indicate whether dependent quantization is available. That is, for example, the dependent quantization available flag may indicate whether dependent quantization is available for a block of a picture in a sequence. For example, the dependent quantization available flag may indicate whether a dependent quantization used flag indicating whether dependent quantization is used for a current slice may exist. For example, the dependent quantization available flag with a value of 1 may indicate that the dependent quantization is available, and the dependent quantization available flag with 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, etc. The syntax element of the dependent quantization available flag may be the aforementioned 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.
[0294] The decoding apparatus obtains a Transform Skip Residual Coding (TSRC) availability flag based on the dependent quantization availability flag (S1010). The image information may include a TSRC availability flag.
[0295] For example, the decoding device may acquire the TSRC available flag based on 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. That is, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be acquired. In other words, for example, when the value of the dependent quantization available flag is 0 (i.e., when the dependent quantization available flag indicates that dependent quantization is not available), the TSRC available flag may be signaled. Also, for example, when the value of the dependent quantization available flag is 1, 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 dependent quantization available flag is 1 (e.g., when dependent quantization is applied (or used) for the current block), the TSRC available flag may not be signaled and the value of the TSRC available flag may be derived as 0. Thus, for example, when dependent quantization is not available for the current block, the TSRC available flag may be signaled (or obtained). When dependent quantization is available for the current block, the TSRC available flag may not be signaled (or obtained) and the value of the TSRC available flag may be derived as 0. Here, the current block may be a coding block (CB) or a transform block (TB).
[0296] Here, for example, the TSRC available flag may be a flag for whether TSRC is available. That is, for example, the TSRC available flag may be a flag indicating whether TSRC is available for a block in a slice. For example, the TSRC available flag having a value of 1 may indicate that the TSRC is not available, and the TSRC available flag having a value of 0 may indicate that the TSRC is available. Also, for example, the TSRC available flag may be signaled in a slice header syntax. The syntax element of the TSRC available flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.
[0297] The decoding apparatus determines a syntax of residual coding for the current block based on the TSRC availability flag (S1020). The decoding apparatus may determine a syntax of residual coding for the current block based on the TSRC availability flag. For example, the decoding apparatus may determine a syntax of residual coding for the current block to be one of a syntax of Regular Residual Coding (RRC) and a syntax of Transform Skip Residual Coding (TSRC) 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.
[0298] For example, based on the TSRC availability flag having a value of 1, the residual coding syntax for the current block may be determined to be a Regular Residual Coding (RRC) syntax. In this case, for example, a transform skip flag for whether or not the current block is transform skipped may be obtained, and the value of the transform skip flag may be 1. For example, the image information may include a transform skip flag for the current block. The transform skip flag may indicate whether or not the current block is transform skipped. That is, the transform skip flag may indicate whether or not a transform is applied to a transform coefficient of the current block. The syntax element representing 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., transform 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.
[0299] Also, for example, based on the TSRC availability flag having a value of 0, the syntax of the residual coding for the current block may be determined to be a Transform Skip Residual Coding (TSRC) syntax. Also, for example, a transform skip flag for whether or not the transform skip of the current block is possible may be obtained, and based on the transform skip flag having a value of 1 and the TSRC availability flag having a value of 0, the syntax of the residual coding for the current block may be determined to be a Transform Skip Residual Coding (TSRC) syntax. Also, for example, a transform skip flag for whether or not the transform skip of the current block is possible may be obtained, and based on the transform skip flag having a value of 0 and the TSRC availability flag having a value of 0, the syntax of the residual coding for the current block may be determined to be a Regular Residual Coding (RRC) syntax.
[0300] The decoding apparatus may obtain residual information of the determined syntax of the residual coding for the current block (S1030). The decoding apparatus may obtain the residual information of the determined syntax of the residual coding for the current block. The image information may include residual information.
[0301] For example, if the syntax of the residual coding for the current block is determined to be the RRC syntax, the decoding device may obtain 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.
[0302] 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.
[0303] 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.
[0304] Specifically, for example, the syntax element may include position information representing a position of a last non-zero transform coefficient in an array of residual coefficients of the current block. That is, the syntax element may include position information representing a position of a last non-zero transform coefficient in a scanning order of the current block. The position information may include information representing a prefix of a column position of the last non-zero transform coefficient, information representing a prefix of a row position of the last non-zero transform coefficient, information representing a suffix of a column position of the last non-zero transform coefficient, and information representing 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, the non-zero transform coefficients may be referred to as significant coefficients.
[0305] Also, for example, the syntax element may include a coded sub-block flag indicating whether a current sub-block of the current block includes a non-zero transform coefficient, a significant coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag indicating whether a coefficient level for the transform coefficient is greater than a first threshold value, a parity level flag indicating 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 threshold value, where 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.
[0306] Also, for example, the syntax element may include coefficient value related information for values of the transform coefficients of the current block, where the coefficient value related information may be abs_remainder and / or dec_abs_level.
[0307] 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.
[0308] For example, if the syntax of the residual coding for the current block is determined to be the TSRC syntax, the decoding device may obtain residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax may include syntax elements disclosed in Table 3 above.
[0309] 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.
[0310] 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.
[0311] 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 a sign for the transform coefficient, a first coefficient level flag indicating whether a coefficient level for the transform coefficient is greater than a first critical value, and / or a parity level flag indicating a parity of a coefficient level for 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 significance 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.
[0312] 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 representing a sign for the transform coefficient, where the coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be ceff_sign_flag.
[0313] The decoding device may derive a residual sample of the current block based on the residual information (S1040). For example, the decoding device may derive transform coefficients of the current block based on the residual information, and may derive a residual sample of the current block based on the transform coefficients.
[0314] For example, the decoding apparatus may derive transform coefficients of the current block based on the syntax element of the residual information. Then, the decoding apparatus may derive residual samples of the current block based on the transform coefficients. As an example, if it is derived based on the transform skip flag that no transform is applied to the current block, i.e., if the value of the transform skip flag is 1, the decoding apparatus may derive the transform coefficients as the residual samples of the current block. Alternatively, for example, if it is derived based on the transform skip flag that no transform is applied to the current block, i.e., if the value of the transform skip flag is 1, the decoding apparatus may dequantize the transform coefficients and derive the residual samples of the current block. Alternatively, for example, if it is derived based on the transform skip flag that a transform is applied to the current block, i.e., if the value of the transform skip flag is 0, the decoding apparatus may inverse transform the transform coefficients and derive the residual samples of the current block. Alternatively, for example, if it is derived 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 may inverse quantize the transform coefficients and inverse transform the inverse quantized transform coefficients to derive the residual samples of the current block.
[0315] Meanwhile, for example, it may be determined whether the dependent quantization is applied to the current block based on the dependent quantization available flag. For example, if the value of the dependent quantization available flag is 1 (i.e., if the dependent quantization available flag indicates that the dependent quantization is available), dependent quantization may be applied to the current block. For example, if the dependent quantization is applied to the current block, the decoding device may perform the dependent quantization process on the transform coefficients and derive the residual sample of the current block. That is, for example, if the dependent quantization is applied to the current block, the decoding device may derive the residual sample of the current block based on the dependent quantization on the transform coefficients. For example, when the dependent quantization is applied to the current block, the decoding device may update a state (Qstate) for dependent quantization based on a coefficient level of a transform coefficient immediately before the current transform coefficient in a 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 based on a quantization parameter for a restoration level of the current transform coefficient by a scalar quantizer for the updated state. Here, the restoration level may be derived based on a syntax element for the current transform coefficient.
[0316] Also, for example, if the dependent quantization is not applied to the current block, the decoding device may derive coefficient levels of the transform coefficients based on syntax elements for the transform coefficients of the current block, and may derive residual samples by inverse quantizing the coefficient levels. That is, for example, if the dependent quantization is not applied to the current block, the decoding device may not perform a state (Qstate) update process based on the coefficient level of the transform coefficient immediately before the current transform coefficient in the scanning order.
[0317] The decoding device generates a reconstructed picture based on the residual sample (S1050). For example, the decoding device may generate a reconstructed sample and / or a reconstructed picture of the current block based on the residual sample. For example, the decoding device may perform an inter prediction mode or an intra prediction mode on the current block based on prediction information received via a bitstream, derive a prediction sample, and generate the reconstructed sample by adding the prediction sample and the residual sample.
[0318] Hereafter, as mentioned above, if necessary, in-loop filtering procedures such as deblocking filtering, SAO and / or ALF procedures may be applied to the reconstructed pictures in order to improve the subjective / objective image quality.
[0319] FIG. 11 is a schematic diagram of a decoding device that performs an image decoding method according to the present document. The method disclosed in FIG. 10 can be performed by the decoding device disclosed in FIG. 11. Specifically, for example, the entropy decoding unit of the decoding device of FIG. 11 can perform S1000 to S1030 of FIG. 10, the residual processing unit of the decoding device of FIG. 11 can perform S1040 of FIG. 10, and the adder of the decoding device of FIG. 11 can perform S1050 of FIG. 10. Although not shown, the process of receiving prediction information for a current block can be performed by the entropy decoding unit of the decoding device of FIG. 11, and the process of deriving a prediction sample of a current block can be performed by a prediction unit of the decoding device of FIG. 11.
[0320] According to the above mentioned document, the efficiency of residual coding can be increased.
[0321] In addition, according to this document, a signaling relationship can be set between the dependent quantization available flag and the TSRC available flag, and the TSRC available flag can be signaled when dependent quantization is not available, thereby preventing dependent quantization from being 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.
[0322] In addition, according to this document, the TSRC availability flag can be signaled only when dependent quantization is not used, thereby preventing overlapping between coding of the RRC syntax and the use of dependent quantization for the transform skip block, and allowing the TSRC availability flag to be coded more effectively, thereby reducing the amount of bits and improving overall residual coding efficiency.
[0323] In the above-described embodiments, the method is described with reference to a flow chart with a series of steps or blocks, but this document is not limited to the order of steps, and certain steps may occur in a different order or simultaneously with other steps than those described above. Also, those skilled in the art will understand that the steps shown in the flow chart are not exclusive, and other steps may be included, or one or more steps of the flow chart may be deleted without affecting the scope of this document.
[0324] The embodiments described in this document may be implemented and executed on a processor, a microprocessor, a controller, or a chip. For example, the functional units illustrated in the drawings may be implemented and executed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information (e.g., information on instructions) or algorithms for implementation may be stored in a digital recording medium.
[0325] In addition, the decoding device and the encoding device to which the embodiment of the present document is 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 interactive device, a real-time communication device such as video communication, a mobile streaming device, a recording medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, a transportation terminal (e.g., a vehicle terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, and may be used to process a video signal or a data signal. For example, the over-the-top video (OTT) device may 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.
[0326] In addition, the processing method to which the embodiments of this document are applied may be produced in the form of a program executed by a computer and may be 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 all types of storage devices and distributed storage devices 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 a medium realized in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bit stream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.
[0327] Also, the embodiments of the present document may be implemented in 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.
[0328] FIG. 12 exemplarily illustrates a structural diagram of a content streaming system to which the embodiments of this document are applied.
[0329] 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 repository, a user device, and a multimedia input device.
[0330] 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.
[0331] 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.
[0332] 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, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.
[0333] The streaming server may receive content from a media repository and / or an encoding server. For example, when the content is received from the encoding server, the content may be received in real time. In this case, the streaming server may store the bitstream for a certain period of time in order to provide a smooth streaming service.
[0334] 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 glass, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc. Each server in the content streaming system can be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.
[0335] The claims described in this specification may be combined in various ways. For example, the technical features of the method claims in this specification may be combined and realized as an apparatus, the technical features of the apparatus claims in this specification may be combined and realized as a method, the technical features of the method claims and the technical features of the apparatus claims in this specification may be combined and realized as an apparatus, and the technical features of the method claims and the technical features of the apparatus claims in this specification may be combined and realized as a method.
Claims
1. 1. An image decoding method performed by a decoding device, comprising: obtaining a dependent quantization available flag; obtaining a transform skip residual coding (TSRC) disable flag based on the dependent quantization available flag; determining a syntax of residual coding for a current block based on the TSRC invalid flag; obtaining residual information of the residual coding syntax for the current block; deriving a residual sample of the current block based on the residual information; generating a reconstructed picture based on the residual samples; The dependent quantization availability flag is a flag indicating whether dependent quantization is available; (i) the TSRC invalid flag is obtained based on the value of the dependent quantization available flag being 0; Based on the TSRC invalid flag being a value of 1, a syntax structure of the residual coding is used; Based on the value of the TSRC invalid flag being 0, the syntax structure of the residual coding is not used; (ii) the TSRC invalid flag is not obtained based on the dependent quantization available flag having a value of 1.
2. 1. An image encoding method performed by an encoding device, comprising: encoding a dependent quantization available flag; encoding a transform skip residual coding (TSRC) disable flag based on the dependent quantization availability flag; determining a syntax of residual coding for a current block based on the TSRC invalid flag; encoding residual information of the residual coding syntax for the current block; generating a bitstream including the dependent quantization available flag, the TSRC invalid flag, and the residual information; The dependent quantization availability flag is a flag indicating whether dependent quantization is available; (i) the TSRC invalid flag is obtained based on the value of the dependent quantization available flag being 0; Based on the TSRC invalid flag being a value of 1, a syntax structure of the residual coding is used; Based on the value of the TSRC invalid flag being 0, the syntax structure of the residual coding is not used; (ii) the TSRC invalid flag is not obtained based on the dependent quantization available flag having a value of 1.
3. 1. A transmission method for data including a bitstream of image information, comprising: obtaining the bitstream of the image information including residual information, the bitstream being generated by: encoding a dependent quantization available flag; encoding a transform skip residual coding (TSRC) disable flag based on the dependent quantization available flag; determining a residual coding syntax for a current block based on the TSRC disable flag; encoding the residual information of the residual coding syntax for the current block; and generating the bitstream including the dependent quantization available flag, the TSRC disable flag, and the residual information; transmitting the data including the bitstream of the image information including the residual information; The dependent quantization availability flag is a flag indicating whether dependent quantization is available; (i) the TSRC invalid flag is obtained based on the value of the dependent quantization available flag being 0; Based on the TSRC invalid flag being a value of 1, a syntax structure of the residual coding is used; Based on the value of the TSRC invalid flag being 0, the syntax structure of the residual coding is not used; (ii) A transmission method, in which the TSRC invalid flag is not obtained based on the value of the dependent quantization available flag being 1.