Video decoding method, video encoding method and related non-transitory recording medium
Patent Information
- Application Number
- TW114138399
- Authority / Receiving Office
- TW · TW
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2013-06-25
- Filing Date
- 2013-06-28
- Publication Date
- 2026-10-01
- Estimated Expiration
- 2033-06-27
AI Technical Summary
Existing video encoding and decoding technologies face inefficiencies in handling high-resolution and high-quality images, particularly with the transition to Ultra-High Definition (UHD), necessitating improved compression techniques to maintain image quality while optimizing bandwidth and storage.
The method involves deriving a scan type for residual signals based on whether a block is a transform skip block, applying specific scan types such as vertical, horizontal, or upper right scans, depending on the block's characteristics, to enhance encoding and decoding efficiency.
This approach improves encoding and decoding efficiency by tailoring scan types to the characteristics of transform skip blocks, avoiding unnecessary transform processing and enhancing compression performance.
Smart Images

Figure TWG2TB001914064_001 
Figure TWG2TB001914064_002 
Figure TWG2TB001914064_003
Abstract
Description
[Technical Field]
[0001] The present invention relates to the encoding and decoding of an image, and more particularly to a method for scanning residual signals. [Previous Technology]
[0002] Broadcast services with high-definition (HD) resolution (1280×1024 or 1920×1080) are expanding nationally and globally. Consequently, many users are accustomed to video with high resolution and high image quality. Correspondingly, numerous institutions are promoting the development of next-generation imaging devices. Furthermore, with increasing interest in Ultra-High Definition (UHD), which offers four times the resolution of HDTV, along with HDTV, mobile imaging standardization organizations have recognized the need for compression technologies for images with higher resolution and higher image quality. In addition, there is an urgent need for a new standard that can maintain the same image quality while offering numerous advantages in terms of bandwidth or storage through compression efficiency higher than that of H.264 / AVC currently used in HDTV, mobile phones, and Blu-ray players.
[0003] Today, the Moving Picture Experts Group (MPEG) and the Video Coding Experts Group (VCEG) are jointly standardizing High Efficiency Video Coding (HEVC), the next generation of video codecs, aiming to encode UHD video with twice the compression efficiency of H.264 / AVC. This can even provide video with a lower frequency and higher image quality than current video, as well as HD and UHD video, in 3D broadcasting and mobile communication networks. [Summary of the Invention]
[0004] [Technical Issues]
[0005] The present invention provides a method and apparatus for encoding and decoding an image, which can improve the encoding and decoding efficiency.
[0006] This invention provides a method and apparatus for scanning residual signals, which can improve encoding and decoding efficiency. [Technical Solution]
[0007] According to one aspect of the present invention, an image decoding method is provided. The method includes: deriving a scan type of the residual signal of a current block based on whether a current block is a transform skip block; and applying the scan type to the residual signal of the current block, wherein the transform skip block is the current block to which the transform has not yet been applied and is specified based on information indicating whether the transform is applied to the current block.
[0008] The scan type for deriving the residual signals of the current block may include, if the current block is a transform skip block, deriving any one of a vertical scan, a horizontal scan, and an upper right scan as the scan type for the residual signals.
[0009] The scan type for deriving the residual signals of the current block may include setting a scan type derived based on an intra-block prediction mode of the current block as the scan type of the residual signals if the current block is a transformed skip block.
[0010] If the scan type derived from the intraprediction mode of the current block is a vertical scan, a horizontal scan can be set again as the scan type of the residual signals.
[0011] If the scan type derived from the intraprediction mode of the current block is a horizontal scan, a vertical scan can be set again as the scan type of the residual signals.
[0012] If the scan type derived from the intraprediction mode of the current block is not a vertical scan or a horizontal scan, then an upper right scan can be set as the scan type of the residual signals again.
[0013] The scan type for deriving the residual signals of the current block may include, if the current block is a transformed skip block and one of the sizes of the current block is a specific size or lower, then deriving any one of a vertical scan, a horizontal scan, and an upper right scan as the scan type for the residual signals of the current block.
[0014] This specific size can be a 4×4 size.
[0015] The scan type for deriving the residual signals of the current block may include setting a scan type again based on the prediction mode within the current block if the current block is a transformed skip block and the size of the current block is a specific size or lower.
[0016] If the scan type derived from the intraprediction mode of the current block is a vertical scan, a horizontal scan can be set again as the scan type of the residual signals.
[0017] If the scan type derived from the intraprediction mode of the current block is a horizontal scan, a vertical scan can be set again as the scan type of the residual signals.
[0018] If the scan type derived from the intraprediction mode of the current block is not a vertical scan or a horizontal scan, then an upper right scan can be set as the scan type of the residual signals again.
[0019] This specific size can be a 4×4 size.
[0020] The scan type for deriving the residual signals of the current block may include, if the current block is not a transform skip block, deriving the scan type for the residual signals of the current block based on an in-block prediction pattern.
[0021] According to another aspect of the present invention, an image decoding apparatus is provided. The apparatus includes: a scan type export module for exporting a scan type of the residual signal of a current block based on whether a current block is a transform skip block; and a scan module for applying the scan type to the residual signal of the current block, wherein the transform skip block is the current block to which the transform has not yet been applied and is specified based on information indicating whether the transform is applied to the current block.
[0022] According to another aspect of the present invention, an image encoding method is provided. The method includes: deriving a scan type of the residual signal of a current block based on whether a current block is a transform skip block; and applying the scan type to the residual signal of the current block, wherein the transform skip block is the current block to which the transform has not yet been applied and is specified based on information indicating whether the transform is applied to the current block.
[0023] According to another aspect of the present invention, an image encoding apparatus is provided. The apparatus includes: a scan type export module for exporting a scan type of the residual signal of a current block based on whether a current block is a transform skip block; and a scan module for applying the scan type to the residual signal of the current block, wherein the transform skip block is the current block to which no transform has been applied and is specified based on information indicating whether the transform should be applied to the current block. [Advantageous Effects]
[0024] Since a transform processing procedure is not performed on a block to which a transform skip algorithm has been applied, the block to which an existing transform processing procedure has been performed has different transform coefficient characteristics than the transform skip block. Accordingly, the encoding and decoding efficiency of the residual signal can be improved by providing a method and apparatus for deriving a scan type that is suitable for the characteristics of a transform skip block, rather than a transform coefficient scan method applied to a block to which an existing transform processing procedure has been performed.
Implementation Method
[0026] Hereinafter, certain exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Furthermore, in describing embodiments of this specification, any detailed description of a known function or structure will unnecessarily obscure the essential points of the present invention; such description will be omitted.
[0027] In this specification, when an element is said to be connected or coupled to another element, it may mean that the one element can be directly connected or coupled to the other element, or that a third element can be connected or coupled between the two elements. Furthermore, in this specification, when a specific element is mentioned, it may mean that elements other than that specific element are not excluded, and that other elements may be included within the scope of the embodiments of the present invention or the technical spirit of the present invention.
[0028] Terms such as "first" and "second" may be used to describe various elements, but such elements are not limited by such terms. These terms are only used to distinguish one element from another. For example, a first element may be named a second element without departing from the scope of the invention. Similarly, a second element may be named a first element.
[0029] Furthermore, the element units described in the embodiments of the present invention are shown independently to indicate differences and functional characteristics, and do not imply that each of these element units is formed by a single piece of hardware or software. That is, these element units are configured and included for ease of explanation, and at least two of these element units can form an element unit or an element can be divided into a plurality of element units and the plurality of divided element units can perform functions. Embodiments in which these elements are integrated into one of the embodiments or from which certain elements are separated are also included within the scope of the present invention, unless they depart from the spirit of the present invention.
[0030] Furthermore, in this invention, some elements are not essential elements for performing essential functions, but may be optional elements used only to improve performance. This invention may be implemented using only essential elements for implementing the essence of the invention, excluding those used only to improve performance, and structures that include only one of the essential elements, excluding optional elements used only to improve performance, are included within the scope of this invention.
[0031] Figure 1 is a block diagram showing the structure of an image encoding device to which an embodiment of the present invention is applied.
[0032] Referring to FIG1, the image encoding device 100 includes a motion estimation module 111, a motion compensation module 112, an internal prediction module 120, a switcher 115, a subtractor 125, a transform module 130, a quantization module 140, an entropy encoding module 150, a dequantization module 160, an inverse transform module 170, an adder 175, a filter module 180, and a reference image buffer 190.
[0033] The image encoding apparatus 100 can encode an input image in either intra-frame or inter-frame mode and output a one-bit stream. In the intra-frame mode, the switcher 115 can switch to intra-frame mode. In the inter-frame mode, the switcher 115 can switch to inter-frame mode. Intra-frame prediction refers to prediction within a frame, and inter-frame prediction refers to prediction between frames. The image encoding apparatus 100 can generate a prediction block for an input block of the input image and then encode a difference between the input block and the prediction block. Here, the input image may refer to the original picture.
[0034] In the case of the inner mode, the inner prediction module 120 can generate the prediction block by performing spatial prediction using the value of a pixel of a neighboring current block that has already been encoded.
[0035] In the inter-mode case, the motion estimation module 111 can obtain a motion vector by searching a reference image stored in the reference image buffer 190 to find a region that best matches the input block in a motion prediction process. The motion compensation module 112 can generate the predicted block by performing motion compensation using the motion vector and the reference image stored in the reference image buffer 190. Here, the motion vector is a two-dimensional (2-D) vector used in inter-prediction, and the motion vector can indicate an offset between the image to be encoded / decoded and a reference image.
[0036] Subtractor 125 can generate a residual block based on the difference between the input block and the generated prediction block.
[0037] The transformation module 130 can perform a transformation on the residual block and output a transformation coefficient based on the transformed block. In addition, the quantization module 140 can output a quantized coefficient by quantizing the received transformation coefficient according to a quantization parameter.
[0038] The entropy coding module 150 can perform entropy coding on a symbol according to a probability distribution based on the value calculated by the quantization module 140, a coding parameter value calculated in a coding process, etc., and output a bit stream based on the entropy-coded symbols. If entropy coding is applied, the size of a bit stream of a symbol to be encoded can be reduced because the symbol is represented by allocating a small number of bits to a symbol with a high occurrence rate and a large number of bits to a symbol with a low occurrence rate. Accordingly, the compression performance of image coding can be improved through entropy coding. The entropy coding module 150 can use coding methods such as exponential Golomb, context-adaptive binary arithmetic coding (CABAC), and context-adaptive binary arithmetic coding (CABAC) for entropy coding.
[0039] The image encoding apparatus 100 according to the embodiment of FIG1 performs inter-frame predictive coding, that is, inter-frame predictive coding, and therefore an encoded image needs to be decoded and stored for use as a reference image. Accordingly, a quantized coefficient is dequantized by the dequantization module 160 and inversely transformed by the inverse transform module 170. The dequantized and inversely transformed coefficients are added to the prediction block by the adder 175, thereby generating a reconstructed block.
[0040] The reconstructed block undergoes a filter module 180. The filter module 180 can apply one or more of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed block or the reconstructed image. The filter module 180 can also be referred to as an embedded adaptive filter. The deblocking filter removes block distortions generated at the boundaries of the block. The SAO adds an appropriate offset value to a pixel value to compensate for a coding error. The ALF performs filtering based on a value obtained by comparing a reconstructed image with the original image. The reconstructed block that has undergone the filter module 180 can be stored in a reference image buffer 190.
[0041] Figure 2 is a block diagram showing the structure of an image decoding device in which an embodiment of the present invention is applied.
[0042] Referring to FIG2, the image decoding device 200 includes an entropy decoding module 210, a dequantization module 220, an inverse transform module 230, an internal prediction module 240, a motion compensation module 250, a filter module 260 and a reference image buffer 270.
[0043] The image decoding device 200 can receive a bitstream output from an encoder, perform decoding on the bitstream in either inner or outer mode, and output a reconstructed image, i.e., a reconstructed image. In the case of inner mode, a switcher can switch to inner mode. In the case of outer mode, the switcher can switch to outer mode.
[0044] The image decoding device 200 can obtain a reconstructed residual block from the received bit stream, generate a prediction block, and generate a reconstructed block, i.e., a recovery block, by adding the reconstructed residual block to the prediction block.
[0045] The entropy decoding module 210 can generate a symbol including a symbol having a quantized coefficient form by performing entropy decoding on the received bit stream according to a probability distribution.
[0046] If an entropy decoding method is applied, the size of the bit stream for each symbol can be reduced because the symbol is represented by allocating a small number of bits to a symbol with a high occurrence rate and allocating a large number of bits to a symbol with a low occurrence rate.
[0047] The quantized coefficient is dequantized by the dequantization module 220 and inversely transformed by the inverse transform module 230. As a result of the dequantization / inverse transformation of the quantized coefficient, a reconstructed residual block can be generated.
[0048] In the case of the inner mode, the inner prediction module 240 can generate a prediction block by performing spatial prediction using a pixel value of a neighboring encoded block of the current block. In the case of the inter-mode, the motion compensation module 250 can generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference image buffer 270.
[0049] The residual block and the predicted block are added together by adder 255. The added block passes through filter module 260. Filter module 260 can apply at least one of a deblocking filter, a SAO, and an ALF to the reconstructed block or reconstructed image. Filter module 260 outputs a reconstructed image, i.e., a reconstructed image. The reconstructed image can be stored in reference image buffer 270 and can be used for inter-frame prediction.
[0050] Figure 3 is a schematic diagram of the segmentation structure of an image when it is encoded.
[0051] In High Efficiency Video Coding (HEVC), coding is performed in a coding unit to efficiently segment an image.
[0052] Referring to Figure 3, in HEVC, an image 300 is sequentially segmented by the largest coding unit (hereinafter referred to as an LCU), and a segmentation structure is determined based on these LCUs. The segmentation structure refers to a distribution of coding units (hereinafter referred to as CUs) used to efficiently code one image within an LCU 310. This distribution can be determined based on whether a CU will be segmented into four CUs, each of which is halved in both width and height from the original CU. Similarly, a segmented CU can be recursively segmented into four CUs, each of which is halved in both width and height from the segmented CU.
[0053] Here, the partitioning of a CU can be performed recursively up to a predetermined depth. The information about this depth indicates the size of a CU, and information about the depth of each CU is stored. For example, the depth of an LCU can be 0, and the depth of the smallest coding unit (SCU) can be a predetermined maximum depth. Here, the LCU is a maximum CU size as described above, and the SCU is a CU with a minimum CU size.
[0054] Whenever a CU is divided in half from LCU 310 in terms of width and height, the depth of a CU increases by 1. A CU that has not yet been divided has a size of 2N×2N for each depth, and a CU that is being divided is divided from a CU of size 2N×2N into four CUs, each of size N×N. Whenever the depth increases by 1, the size of N decreases by half.
[0055] Referring to Figure 3, the size of an LCU with a minimum depth of 0 can be 64×64 pixels, and the size of an SCU with a maximum depth of 3 can be 8×8 pixels. Here, an LCU with 64×64 pixels can be represented by a depth of 0, a CU with 32×32 pixels can be represented by a depth of 1, a CU with 16×16 pixels can be represented by a depth of 2, and an SCU with 8×8 pixels can be represented by a depth of 3.
[0056] Furthermore, information regarding whether a specific CU will be segmented can be represented by 1 bit of segmentation information for each CU. This segmentation information can be included in all CUs except the SCU. For example, if a CU is not segmented, segmentation information 0 can be stored. If a CU is segmented, segmentation information 1 can be stored.
[0057] Meanwhile, one of the CUs divided from the LCU may include a prediction unit (PU) (or prediction block (PB)), that is, a basic unit for prediction, and a transformation unit (TU) (or transformation block (TB)), that is, a basic unit for transformation.
[0058] Figure 4 is a diagram showing one of the forms of a PU that may be included in a CU.
[0059] A CU that is no longer to be divided from the CUs that are divided from the LCU is divided into one or more PUs. This act itself is also called a division. A prediction unit (hereinafter referred to as a PU) is a basic unit for which prediction is performed and encoded in any of the skip mode, inter-mode, and inner mode. Depending on each mode, the PU can be divided in various forms.
[0060] Referring to Figure 4, in the case of skipping mode, a 2N×2N mode 410 with the same size as a CU can be supported without being divided within the CU.
[0061] In the case of inter-mode, a CU can support 8 split modes, for example, 2N×2N mode 410, 2N×N mode 415, N×2N mode 420, N×N mode 425, 2N×nU mode 430, 2N×nD mode 435, nL×2N mode 440 and nR×2N mode 445.
[0062] In the case of internal mode, 2N×2N mode 410 and N×N mode 425 can be supported within a CU.
[0063] Figure 5 is a diagram showing one of the forms of a TU that may be included in a CU.
[0064] A transformation unit (hereinafter referred to as a TU) is a basic unit used for spatial transformation and a quantization / dequantization (scaling) process within a CU. A TU may be rectangular or square in form. A CU that is no longer divided from a CU divided by an LCU may be divided into one or more TUs.
[0065] Here, the partitioning structure of TU can be a quadtree structure. For example, as shown in Figure 5, based on a quadtree result, a CU 510 can be partitioned once or multiple times so that CU 510 is formed by TUs of various sizes.
[0066] Simultaneously, in HEVC, as in H.264 / AVC, in-frame prediction (hereinafter referred to as intra-prediction) coding is performed. Here, prediction coding is performed using neighboring blocks located close to the current block, based on one of the intra-prediction modes (or prediction orientations) of the current block. In H.264 / AVC, coding is performed using one of nine prediction modes with different orientations. In contrast, in HEVC, coding is performed using a total of 36 prediction modes, including 33 directional prediction modes and 3 non-directional prediction modes.
[0067] Figure 6 is a diagram illustrating one example of an internal prediction model. Different model numbers can be assigned to individual internal prediction models.
[0068] Referring to Figure 6, there are a total of 36 intra-prediction modes. Based on the direction of estimating a pixel value of a current block using a reference pixel and / or a prediction method, the total of 36 intra-prediction modes may include 33 directional modes and 3 non-directional modes.
[0069] The three non-directional modes include an Intra_Planar mode, an Intra_DC mode, and an LM mode (Intra_FromLuma) from which a chromaticity signal is derived from a recovered luminance signal. In intraprediction, all three non-directional modes may be used, or some of them may be used. For example, only the Intra_Planar mode and the Intra_DC mode may be used, and the LM mode may not be used.
[0070] The encoding of 36 internal prediction modes (such as those shown in Figure 6) can be applied to a luminance signal and a chrominance signal. For example, in the case of a luminance signal, modes other than the LM mode among the 36 internal prediction modes can be encoded. In the case of a chrominance signal, an internal prediction mode can be encoded using the three methods shown in Table 1.
[0071] Table 1 shows an example of an encoding method for an internal prediction mode of a chrominance signal. [Table 1] Intrachromatic predictive coding mode Predictive scanning mode within brightness signal 0 26 10 1 X (0 <= X < 35) 0 34 0 0 0 0 (Planar) 1 26 34 26 26 26 (Vert.) 2 10 10 34 10 10 (Hor.) EM 3 1 1 1 34 1(DC) 4 LM LM LM LM LM LM 5 0 26 10 1 X DM
[0072] Refer to Table 1 to explain the method of encoding the intrinsic prediction modes of three chromaticity signals. A first method uses a derived mode (DM), in which an intrinsic prediction mode of a luminance signal is applied to an intrinsic prediction mode of a chromaticity signal without modification. A second method uses an encoding mode (explicit mode (EM)), in which an actual intrinsic prediction mode is applied. An intrinsic prediction mode of a chromaticity signal encoded in EM mode includes a planar mode, a DC mode, a horizontal mode, a vertical mode, and a mode vertically located at an eighth position (i.e., Ver+8 or No. 34 mode). A third method uses an LM mode, in which a chromaticity signal is predicted from a luminance signal recovered from a luminance signal. The most efficient method among the three encoding methods can be selected.
[0073] A prediction image of a signal obtained by performing a prediction using the internal prediction mode described above may have a residual value of the original image. The residual image having a residual value between the prediction image and the original image may undergo frequency domain transformation and quantization, and then undergo entropy coding.
[0074] To improve entropy coding efficiency, the coefficients of a quantized image with a 2D form can be arranged in a 1-D form. When quantizing the coefficients are rearranged, a zigzag scanning method is used in an image coding method (such as the existing H.264 / AVC), but a top-right scanning method is mainly used in HEVC.
[0075] In addition, frequency domain transformation may include integer transformation, discrete cosine transform (DCT), discrete sine transform (DST) and internal prediction mode dependent DCT / DST.
[0076] Figure 7 is a diagram showing an example of one of the upper right scanning methods used for transforming coefficients.
[0077] When the encoding has a quantization coefficient of a block of a specific size, the block of a specific size can be divided into 4×4 sub-blocks and encoded.
[0078] Referring to Figure 7, a 16×16 block can be divided into 16 4×4 sub-blocks and encoded. In the decoding process, the presence of a transform coefficient in each sub-block can be checked based on flag information parsed from the bitstream. For example, the flag could be significant_coeff_group_flag (sigGrpFlag). If a value of significant_coeff_group_flag is 1, it indicates that any transform coefficient is quantized into a corresponding 4×4 sub-block. Conversely, if a value of significant_coeff_group_flag is 0, it indicates that no transform coefficient is quantized into a corresponding 4×4 sub-block. An upper-right scan type is primarily used for the scan type (or scan order) of the 4×4 sub-blocks shown in Figure 7 and the scan type of significant_coeff_group_flag.
[0079] Although a top-right scanning method has been illustrated in Figure 7, scanning methods used for a quantization coefficient include top-right scanning, horizontal scanning, and vertical scanning. For example, the top-right scanning method can be primarily used in inter-prediction, while the top-right, horizontal, and vertical scanning methods can be selectively used in intra-prediction.
[0080] One of the scan types in the internal prediction can be selected based on a prediction mode applicable to both a luminance signal and a chrominance signal. Table 2 below shows an example of a method for determining a scan type based on an internal prediction mode. [Table 2]
[0081] In Table 2, IntraPredModeValue refers to an intraprediction mode. Here, in the case of a luminance signal, IntraPredModeValue corresponds to a value of IntraPredMode. In the case of a chrominance signal, IntraPredModeValue corresponds to a value of IntraPredModeC. log2TrafoSize indicates the size of a current transform block, indicated by a logarithm. For example, when a value of IntraPredModeValue is 1, it indicates a DC mode (DC; Intra_DC). When a value of log2TrafoSize-2 is 1, it indicates an 8×8 block.
[0082] Furthermore, in Table 2, the numbers 0, 1, and 2, determined by the IntraPredModeValue and the current transformed block size, log2TrafoSize, indicate the scan type. For example, an upper right scan type can be indicated by 0, a horizontal scan type by 1, and a vertical scan type by 2.
[0083] Figure 8 is a flowchart illustrating one embodiment of a method for determining a scan type based on an internal prediction pattern.
[0084] The method of FIG8 can be performed in the encoding device of FIG1 or the decoding device of FIG2. In the embodiment of FIG8, although the method of FIG8 is illustrated as being performed in the encoding device for ease of explanation, the method of FIG8 can also be applied equally to the decoding device.
[0085] In Figure 8, IntraPredMode refers to an intraprediction mode used for a luminance signal, and IntraPredModeC refers to an intraprediction mode used for a chrominance signal. Depending on the composition of the signal, IntraPredMode(C) can refer to an intraprediction mode used for either a luminance signal or a chrominance signal.
[0086] Referring to Figure 8, if a current block is not in an internal prediction mode at step S800, the encoding device determines an upper right scan at step S860 to be used as a scan for the residual signal.
[0087] In step S810, if the current block is an intraprediction mode and the IntraPredModeC of a chroma signal is an LM mode, then in step S860 the encoding device determines an upper right scan to be used as a scan for the residual signal.
[0088] In step S810, if the current block is an intraprediction mode and the IntraPredModeC of the chroma signal is not an LM mode, the encoding device determines a scan type for the residual signal based on the IntraPredMode(C) of the current block.
[0089] In step S820, if the mode value of IntraPredMode(C) of the current block is greater than or equal to 6 and less than or equal to 14, then in step S840 the encoding device determines that a vertical scan is used as a scan for the residual signal.
[0090] In step S830, if the mode value of IntraPredMode(C) is not greater than or equal to 6 and less than or equal to 14 and the mode value of IntraPredMode(C) of the current block is greater than or equal to 22 and less than or equal to 30, then in step S850 the encoding device determines that a horizontal scan is used as one of the scans for the residual signal.
[0091] If not, that is, if the mode value of IntraPredMode(C) is greater than or equal to 6 and less than or equal to 14 and is not greater than or equal to 22 and less than or equal to 30, then at step S860 the encoding device determines an upper right scan to be used as one of the scans for the residual signal.
[0092] Meanwhile, as explained above, a residual value (or residual signal or residual) between the original image and the predicted image undergoes frequency domain transformation and quantization, and then entropy coding. Here, to improve the coding efficiency belonging to the frequency domain transformation, integer transformation, DCT, DST, and intrapredictive mode phase shift DCT / DST are selectively applied according to the size of a block.
[0093] Furthermore, to improve coding efficiency, a transform skip algorithm can be applied to screen content, such as a document image or a presentation image in PowerPoint. If the transform skip algorithm is applied, a residual value (or residual signal or residue) between the original image and a predicted image is directly quantized and then entropy encoded without a frequency conversion process. Accordingly, a frequency conversion process is not performed on a block to which the transform skip algorithm has been applied.
[0094] Figure 9 is a flowchart illustrating one example of a frequency transformation method for residual signals (or residual images).
[0095] The method of FIG9 can be performed in the encoding device of FIG1 or the decoding device of FIG2. In the embodiment of FIG9, although the method of FIG9 is illustrated as being performed in the encoding device for ease of explanation, the method of FIG9 can also be applied equally to the decoding device.
[0096] Referring to FIG9, in step S900, if a current block has been encoded in an internal prediction mode and is not a block of a luminance signal, then in step S990 the encoding device uses integer transformation or DCT as a frequency transformation method for the residual image of the luminance and chrominance signals of the current block.
[0097] In step S900, if the current block has been encoded in an intrapred mode and is a block of a brightness signal, then in step S910 the encoding device obtains the IntraPredMode of the brightness signal of the current block.
[0098] In step S920, the encoding device checks whether the current block is a block of size 4×4 (iWidth == 4).
[0099] If, as a result of the inspection, the current block is not a 4×4 block (iWidth == 4), then in step S990, the encoding device uses integer transformation or DCT as a frequency transformation method for the residual image of the brightness and chrominance signals of the current block.
[0100] If, as one of the results of the inspection, the current block is a 4×4 block (iWidth == 4), then the encoding device checks the prediction pattern within the current block.
[0101] In step S930, if, as a result of the check, the mode value of one of the predicted modes within the current block is greater than or equal to 2 and less than or equal to 10, then in step S960, the encoding device uses a DST along a horizontal direction and a DCT along a vertical direction as a frequency transformation method for the luminance signal of the current block. The DCT can be used as a frequency transformation method for the chrominance signal of the current block in both the horizontal and vertical directions.
[0102] If, as a result of the check at step S930, the mode value of the predicted mode within the current block is 0 or greater than or equal to 11 and less than or equal to 25 at step S940, then at step S970, the encoding device uses DST along both the horizontal and vertical directions as a frequency transformation method for the luminance signal of the current block. DCT can be used as a frequency transformation method for the chrominance signal of the current block along both the horizontal and vertical directions.
[0103] If, as a result of the check at step S940, the mode value of the predicted mode within the current block is greater than or equal to 26 and less than or equal to 34 at step S950, then at step S980, the encoding device uses a DCT along a horizontal direction and a DST along a vertical direction as a frequency transformation method for the luminance signal of the current block. The DCT can be used as a frequency transformation method for the chrominance signal of the current block in both the horizontal and vertical directions.
[0104] If, as one of the results of the check at step S950, the mode value of the predicted mode within the current block is not greater than or equal to 26 and less than or equal to 34, then at step S990, the encoding device uses DCT along both the horizontal and vertical directions as a frequency transformation method for the residual image of the brightness and chromaticity signals of the current block.
[0105] "iWidth" is an indicator that indicates the size of a transform block, and can be assigned as follows based on the iWidth value of the size of each transform block.
[0106] For example, if the size of a transform block is 64×64, then the value of iWidth can be 64. If the size of a transform block is 32×32, then the value of iWidth can be 32. If the size of a transform block is 16×16, then the value of iWidth can be 16. If the size of a transform block is 8×8, then the value of iWidth can be 8. If the size of a transform block is 4×4, then the value of iWidth can be 4. If the size of a transform block is 2×2, then the value of iWidth can be 2.
[0107] Regarding the content of Figure 9, the transformation procedure for one of the scaling transformation coefficients is as follows.
[0108] In this case, the input is as follows: - Width of the current transform block; nW - Height of the current transform block; nH - Array of transform coefficients with one element dij; (nW×nH) array d - Information indicating whether the transform skip algorithm has been applied to the current transform block - An index of the luminance and chrominance signals of the current transform block; cIdx If cIdx is 0, it refers to a luminance signal. If cIdx is 1 or cIdx is 2, it refers to a chrominance signal. Furthermore, if cIdx is 1, it refers to Cb in a chrominance signal. If cIdx is 2, it refers to Cr in a chrominance signal. - Quantization parameter; qP
[0109] In this case, the output is as follows: - An array of residual blocks obtained by performing an inverse transform on the scaling transform coefficients; (nW×nH) array r If the encoding mode "PredMode" of a current block is an in-between prediction mode, then the value of Log2(nW*nH) is 4, and the value of cIdx is 0. The parameters "horizTrType" and "vertTrType" are obtained from the in-between prediction mode of a brightness signal through Table 3 below. Otherwise, the parameters "horizTrType" and "vertTrType" are set to 0. [Table 3]
[0110] Obtain the residual signal of one of the current blocks according to the following sequence.
[0111] First, if the transformation skip algorithm for the current block has been applied, the following procedure is executed: 1. If cIdx is non-zero, then shift = 13 – BitDepthY. Otherwise, shift = 13 – BitDepthC. 2. One of the remaining blocks, array rij (i=0..(nW)-1, j=0..(nH)-1), is set as follows. If the shift is greater than 0, then rij = (dij + (1 << (shift - 1))) >> shift. Otherwise, then rij = (dij << (-shift).
[0112] If the transformation skip algorithm for the current block has not yet been applied, the following procedure is executed.
[0113] Use the values of the parameters "horizTrType" and "vertTrType" to perform an inverse transformation process on the scaling transformation coefficients. First, receive the size of the current block (nW, nH), an array of scaling transformation coefficients "(nW×nH) array d" and the parameter "horizTrType", and output an array "(nW×nH) array e" by performing a horizontal 1-D inverse transformation.
[0114] Next, receive the array "(nW×nH) array e", and derive the array "(nW×nH) array g" as in Equation 1. [Equation 1] gij = Clip3(-32768, 32767, (eij+64)≫7) Next, receive the size of the current block (nW, nH), the array "nW×nH array g" and the parameter "vertTrType", and perform a horizontal 1D inverse transformation.
[0115] Next, based on cIdx, set one of the residual blocks as an array "(nW×nH) array r" in the following Equation 17. [Equation 2] rij = (fij+(1≪(shift-1)))≫shift In Equation 2, when cIdx is 0, shift = 20 – BitDepthY. Otherwise, shift = 20 – BitDepthC. BitDepth refers to the number of bits in one sample of the current image (e.g., 8 bits).
[0116] Meanwhile, as explained above, a frequency transformation process is not performed on a block to which a transform skip algorithm has been applied (hereinafter referred to as a transform skip block). Accordingly, a block to which an existing frequency transformation process has been performed and a transform skip block have different transform coefficient characteristics. That is, if a transform coefficient scanning method applied to a block to which an existing frequency transformation process has been performed is applied to a transform skip block, coding efficiency can be reduced. Accordingly, the present invention provides a coefficient scanning method applicable to a transform skip block. [Example 1] Method and apparatus for unifying a scanning type for all transform skip blocks
[0117] Figure 10 is a flowchart illustrating one of the methods for deriving one scan type (or transform coefficient) of the residual signal according to one embodiment of the present invention.
[0118] The method of FIG10 can be performed in the encoding device of FIG1 or the decoding device of FIG2. In the embodiment of FIG10, although the method of FIG10 is illustrated as being performed in the encoding device for ease of explanation, the method of FIG10 can also be equally applied to the decoding device.
[0119] Referring to Figure 10, the scan type of a current block’s residual signal (or transform coefficients) can be determined based on whether a transform skip algorithm has been applied to the current residual signal.
[0120] If, as one of the determinations at step S1000, it is determined that the residual signal (or transform coefficient) of the current block is a transform skipped block, then at step S1010, the encoding device determines a horizontal scan as the scan type of the residual signal of the current block.
[0121] If, as one of the results of the determination at step S1000, it is determined that the residual signal (or transform coefficient) of the current block is not a transform skipped block, then at step S1020, the encoding device determines the scan type of the residual signal of the current block based on an in-block prediction mode. For example, any one of the upper right scan, horizontal scan, and vertical scan can be derived as the scan type of the residual signal based on an in-block prediction mode. In this case, for example, the method shown in Figure 8 can be used.
[0122] In the embodiment of FIG10, when the current block is a transition skip block, a horizontal scan is illustrated as one scan type of the residual signal of the current block. However, this is only one example, and the invention is not limited to this example. For example, if a current block is a transition skip block, an upper right scan or a vertical scan can be determined as one scan type of the residual signal of the current block.
[0123] Figure 11 is a flowchart illustrating one of the methods for deriving one scan type (or transform coefficient) of the residual signal according to another embodiment of the present invention.
[0124] The method of FIG11 can be performed in the encoding device of FIG1 or the decoding device of FIG2. In the embodiment of FIG11, although the method of FIG11 is illustrated as being performed in the encoding device for ease of explanation, the method of FIG11 can also be applied equally to the decoding device.
[0125] Referring to FIG11, at step S1100, the encoding device analyzes information indicating whether there is a residual signal (or transform coefficient) in a current block.
[0126] For example, information indicating whether a residual signal exists in a current block can be "cbf (coded block flag)". If a residual signal exists in the current block, that is, if the current block includes one or more transform coefficients other than 0, then a value of cbf can be 1. If no residual signal exists in the current block, then a value of cbf can be 0.
[0127] If the information indicating whether a residual signal exists in the current block indicates that a residual signal exists in the current block, for example, when the value of cbf is 1 (at step S1105), then the next processing procedure is executed. If, at step S1105, the information indicating whether a residual signal exists in the current block indicates that a residual signal does not exist in the current block, for example, when the value of cbf is 0, then the processing procedure for deriving a scan type shown in FIG11 is terminated at step S1110.
[0128] If the information indicating whether a residual signal exists in the current block indicates that a residual signal exists in the current block (e.g., cbf == 1), then at step S1115, the encoding device analyzes the information indicating a residual value in the step of quantizing the current block. For example, the information indicating a residual value in the step of quantizing the current block may be a parameter "cu_qp_delta".
[0129] The information indicating a residual value (i.e., cu_qp_delta) in the step of quantizing the current block is unrelated to the derivation of a scan type of the residual signal of the current block. Accordingly, step S1115 can be omitted, and the next step S1120 can be executed.
[0130] In step S1120, the encoding device sets information about the size of the current block.
[0131] For example, a parameter "log2TrafoSize" can be used to set information about the size of the current block. The parameter "log2TrafoSize" can be obtained by right shifting and performing a calculation on the sum of "log2TrafoWidth" indicating the width of the current block and "log2TrafoHeight" indicating the height of the current block. Here, the parameter "log2TrafoSize" refers to the size of a TU block of a luminance signal.
[0132] If, at step S1125, either the width "log2TrafoWidth" or the height "log2TrafoHeight" of the current block is 1 (that is, the width and height of the current block have a size of 2), then at step S1130, the encoding device sets both the width "log2TrafoWidth" and the height "log2TrafoHeight" of the current block to 2. That is, the width and height of the current block are set to a size of 4.
[0133] If, at step S1135, a transform skip algorithm has been substantially applied to one of the current images including the current block (i.e., transform_skip_enabled_flag == 1), a mode is not one of the modes in which transformation and quantization have not been performed (i.e., !cu_tranquant_bypass_flag), the encoding mode of the current block has been encoded with an intra-prediction mode (i.e., PredMode == MODE_INTRA), and the width "log2TrafoWidth" and height "log2TrafoHeight" of the current block are both 2, then at step S1140, the encoding device analyzes the information indicating whether to apply a transform to the current block (for example, transform_skip_flag).
[0134] If the encoding mode of the current block has been encoded in an intra-prediction mode (i.e., PredMode == MODE_INTRA) and the information indicating whether to apply a transformation to the current block indicates that no transformation is applied to the current block, for example, if the value of transform_skip_flag is 0 (i.e., if the current block is a transformation skip block), then in steps S1150 to S1160, the encoding device can determine the scan type of the residual signal of the current block based on an intra-prediction mode of the current block, as explained above with reference to FIG8.
[0135] For example, if at step S1150, a value of cIdx (i.e., an indicator of the color components of the current block) is 0, that is, if the current block is a luminance signal, then at step S1155, the scan type of the residual signal of the current block can be determined based on the IntraPredMode of the luminance signal of the current block. If at step S1150, a value of cIdx of the current block is not 0, that is, if the current block is a chroma signal, then at step S1160, the scan type of the residual signal of the current block can be determined based on the IntraPredModeC of the chroma signal of the current block.
[0136] Here, scanIdx can be an index value indicating one of the scan types of the residual signal of the current block. For example, if a scanIdx value is 0, it can indicate an upper right scan. If a scanIdx value is 1, it can indicate a horizontal scan. If a scanIdx value is 2, it can indicate a vertical scan. ScanType can indicate one of the scan types determined by the prediction mode in Table 2 and the size of the current block. IntraPredMode means an intraprediction mode of a luminance signal, and IntraPredModeC means an intraprediction mode of a chrominance signal.
[0137] If, at step S1145, the encoding mode of the current block has been encoded in an internal prediction mode (i.e., PredMode == MODE_INTRA) and the information indicating whether to apply a transform to the current block indicates that a transform should be applied to the current block, for example, if the value of transform_skip_flag is 1 (i.e., the current block is a transform skip block), then at step S1165, the encoding device determines any one of the upper right scan, horizontal scan, and vertical scan as a scan type of the residual signal of the current block. For example, the value of scanIdx can be set to 0, and an upper right scan can be determined as a scan type of the residual signal of the current block.
[0138] In this embodiment, when a current block is a transition skipped block, an upper-right scan has been determined as one of the scan types of the residual signal of the current block. However, this is only one example, and the present invention is not limited to this example. For example, if a current block is a transition skipped block, a horizontal scan (scanIdx = 1) or a vertical scan (scanIdx = 2) can be set as one of the scan types of the residual signal of the current block.
[0139] In step S1170, the encoding device uses the determined scan type to analyze the coefficients of the current block.
[0140] Figure 12 is a diagram illustrating one example of the scanning types to which the present invention can be applied.
[0141] Figure 12(a) shows an example in which a diagonal scan (or upper right scan) is applied to one of the 4×4 blocks. The residual signal (or transform coefficients) within the 4×4 block can be scanned in sequence, such as the sequence in Figure 12(a).
[0142] The diagonal scan type in Figure 12(a) is only one example, and the invention is not limited thereto. For example, a diagonal scan type in which the 4×4 block of Figure 12(a) has been rotated 180 degrees to the right can be used to scan residual signals.
[0143] Figure 12(b) shows an example in which a vertical scan is applied to a 4×4 block. The residual signal (or transform coefficients) within the 4×4 block can be scanned in sequence, such as in Figure 12(b).
[0144] The vertical scan type in Figure 12(b) is only one example, and the invention is not limited thereto. For example, a vertical scan type in which the 4×4 block of Figure 12(b) has been rotated 180 degrees to the right can be used to scan residual signals.
[0145] Figure 12(c) shows an example in which a horizontal scan is applied to one of the 4×4 blocks. The residual signal (or transform coefficients) within the 4×4 block can be scanned in sequence, such as in the order shown in Figure 12(c).
[0146] The horizontal scan type in Figure 12(c) is only one example, and the invention is not limited thereto. For example, a horizontal scan type in which the 4×4 block of Figure 12(c) has been rotated 180 degrees to the right can be used to scan the residual signal.
[0147] Tables 4 and 5 can be obtained by incorporating the examples of Figures 10 and 11 into a coding syntax of a transform unit (TU) and a residual signal.
[0148] Table 4 illustrates the TU encoding syntax according to one embodiment of the present invention. [Table 4]
[0149] Referring to Table 4, transform_unit indicates a one-bit stream of coefficients for a TU block. Here, it is determined whether to analyze the encoding information of the residual signal for the TU block (i.e., residual encoding) based on information indicating whether there is a residual signal in a luminance signal (cbf_luma) and information indicating whether there is a residual signal in a chrominance signal (cbf_cb, cbf_cr).
[0150] Table 5 illustrates the residual signal encoding syntax according to one embodiment of the present invention. [Table 5]
[0151] Referring to Table 5, residual_coding refers to a one-bit stream of coefficients for a TU block. Here, a TU block can be a luminance signal or a chrominance signal.
[0152] log2TrafoWidth refers to the width of a current block, and log2TrafoHeight refers to the height of the current block. log2TrafoSize is a value obtained by right shifting and performing the sum of the received log2TrafoWidth and log2TrafoHeight, and refers to the size of a TU block of a brightness signal.
[0153] PredMode refers to one of the encoding modes of a current block. PredMode is the intra-block mode when encoding within a frame and the inter-block mode when encoding between frames.
[0154] scanIdx can be an index indicating the scan type of the brightness signal of a current TU block. For example, when a scanIdx value is 0, it can indicate an upper right scan. When a scanIdx value is 1, it can indicate a horizontal scan. When a scanIdx value is 2, it can indicate a vertical scan.
[0155] ScanType can be a table indicating a scan type determined by a prediction mode in Table 2 and the size of a current block. Here, "ScanType=DIAG" or "Up-right" is an example.
[0156] IntraPredMode refers to the intraprediction mode of a luminance signal, and IntraPredModeC refers to the intraprediction mode of a chrominance signal.
[0157] In the embodiments of Figures 10 and 11, a method for unifying a scan type for all transform skip blocks has been described. In other words, the same scan type has been applied to the transform skip blocks. In the following embodiments of the present invention, in the case of a transform skip block, a method for setting a scan type again is described. [Embodiment 2] Method and apparatus for deriving a scan type for a transform skip block
[0158] Figure 13 is a flowchart illustrating one method for deriving one scan type (or transform coefficient) of a residual signal according to one embodiment of the present invention.
[0159] The method of FIG1 can be performed in the encoding device of FIG1 or the decoding device of FIG2. In the embodiment of FIG13, although the method of FIG13 is illustrated as being performed in the encoding device for ease of explanation, the method of FIG13 can also be applied equally to the decoding device.
[0160] Referring to FIG13, at step S1300, the encoding device determines one of the scan types of the residual signals of the current block based on the prediction mode within one of the current blocks.
[0161] For example, one of the upper right scan, horizontal scan, and vertical scan can be derived as a scan type of the residual signal of the current block based on the prediction pattern within one of the current blocks. In this case, for example, the method of Figure 8 can be used.
[0162] If, at step S1310, the residual signal (or transform coefficient) of the current block is a transform skip block, then in steps S1330 to S1370, the encoding device again sets a scan type for the residual signal of the current block. If, at step S1310, the residual signal (or transform coefficient) of the current block is not a transform skip block, then in step S1320, the process of deriving a scan type shown in FIG13 is terminated. Here, the scan type determined in step S1300 is used as the scan type for the residual signal of the current block.
[0163] If, at step S1330, the residual signal of the current block corresponds to a transform skip block and the scan type determined based on an in-block prediction mode is a vertical scan, then at step S1350, the encoding device sets the scan type of the residual signal of the current block to a horizontal direction again.
[0164] If, at step S1340, the residual signal of the current block corresponds to a transform skip block and the scan type determined based on an intra-block prediction mode is a horizontal scan, then at step S1360, the encoding device sets the scan type of the residual signal of the current block to a vertical direction again.
[0165] If, at step S1340, the residual signal of the current block corresponds to a transform skip block and the scan type determined based on one of the prediction modes of the current block is not either vertical scan or horizontal scan, then at step S1370, the encoding device sets one of the scan types of the residual signal of the current block to an upper right scan again.
[0166] The method of resetting a scan type based on whether the residual signal of a current block corresponds to a change skip block, as described in the embodiment of FIG13, can be applied in various ways. For example, a scan type of a luminance signal derived using the embodiment of FIG13 can be equally applied to a chrominance signal. That is, the scan type of the luminance signal becomes the same as the scan type of the chrominance signal. In contrast, the embodiment of FIG13 can be applied to each of a luminance signal and a chrominance signal. In another embodiment, a scan type of a current block can be determined based on a scan type of an adjacent block. In yet another embodiment, in the case of a change skip block, a scan type other than the existing scan type (e.g., vertical, horizontal, and upper right) can be used.
[0167] Figure 14 is a flowchart illustrating one of the methods for deriving one scan type (or transform coefficient) of the residual signal according to another embodiment of the present invention.
[0168] The method of FIG14 can be performed in the encoding device of FIG1 or the decoding device of FIG2. In the embodiment of FIG14, although the method of FIG14 is illustrated as being performed in the encoding device for ease of explanation, the method of FIG14 can also be equally applied to the decoding device.
[0169] Referring to FIG14, at step S1400, the encoding device analyzes information indicating whether there is a residual signal (or transform coefficient) in a current block.
[0170] For example, information indicating whether a residual signal exists in a current block can be "cbf". If a residual signal exists in the current block, that is, if the current block includes one or more transform coefficients other than 0, then a value of cbf can be 1. If no residual signal exists in the current block, then a value of "cbf" can be 0.
[0171] If, at step S1405, the information indicating whether a residual signal exists in the current block indicates that a residual signal exists in the current block, for example, when one of the values of cbf is 1, then the next processing procedure is executed. If, at step S1405, the information indicating whether a residual signal exists in the current block indicates that a residual signal exists in the current block, for example, when one of the values of cbf is 0, then the next processing procedure for the current block is terminated at step S1410.
[0172] If the information indicating whether a residual signal exists in the current block indicates that a residual signal exists in the current block, for example, when the value of cbf is 1, then in step S1415, the encoding device analyzes the information indicating a residual value in the step of quantizing the current block. For example, the information indicating the residual value in the step of quantizing the current block may be a parameter "cu_qp_delta".
[0173] The information indicating the residual value (i.e., cu_qp_delta) in the step of quantizing the current block is unrelated to the derivation of one scan type of the residual signal of the current block. Accordingly, step S1415 can be omitted, and the next step S1420 can be executed.
[0174] In step S1420, the encoding device sets information about the size of the current block.
[0175] For example, a parameter "log2TrafoSize" can be used to set information about the size of the current block. The parameter "log2TrafoSize" can be obtained by right shifting and performing a calculation on the sum of "log2TrafoWidth" indicating the width of the current block and "log2TrafoHeight" indicating the height of the current block. Here, the parameter "log2TrafoSize" refers to the size of a TU block of a luminance signal.
[0176] If, at step S1425, either log2TrafoWidth or log2TrafoHeight, which indicates the size of the current block, is 1 (that is, the width and height of the current block have a size of 2), then at step S1430, the encoding device sets both log2TrafoWidth and log2TrafoHeight of the current block to 2. That is, the width and height of the current block are set to a size of 4.
[0177] If, at step S1435, a transform skip algorithm has been substantially applied to one of the current images including the current block (i.e., transform_skip_enabled_flag == 1), a mode is not one of the modes in which transformation and quantization have not been performed (i.e., !cu_tranquant_bypass_flag), the encoding mode of the current block has been encoded in an intrapredictive mode (i.e., PredMode == MODE_INTRA), and the log2TrafoWidth and log2TrafoHeight of the current block are both 2, then at step S1440 the encoding device analyzes the information indicating whether to apply a transform to the current block (for example, transform_skip_flag).
[0178] If the encoding mode of the current block has been encoded in an internal prediction mode (i.e., PredMode == MODE_INTRA) at step S1445, then at steps S1450 to S1460 the encoding device can determine one of the scan types of the residual signal of the current block based on one of the internal prediction modes of the current block, as explained above with reference to Figure 8.
[0179] For example, if at step S1450, a value of cIdx (i.e., an indicator of the color components of the current block) is 0, that is, if the current block is a luminance signal, then at step S1455, the encoding device can determine the scan type of the residual signal of the current block based on the IntraPredMode of the luminance signal of the current block. If at step S1450, a value of cIdx of the current block is not 0, that is, if the current block is a chroma signal, then at step S1460, the encoding device can determine the scan type of the residual signal of the current block based on the IntraPredModeC of the chroma signal of the current block.
[0180] Here, scanIdx may be an index value indicating one of the scan types of the residual signal of the current block. For example, if a scanIdx value is 0, it may indicate an upper right scan. If a scanIdx value is 1, it may indicate a horizontal scan. If a scanIdx value is 2, it may indicate a vertical scan. ScanType may indicate a scan type determined by one of the intrapred modes in Table 2 and the size of the current block. IntraPredMode refers to one of the intrapred modes of a luminance signal, and IntraPredModeC refers to one of the intrapred modes of a chrominance signal.
[0181] If the encoding mode of the current block has not been encoded using an internal prediction mode at step S1445, then at step S1465 the encoding device determines any one of the upper right scan, horizontal scan, and vertical scan as a scan type of the residual signal of the current block. For example, a value of scanIdx can be set to 0, and an upper right scan can be determined as a scan type of the residual signal of the current block.
[0182] In step S1470, the encoding device re-sets the determined scan type based on whether the current block is a change skip block.
[0183] For example, the method shown in FIG13 can be used to re-set the determined scan type. If the current block is a transform skip block (that is, the transform_skip_flag is 1 after analysis), the encoding device can re-set a horizontal scan as a scan type if the determined scan type is a vertical scan, and re-set a vertical scan as a scan type if the determined scan type is a horizontal scan.
[0184] At step S1475, the encoding device uses the re-set scan type to analyze the coefficients of the current block.
[0185] Tables 6 and 7 can be obtained by incorporating the examples of Figures 13 and 14 into a coding syntax of a transform unit (TU) and a residual signal.
[0186] Table 6 illustrates the TU encoding syntax according to one embodiment of the present invention. [Table 6]
[0187] Referring to Table 6, transform_unit indicates a one-bit stream of coefficients for a TU block. Here, it is determined whether to analyze the residual signal encoding information (residual encoding) for the TU block based on information indicating whether residual signals exist in a luminance signal (cbf_luma) and information indicating whether residual signals exist in a chrominance signal (cbf_cb, cbf_cr).
[0188] Table 7 illustrates the residual signal encoding syntax according to one embodiment of the present invention. [Table 7]
[0189] Referring to Table 7, residual_coding refers to a one-bit stream of coefficients for a TU block. Here, a TU block can be a luminance signal or a chrominance signal.
[0190] log2TrafoWidth refers to the width of a current block, and log2TrafoHeight refers to the height of the current block. log2TrafoSize means the result obtained by right shifting and performing the sum of the received log2TrafoWidth and log2TrafoHeight, and refers to the size of a TU block of a brightness signal.
[0191] PredMode refers to one of the encoding modes of the current block. PredMode is the intra-block mode when encoding within a frame and the inter-block mode when encoding between frames.
[0192] scanIdx can be an index indicating the scan type of the brightness signal of a current TU block. For example, if a scanIdx value is 0, it can indicate an upper right scan. If a scanIdx value is 1, it can indicate a horizontal scan. If a scanIdx value is 2, it can indicate a vertical scan.
[0193] ScanType can be an indication of a scan type determined by one of the prediction patterns in Table 2 and the size of a current block. Here, "ScanType=DIAG" or "Up-right" is only one instance.
[0194] IntraPredMode refers to the intraprediction mode of a luminance signal, and IntraPredModeC refers to the intraprediction mode of a chrominance signal.
[0195] Meanwhile, the embodiments described above can have different application ranges depending on the size of a block, the depth of a CU, or the depth of a TU. One parameter for determining the application range (e.g., information about the size or depth of a block) can be set by an encoder and a decoder so that the parameter has a predetermined value or can have a predetermined value according to a specification or level setting. When an encoder writes a parameter value into a bitstream, a decoder can obtain the value from the bitstream and use the value.
[0196] If the application scope varies depending on the depth of a CU, the following three methods can be applied to the embodiments described above, as illustrated in Table 8. Method A is only applicable to a depth with a specific depth or higher, Method B is only applicable to a depth with a specific depth or lower, and Method C is only applicable to a specific depth.
[0197] Table 8 shows an example of a method for determining the scope of the method of the present invention based on the depth of a CU (or TU). In Table 8, "O" indicates that a corresponding method is applied to a corresponding depth of a CU (or TU), and "X" indicates that a corresponding method is not applied to a corresponding depth of a CU (or TU). [Table 8] Indicates the depth of the CU (or TU) of the application range. Method A Method B Method C 0 X O X 1 X O X 2 O O O 3 O X X 4 O X X
[0198] Referring to Table 8, if the depth of a CU (or TU) is 2, then all methods A, B and C can be applied to the embodiments of the present invention.
[0199] If an embodiment of the present invention is not applied to all depths of a CU (or TU), it may be indicated by a specific indicator (e.g., a flag) or by a value that is 1 greater than one of the maximum depths of a CU as a value indicating the depth of a CU within an application range.
[0200] Furthermore, the method within the scope of the present invention, which determines the depth of a CU (or TU) in which the method of the present invention is applied, can be applied to Embodiment 1 (Figures 10 and 11) and Embodiment 2 (Figures 13 and 14) of the present invention, or a combination of Embodiment 1 and Embodiment 2.
[0201] Furthermore, the method within the scope of the present invention can be applied to a situation where a luminance signal and a chrominance signal have different resolutions, based on the depth of a CU (or TU). The following describes, with reference to Figures 15 and 16, a method within the scope of the present invention for determining the application of a frequency conversion method (or scan type) when a luminance signal and a chrominance signal have different resolutions.
[0202] Figure 15 is a diagram illustrating one example of a resolution difference between a lightness block and a chroma block.
[0203] Referring to Figure 15, assuming a chroma signal has a size of 1 / 4 of a luminance signal (for example, the luminance signal has a size of 416×240 and the chroma signal has a size of 208×120), a luminance block 1510 with a size of 8×8 corresponds to a chroma block 1520 with a size of 4×4.
[0204] In this case, the 8×8 size luminance block 1510 may include four luminance blocks, each having a 4×4 size, and may have an intrinsic prediction mode in each of the individual 4×4 size luminance blocks. In contrast, the 4×4 size chroma block 1520 may not be divided into 2×2 size chroma blocks. The 4×4 size chroma block 1520 may have an intrinsic prediction mode.
[0205] Here, if the 4×4 chroma block 1520 is encoded in an LM mode "Intra_FromLuma" or the 4×4 chroma block 1520 is encoded in a DM mode (that is, the mode in which an inner prediction mode of a luminance signal is used as an inner prediction mode of a chroma signal without change), then any one of the inner prediction modes of the four 4×4 luminance blocks can be used as an inner prediction mode of the 8×8 luminance block 1510 for a frequency conversion method (or scan type) to derive the residual signal of the 4×4 chroma block 1520.
[0206] To selectively apply a frequency transformation method (or scan type) to the residual signal of a chrominance signal, one of the following methods 1 to 4 can be used in various ways as a method for deriving an internal prediction mode. 1. An internal prediction mode can be used from a block placed in the upper left of a luminance signal block. 2. An internal prediction mode can be used from a block placed in the upper left, lower left, or lower right of a luminance signal block. 3. The average or median value of four luminance signal blocks can be used. 4. The average or median value of the chrominance signal blocks of the current block and the blocks adjacent to the current block can be used.
[0207] In addition to methods 1 to 4, one of the internal prediction modes of a chromaticity signal can also be derived in various ways.
[0208] Figure 16 is another example of a resolution difference between a lightness block and a chroma block.
[0209] Referring to Figure 16, a luminance block 1610 of size 16×16 may have an internal prediction mode. In contrast, a chroma block 1620 of size 8×8 may be divided into four chroma blocks, each of size 4×4. Each of these 4×4 chroma blocks may have an internal prediction mode.
[0210] If the 8×8 chroma block 1620 is encoded in an LM mode "Intra_FromLuma" or the 8×8 chroma block 1620 is encoded in a DM mode (i.e., where an inner prediction mode of a luminance signal is used as an inner prediction mode of a chroma signal without change), then an inner prediction mode of a 16×16 luminance block 1610 can be used to derive a frequency transformation method (or scan type) of the residual signal of the 8×8 chroma block 1620. In another embodiment, an inner prediction mode can be derived from a block adjacent to a current block (i.e., a luminance block or a chroma block) to derive a frequency transformation method (or scan type) of the residual signal of the 8×8 chroma block 1620.
[0211] The frequency transformation method or scanning type can be applied differently to a chroma block or to a chroma signal image and a chroma signal image, depending on the size of a luminance block, or it can be applied differently according to a horizontal scan and a vertical scan.
[0212] Table 9 schematically illustrates an example of a combination of methods for determining an application scope based on a block size, a chroma signal, a luminance signal, and vertical and horizontal scanning. [Table 9] Brightness block size Chromaticity block size The applied brightness The applied chromaticity The level applied The applied vertical method 4(4×4, 4×2, 2×4) 2(2×2) O or X O or X O or X O or X A 1, 2, … 4(4×4, 4×2, 2×4) O or X O or X O or X O or X B 1, 2, … 8 (8×8, 8×4, 4×8, 2×8, etc.) O or X O or X O or X O or X C 1, 2, … 16 (16×16, 16×8, 4×16, 2×16, etc.) O or X O or X O or X O or X D 1, 2, … 32(32×32) O or X O or X O or X O or X E 1, 2, … 8 (8×8, 8×4, 2×8, etc.) 2(2×2) O or X O or X O or X O or X F 1, 2, … 4(4×4, 4×2, 2×4) O or X O or X O or X O or X G 1, 2, … 8 (8×8, 8×4, 4×8, 2×8, etc.) O or X O or X O or X O or X H 1, 2, … 16 (16×16, 16×8, 4×16, 2×16, etc.) O or X O or X O or X O or X I 1, 2, … 32(32×32) O or X O or X O or X O or X J 1, 2, … 16 (16×16, 8×16, 4×16, etc.) 2(2×2) O or X O or X O or X O or X K 1, 2, … 4(4×4, 4×2, 2×4) O or X O or X O or X O or X L 1, 2, … 8 (8×8, 8×4, 4×8, 2×8, etc.) O or X O or X O or X O or X M 1, 2, … 16 (16×16, 16×8, 4×16, 2×16, etc.) O or X O or X O or X O or X N 1, 2, … 32(32×32) O or X O or X O or X O or X O 1, 2, …
[0213] In the case of method "G 1" among the methods listed in Table 9, if the size of the lightness block is 8 (8×8, 8×4, 2×8, etc.) and the size of the chroma block is 4 (4×4, 4×2, 2×4), then Embodiment 1 of the present invention (Figures 10 and 11) or Embodiment 2 of the present invention (Figures 13 and 14) can be applied to a lightness signal, a chroma signal, a horizontal signal and a vertical signal.
[0214] In the case of method "M1" among the methods listed in Table 9, if the size of the lightness block is 16 (16×16, 8×16, 2×16, etc.) and the size of the chroma block is 4 (4×4, 4×2, 2×4), then Embodiment 1 of the present invention (Figures 10 and 11) or Embodiment 2 of the present invention (Figures 13 and 14) can be applied to a lightness signal, a chroma signal and a horizontal signal, but cannot be applied to a vertical signal.
[0215] Figure 17 is a schematic block diagram of an encoding device according to one embodiment of the present invention.
[0216] Referring to FIG17, the encoding device 1700 includes a scan type export module 1710 and a scan module 1720.
[0217] The scan type export module 1710 exports one of the scan types of the residual signal of the current block based on whether the current block is a transformed skip block.
[0218] Here, the transform skip block is one of the blocks to which a transformation has not yet been applied to a current block and can be specified by information indicating whether a transformation is applied to the current block (for example, transform_skip_flag).
[0219] A detailed method for deriving a scan type of residual signal of a current block based on whether the current block is a transformed skip block has been described in detail with reference to embodiments of this specification.
[0220] The scanning module 1720 applies the scan type exported by the scan type export module 1710 to the residual signal of the current block. For example, the scan type shown in Figure 12 can be used to scan the residual signal of the current block.
[0221] Figure 18 is a schematic block diagram of a decoding device according to one embodiment of the present invention.
[0222] Referring to Figure 18, the decoding device 1800 includes a scan type export module 1810 and a scan module 1820.
[0223] The scan type export module 1810 exports one of the scan types of the residual signal of the current block based on whether the current block is a transformed skip block.
[0224] Here, the transform skip block is one of the blocks to which a transformation has not yet been applied to a current block and can be specified by information indicating whether a transformation is applied to the current block (for example, transform_skip_flag).
[0225] A detailed method for deriving a scan type of residual signal of a current block based on whether the current block is a transformed skip block has been described in detail with reference to embodiments of this specification.
[0226] The scanning module 1820 applies the scan type exported by the scan type export module 1810 to the residual signal of the current block. For example, the scan type shown in Figure 12 can be used to scan the residual signal of the current block.
[0227] In the embodiments described above, although the methods have been illustrated based on flowcharts in the form of a series of steps or blocks, the present invention is not limited to the order of these steps, and some of these steps may be performed in a different order than the other steps, or may be performed simultaneously with other steps. Furthermore, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, and these steps may include other steps, or one or more steps in the flowchart may be deleted, without affecting the scope of the present invention.
[0228] The above description is merely one example of the technical spirit of the present invention, and those skilled in the art can change and modify the present invention in various ways without departing from its inherent characteristics. Accordingly, the disclosed embodiments should not be considered as limiting the technical spirit of the present invention, but rather as illustrating the technical spirit of the present invention. The scope of the technical spirit of the present invention is not limited by these embodiments, and the scope of the present invention should be interpreted based on the appended claims. Accordingly, the present invention should be considered to cover all modifications or variations arising from the meaning and scope of the appended claims and their equivalents. [Simplified Explanation of the Diagram]
[0025] Figure 1 is a block diagram illustrating the structure of an image encoding apparatus according to an embodiment of the present invention; Figure 2 is a block diagram illustrating the structure of an image decoding apparatus according to an embodiment of the present invention; Figure 3 is a schematic diagram illustrating the segmentation structure of an image when encoding an image; Figure 4 is a diagram illustrating the form of a PU that may be included in a CU; Figure 5 is a diagram illustrating the form of a TU that may be included in a CU; Figure 6 is a diagram illustrating an example of an internal prediction mode; Figure 7 is a diagram illustrating an example of an upper right scan method for transform coefficients; Figure 8 is a flowchart illustrating an embodiment of a method for determining a scan type based on an internal prediction mode; Figure 9 is a flowchart illustrating an example of a method for selecting a frequency transformation method for residual signals (or residual images); Figure 10 is a flowchart illustrating a method for deriving a scan type (or transform coefficient) of a residual signal according to an embodiment of the present invention; Figure 11 is a flowchart illustrating a method for deriving a scan type (or transform coefficient) of a residual signal according to another embodiment of the present invention. Figure 12 is a diagram illustrating one example of a scan type to which the present invention can be applied; Figure 13 is a flowchart illustrating one method for deriving a scan type (or transform coefficient) of a residual signal according to one embodiment of the present invention; Figure 14 is a flowchart illustrating one method for deriving a scan type (or transform coefficient) of a residual signal according to another embodiment of the present invention; Figure 15 is a diagram illustrating one example of a resolution difference between a lightness block and a chroma block; Figure 16 is a diagram illustrating another example of a resolution difference between a lightness block and a chroma block; Figure 17 is a schematic block diagram of an encoding device according to one embodiment of the present invention; and Figure 18 is a schematic block diagram of a decoding device according to one embodiment of the present invention.
Claims
1. A video decoding apparatus comprising one or more processors configured to: obtain first information indicating the presence of a residual signal in a current block; determine a transformation type of the current block based on second information indicating whether an inverse-transform based on a discrete cosine transform (DCT) or a discrete sine transform (DST) is permitted; if the first information indicates the presence of the residual signal in the current block, obtain transform coefficients from the residual signal of the current block based on a scan direction for the residual signal of the current block; and perform the inverse-transform on the transform coefficients based on the determined transformation type to obtain residual samples of the current block; generate prediction samples of the current block; and reconstruct the current block based on the residual samples and the prediction samples, wherein the scan direction is determined based on the second information.
2. The image decoding apparatus of request item 1, wherein if the second information indicates that the inverse transformation based on DCT or DST is permitted, the scanning direction is determined based on an intra-block prediction mode.
3. The image decoding apparatus of claim 2, wherein if the second information indicates that the inverse transform based on DCT or DST is not allowed to determine the scan direction independently of the intrapredictive mode of the current block.
4. The image decoding apparatus of claim 1, wherein if the second information indicates that the inverse transformation based on DCT or DST is permitted, the scanning direction is determined to be one of a first direction, a second direction and a third direction based on an in-block prediction mode of the current block.
5. The image decoding apparatus of claim 4, wherein the second direction is a row direction of the current block and the third direction is a column direction of the current block.
6. The image decoding apparatus of claim 5, wherein if the second information indicates that the inverse transform of the DCT or the DST is not allowed to determine the scanning direction as the first direction independently of the intrapredictive mode of the current block.
7. The image decoding apparatus of claim 6, wherein the second direction is more vertical than the first direction, and the third direction is more horizontal than the first direction.
8. The image decoding apparatus of claim 1, wherein the transformation type of the current block is further determined based on the size of one of the current blocks.
9. A video encoding apparatus comprising one or more processors configured to: generate a prediction sample of a current block; determine whether a residual signal exists in the current block; generate a residual sample based on the prediction sample; determine a transform type of the current block based on whether an inverse transform based on a discrete cosine transform (DCT) or a discrete sine transform (DST) is permitted; transform the residual sample based on the transform type of the current block to generate transform coefficients; apply a scan direction to the transform coefficients; and if the residual signal exists in the current block, generate a bitstream containing the residual signal, wherein... The scanning direction is determined based on whether inverse transformation based on either DCT or DST is allowed.
10. A non-transitory computer-readable recording medium storing a one-bit stream decoded by a decoding method, the video decoding method comprising: Obtain first information indicating whether a residual signal exists in the current block; A transformation type for the current block is determined based on second information indicating whether an inverse transformation based on either Discrete Cosine Transform (DCT) or Discrete Sine Transform (DST) is permitted; if the first information indicates the presence of the residual signal in the current block, transformation coefficients are obtained from the residual signal of the current block based on a scan direction for the residual signal of the current block; and the inverse transformation is performed on the transformation coefficients based on the determined transformation type to obtain residual samples of the current block; a predicted sample of the current block is generated; and the current block is reconstructed based on the residual sample and the predicted sample, wherein the scan direction is determined based on the second information.
Citation Information
Patent Citations
Method, device and system for processing image residual block
CN102447896A
Multilayer-based video encoding / decoding method and video encoder / decoder using smoothing prediction
TW200727709A
Signaling selected directional transform for video coding
US20120008683A1
Mode dependent scanning of coefficients of a block of video data
WO2012087713A1
