Encoding method, decoding method, and device using the same
By adapting frequency conversion and scanning methods based on intra-frame prediction modes for chrominance signals, the method optimizes the handling of color difference signals, improving video encoding and decoding efficiency.
Patent Information
- Application Number
- JP2025139206
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2013-04-16
- Filing Date
- 2025-08-22
- Publication Date
- 2025-11-05
- Estimated Expiration
- 2033-04-16
AI Technical Summary
Existing video encoding and decoding technologies face challenges in efficiently handling color difference signals, as human vision sensitivity to brightness and color difference signals requires separate and optimized handling.
The method involves applying different frequency conversion and scanning methods based on the intra-frame prediction mode for chrominance signals, and determining scanning types for both luminance and chrominance signals accordingly.
This approach improves the efficiency of video encoding and decoding by optimizing frequency conversion and scanning for color difference signals, enhancing coding efficiency.
Smart Images

Figure 2025166251000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to video encoding and decoding technology, and more particularly to a method for determining a frequency conversion scheme and / or a scanning scheme for a color difference (chroma) signal, and an apparatus using the same. [Background technology]
[0002] Recently, broadcasting services with HD (High Definition) resolution have been expanding not only in Korea but also around the world. As a result, many users have become accustomed to high-resolution, high-quality images, and many organizations are accelerating the development of next-generation video equipment.
[0003] As interest in HDTV and UHD (Ultra High Definition), which has a resolution four times higher than that of HDTV, grows, a compression technique for higher resolution, higher quality images is required.
[0004] For video compression, pixel information of a current picture can be coded using predictions, such as inter-prediction, which predicts pixel values included in the current picture from previous and / or subsequent pictures, or intra-prediction, which predicts pixel values included in the current picture using pixel information within the current picture.
[0005] Pixel information consists of a luminance signal for brightness (luma) and a color difference signal for color difference (chroma). Taking advantage of the fact that human vision is sensitive to brightness, the luminance signal and color difference signal can be treated differently or the same.
[0006] Therefore, a problem arises as to how to effectively handle the color difference signal and the luminance signal separately. Summary of the Invention [Problem to be solved by the invention]
[0007] The present invention aims to provide a method and apparatus for improving the encoding / decoding efficiency in video encoding / decoding.
[0008] An object of the present invention is to provide an efficient frequency conversion method and apparatus for color difference signals, and an efficient scanning method and apparatus for color difference signals. [Means for solving the problem]
[0009] In one embodiment of the present invention, when selecting a frequency conversion method and a scanning method for a chrominance signal, the frequency conversion method can be applied differently depending on the intra-frame prediction mode of the chrominance signal, and the scanning method can also be determined differently depending on the intra-frame prediction mode.
[0010] In another embodiment of the present invention, a scanning type for the luminance signal and the chrominance signal of the current block may be determined according to an intra prediction mode for the luminance samples of the current block.
[0011] In this case, the scanning type for the color difference signals may be applied in the same manner as the scanning type for the luminance signal, or may be determined in the same manner as the method for determining the scanning type for the luminance signal. [Effects of the Invention]
[0012] According to the present invention, it is possible to improve the efficiency of video encoding / decoding, particularly to efficiently perform frequency conversion and / or scanning on a color difference signal.
[0013] In addition, according to the present invention, when selecting a frequency transform method and a scanning method for a chrominance signal, a frequency transform method for the chrominance signal is applied according to an intra-frame prediction direction mode of the chrominance signal, and a method and apparatus for guiding a scanning direction for the chrominance signal are used, thereby improving the coding efficiency of the residual signal of the chrominance signal. [Brief explanation of the drawings]
[0014] [Figure 1] 1 is a block diagram showing a configuration of an embodiment of a video encoding device to which the present invention is applied. [Figure 2] 1 is a block diagram showing a configuration of an embodiment of a video decoding device to which the present invention is applied; [Figure 3] 1 is a diagram illustrating an example of a method for dividing CUs within an LCU when encoding video. [Figure 4] 1 is a diagram illustrating an example of a divided structure of a PU. [Figure 5] 10 is a diagram simply showing an example of a division structure of TUs within a CU. [Figure 6] 1 is a diagram for explaining an intra-frame prediction mode; [Figure 7] 1 is a diagram for explaining the relationship of Equation 1. [Figure 8] 10 is a diagram illustrating an example of scanning an important group flag and a transform coefficient in a top right direction; [Figure 9] 10 is a flowchart illustrating an example of a method for determining a scanning direction according to a screen prediction direction. [Figure 10] 10 is a flowchart briefly illustrating another example of a method for determining a scanning direction according to a screen prediction direction. [Figure 11] 10 is a flowchart illustrating an example of a method for selecting a frequency transformation scheme for a residual image. [Figure 12] 10 is a flowchart illustrating an example of a method for guiding a scanning direction for a color difference signal according to the present embodiment. [Figure 13]10 is a flowchart illustrating another example of a method for guiding a scanning direction for a color difference signal according to an embodiment of the present invention. [Figure 14] 10 is a flowchart illustrating an embodiment of a method for deriving a scanning direction for a color difference signal according to the present embodiment. [Figure 15] 10 is a flowchart illustrating another example of a method for guiding a scanning direction for a color difference signal according to an embodiment of the present invention. [Figure 16] 10 is a flowchart illustrating an example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode of the chrominance signal according to an embodiment of the present invention. [Figure 17] 10 is a flowchart illustrating another example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode of the chrominance signal according to an embodiment of the present invention. [Figure 18] 10 is a flowchart illustrating a method for selectively deriving a frequency transform mode for a residual image of a chrominance signal according to an intra-frame prediction direction mode of a luminance signal with respect to an LM mode of a chrominance signal, according to an embodiment of the present invention. [Figure 19] 10 is a flowchart illustrating another example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal according to an intra-frame prediction direction mode of a luminance signal for an Intra_FromLuma (LM) coding mode of a chrominance signal according to an embodiment of the present invention. [Figure 20] 10 is a flowchart illustrating an example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode according to an embodiment of the present invention. [Figure 21] 10 is a flowchart illustrating another example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode according to an embodiment of the present invention. [Figure 22] 10 is a diagram illustrating an example of a resolution difference between a luminance block and a chrominance block; [Figure 23] 10 is a diagram illustrating another example of a difference in resolution between a luminance block and a chrominance block; [Figure 24] 10 is a diagram illustrating another example of an encoding device according to the present invention. [Figure 25] 10 is a diagram illustrating another example of a decoding device according to the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0015] Hereinafter, the embodiments of the present invention will be described in detail with reference to the drawings. In describing the embodiments of this specification, if a detailed description of related known configurations or functions is deemed to unnecessarily obscure the gist of this specification, the detailed description will be omitted.
[0016] In this specification, when a component is said to be "coupled" or "connected" to another component, it means that the component is directly coupled or connected to the other component, or that there is another component between them. Furthermore, in this specification, when a component is described as "including" a specific component, it does not exclude components other than the component, but means that additional components may be included within the scope of the implementation or technical idea of the present invention.
[0017] Terms such as "first" and "second" may be used to describe various components, but the components are not limited by these terms. These terms are used to distinguish one component from another. For example, a first component may be called a "second component," and similarly, a second component may be called a "first component" without departing from the scope of the present invention.
[0018] Furthermore, the components disclosed in the embodiments of the present invention are illustrated independently to demonstrate different characteristic functions, and do not mean that each component is configured as a separate hardware or software unit. That is, each component is included as a separate component for convenience of explanation, and at least two of the components may be integrated into one component, or one component may be divided into multiple components to perform its function. Both integrated and separated embodiments of each component are within the scope of the present invention as long as they do not deviate from the essence of the present invention.
[0019] In addition, some components are not essential components for performing essential functions in the present invention, but are optional components merely for improving performance. The present invention may be embodied by including only components essential for embodying the essence of the present invention, excluding components merely used for improving performance, and a structure including only essential components, excluding optional components merely used for improving performance, is also included in the scope of the present invention.
[0020] FIG. 1 is a block diagram showing the configuration of an embodiment of a video encoding device to which the present invention is applied.
[0021] Referring to FIG. 1, the video encoding device 100 includes a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference video buffer 190.
[0022] The video encoding device 100 may output a bitstream by encoding an input image in intra mode or inter mode. Intra prediction refers to intra-frame prediction, and inter prediction refers to inter-frame prediction. In the intra mode, the switch 115 may be switched to intra, and in the inter mode, the switch 115 may be switched to inter. The video encoding device 100 may generate a predicted block for an input block of the input image, and then encode the difference between the input block and the predicted block. In this case, the input image refers to an original picture.
[0023] In the case of the intra mode, the intra prediction unit 120 may generate a predicted block by performing spatial prediction using pixel values of previously coded blocks surrounding the current block.
[0024] In the case of inter mode, the motion prediction unit 111 may obtain a motion vector by searching for an area that best matches the input block in a reference image stored in the reference image buffer 190 during the motion prediction process. The motion compensation unit 112 may generate a predicted block by performing motion compensation using the motion vector. Here, the motion vector is a two-dimensional vector used in inter prediction and may indicate an offset between the current block and a block in the reference image.
[0025] The subtractor 125 may generate a residual block based on the difference between the input block and the generated prediction block. The transform unit 130 may output transform coefficients by performing a transform on the residual block. The quantization unit 140 may output quantized coefficients by quantizing the input transform coefficients using at least one of a quantization parameter and a quantization matrix. In this case, the quantization matrix may be input to an encoder, and it may be determined that the input quantization matrix is to be used in the encoder.
[0026] The entropy encoder 150 may output a bit stream by performing entropy encoding based on values calculated by the quantizer 140 or encoding parameter values calculated during the encoding process. When entropy encoding is applied, fewer bits are assigned to symbols with a high occurrence probability and more bits are assigned to symbols with a low occurrence probability to represent the symbols, thereby reducing the size of a bit string for a symbol to be encoded. Therefore, the compression performance of video encoding may be improved through entropy encoding. The entropy encoder 150 may use encoding methods such as Exponential-Golomb Code, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC) for entropy encoding.
[0027] 1 performs inter-prediction coding, i.e., inter-frame predictive coding, so that a currently coded image needs to be decoded and stored to be used as a reference image. Therefore, the quantized coefficients are inversely quantized by the inverse quantization unit 160 and inversely transformed by the inverse transform unit 170. The inversely quantized and inverse transformed coefficients become a reconstructed residual block, which is added to the predicted block via the adder 175 to generate a reconstructed block.
[0028] The reconstructed block passes through the filter unit 180, which can apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or picture. The filter unit 180 is also called an in-loop filter. The deblocking filter can remove block distortion that occurs at boundaries between blocks. The SAO can add an appropriate offset value to pixel values to compensate for coding errors. The ALF can perform filtering based on a value obtained by comparing a reconstructed image with an original image. The reconstructed block that has passed through the filter unit 180 can be stored in the reference image buffer 190.
[0029] FIG. 2 is a block diagram showing the configuration of an embodiment of a video decoding device to which the present invention is applied.
[0030] Referring to FIG. 2, the video decoding apparatus 200 includes an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference video buffer 270.
[0031] The video decoding apparatus 200 receives a bitstream output from an encoder and performs decoding in an intra mode or an inter mode to output a reconstructed image, i.e., a restored image. In the intra mode, a switch may be switched to intra, and in the inter mode, a switch may be switched to inter. The video decoding apparatus 200 may obtain a reconstructed residual block from the input bitstream, generate a prediction block, and then generate a reconstructed block, i.e., a restored block, by adding the reconstructed residual block and the prediction block.
[0032] The entropy decoding unit 210 may entropy decode the input bitstream according to a probability distribution to generate symbols including symbols in the form of quantized coefficients. The entropy decoding method is the same as the entropy encoding method described above.
[0033] When the entropy decoding method is applied, symbols are represented by assigning fewer bits to symbols with a higher probability of occurrence and more bits to symbols with a lower probability of occurrence, thereby reducing the size of the bit string for each symbol.
[0034] The quantized coefficients are inverse quantized using quantization parameters in the inverse quantization unit 220 and inverse transformed in the inverse transform unit 230, and a reconstructed residual block can be generated as a result of the inverse quantization / inverse transform of the quantized coefficients.
[0035] The quantization matrix used for dequantization is also called a scaling list. The dequantization unit 220 may generate dequantized coefficients by applying the quantization matrix to the quantized coefficients.
[0036] In this case, the inverse quantization unit 220 may perform inverse quantization corresponding to the quantization applied by the encoder. For example, the inverse quantization unit 220 may perform inverse quantization by inversely applying the quantization matrix applied by the encoder to the quantized coefficients.
[0037] The quantization matrix used for inverse quantization in the video decoding apparatus 200 may be received from the bitstream, or a base matrix already stored in the encoder and / or decoder may be used. The transmitted quantization matrix information may be received for each quantization matrix size or each transform block size to which the quantization matrix is applied via a sequence parameter set or a picture parameter set. For example, a 4x4 quantization matrix may be received for a 4x4 transform block, an 8x8 matrix for an 8x8 transform block, a 16x16 matrix for a 16x16 transform block, and a 32x32 matrix for a 32x32 transform block.
[0038] In the intra mode, the intra prediction unit 240 generates a predicted block by performing spatial prediction using pixel values of already decoded blocks surrounding the current block. In the inter mode, the motion compensation unit 250 generates a predicted block by performing motion compensation using a motion vector and a reference image stored in the reference image buffer 270.
[0039] The reconstructed residual block and the prediction block are added via an adder 255, and the added block may pass through a filter unit 260. The filter unit 260 may apply at least one of a deblocking filter, SAO, and ALF to the reconstructed block or the reconstructed picture. The filter unit 260 may output a reconstructed image, i.e., a reconstructed image. The reconstructed image may be stored in a reference image buffer 270 and used for inter prediction.
[0040] In HEVC, in order to efficiently encode video, encoding can be performed for each coding unit (hereinafter referred to as 'CU').
[0041] FIG. 3 briefly illustrates an example of a method for dividing a CU (Largest Coding Unit, hereinafter referred to as 'LCU') when encoding a video.
[0042] An image input to the encoding device may be sequentially divided into LCU units as shown in FIG. 3, and then a division structure may be determined for each LCU.
[0043] The partitioning structure refers to the distribution of CUs for efficiently encoding video within an LCU. The distribution of CUs can be determined by determining whether to divide a CU into four CUs by halving its size vertically and horizontally. The divided CUs can be recursively divided into four CUs by halving their size vertically and horizontally in the same manner.
[0044] In this case, the division of CUs may be performed up to a predefined depth. Depth information indicates the size of a CU and is stored in all CUs. The depth of a basic LCU is 0, and the depth of a smallest coding unit (hereinafter referred to as 'SCU') is a predefined maximum depth.
[0045] Each time an LCU is split in half vertically or horizontally, the depth of the CU increases by 1. At each depth, a CU that is not split has a size of 2N x 2N, and when split is performed, the 2N x 2N CU before splitting is split into four CUs of size N x N.
[0046] The size of a CU is halved every time the depth increases by 1. In FIG. 3, an example is described in which the size of an LCU with a minimum depth of 0 is 64x64 pixels and the size of an SCU with a maximum depth of 3 is 8x8 pixels.
[0047] In the example of Figure 3, a 64x64 pixel CU (LCU) has a depth of 0, a 32x32 pixel CU has a depth of 1, a 16x16 pixel CU has a depth of 2, and an 8x8 pixel CU (SCU) has a depth of 3.
[0048] In addition, information on whether to split a CU is expressed by 1-bit split information for each CU. This split information is included in all CUs except for SCUs, and the value of the split information can be set to 0 if the CU is not split, and 1 if the CU is split.
[0049] A prediction unit (hereinafter referred to as 'PU') is a unit of prediction.
[0050] FIG. 4 is a diagram for explaining an example of a division structure of a PU.
[0051] As shown in the example of FIG. 4, one CU can be divided into multiple PUs for prediction.
[0052] A transform unit (TU) is a basic unit used in spatial transformation and quantization processes within a CU. A TU can have a square or rectangular shape.
[0053] Each CU can have one or more TU blocks, which have a quad-tree structure.
[0054] 5 shows an example of a division structure of TUs in a CU. As shown in the figure, TUs in a CU 510 can have various sizes according to the quadtree structure.
[0055] Intra prediction encoding / decoding can perform predictive encoding according to direction from neighboring blocks of a current block.
[0056] Intra-frame prediction has a total of 36 prediction modes, including 33 directional prediction modes and 3 non-directional prediction modes, for encoding / decoding.
[0057] FIG. 6 is a diagram for explaining an outline of intra-frame prediction modes.
[0058] Among the 36 intra-frame prediction direction modes, there are three non-directional modes: a planar mode (Planar; Intra_Planar), an average mode (DC; Intra_DC), and a mode that predicts a color difference signal from a restored luminance signal (LM; Intra_FromLuma). Intra-frame prediction can use all three non-directional modes, or only some of them. For example, only the planar mode and the average mode are used, and the LM mode is not used.
[0059] Encoding for 36 intra-picture prediction direction modes can be applied to the luminance signal and the chrominance signal, respectively. For the luminance signal, the LM mode can be excluded, and for the chrominance signal, encoding for the intra-picture prediction direction mode can be performed in three ways as shown in Table 1.
[0060] [Table 1]
[0061] In Table 1, the first is a derived mode (DM) that directly applies the intra prediction direction mode of the luminance signal to the intra prediction direction mode of the chrominance signal, and the second is an explicit mode (EM) that applies the actual intra prediction direction mode. The intra prediction direction modes of the chrominance signal coded in EM mode include planar mode (Planar), average mode (DC), horizontal mode (Hor), vertical mode (Ver), and the 8th mode in the vertical direction (Ver+8 or 34th mode). Finally, there is LM mode that predicts the chrominance signal from the restored luminance signal.
[0062] The most efficient encoding / decoding method can be selected from these three modes.
[0063] A method (Intra_FromLuma) of predicting a chrominance signal from a luminance signal sample restored by a method of predicting and encoding / decoding a chrominance signal can also be used. This technique utilizes a linear correlation between the chrominance signal and the luminance signal. An example of the linear correlation used here is shown in Equation 1.
[0064]
number
[0065] FIG. 7 is a diagram for explaining the relationship of Equation 1.
[0066] Pred in Equation 1 c [x,y] means the predicted value of the color difference (chroma) signal in Figure 7(a), and Rec L [x, y] represents a value calculated using Equation 2 for the luminance (luma) signal to match the 4:2:0 sampling ratio of the color difference signal.
[0067]
number
[0068] In Equation 2, the α and β values indicate a weighting value (α) and a compensation value (β) between the downsampled luminance signal and the downsampled color difference signal.
[0069] By using the predicted image for the color difference signal obtained through Equations 1 and 2, a differential image, which is the difference from the original image, can be generated.
[0070] The residual image is entropy coded through frequency domain transformation and quantization, which can be an integer transform, an integer discrete cosine transform (DCT), an integer discrete sine transform (DST), or a DCT / DST depending on the intra-frame prediction mode.
[0071] As described above, the differential image between the original image and the predicted image can be entropy coded after undergoing frequency domain transformation and quantization. In this case, to improve the efficiency of the entropy coding, the coefficients of the quantized image in a two-dimensional form can be rearranged into a one-dimensional form.
[0072] In contrast to the conventional zigzag scanning method, the present specification may use an up-right scanning method for the quantized coefficients, which is not a zigzag scanning method. In addition, the frequency domain transform may be an integer transform, an integer discrete cosine transform (DCT), an integer discrete sine transform (DST), or an intra-frame prediction mode-dependent DCT / DST.
[0073] The quantized coefficients for any block can be coded / decoded by dividing them into groups of 4x4 sub-blocks.
[0074] FIG. 8 is a diagram illustrating an example of scanning the important group flag and transform coefficients in the upper right direction.
[0075] FIG. 8 shows an example in which a 16×16 block is divided into 16 4×4 sub-blocks and coded.
[0076] FIG. 8(a) shows the basic method of scanning, and FIG. 8(b) simply shows an example of scanning actual quantized coefficients and the results thereof.
[0077] Whether a transform coefficient exists in each sub-block during decoding can be confirmed through significant_coeff_group_flag (sigGrpFlag) parsed from the bitstream. If significant_coeff_group_flag is '1', it means that at least one quantized transform coefficient exists in the 4x4 sub-block, while if significant_coeff_group_flag is '0', it means that no quantized transform coefficient exists in the 4x4 sub-block. In Figure 8, the scanning direction for the 4x4 sub-block and the scanning direction for significant_coeff_group_flag are both basically up-right scanning directions.
[0078] Although it has been described in FIG. 8 that the scanning method from the upper right direction is applied, there are other scanning methods for the quantized coefficients, such as the upper right direction (Up-right), horizontal direction, and vertical direction (Vertical).
[0079] In inter-frame prediction, the up-right scanning method can basically be used, and in intra-frame prediction, the up-right, horizontal, or vertical scanning method can be selectively used.
[0080] In intra prediction, the scanning direction can be selected differently depending on the intra prediction direction, and can be applied to both the luminance signal and the chrominance signal.
[0081] Table 2 explains an example of how to determine the scanning direction according to the screen prediction direction.
[0082] [Table 2]
[0083] In Table 2, "IntraPredModeValue" means an intra prediction direction, and corresponds to the IntraPredMode value for luminance signals and the IntraPredModeC value for chrominance signals. Also, "log2TrafoSize" means the size of the current transform block expressed using 'log'.
[0084] For example, IntraPredModeValue of '1' means "Intra_DC" mode, and "log2TrafoSize-2" of '1' means 8x8 blocks.
[0085] In addition, in Table 2, the numbers 0, 1, and 2 determined by IntraPredModeValue and log2TrafoSize specify the scan direction. For example, in Table 2, 2 indicates the upper right scan direction (Up-right), 1 indicates the horizontal scan direction (Horizontal), and 2 indicates the vertical scan direction (Vertical).
[0086] FIG. 9 is a flowchart illustrating an example of a method for determining a scanning direction based on a screen prediction direction.
[0087] 9, IntraPredMode means an intra-frame prediction direction mode for a luminance signal, and IntraPredModeC means an intra-frame prediction direction mode for a chrominance signal. IntraPredMode(C) may be a luminance signal or a chrominance signal depending on the signal component. ScanType means a residual signal scanning direction, and includes an upper right direction (DIAG; Up-right=0), a horizontal direction (HOR; Horizontal=1), and a vertical direction (VER; Vertical=2).
[0088] The example of Fig. 9 can be implemented in an encoder device and a decoder device, or can be implemented in a predetermined module within the encoder device and the decoder device.
[0089] FIG. 10 is a flowchart briefly illustrating another example of a method for determining a scanning direction according to a screen prediction direction.
[0090] In the example of Figure 10, the scanning method for the luminance signal and the scanning method for the chrominance signal are expressed as different methods. In the figure, an index is an indicator indicating the magnitude of transformation, and the index value according to each transformation magnitude can be calculated as follows:
[0091] If the transformation size is 64x64, Index=1; if the transformation size is 32x32, Index=2; if the transformation size is 16x16, Index=3; if the transformation size is 8x8, Index=4; if the transformation size is 4x4, Index=5; and if the transformation size is 2x2, Index=6.
[0092] Therefore, it can be seen from the diagram that scanning according to the intra-frame prediction direction is applied to the 8x8 transform size and the 4x4 transform size for the luminance signal, and is applied only to the smallest transform size, 4x4, for the chrominance signal. Also, when scanning according to the intra-frame prediction direction is not applied, all upper right direction (DIAG; Up-right=0) scanning can be applied.
[0093] In intra prediction, the scanning direction obtained from Table 2 for encoding the quantized coefficients can be used as the scanning direction for the 4x4 sub-block and the scanning direction for significant_coeff_group_flag, such as 8.
[0094] As described above, in the encoding process, a residual image (a difference image between an original image and a predicted image) undergoes frequency domain transformation and quantization, and then is entropy coded. In this case, to improve the efficiency of coding by frequency domain transformation, an integer transform, an integer discrete cosine transform (DCT), an integer discrete sine transform (DST), or an intra-frame prediction mode-dependent DCT / DST can be selectively or adaptively applied depending on the block size.
[0095] In addition, in the decoding process, residual images are decoded through entropy decoding, inverse quantization, and inverse frequency domain transform. In this case, an inverse integer transform, an integer discrete cosine transform, an integer discrete sine transform, or an intra-frame prediction mode-dependent DCT / DST can be selectively or adaptively used depending on the block size.
[0096] FIG. 11 is a flowchart illustrating an example of a method for selecting a frequency transformation scheme for a residual image.
[0097] First, if the current block is coded using intra-picture coding (Intra) and is not a luminance (Luma) block, the frequency transform method for the residual image of the luminance signal and chrominance signal of the current block is an integer transform or an integer discrete cosine transform (DCT).
[0098] Otherwise (if the current block is coded by intra coding (Intra) and is a luminance (Luma) block), the intra prediction direction mode (IntraPredMode) for the luminance signal of the current block is obtained.
[0099] Next, it is checked whether the current block is a 4x4 block (iWidth = 4). If the current block is not a 4x4 block (iWidth = 4), the frequency transform method for the residual image of the luminance signal and chrominance signal of the current block is an integer transform or an integer discrete cosine transform (DCT).
[0100] Otherwise (if the current block is a 4x4 block (iWidth==4)), the intra prediction direction mode of the current block is checked.
[0101] If the intra-frame prediction direction mode of the current block is greater than '2' and less than '10', the frequency transform method for the luminance signal of the current block is to apply an integer discrete sine transform (DST) in the horizontal direction and an integer discrete cosine transform (DCT) in the vertical direction.
[0102] The frequency transform method for the color difference signal of the current block performs integer discrete cosine transform (DCT) in both the horizontal and vertical directions.
[0103] On the other hand, if the intra-frame prediction direction mode of the current block is '0' or is greater than '11' and less than '25', the integer discrete sine transform (DST) is applied in both the horizontal and vertical directions as the frequency transform method for the luminance signal of the current block.
[0104] The frequency transform method for the color difference signal of the current block performs an integer discrete cosine transform (DCT) in both the horizontal and vertical directions.
[0105] On the other hand, if the intra-screen prediction direction mode of the current block is greater than '26' and less than '34', the frequency transform method for the luminance signal of the current block is to apply an integer discrete cosine transform (DCT) in the horizontal direction and an integer discrete sine transform (DST) in the vertical direction.
[0106] The frequency transform method for the color difference signal of the current block performs an integer discrete cosine transform (DCT) in both the horizontal and vertical directions.
[0107] Otherwise, an integer discrete cosine transform (DCT) is applied to the residual images of the luminance and chrominance signals of the current block in both the horizontal and vertical directions as a frequency transform method.
[0108] In FIG. 11, iWidth is an indicator indicating the size of the transformation, and the iWidth value according to each transformation size can be calculated as follows:
[0109] If the transformation size is 64x64, iWidth = 64; if the transformation size is 32x32, iWidth = 32; if the transformation size is 16x16, iWidth = 16; if the transformation size is 8x8, iWidth = 8; if the transformation size is 4x4, iWidth = 4; if the transformation size is 2x2, iWidth = 2.
[0110] With reference to FIG. 11, the transformation process for scaled transform coefficients is as follows.
[0111] Transformation process for scaled transform coefficients
[0112] The input here is as follows:
[0113] -Width of current transformation block Width:nW
[0114] -Current conversion block height: nH
[0115] -element ij Array of scaled transform coefficients having the following structure: (nW × nH) array d
[0116] - Index for the luminance signal and chrominance signal of the current block: cIdx
[0117] If cIdx is '0', it means the luminance signal, if cIdx is '1' or '2' it means the color difference signal, if cIdx is '1' it means the color difference signal Cb, if cIdx is '2' it means the color difference signal Cr.
[0118] The output here is as follows:
[0119] - Array for the residual signal obtained by inversely transforming the scaled transform coefficients: (nW × nH) array (array) r
[0120] If the coding mode (PredMode) for the current block is the intra prediction mode (Intra), and the Log2(nW*nH) value is '4' and the cIdx value is '0', the variables horizTrType and vertTrType are calculated according to the intra prediction direction mode of the luminance signal according to Table 3 below. Otherwise, the variables horizTrType and vertTrType are set to '0'.
[0121] [Table 3]
[0122] This function performs an inverse transform process on the scaled transform coefficients using the horizTrType and vertTrType variables. First, it receives the current block size (nW, nH), the scaled transform coefficient array (nW×nH array d), and the horizTrType variable, performs a 1D inverse transform in the horizontal direction, and outputs the array (nW×nH array e).
[0123] Next, the array (nW×nH array e) is input and the array (nW×nH array g) is derived as shown in Equation 3.
[0124]
number
[0125] Next, the size (nW, nH) and array (nW×nH array g) of the current block and the variable vertTrType are input to perform a one-dimensional inverse transformation in the vertical direction.
[0126] Next, the array (nW×nH array r) for the residual signal is set by cIdx as shown in Equation 4.
[0127]
number
[0128] Here, 'shift' is '0', shift=20-BitDepth Y otherwise, shift=20-BitDepth C BitDepth has a value, and BitDepth means the number of bits of a sample for the current image (for example, 8 bits).
[0129] As described above, it is also possible to use a method (Intra_FromLuma) of predicting a color difference signal from a luminance signal sample restored by a method of predicting a color difference signal.
[0130] The residual signal (error signal) for the chrominance component coded using the Intra_FromLuma method is basically scanned in the upper right direction (Up-right=0) and coded, since there is no in-screen direction mode.
[0131] However, since the Intra_FromLuma method utilizes the similarity between the luminance signal and the chrominance signal, the residual signal for the chrominance signal obtained by the Intra_FromLuma method is likely to have characteristics similar to those of the luminance signal. By utilizing such characteristics, the coding efficiency of the residual signal for the chrominance signal can be improved.
[0132] In addition, for 4x4 luminance signal blocks, the integer discrete cosine transform (DCT) and integer discrete sine transform (DST) are applied differently in the horizontal and vertical directions depending on the intra-frame prediction direction mode of the luminance signal, improving coding efficiency.In contrast, only the integer discrete cosine transform (DCT) is used for conventional 4x4 chrominance signal blocks.
[0133] The characteristics of the chrominance residual image may be similar to those of the luminance residual image, so that the selective frequency transform method based on the intra-frame prediction direction mode applied to the luminance residual image can be applied to the chrominance residual image to improve coding efficiency.
[0134] In addition, the method of predicting a chrominance signal from a luminance signal sample restored by a chrominance signal prediction method (Intra_FromLuma) utilizes the similarity between the luminance signal and the chrominance signal, so that the residual signal for the chrominance signal obtained by the Intra_FromLuma method is likely to have similar characteristics to the residual signal for the luminance signal. By utilizing this characteristic, a selective frequency transform method for the residual signal of the chrominance signal can be used to improve coding efficiency.
[0135] In this way, the Intra_FromLuma method is an intra prediction method that utilizes the similarity between the luminance signal and the chrominance signal. By utilizing the similarity between the luminance signal and the chrominance signal, the scanning direction for the residual signal of the chrominance signal can be derived from the intra prediction direction of the luminance signal.
[0136] Hereinafter, a method and apparatus for guiding a scanning direction for a color difference signal will be described in detail.
[0137] [Embodiment 1] Method and apparatus for guiding the scanning direction for a color difference signal to the intra-frame prediction direction mode for a luminance signal
[0138] FIG. 12 is a flowchart illustrating an example of a method for guiding a scanning direction for a color difference signal according to this embodiment.
[0139] In the example of Figure 12, the scanning direction for the chrominance signal may be determined based on the intra-frame prediction direction mode of the luminance signal. That is, the scanning direction for the luminance signal may be directly applied to the chrominance signal. Therefore, since no calculation is required to determine the scanning direction for the chrominance signal, there is a complexity reduction effect.
[0140] The operations of FIG. 12 can be performed by the encoding apparatus of FIG. 1 and the decoding apparatus of FIG.
[0141] 12, it is determined whether the luma component of the current block is intra-predicted (S1210). If the current block is not intra-predicted (if it is inter-predicted), scanning is performed from the top right to the bottom on the chroma and luma components of the current block (S1260). That is, the scan type for both the luma component and the chroma component of the current block is from the top right to the bottom.
[0142] The luminance component of the current block is intra-predicted, and it is determined whether the intra prediction mode for the luminance component of the current block is between 6 and 14 (S1220). That is, it is determined whether the intra prediction mode for the luminance component of the current block is a horizontal intra prediction mode or a near-horizontal intra prediction mode (S1220).
[0143] If the intra prediction mode for the luma component of the current block is between 6 and 14, vertical scanning is performed on the luma component and chroma component of the current block (S1240). That is, the scan type for the luma component and the scan type for the chroma component of the current block are both vertical scans.
[0144] If the luminance component of the current block is intra-predicted and the intra prediction mode for the luminance component of the current block is not between 6 and 14, it is determined whether the intra prediction mode for the luminance component of the current block is between 22 and 30 (S1230). That is, it is determined whether the intra prediction mode for the luminance component of the current block is a vertical intra prediction mode or a near-vertical intra prediction mode.
[0145] If the intra prediction mode for the luma component of the current block is between 22 and 30, horizontal scanning is performed on the luma component and chroma component of the current block (S1250). That is, the scan type for the luma component and the scan type for the chroma component of the current block are both horizontal scans.
[0146] If the luminance component of the current block is intra-predicted, but the intra-prediction mode for the luminance component of the current block is neither 6 to 14 nor 22 to 30, a scan from the top right is applied to the luminance component and chrominance component of the current block (S1260).
[0147] 13 is a flowchart illustrating another example of a method for guiding a scanning direction for a color difference signal according to this embodiment. The example of FIG. 13 provides the effect of unifying the scanning method for the luminance signal and the scanning method for the color difference signal.
[0148] The operations of FIG. 13 can be performed in the encoding device of FIG. 1 and the decoding device of FIG.
[0149] Referring to FIG. 13, first, it is determined whether the current block is intra-predicted (S1310).
[0150] If intra prediction is not performed, the luminance and chrominance signals of the current block are scanned from the top right (S1390).
[0151] If the current block is intra-predicted, the size of the current block is converted into an index (S1320). For example, an index specifying the size of the current block can be set.
[0152] Next, information on the intra prediction mode of the current block, IntraPredMode, may be obtained (S1330). Information IntraPredMode indicating the intra prediction mode for the current block may be obtained based on FIG.
[0153] It is determined whether the index set for the current block in step S1320 is greater than 3 and less than 6 (S1340). If the index for the current block is not greater than 3 and less than 6, scanning from the top right is applied to the luminance signal and chrominance signal of the current block (S1390).
[0154] If the index for the current block is greater than 3 and less than 6, it is determined whether the intra prediction mode for the chrominance signal of the current block is between 6 and 14 (S1350). If the intra prediction mode for the chrominance signal of the current block is between 6 and 14 (S1370), vertical scanning is applied to the chrominance signal of the current block.
[0155] If the intra prediction mode for the chrominance signal of the current block is not between 6 and 14, it is determined whether the intra prediction mode for the chrominance signal of the current block is between 22 and 30 (S1360). If the intra prediction mode for the chrominance signal of the current block is between 22 and 30, horizontal scanning is applied to the chrominance signal of the current block (S1380).
[0156] If the intra prediction mode for the chrominance signal of the current block is neither 6 to 14 nor 22 to 30, scanning from the top right to the bottom is applied to the chrominance signal of the current block (S1390).
[0157] Unlike the example of Figure 12, the example of Figure 13 determines the scan type by determining the intra-screen prediction mode for the chrominance signal of the current block, but as in the case of Figure 12, the scanning methods for the chrominance signal and luminance signal are determined by the same method.
[0158] 13 can be equally applied to scanning of a luminance signal. In steps S1350 and S1360, the reason for using parentheses to indicate IntraPredMode(C) is that for a luminance signal, an intra prediction mode for the luminance signal can be determined and applied via IntraPredMode, and for a chrominance signal, an intra prediction mode for the chrominance signal can be determined and applied via IntraPredModeC.
[0159] 13 can be equally applied to the luminance signal and the chrominance signal, and the scanning type for the luminance signal and the scanning type for the chrominance signal can be determined in the same manner, where the scanning type is one of vertical scanning, horizontal scanning, and top right scanning.
[0160] 12 and 13 are reflected in the syntax structure of a transform unit (TU), as shown in Table 4.
[0161] Table 4 shows an example of the TU syntax according to the first embodiment.
[0162] [Table 4]
[0163] Here, Transform_unit refers to the bitstream order for one TU block, log2TrafoSize refers to the result of right-shifting the sum of input log2TrafoWidth and log2TrafoHeight, and refers to the size of a TU block for a luminance signal, and log2TrafoSizeC refers to the size of a TU block for a chrominance signal.
[0164] PredMode indicates the coding mode for the current block, and is 'Intra' for intra-picture coding and 'Inter' for inter-picture coding. scanIdx indicates scanning direction information for the luminance signal of the current TU block, and can be up-right (DIAG; Up-right=0), horizontal (HOR; Horizontal=1), or vertical (VER; Vertical=2).
[0165] scanIdxC indicates scanning direction information for the chrominance signal of the current TU block, and includes the upper right direction (DIAG; Up-right=0), horizontal direction (HOR; Horizontal=1), and vertical direction (VER; Vertical=2).
[0166] The ScanType is determined based on Table 2, which shows how to determine the scanning direction according to the screen prediction direction.
[0167] IntraPredMode means intra-picture prediction direction information for a luminance signal, and IntraPredModeC means intra-picture prediction direction information for a chrominance signal.
[0168] With reference to Table 4, the transform coefficient level can be parsed into a transCoeffLevel array. In this case, if PredMode is Intra, different scanning directions are applied depending on the intra-frame prediction direction mode. Such scanning directions can be obtained from the ScanType array in Table 2.
[0169] The scanning direction of the color difference signal can be the same as the scanning direction of the luminance signal.
[0170] [Example 2-1] Method and apparatus for directly using the scanning direction of the luminance signal for the chrominance signal when the intra-picture prediction direction mode of the chrominance signal is "Intra_FromLuma"
[0171] FIG. 14 is a flowchart illustrating an embodiment of a method for deriving a scanning direction for a color difference signal according to this embodiment.
[0172] 14, it is determined whether the intra prediction direction mode of the chrominance signal of the current block is the intra prediction mode (S1410). If the intra prediction mode is not applied, scanning from the top right direction is applied to the current block.
[0173] If the current block is intra predicted, it is determined whether the intra prediction mode for the chrominance signal of the current block is Intra_FromLuma (S1420). If the intra prediction mode for the chrominance signal of the current block is Intra_FromLuma, the intra prediction mode for the luminance signal of the current block is set to the intra prediction mode for the chrominance signal of the current block (S1440).
[0174] That is, when the intra prediction mode for the chrominance signal of the current block is "Intra_FromLuma", the intra prediction direction mode of the luminance signal can be input to the intra prediction direction mode of the chrominance signal to guide the scanning direction for the chrominance signal. That is, when the intra prediction direction mode of the chrominance signal is "Intra_FromLuma", the scanning direction of the luminance signal can be used as is.
[0175] Next, it is determined whether the intra prediction mode for the chrominance signal of the current block is between 6 and 14 (S1430). If the intra prediction mode for the chrominance signal of the current block is between 6 and 14 (S1460), vertical scanning is applied to the chrominance signal of the current block.
[0176] If the intra prediction mode for the chrominance signal of the current block is not between 6 and 14, it is determined whether the intra prediction mode for the chrominance signal of the current block is between 22 and 30 (S1450). If the intra prediction mode for the chrominance signal of the current block is between 22 and 30, horizontal scanning is applied to the chrominance signal of the current block (S1470).
[0177] If the intra prediction mode for the chrominance signal of the current block is neither 6 to 14 nor 22 to 30, scanning from the top right to the bottom is applied to the chrominance signal of the current block (S1480).
[0178] [Example 2-2] Method and apparatus for using the scanning direction of the luminance signal for the chrominance signal as is when the intra-prediction direction of the chrominance signal is the same as the intra-prediction direction of the luminance signal, or when the intra-prediction mode of the chrominance signal is "Intra_FromLuma" mode
[0179] FIG. 15 is a flowchart illustrating an embodiment of a method for guiding a scanning direction for a color difference signal according to this embodiment.
[0180] Referring to Figure 15, it can be seen that the DM (meaning a method in which the intra prediction direction mode of the luminance signal is used as the intra prediction direction mode of the chrominance signal, or the intra prediction direction of the chrominance signal is the same as the intra prediction direction of the luminance signal) and LM (Intra_FromLuma) methods are unified into one.
[0181] First, it is determined whether the current block is intra-predicted (S1505). If it is not intra-predicted, scanning from the top right to the bottom is applied to the current block (S1575).
[0182] If the current block is intra-predicted, the width of the current block is converted into an index (S1510).
[0183] It is determined whether the sample to be determined is a luminance signal (S1515). If it is not a luminance signal, it is determined whether DM or LM is applied to the current block (S1530). If the sample to be determined is a luminance signal, information indicating an intra prediction mode is obtained (S1520).
[0184] When the present invention is applied to a case where intra-frame coding or decoding of a color difference signal is restricted to be performed using only DM mode without using LM mode due to profiling depending on the application field, in the example of Figure 15, when applying step S1530, it is also possible to determine only whether DN is applied without determining whether LM is applied.
[0185] When the target is a luminance signal, if the index is greater than 3 and less than 6 in S1525 (i.e., the transform size is 8x8 or 4x4), it is determined whether the intra prediction mode for the luminance signal of the current block is between 6 and 14 (S1555). If the intra prediction mode for the luminance signal of the current block is between 6 and 14 (S1565), vertical scanning is applied to the luminance signal of the current block.
[0186] Also, it is determined whether the intra prediction mode for the luminance signal of the current block is between 22 and 30 (S1560), and a horizontal scan is applied (S1570), or a top-right scan is applied (S1575).
[0187] On the other hand, if the target is a chrominance signal, it is determined whether the mode of the current block is DM or LM (S1530). If the mode of the chrominance signal of the current block is not DM or LM, information indicating the intra prediction mode for the chrominance signal is obtained (S1545). If the mode is DM or LM, information indicating the intra prediction mode for the luminance signal is obtained (S1535), and then the intra prediction mode for the chrominance signal is set to the intra prediction mode for the luminance signal to determine the scanning direction of the chrominance signal (S1540).
[0188] Next, it is determined whether the index is greater than 4 and less than 7 (i.e., whether the transform size is 4x4 or 2x2) (S1550). If the index is not greater than 4 and less than 7, a top-right scan is applied to the chrominance signal of the current block (S1575).
[0189] If the index is greater than 4 and less than 7, it is determined whether the intra prediction mode for the chrominance signal of the current block is between 6 and 14 (S1555). If the intra prediction mode for the chrominance signal of the current block is between 6 and 14 (S1565), vertical scanning is applied to the chrominance signal of the current block.
[0190] Also, it is determined whether the intra prediction mode for the chrominance signal of the current block is between 22 and 30 (S1560), and a horizontal scan is applied (S1570), or a top right scan is applied (S1575).
[0191] 14 and 15 are reflected in the syntax structure of a transform unit (TU), as shown in Table 5.
[0192] Table 5 shows an example of the TU syntax according to the first embodiment.
[0193] [Table 5]
[0194] Here, Transform_unit means the bitstream order for one TU block, and log2TrafoSize means the result of right-shifting the sum of input log2TrafoWidth and log2TrafoHeight, and means the size of the TU block for the luminance signal.
[0195] log2TrafoSizeC means the TU block size for the color difference signal. PredMode indicates the coding mode for the current block, and is 'Intra' for intra-picture coding and 'Inter' for inter-picture coding.
[0196] scanIdx indicates scanning direction information for the luminance signal of the current TU block, and includes the upper right direction (DIAG; Up-right=0), horizontal direction (HOR; Horizontal=1), and vertical direction (VER; Vertical=2).
[0197] scanIdxC indicates scanning direction information for the chrominance signal of the current TU block, and includes the upper right direction (DIAG; Up-right=0), horizontal direction (HOR; Horizontal=1), and vertical direction (VER; Vertical=2).
[0198] ScanType can be determined based on the method of determining the scanning direction according to the predicted direction in Table 2.
[0199] IntraPredMode means intra prediction direction information for a luminance signal, and IntraPredModeC means intra prediction direction information for a chrominance signal. As shown in the syntax table, if the value of IntraPredModeC is Intra_FromLuma, the scanning direction used for the luminance signal is applied to the chrominance signal as is.
[0200] With reference to Table 5, the transform coefficient level is parsed into a transCoeffLevel array. At this time, when PredMode is Intra, different scanning directions are applied depending on the intra prediction direction mode. Such scanning directions can be obtained from the ScanType array in the following table. When obtaining scanIdx, which is a scanning direction indicator for the luminance signal, the IntraPredMode value indicating the luminance signal intra prediction mode is used as the IntraPredModeValue value in the following table. When obtaining scanIdxC, which is a scanning direction indicator for the chrominance signal, the IntraPredModeC value indicating the chrominance signal intra prediction mode is used as the IntraPredModeValue value in Table 6.
[0201] Table 6 shows an example of how the scan type is determined.
[0202] [Table 6]
[0203] In Table 6, the scan type ScanType can be determined by log2TrafoSize and IntraPredModeValue as follows: ScanType[log2TrafoSize-2][IntraPredModeValue]
[0204] As described above, the transform coefficient levels are parsed into a transCoeffLevel array. At this time, if PredMode is 'Intra', different scanning directions are applied depending on the intra prediction direction mode.
[0205] In this case, ScanType[log2TrafoSize-2][IntraPredModeValue] can be set according to the syntax of Table 7 depending on the size of the luminance signal transform block (log2TrafoSize) and the intra prediction direction mode (IntraPredModeValue).
[0206] [Table 7]
[0207] When attempting to obtain scanIdx, which is a scanning direction indicator for the luminance signal, the IntraPredMode value indicating the intra-frame prediction mode of the luminance signal is used as the IntraPredModeValue value in Table 2, and when attempting to obtain scanIdxC, which is a scanning direction indicator for the chrominance signal, the IntraPredModeC value indicating the intra-frame prediction mode of the chrominance signal is used as the IntraPredModeValue value in Table 2.
[0208] This embodiment can be applied not only when the current chrominance block is coded in the "Intra_FromLuma" mode, but also in the following cases.
[0209] 1. In predicting a chrominance block, this embodiment can be applied to all methods in which a weight is applied to a restored luminance signal block and then an offset is added.
[0210] 2. In predicting a chrominance block, a template shift for the restored luminance signal block and the chrominance signal block is used, so that this embodiment can be applied to all methods of predicting a chrominance block. Here, the template shift is used to infer the correlation between the luminance signal and the chrominance signal.
[0211] In addition, this embodiment can be applied in various ways.
[0212] For example, this embodiment may vary the application range depending on the block size, CU depth, TU depth, etc. The variable (i.e., size or depth information) that determines the application range may be set so that the encoder and decoder use a predetermined value, or may use a value determined according to a profile or level. If the encoder writes the variable value in the bitstream, the decoder may obtain and use this value from the bitstream.
[0213] When the application range is varied depending on the CU depth, one of the following three methods can be applied, as shown in Table 8: Method A) A method that applies only to depths greater than or equal to a given depth, Method B) A method that applies only to depths less than a given depth, and Method C) A method that applies only to a given depth.
[0214] Table 8 shows an example of a method for determining the range to which each method of this embodiment is applied when the depth of a given CU (or TU) is 2. In Table 8, O indicates that the method is applied to the depth, and X indicates that the method is not applied to the depth.
[0215] [Table 8]
[0216] If the method of the present invention is not to be applied to all depths, this can be indicated using any indicator (flag), or it can be expressed by signaling a value one greater than the maximum value of the CU depth as a CU depth value indicating the range of application.
[0217] It should also be noted that the above-described method for determining the range of application of the method of the present invention can be applied to the above-described Example 1 and the following Examples, respectively, or in combination.
[0218] [Embodiment 3] Method and apparatus for selectively deriving a frequency conversion method for residual images of chrominance signals according to intra-frame prediction direction mode of chrominance signals
[0219] In this embodiment, the selective frequency transform method according to the intra-frame prediction direction mode applied to the residual image of the luminance signal is also applied to the residual image of the chrominance signal, thereby improving the coding efficiency.
[0220] In addition, in this embodiment, the residual signal for the color difference signal obtained by the Intra_FromLuma method can be selectively frequency-converted by utilizing the property that the residual signal for the luminance signal has similar characteristics.
[0221] FIG. 16 is a flowchart illustrating an example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode of the chrominance signal according to an embodiment of the present invention.
[0222] Referring to FIG. 16, first, if the current block is coded using intra coding (Intra) and is a block of 4x4 size (trafoSize (or iWidth) == 4) (S1605), the frequency transform method for the current block is an integer discrete sine transform (DST) or integer discrete cosine transform (DCT). Otherwise (S1605), the frequency transform method for the current block can be a DCT (S1660).
[0223] Next, if the current block is a luminance block (S1610), an intra prediction direction mode (IntraPredMode) for the luminance signal is obtained (S1620). Here, the intra prediction direction mode for the luminance signal of the current block can be used to guide the frequency transform method of the residual image for the luminance signal.
[0224] If it is a chrominance block (S1610), it is determined whether the mode is DM (S1615).
[0225] If the current block is a chrominance block and a DM block, DCT can be applied (S1660). On the other hand, if the current block is a chrominance block and not a DM block, the intra prediction direction mode for the chrominance signal can be used to guide the frequency transform method of the residual image for the chrominance signal (S1625).
[0226] Here, when a chrominance block is coded in DM mode, the intra-frame prediction direction mode corresponding to EM mode (Planar mode, Average mode (DC), Horizontal mode (Hor), Vertical mode (Ver), and the 8th mode in the vertical direction (Ver+8 or 34th mode)) among the DM modes can apply DST, DCT, or other frequency transform methods.
[0227] Next, if the intra-frame prediction direction mode of the current block (luminance and chrominance signal block) is greater than '2' and less than '10' (S1620), the frequency transform method for the current block (luminance and chrominance signal block) can be an integer discrete sine transform (DST) applied horizontally and an integer discrete cosine transform (DCT) applied vertically (S1645).
[0228] On the other hand, if the intra-picture prediction direction mode of the current block (luminance and chrominance signal block) is '0' (Planar) or is greater than '11' and less than '25' (S1635), integer discrete sine transform (DST) can be applied in both the horizontal and vertical directions as the frequency transform method for the current block (luminance and chrominance signal block) (S1650).
[0229] Also, if the intra-picture prediction direction mode of the current block (luminance and chrominance signal block) is greater than '26' and less than '34' (S1640), the frequency transform method for the current block (luminance and chrominance signal block) can be an integer discrete cosine transform (DCT) in the horizontal direction and an integer discrete sine transform (DST) in the vertical direction (S1655).
[0230] Otherwise, an integer discrete cosine transform (DCT) can be applied to the current block (luminance and chrominance signal block) in both the horizontal and vertical directions as a frequency transform method (S1660).
[0231] The method of FIG. 16 described above can be reflected in the transformation process for scaled transform coefficients as follows.
[0232] The transformation process for scaled transform coefficients reflects the example of Figure 16.
[0233] The input here is as follows:
[0234] -Width of current transformation block Width:nW
[0235] -Current conversion block height: nH
[0236] -element ij Array of scaled transform coefficients having the following structure: (nW × nH) array d
[0237] Index for the luminance and chrominance signals of the current block: cIdx
[0238] If cIdx is '0', it means the luminance signal, if cIdx is '1' or '2' it means the color difference signal, if cIdx is '1' it means the color difference signal Cb, if cIdx is '2' it means the color difference signal Cr.
[0239] The output here is as follows:
[0240] - Array for the residual signal obtained by inversely transforming the scaled transform coefficients: (nW × nH) array r
[0241] If the coding mode (PredMode) for the current block is the intra prediction mode (Intra) and the Log2(nW*nH) value is '4', in the case of the luminance signal, the variables horizTrType and vertTrType are obtained according to Table 9 according to the intra prediction direction mode of the luminance signal.
[0242] In the case of a chrominance signal, if the intra prediction coding mode of the chrominance signal is less than '4', the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the chrominance signal via Table 9. Otherwise, the variables horizTrType and vertTrType are set to '0'.
[0243] When the intra-picture prediction direction mode of the color difference signal is '35', the variables horizTrType and vertTrType are set to '0'.
[0244] [Table 9]
[0245] This function performs an inverse transform process on the scaled transform coefficients using the horizTrType and vertTrType variables. First, it receives the current block size (nW, nH), the scaled transform coefficient array (nW×nH array d), and the horizTrType variable, performs a 1D inverse transform in the horizontal direction, and outputs the array (nW×nH array e).
[0246] Next, the array (nW×nH array e) is input and the array (nW×nH array g) is derived as shown in Equation 5.
[0247]
number
[0248] Next, the size (nW, nH) and array (nW×nH array g) of the current block and the variable vertTrType are input to perform a one-dimensional inverse transformation in the vertical direction.
[0249] Next, the array (nW×nH array r) for the residual signal is set by cIdx as shown in Equation 6.
[0250]
number
[0251] Here, if cIdx is '0', shift=20-BitDepth Y otherwise, shift=20-BitDepth C BitDepth has a value, and BitDepth means the number of bits of a sample for the current image (for example, 8 bits).
[0252] FIG. 17 is a flowchart illustrating another example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode of the chrominance signal according to an embodiment of the present invention.
[0253] Referring to FIG. 17, first, it is determined whether the current block is coded using intra-picture coding (S1710). If it is coded using intra-picture coding, the frequency transform method for the current block is an integer discrete sine transform (DST) or an integer discrete cosine transform (DCT) (S1755).
[0254] Otherwise (if the current block is not intra-coded), an intra prediction direction mode (IntraPredMode(C)) for the luma or chroma signal of the current block is obtained (S1715). Here, when deriving a frequency transform method for the luma signal, IntraPredMode(C) is changed to IntraPredMode (intra prediction direction mode for the luma signal), and when deriving a frequency transform method for the chroma signal, IntraPredMode(C) is changed to IntraPredModeC (intra prediction direction mode for the chroma signal). Here, the intra prediction direction mode for the luma signal of the current block can be used to derive a frequency transform method for the residual image for the luma signal. And, the intra prediction direction mode for the chroma signal of the current block can be used to derive a frequency transform method for the residual image for the chroma signal.
[0255] At this time, the intra-frame prediction direction mode for selecting the frequency transform method can be obtained by various methods such as one of the following 1 to 3.
[0256] 1. The intra prediction direction mode for the luminance signal of the current block can be applied to the residual images for the luminance signal and the chrominance signal to derive a frequency transform method.
[0257] 2. The intra prediction direction mode for the chrominance signal of the current block can be applied to the residual images for the luminance signal and the chrominance signal to derive a frequency conversion method.
[0258] 3. Only the integer discrete cosine transform (DCT) or integer discrete sine transform (DST) can be used for the luminance signal of the current block, and the intra prediction direction mode for the chrominance signal of the current block can be used to guide the frequency transform method of the residual image for the chrominance signal.
[0259] In addition, the frequency conversion method can be induced by various methods.
[0260] Next, it is determined whether the current block is a 4x4 block (iWidth=4) (S1720). If the current block is not a 4x4 block (iWidth=4), the frequency transform method for the current block is an integer transform or an integer discrete cosine transform (DCT) (S1755).
[0261] Otherwise (if the current block is a 4x4 block (iWidth==4)), the intra prediction direction mode of the current block is checked.
[0262] If the intra-frame prediction direction mode of the current block is greater than '2' and less than '10' (S1725), the frequency transform method for the current block can be an integer discrete sine transform (DST) in the horizontal direction and an integer discrete cosine transform (DCT) in the vertical direction (S1740).
[0263] On the other hand, if the intra-frame prediction direction mode of the current block is '0' or is greater than '11' and less than '25' (S1730), integer discrete sine transform (DST) can be applied in both the horizontal and vertical directions as the frequency transform method for the current block (S1745).
[0264] On the other hand, if the intra-frame prediction direction mode of the current block is greater than '26' and less than '34' (S1735), the frequency transform method for the current block can be an integer discrete cosine transform (DCT) in the horizontal direction and an integer discrete sine transform (DST) in the vertical direction (S1750).
[0265] Otherwise, the integer discrete cosine transform (DCT) can be applied to both the horizontal and vertical directions as the frequency transform method for the current block (S1755).
[0266] At this time, the frequency transform method according to the intra-frame prediction direction mode can be used in various ways. For example, if the intra-frame prediction direction mode of the current block is greater than '2' and less than '10', the frequency transform method can be applied as in the above example. Alternatively, as the frequency transform method for the current block, an integer discrete cosine transform (DCT) can be applied in the horizontal direction and an integer discrete sine transform (DST) can be applied in the vertical direction. Alternatively, as the frequency transform method for the current block, an integer discrete cosine transform (DCT) can be applied in both the horizontal and vertical directions, or an integer discrete sine transform (DST) can be applied in both the horizontal and vertical directions. Alternatively, an integer discrete sine transform (DST) can be applied in all horizontal and vertical directions except for DC (mean prediction, non-directional mode) mode.
[0267] This method of applying various frequency transform schemes in various ways can be applied not only when the intra prediction direction mode of the current block is greater than '2' and less than '10', but also when the intra prediction direction mode is in other ranges. This can be applied to the following embodiments as well.
[0268] The above method can be reflected in the transformation process for scaled transform coefficients as follows:
[0269] The transformation process for scaled transform coefficients reflects the example of Figure 17.
[0270] The input here is as follows:
[0271] -Width of current transformation block Width:nW
[0272] -Current conversion block height: nH
[0273] -element ijan array of scaled transform coefficients having a (nW × nH) array d
[0274] - Index for the luminance signal and chrominance signal of the current block: cIdx
[0275] If cIdx is '0', it means the luminance signal, if cIdx is '1' or '2' it means the color difference signal, if cIdx is '1' it means the color difference signal Cb, if cIdx is '2' it means the color difference signal Cr.
[0276] The output here is as follows:
[0277] Array for the residual signal obtained by inverse transforming the scaled transform coefficients: (nW × nH) array r
[0278] If the coding mode (PredMode) for the current block is an intra prediction mode (Intra) and the Log2(nW*nH) value is '4', (1) in the case of a luminance signal, the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal via Table 10, and (2) in the case of a chrominance signal, the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the chrominance signal via Table 10. Otherwise, the variables horizTrType and vertTrType are set to '0'.
[0279] [Table 10]
[0280] This function performs an inverse transform process on the scaled transform coefficients using the horizTrType and vertTrType variables. First, it receives the current block size (nW, nH), the scaled transform coefficient array (nW×nH array d), and the horizTrType variable, performs a 1D inverse transform in the horizontal direction, and outputs the array (nW×nH array e).
[0281] Next, the array (nW×nH array e) is input and the array (nW×nH array g) is derived as shown in Equation 7.
[0282]
number
[0283] Next, the size (nW, nH) and array (nW×nH array g) of the current block and the variable vertTrType are input to perform a one-dimensional inverse transformation in the vertical direction.
[0284] The array (nW×nH array r) for the residual signal is set according to cIdx as shown in Equation 8.
[0285]
number
[0286] Here, if cIdx is '0', shift=20-BitDepth Y otherwise, shift=20-BitDepth C BitDepth has a value, and BitDepth means the number of bits of a sample for the current image (for example, 8 bits).
[0287] [Embodiment 4] Method and apparatus for selectively deriving a frequency conversion scheme for residual images of color difference signals according to intra-picture prediction direction mode of luminance signal for Intra_FromLuma (LM) coding mode of color difference signals
[0288] FIG. 18 is a flowchart illustrating a method for selectively deriving a frequency transform method for a residual image of a chrominance signal according to an intra-frame prediction direction mode of a luminance signal for an Intra_FromLuma (LM) coding mode of a chrominance signal, according to an embodiment of the present invention.
[0289] Referring to FIG. 18, first, if the current block is coded using intra coding (Intra) and is a block of 4x4 size (trafoSize (or iWidth) == 4) (S1810), the frequency transform method for the current block is an integer discrete sine transform (DST) or an integer discrete cosine transform (DCT) (S1855). Otherwise, the frequency transform method for the current block can be a DCT.
[0290] Next, if the current block is a luminance block or a chrominance block and the intra prediction direction mode of the chrominance block is the LM mode (S1815), the intra prediction direction mode (IntraPredMode) for the luminance signal is obtained (S1820).
[0291] Here, the intra prediction direction mode for the luminance signal of the current block can be used to guide the frequency transform method of the residual image for the luminance signal and the chrominance signal.
[0292] If it is a block (a chrominance block that is not in LM mode), DCT can be applied (S1855).
[0293] Next, if the intra-frame prediction direction mode of the current block (luminance and chrominance signal block) is greater than '2' and less than '10' (S1825), the frequency transform method for the current block (luminance and chrominance signal block) can be an integer discrete sine transform (DST) applied horizontally and an integer discrete cosine transform (DCT) applied vertically (S1840).
[0294] On the other hand, if the intra-picture prediction direction mode of the current block (luminance and chrominance signal block) is '0' (Planar) or is greater than '11' and less than '25' (S1830), integer discrete sine transform (DST) can be applied in both the horizontal and vertical directions as the frequency transform method for the current block (luminance and chrominance signal block) (S1845).
[0295] If the intra prediction direction mode of the current block (luminance and chrominance signal block) is greater than '26' and less than '34' (S1835), the frequency transform method for the current block (luminance and chrominance signal block) can be an integer discrete cosine transform (DCT) in the horizontal direction and an integer discrete sine transform (DST) in the vertical direction (S1850). Otherwise, the frequency transform method for the current block (luminance and chrominance signal block) can be an integer discrete cosine transform (DCT) in both the horizontal and vertical directions (S1855).
[0296] Meanwhile, the transformation process for scaled transform coefficients according to the example of FIG. 18 is as follows.
[0297] Transformation process for scaled transform coefficients according to the example of FIG. 18
[0298] The input here is as follows:
[0299] -Width of current transformation block Width:nW
[0300] -Current conversion block height: nH
[0301] -element ij Array of scaled transform coefficients having the following structure: (nW × nH) array d
[0302] - Index for the luminance signal and chrominance signal of the current block: cIdx
[0303] If cIdx is '0', it means the luminance signal, if cIdx is '1' or '2' it means the color difference signal, if cIdx is '1' it means the color difference signal Cb, if cIdx is '2' it means the color difference signal Cr.
[0304] The output here is as follows:
[0305] - Array for the residual signal obtained by inversely transforming the scaled transform coefficients; (nW × nH) array r
[0306] If the coding mode (PredMode) for the current block is the intra prediction mode (Intra) and the Log2(nW*nH) value is '4', and in the case of a luminance signal, the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal via Table 11, and if the coding mode of the chrominance signal is Intra_FromLuma (LM), the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal via Table 11. If not, the variables horizTrType and vertTrType are set to '0'.
[0307] [Table 11]
[0308] This function performs an inverse transform process on the scaled transform coefficients using the horizTrType and vertTrType variables. First, it receives the current block size (nW, nH), the scaled transform coefficient array (nW×nH array d), and the horizTrType variable, performs a 1D inverse transform in the horizontal direction, and outputs the array (nW×nH array e).
[0309] Next, the array (nW×nH array e) is input and the array (nW×nH array g) is derived as shown in Equation 9.
[0310]
number
[0311] Next, the size (nW, nH) and array (nW×nH array g) of the current block and the variable vertTrType are input to perform a one-dimensional inverse transformation in the vertical direction.
[0312] The array (nW×nH array r) for the residual signal is set according to cIdx as shown in Equation 10.
[0313]
number
[0314] Here, if cIdx is '0', shift=20-BitDepth Y otherwise, shift=20-BitDepth C BitDepth has a value, and BitDepth means the number of bits of a sample for the current image (for example, 8 bits).
[0315] Figure 19 is a flowchart illustrating another example of a method for selectively deriving a frequency conversion method for residual images of a color difference signal according to an intra-frame prediction direction mode of a luminance signal for an Intra_FromLuma (LM) coding mode of a color difference signal in this embodiment.
[0316] Referring to FIG. 19, it is determined whether the current block is in condition 1 (intra-coded and is a luminance (Luma) signal block) or condition 2 (the current block is in LM mode and is a chrominance (Chroma) signal block) (S1910).
[0317] If the condition 1 or 2 is not satisfied, the frequency transform method for the luminance signal and the chrominance signal of the current block is an integer transform or an integer discrete cosine transform (DCT) (S1955).
[0318] Otherwise (if the condition 1 or 2 is satisfied), the intra-frame prediction direction mode (IntraPredMode) for the luminance signal of the current block is obtained (S1915).
[0319] Here, the intra prediction direction mode for the luminance signal of the current block can be used to guide the frequency transform method of the residual image for the luminance signal. And, if the chrominance signal of the current block is coded in LM mode, the intra prediction direction mode for the luminance signal of the current block can be used to guide the frequency transform method of the residual image for the chrominance signal.
[0320] Next, it is determined whether the current block is a 4x4 block (iWidth == 4) (S1920). If the current block is not a 4x4 block (iWidth == 4), an integer transform or an integer discrete cosine transform (DCT) is applied as a frequency transform method for the luminance signal and chrominance signal of the current block (S1955). Otherwise (if the current block is a 4x4 block (iWidth == 4)), the intra prediction direction mode of the current block is checked.
[0321] If the intra prediction direction mode of the current block is greater than '2' and less than '10' (S1925), an integer discrete sine transform (DST) can be applied horizontally and an integer discrete cosine transform (DCT) can be applied vertically as a frequency transform method for the luminance signal of the current block (S1940). If the chrominance signal of the current block is coded in LM mode, the frequency transform method for the luminance signal of the current block can be used to frequency transform the residual image of the chrominance signal.
[0322] However, if the chrominance signal of the current block is not coded in the LM mode, an integer discrete cosine transform (DCT) can be performed on the chrominance signal of the current block in both the horizontal and vertical directions (S1955).
[0323] If the intra prediction direction mode of the current block is '0' or is greater than '11' and less than '25' (S1930), an integer discrete sine transform (DST) can be applied to the luminance signal of the current block in both the horizontal and vertical directions as a frequency transform method (S1945). If the chrominance signal of the current block is coded in LM mode, the frequency transform method for the luminance signal of the current block can be used to frequency transform the residual image of the chrominance signal. On the other hand, if the chrominance signal of the current block is not coded in LM mode, an integer discrete cosine transform (DCT) can be performed on the chrominance signal of the current block in both the horizontal and vertical directions (S1955).
[0324] On the other hand, if the intra prediction direction mode of the current block is greater than '26' and less than '34' (S1935), an integer discrete cosine transform (DCT) can be applied in the horizontal direction and an integer discrete sine transform (DST) can be applied in the vertical direction as a frequency transform method for the luminance signal of the current block (S1950). If the chrominance signal of the current block is coded in LM mode, the frequency transform method for the luminance signal of the current block can be used to frequency transform the residual image of the chrominance signal. Otherwise, if the chrominance signal of the current block is not coded in LM mode, an integer discrete cosine transform (DCT) can be performed on the chrominance signal of the current block in both the horizontal and vertical directions (S1955).
[0325] Otherwise, the integer Discrete Cosine Transform (DCT) is applied to the residual images of the luminance and chrominance signals of the current block in both the horizontal and vertical directions as a frequency transform method (S1955).
[0326] Transformation process for scaled transform coefficients reflecting the above example is as follows:
[0327] The transformation process for scaled transform coefficients reflects the example in Figure 19.
[0328] The input here is as follows:
[0329] -Width of current transformation block Width:nW
[0330] -Current conversion block height: nH
[0331] -element ij Array of scaled transform coefficients having the following structure: (nW × nH) array d
[0332] - Index for the luminance signal and chrominance signal of the current block: cIdx
[0333] If cIdx is '0', it means the luminance signal, if cIdx is '1' or '2' it means the color difference signal, if cIdx is '1' it means the color difference signal Cb, if cIdx is '2' it means the color difference signal Cr.
[0334] The output here is as follows:
[0335] - Array for the residual signal obtained by inversely transforming the scaled transform coefficients: (nW × nH) array r
[0336] If the coding mode (PredMode) for the current block is the intra prediction mode (Intra) and the Log2(nW*nH) value is '4', and in the case of a luminance signal, the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal via Table 12, and if the coding mode of the chrominance signal is Intra_FromLuma (LM), the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal via Table 12. Otherwise, the variables horizTrType and vertTrType are set to '0'.
[0337] [Table 12]
[0338] This function performs an inverse transform process on the scaled transform coefficients using the horizTrType and vertTrType variables. First, it receives the current block size (nW, nH), the scaled transform coefficient array (nW×nH array d), and the horizTrType variable, performs a 1D inverse transform in the horizontal direction, and outputs the array (nW×nH array e).
[0339] Next, the array (nW×nH array e) is input and the array (nW×nH array g) is derived as shown in Equation 11.
[0340]
number
[0341] Next, the size (nW, nH) and array (nW×nH array g) of the current block and the variable vertTrType are input to perform a one-dimensional inverse transformation in the vertical direction.
[0342] The array (nW×nH array r) for the residual signal is set according to cIdx as shown in Equation 12.
[0343]
number
[0344] Here, if cIdx is '0', shift=20-BitDepth Y otherwise, shift=20-BitDepth C BitDepth has a value, and BitDepth means the number of bits of a sample for the current image (for example, 8 bits).
[0345] Here, this embodiment can be applied not only to the case where the current chrominance block is coded in the "Intra_FromLuma" mode, but also to various cases such as the following 1 or 2.
[0346] 1. In predicting a chrominance block, the present invention can be applied to all methods of multiplying a restored luminance signal block by a weight and then adding an offset.
[0347] 2. In predicting a chrominance block, a template shift for the restored luminance signal block and the chrominance signal block is used, which can be applied to all methods of predicting a chrominance block. Here, the template shift is used to estimate the correlation between the luminance signal and the chrominance signal.
[0348] In addition, this embodiment can be applied in various ways.
[0349] [Embodiment 5] Method and apparatus for selectively deriving a frequency conversion method for residual images of chrominance signals according to intra-frame prediction direction mode
[0350] FIG. 20 is a flowchart illustrating an example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode according to an embodiment of the present invention.
[0351] Referring to FIG. 20, first, it is determined whether the current block is coded using intra-picture coding (Intra) and is a block of 4x4 size (trafoSize (or iWidth) == 4) (S2010). First, if the current block is coded using intra-picture coding (Intra) and is a block of 4x4 size (trafoSize (or iWidth) == 4), the frequency transform method for the current block is an integer discrete sine transform (DST) or an integer discrete cosine transform (DCT). Otherwise, the frequency transform method for the current block may be a DCT (S2065).
[0352] Next, if the current block is a luminance block or a chrominance block and the intra prediction direction mode of the chrominance block is LM mode (S2015), an intra prediction direction mode (IntraPredMode) for the luminance signal is obtained (S2020). Here, the intra prediction direction mode for the luminance signal of the current block can be used to guide the frequency transform method of the residual image for the luminance signal and the chrominance signal.
[0353] If not, it is determined whether the chrominance block is in DM mode (S2025).
[0354] If the current block is a chrominance block and a DM block, DCT can be applied (S2065). On the other hand, if the current block is a chrominance block and not a DM block, the intra prediction direction mode for the chrominance signal can be used to guide the frequency transform method of the residual image for the chrominance signal (S2030).
[0355] Here, when a chrominance block is coded in DM mode, the intra-frame prediction direction mode corresponding to EM mode (Planar mode, Average mode (DC), Horizontal mode (Hor), Vertical mode (Ver), and the 8th mode in the vertical direction (Ver+8 or 34th mode)) among the DM modes can apply DST, DCT, or other frequency transform methods.
[0356] Next, if the intra-frame prediction direction mode of the current block (luminance and chrominance signal block) is greater than '2' and less than '10' (S2035), the frequency transform method for the current block (luminance and chrominance signal block) can be an integer discrete sine transform (DST) in the horizontal direction and an integer discrete cosine transform (DCT) in the vertical direction (S2050).
[0357] On the other hand, if the intra-frame prediction direction mode of the current block (luminance and chrominance signal block) is '0' (Planar) or is greater than '11' and less than '25' (S2040), an integer discrete sine transform (DST) can be applied in both the horizontal and vertical directions as the frequency transform method for the current block (luminance and chrominance signal block) (S2055).
[0358] Also, if the intra-frame prediction direction mode of the current block (luminance and chrominance signal block) is greater than '26' and less than '34' (S2045), the frequency transform method for the current block (luminance and chrominance signal block) can be an integer discrete cosine transform (DCT) in the horizontal direction and an integer discrete sine transform (DST) in the vertical direction (S2060).
[0359] Otherwise, an integer discrete cosine transform (DCT) can be applied to both the horizontal and vertical directions as a frequency transform method for the current block (luminance and chrominance signal block) (S2065).
[0360] Here, the method for selectively applying the frequency conversion method can be variously applied, such as any one of the following 1 to 3.
[0361] 1. When a chrominance block is coded in DM mode, DST, DCT or other frequency transform methods can be applied only to the intra-frame prediction direction mode corresponding to EM mode (Planar mode, Average mode (DC), Horizontal mode (Hor), Vertical mode (Ver), and the 8th mode in the vertical direction (Ver+8 or 34th mode)) among the DM modes.
[0362] 2. When a chrominance block is coded in LM mode, DST, DCT or other frequency transform methods can be applied only to the intra-picture prediction direction modes corresponding to EM modes (Planar mode, Average mode (DC), Horizontal mode (Hor), Vertical mode (Ver), and the 8th mode in the vertical direction (Ver+8 or 34th mode)) among the intra-picture prediction direction modes derived from the luminance signal.
[0363] 3. Only when the intra-frame prediction direction mode is planar or DC, DST, DCT, or other frequency transform methods can be selectively applied, and DST, DCT, or other frequency transform methods can be fixedly applied to other modes. Or, the opposite is also possible.
[0364] In addition, the frequency conversion method can be induced by various methods.
[0365] A method for performing a transformation process for scaled transform coefficients, reflecting the method of FIG. 20, is as follows.
[0366] The transformation process for scaled transform coefficients reflects the example in Figure 20.
[0367] The input here is as follows:
[0368] -Width of current transformation block Width:nW
[0369] -Current conversion block height: nH
[0370] -element ij Array of scaled transform coefficients having the following structure: (nW × nH) array d
[0371] - Index for the luminance signal and chrominance signal of the current block: cIdx
[0372] If cIdx is '0', it means the luminance signal, if cIdx is '1' or '2' it means the color difference signal, if cIdx is '1' it means the color difference signal Cb, if cIdx is '2' it means the color difference signal Cr.
[0373] The output here is as follows:
[0374] - Array for the residual signal obtained by inversely transforming the scaled transform coefficients: (nW × nH) array r
[0375] If the coding mode (PredMode) for the current block is the intra prediction mode (Intra), and the Log2(nW*nH) value is '4' and the current block is a luminance signal, the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal according to Table 13 below. If the coding mode for the chrominance signal is less than '4', the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the chrominance signal according to Table 13 below. On the other hand, if the coding mode for the chrominance signal is Intra_FromLuma (LM), the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal according to the table below. Otherwise, the variables horizTrType and vertTrType are set to '0'.
[0376] [Table 13]
[0377] This function performs an inverse transform process on the scaled transform coefficients using the horizTrType and vertTrType variables. First, it receives the current block size (nW, nH), the scaled transform coefficient array (nW×nH array d), and the horizTrType variable, performs a 1D inverse transform in the horizontal direction, and outputs the array (nW×nH array e).
[0378] Next, the array (nW×nH array e) is input and the array (nW×nH array g) is derived as shown in Equation 13.
[0379]
number
[0380] Next, the size (nW, nH) and array (nW×nH array g) of the current block and the variable vertTrType are input to perform a one-dimensional inverse transformation in the vertical direction.
[0381] The array (nW×nH array r) for the residual signal is set according to cIdx as shown in Equation 14.
[0382]
number
[0383] Here, if cIdx is '0', shift=20-BitDepth Y otherwise, shift=20-BitDepth C BitDepth has a value, and BitDepth means the number of bits of a sample for the current image (for example, 8 bits).
[0384] FIG. 21 is a flowchart illustrating another example of a method for selectively deriving a frequency transform scheme for a residual image of a chrominance signal based on an intra-frame prediction direction mode according to an embodiment of the present invention.
[0385] Referring to FIG. 21, first, if the current block is not coded using intra-picture coding (S2105), an integer transform or an integer discrete cosine transform (DCT) is applied as a frequency transform method to the luminance signal and chrominance signal of the current block (S2160).
[0386] Otherwise (if the current block is coded by intra-picture coding (Intra)), it is determined whether the current block is a luminance (Luma) block or whether the coding mode of the current block is LM (S2110).
[0387] If the current block is neither a luminance signal nor the coding mode of the current block is LM, the intra prediction direction mode for the chrominance signal is obtained (S2115). Otherwise, the intra prediction direction mode for the luminance signal is obtained (S2120).
[0388] Here, the intra prediction direction mode for the luminance signal of the current block can be used to guide the frequency transform method of the residual image for the luminance signal, and the intra prediction direction mode for the chrominance signal of the current block can be used to guide the frequency transform method of the residual image for the chrominance signal.
[0389] If the chrominance signal of the current block is coded in the LM mode, the intra prediction direction mode for the luminance signal of the current block can be used to guide the frequency transform method of the residual image for the chrominance signal.
[0390] Next, it is determined whether the current block is a 4x4 block (iWidth == 4) (S2125). If the current block is not a 4x4 block (iWidth == 4), an integer transform or an integer discrete cosine transform (DCT) is applied as a frequency transform method for the luminance signal and chrominance signal of the current block (S2160). Otherwise (if the current block is a 4x4 block (iWidth == 4)), the intra prediction direction mode of the current block is checked.
[0391] Here, when inducing a frequency transform method for a luminance signal, IntraPredMode(C) is changed to IntraPredMode (intra-frame prediction direction mode for a luminance signal), and when inducing a frequency transform method for a chrominance signal, IntraPredMode(C) is changed to IntraPredModeC (intra-frame prediction direction mode for a chrominance signal).
[0392] If the intra-frame prediction direction mode of the current block is greater than '2' and less than '10' (S2130), the frequency transform method for the current block can be an integer discrete sine transform (DST) in the horizontal direction and an integer discrete cosine transform (DCT) in the vertical direction (S2145).
[0393] On the other hand, if the intra-frame prediction direction mode of the current block is '0' or is greater than '11' and less than '25' (S2135), integer discrete sine transform (DST) can be applied in both the horizontal and vertical directions as the frequency transform method for the current block (S2150).
[0394] On the other hand, if the intra-screen prediction direction mode of the current block is greater than '26' and less than '34' (S2140), the frequency transform method for the current block can be an integer discrete cosine transform (DCT) in the horizontal direction and an integer discrete sine transform (DST) in the vertical direction (S2155).
[0395] Otherwise, an integer Discrete Cosine Transform (DCT) can be applied to both the horizontal and vertical directions as a frequency transform method for the residual images of the luminance and chrominance signals of the current block (S2160).
[0396] The method according to the above example is reflected in the transformation process for scaled transform coefficients as follows.
[0397] The transformation process for scaled transform coefficients reflects the example of Figure 21.
[0398] The input here is as follows:
[0399] -Width of current transformation block Width:nW
[0400] -Current conversion block height: nH
[0401] -element ij Array of scaled transform coefficients having the following structure: (nW × nH) array d
[0402] - Index for the luminance signal and chrominance signal of the current block: cIdx
[0403] If cIdx is '0', it means the luminance signal, if cIdx is '1' or '2' it means the color difference signal, if cIdx is '1' it means the color difference signal Cb, if cIdx is '2' it means the color difference signal Cr.
[0404] The output here is as follows:
[0405] - Array for the residual signal obtained by inversely transforming the scaled transform coefficients: (nW × nH) array r
[0406] If the coding mode (PredMode) for the current block is the intra prediction mode (Intra), and the Log2(nW*nH) value is '4' and the current block is a luminance signal, the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal via Table 14, and if the current block is a chrominance signal, the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the chrominance signal via Table 14, and if the coding mode of the chrominance signal is Intra_FromLuma (LM), the variables horizTrType and vertTrType are determined according to the intra prediction direction mode of the luminance signal via Table 14. Otherwise, the variables horizTrType and vertTrType are set to '0'.
[0407] [Table 14]
[0408] The inverse transform process is performed on the scaled transform coefficients using the variables horizTrType and vertTrType. First, the size of the current block (nW, nH), the scaled transform coefficient array (nW×nH array d), and the variable horizTrType are input, and a one-dimensional inverse transform is performed in the horizontal direction to output the array (nW×nH array e).
[0409] Next, the array (nW×nH array e) is input and the array (nW×nH array g) is derived as shown in Equation 15.
[0410]
number
[0411] Next, the size (nW, nH) and array (nW×nH array g) of the current block and the variable vertTrType are input to perform a one-dimensional inverse transformation in the vertical direction.
[0412] Next, the array (nW×nH array r) for the residual signal is set by cIdx as shown in Equation 16.
[0413]
number
[0414] Here, if cIdx is '0', shift=20-BitDepth Y otherwise, shift=20-BitDepth C BitDepth has a value, and BitDepth means the number of bits of a sample for the current image (for example, 8 bits).
[0415] The above-described method can be applied in different scopes depending on the block size, CU depth, TU depth, and the like.
[0416] The variables that determine the scope of application (i.e., size or depth information) can be set so that the encoder and decoder use predetermined values, or they can be set to use values determined by the profile or level, and if the encoder writes the variable values in the bitstream, the decoder can obtain and use these values from the bitstream.
[0417] When the application range is varied depending on the CU depth, the following three methods can be applied, as shown in Table 15: Method A) A method that applies only to depths greater than a given depth, Method B) A method that applies only to depths less than a given depth, and Method C) A method that applies only to depths less than a given depth.
[0418] Table 15 shows an example of a range determination scheme for applying the method of the present invention when the depth of a given CU (or TU) is 2. In Table 15, O shows an example of a range determination scheme for applying the method of the present invention when the depth of a given CU (or TU) is 2. In Table 15, O indicates that the method is applicable to the depth, and X indicates that the method is not applicable to the depth.
[0419] [Table 15]
[0420] If the method of the present invention is not to be applied to all depths, this can be indicated using any indicator (flag), or it can be expressed by signaling a value one greater than the maximum value of the CU depth as a CU depth value indicating the range of application.
[0421] The above-described method can also be applied when the resolutions of the luminance signal and the color difference signals are different.
[0422] For example, assuming that the color difference signal is 1 / 4 the size of the luminance signal (for example, the luminance signal is 416x240 in size and the color difference signal is 208x120 in size), an 8x8 block of the luminance signal is the same as a 4x4 block of the color difference signal.
[0423] 22 shows an example of the difference in resolution between luminance blocks and chrominance blocks. In the example of FIG. 22, the luminance signal is an 8×8 block 2210, and the chrominance signal is a 4×4 block 2220.
[0424] 22, there are four 4x4 blocks in the luminance signal 2210, and each 4x4 block can have an intra prediction direction mode, whereas the chrominance signal 2220 cannot be divided into 2x2 blocks.
[0425] In this case, the chrominance signal may have one intra prediction direction mode for each 4x4 block. In this case, if the chrominance signal is coded in Intra_FromLuma (LM) mode (or if the chrominance signal is coded in DM mode (a mode in which the intra prediction direction mode of the luminance signal is directly used as the intra prediction direction mode of the chrominance signal)), one of four 4x4 blocks may be used as the intra prediction direction mode of the luminance signal for guiding a frequency transform scheme for the residual image of the chrominance signal.
[0426] In order to selectively apply a frequency transform method to the residual image of the chrominance signal, the method of guiding the intra-frame prediction direction can be variously applied, such as any one of the following methods 1 to 4.
[0427] 1. The intra prediction direction mode of the block located in the upper left corner of the luminance signal block can be used.
[0428] 2. The intra prediction direction mode of the block located in the upper right, lower left, or lower right of the luminance signal block can be used.
[0429] 3. The average or median value of the four luminance signal blocks can be used.
[0430] 4. An average value or a median value using the intra-frame prediction direction mode of the four luminance signal blocks of the current block and the chrominance signal blocks of the neighboring blocks of the current block can be used.
[0431] Alternatively, the intra prediction direction mode for the chrominance signal can be induced by various other methods.
[0432] FIG. 23 is another example illustrating the difference in resolution between the luminance block and the chrominance block.
[0433] 23, the luminance signal 2310 has one 16x16 block and can have one intra prediction mode, whereas the chrominance signal 2320 can be divided into four 4x4 blocks, each of which can have an intra prediction direction mode.
[0434] In this case, if the chrominance signal is coded in Intra_FromLuma (LM) mode (or if the chrominance signal is coded in DM mode (a mode in which the intra prediction direction mode of the luminance signal is used as the intra prediction direction mode of the chrominance signal)), the intra prediction direction mode of one luminance signal can be used to derive a frequency transform method for the residual video block of each chrominance signal. Alternatively, the intra prediction direction mode can be derived from a neighboring block (luminance block or chrominance block) of the current block and used to derive a frequency transform method for the residual video block of the chrominance signal.
[0435] In addition, the above-described method can be applied differently to chrominance blocks depending on the size of the luminance block, and can be applied differently to luminance signal images and chrominance images, and frequency conversion methods can be applied differently in the horizontal and vertical directions.
[0436] Table 16 outlines this combination of methods.
[0437] [Table 16]
[0438] Among the modified methods in Table 16, looking at method “T1”, when the size of the luminance block is 8 (8×8, 8×4, 2×8, etc.) and the size of the chrominance block is 4 (4×4, 4×2, 2×4), Example 1 (T1-Example 1), Example 2-1 or Example 2-2 (T1-Example 2-1 or Example 2-2), and Example 3 (T1-Example 3) of the specification can be applied to the luminance signal, chrominance signal, horizontal signal, and vertical signal.
[0439] Among the modified methods, in method "L2," when the size of the luminance block is 16 (16x16, 8x16, 4x16, etc.) and the size of the chrominance block is 4 (4x4, 4x2, 2x4), Example 1 (L2-Example 1), Example 2-1 or Example 2-2 (L2-Example 2-1 or Example 2-2), and Example 3 (L2-Example 3) of the specification are applied to the luminance signal, chrominance signal, and horizontal signal, but not to the vertical signal.
[0440] Here, the above-described method can be applied not only to the case where the current chrominance block is coded in the "Intra_FromLuma" mode, but also to various cases such as the following 1 or 2.
[0441] 1. In predicting a chrominance block, the present invention can be applied to all methods of multiplying a restored luminance signal block by a weight and then adding an offset.
[0442] 2. In predicting a chrominance block, a template shift for the restored luminance signal block and the chrominance signal block is used, which can be applied to all methods of predicting a chrominance block. Here, the template shift is used to estimate the correlation between the luminance signal and the chrominance signal.
[0443] There are also various other applications.
[0444] [Embodiment 6] Method and apparatus for determining the conversion method and scanning method of color difference signals in an integrated manner
[0445] As described above, the scanning method for the residual signal (difference image) of the chrominance signal can be changed depending on the intra-frame prediction direction mode of the chrominance signal.
[0446] Also, the frequency conversion method for the residual signal (difference image) of the chrominance signal can be changed depending on the intra-frame prediction direction mode of the chrominance signal.
[0447] The scanning method for the residual signal (difference image) of the chrominance signal may have different coding efficiency depending on the frequency transform method for the residual signal of the chrominance signal. However, since both the scanning method and the frequency transform method for the residual signal (difference image) of the chrominance signal can be changed depending on the intra-frame prediction direction mode of the chrominance signal, it can be said that the two methods have a predetermined correlation.
[0448] That is, the scanning method and the frequency conversion method for the residual signal of the color difference signal may have a correlation, and the two methods may be integrated and determined as an optimal combination. Therefore, the scanning method for the color difference signal in Example 1 and Example 2-1 / Example 2-2, and the frequency conversion method in Example 3, Example 4, and Example 5 may be integrated and determined as shown in Table 17.
[0449] Table 17 shows an example of a method for determining the scanning method and frequency conversion method for the residual signal of the color difference signal in an integrated manner according to this embodiment.
[0450] [Table 17]
[0451] Table 17 shows the combination of the scanning method and frequency transform method for the residual signal of the chrominance signal, where EM, DM, and LM modes indicate the coding method of the intra prediction direction mode for the chrominance signal.
[0452] The chrominance signal mode derived by directly applying the intra prediction direction mode of the luminance signal as the intra prediction direction mode of the chrominance signal is called Derived Mode (DM). The chrominance signal mode that actually encodes the intra prediction direction mode is called Explicit Mode (EM). The chrominance signal intra prediction direction modes encoded in EM mode include Planar mode (Planar), Average mode (DC), Horizontal mode (Hor), Vertical mode (Ver), and the 8th mode in the vertical direction (Ver+8 or 34th mode).
[0453] Finally, the LM (Intra_FromLuma) mode is a mode in which a color difference signal is predicted from a restored luminance signal.
[0454] In Table 17, as an example of combination, 'A', to determine the frequency transform method for the chrominance signal, only EM and LM are used among the intra prediction direction modes of the chrominance signal, and DM is not used. The frequency transform method is determined using EM and LM (Examples 3, 4, and 5), and then the scanning method for the transformed coefficients is determined using EM and DM among the intra prediction direction modes of the chrominance signal (Examples 1 and 2).
[0455] Here, in consideration of coding efficiency, it is also possible to exclude cases where the frequency transform method is derived using the DM mode from the intra prediction direction mode of the chrominance signal. For example, when encoding in DM mode, if the intra prediction direction mode of the chrominance signal is different from the intra prediction direction mode of the luminance signal and the intra prediction direction mode of the chrominance signal is a mode that does not exist in EM mode (planar mode (Planar), average mode (DC), horizontal mode (Hor), vertical mode (Ver), or the mode located 8th in the vertical direction (Ver+8 or 34th mode)), encoding has no choice but to be in DM mode, so the intra prediction direction mode of the chrominance signal encoded in DM mode may be degraded in terms of accuracy. Therefore, the DM mode may not be used to determine the frequency transform method.
[0456] In Table 17, as another example of combination, 'D', only EM and LM are used among the intra prediction direction modes of the chrominance signal to determine the frequency transform method for the chrominance signal, and DM is not used. The frequency transform method is determined using EM and LM (Examples 3, 4, and 5), and then the scanning method for the transformed coefficients is determined by using all of EM, DM, and LM among the intra prediction direction modes of the chrominance signal (Examples 1 and 2).
[0457] Here, in consideration of coding efficiency, a case may be included in which the scanning method is derived using the LM mode from among the intra prediction direction modes of the chrominance signal. As described in the first and second embodiments, the chrominance signal coded in the LM mode may have a correlation with the luminance signal. Therefore, the intra prediction direction mode of the chrominance signal coded in the LM mode is substantially the same as the intra prediction direction mode of the luminance signal. Therefore, the intra prediction direction mode of the chrominance signal coded in the LM mode has characteristics similar to those of the luminance signal, and can therefore be used to determine the scanning method.
[0458] In Table 17, as another example of combination, 'T', all of the EM, DM, and LM intra prediction direction modes of the chrominance signal are used to determine the frequency transform mode for the chrominance signal. The frequency transform mode is determined using EM, DM, and LM (Examples 3, 4, and 5), and then the scanning mode for the transformed coefficients is determined using all of the EM, DM, and LM intra prediction direction modes of the chrominance signal (Examples 1 and 2).
[0459] In Table 17, as another example of the combination, when the 'T' method is modified, EM, DM, and LM modes among the intra prediction direction modes of the chrominance signal can be used to determine the frequency transform method for the chrominance signal. In this case, among EM, DM, and LM modes, the frequency transform method can be determined only when the intra prediction direction mode for the actually reconstructed chrominance signal is EM mode (Planar mode, Average mode (DC), Horizontal mode (Hor), Vertical mode (Ver), or the 8th mode in the vertical direction (Ver+8 or 34th mode)). In addition, EM, DM, and LM can all be used to determine the scanning method for the transformed coefficients. In this case, among EM, DM, and LM modes, the scanning method (Examples 1 and 2) can be used only when the intra-frame prediction direction mode for the actually restored chrominance signal is EM mode (Planar mode, DC mode, Hor mode, Ver mode, or the 8th mode in the vertical direction (Ver+8 or 34th mode)).
[0460] [Embodiment 7] Method and apparatus for integrating tables for determining the conversion method and scanning method of color difference signals
[0461] Since both the scanning method and the frequency conversion method for the residual signal (difference image) of the chrominance signal can be changed depending on the intra-frame prediction direction mode of the chrominance signal, it can be said that the two methods have a close correlation.
[0462] Therefore, in this embodiment, the tables used to determine the two methods according to the intra-frame prediction direction mode can be integrated and used.
[0463] Table 18 shows an example of a frequency conversion method and a scanning method induced based on an intra-frame prediction direction mode according to this embodiment.
[0464] [Table 18]
[0465] Table 19 shows other examples of frequency conversion methods and scanning methods induced based on the intra-frame prediction direction mode according to this embodiment.
[0466] [Table 19]
[0467] Table 20 shows another example of a frequency conversion method and a scanning method induced based on an intra-frame prediction direction mode according to this embodiment.
[0468] [Table 20]
[0469] Table 21 shows another example of a frequency conversion method and a scanning method induced based on an intra-frame prediction direction mode according to this embodiment.
[0470] [Table 21]
[0471] Tables 18 to 21 show an example of an integrated table of frequency conversion methods and scanning methods induced by the intra-frame prediction direction mode.
[0472] For example, referring to Table 19, when the intra-frame prediction direction mode is 2 to 5, DST is used as the vertical-horizontal frequency conversion method, and DIAG (up-right) is used as the scanning method. When the intra-frame prediction direction mode is 6 to 14, DCT is used as the vertical frequency conversion method, DST is used as the horizontal frequency conversion method, and VER (vertical) is used as the scanning method.
[0473] When the intra-frame prediction direction mode is 15 to 21, DST is used as the vertical-horizontal frequency conversion method, and DIAG (up-right) is used as the scanning method. When the intra-frame prediction direction mode is 22 to 30, DST is used as the vertical frequency conversion method, DCT is used as the horizontal frequency conversion method, and HOR (horizontal) is used as the scanning method.
[0474] When the intra-frame prediction direction mode is 31 to 34, DST is used as the vertical-horizontal frequency conversion method, and DIAG (up-right) is used as the scanning method.
[0475] As shown in Table 19, when the frequency conversion method and scanning method are considered depending on the intra-frame prediction direction mode, there is an advantage that it can be implemented uniformly by VER and HOR, unlike Table 18.
[0476] Here, the above method can be applied not only when the current chrominance block is coded in the "Intra_FromLuma" mode, but also in the following cases 1 and 2.
[0477] 1. In predicting a chrominance block, the present invention can be applied to all methods of multiplying a restored luminance signal block by a weight and then adding an offset.
[0478] 2. In predicting a chrominance block, a template shift for the restored luminance signal block and the chrominance signal block is used, which can be applied to all methods of predicting a chrominance block. Here, the template shift is used to estimate the correlation between the luminance signal and the chrominance signal.
[0479] The above-described method can be applied in various other ways.
[0480] FIG. 24 is a block diagram illustrating a schematic of an encoding device according to the present invention.
[0481] Referring to FIG. 24, an encoding apparatus 2400 includes a prediction mode identification unit 2410 and a scanning unit 2420.
[0482] The prediction mode identification unit 2410 identifies a prediction mode applied to a current block. For example, the prediction mode identification unit 2410 may identify an intra prediction mode applied to luma samples and / or chroma samples of the current block.
[0483] In this case, the prediction mode identification unit 2410 may be located before the intra prediction unit of FIG. 1 and identify the intra prediction mode to be applied to the current block, or may be located above the intra prediction unit and output information to identify the intra prediction mode applied to the current block.
[0484] The intra-frame prediction mode is as described above with reference to FIG.
[0485] The scanning unit 2420 may scan the chrominance signal and / or luminance signal of the current block, and may determine a scanning type to be applied to the current block according to the intra prediction mode of the current block.
[0486] The specific method for determining the scanning type (method) to be applied to the current block is as described in detail in the embodiments of this specification.
[0487] FIG. 25 is a block diagram illustrating a decoding device according to the present invention.
[0488] Referring to FIG. 25, a decoding apparatus 2500 includes a prediction mode identification unit 2510 and a scanning unit 2520.
[0489] The prediction mode identification unit 2510 identifies a prediction mode applied to a current block. For example, the prediction mode identification unit 2410 may identify an intra prediction mode applied to luma samples and / or chroma samples of the current block.
[0490] The intra-frame prediction mode is as described above with reference to FIG.
[0491] The scanning unit 2520 may scan the chrominance signal and / or luminance signal of the current block, and may determine a scanning type to be applied to the current block according to the intra prediction mode of the current block.
[0492] The specific method for determining the scanning type (method) to be applied to the current block is as described in detail in the embodiments of this specification.
[0493] In the exemplary system described above, the method is described based on a flow chart with a series of steps or blocks, but the present invention is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Also, the above-described embodiments include examples of various aspects. For example, a combination of each embodiment should also be understood as an embodiment of the present invention.
Claims
1. 1. A video decoding method comprising: obtaining prediction mode information of a current block; deriving an intra prediction mode associated with the current block in response to the current block being an intra-coded block; obtaining a predicted sample of the current block by performing intra prediction on the current block according to the intra prediction mode; scanning the transform coefficients of the current block; performing inverse quantization on the transform coefficients to obtain inverse quantized transform coefficients of the current block; determining a transformation type for the current block; obtaining residual samples of the current block by performing an inverse transform on the dequantized transform coefficients based on the determined transform type, wherein the inverse transform is performed in horizontal and vertical directions; obtaining reconstructed samples of the current block based on the prediction samples and the residual samples; performing filtering on the reconstructed samples of the current block; Equipped with The transform type is determined to be DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform); A video decoding method characterized in that, when the size of the current block is 4x4, the DST (Discrete Sign Transform) is applied to both the horizontal and vertical directions for all intra-frame prediction direction modes and planar modes of the current block.
2. 1. A video encoding method comprising: obtaining prediction mode information of a current block; deriving an intra prediction mode associated with the current block in response to the current block being an intra-coded block; obtaining a predicted sample of the current block by performing intra prediction on the current block according to the intra prediction mode; scanning the transform coefficients of the current block; performing inverse quantization on the transform coefficients to obtain inverse quantized transform coefficients of the current block; determining a transformation type for the current block; obtaining residual samples of the current block by performing an inverse transform on the dequantized transform coefficients based on the determined transform type, wherein the inverse transform is performed in horizontal and vertical directions; obtaining reconstructed samples of the current block based on the prediction samples and the residual samples; performing filtering on the reconstructed samples of the current block; Equipped with The transform type is determined to be DCT (Discrete Cosine Transform) or DST (Discrete Sine Transform); A video encoding method characterized in that, when the size of the current block is 4x4, the DST (Discrete Sine Transform) is applied to both the horizontal and vertical directions for all intra-frame prediction direction modes and planar modes of the current block.
Citation Information
Patent Citations
Image processing device and image processing method
JP2012238927A
Interlayer prediction method and apparatus utilizing the same
JP2015512216A