Image decoding method, image encoding method, and method for transmitting bit stream

By determining the intra-frame prediction mode in image coding and applying filters to generate reference samples, the problem of low compression efficiency of inter-frame prediction and intra-frame prediction is solved, and more efficient image coding is achieved.

CN114189680BActive Publication Date: 2025-09-09DOLBY INTERNATIONAL AB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111347576.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2016-05-03
Filing Date
2017-04-19
Publication Date
2025-09-09
Estimated Expiration
2037-04-19

AI Technical Summary

Technical Problem

In the existing technology, the compression efficiency of inter-frame prediction and intra-frame prediction needs to be improved.

Method used

By determining the intra-frame prediction mode of the current block and deciding whether to apply the first filter based on the mode and the size of the block, after filtering the adjacent samples, a second interpolation filter is used to generate reference samples, and finally a prediction block and a residual block of the current block are generated.

Benefits of technology

The compression efficiency of inter-frame prediction and intra-frame prediction is enhanced, motion vectors are effectively derived, and the efficiency of image coding is improved through the use of adaptive encoding/decoding order and optimal interpolation filters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114189680B_ABST
    Figure CN114189680B_ABST
Patent Text Reader

Abstract

Disclosed are an image decoding method, an image encoding method, and a method for transmitting a bitstream. The image decoding method includes: determining an intra-frame prediction mode of a current block; determining whether to apply a first filter to adjacent samples of the current block based on the intra-frame prediction of the current block and the size of the current block; filtering the adjacent samples to generate filtered adjacent samples if it is determined that the first filter is to be applied; applying a second filter to the filtered adjacent samples to generate reference samples; generating a prediction block of the current block based on the reference samples; generating a residual block of the current block by decoding a bitstream; and reconstructing the current block based on the prediction block and the residual block, wherein the second filter is an interpolation filter using four samples of the filtered adjacent samples, and the residual block is generated by entropy decoding residual information included in the bitstream.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application with an international application date of April 19, 2017, international application number PCT / KR2017 / 004192, and invention name “Method and device for encoding / decoding images” (the Chinese application number entering the Chinese national phase is 201780038491.0). Technical Field

[0002] The present invention relates to a method and apparatus for encoding / decoding a video signal. Background Art

[0003] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, has increased in various application fields. However, compared with conventional image data, image data with higher resolution and quality has an increased data volume. Therefore, when image data is transmitted using a medium such as conventional wired and wireless broadband networks, or when image data is stored using conventional storage media, the cost of transmission and storage increases. In order to solve these problems arising from the increase in resolution and quality of image data, efficient image compression technology can be utilized.

[0004] Image compression technology includes various technologies, including: inter-frame prediction technology that predicts pixel values ​​included in the current picture from previous or subsequent pictures of the current picture; intra-frame prediction technology that predicts pixel values ​​included in the current picture by using pixel information in the current picture; entropy coding technology that assigns short codes to values ​​with high frequency of occurrence and long codes to values ​​with low frequency of occurrence; etc. By using such image compression technology, image data can be efficiently compressed and transmitted or stored.

[0005] Meanwhile, in addition to the demand for high-resolution images, the demand for stereoscopic image content as a new image service has also increased. Video compression technology for efficiently providing stereoscopic image content with high resolution and ultra-high resolution is being discussed. Summary of the Invention

[0006] Technical issues

[0007] The present invention aims to enhance compression efficiency in inter-frame prediction.

[0008] The present invention aims to enhance compression efficiency in intra-frame prediction.

[0009] However, technical problems to be solved by the embodiments are not limited to the above-mentioned technical problems, and there may be other technical problems.

[0010] Technical Solution

[0011] The present invention provides an image decoding method, comprising: determining an intra-frame prediction mode of a current block; determining whether to apply a first filter to adjacent samples of the current block based on the intra-frame prediction mode of the current block and the size of the current block; filtering the adjacent samples to generate filtered adjacent samples when it is determined in the above-mentioned determination step that the first filter is to be performed; applying a second filter to the filtered adjacent samples to generate reference samples; generating a prediction block of the current block based on the reference samples; generating a residual block of the current block by decoding a bitstream; and reconstructing the current block based on the prediction block and the residual block, wherein the second filter is an interpolation filter using four samples of the filtered adjacent samples, and wherein the residual block is generated by entropy decoding residual information included in the bitstream.

[0012] The present invention provides an image encoding method, comprising: determining an intra-frame prediction mode of a current block; determining whether to apply a first filter to adjacent samples of the current block based on the intra-frame prediction mode of the current block and the size of the current block; filtering the adjacent samples to generate filtered adjacent samples when it is determined in the above-mentioned determination step that the first filter is to be performed; applying a second filter to the filtered adjacent samples to generate reference samples; generating a prediction block of the current block based on the reference samples; generating a residual block of the current block based on the prediction block; and encoding the residual block of the current block into a bitstream, wherein the second filter is an interpolation filter using four samples of the filtered adjacent samples, and wherein the residual block is encoded by entropy encoding residual information into the bitstream.

[0013] The present invention provides a method for transmitting a bit stream, which is generated by an image encoding method, and the method includes: determining an intra-frame prediction mode of a current block; determining whether to apply a first filter to adjacent samples of the current block based on the intra-frame prediction mode of the current block and the size of the current block; filtering the adjacent samples to generate filtered adjacent samples when it is determined in the above-mentioned determination step that the first filter is to be performed; applying a second filter to the filtered adjacent samples to generate reference samples; generating a prediction block of the current block based on the reference samples; generating a residual block of the current block based on the prediction block; and encoding the residual block of the current block into a bit stream, wherein the second filter is an interpolation filter using four samples of the filtered adjacent samples, and wherein the residual block is encoded by entropy encoding residual information into the bit stream.

[0014] The present invention provides an inter-frame prediction method and device based on a current picture reference mode.

[0015] The present invention provides a method and apparatus for deriving a motion vector of a current picture reference mode.

[0016] The present invention provides a method and apparatus for determining an encoding / decoding order of subblocks belonging to a current block by considering an intra prediction mode of the current block.

[0017] The present invention provides a method and apparatus for generating reference samples for intra prediction based on an interpolation filter.

[0018] The present invention provides a method and apparatus for determining an interpolation filter applied to nearby samples by considering at least one of a block size and an intra prediction mode.

[0019] Beneficial effects

[0020] According to the present invention, the efficiency of inter-frame prediction can be enhanced based on the current picture reference mode.

[0021] Furthermore, according to the present invention, the motion vector of the current picture reference mode can be efficiently derived.

[0022] Furthermore, according to the present invention, the efficiency of intra prediction can be enhanced based on an adaptive encoding / decoding order.

[0023] Furthermore, according to the present invention, reference samples for intra prediction can be efficiently generated by determining an optimal interpolation filter and using the determined interpolation filter. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a block diagram illustrating an apparatus for encoding an image according to an embodiment of the present invention.

[0025] Figure 2 is a block diagram illustrating an apparatus for decoding an image according to an embodiment of the present invention.

[0026] Figure 3 is a diagram illustrating intra prediction based on a fixed scanning order according to an embodiment of the present invention.

[0027] Figure 4 is a diagram illustrating an intra prediction method based on an adaptive scan order according to an embodiment of the present invention.

[0028] Figure 5 is a diagram illustrating an example of categories related to a scan order according to an embodiment of the present invention.

[0029] Figure 6 is a diagram illustrating a process of intra prediction based on z-scan in an adaptive scan order according to an embodiment of the present invention.

[0030] Figure 7is a diagram illustrating a process of intra prediction based on z scanning in the form of a 90-degree counterclockwise rotation in an adaptive scanning order according to an embodiment of the present invention.

[0031] Figure 8 is a diagram illustrating a process of intra prediction based on z scanning in the form of a 90-degree rotation in a clockwise direction in an adaptive scanning order according to an embodiment of the present invention.

[0032] Figure 9 is a diagram illustrating an inter prediction method based on a current picture reference mode according to an embodiment of the present invention.

[0033] Figure 10 is a diagram illustrating a method of deriving a motion vector of a current block encoded in a current picture reference mode according to an embodiment of the present invention.

[0034] Figure 11 is a diagram illustrating a method of filtering a reference block according to an embodiment of the present invention.

[0035] Figure 12 is a diagram illustrating the shape of a current block encoded in a current picture reference mode according to an exemplary embodiment.

[0036] Figure 13 is a diagram illustrating a process of interpolation-based intra prediction according to an embodiment of the present invention.

[0037] Figure 14 is a diagram illustrating a method of applying an interpolation filter according to an embodiment of the present invention.

