Encoding method and decoding method, and device using them
By adapting frequency conversion and scanning methods for color difference signals based on intra-screen prediction modes, the method enhances encoding/decoding efficiency in video compression, addressing inefficiencies in handling chrominance signals in ultra-high definition video.
Patent Information
- Application Number
- JP2024199721
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2013-04-16
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-12
- Estimated Expiration
- 2033-04-16
AI Technical Summary
Existing video encoding/decoding technologies face inefficiencies in handling color difference signals, particularly in ultra-high definition video compression, where current methods do not effectively utilize the correlation between luminance and chrominance signals to optimize encoding/decoding processes.
The method involves applying different frequency conversion and scanning methods for color difference signals based on the intra-screen prediction mode, utilizing the correlation between luminance and chrominance signals to enhance encoding/decoding efficiency by adapting scanning directions and frequency conversion techniques according to the prediction mode.
This approach increases the coding/decoding efficiency by optimizing the handling of color difference signals, improving the overall performance of video encoding/decoding processes, especially in ultra-high definition video compression.
Smart Images

Figure 2025020429000001_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 devices.
[0003] As interest in UHD (Ultra High Definition), which has a resolution four times higher than that of HDTV, increases, a compression technique for higher resolution, higher quality images is required.
[0004] For video compression, pixel information of a current picture may be coded by prediction, for example, an inter prediction technique may be applied to predict pixel values included in the current picture from previous and / or subsequent pictures, and an intra prediction technique may be applied to predict pixel values included in the current picture using pixel information within the current picture.
[0005] Pixel information consists of a luminance signal for luminance (luma) and a color difference signal for chroma. Taking advantage of the fact that human vision is sensitive to luminance, the luminance signal and the 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 device for color difference signals, and an efficient scanning method and device 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-screen prediction mode of the chrominance signal, and the scanning method can also be determined differently depending on the intra-screen 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] At this time, the scanning type for the color difference signal may be applied in the same manner as the scanning type for the luminance signal, or the scanning type for the color difference signal may be determined in the same manner as the method for determining the scanning type for the luminance signal. Effect of the Invention
[0012] According to the present invention, it is possible to improve the efficiency of video encoding / decoding. Specifically, according to the present invention, it is possible 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 conversion method and a scanning method for a chrominance signal, a frequency conversion method for the chrominance signal is applied according to an intra-screen prediction direction mode of the chrominance signal, and a method and device for inducing a scanning direction for the chrominance signal are used, thereby improving the coding efficiency for the residual signal of the chrominance signal. [Brief description 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; [Diagram 2] 1 is a block diagram showing a configuration of an embodiment of a video decoding device to which the present invention is applied; [Diagram 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 for briefly explaining an example of a division structure of a PU. [Diagram 5] 1 is a diagram simply illustrating 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] 13 is a diagram illustrating an example of scanning an important group flag and a transform coefficient in a top right direction; [Figure 9] 11 is a flowchart illustrating an example of a method for determining a scanning direction according to a screen prediction direction. [Figure 10] 11 is a flowchart briefly illustrating another example of a method for determining a scanning direction according to a screen prediction direction. [Figure 11] 11 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 an embodiment of the present invention. [Figure 13]11 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] 4 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] 11 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] 1 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-picture 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-picture 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 conversion scheme for a residual image of a chrominance signal according to an intra-picture prediction direction mode of a luminance signal for an LM mode of a chrominance signal, according to an embodiment of the present invention. [Figure 19] 11 is a flowchart illustrating another example of a method for selectively deriving a frequency conversion scheme for a residual image of a chrominance signal according to an intra-picture 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] 11 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] 1 is a diagram illustrating an example of a resolution difference between a luminance block and a chrominance block; [Diagram 23] 13 is a diagram illustrating another example of a resolution difference between a luminance block and a chrominance block; [Figure 24] 13 is a diagram showing another example of an encoding device according to the present invention. [Diagram 25] 13 is a diagram showing another example of a decoding device according to the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] Hereinafter, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing the embodiments of the present specification, if a detailed description of related known configurations or functions is determined to unnecessarily obscure the gist of the 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 in between. In addition, in this specification, when a description is made that a specific component "includes," it does not exclude components other than the component, but means that additional components may be included in the scope of the implementation of the present invention or the technical idea of the present invention.
[0017] Terms such as "first" and "second" may be used to describe various configurations, but the configurations are not limited to these terms. The terms are used to distinguish one component from another. For example, a first configuration may be called a second configuration, and similarly, a second configuration may be called a first configuration, without departing from the scope of the present invention.
[0018] In addition, components disclosed in the embodiments of the present invention are illustrated independently to show 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 list of components for convenience of explanation, and at least two components among the components may be integrated into one component, or one component may be divided into multiple components to perform a function. Both integrated and separated embodiments of each component are included in 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 including only the components essential for the realization of the essence of the present invention, excluding components merely used for improving performance, and a structure including only the 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 a configuration according to 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 performing encoding on the input image in an intra mode or an inter mode. Intra prediction means intra-frame prediction, and inter prediction means 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 means an original picture.
[0023] In the case of the intra mode, the intra prediction unit 120 may generate a prediction block by performing spatial prediction using pixel values of already-encoded blocks surrounding the current block.
[0024] In the case of an 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 prediction 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 a current block and a block in a reference image.
[0025] The subtractor 125 may generate a residual block based on a difference between an input block and the generated prediction block. The transform unit 130 may output a transform coefficient by performing a transform on the residual block. The quantizer 140 may output a quantized coefficient by quantizing the input transform coefficient 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 used in the encoder.
[0026] The entropy coding unit 150 may output a bit stream by performing entropy coding based on a value calculated by the quantization unit 140 or a coding parameter value calculated during a coding process. When entropy coding is applied, a small number of bits are assigned to a symbol having a high occurrence probability, and a large number of bits are assigned to a symbol having a low occurrence probability to represent the symbol, thereby reducing the size of a bit string for a symbol to be coded. Therefore, the compression performance of video coding may be improved through entropy coding. The entropy coding unit 150 may use a coding method such as Exponential-Golomb Code, Context-Adaptive Variable Length Coding (CAVLC), or Context-Adaptive Binary Arithmetic Coding (CABAC) for entropy coding.
[0027] Since the video encoding apparatus according to the embodiment of Fig. 1 performs inter-prediction encoding, i.e., inter-frame predictive encoding, a currently encoded image needs to be decoded and stored to be used as a reference image. Therefore, the quantized coefficients are inverse quantized by the inverse quantization unit 160 and inverse transformed by the inverse transform unit 170. The inverse quantized and inverse transformed coefficients become a reconstructed residual block and are 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 the reconstructed picture. The filter unit 180 is also called an in-loop filter. The deblocking filter can remove block distortion that occurs at the boundary between blocks. The SAO can add an appropriate offset value to a pixel value 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 a reference image buffer 190.
[0029] FIG. 2 is a block diagram showing a configuration according to an embodiment of a video decoding device to which the present invention is applied.
[0030] 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 may receive a bitstream output from an encoder and perform 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 bit stream 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 coding method described above.
[0033] When the entropy decoding method is applied, symbols are represented by allocating 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 transformation of the quantized coefficients.
[0035] The quantization matrix used in the inverse quantization is also called a scaling list. The inverse quantization unit 220 may generate inverse quantized coefficients by applying the quantization matrix to the quantized coefficients.
[0036] At this time, 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 a bitstream, or a base matrix already held by the encoder and / or decoder may be used. The information on the quantization matrix to be transmitted may be received by the size of the quantization matrix or the size of the transform block to which the quantization matrix is applied via a sequence parameter set or a picture parameter set. For example, a 4×4 quantization matrix may be received for a 4×4 transform block, an 8×8 matrix may be received for an 8×8 transform block, a 16×16 matrix may be received for a 16×16 transform block, and a 32×32 matrix may be received for a 32×32 transform block.
[0038] In the case of the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values of already decoded blocks surrounding the current block. In the case of the inter mode, the motion compensation unit 250 may generate a prediction 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 within a largest coding unit (hereinafter, referred to as an 'LCU') when encoding an image.
[0042] An image input to an encoding device may be sequentially divided into LCU units as shown in FIG. 3, and then a partition structure may be determined for each LCU.
[0043] The partition structure means a distribution of CUs for efficiently encoding an image in an LCU. The distribution of CUs can be determined by determining whether to partition a CU into four CUs by halving its size vertically and horizontally. The partitioned CU can be recursively partitioned into four CUs by halving its size vertically and horizontally in the same manner.
[0044] At this time, the division of CUs may be performed up to a predefined depth. Depth information is information indicating 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 and horizontally, the depth of the CU increases by 1. At each depth, if a CU is not split, it has a size of 2N x 2N, and if split is performed, the CU that was 2N x 2N before splitting is split into 4 CUs of size N x N.
[0046] The size of a CU is reduced by half every time the depth increases by 1. In FIG 3, an example will be described in which an LCU with a minimum depth of 0 has a size of 64x64 pixels and an SCU with a maximum depth of 3 has a size of 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 divide a CU is expressed by 1-bit division information for each CU. This division information is included in all CUs except for SCUs, and the value of the division information can be set to 0 if the CU is not divided, and set to 1 if the CU is divided.
[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 may 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 a quadtree structure.
[0055] Intra prediction encoding / decoding can perform predictive encoding according to direction from neighboring blocks of a current block.
[0056] In intra-frame prediction, encoding / decoding is performed using a total of 36 prediction modes, including 33 directional prediction modes and 3 non-directional prediction modes.
[0057] FIG. 6 is a diagram for explaining an outline of intra prediction modes.
[0058] Of 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 for predicting a chrominance signal from a restored luminance signal (LM; Intra_FromLuma). In intra-frame prediction can use all three non-directional modes, or can use only some of them. For example, only the planar mode and the average mode are used, and the LM mode is not used.
[0059] The coding for the 36 intra-picture prediction direction modes can be applied to the luminance signal and the chrominance signal, respectively. In the case of the luminance signal, the LM mode can be excluded, and in the case of the chrominance signal, the coding for the intra-picture prediction direction modes can be performed in three ways as shown in Table 1.
[0060] [Table 1]
[0061] In Table 1, the first mode is a derived mode (DM) that applies the intra prediction direction mode of the luminance signal directly to the intra prediction direction mode of the chrominance signal, and the second mode is an explicit mode (EM) that applies the actual intra prediction direction mode. The intra prediction direction modes of the chrominance signal coded in the EM mode include a planar mode (Planar), a mean mode (DC), a horizontal mode (Hor), a vertical mode (Ver), and a mode positioned 8th in the vertical direction (Ver+8 or 34th mode). Finally, there is a LM mode that predicts a chrominance signal from a restored luminance signal.
[0062] Among these three modes of encoding / decoding, the most efficient one can be selected.
[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 uses a linear correlation between the chrominance signal and the luminance signal. An example of the linear correlation used at this time is shown in Equation 1.
[0064]
number
[0065] FIG. 7 is a diagram for explaining the relationship of Equation 1.
[0066] Pred in formula 1 c [x,y] is the predicted value of the chroma signal in Figure 7(a), and Rec L [x, y] represents a value calculated by Equation 2 for the 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 chrominance signal.
[0069] By using the predicted image for the chrominance signal obtained through Equations 1 and 2, a differential image, which is a difference from an original image, can be generated.
[0070] The residual image is entropy coded through frequency domain transformation and quantization, including integer transform, integer discrete cosine transform (DCT), integer discrete sine transform (DST), or intra-prediction mode-dependent DCT / DST.
[0071] As described above, the differential image between the original image and the predicted image may be entropy coded after undergoing frequency domain transformation and quantization. In this case, in order to increase the efficiency of the entropy coding, the coefficients of the quantized image in a two-dimensional form may be rearranged into a one-dimensional form.
[0072] Conventionally, a zigzag scanning method has been used. In contrast, in this specification, a scanning method for quantized coefficients can be used in an up-right direction, which is not a zigzag scanning method. In addition, the frequency domain transform can 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 sub-blocks of size 4×4.
[0074] FIG. 8 is a diagram illustrating an example of scanning the importance 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 a basic method of scanning, and FIG. 8(b) shows a simple example of scanning actual quantized coefficients and the results thereof.
[0077] Whether or not 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 4×4 sub-block, and if significant_coeff_group_flag is '0', it means that no quantized transform coefficient exists in the 4×4 sub-block. In FIG. 8, the scanning direction for the 4×4 sub-block and the scanning direction for significant_coeff_group_flag are both basically the up-right scanning direction.
[0078] Although it has been described in FIG. 8 that the scanning method in the up-right direction is applied, the scanning method for the quantized coefficients may be in the up-right direction, horizontal direction, or vertical direction.
[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 may be selected differently depending on the intra prediction direction, and may be applied to both the luminance signal and the chrominance signal.
[0081] Table 2 illustrates an example of a method for determining 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 an IntraPredMode value in the case of a luminance signal and to an IntraPredModeC value in the case of a chrominance signal. Also, "log2TrafoSize" means the size of the current transform block expressed using 'log'.
[0084] For example, IntraPredModeValue='1' means "Intra_DC" mode, and "log2TrafoSize-2"='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 according to a screen prediction direction.
[0087] In Fig. 9, IntraPredMode means an intra-picture prediction direction mode for a luminance signal, and IntraPredModeC means an intra-picture 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 the upper right direction (DIAG; Up-right=0), the horizontal direction (HOR; Horizontal=1), and the vertical direction (VER; Vertical=2).
[0088] The example of Fig. 9 may be implemented in an encoder device and a decoder device, or may 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 Fig. 10, the scanning method for the luminance signal and the scanning method for the chrominance signal are expressed as being different. In the figure, an index is an indicator indicating the magnitude of transformation, and the index value according to each transformation magnitude can be obtained 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 drawing that scanning according to the intra prediction direction is applied to 8x8 transform size and 4x4 transform size for luminance signals, and is applied only to the smallest transform size, 4x4, for chrominance signals. Also, when scanning according to the intra 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, the residual image between the original image and the predicted image is subjected to frequency domain transformation and quantization, and then entropy coding. In order to increase the efficiency of the 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 according to the block size.
[0095] In addition, in the decoding process, the residual image is decoded through entropy decoding, inverse quantization, and inverse transform in the frequency domain. 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 according to 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 block of 4x4 size (iWidth==4). If the current block is not a block of 4x4 size (iWidth==4), the frequency transform method for the residual image of the luminance signal and the 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 block of 4×4 size (iWidth==4)), the intra prediction direction mode of the current block is checked.
[0101] If the intra-screen prediction direction mode of the current block is greater than '2' and less than '10', the frequency transformation method for the luminance signal of the current block is to apply integer discrete sine transform (DST) in the horizontal direction and 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 prediction direction mode of the current block is '0' or is greater than '11' and less than '25', integer discrete sine transform (DST) is applied in both the horizontal and vertical directions as a frequency transform method for the luminance signal of the current block.
[0104] In the frequency transformation method for the color difference signal of the current block, an integer discrete cosine transform (DCT) is performed 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 transformation method for the luminance signal of the current block is to apply integer discrete cosine transform (DCT) in the horizontal direction and integer discrete sine transform (DST) in the vertical direction.
[0106] In the frequency transformation method for the color difference signal of the current block, an integer discrete cosine transform (DCT) is performed 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 blockWidth: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 and chrominance signals 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 an 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. If not, the variables horizTrType and vertTrType are set to '0'.
[0121] [Table 3]
[0122] It performs an inverse transform process on the scaled transform coefficients using the variables horizTrType and vertTrType. First, it receives the size (nW, nH) of the current block, the scaled transform coefficient array (nW×nH array d), and the variable horizTrType, and performs a 1D inverse transform in the horizontal direction to output the array (nW×nH array e).
[0123] Next, an array (nW×nH array e) is input and an 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, an array (nW×nH array r) for the residual signal is set according to cIdx as shown in Equation 4.
[0127]
number
[0128] Here, 'shift' is 20-BitDepth when cIdx is '0'. Y otherwise, shift=20-BitDepth C It has a value, BitDepth means the number of bits of a sample for the current image (eg, 8 bits).
[0129] As described above, a method of predicting a color difference signal from a luminance signal sample restored by a method of predicting a color difference signal (Intra_FromLuma) can also be used.
[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 to improve coding efficiency. In contrast, only the integer discrete cosine transform (DCT) is used for the conventional 4x4 chrominance signal blocks.
[0133] The characteristics of the chrominance residual image may be similar to those of the luminance residual image, and therefore, the selective frequency transform method according to the intra-frame prediction direction mode applied to the luminance residual image may 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 the method of predicting a chrominance signal (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 such characteristics, a selective frequency transform method for the residual signal of the chrominance signal can be used to improve the 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] [Example 1] Method and apparatus for guiding the scanning direction for a color difference signal to the intra-frame prediction direction mode of 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 the present embodiment.
[0139] In the example of Fig. 12, the guidance of the scanning direction for the chrominance signal may be determined as 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 guide the scanning direction of the chrominance signal, there is a complexity reduction effect.
[0140] The operations of FIG. 12 may 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 top for the chroma and luma components of the current block (S1260). That is, the scan type for the luma component and the scan type for the chroma component of the current block are both from the top right to the top.
[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 and chroma components 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 and chroma components 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 not between 6 and 14 or between 22 and 30, a scan from the top right is applied to the luminance and chrominance components of the current block (S1260).
[0147] 13 is a flow chart illustrating another example of a method for guiding a scanning direction for a color difference signal according to the present embodiment. According to the example of FIG. 13, the effect of unifying the scanning method for the luminance signal and the scanning method for the color difference signal can be obtained.
[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, scanning from the top right direction is applied to the luminance signal and the chrominance signal of the current block (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 that specifies 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). The information IntraPredMode indicating the intra prediction mode of 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 in the upper right direction is applied to the luminance signal and the 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 not between 6 and 14, or between 22 and 30, a scan in the upper right direction 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] That is, the flowchart of Fig. 13 can be applied to the scanning of the luminance signal in the same manner. In steps S1350 and S1360, the reason for indicating IntraPredMode(C) using parentheses is that for the luminance signal, an intra prediction mode for the luminance signal can be determined and applied via IntraPredMode, and for the 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] When the examples of FIG. 12 and FIG. 13 are reflected in a syntax structure for a transform unit (TU), the result is 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 means the order of the bitstream for one TU block, log2TrafoSize means the result of right-shifting the sum of input log2TrafoWidth and log2TrafoHeight, and means the size of a TU block for a luminance signal, and log2TrafoSizeC means the size of a TU block for a chrominance signal.
[0164] PredMode means 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 the upper right direction (DIAG; Up-right = 0), horizontal direction (HOR; Horizontal = 1), or vertical direction (VER; Vertical = 2).
[0165] scanIdxC indicates scanning direction information for the chrominance signal of the current TU block, and can be the upper right direction (DIAG; Up-right=0), the horizontal direction (HOR; Horizontal=1), or the 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] In relation to Table 4, the transform coefficient level may be parsed into a transCoeffLevel array. In this case, if PredMode is Intra, different scanning directions are applied according to the intra-frame prediction direction mode. Such scanning directions may 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 device for directly using the scanning direction of the luminance signal for the chrominance signal when the intra-screen prediction direction mode of the chrominance signal is "Intra_FromLuma"
[0171] FIG. 14 is a flow chart illustrating an embodiment of a method for deriving a scanning direction for a color difference signal according to the present invention.
[0172] 14, it is determined whether an intra prediction direction mode of a chrominance signal of a current block is an intra prediction mode (S1410). If the intra prediction mode is not applied, scanning in the upper 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 induce 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 not between 6 and 14, or between 22 and 30, a scan in the upper right direction 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 as it is for the chrominance signal 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 the "Intra_FromLuma" mode
[0179] FIG. 15 is a flow chart illustrating an embodiment of a method for guiding a scanning direction for a color difference signal according to the present invention.
[0180] Referring to FIG. 15, it can be seen that DM (meaning a method of using the intra prediction direction mode of the luma signal as the intra prediction direction mode of the chroma signal, or the case where the intra prediction direction of the chroma signal is the same as the intra prediction direction of the luma signal) and LM (Intra_FromLuma) methods are unified into one.
[0181] First, it is determined whether the current block is intra-predicted (S1505). If the current block is not intra-predicted, scanning from the top right 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 it 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-picture encoding or decoding of a chrominance signal is restricted to be performed using only DM mode without using LM mode due to profiling by 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, vertical scanning is applied to the luminance signal of the current block (S1565).
[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] Meanwhile, 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), and 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 in order 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 4×4 or 2×2) (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] When the examples of FIG. 14 and FIG. 15 are reflected in a syntax structure for a transform unit (TU), the result is 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 order of the bitstream 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 denotes a coding mode for the current block, and is 'Intra' in the case of intra coding and 'Inter' in the case of inter coding.
[0196] scanIdx indicates scanning direction information for the luminance signal of the current TU block, and can be the upper right direction (DIAG; Up-right=0), the horizontal direction (HOR; Horizontal=1), or the vertical direction (VER; Vertical=2).
[0197] scanIdxC indicates scanning direction information for the chrominance signal of the current TU block, and can be the upper right direction (DIAG; Up-right=0), the horizontal direction (HOR; Horizontal=1), or the 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] In relation 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 according to 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 a luminance signal, an IntraPredMode value indicating a luminance signal intra prediction mode is used as an IntraPredModeValue value in the following table, and when obtaining scanIdxC, which is a scanning direction indicator for a chrominance signal, an IntraPredModeC value indicating a chrominance signal intra prediction mode is used as an 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. In this case, 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 a 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 a 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 of multiplying a restored luminance signal block by a weight and then adding an offset.
[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 the present embodiment can be applied to all methods of predicting a chrominance block, where 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 can 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 can be set so that the encoder and decoder use a predetermined value, or can use a value determined according to a profile or level. When the encoder writes the variable value in the bitstream, the decoder can obtain and use this value from the bitstream.
[0213] When the application range is to be 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 equal to or greater than a given depth, Method B) A method that applies only to depths equal to or 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-mentioned method for determining the range to which the method of the present invention is applied can be applied to the above-mentioned Example 1 and the following Examples, either individually or in combination.
[0218] [Embodiment 3] Method and apparatus for selectively deriving a frequency conversion scheme for a residual image of a chrominance signal according to an intra-frame prediction direction mode of the chrominance signal
[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 by intra-picture coding (Intra) and is a block of size 4×4 (trafoSize (or iWidth)==4) (S1605), the frequency transform method for the current block is an integer discrete sine transform (DST) or an 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 a frequency transform scheme of a 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 derive a 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-screen 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 may apply DST, DCT, or other frequency transform methods.
[0227] Next, if the intra-screen 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) in the horizontal direction and an integer discrete cosine transform (DCT) in the vertical direction (S1645).
[0228] On the other hand, if the intra-screen 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] In addition, if the intra-screen 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] If not, integer discrete cosine transform (DCT) can be applied in both horizontal and vertical directions as a frequency transform scheme for the current block (luminance and chrominance signal block) (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 reflecting the example of FIG.
[0233] The input here is as follows:
[0234] -Width of current transformation blockWidth: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] 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. If not, the variables horizTrType and vertTrType are set to '0'.
[0243] When the intra-prediction direction mode of the chrominance signal is '35', the variables horizTrType and vertTrType are set to '0'.
[0244] [Table 9]
[0245] It performs an inverse transform process on the scaled transform coefficients using the variables horizTrType and vertTrType. First, it receives the size (nW, nH) of the current block, the scaled transform coefficient array (nW×nH array d), and the variable horizTrType, and performs a 1D inverse transform in the horizontal direction to output the array (nW×nH array e).
[0246] Next, an array (nW×nH array e) is input and an 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, an array (nW×nH array r) for the residual signal is set according to cIdx as shown in Equation 6.
[0250]
number
[0251] Here, the shift is 20-BitDepth when cIdx is '0'. Y otherwise, shift=20-BitDepth C It has a value, BitDepth means the number of bits of a sample for the current image (eg, 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 intra-picture coded, 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 luminance or chrominance signal of the current block is obtained (S1715). Here, when inducing a frequency conversion method for the luminance signal, IntraPredMode(C) is changed to IntraPredMode (intra prediction direction mode for the luminance signal), and when inducing a frequency conversion method for the chrominance signal, IntraPredMode(C) is changed to IntraPredModeC (intra prediction direction mode for the chrominance signal). Here, the intra prediction direction mode for the luminance signal of the current block can be used to inducing a frequency conversion method for 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 inducing a frequency conversion method for the residual image for the chrominance signal.
[0255] At this time, an intra-frame prediction direction mode for selecting a frequency transform method can be obtained by various methods such as any 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 all of the residual images for the luminance signal and the chrominance signal to derive a frequency conversion method.
[0257] 2. The intra prediction direction mode for the chrominance signal of the current block can be applied to all of 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 other methods.
[0260] Next, it is determined whether the current block is a 4×4 block (iWidth==4) (S1720). If the current block is not a 4×4 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 block of 4×4 size (iWidth==4)), the intra prediction direction mode of the current block is checked.
[0262] If the intra-screen 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-screen 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-screen 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] If not, 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 (S1755).
[0266] At this time, the frequency transform method according to the intra prediction direction mode can be used in various ways. For example, if the intra 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 a frequency transform method for the current block, an integer discrete cosine transform (DCT) can be applied to the horizontal direction and an integer discrete sine transform (DST) can be applied to the vertical direction. Alternatively, as a frequency transform method for the current block, an integer discrete cosine transform (DCT) can be applied to both the horizontal and vertical directions, or an integer discrete sine transform (DST) can be applied to both the horizontal and vertical directions. Alternatively, an integer discrete sine transform (DST) can be applied to all horizontal and vertical directions except for DC (average prediction, non-directional mode) mode.
[0267] The method of applying various frequency transform methods 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 content can be applied in the same way to the following embodiments.
[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 FIG. 17.
[0270] The input here is as follows:
[0271] -Width of current transformation blockWidth:nW
[0272] -Current conversion block height: nH
[0273] -element ijan array of scaled transform coefficients having the (nW × nH) array d
[0274] - Index for the luminance and chrominance signals of the current block: cIdx
[0275] If cIdx is '0', it means a luminance signal, if cIdx is '1' or '2' it means a color difference signal, if cIdx is '1' it means a color difference signal Cb, if cIdx is '2' it means a color difference signal Cr.
[0276] The output here is as follows:
[0277] Array for the residual signal obtained by inversely 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. If not, the variables horizTrType and vertTrType are set to '0'.
[0279] [Table 10]
[0280] It performs an inverse transform process on the scaled transform coefficients using the variables horizTrType and vertTrType. First, it receives the size (nW, nH) of the current block, the scaled transform coefficient array (nW×nH array d), and the variable horizTrType, and performs a 1D inverse transform in the horizontal direction to output the array (nW×nH array e).
[0281] Next, an array (nW×nH array e) is input and an 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, the shift is 20-BitDepth when cIdx is '0'. Y otherwise, shift=20-BitDepth C It has a value, BitDepth means the number of bits of a sample for the current image (eg, 8 bits).
[0287] [Embodiment 4] Method and apparatus for selectively deriving a frequency conversion scheme for residual image of chrominance signal according to intra-picture prediction direction mode of luminance signal for Intra_FromLuma (LM) coding mode of chrominance signal
[0288] FIG. 18 is a flowchart illustrating a method for selectively deriving a frequency conversion scheme for a residual image of a chrominance signal according to an intra-picture 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 by intra-picture coding (Intra) and is a block of size 4×4 (trafoSize (or iWidth)==4) (S1810), the frequency transform method for the current block is integer discrete sine transform (DST) or integer discrete cosine transform (DCT) (S1855). Otherwise, the frequency transform method for the current block may be 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), a DCT can be applied (S1855).
[0293] Next, if the intra-screen 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) in the horizontal direction and an integer discrete cosine transform (DCT) in the vertical direction (S1840).
[0294] On the other hand, if the intra-screen 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] Also, 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) may apply integer discrete cosine transform (DCT) in the horizontal direction and integer discrete sine transform (DST) in the vertical direction (S1850). Otherwise, the frequency transform method for the current block (luminance and chrominance signal block) may apply integer discrete cosine transform (DCT) in both the horizontal and vertical directions (S1855).
[0296] Meanwhile, a 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.
[0298] The input here is as follows:
[0299] -Width of current transformation blockWidth: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 and chrominance signals 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 an intra prediction mode (Intra) and the Log2(nW*nH) value is '4', 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 a 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] It performs an inverse transform process on the scaled transform coefficients using the variables horizTrType and vertTrType. First, it receives the size (nW, nH) of the current block, the scaled transform coefficient array (nW×nH array d), and the variable horizTrType, and performs a 1D inverse transform in the horizontal direction to output the array (nW×nH array e).
[0309] Next, an array (nW×nH array e) is input and an 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, the shift is 20-BitDepth when cIdx is '0'. Y otherwise, shift=20-BitDepth C It has a value, BitDepth means the number of bits of a sample for the current image (eg, 8 bits).
[0315] FIG. 19 is a flowchart illustrating another example of a method for selectively deriving a frequency conversion 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 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 in 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 condition 1 or condition 2 is satisfied), the intra-screen 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 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.
[0320] Next, it is determined whether the current block is a block of 4×4 size (iWidth==4) (S1920). If the current block is not a block of 4×4 size (iWidth==4), 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). If not (if the current block is a block of 4×4 size (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 in the horizontal direction and an integer discrete cosine transform (DCT) can be applied in the vertical direction 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 both the horizontal and vertical directions as a frequency transform method for the luminance signal of the current block (S1945). If the chrominance signal of the current block is coded in the 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 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).
[0324] On the other hand, if the intra prediction direction mode of the current block is greater than '26' and less than '34' (S1935), the frequency transform method for the luminance signal of 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 (S1950). If the chrominance signal of the current block is coded in the 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 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).
[0325] If not, an integer discrete cosine transform (DCT) is 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 (S1955).
[0326] The transformation process for scaled transform coefficients reflecting the above example is as follows:
[0327] The transformation process for the scaled transform coefficients reflects the example of FIG.
[0328] The input here is as follows:
[0329] -Width of current transformation blockWidth: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 and chrominance signals 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 an intra prediction mode (Intra) and the Log2(nW*nH) value is '4', 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 a 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. If not, the variables horizTrType and vertTrType are set to '0'.
[0337] [Table 12]
[0338] It performs an inverse transform process on the scaled transform coefficients using the variables horizTrType and vertTrType. First, it receives the size (nW, nH) of the current block, the scaled transform coefficient array (nW×nH array d), and the variable horizTrType, and performs a 1D inverse transform in the horizontal direction to output the array (nW×nH array e).
[0339] Next, an array (nW×nH array e) is input and an 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, the shift is 20-BitDepth when cIdx is '0'. Y otherwise, shift=20-BitDepth C It has a value, BitDepth means the number of bits of a sample for the current image (eg, 8 bits).
[0345] Here, this embodiment can be applied not only when the current chrominance block is coded in the "Intra_FromLuma" mode, but also to various other cases such as 1 or 2 below.
[0346] 1. In predicting a chrominance block, the present invention can be applied to all methods of applying an offset after multiplying a weighted value by a restored luminance block.
[0347] 2. In predicting a chrominance block, a template shift for the restored luminance signal block and chrominance signal block is used, so that the method can be applied to all methods of predicting a chrominance block, where the template shift is used to infer 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 scheme for a residual image of a chrominance signal according to an 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 4×4 size (trafoSize (or iWidth)==4) (S2010). First, if the current block is coded using intra-picture coding (Intra) and is a block of 4×4 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). If not, 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 an 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 a frequency transform method of a 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 is a DM block, DCT can be applied (S2065). On the other hand, if the current block is a chrominance block and is not a DM block, the intra prediction direction mode for the chrominance signal can be used to derive a frequency transform method of a residual image for the chrominance signal (S2030).
[0355] Here, when a chrominance block is coded in DM mode, the intra-screen 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 may apply DST, DCT, or other frequency transform methods.
[0356] Next, if the intra-screen 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-screen 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), 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] In addition, if the intra-screen 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] If not, an integer discrete cosine transform (DCT) can be applied in both the horizontal and vertical directions as a frequency transform scheme for the current block (luminance and chrominance signal block) (S2065).
[0360] Here, the method of selectively applying the frequency conversion method may 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-screen 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 in various other ways.
[0365] A method of performing a transformation process for scaled transform coefficients reflecting the method of FIG. 20 described above is as follows.
[0366] The transformation process for scaled transform coefficients reflecting the example of FIG. 20.
[0367] The input here is as follows:
[0368] -Width of current transformation blockWidth: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 and chrominance signals 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 an 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, and if the current block is a chrominance signal, and 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 according to Table 13 below. On the other hand, 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 according to the table below. If not, the variables horizTrType and vertTrType are set to '0'.
[0376] [Table 13]
[0377] It performs an inverse transform process on the scaled transform coefficients using the variables horizTrType and vertTrType. First, it receives the size (nW, nH) of the current block, the scaled transform coefficient array (nW×nH array d), and the variable horizTrType, and performs a 1D inverse transform in the horizontal direction to output the array (nW×nH array e).
[0378] Next, an array (nW×nH array e) is input and an 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, the shift is 20-BitDepth when cIdx is '0'. Y otherwise, shift=20-BitDepth C It has a value, BitDepth means the number of bits of a sample for the current image (eg, 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 for the luminance signal and the 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 not a luminance signal and the coding mode of the current block is not 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 a 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 a frequency transform method of the residual image for the chrominance signal.
[0389] Furthermore, 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 block of 4×4 size (iWidth==4) (S2125). If the current block is not a block of 4×4 size (iWidth==4), 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) (S2160). If not (if the current block is a block of 4×4 size (iWidth==4)), the intra prediction direction mode of the current block is checked.
[0391] Here, when inducing a frequency conversion method for a luminance signal, IntraPredMode(C) is changed to IntraPredMode (intra-screen prediction direction mode for a luminance signal), and when inducing a frequency conversion method for a chrominance signal, IntraPredMode(C) is changed to IntraPredModeC (intra-screen prediction direction mode for a chrominance signal).
[0392] If the intra-screen 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-screen 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 in both the horizontal and vertical directions as a frequency transform scheme for the residual images of the luminance and chrominance signals of the current block (S2160).
[0396] The method of reflecting the method according to the above example in the transformation process for scaled transform coefficients is as follows.
[0397] The transformation process for scaled transform coefficients reflecting the example of FIG. 21.
[0398] The input here is as follows:
[0399] -Width of current transformation blockWidth: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 and chrominance signals 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 an intra prediction mode (Intra), and the Log2(nW*nH) value is '4' and it 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, if it 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. If not, the variables horizTrType and vertTrType are set to '0'.
[0407] [Table 14]
[0408] An 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 1-dimensional inverse transform is performed in the horizontal direction to output the array (nW×nH array e).
[0409] Next, an array (nW×nH array e) is input and an 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 according to cIdx as shown in Equation 16.
[0413]
number
[0414] Here, the shift is 20-BitDepth when cIdx is '0'. Y otherwise, shift=20-BitDepth C It has a value, BitDepth means the number of bits of a sample for the current image (eg, 8 bits).
[0415] The above-mentioned method may be applicable 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., magnitude or depth information) can be set so that the encoder and decoder use predetermined values, or can use values determined by the profile or level, and if the encoder writes the variable value in the bitstream, the decoder can obtain and use this value from the bitstream.
[0417] When the application range is varied according to the CU depth, the following three methods can be applied as shown in Table 15: Method A) A method that applies only to depths equal to or greater than a given depth, Method B) A method that applies only to depths equal to or less than a given depth, and Method C) A method that applies only to a given depth.
[0418] Table 15 shows an example of a range determination scheme for applying the method of the present invention when the given CU (or TU) depth is 2. In Table 15, O shows an example of a range determination scheme for applying the method of the present invention when the given CU (or TU) depth is 2. In Table 15, O indicates that it is applicable to the depth, and X indicates that it 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 resolution difference between a luminance block and a chrominance block. In the example of FIG. 22, a luminance signal is an 8×8 block 2210, and a chrominance signal is a 4×4 block 2220.
[0424] 22, there are four 4×4 blocks in the luminance signal 2210, and each 4×4 block can have an intra prediction direction mode. On the other hand, the chrominance signal 2220 cannot be divided into 2×2 blocks.
[0425] In this case, the chrominance signal may have one intra prediction direction mode for each 4×4 block. In this case, when the chrominance signal is coded in Intra_FromLuma (LM) mode (or when 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 the four 4×4 blocks may be used as the intra prediction direction mode of the luminance signal for inducing a frequency transform scheme for the residual image of the chrominance signal.
[0426] In order to selectively apply a frequency transform scheme to a residual image of a chrominance signal, a method of deriving an intra-frame prediction direction may be applied in various ways, such as 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 may 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 resolution difference between the luminance block and the chrominance block.
[0433] 23, the luminance signal 2310 has one 16×16 block and can have one intra prediction mode, whereas the chrominance signal 2320 can be divided into four 4×4 blocks and can have an intra prediction direction mode for each of the 4×4 blocks.
[0434] In this case, when the chrominance signal is coded in Intra_FromLuma (LM) mode (or when 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)), the intra prediction direction mode of one luminance signal can be used to derive a frequency transform method for the residual image 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 image block of the chrominance signal.
[0435] In addition, the above-mentioned method can be applied differently to chrominance blocks depending on the size of the luminance block, can be applied differently to luminance signal images and chrominance images, and can apply frequency conversion methods differently in the horizontal and vertical directions.
[0436] Table 16 outlines this combination method.
[0437] [Table 16]
[0438] Looking at method “T1” among the modified methods in Table 16, 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, the chrominance signal, and the horizontal and vertical signals.
[0439] Among the modified methods, in method "W2", 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 (W2-Example 1), Example 2-1 or Example 2-2 (W2-Example 2-1 or Example 2-2), and Example 3 (W2-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 other 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 applying an offset after multiplying a weighted value by a restored luminance block.
[0442] 2. In predicting a chrominance block, a template shift for the restored luminance signal block and chrominance signal block is used, so that the method can be applied to all methods of predicting a chrominance block, where the template shift is used to infer the correlation between the luminance signal and the chrominance signal.
[0443] There are many other possible applications.
[0444] [Example 6] Method and apparatus for comprehensively determining the conversion method and scanning method of color difference signals
[0445] As described above, the scanning method for the residual signal (difference image) of the chrominance signal may vary depending on the intra-picture prediction direction mode of the chrominance signal.
[0446] Also, the frequency conversion method for the residual signal (difference image) of the chrominance signal may vary depending on the intra-picture 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 conversion method for the residual signal of the chrominance signal. However, 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 certain 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 the first embodiment and the second embodiment and the frequency conversion method in the third embodiment, the fourth embodiment, and the fifth embodiment may be integrated and determined as shown in Table 17.
[0449] Table 17 shows an example of a method for determining a scanning method and a frequency conversion method for a residual signal of a color difference signal in an integrated manner according to this embodiment.
[0450] [Table 17]
[0451] Table 17 shows a combination of a scanning method and a frequency transform method for a residual signal of a chrominance signal that are jointly determined. Here, EM, DM, and LM modes indicate an intra-frame prediction direction mode coding method for a chrominance signal.
[0452] A mode for a chrominance signal derived by directly applying the intra prediction direction mode of a luminance signal as the intra prediction direction mode of a chrominance signal is called a Derived Mode (DM). A mode for a chrominance signal that actually encodes the intra prediction direction mode is called an Explicit Mode (EM). As intra prediction direction modes for a chrominance signal encoded in the EM mode, there are a planar mode (Planar), a average mode (DC), a horizontal mode (Hor), a vertical mode (Ver), and a mode positioned 8th in the vertical direction (Ver+8 or 34th mode).
[0453] Finally, the LM (Intra_FromLuma) mode is a mode for predicting a color difference signal from a restored luminance signal.
[0454] In Table 17, as an example of combination, 'A', in order 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, in order to determine the scanning method for the transformed coefficients, the scanning method (Examples 1 and 2) is determined using EM and DM among the intra prediction direction modes of the chrominance signal.
[0455] Here, in consideration of coding efficiency, the case where the frequency conversion method is derived using the DM mode among the intra prediction direction modes of the chrominance signal may be excluded. For example, when coding in the 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 the EM mode (Planar mode, Average mode (DC), Horizontal mode (Hor), Vertical mode (Ver), and the mode located 8th in the vertical direction (Ver+8 or 34th mode)), there is no other way but to code in the DM mode, so the intra prediction direction mode of the chrominance signal coded in the DM mode may be degraded in terms of accuracy. Therefore, the DM mode may not be used to determine the frequency conversion method.
[0456] In Table 17, as another example of combination, 'D', in order 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 (embodiments 3, 4, and 5), and then, in order to determine the scanning method for the transformed coefficients, the scanning method (embodiments 1 and 2) is determined using all of EM, DM, and LM among the intra prediction direction modes of the chrominance signal.
[0457] Here, in consideration of coding efficiency, the scanning method may be 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 similar characteristics to the luminance signal, and therefore can be used to determine the scanning method.
[0458] In Table 17, as another example of combination, 'T', all of EM, DM, and LM are used among the intra prediction direction modes of the chrominance signal to determine the frequency transformation method for the chrominance signal. The frequency transformation method is determined using EM, DM, 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).
[0459] In Table 17, as another example of the combination, when the 'T' method is modified, the EM, DM, and LM modes of the intra-frame prediction direction mode of the chrominance signal can be used to determine the frequency transformation method for the chrominance signal. In this case, among the EM, DM, and LM modes, the frequency transformation method can be determined (embodiments 3, 4, and 5) only when the intra-frame prediction direction mode for the actually restored chrominance signal is the 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)). In addition, all of the EM, DM, and LM can be used to determine the scanning method for the transformed coefficients. In this case, among EM, DM, and LM modes, the scanning method (embodiments 1 and 2) can be used only when the intra-screen prediction direction mode for the actually restored chrominance signal is EM mode (Planar mode, DC mode, Horizontal mode, Vertical 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 according to the intra-picture 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 used in an integrated manner.
[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 the present embodiment.
[0464] [Table 18]
[0465] Also, Table 19 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.
[0466] [Table 19]
[0467] Table 20 shows another example of a frequency conversion scheme and a scanning scheme induced based on an intra-frame prediction direction mode according to an embodiment of the present invention.
[0468] [Table 20]
[0469] Table 21 shows another example of a frequency conversion scheme and a scanning scheme induced based on an intra-frame prediction direction mode according to an embodiment of the present invention.
[0470] [Table 21]
[0471] Tables 18 to 21 show an example of integrating tables 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-screen 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-screen 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 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 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-screen 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] In this way, when the frequency conversion method and the scanning method are taken into consideration according to the intra-frame prediction direction mode as shown in Table 19, unlike Table 18, there is an advantage that it can be implemented in a unified manner according to VER and HOR.
[0476] Here, the 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 applying an offset after multiplying a weighted value by a restored luminance block.
[0478] 2. In predicting a chrominance block, a template shift for the restored luminance signal block and chrominance signal block is used, so that the method can be applied to all methods of predicting a chrominance block, where the template shift is used to infer the correlation between the luminance signal and the chrominance signal.
[0479] The above-mentioned 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 identifying the intra prediction mode applied to the current block.
[0484] The intra prediction mode is as described above with reference to FIG.
[0485] The scanning unit 2420 may scan a chrominance signal and / or a luminance signal of the current block, and may determine a scanning type to be applied to the current block in response to an intra prediction mode of the current block.
[0486] A 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 schematic diagram of 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 prediction mode is as described above with reference to FIG.
[0491] The scanning unit 2520 may scan a chrominance signal and / or a luminance signal of the current block, and may determine a scanning type to be applied to the current block according to an intra prediction mode of the current block.
[0492] A 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 above-mentioned exemplary system, 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 steps, and some steps may occur in a different order or simultaneously with other steps than those described above. In addition, the above-mentioned embodiments include examples of various aspects. For example, a combination of each embodiment should also be understood as one embodiment of the present invention.
Claims
1. 1. A video decoding method, comprising: obtaining prediction mode information of a current block; in response to the current block being an intra-coded block, deriving an intra prediction mode associated with the current block; obtaining a prediction 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, the inverse transform being performed in a horizontal direction and a vertical direction; 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 in both the horizontal and vertical directions for all intra-screen 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; in response to the current block being an intra-coded block, deriving an intra prediction mode associated with the current block; obtaining a prediction 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, the inverse transform being performed in a horizontal direction and a vertical direction; 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 Sign Transform) is applied in both the horizontal and vertical directions for all intra-screen prediction direction modes and planar modes of the current block.
Citation Information
Patent Citations
Encoder, decoder, and program
JP2011223068A