Decoding apparatus, encoding apparatus, and data transmission apparatus

By using a palette mode-based method in image encoding/decoding, selectively updating the palette predictor, the problem of low high-resolution image encoding/decoding efficiency in the prior art is solved, and more efficient image transmission and storage are achieved.

CN119996672APending Publication Date: 2025-05-13NOKIA TECHNOLOGIES OY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510311691.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-09-23
Filing Date
2020-09-23
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve the encoding/decoding efficiency of high resolution and high-quality images, resulting in increased transmission and storage costs.

Method used

The image encoding/decoding method based on the palette mode is adopted, and the palette predictor is selectively updated through the division structure of the current block, thereby improving the encoding/decoding efficiency.

Benefits of technology

Improved encoding/decoding efficiency is achieved, reducing transmission and storage costs, and improving image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996672A_ABST
    Figure CN119996672A_ABST
Patent Text Reader

Abstract

The invention relates to a decoding apparatus, an encoding apparatus, and a data transmission apparatus. An image encoding / decoding method and apparatus are provided. An image decoding method according to the present disclosure comprises the steps of: acquiring palette information and palette index prediction information on a current block from a bitstream when a palette mode is applied to the current block; forming a palette predictor for the current block based on the palette information, and forming a palette table for the current block based on the palette predictor; generating a palette index map for the current block based on the palette index prediction information; and decoding the current block based on the palette table and the palette index map, where the palette predictor may be selectively updated based on a partition structure of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the original application number 202080066527.8 (international application number: PCT / KR2020 / 012898, application date: September 23, 2020, invention name: Image encoding / decoding method and device using palette mode and method for sending bit stream). Technical Field

[0002] The present disclosure relates to an image encoding / decoding method and device using a palette mode and a method for sending a bitstream, and more specifically, to an image encoding / decoding method and device that selectively updates a palette predictor based on a partition structure of a current block and a method for sending a bitstream generated by the image encoding method / device of the present disclosure. Background Art

[0003] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, is increasing in various fields. As the resolution and quality of image data are improved, the amount of information or bit volume transmitted is relatively increased compared to existing image data. The increase in the amount of information or bit volume transmitted leads to an increase in transmission cost and storage cost.

[0004] Therefore, efficient image compression technology is needed to effectively transmit, store, and reproduce information about high-resolution and high-quality images. Summary of the invention

[0005] Technical issues

[0006] An object of the present disclosure is to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0007] An object of the present disclosure is to provide an image encoding / decoding method and apparatus using a palette mode.

[0008] The present disclosure aims to provide an image encoding / decoding method and device for selectively updating a palette predictor based on a partition structure of a current block.

[0009] An object of the present disclosure is to provide an image encoding / decoding method and apparatus for selectively applying a palette mode based on a division structure of a current block.

[0010] Another object of the present disclosure is to provide a method for transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0011] Another object of the present disclosure is to provide a recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0012] Another object of the present disclosure is to provide a recording medium storing a bit stream received and decoded by the image decoding apparatus according to the present disclosure and used to reconstruct an image.

[0013] The technical problems solved by the present disclosure are not limited to the above-mentioned technical problems, and other technical problems not described here will be clear to those skilled in the art through the following description.

[0014] Technical Solution

[0015] According to one aspect of the present disclosure, an image decoding method performed by an image decoding device may include the following steps: based on a palette mode applied to a current block, obtaining palette information and palette index prediction information of the current block from a bitstream; constructing a palette predictor for the current block based on the palette information and constructing a palette table for the current block based on the palette predictor; generating a palette index map for the current block based on the palette index prediction information; and decoding the current block based on the palette table and the palette index map. The palette predictor may be selectively updated based on the partition structure of the current block.

[0016] In addition, an image decoding device according to an aspect of the present disclosure may include a memory and at least one processor. The at least one processor may apply a palette mode to a current block, obtain palette information and palette index prediction information of the current block from a bitstream; construct a palette predictor for the current block based on the palette information and construct a palette table for the current block based on the palette predictor; generate a palette index map for the current block based on the palette index prediction information; and decode the current block based on the palette table and the palette index map. The palette predictor may be selectively updated based on the partition structure of the current block.

[0017] In addition, according to an aspect of the present disclosure, an image encoding method performed by an image encoding device may include the following steps: based on a palette mode applied to a current block, constructing a palette predictor for the current block and constructing a palette table for the current block based on the palette predictor; generating a palette index map for the current block based on the palette table; and encoding the current block based on the palette index map. Selectively updating the palette predictor based on the partition structure of the current block.

[0018] In addition, a transmission method according to another aspect of the present disclosure may transmit a bit stream generated by the image encoding device or the image encoding method of the present disclosure.

[0019] In addition, a computer-readable recording medium according to another aspect of the present disclosure may store a bit stream generated by the image encoding device or the image encoding method of the present disclosure.

[0020] The features described above in brief summary of the present disclosure are merely exemplary aspects of the following detailed description of the present disclosure and do not limit the scope of the present disclosure.

[0021] Beneficial Effects

[0022] According to the present disclosure, it is possible to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0023] According to the present disclosure, it is possible to provide an image encoding / decoding method and device based on an improved palette mode.

[0024] According to the present disclosure, it is possible to provide an image encoding / decoding method and apparatus for selectively applying a palette mode based on a division structure of a current block.

[0025] Furthermore, according to the present disclosure, it is possible to provide a method of transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0026] Furthermore, according to the present disclosure, it is possible to provide a recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0027] Furthermore, according to the present disclosure, it is possible to provide a recording medium that stores a bit stream received and decoded by the image decoding device according to the present disclosure and used to reconstruct an image.

[0028] Those skilled in the art will understand that the effects that can be achieved through the present disclosure are not limited to what has been specifically described above, and other advantages of the present disclosure will be more clearly understood from the detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a diagram schematically showing a video encoding system to which an embodiment of the present disclosure is applicable.

[0030] Figure 2 is a view schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.

[0031] Figure 3 is a view schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

[0032] Figure 4 is a view showing a segmentation structure of an image according to an embodiment.

[0033] Figure 5 is a view showing an embodiment of a partition type of a block according to a multi-type tree structure.

[0034] Figure 6is a diagram illustrating a signaling mechanism of block partitioning information in a quadtree having a nested multi-type tree structure according to the present disclosure.

[0035] Figure 7 is a diagram showing an embodiment of dividing a CTU into a plurality of CUs.

[0036] Figure 8 is a view illustrating an embodiment of a redundancy division pattern.

[0037] Fig. 9 is a view illustrating an example of a luma block and a chroma block in a 4:2:0 color format.

[0038] Figures 10a to 10c is a view illustrating an example of a syntax for switching a single tree structure to a dual tree structure.

[0039] Fig.11 is a flowchart illustrating a video / image encoding method based on intra-frame prediction.

[0040] Fig.12 is a view illustrating a configuration of an intra predictor according to the present disclosure.

[0041] Fig.13 is a flowchart illustrating a video / image decoding method based on intra-frame prediction.

[0042] Fig.14 is a view illustrating a configuration of an intra predictor according to the present disclosure.

[0043] Fig.15 is a view illustrating an example of a scanning method that can be used in the palette mode.

[0044] Fig.16 is a view illustrating an example of palette encoding processing of the current block.

[0045] Fig.17 is a view illustrating some coding_unit syntax for palette mode.

[0046] Figures 18a to 18e is a view illustrating the palette_coding syntax for palette mode.

[0047] Fig.19 is a view illustrating an example of a CTU having a local dual tree structure.

[0048] Fig. 20 is exemplified in Fig.19 FIG. 1 is a view of an example of a decoding process of a CU in an example.

[0049] Fig.21 and Fig. 22 is exemplified in Fig. 20 A view that addresses issues that occur when applying palette mode in the decoding process.

[0050] Fig.23 is a flowchart illustrating a palette encoding method according to an embodiment of the present disclosure.

[0051] Fig.24 is exemplified in Fig.19 The example in the example does not update the palette predictor when the palette encoding process is in view.

[0052] Fig.25 is a view illustrating an example of a process of selectively updating a palette predictor based on a partition structure of a current block.

[0053] Fig.26 is a flowchart illustrating a palette decoding method according to an embodiment of the present disclosure.

[0054] Fig. 27 is a flowchart illustrating a palette encoding method according to an embodiment of the present disclosure.

[0055] Fig.28 is a view illustrating a detailed example of the coding_unit syntax including a palette mode flag.

[0056] Fig.29 is a flowchart illustrating a palette decoding method according to an embodiment of the present disclosure.

[0057] Fig.30 is a diagram showing a content streaming system to which an embodiment of the present disclosure is applicable. DETAILED DESCRIPTION

[0058] Hereinafter, the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to facilitate implementation by those skilled in the art. However, the present disclosure can be implemented in various forms and is not limited to the embodiments described herein.

[0059] When describing the present disclosure, if it is determined that the detailed description of related known functions or configurations makes the scope of the present disclosure unnecessarily ambiguous, the detailed description thereof will be omitted. In the drawings, parts irrelevant to the description of the present disclosure are omitted, and like reference numerals are given to like parts.

[0060] In the present disclosure, when a component is "connected", "coupled" or "linked" to another component, it may include not only a direct connection relationship but also an indirect connection relationship with intermediate components. In addition, when a component "includes" or "has" other components, unless otherwise specified, it means that other components may also be included, rather than excluding other components.

[0061] In the present disclosure, the terms first, second, etc. are used only for the purpose of distinguishing one component from other components, and do not limit the order or importance of the components unless otherwise specified. Accordingly, within the scope of the present disclosure, a first component in one embodiment may be referred to as a second component in another embodiment, and similarly, a second component in one embodiment may be referred to as a first component in another embodiment.

[0062] In the present disclosure, components that are distinguished from each other are intended to clearly describe each feature and do not mean that the components must be separated. That is, multiple components can be integrated and implemented in one hardware or software unit, or one component can be distributed and implemented in multiple hardware or software units. Therefore, even if not specifically stated, implementations in which these components are integrated or distributed are also included in the scope of the present disclosure.

[0063] In the present disclosure, the components described in each embodiment are not necessarily indispensable components, and some components may be optional components. Therefore, the embodiments consisting of a subset of the components described in the embodiments are also included in the scope of the present disclosure. In addition, the embodiments including other components in addition to the components described in the various embodiments are included in the scope of the present disclosure.

[0064] The present disclosure relates to encoding and decoding of images. Unless otherwise defined in the present disclosure, terms used in the present disclosure may have general meanings commonly used in the technical field to which the present disclosure belongs.

[0065] In the present disclosure, a "picture" generally refers to a unit of an image within a specific time period, and a slice / tile is a coding unit that constitutes a part of a picture, and a picture may be composed of one or more slices / tiles. In addition, a slice / tile may include one or more coding tree units (CTUs).

[0066] In the present disclosure, "pixel" or "pel" may refer to the smallest unit constituting a picture (or image). In addition, "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, or may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component.

[0067] In the present disclosure, a "unit" may refer to a basic unit of image processing. The unit may include at least one of a specific area of ​​a picture and information related to the area. In some cases, the unit may be used interchangeably with terms such as "sample array", "block" or "area". In general, an M×N block may include M columns and N rows of samples (or sample arrays) or a set (or array) of transform coefficients.

[0068] In the present disclosure, "current block" may mean one of "current coding block", "current coding unit", "coding target block", "decoding target block" or "processing target block". When prediction is performed, "current block" may mean "current prediction block" or "prediction target block". When transform (inverse transform) / quantization (dequantization) is performed, "current block" may mean "current transform block" or "transform target block". When filtering is performed, "current block" may mean "filtering target block".

[0069] Furthermore, in the present disclosure, unless explicitly stated as a chroma block, "current block" may mean a block including both a luma component block and a chroma component block or a "luminance block of the current block". The chroma component block of the current block may be expressed by including an explicit description of the luma component block such as "luminance block" or "current luma block". In addition, the chroma component block of the current block may be explicitly expressed by including an explicit description of the chroma component block such as "chroma block" or "current chroma block".

[0070] In the present disclosure, the slash " / " or "," may be interpreted as indicating "and / or". For example, "A / B" and "A, B" may mean "A and / or B". In addition, "A / B / C" and "A / B / C" may mean "at least one of A, B, and / or C".

[0071] In the present disclosure, the term "or" should be interpreted to indicate "and / or". For example, the expression "A or B" may include 1) only "A", 2) only "B", or 3) both "A and B". In other words, in the present disclosure, "or" should be interpreted to indicate "additionally or alternatively".

[0072] Overview of Video Coding Systems

[0073] Figure 1 is a diagram schematically illustrating a video encoding system according to the present disclosure.

[0074] The video encoding system according to the embodiment may include an encoding device 10 and a decoding device 20. The encoding device 10 may deliver the encoded video and / or image information or data to the decoding device 20 via a digital storage medium or a network in the form of a file or a stream.

[0075] The encoding device 10 according to the embodiment may include a video source generator 11, an encoding unit 12, and a transmitter 13. The decoding device 20 according to the embodiment may include a receiver 21, a decoding unit 22, and a renderer 23. The encoding unit 12 may be called a video / image encoding unit, and the decoding unit 22 may be called a video / image decoding unit. The transmitter 13 may be included in the encoding unit 12. The receiver 21 may be included in the decoding unit 22. The renderer 23 may include a display and the display may be configured as a separate device or an external component.

[0076] The video source generator 11 can obtain the video / image by the process of capturing, synthesizing or generating the video / image. The video source generator 11 may include a video / image capturing device and / or a video / image generating device. The video / image capturing device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generating device may include, for example, a computer, a tablet computer, and a smart phone, and may generate the video / image (electronically). For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capturing process may be replaced by a process of generating relevant data.

[0077] The encoding unit 12 may encode the input video / image. For compression and encoding efficiency, the encoding unit 12 may perform a series of processes such as prediction, transformation, and quantization. The encoding unit 12 may output encoded data (encoded video / image information) in the form of a bitstream.

[0078] The transmitter 13 transmits the encoded video / image information or data output in the form of a bit stream to the receiver 21 of the decoding device 20 in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media, such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter 13 may include an element for generating a media file in a predetermined file format and may include an element for transmission through a broadcast / communication network. The receiver 21 may extract / receive a bit stream from a storage medium or a network and transmit the bit stream to the decoding unit 22.

[0079] The decoding unit 22 may decode a video / image by performing a series of processes corresponding to the operations of the encoding unit 12, such as dequantization, inverse transformation, and prediction.

[0080] The renderer 23 may render the decoded video / image. The rendered video / image may be displayed through a display.

[0081] Overview of Image Coding Equipment

[0082] Figure 2is a view schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.

[0083] like Figure 2 As shown, the image encoding device 100 may include an image segmenter 110, a subtractor 115, a transformer 120, a quantizer 130, a dequantizer 140, an inverse transformer 150, an adder 155, a filter 160, a memory 170, an inter-frame prediction unit 180, an intra-frame prediction unit 185, and an entropy encoder 190. The inter-frame prediction unit 180 and the intra-frame prediction unit 185 may be collectively referred to as a "prediction unit". The transformer 120, the quantizer 130, the dequantizer 140, and the inverse transformer 150 may be included in a residual processor. The residual processor may also include a subtractor 115.

[0084] In some embodiments, all or at least some of the components configuring the image encoding apparatus 100 may be configured by one hardware component (eg, an encoder or a processor). In addition, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium.

[0085] The image segmenter 110 may segment the input image (or picture or frame) input to the image encoding device 100 into one or more processing units. For example, the processing unit may be referred to as a coding unit (CU). The coding unit may be obtained by recursively segmenting a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QT / BT / TT) structure. For example, a coding unit may be segmented into a plurality of coding units of a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. For the segmentation of the coding unit, the quadtree structure may be applied first, and then the binary tree structure and / or the ternary tree structure may be applied. The encoding process according to the present disclosure may be performed based on the final coding unit that is no longer segmented. The maximum coding unit may be used as the final coding unit, and the coding unit of a deeper depth obtained by segmenting the maximum coding unit may also be used as the final coding unit. Here, the encoding process may include the prediction, transformation, and reconstruction processes described later. As another example, the processing unit of the encoding process may be a prediction unit (PU) or a transformation unit (TU). The prediction unit and the transform unit may be divided or partitioned from the final coding unit. The prediction unit may be a sample prediction unit, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient.

[0086] The prediction unit (inter prediction unit 180 or intra prediction unit 185) may perform prediction on the block to be processed (current block) and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction based on the current block or CU. The prediction unit may generate various information related to the prediction of the current block and transmit the generated information to the entropy encoder 190. The information about the prediction may be encoded in the entropy encoder 190 and output in the form of a bitstream.

[0087] The intra prediction unit 185 can predict the current block by referring to the samples in the current picture. Depending on the intra prediction mode and / or the intra prediction technology, the reference samples can be located in the neighbors of the current block or can be placed separately. The intra prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the level of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or fewer directional prediction modes may be used according to the settings. The intra prediction unit 185 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0088] The inter prediction unit 180 may derive a prediction block of the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc. The reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter prediction unit 180 may configure a motion information candidate list based on the neighboring blocks and generate information specifying 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. For example, in the case of skip mode and merge mode, the inter prediction unit 180 may use the motion information of the neighboring block as the motion information of the current block. In the case of skip mode, unlike the merge mode, the residual signal may not be transmitted. In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor, and the motion vector of the current block may be signaled by encoding the motion vector difference and an indicator of the motion vector predictor. The motion vector difference may mean the difference between the motion vector of the current block and the motion vector predictor.

[0089] The prediction unit may generate a prediction signal based on various prediction methods and prediction techniques described below. For example, the prediction unit may not only apply intra prediction or inter prediction, but may also apply intra prediction and inter prediction simultaneously to predict the current block. The prediction method of applying both intra prediction and inter prediction simultaneously to predict the current block may be referred to as combined inter and intra prediction (CIIP). In addition, the prediction unit may perform intra block copying (IBC) to predict the current block. Intra block copying may be used for content image / video encoding of games, etc., such as screen content coding (SCC). IBC is a method of predicting the current picture using a previously reconstructed reference block in the current picture at a position separated by a predetermined distance from the current block. When IBC is applied, the position of the reference block in the current picture may be encoded as a vector (block vector) corresponding to a predetermined distance. IBC basically performs prediction in the current picture, but may be performed similarly to inter prediction because the reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction techniques described in the present disclosure.

