Video decoding method, video encoding method, and computer-readable recording medium storing bit stream encoded by video encoding method

By using a palette-based intra-frame prediction method and apparatus, the problem of high data transmission and storage costs for high-resolution images is solved, and efficient encoding and decoding of video signals is achieved, especially the optimized processing of stereoscopic image content.

CN119299727APending Publication Date: 2025-01-10KT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411751845.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-12-13
Filing Date
2020-08-28
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

With the increasing demand for high-resolution and high-quality images, the cost of existing image data transmission and storage is rising, and there is a lack of effective video compression technology to process stereoscopic image content.

Method used

An intra-frame prediction method and apparatus based on palette mode is adopted. By configuring the current palette table, determining the palette index, and reconstructing pixels in the video signal using index mode or copy mode, the encoding/decoding efficiency is improved.

Benefits of technology

It improves the encoding/decoding efficiency of video signals, especially in the processing of high-resolution and stereoscopic image content, reduces the amount of data, and optimizes transmission and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299727A_ABST
    Figure CN119299727A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a video decoding method, a video encoding method, and a computer-readable recording medium storing a bitstream encoded by the video encoding method, the video decoding method comprising: determining whether a palette mode is applied to a current block; configuring a current palette table based on the palette prediction table in a case where the palette mode is applied to the current block; determining a palette index for each pixel in the current block; and reconstructing the current pixel in the current block based on the current palette table and the palette index for the current pixel, in which, if the current block is included in a first coding tree unit of the current coding tree unit row, the palette prediction table is inherited from an upper adjacent coding tree unit adjacent to the first coding tree unit, the upper adjacent coding tree unit directly adjoins an upper boundary of the current coding tree unit, and wherein the upper adjacent coding tree unit is included in a coding tree unit row processed in parallel with the current coding tree unit row.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an invention patent application with an application date of August 28, 2020, application number 202080060135.0 (international stage application number PCT / KR2020 / 011550), and invention name “Method and device for processing video signals”. Technical Field

[0002] The present disclosure relates to methods and apparatus for processing video signals. Background Art

[0003] Recently, the demand for high-resolution and high-quality images such as HD (high-definition) images and UHD (ultra-high-definition) images has increased in various application fields. As image data becomes high-resolution and high-quality, the amount of data increases relatively compared to existing image data, so when the image data is transmitted by using a medium such as an existing wired and wireless broadband circuit or stored by using an existing storage medium, the transmission cost and storage cost increase. High-efficiency image compression technology can be used to solve these problems caused by image data becoming high-resolution and high-quality.

[0004] There are various technologies, such as inter-frame prediction technology that uses image compression technology to predict pixel values ​​included in a current picture based on previous pictures or subsequent pictures of the current picture, intra-frame prediction technology that predicts pixel values ​​included in a current picture by using pixel information in the current picture, entropy coding technology that assigns short symbols to values ​​with high occurrence frequencies and assigns long symbols to values ​​with low occurrence frequencies, etc., and image data can be effectively compressed and transmitted or stored by using these image compression technologies.

[0005] On the other hand, as the demand for high-resolution images increases, the demand for stereoscopic image content as a new image service also increases. Video compression technology for efficiently providing high-resolution and ultra-high-resolution stereoscopic image content has been discussed. Summary of the invention

[0006] Technical Purpose

[0007] The object of the present disclosure is to provide an intra-frame prediction method and apparatus for encoding / decoding a video signal.

[0008] An object of the present disclosure is to provide a method and apparatus for intra-frame prediction based on a palette mode when encoding / decoding a video signal.

[0009] The technical effects of the present disclosure may not be limited to the above-mentioned technical effects, and those skilled in the art in the technical field to which the present disclosure belongs may clearly understand other unmentioned technical effects according to the following description.

[0010] Technical Solutions

[0011] A video signal decoding method according to the present disclosure may include: configuring a current palette table based on a previous palette table; determining a palette index in pixels in a current block; and reconstructing pixels in the current block based on the palette table and the palette index. In this case, in the case where the current block is included in the first coding tree unit of the coding tree unit row, the previous palette table may be derived from a block above the coding tree unit.

[0012] A video signal encoding method according to the present disclosure may include: configuring a current palette table based on a previous palette table; determining a palette index in pixels in a current block; and reconstructing pixels in the current block based on the palette table and the palette index. In this case, in the case where the current block is included in the first coding tree unit of the coding tree unit row, the previous palette table may be derived from a block above the coding tree unit.

[0013] In the video signal decoding method according to the present disclosure, it may further include: decoding a palette prediction flag, the palette prediction flag indicating whether a palette entry included in a previous palette table is included in a current palette table.

[0014] In the video signal decoding method according to the present disclosure, it may further include: in a case where the number of predicted palette entries used from the previous palette table is smaller than the size of the current palette table, decoding information on the remaining palette entries.

[0015] In a video signal decoding method according to the present disclosure, the palette index of a current block can be determined by using at least one of an index mode or a copy mode, the index mode can be a mode of signaling palette index information for specifying the palette index of the current block, and the copy mode can be a mode of using palette indexes of adjacent pixels according to a predetermined scanning order.

[0016] Technical Effects

[0017] According to the present disclosure, the encoding / decoding efficiency of the palette mode may be improved by configuring the palette table of the current block based on the previous palette table.

[0018] According to the present disclosure, the encoding / decoding efficiency of the palette mode can be improved by adaptively using the scanning order of the palette mode.

[0019] According to the present disclosure, the encoding / decoding efficiency of the palette index for each pixel in the current block can be improved.

[0020] Effects that can be obtained according to the present disclosure may not be limited to the above-mentioned effects, and other unmentioned effects may be clearly understood by those skilled in the art in the technical field to which the present invention pertains from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 : is a block diagram showing an image encoding device according to an embodiment of the present disclosure.

[0022] Figure 2 is a block diagram showing an image decoding apparatus according to an embodiment of the present disclosure.

[0023] Figures 3 to 5 is a diagram for describing the concept of a palette mode according to the present disclosure.

[0024] Figure 6 A method of performing intra prediction based on a palette mode according to the present disclosure is shown.

[0025] Figures 7 to 11 A method of configuring a palette table according to the present disclosure is shown.

[0026] Fig.12 is a diagram showing an example of adding a palette entry to a palette entry candidate list.

[0027] Fig.13 A method of signaling a palette prediction flag in the form of a binary vector based on run-length encoding is shown as an embodiment to which the present disclosure is applied.

[0028] Fig.14 An example of encoding a palette prediction flag by using context information is shown.

[0029] Fig.15 is an example showing the range of the context information index.

[0030] Fig.16 An example is shown in which a palette table is defined in units of areas of a preset size.

[0031] Figures 17 to 22 A method of encoding / decoding palette indices in scan order according to the present disclosure is shown.

[0032] Fig.23 An example of configuring an integrated palette table is shown.

[0033] Fig.24 An example is shown in which palette tables are configured separately for luma components and chroma components.

[0034] Fig.25 and Fig.26An example of allocating palette indexes in units of predetermined areas is shown.

[0035] Fig. 27 is an example of a process of assigning pixels in a block to indexes by using a palette table.

[0036] Fig.28 An example of using a palette table predefined in an encoder and a decoder is shown. DETAILED DESCRIPTION

[0037] Since the present disclosure can be varied and has several embodiments, specific embodiments will be illustrated in the drawings and described in detail. However, it is not intended to limit the present disclosure to specific embodiments, and it should be understood that the present disclosure includes all variations, equivalents, or substitutes included in the concept and technical scope of the present disclosure. When describing each figure, similar reference numerals are used for similar parts.

[0038] Terms such as first, second, etc. can be used to describe various components, but components should not be limited by the terms. Terms are only used to distinguish one component from other components. For example, without exceeding the scope of the rights of the present disclosure, a first component can be referred to as a second component, and similarly, a second component can also be referred to as a first component. The term "and / or" includes a combination of multiple relative input items or any items of multiple relative input items.

[0039] When a component is referred to as being "linked" or "connected" to other components, it should be understood that the component can be directly linked or connected to other components, but other components can exist in between. On the other hand, when a component is referred to as being "directly linked" or "directly connected" to other components, it should be understood that other components do not exist in between.

[0040] Because the terms used in this application are only used to describe specific embodiments, they are not intended to limit the present disclosure. Singular expressions include plural expressions unless they clearly have different meanings in the context. In this application, it should be understood that terms such as "including" or "having" refer to the existence of characteristics, numbers, stages, movements, parts, parts or combinations thereof entered in the specification, but do not exclude the existence or possibility of adding one or more other characteristics, numbers, stages, movements, parts, parts or combinations thereof in advance.

[0041] Hereinafter, with reference to the accompanying drawings, a desired embodiment of the present disclosure will be described in more detail. Hereinafter, the same reference numerals are used for the same components in the drawings, and repeated description of the same components is omitted.

[0042] Figure 1 : is a block diagram showing an image encoding device according to an embodiment of the present disclosure.

[0043] Reference Figure 1 , the image encoding device 100 may include a picture division unit 110, prediction units 120 and 125, a transformation unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transformation unit 145, a filter unit 150 and a memory 155.

[0044] because Figure 1 Each construction unit in is shown independently to illustrate different characteristic functions in the image encoding device, which does not mean that each construction unit is composed of separate hardware or one software unit. That is, since each construction unit is included by being enumerated as each construction unit for the convenience of description, at least two construction units in each construction unit may be combined to constitute one construction unit, or one construction unit may be divided into multiple construction units to perform functions, and even integrated implementations and separate implementations of each construction unit are included in the scope of the rights of the present disclosure as long as they do not deviate from the essence of the present disclosure.

[0045] In addition, some components may be only optional components for improving performance, rather than essential components for performing basic functions in the present disclosure. The present disclosure may be implemented by including only structural units necessary for realizing the essence of the present disclosure without including components only for improving performance, and a structure including only essential components without including optional components only for improving performance is also included in the scope of the rights of the present disclosure.

[0046] The picture division unit 110 may divide the input picture into at least one processing unit. In this regard, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). In the picture division unit 110, one picture may be divided into a combination of a plurality of coding units, prediction units, and transform units, and the picture may be encoded by selecting a combination of a coding unit, a prediction unit, and a transform unit according to a predetermined criterion (e.g., a cost function).

[0047] For example, a picture can be divided into multiple coding units. In order to divide the coding units in the picture, a recursive tree structure such as a quadtree structure can be used, and the coding unit divided into other coding units by using an image or a maximum coding unit as a route can be divided with as many child nodes as the number of divided coding units. Coding units that are no longer divided according to certain restrictions become leaf nodes. In other words, when it is assumed that only square division is possible for one coding unit, one coding unit can be divided into up to four other coding units.

[0048] Hereinafter, in an embodiment of the present disclosure, a coding unit may be used as a unit for encoding, or may be used as a unit for decoding.

[0049] The prediction units may be divided in at least one square shape or rectangular shape, etc., with the same size in one coding unit, or the prediction units may be divided such that any one of the prediction units divided in one coding unit may have a different shape and / or size from another prediction unit.

[0050] When generating a prediction unit for performing intra prediction based on a coding block, when the prediction unit is not a minimum coding unit, intra prediction may be performed without performing splitting into a plurality of prediction units NxN.