[0038] Figure 15 is a diagram illustrating an example of an interpolation filter using a plurality of taps according to an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In the intra-frame prediction method according to the present invention, the intra-frame prediction mode of the current block can be determined, the scanning order of multiple sub-blocks in the current block can be determined based on the determined intra-frame prediction mode, and the intra-frame prediction of the current block can be performed based on the determined scanning order.

[0040] In the inter-frame prediction method according to the present invention, a motion vector of a current block may be derived, a reference block of the current block may be determined based on the motion vector of the current block, and motion compensation of the current block may be performed based on the determined reference block, wherein the reference block may belong to the same picture as the current block.

[0041] In the intra prediction method according to the present invention, nearby samples for intra prediction of a current block can be specified, predetermined filtering can be performed on the specified nearby samples, reference samples for intra prediction can be generated by applying an interpolation filter to the filtered nearby samples, and intra prediction of the current block can be performed based on the generated reference samples.

[0042] In the device for encoding / decoding an image according to the present invention, the device includes: an intra-frame prediction module, which is configured to: determine an intra-frame prediction mode of a current block; determine a scanning order of multiple sub-blocks in the current block based on the determined intra-frame prediction mode; and perform intra-frame prediction of the current block based on the determined scanning order.

[0043] In an apparatus for encoding / decoding an image according to the present invention, an inter-frame prediction module is included, which is configured to: derive a motion vector of a current block; determine a reference block of the current block according to the motion vector of the current block; and perform motion compensation of the current block based on the determined reference block, wherein the reference block may belong to the same picture as the current block.

[0044] In the apparatus for encoding / decoding an image according to the present invention, an intra-frame prediction module is included, which is configured to: specify nearby samples for intra-frame prediction of a current block; perform predetermined filtering on the specified nearby samples; generate reference samples for intra-frame prediction by applying an interpolation filter to the filtered nearby samples; and perform intra-frame prediction of the current block based on the generated reference samples.

[0045] 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 described in detail. However, the present invention is not limited thereto, and the exemplary embodiments should be interpreted as including all modifications, equivalents, or alternatives within the technical concept and technical scope of the present invention. Similar reference numerals denote similar elements described in the drawings.

[0046] The terms "first", "second" and the like used in the specification may be used to describe various elements, but these elements should not be construed as being limited to these terms. These terms are only used to distinguish one element from other elements. For example, without departing from the scope of the present invention, a "first" element may be named a "second" element, and a "second" element may also be similarly named a "first" element. The term "and / or" includes a combination of multiple items or any one of multiple items.

[0047] It should be understood that when an element is referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element in this specification, it can be “directly connected to” or “directly coupled to” another element, or connected to or coupled to another element with another element 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 present.

[0048] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Unless the context clearly indicates a different meaning, expressions used in the singular include expressions in the plural. In this specification, it should be understood that terms such as "including", "having", etc. 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.

[0049] Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Hereinafter, the same elements in the drawings are denoted by the same reference numerals, and repeated description of the same elements will be omitted.

[0050] Figure 1 is a block diagram illustrating an apparatus for encoding an image according to an embodiment of the present invention.

[0051] Reference Figure 1 , the device 100 for encoding an image 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 encoding module 165, an inverse quantization module 140, an inverse transformation module 145, a filter module 150 and a memory 155.

[0052] Figure 1 The components shown in the figures are shown independently to represent characteristic functions that are different from each other in a device for encoding images. Therefore, it is not intended that each component constitutes a component unit of isolated hardware or software. In other words, for convenience, each component includes each listed component. Therefore, at least two 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, embodiments combining each component and embodiments dividing a component are also included in the scope of the present invention.

[0053] In addition, some elements may not be essential elements for performing the basic functions of the present invention, but rather selective elements that only improve their performance. In addition to elements for improving performance, the present invention may be implemented by only including essential components for implementing the essence of the present invention. In addition to selective elements that only improve performance, structures that only include essential elements are also included within the scope of the present invention.

[0054] The picture partitioning module 110 can divide the input image into one or more blocks. Here, the block can represent a coding unit (CU), a prediction unit (PU) or a transform unit (TU). The partitioning can be performed based on a quadtree or a binary tree or both. The quadtree is a method of dividing an upper layer block into four lower layer blocks, each lower layer block having a width and height half that of the upper layer block. The binary tree is a method of dividing an upper layer block into two lower layer blocks, each lower layer block having a width or height half that of the upper layer block. In the binary tree, through the partitioning based on the binary tree, the block with a height half that of the upper layer block can be square or non-square.

[0055] Hereinafter, in an embodiment of the present invention, a coding unit may mean a unit that performs encoding or a unit that performs decoding.

[0056] The prediction modules 120 and 125 may include an inter-frame prediction module 120 for performing inter-frame prediction and an intra-frame prediction module 125 for performing intra-frame prediction. Whether inter-frame prediction or intra-frame prediction is performed for prediction may be determined, and detailed information based on each prediction method (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) may be determined. Here, the processing unit that undergoes prediction may be different from the processing unit that determines the prediction method and details. 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. Furthermore, the prediction mode information, motion vector information, etc. used for prediction may be encoded using residual values ​​by the entropy coding module 165 and transmitted to the device for decoding. When a specific coding mode is used, the original block is fully encoded and transmitted to the decoding module without generating a prediction block by the prediction modules 120 and 125.

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

[0058] The reference picture interpolation module may receive reference picture information from the memory 155 and may generate pixel information of integer pixels or smaller pixels from the reference picture. In the case of luma pixels, an 8-tap DCT-based interpolation filter with different coefficients may be used to generate pixel information about integer pixels or smaller pixels on a 1 / 4 pixel basis. In the case of chroma signals, a 4-tap DCT-based interpolation filter with different filter coefficients may be used to generate pixel information about integer pixels or smaller pixels on a 1 / 8 pixel basis.

[0059] 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 the full search based block matching algorithm (FBMA), the three-step search (TSS) algorithm, the new three-step search (NTS) algorithm, etc. can be used. Based on the interpolated pixel, the motion vector can have a motion vector value based on every 1 / 2 or 1 / 4 pixel. The motion prediction module can predict the current prediction unit by changing the motion prediction method. As the motion prediction method, various methods such as the skip method, the merge method, the advanced motion vector prediction (AMVP) method, etc. can be used.

[0060] The intra prediction module 125 can generate a prediction unit based on reference pixel information around the current block, which is pixel information in the current picture. When the neighboring block of the current prediction unit is a block undergoing inter-frame prediction and therefore the reference pixel is a pixel undergoing inter-frame prediction, the reference pixel information of the neighboring block undergoing intra-frame prediction is used instead of the reference pixel included in the block undergoing inter-frame prediction. In other words, when the reference pixel is unavailable, at least one reference pixel of the available reference pixel is used instead of the unavailable reference pixel information.

[0061] The prediction mode in the intra prediction may include a directional prediction mode using reference pixel information depending on the prediction direction and a non-directional mode that does not use directional information when performing prediction. The mode for predicting luma information may be different from the mode for predicting chroma information, and for predicting chroma information, intra prediction mode information for predicting luma information or predicted luma signal information may be used.

[0062] In the intra prediction method, a prediction block can be generated after applying an adaptive intra smoothing (AIS) filter to reference pixels according to a prediction mode. The type of the AIS filter applied to the reference pixels can vary. In order to perform the intra prediction method, the intra prediction mode of the current prediction unit can be predicted from the intra prediction modes of the prediction units surrounding the current prediction unit. When the prediction mode of the current prediction unit is predicted by using the mode information predicted from the nearby prediction units, when the intra prediction mode of the current prediction unit is the same as the intra prediction mode of the nearby prediction unit, information indicating that the current prediction unit and the nearby prediction unit have the same prediction mode is sent using predetermined flag information. When the prediction mode of the current prediction unit is different from the prediction mode of the nearby prediction unit, entropy coding is performed to encode the prediction mode information of the current block.

[0063] In addition, a residual block may be generated based on the prediction unit generated by the prediction modules 120 and 125, wherein the residual block includes information about a residual value, which is a difference between the prediction unit subjected to prediction and the original block of the prediction unit. The generated residual block may be input to the transform module 130.

[0064] The transform module 130 may transform the residual block including the residual data by using a transform method such as DCT, DST, etc. Here, the transform method may be determined based on an intra prediction mode of a prediction unit used to generate the residual block.

[0065] The quantization module 135 may quantize the value transformed into the frequency domain by the transform module 130. The quantization coefficient may vary according to the block or importance of the image. The value calculated by the quantization module 135 may be provided to the inverse quantization module 140 and the rearrangement module 160.