[0090] The prediction signal generated by the prediction unit can be used to generate a reconstruction signal or to generate a residual signal. The subtractor 115 can generate a residual signal (residual block or residual sample array) by subtracting the prediction signal (prediction block or prediction sample array) output from the prediction unit from the input image signal (original block or original sample array). The generated residual signal can be transmitted to the transformer 120.

[0091] The transformer 120 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a karhunen-loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT refers to a transform obtained from a graph when relationship information between pixels is represented by a graph. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to square pixel blocks of the same size or may be applied to blocks of variable size rather than square.

[0092] The quantizer 130 may quantize the transform coefficients and transmit them to the entropy encoder 190. The entropy encoder 190 may encode the quantized signal (information about the quantized transform coefficients) and output a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 130 may rearrange the quantized transform coefficients in the block form into a one-dimensional vector form based on the coefficient scanning order, and generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form.

[0093] The entropy encoder 190 may perform various encoding methods, such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 190 may encode information required for video / image reconstruction other than quantized transform coefficients together or separately (e.g., values ​​of syntax elements, etc.). The encoded information (e.g., encoded video / image information) may be transmitted or stored in units of a network abstraction layer (NAL) in the form of a bitstream. The video / image information may also include information about various parameter sets, such as an adaptive 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 also include general constraint information. The signaled information, transmitted information, and / or syntax elements described in the present disclosure may be encoded and included in a bitstream through the above-described encoding process.

[0094] The bitstream may be transmitted over a network or may be stored in a digital storage medium. The network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting a signal output from the entropy encoder 190 and / or a storage unit (not shown) for storing the signal may be included as an internal / external element of the image encoding device 100. Alternatively, a transmitter may be provided as a component of the entropy encoder 190.

[0095] The quantized transform coefficients output from the quantizer 130 may be used to generate a residual signal. For example, the residual signal (residual block or residual sample) may be reconstructed by applying dequantization and inverse transformation to the quantized transform coefficients through the dequantizer 140 and the inverse transformer 150.

[0096] The adder 155 adds the reconstructed residual signal to the prediction signal output from the inter-frame prediction unit 180 or the intra-frame prediction unit 185 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). If the block to be processed has no residual, such as when the skip mode is applied, the prediction block can be used as a reconstructed block. The adder 155 can be called a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture by filtering as described below.

[0097] The filter 160 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 160 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc. The filter 160 can generate various information related to filtering and transmit the generated information to the entropy encoder 190, as described later in the description of each filtering method. The information related to filtering can be encoded by the entropy encoder 190 and output in the form of a bit stream.

[0098] The modified reconstructed picture transferred to the memory 170 may be used as a reference picture in the inter prediction unit 180. When inter prediction is applied by the image encoding apparatus 100, prediction mismatch between the image encoding apparatus 100 and the image decoding apparatus may be avoided and encoding efficiency may be improved.

[0099] The DPB of the memory 170 may store the modified reconstructed picture for use as a reference picture in the inter-frame prediction unit 180. The memory 170 may store the motion information of the block from which the motion information in the current picture is derived (or encoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be transmitted to the inter-frame prediction unit 180 and used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 170 may store the reconstructed samples of the reconstructed blocks in the current picture and may transmit the reconstructed samples to the intra-frame prediction unit 185.

[0100] Overview of Image Decoding Equipment

[0101] Figure 3 is a view schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

[0102] like Figure 3 As shown, the image decoding device 200 may include an entropy decoder 210, a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame prediction unit 260, and an intra-frame prediction unit 265. The inter-frame prediction unit 260 and the intra-frame prediction unit 265 may be collectively referred to as a "prediction unit". The dequantizer 220 and the inverse transformer 230 may be included in a residual processor.

[0103] According to an embodiment, all or at least some of the plurality of components configuring the image decoding apparatus 200 may be configured by hardware components (eg, a decoder or a processor). In addition, the memory 250 may include a decoded picture buffer (DPB) or may be configured by a digital storage medium.

[0104] The image decoding device 200 having received a bit stream including video / image information may perform the same Figure 2 The image encoding device 100 may reconstruct the image by processing corresponding to the processing performed by the image encoding device 100. For example, the image decoding device 200 may perform decoding using a processing unit applied in the image encoding device. Therefore, the processing unit of decoding may be, for example, a coding unit. The coding unit may be obtained by partitioning the coding tree unit or the maximum coding unit. The reconstructed image signal decoded and output by the image decoding device 200 may be reproduced by a reproduction device (not shown).

[0105] The image decoding device 200 may receive the image in the form of a bit stream from Figure 2The received signal may be decoded by the entropy decoder 210. For example, the entropy decoder 210 may parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets, such as an adaptive 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 also include general constraint information. The image decoding device may also decode the picture based on the information about the parameter set and / or the general constraint information. The information and / or syntax elements signaled / received described in the present disclosure may be decoded and obtained from the bitstream through a decoding process. For example, the entropy decoder 210 may decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of the syntax elements required for image reconstruction and the quantized values ​​of the transform coefficients of the residual. More specifically, the CABAC entropy decoding method can receive a bin corresponding to each syntax element in the bitstream, use the decoding target syntax element information, the decoding information of the neighboring block and the decoding target block, or the information of the symbol / bin decoded in the previous stage to determine the context model, perform arithmetic decoding on the bin by predicting the probability of occurrence of the bin according to the determined context model, and generate a symbol corresponding to the value of each syntax element. In this case, the CABAC entropy decoding method can update the context model by using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. The information related to the prediction in the information decoded by the entropy decoder 210 can be provided to the prediction unit (inter-frame prediction unit 260 and intra-frame prediction unit 265), and the residual value of the entropy decoding performed on it in the entropy decoder 210, that is, the quantized transform coefficient and the related parameter information can be input to the dequantizer 220. In addition, the information about filtering in the information decoded by the entropy decoder 210 can be provided to the filter 240. In addition, a receiver (not shown) for receiving a signal output from the image encoding apparatus may be further configured as an internal / external element of the image decoding apparatus 200 , or the receiver may be a component of the entropy decoder 210 .

[0106] In addition, the image decoding device according to the present disclosure may be referred to as a video / image / picture decoding device. The image decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include an entropy decoder 210. The sample decoder may include a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame prediction unit 260, or at least one of an intra-frame prediction unit 265.

[0107] The dequantizer 220 may dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 220 may rearrange the quantized transform coefficients in the form of two-dimensional blocks. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the image encoding device. The dequantizer 220 may dequantize the quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficients.

[0108] The inverse transformer 230 may inversely transform the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0109] The prediction unit may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction to the current block based on the information about prediction output from the entropy decoder 210, and may determine a specific intra / inter prediction mode (prediction technique).

[0110] The same as described in the prediction unit of the image encoding device 100 , the prediction unit can generate a prediction signal based on various prediction methods (techniques) described later.

[0111] The intra prediction unit 265 may predict the current block by referring to samples in the current picture. The description of the intra prediction unit 185 is also applicable to the intra prediction unit 265.

[0112] The inter-frame prediction unit 260 can derive the prediction block of the current block based on the reference block (reference sample array) specified by the motion vector on the reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter-frame 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 may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter-frame prediction unit 260 may configure 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-frame prediction can be performed based on various prediction modes, and the information about the prediction may include information specifying the inter-frame prediction mode of the current block.

[0113] The adder 235 can generate a reconstruction signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the prediction unit (including the inter-frame prediction unit 260 and / or the intra-prediction unit 265). If the block to be processed has no residual, for example, when the skip mode is applied, the prediction block can be used as the reconstructed block. The description of the adder 155 also applies to the adder 235. The adder 235 can be called a reconstructor or a reconstructed block generator. The generated reconstruction signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture by filtering as described below.

[0114] The filter 240 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 240 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 250, specifically, in the DPB of the memory 250. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc.