[0051] The prediction units 120 and 125 may include an inter-frame prediction unit 120 that performs inter-frame prediction and an intra-frame prediction unit 125 that performs intra-frame prediction. It may be determined whether inter-frame prediction or intra-frame prediction is performed for the prediction unit, and detailed information (such as intra-frame prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. In this regard, the processing unit that performs the prediction may be different from the processing unit that determines the prediction method and the specific content. For example, the prediction method, prediction mode, etc. may be determined in the prediction unit, and the prediction may be performed in the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded using the residual value in the entropy encoding unit 165, and may be sent to the decoding device. When a specific encoding mode is used, the original block may be encoded as is and sent to the decoding unit without generating a prediction block through the prediction unit 120 or 125.

[0052] The inter-frame prediction unit 120 may predict a prediction unit based on information about at least one of the previous or subsequent pictures of the current picture, or in some cases may predict a prediction unit based on information about some coding regions in the current picture. The inter-frame prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0053] The reference picture interpolation unit may receive reference picture information from the memory 155 and generate pixel information equal to or less than an integer pixel in the reference picture. For luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information equal to or less than an integer pixel in units of 1 / 4 pixels. For chroma signals, a 4-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information equal to or less than an integer pixel in units of 1 / 8 pixels.

[0054] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods such as FBMA (block matching algorithm based on full search), TSS (three-step search), NTS (new three-step search algorithm), etc. may be used as a method for calculating a motion vector. The motion vector may have a motion vector value in units of 1 / 2 pixel or 1 / 4 pixel based on the interpolated pixel. The motion prediction unit may predict the current prediction unit by changing the motion prediction method. Various methods such as a skip method, a merge method, an advanced motion vector prediction (AMVP) method, an intra-block copy method, etc. may be used as a motion prediction method.

[0055] The intra prediction unit 125 may generate a prediction unit based on reference pixel information (which is pixel information in the current picture) around the current block. When the neighboring block in the current prediction unit is a block for performing inter-frame prediction and thus the reference pixel is a pixel for performing inter-frame prediction, the reference pixel included in the block for performing inter-frame prediction may be used by replacing it with the reference pixel information of the surrounding blocks for performing intra-frame prediction. In other words, when the reference pixel is unavailable, the unavailable reference pixel information may be used by replacing it with at least one reference pixel among the available reference pixels.

[0056] When performing prediction, the prediction mode of intra prediction may have a directional prediction mode using reference pixel information according to a prediction direction and a non-directional prediction mode not using directional information. The mode for predicting luminance information may be different from the mode for predicting chrominance information, and the intra prediction mode information for predicting luminance information or the predicted luminance signal information may be used to predict chrominance information.

[0057] When the size of the prediction unit is the same as the size of the transform unit when performing intra prediction, intra prediction of the prediction unit can be performed based on the pixel at the left position, the pixel at the upper left position, and the pixel at the upper position of the prediction unit. However, when the size of the prediction unit is different from the size of the transform unit when performing intra prediction, intra prediction can be performed by using reference pixels based on the transform unit. In addition, intra prediction using N×N partitioning can be used only for the smallest coding unit.

[0058] In addition, the intra prediction unit 125 may perform intra prediction based on the palette mode and refer to Figures 3 to 28 Describe it in detail.

[0059] In the intra prediction method, a prediction block may be generated after an adaptive intra smoothing (AIS) filter is applied to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels may be different. In order to perform the intra prediction method, an intra prediction mode in a current prediction unit may be predicted based on intra prediction modes in prediction units surrounding the current prediction unit. When predicting the prediction mode in the current prediction unit by using mode information predicted based on surrounding prediction units, if the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the surrounding prediction units, information that the prediction mode of the current prediction unit is the same as the prediction mode of the surrounding prediction units may be sent by using predetermined flag information, and if the prediction mode in the current prediction unit is different from the prediction mode in the surrounding prediction units, the prediction mode information of the current block may be encoded by performing entropy coding.

[0060] In addition, a residual block including information on a residual value which is a difference value between a prediction unit predicted based on the prediction unit generated in the prediction units 120 and 125 and an original block in the prediction unit may be generated. The generated residual block may be input to the transform unit 130.

[0061] The transform unit 130 may transform the original block and the residual block of the residual value information included in the prediction unit generated by the prediction units 120 and 125 by using a transform method such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), and KLT. Whether to apply DCT, DST, or KLT to transform the residual block may be determined based on intra prediction mode information in the prediction unit used to generate the residual block.

[0062] The quantization unit 135 may quantize the value transformed into the frequency domain in the transformation unit 130. The quantization coefficient may be changed according to the importance of the block or image. The value calculated in the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.

[0063] The rearrangement unit 160 may perform rearrangement on coefficient values ​​of the quantized residual value.

[0064] The rearrangement unit 160 may change the coefficients of the shape of the two-dimensional block into the coefficients of the shape of the one-dimensional vector by a coefficient scanning method. For example, the rearrangement unit 160 may scan from the DC coefficient to the coefficients in the high frequency domain by using a zigzag scanning method and change it into the shape of a one-dimensional vector. Depending on the size of the transform unit and the intra-frame prediction mode, instead of the zigzag scanning, horizontal scanning of the coefficients of the shape of the two-dimensional block in the column direction or horizontal scanning of the coefficients of the shape of the two-dimensional block in the row direction may be used. In other words, which scanning method among the zigzag scanning, the vertical direction scanning, and the horizontal direction scanning to be used may be determined according to the size of the transform unit and the intra-frame prediction mode.

[0065] The entropy encoding unit 165 may perform entropy encoding based on the value calculated by the rearrangement unit 160. The entropy encoding may use various encoding methods such as Exponential Golomb, CAVLC (Context-Adaptive Variable Length Coding), and CABAC (Context-Adaptive Binary Arithmetic Coding).

[0066] The entropy coding unit 165 can encode various information from the rearrangement unit 160 and the prediction units 120 and 125, such as residual value coefficient information and block type information in the coding unit, prediction mode information, partition unit information, prediction unit information and transmission unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.

[0067] The entropy encoding unit 165 may perform entropy encoding on coefficient values ​​in the coding unit input from the rearrangement unit 160 .

[0068] The dequantization unit 140 and the inverse transform unit 145 perform dequantization on the value quantized in the quantization unit 135, and perform inverse transform on the value transformed in the transform unit 130. The residual value generated by the dequantization unit 140 and the inverse transform unit 145 may be combined with a prediction unit predicted by a motion prediction unit, a motion compensation unit, and an intra prediction unit included in the prediction units 120 and 125 to generate a reconstructed block.

[0069] The filter unit 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).

[0070] The deblocking filter can remove block distortion generated by the boundaries between blocks in the reconstructed picture. In order to determine whether to perform deblocking, it can be determined whether to apply the deblocking filter to the current block based on the pixels included in several rows or columns included in the block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the required deblocking filter strength. In addition, when applying the deblocking filter, when performing horizontal filtering and vertical filtering, horizontal direction filtering and vertical direction filtering can be set to parallel processing.

[0071] The offset correction unit can correct the offset from the original image in units of pixels for the image to be deblocked. In order to perform offset correction for a specific picture, the area where the offset is to be performed can be determined after dividing the pixels included in the image into a certain number of areas, and a method of applying the offset to the corresponding area or a method of applying the offset by considering edge information of each pixel can be used.

[0072] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed image with an original image. After the pixels included in the image are divided into predetermined groups, filtering can be performed differently on each group by determining a filter to be applied to the corresponding group. Information about whether ALF will be applied can be transmitted per coding unit (CU) for a luminance signal, and the shape and filter coefficient of the ALF filter to be applied can be different for each block. In addition, regardless of the characteristics of the block to be applied, an ALF filter of the same shape (fixed shape) can be applied.

[0073] The memory 155 may store a reconstructed block or picture calculated by the filter unit 150 , and may provide the stored reconstructed block or picture to the prediction units 120 and 125 when inter prediction is performed.

[0074] Figure 2 is a block diagram showing an image decoding apparatus according to an embodiment of the present disclosure.

[0075] Reference Figure 2 , the image decoding device 200 may include an entropy decoding unit 210 , a rearrangement unit 215 , a dequantization unit 220 , an inverse transform unit 225 , prediction units 230 and 235 , a filter unit 240 , and a memory 245 .

[0076] When an image bit stream is input from the image encoding apparatus, the input bit stream may be decoded according to a process reverse to that of the image encoding apparatus.

[0077] The entropy decoding unit 210 may perform entropy decoding according to a process opposite to the process of performing entropy encoding in the entropy encoding unit of the image encoding device. For example, various methods such as Exponential Golomb, CAVLC (Context Adaptive Variable Length Coding) and CABAC (Context Adaptive Binary Arithmetic Coding) may be applied in response to the method performed in the image encoding device.

[0078] The entropy decoding unit 210 may decode information related to intra prediction and inter prediction performed in the encoding apparatus.

[0079] The rearrangement unit 215 may perform rearrangement based on a method of rearranging the bitstream entropy-decoded in the entropy decoding unit 210 in the coding unit. Coefficients expressed in the form of a one-dimensional vector may be rearranged by reconstructing coefficients in the form of a two-dimensional block. The rearrangement unit 215 may receive information related to coefficient scanning performed in the coding unit, and perform rearrangement by a method in which scanning is performed inversely based on a scanning order performed in the corresponding coding unit.

[0080] The inverse quantization unit 220 may perform dequantization based on the quantization parameter provided from the encoding device and the coefficient value of the rearranged block.

[0081] The inverse transform unit 225 may perform the transform performed in the transform unit, i.e., inverse transforms for DCT, DST, and KLT (i.e., inverse DCT, inverse DST, and inverse KLT), on the result of the quantization performed in the image encoding device. The inverse transform may be performed based on the transmission unit determined in the image encoding device. In the inverse transform unit 225 of the image decoding device, a transform technique (e.g., DCT, DST, KLT) may be selectively performed according to a plurality of information (e.g., a prediction method, a size of a current block, a prediction direction, etc.).

[0082] The prediction units 230 and 235 may generate a prediction block based on the information related to generation of the prediction block provided from the entropy decoding unit 210 and the pre-decoded block or picture information provided from the memory 245 .

[0083] As described above, when the size of the prediction unit is the same as the size of the transform unit when intra prediction is performed in the same manner as the operation in the image encoding device, intra prediction of the prediction unit can be performed based on the pixel at the left position, the pixel at the upper left position, and the pixel at the upper position of the prediction unit, but when the size of the prediction unit is different from the size of the transform unit when intra prediction is performed, intra prediction can be performed by using reference pixels based on the transform unit. In addition, intra prediction using N×N division can be used only for the smallest coding unit.

[0084] The prediction units 230 and 235 may include: a prediction unit determination unit, an inter-frame prediction unit, and an intra-frame prediction unit. The prediction unit determination unit may receive various information (e.g., prediction unit information, prediction mode information of an intra-frame prediction method, information related to motion prediction of an inter-frame prediction method, etc.) input from the entropy decoding unit 210, divide the prediction unit in the current coding unit, and determine whether the prediction unit performs inter-frame prediction or intra-frame prediction. The inter-frame prediction unit 230 may perform inter-frame prediction on the current prediction unit based on information included in at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit, by using information required for inter-frame prediction in the current prediction unit provided from the image encoding device. Alternatively, inter-frame prediction may be performed based on information of some areas pre-reconstructed in the current picture including the current prediction unit.