[0066] The rearrangement module 160 may perform rearrangement of coefficient values ​​with respect to the quantized residual value.

[0067] The rearrangement module 160 may change the coefficients in the two-dimensional block form into coefficients in the one-dimensional vector form by a coefficient scanning method. For example, the rearrangement module 160 may use a predetermined scanning type to scan from the DC coefficient to the coefficients in the high frequency domain so as to change the coefficients into the form of a one-dimensional vector.

[0068] 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, such as Exponential Golomb coding, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC).

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

[0070] The entropy encoding module 165 may entropy encode the coefficient values ​​of the coding unit input from the rearrangement module 160 .

[0071] 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 value 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.

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

[0073] A deblocking filter can remove block distortion caused by boundaries between blocks in a reconstructed image. To determine whether to perform deblocking, a determination can be made based on the pixels in a number of rows and columns within the block whether to apply the deblocking filter to the current block. When applying the deblocking filter to a block, a strong or weak filter is applied depending on the desired deblocking filter strength. Furthermore, when applying the deblocking filter, when performing horizontal filtering and vertical filtering, the horizontal and vertical filtering are configured to be processed in parallel.

[0074] The offset correction module can correct the offset from the original image on a per-pixel basis with respect to the image undergoing deblocking. To perform offset correction on a specific image, a method is used in which pixels of the image are separated into a predetermined number of regions, the regions to be subjected to offset are determined, and the offset is applied to the determined regions, or a method is used in which the offset is applied taking into account edge information of each pixel.

[0075] Adaptive loop filtering (ALF) can be performed based on a value obtained by comparing a filtered reconstructed image with an original image. The pixels included in the image 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 to apply ALF and a luminance signal can be sent for each coding unit (CU). The form and filter coefficients of the filter to be applied to the ALF can vary for each block. In addition, regardless of the characteristics of the application target block, the same form (fixed form) of the ALF filter can be applied.

[0076] The memory 155 may store a reconstructed block of a picture calculated by the filter module 150. The stored reconstructed block or picture may be provided to the prediction modules 120 and 125 when performing inter prediction.

[0077] Figure 2 is a block diagram illustrating an apparatus for decoding an image according to an embodiment of the present invention.

[0078] refer to Figure 2 , the apparatus 200 for decoding an image 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 .

[0079] When an image bitstream is input from an apparatus for encoding an image, the input bitstream is decoded according to an inverse process of the apparatus for encoding an image.

[0080] The entropy decoding module 210 may perform entropy decoding according to the inverse process of the entropy encoding of the entropy encoding module of the device for encoding the image. For example, corresponding to the method performed by the device for encoding the image, various methods such as exponential Golomb coding, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC) may be applied.

[0081] The entropy decoding module 210 may decode information about intra prediction and inter prediction performed by the apparatus for encoding.

[0082] The rearrangement module 215 can perform rearrangement on the bitstream entropy decoded by the entropy decoding module 210 based on the rearrangement method used in the encoding device. The coefficients represented in the form of a one-dimensional vector can be reconstructed and rearranged into coefficients in the form of a two-dimensional block. The rearrangement module 215 can perform the rearrangement by receiving information related to the coefficient scanning performed in the encoding device and performing an inverse scanning method based on the scanning order performed in the encoding device.

[0083] The inverse quantization module 220 may perform inverse quantization based on a quantization parameter received from the apparatus for encoding and the rearranged coefficient values ​​of the block.

[0084] The inverse transform module 225 may perform inverse transform on the transform coefficients subjected to inverse quantization using a predetermined transform method. Here, the transform method may be determined based on information on a prediction method (inter / intra prediction), a block size / shape, an intra prediction mode, and the like.

[0085] The prediction modules 230 and 235 may generate a prediction block based on the information on prediction block generation received from the entropy decoding module 210 and information on a previously decoded block or picture received from the memory 245 .

[0086] 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 from the entropy decoding module 210, such as prediction unit information, prediction mode information for the intra-frame prediction method, information about motion prediction for the inter-frame prediction method, etc., may separate the prediction units in the current coding unit, and may determine whether to perform inter-frame prediction or intra-frame prediction on the prediction units. By using the information required for inter-frame prediction of the current prediction unit received from the apparatus for encoding an image, 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 and 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 regions in the current picture including the current prediction unit.

[0087] In order to perform inter prediction, it may be determined which one of the skip mode, the merge mode, and the AMVP mode is used as a motion prediction method of a prediction unit included in the coding unit, based on the coding unit.

[0088] 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 that undergoes intra prediction, intra prediction is performed based on the intra prediction mode information of the prediction unit received from the device for encoding the image. 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 whether to apply the filter can be determined based on the prediction mode of the current prediction unit. The prediction mode and AIS filter information of the prediction unit received from the device for encoding the image are used to perform AIS filtering on the reference pixels of the current block. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter is not applied.

[0089] When the prediction mode of the prediction unit is a prediction mode in which intra-frame prediction is performed based on pixel values ​​obtained by interpolating reference pixels, the reference pixel interpolation module may interpolate the reference pixels to generate reference pixels in units of integer values ​​or smaller pixels. When the prediction mode of the current prediction unit is a prediction mode in which a prediction block is generated without interpolating reference pixels, the reference pixels are not interpolated. When the prediction mode of the current block is a DC mode, a DC filter may generate a prediction block by filtering.

[0090] The reconstructed block or 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.

[0091] From the device for encoding an image, information on whether to apply a deblocking filter to a relevant block or picture and whether to apply a strong filter or a weak filter when applying the deblocking filter is received. The deblocking filter of the device for decoding an image can receive information on the deblocking filter from the device for encoding an image, and the device for decoding an image can perform deblocking filtering on the relevant block.

[0092] The offset correction module may perform offset correction on the reconstructed image based on the type of offset correction applied to the image when encoding is performed, offset value information, and the like.

[0093] ALF may be applied to the coding unit based on information on whether to apply ALF, ALF coefficient information, etc. received from the encoding apparatus. The ALF information may be provided to be included in a specific parameter set.

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

[0095] In the following, reference will be made to Figures 3 to 8 This section describes the intra prediction method in detail. Intra prediction can be performed on a current block using a predetermined intra prediction mode and reference samples. The current block can be determined by partitioning based on a tree structure (e.g., a quadtree or a binary tree). The current block can be a coding block (CU) or a prediction block (PU).

[0096] Intra-frame prediction can be performed on each sub-block constituting the current block according to a predetermined scanning order. The current block can include one or more sub-blocks. The current block can be defined as a group of sub-blocks that share a single intra-frame prediction mode.

[0097] The size / shape of the sub-block may be pre-established and fixed in the apparatus for encoding / decoding an image, or the size / shape of the sub-block may be variably determined according to the size / shape of the current block or the transform block. Alternatively, the apparatus for encoding an image may encode information indicating the size / shape of the sub-block and may signal the result, and the apparatus for decoding the image may determine the size / shape of the sub-block based on the signaled information.

[0098] The reference sample may be a neighboring sample of the current block (or subblock). For example, the reference sample may belong to at least one nearby block located to the left, lower left, upper left, top, or upper right of the current block (or subblock). The reference sample may include a reference possible sample used for intra prediction of the current block (or subblock) and / or a sample generated by a process for generating predetermined reference samples.

[0099] The scanning order may be a fixed scanning order pre-established in a device for encoding / decoding an image (hereinafter referred to as a "first method"), or may be an adaptive scanning order based on the intra-prediction mode of the current block (hereinafter referred to as a "second method"). The first method or the second method may be selectively used. To this end, information indicating whether an adaptive scanning order is used may be signaled. For example, when the information indication value is zero, the first method is used, and when the information indication value is 1, the second method is used. Alternatively, the first method or the second method may be selectively used based on at least one of the prediction mode of the current block, information on whether the intra-prediction mode is directional, the directionality / angle of the intra-prediction mode, the scan type of the transform coefficient, the transform technique, and the block size / shape.

[0100] Figure 3 is a diagram illustrating intra prediction based on a fixed scanning order according to an embodiment of the present invention.

[0101] In this embodiment, it is assumed that the fixed scanning order is z scanning and reference is made to nearby samples in the diagonal direction. Here, the nearby samples may include at least one of reference possible or reference impossible samples and samples generated by a process of generating predetermined reference samples.

[0102] refer to Figure 3 , the current block may include four sub-blocks 310, 320, 330, and 340. According to the z-scan, prediction / reconstruction may be performed on the first sub-block 310, the second sub-block 320, the third sub-block 330, and the fourth sub-block 340 in this order.