[0115] The (modified) reconstructed picture stored in the DPB of the memory 250 may be used as a reference picture in the inter-frame prediction unit 260. The memory 250 may store the motion information of the block from which the motion information in the current picture is derived (or decoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be transmitted to the inter-frame prediction unit 260 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 250 may store the reconstructed samples of the reconstructed block in the current picture and transmit the reconstructed samples to the intra-frame prediction unit 265.

[0116] In the present disclosure, the implementations described in the filter 160, the inter-frame prediction unit 180 and the intra-frame prediction unit 185 of the image encoding device 100 can be equally or correspondingly applied to the filter 240, the inter-frame prediction unit 260 and the intra-frame prediction unit 265 of the image decoding device 200.

[0117] Overview of Image Segmentation

[0118] The video / image encoding method according to the present disclosure can be performed based on the image segmentation structure as follows. Specifically, the prediction, residual processing ((inverse) transform, (de)quantization, etc.), syntax element encoding and filtering processes described later can be performed based on the CTU, CU (and / or TU, PU) derived from the image segmentation structure. The image can be segmented in block units and the block segmentation process can be performed in the image segmentor 110 of the encoding device. The segmentation related information can be encoded by the entropy encoder 190 and sent to the decoding device in the form of a bitstream. The entropy decoder 210 of the decoding device can derive the block segmentation structure of the current picture based on the segmentation related information obtained from the bitstream, and based on this, a series of processes (e.g., prediction, residual processing, block / picture reconstruction, in-loop filtering, etc.) can be performed to perform image decoding.

[0119] A picture may be partitioned into a sequence of coding tree units (CTUs). Figure 4 An example of a picture being partitioned into CTUs is shown. A CTU may correspond to a coding tree block (CTB). Alternatively, a CTU may include a coding tree block of luma samples and two corresponding coding tree blocks of chroma samples. For example, for a picture containing three sample arrays, a CTU may include one N×N block of luma samples and two corresponding blocks of chroma samples.

[0120] Overview of CTU Segmentation

[0121] As described above, a coding unit may be obtained by recursively partitioning a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree / binary tree / ternary tree (QT / BT / TT) structure. For example, a CTU may be first partitioned into a quadtree structure. Thereafter, the leaf nodes of the quadtree structure may be further partitioned by a multi-type tree structure.

[0122] Partitioning according to the quadtree means that the current CU (or CTU) is equally divided into four. By partitioning according to the quadtree, the current CU can be partitioned into four CUs with the same width and the same height. When the current CU is no longer partitioned into a quadtree structure, the current CU corresponds to a leaf node of the quadtree structure. The CU corresponding to the leaf node of the quadtree structure may no longer be partitioned and may be used as the above-mentioned final coding unit. Alternatively, the CU corresponding to the leaf node of the quadtree structure may be further partitioned by a multi-type tree structure.

[0123] Figure 5 is a view showing an embodiment of a partition type of a block according to a multi-type tree structure. The partition according to the multi-type tree structure may include two types of partitions according to a binary tree structure and two types of partitions according to a ternary tree structure.

[0124] The two types of splits according to the binary tree structure may include vertical binary split (SPLIT_BT_VER) and horizontal binary split (SPLIT_BT_HOR). Vertical binary split (SPLIT_BT_VER) means that the current CU is equally split into two in the vertical direction. Figure 4 As shown in FIG, through vertical binary splitting, two CUs with the same height as the current CU and half the width of the current CU can be generated. Horizontal binary splitting (SPLIT_BT_HOR) means that the current CU is equally divided into two in the horizontal direction. Figure 5 As shown, through horizontal binary partitioning, two CUs with a height half of the height of the current CU and the same width as the current CU can be generated.

[0125] The two types of splits according to the triad structure may include vertical triad split (SPLIT_TT_VER) and horizontal triad split (SPLIT_TT_HOR). In vertical triad split (SPLIT_TT_VER), the current CU is split in a vertical direction at a ratio of 1:2:1. Figure 5 As shown, through vertical trisection, two CUs with the same height as the current CU and a width of 1 / 4 of the current CU width and one CU with the same height as the current CU and a width of half the current CU width can be generated. In horizontal trisection (SPLIT_TT_HOR), the current CU is split in the horizontal direction at a ratio of 1:2:1. Figure 5 As shown, through horizontal trifurcated division, two CUs whose height is 1 / 4 of the height of the current CU and whose width is the same as the current CU and one CU whose height is half of the height of the current CU and whose width is the same as the current CU can be generated.

[0126] Figure 6 is a diagram illustrating a signaling mechanism of block partitioning information in a quadtree having a nested multi-type tree structure according to the present disclosure.

[0127] Here, the CTU is regarded as the root node of the quadtree and is first split into a quadtree structure. Information (e.g., qt_split_flag) is used to signal whether to perform quadtree partitioning on the current CU (CTU or node (QT_node) of the quadtree). For example, when qt_split_flag has a first value (e.g., "1"), the current CU can be split by the quadtree. In addition, when qt_split_flag has a second value (e.g., "0"), the current CU is not split by the quadtree, but becomes a leaf node (QT_leaf_node) of the quadtree. Each quadtree leaf node can then be further split into a multi-type tree structure. That is, the leaf node of the quadtree can become a node (MTT_node) of a multi-type tree. In the multi-type tree structure, a first flag (e.g., Mtt_split_cu_flag) is signaled to specify whether the current node is additionally split. If the corresponding node is additionally split (for example, if the first flag is 1), the second flag (for example, Mtt_split_cu_vertical_flag) may be signaled to specify the split direction. For example, the split direction may be a vertical direction when the second flag is 1, and a horizontal direction when the second flag is 0. Then, a third flag (for example, Mtt_split_cu_binary_flag) may be signaled to specify whether the split type is a binary split type or a ternary split type. For example, the split type may be a binary split type when the third flag is 1, and a ternary split type when the third flag is 0. The nodes of the multi-type tree obtained by binary splitting or ternary splitting may be further split into a multi-type tree structure. However, the nodes of the multi-type tree may not be split into a quadtree structure. If the first flag is 0, the corresponding node of the multi-type tree is no longer split, but becomes a leaf node (MTT_leaf_node) of the multi-type tree. The CU corresponding to the leaf node of the multi-type tree may be used as the above-mentioned final coding unit.

[0128] Based on mtt_split_cu_vertical_flag and mtt_split_cu_binary_flag, a multi-type tree partitioning mode (MttSplitMode) of a CU may be derived as shown in the following Table 1. In the following description, a multi-type tree partitioning mode may be referred to as a multi-tree partitioning type or a partitioning type.

[0129] [Table 1]

[0130] MttSplitMode mtt_split_cu_vertical_flag mtt_split_cu_binary_flag SPLIT_TT_HOR 0 0 SPLIT_BT_HOR 0 1 SPLIT_TT_VER 1 0 SPLIT_BT_VER 1 1

[0131] Figure 7 is a view showing an example of splitting a CTU into a plurality of CUs by applying a multi-type tree after applying a quadtree. Figure 7, the bold block edge 710 represents a quadtree partition, while the remaining edges 720 represent a multi-type tree partition. A CU may correspond to a coding block (CB). In an embodiment, a CU may include one coding block of luma samples and two coding blocks of chroma samples corresponding to the luma samples.

[0132] The chroma component (sample) CB or TB size may be derived based on the luma component (sample) CB or TB size based on the component ratio according to the color format (chroma format, e.g., 4:4:4, 4:2:2, 4:2:0, etc.) of the picture / image. In the case of a 4:4:4 color format, the chroma component CB / TB size may be set equal to the luma component CB / TB size. In the case of a 4:2:2 color format, the width of the chroma component CB / TB may be set to half the width of the luma component CB / TB and the height of the chroma component CB / TB may be set to the height of the luma component CB / TB. In the case of a 4:2:0 color format, the width of the chroma component CB / TB may be set to half the width of the luma component CB / TB and the height of the chroma component CB / TB may be set to half the height of the luma component CB / TB.

[0133] In an embodiment, when the size of the CTU is 128 based on the luma sample unit, the size of the CU may have a size from 128×128 to 4×4, which is the same size as the CTU. In an embodiment, in the case of a 4:2:0 color format (or chroma format), the chroma CB size may have a size from 64×64 to 2×2.

[0134] Furthermore, in an embodiment, the CU size and the TU size may be the same. Alternatively, there may be multiple TUs in a CU region. The TU size generally means the luma component (sample) transform block (TB) size.

[0135] The TU size can be derived based on the maximum allowed TB size maxTbSize as a predetermined value. For example, when the CU size is larger than maxTbSize, multiple TUs (TBs) with maxTbSize can be derived from the CU, and transform / inverse transform can be performed in units of TU (TB). For example, the maximum allowed luma TB size may be 64×64 and the maximum allowed chroma TB size may be 32×32. If the width or height of the CB split according to the tree structure is larger than the maximum transform width or height, the CB may be automatically (or implicitly) split until the TB size limits in the horizontal and vertical directions are met.

[0136] In addition, for example, when intra prediction is applied, the intra prediction mode / type may be derived in units of CU (or CB), and the neighboring reference sample derivation and prediction sample generation process may be performed in units of TU (or TB). In this case, there may be one or more TUs (or TBs) in a CU (or CB) region, and in this case, multiple TUs or (TBs) may share the same intra prediction mode / type.

[0137] In addition, for a quadtree coding tree scheme with nested multi-type trees, the following parameters may be signaled from an encoding device to a decoding device as SPS syntax elements. For example, at least one of a CTU size as a parameter for specifying a root node size of a quadtree, a MinQTSize as a parameter for specifying a minimum allowed quadtree leaf node size, a MaxBtSize as a parameter for specifying a maximum allowed binary tree root node size, a MaxTtSize as a parameter for specifying a maximum allowed ternary tree root node size, a MaxMttDepth as a parameter for specifying a maximum allowed hierarchical depth for multi-type tree partitioning from a quadtree leaf node, a MinBtSize as a parameter for specifying a minimum allowed binary tree leaf node size, or a MinTtSize as a parameter for specifying a minimum allowed ternary tree leaf node size may be signaled.

[0138] As an embodiment using a 4:2:0 chroma format, the CTU size may be set to 128×128 luminance blocks and two 64×64 chrominance blocks corresponding to these luminance blocks. In this case, MinOTSize may be set to 16×16, MaxBtSize may be set to 128×128, MaxTtSzie may be set to 64×64, MinBtSize and MinTtSize may be set to 4×4, and MaxMttDepth may be set to 4. Quadtree partitioning may be applied to the CTU to generate a quadtree leaf node. The quadtree leaf node may be referred to as a leaf QT node. The size of the quadtree leaf node may be from 16×16 size (e.g., MinOTSize) to 128×128 size (e.g., CTU size). If the leaf QT node is 128×128, it may not be additionally partitioned into a binary tree / ternary tree. This is because, in this case, even if it is partitioned, it exceeds MaxBtsize and MaxTtszie (e.g., 64×64). In other cases, the leaf QT node can be further split into a multi-type tree. Therefore, the leaf QT node is the root node of the multi-type tree, and the leaf QT node can have a multi-type tree depth (mttDepth) value of 0. If the multi-type tree depth reaches MaxMttdepth (for example, 4), further splitting can be ignored. If the width of the multi-type tree node is equal to MinBtSize and is less than or equal to 2xMinTtSize, further horizontal splitting can be ignored. If the height of the multi-type tree node is equal to MinBtSize and is less than or equal to 2xMinTtSize, further vertical splitting can be ignored. When splitting is not considered, the encoding device can skip the signaling of the splitting information. In this case, the decoding device can derive splitting information with a predetermined value.

[0139] In addition, one CTU may include a coding block of luma samples (hereinafter referred to as "luminance block") and two coding blocks of chroma samples corresponding thereto (hereinafter referred to as "chroma blocks"). The above coding tree scheme may be applied equally or individually to the luma block and chroma block of the current CU. Specifically, the luma block and chroma block in one CTU may be partitioned into the same block tree structure, and in this case, the tree structure is represented as SINGLE_TREE. Alternatively, the luma block and chroma block in one CTU may be partitioned into separate block tree structures, and in this case, the tree structure may be represented as DUAL_TREE. That is, when the CTU is partitioned into dual trees, the block tree structure for the luma block and the block tree structure for the chroma block may exist separately. In this case, the block tree structure for the luma block may be referred to as DUAL_TREE_LUMA, and the block tree structure for the chroma component may be referred to as DUAL_TREE_CHROMA. For P and B slices / block groups, the luma block and the chroma block in one CTU may be restricted to have the same coding tree structure. However, for I slices / patch groups, luma blocks and chroma blocks may have separate block tree structures from each other. If a separate block tree structure is applied, luma CTBs may be partitioned into CUs based on a specific coding tree structure, and chroma CTBs may be partitioned into chroma CUs based on another coding tree structure. That is, this means that a CU in an I slice / patch group to which a separate block tree structure is applied may include a coding block of a luma component or a coding block of two chroma components, and a CU of a P or B slice / patch group may include blocks of three color components (one luma component and two chroma components).

[0140] Although a quadtree coding tree structure with nested multi-type trees has been described, the structure for partitioning the CU is not limited thereto. For example, the BT structure and the TT structure may be interpreted as concepts included in a multi-partition tree (MPT) structure, and the CU may be interpreted as being partitioned by the QT structure and the MPT structure. In an example where the CU is partitioned by the QT structure and the MPT structure, a syntax element (e.g., MPT_split_type) including information about how many blocks a leaf node of the QT structure is partitioned into and a syntax element (e.g., MPT_split_mode) including information about which of the vertical and horizontal directions a leaf node of the QT structure is partitioned into may be signaled to determine the partition structure.

[0141] In another example, the CU may be partitioned in a manner different from the QT structure, the BT structure, or the TT structure. That is, unlike partitioning a CU of a lower depth into 1 / 4 of a CU of a higher depth according to the QT structure, partitioning a CU of a lower depth into 1 / 2 of a CU of a higher depth according to the BT structure, or partitioning a CU of a lower depth into 1 / 4 or 1 / 2 of a CU of a higher depth according to the TT structure, in some cases a CU of a lower depth may be partitioned into 1 / 5, 1 / 3, 3 / 8, 3 / 5, 2 / 3, or 5 / 8 of a CU of a higher depth, and the method of partitioning a CU is not limited thereto.

[0142] The quadtree coding block structure with multi-type trees can provide a very flexible block segmentation structure. Due to the segmentation types supported in the multi-type tree, different segmentation patterns can potentially produce the same coding block structure in some cases. In the encoding device and the decoding device, the amount of data of the segmentation information can be reduced by limiting the occurrence of such redundant segmentation patterns.

[0143] For example, Figure 8 The redundant partitioning patterns that may appear in binary tree partitioning and ternary tree partitioning are shown. Figure 8 As shown, the continuous binary partitions 810 and 820 for one direction of the two-step level have the same coding block structure as the binary partition for the center partition after the ternary partition. In this case, the binary tree partition for the center blocks 830 and 840 of the ternary tree partition can be prohibited. This prohibition applies to CUs of all pictures. When this particular partition is prohibited, the signaling of the corresponding syntax element can be modified by reflecting this prohibition, thereby reducing the number of bits for signaling the partition. For example, as Figure 8 As shown in the example shown in , when binary tree partitioning for the center block of a CU is prohibited, the syntax element mtt_split_cu_binary_flag specifying whether the partition is binary partitioning or ternary partitioning is not signaled and its value can be derived as 0 by the decoding device.

[0144] Overview of Chroma Formats

[0145] A source or coded picture / image may include a luma component (Y) block and two chroma component (cb and cr) blocks. That is, one pixel of a picture / image may include a luma sample and two chroma samples (cb and cr). The chroma format may mean a configuration format of luma samples and chroma samples (cb and cr), and may be referred to as a color format. The chroma format may be predetermined or adaptively signaled. For example, the chroma format may be signaled based on at least one of chroma_format_idc or separate_colour_plane_flag, as shown in Table 2. At least one of chroma_format_idc or separate_colour_plane_flag may be signaled through a high-level syntax such as DPS, VPS, SPS, or PPS. For example, chroma_format_idc and separate_colour_plane_flag may be included in the SPS syntax. .

[0146] [Table 2]

[0147]

[0148] Referring to Table 2, chroma_format_idc may specify the format of the luma sample and the corresponding chroma sample, and separate_colour_plane_flag may specify whether the three color components Y, Cb, and Cr are encoded in 4:4:4 chroma format, respectively.

[0149] When chroma_format_idc is 0, the chroma format corresponds to a monochrome format, and the current block may not include a chroma component block but may include only a luminance component block.

[0150] Alternatively, when chroma_format_idc is 1, the chroma format corresponds to the 4:2:0 chroma format, and the width and height of the chroma component block may correspond to half the width and height of the luminance component block, respectively.

[0151] Alternatively, when chroma_format_idc is 2, the chroma format corresponds to the 4:2:2 chroma format, the width of the chroma component block may correspond to half the width of the luminance component block, and the height of the chroma component block may be equal to the height of the luminance component block.

[0152] Alternatively, when chroma_format_idc is 3, the chroma format corresponds to a 4:4:4 chroma format, and the width and height of the chroma component block may be equal to the width and height of the luminance component block, respectively.

[0153] SubWidthC and SubHeightC can specify the ratio of luma samples to chroma samples. For example, when the width and height of the luma component block are CbWidth and CbHeight, respectively, the width and height of the chroma component block can be derived as (CbWidth / SubwidthC) and (CbHeight / SubHeightC), respectively.

[0154] Minimum size limit for chroma blocks

[0155] In the image encoding / decoding process, the size of the chroma block may have a great influence on the throughput. For example, when chroma blocks having a predetermined size or less are excessively generated, the throughput of the image encoding / decoding process may be significantly degraded. In order to solve this problem, CU partitioning may be restricted so as not to generate chroma blocks having a predetermined size or less.

[0156] The image encoding / decoding device can set the minimum size of the chroma block. In an example, the chroma block can be limited to include at least 16 chroma samples. For example, the division of the luminance block or the chroma block can be limited to not generating 2×2, 2×4 or 4×2 chroma blocks. As a result, in the dual tree structure, the quadtree division and / or binary division of 2×8, 4×4 or 8×2 chroma blocks can be limited. In addition, in the dual tree structure, the ternary division of 2×8, 2×16, 4×4, 4×8, 8×2 or 8×4 chroma blocks can be limited.

[0157] Specifically, when any one of the following conditions 1-1 to 1-4 is satisfied, quadtree partitioning of the current block may be restricted.

[0158] (Condition 1-1) The partition structure of the current block is single-tree or dual-tree luminance, and the size of the luminance block is equal to or smaller than the minimum size that can be quadtree partitioned

[0159] (Condition 1-2) The partition structure of the current block is dual-tree chroma, and the size of the chroma block is equal to or smaller than the minimum size that can be quadtree partitioned

[0160] (Condition 1-3) The partition structure of the current block is dual-tree chroma, and the size of the chroma block is equal to or less than 4

[0161] (Condition 1-4) The partition structure of the current block is dual-tree chroma, and the prediction mode type of the current block is MODE_TYPE_INTRA

[0162] Alternatively, when any one of the following conditions 2-1 to 2-2 is satisfied, binary division of the current block may be restricted.

[0163] (Condition 2-1) The partition structure of the current block is dual-tree chroma, and the product of the width and height of the chroma block is equal to or less than 16

[0164] (Condition 2-2) The partition structure of the current block is dual-tree chroma, and the prediction mode type of the current block is MODE_TYPE_INTRA

[0165] Alternatively, when any one of the following conditions 3-1 to 3-2 is satisfied, the ternary division of the current block may be restricted.

[0166] (Condition 3-1) The partition structure of the current block is dual-tree chroma, and the product of the width and height of the chroma block is equal to or less than 32

[0167] (Condition 3-2) The partition structure of the current block is dual-tree chroma, and the prediction mode type of the current block is MODE_TYPE_INTRA

[0168] Switch from single tree structure to dual tree structure

[0169] In a single tree structure, the luminance block and the chrominance block corresponding to the luminance block can be divided in the same manner. For example, when the luminance block is vertically ternary divided, the chrominance block corresponding to the luminance block can also be vertically ternary divided. In this case, whether to divide the CU can be determined based on the size of the luminance block included in the CU. In addition, the size of the chrominance block corresponding to the luminance block can be determined based on the size of the luminance block and the color format, as described above with reference to Table 2.

[0170] Fig. 9 is a view illustrating an example of a luma block and a chroma block in a 4:2:0 color format. Figures 10a to 10c is a view illustrating an example of a syntax for switching a current CTU to a local dual tree.

[0171] First, refer to Fig. 9 , when the size of the luma block is 16×8 in the 4:2:0 color format, the size of the chroma block corresponding to the luma block may be determined to be 8×4. In this case, when the 8×4 chroma block is vertically ternary-divided, a 2×4 chroma block may be generated. When the chroma block is restricted to include at least 16 chroma samples, the 2×4 chroma block cannot meet the minimum size restriction. Therefore, in the 4:2:0 color format, additional division of the 8×4 chroma block may be prohibited.

[0172] Even when additional partitioning of the chroma block is prohibited, additional partitioning of the luma block may be allowed. Therefore, when additional partitioning is performed only for the luma block, the luma block and the chroma block that have been partitioned into a single tree structure within the current CTU may be switched to a dual tree structure. In this case, the partitioning structure into the luma block and the chroma block having a dual tree structure may be referred to as a local dual tree structure.

[0173] Figures 10a to 10cis a view illustrating an example of a syntax for switching a single tree structure to a dual tree structure. Figures 10a to 10c The following example illustrates the syntax of a coding_tree, which is divided into three figures for convenience.

[0174] Reference Figures 10a to 10c , the prediction mode type of each CU generated from the current CTU can be determined based on the modeTypeCondition parameter in the coding_tree syntax. Here, modeTypeCondition can specify the prediction mode characteristics of each CU. In addition, modeType can specify the prediction mode type of each CU. In the example, modeType can have any value of MODE_TYPE_ALL that specifies that all prediction modes such as intra prediction, IBC, palette mode, inter prediction, etc. are available, MODE_TYPE_INTRA that specifies that only intra prediction, IBC and palette modes are available, and MODE_TYPE_INTER that specifies that only inter prediction mode is available.

[0175] The modeTypeCondition of the current CU may have any one of a first value (eg, 0) to a third value (eg, 2) according to a predetermined condition.

[0176] Specifically, when at least one of the following conditions 4-1 to 4-4 is satisfied, modeTypeCondition may have a first value (eg, 0).

[0177] (Condition 4-1) The current CU is included in an I slice, the CTU included in the corresponding slice is implicitly quad-tree-divided into 64×64 luma sample CUs, and the 64×64 CU is the root node of the dual tree

[0178] (Condition 4-2) modeTypeCurr is not MODE_TYPE_ALL

[0179] (Condition 4-3) The color format (chroma format) of the current block is monochrome

[0180] (Condition 4-4) The color format of the current block is 4:4:4 format

[0181] When all the above conditions are not satisfied and at least one of the following conditions 5-1 to 5-3 is satisfied, modeTypeCondition may have a second value (eg, 1). In the conditions 5-1 to 5-3, the current CU may mean a luminance component block of the current CU.

[0182] (Condition 5-1) The product of the width and height of the current CU is 64, and the current CU is divided into quadtrees

[0183] (Condition 5-2) The product of the width and height of the current CU is 64, and the current CU is horizontally divided into two elements or vertically divided into three elements. (Condition 5-3) The product of the width and height of the current CU is 32, and the current CU is horizontally divided into two elements or vertically divided into two elements.

[0184] When all of the above conditions are not satisfied and at least one of the following conditions 6-1 to 6-4 is satisfied, modeTypeCondition may have a second value (e.g., 1) or a third value (e.g., 2) depending on whether the current CU is included in the I slice. For example, as a case where at least one of the conditions 6-1 to 6-4 is satisfied, when the current CU is included in the I slice, modeTypeCondition may have a second value, and when the current CU is not included in the I slice, modeTypeCondition may have a third value. In the conditions 6-1 to 6-4, the current CU may mean a luminance component block of the current CU.

[0185] (Condition 6-1) The product of the width and height of the current CU is 64, the current CU is horizontally binary-partitioned or vertically binary-partitioned, and the color format of the current CU is 4:2:0 format

[0186] (Condition 6-2) The product of the width and height of the luminance block included in the current CU is 128, the current CU is divided into horizontal ternary or vertical ternary, and the color format of the current CU is 4:2:0 format

[0187] (Condition 6-3) The width of the current CU is 8, and the current CU is divided into two horizontal

[0188] (Condition 6-4) The width of the current CTU is 16, and the current CU is divided into three vertical

[0189] When all of the above conditions are met, modeTypeCondition may have a first value (eg, 0).

[0190] In addition, based on the value of modeTypeCondition, the modeType of the current CU can be determined.

[0191] Specifically, refer to Fig.10a , when modeTypeCondition has a second value (eg, 1) ( 1010 ), modeType may be determined as MODE_TYPE_INTRA ( 1020 ).

[0192] Alternatively, when modeTypeCondition has a third value (e.g., 2) (1030), modeType may be determined based on the value of mode_constraint_flag. Here, mode_constraint_flag may specify whether the inter prediction mode is applied to the current CU. For example, the first value (e.g., 0) of mode_constraint_flag may specify that only the inter prediction mode may be applied to the current CU. In addition, in this case, the modeType of the current CU may be determined as MODE_TYPE_INTER. In contrast, the second value (e.g., 1) of mode_constraint_flag may specify that the inter prediction mode may not be applied to the current CU. In addition, in this case, modeType may be determined as MODE_TYPE_INTRA (1040).

[0193] Alternatively, when modeTypeCondition has a value other than the second value (e.g., 1) and the third value (e.g., 2) (e.g., when modeTypeCondition has a first value (e.g., 0)), modeType may be determined to be the same value as modeTypeCurr (1050). Here, modeTypeCurr is a calling input value of the coding_tree syntax and may mean a prediction mode type of the current CU. In an example, when the current CU is the root node of the partition tree, modeTypeCurr may be MODE_TYPE_ALL.

[0194] The modeType determined based on the value of modeTypeCondition may be used as a calling input value for calling a coding_tree syntax of a lower layer CU obtained by splitting the current CU.

[0195] In addition, based on the value of the modeType of the current CU, the division structure treeType (1060) of the lower CU generated by dividing the current CU can be determined. For example, when the modeType of the current CU is MODE_TYPE_INTRA, the division structure of the lower CU can be determined as dual tree brightness DUAL_TREE_LUMA. In contrast, when the modeType is not MODE_TYPE_INTRA, the division structure of the lower CU can be the division structure treeTypeCurr of the current CU.

[0196] Information about the partition structure of the lower layer CU may be stored in a parameter treeType. treeType and modeType may be used as input values ​​for calling a coding_tree syntax of a lower layer CU by additionally partitioning the current CU.

[0197] When the modeType of the lower layer CU is MODE_TYPE_INTRA, the current CU may be additionally divided into a dual tree structure. Fig.10b , when the modeType of the lower CU is MODE_TYPE_INTRA, the lower CU may have a tree structure of dual tree brightness DUAL_TREE_LUMA. That is, the brightness component and the chrominance component of the current CU may be divided into having separate tree structures (1070). In addition, referring to Fig.10c , when modeTypeCurr of the current CU is MODE_TYPE_ALL and modeType of the lower layer CU is MODE_TYPE_INTRA, the chroma component of the current CU is not divided, and the lower layer CU may have a tree structure of dual tree chroma DUAL_TREE_CHROMA (1080).

[0198] Therefore, the modeType of the lower CU can be determined based on the modeTypeCondition. In addition, when the modeType of the lower CU is MODE_TYPE_INTRA, the luminance component of the lower CU has a tree structure of dual-tree luminance, and the chrominance component of the lower CU can have a tree structure of dual-tree chrominance. That is, the lower CU partially has a dual-tree structure within the current CTU, and this division structure can be called a local dual-tree structure.

[0199] Hereinafter, the intra prediction mode and intra prediction of the chroma block will be described.

[0200] Overview of Intra Prediction

[0201] Intra-frame prediction may indicate a prediction of a prediction sample of a current block generated based on a reference sample in a picture to which the current block belongs (hereinafter referred to as the current picture). When intra-frame prediction is applied to the current block, neighboring reference samples to be used for intra-frame prediction of the current block may be derived. The neighboring reference samples of the current block may include samples adjacent to the left boundary of the current block of size nW×nH and a total of 2×nH samples adjacent to the lower left, samples adjacent to the upper boundary of the current block and a total of 2×nW samples adjacent to the upper right, and one sample adjacent to the upper left of the current block. Alternatively, the neighboring reference samples of the current block may include multiple columns of upper neighboring samples and multiple rows of left neighboring samples. In addition, the neighboring reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nW×nH, a total of nW samples adjacent to the lower boundary of the current block, and one sample adjacent to the lower right of the current block.

[0202] Some neighboring reference samples of the current block have not been decoded or may not be available. In this case, the decoder can construct neighboring reference samples to be used for prediction by replacing unavailable samples with available samples. Alternatively, interpolation of available samples can be used to construct neighboring reference samples to be used for prediction.

[0203] When deriving neighboring reference samples, (i) the prediction sample may be derived based on an average or interpolation of neighboring reference samples of the current block, and (ii) the prediction sample may be derived based on a reference sample existing in a specific (prediction) direction relative to the prediction sample among neighboring reference samples of the current block. The case of (i) may be referred to as a non-directional mode or a non-angular mode, and the case of (ii) may be referred to as a directional mode or an angular mode.

[0204] In addition, the prediction sample can be generated by interpolation using the first neighboring sample located in the prediction direction of the intra prediction mode of the current block among the neighboring reference samples and the second neighboring sample located in the opposite direction based on the prediction target sample of the current block. The above situation can be called linear interpolation intra prediction (LIP).

[0205] In addition, a linear model can be used to generate chrominance prediction samples based on luma samples. This case can be called linear model (LM) mode.

[0206] In addition, the temporary prediction sample of the current block can be derived based on the filtered neighboring reference sample, and the prediction sample of the current block can be derived by weighted summing the temporary prediction sample and at least one reference sample derived according to the intra prediction mode among the existing neighboring reference samples (i.e., the unfiltered neighboring reference sample). This situation can be called position-dependent intra prediction (PDPC).

[0207] In addition, a reference sample row with the highest prediction accuracy can be selected from multiple neighboring reference sample rows of the current block to derive the prediction sample using the reference sample located in the prediction direction in the corresponding row, and at this time, information about the reference sample row used (e.g., intra_luma_ref_idx) can be encoded and signaled in the bitstream. This situation can be called multi-reference row (MRL) intra prediction or MRL-based intra prediction.

[0208] In addition, the current block can be divided into vertical sub-partitions or horizontal sub-partitions to perform intra-frame prediction for each sub-partition based on the same intra-frame prediction mode. At this time, the neighboring reference samples for intra-frame prediction can be derived in units of sub-partitions. That is, the reconstructed samples of the previous sub-partition in the encoding / decoding order can be used as neighboring reference samples of the current sub-partition. In this case, the intra-frame prediction mode of the current block is also applied to the sub-partition, and the neighboring reference samples are derived and used in units of sub-partitions, thereby increasing the intra-frame prediction performance. This prediction method can be referred to as intra-frame sub-partitioning (ISP) or intra-frame prediction based on ISP.

[0209] The intra prediction technique may be referred to as various terms such as intra prediction type or additional intra prediction mode to distinguish from directional or non-directional intra prediction mode. For example, the intra prediction technique (intra prediction type or additional intra prediction mode) may include at least one of LIP, LM, PDPC, MRL, ISP, or MIP. In addition, post filtering may be performed on the derived prediction samples if necessary.

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

[0211] Fig.11 is a flowchart illustrating a video / image encoding method based on intra-frame prediction.

[0212] Fig.11 The encoding method can be Figure 2The image encoding device of the present invention may be performed. Specifically, step S1110 may be performed by the intra predictor 185, and step S1120 may be performed by the residual processor. Specifically, step S1120 may be performed by the subtractor 115. Step S1130 may be performed by the entropy encoder 190. The prediction information of step S1130 may be derived by the intra predictor 185, and the residual information of step S1130 may be derived by the residual processor. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficient of the residual sample. As described above, the residual sample may be derived as a transform coefficient by the transformer 120 of the image encoding device, and the transform coefficient may be derived as a transform coefficient quantized by the quantizer 130. The information about the quantized transform coefficient may be encoded by the entropy encoder 190 through the residual encoding process.

[0213] The image encoding device may perform intra prediction for the current block (S1110). The image encoding device may determine the intra prediction mode / type of the current block, derive neighboring reference samples of the current block, and generate prediction samples in the current block based on the intra prediction mode / type and the neighboring reference samples. Here, the intra prediction mode / type determination, neighboring reference sample derivation, and prediction sample generation processes may be performed simultaneously, or any one process may be performed before the other processes.

[0214] Fig.12 is a view illustrating a configuration of an intra predictor according to the present disclosure.

[0215] like Fig.12 As shown, the intra-frame predictor 185 of the image encoding device may include an intra-frame prediction mode / type determination unit 186, a reference sample derivation unit 187 and / or a prediction sample derivation unit 188. The intra-frame prediction mode / type determination unit 186 may determine the intra-frame prediction mode / type of the current block. The reference sample derivation unit 187 may derive the neighboring reference samples of the current block. The prediction sample derivation unit 188 may derive the prediction sample of the current block. In addition, although not shown, when performing the prediction sample filtering process described below, the intra-frame predictor 185 may also include a prediction sample filter (not shown).

[0216] The image encoding apparatus may determine a mode / type applied to a current block among a plurality of intra prediction modes / types. The image encoding apparatus may compare rate-distortion (RD) costs of intra prediction modes / types and determine an optimal intra prediction mode / type for the current block.

[0217] In addition, the image encoding device may perform a prediction sample filtering process. Prediction sample filtering may be referred to as post-filtering. Through the prediction sample filtering process, some or all prediction samples may be filtered. In some cases, the prediction sample filtering process may be omitted.

[0218] Refer to Fig.11 , the image encoding device may generate a residual sample of the current block based on the prediction sample or the filtered prediction sample (S1120). The image encoding device may derive the residual sample by subtracting the prediction sample from the original sample of the current block. That is, the image encoding device may derive the residual sample value by subtracting the corresponding prediction sample value from the original sample value.

[0219] The image encoding device may encode image information including information about intra prediction (prediction information) and residual information of residual samples (1130). The prediction information may include intra prediction mode information and / or intra prediction technology information. The image encoding device may output the encoded image information in the form of a bit stream. The output bit stream may be transmitted to the image decoding device via a storage medium or a network.

[0220] The residual information may include a residual encoding syntax (to be described later). The image encoding apparatus may transform / quantize the residual samples and derive quantized transform coefficients. The residual information may include information about the quantized transform coefficients.

[0221] In addition, as described above, the image encoding device can generate a reconstructed picture (including reconstructed samples and reconstructed blocks). To this end, the image encoding device can perform dequantization / inverse transformation on the quantized transform coefficients and derive (modified) residual samples. The reason for transforming / quantizing the residual samples and then performing dequantization / inverse transformation is to derive the same residual samples as the residual samples derived by the image decoding device. The image encoding device can generate a reconstructed block including the reconstructed samples of the current block based on the predicted samples and the (modified) residual samples. Based on the reconstructed block, a reconstructed picture of the current picture can be generated. As described above, the in-loop filtering process is further applicable to the reconstructed picture.

[0222] Fig.13 is a flowchart illustrating a video / image decoding method based on intra-frame prediction.

[0223] The image decoding device can perform operations corresponding to operations performed by the image encoding device.

[0224] Fig.13 The decoding method can be obtained by Figure 3The image decoding device of the present invention is performed. Steps S1310 to S1330 may be performed by the intra predictor 265, and the prediction information of step S1310 and the residual information of step S1340 may be obtained from the bitstream by the entropy decoder 210. The residual processor of the image decoding device may derive the residual samples of the current block based on the residual information (S1340). Specifically, the dequantizer 220 of the residual processor may perform dequantization based on the dequantized transform coefficient derived from the residual information to derive the transform coefficient, and the inverse transformer 230 of the residual processor may perform inverse transform on the transform coefficient to derive the residual sample of the current block. Step S650 may be performed by the adder 235 or the reconstructor.

[0225] Specifically, the image decoding device may derive the intra prediction mode / type of the current block based on the received prediction information (intra prediction mode / type information) (S1310). The image decoding device may derive the neighboring reference samples of the current block (S1320). The image decoding device may generate prediction samples in the current block based on the intra prediction mode / type and the neighboring reference samples (S1330). In this case, the image decoding device may perform a prediction sample filtering process. Prediction sample filtering may be referred to as post filtering. Through the prediction sample filtering process, some or all prediction samples may be filtered. In some cases, the prediction sample filtering process may be omitted.

[0226] The image decoding device may generate a residual sample of the current block based on the received residual information (S1340). The image decoding device may generate a reconstructed sample of the current block based on the predicted sample and the residual sample and derive a reconstructed block including the reconstructed sample (S1350). Based on the reconstructed block, a reconstructed picture of the current picture may be generated. As described above, the in-loop filtering process is further applicable to the reconstructed picture.

[0227] Fig.14 is a view illustrating a configuration of the intra predictor 265 according to the present disclosure.

[0228] like Fig.14 As shown, the intra-frame predictor 265 of the image decoding device may include an intra-frame prediction mode / type determination unit 266, a reference sample derivation unit 267, and a prediction sample derivation unit 268. The intra-frame prediction mode / type determination unit 266 may determine the intra-frame prediction mode / type of the current block based on the intra-frame prediction mode / type information generated and signaled by the intra-frame prediction mode / type determination unit 186 of the image encoding device, and the reference sample derivation unit 267 may derive the neighboring reference samples of the current block from the reconstructed reference area in the current picture. The prediction sample derivation unit 268 may derive the prediction sample of the current block. In addition, although not shown, when performing the above-mentioned prediction sample filtering process, the intra-frame predictor 265 may also include a prediction sample filter (not shown).

[0229] For example, the intra prediction mode information may include flag information (e.g., intra_luma_mpm_flag and / or intra_chroma_mpm_flag) indicating whether the most probable mode (MPM) or the residual mode is applied to the current block, and when MPM is applied to the current block, the intra prediction mode information may also include index information (e.g., intra_luma_mpm_idx and / or intra_chroma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may consist of an MPM candidate list or an MPM list. In addition, when MPM is not applied to the current block, the intra prediction mode information may also include residual mode information (e.g., intra_luma_mpm_remainder and / or intra_chroma_mpm_remainder) indicating one of the remaining intra prediction modes other than the intra prediction mode candidates (MPM candidates). The image decoding device may determine the intra prediction mode of the current block based on the intra prediction mode information. The MPM candidate modes may include intra prediction modes of neighboring blocks (eg, left neighboring blocks and / or upper neighboring blocks) of the current block and additional candidate modes.

[0230] In an example, the intra prediction mode may include two non-directional intra prediction modes and 33 directional intra prediction modes. The non-directional intra prediction mode may include a planar mode and a DC mode, and the directional intra prediction mode may include intra prediction modes 2 to 34. The planar intra prediction mode may be referred to as a planar mode, and the DC intra prediction mode may be referred to as a DC mode.

[0231] Alternatively, in order to capture any edge direction present in natural video, the intra prediction mode may include two non-directional intra prediction modes and 65 extended directional intra prediction modes. The non-directional intra prediction mode may include a planar mode and a DC mode, and the extended directional intra prediction mode may include intra prediction modes #2 to #66. The intra prediction mode is applicable to blocks of all sizes and both luminance components (luminance blocks) and chrominance components (chrominance blocks).

[0232] Alternatively, the intra prediction modes may include two non-directional intra prediction modes and 129 directional intra prediction modes. The non-directional intra prediction modes may include planar mode and DC mode, and the directional intra prediction modes may include intra prediction modes #2 to #130.

[0233] In addition, in addition to the above intra prediction modes, the intra prediction mode may also include a cross component linear model (CCLM) mode for chroma samples. The CCLM mode may be divided into L_CCLM, T_CCLM, LT_CCLM according to whether the left sample, the upper sample, or both are considered according to the LM parameter derivation, and may be applied only to the chroma component.

[0234] In another example, in order to capture any edge direction presented in natural video, the intra prediction mode may include two non-directional intra prediction modes and 93 directional intra prediction modes. The non-directional intra prediction mode may include a plane mode and a DC mode. The plane mode may be represented by INTRA_PLANAR, and the DC mode may be represented by INTRA_DC. In addition, the directional intra prediction mode may be represented by INTRA_ANGULAR-14 to INTRA_ANGULAR-1 and INTRA_ANGULAR2 to INTRA_ANGULAR80.

[0235] In addition, the intra-frame prediction technology information can be implemented in various forms. For example, the intra-frame prediction technology information may include intra-frame prediction type index information specifying one of a plurality of intra-frame prediction technologies. As another example, the intra-frame prediction technology information may include reference sample row information (e.g., intra_luma_ref_idx) indicating whether MRL is applied to the current block and which reference sample row to use if applied, ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether ISP is applied to the current block, ISP type information (e.g., intra_subpartitions_split_flag) specifying the type of division of the sub-partition when ISP is applied, flag information specifying whether PDPC is applied, or flag information specifying whether LIP is applied. In the present disclosure, the ISP flag information may be referred to as an ISP application indicator.

[0236] The intra-frame prediction mode information and / or the intra-frame prediction technology information may be encoded / decoded by the encoding method described in the present disclosure. For example, the intra-frame prediction mode information and / or the intra-frame prediction technology information may be encoded / decoded by entropy encoding (e.g., CABAC, CAVLC) based on truncated (rice) binary code.

[0237] Intra prediction of chroma blocks

[0238] When intra prediction is performed on the current block, prediction of the luminance component block (luminance block) and the chrominance component block (chrominance block) of the current block may be performed, and in this case, the intra prediction mode of the chrominance block may be set separately from the intra prediction mode of the luminance block.

[0239] For example, the intra prediction mode of the chroma block can be specified based on the intra chroma prediction mode information, and the intra chroma prediction mode information can be signaled in the form of an intra_chroma_pred_mode syntax element. For example, the intra chroma prediction mode information can specify one of a plane mode, a DC mode, a vertical mode, a horizontal mode, a derived mode (DM), and a cross-component linear model (CCLM) mode. Here, the plane mode can specify intra prediction mode #0, the DC mode can specify intra prediction mode #1, the vertical mode can specify intra prediction mode #26, and the horizontal mode can specify intra prediction mode #10. DM can also be called a direct mode. CCLM can also be called a linear model (LM).

[0240] DM and CCLM are related intra prediction modes that use information about the luma block to predict the chroma block. DM may mean a mode that applies the same intra prediction mode as the intra prediction mode of the luma component as the intra prediction mode of the chroma component. In addition, CCLM may mean an intra prediction mode that uses samples derived as shown in Formula 1 by downsampling the reconstructed samples of the luma block and then applying CCLM parameters α and β to the downsampled samples in the process of generating the prediction block of the chroma block as the prediction samples of the chroma block.

[0241] [Formula 1]

[0242] pred c (i,j)=·rec L ′(i,j)+β

[0243] Among them, pred c (i, j) can represent the predicted sample of the (i, j) coordinate of the current chroma block in the current CU. L '(i,j) can represent the reconstructed sample of the (i,j) coordinate of the current luminance block in the CU. For example, rec L '(i,j) may represent the downsampled reconstructed sample of the current luma block. The linear model coefficients α and β may be signaled or derived from neighboring samples.

[0244] When a chroma block is predicted with DM, the intra prediction mode of the chroma block can be derived as the intra prediction mode of the corresponding luminance block. For example, the intra prediction mode at a predetermined position of the corresponding luminance block can be used as the intra prediction mode of the chroma block.

[0245] In addition, multi-DM (multi-direct mode (MDM)) may be used to perform intra prediction of a chroma block. Multi-DM may be used by extending a single DM to a multi-mode, and a DM candidate list including a plurality of DM candidates may be constructed to derive an intra prediction mode of a chroma block, and one of the candidates included in the DM candidate list may be derived as the intra prediction mode of the chroma block. When multi-DM is applied, the DM candidate list may include at least one of the following plurality of DM candidates.

[0246] - Intra prediction modes at CR, TL, TR, BL and BR positions corresponding to luma blocks

[0247] - Intra prediction modes at L, A, BL, AR and AL positions as neighboring blocks of chroma blocks

[0248] - Planar mode and DC mode

[0249] - a directional pattern derived by adding / subtracting a predetermined offset (e.g., 1) to / from an already included directional pattern

[0250] -Default DM candidate modes: vertical mode, horizontal mode, mode #2, #34, #66, #10, #26 (in case of 65 directional modes)

[0251] - When four default DM candidates (PLANAR mode, DC mode, vertical mode, and horizontal mode) are not included in the DM candidate list, the DM candidates already included in the list are replaced with the default DM candidates that are not included

[0252] The intra prediction mode of the chroma block can be derived based on the intra chroma prediction mode information intra_chroma_pred_mode and / or the intra prediction mode of the corresponding luma block. For example, when the intra chroma prediction mode information specifies DM, the intra prediction mode of the chroma block can be determined in the same manner as the intra prediction mode of the corresponding luma block.

[0253] According to the above intra prediction method, intra prediction of luma blocks can be performed based on the MPM list, and intra prediction of chroma blocks can be performed based on a predetermined default mode and / or DM. The default intra prediction mode may include planar mode, DC mode, vertical mode, and horizontal mode.

[0254] Hereinafter, the palette mode will be described.

[0255] Overview of Palette Mode

[0256] The palette mode may mean a prediction mode in which the current block is encoded / decoded based on a palette (or palette table) including a predetermined set of representative color values. In the palette mode, each sample in the current block may be represented as a palette index value specifying a predetermined representative color. In the present disclosure, encoding / decoding using the palette mode may be referred to as palette encoding / decoding.

[0257] The palette mode can be used to improve the encoding / decoding efficiency of a particular image. For example, as an image including a large amount of text and graphics generated by an electronic device such as a computer or a smart phone, the picture content includes local areas separated by sharp edges, which can be represented by a relatively small number of colors. Therefore, compared with other prediction modes (e.g., intra-frame prediction mode, inter-frame prediction mode, etc.), the palette mode in which most pixel values ​​in the current block are represented by a relatively small number of indices may be more efficient in encoding / decoding the picture content.

[0258] The palette mode is one of the above-mentioned intra prediction modes and may be referred to as a palette coding mode, an intra palette mode, an intra palette coding mode, etc. However, when the palette mode is applied to the current block, unlike the intra prediction mode, the residual value of the current block may not be separately signaled. In this respect, the palette mode may be similar to the above-mentioned skip mode.

[0259] When the current block has a single tree structure, the palette mode can be applied to both the luminance component and the chrominance component of the current block. For example, when the palette mode is applied to the luminance component of the current block with a single tree structure, the palette mode can be applied to the chrominance component of the current block. In contrast, when the current block has a dual tree structure, the palette mode can be applied to the luminance component and the chrominance component of the current block separately. For example, when the palette mode is applied to the luminance component of the current block with a dual tree structure, the palette mode can be applied to the chrominance component of the current block, or one of other prediction modes (e.g., intra-frame prediction mode, inter-frame prediction mode, etc.) can be applied.

[0260] When a palette mode is applied to a current block, a palette table for the current block may be constructed based on the palette predictor.

[0261] The palette predictor may include one or more palette entries (representing color values) and one or more palette indexes for identifying the palette entries. In an example, the palette predictor may be initialized to a predetermined value (e.g., 0) when the CTU (or slice) including the current block is first encoded / decoded. In addition, the palette predictor may be updated using at least one palette entry for palette encoding / decoding. In an embodiment, until the size of the palette predictor reaches a predetermined maximum size (i.e., until the palette predictor includes the maximum allowed number of palette entries), the palette entry of the previous palette predictor that is not included in the current palette table may be added to the last position (index) of the palette predictor for the next palette encoding. This may be referred to as palette filling.

[0262] The palette table may include at least one palette entry included in the palette predictor and at least one palette index for identifying the palette entry. For each palette entry included in the palette predictor, a reuse flag specifying whether the palette entry is included in the palette table may be signaled via a bitstream. In this case, a reuse flag having a first value (e.g., 0) may specify that the palette entry is not included in the palette table. In contrast, a reuse flag having a second value (e.g., 1) may specify that the corresponding palette entry is included in the palette table. For example, a run-length encoding with a value of 0 may be used to encode the reuse flag.

[0263] In addition, the palette table may include at least one new palette entry not included in the palette predictor and at least one palette index for identifying the new palette entry. For example, information about the new palette entry (e.g., total number, component values, etc.) may be encoded using a 0th Index-Golomb code and signaled via the bitstream.

[0264] Based on the palette table, a palette index map for the current block to be encoded can be generated. Specifically, based on the similarity between the pixel value of each of the multiple samples in the current block and the representative color value, a palette index map for the current block can be generated by mapping a predetermined palette index in the palette table to each of the multiple samples. In this case, the escape palette index can be mapped to a sample (escape sample) having a pixel that is not similar to the representative color value (palette entry) defined in the palette table among the multiple samples in the current block. The escape palette index can specify an escape sample (escape symbol) and can have a maximum value within the palette table. In an example, an escape sample flag (e.g., palette_escape_val_present_flag) can be used to signal whether the current block includes an escape sample. For example, a palette_escape_val_present_flag having a first value (e.g., 0) can specify that the current block does not include an escape sample. In contrast, a palette_escape_val_present_flag having a second value (e.g., 1) can specify that the current block includes an escape sample.

[0265] The palette index prediction information of the palette index map may be signaled through a bitstream. The palette index prediction information may include at least one palette index mapped to the current block and run value information of the palette index. The run value of the palette index may specify a value obtained by subtracting 1 from the number of palette indexes continuously mapped to the current block as the same value. For example, when the current block includes the first to fourth samples continuously present in a predetermined scanning direction (e.g., horizontal direction), the first palette index (e.g., 0) is mapped to each of the first to third samples, and the second palette index (e.g., 1) is mapped to the fourth sample, the run value of the first palette index may be 2, and the run value of the second palette index may be 0. When the current block includes an escape sample (escape symbol) (e.g., palette_escape_val_present_flag=1), the palette index prediction information may include the run value information of the escape palette index mapped to the escape sample.

[0266] Based on the palette index prediction information, a palette index map for a current block to be encoded may be generated. For example, by mapping each of one or more palette indexes obtained from the palette index prediction information to each of a plurality of samples in the current block, a palette index map for the current block may be generated. In the example, based on the last palette index (in the mapping order) among the one or more palette indexes obtained from the palette index prediction information, the value of each of the one or more palette indexes may be adjusted. For example, when the last palette index obtained from the palette index prediction information is an escape palette index, the palette entry obtained from the palette index prediction information may be mapped to the current block as a value increased by a predetermined size (e.g., 1).

[0267] The current block may be encoded / decoded based on a palette index map. For samples having pixel values ​​equal to or similar to a representative color value defined in a palette table among a plurality of samples in the current block, a value of a palette index specifying the corresponding representative color value may be signaled through a bitstream. In contrast, for samples having pixel values ​​dissimilar to a representative color value defined in a palette table among a plurality of samples in the current block, a quantized pixel value of the corresponding sample may be directly signaled through a bitstream.

[0268] In order to encode the palette index mapped to the current block, a predetermined scanning method may be used to scan the palette index map. In addition, in order to construct the palette index map using the palette index obtained from the bitstream, a predetermined scanning method may be used to scan the current block.

[0269] Fig.15 is a view illustrating an example of a scanning method that can be used in the palette mode.

[0270] Reference Fig.15 , the scanning methods that can be used in the palette mode may include horizontal traversal scanning and vertical traversal scanning. Horizontal traversal scanning may mean a method of scanning the odd rows of the current block (or palette index map) from left to right and scanning the even rows of the current block from right to left. In addition, vertical traversal scanning may mean a method of scanning the odd columns of the current block from top to bottom and scanning the even columns of the current block from bottom to top.

[0271] Information about the scanning method that can be used in the palette mode can be signaled using a predetermined flag (e.g., palette_transpose_flag). For example, when the horizontal traversal scan is used for palette encoding of the current block, a palette_transpose_flag having a first value (e.g., 0) can be signaled through the bitstream. In contrast, when the vertical traversal scan is used for palette encoding of the current block, a palette_transpose_flag having a second value (e.g., 1) can be signaled through the bitstream.

[0272] The palette index mapped to each sample in the current block can be encoded using the "INDEX" mode and the "COPY_ABOVE" mode. In this disclosure, the "INDEX" mode and the "COPY_ABOVE" mode may be referred to as palette sample modes.

[0273] Except for the top row of the current block in the horizontal traversal scan, the leftmost column of the current block in the vertical traversal scan, and the case where the previous palette sample mode is "COPY_ABOVE", a predetermined flag (e.g., copy_above_palette_indices_flag) may be used to signal information about the palette sample mode. For example, a copy_above_palette_indices_flag having a first value (e.g., 0) may specify that a predetermined palette index mapped to the current block is encoded using the "INDEX" mode. In contrast, a copy_above_palette_indices_flag having a second value (e.g., 1) may specify that a predetermined palette index mapped to the current block is encoded using the "COPY_ABOVE" mode.

[0274] In "INDEX" mode, the value of the palette index may be explicitly signaled via the bitstream. In "INDEX" mode and "COPY_ABOVE" mode, run value information specifying the number of samples to be encoded consecutively using the same palette sample pattern may be signaled via the bitstream.

[0275] The palette indexes included in the palette index map can be encoded in the following order.

[0276] First, the number of palette indexes mapped to the current block (or current CU) can be signaled. Next, the values ​​of each palette index can be signaled using fixed length coding. In an example, the number of palette indexes and the values ​​of each palette index can be encoded using bypass mode. Thus, bypass bins related to the palette index can be grouped. In addition, information about the palette sample mode (e.g., copy_above_palette_indices_flag) and the run value information of the palette sample mode can be signaled in an interleaved manner. Finally, the component escape values ​​corresponding to the escape samples in the current block can be grouped and encoded in bypass mode. In an example, after the values ​​of each palette index are signaled, at least one additional syntax element (e.g., last_run_type_flag) can be additionally signaled. In this case, based on the number of palette indexes and the additional syntax elements, the signaling process of the run value corresponding to the last run in the current block can be skipped.

[0277] Fig.16 is a view illustrating an example of palette encoding processing of the current block.

[0278] Reference Fig.16 , a plurality of pixels (samples) in the current block may be represented using a total of three color values ​​(1610). For example, the first pixel PX1 may have a first color value, the second pixel PX2 may have a second color value, and the third pixel PX3 may have a third color value.

[0279] When the palette mode is applied to the current block, a palette table (1620) for the current block may be constructed. The palette table may include palette entries (representing color values) for each color component (e.g., (G, B, R), (Y, Cb, Cr), etc.) and a palette index (e.g., 0, 1) for identifying each palette entry. In addition, the palette table may also include an escape palette index (e.g., 2). The escape palette index may be mapped to an escape sample (or escape symbol) having a pixel value that is not similar to a representative color value defined in the palette table among multiple pixels in the current block. For the escape sample to which the escape palette index is mapped, the quantized pixel value of the escape sample may be notified by a signal.

[0280] Based on the similarity between the pixel value of each of the multiple samples in the current block and the representative color value, a palette index map (1630) for the current block can be generated by mapping a predetermined palette index in the palette table to each of the multiple samples. For example, a first palette index (e.g., 0) can be mapped to each first pixel PX1, a second palette index (e.g., 1) can be mapped to each second pixel PX2, and an escape palette index (e.g., 2) can be mapped to a third pixel PX3 as an escape sample, thereby generating a palette index map for the current block.

[0281] In order to encode the palette index map, by scanning the palette index included in the palette index map according to a predetermined scanning method, the palette sample pattern of each of the multiple samples in the current block and the run value of the palette sample pattern can be derived (1640, 1650). For example, in the horizontal traversal scan, the palette index "1,0,1,1,1" continuously mapped to the third row of the palette index map has the same index value as the palette index existing at the same position of the second row of the palette index map, and thus can be encoded in the "COPY_ABOVE" mode, and the run value of the "COPY_ABOVE" mode can be 4 (1640). In addition, in the horizontal traversal scan, the palette index "1,1,1" continuously mapped to the second row of the palette index map has a different index value from the palette index existing at the same position of the first row of the palette index map, and thus can be encoded in the "INDEX" mode, and the run value of the "INDEX" mode can be 2 (1650). Furthermore, an escape palette index (eg, 2) mapped to the third pixel PX3 as an escape sample may be encoded in the “INDEX” mode.

[0282] When a palette mode is applied to a current block, a predetermined palette index in the palette table can be mapped to each of multiple samples in the current block to generate a palette index map, and the palette index included in the palette index map can be encoded in "INDEX" mode or "COPY_ABOVE" mode according to a predetermined method.

[0283] Below, the syntax elements of the palette mode will be described.

[0284] Fig.17 is a view that illustrates some coding_unit syntax for palette mode, Figures 18a to 18e is a view that illustrates the palette_coding syntax for palette mode. The syntax elements for palette mode can be as follows Fig.17 and Figures 18a to 18e The encoding shown is signaled via the bitstream.

[0285] First, refer to Fig.17 , the palette mode flag pred_mode_plt_flag may specify whether the palette mode is applied to the current block (or current CU). For example, the first value (e.g., 0) of pred_mode_plt_flag may specify that the palette mode may not be applied to the current block. In contrast, the second value (e.g., 1) of pred_mode_plt_flag may specify that the palette mode is applied to the current block. When pred_mode_plt_flag is not obtained from the bitstream, the value of pred_mode_plt_flag may be determined as the first value.

[0286] Reference Fig.18a The parameter PredictorPaletteSize[startComp] can specify the size of the palette predictor for the first color component startComp of the palette table (current palette table) of the current block.

[0287] In addition, the parameter PalettePredictorEntryReuseFlags[i] can specify whether the i-th palette entry in the palette predictor is in the current palette table (i.e., whether it is reused). For example, PalettePredictorEntryReuseFlags[i] having a first value (e.g., 0) can specify that the i-th palette entry in the palette predictor is not reused in the current palette table. In contrast, PalettePredictorEntryReuseFlags[i] having a second value (e.g., 1) can specify that the i-th palette entry in the palette predictor is reused in the current palette table. In the example, the initial value of PalettePredictorEntryReuseFlags[i] can be set to 0.

[0288] Additionally, the parameter palette_predictor_run may specify the number of zeros that exist before a non-zero palette entry in the PalettePredictorEntryReuseFlags array.

[0289] Additionally, the parameter num_signalled_palette_entries may specify the number of palette entries in the current palette table that are explicitly signaled for the first color component startComp of the current palette table. The value of num_signalled_palette_entries may be inferred to be 0 when num_signalled_palette_entries is not obtained from the bitstream.

[0290] Reference Fig.18b, the parameter CurrentPaletteSize[startComp] may specify the size of the current palette table for the first color component startComp of the current palette table. The value of CurrentPaletteSize[startComp] may be calculated as shown in the following formula 2. In an example, CurrentPaletteSize[startComp] may have a value of 0 to palette_max_size.

[0291] [Formula 2]

[0292] CurrentPaletteSize[startComp]=NumPredictedPaletteEntries+num_signalled_palette_entries

[0293] Additionally, the parameter new_palette_entries[cIdx][i] may specify the value of the new i-th palette entry signaled for the color component cIdx.

[0294] Additionally, the parameter PredictorPaletteEntries[cIdx][i] may specify the i-th palette entry in the palette predictor for color component cIdx.

[0295] Additionally, the parameter CurrentPaletteEntries[cIdx][i] may specify the i-th palette entry in the current palette table for color component cIdx.

[0296] In addition, the parameter palette_escape_val_present_flag may specify whether there is an escape sample (escape symbol). For example, a palette_escape_val_present_flag having a first value may specify that the current block does not include an escape sample. In contrast, a palette_escape_val_present_flag having a second value (e.g., 1) may specify that the current block includes an escape sample. When palette_escape_val_present_flag is not obtained from the bitstream, the value of palette_escape_val_present_flag may be inferred to be 1.

[0297] In addition, the parameter MaxPaletteIndex can specify the maximum value of the palette index in the current palette table. The value of MaxPaletteIndex can be calculated as shown in the following formula 3.

[0298] [Formula 3]

[0299] MaxPaletteIndex=CurrentPaletteSize[startComp]+palette_escape_val_present_flag

[0300] In addition, the parameter num_palette_indices_minus1 may specify a value obtained by subtracting 1 from the number of palette indices signaled in the palette encoding process of the current block. When num_palette_indices_minus1 is not obtained from the bitstream, the value of num_palette_indices_minus1 may be inferred to be 0.

[0301] In addition, the parameter palette_idx_idc may be an indicator of a palette index of the current palette table CurrentPaletteEntries. palette_idx_idc may have a value of 0 to MaxPaletteIndex for the first palette index of the corresponding block, and a value of 0 to MaxPaletteIndex-1 for the remaining palette indexes of the corresponding block. When the value of palette_idx_idc is not obtained from the bitstream, the value of palette_idx_idc may be inferred to be 0.

[0302] In addition, the parameter PaletteIndexIdc[i] may specify the ith palette_idx_idc. In an example, all values ​​of the array PaletteIndexIdc may be initialized to zero.

[0303] In addition, the parameter copy_above_indices_for_final_run_flag can specify that the palette index at the last position in the current block is copied from the previous palette index. For example, copy_above_indices_for_final_run_flag with a first value (e.g., 0) can specify that the palette index at the last position in the current block is copied from PaletteIndexIdc[num_palette_indices_minus1]. In contrast, copy_above_indices_for_final_run_flag with a second value (e.g., 1) can specify that the palette index at the last position in the current block is copied from the palette index of the neighboring sample. When using vertical traversal scanning, there may be neighboring samples at the same position as the current sample in the left column of the current sample. When using horizontal traversal scanning, there may be neighboring samples at the same position as the current sample in the upper row of the current sample. When copy_above_indices_for_final_run_flag is not obtained from the bitstream, the value of copy_above_indices_for_final_run_flag may be inferred to be 0.

[0304] In addition, the parameter palette_transpose_flag can specify a scanning method for the current block (or palette index map). For example, a palette_transpose_flag having a first value (e.g., 0) can specify that a horizontal traversal scan is applied to the current block. In contrast, a palette_transpose_flag having a second value (e.g., 1) can specify that a vertical traversal scan is applied to the current block. When palette_transpose_flag is not obtained from the bitstream, the value of palette_transpose_flag can be inferred to be 0.

[0305] Reference Fig.18c , the parameter copy_above_palette_indices_flag may specify the encoding mode (palette sample mode) of the current sample in the current block. For example, a copy_above_palette_indices_flag having a first value (e.g., 0) may specify that the palette index mapped to the current sample is encoded in "INDEX" mode. In contrast, a copy_above_palette_indices_flag having a second value (e.g., 1) may specify that the palette index mapped to the current sample is encoded in "COPY_ABOVE" mode.

[0306] In addition, the parameter CopyAboveIndicesFlag[xC][yC] may specify the encoding mode for each of the multiple samples in the current block. That is, CopyAboveIndicesFlag may be an array of copy_above_palette_indices_flags for each of the multiple samples in the current block. Here, xC and yC may be coordinate indicators that specify the relative position of the current block relative to the upper left sample of the current picture.

[0307] When CopyAboveIndicesFlag[xC][yC] has a first value (e.g., 0), PaletteRunMinus1 may specify a value obtained by subtracting 1 from the number of palette indexes consecutively encoded using "COPY_ABOVE". In contrast, when CopyAboveIndicesFlag[xC][yC] has a second value (e.g., 1), PaletteRunMinus1 may specify a value obtained by subtracting 1 from the number of palette indexes consecutively encoded using the "INDEX" mode.

[0308] Reference Fig.18d , the parameter PaletteIndexMap[xC][yC] may specify a palette index map for the current block. That is, PaletteIndexMap may be an array of CurrentPaletteEntries for each of a plurality of samples in the current block. Here, xC and yC may be coordinate indicators that specify the relative position of the current sample to the top left sample of the current picture. In an example, PaletteIndexMap[xC][yC] may have a value from 0 to (MaxPaletteIndex-1).

[0309] In addition, the parameter PaletteMaxRunMinus1 can specify a maximum value of PaletteRunMinus1. In an example, PaletteMaxRunMinus1 can have a value greater than 0.

[0310] Additionally, the parameter palette_run_prefix can specify the prefix part used for the binarization of PaletteRunMinus1.

[0311] In addition, the parameter palette_run_suffix may specify a binarized suffix portion for PaletteRunMinus 1. When palette_run_suffix is ​​not obtained from the bitstream, the value of palette_run_suffix may be inferred to be 0.

[0312] In an example, when the value of PaletteMaxRunMinus1 is 0, the value of PaletteRunMinus1 may be set to 0. In contrast, when PaletteMaxRunMinus1 is greater than 0, PaletteRunMinus1 may be set based on the value of palette_run_prefix. For example, when the value of palette_run_prefix is ​​less than 2, the value of PaletteRunMinus1 may be set as shown in Equation 4 below.

[0313] [Formula 4]

[0314] PaletteRunMinus1=palette_run_prefix

[0315] When the value of palette_run_prefix is ​​equal to or greater than 2, the value of PaletteRunMinus1 can be calculated as shown in the following formula 5.

[0316] [Formula 5]

[0317] PrefixOffset=1<<(palette_run_prefix-1)

[0318] PaletteRunMinus1=PrefixOffset+palette_run_suffix

[0319] Reference Fig.18e , the parameter palette_escape_val can specify the quantized pixel value of the escape sample in the current block.

[0320] In addition, the parameter PaletteEscapeVal[cIdx][xC][yC] may specify the quantized pixel value of the escape sample for which the value of PaletteIndexMap[xC][yC] is MaxPaletteIndex and the value of palette_escape_val_present_flag is 1. Here, cIdx may specify a color component, and xC and yC may be coordinate indicators that specify the relative position of the current sample relative to the upper left sample of the current picture.

[0321] Hereinafter, a method of applying a palette mode to a current block having a local dual tree structure will be described.

[0322] Apply palette mode to current block with local dual tree structure

[0323] Fig.19 is a view illustrating an example of a CTU having a local dual tree structure.

[0324] Reference Fig.19 , for each of the luminance component and the chrominance component, the current CU may be divided into a quadtree structure. For example, in the current CU having a 4:2:0 color format, the 16×16 luminance block may be divided by the quadtree, thereby generating the first luminance block 1911 to the fourth luminance block 1914, each having an 8×8 size. In addition, the 8×8 chrominance block may be divided by the quadtree, thereby generating the first chrominance block 1921 to the fourth chrominance block 1924, each having a 4×4 size. In this case, the first chrominance block 1921 may correspond to the first luminance block 1911, the second chrominance block 1922 may correspond to the second luminance block 1912, the third chrominance block 1923 may correspond to the third luminance block 1913, and the fourth chrominance block 1924 may correspond to the fourth luminance block 1914.

[0325] When the minimum size of a chroma block is constrained to include 16 or more chroma samples, additional partitioning of the first chroma block 1921 to the fourth chroma block 1924 may be prohibited. In contrast, in order to improve coding efficiency, additional partitioning of the first luminance block 1911 to the fourth luminance block 1914 may be allowed. Therefore, the third luminance block 1913 may be vertically binary-partitioned to generate two luminance blocks 1913-1 and 1913-2 each having a size of 4×8. In this case, the partitioning structure of the third luminance block 1913 may be referred to as a dual-tree luminance DUAL_TREE_LUMA, and the partitioning structure of the third chroma block 1923 may be referred to as a dual-tree chroma DUAL_TREE_CHROMA. In addition, since only the lower-layer CU including the third luminance block 1913 and the third chroma block 1923 among the multiple lower-layer CUs generated by partitioning the current CU has a dual-tree structure, the partitioning structure of the lower-layer CU may be referred to as a local dual-tree structure. In this case, Fig. 20 An example of the decoding process of the current CU is shown in FIG.

[0326] Fig. 20 is exemplified in Fig.19 A view of an example of the decoding process of the current CU in an example.

[0327] The luminance block and chrominance block of the lower CU with a single tree structure can be decoded based on the same prediction mode (e.g., intra prediction mode, IBC, palette mode, inter prediction mode, etc.). In contrast, the luminance block and chrominance block of the lower CU with a dual tree structure can be decoded based on a combination of various prediction modes separately. For example, the luminance block and chrominance block of the lower CU with a dual tree structure can be decoded using the same prediction mode or different prediction modes.

[0328] exist Fig. 20In order to distinguish between the lower layer CU having a single tree structure and the lower layer CU having a dual tree structure, only the luminance block is shown for the lower layer CU having a single tree structure, and both the luminance block and the chrominance block are shown for the lower layer CU having a dual tree structure. In addition, for the lower layer CU having a single tree structure, the decoding process will be described based on the luminance block.

[0329] Reference Fig. 20 , the first luminance block 1911 having a single tree structure can be decoded using the inter-prediction mode. In addition, the second luminance block 1912 having a single tree structure can be decoded using the palette mode. In addition, the fourth luminance block 1914 having a single tree structure can be decoded using the palette mode. In contrast, the (3-1)th luminance block 1913-1 having a dual tree structure can be decoded using the palette mode, the (3-2)th luminance block 1913-2 can be decoded using the intra-frame mode, and the third chrominance block 1923 can be decoded using the palette mode.

[0330] The decoding process of the first luminance block 1911 to the fourth luminance block 1914 can be performed sequentially. In addition, the decoding process of the (3-1) luminance block 1913-1 and the (3-2) luminance block 1913-2 and the decoding process of the third chrominance block 1923 can be performed in parallel or sequentially according to a predetermined order.

[0331] When performing palette decoding of the second luma block 1912, as described above, a palette predictor including a palette entry for each of the luma component and the chroma component and a palette index for identifying the palette entry may be constructed. In addition, the palette predictor may be updated using the palette entry applied to the second luma block 1912 for the next palette decoding (S2010).

[0332] When the palette decoding of the second luma block 1912 is completed, the palette decoding of the (3-1)th luma block 1913-1 and the third chroma block 1923 may be performed separately using the palette predictor updated in step S2010.

[0333] The palette predictor for the (3-1)th luma block 1913-1 may include only the palette entry for the luma component in the palette predictor updated in step S2010 and a palette index for identifying the palette entry (S2020). The palette predictor for the (3-1)th luma block 1913-1 may be referred to as a luma palette predictor. In addition, when palette decoding of the (3-1)th luma block 1913-1 is completed, the luma palette predictor may be updated using the palette entry applied to the (3-1)th luma block 1913-1 (S2030).

[0334] The palette predictor for the third chroma block 1923 may include only the palette entry for the chroma component in the palette predictor updated in step S2010 and the palette index for identifying the palette entry (S2040). The palette predictor for the third chroma block 1923 may be referred to as a chroma palette predictor. In addition, when palette decoding of the third chroma block 1923 is completed, the chroma palette predictor may be updated using the palette entry applied to the third chroma block 1923 (S2050).

[0335] After decoding is performed on the (3-2)th luminance block 1913-2, palette decoding on the fourth luminance block 1914 may be performed.

[0336] A palette predictor for the fourth luma block 1914 may be constructed by combining the luma palette predictor updated in step S2030 with the chroma palette predictor updated in step S2050 (S2060). That is, the palette predictor for the fourth luma block 1914 may include a palette entry for the luma component of the (3-1)th luma block 1913-1, a palette entry for the chroma component of the third chroma block 1923, and a palette index for identifying each palette entry. In this case, the size of the palette predictor for the fourth luma block 1914 (i.e., the number of palette entries) may be determined based on the number of palette entries for the luma component. For example, when the size of the luma palette predictor updated in step S2030 is N (N is an integer greater than 0) and the size of the chroma palette predictor updated in step S2050 is M (M is an integer greater than 0), the size of the palette predictor for the fourth luma block 1914 may be determined to be N. Due to these characteristics, the palette predictor may include (invalid) palette entries, or may not include valid palette entries. Fig.21 and Fig. 22 is exemplified in Fig. 20 A view of the problem that occurs when a palette mode is applied to a lower-level CU with a local dual-tree structure in the example of FIG.

[0337] First, refer to Fig.21 , the luma palette predictor 2110 updated as a result of palette decoding of the (3-1)th luma block 1913-1 having a local dual-tree structure may include, for example, 9 palette entries (representing color values) for luma components (e.g., Y components). In addition, the chroma palette predictor 2120 updated as a result of palette decoding of the third luma block 1923 having a dual-tree structure may include, for example, two palette entries for each chroma component (e.g., Cb component and Cr component).

[0338] In addition, after performing separate palette decoding on the (3-1)th luma block 1913-1 and the third chroma block 1923, palette decoding on the fourth luma block 1914 having a single tree structure may be performed. In this case, a palette predictor 2130 for the fourth luma block 1914 may be constructed by combining the luma palette predictor 2110 and the chroma palette predictor 2120 based on the size of the luma palette predictor 2110. Specifically, since the size of the luma palette predictor 2110 is 9 (e.g., PredictorPaletteSize[0]=9) and the size of the chroma palette predictor 2120 is 2 (e.g., PredictorPaletteSize[1]=2, PredictorPaletteSize[2]=2) for each chroma component (e.g., Cb and Cr), the size of the palette predictor 2130 for the fourth luma block 1914 may be determined to be 9. To satisfy the determined size, the palette predictor 2130 for the fourth luma block 1914 may include palette entries 2131 having 7 NULL values ​​for each chroma component. As a result, unnecessary memory space for storing palette entries having NULL values ​​may be wasted, and decoding efficiency may be degraded.

[0339] Next, refer to Fig. 22 , the luma palette predictor 2210 updated as a result of palette decoding of the (3-1)th luma block 1913-1 having a local dual tree structure may include, for example, three palette entries (representing color values) for the luma component (e.g., Y). In addition, the chroma palette predictor 2220 updated as a result of palette decoding of the third luma block 1923 having a local dual tree structure may include, for example, five palette entries for each chroma component (e.g., Cb and Cr).

[0340] In addition, after performing separate palette decoding on the (3-1)th luma block 1913-1 and the third chroma block 1923, palette decoding on the fourth luma block 1914 having a single tree structure may be performed. In this case, a palette predictor 2230 for the fourth luma block 1914 may be constructed by combining the luma palette predictor 2210 and the chroma palette predictor 2220 based on the size of the luma palette predictor 2210. Specifically, since the size of the luma palette predictor is 3 (e.g., PredictorPaletteSize[0]=3), and the size of the chroma palette predictor 2220 is 5 (e.g., PredictorPaletteSize[1]=5, PredictorPaletteSize[2]=5) for each chroma component (e.g., Cb and Cr), the size of the palette predictor 2230 for the fourth luma block 1914 may be determined to be 3. In order to meet the determined size, the last two valid palette entries 2221 for each chroma component included in the chroma palette predictor 2220 may be discarded. As a result, since the optimal palette table for the fourth luma block 1914 cannot be constructed, the palette decoding performance of the palette decoding of the fourth luma block 1914 may be degraded.

[0341] To resolve the reference Fig.21 and Fig. 22 Regarding the described problem, according to the image encoding / decoding method according to an embodiment of the present disclosure, the process of updating the palette predictor can be skipped, or the palette mode can be selectively applied based on whether the partition structure of the current block is a local dual-tree structure.

[0342] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.

[0343] Implementation #1

[0344] According to embodiment #1 of the present disclosure, when palette encoding / decoding is performed on a current block having a local dual-tree structure, a process of updating a palette predictor may be selectively performed based on a partition structure of the current block.

[0345] Fig.23 is a flowchart illustrating a palette encoding method according to an embodiment of the present disclosure.

[0346] Fig.23 The palette encoding method can be represented by Figure 2 Specifically, steps S2310 to S2350 may be performed by the intra prediction unit 165 or a separate functional block (eg, a palette encoder) different from the intra prediction unit 165.

[0347] Whether the palette mode is applied to the current block may be determined based on the prediction mode type of the current block. For example, when the prediction mode type of the current block is a first mode type (e.g., MODE_TYPE_ALL) to which all intra predictions, intra block copy (IBC), palette mode, and inter predictions are applicable, the palette mode may be applied to the current block. In contrast, when the prediction mode type of the current block is a second mode type (e.g., MODE_TYPE_INTRA) to which only intra predictions are applicable or a third mode type (e.g., MODE_TYPE_INTER) to which only inter predictions are applicable, the palette mode may not be applied to the current block. Whether the palette mode is applied to the current block may be signaled using a predetermined flag (e.g., pred_mode_plt_flag). For example, when the palette mode is not applied to the current block, a pred_mode_plt_flag having a first value (e.g., 1) may be signaled. In contrast, when the palette mode is applied to the current block, a pred_mode_plt_flag having a second value (e.g., 1) may be signaled.

[0348] Reference Fig.23 , when the palette mode is applied to the current block, the image encoding device can construct a palette predictor and a palette table of the current block (S2310).

[0349] The palette predictor may include at least one palette entry (representing a color value) and a palette index for identifying the palette entry. When the current block is a block that is palette-encoded for the first time in the current CTU (or slice), the palette predictor may have a predetermined initial value (e.g., 0). In contrast, when the current block is not a block that is palette-encoded for the first time in the current CTU, the palette predictor may include at least one palette entry used in a previous palette encoding process of the current block.

[0350] The image encoding device may construct a palette table based on the palette predictor. The palette table may include at least one palette entry selected from the palette predictor and a palette index for identifying each palette entry.

[0351] In an example, the palette predictor and the palette table may be constructed differently according to the color format (or chroma format) of the current block. For example, when the color format of the current block is the monochrome format described above with reference to Table 2, the palette predictor and the palette table may include only a palette entry for the luma component of the current block. In contrast, when the color format of the current block is the 4:2:0, 4:2:2, or 4:4:4 format described above with reference to Table 2, the palette predictor and the palette table may include a palette entry for each of the luma component and the chroma component of the current block.

[0352] In an example, a palette predictor and a palette table may be constructed differently according to a partition structure of a current block. For example, when the current block has a single tree structure, the palette predictor and the palette table may have one configuration that is commonly applied to the luma component and the chroma component of the current block. In contrast, when the current block has a dual tree structure, the palette predictor and the palette table may have multiple configurations that are individually applied to each of the luma component and the chroma component of the current block. For example, a palette predictor for the current block may include a luma palette predictor for the luma component and a chroma palette predictor for the chroma component. In this case, the number of palette entries included in the luma palette predictor may be different from the number of palette entries included in the chroma palette predictor.

[0353] The image encoding apparatus may generate a palette index map for the current block based on the palette table ( S2320 ).

[0354] The palette index map may mean that a predetermined palette index in the palette table is mapped to each sample in the current block. For example, the palette index that specifies the corresponding representative color value may be mapped to a sample having a pixel value equal to or similar to the representative color value defined in the palette table among multiple samples in the current block. In contrast, the escape palette index may be mapped to a sample (escape sample) having a pixel value that is not similar to the representative color value defined in the palette table among multiple samples in the current block. In the example, it may be determined based on a predetermined threshold whether the pixel value of each sample is similar to the representative color value defined in the palette table. For example, when the difference between the pixel value of each sample and the representative color value is equal to or less than a predetermined threshold, the palette index that specifies the representative color value may be mapped to the corresponding sample. In contrast, when the difference between the pixel value of each sample and the representative color value exceeds a predetermined threshold, the escape palette index may be mapped to the corresponding sample.

[0355] The image encoding apparatus may encode the current block based on the palette index map (S2330).

[0356] The encoding process of the current block can be performed by scanning the palette index in the palette index map according to a predetermined scanning method. Specifically, the image encoding device can determine the encoding mode (palette sample mode) of each palette index by scanning the palette index mapped to the current block according to a predetermined scanning method.

[0357] The palette encoding scanning method may include the above reference Fig.15The horizontal traversal scan and the vertical traversal scan described above are described above. In an example, palette_transpose_flag may be used to signal information about the scanning method. For example, when the horizontal traversal scan is used for palette encoding of the current block, a palette_transpose_flag having a first value (e.g., 0) may be signaled. In contrast, when the vertical traversal scan is used for palette encoding of the current block, a palette_transpose_flag having a second value (e.g., 1) may be signaled.

[0358] The encoding mode for encoding each palette index mapped to the current block may be referred to as a palette sample mode. The palette sample mode may include an "INDEX" mode and a "COPY_ABOVE" mode. When the palette sample mode is determined to be the "INDEX" mode, the value of the corresponding palette index may be encoded. In contrast, when the palette sample mode is determined to be the "COPY_ABOVE" mode, the value of the corresponding palette index may not be encoded, and information specifying that the corresponding palette index has the same value as the palette index existing above (in the case of a horizontal traversal scan) or on the left (in the case of a vertical traversal scan). In an example, information about the palette sample mode may be signaled using copy_above_palette_indices_flag. For example, when the palette sample mode of the current sample is determined to be the "INDEX" mode, a copy_above_palette_indices_flag having a first value (e.g., 0) may be signaled. In contrast, when the palette sample mode of the current sample is determined to be the 'COPY_ABOVE' mode, a copy_above_palette_indices_flag having a second value (eg, 1) may be signaled.

[0359] In addition, in "INDEX" mode and "COPY_ABOVE" mode, run value information specifying the number of palette indices encoded consecutively using the same palette sample pattern may be additionally encoded.

[0360] In addition, in the case of an escape sample, a quantized pixel value of the escape sample may be encoded. In an example, an escape sample flag (e.g., palette_escape_val_present_flag) may be used to signal whether the current block includes an escape sample. For example, when the current block does not include an escape sample, a palette_escape_val_present_flag having a first value (e.g., 0) may be signaled. In contrast, when the current block includes an escape sample, a palette_escape_val_present_flag having a second value (e.g., 1) may be signaled.

[0361] The image encoding apparatus may determine whether the division structure of the current block is a local dual tree structure (S2340).

[0362] In an example, whether the partition structure of the current block is a local dual-tree structure can be determined based on the prediction mode type of the current block. Figures 10a to 10c As described, when the prediction mode type of the current block is MODE_TYPE_INTRA applicable only to intra-frame prediction, the partition structure of the current block may be a local dual-tree structure. In contrast, when the prediction mode type of the current block is not MODE_TYPE_INTRA (eg, MODE_TYPE_ALL), the partition structure of the current block may be a single-tree structure.

[0363] In another example, whether the partition structure of the current block is a local dual tree structure can be determined based on at least one of the tree type treeType of the current block or the partition structure of the current CTU. For example, when the tree type of the current block is not a single tree SINGLE_TREE and the current CTU is included in a P slice or a B slice or is divided into a single tree structure, the partition structure of the current block may be a local dual tree structure. In contrast, when the tree type of the current block is a single tree SINGLE_TREE, the partition structure of the current block may be a single tree structure. Alternatively, when the current block is included in an I slice, the CTU included in the corresponding slice is implicitly quad-tree divided into 64×64 luma sample CUs and the 64×64 luma sample CU is the root node of the dual tree, the partition structure of the current block may be a dual tree structure. The LocalDualTreeFlag shown in Formula 6 below may be used to signal whether the partition structure of the current block is a local dual tree structure.

[0364] [Formula 6]

[0365] LocalDualTreeFlag=(treeType!=SINGLE_TREE&&(sh_slice_type!=I||(sh_slice_type==I&&sps_qtbtt_dual_tree_intra_flag==0)))? 1:0

[0366] Referring to Formula 6, sps_qtbtt_dual_tree_intra_flag may specify a partition structure of a current CTU. For example, sps_qtbtt_dual_tree_intra_flag having a first value (e.g., 0) may specify that the current block is included in an I slice and the CTU included in the corresponding slice is partitioned to have a single tree structure. In contrast, sps_qtbtt_dual_tree_intra_flag having a second value (e.g., 1) may specify that the current block is included in an I slice, the CTU included in the corresponding slice is implicitly quad-tree partitioned into 64×64 luma sample CUs, and the 64×64 luma sample CUs are the root nodes of the dual trees.

[0367] The value of LocalDualTreeFlag can be determined based on the tree type treeType of the current block, the slice type sh_slice_type, and the partition structure sps_qtbtt_dual_tree_intra_flag of the current CTU. The first value of LocalDualTreeFlag (e.g., 0) can specify that the partition structure of the current block is not a local dual tree structure, and the second value of LocalDualTreeFlag (e.g., 1) can specify that the partition structure of the current block is a local dual tree structure.

[0368] When the partition structure of the current block is not a local dual-tree structure (S2340 is "No"), the image encoding device may use the palette table for the current block to update the palette predictor (S2350). For example, when the current block is a luminance block in a monochrome format, the image encoding device may update the palette predictor. In addition, when the current block is a chrominance block and the partition structure of the current block is not a local dual-tree structure, the image encoding device may update the palette predictor. In contrast, when the current block is a chrominance block and the partition structure of the current block is a local dual-tree structure, the image encoding device may not update the palette predictor.

[0369] In an example, the image encoding device may update the palette predictor by adding at least one palette entry included in the palette table to the palette predictor. In addition, the image encoding device may update the palette predictor by replacing at least one palette entry included in the palette predictor with at least one palette entry included in the palette table. In this case, the replaced palette entry in the palette predictor may be determined as the oldest palette entry or the least frequently used palette entry according to a first-in-first-out (FIFO) method.

[0370] In an example, the update process of the palette predictor can be continuously performed until the palette predictor reaches a maximum size. When the palette predictor does not reach the maximum size, at least one palette entry in the palette predictor that is not reused in the palette table can be added as a new palette predictor. This can be referred to as palette filling. In addition, information about the updated palette predictor can be encoded and notified with a signal.

[0371] When the partition structure of the current block is a local dual tree structure (S2340 is "yes"), the image encoding device can skip the step S2350 of updating the palette predictor. In this case, for the blocks in the current CTU that are palette-coded after the current block, the palette predictor applied to the current block can be applied again.

[0372] In addition, although the step S2340 of determining whether the partition structure of the current block is a local dual-tree structure is shown as Fig.23 The step S2340 is performed after step S2330 of encoding the current block in the above embodiment, but the operation order may be changed differently. For example, step S2340 may be performed before or in step S2330, or may be performed simultaneously with step S2330.

[0373] Fig.24 is exemplified in Fig.19 A view of the palette encoding process when the palette predictor is not updated in the example shown in Figure 2.

[0374] Reference Fig.24In the palette predictor updated in the encoding process S2410 of the second luma block 1912, the palette entry for the luma component can be used for the palette encoding of the (3-1)th luma block 1913-1 (S2420). In addition, in the palette predictor updated in the encoding process S2410 of the second luma block 1912, the palette entry for the chroma component can be used for the palette encoding of the third chroma block 1923 (S2430). In addition, in the palette encoding process of the (3-1)th luma block 1913-1 and the third chroma block 1923 having the local dual tree structure, the process of updating the palette predictor can be skipped. As a result, for the fourth luma block 1914 that is palette-encoded after the (3-1)th luma block 1913-1 and the third chroma block 1923, the palette predictor updated in the palette encoding process S2410 for the second luma block 1912 can be applied again (S2440).

[0375] Fig.25 is a view illustrating an example of a process of selectively updating a palette predictor based on a partition structure of a current block.

[0376] Reference Fig.25 , the update operation of constructing the palette entry PredictorPaletteEntries of the palette prediction sub PredictorPaletteEntries[cIdx][i] can be performed only when the prediction mode type of the current block is the first mode type (for example, MODE_TYPE_ALL) to which all intra-frame predictions, intra-frame block copy (IBC), palette modes and inter-frame predictions are applicable.

[0377] The parameter CurrentPaletteSize[startComp] may specify the size of the palette table (ie, the total number of palette entries) for the current block.

[0378] The value of each of the parameters startComp, numComps, and maxNumPalettePredictorSize may be differently set according to the partition tree structure of the current block.

[0379] For example, when the current block has a single tree structure, the value of each of the parameters startComp, numComps, and maxNumPalettePredictorSize may be set as shown in Equation 7 below.

[0380] [Formula 7]

[0381] startComp=0

[0382] numComps=sps_chroma_format_idc==0?1:3

[0383] maxNumPalettePredictorSize=63

[0384] Referring to Formula 7, the first color component startComp of the palette table may be set to 0. In addition, when the color format (or chroma format) of the current block is monochrome, the total number numComps of the color components of the palette table may be set to 1, and when the color format of the current block is a 4:4:4 format, the total number numComps of the color components of the palette table may be set to 3. In addition, the maximum size maxNumPalettePredictorSize of the palette predictor may be set to 63.

[0385] In contrast, when the current block has a dual-tree luma structure, a value of each of parameters startComp, numComps, and maxNumPalettePredictorSize may be set as shown in Equation 8 below.

[0386] [Formula 8]

[0387] startComp=0

[0388] numComps=1

[0389] maxNumPalettePredictorSize=31

[0390] Referring to Formula 8, the first color component startComp of the palette table may be set to 0. In addition, the total number numComps of the color components of the palette table may be set to 1. In addition, the maximum size maxNumPalettePredictorSize of the palette predictor may be set to 31.

[0391] In addition, when the current block has a dual-tree chroma structure, a value of each of parameters startComp, numComps, and maxNumPalettePredictorSize may be set as shown in Equation 9 below.

[0392] [Formula 9]

[0393] startComp=1

[0394] numComps=2

[0395] maxNumPalettePredictorSize=31

[0396] Referring to Formula 9, the first color component startComp of the palette table may be set to 1. In addition, the total number numComps of the color components of the palette table may be set to 2. In addition, the maximum size maxNumPalettePredictorSize of the palette predictor may be set to 31.

[0397] All palette entries of the palette table may be set to new palette entries (newPredictorPaletteEntries[cIdx][i]=CurrentPaletteEntries[cIdx][i]). Here, cIdx may refer to a color component. In addition, the size of the new palette predictor of the first color component startComp may be set to the size of the new palette predictor (newPredictorPaletteSize=CurrentPaletteSize[startComp]).

[0398] Next, based on the value of the predetermined reuse flag PalettePredictorEntryReuseFlags[i], at least one palette entry of the palette predictor can be set to a new palette entry (newPredictorPaletteEntries[cIdx][newPredictorPaletteSize]=PredictorPaletteEntries[cIdx][i]). In addition, the size of the new palette predictor can be increased by 1 (newPredictorPaletteSize++).

[0399] Next, all of the above new palette entries can be set to the palette entries of the new palette predictor (PredictorPaletteEntries[cIdx][i] = newPredictorPaletteEntries[cIdx][i]). In addition, the size of the new palette predictor can be set to the size of the palette predictor for the first color component startComp (newPredictorPaletteSize = PredictorPaletteSize[StartComp]).

[0400] Fig.26 is a flowchart illustrating a palette decoding method according to an embodiment of the present disclosure.

[0401] Fig.26 The palette decoding method can be obtained by Figure 3Specifically, steps S2610 to S2660 may be performed by the intra prediction unit 265 or a separate functional block (eg, a palette decoder) different from the intra prediction unit 265.

[0402] Reference Fig.26 , when the palette mode is applied to the current block, the image decoding device can obtain the palette information and palette index prediction information of the current block from the bitstream (S2610).

[0403] The palette information may include information about the palette predictor. In addition, the palette information may also include information about the new palette entry. In an example, the image decoding device may obtain information about the palette predictor by decoding PredictorPaletteEntries[cIdx][i] included in the bitstream. In addition, in an example, the image decoding device may obtain information about the new palette entry by decoding new_palette_entries[cIdx][i] included in the bitstream. In PredictorPaletteEntries[cIdx][i] and new_palette_entries[cIdx][i], cIdx may mean a color component.

[0404] The palette index prediction information may include information about a palette index map for the current block. In an example, the image decoding device may obtain at least one palette index mapped to the current block by decoding PaletteIndexMap[xC][yC] included in the bitstream. Here, xC and yC may be coordinate indicators that specify the relative position of the current sample relative to the upper left sample of the CTU (or slice) to which the current block belongs. In an example, the image decoding device may obtain the run value information of the palette index included in the palette index map by decoding PaletteRunMinus1 included in the bitstream.

[0405] The image decoding apparatus may construct a palette predictor and a palette table for the current block based on the palette information obtained from the bitstream (S2620).

[0406] In an example, the image decoding device may construct a palette predictor for the current block based on PredictorPaletteEntries[cIdx][i] included in the bitstream. For example, the palette predictor may have a predetermined value (e.g., 0) initialized at the first decoding of a CTU (or slice) including the current block. Alternatively, the palette predictor may have the same configuration as a palette predictor updated in a previous palette decoding process.

[0407] The image decoding device may construct a palette table for the current block based on the palette predictor. The palette table may include at least one of a palette entry included in the palette predictor or a new palette entry obtained from a bitstream and a palette index for identifying each palette entry.

[0408] In an example, the palette predictor and the palette table may be constructed differently according to the color format (or chroma format) of the current block. For example, according to the color format of the current block, the palette predictor and the palette table may include only a palette entry for the luma component or a palette entry for each of the luma component and the chroma component.

[0409] In an example, the palette predictor and the palette table may be constructed differently according to the partition structure of the current block. For example, when the current block has a single tree structure, the palette predictor and the palette table may have a single configuration commonly applied to the luminance component and the chrominance component of the current block. In contrast, when the current block has a dual tree structure, the palette predictor and the palette table may have multiple configurations individually applied to the luminance component and the chrominance component of the current block.

[0410] The image decoding apparatus may generate a palette index map for the current block based on the palette index prediction information obtained from the bitstream (S2630). Specifically, the image decoding apparatus may generate a palette index map by mapping the palette index to each sample in the current block according to a predetermined scanning method using the palette index obtained from the bitstream, the palette sample pattern, and the run value of the palette sample pattern.

[0411] The scanning method of palette decoding may include the above reference Fig.15 The horizontal traversal scan and vertical traversal scan described above. In an example, the scanning method of the palette decoding can be determined by decoding the palette_transpose_flag included in the bitstream. For example, when_transpose_flag has a first value (e.g., 0), the scanning method of the palette decoding can be determined as the horizontal traversal scan. In contrast, when palette_transpose_flag has a second value (e.g., 1), the scanning method of the palette decoding can be determined as the vertical traversal scan.

[0412] As described above, the palette sample mode may include an "INDEX" mode and a "COPY_ABOVE" mode. When the "INDEX" mode is applied to the current sample, the value of the palette index mapped to the current sample may be obtained directly from the bitstream. In contrast, when the "COPY_ABOVE" mode is applied to the current sample, the value of the palette index mapped to the current sample may be determined as the value of the palette index mapped to the adjacent sample existing above (in the case of horizontal traversal scanning) or to the left (in the case of vertical traversal scanning) of the current sample.

[0413] In addition, when the current sample is an escape sample, the quantized pixel value of the current sample can be obtained directly from the bitstream. The escape palette index can be mapped to the escape sample.

[0414] The image decoding device can decode the current block based on the palette table and the palette index map for the current block (S2640). Specifically, the image decoding device can generate a prediction block of the current block by inversely mapping the values ​​of each palette index in the palette index map to a representative color value by referring to the palette table.

[0415] In addition, the image decoding apparatus may determine whether the current block has a local dual tree structure (S2650).

[0416] In an example, whether the partition structure of the current block is a local dual-tree structure can be determined based on the prediction mode type of the current block. Figures 10a to 10c As described, when the prediction mode type of the current block is MODE_TYPE_INTRA applicable only to intra-frame prediction, the partition structure of the current block may be a local dual-tree structure. In contrast, when the prediction mode type of the current block is not MODE_TYPE_INTRA (eg, MODE_TYPE_ALL), the partition structure of the current block may be a single-tree structure.

[0417] In another example, whether the partition structure of the current block is a local dual tree structure can be determined based on at least one of the tree type treeType of the current block and the partition structure of the CTU (current CTU) including the current block. For example, when the tree type of the current block is not a single tree SINGLE_TREE and the current CTU is divided into a single tree structure, the partition structure of the current block may be a local dual tree structure. In contrast, when the tree type of the current block is a single tree SINGLE_TREE, the partition structure of the current block may be a single tree structure. Alternatively, when the current block is included in an I slice, the CTU included in the corresponding slice is implicitly quad-tree-divided into 64×64 luma sample CUs, and the 64×64 luma sample CUs are the root nodes of the dual trees, the partition structure of the current block may be a dual tree structure. Whether the partition structure of the current block is a local dual tree structure can be determined by decoding the above-mentioned LocalDualTreeFlag shown in Formula 6. For example, when LocalDualTreeFlag has a first value (e.g., 0), the partition structure of the current block may be determined to be a single tree structure or a dual tree structure. In contrast, when LocalDualTreeFlag has a second value (eg, 1), the partition structure of the current block may be determined as a local dual tree structure.

[0418] When the partition structure of the current block is not a local dual-tree structure (S2650 is "No"), the image decoding device may use the palette table for the current block to update the palette predictor (S2660). For example, when the current block is a luminance block in a monochrome format, the image decoding device may update the palette predictor. In addition, when the current block is a chrominance block and the partition structure of the current block is not a local dual-tree structure, the image decoding device may update the palette predictor. In contrast, when the current block is a chrominance block and the partition structure of the current block is a local dual-tree structure, the image decoding device may not update the palette predictor.

[0419] In an example, the image decoding device may update the palette predictor by adding at least one palette entry included in the palette table to the palette predictor. In addition, the image decoding device may update the palette predictor by replacing at least one palette entry included in the palette predictor with at least one palette entry included in the palette table. In this case, the palette entry replaced in the palette predictor may be determined as the oldest palette entry or the least frequently used palette entry according to a first-in-first-out (FIFO) method.

[0420] In an example, the updating process of the palette predictor may be continuously performed until the palette predictor reaches a maximum size. When the palette predictor does not reach the maximum size, at least one palette entry in the palette predictor that is not reused in the palette table may be added as a new palette predictor. This may be referred to as palette filling.

[0421] In an example, the image decoding device may update the palette predictor based on update information of the palette predictor signaled from the image encoding device.

[0422] When the partition structure of the current block is a local dual tree structure (S2650 is "yes"), the image decoding device can skip the step S2660 of updating the palette predictor. In this case, for the blocks in the current CTU that are palette-decoded after the current block, the palette predictor applied to the current block can be applied again.

[0423] According to implementation #1 of the present disclosure, when the partition structure of the current block is a local dual-tree structure, the process of updating the palette predictor applied to the current block can be skipped. Therefore, the problem that the palette predictor for the block to be palette-encoded / decoded after the current block is not included in the valid palette entry applied to the current block or is included in the invalid palette entry can be solved.

[0424] Implementation #2

[0425] According to embodiment #2 of the present disclosure, when palette encoding / decoding is performed on a current block having a local dual-tree structure, a palette mode may be selectively applied based on a partition structure of the current block.

[0426] Fig. 27 is a flowchart illustrating a palette encoding method according to an embodiment of the present disclosure.

[0427] Fig. 27 The palette encoding method can be represented by Figure 2 Specifically, steps S2710 to S2760 may be performed by the intra prediction unit 165 or a separate functional block (eg, a palette encoder) different from the intra prediction unit 165. In addition, Fig. 27 The S2720 to S2750 can correspond to Fig.23 Therefore, the description of S2720 to S2750 will be simplified.

[0428] Reference Fig. 27 , the image encoding device can determine whether the division structure of the current block is a local dual tree structure (S2710).

[0429] In an example, whether the partition structure of the current block is a local dual-tree structure can be determined based on the prediction mode type of the current block. Figures 10a to 10c As described, when the prediction mode type of the current block is MODE_TYPE_INTRA applicable only to intra-frame prediction, the partition structure of the current block may be a local dual-tree structure. In contrast, when the prediction mode type of the current block is not MODE_TYPE_INTRA (eg, MODE_TYPE_ALL), the partition structure of the current block may be a single-tree structure.

[0430] In another example, whether the partition structure of the current block is a local dual tree structure can be determined based on at least one of the tree type treeType of the current block or the partition structure of the current CTU. For example, when the tree type of the current block is not a single tree SINGLE_TREE and the current CTU is included in a P slice or a B slice or is divided into a single tree structure, the partition structure of the current block may be a local dual tree structure. In contrast, when the tree type of the current block is a single tree SINGLE_TREE, the partition structure of the current block may be a single tree structure. Alternatively, when the current block is included in an I slice, the CTU included in the corresponding slice is implicitly quad-tree divided into 64×64 luma sample CUs, and the 64×64 luma sample CU is the root node of the dual tree, the partition structure of the current block may be a dual tree structure. The LocalDualTreeFlag shown in the following formula 6 may be used to signal whether the partition structure of the current block is a local dual tree structure. In this case, a first value (eg, 0) of LocalDualTreeFlag may specify that the partition structure of the current block is not a local dual tree structure, and a second value (eg, 1) of LocalDualTreeFlag may specify that the partition structure of the current block is a local dual tree structure.

[0431] When the partition structure of the current block is not a local dual-tree structure (No at S2710), the image encoding apparatus may determine that a palette mode applies to the current block and construct a palette predictor and a palette table for the current block (S2720).

[0432] The palette predictor may include at least one palette entry (representing a color value) and a palette index for identifying the palette entry. When the current block is a block that is palette-encoded for the first time in the current CTU (or slice), the palette predictor may have a predetermined initial value (e.g., 0). In contrast, when the current block is not a block that is palette-encoded for the first time in the current CTU, the palette predictor may include at least one palette entry used in a previous palette encoding process of the current block in the current CTU.

[0433] The image encoding device may construct a palette table based on the palette predictor. The palette table may include at least one palette entry selected from the palette predictor and a palette index for identifying each palette entry.

[0434] In an example, the palette predictor and the palette table may be constructed differently according to the color format (or chroma format) of the current block. For example, when the color format of the current block is the monochrome format described above with reference to Table 2, the palette predictor and the palette table may include only a palette entry for the luma component of the current block. In contrast, when the color format of the current block is the 4:2:0, 4:2:2, or 4:4:4 format described above with reference to Table 2, the palette predictor and the palette table may include a palette entry for each of the luma component and the chroma component of the current block.

[0435] In an example, the palette predictor and the palette table may be constructed differently according to the partition structure of the current block. For example, when the current block has a single tree structure, the palette predictor and the palette table may have one configuration commonly applied to the luminance component and the chrominance component of the current block. In contrast, when the current block has a dual tree structure, the palette predictor and the palette table may have multiple configurations individually applied to each of the luminance component and the chrominance component of the current block.

[0436] The image encoding device may generate a palette index map for the current block based on the palette table (S2730). Specifically, the image encoding device may generate the palette index map by mapping the palette index to each pixel in the current block based on whether the pixel value of each pixel (sample) in the current block is equal to or similar to the representative color value in the palette table.

[0437] The image encoding apparatus may encode the current block based on the palette index map (S2740).

[0438] The encoding process of the current block can be performed by scanning the palette index in the palette index map according to a predetermined scanning method. Specifically, the image encoding device can determine the encoding mode (palette sample mode) of each palette index by scanning the palette index mapped to the current block according to a predetermined scanning method.

[0439] The palette encoding scanning method may include the above reference Fig.15 The horizontal traversal scan and the vertical traversal scan described in the example can be used to signal the information about the scanning method using palette_transpose_flag.

[0440] A palette sample mode for encoding each palette index included in a palette index map may include an "INDEX" mode and a "COPY_ABOVE" mode. When the palette sample mode is determined to be the "INDEX" mode, the value of the corresponding palette index may be encoded. In contrast, when the palette sample mode is determined to be the "COPY_ABOVE" mode, the value of the corresponding palette index may not be encoded, and information specifying that the corresponding palette index has the same value as a palette index existing above (in the case of a horizontal traversal scan) or on the left (in the case of a vertical traversal scan). In an example, information about the palette sample mode may be signaled using copy_above_palette_indices_flag.

[0441] In addition, in "INDEX" mode and "COPY_ABOVE" mode, run value information specifying the number of palette indices encoded consecutively using the same palette sample pattern may be additionally encoded.

[0442] In addition, an escape sample flag (e.g., palette_escape_val_present_flag) may be used to signal whether the palette index map includes information for escape palette indexes. For samples to which escape palette indexes are mapped (escape samples), quantized pixel values ​​of the corresponding samples may be encoded and signaled.

[0443] The image encoding device may update the palette predictor using the palette table for the current block (S2750). For example, the image encoding device may update the palette predictor by adding at least one palette entry included in the palette table to the palette predictor. In addition, the image encoding device may update the palette predictor by replacing at least one palette entry included in the palette predictor with at least one palette entry included in the palette table. The palette entry replaced in the palette predictor may be determined as the oldest palette entry or the least frequently used palette entry according to a first-in-first-out (FIFO) method.

[0444] The updating process of the palette predictor may be continuously performed until the palette predictor reaches a maximum size. For example, the palette predictor may be updated by palette filling until the maximum palette size is reached.

[0445] When the partition structure of the current block is a local dual-tree structure (S2710 is "yes"), the image encoding device may not apply the palette mode to the current block, and may encode the current block using a normal prediction mode other than the palette mode (e.g., an intra-frame prediction mode, an inter-frame prediction mode, etc.) (S2760). Figures 1 to 14Details of the normal prediction mode are described.

[0446] Furthermore, information on whether a palette mode is applied to a current block may be signaled using a palette mode flag (eg, pred_mode_plt_flag).

[0447] Fig.28 is a view illustrating a detailed example of the coding_unit syntax including a palette mode flag.

[0448] Reference Fig.28 , pred_mode_plt_flag may specify whether the palette mode is applied to the current block (or current CU). For example, a pred_mode_plt_flag having a first value (e.g., 0) may specify that the palette mode may not be applied to the current block. In contrast, a pred_mode_plt_flag having a second value (e.g., 1) may specify that the palette mode may be applied to the current block.

[0449] In an example, pred_mode_plt_flag may be signaled based on a prediction mode type of a current block. For example, when the prediction mode type of the current block is a first mode type (e.g., MODE_TYPE_ALL) to which all intra prediction, intra block copy (IBC), palette mode, and inter prediction are applicable, pred_mode_plt_flag may be signaled. In contrast, when the prediction mode type of the current block is a second mode type (e.g., MODE_TYPE_INTRA) to which only intra prediction is applicable or a third mode type (e.g., MODE_TYPE_INTER) to which only inter prediction is applicable, pred_mode_plt_flag may not be signaled.

[0450] Fig.29 is a flowchart illustrating a palette decoding method according to an embodiment of the present disclosure.

[0451] Fig.29 The palette decoding method can be obtained by Figure 3 Specifically, steps S2910 to S2980 may be performed by the intra prediction unit 265 or a separate functional block (eg, a palette decoder) different from the intra prediction unit 265. In addition, Fig.29 The S2930 to S2970 can correspond to Fig.26 Therefore, the description of S2930 to S2970 can be simplified.

[0452] Reference Fig.29, the image decoding device can determine whether the division structure of the current block is a local dual tree structure (S2910).

[0453] In an example, whether the partition structure of the current block is a local dual-tree structure can be determined based on the prediction mode type of the current block. Figures 10a to 10c As described, when the prediction mode type of the current block is MODE_TYPE_INTRA applicable only to intra-frame prediction, the partition structure of the current block may be a local dual-tree structure. In contrast, when the prediction mode type of the current block is not MODE_TYPE_INTRA (eg, MODE_TYPE_ALL), the partition structure of the current block may be a single-tree structure.

[0454] In another example, whether the partition structure of the current block is a local dual tree structure can be determined based on at least one of the tree type treeType of the current block or the partition structure of the current CTU. For example, when the tree type of the current block is not a single tree SINGLE_TREE and the current CTU is included in a P slice or a B slice or is divided into a single tree structure, the partition structure of the current block may be a local dual tree structure. In contrast, when the tree type of the current block is a single tree SINGLE_TREE, the partition structure of the current block may be a single tree structure. Alternatively, when the current block is included in an I slice, the CTU included in the corresponding slice is implicitly quad-tree divided into 64×64 luminance sample CUs, and the 64×64 luminance sample CUs are the root nodes of the dual trees, the partition structure of the current block may be a dual tree structure. Whether the partition structure of the current block is a local dual tree structure can be signaled by decoding the above-mentioned LocalDualTreeFlag shown in Formula 6. For example, LocalDualTreeFlag having a first value (eg, 0) may specify that the partition structure of the current block is not a local dual tree structure, and a second value (eg, 1) of LocalDualTreeFlag may specify that the partition structure of the current block is a local dual tree structure.

[0455] When the partition structure of the current block is not a local dual tree structure (S2910 is "No"), the image decoding device may determine whether the palette mode is applied to the current block. In an example, the image decoding device may determine whether the palette mode is applied to the current block based on a palette mode flag (e.g., pred_mode_plt_flag) obtained from a bitstream. For example, when the above reference Fig.28When the described pred_mode_plt_flag has a first value (e.g., 0), the palette mode may be applied to the current block. In contrast, when pred_mode_plt_flag has a second value (e.g., 1), the palette mode may be applied to the current block. In addition, when pred_mode_plt_flag is not obtained from the bitstream, the value of pred_mode_plt_flag may be inferred to have the first value.

[0456] When the palette mode is applied to the current block (S2920 is "yes"), the image decoding device can obtain the palette information and palette index prediction information of the current block from the bitstream (S2930). The palette information may include information about the palette predictor and / or the new palette entry. The palette index prediction information may have a palette index mapped to the current block and run value information of the palette index.

[0457] The image decoding device may construct a palette predictor and a palette table for the current block based on the palette information obtained from the bitstream (S2940). In an example, the palette predictor may have the same configuration as the palette predictor updated in the previous palette decoding process of the current block. In addition, when information about the palette predictor is not obtained from the bitstream, the palette predictor may have a predetermined initial value (e.g., 0) or the same configuration as the palette predictor used in the previous palette decoding process.

[0458] The image decoding device may construct a palette table for the current block based on the palette predictor. The palette table may include at least one of a palette entry included in the palette predictor or a new palette entry obtained from a bitstream and a palette index for identifying each palette entry.

[0459] In an example, the palette predictor and the palette table may be constructed differently according to the color format (or chroma format) of the current block. In addition, the palette predictor and the palette table may be constructed differently according to the partition structure of the current block.

[0460] The image decoding device may generate a palette index map for the current block based on the palette index prediction information (S2950). Specifically, the image decoding device may generate a palette index map by mapping the palette index to each sample in the current block according to a predetermined scanning method using the palette index obtained from the bitstream, the palette sample pattern, and the run value of the palette sample pattern.

[0461] The scanning method of palette decoding may include the above reference Fig.15The horizontal traversal scan and the vertical traversal scan described above. In an example, the scanning method of the palette decoding can be determined by decoding the palette_transpose_flag included in the bitstream. For example, when_transpose_flag has a first value (e.g., 0), the scanning method of the palette decoding can be determined as the horizontal traversal scan. In contrast, when palette_transpose_flag has a second value (e.g., 1), the scanning method of the palette decoding can be determined as the vertical traversal scan.

[0462] As described above, the palette sample mode may include an "INDEX" mode and a "COPY_ABOVE" mode. When the "INDEX" mode is applied to the current sample, the value of the palette index mapped to the current sample may be obtained directly from the bitstream. In contrast, when the "COPY_ABOVE" mode is applied to the current sample, the value of the palette index mapped to the current sample may be determined as the value of the palette index mapped to the adjacent sample existing above (in the case of horizontal traversal scanning) or to the left (in the case of vertical traversal scanning) of the current sample.

[0463] In addition, when the current sample is an escape sample, the quantized pixel value of the current sample can be obtained directly from the bitstream. The escape palette index can be mapped to the escape sample.

[0464] The image decoding device can decode the current block based on the palette table and the palette index map for the current block (S2960). Specifically, the image decoding device can generate a prediction block of the current block by inversely mapping the values ​​of each palette index in the palette index map to a representative color value by referring to the palette table.

[0465] The image decoding device may update the palette predictor using the palette table for the current block (S2970). For example, the image decoding device may update the palette predictor by adding at least one palette entry included in the palette table to the palette predictor. In addition, the image decoding device may update the palette predictor by replacing at least one palette entry included in the palette predictor with at least one palette entry included in the palette table.

[0466] In an example, the updating process of the palette predictor may be continuously performed until the palette predictor reaches the maximum palette size. For example, the palette predictor may be updated by palette filling until the maximum palette size is reached.

[0467] In an example, the image decoding device may update the palette predictor based on update information of the palette predictor signaled from the image encoding device.

[0468] When the partition structure of the current block is a local dual-tree structure (S2910 is "yes"), the image decoding device may not apply the palette mode to the current block, and may decode the current block using a normal prediction mode other than the palette mode (e.g., intra-frame prediction mode, inter-frame prediction mode, etc.) (S2980). Figures 1 to 14 The details of the normal prediction mode are described. In this case, for a block in the current CTU that is palette-decoded after the current block, a palette predictor initialized to a predetermined value (e.g., 0) may be applied, or the palette predictor applied to the current block may be applied again.

[0469] According to implementation #2 of the present disclosure, when the partition structure of the current block is a local dual-tree structure, the current block can be encoded / decoded using a normal prediction mode other than a palette mode. Therefore, since the process of updating the palette predictor is skipped, the problem that the palette predictor is not included in a valid palette entry or is included in an invalid palette entry can be solved.

[0470] Although for the sake of clarity of description, the exemplary method of the present disclosure described above is represented as a series of operations, it is not intended to limit the order of executing the steps, and these steps can be performed simultaneously or in different orders when necessary. In order to implement the method according to the present invention, the steps described may further include other steps, may include the remaining steps except some steps, or may include other additional steps except some steps.

[0471] In the present disclosure, an image encoding device or an image decoding device that performs a predetermined operation (step) may perform an operation (step) of confirming an execution condition or situation of the corresponding operation (step). For example, if it is described that a predetermined operation is performed when a predetermined condition is met, the image encoding device or the image decoding device may perform the predetermined operation after determining whether the predetermined condition is met.

[0472] The various embodiments of the present disclosure are not a list of all possible combinations and are intended to describe representative aspects of the present disclosure, and matters described in the various embodiments may be applied independently or in combination of two or more.

[0473] Various embodiments of the present disclosure may be implemented in hardware, firmware, software or a combination thereof. In the case of implementing the present disclosure in hardware, the present disclosure may be implemented in an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a general purpose processor, a controller, a microcontroller, a microprocessor, etc.

[0474] In addition, the image decoding device and the image encoding device to which the embodiments of the present disclosure are applied may be included in a multimedia broadcast transmission and reception device, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video chat device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camera, a video on demand (VoD) service provider, an OTT video (over the top video) device, an Internet streaming service provider, a three-dimensional (3D) video device, a video phone video device, a medical video device, etc., and may be used to process a video signal or a data signal. For example, an OTT video device may include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.

[0475] Fig.30 is a diagram showing a content streaming system to which an embodiment of the present disclosure can be applied.

[0476] like Fig.30 As shown in , a content streaming system to which the embodiments of the present disclosure are applied may mainly include an encoding server, a streaming server, a network server, a media storage device, a user device, and a multimedia input device.

[0477] The encoding server compresses the content input from a multimedia input device such as a smart phone, camera, or camcorder into digital data to generate a bitstream and sends the bitstream to the streaming server. As another example, when a multimedia input device such as a smart phone, camera, or camcorder directly generates a bitstream, the encoding server can be omitted.

[0478] The bitstream may be generated by the image encoding method or the image encoding device to which the embodiments of the present disclosure are applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0479] The streaming server sends multimedia data to the user device based on the user's request through the network server, and the network server is used as a medium to inform the user of the service. When the user requests the required service from the network server, the network server can deliver it to the streaming server, and the streaming server can send the multimedia data to the user. In this case, the content streaming system may include a separate control server. In this case, the control server is used to control the command / response between the devices in the content streaming system.

[0480] The streaming server may receive content from a media storage device and / or an encoding server. For example, when receiving content from an encoding server, the content may be received in real time. In this case, in order to provide a smooth streaming service, the streaming server may store the bitstream within a predetermined time.

[0481] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, head-mounted displays), digital televisions, desktop computers, digital signage, etc.