[0085] In order to perform inter prediction, whether a motion prediction method in a prediction unit included in a corresponding coding unit is a skip mode, a merge mode, an AMVP mode, or an intra block copy mode may be determined on a coding unit basis.

[0086] The intra prediction unit 235 may generate a prediction block based on pixel information in the current picture. In the case where the prediction unit is a prediction unit that performs intra prediction, intra prediction may be performed based on intra prediction mode information in the prediction unit provided from the image encoding device. Alternatively, the intra prediction unit 235 may perform intra prediction based on a palette mode and refer to Figures 3 to 28 It is described in detail. The intra prediction unit 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation unit, and a DC filter. As a part of performing filtering on the reference pixels of the current block, the AIS filter may be applied by determining whether to apply the filter according to the prediction mode in the current prediction unit. By using the AIS filter information and the prediction mode in the prediction unit provided from the image encoding device, the AIS filtering may be performed on the reference pixels of the current block. In the case where the prediction mode of the current block is a mode in which the AIS filtering is not performed, the AIS filter may not be applied.

[0087] In the case where the prediction mode in the prediction unit is a prediction unit that performs intra-frame prediction based on a pixel value interpolated from a reference pixel, the reference pixel interpolation unit may interpolate the reference pixel so as to generate the reference pixel in units of pixels equal to or less than an integer value. In the case where the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. In the case where the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.

[0088] The reconstructed block or picture may be provided to the filter unit 240. The filter unit 240 may include a deblocking filter, an offset correction unit, and an ALF.

[0089] Information on whether to apply a deblocking filter to a corresponding block or picture and information on whether to apply a strong filter or a weak filter when applying the deblocking filter may be provided from the image encoding device. Information related to the deblocking filter provided from the image encoding device may be provided in the deblocking filter of the image decoding device, and deblocking filtering of the corresponding block may be performed in the image decoding device.

[0090] The offset correction unit may perform offset correction on the reconstructed image based on offset value information, the offset value information being a type of offset correction applied to the image when encoding is performed.

[0091] ALF may be applied to the coding unit based on information on whether ALF is applied, ALF coefficient information, etc. provided from the encoding device. Such ALF information may be provided by being included in a specific parameter set.

[0092] The memory 245 may store the reconstructed picture or block to be used as a reference picture or a reference block, and provide the reconstructed picture to the output unit.

[0093] As described above, hereinafter, in the embodiments of the present disclosure, for convenience of description, a coding unit is used as a term of a coding unit, but it may be a unit that performs decoding as well as encoding.

[0094] In addition, since the current block represents a block to be encoded / decoded, according to the encoding / decoding step, the current block may represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit) or a prediction block (or prediction unit), etc. In this specification, a "unit" may represent a basic unit for performing a specific encoding / decoding process, and a "block" may represent a pixel array of a predetermined size. Unless otherwise classified, "block" and "unit" may be used interchangeably. For example, in the embodiments described later, it will be understood that coding blocks (coding blocks) and coding units (coding units) may be used interchangeably.

[0095] Figures 3 to 5 is a diagram for describing the concept of a palette mode according to the present disclosure.

[0096] The palette mode is a method of encoding a specific index instead of a pixel after indicating a pixel that frequently appears in a block to be encoded (hereinafter referred to as the current block) as a specific index and sending the specific index to a decoding device. A flag indicating whether the palette mode is allowed can be encoded and sent to the decoding device. In this case, the flag is encoded only when the size of the current block is equal to or less than the preset size. The preset size can be determined based on the slice type of the slice to which the current block belongs or the encoding mode or prediction mode of the current block. In the example, when the current block belongs to slice I, the palette mode can be used only when the size of the current block is 4×4. When the current block belongs to slice B or slice P, the palette mode can be used only when the size of the current block is greater than 4×4 and less than 64×64.

[0097] Figure 3 The process of generating a palette table is shown in FIG. For ease of description, the description is given under the assumption that the size of the current block is 4×4. First, the histogram of the 16 pixels in the current block is as follows: Figure 3 As shown. Figure 3 In the example, the horizontal axis represents the pixel value (for example, for a pixel quantized by 8 bits, a value from 0 to 225), and the vertical axis represents the frequency of the pixel value. Subsequently, the quantization zone is set based on the pixel with a high frequency. The pixels in the quantization zone are replaced by the pixels with the highest frequency, and an index is assigned to the pixel with the highest frequency. Information representing the size of the quantization zone can be encoded and sent to the decoding device. Alternatively, the size of the quantization zone can be determined based on at least one of the size, shape, or bit depth of the current block.

[0098] exist Figure 3 In the quantization area, the portion expressed by the thick line means the pixel with the highest frequency (a3, a8, a10, a11), and the portion expressed by the thin line means the other pixels. Also, the pixel not included in the quantization area (the portion expressed by the thick line outside the quantization area) is expressed as an escape value, and the value is additionally quantized and encoded in addition to being encoded by the index.

[0099] Figure 4 Shows Figure 3 Example of a palette table set up in .

[0100] exist Figure 4 In , each row of the palette table is expressed as a palette entry, and a different index is assigned to each entry. In other words, the size of the palette table may mean the number of entries.

[0101] The entries are configured by using the pixels (a3, a8, a10, a11) with the highest frequency in each quantization region, and an index is assigned to each entry. If there is an escape value, the escape can be arranged as the last entry and an index can be assigned to it. In other words, the last index in the palette can mean the escape value.

[0102] Figure 5 is an example of the process of assigning pixels in a block to indices by using a set palette table. Figure 5 , expresses the specified index as a palette index.