[0103] The first sub-block 310 may refer to nearby samples 311 (samples indicated by slashes) reconstructed before the first sub-block.

[0104] The second sub-block 320 can be divided into a sample region indicated by white (hereinafter referred to as a "first region") and a sample region indicated by grayscale (hereinafter referred to as a "second region"). The first region refers to the region of pre-reconstructed nearby samples 321 (samples indicated by diagonal lines), and the second region refers to the region of samples 322 (samples filled with dots) that are not reconstructed or impossible to reference. The samples in the second region have low spatial correlation with the samples 322, which may lead to a decrease in the performance of intra-frame prediction.

[0105] Similarly, the third sub-block 330 can be divided into a sample region indicated in white (hereinafter referred to as a "first region") and a sample region indicated in grayscale (hereinafter referred to as a "second region"). The first region refers to the region of pre-reconstructed nearby samples 331 (samples indicated by slashes), and the second region refers to the region of samples 332 (samples filled with dots) that have not been reconstructed or for which reference is impossible. The samples in the second region have low spatial correlation with the samples 332, which may lead to a decrease in the performance of intra-frame prediction.

[0106] Similarly, the fourth sub-block 340 can be divided into a sample region indicated in white (hereinafter referred to as a "first region") and a sample region indicated in grayscale (hereinafter referred to as a "second region"). The first region refers to the region of pre-reconstructed nearby samples 341 (samples indicated by slashes), and the second region refers to the region of samples 342 (samples filled with dots) that are not reconstructed or impossible to reference. The samples in the second region have low spatial correlation with the samples 342, which may lead to a decrease in the performance of intra-frame prediction.

[0107] Figure 4 is a diagram illustrating an intra prediction method based on an adaptive scan order according to an embodiment of the present invention.

[0108] refer to Figure 4 , the intra prediction mode of the current block may be determined in step S400 .

[0109] Specifically, N intra-frame prediction modes predefined in the device for encoding / decoding an image can be grouped into multiple groups. N can be an integer equal to or greater than 35. For example, the first group can be composed of candidate modes (most probable modes, MPMs), and the second group can include modes other than the candidate modes from the N intra-frame prediction modes. Candidate modes can be derived based on at least one of the intra-frame prediction modes of nearby blocks and the default mode according to a rule pre-established in the device for encoding / decoding an image. The number of candidate modes can be three, four, five, six, or more.

[0110] The intra prediction mode of the current block may be determined using information specifying a group to which the intra prediction mode of the current block belongs and / or information specifying the intra prediction mode of the current block in the relevant group.

[0111] Based on the intra prediction mode determined in step S400 , a scanning order in the current block may be determined in step S410 .

[0112] The scanning order can be determined by considering whether the intra-frame prediction mode is a non-directional mode or a directional mode. Alternatively, the scanning order can be determined by considering the directionality / angle of the intra-frame prediction mode. For example, the process of determining the scanning order can be implemented by the following processes: a process of determining the category of the intra-frame prediction mode by considering the directionality of the intra-frame prediction mode, and a process of determining the scanning order based on the determined category. The category can be defined as a group of intra-frame prediction modes having similar directionality. To this end, N intra-frame prediction modes predefined in the device for encoding / decoding images can be classified into multiple categories. The device for encoding / decoding images can define a mapping relationship between a specific category and a scanning order.

[0113] Based on the scanning order determined in step S410, intra-frame prediction of the current block can be performed in step S420. Based on the scanning order, subblocks of the current block can be predicted / reconstructed sequentially. Prediction and reconstruction can be performed on preceding subblocks, and then on succeeding subblocks. Here, succeeding subblocks can refer to nearby samples of the current block and / or reconstructed samples of preceding subblocks. In this manner, subblocks belonging to the current block can be predicted and reconstructed sequentially.

[0114] Figure 5 is a diagram illustrating an example of categories related to a scan order according to an embodiment of the present invention.

[0115] The scanning order is classified into two, three, or more categories based on the directionality of the intra prediction mode predefined in the apparatus for encoding / decoding an image. Alternatively, the categories can be obtained by classifying the number, range, and / or position of samples referenced by the intra prediction mode of the current block.

[0116] The scan sequence available for each category obtained through classification can be defined. Scan sequences can include z-scanning, z-scanning rotated by a predetermined angle in the clockwise or counterclockwise direction, and the like. The predetermined angle can be 90 degrees, 180 degrees, -90 degrees, or -180 degrees. For example, the first category can use z-scanning, the second category can use z-scanning rotated by 90 degrees in the counterclockwise direction, and the third category can use z-scanning rotated by 90 degrees in the clockwise direction.

[0117] The number / type of scanning orders may be variably determined by considering the size of a block (e.g., coding block, prediction block, and transform block), the partition type of the block, the transform type (e.g., DCT and DST), information on whether there are non-zero transform coefficients, information on whether it is a transform skip block, a quantization parameter, etc. Alternatively, the number / type of scanning orders may be preset in an apparatus for encoding / decoding an image.

[0118] Figure 6is a diagram illustrating a process of intra prediction based on z-scan in an adaptive scan order according to an embodiment of the present invention.

[0119] Reference Figure 6 According to the directionality of the intra prediction mode, when referring to the upper left neighboring sample in the 135-degree direction, intra prediction can be performed based on the z-scan in the adaptive scan order. According to the z-scan, prediction / reconstruction can be performed on the first sub-block 610, the second sub-block 620, the third sub-block 630, and the fourth sub-block 640 in sequence.

[0120] The first sub-block 610 may refer to nearby samples 611 (samples indicated by slashes) reconstructed before the first sub-block.

[0121] The nearby samples of the second sub-block 620 may include pre-reconstructed nearby samples 621 (samples indicated by slashes) and unreconstructed or reference-impossible samples 622 (samples filled with dots). However, the second sub-block 620 may be predicted / reconstructed with reference to only the pre-reconstructed nearby samples 621 of these nearby samples.

[0122] Similarly, the nearby samples of the third sub-block 630 may include pre-reconstructed nearby samples 631 (samples indicated by slashes) and unreconstructed or reference-impossible samples 632 (samples filled with dots). However, the third sub-block 630 may be predicted / reconstructed with reference to only the pre-reconstructed nearby samples 631 of these nearby samples.

[0123] Similarly, the nearby samples of the fourth sub-block 640 include pre-reconstructed nearby samples 641 (samples indicated by slashes) and unreconstructed or reference-impossible samples 642 (samples filled with dots). However, the fourth sub-block 640 can be predicted / reconstructed by referring only to the pre-reconstructed nearby samples 641 of these nearby samples.

[0124] Meanwhile, one subblock may be divided into two non-square blocks. In this case, the scanning order for encoding / decoding the two non-square blocks may be determined based on the directionality of the intra prediction mode of the current block.

[0125] like Figure 6As shown, the first sub-block 610 can be divided into a first lower layer block 612 and a second lower layer block 613, which are non-square blocks in the vertical direction. Here, when the intra prediction mode refers to the upper left nearby sample in the 135-degree direction, encoding / decoding is performed on the first lower layer block 612 and the second lower layer block 613 in sequence. After prediction and reconstruction are performed on the first lower layer block 612, prediction and reconstruction can be performed on the second lower layer block 613. The second lower layer block 613 can refer to at least one of the nearby samples of the first sub-block 610 and the reconstructed samples of the first lower layer block 612. Alternatively, after prediction is performed on the first lower layer block 612, prediction can be performed on the second lower layer block 613. Here, the second lower layer block 613 can refer to at least one of the nearby samples of the first sub-block 610 and the predicted samples of the first lower layer block 612.

[0126] Or, as Figure 6 As shown, the third sub-block 630 can be divided into a third lower layer block 633 and a fourth lower layer block 634, which are non-square blocks in the horizontal direction. Here, when the intra-frame prediction mode refers to the upper left nearby sample in the 135-degree direction, encoding / decoding is performed on the third lower layer block 633 and the fourth lower layer block 634 in sequence. Similarly, after prediction and reconstruction are performed on the third lower layer block 633, prediction and reconstruction can be performed on the fourth lower layer block 634. The fourth upper layer block 634 can refer to at least one of the nearby samples of the third sub-block 630 and the reconstructed samples of the third lower layer block 633. Alternatively, after prediction is performed on the third lower layer block 633, prediction can be performed on the fourth lower layer block 634. Here, the fourth lower layer block 634 can refer to at least one of the nearby samples of the third sub-block 630 and the predicted samples of the third lower layer block 633.

[0127] Figure 7 is a diagram illustrating a process of intra prediction based on z scanning in the form of a 90-degree counterclockwise rotation in an adaptive scanning order according to an embodiment of the present invention.