[0482] Each server in the content streaming system may operate as a distributed server, in which case data received from each server may be distributed.

[0483] The scope of the present disclosure includes software or machine-executable commands (e.g., operating systems, applications, firmware, programs, etc.) for enabling operations of methods according to various embodiments to be performed on a device or computer, and non-transitory computer-readable media having such software or commands stored thereon and executable on a device or computer.

[0484] Industrial Applicability

[0485] The embodiments of the present disclosure may be used to encode or decode an image.

Claims

1. A decoding device for image decoding, the decoding device comprising: Memory; as well as at least one processor, the at least one processor connected to the memory, the at least one processor configured to: Based on the palette mode applied to the current block, obtaining palette information and palette index prediction information of the current block from a bitstream; constructing a palette predictor for the current block based on the palette information and constructing a palette table for the current block based on the palette predictor; generating a palette index map for the current block based on the palette index prediction information; and decoding the current block based on the palette table and the palette index map, Wherein, whether to update the palette predictor is determined based on whether the partition structure of the current block is a local dual-tree structure, and The local dual-tree structure is a division structure that performs additional division only on the luminance blocks within the CTU that has been divided into the single-tree structure.

2. The decoding device according to claim 1, wherein: Based on the current block being a chroma block and the partition structure of the current block being the local dual-tree structure, the palette predictor is not updated.

