Method for decoding or encoding an image and device for transmitting compressed video data
By grading and dividing the encoding blocks of the video signals and determining the intra prediction mode, the problem of increasing high-resolution image data transmission and storage costs is solved, and more efficient encoding and more accurate intra prediction are achieved.
Patent Information
- Application Number
- CN202211007179.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2015-08-31
- Filing Date
- 2016-08-29
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2036-08-29
AI Technical Summary
As the resolution and quality of image data improve, and the cost of transmission and storage increases, it is difficult for the prior art to effectively process high-resolution and ultra-high-resolution stereoscopic image content.
A method and apparatus for encoding/decoding of video signals are provided, by grading the encoding blocks, performing intra prediction, and correcting the prediction samples to improve encoding efficiency and accuracy of intra prediction.
Through the effective determination of the hierarchical/adaptive division of the encoding block and the intra prediction mode, the encoding efficiency and the accuracy of intra prediction are improved, and the cost of transmission and storage is reduced.
Smart Images

Figure CN115278236B_ABST
Abstract
Description
[0001] This application is a divisional application of the Chinese patent application with the application date of August 29, 2016, the international application number of PCT / KR2016 / 009574, the invention name of “Method and device for processing video signals”, and the application number of 201680062859.2 that has entered the Chinese national phase. Technical Field
[0002] The invention relates to a method and an apparatus for processing a video signal. Background Art
[0003] Recently, the demand for high-resolution and high-quality images (e.g., high-definition (HD) images and ultra-high-definition (UHD) images) has increased in various application fields. However, the data amount of image data with higher resolution and quality has increased compared to conventional image data. Therefore, when the image data is transmitted by using a medium (e.g., conventional wired and wireless broadband networks), or when the image data is stored by using a conventional storage medium, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data are improved, efficient image encoding / decoding technology can be used.
[0004] The image compression technology includes various technologies, including: an inter-frame prediction technology that predicts a pixel value included in a current picture based on a previous picture or a subsequent picture of the current picture; an intra-frame prediction technology that predicts a pixel value included in the current picture by using pixel information in the current picture; an entropy coding technology that assigns a short code to a value with a high frequency of occurrence and a long code to a value with a low frequency of occurrence, etc. Image data can be effectively compressed by using such an image compression technology, and the image data can be transmitted or stored.
[0005] Meanwhile, as the demand for high-resolution images increases, the demand for stereoscopic image content as a new image service is also increasing. Video compression technology for efficiently providing stereoscopic image content with high resolution and ultra-high resolution is being explored. Summary of the invention
[0006] Technical issues
[0007] An object of the present invention is to provide a method and apparatus for encoding / decoding a video signal, wherein the method and apparatus hierarchically divide a coding block.
[0008] An object of the present invention is to provide a method and apparatus for encoding / decoding a video signal, the method and apparatus performing intra-frame prediction on an encoding / decoding target block.
[0009] An object of the present invention is to provide a method and apparatus for encoding / decoding a video signal, wherein the method and apparatus correct a prediction sample of an encoding / decoding target block.
[0010] Technical Solution
[0011] According to the present invention, a method and apparatus for decoding a video signal are provided, the method comprising: determining an intra-frame prediction mode of a current block; obtaining a reference sample for intra-frame prediction of the current block; and performing intra-frame prediction on the current block based on the intra-frame prediction mode and the reference sample.
[0012] In the method and apparatus for decoding a video signal according to the present invention, the current block may be a non-square coding block divided based on at least one of a quadtree and a binary tree.
[0013] In the method and apparatus for decoding a video signal according to the present invention, determining the intra prediction mode may include: generating a candidate list having a plurality of candidates; and determining the intra prediction mode of the current block based on the candidate list and an index.
[0014] In the method and apparatus for decoding a video signal according to the present invention, the maximum number of candidates that may be included in the candidate list may be more than three.
[0015] In the method and apparatus for decoding a video signal according to the present invention, the determined intra prediction mode may be one of extended intra prediction modes, and the extended intra prediction mode may include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0016] In the method and apparatus for decoding a video signal according to the present invention, performing intra prediction may include: obtaining prediction samples of a current block based on an intra prediction mode and reference samples; and correcting the obtained prediction samples using differential information of adjacent samples of the current block.
[0017] In the method and apparatus for decoding a video signal according to the present invention, performing intra prediction may include: obtaining a prediction sample of a current block based on an intra prediction mode and a reference sample; and correcting the obtained prediction sample based on at least one of a predetermined weight and an offset.
[0018] According to the present invention, a method and apparatus for encoding a video signal are provided, the method comprising: determining an intra-frame prediction mode of a current block; obtaining a reference sample for intra-frame prediction of the current block; and performing intra-frame prediction on the current block based on the intra-frame prediction mode and the reference sample.
[0019] In the method and apparatus for encoding a video signal according to the present invention, the current block may be a non-square coding block divided based on at least one of a quadtree and a binary tree.
[0020] In the method and apparatus for encoding a video signal according to the present invention, determining the intra prediction mode may include: generating a candidate list having a plurality of candidates; and determining the intra prediction mode of the current block based on the candidate list and an index.
[0021] In the method and apparatus for encoding a video signal according to the present invention, the maximum number of candidates that may be included in the candidate list may be more than three.
[0022] In the method and apparatus for encoding a video signal according to the present invention, the determined intra prediction mode may be one of extended intra prediction modes, and the extended intra prediction modes include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0023] In the method and apparatus for encoding a video signal according to the present invention, performing intra prediction may include: obtaining a prediction sample of a current block based on an intra prediction mode and a reference sample; and correcting the obtained prediction sample using differential information of adjacent samples of the current block.
[0024] In the method and apparatus for encoding a video signal according to the present invention, performing intra prediction may include: obtaining a prediction sample of a current block based on an intra prediction mode and a reference sample; and correcting the obtained prediction sample based on at least one of a predetermined weight and an offset.
[0025] Beneficial Effects
[0026] According to the present invention, the coding efficiency can be improved by hierarchical / adaptive partitioning of coding blocks.
[0027] According to the present invention, it is possible to effectively determine an intra prediction mode of an encoding / decoding target block and improve the accuracy of intra prediction.
[0028] According to the present invention, a method for decoding an image is provided, comprising: determining an intra-frame prediction mode of a current block in the image; obtaining a reference sample for intra-frame prediction of the current block; and performing intra-frame prediction of the current block based on the intra-frame prediction mode and the reference sample, wherein the intra-frame prediction mode of the current block is determined based on a candidate list and index information, wherein the candidate list includes multiple candidates, wherein the multiple candidates are determined based on the intra-frame prediction modes of neighboring blocks adjacent to the current block, wherein the index information specifies one of the multiple candidates in the candidate list, and wherein the maximum number of candidates included in the candidate list is 5.
[0029] According to the present invention, a method for encoding an image is provided, comprising: obtaining a reference sample for intra-frame prediction of a current block in the image; and performing intra-frame prediction of the current block based on the reference sample, wherein an intra-frame prediction mode for intra-frame prediction of the current block is determined based on a candidate list, wherein the candidate list includes multiple candidates, wherein the multiple candidates are determined based on the intra-frame prediction modes of neighboring blocks adjacent to the current block, wherein index information is encoded to specify the intra-frame prediction mode of the current block among the multiple candidates in the candidate list, and wherein the maximum number of candidates included in the candidate list is 5.
[0030] According to the present invention, a device for transmitting compressed video data is provided, comprising: a processor configured to obtain compressed video data; and a transmitting unit configured to transmit the compressed video data, wherein obtaining the compressed video data comprises: obtaining a first prediction sample of a current block in an image; determining a template of the current block, wherein, according to a template mode of the current block, the template of the current block consists of only upper reference samples, only left reference samples, or both upper reference samples and left reference samples; obtaining weights and offsets based on reference samples in the template; and obtaining a second prediction sample by multiplying the weights with the first prediction sample and then adding an offset, wherein the weights and offsets are obtained by using sub-sampled reference samples selected from the reference samples, and wherein the sub-sampling rate of the upper reference samples is determined based on the width of the current block, and the sub-sampling rate of the left reference samples is determined based on the height of the current block. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.
[0032] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.
[0033] Figure 3 is a view illustrating an example of hierarchically dividing a coding block based on a tree structure according to an embodiment of the present invention.
[0034] Figure 4 is a view illustrating types of predefined intra prediction modes of an apparatus for encoding / decoding a video according to an embodiment of the present invention.
[0035] Figure 5 is a flowchart briefly illustrating an intra prediction method according to an embodiment of the present invention.
[0036] Figure 6is a view illustrating a method of correcting a prediction sample of a current block based on differential information of adjacent samples according to an embodiment of the present invention.
[0037] Figure 7 and Figure 8 is a view illustrating a method of correcting a prediction sample based on a predetermined correction filter according to an embodiment of the present invention.
[0038] Fig. 9 is a view illustrating a method of correcting a prediction sample using a weight and an offset according to an embodiment of the present invention.
[0039] Figures 10 to 15 is a view illustrating a method of composing templates to determine a weight w according to an embodiment of the present invention.
[0040] Best Mode for Carrying Out the Invention
[0041] According to the present invention, a method and apparatus for decoding a video signal are provided, the method comprising: determining an intra-frame prediction mode of a current block; obtaining a reference sample for intra-frame prediction of the current block; and performing intra-frame prediction on the current block based on the intra-frame prediction mode and the reference sample.
[0042] In the method and apparatus for decoding a video signal according to the present invention, the current block may be a non-square coding block divided based on at least one of a quadtree and a binary tree.
[0043] In the method and apparatus for decoding a video signal according to the present invention, determining the intra prediction mode may include: generating a candidate list having a plurality of candidates; and determining the intra prediction mode of the current block based on the candidate list and an index.
[0044] In the method and apparatus for decoding a video signal according to the present invention, the maximum number of candidates that may be included in the candidate list may be more than three.
[0045] In the method and apparatus for decoding a video signal according to the present invention, the determined intra prediction mode may be one of extended intra prediction modes, and the extended intra prediction mode may include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0046] In the method and apparatus for decoding a video signal according to the present invention, performing intra prediction may include: obtaining prediction samples of a current block based on an intra prediction mode and reference samples; and correcting the obtained prediction samples using differential information of adjacent samples of the current block.
[0047] In the method and apparatus for decoding a video signal according to the present invention, performing intra prediction may include: obtaining a prediction sample of a current block based on an intra prediction mode and a reference sample; and correcting the obtained prediction sample based on at least one of a predetermined weight and an offset.
[0048] According to the present invention, a method and apparatus for encoding a video signal are provided, the method comprising: determining an intra-frame prediction mode of a current block; obtaining a reference sample for intra-frame prediction of the current block; and performing intra-frame prediction on the current block based on the intra-frame prediction mode and the reference sample.
[0049] In the method and apparatus for encoding a video signal according to the present invention, the current block may be a non-square coding block divided based on at least one of a quadtree and a binary tree.
[0050] In the method and apparatus for encoding a video signal according to the present invention, determining the intra prediction mode may include: generating a candidate list having a plurality of candidates; and determining the intra prediction mode of the current block based on the candidate list and an index.
[0051] In the method and apparatus for encoding a video signal according to the present invention, the maximum number of candidates that may be included in the candidate list may be more than three.
[0052] In the method and apparatus for encoding a video signal according to the present invention, the determined intra prediction mode may be one of extended intra prediction modes, and the extended intra prediction modes include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0053] In the method and apparatus for encoding a video signal according to the present invention, performing intra prediction may include: obtaining a prediction sample of a current block based on an intra prediction mode and a reference sample; and correcting the obtained prediction sample using differential information of adjacent samples of the current block.
[0054] In the method and apparatus for encoding a video signal according to the present invention, performing intra prediction may include: obtaining a prediction sample of a current block based on an intra prediction mode and a reference sample; and correcting the obtained prediction sample based on at least one of a predetermined weight and an offset. DETAILED DESCRIPTION
[0055] The present invention can be modified in various ways, and there are various embodiments of the present invention, examples of which will now be provided with reference to the accompanying drawings, and they will be described in detail. However, the present invention is not limited thereto, and the exemplary embodiments may be interpreted as including all modifications, equivalents or alternatives within the technical concept and technical scope of the present invention. In the accompanying drawings described, similar reference numerals refer to similar elements.
[0056] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components are not to be construed as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a "first" component may be referred to as a "second" component, and a "second" component may also be similarly referred to as a "first" component. The term "and / or" includes a combination of any one of a plurality of terms or a plurality of terms.
[0057] It should be understood that in this specification, when an element is simply referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” another element, or the element may be connected to or coupled to another element with other elements interposed therebetween. Conversely, it should be understood that when an element is referred to as being “directly coupled to” or “directly connected to” another element, there are no intervening elements.
[0058] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Expressions used in the singular include expressions in the plural form unless the expression has a significantly different meaning in the context. In this specification, it should be understood that terms such as "including", "having" and the like are intended to indicate the presence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added.
[0059] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same constituent elements in the drawings are denoted by the same reference numerals, and repeated description of the same elements will be omitted.
[0060] Figure 1 is a block diagram illustrating an apparatus for encoding a video according to an embodiment of the present invention.
[0061] Reference Figure 1The device 100 for encoding a video may include: a picture division module 110, prediction modules 120 and 125, a transformation module 130, a quantization module 135, a rearrangement module 160, an entropy coding module 165, an inverse quantization module 140, an inverse transformation module 145, a filter module 150 and a memory 155.
[0062] Figure 1 The components shown are shown independently to represent the characteristic functions that are different from each other in the device for encoding the video. Therefore, this does not mean that each component is composed of separate hardware or software components. In other words, for convenience, each component includes each of the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be divided into multiple components to perform each function. Without departing from the essence of the present invention, the embodiment of combining each component and the embodiment of dividing a component are also included in the scope of the present invention.
[0063] In addition, some of the components may not be indispensable components for performing the basic functions of the present invention, but optional components that only improve the performance of the present invention. The present invention can be realized by excluding components for improving performance and only including indispensable components for realizing the essence of the present invention. Structures that exclude optional components that only improve performance and only include indispensable components are also included in the scope of the present invention.
[0064] The picture partition module 110 may partition an input picture into one or more processing units. Here, a processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture partition module 110 may partition a picture into a combination of a plurality of coding units, prediction units, and transform units, and may encode a picture by selecting a combination of coding units, prediction units, and transform units using a predetermined criterion (e.g., a cost function).
[0065] For example, a picture can be divided into multiple coding units. A recursive tree structure (e.g., a quadtree structure) can be used to divide a picture into coding units. Coding units divided into other coding units with a picture or a maximum coding unit as the root can be divided in a manner that the child nodes correspond to the number of divided coding units. Coding units that cannot be divided any further according to predetermined restrictions are used as leaf nodes. That is, when it is assumed that only square division is feasible for a coding unit, a coding unit can be divided into up to four other coding units.
[0066] Hereinafter, in an embodiment of the present invention, a coding unit may mean a unit that performs encoding or a unit that performs decoding.
[0067] The prediction unit may be split into at least one square shape or rectangular shape having the same size in a single coding unit, or the prediction unit may be split such that: one split prediction unit in a single coding unit has a different shape and / or size from another split prediction unit.
[0068] When a prediction unit to be intra-predicted is generated based on a coding unit and the coding unit is not a minimum coding unit, intra-prediction may be performed without splitting the prediction unit into a plurality of prediction units N×N.
[0069] The prediction modules 120 and 125 may include an inter-frame prediction module 120 that performs inter-frame prediction and an intra-frame prediction module 125 that performs intra-frame prediction. It may be determined whether inter-frame prediction or intra-frame prediction is performed for prediction, and detailed information (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) according to each prediction method may be determined. Here, the processing unit to be predicted may be different from the processing unit for which the prediction method and detailed content are determined. For example, the prediction method, prediction mode, etc. may be determined by the prediction unit, and the prediction may be performed by the transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform module 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded together with the residual value by the entropy encoding module 165, and may be transmitted to a device for decoding a video. When a specific encoding mode is used, the original block may be completely encoded and transmitted to the decoding module without generating a prediction block through the prediction modules 120 and 125.
[0070] The inter-frame prediction module 120 may predict a prediction unit based on information of at least one of a previous picture or a subsequent picture of the current picture, or in some cases, may predict a prediction unit based on information of some coding regions in the current picture. The inter-frame prediction module 120 may include a reference picture interpolation module, a motion prediction module, and a motion compensation module.
[0071] The reference picture interpolation module may receive reference picture information from the memory 155, and may generate pixel information of integer pixels or less than integer pixels according to the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of integer pixels or less than integer pixels in units of 1 / 4 pixels. In the case of chrominance signals, a 4-tap interpolation filter based on DCT with different filter coefficients may be used to generate pixel information of integer pixels or less than integer pixels in units of 1 / 8 pixels.
[0072] The motion prediction module can perform motion prediction based on the reference picture interpolated by the reference picture interpolation module. As a method for calculating the motion vector, various methods such as a full search based block matching algorithm (FBMA), a three-step search (TSS) algorithm, and a new three-step search (NTS) algorithm can be used. Based on the interpolated pixel, the motion vector can have a motion vector value in units of 1 / 2 pixel or 1 / 4 pixel. The motion prediction module can predict the current prediction unit by changing the motion prediction method. As a motion prediction method, various methods such as a skip method, a merge method, an AMVP (Advanced Motion Vector Prediction) method, an intra-block copy method, etc. can be used.
[0073] The intra prediction module 125 may generate a prediction unit based on reference pixel information adjacent to a current block as pixel information in a current picture. When an adjacent block of a current prediction unit is a block to be inter-predicted and thus a reference pixel is a pixel to be inter-predicted, reference pixel information of an adjacent block to be intra-predicted may be replaced with a reference pixel included in the block to be inter-predicted. That is, when a reference pixel is unavailable, at least one reference pixel among available reference pixels may be used to replace the unavailable reference pixel information.
[0074] The prediction mode in the intra prediction may include a directional prediction mode using reference pixel information according to a prediction direction and a non-directional prediction mode that does not use directional information when performing prediction. The mode for predicting luminance information may be different from the mode for predicting chrominance information, and in order to predict chrominance information, the intra prediction mode information for predicting luminance information may be utilized or the predicted luminance signal information may be utilized.
[0075] When performing intra prediction, when the size of the prediction unit is the same as the size of the transform unit, intra prediction can be performed on the prediction unit based on pixels located on the left, upper left, and upper sides of the prediction unit. However, when performing intra prediction, when the size of the prediction unit is different from the size of the transform unit, intra prediction can be performed using reference pixels based on the transform unit. In addition, intra prediction using N×N partitioning only for the minimum coding unit can be used.
[0076] In the intra prediction method, a prediction block may be generated after applying an AIS (Adaptive Intra Smoothing) filter to a reference pixel according to a prediction mode. The type of the AIS filter applied to the reference pixel may be different. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit may be predicted according to the intra prediction mode of a prediction unit adjacent to the current prediction unit. In the process of predicting the prediction mode of the current prediction unit by using the mode information predicted according to the adjacent prediction unit, when the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the adjacent prediction unit, predetermined flag information may be used to transmit information indicating that the prediction mode of the current prediction unit and the prediction mode of the adjacent prediction unit are the same as each other. When the prediction mode of the current prediction unit is different from the prediction mode of the adjacent prediction unit, entropy coding may be performed to encode the prediction mode information of the current block.
[0077] In addition, a residual block including information on a residual value that is a difference between a prediction unit to be predicted and an original block of the prediction unit may be generated based on the prediction unit generated by the prediction modules 120 and 125. The generated residual block may be input to the transform module 130.
[0078] The transform module 130 may transform the residual block including information on the residual value between the original block and the prediction unit generated by the prediction modules 120 and 125 by using a transform method such as discrete cosine transform (DCT), discrete sine transform (DST), and KLT. Whether to apply DCT, DST, or KLT to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.
[0079] The quantization module 135 may quantize the value converted to the frequency domain by the transform module 130. The quantization coefficient may be different according to the block or importance of the picture. The value calculated by the quantization module 135 may be provided to the inverse quantization module 140 and the rearrangement module 160.
[0080] The rearrangement module 160 may rearrange coefficients of the quantized residual value.
[0081] The rearrangement module 160 can change the coefficient of the two-dimensional block form into the coefficient of the one-dimensional vector form by the coefficient scanning method. For example, the rearrangement module 160 can use the zigzag scanning method to scan from the DC coefficient to the coefficient of the high frequency domain so that the coefficient is changed into the one-dimensional vector form. According to the size of the transform unit and the intra-frame prediction mode, the zigzag scanning can be replaced by the vertical direction scanning of the coefficient of the two-dimensional block form along the column direction or the horizontal direction scanning of the coefficient of the two-dimensional block form along the row direction. That is to say, it can be determined according to the size of the transform unit and the intra-frame prediction mode which scanning method to use among the zigzag scanning, the vertical direction scanning and the horizontal direction scanning.
[0082] The entropy encoding module 165 may perform entropy encoding based on the value calculated by the rearrangement module 160. The entropy encoding may use various encoding methods, for example, exponential Golomb coding, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).
[0083] The entropy coding module 165 can encode various information from the rearrangement module 160 and the prediction modules 120 and 125 (for example, residual value coefficient information and block type information of the coding unit, prediction mode information, partition unit information, prediction unit information, transformation unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.).
[0084] The entropy encoding module 165 may entropy encode coefficients of the coding unit input from the rearrangement module 160 .
[0085] The inverse quantization module 140 may inversely quantize the value quantized by the quantization module 135, and the inverse transform module 145 may inversely transform the value transformed by the transform module 130. The residual values generated by the inverse quantization module 140 and the inverse transform module 145 may be combined with the prediction unit predicted by the motion estimation module, the motion compensation unit, and the intra prediction module of the prediction modules 120 and 125, so that a reconstructed block may be generated.
[0086] The filter module 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
[0087] The deblocking filter can remove block distortion caused by the boundaries between blocks in the reconstructed picture. In order to determine whether to perform deblocking, it can be determined whether to apply the deblocking filter to the current block based on the pixels included in several rows or columns of the block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the required deblocking filter strength. In addition, when applying the deblocking filter, horizontal filtering and vertical filtering can be processed in parallel.
[0088] The offset correction module can correct the offset from the original picture in units of pixels for the picture to be deblocked. In order to perform offset correction on a specific picture, a method of applying an offset considering edge information of each pixel can be used, or the following method can be used: dividing the pixels of the picture into a predetermined number of regions, determining the region to perform the offset, and applying the offset to the determined region.
[0089] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed picture with an original picture. The pixels included in the picture can be divided into predetermined groups, the filter to be applied to each group can be determined, and filtering can be performed separately for each group. Information on whether ALF is applied and a luminance signal can be transmitted by a coding unit (CU). The shape and filter coefficients of the filter used for ALF can be different for each block. In addition, regardless of the characteristics of the application target block, the filter for ALF of the same form (fixed form) can be applied.
[0090] The memory 155 may store the reconstructed block or the reconstructed picture calculated by the filter module 150. The stored reconstructed block or the reconstructed picture may be provided to the prediction modules 120 and 125 when performing inter prediction.
[0091] Figure 2 is a block diagram illustrating an apparatus for decoding a video according to an embodiment of the present invention.
[0092] Reference Figure 2 , the apparatus 200 for decoding a video may include: an entropy decoding module 210 , a rearrangement module 215 , an inverse quantization module 220 , an inverse transform module 225 , prediction modules 230 and 235 , a filter module 240 , and a memory 245 .
[0093] When a video bitstream is input from an apparatus for encoding a video, the input bitstream may be decoded according to an inverse process of the apparatus for encoding a video.
[0094] The entropy decoding module 210 can perform entropy decoding according to the inverse process of entropy encoding performed by the entropy encoding module of the device for encoding the video. For example, corresponding to the method performed by the device for encoding the video, various methods such as exponential Golomb coding, context adaptive variable length coding (CAVLC) and context adaptive binary arithmetic coding (CABAC) can be applied.
[0095] The entropy decoding module 210 may decode information about intra prediction and inter prediction performed by the apparatus for encoding a video.
[0096] The rearrangement module 215 may perform rearrangement on the bitstream entropy-decoded by the entropy decoding module 210 based on the rearrangement method used in the apparatus for encoding a video. The rearrangement module may reconstruct and rearrange coefficients in the form of a one-dimensional vector into coefficients in the form of a two-dimensional block. The rearrangement module 215 may perform rearrangement by receiving information related to coefficient scanning performed in the apparatus for encoding a video, and inversely scanning the coefficients based on the scanning order performed in the apparatus for encoding a video.
[0097] The inverse quantization module 220 may perform inverse quantization based on a quantization parameter received from an apparatus for encoding a video and coefficients of the rearranged block.
[0098] The inverse transform module 225 may perform an inverse transform (i.e., inverse DCT, inverse DST, and inverse KLT) on the quantization result performed by the device for encoding the video, that is, the inverse process of the transform (i.e., DCT, DST, and KLT) performed by the transform module. The inverse transform may be performed based on a transmission unit determined by the device for encoding the video. The inverse transform module 225 of the device for decoding the video may selectively perform a transform technique (e.g., DCT, DST, KLT) according to a plurality of pieces of information (e.g., a prediction method, a size of a current block, a prediction direction, etc.).
[0099] The prediction modules 230 and 235 may generate a prediction block based on information on prediction block generation received from the entropy decoding module 210 and previously decoded block or picture information received from the memory 245 .
[0100] As described above, similar to the operation of the apparatus for encoding a video, when performing intra-frame prediction, when the size of the prediction unit is the same as the size of the transform unit, intra-frame prediction can be performed on the prediction unit based on pixels located on the left, upper left, and upper sides of the prediction unit. When performing intra-frame prediction, when the size of the prediction unit is different from the size of the transform unit, intra-frame prediction can be performed using reference pixels based on the transform unit. In addition, intra-frame prediction using N×N partitioning only for the minimum coding unit can be used.
[0101] The prediction modules 230 and 235 may include a prediction unit determination module, an inter-frame prediction module, and an intra-frame prediction module. The prediction unit determination module may receive various information (e.g., prediction unit information, prediction mode information of an intra-frame prediction method, information on motion prediction of an inter-frame prediction method, etc.) from the entropy decoding module 210, may distinguish prediction units in the current coding unit, and may determine whether to perform inter-frame prediction or intra-frame prediction on the prediction unit. By using the information required for inter-frame prediction of the current prediction unit received from the device for encoding a video, the inter-frame prediction module 230 may perform inter-frame prediction on the current prediction unit based on information about at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit. Alternatively, inter-frame prediction may be performed based on information about some pre-reconstructed areas in the current picture including the current prediction unit.
[0102] In order to perform inter prediction, which one of the skip mode, the merge mode, the AMVP mode, and the inter block copy mode to use as a motion prediction method of a prediction unit included in the coding unit may be determined based on the coding unit.
[0103] The intra prediction module 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit to be intra predicted, intra prediction can be performed based on the intra prediction mode information of the prediction unit received from the device for encoding the video. The intra prediction module 235 may include an adaptive intra smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block, and it can be determined whether to apply the filter according to the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block by using the prediction mode and AIS filter information of the prediction unit received from the device for encoding the video. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.
[0104] When the prediction mode of the prediction unit is a prediction mode for performing intra-frame prediction based on pixel values obtained by interpolating reference pixels, the reference pixel interpolation module may interpolate the reference pixels to generate reference pixels that are integer pixels or smaller than integer pixels. When the prediction mode of the current prediction unit is a prediction mode for generating a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.
[0105] The reconstructed block or the reconstructed picture may be provided to the filter module 240. The filter module 240 may include a deblocking filter, an offset correction module, and an ALF.
[0106] Information about whether to apply a deblocking filter to a corresponding block or picture and information about which filter of a strong filter and a weak filter to apply when applying the deblocking filter can be received from a device for encoding a video. A deblocking filter of a device for decoding a video can receive information about the deblocking filter from a device for encoding a video, and can perform deblocking filtering on a corresponding block.
[0107] The offset correction module may perform offset correction on the reconstructed picture based on the type of offset correction applied to the picture when encoding is performed and offset value information.
[0108] The ALF may be applied to the coding unit based on information on whether the ALF is applied and ALF coefficient information, etc., received from the apparatus for encoding a video. The ALF information may be provided to be included in a specific parameter set.
[0109] The memory 245 may store the reconstructed picture or the reconstructed block to be used as a reference picture or a reference block, and may provide the reconstructed picture to the output module.
[0110] As described above, in the embodiments of the present invention, for convenience of explanation, a coding unit is used as a term representing a coding unit, however, a coding unit may be used as a unit that performs decoding as well as encoding.
[0111] Figure 3 is a view illustrating an example of hierarchically dividing a coding block based on a tree structure according to an embodiment of the present invention.
[0112] The input video signal is decoded in a predetermined block unit, and the default unit for decoding the input video signal is a coding block. The coding block may be a block that performs intra / inter prediction, transformation, and quantization. The coding block may be a square block or a non-square block having any size in the range of 8×8 to 64×64, or may be a square block or a non-square block having a size of 128×128, 256×256, or more.
[0113] Specifically, the coding block can be hierarchically divided based on at least one of a quadtree and a binary tree. Here, quadtree-based division may mean dividing a 2N×2N coding block into four N×N coding blocks, and binary tree-based division may mean dividing one coding block into two coding blocks. Binary tree-based division can be performed symmetrically or asymmetrically. The coding block based on binary tree division may be a square block or a non-square block (e.g., a rectangular shape). Binary tree-based division may be performed on the coding block for which quadtree-based division is no longer performed. Quadtree-based division may no longer be performed on the coding block based on binary tree division.
[0114] In order to implement adaptive partitioning based on quadtree or binary tree, the following information may be used: information indicating quadtree-based partitioning, information about the size / depth of coding blocks for which quadtree-based partitioning is allowed, information indicating binary tree-based partitioning, information about the size / depth of coding blocks for which binary tree-based partitioning is allowed, information about the size / depth of coding blocks for which binary tree-based partitioning is not allowed, information about whether binary tree-based partitioning is performed in a vertical direction or a horizontal direction, etc.
[0115] like Figure 3 As shown, the first coding block 300 with a partition depth (split depth) of k can be divided into multiple second coding blocks based on a quadtree. For example, the second coding blocks 310 to 340 can be square blocks with half the width and half the height of the first coding block, and the partition depth of the second coding block can be increased to k+1.
[0116] The second coding block 310 having a split depth of k+1 may be split into a plurality of third coding blocks having a split depth of k+2. The splitting of the second coding block 310 may be performed by selectively using one of a quadtree and a binary tree according to a splitting method. Here, the splitting method may be determined based on at least one of information indicating a quadtree-based splitting and information indicating a binary tree-based splitting.
[0117] When the second coding block 310 is divided based on a quadtree, the second coding block 310 may be divided into four third coding blocks 310a having half the width and half the height of the second coding block, and the division depth of the third coding block 310a may be increased to k+2. In contrast, when the second coding block 310 is divided based on a binary tree, the second coding block 310 may be divided into two third coding blocks. Here, each of the two third coding blocks may be a non-square block having half the width and half the height of the second coding block, and the division depth may be increased to k+2. The second coding block may be determined as a non-square block in the horizontal direction or the vertical direction according to the division direction, and the division direction may be determined based on information about whether the binary tree-based division is performed in the vertical direction or in the horizontal direction.
[0118] At the same time, the second coding block 310 may be determined as a leaf coding block that is no longer partitioned based on a quadtree or a binary tree. In this case, the leaf coding block may be used as a prediction block or a transform block.
[0119] Similar to the division of the second coding block 310, the third coding block 310a may be determined as a leaf coding block, or may be further divided based on a quadtree or a binary tree.
[0120] At the same time, the third coding block 310b based on the binary tree division can be further divided into a coding block 310b-2 in the vertical direction or a coding block 310b-3 in the horizontal direction based on the binary tree, and the division depth of the relevant coding block can be increased to k+3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 that is no longer divided based on the binary tree. In this case, the coding block 310b-1 can be used as a prediction block or a transform block. However, the above-mentioned division processing can be performed restrictively based on at least one of the following information: information about the size / depth of the coding block that allows quadtree-based division, information about the size / depth of the coding block that allows binary tree-based division, and information about the size / depth of the coding block that does not allow binary tree-based division.
[0121] Figure 4 is a view illustrating types of predefined intra prediction modes of an apparatus for encoding / decoding a video according to an embodiment of the present invention.
[0122] The apparatus for encoding / decoding a video may perform intra prediction using one of the predefined intra prediction modes. The predefined intra prediction modes for intra prediction may include a non-directional prediction mode (eg, planar mode, DC mode) and 33 directional prediction modes.
[0123] Alternatively, in order to improve the accuracy of intra-frame prediction, a larger number of directional prediction modes than 33 directional prediction modes can be used. That is, M extended directional prediction modes (M>33) can be defined by subdividing the angle of the directional prediction mode, and at least one of the 33 predefined directional prediction modes can be used to obtain a directional prediction mode with a predetermined angle.
[0124] Figure 4 An example of an extended intra prediction mode is shown, and the extended intra prediction mode may include two non-directional prediction modes and 65 extended directional prediction modes. The same number of extended intra prediction modes may be used for luma components and chroma components, or a different number of intra prediction modes may be used for each component. For example, 67 extended intra prediction modes may be used for luma components, and 35 intra prediction modes may be used for chroma components.
[0125] Alternatively, depending on the chroma format, different numbers of intra prediction modes may be used when performing intra prediction. For example, in the case of a 4:2:0 format, 67 intra prediction modes may be used for the luma component to perform intra prediction, and 35 intra prediction modes may be used for the chroma component. In the case of a 4:4:4 format, 67 intra prediction modes may be used for both the luma component and the chroma component to perform intra prediction.
[0126] Alternatively, depending on the size and / or shape of the block, different numbers of intra prediction modes may be used to perform intra prediction. That is, depending on the size and / or shape of the PU or CU, 35 intra prediction modes or 67 intra prediction modes may be used to perform intra prediction. For example, when the CU or PU has a size less than 64×64 or is divided asymmetrically, 35 intra prediction modes may be used to perform intra prediction. When the size of the CU or PU is equal to or greater than 64×64, 67 intra prediction modes may be used to perform intra prediction. For Intra_2N×2N, 65 directional intra prediction modes may be allowed, and for Intra_N×N, only 35 directional intra prediction modes may be allowed.
[0127] Figure 5 is a flowchart briefly illustrating an intra prediction method according to an embodiment of the present invention.
[0128] Reference Figure 5, the intra prediction mode of the current block may be determined at step S500.
[0129] Specifically, the intra prediction mode of the current block can be obtained based on the candidate list and the index. Here, the candidate list includes multiple candidates, and multiple candidates can be determined based on the intra prediction mode of the adjacent blocks adjacent to the current block. The adjacent blocks may include at least one of the blocks located on the upper side, lower side, left side, right side and corner of the current block. The index can specify one candidate among the multiple candidates in the candidate list. The candidate specified by the index can be set to the intra prediction mode of the current block.
[0130] The intra prediction mode used for intra prediction in the adjacent block may be set as a candidate. In addition, an intra prediction mode having a directionality similar to that of the intra prediction mode of the adjacent block may be set as a candidate. Here, the intra prediction mode having similar directionality may be determined by adding a predetermined constant value to the intra prediction mode of the adjacent block or subtracting a predetermined constant value from the intra prediction mode of the adjacent block. The predetermined constant value may be an integer (e.g., one, two, or more).
[0131] The candidate list may also include a default mode. The default mode may include at least one of a planar mode, a DC mode, a vertical mode, and a horizontal mode. The default mode may be adaptively added in consideration of the maximum number of candidates that may be included in the candidate list of the current block.
[0132] The maximum number of candidates that can be included in the candidate list can be three, four, five, six or more. The maximum number of candidates that can be included in the candidate list can be a fixed value preset in the device for encoding / decoding the video, or can be determined differently based on the characteristics of the current block. The characteristics can mean the position / size / shape of the block, the number / type of intra-frame prediction modes that the block can use, etc. Alternatively, information indicating the maximum number of candidates that can be included in the candidate list can be separately signaled, and the information can be used to determine the maximum number of candidates that can be included in the candidate list differently. The information indicating the maximum number of candidates can be signaled at at least one of the sequence level, the picture level, the slice level, and the block level.
[0133] When the extended intra prediction mode and the 35 predefined intra prediction modes are selectively used, the intra prediction mode of the adjacent block can be transformed into an index corresponding to the extended intra prediction mode, or transformed into an index corresponding to the 35 intra prediction modes, thereby obtaining a candidate. In order to transform into an index, a predefined table can be used, or a scaling operation based on a predetermined value can be used. Here, the predefined table can define a mapping relationship between different intra prediction mode groups (e.g., an intra prediction mode of an extended frame and 35 intra prediction modes).
[0134] For example, when the left neighboring block uses 35 intra prediction modes and the intra prediction mode of the left neighboring block is 10 (horizontal mode), the intra prediction mode may be transformed into index 16 corresponding to the horizontal mode in the extended intra prediction mode.
[0135] Alternatively, when the upper neighboring block uses the extended intra prediction mode and the intra prediction mode of the upper neighboring block has an index of 50 (vertical mode), the intra prediction mode may be transformed into an index of 26 corresponding to the vertical mode among the 35 intra prediction modes.
[0136] Based on the above method of determining the intra prediction mode, the intra prediction mode may be independently obtained for each of the luminance component and the chrominance component, or the intra prediction mode of the chrominance component may be obtained according to the intra prediction mode of the luminance component.
[0137] Specifically, as shown in Table 1 below, the intra prediction mode of the chrominance component may be determined based on the intra prediction mode of the luminance component.
[0138] [Table 1]
[0139]
[0140] In Table 1, intra_chroma_pred_mode means information signaled to specify an intra prediction mode of a chroma component, and IntraPredModeY indicates an intra prediction mode of a luma component.
[0141] Reference Figure 5 , at step S510, a reference sample for intra prediction of the current block may be obtained.
[0142] Specifically, reference samples for intra prediction may be obtained based on neighboring samples of the current block. The neighboring samples may be reconstructed samples of neighboring blocks, and the reconstructed samples may be reconstructed samples before applying a loop filter or reconstructed samples after applying a loop filter.
[0143] The adjacent samples reconstructed before the current block may be used as reference samples, and the adjacent samples filtered based on a predetermined intra-frame filter may be used as reference samples. The intra-frame filter may include at least one of a first intra-frame filter applied to a plurality of adjacent samples located on the same horizontal line and a second intra-frame filter applied to a plurality of adjacent samples located on the same vertical line. Depending on the position of the adjacent samples, one of the first intra-frame filter and the second intra-frame filter may be selectively applied, or both intra-frame filters may be applied.
[0144] Filtering may be adaptively performed based on at least one of the intra prediction mode of the current block and the size of the transform block of the current block. For example, when the intra prediction mode of the current block is a DC mode, a vertical mode, or a horizontal mode, filtering may not be performed. When the size of the transform block is N×M, filtering may not be performed. Here, N and M may be the same value or different values, or may be 4, 8, 16 or greater. Alternatively, filtering may be selectively performed based on the result of comparing a predefined threshold with the difference between the intra prediction mode of the current block and the vertical mode (or horizontal mode). For example, filtering may be performed when the difference between the intra prediction mode of the current block and the vertical mode is greater than a threshold. As shown in Table 2, a threshold may be defined for each size of the transform block.
[0145] [Table 2]
[0146] 8×8 Transform 16×16 Transform 32×32 Transform Threshold 7 1 0
[0147] The intra filter may be determined as one of a plurality of intra filter candidates predefined in a device for encoding / decoding a video. To this end, an index of an intra filter for a current block among a plurality of intra filter candidates may be transmitted by a signal. Alternatively, the intra filter may be determined based on at least one of the following: the size / shape of the current block, the size / shape of the transform block, information about filter strength, and a change in neighboring samples.
[0148] Reference Figure 5 At step 520, intra prediction may be performed using the intra prediction mode and reference samples of the current block.
[0149] That is, the prediction sample of the current block can be obtained using the intra prediction mode determined at step S500 and the reference sample obtained at step S510. However, in the case of intra prediction, the boundary samples of the adjacent blocks may be used, and thus the quality of the predicted picture may be reduced. Therefore, a correction process may be performed on the prediction samples generated by the above prediction process, and the reference samples may be used as the reference samples. Figures 6 to 15 However, the correction process is not limited to being applied only to intra-prediction samples, and the correction process may be applied to inter-prediction samples or reconstructed samples.
[0150] Figure 6 is a view illustrating a method of correcting a prediction sample of a current block based on differential information of adjacent samples according to an embodiment of the present invention.
[0151] The prediction samples of the current block may be corrected based on differential information of a plurality of adjacent samples of the current block. The correction may be performed on all prediction samples in the current block, or may be performed on predetermined samples in some predetermined areas. Some areas may be one row / column or multiple rows / columns, or may be preset areas for correction in an apparatus for encoding / decoding a video, or may be determined differently based on at least one of the size / shape of the current block and an intra prediction mode.
[0152] The neighboring samples may belong to a neighboring block located at the upper side, the left side, or the upper left corner of the current block. The number of neighboring samples used for correction may be two, three, four, or more. The positions of the neighboring samples may be determined differently according to the positions of the prediction samples as the correction target in the current block. Alternatively, some of the neighboring samples may have fixed positions regardless of the positions of the prediction samples as the correction target, and the remaining neighboring samples may have different positions according to the positions of the prediction samples as the correction target.
[0153] The difference information of the adjacent samples may mean the difference samples between the adjacent samples, or may mean a value obtained by scaling the difference samples by a predetermined constant value (e.g., one, two, three, etc.). Here, the predetermined constant value may be determined in consideration of the position of the prediction sample as the correction target, the position of the row or column including the prediction sample as the correction target, the position of the prediction sample within the row or column, etc.
[0154] For example, when the intra prediction mode of the current block is a vertical mode, as shown in Formula 1, the final prediction sample can be obtained using the difference sample between the upper left adjacent sample p(-1,-1) and the adjacent sample p(-1,y) adjacent to the left boundary of the current block. (y=0...N-1)
[0155] [Formula 1]
[0156] P′(0,y)=P(0,y)+((p(-1,y)-p(-1,-1))>>1
[0157] For example, when the intra prediction mode of the current block is the horizontal mode, as shown in Formula 2, the final prediction sample can be obtained using the difference sample between the upper left adjacent sample p(-1,-1) and the adjacent sample p(x,-1) adjacent to the upper boundary of the current block. (x=0...N-1)
[0158] [Formula 2]
[0159] P′(x,0)=P(x,0)+((p(x,-1)-p(-1,-1))>>1
[0160] For example, when the intra prediction mode of the current block is a vertical mode, the final prediction sample can be obtained using the difference sample between the upper left adjacent sample p(-1,-1) and the adjacent sample p(-1,y) adjacent to the left boundary of the current block. Here, the difference sample can be added to the prediction sample, or the difference sample can be scaled by a predetermined constant value and then added to the prediction sample. The predetermined constant value used in scaling can be determined differently according to rows and / or columns. For example, the prediction sample can be corrected as shown in Formula 3 and Formula 4. (y=0...N-1)
[0161] [Formula 3]
[0162] P′(0,y)=P(0,y)+((p(-1,y)-p(-1,-1))>>1
[0163] [Formula 4]
[0164] P′(1,y)=P(1,y)+((p(-1,y)-p(-1,-1))>>2
[0165] For example, when the intra prediction mode of the current block is a horizontal mode, the difference sample between the upper left neighboring sample p(-1,-1) and the neighboring sample p(x,-1) adjacent to the upper boundary of the current block can be used to obtain the final prediction sample as described in the case of the vertical mode. For example, the prediction sample can be corrected as shown in Formula 5 and Formula 6. (x=0...N-1)
[0166] [Formula 5]
[0167] P′(x,0)=p(x,0)+((p(x,-1)-p(-1,-1))>>1
[0168] [Formula 6]
[0169] P′(x,1)=p(x,1)+((p(x,-1)-p(-1,-1))>>2
[0170] Figure 7 and Figure 8 is a view illustrating a method of correcting a prediction sample based on a predetermined correction filter according to an embodiment of the present invention.
[0171] The prediction sample may be corrected based on the neighboring samples of the prediction sample as the correction target and a predetermined correction filter. Here, the neighboring samples may be specified by the angle line of the directional prediction mode of the current block, or the neighboring samples may be at least one sample located on the same angle line as the prediction sample as the correction target. In addition, the neighboring samples may be the prediction samples in the current block, or may be the reconstructed samples in the neighboring blocks reconstructed before the current block.
[0172] At least one of the number of taps, strength, and filter coefficients of the correction filter can be determined based on at least one of the following: the position of the prediction sample as the correction target, whether the prediction sample as the correction target is located at the boundary of the current block, the intra-frame prediction mode of the current block, the angle of the directional prediction mode, the prediction mode of the adjacent block (inter-frame mode or intra-frame mode), and the size / shape of the current block.
[0173] Reference Figure 7 , when the directional prediction mode has an index of 2 or 34, a final prediction sample may be obtained using at least one prediction / reconstruction sample located on the lower left side of the prediction sample as a correction target and a predetermined correction filter. Here, the prediction / reconstruction sample on the lower left side may belong to a previous row of a row including the prediction sample as a correction target, to the same block as the current sample, or to a neighboring block adjacent to the current block.
[0174] The filtering of the prediction samples may be performed only on the rows located at the block boundary, or may be performed on multiple rows. A correction filter different for each row may be used, at least one of the number of filter taps and the filter coefficient. For example, a (1 / 2, 1 / 2) filter may be used for the first row on the left closest to the block boundary, a (12 / 16, 4 / 16) filter may be used for the second row, a (14 / 16, 2 / 16) filter may be used for the third row, and a (15 / 16, 1 / 16) filter may be used for the fourth row.
[0175] Alternatively, when the directional prediction mode has an index of 3 to 6 or 30 to 33, it may be as follows Figure 8 Filtering is performed on the block boundary as shown, and a 3-tap correction filter can be used to correct the prediction sample. The filtering can be performed using the lower left sample of the prediction sample as the correction target, the lower sample of the lower left sample, and a 3-tap correction filter that takes the prediction sample as the correction target as input. The position of the adjacent sample used by the correction filter can be determined differently based on the directional prediction mode. The filter coefficient of the correction filter can be determined differently according to the directional prediction mode.
[0176] Different correction filters can be applied depending on whether the neighboring blocks are encoded in inter-frame mode or intra-frame mode. When the neighboring blocks are encoded in intra-frame mode, a filtering method that gives more weight to the prediction samples can be used than when the neighboring blocks are encoded in inter-frame mode. For example, in the case where the intra-frame prediction mode is 34, when the neighboring blocks are encoded in inter-frame mode, a (1 / 2, 1 / 2) filter can be used, and when the neighboring blocks are encoded in intra-frame mode, a (4 / 16, 12 / 16) filter can be used.
[0177] The number of rows to be filtered in the current block may be different depending on the size / shape of the current block (e.g., coding block and prediction block). For example, when the size of the current block is equal to or less than 32×32, filtering may be performed only on one row at the block boundary; otherwise, filtering may be performed on multiple rows including one row at the block boundary.
[0178] Figure 7 and Figure 8 Based on which Figure 4 The present invention is about the case where 35 intra prediction modes are used, but can also be equally / similarly applied to the case where the extended intra prediction mode is used.
[0179] Fig. 9 is a view illustrating a method of correcting a prediction sample using a weight and an offset according to an embodiment of the present invention.
[0180] When the brightness changes between the previous frame and the current frame, even if the current block is similar to the collocated block of the previous frame, it is impossible to encode the predicted picture with intra prediction or inter prediction, or the quality of the predicted picture encoded with intra prediction or inter prediction may be relatively low. In this case, the weight and offset for brightness compensation can be applied to the predicted sample so that the quality of the predicted picture can be improved.
[0181] Reference Fig. 9 , at step S900, at least one of a weight w and an offset f may be determined.
[0182] At least one of the weight w and the offset f may be signaled in at least one of a sequence parameter set, a picture parameter set, and a slice header. Alternatively, at least one of the weight w and the offset f may be signaled in a predetermined block unit sharing the same weight w and offset f, and a plurality of blocks (e.g., CU, PU, and TU) belonging to the predetermined block unit may share one signaled weight w and / or offset f.
[0183] At least one of the weight w and the offset f may be signaled regardless of the prediction mode of the current block, and at least one of the weight w and the offset f may be selectively signaled in consideration of the prediction mode. For example, when the prediction mode of the current block is an inter-frame mode, the weight w and / or the offset f may be signaled; otherwise, the weight w and / or the offset f may not be signaled. Here, the inter-frame mode may include at least one of a skip mode, a merge mode, an AMVP mode, and a current picture reference mode. The current picture reference mode may mean a prediction mode using a pre-reconstructed region in a current picture including the current block. The pre-reconstructed region may be specified using a motion vector for the current picture reference mode. A flag or index indicating whether the current block is encoded in the current picture reference mode may be signaled, or the flag or index may be obtained by the reference picture index of the current block. The current picture for the current picture reference mode may be present at a fixed position (e.g., a position of refIdx=0 or the last position) in the reference picture list of the current block. Alternatively, the current picture may be located at a different position in the reference picture list, and for this purpose, a separate reference picture index indicating the position of the current picture may be signaled.
[0184] The weight may be obtained using a brightness change between a first template of a specific shape adjacent to the current block and a second template corresponding to the specific shape adjacent to the previous block. The second template may include unavailable samples. In this case, the available samples may be copied to the location of the unavailable samples, or the available samples may be obtained by interpolation between a plurality of available samples. Here, the available samples may be included in the second template or the adjacent block. At least one of the coefficients, shape, and number of taps of the filter used for interpolation may be determined differently based on the size and / or shape of the template. Figures 10 to 15 To describe in detail the method of composing templates.
[0185] For example, when the neighboring samples of the current block are represented by y i (i ranges from 0 to N-1) and the adjacent samples of the parallel block are specified by x i (i ranges from 0 to N-1) When specified, the weight w and offset f can be obtained as follows.
[0186] Using a template of a specific shape adjacent to the current block, the weight w and offset f can be obtained by obtaining the minimum value of E(w,f) in Formula 7.
[0187] [Formula 7]
[0188] E(w,f)=Σ i (p i -(wp i -f)) 2 +λ(w-1)2
[0189] Formula 7 for obtaining the minimum value can be transformed into Formula 8.
[0190] [Formula 8]
[0191]
[0192] Formula 9 for obtaining the weight w and Formula 10 for obtaining the offset f can be obtained according to Formula 8.
[0193] [Formula 9]
[0194]
[0195] [Formula 10]
[0196] f=Σ i y i -a*Σ i x i
[0197] Reference Fig. 9 , the prediction sample may be corrected using at least one of the weight and the offset determined at step S900.
[0198] For example, when the brightness changes in all frames, the weight w and the offset f are applied to the prediction sample p generated by intra prediction, so that the corrected prediction sample p' can be obtained as shown in Formula 11.
[0199] [Formula 11]
[0200] p′=w×p+f
[0201] Here, the weight w and the offset f may be applied to a prediction sample generated by inter prediction, or may be applied to a reconstructed sample.
[0202] Figures 10 to 15 is a view illustrating a method of composing templates to determine a weight w according to an embodiment of the present invention.
[0203] Reference Fig.10 On the left side of , the template may consist of all neighboring samples adjacent to the current block, or the template may consist of some samples sub-sampled from neighboring samples adjacent to the current block. Fig.10 The middle part of FIG shows an example of 1 / 2 subsampling, and the template can be composed of only gray samples. Instead of 1 / 2 subsampling, 1 / 4 subsampling or 1 / 8 subsampling can be used to compose the template. Fig.10 As shown on the right side of , except for the samples located on the upper left side, the template can be composed of all adjacent samples adjacent to the current block. Fig.10 What is not shown is that, considering the position of the current block in the picture or the coding tree block (largest coding unit), a template consisting of only samples located on the left side or a template consisting of only samples located on the upper side may be used.
[0204] Reference Fig.11 , the template can be formed by increasing the number of adjacent samples. That is, Fig.11 The template in may consist of first neighboring samples adjacent to a boundary of the current block and second neighboring samples adjacent to the first neighboring samples.
[0205] like Fig.11 As shown on the left side of , the template can consist of all adjacent samples belonging to the two rows adjacent to the boundary of the current block, or as Fig.11 As shown in the middle of , the template can be composed by subsampling the template on the left. Fig.11 As shown on the right side of , the four samples belonging to the upper left side can be excluded to form the template. Fig.11 What is not shown is that, considering the position of the current block in the picture or the coding tree block (largest coding unit), a template consisting of only samples located on the left side or a template consisting of only samples located on the upper side may be used.
[0206] Alternatively, different templates may be composed according to the size and / or shape of the current block (whether the current block has a square shape, whether the current block is symmetrically divided). Fig.12 As shown, the subsampling rate of the template can be applied differently according to the size of the current block. Fig.12 As shown on the left side of , when the block size is equal to or less than 64×64, a template that has been subsampled by 1 / 2 can be formed. Fig.12 As shown on the right side of , when the block size is equal to or greater than 128×128, a template that is subsampled by 1 / 4 can be formed.
[0207] Reference Fig.13 , a template can be composed by increasing the number of neighboring samples adjacent to the current block according to the size of the current block.
[0208] Multiple template candidates that can be used in a sequence or a slice can be determined, and one of the multiple template candidates can be selectively used. Multiple candidate templates can be templates of different shapes and / or sizes. Information about the shape and / or size of the template can be transmitted by signaling in a sequence header or a slice header. In a device for encoding / decoding a video, an index can be assigned to each template candidate. In order to identify a template candidate to be used in a current sequence, picture, or slice among multiple template candidates, the syntax type_weight_pred_template_idx can be encoded. A device for decoding a video can selectively use a template candidate based on the syntax type_weight_pred_template_idx.
[0209] For example, Fig.14 As shown, Fig.10 The template in the middle can be assigned 0, Fig.10 The template on the right can be assigned 1, Fig.11 The middle template can be assigned 2, and Fig.11 The template on the right may be assigned 3. The template used in the sequence may be signaled.
[0210] When performing weighted prediction using non-square blocks, templates can be composed by applying different subsampling rates to the long and short edges so that the total number of templates is 2^N. Fig.15 As shown, the template can be composed by performing 1 / 2 subsampling on the short side and 1 / 4 subsampling on the long side.
[0211] The present disclosure may also have the following configurations:
[0212] 1. A method for decoding a video, the method comprising:
[0213] Determining an intra prediction mode for a current block;
[0214] Obtaining reference samples for intra prediction of the current block; and
[0215] performing intra prediction on the current block based on the intra prediction mode and the reference sample,
[0216] The current block is a coding block divided based on at least one of a quadtree and a binary tree, and is a non-square block.
[0217] 2. The method according to claim 1, wherein determining the intra prediction mode comprises:
[0218] generating a candidate list including a plurality of candidates; and
[0219] determining an intra prediction mode of the current block based on the candidate list and the index,
[0220] wherein a maximum number of candidates that can be included in the candidate list is more than three, the determined intra prediction mode is one of the extended intra prediction modes, and
[0221] The extended intra prediction modes include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0222] 3. The method according to claim 1, wherein performing intra prediction comprises:
[0223] Obtaining a prediction sample of the current block based on the intra prediction mode and the reference sample; and
[0224] The obtained prediction samples are corrected using differential information of adjacent samples of the current block.
[0225] 4. The method of claim 1, wherein performing intra prediction comprises:
[0226] Obtaining a prediction sample of the current block based on the intra prediction mode and the reference sample; and
[0227] The obtained prediction samples are corrected based on at least one of a predetermined weight and an offset.
[0228] 5. A device for decoding a video, the device comprising:
[0229] a prediction module, which determines an intra prediction mode of a current block, obtains a reference sample for intra prediction of the current block, and performs intra prediction on the current block based on the intra prediction mode and the reference sample,
[0230] The current block is a coding block divided based on at least one of a quadtree and a binary tree, and is a non-square block.
[0231] 6. The device according to scheme 5, wherein the prediction module generates a candidate list including a plurality of candidates, and determines the intra prediction mode of the current block based on the candidate list and the index,
[0232] the maximum number of candidates that can be included in the candidate list is more than three,
[0233] The determined intra prediction mode is one of the extended intra prediction modes, and
[0234] The extended intra prediction modes include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0235] 7. The device according to scheme 5, wherein the prediction module obtains the prediction sample of the current block based on the intra-frame prediction mode and the reference sample, and corrects the obtained prediction sample using differential information of adjacent samples of the current block.
[0236] 8. The device according to scheme 5, wherein the prediction module obtains the prediction sample of the current block based on the intra-frame prediction mode and the reference sample, and corrects the obtained prediction sample based on at least one of a predetermined weight and an offset.
[0237] 9. A method for encoding a video, the method comprising:
[0238] Determining an intra prediction mode for a current block;
[0239] Obtaining reference samples for intra prediction of the current block; and
[0240] performing intra prediction on the current block based on the intra prediction mode and the reference sample,
[0241] The current block is a coding block divided based on at least one of a quadtree and a binary tree, and is a non-square block.
[0242] 10. The method according to claim 9, wherein determining the intra prediction mode comprises:
[0243] generating a candidate list including a plurality of candidates; and
[0244] determining an intra prediction mode of the current block based on the candidate list and the index,
[0245] wherein a maximum number of candidates that can be included in the candidate list is more than three, the determined intra prediction mode is one of the extended intra prediction modes, and
[0246] The extended intra prediction modes include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0247] 11. The method of claim 9, wherein performing intra prediction comprises:
[0248] Obtaining a prediction sample of the current block based on the intra prediction mode and the reference sample; and
[0249] The obtained prediction samples are corrected using differential information of adjacent samples of the current block.
[0250] 12. The method of claim 9, wherein performing intra prediction comprises:
[0251] Obtaining a prediction sample of the current block based on the intra prediction mode and the reference sample; and
[0252] The obtained prediction samples are corrected based on at least one of a predetermined weight and an offset.
[0253] 13. A device for encoding a video, the device comprising:
[0254] a prediction module, which determines an intra prediction mode of a current block, obtains a reference sample for intra prediction of the current block, and performs intra prediction on the current block based on the intra prediction mode and the reference sample,
[0255] The current block is a coding block divided based on at least one of a quadtree and a binary tree, and is a non-square block.
[0256] 14. The device according to scheme 13, wherein the prediction module generates a candidate list including a plurality of candidates, and determines the intra prediction mode of the current block based on the candidate list and the index,
[0257] the maximum number of candidates that can be included in the candidate list is more than three,
[0258] The determined intra prediction mode is one of the extended intra prediction modes, and
[0259] The extended intra prediction modes include a planar mode, a DC mode, and more than 33 directional prediction modes.
[0260] 15. The device according to scheme 13, wherein the prediction module obtains the prediction sample of the current block based on the intra-frame prediction mode and the reference sample, and corrects the obtained prediction sample using differential information of adjacent samples of the current block.
[0261] Industrial Applicability
[0262] The present invention can be used for encoding / decoding video signals.
Claims
1. A method for decoding an image, comprising: Obtaining a first prediction sample of a current block in an image; Determine a template of the current block, wherein, according to a template mode of the current block, the template of the current block consists of only upper reference samples, only left reference samples, or both upper reference samples and left reference samples; deriving weights and offsets based on reference samples in the template; and A second prediction sample is obtained by multiplying the weight with the first prediction sample and then adding an offset, wherein the weights and offsets are obtained by using subsampled reference samples selected from the reference samples, and The sub-sampling rate of the upper reference samples is determined based on the width of the current block, and the sub-sampling rate of the left reference samples is determined based on the height of the current block.
2. The method according to claim 1, wherein: When the current block has a non-square shape with different width and height, the sub-sampling rate of the upper reference samples is different from the sub-sampling rate of the left reference samples.
3. The method according to claim 1, wherein: Index information is decoded from a bitstream to determine a template mode of the current block, the index information specifying an upper template mode using only an upper reference sample, a left template mode using only a left reference sample, and an upper-left template mode using both an upper reference sample and a left reference sample.
4. A method for encoding an image, comprising: Obtaining a first prediction sample of a current block in an image; Determine a template of the current block, wherein, according to a template mode of the current block, the template of the current block consists of only upper reference samples, only left reference samples, or both upper reference samples and left reference samples; deriving weights and offsets based on reference samples in the template; and A second prediction sample is obtained by multiplying the weight with the first prediction sample and then adding an offset, wherein the weights and offsets are obtained by using subsampled reference samples selected from the reference samples, and The sub-sampling rate of the upper reference samples is determined based on the width of the current block, and the sub-sampling rate of the left reference samples is determined based on the height of the current block.
5. A device for transmitting compressed video data, comprising: a processor configured to obtain compressed video data; as well as a transmitting unit configured to transmit the compressed video data, Wherein, obtaining the compressed video data comprises: Obtaining a first prediction sample of a current block in an image; Determine a template of the current block, wherein, according to a template mode of the current block, the template of the current block consists of only upper reference samples, only left reference samples, or both upper reference samples and left reference samples; deriving weights and offsets based on reference samples in the template; and A second prediction sample is obtained by multiplying the weight with the first prediction sample and then adding an offset, wherein the weights and offsets are obtained by using subsampled reference samples selected from the reference samples, and The sub-sampling rate of the upper reference samples is determined based on the width of the current block, and the sub-sampling rate of the left reference samples is determined based on the height of the current block.
Citation Information
Patent Citations
Intra-prediction decoding device
CN103081474A
Method and device for intra prediction
CN103891283A
Methods of deciding most probable mode and appratuses using the same
KR1020130100662A
Image decoding method
KR1020140057518A
A method for adaptive illuminance compensation based on object and an apparatus using it
KR1020140124045A