[0128] Reference Figure 7 According to the directionality of the intra prediction mode, when referring to the lower left sample in the 225-degree direction, intra prediction may be performed based on z scanning at an angle rotated 90 degrees counterclockwise in the adaptive scan order. Based on the z scanning at an angle rotated 90 degrees counterclockwise, prediction / reconstruction may be performed on the first sub-block 710, the second sub-block 720, the third sub-block 730, and the fourth sub-block 740 in this order.

[0129] The first sub-block 710 can be divided into a sample region indicated in white (hereinafter referred to as a "first region") and a sample region indicated in grayscale (hereinafter referred to as a "second region"). The first region refers to a region that refers to possible or pre-reconstructed nearby samples 711 (samples indicated by slashes), and the second region refers to a region that does not reconstruct or refers to impossible samples 712 (samples of fill points). One or more samples belonging to region 711 can be used to generate samples of region 712. Samples of the second region can be predicted with reference to the generated samples of region 712.

[0130] The second sub-block 720 may be predicted / reconstructed with reference to pre-reconstructed nearby samples 721 (samples indicated by slash lines). Here, the pre-reconstructed nearby samples 721 may include reconstructed samples of the first sub-block 710, which are adjacent to the bottom of the second sub-block.

[0131] The third sub-block 730 can be divided into a sample region indicated in white (hereinafter referred to as a "first region") and a sample region indicated in grayscale (hereinafter referred to as a "second region"). The first region refers to a region that refers to possible or pre-reconstructed nearby samples 731 (samples indicated by slashes), and the second region refers to a region that does not reconstruct or refers to impossible samples 732 (samples of fill points). One or more samples belonging to region 731 can be used to generate samples of region 732. Samples of the second region can be predicted with reference to the generated samples of region 732.

[0132] The fourth subblock 740 may be predicted / reconstructed with reference to pre-reconstructed nearby samples 741 (samples indicated by slash lines). Here, the pre-reconstructed nearby samples 741 may include reconstructed samples of the first to third subblocks, which are adjacent to the fourth subblock.

[0133] As described above, according to the directionality of the intra prediction mode, when the adaptive scan order is used, the occurrence of the second region referring to non-reconstruction or reference impossible, such as the second subblock 720 and the fourth subblock 740, can be minimized.

[0134] Meanwhile, one subblock may be divided into two non-square blocks. In this case, the scanning order for encoding / decoding the two non-square blocks may be determined based on the directionality of the intra prediction mode of the current block.

[0135] like Figure 7 As shown, the second sub-block 720 can be divided into a first lower layer block 722 and a second lower layer block 723, which are non-square blocks in the horizontal direction. Here, when the intra prediction mode refers to the lower left neighboring sample in the 225-degree direction, encoding / decoding can be performed on the first lower layer block 722 and the second lower layer block 723 in sequence.

[0136] After prediction and reconstruction are performed on the first lower layer block 722, prediction and reconstruction may be performed on the second lower layer block 723. The second lower layer block 723 may refer to at least one of the nearby samples of the second sub-block 720 and the reconstructed samples of the first lower layer block 722. Alternatively, after prediction is performed on the first lower layer block 722, prediction may be performed on the second lower layer block 723. Here, the second lower layer block 723 may refer to at least one of the nearby samples of the second sub-block 720 and the predicted samples of the first lower layer block 722.

[0137] Figure 8 is a diagram illustrating a process of intra prediction based on z scanning in the form of a 90-degree rotation in a clockwise direction in an adaptive scanning order according to an embodiment of the present invention.

[0138] Reference Figure 8 According to the directionality of the intra prediction mode, when referring to a sample near the upper right in the 45-degree direction, intra prediction can be performed based on z scanning in the adaptive scan order rotated by 90 degrees in the clockwise direction. Based on the z scanning in the adaptive scan order rotated by 90 degrees in the clockwise direction, prediction / reconstruction can be performed on the first sub-block 810, the second sub-block 820, the third sub-block 830, and the fourth sub-block 840 in this order.

[0139] The first sub-block 810 may be predicted / reconstructed with reference to pre-reconstructed nearby samples 811 (samples indicated by slashes).

[0140] The second sub-block 820 can be divided into a sample region indicated in white (hereinafter referred to as a "first region") and a sample region indicated in grayscale (hereinafter referred to as a "second region"). The first region refers to a region that refers to possible or pre-reconstructed nearby samples 821 (samples indicated by slashes), and the second region refers to a region that does not reconstruct or refers to impossible samples 822 (samples of fill points). One or more samples belonging to the region 821 can be used to generate samples of the region 822. The samples of the second region can be predicted with reference to the generated samples of the region 822.

[0141] The third sub-block 830 may be predicted / reconstructed with reference to pre-reconstructed nearby samples 831 (samples indicated by slash lines). Here, the pre-reconstructed nearby samples 831 may include reconstructed samples of the first sub-block 810 adjacent to the left side of the third sub-block.

[0142] The fourth subblock 840 may be predicted / reconstructed with reference to pre-reconstructed nearby samples 841 (samples indicated by slash lines). Here, the pre-reconstructed nearby samples 841 may include reconstructed samples of the first subblock to the third subblock adjacent to the fourth subblock.

[0143] As described above, according to the directionality of the intra prediction mode, when the adaptive scan order is used, the occurrence of the second region referring to non-reconstructed or reference impossible samples, such as the third subblock 830 and the fourth subblock 840, can be minimized.

[0144] Meanwhile, one subblock may be divided into two non-square blocks. In this case, the scanning order for encoding / decoding the two non-square blocks may be determined based on the directionality of the intra prediction mode of the current block.

[0145] like Figure 8 As shown, the third sub-block 830 can be divided into a first lower layer block 832 and a second lower layer block 833, which are non-square blocks in the vertical direction. Here, when the intra prediction mode refers to the upper right near sample in the 45-degree direction, encoding / decoding can be performed on the first lower layer block 832 and the second lower layer block 833 in sequence.

[0146] After prediction and reconstruction are performed on the first lower layer block 832, prediction and reconstruction may be performed on the second lower layer block 833. The second lower layer block 833 may refer to at least one of the nearby samples of the third sub-block 830 and the reconstructed samples of the first lower layer block 832. Alternatively, after prediction is performed on the first lower layer block 832, prediction may be performed on the second lower layer block 833. Here, the second lower layer block 833 may refer to at least one of the nearby samples of the third sub-block 830 and the predicted samples of the first lower layer block 832.

[0147] Figure 9 is a diagram illustrating an inter prediction method based on a current picture reference mode according to an embodiment of the present invention.

[0148] In current picture reference mode, motion compensation is performed on the current block based on a reference block belonging to the same picture as the current block. This can be separated from inter-frame mode, in which motion compensation is performed based on a reference block belonging to a different picture from the current block. For separation, information indicating whether the current block is a block encoded in current picture reference mode can be encoded / decoded. Alternatively, when the picture specified by the reference picture index of the current block is the current picture, the current block is determined to be a block encoded in current picture reference mode. The current picture is placed at a predetermined position within the reference picture list. The predetermined position can be a position pre-established in the device for encoding / decoding images, or it can be an arbitrary position like other reference pictures. For example, the current picture can be placed before a short-term reference picture, between a short-term reference picture and a long-term reference picture, or after a long-term reference picture.

[0149] refer to Figure 9 , based on the motion vector of the current block, a reference block of the current block may be determined in step S900 .

[0150] When the current block is coded in current picture reference mode, the reference block is in the same picture as the current block. In contrast, when the current block is coded in inter mode, the reference block is in a different picture than the current block.

[0151] The motion vector can be derived from the neighboring blocks of the current block. Here, the neighboring blocks may refer to blocks that are spatially and / or temporally adjacent to the current block. Spatially adjacent blocks may include at least one of the blocks adjacent to the left, top, bottom left, top left, or top right of the current block. Temporally adjacent blocks may include at least one of the blocks located at the same position as the current block, and blocks adjacent to the left, top, right, bottom, or each corner of the block located at the same position.

[0152] Motion vectors can be derived by selectively using nearby blocks that satisfy predetermined conditions among the nearby blocks. Examples of the predetermined conditions include whether the prediction mode (e.g., current picture reference mode, inter mode, etc.) is the same as that of the current block, whether the same reference picture list as that of the current block is used, whether the same reference picture as that of the current block is referenced, etc.

[0153] Alternatively, the motion vector can be determined based on template matching. Template matching is a process of specifying a region near the current block (hereinafter referred to as a "template") and searching for a block having a template most similar to the template of the current block. The search can be performed on all or part of the pre-reconstructed region within the current picture, or on a picture with a different time than the current picture.

