Image decoding methods, image encoding methods, data transmission methods for images, and storage media readable by computers without relaying
Patent Information
- Application Number
- VN1202604948
- Authority / Receiving Office
- VN · VN
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2020-03-31
- Filing Date
- 2021-03-30
- Publication Date
- 2026-08-03
AI Technical Summary
The increasing demand for high-resolution, high-quality video data leads to increased storage and transmission costs due to higher bit rates, necessitating highly efficient video compression technologies to effectively manage and reproduce such data.
The method and device enhance video coding efficiency by establishing signaling relationships between flags for dependent quantization, sign data hiding, and Transform Skip Residual Coding (TSRC) availability, allowing for improved residual coding efficiency by preventing unnecessary data encoding and reducing the amount of coded bits.
This approach enhances overall residual coding efficiency by signaling TSRC availability based on the availability of other flags, thereby reducing the amount of coded bits and improving coding efficiency, especially when TSRC or dependent quantization is not available.
Smart Images

Figure VN1202604948_0
Abstract
Description
Video decoding method and device therefor
[0001] This document relates to a video coding technology, and more specifically, to a video decoding method and device for coding flag information indicating whether TSRC is available when coding residual data of a current block in a video coding system.
[0002] Demand for high-resolution, high-quality video, such as HD (High Definition) and UHD (Ultra High Definition), is growing across various fields. As video data becomes higher in resolution and quality, the amount of information or bits transmitted increases relative to conventional video data. Therefore, transmitting video data using existing media, such as wired or wireless broadband lines, or storing it using existing storage media, increases transmission and storage costs.
[0003] Accordingly, high-efficiency image compression technology is required to effectively transmit, store, and play high-resolution, high-quality image information.
[0004] The technical task of this document is to provide a method and device for improving video coding efficiency.
[0005] Another technical challenge of this document is to provide a method and device for improving the efficiency of residual coding.
[0006] According to one embodiment of the present document, a video decoding method performed by a decoding device is provided. The method includes the steps of: obtaining a dependent quantization availability flag indicating whether dependent quantization is available; obtaining a sign data hiding availability flag indicating whether sign data hiding is available; obtaining a TSRC availability flag indicating whether transform skip residual coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag; obtaining residual information for a current block based on the TSRC availability 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 availability flag is obtained based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.
[0007] According to another embodiment of the present document, a decoding device for performing image decoding is provided. The decoding device comprises an entropy decoding unit that obtains a dependent quantization availability flag indicating whether dependent quantization is available, a sign data hiding availability flag indicating whether sign data hiding is available, a TSRC availability flag indicating whether transform skip residual coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag, an entropy decoding unit that obtains residual information for a current block based on the TSRC availability flag, a residual processing unit that derives a residual sample of the current block based on the residual information, and an adding unit that generates a reconstructed picture based on the residual sample, wherein the TSRC availability flag is obtained based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.
[0008] According to another embodiment of the present document, a video encoding method performed by an encoding device is provided. The method includes the steps of encoding a dependent quantization availability flag indicating whether dependent quantization is available, encoding a sign data hiding availability flag indicating whether sign data hiding is available, encoding a TSRC availability flag indicating whether transform skip residual coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag, encoding residual information for a current block based on the TSRC availability flag, and generating a bitstream including the dependent quantization availability flag, the sign data hiding availability flag, the TSRC availability flag, and the residual information, wherein the TSRC availability flag is encoded based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.
[0009] According to another embodiment of the present document, a video encoding device is provided. The encoding device includes an entropy encoding unit that encodes a dependent quantization availability flag indicating whether dependent quantization is available, encodes a sign data hiding availability flag indicating whether sign data hiding is available, encodes a TSRC availability flag indicating whether transform skip residual coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag, encodes residual information for a current block based on the TSRC availability flag, and generates a bitstream including the dependent quantization availability flag, the sign data hiding availability flag, the TSRC availability flag, and the residual information, wherein the TSRC availability flag is encoded based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.
[0010] According to another embodiment of the present document, a computer-readable digital storage medium having stored thereon a bitstream including image information causing an image decoding method to be performed is provided. In a computer-readable digital storage medium, the image decoding method comprises the steps of: obtaining a dependent quantization availability flag indicating whether dependent quantization is available; obtaining a sign data hiding availability flag indicating whether sign data hiding is available; obtaining a TSRC availability flag indicating whether transform skip residual coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag; obtaining residual information for a current block based on the TSRC availability flag; deriving a residual sample of the current block based on the residual information; and generating a restored picture based on the residual sample, wherein the TSRC availability flag is obtained based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.
[0011] According to this document, the efficiency of residual coding can be improved.
[0012] According to this document, a signaling relationship between the sign data hiding availability flag and the TSRC availability flag is established so that the TSRC availability flag can be signaled when sign data hiding is not available, thereby improving coding efficiency by not using sign data hiding when RRC syntax is coded for a transform skip block due to TSRC being unavailable, and reducing the amount of bits to be coded so as to improve overall residual coding efficiency.
[0013] According to this document, a signaling relationship between a dependent quantization available flag and a TSRC available flag is established so that the TSRC available flag can be signaled when dependent quantization is not available, thereby improving coding efficiency by not using dependent quantization when an RRC syntax is coded for a transform skip block due to TSRC being unavailable, and reducing the amount of bits to be coded so as 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, the TSRC available flag can be signaled when transform skip is available, thereby reducing the amount of bits to be coded and improving the overall residual coding efficiency.
[0015] Figure 1 schematically illustrates an example of a video / image coding system to which embodiments of the present document can be applied.
[0016] FIG. 2 is a drawing schematically illustrating the configuration of a video / image encoding device to which embodiments of this document can be applied.
[0017] FIG. 3 is a drawing schematically illustrating the configuration of a video / image decoding device to which embodiments of this document can be applied.
[0018] Figure 4 shows an example of an intra prediction based video / image encoding method.
[0019] Figure 5 shows an example of an intra prediction based video / image decoding method.
[0020] Figure 6 illustrates an intra prediction procedure as an example.
[0021] Figure 7 shows an example of an inter prediction based video / image encoding method.
[0022] Figure 8 shows an example of an inter prediction based video / image decoding method.
[0023] Figure 9 illustrates an example of an inter prediction procedure.
[0024] Figure 10 illustrates an example of context-adaptive binary arithmetic coding (CABAC) for encoding a syntax element.
[0025] Figure 11 is a diagram showing an example of transform coefficients within a 4x4 block.
[0026] Figure 12 illustrates scalar quantizers used in dependent quantization.
[0027] Figure 13 illustrates an example of state transition and quantizer selection for dependent quantization.
[0028] Figure 14 schematically illustrates a method for encoding an image using an encoding device according to this document.
[0029] Fig. 15 schematically illustrates an encoding device that performs an image encoding method according to this document.
[0030] Figure 16 schematically illustrates a method of decoding an image by a decoding device according to this document.
[0031] Fig. 17 schematically illustrates a decoding device that performs an image decoding method according to this document.
[0032] Figure 18 illustrates an exemplary structure of a content streaming system to which embodiments of this document are applied.
[0033] This document may have various modifications and embodiments, and thus specific embodiments are illustrated and described in detail in the drawings. However, this is not intended to limit the embodiments of this document to specific embodiments. The terminology used herein is only used to describe specific embodiments and is not intended to limit the technical idea of this document. The singular expression includes plural expressions unless the context clearly indicates otherwise. It should be understood that the terms "comprises" or "has" in this specification specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0034] Meanwhile, each component in the drawings described in this document is depicted independently for the convenience of explaining their distinct features. This does not imply that each component is implemented using separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also included within the scope of this document, as long as they do not deviate from the essence of this document.
[0035] Hereinafter, with reference to the attached drawings, preferred embodiments of the present document will be described in more detail. Hereinafter, identical components in the drawings will be designated by the same reference numerals, and redundant descriptions of identical components may be omitted.
[0036] Figure 1 schematically illustrates an example of a video / image coding system to which embodiments of the present document can be applied.
[0037] Referring to FIG. 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 via a digital storage medium or a network in the form of a file or streaming.
[0038] The source device may include a video source, an encoding device, and a transmitter. The receiving device may include a receiver, a decoding device, and a renderer. The encoding device may be referred to as a video / 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 include a display unit, and the display unit may be configured as a separate device or an external component.
[0039] A video source may obtain video / images through a process of capturing, synthesizing, or generating video / images. The video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be replaced by a process of generating related data.
[0040] An encoding device can encode input video / images. The encoding device can perform a series of procedures, such as prediction, transformation, and quantization, to improve compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0041] The transmission unit can transmit encoded video / image information or data output in the form of a bitstream to the receiving unit of a receiving device via a digital storage medium or network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmission unit can include an element for generating a media file via a predetermined file format and an element for transmission via a broadcasting / communication network. The receiving unit can receive / extract the bitstream and transmit it to a decoding device.
[0042] The decoding device can decode the video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operation of the encoding device.
[0043] The renderer can render decoded video / images. The rendered video / images can be displayed through the display unit.
[0044] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document can be applied to methods disclosed in the VVC (versatile video coding) standard, the EVC (essential video coding) standard, the AV1 (AOMedia Video 1) standard, the AVS2 (2nd generation of audio video coding standard), or the next generation video / image coding standard (e.g., H.267 or H.268).
[0045] This document presents various embodiments of video / image coding, and unless otherwise stated, the embodiments may be performed in combination with each other.
[0046] In this document, video may refer to a set of images over time. A picture generally refers to a unit representing one image at a specific time point, and a subpicture / slice / tile is a unit that constitutes part of a picture in coding. A subpicture / slice / tile may include one or more CTUs (coding tree units). 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 CTU rows within a tile within 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 specific sequential ordering of CTUs partitioning a picture, wherein the CTUs may be arranged within a brick by a CTU raster scan, the bricks within a tile may be arranged sequentially by a raster scan of the bricks within the tile, and the tiles within a picture may be arranged sequentially by a raster scan of the tiles within the picture. Furthermore, a subpicture may represent a rectangular region of one or more slices within a picture. That is, a subpicture may include one or more slices that collectively cover a rectangular region of a picture. A tile is a rectangular region of a specific tile row and CTUs within a specific tile row. The tile row is a rectangular region of CTUs, and the rectangular region has a height equal to the height of the picture, and a width may be specified by syntax elements within a picture parameter set.The above tile row is a rectangular region of CTUs, and the rectangular region has a width specified by syntax elements in the picture parameter set, and the height may be equal to the height of the picture. A tile scan may indicate a specific sequential ordering of CTUs that partition a picture, and the CTUs may be sequentially ordered by a CTU raster scan within a tile, and the tiles within a picture may be sequentially ordered by a raster scan of the tiles of the picture. A slice may contain an integer number of bricks of a picture, and the integer number of bricks may be included in one NAL unit. A slice may consist of multiple complete tiles, or may be a continuous sequence of complete bricks of a tile. In this document, tile group and slice may be used interchangeably. For example, in this document, tile group / tile group header may be referred to as slice / slice header.
[0047] A pixel or pel can refer to the smallest unit that constitutes a picture (or image). Additionally, the term "sample" can be used as a counterpart to a pixel. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luma component, or only the pixel / pixel value of the chroma component.
[0048] 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 (e.g., cb, cr) blocks. In some cases, the term "unit" may be used interchangeably with terms such as "block" or "area." In general, an MxN block may include a set (or array) of samples (or sample array) or transform coefficients consisting of M columns and N rows.
[0049] As used herein, "A or B" can mean "only A," "only B," 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 "only A," "only B," "only C," or "any combination of A, B and C."
[0050] As used herein, a slash ( / ) or a comma can mean "and / or." For example, "A / B" can mean "A and / or B." Accordingly, "A / B" can mean "only A," "only B," or "both A and B." For example, "A, B, C" can mean "A, B, or C."
[0051] In this specification, "at least one of A and B" may mean "only A", "only B" or "both A and B". Additionally, in this specification, the expressions "at least one of A or B" or "at least one of A and / or B" may be interpreted identically to "at least one of A and B".
[0052] Additionally, in this specification, “at least one of A, B and C” can mean “only A,” “only B,” “only C,” or “any combination of A, B and C.” Additionally, “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.”
[0053] Additionally, parentheses used herein may mean "for example." Specifically, when "prediction (intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction." In other words, "prediction" in this specification is not limited to "intra-prediction," and "intra-prediction" may be suggested as an example of "prediction." Furthermore, even when "prediction (i.e., intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction."
[0054] Technical features individually described in a single drawing in this specification may be implemented individually or simultaneously.
[0055] The following drawings are intended to illustrate specific examples of the present specification. The names of specific devices and the names of specific signals / messages / fields depicted in the drawings are provided for illustrative purposes only, and the technical features of this specification are not limited to the specific names used in the drawings.
[0056] Figure 2 is a drawing schematically illustrating the configuration of a video / image encoding device to which embodiments of this document may be applied. The term "video encoding device" hereinafter may include an image encoding device.
[0057] Referring to FIG. 2, the encoding device (200) may be configured to include an image partitioner (210), a prediction unit (predictor) 220, a residual processor (residual processor) 230, an entropy encoder (entropy encoder) 240, an adder (adder) 250, a filter (filter) 260, and a memory (memory) 270. The prediction unit (220) may include an inter prediction unit (221) and an intra prediction unit (222). The residual processor (230) may include a transformer (transformer) 232, a quantizer (quantizer) 233, a dequantizer (dequantizer) 234, and an inverse transformer (inverse transformer) 235. The residual processing unit (230) may further include a subtractor (231). The addition unit (250) may be called a reconstructor or a recontructed block generator. The image segmentation unit (210), the prediction unit (220), the residual processing unit (230), the entropy encoding unit (240), the addition unit (250), and the filtering unit (260) described above may be configured by one or more hardware components (e.g., an encoder chipset or a processor) according to an embodiment. In addition, the memory (270) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (270) as an internal / external component.
[0058] The image segmentation unit (210) can segment an input image (or picture, frame) input to the encoding device (200) into one or more processing units. For example, the processing unit may be called a coding unit (CU). In this case, the coding unit may be recursively segmented from a coding tree unit (CTU) or a largest coding unit (LCU) according to a QTBTTT (Quad-tree binary-tree ternary-tree) structure. For example, one coding unit may be segmented into a plurality of coding units of deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure and / or the ternary structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present document may be performed based on the final coding unit that is no longer segmented. In this case, based on coding efficiency according to image characteristics, etc., the maximum coding unit can be used as the final coding unit, or, if necessary, the coding unit can be recursively divided into coding units of lower depths, and the coding unit of the optimal size can be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration described below. As another example, the processing unit may further include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may each be divided or partitioned from the final coding unit described above.The above prediction unit may be a unit of sample prediction, and the above transformation unit may be a unit for deriving a transformation coefficient and / or a unit for deriving a residual signal from a transformation coefficient.
[0059] The term "unit" may be used interchangeably with terms such as "block" or "area" depending on the case. In general, an MxN block can represent a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chroma component. A sample can be used as a term corresponding to a pixel or pel in a picture (or image).
[0060] The encoding device (200) can generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from an inter prediction unit (221) or an intra prediction unit (222) from an input video signal (original block, original sample array), and the generated residual signal is transmitted to a conversion unit (232). In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input video signal (original block, original sample array) within the encoder (200) may be called a subtraction unit (231). The prediction unit can perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including prediction samples for the current block. The prediction unit can determine whether intra prediction or inter prediction is applied on a current block or CU basis. The prediction unit can generate various information regarding prediction, such as prediction mode information, as described later in the description of each prediction mode, and transmit the information to the entropy encoding unit (240). The information regarding prediction can be encoded in the entropy encoding unit (240) and output in the form of a bitstream.
[0061] The intra prediction unit (222) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of detail in the prediction direction. However, this is merely an example, and a greater or lesser number of directional prediction modes may be used depending on the settings. The intra prediction unit (222) may also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.
[0062] The inter prediction unit (221) can derive a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring block can include a spatial neighboring block existing in the current picture and a temporal neighboring block existing 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 above temporal neighboring blocks may be called collocated reference blocks, collocated CUs (colCUs), etc., and the reference pictures including the temporal neighboring blocks may be called collocated pictures (colPic). For example, the inter prediction unit (221) may construct a motion information candidate list based on the neighboring blocks, and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of skip mode and merge mode, the inter prediction unit (221) may use the motion information of the neighboring blocks as the motion information of the current block. In the case of skip mode, unlike the merge mode, a residual signal may not be transmitted.In the motion vector prediction (MVP) mode, the motion vector of the surrounding blocks is used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.
[0063] The prediction unit (220) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP). In addition, the prediction unit can 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 can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described in this document. Palette mode can be viewed as an example of intra coding or intra prediction. When palette mode is applied, sample values within a picture can be signaled based on information about the palette table and palette index.
[0064] The prediction signal generated through the above prediction unit (including the inter prediction unit (221) and / or the intra prediction unit (222)) can be used to generate a restored signal or a residual signal. The transform unit (232) can apply a transform technique to the residual signal to generate transform coefficients. For example, the transform technique can include at least one of a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), a Karhunen-Loeve Transform (KLT), a Graph-Based Transform (GBT), or a Conditionally Non-linear Transform (CNT). Here, GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on a prediction signal generated by using all previously reconstructed pixels. Additionally, the transformation process can be applied to blocks of pixels having equal square sizes, or to blocks of variable sizes that are not square.
[0065] The quantization unit (233) quantizes the transform coefficients and transmits them to the entropy encoding unit (240), and the entropy encoding unit (240) can encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. The information about the quantized transform coefficients may be called residual information. The quantization unit (233) can rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and can also generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit (240) can perform various encoding methods, such as, for example, exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit (240) may encode, together or separately, information necessary for video / image restoration (e.g., values of syntax elements, etc.) in addition to the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in units of NAL (network abstraction layer) units. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image 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 / image information. The video / image information may be encoded through the above-described encoding procedure and included in the bitstream.The above bitstream may be transmitted through 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 USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The signal output from the entropy encoding unit (240) may be configured as an internal / external element of the encoding device (200) by a transmitting unit (not shown) and / or a storing unit (not shown), or the transmitting unit may be included in the entropy encoding unit (240).
[0066] The quantized transform coefficients output from the quantization unit (233) can be used to generate a prediction signal. For example, by applying inverse quantization and inverse transformation to the quantized transform coefficients through the inverse quantization unit (234) and the inverse transform unit (235), a residual signal (residual block or residual samples) can be reconstructed. The addition unit (250) can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit (221) or the intra prediction unit (222). When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as a reconstructed block. The addition unit (250) may be called a reconstructor or a reconstructed block generation unit. The generated restoration signal can be used for intra prediction of the next processing target block within the current picture, and can also be used for inter prediction of the next picture after filtering as described below.
[0067] Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture encoding and / or restoration process.
[0068] The filtering unit (260) can improve subjective / objective picture quality by applying filtering to the restoration signal. For example, the filtering unit (260) can apply various filtering methods to the restoration picture to generate a modified restoration picture, and store the modified restoration 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, adaptive loop filter, bilateral filter, etc. The filtering unit (260) can generate various information regarding filtering and transmit the information to the entropy encoding unit (240), as described later in the description of each filtering method. The information regarding filtering may be encoded by the entropy encoding unit (240) and output in the form of a bitstream.
[0069] The modified restored picture transmitted to the memory (270) can be used as a reference picture in the inter prediction unit (221). Through this, when inter prediction is applied, the encoding device can avoid prediction mismatch in the encoding device (200) and the decoding device (300), and can also improve encoding efficiency.
[0070] The memory (270) DPB can store the modified restored picture to be used as a reference picture in the inter prediction unit (221). The memory (270) can store motion information of a block from which motion information is derived (or encoded) within the current picture and / or motion information of blocks within a picture that has already been restored. The stored motion information can be transferred 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) can store restored samples of restored blocks within the current picture and transfer them to the intra prediction unit (222).
[0071] FIG. 3 is a drawing schematically illustrating the configuration of a video / image decoding device to which embodiments of this document can be applied.
[0072] Referring to FIG. 3, the decoding device (300) may be configured to include an entropy decoder (310), a residual processor (320), a predictor (330), an adder (340), a filter (350), and a memory (360). The predictor (330) may include an inter-prediction unit (331) and an intra-prediction unit (332). The residual processor (320) may include a dequantizer (321) and an inverse transformer (322). The entropy decoding unit (310), residual processing unit (320), prediction unit (330), addition unit (340), and filtering unit (350) described above may be configured by a single hardware component (e.g., decoder chipset or processor) depending on the embodiment. In addition, the memory (360) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (360) as an internal / external component.
[0073] When a bitstream including video / image information is input, the decoding device (300) can restore the image corresponding to the process in which the video / image information is processed in the encoding device of FIG. 2. For example, the decoding device (300) can derive units / blocks based on block division-related information obtained from the bitstream. The decoding device (300) can perform decoding using a processing unit applied in the encoding device. Therefore, the processing unit of decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximum coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. Then, the restored image signal decoded and output through the decoding device (300) can be reproduced through a reproduction device.
[0074] The decoding device (300) can receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal can be decoded through the entropy decoding unit (310). For example, the entropy decoding unit (310) can parse the bitstream to derive information (e.g., video / image information) necessary 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 device can decode the picture further based on the information on the parameter set and / or the general constraint information. The signaling / received information and / or syntax elements described later in this document can be decoded and obtained from the bitstream through the decoding procedure. For example, the entropy decoding unit (310) can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values of syntax elements required for image restoration and the quantized values of transform coefficients for residuals. More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in the bitstream, determines a context model using information of a syntax element to be decoded and decoding information of surrounding and decoding target blocks or information of symbols / bins decoded in the previous step, and predicts the occurrence probability of a bin according to the determined context model to perform arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element.At this time, the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Information regarding prediction among the information decoded by the entropy decoding unit (310) is provided to the prediction unit (inter prediction unit (332) and intra prediction unit (331)), and residual values on which entropy decoding is performed by the entropy decoding unit (310), i.e., quantized transform coefficients and related parameter information, can be input to the residual processing unit (320). The residual processing unit (320) can derive a residual signal (residual block, residual samples, residual sample array). In addition, information regarding filtering among the information decoded by the entropy decoding unit (310) can be provided to the filtering unit (350). Meanwhile, a receiving unit (not shown) that receives a signal output from an encoding device may be further configured as an internal / external element of the decoding device (300), or the receiving unit may be a component of an entropy decoding unit (310). Meanwhile, the decoding device according to the present document may be called a video / video / picture decoding device, and the decoding device may be divided into an information decoder (video / video / picture information decoder) and a sample decoder (video / video / 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 transformation unit (322), the addition unit (340), the filtering unit (350), the memory (360), the inter prediction unit (332), and the intra prediction unit (331).
[0075] The inverse quantization unit (321) can inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit (321) can rearrange the quantized transform coefficients into a two-dimensional block form. In this case, the rearrangement can be performed based on the coefficient scanning order performed in the encoding device. The inverse quantization unit (321) can perform inverse quantization on the quantized transform coefficients using quantization parameters (e.g., quantization step size information) and obtain transform coefficients.
[0076] In the inverse transform unit (322), the transform coefficients are inversely transformed to obtain a residual signal (residual block, residual sample array).
[0077] The prediction unit can perform a prediction on the current block and generate a predicted block containing prediction samples for the current block. Based on the information regarding the prediction output from the entropy decoding unit (310), the prediction unit can determine whether intra-prediction or inter-prediction is applied to the current block, and can determine a specific intra / inter-prediction mode.
[0078] The prediction unit (320) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP). In addition, the prediction unit can 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 can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described in this document. Palette mode can be viewed as an example of intra coding or intra prediction. When palette mode is applied, information about the palette table and palette index may be signaled and included in the video / image information.
[0079] The intra prediction unit (331) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it, depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple directional modes. The intra prediction unit (331) can also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.
[0080] The inter prediction unit (332) can derive a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter prediction unit (332) can construct a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter prediction can be performed based on various prediction modes, and the information about the prediction can include information indicating the mode of inter prediction for the current block.
[0081] The addition unit (340) can generate a restoration signal (restored picture, restoration block, restoration sample array) by adding the acquired residual signal to the prediction signal (predicted block, prediction sample array) output from the prediction unit (including the inter-prediction unit (332) and / or intra-prediction unit (331)). When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as the restoration block.
[0082] The addition unit (340) may be referred to as a restoration unit or restoration block generation unit. The generated restoration signal may be used for intra prediction of the next processing target block within the current picture, may be output after filtering as described below, or may be used for inter prediction of the next picture.
[0083] Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture decoding process.
[0084] The filtering unit (350) can improve subjective / objective image quality by applying filtering to the restored signal. For example, the filtering unit (350) can apply various filtering methods to the restored picture to generate a modified restored picture, and transmit the modified restored picture to the memory (360), specifically, to the DPB of the memory (360). The various filtering methods can include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.
[0085] The (modified) reconstructed picture stored in the DPB of the memory (360) can be used as a reference picture in the inter prediction unit (332). The memory (360) can store motion information of a block from which motion information is derived (or decoded) within the current picture and / or motion information of blocks within a picture that has already been reconstructed. The stored motion information can be transferred 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) can store reconstructed samples of reconstructed blocks within the current picture and transfer them to the intra prediction unit (331).
[0086] In this specification, the embodiments described in the filtering unit (260), the inter prediction unit (221), and the intra prediction unit (222) of the encoding device (200) can be applied to the filtering unit (350), the inter prediction unit (332), and the intra prediction unit (331) of the decoding device (300) in the same or corresponding manner, respectively.
[0087] In this document, at least one of quantization / dequantization and / or transformation / inverse transformation may be omitted. If the quantization / dequantization is omitted, the quantized transform coefficient may be called a transform coefficient. If the transformation / inverse transformation is omitted, the transform coefficient may be called a coefficient or a residual coefficient, or may still be called a transform coefficient for the sake of consistency of expression.
[0088] In this document, the quantized transform coefficients and 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 coefficient(s), and the information about the transform coefficient(s) may be signaled via residual coding syntax. Transform coefficients may be derived based on the residual information (or information about the transform coefficient(s)), and scaled transform coefficients may be derived through inverse transformation (scaling) of the transform coefficients. Residual samples may be derived based on inverse transformation (transformation) of the scaled transform coefficients. This may be similarly applied / expressed in other parts of this document.
[0089] As described above, prediction is performed to increase compression efficiency when performing video coding. Through this, a predicted block including prediction samples for a current block, which is a coding target block, can be generated. Here, the predicted block includes prediction samples in a spatial domain (or pixel domain). The predicted block is derived identically from an encoding device and a decoding device, and the encoding device can increase video coding efficiency by signaling information (residual information) about the residual between the original block and the predicted block, rather than the original sample value of the original block itself, to a decoding device. The decoding device can derive a residual block including residual samples based on the residual information, and generate a reconstructed block including reconstructed samples by combining the residual block and the predicted block, and can generate a reconstructed picture including the reconstructed blocks.
[0090] The residual information may be generated through a transformation and quantization procedure. For example, the encoding device may derive a residual block between the original block and the predicted block, perform a transformation procedure on residual samples (a 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, thereby signaling the related residual information to a decoding device (via a bitstream). Here, the residual information may include information such as value information, position information, a transformation technique, a transformation kernel, and quantization parameters of the quantized transform coefficients. The decoding device may perform an inverse quantization / inverse transformation procedure based on the residual information to derive residual samples (or residual blocks). The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device can also inversely quantize / inversely transform the quantized transform coefficients to derive a residual block for reference in inter prediction of a subsequent picture, and generate a restored picture based on the residual block.
[0091] Intra prediction may refer to a prediction that generates prediction samples for a current block based on reference samples within a picture to which the current block belongs (hereinafter, referred to as the current picture). When intra prediction is applied to a current block, peripheral reference samples to be used for intra prediction of the current block may be derived. The peripheral reference samples of the current block may include a total of 2 x nH samples adjacent to a left boundary and a bottom-left neighboring sample of a current block of a size nW x nH, a total of 2 x nW samples adjacent to a top boundary and a top-right neighboring sample of the current block, and one sample adjacent to the top-left neighboring sample of the current block. Alternatively, the peripheral reference samples of the current block may include upper peripheral samples of multiple columns and left peripheral samples of multiple rows. Additionally, the surrounding reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.
[0092] However, some of the surrounding reference samples of the current block may not yet be decoded or available. In this case, the decoder can construct the surrounding reference samples to be used for prediction by substituting the unavailable samples with available samples. Alternatively, the decoder can construct the surrounding reference samples to be used for prediction by interpolating the available samples.
[0093] When neighboring reference samples are derived, (i) a prediction sample can be derived based on an average or interpolation of neighboring reference samples of the current block, and (ii) the prediction sample can be derived based on a reference sample existing in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. The case of (i) can be called a non-directional mode or a non-angular mode, and the case of (ii) can be called a directional mode or an angular mode.
[0094] In addition, the prediction sample may be generated through interpolation between a first surrounding sample located in the prediction direction of the intra prediction mode of the current block and a second surrounding sample located in the opposite direction of the prediction direction based on the prediction sample of the current block among the surrounding reference samples. The above-described case may be called linear interpolation intra prediction (LIP). In addition, chroma prediction samples may be generated based on luma samples using a linear model (LM). This case may be called LM mode or CCLM (chroma component LM) mode.
[0095] In addition, a temporary prediction sample of the current block may be derived based on filtered peripheral reference samples, and a prediction sample of the current block may be derived by weighting at least one reference sample derived according to the intra prediction mode among the existing peripheral reference samples, i.e., unfiltered peripheral reference samples, with the temporary prediction sample. The above-described case may be referred to as PDPC (Position dependent intra prediction).
[0096] In addition, intra prediction encoding can be performed by selecting a reference sample line with the highest prediction accuracy among the surrounding multiple reference sample lines of the current block, deriving a prediction sample using the reference sample located in the prediction direction in the corresponding line, and then instructing (signaling) the used reference sample line to a decoding device. The above-described case may be called multi-reference line intra prediction or MRL-based intra prediction.
[0097] In addition, the current block can be divided into vertical or horizontal subpartitions, and intra prediction can be performed based on the same intra prediction mode, while peripheral reference samples can be derived and utilized for each subpartition. That is, in this case, the intra prediction mode for the current block is applied equally to the subpartitions, and peripheral reference samples can be derived and utilized for each subpartition, thereby improving intra prediction performance in some cases. This prediction method can be called intra subpartitions (ISP)-based intra prediction.
[0098] The intra prediction methods described above may be referred to as intra prediction types, distinguished from intra prediction modes. The intra prediction types may be referred to by various terms, such as intra prediction techniques or additional intra prediction modes. For example, the intra prediction types (or additional intra prediction modes, etc.) may include at least one of the above-described LIP, PDPC, MRL, and ISP. A general intra prediction method excluding specific intra prediction types such as the above-described LIP, PDPC, MRL, and ISP may be referred to as a normal intra prediction type. The normal intra prediction type may be generally applied when the above-described specific intra prediction types are not applied, and prediction may be performed based on the above-described intra prediction modes. Meanwhile, post-processing filtering may be performed on the derived prediction samples, if necessary.
[0099] Specifically, the intra prediction procedure may include an intra prediction mode / type determination step, a surrounding reference sample derivation step, and an intra prediction mode / type-based prediction sample derivation step. Additionally, a post-processing filtering step may be performed on the derived prediction samples, if necessary.
[0100] Figure 4 shows an example of an intra prediction based video / image encoding method.
[0101] Referring to FIG. 4, an encoding device performs intra prediction on a current block (S400). The encoding device performs intra prediction on the current block (S400). The encoding device can derive an intra prediction mode / type for the current block, derive surrounding reference samples of the current block, and generate prediction samples within the current block based on the intra prediction mode / type and the surrounding reference samples. Here, the intra prediction mode / type determination, surrounding reference sample derivation, and prediction sample generation procedures may be performed simultaneously, or one procedure may be performed before the other. The encoding device can determine a mode / type to be applied to the current block among a plurality of intra prediction modes / types. The encoding device can compare RD costs for the intra prediction modes / types and determine an optimal intra prediction mode / type for the current block.
[0102] Meanwhile, the encoding device may also perform a predictive sample filtering procedure. Predictive sample filtering may be referred to as post-filtering. Some or all of the predictive samples may be filtered through the predictive sample filtering procedure. In some cases, the predictive sample filtering procedure may be omitted.
[0103] The encoding device generates residual samples for the current block based on (filtered) prediction samples (S410). The encoding device can compare the prediction samples with the original samples of the current block based on phase and derive the residual samples.
[0104] The encoding device can encode image information including information about the intra prediction (prediction information) and residual information about the residual samples (S420). The prediction information can include intra prediction mode information and intra prediction type information. The encoding device can output the encoded image information in the form of a bitstream. The output bitstream can be transmitted to a decoding device via a storage medium or a network.
[0105] The residual information may include the residual coding syntax described below. The encoding device may transform / quantize the residual samples to derive quantized transform coefficients. The residual information may include information about the quantized transform coefficients.
[0106] Meanwhile, as described above, the encoding device can generate a restored picture (including restored samples and restored blocks). To this end, the encoding device can dequantize / inversely transform the quantized transform coefficients again to derive (corrected) residual samples. The reason for performing dequantization / inversely transforming the residual samples after transforming / quantizing them in this way is to derive residual samples that are identical to the residual samples derived from the decoding device as described above. The encoding device can generate a restored block including restored samples for the current block based on the predicted samples and the (corrected) residual samples. A restored picture for the current picture can be generated based on the restored block. As described above, an in-loop filtering procedure, etc. can be further applied to the restored picture.
[0107] Figure 5 shows an example of an intra prediction based video / image decoding method.
[0108] The decoding device can perform an operation corresponding to the operation performed by the encoding device.
[0109] Prediction information and residual information can be obtained from the bitstream. Based on the residual information, residual samples for the current block can be derived. Specifically, based on the quantized transform coefficients derived based on the residual information, inverse quantization can be performed to derive transform coefficients, and inverse transformation can be performed on the transform coefficients to derive residual samples for the current block.
[0110] Specifically, the decoding device can derive an intra prediction mode / type for the current block based on the received prediction information (intra prediction mode / type information) (S500). The decoding device can derive surrounding reference samples of the current block (S510). The decoding device generates prediction samples within the current block based on the intra prediction mode / type and the surrounding reference samples (S520). In this case, the decoding device can perform a prediction sample filtering procedure. 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.
[0111] The decoding device generates residual samples for the current block based on the received residual information (S530). The decoding device can generate reconstructed samples for the current block based on the predicted samples and the residual samples, and derive a reconstructed block including the reconstructed samples (S540). A reconstructed picture for the current picture can be generated based on the reconstructed block. As described above, an in-loop filtering procedure, etc. can be further applied to the reconstructed picture.
[0112] The intra prediction mode information may include flag information (e.g., intra_luma_mpm_flag) indicating, for example, whether the most probable mode (MPM) or the remaining mode is applied to the current block, and when 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. In addition, when 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 device may determine the intra prediction mode of the current block based on the intra prediction mode information.
[0113] In addition, the intra prediction type information can be implemented in various forms. For example, the intra prediction type information can include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information can 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 split type of subpartitions if the ISP is applied, flag information indicating whether PDCP is applied, or flag information indicating whether LIP is applied. In addition, the intra prediction type information can include a MIP flag indicating whether MIP (matrix-based intra prediction) is applied to the current block.
[0114] The intra prediction mode information and / or the intra prediction type information may be encoded / decoded using the coding method described in this document. For example, the intra prediction mode information and / or the intra prediction type information may be encoded / decoded using entropy coding (e.g., CABAC, CAVLC) coding.
[0115] Figure 6 illustrates an intra prediction procedure as an example.
[0116] Referring to FIG. 6, the intra prediction procedure as described above may include an intra prediction mode / type determination step, a surrounding reference sample derivation step, and an intra prediction performance (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.
[0117] Referring to FIG. 6, the coding device determines the intra prediction mode / type (S600).
[0118] An encoding device can determine an intra prediction mode / type to be applied to the current block from among the various intra prediction modes / types described above, and can generate prediction-related information. The prediction-related information can include intra prediction mode information indicating an intra prediction mode applied to the current block and / or intra prediction type information indicating an intra prediction type applied to the current block. A decoding device can determine an intra prediction mode / type to be applied to the current block based on the prediction-related information.
[0119] The intra prediction mode information may include flag information (e.g., intra_luma_mpm_flag) indicating, for example, whether the most probable mode (MPM) or the remaining mode is applied to the current block, and when 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. In addition, when 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 device may determine the intra prediction mode of the current block based on the intra prediction mode information.
[0120] In addition, the intra prediction type information can be implemented in various forms. For example, the intra prediction type information can include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information can 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 split type of subpartitions if the ISP is applied, flag information indicating whether PDCP is applied, or flag information indicating whether LIP is applied. In addition, the intra prediction type information can include a MIP flag indicating whether MIP (matrix-based intra prediction) is applied to the current block.
[0121] For example, when intra prediction is applied, the intra prediction mode to be applied to the current block can be determined using the intra prediction mode of the surrounding block. For example, the coding device can select one of the MPM candidates in the MPM (most probable mode) list derived based on the intra prediction modes of the surrounding blocks of the current block (e.g., left and / or upper surrounding blocks) and / or additional candidate modes, based on the received MPM index, or can select one of the remaining intra prediction modes not included in the MPM candidates (and planar modes) based on MPM rememberer information (remaining intra prediction mode information). The MPM list can be configured to include or not include a planar mode as a candidate. For example, when the MPM list includes a planar mode as a candidate, the MPM list can have six candidates, and when the MPM list does not include a planar mode as a candidate, the MPM list can have five candidates. If the above MPM list does not include a planar mode as a candidate, a not planar flag (e.g., intra_luma_not_planar_flag) indicating whether the intra prediction mode of the current block is not a planar mode may be signaled. For example, the MPM flag may be signaled first, and the MPM index and the not planar flag may be signaled if the value of the MPM flag is 1. In addition, the MPM index may be signaled if the value of the not planar flag is 1. Here, the reason why the above MPM list is configured not to include a planar mode as a candidate is not because the planar mode is not MPM m, but rather to first check whether it is a planar mode by signaling a flag (not planar flag) since the planar mode is always considered as an MPM.
[0122] 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 can be indicated based on the MPM flag (e.g., intra_luma_mpm_flag). A value of 1 of the MPM flag can 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 can 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) can indicate that the intra prediction mode for the current block is the planar mode, and a value of 1 of the not planar flag can indicate that the intra prediction mode for the current block is not the planar mode. The above MPM index may be signaled in the form of a 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 point to one of the remaining intra prediction modes that are not included in the MPM candidates (and planar modes) among all intra prediction modes by indexing them in the 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 the MPM flag (e.g., intra_luma_mpm_flag), the not planar flag (e.g., intra_luma_not_planar_flag), and the MPM index (e.g.,The remaining intra prediction mode information (rem_intra_luma_pred_mode or intra_luma_mpm_remainder) may include at least one of the following: mpm_idx or intra_luma_mpm_idx). In this document, the MPM list may be referred to by various terms such as MPM candidate list, candModeList, etc.
[0123] 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), and remaining intra prediction mode information (e.g. intra_mip_mpm_remainder) may be signaled, and the not planar flag may not be signaled.
[0124] In other words, when an image is typically segmented into blocks, the current block to be coded and the neighboring blocks tend to have similar image characteristics. Therefore, the current block and neighboring blocks are likely to have identical or similar intra-prediction modes. Therefore, the encoder can utilize the intra-prediction modes of the neighboring blocks to encode the intra-prediction mode of the current block.
[0125] The coding device can construct a list of most probable modes (MPMs) for the current block. The MPM list may also be referred to as an MPM candidate list. Here, the MPM may refer to a mode used to improve coding efficiency by considering the similarity between the current block and surrounding blocks during intra prediction mode coding. As described above, the MPM list may be constructed including a planar mode, or may be constructed excluding a planar mode. For example, if the MPM list includes a planar mode, the number of candidates in the MPM list may be six. In addition, if the MPM list does not include a planar mode, the number of candidates in the MPM list may be five.
[0126] An encoding device can perform prediction based on various intra prediction modes, and determine an optimal intra prediction mode based on rate-distortion optimization (RDO) based on the prediction. In this case, the encoding device may determine the optimal intra prediction mode using only the MPM candidates and the planar mode configured in the MPM list, or may determine the optimal intra prediction mode using not only the MPM candidates and the planar mode configured in the MPM list but also the remaining intra prediction modes. Specifically, for example, if the intra prediction type of the current block is not a normal intra prediction type but a specific type (e.g., LIP, MRL, or ISP), the encoding device may determine the optimal intra prediction mode by considering only the MPM candidates and the 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 among the MPM candidates and the planar mode, and in this case, the mpm flag may not be encoded / signaled. The decoding device can assume that the mpm flag is 1 in this case without being separately signaled the mpm flag.
[0127] Meanwhile, in general, if the intra prediction mode of the current block is not a planar mode but one of the MPM candidates in the MPM list, the encoding device generates an mpm index (mpm idx) pointing to one of the MPM candidates. If the intra prediction mode of the current block is not in the MPM list either, the encoding device generates MPM reminder information (remaining intra prediction mode information) pointing to a mode that is the same as the intra prediction mode of the current block among the remaining intra prediction modes that are not included in the MPM list (and the planar mode). The MPM reminder information may include, for example, an intra_luma_mpm_remainder syntax element.
[0128] A decoding device obtains 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 reminder information (remaining intra prediction mode information) as described above. The decoding device may configure an MPM list. The MPM list is configured in the same manner as the MPM list configured in the encoding device. That is, the MPM list may include intra prediction modes of neighboring blocks, and may further include specific intra prediction modes according to a predetermined method.
[0129] The decoding device may determine the intra prediction mode of the current block based on the MPM list and the intra prediction mode information. For example, when the value of the MPM flag is 1, the decoding device may derive a planar mode as the intra prediction mode of the current block (based on the not planar flag) or 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 candidates may refer to only candidates included in the MPM list, or may include not only candidates included in the MPM list but also a planar mode that can be applied when the value of the MPM flag is 1.
[0130] As another example, when the value of the MPM flag is 0, the decoding device can derive an 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 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 can also derive a candidate indicated by the MPM flag in the planar mode or the MPM list as the intra prediction mode of the current block without parsing / decoding / verifying the MPM flag.
[0131] The coding device derives peripheral reference samples of the current block (S610). When intra prediction is applied to the current block, peripheral reference samples to be used for intra prediction of the current block can be derived. The peripheral reference samples of the current block may include a total of 2 x nH samples adjacent to the left boundary and bottom-left neighbors of the current block of a size nW x nH, a total of 2 x nW samples adjacent to the top boundary and top-right neighbors of the current block, and one sample adjacent to the top-left neighbor of the current block. Alternatively, the peripheral reference samples of the current block may include upper peripheral samples of multiple columns and left peripheral samples of multiple rows. Additionally, the surrounding reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.
[0132] Meanwhile, when MRL is applied (i.e., when the value of the MRL index is greater than 0), the peripheral reference samples may be located on lines 1 or 2, not line 0 adjacent to the current block on the left / upper side, and in this case, the number of peripheral reference samples may increase further. Meanwhile, when ISP is applied, the peripheral reference samples may be derived in units of subpartitions.
[0133] The coding device performs intra prediction on the current block to derive prediction samples (S620). The coding device can derive the prediction samples based on the intra prediction mode / type and the surrounding samples. The coding device can derive a reference sample according to the intra prediction mode of the current block among the surrounding reference samples of the current block, and can derive a prediction sample of the current block based on the reference sample.
[0134] Meanwhile, when inter prediction is applied, the prediction unit of the encoding device / decoding device can perform inter prediction on a block-by-block basis to derive prediction samples. Inter prediction can be a prediction derived in a manner that is dependent on data elements (e.g., sample values or motion information) of picture(s) other than the current picture. When inter prediction is applied to the current block, a predicted block (prediction sample array) for the current block can be derived based on a reference block (reference sample array) specified by a motion vector on a reference picture pointed to by a reference picture index. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information of the current block can be predicted on a block, sub-block, or sample basis based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include information on the inter prediction type (L0 prediction, L1 prediction, Bi prediction, etc.). When inter prediction is applied, the neighboring blocks may include spatial neighboring blocks existing within the current picture and temporal neighboring blocks existing in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring blocks may be the same or different.The temporal neighboring blocks may be called collocated reference blocks, collocated CUs (colCUs), etc., and a reference picture including the temporal neighboring blocks may be called a collocated picture (colPic). For example, a motion information candidate list may be constructed based on neighboring 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, and for example, in the case of 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 the case of skip mode, unlike the merge mode, a residual signal may not be transmitted. In the case of motion vector prediction (MVP) mode, the motion vector of the selected neighboring block is used as a motion vector predictor, and the motion vector difference may be signaled. In this case, the motion vector of the current block can be derived using the sum of the motion vector predictor and the motion vector difference.
[0135] The above motion information may include L0 motion information and / or L1 motion information depending on the inter prediction type (L0 prediction, L1 prediction, Bi prediction, etc.). A motion vector in the L0 direction may be called an L0 motion vector or MVL0, and a motion vector in the L1 direction may be called an L1 motion vector or MVL1. Prediction based on an L0 motion vector may be called an L0 prediction, prediction based on an L1 motion vector may be called an L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be called a bi-prediction (Bi). Here, an L0 motion vector may represent a motion vector associated with a reference picture list L0 (L0), and an L1 motion vector may represent a motion vector associated with a reference picture list L1 (L1). The reference picture list L0 may include pictures preceding the current picture in output order as reference pictures, and the reference picture list L1 may include pictures succeeding the current picture in output order. The preceding pictures may be called forward (reference) pictures, and the succeeding pictures may be called backward (reference) pictures. The reference picture list L0 may further include pictures succeeding the current picture in output order as reference pictures. In this case, the preceding pictures may be indexed first and the succeeding pictures may be indexed next within the reference picture list L0. The reference picture list L1 may further include pictures preceding the current picture in output order as reference pictures. In this case, the succeeding pictures may be indexed first and the succeeding pictures may be indexed next within the reference picture list 1. Here, the output order may correspond to a POC (picture order count) order.
[0136] A video / image encoding procedure based on inter prediction may roughly include, for example:
[0137] Figure 7 shows an example of an inter prediction based video / image encoding method.
[0138] The encoding device performs inter prediction on the current block (S700). The encoding device can derive the inter prediction mode and motion information of the current block, and generate prediction samples 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 before the other. For example, the inter prediction unit of the encoding device 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 the 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 prediction samples of the current block. For example, the inter prediction unit of the encoding device may search for a block similar to the current block within a certain area (search area) of reference pictures through motion estimation, and derive a reference block whose difference from the current block is minimal or below a certain standard. Based on this, a reference picture index indicating a reference picture where the reference block is located can be derived, and a motion vector can be derived based on the positional difference between the reference block and the current block. The encoding device can determine a mode to be applied to the current block among various prediction modes. The encoding device can compare RD costs for the various prediction modes and determine an optimal prediction mode for the current block.
[0139] For example, when the skip mode or merge mode is applied to the current block, the encoding device may configure a merge candidate list described below, and derive a reference block among the reference blocks indicated by the merge candidates included in the merge candidate list, the difference between the current block and the current block being at least or below a certain standard. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to a decoding device. Motion information of the current block may be derived using motion information of the selected merge candidate.
[0140] As another example, when the (A)MVP mode is applied to the current block, the encoding device may configure an (A)MVP candidate list described below, and use the motion vector of an mvp candidate selected from among 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-described 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 about the MVD may be signaled to the decoding device. In addition, when the (A)MVP mode is applied, the value of the reference picture index may be configured as reference picture index information and signaled separately to the decoding device.
[0141] The encoding device can derive residual samples based on the above predicted samples (S710). The encoding device can derive the residual samples by comparing the original samples of the current block with the predicted samples.
[0142] An encoding device encodes image information including prediction information and residual information (S720). The encoding device can output the encoded image information in the form of a bitstream. The prediction information may include information related to the prediction procedure, such as prediction mode information (e.g., skip flag, merge flag, or mode index) and information about motion information. The information about the motion information may include candidate selection information (e.g., merge index, mvp flag, or mvp index), which is information for deriving a motion vector. In addition, the information about the motion information may include information about the above-described MVD and / or reference picture index information. In addition, the information about the motion information may include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information about the residual samples. The residual information may include information about quantized transform coefficients for the residual samples.
[0143] The output bitstream can be stored on a (digital) storage medium and transmitted to a decoding device, or can be transmitted to a decoding device via a network.
[0144] Meanwhile, as described above, the encoding device can generate a reconstructed picture (including reconstructed samples and reconstructed blocks) based on the reference samples and the residual samples. This is to derive the same prediction result as that performed by the decoding device from the encoding device, thereby improving coding efficiency. Accordingly, the encoding device can store the reconstructed picture (or reconstructed samples, reconstructed blocks) in memory and use it as a reference picture for inter prediction. As described above, an in-loop filtering procedure, etc. can be further applied to the reconstructed picture.
[0145] A video / image decoding procedure based on inter prediction may roughly include, for example:
[0146] Figure 8 shows an example of an inter prediction based video / image decoding method.
[0147] Referring to FIG. 8, the decoding device can perform an operation corresponding to the operation performed by the encoding device. The decoding device can perform a prediction on the current block based on the received prediction information and derive prediction samples.
[0148] Specifically, the decoding device can determine a prediction mode for the current block based on the received prediction information (S800). The decoding device can determine which inter-prediction mode is applied to the current block based on the prediction mode information within the prediction information.
[0149] For example, based on the merge flag, it can be determined whether the merge mode or the (A)MVP mode is applied to the current block. Alternatively, one of various inter prediction mode candidates can be selected based on the mode index. The inter prediction mode candidates can include skip mode, merge mode, and / or (A)MVP mode, or can include various inter prediction modes described below.
[0150] The decoding device derives motion information of the current block based on the determined inter prediction mode (S810). For example, when the skip mode or merge mode is applied to the current block, the decoding device may configure a merge candidate list described below and select one of the merge candidates included in the merge candidate list. The selection may be performed based on the above-described selection information (merge index). Motion information of the current block may be derived using motion information of the selected merge candidate. Motion information of the selected merge candidate may be used as motion information of the current block.
[0151] As another example, when the (A)MVP mode is applied to the current block, the decoding device may construct an (A)MVP candidate list described below, and use the motion vector of an MVP candidate selected from among the MVP (motion vector predictor) candidates included in the (A)MVP candidate list as the MVP of the current block. The selection may be performed based on the selection information (mvp flag or mvp index) described above. In this case, the MVD of the current block may be derived based on the information about the MVD, and the motion vector of the current block may be derived based on the MVP of the current block and the MVD. In addition, 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 within the reference picture list for the current block may be derived as a reference picture referenced for inter prediction of the current block.
[0152] Meanwhile, as described below, motion information of the current block can be derived without constructing a candidate list, in which case the motion information of the current block can be derived according to the procedure initiated in the prediction mode described below. In this case, constructing a candidate list as described above can be omitted.
[0153] The decoding device may generate prediction samples for the current block based on 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 prediction samples of the current block may be derived using samples of a reference block pointed to by the motion vector of the current block on the reference picture. In this case, as described below, a prediction sample filtering procedure may be further performed on all or part of the prediction samples of the current block, depending on the case.
[0154] 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 the prediction mode for the current block may be determined based on prediction mode information received from the prediction mode determination unit, the motion information derivation unit may derive motion information (such as a motion vector and / or a reference picture index) of the current block based on information about the received motion information, and the prediction sample derivation unit may derive prediction samples of the current block.
[0155] The decoding device generates residual samples for the current block based on the received residual information (S830). The decoding device generates reconstructed samples for the current block based on the predicted samples and the residual samples, and can generate a reconstructed picture based on these (S840). As described above, an in-loop filtering procedure, etc., may be further applied to the reconstructed picture.
[0156] Figure 9 illustrates an example of an inter prediction procedure.
[0157] Referring to FIG. 9, the inter prediction procedure described above may include an inter prediction mode determination step, a motion information derivation step according to the determined prediction mode, and a prediction performance (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, a coding device may include an encoding device and / or a decoding device.
[0158] Referring to FIG. 9, the coding device determines an inter prediction mode for a current block (S900). Various inter prediction modes may be used to predict the current block within a picture. For example, various modes may be used, such as merge mode, skip mode, MVP (motion vector prediction) mode, affine mode, sub-block merge mode, and MMVD (merge with MVD) mode. Decoder-side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, bi-prediction with CU-level weight (BCW), and bi-directional optical flow (BDOF) may be used as additional or alternative modes. Affine mode may be referred to as affine motion prediction mode. MVP mode may be referred to as advanced motion vector prediction (AMVP) mode. In this document, motion information candidates derived by some modes and / or some modes may be included as one of the motion information-related candidates 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 called an HMVP merge candidate.
[0159] Prediction mode information indicating the inter prediction mode of the current block may be signaled from the encoding device to the decoding device. The prediction mode information may be included in the bitstream and received by the decoding device. The prediction mode information may include index information indicating one of a plurality of candidate modes. Alternatively, the inter prediction mode may be indicated through 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 skip mode is applied, a merge flag may be signaled to indicate whether merge mode is applied if skip mode is not applied, and if merge mode is not applied, MVP mode may be indicated to be applied, or a flag for additional distinction may be further signaled. The affine mode may be signaled as an independent mode, or as a mode dependent on the merge mode or the MVP mode. For example, the affine mode may include an affine merge mode and an affine MVP mode.
[0160] The coding device derives motion information for the current block (S910). The motion information may be derived based on the inter prediction mode.
[0161] A coding device can perform inter prediction using motion information of the current block. The encoding device can derive optimal motion information for the current block through a motion estimation procedure. For example, the encoding device can search for similar reference blocks with high correlation within a predetermined search range within the reference picture using the original block within the original picture for the current block, in fractional pixel units, and thereby derive motion information. The similarity between blocks can be derived based on the difference in phase-based sample values. For example, the similarity between blocks can be calculated based on the SAD between the current block (or a template of the current block) and the reference block (or a template of the reference block). In this case, motion information can be derived based on the reference block with the smallest SAD within the search range. The derived motion information can be signaled to the decoding device in various ways based on the inter prediction mode.
[0162] The coding device performs inter prediction based on motion information for the current block (S920). The coding device can derive prediction sample(s) for the current block based on the motion information. The current block including the prediction samples may be referred to as a predicted block.
[0163] Meanwhile, as described above, the encoding device can perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. In addition, the decoding device can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients for residuals.
[0164] For example, the coding methods described above can be performed as described below.
[0165] Fig. 10 illustrates context-adaptive binary arithmetic coding (CABAC) for encoding syntax elements. For example, in the CABAC encoding process, if the input signal is a syntax element rather than a binary value, the encoding device can convert the input signal into a binary value by binarizing the value of the input signal. In addition, if the input signal is already a binary value (i.e., if the value of the input signal is a binary value), binarization may not be performed and may be bypassed. Here, each binary digit 0 or 1 that constitutes the binary value may be referred to as a bin. For example, if the binary string after binarization is 110, each of 1, 1, and 0 is referred to as one bin. The bin(s) for one syntax element may represent the value of the syntax element.
[0166] Thereafter, the binarized bins of the syntax element can be input to a regular encoding engine or a bypass encoding engine. The regular encoding engine of the encoding device can assign a context model that reflects a probability value for the bin and encode the bin based on the assigned context model. The regular encoding engine of the encoding device can update the context model for the bin after performing encoding for each bin. The bin encoded as described above can be expressed as a context-coded bin.
[0167] Meanwhile, when the binarized bins of the syntax element are input to the bypass encoding engine, they can be coded as follows. For example, the bypass encoding engine of the encoding device omits the procedure of estimating the 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 bins encoded as described above can be expressed as bypass bins.
[0168] Entropy decoding can be described as a process that performs the same process as the entropy encoding described above in reverse order.
[0169] For example, when a syntax element is decoded based on a context model, a decoding device can receive a bin corresponding to the syntax element through a bitstream, determine a context model using the syntax element and decoding information of a block to be decoded or a surrounding block or information of a symbol / bin decoded in a previous step, and predict an occurrence probability of the received bin according to the determined context model to perform arithmetic decoding of the bin to derive the value of the syntax element. Thereafter, a context model of a bin to be decoded next can be updated with the determined context model.
[0170] Additionally, for example, when a syntax element is bypass-decoded, the decoding device can receive a bin corresponding to the syntax element through the bitstream and decode the input bin by applying a uniform probability distribution. In this case, the decoding device can omit the procedure of deriving a context model of the syntax element and the procedure of updating the context model applied to the bin after decoding.
[0171] As described above, residual samples can be derived as quantized transform coefficients through a transform and quantization process. The quantized transform coefficients may also be referred to as transform coefficients. In this case, the transform coefficients within a block can be signaled in the form of residual information. The residual information may include residual coding syntax. That is, an encoding device can construct a residual coding syntax using residual information, encode it, and output it in the form of a bitstream, and a decoding device can decode the residual coding syntax from the bitstream to derive residual (quantized) transform coefficients. The residual coding syntax may include syntax elements that indicate, as described below, whether a transform has been applied to a corresponding block, the location of the last valid transform coefficient within the block, whether a valid transform coefficient exists within a subblock, the size / sign of the valid transform coefficient, etc.
[0172] For example, syntax elements related to residual data encoding / decoding can be represented as in the following table.
[0173]
[0174]
[0175]
[0176] transform_skip_flag indicates whether transform is skipped in 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 transform (and quantization) and residual coding procedures, CB and TB may be used interchangeably. For example, as described above, residual samples may be derived for CB, and (quantized) transform coefficients may be derived through transform and quantization of the residual samples, and information (e.g., syntax elements) that efficiently represent the positions, magnitudes, signs, etc. of the (quantized) transform coefficients may be generated and signaled through the residual coding procedure. The quantized transform coefficients may be simply referred to as transform coefficients. In general, if the CB is not larger than the maximum TB, the size of the CB can be the same as the size of the TB, in which case the target block to be transformed (and quantized) and residually coded can be called CB or TB. On the other hand, if the CB is larger than the maximum TB, the target block to be transformed (and quantized) and residually coded can be called TB. Hereinafter, the syntax elements related to residual coding are described as being signaled in units of transform blocks (TBs), but this is only an example, and as described above, the TBs can be used interchangeably with coding blocks (CBs).
[0177] Meanwhile, the syntax elements signaled after the conversion skip flag is signaled may be identical to the syntax elements disclosed in Table 2 and / or Table 3 described below, and a specific description of the syntax elements is as described below.
[0178]
[0179]
[0180]
[0181]
[0182]
[0183]
[0184]
[0185]
[0186]
[0187] According to the present embodiment, residual coding can be branched depending on the value of the syntax element transform_skip_flag of the transform skip flag as shown in Table 1. That is, different syntax elements can be used for residual coding based on the value of the transform skip flag (based on whether or not transform is skipped). The residual coding used when transform skip is not applied (i.e., when transform is applied) can be called regular residual coding (RRC), and the residual coding when transform skip is applied (i.e., when transform is not applied) can be called transform skip residual coding (TSRC). In addition, the regular residual coding may also be called general residual coding. In addition, the above regular residual coding may be called a regular residual coding syntax structure, and the above transform skip residual coding may be called a transform skip residual coding syntax structure. Table 2 may represent syntax elements of residual coding when the value of transform_skip_flag is 0, i.e., when transform is applied, and Table 3 may represent syntax elements of residual coding when the value of transform_skip_flag is 1, i.e., when transform is not applied.
[0188] Specifically, for example, a transform skip flag indicating whether to skip the transform of a transform block can be parsed, and it can be determined whether the transform skip flag is 1. When the value of the transform skip flag is 0, syntax elements for residual coefficients of the transform block 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 can be parsed, as shown in Table 2, and the residual coefficients can be derived based on the syntax elements. In this case, the syntax elements may be parsed sequentially, or the parsing order may be changed. Additionally, 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).
[0189] Referring to Table 2 described above, last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, last_sig_coeff_y_suffix, sb_coded_flag, sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, abs_remainder, coeff_sign_flag, and / or dec_abs_level can be encoded / decoded. Meanwhile, the sb_coded_flag can also be expressed as coded_sub_block_flag.
[0190] In one embodiment, the encoding device can encode (x, y) position information of the last non-zero transform coefficient within a transform block based on the syntax elements last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. More specifically, the last_sig_coeff_x_prefix represents a prefix of a column position of a last significant coefficient in a scanning order within a transform block, the last_sig_coeff_y_prefix represents a prefix of a row position of a last significant coefficient in the scanning order within the transform block, the last_sig_coeff_x_suffix represents a suffix of a column position of a last significant coefficient in the scanning order within the transform block, and the last_sig_coeff_y_suffix represents a suffix of a row position of a last significant coefficient in the scanning order within the transform block. Here, the effective coefficient may represent the non-zero coefficient. In addition, the scan order may be an upward-facing diagonal scan order. Alternatively, the scan order may be a horizontal scan order or a vertical scan order.The above scan order may be determined based on whether intra / inter prediction is applied to the target block (CB, or CB including TB) and / or a specific intra / inter prediction mode.
[0191] Next, the encoding device divides the above transform block into 4x4 sub-blocks, and then uses a 1-bit syntax element coded_sub_block_flag for each 4x4 sub-block to indicate whether a non-zero coefficient exists in the current sub-block.
[0192] If the value of coded_sub_block_flag is 0, there is no more information to transmit, so the encoding device can end the encoding process for the current sub-block. Conversely, if the value of coded_sub_block_flag is 1, the encoding device can continue the encoding process for sig_coeff_flag. The sub-block containing the last non-zero coefficient does not need to encode coded_sub_block_flag, and the sub-block containing the DC information of the transform block is likely to contain non-zero coefficients, so coded_sub_block_flag is not encoded and its value can be assumed to be 1.
[0193] If the value of coded_sub_block_flag is 1 and it is determined that a non-zero coefficient exists in the current sub-block, the encoding device can encode sig_coeff_flag having a binary value according to the reverse scanned order. The encoding device can 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 can 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 can be omitted. Level information encoding can be performed only when sig_coeff_flag is 1, and four syntax elements can be used in the level information encoding process. More specifically, each sig_coeff_flag[xC][yC] may indicate whether the level (value) of the corresponding transform coefficient at each transform coefficient position (xC, yC) within the current TB is non-zero. In one embodiment, the sig_coeff_flag may correspond to an example of a syntax element of a significant coefficient flag indicating whether the quantized transform coefficient is a significant coefficient that is non-zero.
[0194] The remaining level value after encoding for sig_coeff_flag can be derived as shown in the mathematical formula below. That is, the syntax element remAbsLevel, which indicates the level value to be encoded, can be derived as shown in the mathematical formula below.
[0195]
[0196] Here, coeff refers to the actual transformation coefficient value.
[0197] Additionally, abs_level_gt1_flag can indicate whether remAbsLevel at the corresponding scanning position (n) is greater than 1. For example, if the value of abs_level_gt1_flag is 0, the absolute value of the transform coefficient at the corresponding position can be 1. Additionally, if the value of abs_level_gt1_flag is 1, the remAbsLevel indicating the level value to be encoded thereafter can be updated as in the following mathematical formula.
[0198]
[0199] Additionally, the least significant coefficient (LSB) value of remAbsLevel described in the above-described mathematical expression 2 can be encoded as in the mathematical expression 3 below through par_level_flag.
[0200]
[0201] Here, par_level_flag[n] can indicate the parity of the transform coefficient level (value) at scanning position n.
[0202] After par_leve_flag encoding, the transform coefficient level value remAbsLevel to be encoded can be updated as follows:
[0203]
[0204] abs_level_gt3_flag can indicate whether remAbsLevel at the corresponding scanning position (n) is greater than 3. Encoding for abs_remainder can be performed only when abs_level_gt3_flag is 1. The relationship between the actual transform coefficient value, coeff, and each syntax element can be as follows:
[0205]
[0206] Additionally, the following table shows examples related to the above mathematical expression 5.
[0207]
[0208] Here, | coeff | represents the transform coefficient level (value), which can also be denoted as AbsLevel for the transform coefficient. Additionally, the sign of each coefficient can be encoded using the 1-bit symbol coeff_sign_flag.
[0209] In addition, for example, when the value of the transform skip flag is 1, syntax elements sb_coded_flag, sig_coeff_flag, coeff_sign_flag, abs_level_gtx_flag, par_level_flag and / or abs_remainder for the residual 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. In addition, the abs_level_gtx_flag may represent abs_level_gt1_flag, abs_level_gt3_flag, abs_level_gt5_flag, abs_level_gt7_flag and / or abs_level_gt9_flag. For example, abs_level_gtx_flag[n][j] may be a flag indicating whether the absolute value or level (value) of the conversion coefficient at scanning position n is greater than (j<<1)+1. The (j<<1)+1 may be replaced with a predetermined threshold, such as a first threshold or a second threshold, as the case may be.
[0210] On the other hand, CABAC has the disadvantage of poor throughput performance although it provides high performance. This is due to CABAC's regular encoding engine. Regular encoding (i.e. encoding through CABAC's regular encoding engine) shows high data dependency because it uses the probability state and range updated through encoding of the previous bin, and it may take a lot of time to read the probability interval and determine the current state. CABAC's throughput issue 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 can be limited to a number according to the size of the corresponding block. Additionally, for example, as in Table 3 described above, the sum of bins used to express 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 according to the size of the corresponding block.For example, if the block is a 4x4 sized 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 sized block, the sum of the bins for sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag may be limited to 8 (or, for example, 7). The limited number of bins may be represented by remBinsPass1 or RemCcbs. Alternatively, for example, for higher CABAC throughput, the number of context coded bins may be limited for a block (CB or TB) containing the CG to be coded. In other words, the number of context coded bins may be limited on a block (CB or TB) basis. For example, if the 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.
[0211] In this case, if the encoding device uses all of the limited number of context coded bins to encode the context elements, the remaining coefficients can be binarized using the binarization method for the coefficients described below without using context coding, and bypass coding can be performed. In other words, for example, when the number of context coded bins coded for a 4x4 CG becomes 32 (or, for example, 28), or the number of context coded bins coded for a 2x2 CG becomes 8 (or, for example, 7), sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, which are coded as context coded bins, may not be coded any longer, and may be coded directly as dec_abs_level. Alternatively, for example, if the number of context coded bins 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, abs_level_gt3_flag, which are no longer coded as context coded bins, may not be coded and may be coded directly as dec_abs_level as shown in Table 5 below.
[0212]
[0213] The |coeff| value can be derived based on dec_abs_level. In this case, the transformation coefficient value |coeff| can be derived as follows:
[0214]
[0215] Additionally, the coeff_sign_flag may indicate the sign of the transform coefficient level at the corresponding scanning position (n). That is, the coeff_sign_flag may indicate the sign of the transform coefficient at the corresponding scanning position (n).
[0216] Figure 11 is a diagram showing an example of transform coefficients within a 4x4 block.
[0217] The 4x4 block in Fig. 11 represents an example of quantized coefficients. The block illustrated in Fig. 11 may be a 4x4 transform block, or a 4x4 sub-block of an 8x8, 16x16, 32x32, or 64x64 transform block. The 4x4 block in Fig. 11 may represent a luma block or a chroma block.
[0218] Meanwhile, as described above, if the input signal is a syntax element rather than a binary value, the encoding device can convert the input signal into a binary value by binarizing the value of the input signal. In addition, the decoding device can decode the syntax element to derive a binarized value (i.e., a binarized bin) of the syntax element, and can de-binarize the binarized value to derive the value of the syntax element. The binarization process can be performed by a truncated Rice (TR) binarization process, a k-th order Exp-Golomb (k-th order Exp-Golomb, EGk) binarization process, a k-th Limited Exp-Golomb (Limited k-th order Exp-Golomb, Limited EGk), or a fixed-length (FL) binarization process, which will be described later. Additionally, the reverse binarization process may be performed based on the TR binarization process, the EGk binarization process, or the FL binarization process to represent a process of deriving the value of the syntax element.
[0219] For example, the above TR binarization process can be performed as follows.
[0220] The input of the above TR binarization process may be a request for TR binarization and cMax and cRiceParam for syntax elements. In addition, the output of the above TR binarization process may be a TR binarization for a value symbolVal corresponding to an empty string.
[0221] Specifically, for example, if a suffix empty string exists for a syntax element, the TR empty string for the syntax element may be a concatenation of the prefix empty string and the suffix empty string, and if the suffix empty string does not exist, the TR empty string for the syntax element may be the prefix empty string. For example, the prefix empty string may be derived as described below.
[0222] The prefix value of the symbolVal for the above syntax element can be derived as follows:
[0223]
[0224] Here, prefixVal can represent a prefix value of the symbolVal. The prefix of the TR empty string of the syntax element (i.e., the prefix empty string) can be derived as described below.
[0225] 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. A bin for a binIdx less than prefixVal may be equal to 1. Additionally, a bin for a binIdx equal to prefixVal may be equal to 0.
[0226] For example, the empty string derived from unary binarization for the above prefixVal may be as shown in the following table.
[0227]
[0228] Meanwhile, if the above prefixVal is not less than cMax >> cRiceParam, the above prefix bin string may be a bit string whose length is cMax >> cRiceParam and all bins are 1.
[0229] Additionally, if cMax is greater than symbolVal and cRiceParam is greater than 0, a suffix empty string of the TR empty string may exist. For example, the suffix empty string can be derived as described below.
[0230] The suffix value of the symbolVal for the above syntax element can be derived as follows:
[0231]
[0232] Here, suffixVal can represent the suffix value of the symbolVal.
[0233] The suffix of the TR bin string (i.e., the suffix bin string) can be derived based on the FL binarization process for suffixVal with cMax value of (1 << cRiceParam)-1.
[0234] Meanwhile, if the value of the input parameter cRiceParam is 0, the TR binarization can be exactly a truncated unary binarization, and the cMax value, which is always equal to the maximum possible value of the syntax element being decoded, can be used.
[0235] Additionally, for example, the EGk binarization process can be performed as follows: a syntax element coded as ue(v) can be an Exp-Golomb coded syntax element.
[0236] As an example, the 0th order Exp-Golomb (EG0) binarization process can be performed as follows.
[0237] The parsing process for the above syntax element can begin by reading the bits starting from the current position in the bitstream, including the first non-zero bit, and counting the number of leading bits equal to 0. The above process can be represented as shown in the following table.
[0238]
[0239] Additionally, the variable codeNum can be derived as follows:
[0240]
[0241] 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 for the most significant bit written first.
[0242] The structure of the Exp-Golomb code, which divides a bit string into "prefix" bits and "suffix" bits, can be represented as shown in the following table.
[0243]
[0244] The "prefix" bit may be a bit parsed as described above for the calculation of leadingZeroBits, and may be represented as 0 or 1 in the bit string in Table 8. That is, a bit string starting with 0 or 1 in Table 8 described above may represent a prefix bit string. The "suffix" bit may be a bit parsed in the calculation of codeNum, and may be represented as xi in Table 8 described above. That is, a bit string starting with xi in Table 8 described above may represent a suffix bit string. Here, i may be a value in the range of 0 to LeadingZeroBits-1. In addition, each xi may be equal to 0 or 1.
[0245] The bit string assigned to the above codeNum can be as shown in the following table.
[0246]
[0247] If the descriptor of the syntax element is ue(v), i.e., if the syntax element is coded as ue(v), the value of the syntax element may be equal to codeNum.
[0248] Additionally, for example, the EGk binarization process can be performed as follows.
[0249] The input of the above EGk binarization process may be a request for EGk binarization. Additionally, the output of the above EGk binarization process may be an EGk binarization for a value symbolVal corresponding to an empty string.
[0250] The bit string of the EGk binarization process for symbolVal can be derived as follows.
[0251]
[0252] Referring to Table 10 above, each call to put(X) can add a binary value X to the end of an empty string, where X can be 0 or 1.
[0253] Additionally, for example, the Limited EGk binarization process can be performed as follows.
[0254] 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. In addition, the output of the Limited EGk binarization process may be a Limited EGk binarization for a value symbolVal corresponding to an empty string.
[0255] The bit string of the Limited EGk binarization process for symbolVal can be derived as follows.
[0256]
[0257] Additionally, for example, the FL binarization process can be performed as follows.
[0258] The input of the above FL binarization process may be a request for FL binarization and cMax for the syntax element. In addition, the output of the above FL binarization process may be an FL binarization for a value symbolVal corresponding to an empty string.
[0259] FL binarization can be constructed using a bit string having a fixed length of bits of the symbol value symbolVal. Here, the fixed length bits can be an unsigned integer bit string. That is, a bit string for the symbol value symbolVal can be derived through FL binarization, and the bit length (i.e., the number of bits) of the bit string can be a fixed length.
[0260] For example, the fixed length can be derived as follows:
[0261]
[0262] The indexing of bins for FL binarization can be done using values that increase 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.
[0263] Meanwhile, for example, the binarization process for the syntax element abs_remainder among the residual information can be performed as follows.
[0264] The input of the binarization process for the above abs_remainder may be a request for binarization of the syntax element abs_remainder[n], a color component cIdx, and a luma location (x0, y0). The luma location (x0, y0) may point to the upper left sample of the current luma transform block based on the upper left luma sample of the picture.
[0265] The output of the binarization process for the above abs_remainder may be a binarization of the above abs_remainder (i.e., a binarized empty string of the above abs_remainder). Through the binarization process, available empty strings for the above abs_remainder may be derived.
[0266] The Rice parameter cRiceParam for the above abs_remainder[n] can be derived through a Rice parameter derivation process performed using the color component cIdx and 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 input. A specific description of the Rice parameter derivation process will be described later.
[0267] Additionally, for example, cMax for the currently coded abs_remainder[n] can be derived based on the Rice parameter cRiceParam. The cMax can be derived as follows:
[0268]
[0269] Meanwhile, the binarization for the abs_remainder, i.e., the empty string for the abs_remainder, may be a concatenation of a prefix empty string and a suffix empty string if a suffix empty string exists. Furthermore, if the suffix empty string does not exist, the empty string for the abs_remainder may be the prefix empty string.
[0270] For example, the above prefix empty string can be derived as described below.
[0271] The prefix value prefixVal of the above abs_remainder[n] can be derived as follows:
[0272]
[0273] The prefix of the empty string of the above abs_remainder[n] (i.e., the prefix empty string) can be derived through a TR binarization process for the above prefixVal using the above cMax and the above cRiceParam as inputs.
[0274] If the above prefix empty string is identical to a bit string in which all bits are 1 and the bit length is 6, then a suffix empty string of the above empty string of abs_remainder[n] may exist and can be derived as described below.
[0275] The process of deriving the Rice parameter for the above abs_remainder[n] can be as follows.
[0276] The inputs of the above Rice parameter derivation process may be a color component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of a transform block log2TbWidth, and a binary logarithm of the height of a transform block log2TbHeight. The luma position (x0, y0) may indicate an upper left sample of a current luma transform block based on an upper left luma sample of a picture. In addition, the output of the above Rice parameter derivation process may be the Rice parameter cRiceParam.
[0277] For example, based on the array AbsLevel[x][y] for the transform block with the given component index cIdx and the upper left luma location (x0, y0), the variable locSumAbs can be derived as shown in the pseudo code in the following table.
[0278]
[0279] Afterwards, based on the given variable locSumAbs, the rice parameter cRiceParam can be derived as shown in the following table.
[0280]
[0281] Additionally, for example, in the process of deriving the Rice parameters for abs_remainder[n], baseLevel can be set to 4.
[0282] Alternatively, for example, the Rice parameter cRiceParam may be determined based on whether the transformation of the current block is skipped. That is, if no transformation is applied to the current TB containing the current CG, i.e., if a transform skip is applied to the current TB containing the current CG, the Rice parameter cRiceParam may be derived as 1.
[0283] In addition, the suffix value suffixVal of the above abs_remainder can be derived as in the following mathematical formula.
[0284]
[0285] The suffix empty string of the above abs_remainder can be derived through a Limited EGk binarization process for the above suffixVal in which k is set to cRiceParam+1, riceParam is set to cRiceParam, log2TransformRange is set to 15, and maxPreExtLen is set to 11.
[0286] Meanwhile, for example, the binarization process for the syntax element dec_abs_level among the residual information can be performed as follows.
[0287] The input of the binarization process for the above dec_abs_level may be a request for binarization of the syntax element dec_abs_level[n], a color component cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of the transform block log2TbWidth, and a binary logarithm of the height of the transform block log2TbHeight. The luma position (x0, y0) may point to the upper left sample of the current luma transform block based on the upper left luma sample of the picture.
[0288] The output of the binarization process for the above dec_abs_level may be a binarization of the above dec_abs_level (i.e., a binarized empty string of the above dec_abs_level). Through the binarization process, available empty strings for the above dec_abs_level may be derived.
[0289] The Rice parameter cRiceParam for the above dec_abs_level[n] can be derived through a Rice parameter derivation process performed using the color component cIdx and 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 input. A specific description of the Rice parameter derivation process will be described later.
[0290] Additionally, for example, cMax for the dec_abs_level[n] can be derived based on the Rice parameter cRiceParam. The cMax can be derived as follows:
[0291]
[0292] Meanwhile, the binarization for the dec_abs_level[n], i.e., the empty string for the dec_abs_level[n], may be a concatenation of a prefix empty string and a suffix empty string if a suffix empty string exists. Furthermore, if the suffix empty string does not exist, the empty string for the dec_abs_level[n] may be the prefix empty string.
[0293] For example, the above prefix empty string can be derived as described below.
[0294] The prefix value prefixVal of the above dec_abs_level[n] can be derived as follows:
[0295]
[0296] The prefix of the empty string of the above dec_abs_level[n] (i.e., the prefix empty string) can be derived through a TR binarization process for the above prefixVal using the above cMax and the above cRiceParam as inputs.
[0297] If the above prefix empty string is identical to a bit string in which all bits are 1 and the bit length is 6, then a suffix empty string of the above empty string of dec_abs_level[n] may exist and be derived as described below.
[0298] The process of deriving the Rice parameter for the above dec_abs_level[n] can be as follows.
[0299] The inputs of the above Rice parameter derivation process may be a color component index cIdx, a luma position (x0, y0), a current coefficient scan position (xC, yC), a binary logarithm of the width of a transform block log2TbWidth, and a binary logarithm of the height of a transform block log2TbHeight. The luma position (x0, y0) may indicate an upper left sample of a current luma transform block based on an upper left luma sample of a picture. In addition, the output of the above Rice parameter derivation process may be the Rice parameter cRiceParam.
[0300] For example, based on the array AbsLevel[x][y] for the transform block with the given component index cIdx and the upper left luma location (x0, y0), the variable locSumAbs can be derived as shown in the pseudo code in the following table.
[0301]
[0302] Afterwards, based on the given variable locSumAbs, the rice parameter cRiceParam can be derived as shown in the following table.
[0303]
[0304] Additionally, for example, in the process of deriving the Rice parameter for dec_abs_level[n], baseLevel can be set to 0, and the ZeroPos[n] can be derived as follows.
[0305]
[0306] In addition, the suffix value suffixVal of the above dec_abs_level[n] can be derived as in the following mathematical formula.
[0307]
[0308] The suffix empty string of the above dec_abs_level[n] can be derived through a Limited EGk binarization process for the above suffixVal where k is set to cRiceParam+1, truncSuffixLen is set to 15, and maxPreExtLen is set to 11.
[0309] Meanwhile, the above-described RRC and TSRC may have the following differences.
[0310] - For example, the Rice parameter cRiceParam of the syntax elements abs_remainder[] and dec_abs_level[] in RRC can be derived based on the locSumAbs, look-up table and / or baseLevel as described above, but the Rice parameter cRiceParam of the syntax element abs_remainder[] in TSRC can be derived as 1. That is, for example, when transform skip is applied to the current block (e.g., the current TB), the Rice parameter cRiceParam for abs_remainder[] of TSRC for the current block can be derived as 1.
[0311] - Also, for example, referring to Table 3 and Table 4, in RRC, abs_level_gtx_flag[n][0] and / or abs_level_gtx_flag[n][1] may be signaled, but in TSRC, abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1], abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3] and abs_level_gtx_flag[n][4] may be signaled. Here, the abs_level_gtx_flag[n][0] may be represented as abs_level_gt1_flag or a first coefficient level flag, the abs_level_gtx_flag[n][1] may be represented as abs_level_gt3_flag or a second coefficient level flag, the abs_level_gtx_flag[n][2] may be represented as abs_level_gt5_flag or a third coefficient level flag, the abs_level_gtx_flag[n][3] may be represented as abs_level_gt7_flag or a fourth coefficient level flag, and the abs_level_gtx_flag[n][4] may be represented as abs_level_gt9_flag or a fifth coefficient level flag. Specifically, the first coefficient level flag may be a flag indicating whether the coefficient level is greater than a first threshold (e.g., 1), the second coefficient level flag may be a flag indicating whether the coefficient level is greater than a second threshold (e.g., 3), the third coefficient level flag may be a flag indicating whether the coefficient level is greater than a third threshold (e.g., 5), the fourth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fourth threshold (e.g., 7), and the fifth coefficient level flag may be a flag indicating whether the coefficient level is greater than a fifth threshold (e.g., 9).As described above, TSRC may further include abs_level_gtx_flag[n][2], abs_level_gtx_flag[n][3], and abs_level_gtx_flag[n][4] in addition to abs_level_gtx_flag[n][0], abs_level_gtx_flag[n][1] compared to RRC.
[0312] - Also, for example, in RRC, the syntax element coeff_sign_flag can be bypass coded, but in TSRC, the syntax element coeff_sign_flag can be bypass coded or context coded.
[0313] In addition, dependent quantization can be proposed for the quantization process of residual samples. Dependent quantization can indicate how the set of allowed restoration values for the current transform coefficient depends on the value (value of the transform coefficient level) of the transform coefficient preceding the current transform coefficient in the restoration order. That is, for example, dependent quantization can be realized by (a) defining two scalar quantizers with different restoration levels, and (b) defining a process for switching between the scalar quantizers. The dependent quantization can have the effect of making the allowed restoration vectors more dense in the N-dimensional vector space compared to the conventional independent scalar quantization. Here, N can indicate the number of transform coefficients of the transform block.
[0314] Fig. 12 illustrates scalar quantizers used in dependent quantization. Referring to Fig. 12, the positions of available restoration levels can be designated by a quantization step size △. Referring to Fig. 12, the scalar quantizers can be represented as Q0 and Q1. The scalar quantizer used can be derived without being explicitly signaled in the bitstream. For example, the quantizer used for the current transform coefficient can be determined by the parities of the transform coefficient level preceding the current transform coefficient in the coding / reconstruction order.
[0315] Figure 13 illustrates an example of state transition and quantizer selection for dependent quantization.
[0316] Referring to Fig. 13, the transition between two scalar quantizers (Q0 and Q1) can be realized through a state machine with four states. The four states can have four different values (0, 1, 2, 3). The state for the current transform coefficient can be determined by the parities of the transform coefficient levels preceding the current transform coefficient in the coding / reconstruction order.
[0317] For example, when the dequantization process for a transform block starts, the state for dependent quantization can be set to 0. Thereafter, the transform coefficients for the transform block can be restored in the scan order (i.e., the same order as entropy decoded). For example, after the current transform coefficient is restored, the state for dependent quantization can be updated as illustrated in FIG. 13. The dequantization process for the transform coefficient restored after the current transform coefficient is restored in the scan order can be performed based on the updated state. k illustrated in FIG. 13 can represent the value of the transform coefficient, i.e., the transform coefficient level value. For example, when the current state is 0, if k(the value of the current transform coefficient)&1 is 0, the state can be updated to 0, and if k&1 is 1, the state can be updated to 2. Also, for example, when the current state is 1, if k&1 is 0, the state can be updated to 2, and if k&1 is 1, the state can be updated to 0. Also, for example, if the current state is 2, if k&1 is 0, the state can be updated to 1, and if k&1 is 1, the state can be updated to 3. Also, for example, if the current state is 3, if k&1 is 0, the state can be updated to 3, and if k&1 is 1, the state can be updated to 1. Referring to FIG. 13, if the state is one of 0 and 1, the scalar quantizer used in the dequantization process can be Q0, and if the state is one of 2 and 3, the scalar quantizer used in the dequantization process can be Q1. The transform coefficients can be dequantized based on the quantization parameters for the restoration level of the transform coefficients in the scalar quantizer for the current state.
[0318] Meanwhile, this document proposes embodiments related to residual data coding. The embodiments described in this document may be combined with each other. As described above, residual data coding methods may include Regular Residual Coding (RRC) and Transform Skip Residual Coding (TSRC).
[0319] Among the two methods described above, the residual data coding method for the current block can be determined based on the values of transform_skip_flag and sh_ts_residual_coding_disabled_flag as shown in Table 1. Here, the syntax element sh_ts_residual_coding_disabled_flag can indicate whether the TSRC is available. Accordingly, even if the transform_skip_flag indicates that the transform is skipped, if sh_ts_residual_coding_disabled_flag indicates that the TSRC is not available, syntax elements according to RRC can be signaled for the transform skip block. That is, when the value of transform_skip_flag is 0 or the value of slice_ts_residual_coding_disabled_flag is 1, RRC can be used, and in other cases, TSRC can be used.
[0320] Although the above slice_ts_residual_coding_disabled_flag can be used to achieve high coding efficiency in certain applications (e.g., lossless coding, etc.), existing video / image coding standards do not propose any restrictions on cases where the above-described dependent quantization and the above slice_ts_residual_coding_disabled_flag are used together. That is, when dependent quantization is enabled at a high level (e.g., sequence parameter set (SPS) syntax / video parameter set (VPS) syntax / decoding parameter set (DPS) syntax / picture header syntax / slice header syntax, etc.) or a low level (CU / TU) and the slice_ts_residual_coding_disabled_flag is 1, values dependent on the state of dependent quantization in RRC may perform unnecessary operations (i.e., operations according to dependent quantization), thereby degrading coding performance, or an unintentional loss of coding performance may occur due to incorrect settings in the encoding device. Therefore, in this embodiment, we propose methods to set dependencies / constraints between the two techniques to prevent unintended coding loss or malfunction caused by the combined use of dependent quantization and residual coding (i.e., coding residual samples of transform skip blocks within the current slice with RRC) when slice_ts_residual_coding_disabled_flag = 1.
[0321] This document proposes, as an example, a method in which the slice_ts_residual_coding_disabled_flag depends on the ph_dep_quant_enabled_flag. For example, the syntax elements proposed in this embodiment may be as shown in the following table.
[0322]
[0323] According to the present embodiment, the slice_ts_residual_coding_disabled_flag may be signaled when the value of the ph_dep_quant_enabled_flag is 0. Here, the ph_dep_quant_enabled_flag may indicate whether dependent quantization is available. For example, when the value of the ph_dep_quant_enabled_flag is 1, the ph_dep_quant_enabled_flag may indicate that dependent quantization is available, and when the value of the ph_dep_quant_enabled_flag is 0, the ph_dep_quant_enabled_flag may indicate that dependent quantization is not available.
[0324] Accordingly, according to the present embodiment, the 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 inferred as 0. Meanwhile, the ph_dep_quant_enabled_flag and the slice_ts_residual_coding_disabled_flag may be signaled in the picture header syntax and / or the slice header syntax, or may be signaled in a High Level Syntax (HLS) other than the picture header syntax and the slice header syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or in a low level (CU / TU). The above ph_dep_quant_enabled_flag may be called by another name when signaled with a syntax other than the picture header syntax. For example, the above 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.
[0325] In addition, this document proposes another embodiment to set 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 with RRC). For example, this embodiment proposes a scheme to prevent the state of dependent quantization from being used in level value coding 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 using 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 with RRC) together. The residual coding syntax according to this embodiment may be as shown in the following table.
[0326]
[0327]
[0328]
[0329]
[0330]
[0331]
[0332] 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, QState can be derived, and the value of the transform coefficient (transform coefficient level) can be derived based on the QState. For example, referring to Table 17, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] can be derived as ( 2 * AbsLevel[xC][yC] - (QState > 1 1 : 0 )) * ( 1 - 2 * coeff_sign_flag[n] ). Here, AbsLevel[xC][yC] can be the absolute value of the transform coefficient derived based on the syntax elements of the transform coefficient, coeff_sign_flag[n] can be the syntax element of the sign flag indicating the sign of the transform coefficient, and (QState > 1 ? 1 : 0) can indicate that if the value of the state QState is greater than 1, that is, if the value of the state QState is 2 or 3, it is 1, and if the value of the state QState is less than or equal to 1, that is, if the value of the state QState is 0 or 1, it is 0.
[0333] Also, referring to Table 17 described above, if the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (the transform coefficient level) can be derived without using the QState. For example, referring to Table 17, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] can be derived as AbsLevel[xC][yC] * ( 1 - 2 * coeff_sign_flag[n] ). Here, AbsLevel[xC][yC] can be the absolute value of the transform coefficient derived based on the syntax elements of the transform coefficient, and coeff_sign_flag[n] can be the syntax element of the sign flag indicating the sign of the transform coefficient.
[0334] Additionally, according to the present embodiment, if the value of slice_ts_residual_coding_disabled_flag is 1, the state of the dependent quantization may not be used in level value coding of the transform coefficients, and the state update may not be performed. For example, the residual coding syntax according to the present embodiment may be as shown in the following table.
[0335]
[0336]
[0337]
[0338]
[0339]
[0340]
[0341] Referring to Table 18 above, when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, QState can be updated. 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 can be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC] & 1] or QStateTransTable[QState][AbsLevel[xC][yC] & 1]. In addition, when the value of slice_ts_residual_coding_disabled_flag is 1, the process of updating QState may not be performed.
[0342] Also, referring to Table 18 described above, when the value of ph_dep_quant_enabled_flag is 1 and the value of slice_ts_residual_coding_disabled_flag is 0, the value of the transform coefficient (transform coefficient level) can be derived based on the QState. For example, referring to Table 18, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] can be derived as ( 2 * AbsLevel[xC][yC] - (QState > 1 1 : 0 )) * ( 1 - 2 * coeff_sign_flag[n] ). Here, AbsLevel[xC][yC] can be the absolute value of the transform coefficient derived based on the syntax elements of the transform coefficient, coeff_sign_flag[n] can be the syntax element of the sign flag indicating the sign of the transform coefficient, and (QState > 1 ? 1 : 0) can indicate that if the value of the state QState is greater than 1, that is, if the value of the state QState is 2 or 3, it is 1, and if the value of the state QState is less than or equal to 1, that is, if the value of the state QState is 0 or 1, it is 0.
[0343] Also, referring to Table 18 described above, if the value of slice_ts_residual_coding_disabled_flag is 1, the value of the transform coefficient (the transform coefficient level) can be derived without using the QState. For example, referring to Table 18, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] can be derived as AbsLevel[xC][yC] * ( 1 - 2 * coeff_sign_flag[n] ). Here, AbsLevel[xC][yC] can be the absolute value of the transform coefficient derived based on the syntax elements of the transform coefficient, and coeff_sign_flag[n] can be the syntax element of the sign flag indicating the sign of the transform coefficient.
[0344] In addition, this document proposes another embodiment to set dependency / restriction between dependent quantization and residual coding (i.e., coding residual samples of transform skip blocks within the current slice into RRC) when slice_ts_residual_coding_disabled_flag = 1. For example, this embodiment proposes a method to add a constraint using transform_skip_flag to the state update of dependent quantization in RRC or the process of deriving the value of transform coefficient (transform coefficient level) depending on the state. That is, this embodiment proposes a method to prevent the state update of dependent quantization in RRC and / or the process of deriving the value of transform coefficient (transform coefficient level) depending on the state from being used based on the transform_skip_flag. The residual coding syntax according to this embodiment may be as shown in the following table.
[0345]
[0346]
[0347]
[0348]
[0349]
[0350]
[0351] 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, QState can be updated. For example, when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, QState can be updated to QStateTransTable[QState][AbsLevelPass1[xC][yC] & 1] or QStateTransTable[QState][AbsLevel[xC][yC] & 1]. In addition, when the value of transform_skip_flag is 1, the process of updating QState may not be performed.
[0352] In addition, referring to Table 19 described above, when the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 0, QState can be derived, and the value of the transform coefficient (transform coefficient level) can be derived based on the QState. For example, referring to Table 19, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] can be derived as ( 2 * AbsLevel[xC][yC] - (QState > 1 1 : 0 )) * ( 1 - 2 * coeff_sign_flag[n] ). Here, AbsLevel[xC][yC] can be the absolute value of the transform coefficient derived based on the syntax elements of the transform coefficient, coeff_sign_flag[n] can be the syntax element of the sign flag indicating the sign of the transform coefficient, and (QState > 1 ? 1 : 0) can indicate that if the value of the state QState is greater than 1, that is, if the value of the state QState is 2 or 3, it is 1, and if the value of the state QState is less than or equal to 1, that is, if the value of the state QState is 0 or 1, it is 0.
[0353] Also, referring to Table 19 described above, when the value of transform_skip_flag is 1, the value of the transform coefficient (the transform coefficient level) can be derived without using the QState. Therefore, when residual data according to RRC is coded for the transform skip block, the value of the transform coefficient can be derived without using the Qstate. For example, referring to Table 19, the transform coefficient level TransCoeffLevel[x0][y0][cIdx][xC][yC] can be derived as AbsLevel[xC][yC] * ( 1 - 2 * coeff_sign_flag[n] ). Here, AbsLevel[xC][yC] can be the absolute value of the transform coefficient derived based on the syntax elements of the transform coefficient, and coeff_sign_flag[n] can be the syntax element of the sign flag indicating the sign of the transform coefficient.
[0354] Additionally, for example, this document proposes embodiments such as the following table.
[0355]
[0356] Referring to Table 20, a method for deriving ZeroPos of dec_abs_level can be selected based on ph_dep_quant_enabled_flag and transform_skip_flag. For example, if the value of ph_dep_quant_enabled_flag is 1 and the value of transform_skip_flag is 1, ZeroPos of dec_abs_level can be derived based on a mathematical formula that does not use the state value of dependent quantization. For example, as shown in Table 20 described above, ZeroPos can be derived as 1 << cRiceParam.
[0357] Meanwhile, for example, if the value of ph_dep_quant_enabled_flag is 0 or the value of transform_skip_flag is 0, ZeroPos of dec_abs_level can be derived depending on the state value of dependent quantization.
[0358] Additionally, this document proposes several embodiments related to the signaling of the syntax element sh_ts_residual_coding_disabled_flag described above.
[0359] For example, since sh_ts_residual_coding_disabled_flag is a syntax element that defines whether TSRC is disabled as described above, it may not need to be signaled if a translation skip block is not used. That is, it may be meaningful to signal sh_ts_residual_coding_disabled_flag only when the syntax element for whether a translation skip block is used indicates that a translation skip block is used.
[0360] Accordingly, this document proposes an embodiment that signals sh_ts_residual_coding_disabled_flag only when sps_transform_skip_enabled_flag is 1. The syntax according to this embodiment is as follows.
[0361]
[0362] Referring to Table 21, when sps_transform_skip_enabled_flag is 1, sh_ts_residual_coding_disabled_flag may be signaled, and when sps_transform_skip_enabled_flag is 0, sh_ts_residual_coding_disabled_flag may not be signaled. Here, for example, the sps_transform_skip_enabled_flag may indicate whether the 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 sps_transform_skip_enabled_flag is 1, sps_transform_skip_enabled_flag may indicate that a transform skip flag (transform_skip_flag) may exist in the transform unit syntax, and when the value of sps_transform_skip_enabled_flag is 0, sps_transform_skip_enabled_flag may indicate that a transform skip flag does not exist in the transform unit syntax. Meanwhile, when sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be inferred as 0.Additionally, the above-described sps_transform_skip_enabled_flag can be signaled in the SPS, or in other high-level syntax (VPS, PPS, picture header syntax, slice header syntax, etc.) or low-level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than the SPS. Additionally, it can be signaled before the slice_ts_residual_coding_disabled_flag.
[0363] Additionally, this document proposes an embodiment that combines the embodiments described above with respect to signaling sh_ts_residual_coding_disabled_flag. For example, an embodiment that signals sh_ts_residual_coding_disabled_flag may be proposed as shown in the following table.
[0364]
[0365] 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 inferred as 0.
[0366] Alternatively, an embodiment may be proposed that signals sh_ts_residual_coding_disabled_flag as in the following table, for example.
[0367]
[0368] Referring to Table 23, sh_ts_residual_coding_disabled_flag can be signaled in the picture header. The sh_ts_residual_coding_disabled_flag can be expressed as ph_ts_residual_coding_disabled_flag. Also, referring to Table 23, ph_dep_quant_enabled_flag can be signaled in the picture header.
[0369] For example, referring to Table 23, if ph_dep_quant_enabled_flag is 0 and sps_transform_skip_enabled_flag is 1, ph_ts_residual_coding_disabled_flag may be signaled, otherwise ph_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if ph_ts_residual_coding_disabled_flag is not signaled, ph_ts_residual_coding_disabled_flag may be inferred as 0.
[0370] Meanwhile, with respect to the syntax elements described in the embodiments of this document, in existing video / image coding standards, the ph_dep_quant_enabled_flag can be signaled in the picture header syntax, and the sh_ts_residual_coding_disabled_flag can be signaled in the slice header syntax. In this regard, this document proposes an embodiment in which the two syntax elements are signaled in the same high-level syntax or low-level syntax.
[0371] For example, an embodiment may be proposed in which both the ph_dep_quant_enabled_flag and the sh_ts_residual_coding_disabled_flag are signaled in the picture header syntax. In this case, the sh_ts_residual_coding_disabled_flag may be called ph_ts_residual_coding_disabled_flag.
[0372] Alternatively, for example, an embodiment may be proposed in which both the ph_dep_quant_enabled_flag and the sh_ts_residual_coding_disabled_flag are signaled in the slice header syntax. In this case, the ph_dep_quant_enabled_flag may be called sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or slice_dep_quant_enabled_flag.
[0373] 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 when 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.
[0374]
[0375] Referring to Table 24, the ph_dep_quant_enabled_flag may be signaled in the picture header syntax, and when the value of the ph_dep_quant_enabled_flag is 0, the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax, and when the value of the ph_dep_quant_enabled_flag is 1, the ph_ts_residual_coding_disabled_flag may not be signaled. 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.
[0376] Meanwhile, the above-described embodiment may be proposed as an example in which the ph_dep_quant_enabled_flag and the ph_ts_residual_coding_disabled_flag are signaled 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.) other than the picture header syntax.
[0377] Additionally, 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 when the value of the ph_ts_residual_coding_disabled_flag is 0.
[0378]
[0379] Referring to Table 25, the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax, and when the value of the ph_ts_residual_coding_disabled_flag is 0, the ph_dep_quant_enabled_flag may be signaled in the picture header syntax, and when the value of the ph_ts_residual_coding_disabled_flag is 1, the ph_dep_quant_enabled_flag may not be signaled. For example, when the ph_dep_quant_enabled_flag is not signaled, the ph_dep_quant_enabled_flag may be inferred as 0.
[0380] Meanwhile, the above-described embodiment may be proposed as an example in which the ph_ts_residual_coding_disabled_flag and the ph_dep_quant_enabled_flag are signaled 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.) other than the picture header syntax.
[0381] In addition, for example, an embodiment combining the above-described 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 when the value of the ph_dep_quant_enabled_flag is 0 or the value of the sps_transform_skip_enabled_flag is 1.
[0382]
[0383] Referring to Table 26, the ph_dep_quant_enabled_flag can be signaled in the picture header syntax, and when 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 can be signaled in the picture header syntax, and in other cases, the ph_ts_residual_coding_disabled_flag may not be signaled. Here, for example, the sps_transform_skip_enabled_flag can indicate whether a transform skip block is used. That is, for example, the sps_transform_skip_enabled_flag can 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 (transform_skip_flag) may exist 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 does not exist in the 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 as 0.
[0384] Additionally, 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, etc.), 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.
[0385]
[0386] Referring to Table 27, the ph_dep_quant_enabled_flag may be signaled in the picture header syntax, and when the value of the ph_dep_quant_enabled_flag is 0 and the value of the sps_transform_skip_enabled_flag is 1, the ph_ts_residual_coding_disabled_flag may be signaled in the picture header syntax, and in other cases, the ph_ts_residual_coding_disabled_flag may not be signaled. 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.
[0387] Additionally, for example, an embodiment may be proposed in which both ph_dep_quant_enabled_flag and ph_ts_residual_coding_disabled_flag are signaled in the same HLS, but the ph_ts_residual_coding_disabled_flag is signaled only when the value of the sps_transform_skip_enabled_flag is 1, and the ph_dep_quant_enabled_flag is signaled only when the value of the ph_ts_residual_coding_disabled_flag is 0.
[0388]
[0389] Referring to Table 28, when the value of the sps_transform_skip_enabled_flag is 1, the ph_ts_residual_coding_disabled_flag can be signaled in the picture header syntax, and when the value of the ph_ts_residual_coding_disabled_flag is 0, the ph_dep_quant_enabled_flag can be signaled in the picture header syntax. For example, when the value of the sps_transform_skip_enabled_flag is 0, the ph_ts_residual_coding_disabled_flag may not be signaled. 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. Additionally, for example, if the value of the ph_ts_residual_coding_disabled_flag is 1, the ph_dep_quant_enabled_flag may not be signaled. For example, if the ph_dep_quant_enabled_flag is not signaled, the ph_dep_quant_enabled_flag may be inferred as 0.
[0390] Meanwhile, as described above, information (syntax elements) within the syntax table disclosed in this document may be included in image / video information, configured / encoded by an encoding device, and transmitted to a decoding device in the form of a bitstream. The decoding device may parse / decode the information (syntax elements) within the syntax table. The decoding device may perform a block / image / video restoration procedure based on the decoded information.
[0391] Additionally, this document proposes several embodiments related to the signaling of the syntax element sh_ts_residual_coding_disabled_flag described above.
[0392] For example, as described above, high coding efficiency can be achieved in certain applications (e.g., lossless coding, etc.) by using the slice_ts_residual_coding_disabled_flag, but existing video / image coding standards do not propose any restrictions on cases where Sign Data Hiding (SDH) is used together with the slice_ts_residual_coding_disabled_flag.
[0393] Here, the method for omitting the sign data 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 for omitting explicit signaling of coeff_sign_flag for the first valid transform coefficient in a sub-block / coefficient group (CG) in order to improve coding efficiency. Here, the value of coeff_sign_flag for the first valid transform coefficient may be derived based on the sum of the absolute levels (i.e., absolute values) of the valid transform coefficients in the corresponding sub-block / coefficient group. That is, the sign of the first valid transform coefficient may be derived based on the sum of the absolute levels for the valid transform coefficients in the corresponding sub-block / coefficient group. Meanwhile, a valid transform coefficient may mean a non-zero transform coefficient whose (absolute) value is not 0. For example, if the sum of the absolute levels for the effective transform coefficients is even, the value of coeff_sign_flag for the first effective transform coefficient can be derived as 1, and if the sum of the absolute levels for the effective transform coefficients is odd, the value of coeff_sign_flag for the first effective transform coefficient can be derived as 0. In other words, for example, if the sum of the absolute levels for the effective transform coefficients is even, the sign for the first effective transform coefficient can be derived as a negative value, and if the sum of the absolute levels for the effective transform coefficients is odd, the sign for the first effective transform coefficient can be derived as a positive value.Alternatively, for example, if the sum of the absolute levels for the effective transform coefficients is even, the value of coeff_sign_flag for the first effective transform coefficient may be derived as 0, and if the sum of the absolute levels for the effective transform coefficients is odd, the value of coeff_sign_flag for the first effective transform coefficient may be derived as 1. In other words, for example, if the sum of the absolute levels for the effective transform coefficients is even, the sign for the first effective transform coefficient may be derived as a positive value, and if the sum of the absolute levels for the effective transform coefficients is odd, the sign for the first effective transform coefficient may be derived as a negative value.
[0394] For example, the above SDH in residual syntax can be represented as shown in the following table.
[0395]
[0396] Referring to Table 29, the variable signHiddenFlag can indicate whether the SDH is applied. The variable signHiddenFlag may also be called signHidden. For example, when the value of the variable signHiddenFlag is 0, the variable signHiddenFlag can indicate that the SDH is not applied, and when the value of the variable signHiddenFlag is 1, the variable signHiddenFlag can indicate that the SDH is applied. For example, the value of the variable signHiddenFlag can be set based on signaled flag information (e.g., sh_sign_data_hiding_used_flag or pic_sign_data_hiding_enabled_flag or sps_sign_data_hiding_enabled_flag). In addition, for example, the value of the variable signHiddenFlag can be set based on lastSigScanPosSb and firstSigScanPosSb. Here, lastSigScanPosSb may indicate the last valid transform coefficient position searched within the corresponding sub-block / coefficient group according to the scan order, and firstSigScanPosSb may indicate the first valid transform coefficient position searched within the corresponding sub-block / coefficient group according to the scan order. In general, lastSigScanPosSb may be located in a relatively high-frequency component area compared to firstSigScanPosSb. Accordingly, when lastSigScanPosSb - firstSigScanPosSb is greater than a predetermined threshold, the signHidden value may be derived as 1 (i.e., SDH applied), and in other cases, the signHidden value may be derived as 0 (i.e., SDH not applied). Here, for example, referring to Table 29, the threshold may be set to 3.
[0397] Meanwhile, if the above-described sign data hiding is activated in the high-level syntax (VPS, SPS, PPS, slice header syntax, etc.) or the 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 RRC can be used in lossless coding. Therefore, lossless coding may become impossible due to an incorrect setting in the encoding device. Or, if loss coding (i.e., an irreversible coding method) rather than lossless coding is applied, and the residual signal to which the transform skip is applied is coded with RRC while BDPCM is applied at the same time, BDPCM may cause coding loss by performing SDH because it satisfies the SDH application conditions even though there are more sections in which the residual value becomes 0 than in the general case due to the difference between the residuals. Specifically, for example, if there are valid transform coefficients (non-zero residual data) at positions 0 and 15 in the CG, and the values of the transform coefficients at the remaining positions in the CG are 0, SDH can be applied to the CG according to the SDH application conditions described above, and thus, the sign data (i.e., coding of the sign flag) for the first valid transform coefficient of the CG can be omitted. Therefore, in this case, the parity of only two residual data of the CG can be adjusted at the quantization step to omit the sign data, which may actually cause more coding loss than when SDH is not applied. Such cases can also occur in blocks to which BDPCM is not applied, but since BDPCM lowers the level through the difference with the surrounding residuals due to the characteristics of BDPCM, cases that are disadvantageous when applying SDH can occur more frequently.
[0398] Therefore, this document proposes an embodiment that sets dependencies / constraints between the two techniques to prevent unintended coding loss or malfunction when SDH and residual coding (i.e., coding residual samples of transform skip blocks within the current slice with RRC) when slice_ts_residual_coding_disabled_flag = 1) are used together.
[0399] For example, the present embodiment proposes a scheme in which slice_ts_residual_coding_disabled_flag is dependent on pic_sign_data_hiding_enabled_flag. The residual coding syntax according to the present embodiment may be as shown in the following table.
[0400]
[0401] Here, slice_ts_residual_coding_disabled_flag can be signaled by slice header syntax, or can be signaled by other High Level Syntax (HLS) syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low level (CU / TU) than slice header syntax. Also, pic_sign_data_hiding_enabled_flag can be signaled by picture header syntax, or can be signaled by other High Level Syntax (HLS) syntax (e.g., SPS syntax / VPS syntax / DPS syntax, etc.) or low level (CU / TU) than picture header syntax. For example, when pic_sign_data_hiding_enabled_flag is signaled by other syntax than picture header syntax, it can be called by another name. For example, the above pic_sign_data_hiding_enabled_flag can also be expressed as sps_sign_data_hiding_enabled_flag.
[0402] Additionally, sps_sign_data_hiding_enabled_flag can be a flag for whether sign data hiding is enabled. That is, for example, sps_sign_data_hiding_enabled_flag can indicate whether the sign data hiding is enabled. For example, when the value of sps_sign_data_hiding_enabled_flag is 1, sps_sign_data_hiding_enabled_flag can indicate that the sign data hiding is enabled, and when the value of sps_sign_data_hiding_enabled_flag is 0, sps_sign_data_hiding_enabled_flag can indicate that the sign data hiding is not enabled.
[0403] According to Table 30 disclosing the present embodiment, slice_ts_residual_coding_disabled_flag may be signaled only when sign data hiding is not available. In addition, when 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 (coding residual samples of transform skip blocks in the current slice with TSRC syntax) or 1 (coding residual samples of transform skip blocks in the current slice with RRC syntax).
[0404] Additionally, this document proposes an embodiment that combines the embodiments described above with respect to signaling sh_ts_residual_coding_disabled_flag. For example, an embodiment that signals sh_ts_residual_coding_disabled_flag may be proposed as shown in the following table.
[0405]
[0406] 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 can be signaled, and in other cases, 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 can be inferred as 0.
[0407] Meanwhile, the embodiment of Table 31 may be proposed as an example 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.).
[0408] Alternatively, an embodiment may be proposed that signals sh_ts_residual_coding_disabled_flag as in the following table, for example.
[0409]
[0410] 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, and in other cases, sh_ts_residual_coding_disabled_flag may not be signaled. On the other hand, if sh_ts_residual_coding_disabled_flag is not signaled, sh_ts_residual_coding_disabled_flag may be inferred as 0.
[0411] Meanwhile, the embodiment of Table 32 may be proposed as an example 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.).
[0412] Alternatively, an embodiment may be proposed that signals sh_ts_residual_coding_disabled_flag as in the following table, for example.
[0413]
[0414] 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 as 0.
[0415] Additionally, this document proposes an embodiment of signaling the above-described syntax elements ph_dep_quant_enabled_flag, pic_sign_data_hiding_enabled_flag and slice_ts_residual_coding_disabled_flag in the same high-level syntax or low-level syntax.
[0416] For example, an embodiment may be proposed where 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.
[0417]
[0418] In this case, the above slice_ts_residual_coding_disabled_flag may be called ph_ts_residual_coding_disabled_flag.
[0419] Referring to Table 34, ph_ts_residual_coding_disabled_flag can be signaled in the picture header syntax, and 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 can 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 can be signaled in the picture header syntax. Meanwhile, 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.
[0420] Alternatively, an embodiment could be proposed where 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 in the following table.
[0421]
[0422] Referring to Table 35, if the value of sps_transform_skip_enabled_flag is 1, ph_ts_residual_coding_disabled_flag can be signaled in the picture header syntax. Also, for example, if the value of sps_transform_skip_enabled_flag is 0, ph_ts_residual_coding_disabled_flag may not be signaled. If ph_ts_residual_coding_disabled_flag is not signaled, ph_ts_residual_coding_disabled_flag can be inferred as 0 by the decoding device.
[0423] Also, referring to Table 35, if the value of ph_ts_residual_coding_disabled_flag is 0, and the value of sps_dep_quant_enabled_flag is 1, then ph_dep_quant_enabled_flag can be signaled in the picture header syntax. Also, if the value of ph_ts_residual_coding_disabled_flag is 0, and the value of sps_sign_data_hiding_enabled_flag is 1, and ph_dep_quant_enabled_flag is 0, then pic_sign_data_hiding_enabled_flag can be signaled in the picture header syntax. Meanwhile, 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. Also, for example, if ph_dep_quant_enabled_flag is not signaled, ph_dep_quant_enabled_flag may be inferred as 0 at the decoding device. Also, for example, if pic_sign_data_hiding_enabled_flag is not signaled, pic_sign_data_hiding_enabled_flag may be inferred as 0 at the decoding device.
[0424] Meanwhile, the above-described embodiments are examples, and it may be suggested that ph_ts_residual_coding_disabled_flag, ph_dep_quant_enabled_flag, and pic_sign_data_hiding_enabled_flag be signaled in other high-level syntax (VPS, SPS, PPS, slice header syntax, etc.) or low-level syntax (slice data syntax, coding unit syntax, transform unit syntax, etc.) other than picture header syntax.
[0425] Meanwhile, as described above, information (syntax elements) within the syntax table disclosed in this document may be included in image / video information, configured / encoded by an encoding device, and transmitted to a decoding device in the form of a bitstream. The decoding device may parse / decode the information (syntax elements) within the syntax table. The decoding device may perform a block / image / video restoration procedure based on the decoded information.
[0426] Fig. 14 schematically illustrates a video encoding method by an encoding device according to the present document. The method disclosed in Fig. 11 can be performed by the encoding device disclosed in Fig. 2. Specifically, for example, S1100 of Fig. 11 can be performed by a prediction unit of the encoding device, S1110 of Fig. 11 can be performed by a subtraction unit of the encoding device, and S1120 to S1140 of Fig. 11 can be performed by an entropy encoding unit of the encoding device. In addition, although not illustrated, a process of generating a reconstructed sample and a reconstructed picture for the current block based on a residual sample and a prediction sample for the current block can be performed by an addition unit of the encoding device.
[0427] An encoding device encodes a dependent quantization availability flag indicating whether dependent quantization is available (S1400). The encoding device can encode a dependent quantization availability flag indicating whether dependent quantization is available. Image information can include a dependent quantization availability flag. For example, the encoding device can determine whether dependent quantization is available for blocks of pictures in a sequence, and can encode a dependent quantization availability flag indicating whether dependent quantization is available. For example, the dependent quantization availability flag can be a flag indicating whether dependent quantization is available. For example, the dependent quantization availability flag can indicate whether dependent quantization is available. That is, for example, the dependent quantization availability flag can indicate whether dependent quantization is available for blocks of pictures in a sequence. For example, the dependent quantization enabled flag may indicate whether a dependent quantization enabled flag exists, which indicates whether dependent quantization is enabled for the current slice. For example, the dependent quantization enabled flag having a value of 1 may indicate that the dependent quantization is enabled, and the dependent quantization enabled flag having a value of 0 may indicate that the dependent quantization is not enabled. In addition, for example, the dependent quantization enabled flag may be signaled by SPS syntax or slice header syntax, etc. The syntax element of the dependent quantization enabled flag may be the sps_dep_quant_enabled_flag described above.The above sps_dep_quant_enabled_flag can be called sh_dep_quant_enabled_flag, sh_dep_quant_used_flag or ph_dep_quant_enabled_flag.
[0428] The encoding device encodes a sign data hiding availability flag indicating whether sign data hiding is available (S1410). The encoding device can encode a sign data hiding availability flag indicating whether sign data hiding is available. The image information can include the sign data hiding availability flag. For example, the encoding device can determine whether sign data hiding is available for blocks of pictures in a sequence, and can encode a sign data hiding availability flag indicating whether sign data hiding is available. For example, the sign data hiding availability flag can be a flag indicating whether sign data hiding is available. For example, the sign data hiding availability flag can indicate whether sign data hiding is available. That is, for example, the sign data hiding availability flag can indicate whether sign data hiding is available for blocks of pictures in a sequence. For example, the sign data hiding available flag may indicate whether a sign data hiding enabled flag may be present, which indicates whether sign data hiding is used for the current slice. For example, the sign data hiding available flag having a value of 1 may indicate that the sign data hiding is enabled, and the sign data hiding available flag having a value of 0 may indicate that the sign data hiding is not enabled. For example, the sign data hiding available flag having a value of 1 may indicate that the sign data hiding enabled flag may be present, and the sign data hiding available flag having a value of 0 may indicate that the sign data hiding enabled flag is not present. Furthermore, for example, the sign data hiding available flag may be signaled with a Sequence Parameter Set (SPS) syntax.Alternatively, for example, the sign data hiding enabled flag may be signaled in the picture header syntax or the slice header syntax. The syntax element of the sign data hiding enabled flag may be the sps_sign_data_hiding_enabled_flag described above.
[0429] The encoding device encodes a TSRC availability flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag (S1420). The image information may include the TSRC availability flag.
[0430] For example, the encoding device can 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 can 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 can 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. In addition, 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 at a 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 at a decoding device. Additionally, for example, if the value of the dependent quantization availability flag is 1, the TSRC availability flag may not be encoded, and the value of the TSRC availability 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 (for example, 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 in the decoding device. Accordingly, 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). When dependent quantization and / or sign data hiding are available for the current block, the TSRC available flag may not be signaled (or encoded), and the value of the TSRC available flag may be derived as 0 in the decoding device. Here, the current block may be a coding block (CB) or a transform block (TB).
[0431] Here, for example, the TSRC availability flag may be a flag indicating whether the TSRC is available. That is, for example, the TSRC availability flag may be a flag indicating whether the TSRC is available for blocks within a slice. For example, the TSRC availability flag having a value of 1 may indicate that the TSRC is not available, and the TSRC availability flag having a value of 0 may indicate that the TSRC is available. In addition, for example, the TSRC availability flag may be signaled with a slice header syntax. The syntax element of the TSRC availability flag may be the above-described sh_ts_residual_coding_disabled_flag.
[0432] Meanwhile, for example, the encoding device can encode a transform skip availability flag indicating whether transform skip is available. The image information can include the transform skip availability flag. For example, the encoding device can determine whether transform skip is available for blocks of pictures in a sequence, and can encode a transform skip availability flag indicating whether transform skip is available. For example, the transform skip availability flag can be a flag indicating whether transform skip is available. For example, the transform skip availability flag can indicate whether transform skip is available. That is, for example, the transform skip availability flag can indicate whether transform skip is available for blocks of pictures in a sequence. For example, the transform skip availability flag can indicate whether a transform skip flag can exist. For example, the transform skip enabled flag having a value of 1 may indicate that the transform skip is enabled, and the transform skip enabled flag having a value of 0 may indicate that the transform skip is not enabled. That is, for example, the transform skip enabled flag having a value of 1 may indicate that the transform skip flag may exist, and the transform skip enabled flag having a value of 0 may indicate that the transform skip flag does not exist. In addition, for example, the transform skip enabled flag may be signaled with SPS (Sequence Parameter Set) syntax. The syntax element of the transform skip enabled flag may be the sps_transform_skip_enabled_flag described above.
[0433] Also, for example, the TSRC available flag can 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 can 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, 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), the TSRC available flag can be encoded (or signaled). In addition, 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, 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. In addition, 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.
[0434] The encoding device encodes residual information for the current block based on the TSRC availability flag (S1430). The encoding device can encode residual information for the current block based on the TSRC availability flag.
[0435] For example, the encoding device may determine the residual coding syntax for the current block based on the TSRC availability flag. For example, the encoding device may determine the residual coding syntax for the current block as one of the Regular Residual Coding (RRC) syntax and the Transform Skip Residual Coding (TSRC) syntax based on the TSRC availability flag. The RRC syntax may indicate a syntax according to RRC, and the TSRC syntax may indicate a syntax according to TSRC.
[0436] For example, based on the TSRC availability flag having a value of 1, the residual coding syntax for the current block may be determined as Regular Residual Coding (RRC) syntax. In this case, for example, a transform skip flag indicating whether the current block is transformed may be encoded, and the value of the transform skip flag may be 1. For example, the image information may include a transform skip flag for the current block. The transform skip flag may indicate whether the current block is transformed. That is, the transform skip flag may indicate whether a transform is applied to transform coefficients of the current block. A syntax element indicating the transform skip flag may be the above-described transform_skip_flag. For example, when the value of the transformation skip flag is 1, the transformation skip flag may indicate that transformation is not applied to the current block (i.e., transformation is skipped), and when the value of the transformation skip flag is 0, the transformation skip flag may indicate that transformation is applied to the current block. For example, when the current block is a transformation skip block, the value of the transformation skip flag for the current block may be 1.
[0437] Additionally, for example, based on the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined as a Transform Skip Residual Coding (TSRC) syntax. Additionally, for example, a transform skip flag for whether the current block is transform skipped may be encoded, and based on the transform skip flag having a value of 1 and the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined as a Transform Skip Residual Coding (TSRC) syntax. Additionally, for example, a transform skip flag for whether or not to skip transform of the current block can be encoded, and the residual coding syntax for the current block can be determined as 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.
[0438] Thereafter, for example, the encoding device can encode residual information of the determined residual coding syntax for the current block. The encoding device can derive a residual sample for the current block and encode residual information of the determined residual coding syntax for the residual sample of the current block. For example, residual information of a Regular Residual Coding (RRC) syntax can be encoded based on the TSRC availability flag having a value of 1, and residual information of a TSRC syntax can be encoded based on the TSRC availability flag having a value of 0. The image information can include residual information.
[0439] For example, the encoding device can determine whether to perform inter prediction or intra prediction on the current block, and can determine a specific inter prediction mode or a specific intra prediction mode based on the RD cost. Depending on the determined mode, the encoding device can derive prediction samples for the current block, and can derive residual samples for the current block by subtracting the original samples for the current block and the prediction samples.
[0440] Thereafter, for example, the encoding device can derive transform coefficients of the current block based on the residual samples. For example, the encoding device can determine whether transform is applied to the current block. That is, the encoding device can determine whether transform is applied to the residual samples of the current block. The encoding device can determine whether transform is applied to the current block by considering coding efficiency. For example, the encoding device can determine that transform is not applied to the current block. The block to which the transform is not applied can be represented as a transform skip block. That is, for example, the current block can be a transform skip block.
[0441] If no transformation is applied to the current block, that is, if no transformation is applied to the residual samples, the encoding device can derive the derived residual samples as the current transform coefficients. In addition, if a transformation is applied to the current block, that is, if a transformation is applied to the residual samples, the encoding device can perform a transformation on the residual samples to derive the transform coefficients. The current block may include a plurality of sub-blocks or coefficient groups (CGs). In addition, the size of the sub-block of the current block may be a 4x4 size or a 2x2 size. That is, the sub-block of the current block may include at most 16 non-zero transform coefficients or at most 4 non-zero transform coefficients. Here, the current block may be a coding block (CB) or a transform block (TB). Additionally, the transform coefficient can also be expressed as a residual coefficient.
[0442] Meanwhile, the encoding device may determine whether dependent quantization is applied to the current block. For example, if the dependent quantization is applied to the current block, the encoding device may perform the dependent quantization process on the transform coefficients to derive the transform coefficients of the current block. For example, if the dependent quantization is applied to the current block, the encoding device may update a state (Qstate) for dependent quantization based on a coefficient level of a transform coefficient immediately before the current transform coefficient in scanning order, derive a coefficient level of the current transform coefficient based on the updated state and syntax elements for the current transform coefficient, and quantize the derived coefficient level to derive the current transform coefficient. For example, the current transform coefficient may be quantized based on a quantization parameter for a reconstruction level of the current transform coefficient in a scalar quantizer for the updated state.
[0443] For example, if the residual coding syntax for the current block is determined as the RRC syntax, the encoding device can encode residual information of the RRC syntax for the current block. For example, the residual information of the RRC syntax can include the syntax elements disclosed in Table 2 described above.
[0444] For example, the residual information of the RRC syntax may include syntax elements for the transform coefficient of the current block. Here, the transform coefficient may also be expressed as a residual coefficient.
[0445] 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.
[0446] Specifically, for example, the syntax elements may include position information indicating the position of the last non-zero transform coefficient in the residual coefficient array of the current block. That is, the syntax elements may include position information indicating the position of the last non-zero transform coefficient in the 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. Syntax elements for the above location information may be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. Meanwhile, non-zero transform coefficients may also be called significant coefficients.
[0447] Additionally, for example, the syntax elements may include a coded sub-block flag indicating whether a current sub-block of the current block includes a non-zero transform coefficient, a valid coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag indicating whether a coefficient level for the transform coefficient is greater than a first threshold, a parity level flag indicating parity of the coefficient level, and / or a second coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a second threshold. Here, the coded sub-block flag may be sb_coded_flag or coded_sub_block_flag, the valid 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.
[0448] Additionally, for example, the syntax elements may include coefficient value-related information regarding the values of the transform coefficients of the current block. The coefficient value-related information may be abs_remainder and / or dec_abs_level.
[0449] Additionally, for example, the syntax elements may include a sign flag indicating the sign of the transform coefficient. The sign flag may be coeff_sign_flag.
[0450] Meanwhile, for example, when the sine data hiding is applied to the current block, the sine flag of the first valid transform coefficient of the current CG (coefficient group) in the current block may not be encoded and signaled. That is, for example, when the sine data hiding is applied to the current block, the syntax elements may not include a sine flag indicating the sign of the first valid transform coefficient. Meanwhile, for example, whether the sine data hiding is applied to the current block may be derived based on the sine data hiding availability flag and / or the first valid transform coefficient position and the last valid transform coefficient position of the current CG. For example, when the value of the sine data hiding availability flag is 1 and the 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 value of the sine data hiding availability flag is 1 and the number of valid transform coefficients in the current CG is greater than 3), the sine data hiding may be applied to the current CG of the current block.
[0451] Additionally, for example, if the residual coding syntax for the current block is determined as the TSRC syntax, the encoding device may encode residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax may include the syntax elements disclosed in Table 3 described above.
[0452] For example, the residual information of the TSRC syntax may include syntax elements for the transform coefficient of the current block. Here, the transform coefficient may also be expressed as a residual coefficient.
[0453] 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.
[0454] For example, the context coded syntax elements for the transform coefficients may include a significant coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient, a sign flag indicating a sign of the transform coefficient, a first coefficient level flag indicating whether a coefficient level of the transform coefficient is greater than a first threshold, and / or a parity level flag indicating parity of a coefficient level of the transform coefficient. Further, for example, the context coded syntax elements may include a second coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a second threshold, a third coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a third threshold, a fourth coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a fifth threshold. Here, the valid coefficient flag may be sig_coeff_flag, the sign flag may be ceff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, and the parity level flag may be par_level_flag. In addition, 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.
[0455] Additionally, for example, the bypass-coded syntax elements for the transform coefficients may include coefficient level information for the values (or coefficient levels) of the transform coefficients and / or a sign flag indicating a sign for the transform coefficients. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be ceff_sign_flag.
[0456] The encoding device 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 device may output image 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.
[0457] 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 intra-prediction mode performed on the current block.
[0458] Meanwhile, the bitstream may be transmitted to a decoding device via a network or (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 USB, SD, CD, DVD, Blu-ray, HDD, and SSD.
[0459] Fig. 15 schematically illustrates an encoding device that performs an image encoding method according to the present document. The method disclosed in Fig. 14 can be performed by the encoding device disclosed in Fig. 15. Specifically, for example, the entropy encoding unit of the encoding device of Fig. 15 can perform S1400 to S1440 of Fig. 14. In addition, although not illustrated, the process of deriving a prediction sample can be performed by the prediction unit of the encoding device, the process of deriving a residual sample for the current block based on the original sample and the prediction sample for the current block can be performed by the 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 prediction sample for the current block can be performed by the addition unit of the encoding device.
[0460] Fig. 16 schematically illustrates an image decoding method by a decoding device according to the present document. The method disclosed in Fig. 16 can be performed by the decoding device disclosed in Fig. 3. Specifically, for example, S1600 to S1630 of Fig. 16 can be performed by an entropy decoding unit of the decoding device, S1640 of Fig. 16 can be performed by a residual processing unit of the decoding device, and S1650 of Fig. 16 can be performed by an adding unit of the decoding device. In addition, although not illustrated, a process of receiving prediction information for a current block can be performed by an entropy decoding unit of the decoding device, and a process of deriving a prediction sample of the current block can be performed by a prediction unit of the decoding device.
[0461] A decoding device obtains a dependent quantization availability flag indicating whether dependent quantization is available (S1600). The decoding device can obtain image information including the dependent quantization availability flag through a bitstream. The image information can include the dependent quantization availability flag. For example, the dependent quantization availability flag can be a flag indicating whether dependent quantization is available. For example, the dependent quantization availability flag can indicate whether dependent quantization is available. That is, for example, the dependent quantization availability flag can indicate whether dependent quantization is available for blocks of pictures in a sequence. For example, the dependent quantization availability flag can indicate whether a dependent quantization use flag indicating whether dependent quantization is used for a current slice may exist. For example, the dependent quantization enabled flag having a value of 1 may indicate that the dependent quantization is enabled, and the dependent quantization enabled flag having a value of 0 may indicate that the dependent quantization is not enabled. In addition, for example, the dependent quantization enabled flag may be signaled by SPS syntax or slice header syntax, etc. The syntax element of the dependent quantization enabled flag may be the sps_dep_quant_enabled_flag described above. The sps_dep_quant_enabled_flag may be called sh_dep_quant_enabled_flag, sh_dep_quant_used_flag, or ph_dep_quant_enabled_flag.
[0462] A decoding device obtains a sign data hiding availability flag indicating whether sign data hiding is available (S1610). The decoding device can obtain image information including the sign data hiding availability flag through a bitstream. The image information can include the sign data hiding availability flag. For example, the sign data hiding availability flag can be a flag indicating whether sign data hiding is available. For example, the sign data hiding availability flag can indicate whether sign data hiding is available. That is, for example, the sign data hiding availability flag can indicate whether sign data hiding is available for blocks of pictures in a sequence. For example, the sign data hiding availability flag can indicate whether a sign data hiding use flag indicating whether sign data hiding is used for a current slice may exist. 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 with a Sequence Parameter Set (SPS) syntax. Or, for example, the sign data hiding available flag may be signaled with a picture header syntax or a slice header syntax.The syntax element of the above sign data hiding enabled flag may be the sps_sign_data_hiding_enabled_flag described above.
[0463] The decoding device obtains a TSRC availability flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag (S1620). The image information may include the TSRC availability flag.
[0464] For example, the decoding device can 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 can 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, 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 can be obtained. 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. In addition, 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. In addition, 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 (for example, 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. Accordingly, 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 acquired). When dependent quantization and / or sign data hiding are available for the current block, the TSRC available flag may not be signaled (or acquired), 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).
[0465] Here, for example, the TSRC availability flag may be a flag indicating whether the TSRC is available. That is, for example, the TSRC availability flag may be a flag indicating whether the TSRC is available for blocks within a slice. For example, the TSRC availability flag having a value of 1 may indicate that the TSRC is not available, and the TSRC availability flag having a value of 0 may indicate that the TSRC is available. In addition, for example, the TSRC availability flag may be signaled with a slice header syntax. The syntax element of the TSRC availability flag may be the above-described sh_ts_residual_coding_disabled_flag.
[0466] Meanwhile, for example, a decoding device can obtain a transform skip available flag. The decoding device can obtain image information including the transform skip available flag through a bitstream. The image information can include the transform skip available flag. Here, the current block can be a coding block (CB) or a transform block (TB). For example, the transform skip available flag can be a flag indicating whether transform skip is available. For example, the transform skip available flag can indicate whether transform skip is available. That is, for example, the transform skip available flag can indicate whether transform skip is available for blocks of pictures in a sequence. For example, the transform skip available flag can indicate whether a transform skip flag can exist. For example, the transform skip enabled flag having a value of 1 may indicate that the transform skip is enabled, and the transform skip enabled flag having a value of 0 may indicate that the transform skip is not enabled. That is, for example, the transform skip enabled flag having a value of 1 may indicate that the transform skip flag may exist, and the transform skip enabled flag having a value of 0 may indicate that the transform skip flag does not exist. In addition, for example, the transform skip enabled flag may be signaled with SPS (Sequence Parameter Set) syntax. The syntax element of the transform skip enabled flag may be the sps_transform_skip_enabled_flag described above.
[0467] Also, for example, the TSRC available flag can be acquired based on the sine data hiding available flag, the dependent quantization available flag, and / or the transform skip available flag. For example, the TSRC available flag can be acquired based on the sine 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, when the value of the sine data hiding available flag is 0 (i.e., the sine data hiding available flag indicates that sine 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), the TSRC available flag can be acquired (or signaled). In addition, 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. In addition, 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.
[0468] The decoding device obtains residual information for the current block based on the TSRC availability flag (S1630). The decoding device can obtain residual information for the current block based on the TSRC availability flag.
[0469] For example, the decoding device may determine the residual coding syntax for the current block based on the TSRC availability flag. For example, the decoding device may determine the residual coding syntax for the current block as one of the Regular Residual Coding (RRC) syntax and the Transform Skip Residual Coding (TSRC) syntax based on the TSRC availability flag. The RRC syntax may indicate a syntax according to RRC, and the TSRC syntax may indicate a syntax according to TSRC.
[0470] For example, based on the TSRC available flag having a value of 1, the residual coding syntax for the current block may be determined as Regular Residual Coding (RRC) syntax. In this case, for example, a transform skip flag for whether to skip transform of the current block may be obtained based on the transform skip available flag having a value of 1, and the value of the transform skip flag may be 1. For example, the image information may include a transform skip flag for the current block. The transform skip flag may indicate whether to skip transform of the current block. That is, the transform skip flag may indicate whether transform is applied to transform coefficients of the current block. A syntax element indicating the transform skip flag may be the above-described transform_skip_flag. For example, when the value of the transformation skip flag is 1, the transformation skip flag may indicate that transformation is not applied to the current block (i.e., transformation is skipped), and when the value of the transformation skip flag is 0, the transformation skip flag may indicate that transformation is applied to the current block. For example, when the current block is a transformation skip block, the value of the transformation skip flag for the current block may be 1.
[0471] Additionally, for example, based on the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined as a Transform Skip Residual Coding (TSRC) syntax. Additionally, for example, a transform skip flag for whether the current block is transform skipped may be obtained, and based on the transform skip flag having a value of 1 and the TSRC availability flag having a value of 0, the residual coding syntax for the current block may be determined as a Transform Skip Residual Coding (TSRC) syntax. Additionally, for example, a transform skip flag for whether or not the transform of the current block is skipped can be obtained, and based on the transform skip flag having a value of 0 and the TSRC availability flag having a value of 0, the residual coding syntax for the current block can be determined as a regular residual coding (RRC) syntax.
[0472] Thereafter, for example, the decoding device can obtain residual information of the determined residual coding syntax for the current block. For example, residual information of the Regular Residual Coding (RRC) syntax can be obtained based on the TSRC availability flag having a value of 1, and residual information of the TSRC syntax can be obtained based on the TSRC availability flag having a value of 0. The image information can include residual information.
[0473] For example, if the residual coding syntax for the current block is determined as the RRC syntax, the decoding device can obtain residual information of the RRC syntax for the current block. For example, the residual information of the RRC syntax can include the syntax elements disclosed in Table 2 described above.
[0474] For example, the residual information of the RRC syntax may include syntax elements for the transform coefficient of the current block. Here, the transform coefficient may also be expressed as a residual coefficient.
[0475] 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.
[0476] Specifically, for example, the syntax elements may include position information indicating the position of the last non-zero transform coefficient in the residual coefficient array of the current block. That is, the syntax elements may include position information indicating the position of the last non-zero transform coefficient in the 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. Syntax elements for the above location information may be last_sig_coeff_x_prefix, last_sig_coeff_y_prefix, last_sig_coeff_x_suffix, and last_sig_coeff_y_suffix. Meanwhile, non-zero transform coefficients may also be called significant coefficients.
[0477] Additionally, for example, the syntax elements may include a coded sub-block flag indicating whether a current sub-block of the current block includes a non-zero transform coefficient, a valid coefficient flag indicating whether a transform coefficient of the current block is a non-zero transform coefficient, a first coefficient level flag indicating whether a coefficient level for the transform coefficient is greater than a first threshold, a parity level flag indicating parity of the coefficient level, and / or a second coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a second threshold. Here, the coded sub-block flag may be sb_coded_flag or coded_sub_block_flag, the valid 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.
[0478] Additionally, for example, the syntax elements may include coefficient value-related information regarding the values of the transform coefficients of the current block. The coefficient value-related information may be abs_remainder and / or dec_abs_level.
[0479] Additionally, for example, the syntax elements may include a sign flag indicating the sign of the transform coefficient. The sign flag may be coeff_sign_flag.
[0480] Meanwhile, for example, when the sine data hiding is applied to the current block, the sine flag of the first valid transform coefficient of the current CG (coefficient group) in the current block may not be signaled. That is, for example, when the sine data hiding is applied to the current block, the syntax elements may not include a sine flag indicating the sign of the first valid transform coefficient. Meanwhile, for example, whether the sine data hiding is applied to the current block may be derived based on the sine data hiding availability flag and / or the first valid transform coefficient position and the last valid transform coefficient position of the current CG. For example, when the value of the sine data hiding availability flag is 1 and the 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 value of the sine data hiding availability flag is 1 and the number of valid transform coefficients in the current CG is greater than 3), the sine data hiding may be applied to the current CG of the current block.
[0481] Additionally, for example, if the residual coding syntax for the current block is determined as the TSRC syntax, the decoding device can obtain residual information of the TSRC syntax for the current block. For example, the residual information of the TSRC syntax can include the syntax elements disclosed in Table 3 described above.
[0482] For example, the residual information of the TSRC syntax may include syntax elements for the transform coefficient of the current block. Here, the transform coefficient may also be expressed as a residual coefficient.
[0483] 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.
[0484] For example, the context coded syntax elements for the transform coefficients may include a significant coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient, a sign flag indicating a sign of the transform coefficient, a first coefficient level flag indicating whether a coefficient level of the transform coefficient is greater than a first threshold, and / or a parity level flag indicating parity of a coefficient level of the transform coefficient. Further, for example, the context coded syntax elements may include a second coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a second threshold, a third coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a third threshold, a fourth coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a fourth threshold, and / or a fifth coefficient level flag indicating whether the coefficient level of the transform coefficient is greater than a fifth threshold. Here, the valid coefficient flag may be sig_coeff_flag, the sign flag may be ceff_sign_flag, the first coefficient level flag may be abs_level_gt1_flag, and the parity level flag may be par_level_flag. In addition, 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.
[0485] Additionally, for example, the bypass-coded syntax elements for the transform coefficients may include coefficient level information for the values (or coefficient levels) of the transform coefficients and / or a sign flag indicating a sign for the transform coefficients. The coefficient level information may be abs_remainder and / or dec_abs_level, and the sign flag may be ceff_sign_flag.
[0486] The decoding device derives residual samples of the current block based on the residual information (S1640). For example, the decoding device can derive transform coefficients of the current block based on the residual information, and can derive residual samples of the current block based on the transform coefficients.
[0487] For example, the decoding device can derive transform coefficients of the current block based on syntax elements of the residual information. Thereafter, the decoding device can derive residual samples of the current block based on the transform coefficients. For example, if it is determined that no transform is applied to the current block based on the transform skip flag, that is, if the value of the transform skip flag is 1, the decoding device can derive the transform coefficients as the residual samples of the current block. Alternatively, for example, if it is determined that no transform is applied to the current block based on the transform skip flag, that is, if the value of the transform skip flag is 1, the decoding device can dequantize the transform coefficients to derive the residual samples of the current block. Alternatively, for example, if it is determined that a transformation has been applied to the current block based on the transformation skip flag, that is, if the value of the transformation skip flag is 0, the decoding device may inversely transform the transformation coefficients to derive the residual samples of the current block. Alternatively, for example, if it is determined that a transformation has been applied to the current block based on the transformation skip flag, that is, if the value of the transformation skip flag is 0, the decoding device may inversely quantize the transformation coefficients and inversely transform the inversely quantized transformation coefficients to derive the residual samples of the current block.
[0488] Meanwhile, when the dependent quantization is applied to the current block, the decoding device can perform the dependent quantization process on the transform coefficients to derive the residual samples of the current block. For example, when the dependent quantization is applied to the current block, the decoding device can update the state (Qstate) for dependent quantization based on the coefficient level of the transform coefficient immediately before the current transform coefficient in the scanning order, derive the coefficient level of the current transform coefficient based on the updated state and syntax elements for the current transform coefficient, and dequantize the derived coefficient level to derive the residual sample. For example, the current transform coefficient can be dequantized based on a quantization parameter for a reconstruction level of the current transform coefficient in a scalar quantizer for the updated state. Here, the reconstruction level can be derived based on syntax elements for the current transform coefficient.
[0489] Meanwhile, for example, when the sign data hiding is applied to the current block, the sign of the first valid transform coefficient of the current CG in the current block can be derived based on the sum of the absolute values of the valid transform coefficients in the current CG. For example, when the sum of the absolute values of the valid transform coefficients is even, the sign of the first valid transform coefficient can be derived as a positive value, and when the sum of the absolute values of the valid transform coefficients is odd, the sign of the first valid transform coefficient can be derived as a negative value.
[0490] The decoding device generates a reconstructed picture based on the residual sample (S1650). For example, the decoding device may generate a reconstructed sample and / or a reconstructed picture of the current block based on the residual sample. For example, the decoding device may perform an inter-prediction mode or an intra-prediction mode for the current block based on prediction information received through a bitstream to derive a prediction sample, and may generate the reconstructed sample by adding the prediction sample and the residual sample.
[0491] As described above, in-loop filtering procedures such as deblocking filtering, SAO and / or ALF procedures may be applied to the restored picture to improve subjective / objective image quality as needed.
[0492] Fig. 17 schematically illustrates a decoding device that performs an image decoding method according to the present document. The method disclosed in Fig. 16 can be performed by the decoding device disclosed in Fig. 17. Specifically, for example, the entropy decoding unit of the decoding device of Fig. 17 can perform S1600 to S1630 of Fig. 16, the residual processing unit of the decoding device of Fig. 17 can perform S1640 of Fig. 16, and the adding unit of the decoding device of Fig. 17 can perform S1650 of Fig. 16. In addition, although not illustrated, the process of receiving prediction information for the current block can be performed by the entropy decoding unit of the decoding device of Fig. 17, and the process of deriving a prediction sample of the current block can be performed by the prediction unit of the decoding device of Fig. 17.
[0493] According to the above-mentioned document, the efficiency of residual coding can be improved.
[0494] In addition, according to this document, a signaling relationship between the sign data hiding availability flag and the TSRC availability flag is established so that the TSRC availability flag can be signaled when sign data hiding is not available, thereby improving coding efficiency by not using sign data hiding when TSRC is not available and RRC syntax is coded for a transform skip block, and reducing the amount of coded bits to improve overall residual coding efficiency.
[0495] In addition, according to this document, a signaling relationship between the dependent quantization available flag and the TSRC available flag is established so that the TSRC available flag can be signaled when dependent quantization is not available, thereby improving coding efficiency by not using dependent quantization when the RRC syntax is coded for a transform skip block because TSRC is not available, and reducing the amount of coded bits to improve the overall residual coding efficiency.
[0496] Additionally, according to this document, by establishing a signaling relationship between the transform skip available flag and the TSRC available flag, the TSRC available flag can be signaled when transform skip is available, thereby reducing the amount of bits to be coded and improving the overall residual coding efficiency.
[0497] While the methods described in the above-described embodiments are described based on a flowchart as a series of steps or blocks, this document is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps described above. Furthermore, those skilled in the art will appreciate that the steps depicted in the flowchart are not exclusive, and that other steps may be included, or one or more steps in the flowchart may be deleted, without affecting the scope of this document.
[0498] The embodiments described in this document may be implemented and performed on a processor, microprocessor, controller, or chip. For example, the functional units depicted in each drawing may be implemented and performed on a computer, processor, microprocessor, controller, or chip. In this case, information for implementation (e.g., information on instructions) or algorithms may be stored on a digital storage medium.
[0499] In addition, the decoding device and encoding device to which the embodiments of the present document are applied may be included in a multimedia broadcasting transmitting and 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 video-on-demand (VoD) service providing device, an OTT video (Over the top video) device, an Internet streaming service providing device, a three-dimensional (3D) video device, a video phone video device, a transportation terminal (e.g., a vehicle terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, and may be used to process a video signal or a data signal. For example, the OTT video (Over the top video) device may include a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a DVR (Digital Video Recorder), etc.
[0500] In addition, the processing method to which the embodiments of the present document are applied can be produced in the form of a computer-executable program and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to the present document can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium can 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. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by an encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.
[0501] Additionally, the embodiments of the present document can be implemented as a computer program product by program code, and the program code can be executed on a computer by the embodiments of the present document. The program code can be stored on a computer-readable carrier.
[0502] Figure 18 illustrates an exemplary structure of a content streaming system to which embodiments of this document are applied.
[0503] A content streaming system to which the embodiments of this document are applied may largely include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
[0504] The encoding server compresses content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data, generates a bitstream, and transmits it to the streaming server. Alternatively, if multimedia input devices such as smartphones, cameras, and camcorders directly generate bitstreams, the encoding server may be omitted.
[0505] The above bitstream can be generated by an encoding method or a bitstream generation method to which the embodiments of the present document are applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0506] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits the multimedia data to the user. At this time, the content streaming system may include a separate control server, in which case the control server controls commands / responses between each device within the content streaming system.
[0507] The streaming server can receive content from a media repository and / or an encoding server. For example, when receiving content from the encoding server, the content can be received in real time. In this case, to provide a smooth streaming service, the streaming server can store the bitstream for a certain period of time.
[0508] Examples of the user devices may include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, 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 from each server may be distributedly processed.
[0509] The claims set forth in this specification may be combined in various ways. For example, the technical features of the method claims of this specification may be combined and implemented as a device, and the technical features of the device claims of this specification may be combined and implemented as a method. Furthermore, the technical features of the method claims and the technical features of the device claims of this specification may be combined and implemented as a device, and the technical features of the method claims and the technical features of the device claims of this specification may be combined and implemented as a method.
Claims
1. In a video decoding method performed by a decoding device, A step of obtaining a dependent quantization available flag for determining whether dependent quantization is available; A step of obtaining a sign data hiding availability flag for determining whether sign data hiding is available; A step of obtaining a TSRC availability flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag; A step of obtaining residual information for the current block based on the above TSRC availability flag; A step of deriving a residual sample of the current block based on the residual information; and Including a step of generating a restored picture based on the above residual sample, An image decoding method, characterized in that the above TSRC availability flag is obtained based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.
2. In paragraph 1, The above sign data hiding availability flag having a value of 1 indicates that the above sign data hiding is available, A method of decoding an image, wherein the sign data hiding availability flag having a value of 0 indicates that the sign data hiding is not available.
3. In paragraph 1, The dependent quantization available flag having a value of 1 indicates that the dependent quantization is available, A method of image decoding, wherein the dependent quantization available flag having a value of 0 indicates that the dependent quantization is not available.
4. In paragraph 1, The above TSRC availability flag having a value of 1 indicates that the TSRC is not available, A video decoding method, wherein the TSRC availability flag having a value of 0 indicates that the TSRC is available.
5. In paragraph 1, An image decoding method, characterized in that the TSRC available flag is acquired when the dependent quantization is not available for the current block and the sign data hiding is not available for the current block.
6. In paragraph 1, An image decoding method, characterized in that when the sign data hiding is applied to the current block, the TSRC available flag is not acquired and the value of the TSRC available flag is derived as 0.
7. In paragraph 6, An image decoding method, characterized in that when the sign data hiding is applied to the current block, the sign of the first valid transform coefficient of the current CG (coefficient group) in the current block is derived based on the sum of the absolute values of the valid transform coefficients in the current CG.
8. In paragraph 7, An image decoding method, characterized in that when the sign data hiding is applied to the current block, the residual information does not include a sign flag for the first valid transform coefficient.
9. In paragraph 4, A video decoding method, characterized in that residual information of a Regular Residual Coding (RRC) syntax is obtained based on the TSRC availability flag having a value of 1.
10. In paragraph 9, A conversion skip flag is obtained for whether or not to skip the conversion of the current block. An image decoding method, characterized in that the value of the above conversion skip flag is 1.
11. In paragraph 4, An image decoding method, characterized in that when the current block is a transformation skip block and the value of the TSRC availability flag is 0, the residual information for the current block is residual information of the TSRC syntax.
12. In paragraph 11, The residual information of the above TSRC syntax includes context-coded syntax elements for transform coefficients, A video decoding method, characterized in that the context coded syntax elements include a valid coefficient flag indicating whether the transform coefficient is a non-zero transform coefficient, a parity level flag for 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 threshold, and a second coefficient level flag for whether the coefficient level of the transform coefficient is greater than a second threshold.
13. In paragraph 1, An image decoding method, characterized in that when the dependent quantization is applied to the current block, the TSRC available flag is not acquired and the value of the TSRC available flag is derived as 0.
14. In a video encoding method performed by an encoding device, A step of encoding a dependent quantization availability flag indicating whether dependent quantization is available; A step of encoding a sign data hiding availability flag indicating whether sign data hiding is available; A step of encoding a TSRC availability flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag; A step of encoding residual information for the current block based on the above TSRC availability flag; and A step of generating a bitstream including the dependent quantization availability flag, the sign data hiding availability flag, the TSRC availability flag and the residual information, A video encoding method, characterized in that the above TSRC availability flag is encoded based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.
15. A computer-readable digital storage medium storing a bitstream including image information that causes a decoding device to perform an image decoding method, wherein the image decoding method comprises: A step of obtaining a dependent quantization available flag for determining whether dependent quantization is available; A step of obtaining a sign data hiding availability flag for determining whether sign data hiding is available; A step of obtaining a TSRC availability flag indicating whether Transform Skip Residual Coding (TSRC) is available based on the dependent quantization availability flag and the sign data hiding availability flag; A step of obtaining residual information for the current block based on the above TSRC availability flag; A step of deriving a residual sample of the current block based on the residual information; and Including a step of generating a restored picture based on the above residual sample, A computer-readable digital storage medium, characterized in that the TSRC availability flag is obtained based on the dependent quantization availability flag having a value of 0 and the sign data hiding availability flag having a value of 0.