[0103] According to the palette table, the pixels existing in the block are replaced with the index, and the index is encoded and sent to the decoding device. And, when the pixels existing in the block are indicated as escape values ​​( Figure 5 When a5 and a15 in FIG. 1 are used, a5' and a15' are additionally quantized and encoded in addition to the index. In addition, the palette table used is also encoded and sent to the decoding device.

[0104] Figure 6 A method of performing intra prediction based on a palette mode according to the present disclosure is shown.

[0105] The palette mode may be applied in a unit of a block (e.g., a coding unit, a prediction unit), and for it, flag information (pred_mode_plt_flag) indicating whether the palette mode is used in a unit of a block may be signaled. In other words, when the value of the flag is 1, the palette mode is applied to the current block, and when the value of the flag is 0, the palette mode is not applied to the current block.

[0106] The flag may be adaptively encoded / decoded based on at least one of the prediction mode of the current block or the size of the current block. For example, the flag may be encoded / decoded only when the prediction mode of the current block is an intra-frame mode. The flag may be encoded / decoded only when the prediction mode of the current block is not a skip mode. The flag may be encoded / decoded only when at least one of the width or height of the current block is less than or equal to a predetermined first threshold size. Here, since the first threshold size is a value predefined in the encoding / decoding device, the first threshold size may be any one of 16, 32, or 64. The flag may be encoded / decoded only when the product of the width and height of the current block is greater than a predetermined second threshold size. Here, since the second threshold size is a value predefined in the encoding / decoding device, the second threshold size may be any one of 16, 32, or 64. However, the first threshold size may be different from the second threshold size. In the case where any of the above conditions is not met, the flag is not encoded / decoded, and in this case, the value of the flag may be set to 0.

[0107] Reference Figure 6 , a palette table S600 of the palette mode of the current block can be configured.

[0108] The palette table may be configured with at least one palette entry and a palette index identifying each palette entry. The palette table of the current block may be determined by using a palette table of a previous block (hereinafter referred to as a previous palette table). Here, the previous block may mean a block that is encoded or decoded before the current block.

[0109] Specifically, the palette entry of the current block may include at least one of a predicted palette entry or a signaled palette entry. The current block may use all or part of the palette entries used by the previous block, and therefore, the palette entry reused in the current block among the palette entries used in the previous block is called a predicted palette entry.

[0110] The current block may use all the palette entries of the previous palette table. Alternatively, the current block may use a portion of the palette entries of the previous palette table, and for it, a flag (PalettePredictorEntryReuseFlag, hereinafter referred to as the palette prediction flag) that specifies whether to reuse the palette entry may be used. The value of the palette prediction flag is assigned to each palette entry of the previous palette table, and the palette prediction flag (PalettePredictorEntryReuseFlag[i]) may indicate whether the palette entry corresponding to the palette index i in the previous palette table is reused for the palette table of the current block. For example, when the value of the palette prediction flag is 1, the palette entry corresponding to the palette index i in the previous palette table is reused for the palette table of the current block, and when the value of the palette prediction flag is 0, it is not reused. The palette table of the current block may be configured by extracting palette entries whose value of the palette prediction flag is 1 from the previous palette table and arranging them sequentially.

[0111] On the other hand, the palette table of the current block may be initialized in units of a predetermined area. Here, the predetermined area may mean a parallel processing area or a CTU row of the current picture. If the current block belongs to the first CTU of a CTU row, the palette table of the current block may be initialized to the palette table of an adjacent CTU of the CTU to which the current block belongs. Here, the adjacent CTU may mean a CTU at an upper position of the CTU to which the current block belongs. In other words, the palette table of the first CTU of the Nth CTU row may be initialized based on the palette table of the first CTU of the (N-1)th CTU row. The initialized palette table may be updated based on the palette table of a previous block belonging to the same CTU row. The above embodiments are merely examples and will be referred to herein. Figures 7 to 11 Describes in detail the method of configuring the palette table of the current block.

[0112] On the other hand, the palette prediction flags can be signaled in the form of an encoding / decoding flag for each palette entry. Alternatively, the palette prediction flags can be encoded / decoded in the form of a binary vector based on run-length encoding. In other words, palette_predictor_run (a syntax that specifies the number of zero palette prediction flags between non-zero palette prediction flags) can be encoded / decoded in the palette prediction flag array that specifies whether to reuse the previous palette entry. Fig.12 Describe it in detail.

[0113] Alternatively, instead of encoding the run length, the palette prediction flag value may be encoded directly. In this regard, reference will be made to Fig.13 Describe in more detail.

[0114] In addition, the palette table of the current block may additionally include a palette entry signaled in the bitstream, and here, the signaled palette entry may mean a palette entry not included in the previous palette table among the palette entries used by the current block. The signaled palette entry may be added after the predicted palette entry of the palette table.

[0115] Reference Figure 6 , the palette index in pixels in the current block may be determined S610.

[0116] The current block may determine a palette index by using at least one of an index mode or a copy mode.

[0117] Here, the index mode may mean a method of encoding palette index information (palette_idx_idc) in an encoding device to specify a palette index used in a current block. The decoding device may derive a palette index of the current pixel based on the encoded palette index information. The palette index information has a value between 0 and (MaxPaletteIndex-1), and here, MaxPaletteIndex may mean the size of the palette table of the current block or the number of palette entries configuring the palette table. In index mode, the value of the palette index information signaled in the bitstream may be assigned to the palette index of the current pixel.

[0118] The copy mode may mean a method of determining the palette index of the current pixel by using the palette index of the adjacent pixels in a predetermined scanning order. Here, as the scanning order according to the present disclosure, horizontal scanning, vertical scanning, diagonal scanning, etc. may be used, and any one of the above scans may be used selectively. To this end, a predetermined flag or index may be encoded / decoded. For example, the encoding device may encode the flag as 0 when horizontal scanning is applied as the scanning order of the current block, and may encode the flag as 1 when vertical scanning is applied as the scanning order of the current block. The decoding device may adaptively determine the scanning order of the current block based on the encoding flag. However, this is not limited to this, and reference will be made to the Figures 17 to 22 Describes in detail the method of encoding / decoding palette indices in scan order.

[0119] In the copy mode, the palette index of the current pixel can be predicted based on the palette index of the adjacent pixel, and the palette index of the adjacent pixel can be copied and set as the palette index of the current pixel as it is. Here, the adjacent pixel can mean a pixel adjacent to the top, bottom, left or right of the current pixel. In particular, the adjacent pixel can be positioned on the same horizontal line or the same vertical line as the current pixel.

[0120] For example, the copy mode may include at least one of a first copy mode, a second copy mode, and a third copy mode, the first copy mode using the palette index used by the pixels adjacent to the top or bottom of the current pixel in the same way as the palette index of the current pixel; the second copy mode using the palette index used by the pixels adjacent to the left or right of the current pixel in the same way as the palette index of the current pixel; and the third copy mode using the palette index used by the pixels adjacent to the diagonal direction of the current pixel in the same way as the palette index of the current pixel.

[0121] On the other hand, any one of the first to third copy modes can be selectively used in the scanning order of the current block. For example, when the scanning order of the current block is vertical scanning, the first copy mode can be applied, and when the scanning order of the current block is horizontal scanning, the second copy mode can be applied.

[0122] In addition, the scanning start position of the current block is not limited to the upper left pixel of the current block, and other corner pixels (e.g., lower left pixel, upper right pixel, lower right pixel) of the current block can be used as the scanning start position. Therefore, as described above, according to the scanning order and scanning start position of the current block, the same palette index as the upper or left adjacent pixel can be used, or the same palette index as the lower or right adjacent pixel can be used.

[0123] Any of the above-mentioned index mode and copy mode can be selectively used. For example, the encoding device can encode a flag (run_copy_flag) indicating whether the copy mode is used. Here, if the copy mode is used, the encoding device can encode the flag as 1, otherwise (that is, in the case of using the index mode), the encoding device can encode the flag as 0.

[0124] Reference Figure 6 , the pixels of the current block can be predicted based on the palette table and the palette index S620.

[0125] Specifically, a palette entry having a palette index having the same value as the palette index may be extracted from the palette table of the current block, and the pixels of the current block may be predicted / reconstructed using the palette entry. For example, the value of the palette entry extracted from the palette table may be set as a predicted value or a reconstructed value of a pixel of the current block.

[0126] However, in the case where the palette index indicates the last palette entry of the palette entries in the palette table of the current block, it can be inferred that the corresponding pixel is encoded by the escape mode. Here, the escape mode may mean a method of predicting / reconstructing a pixel based on a palette escape value that is additionally signaled instead of using a palette entry of a preconfigured palette table. Therefore, a pixel having a palette index with the same value as (the number of palette entries - 1) may be predicted / reconstructed by using the additionally signaled palette escape value.

[0127] The above embodiments are merely examples and will be referred to in detail. Figures 7 to 11 Describes in detail the various ways to configure the palette table.

[0128] Figures 7 to 11 A method of configuring a palette table according to the present disclosure is shown.

[0129] When the current block is encoded by the palette mode, the same palette table used in the encoding device should also exist in the decoding device. Therefore, the palette table should be encoded in the encoding device. Therefore, the number of palette entries in the palette table can be encoded, and the value of the pixel assigned to each entry can be encoded. However, for this method, as the size of the block becomes larger and as the number of entries increases, the amount of bits to be encoded increases rapidly. Therefore, if the palette mode is used in the previous block, the amount of bits required to encode the palette table can be greatly reduced by generating the palette table of the current block based on the palette table used in the previous block. Here, the previous block means a block that is encoded / decoded before the current block. Specifically, at least one of the following flags can be used: a flag indicating whether the palette table of the current block is configured based on the previous palette table, or a palette prediction flag indicating whether the entries included in the palette table of the previous block will be added to the palette table of the current block.

[0130] Figure 7 A method of reducing the number of bits currently to be encoded in the palette table by using palette prediction flags.

[0131] exist Figure 7In , palette table A may represent a palette table existing in a block encoded by using a palette mode before a current block. In palette table A, by using a palette prediction flag, it may be specified whether each entry is used as is for the current palette table. For example, if the palette prediction flag is 1, it may mean that the corresponding entry is used as is for the current palette table, and if the palette prediction flag is 0, it may mean that the corresponding entry is not used for the current palette table. The index assigned to the entry predicted from palette table A may be set to be the same as the index assigned to palette table A. Alternatively, the index of each entry may be reallocated in ascending / descending order of the index assigned to each entry in palette table A.

[0132] exist Figure 7 In the example of , the first entry, the third entry, and the fifth entry are used in the current palette table, so the first entry, the third entry, and the fifth entry can be placed in the first entry to the third entry in the current palette table in order, and only the fourth entry to the fifth entry can be configured as new entries. Such a method can first encode the palette prediction flag, and the number of remaining entries (for Figure 7 The example of 2 is: the fourth entry and the fifth entry in the current palette table are encoded. Subsequently, the remaining entries as many as the number of the remaining entries can be encoded. By sending the information to the decoding device, the decoding device can also generate the same palette table as the encoding device and predict / reconstruct the current block.

[0133] In this case, the size (number of entries) of the current palette table may be different from the size of the previous palette table. Figure 8 This is an example of a case where the size of the previous palette table is larger than the size of the current palette table. In this case, the size of the current palette table may be encoded first. In the example, at least one of information indicating the number of entries included in the current palette table or information indicating a difference from the size of the previous palette table may be encoded in a bitstream and sent to a decoding device.

[0134] In the case where the palette prediction flag is sequentially encoded for each entry included in the previous table but the number of palette prediction flags having a value of 1 reaches the size of the current palette table, encoding of the palette prediction flags for the remaining entries may be omitted. Figure 8 For the last entry (pixel: a8) of palette table B, the corresponding palette prediction flag may not be encoded.

[0135] Alternatively, the number of entries that can be brought about by using a palette prediction flag (hereinafter referred to as the maximum number of predictions) may be limited. In an example, information about the maximum number of predictions may be signaled in the bitstream. Alternatively, the maximum number of predictions may be determined based on at least one of the size of the palette table, the size / shape of the current block, the size / shape of the previous block, or the size of the previous palette table.

[0136] In an example, the following method may be performed: entries are introduced from a previous palette table by using a palette prediction flag at a certain ratio of the size of the current palette table, and the remaining ratios are forced to be generated in the current palette table. For example, when the size of the current palette table is 6 and the ratio is set to 50%, up to 3 entries may be introduced from the previous palette table by using the palette prediction flag, and the remaining 3 entries may be forced to be generated in the current palette table. Therefore, when the entries whose value of the palette prediction flag is 1 reach 3, the encoding of the palette prediction flags for the remaining entries may be omitted.

[0137] Alternatively, in the case where the size of the previous block is less than a preset threshold, the palette entry included in the palette table of the previous block may be set not to be added to the palette table of the current block. In other words, in the case where the size of the previous block is less than the preset threshold, the encoding of the palette entry prediction flag of the palette entry of the previous block may be omitted, and the value may be inferred to be 0.

[0138] In an example, in a case where the threshold is 16 and the number of samples included in the previous block is less than 16, the palette entry of the previous block may not be added to the palette table of the current block.

[0139] The threshold may be encoded in a higher header and sent to the decoder.Alternatively, a fixed threshold may be used in the encoder and decoder.

[0140] Alternatively, according to the size of the previous block, the number of palette entries that can be added from the palette table of the previous block to the palette table of the current block may be determined.

[0141] Alternatively, entries to be included in the current palette table may be predicted from a plurality of previous palette tables. In an example, the following method is also possible: in a case where entries are introduced into the current palette table by using a prediction flag for each of the entries included in a first previous palette table but the number of palette prediction flags having a value of 1 is less than the size of the current palette table, palette prediction flags are continuously allocated by using a second previous palette table that is further ahead of the first previous palette table.

[0142] Fig. 9This is an example of a case where the size of the previous palette table is smaller than the size of the current palette table, and at the same time, an example of a case where the ratio of entries generated by using the palette prediction flag is set to 50%.

[0143] Since the size of the current palette table is 6, the number of entries generated by using the palette prediction flag is 3. Therefore, the palette prediction flags are allocated by using the previous palette table until there are 3 palette prediction flags that are 1. Fig. 9 In , the previous palette tables A to C are examples of palette tables introduced into a block encoded by the palette mode in the encoding order of the blocks before the current block. In this case, when an entry is introduced from the previous palette table, the repeated entry is not assigned a palette prediction flag. Fig. 9 , a0 in the previous palette table B is indicated as the palette prediction flag in the previous palette table A, and thus no additional palette prediction flag is allocated in the previous palette table B. Also, a5 in the previous palette table C has been indicated as the palette prediction flag in the previous palette table B, and thus no additional palette prediction flag is allocated in the previous palette table C.

[0144] In addition, the number of previous palette tables referred to may be used as a fixed value by the encoding device and the decoding device, or may be transmitted through a higher header.

[0145] Alternatively, whether reference is available when generating the current palette table can be determined by considering the size of the previous palette table. In the example, only when the size of the previous palette table is equal to or greater than the threshold or the size of the previous palette table is the same as the size of the current palette table, it can be determined that reference is available when generating the current palette table.

[0146] Alternatively, the encoding order of the palette prediction flags may be determined by considering the indexes of the entries included in the first previous palette table and the entries included in the second previous palette table. In the example, after encoding the palette prediction flag of the entry with index 0 included in the first previous palette table, the palette prediction flag of the entry with index 0 included in the second previous palette table may be encoded. Subsequently, after encoding the palette prediction flag of the entry with index 1 included in the first previous palette table, the palette prediction flag of the entry with index 1 included in the second previous palette table may be encoded.

[0147] Alternatively, a palette table candidate list may be configured, and at least one of a plurality of previous palette table candidates included in the palette table candidate list may be used when encoding the current palette table. Fig.10 is a method of reducing the amount of bits currently to be encoded in the palette table by using palette prediction flags. Fig.10 In , RT means the pixel at the upper right position in the block and LB means the pixel at the lower left position in the block. Fig.10 In the encoding / decoding apparatus, at least one of the five surrounding blocks (i.e., blocks including pixels A to E, respectively) may be referenced. Subsequently, the referenced block may be indicated as an index, encoded and sent to a decoding device. Alternatively, only blocks located at predefined positions in the encoding / decoding apparatus among the blocks including the above-mentioned pixels A to E, respectively, may be referenced. Here, the predefined position may be an upper block (B) or a left block (A). In this case, the encoding of the index of the designated reference block may be omitted.

[0148] The palette table for the current block may be initialized / configured by using only the palette entry for the block corresponding to the index.

[0149] Alternatively, if the palette table of the current block is not filled to exceed the threshold by using only the palette table of the referenced block, then Fig. 9 In a similar manner to the method in , blocks are additionally specified based on additional indexes to fill the palette table currently to be encoded. In this case, the encoding / decoding device can refer to a fixed number of blocks agreed upon in advance, and information specifying the number of reference blocks can be transmitted through a higher header. Alternatively, the following method is possible: the encoding / decoding device refers to a fixed number of surrounding blocks in the same manner according to the size / shape of the block or the size of the palette table. Alternatively, the following method is also possible: in addition to Fig.10 In addition to the position in , M blocks encoded by the palette mode before the current block in the encoding order are designated as indexes to introduce the palette table from the corresponding block. Alternatively, the following method is also possible: a block included in a collocated picture is designated as an index to introduce the palette table from the corresponding block.

[0150] Alternatively, a method of referring to a palette table used in advance in a block specified by a BV (Block Vector) is also possible.

[0151] Fig.11 is an example of a method for setting BV. After setting a horizontal search range and a vertical search range in the reconstruction area around the current block, a region most similar to the current block is searched within the set search range. Subsequently, the region determined to be most similar is determined, and if there is a region encoded by the palette mode in the corresponding region, the region can be searched in the same manner as Fig. 9 The palette entry is obtained from the corresponding palette table in a similar manner as in . The number of palette tables used in this case may be 1 or may be multiple.

[0152] The determined BV is encoded and sent to the decoding device. Subsequently, after finding the area most similar to the current block by using the same BV in the decoding device, the area most similar to the current block can be introduced by using the palette table of the corresponding area, and the palette table is set in the same way as the encoding device.

[0153] Alternatively, the BV may be encoded based on the BV of the neighboring block. For example, if an encoding method using BV is used around the current block, the corresponding BV may be used by merging with the current block. In this case, the location of the reference BV may include Fig.10 At least one of the blocks shown or the collocated blocks included in the collocated picture. Fig.10 The position of the reference BV is set in a similar manner to that in the above, the referenced position is indicated as an index and encoded and sent to the decoding device. Alternatively, the priority may be determined according to the position without being indicated as an index. For example, the following method is also possible: Fig.10 After determining the priority in the order of A->B->C->D->E, the BV is introduced from the position where the BV is determined to exist first and used for the current block.

[0154] Alternatively, the BV of the neighboring block may be set to a predicted value of the BV, and an index identifying the neighboring block and a difference between the BV and the predicted value may be encoded and sent to a decoding device.

[0155] Alternatively, a method of configuring a palette table candidate list is also possible. Starting from the block at the first position of the image to just before the current block, all used palette tables are stored in the candidate list. Alternatively, after the number N of tables to be stored in the candidate list is set, N palette tables are stored in the candidate list. In other words, if the encoding of the block is completed, the palette table of the encoded block can be stored in the candidate list. In this case, in the case where there is a palette table candidate that is the same as the palette table to be added to the candidate list, the palette table may not be added to the candidate list. Alternatively, the palette table may be added to the candidate list, and the palette table candidate that is the same as the palette table may be deleted from the candidate list.

[0156] In this case, the method of storing the palette table candidates in the candidate list may have a higher priority as it is close to the current block and may have a lower priority as it is far from the current block. Alternatively, the priority may be set according to the size or reference frequency of the palette table, etc. According to the priority, when the number of stored tables exceeds N, the palette table with the lowest priority may be deleted from the candidate list.

[0157] Alternatively, in a parallel processing structure, a method of separately configuring a palette table list for each region that is processed in parallel is also possible. Alternatively, a method of separately configuring a palette table list for each CTU row in a region is also possible. In this case, in the case where each region that performs each parallel processing separately has a palette table list, the palette tables stored in the palette table list at the beginning of the region may be very few. Therefore, for each region that performs each parallel processing, a preset initial palette table may also be filled in instead of filling the palette table from scratch. For example, as Figure 6 As shown in FIG. 1 , the initial palette table may be the palette table of the first CTU in the previous CTU row. Alternatively, the preset initial palette table may be a palette table derived from the entire image, rather than a palette table derived from the entire image. Figure 3 In this case, the value of each entry in the palette table derived from the entire image can be encoded through a higher header together with the number of entries. Alternatively, when configuring the initial palette table, the value quantized according to the representation bit of the pixel can also be set as the entry value. For example, when 8-bit pixels are quantized to 5 (5 entries), 0 to 255 can be divided into 5 areas and can be set as entries and encoded by using the representative value of each area. Alternatively, if 0 to 255 are uniformly quantized, only the information that they are uniformly quantized and the information indicating how much they are quantized can be encoded through a higher header.

[0158] Alternatively, a method of configuring a palette entry candidate list with entries included in a palette table is also possible. Entries included in the palette table of a coding block may be added to the entry candidate list. In this case, among the entries included in the palette table, only entries having an index less than a threshold value may be included in the entry candidate list. In the case where the number of entries included in the palette table of the current block is less than the maximum number, the palette table may be configured by referring to the candidate entries included in the palette entry candidate list.

[0159] A palette entry included in a palette table of an encoding / decoding block may be added to a palette entry candidate list. When a new palette entry is added to the palette entry candidate list, a minimum index may be assigned to the newly added palette entry. And, an index of a pre-existing palette entry may be updated by adding the number of the newly added palette entry to an index of a palette entry pre-existing in the palette entry candidate list.

[0160] As new palette indexes are added, when the number of palette entries included in the palette entry candidate list exceeds a maximum value, pre-existing palette entries may be removed from the palette entry candidate list in descending order of index.

[0161] Fig.12 is a diagram showing an example of adding a palette entry to a palette entry candidate list.

[0162] After configuring the palette table based on the palette prediction flag, the block may be encoded / decoded by using the configured palette table. When encoding / decoding of the block is completed, the palette entry included in the palette table may be added to the palette entry candidate list.

[0163] In an example, when the palette table includes a0, a2, a4, a5, and a7, the palette entry may be added to the palette entry candidate list.

[0164] If the same palette entry as the palette entry to be added to the palette entry candidate list is already stored in the palette entry candidate list, the redundant palette entry may not be added to the palette entry candidate list.

[0165] Alternatively, if the same palette entry as the palette entry to be added to the palette entry candidate list is already stored in the palette entry candidate list, the pre-stored palette entry may be removed from the palette entry candidate list and the redundant palette entry may be added to the palette entry candidate list.

[0166] In the above-mentioned example, it is described that all palette entries included in the palette table of the encoding / decoding block are added to the palette entry candidate list.

[0167] In order to reduce the complexity of the palette entry candidate list configuration, only those palette entries whose indexes are equal to or less than a threshold value may be added to the palette entry candidate list.

[0168] Alternatively, in the case where the size of the block is less than a preset threshold, the palette entry included in the palette table may not be added to the palette entry candidate list. On the other hand, in the case where the size of the block is equal to or greater than the preset threshold, the palette entry included in the palette table may be added to the palette entry candidate list.

[0169] The threshold may be encoded in an upper header and sent to the decoder.Alternatively, a fixed threshold may be used in the encoder and decoder.

[0170] For the palette prediction flag, a run length encoding method can be used. When the same data is continuous, it is called a run and the continuous length is expressed as the run length. For example, when there is a string aaaaaabbccccccc, a is 6, b is 2 and c is 7, the string can be expressed as 6a2b7c. Such an encoding method is called a run length encoding method. When the palette prediction flags are encoded by using run length encoding, they can be expressed as the number of 0s, the number of 1s, etc. Alternatively, run length encoding can be performed only on 0s, and conversely, run length encoding can be performed only on 1s.

[0171] Fig.13 A method of signaling a palette prediction flag in the form of a binary vector based on run-length encoding is shown as an embodiment to which the present disclosure is applied.

[0172] In this embodiment, it is assumed that the palette table of the previous block uses 8 palette entries with palette indices 0 to 7.

[0173] The image encoding apparatus determines, for each of the palette entries No. 0 to No. 7 of the previous block, whether to reuse the corresponding palette entry as the palette entry of the current block, and if the corresponding palette entry is reused as the palette entry of the current block, the value of the palette prediction flag for the corresponding palette entry may be set to 1, otherwise, the value of the palette prediction flag for the corresponding palette entry may be set to 0. For example, Fig.13 As shown, when palette entries No. 0, No. 1, No. 3, and No. 7 among the palette entries of the previous block are reused as palette entries of the current block and other palette entries are not reused, a binary vector represented as 11010001 can be generated.

[0174] Next, at least one of the number of 1s in the binary vector (i.e., the number of palette entries reused as palette entries of the current block among the palette entries of the previous block) or the number of 0s preceding 1 in the binary vector may be encoded and signaled by the image decoding device. For example, the number of 1s in the binary vector is 4, so 4 may be encoded as the number of palette entries reused as palette entries of the current block among the palette entries of the previous block. In addition, the number of 0s preceding 1 in the binary vector, i.e., 0, 0, 1, 3 may be encoded sequentially.

[0175] The decoding device may receive at least one of information about the number of palette entries in a previous block that are reused as palette entries for the current block or information about the number of 0s preceding 1 in a binary vector (palette_entry_run) from the encoding device, and may configure the palette table of the current block by using the received information.

[0176] For example, the decoding device may sequentially extract information (palette_entry_run) about the number of 0s (i.e., 0, 0, 1, 3) preceding 1 in the binary vector from the bitstream, and use the information to reconstruct a binary vector (i.e., 11010001) indicating whether the palette entry of the previous block is reused. When a value of 1 is generated in the process of reconstructing the binary vector, the palette entry corresponding to the value 1 in the previous block may be inserted into the palette table of the current block. In such a process, some palette entries may be selectively reused from the palette table of the previous block to configure the palette table of the current block.

[0177] Without run-length coding, the value of the palette prediction flag can be directly encoded pixel by pixel. In this case, the palette prediction flag can be encoded without using context information. The encoding method without using context information can be defined as bypass coding.

[0178] In another example, the palette prediction flag may be encoded by using context information. When using context information, the likelihood of the value of the palette prediction flag being 1 or 0 may be determined based on the value of the previous palette prediction flag.

[0179] Fig.14 An example of encoding a palette prediction flag by using context information is shown.

[0180] A variable PREV_POS may be used when encoding a palette prediction flag, and the variable PREV_POS indicates a scanning order of a sample having a highest scanning order among samples whose values ​​of the palette prediction flag are set to 0. Specifically, a context information index value may be obtained by subtracting the variable PREV_POS and 1 from the scanning order of the current sample, and the palette prediction flag may be encoded by using the obtained context information index value.

[0181] In this case, when the first palette prediction flag is encoded, there is no pre-encoded palette prediction flag, so the value of the variable PREV_POS can be set to an initial value (e.g., 0). Therefore, for the first palette prediction flag, the context information index value can be set to -1.

[0182] The variable PREV_POS may be updated whenever a palette prediction flag having a value of 0 is encoded. On the other hand, when a palette prediction flag having a value of 1 is encoded, the variable PREV_POS may be maintained.

[0183] exist Fig.14In the example shown, for the sample whose scan order is 7, the value of the variable PREV_POS is shown to be 2. Therefore, the context information index of the sample whose scan order is 7 can be set to 4. When encoding the palette prediction flag of the sample whose scan order is 7, the probability of the palette prediction flag can be determined according to the value of the context information index, and the palette prediction flag can be encoded based on the determined probability.

[0184] exist Fig.14 In the description, the variable PREV_POS represents the position of the sample whose value of the palette prediction flag is 0, but the variable PREV_POS can also be set to represent the position of the sample whose value of the palette prediction flag is 1.

[0185] Fig.15 is an example showing the range of the context information index.

[0186] The maximum value of the context information index may be set to not exceed a predefined threshold. When the value obtained by subtracting the variable PREV_POS and 1 exceeds the threshold at the position of the current sample, the value of the context information index may be set to the maximum value. Fig.15 In FIG. 4 , a maximum value of 4 is shown.

[0187] The minimum value of the context information index may be set to be not less than a predefined threshold. When the value obtained by subtracting the variable PREV_POS and 1 is less than the threshold at the position of the current sample, the value of the context information index may be set to the minimum value. Fig.15 In FIG, the minimum value is shown to be 0.

[0188] The maximum value and / or minimum value of the context information index may be defined in the encoder and the decoder. Alternatively, information indicating the maximum value and / or minimum value of the context information index may be signaled in the bitstream.

[0189] Instead of setting the palette table in units of blocks, the palette encoding may be applied in units of regions of a preset size. Specifically, after a block is divided into a plurality of regions, a palette table may be derived for each region.

[0190] Fig.16 An example is shown in which a palette table is defined in units of areas of a preset size.

[0191] Fig.16 The example in (a) shows the case where the block size is 16×4, and Fig.16 The example in (b) shows the case where the block size is 8 × 8. For ease of description, it is assumed that horizontal scanning is applied to the block.

[0192] The block may be divided into regions of a predetermined size. In an example, when the predetermined size is 16, the block may be divided into a plurality of regions in units of 16 pixels. Fig.16 In the example of (a), division of the block into regions of 16×1 size is shown, and in the second example, division of the block into regions of 8×2 size is shown.

[0193] A palette table may be generated in units of regions, and each region may be encoded / decoded by using the palette table of each region. Multiple regions may be encoded / decoded sequentially. A palette entry included in the palette table of a previous region may be used as a predicted palette entry for a subsequent region.

[0194] The size and / or shape of the region may be predefined in the encoder and the decoder. Alternatively, the size and / or shape of the region may be determined based on at least one of the size or shape of the block, the size of the palette table, the bit depth, whether to skip transform, or whether to apply lossless coding. Alternatively, information indicating the size and / or shape of the region may be encoded and transmitted to the decoding device.

[0195] Figures 17 to 22 A method of encoding / decoding palette indices in scan order according to the present disclosure is shown.

[0196] After encoding the palette table, the palette index assigned to each pixel of the current block should also be encoded. Fig.17 is an example of the order of scans performed in the current block.

[0197] Fig.17 The main purpose of the scanning order shown is to perform scanning by considering directionality. Fig.17 (a) has a similar value in the horizontal or vertical direction, this increases the Fig.17 (a) is performed as in the probability that the same index will be clustered. Alternatively, if the characteristics of the pixels in the block are Fig.17 (b) has similar values ​​in the zigzag or diagonal direction, which increases the Fig.17 The probability that the same index will cluster when performing a scan as in (b).

[0198] In the encoding device, which scanning method to use can be indicated as an index, encoded and sent to the decoding device. Alternatively, the scanning order can be determined according to the size or shape of the current block. After gathering indexes with the same value in such a scanning method, the encoding efficiency can be improved by performing run length encoding.

[0199] Alternatively, a fixed scanning method is used, but run length encoding may be performed after the current block is rotated. The encoding device may encode information indicating whether the current block is rotated and send it to the decoding device. Alternatively, it may be determined whether the current block is rotated based on the size or shape of the current block.

[0200] Furthermore, information indicating whether there is an escape value for each block may be encoded. If there is an escape value, an index at any fixed position, such as the last index or the first index, may be used to indicate that the pixel at the corresponding position is an escape value. In this case, the following method is also possible: Figure 3 The size of the resulting palette table is used as is, but the index is assigned by increasing the size of the palette table by 1 only when there is an escape value. Alternatively, the following method is also possible: information indicating whether each pixel in the block is an escape value, and the index of the palette table is used only when each pixel in the block is not an escape value. When encoding the escape value, both the lossy encoding method and the lossless encoding method can be used. Information about whether to perform lossless encoding is added, and if in the case of encoding the escape value, if the information about whether to perform lossless encoding indicates that lossy encoding is performed, the escape value is quantized, encoded, and sent to the decoding device. In this case, information indicating the degree to which the escape value will be quantized (for example, a quantization parameter) may be additionally encoded, and the quantized escape value may also be encoded. If the information about whether to perform lossless encoding indicates that lossless encoding is performed, the escape value may be encoded without quantization and sent to the decoding device.

[0201] Fig.18 This is an example of a case where a palette index in a current block is encoded. In this case, for ease of description, description is made assuming that horizontal scanning is applied. Information that should be encoded and sent to a decoding device requires an initial index at which run-length encoding starts and a run length immediately following the initial index. Fig.18 In the example, except for the escape value, the initial index is 0, 1, 0, 2, 3, 2, 3, 2, 2, 1, 0 in order. And, except for the starting index, the run length according to each starting index is 6, 4, 3, 5, 10, 1, 4, 4, 3, 3, 9. The escape value can be encoded by using the initial index and the run length like other indexes. Alternatively, the encoding can be performed by using information indicating whether each corresponding pixel position is an escape value. For example, only in the case where it is determined that each corresponding pixel position is not an escape value, the encoding can be performed by using the initial index and the run length, and in the case where it is determined that each corresponding pixel position is an escape value, the escape value can be directly encoded without using the initial index and the run length.

[0202] Alternatively, the index may be copied from a previous row. Fig.19 is an example of a situation where an index is copied from a previous row.

[0203] When encoding the initial index 3, the same index exists directly above. In this case, before encoding the initial index, information indicating whether to use conventional run length encoding or to copy the index from the pixels included in the previous row may be encoded first. Depending on the scanning order, the pixels included in the previous row may be located in the upper row, the lower row, the left column, the right column, or the upper left corner. Subsequently, in the case where it is determined by the information that the copy is to be made from the previous row, only the run length including the initial index may be encoded without encoding the initial index. For example, if a conventional method is used, information that the index is not copied from the previous row and the initial index 3 may be encoded, and the run length 4 may be encoded. If the method of copying from the previous row is applied, only information that the index is copied from the previous row and the run length 5 may be encoded. In this case, the information indicating whether the index is copied from the previous row may be indexed and indicated as content that can be copied from multiple rows. For example, if the index is 0, the conventional run length encoding method may be used instead of this method, if the index is 1, the method of copying from the previous row may be used, and if the index is 2, the method of copying a row from 2 rows away may be used. For such a method, the following method may be used: in the case where the run length to be currently encoded and the initial index exist at the same horizontal position, copying is performed by indicating the vertical position using only the index.

[0204] If they are not at the same horizontal position, you can use a vector to indicate which area to copy from. Fig. 20 is an example of the vector.

[0205] In this case, the encoding / decoding device can use the starting point and the ending point of the vector by setting the same rule. Fig. 20 In the example, if the vector is in the left or upward direction based on the current starting point, the vector is represented as a negative number, and if the vector is in the right or downward direction, the vector is represented as a positive number. However, for horizontal scanning, the y component vector is always negative in the scanning order, so the sign may not be encoded for the y component. In another example, for vertical scanning, the x component vector is always negative in the scanning order, so the sign may not be encoded for the x component.

[0206] Alternatively, redundancy between conventional consecutive run-length encoding methods can be removed. For example, Fig.19The index in the block is represented as 000000011111... in the scanning order. By run-length encoding, such an index can be represented as initial index 0, run length 6, initial index 1, run length 4... Since the number of pixels having the same value as the initial index is represented by the run length, the Nth initial index may have a different value from the previous initial index. In the example, when the initial index is 1, this means that the initial index of the previous order is not 1. In this way, run-length encoding can be performed by reallocating index values ​​for the remaining indexes except the previous initial index. In the example, the index whose original value is less than the original value of the previous initial index maintains its value, and the value subtracted from the original value by 1 is reallocated to the index whose original value is greater than the original value of the previous initial index. Here, the original value represents the index value before reallocation, not the reallocated index value. In the example, if the previous initial index is 1, index 0 maintains the index value, and index 1 to index 3 can be allocated to index 2 to index 4 whose index is greater than 1.

[0207] When this is applied to the example, in this example, the method expressed as initial index 0, run length 6, initial index 1, run length 4... can be changed to initial index 0, run length 6, initial index 0, run length 4...

[0208] In the decoding device, after decoding the second initial index 0, the original value of the initial index may be reconstructed by increasing the initial index in the process of comparing with the previous initial index in the opposite manner to the encoding device. In the example, if the value of the initial index is less than the original value of the previous initial index, the value of the initial index may be set to the original value of the initial index as it is. On the other hand, if the value of the initial index is equal to or greater than the original value of the previous initial index, the value of the initial index plus 1 may be set to the original value of the initial index.

[0209] Redundancy can also be removed by reallocating the value of the initial index in the same manner in the method of copying from the previous row. When encoding the initial index, if the previous initial index and the corresponding run length are copied from the previous row, the value at the same position as the current initial index in the previous row should be different from the current initial index. If they are the same, the run length will be represented by combining the current initial index with the method of copying from the previous row, which is the method of encoding the previous initial index. Therefore, similarly, encoding can be performed by reducing the value.

[0210] Fig.21 is an example of a method for applying intra prediction and palette mode simultaneously. Fig.21 In , the index and the corresponding pixel are indicated for each position.

[0211] For example, information indicating the use of intra-frame prediction is assigned to index 0 of the palette table. Subsequently, a value for performing intra-frame prediction by using reconstructed pixels around the current block is assigned to the pixel position indicated by index 0. After encoding information indicating whether a method of using a conventional palette mode or a method combined with intra-frame prediction is used for each block, if it is determined to use a combined method, which intra-frame prediction to use can be determined by using an index. Depending on the number of intra-frame prediction modes used, the mode itself can be encoded as is and can also be encoded by using an MPM (most probable mode). Alternatively, the intra-frame prediction mode can also be encoded by using a default intra-frame mode. The default mode may include at least one of a planar mode, a DC mode, a horizontal mode, and a vertical mode.

[0212] Fig. 22 It is about combining the palette mode and Fig.11 An example of the case where a block combination is searched for by BV described in.

[0213] For example, information indicating that it is a pixel using BV is assigned to index 0 of the palette table. Subsequently, for the pixel position indicated as index 0, the pixel at the same position in the block searched by using BV is assigned to the position of index 0. After encoding information indicating whether a method of using a normal palette mode or a combined method using BV is used for each block, if it is determined that the combined method is used, information related to BV is sent to the decoding device. When the BV is derived, as Fig.10 A method of specifying which BV to use among the BVs in the surrounding blocks as an index as in , or a method of directly encoding the BV and sending it to the decoding device is also possible. Alternatively, the following method is also possible: Fig.10 After determining the priority in the order A->B->C->D->E, the BV is introduced from the position where the BV is determined to exist first and used for the current block. In this case, it is not necessary to encode the information related to the BV.

[0214] An index indicating intra prediction or an index indicating the use of BV may be assigned to a predefined position in the palette table. Fig.21 and Fig. 22As shown, the index can be set to the first one of the palette table, and contrary to the example shown, the index can be set to the last one of the palette table. Alternatively, the value assigned to the index can be determined based on at least one of the value / angle of the intra-frame prediction mode, the size of the BV, the size / shape of the block, or the intra-frame prediction mode of the adjacent block. Alternatively, when encoding the escape value, a method using intra-frame prediction or a method using BV can be used. For example, values ​​can be introduced from surrounding reconstructed pixels according to the intra-frame prediction mode used and the values ​​can be replaced by escape values, or values ​​at the same position can be introduced from blocks searched by using BV and the values ​​can be replaced by escape values. Alternatively, a method of using these values ​​as prediction values ​​instead of replacing them with escape values ​​and encoding and transmitting only the difference values ​​is also possible. The difference value can be encoded as it is or it can be encoded after quantization is performed.

[0215] The palette tables can be configured separately for luma and chroma components.

[0216] In another example, according to the tree structures of the luma component and the chroma component, an integrated palette table may be configured for the luma component and the chroma component, or palette tables may be configured separately for the luma component and the chroma component.

[0217] Fig.23 An example of configuring an integrated palette table is shown, and Fig.24 An example is shown in which palette tables are configured separately for luma components and chroma components.

[0218] In the case where the tree types of the luma component and the chroma component are a single tree, an integrated palette table may be configured for the luma component and the chroma component.

[0219] A combination of a luma component pixel value and a chroma component pixel value may be assigned to a palette entry in the integrated palette table. Fig.23 In the example shown, a combination of a pixel value of a luma component Y, a pixel value of a chroma component Cb, and a pixel value of a chroma component Cr may be assigned to a palette entry.

[0220] When a palette entry is selected from the integrated palette table, the luminance component pixel value and the chrominance component pixel value assigned to the selected palette entry may be set as predicted values ​​or reconstructed values ​​of the luminance component pixel and predicted values ​​or reconstructed values ​​of the chrominance component pixel, respectively.

[0221] When the tree type of the luminance component and the chrominance component is a dual tree, the palette table can be configured for the luminance component and the chrominance component respectively. In this case, the palette table of the luminance component can be used when predicting the luminance block, and the palette table of the chrominance component can be used when predicting the chrominance block.

[0222] The configuration of the palette table of the luma component can be independent of the configuration of the palette table of the chroma component. In this case, the size of the luma component palette table can be set to be the same as the size of the chroma component palette table.

[0223] Alternatively, the sizes of the luma component palette table and the chroma component palette table may be independently set. In this case, information indicating the size of the palette table may be signaled for the luma image and the chroma image, respectively. The information indicating the size of the palette table of the chroma image may indicate the difference between the size of the palette table of the luma image and the size of the palette table of the chroma image.

[0224] The palette tables are configured for the luminance component and the chrominance component, respectively, but an integrated palette table may be configured for the two chrominance components (Cb, Cr). Alternatively, the palette tables may be configured for the two chrominance components (Cb, Cr), respectively.

[0225] Information indicating whether an integrated palette table is to be configured for luma and chroma components may be encoded for a higher header. The higher header includes at least one of a video parameter set, a sequence parameter set, a picture parameter set, a picture header, or a slice header.

[0226] Fig.23 and Fig.24 The example shows a Y component, a Cb component, and a Cr component, but the above-described embodiment can also be applied to an R component, a G component, and a B component.

[0227] In the above description, the palette index is allocated in units of pixels. According to an embodiment of the present disclosure, the palette index may be allocated in units of regions including a plurality of pixels. In this case, a plurality of pixels included in any region may have the same predicted value or reconstructed value.

[0228] Fig.25 and Fig.26 An example of allocating palette indexes in units of predetermined areas is shown.

[0229] Instead of allocating a palette entry for each pixel, a palette entry may be allocated for each region including a plurality of samples. In this case, the palette entry allocated to each region may be encoded and sent to a decoding device.

[0230] The area to which the palette entries are assigned may have a square shape. In the example, as in Fig.25 In the example shown, the palette entries may be allocated in units of 2×2 areas.

[0231] Alternatively, one row or one column may be set as the allocation unit of the palette entry.

[0232] Alternatively, the size or shape of the area to which the palette entry is allocated may be determined based on at least one of the size or shape of the current block, the intra prediction mode of the neighboring block, or the size of the palette table.

[0233] In the example, in the case where the current block is a square block of size 8×8, as in Fig.25 In the example shown in FIG. 1 , the palette entries may be allocated in units of 2×2 regions. On the other hand, in the case where the current block is a non-square block of 8×4 size, as in Fig.26 In the example shown, the palette entries may be allocated in units of 4×1 or 1×4.

[0234] Alternatively, information indicating at least one of the size or shape of the region may be encoded and transmitted to the decoding device. In an example, the information may be an index specifying one of a plurality of candidates having different sizes or different shapes.

[0235] Information indicating whether the palette index is allocated in units of regions may be encoded and signaled by a decoding device. In the case where it is determined that the palette index is allocated in units of regions, the palette entry may be determined per region. On the other hand, in the case where it is determined that the palette index is not allocated in units of regions, the palette entry may be determined per pixel. The information may be signaled by a block level, a slice header, a picture header, a picture parameter set, or a sequence parameter set.

[0236] In another example, whether to allocate the palette index in units of regions may be determined based on at least one of the size or shape of the current block, the intra prediction mode of the neighboring block, or the size of the palette table.

[0237] In the case where the palette entry indicates the reconstructed value for the pixel to which the corresponding palette entry is assigned, the encoding and decoding of the residual value can be omitted for the current block. Therefore, when the palette mode is applied, the signaling cbf_flag indicating whether there is a non-zero residual coefficient in the current block can be omitted and the value can be set to 0.

[0238] In the above-mentioned embodiment, it is described that a palette entry is set to a predicted value or a reconstructed value for a pixel to which the corresponding palette entry is assigned.

[0239] According to an embodiment of the present disclosure, a palette table may be used to encode / decode a residual value of a current block. In an example, when a predicted pixel is generated for intra prediction or inter prediction and a residual pixel is generated by subtracting the predicted pixel from the original pixel, a palette entry corresponding to the residual pixel may be encoded instead of the residual pixel.

[0240] Hereinafter, a method of encoding a residual value by using a palette table will be described in detail.

[0241] When residual pixels are encoded using a palette mode, residual pixels frequently generated in a current block may be indicated as a specific index, and the specific index may be encoded and sent to a decoding device instead of the residual pixels.

[0242] When allocating quantization regions and indices according to the frequency of residual pixels, Figure 3 In the example, when the palette mode is applied to the residual pixels, Figure 3 The horizontal axis in may represent the value of the residual pixel and the vertical axis may represent the frequency of the residual pixel value.

[0243] In the example, Figure 3 In the example shown, assuming that the values ​​of the residual pixels corresponding to the parts marked with bold lines in the quantization area are a40, a20, a8, a31, respectively, each of them can be set as a palette entry, and a different index can be assigned to each palette entry.

[0244] The order of arrangement of the palette entries in the palette table may be determined based on the frequency of the residual pixels. In an example, the smallest index may be assigned to the residual pixel with the highest frequency.

[0245] In addition, for an escape value not included in the quantization region, the value may be directly encoded and sent to the decoding device. However, a palette entry for notifying that the value of the residual pixel is an escape value may be included in the palette entry.

[0246] Fig. 27 is an example of the process of assigning pixels in a block to indices by using a palette table.

[0247] For the sake of description, assume that Fig. 27 The palette table is configured as shown in the example of (a).

[0248] The residual pixels present in the block are replaced with indices according to the palette table, and the indices are encoded and sent to the decoding device. Fig. 27 In the example of (b), in the case of a50 and a62), in addition to the index, separately quantized a50 and a62 are encoded. In addition, the palette table used is also encoded and sent to the decoding device.

[0249] Figures 6 to 26 The embodiments described in the embodiment can also be applied to the encoding / decoding of the palette index and the encoding / decoding of the palette table of the residual pixel.

[0250] exist Figure 3 In the illustrated example, it is described that a quantization area is set based on a pixel having a high frequency, and a pixel in the quantization area is replaced with a pixel having the highest frequency.

[0251] When lossless encoding is applied to the current image, the generation aspect of the palette table may be different from the description. In the example, when lossless encoding is applied to the current image, the process of setting the representative value by using the quantization zone may be omitted. Alternatively, an index may be assigned to each of all pixel values ​​whose frequency is equal to or greater than 1 in the current block. In this case, the maximum number of palette entries may be the number of pixels in the current block.

[0252] In another example, up to N palette entries may be generated based on the frequency of occurrence of pixel values ​​in the current block. Among the N palette entries, (N-1) pixel values ​​with high frequency of occurrence may be encoded using a palette index. For other pixel values, the index corresponding to the escape value and the escape value may be encoded.

[0253] Predefined palette tables in encoders and decoders can be used.

[0254] Fig.28 An example of using a palette table predefined in an encoder and a decoder is shown.

[0255] Fig.28 The palette table shown in is used to encode the residual value, but even in the case where the palette table is used to derive the predicted value or reconstructed value of the sample, the palette table can be pre-stored in the encoder and the decoder.

[0256] In case of using a palette table predefined in the encoder and decoder, it is not necessary to encode the palette table for each block.

[0257] A predefined palette table means that the size of the palette table and / or the pixel values ​​assigned to the palette entries are predefined in the encoder and the decoder.

[0258] After storing a plurality of predefined palette tables, an index specifying one of the plurality of palette tables may be encoded and sent to a decoder.

[0259] Alternatively, after only the pixel value assigned to each palette entry is predefined, only information indicating the order of index assignment between the palette entries may be encoded.

[0260] In the example, where the minimum value of the residual value in the block is -3, index 0 can be assigned to the palette entry whose pixel value is -3, index 1 can be assigned to the palette entry whose pixel value is +4, and index 2 can be assigned to the palette entry whose pixel value is -4.

[0261] Alternatively, the minimum value m in the block may be encoded and sent to the decoding device, and the index of each of the palette entries may be determined based on the minimum value m. In an example, index 0 may be assigned to the same palette entry as the minimum value m, and the indexes may be assigned in an order similar to the minimum value m. In an example, the index assigned to the palette entry having a small difference from the minimum value m may have a value smaller than the index assigned to the palette entry having a large difference from the minimum value m.

[0262] Whether to use a predefined palette table can be determined based on whether lossless encoding is applied. In an example, when lossless encoding is applied, a predefined palette table can be used, and when lossless encoding is not applied, the palette table can be used in the decoder by configuring in the same manner as the encoder.

[0263] Even in the case where the residual value is encoded by using a palette table, a method of configuring the palette table may be set differently depending on whether lossless encoding is applied.

[0264] Generally, lossy coding can go through prediction processing, transformation processing, quantization processing, entropy coding processing and loop filtering processing.

[0265] The error (ie, loss) between the reconstructed data and the original data may be generated by undergoing a quantization process and a loop filtering process among the lossy encoding process.

[0266] Therefore, in lossless coding where the error between the reconstructed data and the original data is not allowed, the quantization process and the loop filtering process can be omitted. In the case where the quantization process is omitted, the transform process of transforming the residual data into the frequency domain components also becomes meaningless, so when lossless coding is applied, not only the quantization process can be omitted, but also the transform process can be further omitted.

[0267] As described above, there is a difference between the encoding process under lossless encoding and the encoding process under lossy encoding. Therefore, information indicating whether lossless encoding is applied can be encoded and sent to the decoder to specify the encoding process applied to encode the image.

[0268] The information may be signaled via a sequence parameter set, a picture parameter set, a picture header, or a slice header. The information may be a 1-bit flag. In the decoder, the flag may be parsed, and whether lossless coding is applied may be determined based on the parsed value.

[0269] In the case where it is determined to apply lossless encoding, the decoder can omit a transform process, a quantization process, and a loop filtering process for decoding an image.

[0270] The decoder can derive a variable LosslessCoding indicating whether lossless coding is used based on the flag. In the example, when the variable LosslessCoding is true, this indicates that lossless coding is applied, and when the variable LosslessCoding is false, this indicates that lossless coding is not applied.

[0271] A variable indicating whether a separate encoding / decoding process is applied may be defined. In the example, a variable indicating whether a transform is performed, a variable indicating whether a quantization is performed, a variable indicating whether a deblocking filter is applied, a variable indicating whether SAO is applied, and a variable indicating whether ALF is applied may be defined as t_skip, q_skip, d_skip, s_skip, a_skip, respectively. When the value of the variable is true, this indicates that the corresponding encoding process is omitted. On the other hand, when the value of the variable is false, this indicates that the corresponding encoding process is not omitted.

[0272] Information for determining the value of each of the variables may be signaled in the bitstream. In an example, a 1-bit flag indicating whether a specific encoding / decoding process is applied may be signaled, and whether a specific encoding / decoding process is applied may be determined by the flag.

[0273] In this case, whether to signal information indicating whether each encoding / decoding process is applied in the bitstream can be determined based on the value of the variable LosslessCoding indicating whether lossless coding is applied. In the example, when the value of the variable LosslessCoding is true, the information indicating whether each encoding / decoding process is applied can be omitted. In this case, the variables t_skip, q_skip, d_skip, s_skip, a_skip can be set to true. In other words, when the value of the variable LosslessCoding is true, the application of transform, quantization, deblocking filter, SAO and ALF can be omitted without referring to the information signaled in the bitstream.

[0274] When the value of the variable LosslessCoding is false, information indicating whether each encoding / decoding process is applied may be signaled in the bitstream. The variables t_skip, q_skip, d_skip, s_skip, a_skip may be determined by the value of a flag indicating whether each encoding / decoding process is applied. In addition, whether the corresponding encoding / decoding process is applied may be determined based on the value of each variable.

[0275] After signaling a flag for determining the value of a variable LosslessCoding, based on the variable LosslessCoding, instead of determining whether to signal a flag for determining whether to apply a separate encoding / decoding process, encoding of the flag indicating whether lossless coding is applied may be omitted, and the variable LosslessCoding may be determined based on variables t_skip, q_skip, d_skip, s_skip, a_skip indicating whether a separate encoding / decoding process is applied.

[0276] In an example, a flag indicating whether each encoding / decoding process is applied may be signaled in the bitstream, and the values ​​of variables t_skip, q_skip, d_skip, s_skip, a_skip may be derived based on each flag. In this case, when the values ​​of variables t_skip, q_skip, d_skip, s_skip, a_skip are all true, the variable LosslessCoding may be set to true. On the other hand, when at least one of the variables t_skip, q_skip, d_skip, s_skip, a_skip is false, the variable LosslessCoding may be set to false.

[0277] In this example, for ease of description, transform, quantization, deblocking filter, SAO, ALF, etc. are shown as encoding / decoding processes that are applied in a manner that varies depending on whether lossless encoding is performed. Without being limited to the described example, a technique that makes lossless encoding impossible, such as LMCS (luminance mapping and chrominance scaling) or the joint_CbCr encoding method, may be associated with whether lossless encoding is applied.

[0278] The syntax used in the above embodiments is named only for the convenience of description.

[0279] When an embodiment described based on a decoding process or an encoding process is applied to an encoding process or a decoding process, it is included in the scope of the present disclosure. When an embodiment described in a predetermined order is changed in an order different from the description, it is also included in the scope of the present disclosure.

[0280] The above-mentioned embodiments are described based on a series of stages or flow charts, but this does not limit the time series order of the present disclosure, and if necessary, the above-mentioned embodiments can be performed simultaneously or in different orders. In addition, each component (e.g., unit, module, etc.) constituting the block diagram in the above-mentioned embodiments can be implemented as a hardware device or software, and a plurality of components can be combined and implemented as a hardware device or software. The above-mentioned embodiments can be recorded in a computer-readable recording medium implemented in the form of a program instruction that can be executed by various computer components. The computer-readable recording medium can include program instructions, data files, data structures, etc., individually or in combination. The hardware device specially configured for storing and executing magnetic media (e.g., hard disk, floppy disk and tape), optical recording media (e.g., CD-ROM, DVD), magneto-optical media (e.g., optical floppy disk) and program instructions (e.g., ROM, RAM, flash memory), etc. is included in the computer-readable recording medium. The hardware device can be configured to operate as one or more software modules to perform the processing according to the present disclosure, and vice versa.

[0281] Industrial Applicability

[0282] The present disclosure may be applied to an electronic device that encodes / decodes an image.

[0283] Furthermore, according to an embodiment of the present disclosure, the following configurations 1-9 are provided.

[0284] 1. A video decoding method, comprising:

[0285] configuring a current palette table based on a previous palette table;

[0286] determining the palette index in pixels in the current block; and

[0287] reconstructing pixels in the current block based on the palette table and the palette index,

[0288] Wherein, in case that the current block is included in a first coding tree unit of a coding tree unit row, the previous palette table is derived from a block above the coding tree unit.

[0289] 2. The method according to configuration 1, wherein the method further comprises: decoding a palette prediction flag, wherein the palette prediction flag indicates whether a palette entry included in the previous palette table is included in the current palette table.

[0290] 3. A method according to configuration 2, wherein the method further comprises: decoding information about remaining palette entries when the number of predicted palette entries used from the previous palette table is less than the size of the current palette table.

[0291] 4. The method according to configuration 1, wherein the palette index of the current block is determined by using at least one of an index mode or a copy mode, and

[0292] The index mode is a mode of notifying palette index information for specifying a palette index of the current block using a signal, and the copy mode is a mode of using palette indexes of adjacent pixels according to a predetermined scanning order.

[0293] 5. A video encoding method, comprising:

[0294] configuring a current palette table based on a previous palette table;

[0295] determining the palette index in pixels in the current block; and

[0296] reconstructing pixels in the current block based on the palette table and the palette index,

[0297] Wherein, in case that the current block is included in a first coding tree unit of a coding tree unit row, the previous palette table is derived from a block above the coding tree unit.

[0298] 6. The method according to configuration 5, wherein the method further comprises: encoding a palette prediction flag, wherein the palette prediction flag indicates whether a palette entry included in the previous palette table is included in the current palette table.

[0299] 7. A method according to configuration 6, wherein the method further comprises: encoding information about remaining palette entries when the number of predicted palette entries used from the previous palette table is less than the size of the current palette table.

[0300] 8. The method according to configuration 5, wherein the palette index of the current block is determined by using at least one of an index mode or a copy mode, and

[0301] The index mode is a mode of notifying palette index information for specifying a palette index of the current block using a signal, and the copy mode is a mode of using palette indexes of adjacent pixels according to a predetermined scanning order.

[0302] 9. A computer-readable recording medium storing a bit stream encoded by a video encoding method, wherein:

[0303] The video encoding method comprises:

[0304] configuring a current palette table based on a previous palette table;

[0305] determining the palette index in pixels in the current block; and

[0306] reconstructing pixels in the current block based on the palette table and the palette index,

[0307] Wherein, in case that the current block is included in a first coding tree unit of a coding tree unit row, the previous palette table is derived from a block above the coding tree unit.

Claims

1. A video decoding method, comprising: Determines whether the palette mode is applied to the current block; configuring a current palette table based on a palette prediction table in a case where the palette mode is applied to the current block; determining a palette index for each pixel in the current block; as well as reconstructing a current pixel in the current block based on the current palette table and a palette index for the current pixel, wherein, in the case where the current block is included in a first coding tree unit of a current coding tree unit row, the palette prediction table is inherited from an upper adjacent coding tree unit adjacent to the first coding tree unit, the upper adjacent coding tree unit being directly adjacent to an upper boundary of the current coding tree unit, and The upper neighboring coding tree unit is included in a coding tree unit row that is processed in parallel with the current coding tree unit row.

2. The method according to claim 1, wherein: The method further includes decoding a palette prediction flag indicating whether a palette entry included in the palette prediction table is reused for the current palette table.

3. The method according to claim 2, wherein: The method further includes, in a case where the number of predicted palette entries derived from the palette prediction table is less than the size of the current palette table, decoding information about the remaining palette entries.

4. The method according to claim 1, wherein: determining a palette index for the current pixel in the current block by using at least one of an index mode or a copy mode, wherein, in the index mode, palette index information for specifying a palette index for the current pixel in the current block is explicitly signaled, and Wherein, in the copy mode, the palette index of the neighboring pixels according to the predetermined scanning order is reused for the current pixel.

5. A video encoding method, comprising: Configure the current palette table based on the palette prediction table; determining a palette index for each pixel in the current block; reconstructing a current pixel in the current block based on the current palette table and the palette index; as well as encoding information indicating whether a palette mode is applied to the current block, wherein, in the case where the current block is included in a first coding tree unit of a current coding tree unit row, the palette prediction table is inherited from an upper adjacent coding tree unit adjacent to the first coding tree unit, the upper adjacent coding tree unit being directly adjacent to an upper boundary of the current coding tree unit, and The upper neighboring coding tree unit is included in a coding tree unit row that is processed in parallel with the current coding tree unit row.

6. The method according to claim 5, wherein: The method further includes encoding a palette prediction flag indicating whether a palette entry included in the palette prediction table is reused for the current palette table.

7. The method according to claim 6, wherein: The method further includes encoding information about remaining palette entries if the number of predicted palette entries derived from the palette prediction table is less than the size of the current palette table.

8. The method according to claim 5, wherein: determining a palette index for the current pixel in the current block by using at least one of an index mode or a copy mode, and wherein, in the index mode, palette index information for specifying a palette index for the current pixel in the current block is explicitly encoded, and Wherein, in the copy mode, neighboring pixels according to a predetermined scanning order are reused for the current pixel.

9. A computer-readable recording medium storing a bit stream encoded by a video encoding method, wherein: The video encoding method comprises: Configure the current palette table based on the palette prediction table; determining a palette index for each pixel in the current block; reconstructing a current pixel in the current block based on the current palette table and the palette index; and encoding information indicating whether a palette mode is applied to the current block, wherein, in the case where the current block is included in a first coding tree unit of a current coding tree unit row, the palette prediction table is inherited from an upper adjacent coding tree unit adjacent to the first coding tree unit, the upper adjacent coding tree unit being directly adjacent to an upper boundary of the current coding tree unit, and The upper neighboring coding tree unit is included in a coding tree unit row that is processed in parallel with the current coding tree unit row.