[0154] Alternatively, the motion vector may be derived by considering the picture type of the current picture, the frequency of the motion vector of the current picture reference mode, etc., and this will refer to Figure 10 Detailed description.

[0155] refer to Figure 9 , based on the reference block determined in step S900 , motion compensation of the current block may be performed in step S910 .

[0156] The reference block may be a block composed of integer pixels or a block composed of fractional pixels. Alternatively, a filtered reference block may be generated by performing predetermined filtering on the reference block, and motion compensation may be performed using the filtered reference block. Filtering may be performed using a weighting filter that changes sample values ​​of the reference block by applying predetermined weighting factors to the sample values, or may be performed using an interpolation filter that generates fractional pixels by interpolating samples of the reference block.

[0157] The apparatus for encoding an image may encode and signal filter information used for filtering, and the apparatus for decoding an image may filter the reference block based on the signaled filter information.

[0158] The number of filters used in filtering can be one, two, three or more. The filter can be a fixed coefficient filter pre-established in the device for encoding / decoding images, or it can be a variable coefficient filter. The device for encoding images can encode and signal information indicating whether to use a variable coefficient filter, and the device for decoding images can determine whether to use a variable coefficient filter based on the signaled information. The coefficients of the variable coefficient filter can be determined based on the coefficients signaled from the device for encoding images, or can be derived based on one or more samples of the current block and / or one or more samples of nearby blocks. Alternatively, the coefficients of the variable coefficient filter can be derived from the coefficients of the filter used before the current block, or can be derived based on high-level predefined coefficients, such as a sequence, a picture, etc. The coefficients can be different depending on the position of the filtered samples.

[0159] The precision of the fractional pixels generated by filtering can be selectively selected between 1 / 2 pixel and 1 / 4 pixel. When 1 / 2 pixel is selected as the fractional pixel precision, a 1 / 2 pixel is generated between two integer pixels. When 1 / 4 pixel is selected as the fractional pixel precision, a 1 / 4 pixel is generated between two integer pixels. The generated fractional pixels can be generated using multiple samples located on the same vertical line and / or horizontal link. Here, the multiple samples can include at least one of integer pixels and pre-generated fractional pixels. The fractional pixel precision can be selected based on encoded information. Alternatively, a fixed precision pre-established in the image encoding / decoding device can be used. The aforementioned 1 / 2 pixel and 1 / 4 pixel precisions are merely examples and can be extended to 1 / 8 pixel, 1 / 16 pixel, and so on. For example, when the precision is 1 / 16 pixel, the filter coefficients for each of the 15 fractional pixels, excluding the one integer pixel, can be signaled or fixed. In other words, the 15 sets of filter coefficients can be signaled or pre-defined in the image encoding / decoding device.

[0160] The motion compensation process in step S910 may also include scaling the reference block or rotating it by a predetermined angle. Scaling or rotating the reference block transforms the reference block to a size or shape similar to the current block. This can be performed before or after the filtering process described above. At least one of filtering, scaling, and rotation may be omitted during the motion compensation process in step S910.

[0161] Figure 10 is a diagram illustrating a method of deriving a motion vector of a current block encoded in a current picture reference mode according to an embodiment of the present invention.

[0162] The motion vector of the current block encoded in the current picture reference mode may be derived from a predetermined motion candidate list. This may be performed when the current block belongs to an intra-random access point (IRAP) picture.

[0163] The motion candidate list may include motion vectors with a high frequency among the motion vectors used for the current picture reference mode. The range of motion vectors that may be included in the motion candidate list may be determined based on at least one of the search range of the reference block of the current picture reference mode and whether wavefront parallel processing (WPP) is used. For example, the range of motion vectors that may be included in the motion candidate list may be limited to motion vectors within an area that has been decoded by WPP, or may be limited to motion vectors within the search range of the reference block of the current picture reference mode. For example, the motion candidate list of the current block may include motion vectors within an area that has been decoded before the current block. Alternatively, after the encoding / decoding of the current block is completed, the motion vector of the current block may be appended to the motion candidate list. In this way, the motion vector of the current block can be used in the encoding / decoding of the current picture reference mode block that follows the current block.

[0164] refer to Figure 10 , it can be determined in step S1000 whether the current block is a block encoded in the current picture reference mode. Figure 9 As described above, the determination may be performed based on information indicating whether the current block is block-coded in the current picture reference mode, or may be performed based on a reference picture index of the current block.

[0165] When the current block is a block encoded in the current picture reference mode, it is determined at step S1010 whether the current picture to which the current block belongs is an IRAP picture.

[0166] When the current picture is an IRAP picture, a motion vector is derived based on the motion candidate list in step S1020. On the other hand, when the current picture is not an IRAP picture, a motion vector is derived from a nearby block in step S1030.

[0167] Figure 11 is a diagram illustrating a method of filtering a reference block according to an embodiment of the present invention.

[0168] Reference Figure 11 , the accuracy of the fractional pixels for filtering relative to the reference block can be determined in step S1100. Examples of the accuracy of the fractional pixels may include 1 / 2 pixel, 1 / 4 pixel, 1 / 8 pixel, 1 / 16 pixel, etc. The accuracy of the fractional pixels can be determined based on the encoded information to specify the accuracy of the fractional pixels relative to the filtering. Alternatively, as the accuracy of the fractional pixels, an accuracy pre-established in the device for encoding / decoding images can be used, and in this case, the execution of step S1100 can be omitted.

[0169] Whether the filter used in filtering is a variable coefficient filter may be determined at step S1110. This determination may be performed based on information indicating whether a variable coefficient filter is used.

[0170] If the filter is a variable coefficient filter, the filter coefficients are checked at step S1120. The coefficients can be obtained from the bitstream or derived using nearby samples. Alternatively, the coefficients can be derived from the filter coefficients previously used for the current block. Based on the coefficients obtained at step S1120, the reference block can be filtered at step S1130.

[0171] In contrast, when the filter is not a variable coefficient filter, the reference block is filtered based on a fixed coefficient filter pre-established in the apparatus for encoding / decoding an image in step S1140.

[0172] At the same time, this embodiment does not limit the time sequence between the step of determining the accuracy of the fractional pixels and the step of determining whether to use the variable coefficient filter. The step of determining the accuracy of the fractional pixels can be performed after the step of determining whether to use the variable coefficient filter, or these steps can be performed independently.

[0173] Figure 12 is a diagram illustrating the shape of a current block encoded in a current picture reference mode according to an exemplary embodiment.

[0174] Even if the current block is divided into square or non-square, the current picture reference mode is used. Figure 12 As shown, even if the current block is divided into an arbitrary shape such as a triangle, the current picture reference mode is used.

[0175] refer to Figure 12 Blocks 1210 and 1230 are non-square blocks that have been partitioned, and blocks 1220 and 1240 are blocks that have been partitioned into arbitrary shapes. Block 1230 can use block 1210 as a reference block, and block 1240 can use block 1220 as a reference block. This may involve a process of rotating block 1220 by a predetermined angle.

[0176] Alternatively, by obtaining the size / shape of the current block, the current picture reference mode can be used in a restricted manner. For example, when the size of the current block is greater than a threshold size, the current picture reference mode is not allowed. Alternatively, when the partition type of the current block is N×M, the current picture reference mode is not allowed. Here, N and M are integers greater than zero and can be the same as or different from each other. N×M can be pre-established in the device for encoding / decoding images, or can be derived based on encoded information to indicate the block size / shape that allows the current picture reference mode.

[0177] Figure 13 is a diagram illustrating a process of interpolation-based intra prediction according to an embodiment of the present invention.

[0178] Reference Figure 13 , in step S1300, nearby samples for intra prediction of the current block may be designated. The nearby samples may belong to blocks adjacent to the left, lower left, upper left, top, or upper right of the current block. When a sample that is not reconstructed or impossible to reference still exists among the nearby samples, it is replaced by a possible reference sample or a pre-reconstructed sample among the nearby samples.

[0179] At step S1310, a predetermined filtering may be performed on the designated nearby samples. Filtering is the process of generating integer-precision filtered nearby samples by applying a predetermined weighting factor to the integer-precision nearby samples. Filtering may be selectively performed based on factors such as the intra prediction mode of the current block, the block size, the block shape, and variations in adjacent nearby samples.

[0180] By applying the interpolation filter to the filtered nearby samples, reference samples for intra prediction may be generated at step S1320 .