3. The decoding device according to claim 2, wherein: Whether the partition structure of the current block is the local dual tree structure is determined based on at least one of a tree type of the current block and a partition structure of a coding tree unit (CTU) including the current block.

4. The decoding device according to claim 1, wherein: Based on that the current block is a chroma block and the partition structure of the current block is not the local dual-tree structure, the palette predictor is updated based on the palette table.

5. The decoding device according to claim 4, wherein: The updated palette predictor includes at least one palette entry included in the palette table.

6. The decoding device according to claim 4, wherein: The updated palette predictor includes at least one new palette entry within a predetermined maximum size range that is not included in the palette table.

7. The decoding device according to claim 1, wherein: Whether the palette mode is applied to the current block is determined based on a prediction mode type of the current block.

8. The decoding device according to claim 7, wherein: The prediction mode type based on the current block is a first mode type to which intra prediction, intra block copy (IBC), palette mode and inter prediction are all applicable, and the palette mode is applied to the current block.

9. The decoding device according to claim 7, wherein: Based on the fact that the prediction mode type of the current block is a second mode type to which only intra prediction is applicable, the palette mode is not applied to the current block.

10. A coding device for image coding, the coding device comprising: Memory; as well as at least one processor, the at least one processor connected to the memory, the at least one processor configured to: Based on a palette mode applied to a current block, constructing a palette predictor for the current block and constructing a palette table for the current block based on the palette predictor; generating a palette index map for the current block based on the palette table; and encoding the current block based on the palette index map, Wherein, whether to update the palette predictor is determined based on whether the partition structure of the current block is a local dual-tree structure, and The local dual-tree structure is a division structure that performs additional division only on the luminance blocks within the CTU that has been divided into the single-tree structure.

11. The encoding device according to claim 10, wherein: Based on the current block being a chroma block and the partition structure of the current block being the local dual-tree structure, the palette predictor is not updated.

12. The encoding device according to claim 10, wherein: Based on that the current block is a chroma block and the partition structure of the current block is not the local dual-tree structure, the palette predictor is updated based on the palette table.

13. The encoding device according to claim 10, wherein: Whether the palette mode is applied to the current block is determined based on a prediction mode type of the current block.

14. A device for transmitting data for an image, the device comprising: at least one processor configured to obtain a bit stream generated by a coding method performed by a coding device for image coding; as well as a transmitter configured to transmit the bit stream, The encoding method comprises the following steps: Based on a palette mode applied to a current block, constructing a palette predictor for the current block and constructing a palette table for the current block based on the palette predictor; generating a palette index map for the current block based on the palette table; and encoding the current block based on the palette index map, Wherein, whether to update the palette predictor is determined based on whether the partition structure of the current block is a local dual-tree structure, and The local dual-tree structure is a division structure that performs additional division only on the luminance blocks within the CTU that has been divided into the single-tree structure.