Video decoding method and apparatus
By employing flags to determine the availability of dependent quantization and sign data hiding, and using TSRC, the method optimizes residual coding efficiency, reducing the number of coded bits and enhancing video coding efficiency for high-resolution video data.
Patent Information
- Application Number
- JP2024181776
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2020-03-31
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-09
- Estimated Expiration
- 2041-03-30
AI Technical Summary
The increasing demand for high-resolution, high-quality video has led to a surge in the amount of data, resulting in higher transmission and storage costs, necessitating more efficient video coding technologies.
A method and apparatus for video decoding that includes determining the availability of dependent quantization and sign data hiding, and performing Transform Skip Residual Coding (TSRC) based on flags to optimize residual coding efficiency.
This approach reduces the amount of coded bits and improves overall residual coding efficiency by strategically skipping unnecessary processes when certain conditions are not met, thereby enhancing video coding efficiency.
Smart Images

Figure 2025003494000001_ABST
Abstract
Description
[Technical field]
[0001] This document relates to a video coding technology, and more particularly to a video decoding method and apparatus for coding flag information indicating whether TSRC is available when coding residual data of a current block in a video coding system. [Background technology]
[0002] In recent years, the demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images has been increasing in various fields. As the resolution and quality of image data increases, the amount of information or bits to be transmitted increases compared to existing image data, and therefore, 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 costs of transmission and storage increase.
[0003] Therefore, a highly efficient video compression technology is required to effectively transmit, store and play back high-resolution, high-quality video information. Summary of the Invention [Problem to be solved by the invention]
[0004] The technical problem of this document is to provide a method and apparatus for increasing video coding efficiency.
[0005] Another technical problem of this document is to provide a method and apparatus for improving the efficiency of residual coding. [Means for solving the problem]
[0006] According to an embodiment of the present document, there is provided a video decoding method performed by a decoding device, the method including the steps of: obtaining a dependent quantization available flag indicating whether dependent quantization is available, obtaining a sign data hiding available flag indicating whether sign data hiding is available, obtaining a TSRC available flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization available flag and the sign data hiding available flag, obtaining residual information for a current block based on the TSRC available flag, 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 TSRC available flag is obtained based on the dependent quantization available flag having a value of 0 and the sign data hiding available flag having a value of 0.
[0007] According to another embodiment of the present document, there is provided a decoding device for performing video decoding, the decoding device including: an entropy decoding unit for obtaining a dependent quantization available flag indicating whether dependent quantization is available, a sign data hiding available flag indicating whether sign data hiding is available, and a TSRC available flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization available flag and the sign data hiding available flag, and obtaining residual information for a current block based on the TSRC available flag, a residual processing unit for deriving a residual sample of the current block based on the residual information, and an adder for generating a reconstructed picture based on the residual sample, wherein the TSRC available flag is obtained based on the dependent quantization available flag having a value of 0 and the sign data hiding available flag having a value of 0.
[0008] According to yet another embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including the steps of: encoding a dependent quantization available flag indicating whether dependent quantization is available, encoding a sign data hiding available flag indicating whether sign data hiding is available, encoding a TSRC available flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization available flag and the sign data hiding available flag, encoding residual information for a current block based on the TSRC available flag, and generating a bitstream including the dependent quantization available flag, the sign data hiding available flag, the TSRC available flag, and the residual information, wherein the TSRC available flag is encoded based on the dependent quantization available flag having a value of 0 and the sign data hiding available flag having a value of 0.
[0009] According to yet another embodiment of the present document, there is provided a video encoding apparatus, the encoding apparatus including an entropy encoding unit for encoding a dependent quantization available flag indicating whether dependent quantization is available, encoding a sign data hiding available flag indicating whether sign data hiding is available, encoding a Transform Skip Residual Coding (TSRC) available flag indicating whether TSRC is available based on the dependent quantization available flag and the sign data hiding available flag, encoding residual information for a current block based on the TSRC available flag, and generating a bitstream including the dependent quantization available flag, the sign data hiding available flag, the TSRC available flag, and the residual information, wherein the TSRC available flag is encoded based on the dependent quantization available flag having a value of 0 and the sign data hiding 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 storing a bitstream including video information for performing a video decoding method, the video decoding method including the steps of: obtaining a dependent quantization available flag indicating whether dependent quantization is available, obtaining a sign data hiding available flag indicating whether sign data hiding is available, obtaining a TSRC available flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization available flag and the sign data hiding available flag, obtaining residual information for a current block based on the TSRC available flag, 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 TSRC available flag is obtained based on the dependent quantization available flag having a value of 0 and the sign data hiding 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, by establishing a signaling relationship between the sign data hiding available flag and the TSRC available flag and signaling the TSRC available flag when sign data hiding is not available, sign data hiding is not used when TSRC is not available and the RRC syntax is coded for the transform skip block, thereby improving coding efficiency and reducing the amount of coded bits to improve overall residual coding efficiency.
[0013] According to this document, by establishing a signaling relationship between the dependent quantization available flag and the TSRC available flag and signaling the TSRC available flag when dependent quantization is not available, dependent quantization is not used when TSRC is not available and the RRC syntax is coded for the transform skip block, thereby improving coding efficiency and reducing the amount of coded bits to improve overall residual coding efficiency.
[0014] According to this document, by establishing a signaling relationship between the transform skip available flag and the TSRC available flag and signaling the TSRC available flag when transform skip is available, the amount of coded bits can be reduced and the overall residual coding efficiency can be improved. [Brief description of the drawings]
[0015] [Figure 1] FIG. 1 illustrates a schematic diagram of an example video / image coding system to which embodiments of the present document may be applied. [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video / image encoding device to which an embodiment 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 this document can be applied. [Figure 4] FIG. 1 illustrates an example of an intra-prediction based video / image encoding method. [Diagram 5] FIG. 2 illustrates an example of an intra-prediction based video / picture decoding method. [Figure 6] FIG. 1 illustrates an intra prediction procedure. [Figure 7] FIG. 1 illustrates an example of an inter-prediction based video / picture encoding method. [Figure 8] FIG. 2 illustrates an example of an inter-prediction based video / picture decoding method. [Figure 9] FIG. 1 illustrates an inter prediction procedure. [Figure 10]FIG. 1 illustrates a context-adaptive binary arithmetic coding (CABAC) scheme for encoding syntax elements. [Figure 11] FIG. 1 is a diagram illustrating an example of transform coefficients within a 4x4 block. [Figure 12] FIG. 2 illustrates a scalar quantizer used in dependent quantization. [Figure 13] FIG. 2 illustrates state transitions and quantizer selection for dependent quantization. [Figure 14] 1 is a diagram illustrating a video encoding method according to an encoding device according to the present document; [Figure 15] 1 is a schematic diagram of an encoding device for performing a video encoding method according to the present document; [Figure 16] 1 is a diagram illustrating a video decoding method according to a decoding device according to the present document; [Figure 17] 1 is a schematic diagram of a decoding device for performing a video decoding method according to the present document; [Figure 18] FIG. 1 illustrates the structure of a content streaming system to which the embodiments of this document are applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] This document may be modified in various ways 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 the embodiments of this document to the specific embodiment. Terms commonly used in this specification are used only to describe specific embodiments, and are not intended to limit the technical ideas of this document. Singular expressions also include plural expressions unless otherwise specified in the context. 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 as not precluding the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0017] Meanwhile, each component in the drawings described in this document is shown independently for the convenience of describing different characteristic functions, and does not mean that each component is embodied as separate hardware or software. For example, two or more components among the components may be combined to form one component, or one component may be divided into multiple components. An embodiment in which each component is integrated and / or separated is also included in the scope of the rights of this document as long as it does not deviate from the essence of this document.
[0018] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following, the same components in the drawings are designated by the same reference numerals, and duplicated descriptions of the same components will be omitted.
[0019] FIG. 1 illustrates a schematic diagram of an example video / image coding system in which embodiments of the present document may be applied.
[0020] 1, a video / image coding system may include a first device (source device) and a second device (receiving device). The source device may transmit encoded video / image information or data to the receiving device in the form of a file or streaming via a digital storage medium or a network.
[0021] The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / video encoding device, and the decoding device may be referred to as a video / video decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may also include a display unit, which may be configured as a separate device or an external component.
[0022] A video source may obtain video / video by a video / video capture, synthesis, or generation process, etc. A video source may include a video / video capture device and / or a video / video generation device. A video / video capture device may include, for example, one or more cameras, a video / video archive containing previously captured video / video, etc. A video / video generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / video. For example, a virtual video / video may be generated by a computer, etc., in which case the process of generating the associated data may replace the video / video capture process.
[0023] An encoding device may encode input video / image. The encoding device may perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) may be output in the form of a bitstream.
[0024] The transmitting unit 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 according to 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.
[0025] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, and prediction, which correspond to the operations of the encoding device.
[0026] The renderer can render the decoded video / image. The rendered video / image can be displayed on a display unit.
[0027] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document may be applied to methods disclosed in the versatile video coding (VVC) standard, the essential video coding (EVC) standard, the AOMedia Video1 (AV1) standard, the 2nd generation of audio video coding standard (AVS2) or next generation video / image coding standards (such as H.267 or H.268).
[0028] This document presents various embodiments relating to video / image coding, which may be performed in combination with one another, unless otherwise specified.
[0029] In this document, video may refer to a collection of a series of images over time. A picture generally refers to a unit that represents one image at a specific time, and a subpicture / slice / tile is a unit that constitutes a part of a picture in coding. A subpicture / slice / tile may include one or more coding tree units (CTUs). A picture may be composed of one or more subpictures / slices / tiles. A picture may be composed of one or more tile groups. A tile group may include one or more tiles. A brick may represent a rectangular area of a CTU row within a tile of a picture. A tile may be partitioned into multiple bricks, and each brick may be composed of one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be called a brick. A brick scan may represent a particular sequential ordering of CTUs partitioning a picture, where the CTUs may be aligned in a brick-to-CTU raster scan, the bricks in a tile may be aligned contiguously in a raster scan of the bricks of the tile, and the tiles in a picture may be aligned contiguously in a raster scan of the tiles of the picture. A sub-picture may represent a rectangular region of one or more slices in a picture, i.e., a sub-picture may include one or more slices that collectively cover a rectangular region of a picture. A tile is a rectangular region of a CTU within a particular tile row and a particular tile column in a picture. The tile column is a rectangular region of a CTU, where the rectangular region has a height equal to the height of the picture, and a width may be specified by a syntax element in a picture parameter set. The tile row is a rectangular region of a CTU, where the rectangular region has a width specified by a syntax element in a picture parameter set, and a height equal to the height of the picture.A tile scan may represent a particular sequential ordering of CTUs that partition a picture, where the CTUs may be consecutively aligned in a tile raster scan, and tiles within a picture may be consecutively aligned in a raster scan of the tiles of the picture. A slice may contain an integer number of bricks of a picture, where the integer number of bricks may be included in a single NAL unit. A slice may consist of multiple complete tiles or may be a contiguous sequence of complete bricks of one tile. Tile group and slice may be used interchangeably in this document. For example, tile group / tile group header may be referred to as slice / slice header in this document.
[0030] A pixel or PEL (pel) can mean the smallest unit that constitutes one picture (or image). A term corresponding to a pixel may be "sample." A sample can generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luma component, or may represent only a pixel / pixel value of a chroma component.
[0031] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (ex. cb, cr) blocks. A unit may be used interchangeably with terms such as a block or an area. In general, an MxN block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.
[0032] As used herein, "A or B" can mean "A only," "B only," or "both A and B." In other words, as used herein, "A or B" can be interpreted as "A and / or B." For example, as used herein, "A, B or C" can mean "A only," "B only," "C only," or "any combination of A, B and C."
[0033] As used herein, a slash ( / ) or a comma can mean "and / or." For example, "A / B" can mean "A and / or B." Thus, "A / B" can mean "A only," "B only," or "both A and B." For example, "A, B, C" can mean "A, B, or C."
[0034] In this specification, "at least one of A and B" can 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 as the same as "at least one of A and B."
[0035] In addition, in this specification, "at least one of A, B and C" can mean "A only," "B only," "C only," or "any combination of A, B and C." In addition, "at least one of A, B or C" or "at least one of A, B and / or C" can mean "at least one of A, B and C."
[0036] 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, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction."
[0037] In this specification, technical features described separately in one drawing may be embodied separately or simultaneously.
[0038] The following drawings are created to explain a specific example of the present specification. The names of specific devices or names of specific signals / messages / fields 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 in the following drawings.
[0039] 2 is a diagram for explaining the configuration of a video / image encoding device to which the embodiments of the present document can be applied. Hereinafter, the video encoding device may include a image encoding device.
[0040] Referring to FIG. 2, the encoding apparatus 200 may include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter predictor 221 and an intra predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstruction unit or a reconstructed block generator. The above-mentioned image division unit 210, prediction unit 220, residual processing unit 230, entropy encoding unit 240, addition unit 250, and filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chipset or a processor) depending on the embodiment. In addition, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.
[0041] 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 tannery structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure and / or the tannery structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to this document may be performed based on the 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 be divided or partitioned from the final coding unit described above. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0042] The unit may be used interchangeably with terms such as block or area in some cases. In the general case, an MxN block may represent a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally represent a pixel or a pixel value, may represent only a pixel / pixel value of a luma component, or may represent only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to one picture (or image) for a pixel or pel.
[0043] The encoding apparatus 200 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (prediction block, prediction sample array) output from the inter prediction unit 221 or the intra prediction unit 222 from an input video signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, in the encoding apparatus 200, as shown in the figure, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input video signal (original block, original sample array) may be 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 described later in the description of each prediction mode. The prediction information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0044] 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 settings. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction modes applied to the neighboring blocks.
[0045] The inter prediction unit 221 may derive a prediction block for a current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of a block, a sub-block, or a sample based on the correlation of motion information between a neighboring block and a current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). In the 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, for example, in skip mode and merge mode, the inter prediction unit 221 may use motion information of neighboring blocks as motion information of the current block. In skip mode, unlike merge mode, a residual signal may not be transmitted.In motion vector prediction (MVP) mode, the motion vector of a neighboring block is used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.
[0046] The prediction unit 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may also simultaneously apply intra prediction and inter prediction. This may be referred to as 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 coding of content images / moving images such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction methods described in this document. The palette mode may be regarded as an example of intra coding or intra prediction. When the palette mode is applied, a sample value within the picture may be signaled based on information regarding a palette table and a palette index.
[0047] The prediction signal generated by the prediction unit (including the inter prediction unit 221 and / or the intra prediction unit 222) may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 232 may generate transform coefficients by applying a transform method to the residual signal. For example, the transform method may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, 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 blocks of variable sizes other than a square.
[0048] The quantization unit 233 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoding unit 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 quantization unit 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). In addition to the quantized transform coefficients, the entropy encoding unit 240 may also encode information required for video / image restoration (e.g., values of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / video information) may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) unit units. The video / video information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / video information may further include general constraint information. In this document, information and / or syntax elements transmitted / signaled from an encoding device to a decoding device may be included in the video / video information. The video / video information may be encoded by the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting and / or a storage unit (not shown) for storing the signal output from the entropy encoding unit 240 may be configured as an internal / external element of the encoding apparatus 200, or the transmitter may be included in the entropy encoding unit 240.
[0049] 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 in 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 a prediction signal output from the inter prediction unit 221 or the intra prediction unit 222. When there is no residual for the current block to be processed, 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 a next current block to be processed in a current picture, or may be used for inter prediction of a next picture after filtering, as described below.
[0050] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during the picture encoding and / or reconstruction process.
[0051] 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 the information to the entropy encoding unit 240, as 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.
[0052] The modified reconstructed picture transmitted to the memory 270 may be used as a reference picture in the inter prediction unit 221. In this way, when inter prediction is applied, the encoding apparatus can avoid prediction mismatch between the encoding apparatus 200 and the decoding apparatus 300, and can also improve encoding efficiency.
[0053] The DPB of the memory 270 may store the modified reconstructed picture to be used as a reference picture in the inter prediction unit 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of an already reconstructed block in the 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 blocks reconstructed in the current picture and transmit them to the intra prediction unit 222.
[0054] 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.
[0055] Referring to FIG. 3, the decoding device 300 may include an entropy decoding unit (entropy decoder, 310), a residual processor (residual processor, 320), a predictor (predictor, 330), an adder (adder, 340), a filter (filter, 350), and a memory (memory, 360). The predictor 330 may include an inter predictor 331 and an intra predictor 332. The residual processor 320 may include a dequantizer (dequantizer, 321) and an inverse transformer (inverse transformer, 322). The entropy decoding unit 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be configured by 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 by a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.
[0056] When a bitstream including video / picture information is input, the decoding apparatus 300 can restore an image corresponding to a process in which the video / picture information is processed by the encoding apparatus of FIG. 2. For example, the decoding apparatus 300 can derive units / blocks based on block division related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied by the encoding apparatus. Thus, the processing unit for decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a tannery tree structure. One or more transform units may be derived from the coding unit. Then, the restored video signal decoded and output by the decoding apparatus 300 may be reproduced by a reproduction device.
[0057] The decoding apparatus 300 may receive a signal output from the encoding apparatus of FIG. 2 in the form of a bitstream, and the received signal may be decoded by the entropy decoding unit 310. For example, the entropy decoding unit 310 may parse the bitstream and derive information (e.g., video / image information) required for image restoration (or picture restoration). 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 apparatus may decode a picture further 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 by the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 310 may decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element from the bitstream, determines a context model using information on a syntax element to be decoded, decoding information on neighboring and blocks to be decoded, or information on symbols / bins decoded in a previous step, predicts the occurrence probability of a bin according to the determined context model, and performs arithmetic decoding of the bins to generate a symbol corresponding to the value of each syntax element. In this case, the CABAC entropy decoding method may update the context model using information on the decoded symbol / bin 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 the prediction unit 330 (inter prediction unit 332 and intra prediction unit 331), and residual values entropy decoded by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 320. The residual processing unit 320 may derive a residual signal (residual block, residual sample, residual sample array). 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 an encoding apparatus may be further configured as an internal / external element of the decoding apparatus 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to this document may be 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.
[0058] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in the form of a two-dimensional block. In this case, the rearrangement may be performed based on a coefficient scan order performed in an 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.
[0059] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0060] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on the prediction information output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.
[0061] The prediction unit 320 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may also simultaneously apply intra prediction and inter prediction. This may be referred to as a combined inter and intra prediction (CIIP) mode. 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 coding of content images / moving images such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction methods described in this document. The palette mode may be regarded 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.
[0062] The intra prediction unit 331 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located far away from the current block depending on the prediction mode. In intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine the prediction mode to be applied to the current block using the prediction modes applied to the neighboring blocks.
[0063] 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 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 information (L0 prediction, L1 prediction, Bi prediction, etc.). In the 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. For example, the inter prediction unit 332 may configure a motion information candidate list based on the neighboring block, 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 an inter prediction mode for the current block.
[0064] The adder 340 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (prediction block, prediction sample array) output from a prediction unit (including the inter prediction unit 332 and / or the intra prediction unit 331). When there is no residual for the current block, such as when the skip mode is applied, the predicted block may be used as the reconstructed block.
[0065] 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, may be output after filtering as described below, or may be used for inter prediction of a next picture.
[0066] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture decoding.
[0067] 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.
[0068] 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.
[0069] In this specification, the embodiments described for the filtering unit 260, inter prediction unit 221 and intra prediction unit 222 of the encoding apparatus 200 may also be applied identically or correspondingly to the filtering unit 350, inter prediction unit 332 and intra prediction unit 331 of the decoding apparatus 300, respectively.
[0070] 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.
[0071] In addition, 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 about the transform coefficients, and the information about the transform coefficients may be signaled by a residual coding syntax. Transform coefficients may be derived based on the residual information (or the information about the transform coefficients), and scaled transform coefficients may be derived by inverse transform (scaling) on the transform coefficients. Residual samples may be derived based on inverse transform (transform) on the scaled transform coefficients. This may be applied / expressed in the same manner in other parts of this document.
[0072] As described above, prediction is performed to improve compression efficiency when performing video coding. As a result, a predicted block including predicted samples for a current block, which is a block to be coded, can be generated. Here, the predicted block includes predicted samples in a spatial domain (or a pixel domain). The predicted block is derived in the same way by an encoding device and a decoding device, and the encoding device can improve video coding efficiency by signaling to a decoding device information (residual information) regarding the residual between the original block and the predicted block, rather than the original sample value of the original block itself. The decoding device can derive a residual block including residual samples based on the residual information, combine the residual block with the predicted block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.
[0073] The residual information may be generated by a transform and quantization procedure. For example, the encoding apparatus may derive a residual block between the original block and the predicted block, perform a transform procedure on the residual samples (residual sample array) included in the residual block to derive transform coefficients, and perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and then signal the related residual information (using a bitstream) to the decoding apparatus. Here, the residual information may include information such as value information, position information, transform method, kernel, and quantization parameter of the quantized transform coefficients. The decoding apparatus may derive a residual sample (or a residual block) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. The encoding apparatus may also derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a subsequent picture, and generate a reconstructed picture based on the residual block.
[0074] Intra prediction may represent a prediction that generates a prediction sample for a current block based on a reference sample in a picture (hereinafter, current picture) to which the current block belongs. When intra prediction is applied to the current block, neighboring reference samples used for intra prediction of the current block may be derived. The neighboring reference samples of the current block may include a total of 2xnH samples adjacent to the left boundary and bottom-left of the current block having a size of nWxnH, a total of 2xnW samples adjacent to the top boundary and top-right of the current block, and one sample adjacent to the top-left of the current block. Alternatively, the neighboring reference samples of the current block may include upper neighboring samples of multiple columns and left neighboring samples of multiple rows. In addition, the neighboring reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.
[0075] However, some of the neighboring reference samples of the current block may not yet be decoded or may not be available. In this case, the decoder may substitute the unavailable samples with the available samples to construct the neighboring reference samples used for prediction. Alternatively, the decoder may construct the neighboring reference samples used for prediction using interpolation of the available samples.
[0076] When neighboring reference samples are derived, (i) a predicted sample may be derived based on an average or interpolation of neighboring reference samples of the current block, or (ii) the predicted sample may be derived based on a reference sample that exists in a specific (prediction) direction with respect to the predicted sample among the neighboring reference samples of the current block. The case (i) may be called a non-directional mode or a non-angular mode, and the case (ii) may be called a directional mode or an angular mode.
[0077] In addition, the prediction sample may be generated by interpolating a first peripheral sample located in a prediction direction of an intra prediction mode of the current block and a second peripheral sample located in a direction opposite to the prediction direction based on a prediction sample of the current block among the peripheral reference samples. In this case, it may be called linear interpolation intra prediction (LIP). In addition, a chroma prediction sample may be generated based on a luma sample using a linear model (LM). In this case, it may be called an LM mode or a CCLM (chroma component LM) mode.
[0078] Also, a provisional prediction sample of the current block may be derived based on the filtered neighboring reference samples, and a prediction sample of the current block may be derived by weighting the provisional prediction sample and at least one reference sample derived according to the intra prediction mode among the existing neighboring reference samples, i.e., non-filtered neighboring reference samples. In this case, it may be called Position Dependent Intra Prediction (PDPC).
[0079] Also, the intra prediction coding may be performed by selecting a reference sample line with the highest prediction accuracy from among multiple reference sample lines surrounding the current block, deriving a prediction sample using a reference sample located in a prediction direction on the selected line, and indicating (signaling) the reference sample line used to a decoding device. In this case, it may be called multi-reference line intra prediction or MRL-based intra prediction.
[0080] In addition, the current block may be divided into vertical or horizontal sub-partitions, and intra prediction may be performed based on the same intra prediction mode, with neighboring reference samples derived and used for each sub-partition. That is, in this case, the intra prediction mode for the current block is uniformly applied to the sub-partitions, but the performance of intra prediction may be improved in some cases by deriving and using neighboring reference samples for each sub-partition. Such a prediction method may be called ISP (intra sub-partitions) based intra prediction.
[0081] The above-mentioned intra prediction methods may be called intra prediction types, distinguished from intra prediction modes. The intra prediction types may be called various terms, such as intra prediction methods or additional intra prediction modes. For example, the intra prediction types (or additional intra prediction modes, etc.) may include at least one of the above-mentioned LIP, PDPC, MRL, and ISP. A general intra prediction method other than the specific intra prediction types, such as the LIP, PDPC, MRL, and ISP, may be called a normal intra prediction type. The normal intra prediction type may be generally applied when the above-mentioned specific intra prediction types are not applied, and prediction may be performed based on the above-mentioned intra prediction modes. Meanwhile, post-processing filtering may be performed on the derived prediction samples, if necessary.
[0082] Specifically, the intra prediction procedure may include an intra prediction mode / type determination step, a neighboring reference sample derivation step, and an intra prediction mode / type-based prediction sample derivation step. In addition, a post-processing filtering step may be performed on the derived prediction sample, if necessary.
[0083] FIG. 4 illustrates an example of an intra-prediction based video / image encoding method.
[0084] Referring to FIG. 4, an encoding apparatus performs intra prediction on a current block (S400). The encoding apparatus may derive an intra prediction mode / type for the current block, derive neighboring reference samples for the current block, and generate intra prediction samples for the current block based on the intra prediction mode / type and the neighboring reference samples. Here, the steps of determining the intra prediction mode / type, deriving neighboring reference samples, and generating prediction samples may be performed simultaneously, or one step may be performed prior to the other steps. The encoding apparatus may determine a mode / type to be applied to the current block from among a plurality of intra prediction modes / types. The encoding apparatus may compare RD costs for the intra prediction modes / types to determine an optimal intra prediction mode / type for the current block.
[0085] Meanwhile, the encoding apparatus may also perform a predicted sample filtering procedure. The predicted sample filtering may be referred to as post-filtering. Some or all of the predicted samples may be filtered by the predicted sample filtering procedure. In some cases, the predicted sample filtering procedure may be omitted.
[0086] The encoding apparatus generates a residual sample for the current block based on the (filtered) predicted sample (S410). The encoding apparatus may derive the residual sample by comparing the predicted sample with the original sample of the current block in a phase-based manner.
[0087] The encoding apparatus may encode video information including information on the intra prediction (prediction information) and residual information on the residual sample (S420). The prediction information may include the intra prediction mode information and the intra prediction type information. The encoding apparatus may output the encoded video information in the form of a bitstream. The output bitstream may be transmitted to a decoding apparatus via a storage medium or a network.
[0088] The residual information may include a residual coding syntax, which will be described later. An encoding apparatus may transform / quantize the residual samples to derive quantized transform coefficients. The residual information may include information regarding the quantized transform coefficients.
[0089] Meanwhile, as described above, the encoding apparatus may generate a reconstructed picture (including reconstructed samples and reconstructed blocks). To this end, the encoding apparatus may again inverse quantize / inverse transform the quantized transform coefficients to derive (modified) residual samples. The reason for again performing inverse quantization / inverse transform after transforming / quantizing the residual samples is to derive the same residual samples as the residual samples derived in the decoding apparatus, as described above. The encoding apparatus may generate a reconstructed block including reconstructed samples for the current block based on the predicted samples and the (modified) residual samples. A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, an in-loop filtering procedure, etc. may be further applied to the reconstructed picture.
[0090] FIG. 5 illustrates an example of an intra-prediction based video / picture decoding method.
[0091] The decoding device may perform operations corresponding to those performed by the encoding device.
[0092] Prediction information and residual information may be obtained from a bitstream. A residual sample for a current block may be derived based on the residual information. Specifically, a transform coefficient may be derived by performing inverse quantization based on a quantized transform coefficient derived based on the residual information, and a residual sample for the current block may be derived by performing inverse transform on the transform coefficient.
[0093] Specifically, the decoding apparatus may derive an intra prediction mode / type for a current block based on received prediction information (intra prediction mode / type information) (S500). The decoding apparatus may derive neighboring reference samples for the current block (S510). The decoding apparatus generates intra prediction samples for the current block based on the intra prediction mode / type and the neighboring reference samples (S520). In this case, the decoding apparatus may perform a prediction sample filtering procedure. The prediction sample filtering may be referred to as post filtering. Some or all of the prediction samples may be filtered by the prediction sample filtering procedure. In some cases, the prediction sample filtering procedure may be omitted.
[0094] The decoding apparatus generates a residual sample for the current block based on the received residual information (S530). The decoding apparatus may generate a reconstructed sample for the current block based on the prediction sample and the residual sample, and derive a reconstructed block including the reconstructed sample (S540). A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, an in-loop filtering procedure or the like may be further applied to the reconstructed picture.
[0095] The intra prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether a most probable mode (MPM) is applied to the current block or a remaining mode is applied, and if the MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be configured as an MPM candidate list or an MPM list. Also, if the MPM is not applied to the current block, the intra prediction mode information may further include remaining mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes excluding the intra prediction mode candidates (MPM candidates). A decoding apparatus may determine the intra prediction mode of the current block based on the intra prediction mode information.
[0096] Also, the intra prediction type information may be embodied in various forms. As an example, the intra prediction type information may include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information may include at least one of reference sample line information (e.g., intra_luma_ref_idx) indicating whether the MRL is applied to the current block and, if so, which reference sample line is used, ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether the ISP is applied to the current block, ISP type information (e.g., intra_subpartitions_split_flag) indicating a subpartition type when the ISP is applied, flag information indicating whether PDPC is applied, or flag information indicating whether LIP is applied. Also, the intra prediction type information may include an MIP flag indicating whether matrix-based intra prediction (MIP) is applied to the current block.
[0097] The intra-prediction mode information and / or the intra-prediction type information may be encoded / decoded by a coding method described in this document. For example, the intra-prediction mode information and / or the intra-prediction type information may be encoded / decoded by entropy coding (e.g., CABAC, CAVLC).
[0098] FIG. 6 illustrates an intra prediction procedure.
[0099] 6, as described above, the intra prediction procedure may include an intra prediction mode / type determination step, a neighboring reference sample derivation step, and an intra prediction execution (prediction sample generation) step. The intra prediction procedure may be performed in an encoding device and a decoding device as described above. In this document, the coding device may include an encoding device and / or a decoding device.
[0100] Referring to FIG. 6, the coding apparatus determines an intra-prediction mode / type (S600).
[0101] The encoding apparatus may determine an intra prediction mode / type to be applied to the current block from among the various intra prediction modes / types described above, and may generate prediction related information. The prediction related information may include intra prediction mode information indicating an intra prediction mode to be applied to the current block and / or intra prediction type information indicating an intra prediction type to be applied to the current block. The decoding apparatus may determine the intra prediction mode / type to be applied to the current block based on the prediction related information.
[0102] The intra prediction mode information may include, for example, flag information (e.g., intra_luma_mpm_flag) indicating whether a most probable mode (MPM) is applied to the current block or a remaining mode is applied. If the MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be configured as an MPM candidate list or an MPM list. Also, if the MPM is not applied to the current block, the intra prediction mode information may further include remaining mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes excluding the intra prediction mode candidates (MPM candidates). A decoding apparatus may determine the intra prediction mode of the current block based on the intra prediction mode information.
[0103] Also, the intra prediction type information may be embodied in various forms. As an example, the intra prediction type information may include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information may include at least one of reference sample line information (e.g., intra_luma_ref_idx) indicating whether the MRL is applied to the current block and, if so, which reference sample line is used, ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether the ISP is applied to the current block, ISP type information (e.g., intra_subpartitions_split_flag) indicating a subpartition type when the ISP is applied, flag information indicating whether PDPC is applied or flag information indicating whether LIP is applied or not. Also, the intra prediction type information may include an MIP flag indicating whether MIP (matrix-based intra prediction) is applied to the current block.
[0104] For example, when intra prediction is applied, the intra prediction mode applied to the current block may be determined using the intra prediction mode of the neighboring blocks. For example, the coding apparatus may select one of the MPM candidates in an MPM (most probable mode) list derived based on the intra prediction modes of neighboring blocks (e.g., left and / or upper neighboring blocks) of the current block and / or additional candidate modes based on the received MPM index, or may select one of the remaining intra prediction modes not included in the MPM candidates (and the planar mode) based on MPM remainder information (remaining intra prediction mode information). The MPM list may be configured to include or not include a planar mode as a candidate. For example, if the MPM list includes a planar mode as a candidate, the MPM list may have six candidates, and if the MPM list does not include a planar mode as a candidate, the MPM list may have five candidates. If the MPM list does not include planar mode as a candidate, a not planar flag (e.g., intra_luma_not_planar_flag) indicating whether the intra prediction mode of the current block is not a planar mode may be signaled. For example, the MPM flag may be signaled first, and the MPM index and the not planar flag may be signaled if the value of the MPM flag is 1. Also, the MPM index may be signaled if the value of the not planar flag is 1. Here, the reason why the MPM list is configured not to include planar mode as a candidate is that, rather than the planar mode being not an MPM, the planar mode is always considered as an MPM, so a flag (not planar flag) is signaled first to first check whether the mode is a planar mode.
[0105] For example, whether the intra prediction mode applied to the current block is among the MPM candidates (and planar mode) or among the remaining mode may be indicated based on an MPM flag (e.g., intra_luma_mpm_flag). A value of 1 of the MPM flag may indicate that the intra prediction mode for the current block is among the MPM candidates (and planar mode), and a value of 0 of the MPM flag may indicate that the intra prediction mode for the current block is not among the MPM candidates (and planar mode). A value of 0 of the not planar flag (e.g., intra_luma_not_planar_flag) may indicate that the intra prediction mode for the current block is planar mode, and a value of 1 of the not planar flag may indicate that the intra prediction mode for the current block is not planar mode. The MPM index may be signaled in the form of an mpm_idx or intra_luma_mpm_idx syntax element, and the remaining intra prediction mode information may be signaled in the form of a rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element. For example, the remaining intra prediction mode information may indicate one of the remaining intra prediction modes that are not included in the MPM candidates (and planar mode) among all intra prediction modes by indexing them in order of prediction mode numbers. The intra prediction mode may be an intra prediction mode for a luma component (sample). Hereinafter, the intra prediction mode information may include at least one of the MPM flag (e.g., intra_luma_mpm_flag), the not planar flag (e.g., intra_luma_not_planar_flag), the MPM index (e.g., mpm_idx or intra_luma_mpm_idx), and the remaining intra prediction mode information (rem_intra_luma_pred_mode or intra_luma_mpm_remainder). In this document, the MPM list may be referred to by various terms such as an MPM candidate list, a candModeList, etc.
[0106] When MIP is applied to the current block, a separate mpm flag for MIP (e.g., intra_mip_mpm_flag), mpm index (e.g., intra_mip_mpm_idx), remaining intra-prediction mode information (e.g., intra_mip_mpm_remainder) may be signaled, and the not planar flag may not be signaled.
[0107] In other words, in general, when an image is divided into blocks, a current block to be coded and neighboring blocks have similar image characteristics. Therefore, the current block and neighboring blocks are highly likely to have the same or similar intra-prediction mode. Therefore, an encoder can use the intra-prediction mode of the neighboring blocks to encode the intra-prediction mode of the current block.
[0108] A coding apparatus may configure a most probable modes (MPM) list for a current block. The MPM list may also be referred to as an MPM candidate list. Here, MPM may refer to a mode used to improve coding efficiency by considering similarity between a current block and a neighboring block during intra prediction mode coding. As described above, the MPM list may be configured to include a planar mode or may be configured to exclude the planar mode. For example, if the MPM list includes the planar mode, the number of candidates in the MPM list may be six. Also, if the MPM list does not include the planar mode, the number of candidates in the MPM list may be five.
[0109] The encoding apparatus may perform prediction based on various intra prediction modes and may determine an optimal intra prediction mode based on rate-distortion optimization (RDO) based on the prediction. In this case, the encoding apparatus may determine the optimal intra prediction mode using only the MPM candidates and planar mode configured in the MPM list, or may determine the optimal intra prediction mode using the remaining intra prediction modes in addition to the MPM candidates and planar mode configured in the MPM list. Specifically, for example, if the intra prediction type of the current block is not a normal intra prediction type but a specific type (e.g., LIP, MRL, or ISP), the encoding apparatus may determine the optimal intra prediction mode by considering only the MPM candidates and planar mode as intra prediction mode candidates for the current block. That is, in this case, the intra prediction mode for the current block may be determined only from the MPM candidates and planar mode, and in this case, the mpm flag may not be encoded / signaled. In this case, the decoding device can infer that the mpm flag is 1 even if the mpm flag is not separately signaled.
[0110] Meanwhile, in general, when the intra prediction mode of the current block is not a planar mode but is one of the MPM candidates in the MPM list, the encoding apparatus generates an mpm index (mpm idx) indicating one of the MPM candidates. If the intra prediction mode of the current block is not present in the MPM list, the encoding apparatus generates MPM remainder information (remaining intra prediction mode information) indicating the same mode as the intra prediction mode of the current block among the remaining intra prediction modes not included in the MPM list (and planar modes). The MPM remainder information may include, for example, an intra_luma_mpm_remainder syntax element.
[0111] The decoding apparatus may obtain intra prediction mode information from a bitstream. The intra prediction mode information may include at least one of an MPM flag, a not planar flag, an MPM index, and MPM remainder information (remaining intra prediction mode information), as described above. The decoding apparatus may configure an MPM list. The MPM list may be configured in the same manner as the MPM list configured in the encoding apparatus. That is, the MPM list may include intra prediction modes of neighboring blocks, and may further include a specific intra prediction mode according to a predetermined method.
[0112] The decoding apparatus may determine the intra prediction mode of the current block based on the MPM list and the intra prediction mode information. For example, when the value of the MPM flag is 1, the decoding apparatus may derive a planar mode as the intra prediction mode of the current block (not based on the planar flag), or may derive a candidate indicated by the MPM index among MPM candidates in the MPM list as the intra prediction mode of the current block. Here, the MPM candidate may represent only the candidates included in the MPM list, or may include the planar mode applicable when the value of the MPM flag is 1 in addition to the candidates included in the MPM list.
[0113] As another example, when the value of the MPM flag is 0, the decoding device may derive the intra prediction mode indicated by the remaining intra prediction mode information (which may be referred to as mpm remainder information) from among the remaining intra prediction modes not included in the MPM list and planar mode as the intra prediction mode of the current block. Meanwhile, as yet another example, when the intra prediction type of the current block is a specific type (e.g., LIP, MRL, or ISP, etc.), the decoding device may derive the planar mode or a candidate indicated by the MPM flag in the MPM list as the intra prediction mode of the current block without parsing / decoding / checking the MPM flag.
[0114] The coding apparatus derives neighboring reference samples of a current block (S610). When intra prediction is applied to the current block, neighboring reference samples used for intra prediction of the current block may be derived. The neighboring reference samples of the current block may include a total of 2xnH samples adjacent to the left boundary and bottom-left of a current block having a size of nWxnH, a total of 2xnW samples adjacent to the top boundary and top-right of the current block, and one sample adjacent to the top-left of the current block. Alternatively, the neighboring reference samples of the current block may include multiple columns of top neighboring samples and multiple rows of left neighboring samples. In addition, the neighboring reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block having a size of nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.
[0115] On the other hand, when MRL is applied (i.e., when the value of the MRL index is greater than 0), the neighboring reference samples may be located on the 1st and 2nd lines other than the 0th line adjacent to the current block on the left / top side, and in this case, the number of neighboring reference samples may be further increased. On the other hand, when ISP is applied, the neighboring reference samples may be derived in sub-partition units.
[0116] The coding apparatus performs intra prediction on the current block to derive a prediction sample (S620). The coding apparatus may derive the prediction sample based on the intra prediction mode / type and the surrounding samples. The coding apparatus may derive a reference sample according to the intra prediction mode of the current block from among surrounding reference samples of the current block, and may derive a prediction sample of the current block based on the reference sample.
[0117] Meanwhile, when inter prediction is applied, the prediction unit of the encoding device / decoding device may perform inter prediction in units of blocks to derive prediction samples. Inter prediction may represent a prediction derived in a manner dependent on data elements (e.g., sample values or motion information) of pictures other than the current picture. When inter prediction is applied to the current block, a predicted block (prediction sample array) for the current block may be derived based on a reference block (reference sample array) identified by a motion vector on a reference picture indicated by a reference picture index. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, motion information of the current block 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 type (L0 prediction, L1 prediction, Bi prediction, etc.) information. When inter prediction is applied, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal surrounding block may be the same or different. The temporal surrounding block may be called a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal surrounding block may be called a collocated picture (colPic). For example, a motion information candidate list may be constructed based on the surrounding blocks of the current block, and flag or index information indicating which candidate is selected (used) to derive the motion vector and / or reference picture index of the current block may be signaled.Inter prediction may be performed based on various prediction modes. For example, in skip mode and merge mode, the motion information of the current block may be the same as the motion information of the selected neighboring block. In skip mode, unlike merge mode, a residual signal may not be transmitted. In motion vector prediction (MVP) mode, the motion vector of the selected neighboring block may be used as a motion vector predictor, and a motion vector difference may be signaled. In this case, the motion vector of the current block may be derived using the sum of the motion vector predictor and the motion vector difference.
[0118] The motion information may include L0 motion information and / or L1 motion information depending on an inter prediction type (such as L0 prediction, L1 prediction, Bi prediction, etc.). A motion vector in the L0 direction may be referred to as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be referred to as an L1 motion vector or MVL1. A prediction based on an L0 motion vector may be referred to as an L0 prediction, a prediction based on an L1 motion vector may be referred to as an L1 prediction, and a prediction based on both the L0 motion vector and the L1 motion vector may be referred to as a pairwise (Bi) prediction. Here, the L0 motion vector may represent a motion vector associated with a reference picture list L0 (L0), and the L1 motion vector may represent a motion vector associated with a reference picture list L1 (L1). The reference picture list L0 may include a picture prior to the current picture in output order as a reference picture, and the reference picture list L1 may include a picture subsequent to the current picture in output order. The previous picture may be referred to as a forward (reference) picture, and the subsequent picture may be referred to as a backward (reference) picture. The reference picture list L0 may further include, as reference pictures, pictures subsequent to the current picture in output order. In this case, the previous picture may be indexed first in the reference picture list L0, and the subsequent picture may be indexed next. The reference picture list L1 may further include, as reference pictures, pictures subsequent to the current picture in output order. In this case, the subsequent picture may be indexed first in the reference picture list 1, and the previous picture may be indexed next. Here, the output order may correspond to a picture order count (POC) order.
[0119] A video / picture encoding procedure based on inter prediction may generally include, for example:
[0120] FIG. 7 illustrates an example of an inter-prediction based video / picture encoding method.
[0121] The encoding apparatus performs inter prediction on a current block (S700). The encoding apparatus may derive an inter prediction mode and motion information of the current block and generate a prediction sample of the current block. Here, the inter prediction mode determination, motion information derivation, and prediction sample generation procedures may be performed simultaneously, or one procedure may be performed prior to the other procedures. For example, the inter prediction unit of the encoding apparatus may include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit, and the prediction mode determination unit may determine a prediction mode for the current block, the motion information derivation unit may derive motion information of the current block, and the prediction sample derivation unit may derive a prediction sample of the current block. For example, the inter prediction unit of the encoding apparatus may search for a block similar to the current block within a certain area (search area) of a reference picture by motion estimation, and derive a reference block whose difference with the current block is minimum or equal to a certain criterion. Based on this, a reference picture index indicating a reference picture in which the reference block is located may be derived, and a motion vector may be derived based on a position difference between the reference block and the current block. The encoding apparatus may determine a mode to be applied to the current block from among various prediction modes. The encoding apparatus may compare RD costs for the various prediction modes to determine an optimal prediction mode for the current block.
[0122] For example, when a skip mode or a merge mode is applied to the current block, the encoding apparatus may construct a merge candidate list (to be described later) and derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion among reference blocks indicated by merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to a decoding apparatus. Motion information of the current block may be derived using motion information of the selected merge candidate.
[0123] As another example, when the (A)MVP mode is applied to the current block, the encoding apparatus may construct an (A)MVP candidate list (to be described later) and use a motion vector of an MVP candidate selected from the MVP (motion vector predictor) candidates included in the (A)MVP candidate list as the MVP of the current block. In this case, for example, a motion vector indicating a reference block derived by the above-mentioned motion estimation may be used as the motion vector of the current block, and an MVP candidate having a motion vector with the smallest difference from the motion vector of the current block among the MVP candidates may become the selected MVP candidate. A motion vector difference (MVD), which is a difference obtained by subtracting the MVP from the motion vector of the current block, may be derived. In this case, information on the MVD may be signaled to the decoding apparatus. Also, when the (A)MVP mode is applied, the value of the reference picture index may be configured as reference picture index information and separately signaled to the decoding apparatus.
[0124] The encoding apparatus may derive a residual sample based on the predicted sample (S710). The encoding apparatus may derive the residual sample by comparing an original sample of the current block with the predicted sample.
[0125] The encoding apparatus encodes video information including prediction information and residual information (S720). The encoding apparatus may output the encoded video information in the form of a bitstream. The prediction information may include prediction mode information (e.g., a skip flag, a merge flag, or a model index) and information on motion information as information related to the prediction procedure. The information on the motion information may include candidate selection information (e.g., a merge index, an mvp flag, or an mvp index) which is information for deriving a motion vector. The information on the motion information may also include information on the above-mentioned MVD and / or reference picture index information. The information on the motion information may also include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information on the residual sample. The residual information may include information on a quantized transform coefficient for the residual sample.
[0126] The output bitstream may be stored on a (digital) storage medium and transmitted to a decoding device, or may be transmitted to a decoding device over a network.
[0127] Meanwhile, as described above, the encoding apparatus can generate a reconstructed picture (including reconstructed samples and reconstructed blocks) based on the reference sample and the residual sample. This is because the encoding apparatus derives the same prediction result as that performed by the decoding apparatus, thereby improving coding efficiency. Therefore, the encoding apparatus can store the reconstructed picture (or reconstructed samples, reconstructed blocks) in a memory and use it as a reference picture for inter prediction. As described above, an in-loop filtering procedure, etc. may be further applied to the reconstructed picture.
[0128] A video / picture decoding procedure based on inter prediction may generally include, for example:
[0129] FIG. 8 illustrates an example of an inter-prediction based video / picture decoding method.
[0130] 8, the decoding apparatus may perform operations corresponding to those performed by the encoding apparatus, such as performing prediction on a current block based on received prediction information and deriving a prediction sample.
[0131] Specifically, the decoding apparatus may determine a prediction mode for the current block based on received prediction information (S800). The decoding apparatus may determine which inter prediction mode is applied to the current block based on prediction mode information in the prediction information.
[0132] For example, it may be determined whether the merge mode or the (A)MVP mode is applied to the current block based on the merge flag, or one of various inter prediction mode candidates may be selected based on the mode index. The inter prediction mode candidates may include skip mode, merge mode, and / or (A)MVP mode, or may include various inter prediction modes described below.
[0133] The decoding apparatus derives motion information of the current block based on the determined inter prediction mode (S810). For example, when a skip mode or a merge mode is applied to the current block, the decoding apparatus may form a merge candidate list (described later) and select one merge candidate from among the merge candidates included in the merge candidate list. The selection may be performed based on the above-mentioned selection information (merge index). The motion information of the selected merge candidate may be used to derive motion information of the current block. The motion information of the selected merge candidate may be used as motion information of the current block.
[0134] As another example, when the (A)MVP mode is applied to the current block, the decoding apparatus may construct an (A)MVP candidate list described below, and may use a motion vector of a selected MVP candidate among the MVP (motion vector predictor) candidates included in the (A)MVP candidate list as the MVP of the current block. The selection may be performed based on the above-mentioned selection information (mvp flag or mvp index). In this case, the MVD of the current block may be derived based on information on the MVD, and the motion vector of the current block may be derived based on the MVP of the current block and the MVD. Also, the reference picture index of the current block may be derived based on the reference picture index information. A picture indicated by the reference picture index in a reference picture list for the current block may be derived as a reference picture referenced for inter prediction of the current block.
[0135] Meanwhile, as described below, the motion information of the current block may be derived without constructing a candidate list, in which case the motion information of the current block may be derived according to a procedure disclosed in a prediction mode described below. In this case, the candidate list construction as described above may be omitted.
[0136] The decoding apparatus may generate a prediction sample for the current block based on the motion information of the current block (S820). In this case, the reference picture may be derived based on the reference picture index of the current block, and the prediction sample for the current block may be derived using a sample of the reference block indicated on the reference picture by the motion vector of the current block. In this case, as described below, a prediction sample filtering procedure may be further performed on all or some of the prediction samples of the current block, depending on the circumstances.
[0137] For example, the inter prediction unit of the decoding device may include a prediction mode determination unit, a motion information derivation unit, and a prediction sample derivation unit, and may determine a prediction mode for the current block based on prediction mode information received by the prediction mode determination unit, derive motion information (such as a motion vector and / or a reference picture index) of the current block based on information regarding the motion information received by the motion information derivation unit, and derive a prediction sample of the current block by the prediction sample derivation unit.
[0138] The decoding apparatus generates a residual sample for the current block based on the received residual information (S830). The decoding apparatus generates a reconstructed sample for the current block based on the prediction sample and the residual sample, and can generate a reconstructed picture based on the reconstructed sample (S840). Then, an in-loop filtering procedure, etc. may be further applied to the reconstructed picture, as described above.
[0139] FIG. 9 illustrates an exemplary inter prediction procedure.
[0140] 9, as described above, the inter prediction procedure may include an inter prediction mode determination step, a motion information derivation step according to the determined prediction mode, and a prediction (prediction sample generation) step based on the derived motion information. The inter prediction procedure may be performed in an encoding device and a decoding device as described above. In this document, the coding device may include an encoding device and / or a decoding device.
[0141] Referring to FIG. 9, the coding apparatus determines an inter prediction mode for a current block (S900). Various inter prediction modes may be used for predicting a current block in a picture. For example, various modes such as merge mode, skip mode, motion vector prediction mode (MVP), affine mode, sub-block merge mode, and merge with MVD mode (MMVD) may be used. Decoder side motion vector refinement mode (DMVR), adaptive motion vector resolution mode (AMVR), bi-prediction with CU-level weight (BCW), bi-directional optical flow (BDOF), and the like may be used in addition to or instead of the associated mode. The affine mode may be referred to as an affine motion prediction mode. The MVP mode may be referred to as an advanced motion vector prediction mode (AMVP). In this document, some modes and / or motion information candidates derived by some modes may be included as one of the motion information related candidates of other modes. For example, an HMVP candidate may be added as a merge candidate of the merge / skip mode, or may be added as an MVP candidate of the MVP mode. When the HMVP candidate is used as a motion information candidate of the merge mode or skip mode, the HMVP candidate may be referred to as an HMVP merge candidate.
[0142] Prediction mode information indicating an inter prediction mode of a current block may be signaled from an encoding apparatus to a decoding apparatus. The prediction mode information may be included in a bitstream and received by the decoding apparatus. The prediction mode information may include index information indicating one of a plurality of candidate modes. Alternatively, the inter prediction mode may be indicated by hierarchical signaling of flag information. In this case, the prediction mode information may include one or more flags. For example, a skip flag may be signaled to indicate whether a skip mode is applied, and if the skip mode is not applied, a merge flag may be signaled to indicate whether a merge mode is applied, and if the merge mode is not applied, an MVP mode may be indicated to be applied, or a flag for additional classification may be further signaled. The affine mode may be signaled as an independent mode, or may be signaled as a mode dependent on the merge mode, MVP mode, etc. For example, the affine mode may include an affine merge mode and an affine MVP mode.
[0143] The coding apparatus derives motion information for the current block (S910). The motion information may be derived based on the inter prediction mode.
[0144] The coding apparatus may perform inter prediction using motion information of the current block. The encoding apparatus may derive optimal motion information for the current block through a motion estimation procedure. For example, the encoding apparatus may search for a similar reference block with high correlation in a fractional pixel unit within a determined search range in the reference picture using an original block in an original picture for the current block, thereby deriving motion information. The similarity of the blocks may be derived based on a difference in phase-based sample values. For example, the similarity of the blocks may be calculated based on the SAD between the current block (or the template of the current block) and the reference block (or the template of the reference block). In this case, the motion information may be derived based on the reference block with the smallest SAD in the search area. The derived motion information may be signaled to the decoding apparatus in various ways based on the inter prediction mode.
[0145] The coding apparatus performs inter prediction based on motion information for the current block (S920). The coding apparatus may derive predictive samples for the current block based on the motion information. The current block including the predictive samples may be referred to as a predicted block.
[0146] Meanwhile, as described above, the encoding apparatus can perform various encoding methods such as exponential Golomb, CAVLC (context-adaptive variable length coding), CABAC (context-adaptive binary arithmetic coding), etc. Also, the decoding apparatus can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients related to residuals.
[0147] For example, the coding method described above may be performed as follows.
[0148] FIG. 10 illustrates an example of CABAC (context-adaptive binary arithmetic coding) for encoding a syntax element. For example, in a CABAC encoding process, if an input signal is a syntax element that is not a binary value, an encoding apparatus 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), the binarization may be bypassed. Here, each binary digit 0 or 1 constituting a binary value may be called a bin. For example, if a binary string after binarization is 110, each of 1, 1, and 0 is called one bin. The bin for one syntax element may indicate the value of the syntax element.
[0149] The binarized bins of the syntax element may then be input to a regular encoding engine or a bypass encoding engine. The regular encoding engine of the encoding device may assign a context model reflecting a probability value to the bin and encode the bin based on the assigned context model. The regular encoding engine of the encoding device may update the context model for each bin after encoding the bin. Bins encoded as described above may be referred to as context-coded bins.
[0150] Meanwhile, when the binarized bin of the syntax element is input to the bypass encoding engine, it may be coded as follows. For example, the bypass encoding engine of the encoding device omits the procedure of estimating a probability for the input bin and the procedure of updating the 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 bin encoded as described above can be called a bypass bin.
[0151] Entropy decoding can refer to a process of performing the above-mentioned entropy encoding process in reverse order.
[0152] For example, when a syntax element is decoded based on a context model, a decoding device may receive a bin corresponding to the syntax element through a bitstream, determine a context model using the syntax element and decoding information of a block to be decoded or a neighboring block, or information of a symbol / bin decoded in a previous step, predict an occurrence probability of the received bin based on the determined context model, perform arithmetic decoding of the bin, and derive a value of the syntax element. Then, the context model of a bin to be decoded next may be updated to the determined context model.
[0153] Also, for example, when a syntax element is bypass decoded, the decoding device can receive a bin corresponding to the syntax element using a bitstream and decode the input bin by applying a uniform probability distribution. In this case, the decoding device can omit 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.
[0154] As described above, the residual samples may be derived as quantized transform coefficients through a transform and quantization process. The quantized transform coefficients may also be called transform coefficients. In this case, the transform coefficients in the block may be signaled in the form of residual information. The residual information may include a residual coding syntax. That is, an encoding device may configure a residual coding syntax from the residual information, encode the syntax, and output the syntax in the form of a 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, the position of the last valid transform coefficient in the block, whether a valid transform coefficient exists in the subblock, and the size / sign of the valid transform coefficient, as described below.
[0155] For example, syntax elements related to residual data encoding / decoding can be represented as follows:
[0156] [Table 1-1]
[0157] [Table 1-2]
[0158] [Table 1-3]
[0159] 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, a residual sample may be derived for a CB, and a (quantized) transform coefficient may be derived by transforming and quantizing the residual sample. Information (e.g., syntax elements) efficiently indicating the position, size, sign, etc. of the (quantized) transform coefficient may be generated and signaled by the residual coding procedure. The quantized transform coefficient may be simply referred to as a transform coefficient. In general, if CB is not larger than the maximum TB, the size of CB may be the same as the size of TB, in which 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 larger than the maximum TB, the target block to be transformed (and quantized) and residually coded may be referred to as a TB. Hereinafter, syntax elements related to residual coding will be described as being signaled in units of a transform block (TB), but this is merely an example, and as described above, the TB may be used in the same sense as a coding block (CB).
[0160] Meanwhile, the syntax elements signaled after the conversion skip flag is signaled may be the same as the syntax elements disclosed in Table 2 and / or Table 3 described below, and a detailed explanation of the syntax elements is provided below.
[0161]
Table 2-1
[0162]
Table 2-2
[0163]
Table 2-3
[0164]
Table 2-4
[0165]
Table 2-5
[0166]
Table 2-6
[0167]
Table 3-1
[0168]
Table 3-2
[0169]
Table 3-3
[0170] According to this 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 (whether it is a transform skip or not). Residual coding used when the transform skip is not applied (i.e., when a transform is applied) may be called Regular Residual Coding (RRC), and residual coding used when the transform skip is applied (i.e., when a 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 regular residual coding syntax structure, and the transform skip residual coding may also be called a transform skip residual coding syntax structure. 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.
[0171] Specifically, for example, a transform skip flag indicating whether to skip transform of a transform block may be parsed, and it may be determined whether the transform skip flag is 1. If the value of the transform skip flag is 0, syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gtx_flag, par_level_flag, abs_remainder, coeff_sign_flag, and / or dec_abs_level for residual coefficients of the transform block may be parsed, and the residual coefficients may be derived based on the syntax elements, as shown in Table 2. In this case, the syntax elements may be parsed sequentially, or the parsing order may be changed. Furthermore, the abs_level_gtx_flag may represent abs_level_gt1_flag and / or abs_level_gt3_flag. For example, abs_level_gtx_flag[n][0] may be an example of 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).
[0172] Referring to Table 2, 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 be expressed as coded_sub_block_flag.
[0173] In one embodiment, the encoding device may encode (x, y) position information of the last non-zero transform coefficient in a transform block based on syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. More specifically, the last_sig_coeff_x_prefix represents a prefix of the column position of the last significant coefficient in the scanning order in the transform block, the last_sig_coeff_y_prefix represents a prefix of the row position of the last significant coefficient in the scanning order in the transform block, the last_sig_coeff_x_suffix represents a suffix of the column position of the last significant coefficient in the scanning order in the transform block, and the last_sig_coeff_y_suffix represents a suffix of the row position of the last significant coefficient in the scanning order in the transform block. Here, the significant coefficient may represent the non-zero coefficient. In addition, the scan order may be an upper 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 the current block (CB, or CB including TB) and / or a specific intra / inter prediction mode.
[0174] The encoding apparatus then divides the transform block into 4x4 sub-blocks, and for each 4x4 sub-block, may use a 1-bit syntax element coded_sub_block_flag to indicate whether or not there is a non-zero coefficient in the current sub-block.
[0175] 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 is not coded and its value may be assumed to be 1.
[0176] If it is determined that a non-zero coefficient exists in the current sub-block because the value of coded_sub_block_flag is 1, the encoding apparatus may encode sig_coeff_flag having a binary value 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 if sig_coeff_flag is 1, and four syntax elements may be used in the level information encoding process. More specifically, each sig_coeff_flag[xC][yC] may indicate whether the level (value) of the transform coefficient at each transform coefficient position (xC, yC) in the current TB is non-zero. In one embodiment, the sig_coeff_flag may correspond to an example of a syntax element of a significance coefficient flag indicating whether the quantized transform coefficient is a non-zero significance coefficient.
[0177] The remaining level value after encoding for sig_coeff_flag may be derived as follows: That is, a syntax element remAbsLevel indicating a level value that must be encoded may be derived as follows: remAbsLevel=[sig_coeff_flag+remAbsLevel+remAbsLevel].
[0178]
number
[0179] Here, coeff means the actual transform coefficient value.
[0180] Furthermore, abs_level_gt1_flag may indicate whether the remAbsLevel at the scanning position (n) is greater than 1. For example, if the value of abs_level_gt1_flag is 0, the absolute value of the transform coefficient at the position may be 1. Furthermore, if the value of abs_level_gt1_flag is 1, the remAbsLevel indicating the level value to be coded later may be updated as follows:
[0181]
number
[0182] In addition, the least significant coefficient (LSB) value of remAbsLevel described in the above equation 2 may be encoded by par_level_flag as shown in the following equation 3.
[0183]
number
[0184] Here, par_level_flag[n] can indicate the parity of the transform coefficient level (value) at scanning position n.
[0185] The transform coefficient level value remAbsLevel that must be encoded after par_level_flag encoding may be updated as follows:
[0186]
number
[0187] abs_level_gt3_flag may indicate whether the remAbsLevel at the corresponding scanning position (n) is greater than 3. Encoding for abs_remainder may be performed only if abs_level_gt3_flag is 1. The relationship between the actual transform coefficient value coeff and each syntax element may be as follows:
[0188]
number
[0189] The following table also provides examples related to formula 5 above.
[0190] [Table 4]
[0191] Here, |coeff| represents a transform coefficient level (value) and may be denoted 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.
[0192] Also, for example, if the value of the transform skip flag is 1, syntax elements sb_coded_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag, par_level_flag, and / or abs_remainder for the residual coefficient of the transform block may be parsed as shown in Table 3, and the residual coefficient may be derived based on the syntax elements. In this case, the syntax elements may be parsed sequentially, or the parsing order may be changed. 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 or a second threshold value, depending on the case.
[0193] 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 using the regular encoding engine of CABAC) shows high data dependency because it uses the probability state and range updated by encoding the previous bin, and it 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 the bins used to express sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag may be limited to the 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 indicated by remBinsPass1 or RemCcbs. Alternatively, for example, for a higher CABAC throughput, the number of context coded bins may be limited for a block (CB or TB) including a CG to be coded. In other words, the number of context coded bins may be limited on a block (CB or TB) basis. For example, if the size of the current block is 16x16, the number of context coded bins for the current block may be limited to 1.75 times the number of pixels of the current block, i.e., 448, regardless of the current CG.
[0194] In this case, when the limited number of context coding bins are all used for coding the context elements, the encoding apparatus may binarize the remaining coefficients by a binarization method for the coefficients described below without using context coding, and perform bypass coding. In other words, for example, when the number of context coding bins coded for 4x4 CG is 32 (or, for example, 28), or the number of context coding bins coded for 2x2 CG is 8 (or, for example, 7), sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded for the context coding bins may not be coded any more, and may be coded immediately to dec_abs_level. Or, for example, if the number of context coded bins coded for a 4x4 block is limited to 1.75 times the number of pixels in the entire block, i.e., 28, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag coded into further context coded bins do not need to be coded, and may be immediately coded into dec_abs_level as shown in Table 5 below.
[0195] [Table 5]
[0196] may be derived based on dec_abs_level. In this case, the transform coefficient value |coeff| may be derived as follows:
[0197]
number
[0198] In addition, the coeff_sign_flag may indicate the sign of the transform coefficient level at the corresponding scanning position (n), i.e., the coeff_sign_flag may indicate the sign of the transform coefficient at the corresponding scanning position (n).
[0199] FIG. 11 is a diagram showing an example of transform coefficients within a 4x4 block.
[0200] The 4x4 block in Figure 11 represents an example of quantized coefficients. The block shown in Figure 11 may be a 4x4 transform block or a 4x4 sub-block of an 8x8, 16x16, 32x32, 64x64 transform block. The 4x4 block in Figure 11 may represent a luma block or a chroma block.
[0201] Meanwhile, as described above, when an input signal is a syntax element that is not a binary value, the encoding apparatus can convert the input signal into a binary value by binarizing the value of the input signal. 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 a value of the syntax element. The binarization process can be a truncated Rice (TR) binarization process, a k-th order Exp-Golomb (EGk) binarization process, a limited k-th order Exp-Golomb (Limited EGk), or a fixed-length (FL) binarization process, which will be described later. Also, the inverse binarization process may represent a process of deriving the value of the syntax element based on the TR binarization process, the EGk binarization process, or the FL binarization process.
[0202] For example, the TR binarization process may be performed as follows:
[0203] 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.
[0204] 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.
[0205] The symbolVal prefix value for the syntax element may be derived as follows:
[0206]
number
[0207] 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.
[0208] For example, if the prefixVal is less than cMax>>cRiceParam, the prefix bin string may be a bit string of length prefixVal+1 indexed by binIdx. That is, if the prefixVal is less than cMax>>cRiceParam, the prefix bin string may be a bit string of prefixVal+1 bits pointed to by binIdx. The bin for binIdx less than prefixVal may be equal to 1. Also, the bin for binIdx equal to prefixVal may be equal to 0.
[0209] For example, the bin string derived by unary binarization for the prefixVal may be as shown in the following table.
[0210] [Table 6]
[0211] On the other hand, when the prefixVal is not smaller than cMax >> cRiceParam, the prefix bin string may be a bit string with a length of cMax >> cRiceParam and all bits being 1.
[0212] Also, when cMax is larger than symbolVal and cRiceParam is larger than 0, a suffix bin string of the TR bin string may exist. For example, the suffix bin string may be derived as described below.
[0213] The suffix value of the symbolVal for the syntax element may be derived as follows.
[0214] [Equation]
[0215] Here, suffixVal can represent the suffix value of the symbolVal.
[0216] The suffix of the TR bin string (i.e., the suffix bin string) may be derived based on the FL binarization process for suffixVal where the cMax value is (1 << cRiceParam) - 1.
[0217] On the other hand, if the value of the input parameter cRiceParam is 0, the TR binarization may be exactly truncated unary binarization, and a cMax value equal to the maximum possible value of the syntax element always being decoded may be used.
[0218] Also for example, the EGk binarization process may be performed as follows: The syntax elements coded in ue(v) may be Exp-Golomb coded syntax elements.
[0219] As an example, a 0-th order Exp-Golomb (EG0) binarization process may be performed as follows:
[0220] The parsing process for the syntax element may begin by reading bits including the first non-zero bit starting from the current position of the bitstream and counting the number of leading bits such as 0. The process can be represented as follows:
[0221] [Table 7]
[0222] Furthermore, the variable codeNum may be derived as follows:
[0223]
number
[0224] Here, the value returned by read_bits(leadingZeroBits), i.e., the value indicated by read_bits(leadingZeroBits), can be interpreted as a binary representation of an unsigned integer with the most significant bit recorded first.
[0225] The structure of the Exp-Golomb code, which separates a bit string into "prefix" bits and "suffix" bits, can be represented as shown in the following table.
[0226] [Table 8]
[0227] The "prefix" bits may be the bits parsed as described above for the leadingZeroBits calculation and may be represented as 0 or 1 in the bit string in Table 8. That is, the bit strings represented as 0 or 1 in Table 8 above may represent the prefix bit string. The "suffix" bits may be the bits parsed in the codeNum calculation and may be represented as xi in Table 8 above. That is, the bit strings represented as xi in Table 8 above may represent the suffix bit string, where i may range from 0 to LeadingZeroBits-1. Also, each xi may be equal to 0 or 1.
[0228] The bit string assigned to the codeNum may be as shown in the following table.
[0229] [Table 9]
[0230] If the descriptor of a syntax element is ue(v), that is, if the syntax element is coded in ue(v), the value of the syntax element may be equal to codeNum.
[0231] Also, for example, the EGk binarization process may be performed as follows.
[0232] 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.
[0233] The bit string for the EGk binarization process for symbolVal may be derived as follows:
[0234] [Table 10]
[0235] Referring to Table 10 above, each call to put(X) can be used to add a binary value X to the end of the bin string, where X can be 0 or 1.
[0236] Also, for example, the limited EGk binarization process may be performed as follows.
[0237] The input of the limited EGk binarization process may be a request for limited EGk binarization and a Rice parameter riceParam, a variable log2TransformRange representing the binary logarithm of the maximum value, and a variable maxPreExtLen representing the maximum prefix extension length, and the output of the limited EGk binarization process may be limited EGk binarization for a value symbolVal corresponding to a bin string.
[0238] The bit string of the limited EGk binarization process for symbolVal may be derived as follows:
[0239] [Table 11]
[0240] Also, for example, the FL binarization process may be performed as follows.
[0241] 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.
[0242] The FL binarization may be performed using a bit string having a number of bits that is a fixed length of the symbol value symbolVal, where the fixed length bit string may be an unsigned integer bit string. That is, the FL binarization may derive a bit string for the symbol value symbolVal, and the bit length (i.e., the number of bits) of the bit string may be a fixed length.
[0243] For example, the fixed length may be derived as follows:
[0244]
number
[0245] The indexing of the bins for FL binarization may be in a manner that uses increasing values in the order from the most significant bit to the least significant bit, for example, the bin index associated with the most significant bit may be binIdx=0.
[0246] Meanwhile, for example, a binarization process for the syntax element abs_remainder of the residual information may be performed as follows.
[0247] 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 indicate the top left sample of the current luma transform block based on the top left luma sample of the picture.
[0248] 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 derive an available bin string for the abs_remainder.
[0249] The Rice parameter cRiceParam for the abs_remainder[n] may be derived by 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.
[0250] 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:
[0251]
number
[0252] Meanwhile, the binarization for the abs_remainder, i.e., the bin string for the abs_remainder, may be the concatenation of a prefix bin string and a suffix bin string if a suffix bin string exists, or the bin string for the abs_remainder may be the prefix bin string if the suffix bin string does not exist.
[0253] For example, the prefix bin string may be derived as described below.
[0254] The prefix value prefixVal of the abs_remainder[n] may be derived as follows:
[0255]
number
[0256] The prefix of the bin string of the abs_remainder[n] (ie, the prefix bin string) may be derived by a TR binarization process on the prefixVal using the cMax and the cRiceParam as inputs.
[0257] 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 abs_remainder[n] may exist and may be derived as described below.
[0258] The Rice parameter derivation process for abs_remainder[n] may be as follows.
[0259] Inputs 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 the width of a transform block, log2TbWidth, and a binary logarithm of the height of a transform block, log2TbHeight. The luma position (x0, y0) may indicate 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.
[0260] For example, based on a given component index cIdx and an array AbsLevel[x][y] for a transform block having the top left luma position (x0, y0), the variable locSumAbs may be derived as shown in the pseudo code in the following table.
[0261] [Table 12]
[0262] Then, based on the given variable locSumAbs, the rice parameter cRiceParam may be derived as in the following table:
[0263] [Table 13]
[0264] Also, for example, baseLevel may be set to 4 in the Rice parameter derivation process for abs_remainder[n].
[0265] Alternatively, for example, the Rice parameter cRiceParam may be determined based on whether or not a transform of the current block is skipped, i.e., 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.
[0266] In addition, the suffix value suffixVal of the abs_remainder may be derived as follows:
[0267]
number
[0268] The suffix bin string of the bin string of the abs_remainder may be derived by a limited EGk binarization process on the suffixVal with k set to cRiceParam+1, riceParam set to cRiceParam, log2TransformRange set to 15, and maxPreExtLen set to 11.
[0269] Meanwhile, for example, a binarization process for the syntax element dec_abs_level of the residual information may be performed as follows.
[0270] 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 indicate the top left sample of the current luma transform block based on the top left luma sample of the picture.
[0271] An output of the binarization process for the dec_abs_level may be the binarization of the dec_abs_level (i.e., a binarized bin string of the dec_abs_level). The binarization process may derive an available bin string for the dec_abs_level.
[0272] The Rice parameter cRiceParam for the dec_abs_level[n] may be derived by 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.
[0273] Also, for example, cMax for the dec_abs_level[n] may be derived based on the Rice parameter cRiceParam. The cMax may be derived as follows:
[0274]
number
[0275] 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.
[0276] For example, the prefix bin string may be derived as described below.
[0277] The prefix value prefixVal of the dec_abs_level[n] may be derived as follows:
[0278]
number
[0279] 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.
[0280] 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.
[0281] The Rice parameter derivation process for dec_abs_level[n] may be as follows.
[0282] Inputs 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 the width of a transform block, log2TbWidth, and a binary logarithm of the height of a transform block, log2TbHeight. The luma position (x0, y0) may indicate 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.
[0283] For example, based on a given component index cIdx and an array AbsLevel[x][y] for a transform block having the top left luma position (x0, y0), the variable locSumAbs may be derived as shown in the pseudo code in the following table.
[0284] [Table 14]
[0285] Then, based on the given variable locSumAbs, the rice parameter cRiceParam may be derived as follows:
[0286] [Table 15]
[0287] Also, for example, in the process of deriving the Rice parameter for dec_abs_level[n], baseLevel may be set to 0, and the ZeroPos[n] may be derived as follows:
[0288]
number
[0289] In addition, the suffix value suffixVal of the dec_abs_level[n] may be derived as follows:
[0290]
number
[0291] The suffix bin string of the bin string of the dec_abs_level[n] may be derived by a limited EGk binarization process on the suffixVal with k set to cRiceParam+1, truncSuffixLen set to 15, and maxPreExtLen set to 11.
[0292] Meanwhile, the above-mentioned RRC and TSRC may have the following differences.
[0293] - For example, in TSRC, the Rice parameter for syntax element abs_remainder[] may be derived as 1. In RRC, the Rice parameter cRiceParam of syntax element abs_remainder[] may be derived based on the lastAbsRemainder and the lastRiceParam as described above, but the Rice parameter cRiceParam of syntax element abs_remainder[] in TSRC may be derived as 1. That is, for example, when a transform skip is applied to a current block (e.g., a current TB), the Rice parameter cRiceParam for abs_remainder[] of TSRC for the current block may be derived as 1.
[0294] - 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 the 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 the TSRC. Here, the abs_level_gtx_flag[n][0] can be represented as abs_level_gt1_flag or the first coefficient level flag, the abs_level_gtx_flag[n][1] can be represented as abs_level_gt3_flag or the second coefficient level flag, the abs_level_gtx_flag[n][2] can be represented as abs_level_gt5_flag or the third coefficient level flag, the abs_level_gtx_flag[n][3] can be represented as abs_level_gt7_flag or the fourth coefficient level flag, and the abs_level_gtx_flag[n][4] can be represented as abs_level_gt9_flag or the fifth coefficient level flag. Specifically, the first coefficient level flag may be a flag indicating whether the coefficient level is greater than a first critical value (e.g., 1), the second coefficient level flag may be a flag indicating whether the coefficient level is greater than a second critical value (e.g., 3), the third coefficient level flag may be a flag indicating whether the coefficient level is greater than a third critical value (e.g., 5), the fourth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fourth critical value (e.g., 7), and the fifth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fifth critical value (e.g., 9).As described above, compared to the RRC, the TSRC may further include abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1], as well as abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3] and abs_level_gtx_flag[n][4].
[0295] Also, for example, in RRC the syntax element coeff_sign_flag may be bypass coded, but in TSRC the syntax element coeff_sign_flag may be bypass coded or context coded.
[0296] Also, dependent quantization can be proposed for the quantization process of residual samples. Dependent quantization can represent 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 having different reconstruction levels, and (b) defining a process for switching between these scalar quantizers. The dependent quantization can have an effect that permitted reconstruction vectors are more densely packed in an N-dimensional vector space compared to the existing independent scalar quantization, where N can represent the number of transform coefficients of a transform block.
[0297] FIG. 12 illustrates an example of a scalar quantizer used in dependent quantization. Referring to FIG. 12, the location of the available reconstruction levels may be designated as a quantization step size Δ. Referring to FIG. 12, the scalar quantizers may be represented as Q0 and Q1. The scalar quantizer used may not be explicitly signaled in the bitstream, but may be derived. For example, the quantizer used for a current transform coefficient may be determined by the parity of the transform coefficient level preceding the current transform coefficient in the coding / reconstruction order.
[0298] FIG. 13 illustrates state transitions and quantizer selection for dependent quantization.
[0299] 13, the transition between two scalar quantizers (Q0 and Q1) may be realized by a state machine with four states. The four states may have four different values (0, 1, 2, 3). The state for a current transform coefficient may be determined by the parity of the transform coefficient level preceding the current transform coefficient in the coding / reconstruction order.
[0300] For example, when an inverse quantization process for a transform block starts, a state for dependent quantization may be set to 0. Then, transform coefficients for the transform block may be restored in a scan order (i.e., the same order as entropy decoded). For example, after a current transform coefficient is restored, a state for dependent quantization may be updated as shown in FIG. 13. An inverse quantization process for a transform coefficient restored after a current transform coefficient is restored in the scan order may be performed based on the updated state. k shown in FIG. 13 may represent a value of a transform coefficient, i.e., a transform coefficient level value. For example, when the current state is 0, if k (value of the current transform coefficient)&1 is 0, the state may be updated to 0, and when k&1 is 1, the state may be updated to 2. Also, for example, when the current state is 1, if k&1 is 0, the state may be updated to 2, and when k&1 is 1, the state may be updated to 0. Also, for example, when the current state is 2, if k&1 is 0, the state may be updated to 1, and if k&1 is 1, the state may be updated to 3. Also, for example, when the current state is 3, if k&1 is 0, the state may be updated to 3, and if k&1 is 1, the state may be updated to 1. Referring to FIG 13, when the state is one of 0 and 1, the scalar quantizer used in the inverse quantization process may be Q0, and when the state is one of 2 and 3, the scalar quantizer used in the inverse quantization process may be Q1. The transform coefficients may be inverse quantized based on a quantization parameter for a restoration level of the transform coefficient in the scalar quantizer for the current state.
[0301] 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).
[0302] 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. Therefore, even if the transform_skip_flag indicates that the transform is skipped, if the sh_ts_residual_coding_disabled_flag indicates that the TSRC is not available, a syntax element according to RRC may be signaled for the transform skipped block. That is, if the value of transform_skip_flag is 0 or the value of sh_ts_residual_coding_disabled_flag is 1, RRC may be used, and otherwise TSRC may be used.
[0303] Although high coding efficiency can be obtained in a specific application (e.g., lossless coding, etc.) by using the slice_ts_residual_coding_disabled_flag, existing video / picture coding standards do not propose any restriction on the case where the above-mentioned dependent quantization is used together with the slice_ts_residual_coding_disabled_flag. That is, when dependent quantization is activated in a high level (e.g., sequence parameter set (SPS) syntax / video parameter set (VPS) syntax / decoding parameter set (DPS) syntax / picture header syntax / slice header syntax, etc.) or a low level (CU / TU) and the slice_ts_residual_coding_disabled_flag is 1, a value depending on the state of dependent quantization in RRC performs an unnecessary operation (i.e., an operation due to dependent quantization), which may result in degradation of coding performance or unintended loss of coding performance due to incorrect setting in an encoding device. For this reason, in this embodiment, dependent quantization and residual coding when slice_ts_residual_coding_disabled_flag=1 (i.e., coding the residual samples of the transform skip block in the current slice by RRC) are used together, and a method for setting dependencies / constraints between the two techniques is proposed to prevent unintended coding losses or malfunctions.
[0304] As an embodiment, this document proposes a method in which slice_ts_residual_coding_disabled_flag is subordinate to ph_dep_quant_enabled_flag. For example, the syntax elements proposed in this embodiment may be as shown in the following table.
[0305] [Table 16]
[0306] According to this embodiment, the slice_ts_residual_coding_disabled_flag may be signaled when the value of the ph_dep_quant_enabled_flag is 0. Here, the ph_dep_quant_enabled_flag may indicate whether dependent quantization is enabled. For example, when the value of the ph_dep_quant_enabled_flag is 1, the ph_dep_quant_enabled_flag may indicate that dependent quantization is enabled, and when the value of the ph_dep_quant_enabled_flag is 0, the ph_dep_quant_enabled_flag may indicate that dependent quantization is not enabled.
[0307] 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 high level syntax (High Level Syntax, HLS) (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low level (CU / TU) other than the picture header syntax and slice header syntax. The ph_dep_quant_enabled_flag may be named differently when it is signaled in a syntax other than the picture header syntax, for example, the ph_dep_quant_enabled_flag may be expressed as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or sps_dep_quant_enabled_flag.
[0308] 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 transform skip blocks in the current slice by RRC). For example, this embodiment proposes a method for preventing the dependent quantization state from being used 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 use of both 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). The residual coding syntax according to this embodiment may be as shown in the following table.
[0309] [Table 17-1]
[0310] [Table 17-2]
[0311] [Table 17-3]
[0312] [Table 17-4]
[0313] [Table 17-5]
[0314] [Table 17-6]
[0315] Referring to Table 17 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, a QState may be derived, and a transform coefficient value (transform coefficient level) may be derived based on the QState. For example, referring to Table 17, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived as (2*AbsLevel[xC][yC]-(QState>11:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] is the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] is a syntax element of a sign flag indicating the sign of the transform coefficient, and (QState>1?1:0) can represent 1 if the value of the state QState is greater than 1, i.e., if the value of the state QState is 2 or 3, or 0 if the value of the state QState is 1 or less, i.e., if the value of the state QState is 0 or 1.
[0316] Also, referring to Table 17 above, when the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. For example, referring to Table 17, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived as AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] is the absolute value of the transform coefficient derived based on the syntax element of the transform coefficient, and coeff_sign_flag[n] may be a syntax element of a sign flag indicating the sign of the transform coefficient.
[0317] Also, according to this embodiment, when the value of slice_ts_residual_coding_disabled_flag is 1, the dependent quantization state is not used in coding the level value of the transform coefficient, and the state update may not be performed. For example, the residual coding syntax according to this embodiment may be as shown in the following table.
[0318] [Table 18-1]
[0319] [Table 18-2]
[0320] [Table 18-3]
[0321] [Table 18-4]
[0322] [Table 18-5]
[0323] [Table 18-6]
[0324] Referring to Table 18 above, QState may be updated when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0. For example, when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, QState may be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC]&1] or QStateTransTable[QState][AbsLevel[xC][yC]&1]. Also, when the value of slice_ts_residual_coding_disabled_flag is 1, the process of updating QState may not be performed.
[0325] Also, referring to Table 18 above, a transform coefficient value (transform coefficient level) may be derived based on the QState when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0. For example, referring to Table 18, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived as (2*AbsLevel[xC][yC]-(QState>11:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] is the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] is a syntax element of a sign flag indicating the sign of the transform coefficient, and (QState>1?1:0) can represent 1 if the value of the state QState is greater than 1, i.e., if the value of the state QState is 2 or 3, and 0 if the value of the state QState is 1 or less, i.e., if the value of the state QState is 0 or 1.
[0326] Also, referring to Table 18 above, when the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. For example, referring to Table 18, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived as AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] is the absolute value of the transform coefficient derived based on the syntax element of the transform coefficient, and coeff_sign_flag[n] may be a syntax element of a sign flag indicating the sign of the transform coefficient.
[0327] This document also proposes another embodiment for setting dependency / constraint between dependent quantization and residual coding (i.e., coding residual samples of transform skip blocks in the current slice by RRC) when slice_ts_residual_coding_disabled_flag=1. For example, this embodiment proposes a scheme for adding a constraint using transform_skip_flag to a process of deriving a value of a transform coefficient (transform coefficient level) depending on a state update or state of dependent quantization in RRC. That is, this embodiment proposes a scheme for preventing the process of deriving a value of a transform coefficient (transform coefficient level) depending on a state update and / or state of dependent quantization in RRC from being used based on the transform_skip_flag. The residual coding syntax according to this embodiment may be as shown in the following table.
[0328] [Table 19-1]
[0329] [Table 19-2]
[0330] [Table 19-3]
[0331] [Table 19-4]
[0332] [Table 19-5]
[0333] [Table 19-6]
[0334] Referring to Table 19 above, QState may be updated when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0. For example, when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, QState may be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC]&1] or QStateTransTable[QState][AbsLevel[xC][yC]&1]. Also, when the value of transform_skip_flag is 1, the process of updating QState may not be performed.
[0335] Also, referring to Table 19 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, a QState may be derived, and a transform coefficient value (transform coefficient level) may be derived based on the QState. For example, referring to Table 19, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived as (2*AbsLevel[xC][yC]-(QState>1?1:0))*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] is the absolute value of the transform coefficient derived based on the transform coefficient syntax element, coeff_sign_flag[n] is a syntax element of a sign flag indicating the sign of the transform coefficient, and (QState>1?1:0) can represent 1 if the value of the state QState is greater than 1, i.e., if the value of the state QState is 2 or 3, or 0 if the value of the state QState is 1 or less, i.e., if the value of the state QState is 0 or 1.
[0336] Also, referring to Table 19 above, when the value of transform_skip_flag is 1, the value of the transform coefficient (transform coefficient level) may be derived without using the QState. Therefore, when residual data by RRC is coded for a transform skip block, the value of the transform coefficient may be derived without using QState. For example, referring to Table 19, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] may be derived as AbsLevel[xC][yC]*(1-2*coeff_sign_flag[n]). Here, AbsLevel[xC][yC] may be the absolute value of the transform coefficient derived based on the syntax element of the transform coefficient, and coeff_sign_flag[n] may be a syntax element of a sign flag indicating the sign of the transform coefficient.
[0337] For example, this document proposes an embodiment such as the following table.
[0338]
Table 20
[0339] Referring to Table 20, a method for deriving the ZeroPos of dec_abs_level based on ph_dep_quant_enabled_flag and transform_skip_flag may be selected. For example, if the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 1, the ZeroPos of dec_abs_level may be derived based on a formula that does not use the state value of dependent quantization. For example, as shown in Table 20 described above, ZeroPos may be derived as 1<<cRiceParam.
[0340] On the other hand, for example, if the value of ph_dep_quant_enabled_flag is 0 or the value of transform_skip_flag is 0, the ZeroPos of dec_abs_level may be derived depending on the state value of dependent quantization.
[0341] In addition, this document proposes various embodiments related to the signaling of the above-mentioned syntax element sh_ts_residual_coding_disabled_flag.
[0342] For example, as described above, since sh_ts_residual_coding_disabled_flag is a syntax element that defines whether TSRC is available or not, it may not be signaled when the conversion skip block is not used. That is, it may be meaningful to signal the sh_ts_residual_coding_disabled_flag only when the syntax element for whether the conversion skip block is used indicates that the conversion skip block is used.
[0343] Therefore, this document proposes an embodiment in which sh_ts_residual_coding_disabled_flag is signaled only when sps_transform_skip_enabled_flag is 1. The syntax according to this embodiment is as shown in the following table.
[0344] [Table 21]
[0345] Referring to Table 21, if sps_transform_skip_enabled_flag is 1, sh_ts_residual_coding_disabled_flag may be signaled, and if sps_transform_skip_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may not be signaled. Here, for example, the sps_transform_skip_enabled_flag may indicate whether a transform skip block is used. That is, for example, the sps_transform_skip_enabled_flag may indicate whether transform skip is available. For example, when the value of the sps_transform_skip_enabled_flag is 1, the sps_transform_skip_enabled_flag may indicate that a transform skip flag may be present in the transform unit syntax, and when the value of the sps_transform_skip_enabled_flag is 0, the sps_transform_skip_enabled_flag may indicate that a transform skip flag is not present in the transform unit syntax. On the other hand, when the sh_ts_residual_coding_disabled_flag is not signaled, the sh_ts_residual_coding_disabled_flag may be inferred to be 0. In addition, the above-mentioned sps_transform_skip_enabled_flag may be signaled in the SPS, or may be signaled in other high-level syntaxes (VPS, PPS, picture header syntax, slice header syntax, etc.) or low-level syntaxes (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than the SPS.It may also be signaled prior to slice_ts_residual_coding_disabled_flag.
[0346] This document also proposes an embodiment that combines the above-mentioned embodiments in relation to signaling sh_ts_residual_coding_disabled_flag. For example, an embodiment that signals sh_ts_residual_coding_disabled_flag as shown in the following table may be proposed.
[0347] [Table 22]
[0348] Referring to Table 22, if sps_transform_skip_enabled_flag is 1 or ph_dep_quant_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may be signaled, otherwise, sh_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be regarded as 0 (infer).
[0349] Or, for example, an embodiment may be proposed in which sh_ts_residual_coding_disabled_flag is signaled as in the following table.
[0350] [Table 23]
[0351] Referring to Table 23, sh_ts_residual_coding_disabled_flag may be signaled in a picture header. The sh_ts_residual_coding_disabled_flag may be expressed as ph_ts_residual_coding_disabled_flag. Also, referring to Table 23, ph_dep_quant_enabled_flag may be signaled in a picture header.
[0352] For example, referring to Table 23, if ph_dep_quant_enabled_flag is 0 and sps_transform_skip_enabled_flag is 1, then ph_ts_residual_coding_disabled_flag may be signaled, otherwise, ph_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if ph_ts_residual_coding_disabled_flag is not signaled, then ph_ts_residual_coding_disabled_flag may be inferred to be 0.
[0353] Meanwhile, in relation to the syntax elements described in the embodiment of this document, in the existing video / picture coding standard, the ph_dep_quant_enabled_flag may be signaled in a picture header syntax, and the sh_ts_residual_coding_disabled_flag may be signaled in a slice header syntax. In relation to this, this document proposes an embodiment in which both syntax elements are signaled in the same high-level syntax or low-level syntax.
[0354] For example, an embodiment may be proposed in which both the ph_dep_quant_enabled_flag and the sh_ts_residual_coding_disabled_flag are signaled in a picture header syntax. In this case, the sh_ts_residual_coding_disabled_flag may be referred to as ph_ts_residual_coding_disabled_flag.
[0355] Or, for example, an embodiment may be proposed in which both the ph_dep_quant_enabled_flag and the sh_ts_residual_coding_disabled_flag are signaled in a slice header syntax, in which case the ph_dep_quant_enabled_flag may be referred to as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, slice_dep_quant_enabled_flag, etc.
[0356] Alternatively, for example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS, but the ph_ts_residual_coding_disabled_flag is signaled only if the value of the ph_dep_quant_enabled_flag is 0. For example, an example in which both the ph_dep_quant_enabled_flag and the ph_ts_residual_coding_disabled_flag are signaled in the picture header syntax may be as shown in the following table.
[0357] [Table 24]
[0358] Referring to Table 24, the ph_dep_quant_enabled_flag may be signaled in a picture header syntax, and the ph_ts_residual_coding_disabled_flag may be signaled in a picture header syntax when the value of the ph_dep_quant_enabled_flag is 0, and the ph_ts_residual_coding_disabled_flag may not be signaled when the value of the ph_dep_quant_enabled_flag is 1. For example, when the ph_ts_residual_coding_disabled_flag is not signaled, the ph_ts_residual_coding_disabled_flag may be inferred as 0.
[0359] Meanwhile, as an example of the above-mentioned embodiment, an example may be proposed in which the ph_dep_quant_enabled_flag and the ph_ts_residual_coding_disabled_flag are signaled in a high level syntax other than the picture header syntax (VPS, SPS, PPS, slice header syntax, etc.) or a low level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.).
[0360] Also, for example, an embodiment may be proposed in which both ph_ts_residual_coding_disabled_flag and ph_dep_quant_enabled_flag are signaled in the same HLS, but the ph_dep_quant_enabled_flag is signaled only if the value of the ph_ts_residual_coding_disabled_flag is 0.
[0361] [Table 25]
[0362] Referring to Table 25, the ph_ts_residual_coding_disabled_flag may be signaled in a picture header syntax, and the ph_dep_quant_enabled_flag may be signaled in a picture header syntax if the value of the ph_ts_residual_coding_disabled_flag is 0, and the ph_dep_quant_enabled_flag may not be signaled if the value of the ph_ts_residual_coding_disabled_flag is 1. For example, if the ph_dep_quant_enabled_flag is not signaled, the ph_dep_quant_enabled_flag may be inferred to be 0.
[0363] Meanwhile, the above embodiment may, as an example, be proposed in which the ph_ts_residual_coding_disabled_flag and the ph_dep_quant_enabled_flag are signaled in other high level syntax (VPS, SPS, PPS, slice header syntax, etc.) or low level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than the picture header syntax.
[0364] Also, for example, an embodiment combining the above-mentioned embodiments may be proposed. For example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS, but the ph_ts_residual_coding_disabled_flag is signaled only if the value of the ph_dep_quant_enabled_flag is 0 or the value of the sps_transform_skip_enabled_flag is 1.
[0365] [Table 26]
[0366] Referring to Table 26, the ph_dep_quant_enabled_flag may be signaled in a picture header syntax, and if the value of the ph_dep_quant_enabled_flag is 0 or the value of the sps_transform_skip_enabled_flag is 1, the ph_ts_residual_coding_disabled_flag may be signaled in a picture header syntax, otherwise, the ph_ts_residual_coding_disabled_flag may not be signaled. Here, for example, the sps_transform_skip_enabled_flag may indicate whether a transform skip block is used. That is, for example, the sps_transform_skip_enabled_flag may indicate whether transform skip is available. For example, when the value of the sps_transform_skip_enabled_flag is 1, the sps_transform_skip_enabled_flag may indicate that a transform skip flag may be present in a transform unit syntax, and when the value of the sps_transform_skip_enabled_flag is 0, the sps_transform_skip_enabled_flag may indicate that a transform skip flag is not present in a transform unit syntax. For example, when the ph_ts_residual_coding_disabled_flag is not signaled, the ph_ts_residual_coding_disabled_flag may be inferred to be 0.
[0367] In addition, for example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS (e.g., slice header syntax), but the ph_ts_residual_coding_disabled_flag is signaled only when the value of the ph_dep_quant_enabled_flag is 0 and the value of the sps_transform_skip_enabled_flag is 1.
[0368] [Table 27]
[0369] Referring to Table 27, the ph_dep_quant_enabled_flag may be signaled in a picture header syntax, and the ph_ts_residual_coding_disabled_flag may be signaled in a picture header syntax if the value of the ph_dep_quant_enabled_flag is 0 and the value of the sps_transform_skip_enabled_flag is 1, otherwise, the ph_ts_residual_coding_disabled_flag may not be signaled. For example, if the ph_ts_residual_coding_disabled_flag is not signaled, the ph_ts_residual_coding_disabled_flag may be inferred to be 0.
[0370] Also, for example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS, but the ph_ts_residual_coding_disabled_flag is signaled only if the value of the sps_transform_skip_enabled_flag is 1, and the ph_dep_quant_enabled_flag is signaled only if the value of the ph_ts_residual_coding_disabled_flag is 0.
[0371] [Table 28]
[0372] Referring to Table 28, the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax when the value of the sps_transform_skip_enabled_flag is 1, and the ph_dep_quant_enabled_flag may be signaled in the picture header syntax when the value of the ph_ts_residual_coding_disabled_flag is 0. For example, the ph_ts_residual_coding_disabled_flag may not be signaled when the value of the sps_transform_skip_enabled_flag is 0. For example, when the ph_ts_residual_coding_disabled_flag is not signaled, the ph_ts_residual_coding_disabled_flag may be inferred as 0. Also, for example, the ph_dep_quant_enabled_flag may not be signaled when the value of the ph_ts_residual_coding_disabled_flag is 1. For example, when the ph_dep_quant_enabled_flag is not signaled, the ph_dep_quant_enabled_flag may be regarded as 0 (infer).
[0373] Meanwhile, as described above, the information in the syntax table (syntax elements) disclosed in this document may be included in image / video information, may be constructed / encoded by an encoding device, and may be transmitted to a decoding device in the form of a bitstream. The decoding device may parse / decode the information in the syntax table (syntax elements). The decoding device may perform a block / image / video restoration procedure based on the decoded information.
[0374] This document also proposes various embodiments related to the signaling of the above mentioned syntax element sh_ts_residual_coding_disabled_flag.
[0375] For example, as mentioned above, the slice_ts_residual_coding_disabled_flag can be used to obtain high coding efficiency in certain applications (e.g., lossless coding, etc.), but existing video / image coding standards do not propose any restrictions on when Sign Data Hiding (SDH) is used with the slice_ts_residual_coding_disabled_flag.
[0376] Here, the sign data omission method may be as follows. When deriving a transform coefficient, the sign of the transform coefficient may be derived based on a 1-bit sign flag (the syntax element coeff_sign_flag described above). In this regard, SDH may indicate a technique of omitting explicit signaling of coeff_sign_flag for a first significant transform coefficient in a subblock / coefficient group (CG) to improve coding efficiency. Here, the value of coeff_sign_flag for the first significant transform coefficient may be derived based on the sum of absolute levels (i.e., absolute values) of the significant transform coefficients in the subblock / coefficient group. That is, the sign of the first significant transform coefficient may be derived based on the sum of absolute levels for the significant transform coefficients in the subblock / coefficient group. Meanwhile, a significant transform coefficient may mean a transform coefficient whose (absolute) value is not zero (non-zero transform coefficient). For example, if the sum of absolute levels for the significant transform coefficients is even, the value of coeff_sign_flag for the first significant transform coefficient may be derived as 1, and if the sum of absolute levels for the significant transform coefficients is odd, the value of coeff_sign_flag for the first significant transform coefficient may be derived as 0. In other words, for example, if the sum of absolute levels for the significant transform coefficients is even, the sign for the first significant transform coefficient may be derived as a negative value, and if the sum of absolute levels for the significant transform coefficients is odd, the sign for the first significant transform coefficient may be derived as a positive value. Or, for example, if the sum of absolute levels for the significant transform coefficients is even, the value of coeff_sign_flag for the first significant transform coefficient may be derived as 0, and if the sum of absolute levels for the significant transform coefficients is odd, the value of coeff_sign_flag for the first significant transform coefficient may be derived as 1.In other words, for example, if the sum of the absolute levels for the significant transform coefficients is even, the sign for the first significant transform coefficient may be derived as a positive value, and if the sum of the absolute levels for the significant transform coefficients is odd, the sign for the first significant transform coefficient may be derived as a negative value.
[0377] For example, the SDH in the residual syntax can be shown as in the following table.
[0378] [Table 29]
[0379] Referring to Table 29, the variable signHiddenFlag may indicate whether the SDH is applied. The variable signHiddenFlag may be referred to as signHidden. For example, when the value of the variable signHiddenFlag is 0, the variable signHiddenFlag may indicate that the SDH is not applied, and when the value of the variable signHiddenFlag is 1, the variable signHiddenFlag may indicate that the SDH is applied. For example, the value of the variable signHiddenFlag may be set based on the signaled flag information (e.g., sh_sign_data_hiding_used_flag, pic_sign_data_hiding_enabled_flag, or sps_sign_data_hiding_enabled_flag). Also, for example, the value of the variable signHiddenFlag may be set based on lastSigScanPosSb and firstSigScanPosSb. Here, lastSigScanPosSb may indicate the last valid transform coefficient position searched in the corresponding subblock / coefficient group according to the scan order, and firstSigScanPosSb may indicate the first valid transform coefficient position searched in the corresponding subblock / coefficient group according to the scan order. In general, lastSigScanPosSb may be located in a higher frequency component region than firstSigScanPosSb. Thus, if lastSigScanPosSb-firstSigScanPosSb is greater than a predetermined threshold, the signHidden value may be derived as 1 (i.e., SDH is applied), and otherwise, the signHidden value may be derived as 0 (i.e., SDH is not applied). Here, for example, referring to Table 29, the threshold may be set to 3.
[0380] Meanwhile, when the sign data hiding is activated in a high level syntax (VPS, SPS, PPS, slice header syntax, etc.) or a low level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) and the slice_ts_residual_coding_disabled_flag is 1, the sign data hiding process of the RRC may be used for lossless coding. Therefore, lossless coding may be impossible due to an incorrect setting in the encoding device. Alternatively, when loss coding (i.e., a lossy coding method) is applied instead of lossless coding, and a residual signal to which a transform skip is applied is coded by the RRC and BDPCM is applied at the same time, the BDPCM may have more intervals in which the residual value is 0 due to a difference between residuals compared to the general case, but coding loss may occur because SDH is performed in accordance with the SDH application conditions. Specifically, for example, if valid transform coefficients (non-zero residual data) exist at positions 0 and 15 in a CG, and the values of the transform coefficients at the remaining positions in the CG are 0, SDH may be applied to the CG according to the above-mentioned SDH application condition, and therefore, sign data (i.e., coding of a sign flag) for the first valid transform coefficient of the CG may be omitted. Therefore, in this case, due to the omission of the sign data, the parity of only two residual data of the CG may be adjusted in the quantization step, and more coding loss may occur compared to the case where SDH is not applied. This case may also occur in a block to which BDPCM is not applied, but since the level is lowered according to the difference with the surrounding residuals due to the characteristics of BDPCM, disadvantageous cases may occur more frequently when applying SDH.
[0381] Therefore, this document proposes an embodiment that sets dependencies / constraints between SDH 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) to prevent unintended coding losses or malfunctions when both technologies are used.
[0382] For example, the present embodiment proposes a scheme in which slice_ts_residual_coding_disabled_flag is subordinate to pic_sign_data_hiding_enabled_flag. The residual coding syntax according to the present embodiment may be as shown in the following table.
[0383] [Table 30]
[0384] Here, slice_ts_residual_coding_disabled_flag may be signaled in slice header syntax, or may be signaled in other high level syntax (High Level Syntax, HLS) other than slice header syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low level (CU / TU). Also, pic_sign_data_hiding_enabled_flag may be signaled in picture header syntax, or may be signaled in other high level syntax (High Level Syntax, HLS) other than picture header syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low level (CU / TU). For example, when the pic_sign_data_hiding_enabled_flag is signaled in syntax other than the picture header syntax, it may be given a different name. For example, the pic_sign_data_hiding_enabled_flag may be expressed as sps_sign_data_hiding_enabled_flag.
[0385] Also, sps_sign_data_hiding_enabled_flag may be a flag indicating whether sign data hiding is available. That is, for example, sps_sign_data_hiding_enabled_flag may indicate whether the sign data hiding is available. For example, when the value of sps_sign_data_hiding_enabled_flag is 1, sps_sign_data_hiding_enabled_flag may indicate that the sign data hiding is available, and when the value of sps_sign_data_hiding_enabled_flag is 0, sps_sign_data_hiding_enabled_flag may indicate that the sign data hiding is not available.
[0386] According to Table 30 disclosing this embodiment, slice_ts_residual_coding_disabled_flag may be signaled only if sign data hiding is not available. Also, if sign data hiding is available, slice_ts_residual_coding_disabled_flag may not be signaled, and the value of slice_ts_residual_coding_disabled_flag may be inferred as 0 (residual samples of transform skip blocks in the current slice are coded with the TSRC syntax) or 1 (residual samples of transform skip blocks in the current slice are coded with the RRC syntax).
[0387] In addition, this document proposes an embodiment by combining the above-mentioned embodiments in relation to the signaling of sh_ts_residual_coding_disabled_flag. For example, an embodiment for signaling sh_ts_residual_coding_disabled_flag as shown in the following table may be proposed.
[0388] [Table 31]
[0389] Referring to Table 31, if sps_transform_skip_enabled_flag is 1, ph_dep_quant_enabled_flag is 0, and pic_sign_data_hiding_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may be signaled, otherwise sh_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be inferred to be 0.
[0390] Meanwhile, the embodiment of Table 31 is merely an example, and an example may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and ph_ts_residual_coding_disabled_flag are all signaled in the same HLS (e.g., slice header syntax, etc.).
[0391] Or, for example, an embodiment may be proposed to signal sh_ts_residual_coding_disabled_flag as shown in the following table.
[0392] [Table 32]
[0393] Referring to Table 32, if ph_dep_quant_enabled_flag is 0 and pic_sign_data_hiding_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may be signaled, otherwise sh_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be inferred to be 0.
[0394] Meanwhile, the embodiment of Table 32 is merely an example, and an example may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and ph_ts_residual_coding_disabled_flag are all signaled in the same HLS (e.g., slice header syntax, etc.).
[0395] Or, for example, an embodiment may be proposed to signal sh_ts_residual_coding_disabled_flag as shown in the following table.
[0396] [Table 33]
[0397] Referring to Table 33, if ph_dep_quant_enabled_flag is 0 or pic_sign_data_hiding_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may be signaled, otherwise sh_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be inferred to be 0.
[0398] This document also proposes an embodiment in which the above mentioned syntax elements ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag and slice_ts_residual_coding_disabled_flag are signaled in the same high level syntax or in the low level syntax.
[0399] For example, an embodiment may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and slice_ts_residual_coding_disabled_flag are all signaled in the picture header syntax, as shown in the following table.
[0400] [Table 34]
[0401] In this case, the slice_ts_residual_coding_disabled_flag can be referred to as ph_ts_residual_coding_disabled_flag.
[0402] Referring to Table 34, ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax, and if the value of ph_ts_residual_coding_disabled_flag is 0 and the value of sps_dep_quant_enabled_flag is 1, ph_dep_quant_enabled_flag may be signaled in the picture header syntax. Also, if the value of ph_ts_residual_coding_disabled_flag is 0, and the value of sps_sign_data_hiding_enabled_flag is 1 and ph_dep_quant_enabled_flag is 0, pic_sign_data_hiding_enabled_flag may be signaled in the picture header syntax. On the other hand, for example, if the value of ph_ts_residual_coding_disabled_flag is 1, ph_dep_quant_enabled_flag and pic_sign_data_hiding_enabled_flag may not be signaled.
[0403] Or, for example, an embodiment may be proposed in which ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag, and slice_ts_residual_coding_disabled_flag are all signaled in the picture header syntax, as shown in the following table.
[0404] [Table 35]
[0405] Referring to Table 35, ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax when the value of sps_transform_skip_enabled_flag is 1. Also, for example, ph_ts_residual_coding_disabled_flag may not be signaled when the value of sps_transform_skip_enabled_flag is 0. When ph_ts_residual_coding_disabled_flag is not signaled, ph_ts_residual_coding_disabled_flag may be inferred as 0 in the decoding device.
[0406] Also, referring to Table 35, when the value of ph_ts_residual_coding_disabled_flag is 0, if the value of sps_dep_quant_enabled_flag is 1, then ph_dep_quant_enabled_flag may be signaled in the picture header syntax. Also, when the value of ph_ts_residual_coding_disabled_flag is 0, if the value of sps_sign_data_hiding_enabled_flag is 1 and ph_dep_quant_enabled_flag is 0, then pic_sign_data_hiding_enabled_flag may be signaled in the picture header syntax. On the other hand, for example, when the value of ph_ts_residual_coding_disabled_flag is 1, then ph_dep_quant_enabled_flag and pic_sign_data_hiding_enabled_flag may not be signaled. Also, for example, if ph_dep_quant_enabled_flag is not signaled, ph_dep_quant_enabled_flag may be regarded as 0 in the decoding device (infer). Also, for example, if pic_sign_data_hiding_enabled_flag is not signaled, pic_sign_data_hiding_enabled_flag may be regarded as 0 in the decoding device (infer).
[0407] Meanwhile, the above-mentioned embodiments are merely examples, and examples may be proposed in which ph_ts_residual_coding_disabled_flag, ph_dep_quant_enabled_flag and pic_sign_data_hiding_enabled_flag are signaled in other high-level syntax (VPS, SPS, PPS, slice header syntax, etc.) or low-level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than the picture header syntax.
[0408] Meanwhile, as described above, the information (syntax elements) in the syntax table disclosed in this document may be included in image / video information, may be constructed / encoded by an encoding device, and may be transmitted to a decoding device in the form of a bitstream. The decoding device may parse / decode the information (syntax elements) in the syntax table. The decoding device may perform a block / image / video restoration procedure based on the decoded information.
[0409] FIG 14 illustrates a video encoding method by the encoding device according to the present document. The method disclosed in FIG 11 may be performed by the encoding device disclosed in FIG 2. Specifically, for example, S1100 of FIG 11 may be performed by a prediction unit of the encoding device, S1110 of FIG 11 may be performed by a subtraction unit of the encoding device, and S1120 to S1140 of FIG 11 may be performed by an entropy encoding unit of the encoding device. Also, although not shown, 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 adder of the encoding device.
[0410] An encoding apparatus encodes a dependent quantization availability flag indicating whether dependent quantization is available (S1400). The encoding apparatus may encode the dependent quantization availability flag indicating whether dependent quantization is available. The video information may include the dependent quantization availability flag. For example, the encoding apparatus may indicate whether dependent quantization is available for a block of a picture in a sequence, and may encode a dependent quantization availability flag indicating whether dependent quantization is available. For example, the dependent quantization availability flag may be a flag indicating whether dependent quantization is available. For example, the dependent quantization availability flag may indicate whether dependent quantization is available. That is, for example, the dependent quantization availability 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 there is a dependent quantization used flag indicating whether dependent quantization is used for the current slice. 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. The syntax element of the dependent quantization available flag may be the above-mentioned sps_dep_quant_enabled_flag. The sps_dep_quant_enabled_flag may be referred to as sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.
[0411] The encoding apparatus encodes a sign data hiding availability flag for whether sign data hiding is available (S1410). The encoding apparatus may encode the sign data hiding availability flag for whether sign data hiding is available. The video information may include the sign data hiding availability flag. For example, the encoding apparatus may determine whether sign data hiding is available for a block of a picture in a sequence, and may encode a sign data hiding availability flag for whether sign data hiding is available. For example, the sign data hiding availability flag may be a flag for whether sign data hiding is available. For example, the sign data hiding availability flag may indicate whether sign data hiding is available. That is, for example, the sign data hiding availability flag may indicate whether sign data hiding is available for a block of a picture in a sequence. For example, the sign data hiding available flag may indicate whether a sign data hiding use flag indicating whether sign data hiding is used for the current slice may be present. For example, the sign data hiding available flag having a value of 1 may indicate that the sign data hiding is available, and the sign data hiding available flag having a value of 0 may indicate that the sign data hiding is not available. For example, the sign data hiding available flag having a value of 1 may indicate that the sign data hiding use flag may be present, and the sign data hiding available flag having a value of 0 may indicate that the sign data hiding use flag is not present. Also, for example, the sign data hiding available flag may be signaled in a sequence parameter set (SPS) syntax.Or, for example, the sign data hiding enabled flag may be signaled in a picture header syntax or a slice header syntax. The syntax element for the sign data hiding enabled flag may be sps_sign_data_hiding_enabled_flag, as described above.
[0412] The encoding apparatus encodes a Transform Skip Residual Coding (TSRC) availability flag for indicating whether TSRC is available based on the dependent quantization availability flag and the sign data hiding availability flag (S1420). The video information may include a TSRC availability flag.
[0413] For example, the encoding apparatus may encode the TSRC available flag based on the dependent quantization available flag and the sign data hiding available flag. For example, the TSRC available flag may be encoded based on the dependent quantization available flag having a value of 0 and the sign data hiding available flag having a value of 0. That is, for example, when the value of the dependent quantization available flag is 0 (i.e., the dependent quantization available flag indicates that dependent quantization is not available) and the value of the sign data hiding available flag is 0 (i.e., the sign data hiding available flag indicates that sign data hiding 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., the dependent quantization available flag indicates that dependent quantization is not available) and the value of the sign data hiding available flag is 0 (i.e., the sign data hiding available flag indicates that sign data hiding is not available), the TSRC available flag may be signaled. Also, for example, when the value of the sign data hiding 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 sign data hiding available flag is 1, 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. 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 does not need to be signaled, and the value of the TSRC available flag may be derived in a decoding device as 0. Thus, for example, when dependent quantization and the sign data hiding are not available for the current block, the TSRC available flag may be signaled (or encoded).If dependent quantization and / or sign data hiding 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 in a decoding device as 0. Here, the current block may be a coding block (CB) or a transform block (TB).
[0414] Here, for example, the TSRC available flag may be a flag for whether or not the TSRC is available. That is, for example, the TSRC available flag may be a flag indicating whether or not the 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. A syntax element of the TSRC available flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.
[0415] Meanwhile, for example, the encoding apparatus may encode a transform skip availability flag for indicating whether a transform skip is available. The video information may include a transform skip availability flag. For example, the encoding apparatus may determine whether a transform skip is available for a block of a picture in a sequence, and may encode a transform skip availability flag for indicating whether a transform skip is available. For example, the transform skip availability flag may be a flag for indicating whether a transform skip is available. For example, the transform skip availability flag may indicate whether a transform skip is available. That is, for example, the transform skip availability flag may indicate whether a transform skip is available for a block of a picture in a sequence. For example, the transform skip availability flag may indicate whether a transform skip flag may exist. For example, the transform skip availability flag having a value of 1 may indicate that the transform skip is available, and the transform skip availability flag having a value of 0 may indicate that the transform skip is not available. That is, for example, the transform skip enabled flag having a value of 1 may indicate that the transform skip flag may be present, and the transform skip enabled flag having a value of 0 may indicate that the transform skip flag is not present. Also, for example, the transform skip enabled flag may be signaled in a Sequence Parameter Set (SPS) syntax. The syntax element of the transform skip enabled flag may be the above-mentioned sps_transform_skip_enabled_flag.
[0416] Also, for example, the TSRC available flag may be encoded based on the sign data hiding available flag, the dependent quantization available flag, and / or the transform skip available flag. For example, the TSRC available flag may be encoded based on the sign data hiding available flag having a value of 0, the dependent quantization available flag having a value of 0, and the transform skip available flag having a value of 1. That is, for example, the TSRC available flag may be encoded (or signaled) when the sign data hiding available flag has a value of 0 (i.e., the sign data hiding available flag indicates that sign data hiding is not available), the dependent quantization available flag has a value of 0 (i.e., the dependent quantization available flag indicates that dependent quantization is not available), and the transform skip available flag has a value of 1 (i.e., the transform skip available flag indicates that the transform skip is available). 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 a decoding device. That is, for example, when the value of the dependent quantization available flag is 1, the TSRC available flag may not be signaled, and the value of the TSRC available flag may be derived as 0 in a decoding device. Also, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be encoded, and the value of the TSRC available flag may be derived as 0. That is, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be signaled, and the value of the TSRC available flag may be derived as 0.
[0417] The encoding apparatus encodes residual information for the current block based on the TSRC available flag (S1430). The encoding apparatus may encode residual information for the current block based on the TSRC available flag.
[0418] For example, the encoding apparatus may determine a residual coding syntax for the current block based on the TSRC availability flag. For example, the encoding apparatus may determine the residual coding syntax for the current block to be one of a Regular Residual Coding (RRC) syntax and a Transform Skip Residual Coding (TSRC) syntax based on the TSRC availability flag. The RRC syntax may represent a syntax according to the RRC, and the TSRC syntax may represent a syntax according to the TSRC.
[0419] 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 indicating whether or not to skip a transform of the current block may be encoded, and the value of the transform skip flag may be 1. For example, the video information may include a transform skip flag for the current block. The transform skip flag may indicate whether or not a transform of the current block is skipped. That is, the transform skip flag may indicate whether or not a transform has been applied to a transform coefficient of the current block. The syntax element indicating the transform skip flag may be the above-mentioned transform_skip_flag. For example, when the transform skip flag has a value of 1, the transform skip flag may indicate that no transform is applied to the current block (i.e., that the transform is skipped), and when the transform skip flag has a value of 0, the transform skip flag may indicate that a transform is applied to the current block. For example, when the current block is a transform skip block, the value of the transform skip flag for the current block may be 1.
[0420] 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 indicating whether or not a transform of the current block is skipped 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 indicating whether or not a transform of the current block is skipped 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.
[0421] Thereafter, for example, an encoding apparatus may encode residual information of the determined residual coding syntax for the current block. An encoding apparatus may derive residual samples for the current block and encode the residual information of the determined residual coding syntax for the residual samples of the current block. For example, residual information of a Regular Residual Coding (RRC) syntax may be encoded based on the TSRC availability flag having a value of 1, and residual information of a TSRC syntax may be encoded based on the TSRC availability flag having a value of 0. The video information may include residual information.
[0422] For example, the encoding apparatus 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 apparatus may derive a prediction sample for the current block, and may derive a residual sample for the current block by subtracting an original sample for the current block from the prediction sample.
[0423] 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 taking into account 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.
[0424] When a transform is not applied to the current block, i.e., when a transform is not applied to the residual sample, the encoding apparatus may derive the derived residual sample as the current transform coefficient. When a transform is applied to the current block, i.e., when a transform is applied to the residual sample, the encoding apparatus may derive the transform coefficient by performing a transform on the residual sample. The current block may include a plurality of sub-blocks or coefficient groups (CG). Also, a size of the sub-block of the current block may be 4x4 size or 2x2 size. That is, the sub-block 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.
[0425] Meanwhile, the encoding apparatus may determine whether dependent quantization is applied to the current block. For example, when 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, when 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 in a scalar quantizer for the updated state.
[0426] For example, if the residual coding syntax for the current block is derived from 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.
[0427] 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 be referred to as a residual coefficient.
[0428] 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.
[0429] Specifically, for example, the syntax element may include position information indicating a position of a last non-zero transform coefficient in a residual coefficient array of the current block. That is, the syntax element may include position information indicating a position of a last non-zero transform coefficient in a scanning order of the current block. The position information may include information indicating a prefix of a column position of the last non-zero transform coefficient, information indicating a prefix of a row position of the last non-zero transform coefficient, information indicating a suffix of a column position of the last non-zero transform coefficient, and information indicating a suffix of a row position of the last non-zero transform coefficient. The syntax elements for the position information may be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. Meanwhile, the non-zero transform coefficients may be referred to as significant coefficients.
[0430] 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 critical value, a parity level flag for the parity of the coefficient level, and / or a second coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a second critical value. Here, the coded sub-block flag may be sb_coded_flag or coded_sub_block_flag, the significant coefficient flag may be sig_coeff_flag, the first coefficient level flag may be abs_level_gt1_flag or abs_level_gtx_flag, the parity level flag may be par_level_flag, and the second coefficient level flag may be abs_level_gt3_flag or abs_level_gtx_flag.
[0431] Also, for example, the syntax element may include coefficient value related information for values of the transform coefficients of the current block, and the coefficient value related information may be abs_remainder and / or dec_abs_level.
[0432] Also, for example, the syntax element may include a sign flag indicating a sign of the transform coefficient. The sign flag may be coeff_sign_flag.
[0433] Meanwhile, for example, when the sign data hiding is applied to the current block, the sign flag of the first valid transform coefficient of a current coefficient group (CG) in the current block may not be encoded and signaled. That is, for example, when the sign data hiding is applied to the current block, the syntax element may not include a sign flag indicating the sign of the first valid transform coefficient. Meanwhile, for example, whether the sign data hiding is applied to the current block may be derived based on the sign data hiding available flag and / or the first valid transform coefficient position and the last valid transform coefficient position of the current CG. For example, when the sign data hiding available flag has a value of 1 and a value obtained by subtracting the first valid transform coefficient position from the last valid transform coefficient position is greater than 3 (i.e., when the sign data hiding available flag has a value of 1 and the number of valid transform coefficients in the current CG is greater than 3), the sign data hiding may be applied to the current CG of the current block.
[0434] Also, for example, when 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.
[0435] 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.
[0436] 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.
[0437] 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 coeff_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.
[0438] Also, for example, the bypass-coded syntax element for the transform coefficient may include coefficient level information for the value (or coefficient level) of the transform coefficient and / or a sign flag indicating a sign for the transform coefficient. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be coeff_sign_flag.
[0439] An encoding apparatus generates a bitstream including the dependent quantization available flag, the sign data hiding available flag, the TSRC available flag, and the residual information (S1440). For example, the encoding apparatus may output video information including the dependent quantization available flag, the sign data hiding available flag, the TSRC available flag, and the residual information as a bitstream. The bitstream may include the dependent quantization available flag, the sign data hiding available flag, the TSRC available flag, and the residual information. In addition, the bitstream may further include the transform skip available flag.
[0440] 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 performed on the current block.
[0441] Meanwhile, the bitstream may be transmitted to the decoding device via a network or a (digital) storage medium, where the network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.
[0442] FIG. 15 is a schematic diagram of an encoding device for performing a video encoding method according to the present document. The method disclosed in FIG. 14 may be performed by the encoding device disclosed in FIG. 15. Specifically, for example, the entropy encoding unit of the encoding device of FIG. 15 may perform S1400 to S1440 of FIG. 14. Although not shown, the process of deriving a predicted sample may be performed by a prediction unit of the encoding device, the 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 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 may be performed by an addition unit of the encoding device.
[0443] FIG 16 illustrates a video decoding method by a decoding device according to the present document. The method illustrated in FIG 16 may be performed by the decoding device illustrated in FIG 3. Specifically, for example, S1600 to S1630 of FIG 16 may be performed by an entropy decoding unit of the decoding device, S1640 of FIG 16 may be performed by a residual processing unit of the decoding device, and S1650 of FIG 16 may be performed by an adder of the decoding device. Also, although not illustrated, 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.
[0444] A decoding apparatus obtains a dependent quantization available flag indicating whether dependent quantization is available (S1600). The decoding apparatus may obtain video information including the dependent quantization available flag by using a bitstream. The video information may include the dependent quantization available flag. For example, the dependent quantization available flag may be a flag indicating 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. The syntax element of the dependent quantization available flag may be sps_dep_quant_enabled_flag as described above. 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.
[0445] The decoding apparatus acquires a sign data hiding available flag indicating whether sign data hiding is available (S1610). The decoding apparatus may acquire video information including the sign data hiding available flag by using a bitstream. The video information may include the sign data hiding available flag. For example, the sign data hiding available flag may be a flag indicating whether sign data hiding is available. For example, the sign data hiding available flag may indicate whether sign data hiding is available for a block of a picture in a sequence. For example, the sign data hiding available flag may indicate whether a sign data hiding use flag indicating whether sign data hiding is used for a current slice is present. For example, the sign data hiding available flag having a value of 1 may indicate that the sign data hiding is available, and the sign data hiding available flag having a value of 0 may indicate that the sign data hiding is not available. For example, the sign data hiding available flag having a value of 1 may indicate that the sign data hiding use flag may be present, and the sign data hiding available flag having a value of 0 may indicate that the sign data hiding use flag is not present. Also, for example, the sign data hiding available flag may be signaled in a sequence parameter set (SPS) syntax. Or, for example, the sign data hiding available flag may be signaled in a picture header syntax or a slice header syntax. A syntax element of the sign data hiding available flag may be the above-mentioned sps_sign_data_hiding_enabled_flag.
[0446] The decoding apparatus obtains a Transform Skip Residual Coding (TSRC) availability flag indicating whether TSRC is available based on the dependent quantization availability flag and the sign data hiding availability flag (S1620). The video information may include a TSRC availability flag.
[0447] For example, the decoding apparatus may obtain the TSRC available flag based on the dependent quantization available flag and the sign data hiding available flag. For example, the TSRC available flag may be obtained based on the dependent quantization available flag having a value of 0 and the sign data hiding available flag having a value of 0. That is, for example, the TSRC available flag may be obtained when the value of the dependent quantization available flag is 0 (i.e., the dependent quantization available flag indicates that dependent quantization is not available) and the value of the sign data hiding available flag is 0 (i.e., the sign data hiding available flag indicates that sign data hiding is not available). In other words, for example, when the value of the dependent quantization available flag is 0 (i.e., the dependent quantization available flag indicates that dependent quantization is not available) and the value of the sign data hiding available flag is 0 (i.e., the sign data hiding available flag indicates that sign data hiding is not available), the TSRC available flag may be signaled. Also, for example, when the value of the sign data hiding 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 sign data hiding available flag is 1, the TSRC available flag may not be signaled and the value of the TSRC available flag may be derived as 0. 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 and the sign data hiding are not available for the current block, the TSRC available flag may be signaled (or obtained).If dependent quantization and / or sign data hiding is available for the current block, the TSRC available flag may 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).
[0448] Here, for example, the TSRC available flag may be a flag for whether or not TSRC is available. That is, for example, the TSRC available flag may be a flag indicating whether or not 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. A syntax element of the TSRC available flag may be the above-mentioned sh_ts_residual_coding_disabled_flag.
[0449] Meanwhile, for example, a decoding apparatus may obtain a transform skip available flag. The decoding apparatus may obtain video information including the transform skip available flag by using a bitstream. The video information may include the transform skip available flag. Here, the current block may be a coding block (CB) or a transform block (TB). For example, the transform skip available flag may be a flag for whether a transform skip is available. For example, the transform skip available flag may indicate whether a transform skip is available. That is, for example, the transform skip available flag may indicate whether a transform skip is available for a block of a picture in a sequence. For example, the transform skip available flag may indicate whether a transform skip flag may exist. For example, the transform skip available flag having a value of 1 may indicate that the transform skip is available, and the transform skip available flag having a value of 0 may indicate that the transform skip is not available. That is, for example, the transform skip enabled flag having a value of 1 may indicate that the transform skip flag may be present, and the transform skip enabled flag having a value of 0 may indicate that the transform skip flag is not present. Also, for example, the transform skip enabled flag may be signaled in a Sequence Parameter Set (SPS) syntax. The syntax element of the transform skip enabled flag may be the above-mentioned sps_transform_skip_enabled_flag.
[0450] Also, for example, the TSRC available flag may be obtained based on the sign data hiding available flag, the dependent quantization available flag, and / or the transform skip available flag. For example, the TSRC available flag may be obtained based on the sign data hiding available flag having a value of 0, the dependent quantization available flag having a value of 0, and the transform skip available flag having a value of 1. That is, for example, the TSRC available flag may be obtained (or signaled) when the value of the sign data hiding available flag is 0 (i.e., the sign data hiding available flag indicates that sign data hiding is not available), the value of the dependent quantization available flag is 0 (i.e., the dependent quantization available flag indicates that dependent quantization is not available), and the value of the transform skip available flag is 1 (i.e., the transform skip available flag indicates that the transform skip is available). 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, the TSRC available flag may not be signaled, and the value of the TSRC available flag may be derived as 0. Also, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be acquired, and the value of the TSRC available flag may be derived as 0. That is, for example, when the value of the transform skip available flag is 0, the TSRC available flag may not be signaled, and the value of the TSRC available flag may be derived as 0.
[0451] The decoding apparatus obtains residual information for the current block based on the TSRC available flag (S1630). The decoding apparatus can obtain residual information for the current block based on the TSRC available flag.
[0452] For example, the decoding apparatus may determine a residual coding syntax for the current block based on the TSRC availability flag. For example, the decoding apparatus may determine the residual coding syntax for the current block to be one of a Regular Residual Coding (RRC) syntax and a Transform Skip Residual Coding (TSRC) syntax based on the TSRC availability flag. The RRC syntax may represent a syntax according to the RRC, and the TSRC syntax may represent a syntax according to the TSRC.
[0453] 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, based on the transform skip availability flag having a value of 1, for example, a transform skip flag for indicating whether to skip a transform of the current block may be obtained, and a value of the transform skip flag may be 1. For example, the video information may include a transform skip flag for the current block. The transform skip flag may indicate whether to skip a transform of the current block. That is, the transform skip flag may indicate whether a transform has been applied to transform coefficients of the current block. A syntax element representing the transform skip flag may be the above-mentioned transform_skip_flag. For example, when the transform skip flag has a value of 1, the transform skip flag may indicate that no transform is applied to the current block (i.e., transform is skipped), and when the transform skip flag has a value of 0, the transform skip flag may indicate that a transform is applied to the current block. For example, if the current block is a transform skip block, the value of the transform skip flag for the current block may be 1.
[0454] 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 to skip a transform of the current block may be obtained, 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 to skip a transform of the current block may be obtained, 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.
[0455] Thereafter, for example, the decoding apparatus may obtain residual information of the determined residual coding syntax for the current block. For example, residual information of a Regular Residual Coding (RRC) syntax may be obtained based on the TSRC availability flag having a value of 1, and residual information of a TSRC syntax may be obtained based on the TSRC availability flag having a value of 0. The image information may include residual information.
[0456] For example, if the residual coding syntax for the current block is determined to be the RRC syntax, the decoding device 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.
[0457] 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 be referred to as a residual coefficient.
[0458] 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.
[0459] Specifically, for example, the syntax element may include position information indicating a position of a last non-zero transform coefficient in a residual coefficient array of the current block. That is, the syntax element may include position information indicating a position of a last non-zero transform coefficient in a scanning order of the current block. The position information may include information indicating a prefix of a column position of the last non-zero transform coefficient, information indicating a prefix of a row position of the last non-zero transform coefficient, information indicating a suffix of a column position of the last non-zero transform coefficient, and information indicating a suffix of a row position of the last non-zero transform coefficient. The syntax elements for the position information may be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. Meanwhile, a non-zero transform coefficient may be referred to as a significant coefficient.
[0460] Further, 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 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.
[0461] Also, for example, the syntax element may include coefficient value related information for values of the transform coefficients of the current block, and the coefficient value related information may be abs_remainder and / or dec_abs_level.
[0462] Also, for example, the syntax element may include a sign flag indicating a sign of the transform coefficient. The sign flag may be coeff_sign_flag.
[0463] Meanwhile, for example, when the sign data hiding is applied to the current block, the sign flag of the first valid transform coefficient of a current coefficient group (CG) in the current block may not be signaled. That is, for example, when the sign data hiding is applied to the current block, the syntax element may not include a sign flag indicating the sign of the first valid transform coefficient. Meanwhile, for example, whether the sign data hiding is applied to the current block may be derived based on the sign data hiding available flag and / or the first valid transform coefficient position and the last valid transform coefficient position of the current CG. For example, when the sign data hiding available flag has a value of 1 and a value obtained by subtracting the first valid transform coefficient position from the last valid transform coefficient position is greater than 3 (i.e., when the sign data hiding available flag has a value of 1 and the number of valid transform coefficients in the current CG is greater than 3), the sign data hiding may be applied to the current CG of the current block.
[0464] Also, for example, if the residual coding syntax for the current block is determined to be the TSRC syntax, the decoding apparatus 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.
[0465] 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 be referred to as a residual coefficient.
[0466] 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.
[0467] 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 coeff_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.
[0468] Also, for example, the bypass-coded syntax element for the transform coefficient may include coefficient level information for the value (or coefficient level) of the transform coefficient and / or a sign flag indicating a sign for the transform coefficient. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be coeff_sign_flag.
[0469] The decoding apparatus derives a residual sample of the current block based on the residual information (S1640). For example, the decoding apparatus 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.
[0470] 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. For example, when it is determined based on the transform skip flag that no transform is applied to the current block, i.e., when 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, when it is determined based on the transform skip flag that no transform is applied to the current block, i.e., when the value of the transform skip flag is 1, the decoding apparatus may dequantize the transform coefficients to derive the residual samples of the current block. Alternatively, for example, when it is determined based on the transform skip flag that a transform is applied to the current block, i.e., when the value of the transform skip flag is 0, the decoding apparatus may inverse transform the transform coefficients to derive the residual samples of the current block. Or, for example, if it is derived that a transform has been applied to the current block based on the transform skip flag, i.e., if the value of the transform skip flag is 0, the decoding device may dequantize the transform coefficients and inverse transform the dequantized transform coefficients to derive the residual sample of the current block.
[0471] Meanwhile, when the dependent quantization is applied to the current block, the decoding apparatus may derive the residual sample of the current block by performing the dependent quantization process on the transform coefficient. For example, when the dependent quantization is applied to the current block, the decoding apparatus may update a state (Qstate) for dependent quantization based on a coefficient level of a transform coefficient immediately 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 derive a residual sample by inverse quantizing the derived coefficient level. For example, the current transform coefficient may be inverse quantized based on a quantization parameter for a restoration level of the current transform coefficient in a scalar quantizer for the updated state. Here, the restoration level may be derived based on a syntax element for the current transform coefficient.
[0472] Meanwhile, for example, when the sign data hiding is applied to the current block, the sign of the first significant transform coefficient of the current CG in the current block may be derived based on the sum of the absolute values of the significant transform coefficients in the current CG. For example, if the sum of the absolute values of the significant transform coefficients is even, the sign of the first significant transform coefficient may be derived as a positive value, and if the sum of the absolute values of the significant transform coefficients is odd, the sign of the first significant transform coefficient may be derived as a negative value.
[0473] The decoding apparatus generates a reconstructed picture based on the residual sample (S1650). For example, the decoding apparatus may generate a reconstructed sample and / or a reconstructed picture of the current block based on the residual sample. For example, the decoding apparatus may derive a prediction sample by performing an inter prediction mode or an intra prediction mode on the current block based on prediction information received through a bitstream, and may generate the reconstructed sample by adding the prediction sample and the residual sample.
[0474] Then, as mentioned above, in-loop filtering procedures such as deblocking filtering, SAO and / or ALF procedures may be applied to the reconstructed picture, if necessary, to improve the subjective / objective image quality.
[0475] FIG 17 is a schematic diagram of a decoding device performing a video decoding method according to the present document. The method disclosed in FIG 16 may be performed by the decoding device disclosed in FIG 17. Specifically, for example, an entropy decoding unit of the decoding device of FIG 17 may perform S1600 to S1630 of FIG 16, a residual processing unit of the decoding device of FIG 17 may perform S1640 of FIG 16, and an adder of the decoding device of FIG 17 may perform S1650 of FIG 16. Also, although not shown, a process of receiving prediction information for a current block may be performed by an entropy decoding unit of the decoding device of FIG 17, and a process of deriving a prediction sample of a current block may be performed by a prediction unit of the decoding device of FIG 17.
[0476] According to the above-mentioned document, the efficiency of residual coding can be increased.
[0477] In addition, this document establishes a signaling relationship between the sign data hiding available flag and the TSRC available flag, and by not signaling the TSRC available flag when sign data hiding is not available, sign data hiding is not used when TSRC is not available and the RRC syntax is coded for the transform skip block, thereby improving coding efficiency and reducing the amount of coded bits, thereby improving overall residual coding efficiency.
[0478] In addition, this document establishes a signaling relationship between the dependent quantization available flag and the TSRC available flag, and signals the TSRC available flag when dependent quantization is not available, so that dependent quantization is not used when TSRC is not available and the RRC syntax is coded for the transform skip block, thereby improving coding efficiency and reducing the amount of coded bits to improve overall residual coding efficiency.
[0479] In addition, according to this document, by establishing a signaling relationship between the transform skip available flag and the TSRC available flag and signaling the TSRC available flag when transform skip is available, the amount of coded bits can be reduced and the overall residual coding efficiency can be improved.
[0480] In the above-described embodiments, the method is a series of steps or blocks and is described based on a flowchart, but this document is not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described above. In addition, those skilled in the art will understand that the steps shown in the flowchart are not exclusive, and other steps may be included or one or more steps of the flowchart may be deleted without affecting the scope of this document.
[0481] The embodiments described in this document may be implemented and performed on a processor, microprocessor, controller, or chip. For example, the functional units shown in each figure may be implemented and performed on a computer, processor, microprocessor, controller, or chip. In this case, information (e.g., information on instructions) or algorithms for the implementation may be stored in a digital storage medium.
[0482] In addition, the decoding device and encoding device to which the embodiment of this 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 conversation device, a real-time communication device such as a video communication, a mobile streaming device, a storage 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 vehicle terminal (e.g., a vehicle terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, etc., and may be used to process a video signal or a data signal. For example, an 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.
[0483] 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 any kind of storage device and distributed storage device in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable recording medium may also include a medium embodied in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by the encoding method may be stored in a computer-readable recording medium or transmitted through a wired or wireless communication network.
[0484] Furthermore, the embodiments of the present document may be embodied as a computer program product by program code, the program code being executable by a computer in accordance with the embodiments of the present document, the program code being stored on a computer readable carrier.
[0485] FIG. 18 illustrates a structural diagram of a content streaming system to which the embodiments of this document are applied.
[0486] A content streaming system to which the embodiments of this document are applied can broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
[0487] 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, when a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.
[0488] 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.
[0489] 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 a medium 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 the 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 plays a role of controlling commands / responses between the devices in the content streaming system.
[0490] The streaming server may receive the content from a media storage and / or an encoding server. For example, when receiving the content 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.
[0491] Examples of the user devices include mobile phones, smart phones, 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 may be operated as a distributed server, in which case data received by each server may be processed in a distributed manner.
[0492] The claims described herein may be combined in various ways. For example, the technical features of the method claims herein may be combined and embodied as an apparatus, the technical features of the apparatus claims herein may be combined and embodied as a method, the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied as an apparatus, and the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and embodied as a method.
Claims
1. A video decoding method performed by a decoding device, comprising: Obtaining a dependent quantization availability flag indicating whether dependent quantization is available; obtaining a Transform Skip Residual Coding (TSRC) disabled flag indicating whether a TSRC syntax is used based on the dependent quantization available flag; obtaining residual information for a current block based on the TSRC disabled flag; deriving a residual sample of the current block based on the residual information; generating a reconstructed picture based on the residual samples; The TSRC disabled flag is obtained from a bitstream based on a value of the dependent quantization available flag being equal to 0.
2. the dependent quantization available flag being 1 indicates that the dependent quantization is available; The video decoding method of claim 1 , wherein the dependent quantization availability flag being 0 indicates that the dependent quantization is not available.
3. The TSRC disabled flag being 1 indicates that the TSRC syntax is not used; The video decoding method of claim 1 , wherein the TSRC disabled flag being 0 indicates that the TSRC syntax is used.
4. The video decoding method of claim 3 , wherein the residual information for the current block is obtained from a residual coding syntax based on a value of the TSRC disabled flag being equal to one.
5. The video decoding method of claim 4 , wherein a transform skip flag indicating whether transform skip is applied to the current block is obtained from the bitstream.
6. The image decoding method of claim 3 , wherein the current block is a transformed skip block and the residual information for the current block is obtained from the TSRC syntax based on a value of the TSRC disabled flag being 0.
7. The residual information of the TSRC syntax includes a context-coded syntax element for a transform coefficient, 7. The image decoding method of claim 6, wherein the context coded syntax elements include a significant coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient, a parity level flag for a parity of a coefficient level for the transform coefficient, a sign flag indicating a sign for the transform coefficient, a first coefficient level flag for whether the coefficient level is greater than a first critical value, and a second coefficient level flag for whether the coefficient level of the transform coefficient is greater than a second critical value.
8. Based on the dependent quantization being available for the current block, the TSRC disabled flag is not obtained from the bitstream; The video decoding method of claim 1 , wherein the TSRC disabled flag is derived as a value of 0.
9. A video encoding method performed by an encoding device, comprising: encoding a dependent quantization availability flag indicating whether dependent quantization is available; encoding a Transform Skip Residual Coding (TSRC) disabled flag indicating whether a TSRC syntax is used based on the dependent quantization available flag; encoding residual information for a current block based on the TSRC disabled flag; generating a bitstream including the dependent quantization available flag, the TSRC disabled flag, and the residual information; The video encoding method, wherein the TSRC disabled flag is encoded in the bitstream based on a value of the dependent quantization available flag being equal to 0.
10. 1. A method for transmitting data for video information, comprising: generating a bitstream for the image information, the bitstream being generated by encoding a dependent quantization available flag indicating whether dependent quantization is available, encoding a transform skip residual coding (TSRC) disabled flag indicating whether a TSRC syntax is used based on the dependent quantization available flag, and encoding residual information for a current block based on the TSRC disabled flag; transmitting a bitstream for the video information; The data transmission method, wherein the TSRC disabled flag is encoded in the bitstream based on a value of the dependent quantization available flag being equal to 0.
Citation Information
Patent Citations
Image decoding method and apparatus for residual coding
JP7493612B2
Video decoding method and apparatus
JP7575479B2
Video decoding method and apparatus for residual coding
JP7807488B2