[0181] Whether to apply an interpolation filter can be determined based on a flag encoded to indicate whether an interpolation filter is applied. The flag can be signaled at at least one level of a sequence, a picture, a slice, and a block. Alternatively, whether to apply an interpolation filter can be determined by further considering the intra prediction mode of the current block. For example, when the intra prediction mode is a mode that references integer precision samples (e.g., planar mode, DC mode, horizontal mode, and vertical mode), the interpolation filter is not applied to nearby samples. For example, whether to apply the above-mentioned filter can be determined based on a flag signaled at the block level.

[0182] Examples of interpolation filters include linear interpolation filters, cubic interpolation filters, and Gaussian interpolation filters. A device for encoding / decoding an image may define multiple interpolation filters and selectively use one of these filters. For example, a device for encoding / decoding an image may selectively use one of two filters. For example, one of the two filters may be a Gaussian interpolation filter.

[0183] The interpolation filter may be determined by considering at least one of a size of the current block and an intra prediction mode. The current block may be a coding block (CU), a prediction block (PU), or a transform block (TU).

[0184] The block size can be represented by the width / height of the block, the sum of the width and height, the average of the width and height, the number of samples belonging to the relevant block, etc. In other words, the interpolation filter can be determined based on at least one of the width of the block, the height of the block, the width and height of the block, and the ratio of the width and height of the block. The sum of the width and height of the block can be the sum of values ​​representing the width and height of the block on a logarithmic scale.

[0185] For example, a first interpolation filter may be applied to blocks smaller than a predetermined threshold size, and a second interpolation filter may be applied to blocks equal to or larger than the threshold size. The first and second interpolation filters differ from each other in at least one of the filter coefficients, the number of taps, and the filter strength. Alternatively, the first interpolation filter may be one of the types of interpolation filters described, and the second interpolation filter may be another. The threshold size may be preset in the apparatus for encoding / decoding images, or may be variably determined by considering specific encoding parameters. Alternatively, the same interpolation filter may be applied to all block sizes, or different interpolation filters may be applied to each block size.

[0186] By considering the directionality of the intra-frame prediction mode, the intra-frame prediction modes predefined in the device for encoding / decoding an image can be classified into multiple groups. For example, the predefined intra-frame prediction modes can be classified into a first group having a first directionality, a second group having a second directionality, a third group having a third directionality, and so on. The number of groups can range from 1 to the number of predefined intra-frame prediction modes. Each group can include one or more intra-frame prediction modes. The multiple intra-frame prediction modes belonging to each group can have similar directionality. Based on the directionality of the intra-frame prediction mode, an interpolation filter can be determined.

[0187] Alternatively, the apparatus for encoding an image may encode and signal information for determining an interpolation filter, and the apparatus for decoding the image may determine the interpolation filter based on the signaled information. This information may be signaled at at least one of a sequence, picture, slice, and block level. For example, the interpolation filter may be determined based on information signaled at the block level.

[0188] The determination of the interpolation filter may mean determining at least one of a filter coefficient, a filter strength, a number of taps, and a type of the interpolation filter.

[0189] Based on the generated reference samples, intra prediction of the current block can be performed at step S1330. For example, the reference samples can be set as the prediction samples of the current block. The current block can be reconstructed by adding the decoded residual samples to the prediction samples. Alternatively, the reference samples can be set as the reconstructed samples of the current block. In this case, the residual signal of the current block may not be signaled, or the residual signal of the current block may not be reconstructed.

[0190] Figure 14 is a diagram illustrating a method of applying an interpolation filter according to an embodiment of the present invention.

[0191] By applying an interpolation filter to a plurality of nearby samples adjacent to a current block, reference samples for intra-frame prediction can be generated. The nearby samples may include at least one of integer precision samples and fractional precision samples. The number of nearby samples to which the interpolation filter is applied may be two, three, four, five, six, or more. The number of nearby samples may be variably determined based on at least one of the intra-frame prediction mode of the current block and the position of the sample that is the prediction / reconstruction target within the current block. Alternatively, the number of nearby samples may be a fixed number pre-established in the device for encoding / decoding an image. The positions of the nearby samples may be determined based on at least one of the intra-frame prediction mode of the current block and the position of the sample that is the prediction / reconstruction target within the current block. For example, the application of the interpolation filter to four nearby samples may be pre-defined in the device for encoding / decoding an image.

[0192] Reference Figure 14 Based on the position of the sample that is the prediction / reconstruction target within the current block 1410 and the intra prediction mode of the current block, nearby samples 1431 and 1432 with integer precision may be specified. By interpolating the nearby samples 1431 and 1432, a reference sample 1420 may be generated between the nearby samples 1431 and 1432. Here, the reference sample 1420 may be a sample with real number precision. The position of the reference sample may be specified based on at least one of the position of the sample that is the prediction / reconstruction target within the current block 1410 and the intra prediction mode of the current block.

[0193] like Figure 14 As shown, the space between P0 1431 and P1 1432, which are integer precision nearby samples, can be divided into a plurality of interpolated sample positions. The interpolated sample positions can have real precision. The number of interpolated sample positions is N, and N can be an integer greater than 1. Based on the intra prediction mode of the current block, the position of generating the reference sample can be determined among the interpolated sample positions.

[0194] For example, the space between nearby samples P0 1431 and P1 1432 can be divided into 32 interpolated sample positions with real precision. Here, the position of the reference sample 1420 generated by interpolation is 13 / 32, and based on this position, the interpolation filter is applied to P0 1431 and P1 1432 to generate the reference sample.

[0195] Figure 15 is a diagram illustrating an example of an interpolation filter using a plurality of taps according to an embodiment of the present invention.

[0196] In the present invention, the number of taps of the interpolation filter can be determined based on at least one of the size of the current block, whether the intra-frame prediction mode is a directional mode, the directionality / angle of the intra-frame prediction mode, and encoded information specifying the number of taps. The number of taps of the interpolation filter can be two, three, four, five, six, or more. Hereinafter, for ease of description, the cases of four and six taps will be described respectively.

[0197] Reference Figure 15 Based on the position of the prediction / reconstruction target sample within the current block 1510 and at least one of the intra prediction modes of the current block, a reference sample 1520 for intra prediction may be generated between at least two nearby samples among integer-precision nearby samples 1531, 1532, 1533, and 1534. The two nearby samples may be adjacent nearby samples to each other or may be arranged in a discontinuous manner.

[0198] Four positions of neighboring samples (P0 1531, P1 1532, P2 1533, and P3 1534) with integer precision to which an interpolation filter is applied may be determined based on at least one of the position of the prediction / reconstruction target sample within the current block 1510 and the intra-prediction mode of the current block. Furthermore, based on at least one of the position of the prediction / reconstruction target sample within the current block 1510 and the intra-prediction mode of the current block, the position of the interpolated reference sample 1520 may be determined between P1 1532 and P2 1533. The interpolated reference sample 1520 may have real precision.

[0199] By applying an interpolation filter to four nearby samples, a reference sample 1520 may be generated.

[0200] Reference Figure 15 Based on the position of the prediction / reconstruction target sample within the current block 1540 and at least one of the intra prediction modes of the current block, a reference sample 1550 for intra prediction may be generated between at least two nearby samples among integer-precision nearby samples 1561, 1562, 1563, 1564, 1565, and 1566. The two nearby samples may be adjacent nearby samples or may be arranged in a discontinuous manner.

[0201] Based on the position of the prediction / reconstruction target sample within the current block 1540 and at least one of the intra prediction mode of the current block, six positions of nearby samples with integer precision to which the interpolation filter is applied, namely P0 1561, P1 1562, P2 1563, P3 1564, P4 1565, and P5 1566, may be determined. In addition, based on the position of the prediction / reconstruction target sample within the current block 1540 and at least one of the intra prediction mode of the current block, the position of the interpolated reference sample 1550 may be determined between P2 1563 and P3 1564. The interpolated reference sample 1550 may have real precision.

[0202] By applying an interpolation filter to four nearby samples, a reference sample 1550 may be generated.

[0203] The present disclosure may also have the following configurations:

[0204] 1. An image decoding method, comprising:

[0205] determining an intra prediction mode for a current block;

[0206] selecting a filter to apply to neighboring samples of the current block;

[0207] Using the selected filter, filtering the neighboring samples of the current block; and

[0208] Based on the filtered neighboring samples, a prediction block for the current block is generated.

[0209] 2. The image decoding method according to claim 1,

[0210] The filter is an interpolation filter using four adjacent samples.

[0211] 3. The image decoding method according to claim 1,

[0212] Therein, the filter is selected based on information signaled on the block level.

[0213] 4. The image decoding method according to claim 1,

[0214] The filter is selected based on the size of the current block.

[0215] 5. The image decoding method according to claim 4,

[0216] The size of the current block is the sum of values, where each value represents the width and height of the current block in logarithmic scale.

[0217] 6. The image decoding method according to claim 1,

[0218] The filter is selected as one of a plurality of filters including a Gaussian interpolation filter.

[0219] In addition, the present disclosure may also have the following configurations:

[0220] 1. An image decoding method, comprising:

[0221] determining an intra prediction mode for a current block;

[0222] selecting a filter to apply to neighboring samples of the current block;

[0223] Using the selected filter, filtering the neighboring samples of the current block; and

[0224] Based on the filtered neighboring samples, a prediction block for the current block is generated.

[0225] 2. The image decoding method according to claim 1,

[0226] The filter is an interpolation filter using four adjacent samples.

[0227] 3. The image decoding method according to claim 1,

[0228] Therein, the filter is selected based on information signaled on the block level.

[0229] 4. The image decoding method according to claim 1,

[0230] The filter is selected based on the size of the current block.

[0231] 5. The image decoding method according to claim 4,

[0232] The size of the current block is the sum of values, where each value represents the width and height of the current block in logarithmic scale.

[0233] 6. The image decoding method according to claim 1,

[0234] The filter is selected as one of a plurality of filters including a Gaussian interpolation filter.

[0235] 7. An image encoding method, comprising:

[0236] determining an intra prediction mode for a current block;

[0237] selecting a filter to apply to neighboring samples of the current block;

[0238] Using the selected filter, filtering the neighboring samples of the current block; and

[0239] Based on the filtered neighboring samples, a prediction block for the current block is generated.

[0240] 8. The image encoding method according to claim 7,

[0241] The filter is an interpolation filter using four adjacent samples.

[0242] 9. The image encoding method according to claim 7,

[0243] Therein, the filter is selected based on information signaled on the block level.

[0244] 10. The image coding method according to claim 7,

[0245] The filter is selected based on the size of the current block.

[0246] 11. The image encoding method according to claim 10,

[0247] The size of the current block is the sum of values, where each value represents the width and height of the current block in logarithmic scale.

[0248] 12. The image coding method according to claim 7,

[0249] The filter is selected as one of a plurality of filters including a Gaussian interpolation filter.

[0250] 13. A non-transitory computer-readable recording medium storing a bit stream received and decoded by an image decoding device for reconstructing an image, comprising:

[0251] Wherein the bitstream includes information about the intra prediction mode and information about the filter;

[0252] Using the information about the intra prediction mode, determining the intra prediction mode of the current block;

[0253] Using the information about the filter, select a filter to be applied to neighboring samples of the current block;

[0254] Using the selected filter, filtering the neighboring samples of the current block; and

[0255] Using the filtered neighboring samples, a prediction block for the current block is generated.

[0256] 14. A method for decoding an image block in a current picture reference mode, the method comprising:

[0257] deriving a motion vector for the current block based on a motion candidate list, the motion candidate list including motion vectors for blocks in the current picture that are decoded before the current block; and

[0258] Based on the derived motion vector, a prediction block for the current block is generated.

[0259] The motion vector indicates a reference block included in the current picture.

[0260] 15. The image decoding method according to solution 14, further comprising:

[0261] The motion vector of the current block is added to the motion candidate list.

[0262] 16. A method for encoding an image block in a current picture reference mode, the method comprising:

[0263] determining a motion vector of the current block, and generating a prediction block of the current block based on the determined motion vector; and

[0264] encoding a motion vector for the current block based on a motion candidate list that includes motion vectors for blocks in the current picture that were encoded before the current block,

[0265] The motion vector indicates a reference block included in the current picture.

[0266] 17. The image encoding method according to solution 16, further comprising:

[0267] The motion vector of the current block is added to the motion candidate list.

[0268] 18. A non-transitory computer-readable recording medium storing a bit stream received and decoded by an image decoding device and used to reconstruct a current block in a current picture reference mode,

[0269] wherein the bitstream includes information about a prediction of a current block;

[0270] using the information about the prediction of the current block to derive a motion vector for the current block based on a motion candidate list, the motion candidate list including motion vectors of blocks in the current picture, the blocks being decoded before the current block,

[0271] Using the derived motion vector, generate a prediction block for the current block, and

[0272] The motion vector indicates a reference block included in the current picture.

[0273] Although the exemplary methods of the present invention are shown as a series of operations for clarity of description, the order of the steps is not limited thereto. If desired, the steps shown may be performed simultaneously or in a different order. To implement the methods of the present invention, additional steps may be added to the illustrative steps, some steps may be excluded from the illustrative steps, or some steps may be excluded while additional steps may be included.

[0274] The various embodiments of the present invention are not intended to list all possible combinations, but are intended to illustrate representative aspects of the present invention. The contents described in the various embodiments can be applied independently or in combination of two or more.

[0275] In addition, various embodiments of the present invention can be implemented by hardware, firmware, software, or a combination thereof. With hardware implementation, the embodiment can be implemented by using at least one selected from a group of application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, etc.

[0276] The scope of the present invention includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that enable operations according to the methods of various embodiments to be performed on a device or computer, and includes non-transitory computer-readable media storing such software or instructions that are executed on a device or computer.

[0277] Industrial Applicability

[0278] The present invention can be used for encoding / decoding video signals.

Claims

1. An image decoding method, comprising: determining an intra prediction mode for a current block; determining whether to apply a first filter to neighboring samples of the current block based on an intra prediction mode of the current block and a size of the current block; If it is determined in the determining step that the first filter is to be performed, filtering the adjacent samples to generate filtered adjacent samples; applying a second filter to the filtered adjacent samples to generate reference samples; generating a prediction block of the current block based on the reference sample; Generate a residual block of the current block by decoding the bit stream; as well as Reconstruct the current block based on the prediction block and the residual block, wherein the second filter is an interpolation filter using four samples of the filtered adjacent samples, and The residual block is generated by entropy decoding the residual information included in the bitstream.

2. The image decoding method according to claim 1, in, The number of taps of the second filter is determined based on a prediction direction corresponding to the intra prediction mode.

3. The image decoding method according to claim 1, in, The second filter is selected based on information signaled on block level.

4. The image decoding method according to claim 1, in, The second filter is selected based on the size of the current block.

5. The image decoding method according to claim 4, in, The size of the current block is the sum of the following values: each value represents the width and height of the current block in logarithmic scale.

6. The image decoding method according to claim 1, in, The second filter is selected to be one of a plurality of filters including a Gaussian interpolation filter.

7. An image encoding method, comprising: determining an intra prediction mode for a current block; determining whether to apply a first filter to neighboring samples of the current block based on an intra prediction mode of the current block and a size of the current block; If it is determined in the determining step that the first filter is to be performed, filtering the adjacent samples to generate filtered adjacent samples; applying a second filter to the filtered adjacent samples to generate reference samples; generating a prediction block of the current block based on the reference sample; Generate a residual block of the current block based on the prediction block; as well as Encode the residual block of the current block into the bitstream, wherein the second filter is an interpolation filter using four samples of the filtered adjacent samples, and The residual block is encoded by entropy encoding the residual information into the bitstream.

8. The image encoding method according to claim 7, in, The number of taps of the second filter is determined based on a prediction direction corresponding to the intra prediction mode.

9. The image encoding method according to claim 7, in, The second filter is selected based on information signaled on block level.

10. The image encoding method according to claim 7, in, The second filter is selected based on the size of the current block.

11. The image encoding method according to claim 10, in, The size of the current block is the sum of the following values: each value represents the width and height of the current block in logarithmic scale.

12. The image encoding method according to claim 7, in, The second filter is selected to be one of a plurality of filters including a Gaussian interpolation filter.

13. A method for transmitting a bitstream, wherein the bitstream is generated by an image encoding method, the method comprising: determining an intra prediction mode for a current block; determining whether to apply a first filter to neighboring samples of the current block based on an intra prediction mode of the current block and a size of the current block; If it is determined in the determining step that the first filter is to be performed, filtering the adjacent samples to generate filtered adjacent samples; applying a second filter to the filtered adjacent samples to generate reference samples; generating a prediction block of the current block based on the reference sample; Generate a residual block of the current block based on the prediction block; as well as Encode the residual block of the current block into the bitstream, wherein the second filter is an interpolation filter using four samples of the filtered adjacent samples, and The residual block is encoded by entropy encoding the residual information into the bit stream.

Citation Information

Patent Citations

  • Methods and apparatus for encoding / decoding images

    CN109417637B

  • Method of decoding moving pictures in intra prediction

    KR1020130105114A