Method for decoding and encoding video and method for transmitting bitstream of video
By deriving intra prediction modes and configuring adaptive reference pixels with filtering, the method addresses inefficiencies in video compression for high-resolution and 3D content, enhancing encoding efficiency and prediction accuracy.
Patent Information
- Application Number
- CN202411597424.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-07-11
- Filing Date
- 2019-07-10
- Publication Date
- 2024-12-27
AI Technical Summary
Existing video compression technologies face challenges in efficiently encoding and decoding high-resolution and 3D video content, particularly in deriving optimal intra-frame prediction modes and configuring reference pixels for improved compression efficiency.
The method involves deriving an intra prediction mode based on a default mode or MPM candidates, configuring adaptive reference pixels, and performing intra prediction with filtering, using a candidate list and offsets based on block shape and position, and selectively applying filtering based on flags and block characteristics.
This approach enhances encoding efficiency, improves intra prediction accuracy, and improves the performance of intra-frame prediction, leading to more effective video compression and decoding.
Smart Images

Figure CN119211534A_ABST
Abstract
Description
[0001] This application is a divisional application of invention patent application No. 201980046208.8, which was filed on July 10, 2019, has international application number PCT / KR2019 / 008504, and entered the Chinese national phase on January 8, 2021, and is named “Video encoding method and device based on intra-frame prediction”. Technical Field
[0002] The present invention relates to video coding technology, and in particular to intra-frame prediction in video coding technology. Background Art
[0003] The market demand for high-resolution video is increasing, so there is a need for technology that can efficiently compress high-resolution images. In response to this market demand, the ISO / IEC Moving Picture Expert Group (MPEG) and the ITU-T VCEG (Video Coding Expert Group) jointly formed the JCT-VC (Joint Collaborative Team on Video Coding), developed the High Efficiency Video Coding (HEVC) video compression standard in January 2013, and has been actively conducting research and development of the next generation compression standard.
[0004] Video compression mainly consists of intra-frame prediction, inter-frame prediction, transformation, quantization, entropy coding, and loop filtering. At the same time, as the demand for high-resolution images increases, the demand for 3D image content as a new image service is also increasing. Video compression technology for efficiently providing 3D video content with high resolution and ultra-high resolution is being discussed. Summary of the invention
[0005] Technical issues
[0006] An object of the present invention is to provide an image encoding / decoding method and apparatus with improved efficiency.
[0007] Another object of the present invention is to provide a method and apparatus for deriving an intra-frame prediction mode.
[0008] In addition, an object of the present invention is to provide a method and apparatus for configuring reference pixels for intra prediction.
[0009] In addition, an object of the present invention is to provide a method and apparatus for filtering reference pixels.
[0010] In addition, an object of the present invention is to provide an intra-frame prediction / correction method and device.
[0011] In addition, an object of the present disclosure is to provide a computer-readable recording medium storing a bit stream generated by an image encoding method / apparatus.
[0012] Technical Solutions
[0013] The video encoding / decoding method and apparatus according to the present invention can derive an intra prediction mode of a current block, configure reference pixels for intra prediction of the current block, and perform intra prediction of the current block based on the intra prediction mode and the reference pixels.
[0014] In the video encoding / decoding method and apparatus according to the present invention, the intra prediction mode is derived based on a predetermined default mode or one of the MPM candidates.
[0015] The video encoding / decoding method and apparatus according to the present invention can decode a first flag indicating whether the current block uses a default mode from a bit stream.
[0016] In the video encoding / decoding method and apparatus according to the present invention, when the current block uses the default mode according to the first flag, the intra prediction mode of the current block is set to the default mode.
[0017] In the video encoding / decoding method and apparatus according to the present invention, an intra prediction mode is derived based on a candidate list and an MPM index, the candidate list includes N MPM candidates, and N is 3, 4, 5 or 6.
[0018] In the video encoding / decoding method and apparatus according to the present invention, the intra prediction mode is changed by adding or subtracting a predetermined offset.
[0019] In the video encoding / decoding method and apparatus according to the present invention, an offset is selectively applied based on at least one of a shape of a current block or a derived intra prediction mode.
[0020] In the video encoding / decoding method and apparatus according to the present invention, the reference pixel belongs to one pixel row among a plurality of pixel rows adjacent to the current block.
[0021] The video encoding / decoding method and apparatus according to the present invention can filter reference pixels.
[0022] In the video encoding / decoding method and apparatus according to the present invention, filtering is selectively performed based on a second flag indicating whether filtering is performed on a reference pixel, and the second flag is derived based on at least one of the position / area of the reference pixel, the block size, the component type, whether intra-frame prediction in sub-block units is applied, or the intra-frame prediction mode.
[0023] In the video encoding / decoding method and apparatus according to the present invention, when the intra prediction mode of the current block is the DC mode, the pixels of the current block are predicted as the average value of the reference pixels.
[0024] In the video encoding / decoding method and apparatus according to the present invention, a range of reference pixels for a DC mode is determined in consideration of at least one of a size or a shape of a current block.
[0025] In the video encoding / decoding method and apparatus according to the present invention, when the width of the current block is greater than the height of the current block, the pixels of the current block are predicted as the average value of the upper reference pixels of the current block, and when the width of the current block is less than the height, the pixels of the current block are predicted as the average value of the left reference pixels of the current block.
[0026] In the video encoding / decoding method and apparatus according to the present invention, predicted pixels of a current block are corrected based on predetermined neighboring pixels and weights.
[0027] In the video encoding / decoding method and apparatus according to the present invention, a current block is divided into a plurality of sub-blocks based on predetermined division information, and intra prediction is performed in units of sub-blocks.
[0028] In the method for decoding a video according to the present invention, the method includes: deriving an intra-frame prediction mode of a current block; configuring reference pixels for intra-frame prediction of the current block; and performing intra-frame prediction of the current block based on the intra-frame prediction mode and the reference pixels of the current block, wherein the intra-frame prediction mode of the current block is derived based on a most likely mode MPM index and a candidate list including multiple MPM candidates, wherein multiple MPM candidates are derived based on intra-frame prediction modes of neighboring blocks adjacent to the current block, the neighboring blocks including at least one of a left neighboring block and an upper neighboring block, wherein the intra-frame prediction mode of the current block is changed based on a predetermined offset, and wherein, when the width of the current block is greater than the height of the current block and the intra-frame prediction mode of the current block is greater than or equal to 2 and less than 8, the intra-frame prediction mode of the current block is changed by adding a predetermined offset 65 to the intra-frame prediction mode of the current block.
[0029] In the method for encoding a video according to the present invention, the method includes: deriving an intra-frame prediction mode of a current block; configuring reference pixels for intra-frame prediction of the current block; and performing intra-frame prediction of the current block based on the intra-frame prediction mode and the reference pixels of the current block, wherein the intra-frame prediction mode of the current block is derived based on a candidate list including multiple most likely mode (MPM) candidates, wherein multiple MPM candidates are derived based on intra-frame prediction modes of neighboring blocks adjacent to the current block, the neighboring blocks including at least one of a left neighboring block and an upper neighboring block, wherein the intra-frame prediction mode of the current block is changed based on a predetermined offset, and wherein, when the width of the current block is greater than the height of the current block and the intra-frame prediction mode of the current block is greater than or equal to 2 and less than 8, the intra-frame prediction mode of the current block is changed by adding a predetermined offset 65 to the intra-frame prediction mode of the current block.
[0030] In the method for sending a bitstream of a video according to the present invention, the method includes: deriving an intra-frame prediction mode of a current block; configuring reference pixels for intra-frame prediction of the current block; generating a prediction block of the current block by performing intra-frame prediction of the current block based on the intra-frame prediction mode of the current block and the reference pixels; encoding the current block based on the prediction block to generate a bitstream; and sending the bitstream, wherein the intra-frame prediction mode of the current block is derived based on a candidate list including a plurality of most likely mode (MPM) candidates, wherein a plurality of MPM candidates are derived based on intra-frame prediction modes of neighboring blocks adjacent to the current block, the neighboring blocks including at least one of a left neighboring block and an upper neighboring block, wherein the intra-frame prediction mode of the current block is changed based on a predetermined offset, and wherein, when the width of the current block is greater than the height of the current block and the intra-frame prediction mode of the current block is greater than or equal to 2 and less than 8, the intra-frame prediction mode of the current block is changed by adding a predetermined offset 65 to the intra-frame prediction mode of the current block.
[0031] Beneficial effects
[0032] The present invention can provide an effective method and apparatus for deriving an intra-frame prediction mode.
[0033] In addition, according to the present invention, the encoding efficiency can be improved by configuring adaptive reference pixels.
[0034] In addition, the present invention can improve the performance of intra prediction by using filtered reference pixels.
[0035] In addition, the present invention can improve the accuracy of intra-frame prediction through intra-frame prediction / correction.
[0036] Furthermore, a computer-readable recording medium for storing a bit stream generated by the image encoding method / apparatus according to the present disclosure may be provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a block diagram illustrating an image encoding apparatus according to the present disclosure.
[0038] Figure 2 is a block diagram illustrating an image decoding apparatus according to the present disclosure.
[0039] Figure 3 is a diagram illustrating concepts of a multi-tree type (MTT) block structure generated according to binary partitioning and ternary partitioning, a partition type, and a partition block index according to an embodiment of the present invention.
[0040] Figure 4 Intra prediction modes predefined in an encoding / decoding apparatus according to an embodiment to which the present invention is applied are shown.
[0041] Figure 5 An intra prediction method according to an embodiment to which the present invention is applied is shown.
[0042] Figure 6 is a diagram showing a configuration of reference pixels for a DC mode in an intra prediction mode according to an embodiment of the present invention.
[0043] Figure 7 and Figure 8 is a diagram showing a configuration of reference pixels for a DC mode in an intra prediction mode for a block having a size in which a sum of a width and a height is not expressed as a power of 2 according to an embodiment of the present invention.
[0044] Best Mode for Carrying Out the Invention
[0045] The video encoding / decoding method and apparatus according to the present invention can derive an intra prediction mode of a current block, configure reference pixels for intra prediction of the current block, and perform intra prediction of the current block based on the intra prediction mode and the reference pixels.
[0046] In the video encoding / decoding method and apparatus according to the present invention, the intra prediction mode is derived based on a predetermined default mode or one of the MPM candidates.
[0047] The video encoding / decoding method and apparatus according to the present invention can decode a first flag indicating whether the current block uses a default mode from a bit stream.
[0048] In the video encoding / decoding method and apparatus according to the present invention, when the current block uses the default mode according to the first flag, the intra prediction mode of the current block is set to the default mode.
[0049] In the video encoding / decoding method and apparatus according to the present invention, an intra prediction mode is derived based on a candidate list and an MPM index, the candidate list includes N MPM candidates, and N is 3, 4, 5 or 6.
[0050] In the video encoding / decoding method and apparatus according to the present invention, the intra prediction mode is changed by adding or subtracting a predetermined offset.
[0051] In the video encoding / decoding method and apparatus according to the present invention, an offset is selectively applied based on at least one of a shape of a current block or a derived intra prediction mode.
[0052] In the video encoding / decoding method and apparatus according to the present invention, the reference pixel belongs to one pixel row among a plurality of pixel rows adjacent to the current block.
[0053] The video encoding / decoding method and apparatus according to the present invention can filter reference pixels.
[0054] In the video encoding / decoding method and apparatus according to the present invention, filtering is selectively performed based on a second flag indicating whether filtering is performed on a reference pixel, and the second flag is derived based on at least one of the position / area of the reference pixel, the block size, the component type, whether intra-frame prediction in sub-block units is applied, or the intra-frame prediction mode.
[0055] In the video encoding / decoding method and apparatus according to the present invention, when the intra prediction mode of the current block is the DC mode, the pixels of the current block are predicted as the average value of the reference pixels.
[0056] In the video encoding / decoding method and apparatus according to the present invention, a range of reference pixels for a DC mode is determined in consideration of at least one of a size or a shape of a current block.
[0057] In the video encoding / decoding method and apparatus according to the present invention, when the width of the current block is greater than the height of the current block, the pixels of the current block are predicted as the average value of the upper reference pixels of the current block, and when the width of the current block is less than the height, the pixels of the current block are predicted as the average value of the left reference pixels of the current block.
[0058] In the video encoding / decoding method and apparatus according to the present invention, predicted pixels of a current block are corrected based on predetermined neighboring pixels and weights.
[0059] In the video encoding / decoding method and apparatus according to the present invention, a current block is divided into a plurality of sub-blocks based on predetermined division information, and intra prediction is performed in units of sub-blocks. DETAILED DESCRIPTION
[0060] The embodiments of the present disclosure will be described in detail with reference to the drawings in this specification so that those of ordinary skill in the art can easily implement the present disclosure. However, the present disclosure can be implemented in many different forms and should not be construed as being limited to the embodiments described herein. In order to clearly illustrate the present disclosure, parts not related to the description are omitted and similar parts are represented by similar reference numerals throughout the specification.
[0061] Throughout the specification, when a part is referred to as being “connected” to another part, this includes not only an example in which the two parts are directly connected but also an example in which the part is electrically connected to another part in between.
[0062] In addition, throughout the specification, when a part is referred to as “comprising” an element, it should be understood that the element may also include other elements rather than excluding other elements unless specifically stated otherwise.
[0063] In addition, various components may be described using terms such as first and second, but these components should not be limited by these terms. These terms are used only for the purpose of distinguishing one component from another.
[0064] In addition, in the embodiments of the devices and methods described herein, some components of the device or some steps of the method may be omitted. In addition, the order of some components of the device or the order of some steps of the method may be changed. In addition, other components may be inserted into some components of the device or other steps may be inserted into some steps of the method.
[0065] In addition, some components or steps of the first embodiment of the present disclosure may be added to the second embodiment of the present disclosure, or some components or steps of the second embodiment may be replaced.
[0066] In addition, the components shown in the embodiments of the present disclosure are independently shown to indicate different characteristic functions, and do not mean that each component is composed of a separate hardware or a software component unit. That is, for ease of description, each component is listed as a separate component, and at least two components in each component can be combined to form a component, or a component can be divided into multiple components to perform functions. Without departing from the essence of the present disclosure, the integrated implementation and independent implementation of each component in these components are also included in the scope of the present disclosure.
[0067] First, the terms used in the present application will be briefly described as follows.
[0068] The decoding device (Video Decoding Apparatus) to be described later can be a civilian security camera device, a civilian security system, a military security camera device, a military security system, a personal computer (PC), a notebook computer, a portable multimedia player (PMP), a wireless communication terminal, a smart phone, a device included in a server terminal such as a TV application server and a service server, and can represent various devices such as user terminals of various devices, communication devices such as communication modems for performing communication with wired / wireless communication networks, memories for storing various programs and data for decoding images or performing inter-frame prediction or intra-frame prediction for decoding, various devices equipped with a microprocessor for executing programs and calculations and controlling programs and calculations, etc.
[0069] In addition, the image encoded as a bit stream by the encoder can be sent to the image decoding device through a real-time or non-real-time wired / wireless communication network such as the Internet, a local wireless communication network, a wireless LAN network, a WiBro network, a mobile communication network, or through various communication interfaces such as cables, universal serial buses (USB), etc., and is decoded, reconstructed into an image and reproduced. Alternatively, the bit stream generated by the encoder can be stored in a memory. The memory can include both volatile memory and non-volatile memory. In this specification, the memory can be represented as a recording medium storing a bit stream.
[0070] Generally, a video may be composed of a series of pictures, and each picture may be divided into coding units such as blocks. In addition, a person having ordinary knowledge in the technical field to which the present embodiment belongs may understand that the term "picture" described below may be used by replacing the term "picture" with another term having an equivalent meaning, such as "image" or "frame". In addition, a person having ordinary knowledge in the technical field to which the present embodiment belongs may understand that the term "coding unit" may be replaced by other terms having the same meaning, such as "unit block" and "block", and used together with the other terms.
[0071] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In describing the present disclosure, redundant descriptions of the same components will be omitted.
[0072] Figure 1 is a block diagram illustrating an image encoding apparatus according to the present disclosure.
[0073] Reference Figure 1A conventional image encoding device (100) includes: a picture division unit (110), a prediction unit (120, 125), a transformation unit (130), a quantization unit (135), a rearrangement unit (160), an entropy coding unit (165), an inverse quantization unit (140), an inverse transformation unit (145), a filter unit (150) and a memory (155).
[0074] The picture division unit (110) may divide the input picture into at least one processing unit. In this case, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). Hereinafter, in the embodiments of the present disclosure, a coding unit may be used as a meaning of a unit for performing encoding, or may be used as a meaning of a unit for performing decoding. Figure 3 Describe the block partitioning method in detail.
[0075] The prediction unit may be obtained by being divided into at least one square or rectangular shape such as the same size within one coding unit. One of the prediction units divided within one coding unit may be obtained by being divided to have a shape and / or size different from another prediction unit. When generating a prediction unit for performing intra-frame prediction based on a coding unit, when the prediction unit is not a minimum coding unit, intra-frame prediction may be performed without being divided into a plurality of prediction units N×N.
[0076] The prediction unit (120, 125) may include an inter-frame prediction unit (120) that performs inter-frame prediction and an intra-frame prediction unit (125) that performs intra-frame prediction. It may be determined whether inter-frame prediction or intra-frame prediction is used for the prediction unit, and specific information according to each prediction method (e.g., intra-frame prediction mode, motion vector, reference picture, etc.) may be determined. The residual value (residual block) between the generated prediction block and the original block may be input to the transform unit (130). In addition, prediction mode information, motion vector information, etc. used for prediction may be encoded by the entropy encoding unit (165) together with the residual value and sent to the decoder.
[0077] The inter-frame prediction unit (120) can predict the prediction unit based on information of at least one of the previous picture or the subsequent picture of the current picture, and in some cases, can predict the prediction unit based on information of some areas in the current picture that have been encoded. The inter-frame prediction unit (120) can include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.
[0078] The reference picture interpolation unit may receive reference picture information from the memory (155) and generate pixel information of integer pixels or less pixels in the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with different filter coefficients (interpolation filter based on DCT) may be used to generate pixel information of integer pixels or less pixels in units of 1 / 4 pixels. In the case of chrominance signals, a 4-tap interpolation filter based on DCT with different filter coefficients (interpolation filter based on DCT) may be used to generate pixel information of integer pixels or less pixels in units of 1 / 8 pixels.
[0079] The motion prediction unit may perform motion prediction based on a reference picture interpolated by a reference picture interpolation unit. Various methods may be used as methods for calculating motion vectors, such as a full search-based block matching algorithm (FBMA), a three-step search (TSS), and a new three-step search algorithm (NTS). The motion vector may have a motion vector value in units of 1 / 2 or 1 / 4 pixels based on interpolated pixels. The motion prediction unit may predict the current prediction unit by using motion prediction methods differently. Various methods such as skip mode, merge mode, AMVP (Advanced Motion Vector Prediction) mode, intra-block copy mode, and affine mode may be used as motion prediction methods.
[0080] The intra prediction unit (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 performing inter-frame prediction and the reference pixel is a pixel performing inter-frame prediction, the reference pixel included in the block performing inter-frame prediction can be used by replacing the reference pixel included in the block performing inter-frame prediction with the reference pixel information of the block performing intra-frame prediction around the block performing inter-frame prediction. That is, when the reference pixel is unavailable, the unavailable reference pixel information can be used by replacing the unavailable reference pixel with at least one reference pixel among the available reference pixels. Figures 4 to 8 The intra prediction method is described in detail.
[0081] In addition, a residual block including residual information which is a difference between a prediction unit predicted based on the prediction unit generated by the prediction unit (120, 125) and an original block of the prediction unit may be generated. The generated residual block may be input to the transform unit (130).
[0082] The transform unit (130) may transform a residual block including residual information between a prediction unit generated by the prediction unit (120, 125) and an original block by using a transform method such as discrete cosine transform (DCT), discrete sine transform (DST) and KLT. Whether to apply DCT, DST or KLT to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.
[0083] The quantization unit (135) may quantize the value transformed into the frequency domain by the transformation unit (130). The quantization coefficient may vary according to the block or importance of the image. The value calculated by the quantization unit (135) may be provided to the inverse quantization unit (140) and the rearrangement unit (160).
[0084] The rearrangement unit (160) may perform rearrangement on the coefficient values of the quantized residual value.
[0085] The rearrangement unit (160) can change the coefficients in the two-dimensional block form into a one-dimensional vector form by a coefficient scanning method. For example, the rearrangement unit (160) can change into a one-dimensional vector form by scanning from the DC coefficient to the coefficients in the high-frequency region according to a zigzag scanning method. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning of the scanning coefficients in the two-dimensional block form in the column direction and horizontal scanning of the scanning coefficients in the two-dimensional block form in the row direction can be used instead of zigzag scanning. That is, it can be determined which one of zigzag scanning, vertical scanning and horizontal scanning is used according to the size of the transform unit and the intra-frame prediction mode.
[0086] The entropy coding unit (165) may perform entropy coding based on the value calculated by the rearrangement unit (160). Various coding methods, such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC) and Context-Adaptive Binary Arithmetic Coding (CABAC) may be used for entropy coding. In this regard, the entropy coding unit (165) may encode residual value coefficient information of the coding unit from the rearrangement unit (160) and the prediction unit (120, 125). In addition, according to the present disclosure, information indicating that motion information is derived and used on the decoder side and information about a method for deriving motion information may be signaled from the encoder.
[0087] The inverse quantization unit (140) inversely quantizes the value quantized by the quantization unit (135), and the inverse transform unit (145) inversely transforms the value transformed by the transform unit (130). A reconstructed block can be generated by combining the residual value generated by the inverse quantization unit (140) and the inverse transform unit 145 with the prediction unit predicted by the motion estimation unit, the motion compensation unit, and the intra-frame prediction unit included in the prediction unit (120, 125).
[0088] The filter unit (150) may include at least one of a deblocking filter, an offset modification unit, and an adaptive loop filter (ALF). The deblocking filter may remove block distortion caused by boundaries between blocks in a reconstructed picture. The offset modification unit may correct an offset relative to an original image in units of pixels for a deblocked filtered image. In order to perform offset modification on a specific picture, after classifying pixels included in the image into a certain number of regions and determining regions to which offsets are applied, a method of applying an offset to an offset region or a method of applying an offset by considering edge information of each pixel may be used. Adaptive loop filtering (ALF) may be performed based on a value obtained by comparing a filtered reconstructed image with an original image. After classifying pixels included in the image into predetermined groups, a filter to be applied to the group may be determined to perform filtering differently for each group.
[0089] The memory (155) can store the reconstructed block or the reconstructed picture output from the filter unit (150), and when performing inter-frame prediction, the stored reconstructed block or the reconstructed picture can be provided to the prediction unit (120, 125).
[0090] Figure 2 is a block diagram illustrating an image decoding apparatus according to the present disclosure.
[0091] Reference Figure 2 The image decoder (200) may include: an entropy decoding unit (210), a rearrangement unit (215), an inverse quantization unit (220), an inverse transform unit (225), a prediction unit (230, 235) and a filter unit (240), and a memory (245).
[0092] When an image bitstream is input from an image encoder, the input bitstream may be decoded in a process reverse to that of the image encoder.
[0093] The entropy decoding unit (210) may perform entropy decoding in a process opposite to the process performed by entropy encoding in the entropy encoding unit of the image encoder. For example, various methods corresponding to the methods performed in the image encoder, such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC), may be applied.
[0094] The entropy decoding unit 210 may decode information related to intra prediction and inter prediction performed by the encoder.
[0095] The rearrangement unit 215 may perform rearrangement on the bitstream entropy-decoded by the entropy decoding unit 210 based on the rearrangement method of the encoding unit. The coefficients in the one-dimensional vector form may be rearranged again into coefficients in the two-dimensional block form.
[0096] The inverse quantization unit (220) may perform inverse quantization based on the quantization parameter provided by the encoder and the coefficients of the rearranged block.
[0097] The inverse transform unit (225) can perform inverse transforms corresponding to the transforms performed by the transform unit, i.e., DCT, DST, and KLT, on the quantization result performed by the image encoder, i.e., inverse DCT, inverse DST, and inverse KLT. The inverse transform can be performed based on the transmission unit determined by the image encoder. In the inverse transform unit 225 of the image decoder, the transform type (e.g., DCT, DST, KLT) can be selectively performed according to multiple pieces of information such as a prediction method, a size of a current block, and a prediction direction.
[0098] The prediction unit (230, 235) may generate a prediction block based on information related to prediction block generation provided by the entropy decoding unit (210) and previously decoded block or picture information provided by the memory (245).
[0099] As described above, when the size of the prediction unit is the same as the size of the transform unit when performing intra prediction in the same manner as in the image encoder, intra prediction of the prediction unit can be performed based on pixels located on the left, upper left, and upper sides of the prediction unit. However, when the size of the prediction unit is different from the size of the transform unit when performing intra prediction, intra prediction can be performed using reference pixels based on the transform unit. In addition, intra prediction using N×N partitioning can be used only for the minimum coding unit.
[0100] The prediction unit (230, 235) may include at least one of a prediction unit determination unit, an inter prediction unit, and an intra prediction unit. The prediction unit determination unit may receive various information from the entropy decoding unit (210), such as prediction unit information, prediction mode information of an intra prediction method, and motion prediction related information of an inter prediction method, classify the prediction unit according to the current coding unit, and determine whether the prediction unit performs inter prediction or intra prediction. On the other hand, if motion prediction related information for inter prediction is not transmitted, but information indicating that motion information is derived and used on the decoder side and information about a method for deriving motion information is transmitted from the encoder (100), the prediction unit determination unit determines the prediction performance of the inter prediction unit (230) based on the information transmitted from the encoder (100).
[0101] The inter prediction unit (230) can perform inter prediction on the current prediction unit based on information included in at least one of a previous picture or a subsequent picture of the current picture including the current prediction unit by using information required for inter prediction of the current prediction unit provided by the image encoder. In order to perform inter prediction, it can be determined whether the motion prediction method of the prediction unit included in the coding unit is a skip mode, a merge mode, an AMVP mode, an intra block copy mode, or an affine mode.
[0102] The intra prediction unit (235) may generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit that has performed intra prediction, intra prediction may be performed based on intra prediction mode information of the prediction unit provided by the image encoder.
[0103] The intra prediction unit (235) may include an adaptive intra smoothing (Adaptive IntraSmoothing, AIS) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter is a part that performs filtering on the reference pixels of the current block, and the AIS filter can be applied by determining whether to apply the AIS filter according to the prediction mode of the current prediction unit. The AIS filter can be performed on the reference pixels of the current block by using the AIS filter information and the prediction mode of the prediction unit provided by the image encoder. In the case where the prediction mode of the current block is a mode in which the AIS filter is not performed, the AIS filter may not be applied.
[0104] In the case where the prediction mode of the prediction unit is a prediction unit that performs intra-frame prediction based on pixel values obtained by interpolating reference pixels, the reference pixel interpolation unit may interpolate the reference pixels to generate reference pixels of integer pixels or less. In the case where the prediction mode of the current prediction unit is a prediction mode that generates a prediction block without interpolating reference pixels, the reference pixels may not be interpolated. In the case where the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering. Figures 4 to 8 The intra prediction method is described in detail.
[0105] The reconstructed block or the reconstructed picture may be provided to the filter unit (240). The filter unit (240) may include a deblocking filter, an offset modification unit, and an ALF.
[0106] Information about whether to apply a deblocking filter to a corresponding block or picture and information about whether to apply a strong filter or a weak filter when applying the deblocking filter can be provided from the video encoder. In the deblocking filter of the video decoder, information related to the deblocking filter provided by the video encoder can be provided, and the video decoder can perform deblocking filtering on the corresponding block.
[0107] The offset modification unit may perform offset modification on the reconstructed image based on the type of offset modification applied to the image during encoding and the offset value information. ALF may be applied to the coding unit based on information provided by the encoder about whether ALF is applied, ALF coefficient information, etc. The ALF information may be provided from a specific parameter set.
[0108] The memory (245) can store the reconstructed picture or the reconstructed block so that the reconstructed picture or the reconstructed block can be used as a reference picture or a reference block, and can also provide the reconstructed picture to the output unit.
[0109] Figure 3 is a diagram illustrating concepts of a multi-tree (MTT) block structure generated according to binary partitioning and ternary partitioning, a partition type, and a partition block index according to an embodiment of the present invention.
[0110] When there is a block (310) divided using MTT block partitioning according to an embodiment, the corresponding block (310) can be divided into four square blocks using quadtree block partitioning. In addition, in MTT block partitioning, binary block partitioning or ternary block partitioning can start from a leaf node of a quadtree generated by quadtree block partitioning.
[0111] exist Figure 3, the first quadtree partition block of the highest block (310) shows an embodiment in which ternary block partition (312, 313) in the horizontal direction is performed starting from the leaf node of the quadtree, and the widths of the three blocks partitioned by performing the ternary block partition (312, 313) in the horizontal direction have the same size N. The heights of the three blocks partitioned by performing the ternary block partition (312, 313) are N / 4, N / 2, and N / 4.
[0112] The second quadtree partition block of the highest block (310) shows an embodiment in which a binary block partition 314 is performed in the horizontal direction starting from a leaf node of the quadtree, and a ternary block partition (315, 316) is performed again in the vertical direction for the first binary partition block of the two binary partition blocks partitioned by performing the binary block partition (314) in the horizontal direction. The heights of the three blocks partitioned by performing the ternary block partition (315, 316) in the vertical direction have the same size M, and the widths of the three partitioned blocks are M / 4, M / 2, and M / 4.
[0113] Figure 3 The reference numeral (330) shows the partition type (partition type) according to the direction of the binary block partition and the trifurcated block partition. The partition type can be used interchangeably with terms such as binary and trifurcated partition directions, binary and trifurcated partition shapes, and binary and trifurcated partition types. 0 and 1 can be used to indicate that a block is partitioned in one of the horizontal direction and the vertical direction. In one embodiment, the block partition in the vertical direction is indicated by 1, and the block partition in the horizontal direction is indicated by 0.
[0114] Figure 3 Reference numeral (350) shows a partition index (partition index) for a binary partition block and a ternary partition block. The binary partition index and the ternary partition index can be represented by 0, 1, and 2 according to the encoding order of two partition blocks generated by binary partitioning of a higher block. Figure 3 The figure mark (350) shows the following implementation based on the binary partition index: wherein, in the two partition blocks that are binary divided, the first binary partition block is represented by index 0, and the second binary partition block is represented by index 1, and shows the following implementation based on the trifurcated partition index: wherein, in the three partition blocks that are trifurcated, the first trifurcated partition block is represented by index 0, the second trifurcated partition block is represented by index 1, and the third trifurcated partition block is represented by index 2.
[0115] Figure 4 An intra prediction mode predefined in an encoding / decoding apparatus according to an embodiment to which the present invention is applied is shown.
[0116] Reference Figure 4, the predefined intra-frame prediction modes may include two non-directional modes and 65 directional modes. The non-directional modes may include a planar mode and a DC mode. The directional modes may be defined as Mode 2 to Mode 66 having a predetermined angle. In particular, Mode 2, Mode 34, and Mode 66 may be defined as diagonal modes. The intra-frame prediction modes between Mode 2 and Mode 34 may be defined as modes having horizontal directivity, and the intra-frame prediction modes between Mode 34 and Mode 66 may be defined as modes having vertical directivity. In addition, depending on the shape of the block, a mode smaller than Mode 2 or a mode larger than Mode 66 may be used, which will refer to Figure 5 Detailed description.
[0117] in addition, Figure 4 The intra-frame prediction mode is only an example, and less than 67 intra-frame prediction modes may be defined, and conversely, more than 67 intra-frame prediction modes may be defined. Alternatively, the number of modes with horizontal directivity and the number of modes with vertical directivity may be different from each other according to block attributes. In the present invention, for ease of explanation, 67 intra-frame prediction modes are defined, and it is assumed that the number of modes with horizontal directivity and the number of modes with vertical directivity are the same.
[0118] Figure 5 An intra prediction method according to an embodiment to which the present invention is applied is shown.
[0119] Reference Figure 5 , the intra prediction mode of the current block can be obtained (S500).
[0120] The current block may use a default mode predefined in the image encoding / decoding device. The default mode may be a directional mode or a non-directional mode. For example, the directional mode may include at least one of a vertical mode, a horizontal mode, and a diagonal mode. The non-directional mode may include at least one of a plane mode and a DC mode. When it is determined that the current block uses the default mode, the intra-frame prediction mode of the current block may be set to the default mode. The number of predefined default modes may be 1, 2, 3 or more. When multiple default modes are defined, an index specifying any one of the multiple default modes may be sent by a signal. The default mode corresponding to the index sent by the signal may be set as the intra-frame prediction mode of the current block.
[0121] Alternatively, the intra prediction mode of the current block can be derived based on a candidate list including multiple MPM candidates. First, a predetermined MPM candidate can be selected from the above-mentioned predefined intra prediction modes. However, when the current block does not use the default mode, the MPM candidate can be selected from the remaining modes other than the default mode in the predefined intra prediction modes. The number of MPM candidates can be 3, 4, 5, 6 or more. The MPM candidate can be derived based on the intra prediction mode of a neighboring block adjacent to the current block. The neighboring block can be a block adjacent to at least one of the left side, top side, upper left side, lower left side or upper right side of the current block.
[0122] Specifically, the MPM candidate may be determined by considering whether the intra prediction mode (candIntraPredModeA) of the left block and the intra prediction mode (candIntraPredModeB) of the upper block are the same and whether candIntraPredModeA and candIntraPredModeB are non-directional modes.
[0123] For example, when candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is not a non-directional mode, the MPM candidates for the current block may include at least one of candIntraPredModeA, (candIntraPredModeA-n), (candIntraPredModeA+n), or a non-directional mode. Here, n may be an integer of 1, 2 or more. The non-directional mode may include at least one of a planar mode and a DC mode. As an example, the MPM candidates for the current block may be determined as shown in Table 1 below. The indexes of Table 1 specify the position or priority of the MPM candidates, but are not limited thereto. For example, index 1 may be assigned to the DC mode, or index 4 may be assigned to the DC mode.
[0124] [Table 1]
[0125]
[0126]
[0127] Alternatively, when candIntraPredModeA is different from candIntraPredModeB and both candIntraPredModeA and candIntraPredModeB are not non-directional modes, the MPM candidates of the current block may include at least one of candIntraPredModeA, candIntraPredModeB, (maxAB-n), (maxAB+n), (minAB-n), (minAB+n), or non-directional modes. Here, maxAB and minAB represent the maximum and minimum values of candIntraPredModeA and candIntraPredModeB, respectively, and n may be an integer of 1, 2 or more. The non-directional mode may include at least one of a planar mode and a DC mode. As an example, the MPM candidates of the current block may be determined as shown in Table 2 below. The index of Table 2 specifies the position or priority of the MPM candidates, but is not limited thereto. For example, the maximum index may be assigned to the DC mode.
[0128] Meanwhile, the MPM candidates may be determined differently based on the difference between candIntraPredModeA and candIntraPredModeB. For example, when the difference between candIntraPredModeA and candIntraPredModeB belongs to a predetermined threshold range, MPM candidate 1 of Table 2 may be applied, otherwise, MPM candidate 2 may be applied. Here, the threshold range may represent a range greater than or equal to 2 and less than or equal to 62. Alternatively, when the difference between candIntraPredModeA and candIntraPredModeB does not belong to the threshold range, one of the MPM candidates may be derived based on maxAB, and another MPM candidate may be derived based on minAB. For example, one of the MPM candidates may be derived by adding 1 to maxAB, and another MPM candidate may be derived by subtracting 1 from minAB.
[0129] [Table 2]
[0130] index MPM Candidate 1 MPM Candidate 2 0 candIntraPredModeA candIntraPredModeA 1 candIntraPredModeB candIntraPredModeB 2 INTRA_DC INTRA_DC 3 2+((maxAB+61)%64) 2+((maxAB+60)%64) 4 2+((maxAB-1)%64) 2+((maxAB)%64)
[0131] Alternatively, when candIntraPredModeA is different from candIntraPredModeB and only one of candIntraPredModeA and candIntraPredModeB is a non-directional mode, the MPM candidate of the current block may include at least one of maxAB, (maxAB-n), (maxAB+n), or a non-directional mode. Here, maxAB represents the maximum value of candIntraPredModeA and candIntraPredModeB, and n may be an integer of 1, 2 or more. The non-directional mode may include at least one of a planar mode and a DC mode. As an example, the MPM candidate of the current block may be determined as shown in Table 3 below. The index of Table 3 specifies the position or priority of the MPM candidate, but is not limited thereto. For example, index 0 may be assigned to the DC mode, and index 1 may be assigned to maxAB.
[0132] [Table 3]
[0133] index MPM Candidate 0 maxAB 1 INTRA_DC 2 2+((maxAB+61)%64) 3 2+((maxAB-1)%64) 4 2+((maxAB+60)%64)
[0134] Alternatively, when candIntraPredModeA is different from candIntraPredModeB and both candIntraPredModeA and candIntraPredModeB are non-directional, the MPM candidate of the current block may include at least one of a non-directional mode, a vertical mode, a horizontal mode, (vertical mode-m), (vertical mode+m), (horizontal mode-m) or (horizontal mode+m). Here, m may be an integer of 1, 2, 3, 4 or more. The non-directional mode may include at least one of a planar mode and a DC mode. As an example, the MPM candidate of the current block may be determined as shown in Table 4 below. The index of Table 4 specifies the position or priority of the MPM candidate, but is not limited thereto. For example, index 1 or the maximum index may be assigned to the horizontal mode. In addition, the MPM candidate may include at least one of a diagonal mode (e.g., mode 2, mode 34, mode 66), (diagonal mode-m) or (diagonal mode+m).
[0135] [Table 4]
[0136]
[0137]
[0138] Alternatively, the MPM candidates may be derived based on table information predefined in the encoding / decoding device. The table information may define MPM candidates for each size of the current block and / or adjacent blocks. Here, the number of MPM candidates may be 3, 4, 5 or more. For example, the table information of the present invention may be defined as follows.
[0139] [Table 5]
[0140]
[0141] In Table 5, sizeId is an identifier indicating the size of the current block and / or the adjacent block, and the candidate mode x indicates the MPM candidate defined for each sizeId. When the size is 4×4, sizeId may be determined as 0. When the size is greater than 4×4 and less than or equal to 8×8, sizeId may be determined as 1. Otherwise, sizeId may be determined as 2.
[0142] Specifically, when the intra prediction mode of the left / upper neighboring block is not available, considering the sizeId defined in Table 5, it can be concluded that the MPM candidate is the candidate mode x (x=0, 1, 2).
[0143] Alternatively, when the intra prediction modes of the left / upper neighboring blocks are the same (or any of the intra prediction modes of the left / upper neighboring blocks are not available), the MPM candidate may include the intra prediction mode of the left / upper neighboring block and any one of the k of the above-mentioned candidate mode x. Here, k may be an integer of 1, 2, 3, 4 or more. In candidate mode x, k may be added to the candidate list in consideration of a predetermined priority. The priority is determined based on the x value shown in Table 5. For example, the smaller the x value, the higher the priority. However, k may be added only when the k of candidate mode x is different from the pre-added MPM candidate. For example, when k is 2, the modes corresponding to candidate mode 0 and candidate mode 1 having a high priority may be added as MPM candidates. However, when candidate mode 0 is the same as the pre-added MPM candidate, the modes corresponding to candidate mode 1 and candidate mode 2 may be added as MPM candidates. Alternatively, when candidate mode 1 is the same as the pre-added MPM candidate, the modes corresponding to candidate mode 0 and candidate mode 2 may be added as MPM candidates.
[0144] Alternatively, when the intra prediction modes of the left / upper neighboring blocks are different, the MPM candidates may include at least one of the intra prediction mode of the left neighboring block, the intra prediction mode of the upper neighboring block, or at least one of the candidate modes x in Table 5 above. In this case, k priority modes among the candidate modes x may be added to the candidate list. Similarly, among the candidate modes x, the same mode as the MPM candidate pre-added to the candidate list may be restricted so that it is not added to the candidate list.
[0145] Meanwhile, in the above-mentioned embodiment, the intra prediction mode of the adjacent block is added to the candidate list, but is not limited thereto. For example, as shown in Table 6, the mode mapped to the intra prediction mode of the adjacent block may be added to the candidate list. In this case, the intra prediction mode of the adjacent block may be restricted so that it is not added to the candidate list. Table 6 is a table predefined in the encoding / decoding device, and may define a mode mapped to the intra prediction mode (IntraPredModeY[xNbX][yNbX]) of the adjacent block according to the size (sizeId) of the current block and / or the adjacent block.
[0146] [Table 6]
[0147]
[0148]
[0149] Among the above-mentioned multiple MPM candidates, the MPM candidate specified by the MPM index may be set as the intra prediction mode of the current block. The MPM index may be encoded by the image encoding device and transmitted by a signal.
[0150] As described above, the intra-frame prediction mode can be derived by selectively using the default mode or the MPM candidate. The selection can be performed based on a first flag sent by the encoding device with a signal. In this case, the first flag can indicate whether the intra-frame prediction mode of the current block is set to the default mode. If the flag is a first value, the intra-frame prediction mode of the current block is set to the default mode, otherwise, information such as a second flag indicating whether the intra-frame prediction mode of the current block is derived from the MPM candidate, an MPM index, etc. can be sent with a signal.
[0151] Alternatively, the second flag may be signaled before the first flag. For example, when the intra prediction mode of the current block is derived from the MPM candidates according to the second flag, the first flag may be signaled. If the first flag signaled is a first value, the intra prediction mode of the current block is set to a default mode, otherwise, the MPM index may be signaled. Alternatively, if the intra prediction mode of the current block is derived from the MPM candidates according to the second flag, the MPM index may be signaled, otherwise, the first flag may be signaled.
[0152] The intra prediction mode (IntraPredMode) decoded through the above-described process may be changed based on a predetermined offset.
[0153] The application of the offset may be selectively performed based on at least one of block properties, ie, size, shape, partition information, partition depth, value of intra prediction mode, or component type.Here, the block may refer to a current block and / or a block adjacent to the current block.
[0154] The partition information may include at least one of first information indicating whether the current block is divided into a plurality of sub-blocks, second information indicating a partition direction (e.g., horizontal or vertical), or third information related to the number of partitioned sub-blocks. The partition information may be encoded by an encoding device and transmitted by a signal. Alternatively, some of the partition information may be variably determined by a decoding device based on the above-mentioned block attributes, or some of the partition information may be set to a fixed value predefined in the encoding / decoding device.
[0155] For example, if the first information is a first value, the current block is divided into a plurality of sub-blocks, otherwise, the current block may not be divided into a plurality of sub-blocks (NO_SPLIT). When the current block is divided into a plurality of sub-blocks, the current block may be horizontally divided (HOR_SPLIT) or vertically divided (VER_SPLIT) based on the second information. In this case, the current block may be divided into k sub-blocks. Here, k may be an integer of 2, 3, 4 or more. Alternatively, k may be limited to powers of 2, such as 1, 2, 4, etc. Alternatively, in the case of a block in which at least one of the width or height of the current block is 4 (e.g., 4×8, 8×4), k is set to 2, otherwise, k may be set to 4, 8, or 16. When the current block is not divided (NO_SPLIT), k may be set to 1.
[0156] The current block may be divided into sub-blocks having the same width and height, or may be divided into sub-blocks having different widths and heights. The current block may be divided into N×M block units (e.g., 2×2, 2×4, 4×4, 8×4, 8×8, etc.) pre-submitted to the encoding / decoding apparatus, regardless of the attributes of the above blocks.
[0157] The offset may be applied only when the size of the current block is less than or equal to a predetermined threshold value T1. Here, the threshold value T1 may represent the maximum block size to which the offset is applied. Alternatively, the offset may be applied only when the size of the current block is greater than or equal to a predetermined threshold value T2. In this case, the threshold value T2 may represent the minimum block size to which the offset is applied. The threshold value may be signaled via a bitstream. Alternatively, the threshold value may be variably determined by the decoding device based on at least one of the above-mentioned block attributes, or the threshold value may be a fixed value submitted in advance to the encoding / decoding device.
[0158] Alternatively, the offset may be applied only when the shape of the current block is non-square. For example, a predetermined offset (eg, 65) may be added to the IntraPredMode of the current block when the following conditions are met.
[0159] nW is greater than nH
[0160] IntraPredMode is greater than or equal to 2
[0161] IntraPredMode is less than (whRatio>1)? (8+2*whRatio):8
[0162] Here, nW and nH represent the width and height of the current block, respectively, and whRatio may be set to Abs(Log2(nW / nH)).
[0163] Alternatively, when the following conditions are met, a predetermined offset (eg, 67) may be subtracted from the IntraPredMode of the current block.
[0164] nH is greater than nW
[0165] IntraPredMode is greater than or equal to 66
[0166] IntraPredMode is less than (whRatio>1)? (60-2*whRatio):60
[0167] As described above, the final intra prediction mode can be determined by adding / subtracting the offset from the intra prediction mode (IntraPredMode) of the current block in consideration of the properties of the current block. However, the present invention is not limited thereto, and the application of the offset can be performed in the same / similar manner in consideration of the properties of the sub-blocks belonging to the current block, and its detailed description will be omitted.
[0168] Reference Figure 5 , reference pixels for intra prediction of a current block may be configured ( S510 ).
[0169] The reference pixel may belong to at least one of a plurality of pixel rows adjacent to the current block. Here, the plurality of pixel rows may include at least one of a first pixel row adjacent to the current block, a second pixel row adjacent to the first pixel row, a third pixel row adjacent to the second pixel row, or a fourth pixel row adjacent to the third pixel row.
[0170] For example, the plurality of pixel rows may include all of the first pixel row to the fourth pixel row, or may include only the remaining pixel rows except the third pixel row. Alternatively, the plurality of pixel rows may include only the first pixel row and the fourth pixel row.
[0171] The current block may perform intra prediction by selecting any one of a plurality of pixel rows. The selection may be performed based on an index (refIdx) signaled by the encoding device. Alternatively, one of the plurality of pixel rows may be selectively used based on a size, shape, partition type, whether the intra prediction mode is a non-directional mode, an angle of the intra prediction mode, a component type, etc. related to the current block.
[0172] For example, when the intra prediction mode is a plane mode or a DC mode, only the first pixel row may be used. Alternatively, when the size (width or height) of the current block is less than or equal to a predetermined threshold, only the first pixel row may be used. Alternatively, when the intra prediction mode is greater than a predetermined threshold angle (or less than a predetermined threshold angle), only the first pixel row may be used. The threshold angle may be an angle of an intra prediction mode corresponding to mode 2 or mode 66 in the above-mentioned predefined intra prediction modes.
[0173] At the same time, Figure 3 In the block structure of the current block, the reference pixels used for intra prediction can be configured according to the width and height of the current block. For example, the reference pixels may include at least one of the upper left pixel (PTL), upper pixel (PT), upper right pixel (PTR), left pixel (PL), or lower left pixel (PLB) of the current block. Here, the number of upper pixels PT and upper right pixels PTR may be equal to the sum of the width (nCbW) and height (nCbH) of the current block, or may be equal to the width (nCbW)*2 of the current block. The number of left pixels PL and lower left pixels PLB may be equal to the sum of the width (nCbW) and height (nCbH) of the current block, or may be equal to the height (nCbH)*2 of the current block.
[0174] Filtering may be performed on the configured reference pixels. Filtering may be selectively performed based on a predetermined flag. Here, the flag may indicate whether filtering is performed on the reference pixels used for intra prediction. The flag may be encoded by an encoding device and sent with a signal. Alternatively, the flag may be derived from a decoding device based on encoding parameters of the current block. The encoding parameters may include at least one of the position / area of the reference pixels, the block size, the component type, whether intra prediction in units of subblocks is applied, or an intra prediction mode.
[0175] For example, if the reference pixels of the current block are the first pixel row adjacent to the current block, filtering may be performed on the reference pixels; otherwise, filtering may not be performed on the reference pixels. Alternatively, when the number of pixels belonging to the current block is greater than a predetermined threshold number, filtering may be performed on the reference pixels; otherwise, filtering may not be performed on the reference pixels. The threshold number is a value pre-submitted to the encoding / decoding device and may be an integer such as 16, 32, 64 or greater. Alternatively, if the current block is a luminance component, filtering may be performed on the reference pixels; otherwise, filtering may not be performed on the reference pixels. Alternatively, if the current block does not perform the above-mentioned intra prediction in units of sub-blocks (i.e., the current block is not divided into multiple sub-blocks), filtering may be performed on the reference pixels; otherwise, filtering may not be performed on the reference pixels. Alternatively, if the intra prediction mode of the current block is a non-directional mode or a predetermined directional mode, filtering may be performed on the reference pixels; otherwise, filtering may not be performed on the reference pixels. Here, the non-directional mode may be a planar mode or a DC mode. However, in the DC mode of the non-directional mode, it may be restricted such that filtering of the reference pixels is not performed. The directional mode may represent an intra prediction mode of reference integer pixels. For example, the directional mode may include at least one of the intra prediction modes corresponding to the modes -14, -12, -10, -6, 2, 18, 34, 50, 66, 72, 78 and 80 shown in Figure 4 However, the directional mode may be restricted such that it does not include the horizontal mode and the vertical mode corresponding to mode 18 and mode 50, respectively.
[0176] When filtering is performed on the reference pixels according to this flag, filtering may be performed based on a filter predefined in the encoding / decoding device. The number of filter taps may be 1, 2, 3, 4, 5 or more. The number of filter taps may be variably determined according to the position of the reference pixels. For example, a 1-tap filter may be applied to the reference pixels corresponding to at least one of the lowermost, uppermost, leftmost or rightmost of the pixel rows, and a 3-tap filter may be applied to the remaining reference pixels.
[0177] Similarly, the filtering intensity may be variably determined according to the position of the reference pixels. For example, the filtering intensity s1 may be applied to the reference pixels corresponding to at least one of the lowermost, uppermost, leftmost or rightmost of the pixel rows, and the filtering intensity s2 may be applied to the remaining reference pixels (s1 < s2). The filtering intensity may be signaled by the encoding device or may be determined based on the above-mentioned encoding parameters.
[0178] When an n-tap filter is applied to a reference pixel, the filter may be applied to the current reference pixel and (n-1) adjacent reference pixels. The adjacent reference pixel may represent a pixel located in at least one of the upper, lower, left, or right sides of the current reference pixel. The adjacent reference pixel may belong to the same pixel row as the current reference pixel, and some of the adjacent reference pixels may belong to a different pixel row from the current reference pixel. For example, when the current reference pixel is located on the left side of the current block, the adjacent reference pixel may be a pixel adjacent to at least one of the upper or lower sides of the current reference pixel. Alternatively, when the current reference pixel is located above the current block, the adjacent reference pixel may be a pixel adjacent to at least one of the left or right sides of the current reference pixel. Alternatively, when the current reference pixel is located in the upper left of the current block, the adjacent reference pixel may be a pixel adjacent to at least one of the lower or right sides of the current reference pixel. The ratio between the filter coefficients may be [1:2:1], [1:3:1], or [1:4:1].
[0179] Reference Figure 5 , intra prediction of the current block may be performed based on the intra prediction mode and the reference pixels (S520).
[0180] Specifically, the pixels of the current block may be predicted based on reference pixels according to the intra prediction mode among the configured reference pixels.
[0181] If the intra prediction mode of the current block is the DC mode, the pixels of the current block may be predicted as an average value of the reference pixels. Here, the reference pixels may include at least one of the reference pixels adjacent to the left side of the current block or the reference pixels adjacent to the upper side of the current block. The range of the reference pixels for the DC mode may be determined in consideration of the size / shape of the current block.
[0182] For example, when the width and height of the current block are the same, the pixels of the current block can be predicted by the average value of the reference pixels adjacent to the left side of the current block (hereinafter, referred to as the left reference pixels) and the reference pixels adjacent to the upper side (hereinafter, referred to as the upper reference pixels). However, when the width of the current block is greater than the height, the pixels of the current block can be predicted as the average value of the upper reference pixels of the current block. When the height of the current block is greater than the width, the pixels of the current block can be predicted as the average value of the left reference pixels of the current block.
[0183] The left / upper reference pixel may belong to at least one of the first pixel row to the fourth pixel row. In this case, the left reference pixel may consist only of pixels having the same y coordinate as the pixels of the current block in the pixel row. The upper reference pixel may consist only of pixels having the same x coordinate as the pixels of the current block in the pixel row. For example, assuming that the position of the upper left sample of the current block is (xCb, yCb), and the width and height of the current block are nCbW and nCbH, respectively. When the left / upper reference pixel belongs to the second pixel row, the left reference pixel is set to (xL, yL), where xL is (xCb-2), and yL is yCb, (yCb+1), ..., (yCb+nCbH-1). The upper reference pixel is set to (xT, yT), where xT is xCb, (xCb+1), ..., (xCb+nCbW-1), and yT is (yCb-2). Similarly, when the left / upper reference pixel belongs to the fourth pixel row, the left reference pixel is set to (xL, yL), where xL is (xCb-4), and yL is yCb, (yCb+1), ..., (yCb+nCbH-1). The upper reference pixel is set to (xT, yT), where xT is xCb, (xCb+1), ..., (xCb+nCbW-1), and yT is (yCb-4). In this way, pixels having x and y coordinates less than the position (xCb, yCb) of the upper left pixel of the current block in the pixel row used for intra prediction of the current block can be restricted so as not to be referenced.
[0184] Alternatively, when the width of the current block is greater than the height, the pixels of the current block may be predicted as an average value of at least one of the reference pixels adjacent to the upper side of the current block or the reference pixels adjacent to the upper right. In this case, all or some of the upper adjacent reference pixels may be used, and all or some of the upper right adjacent reference pixels may be used. When the height of the current block is greater than the width, the pixels of the current block may be predicted as an average value of at least one of the reference pixels adjacent to the left side of the current block or the reference pixels adjacent to the lower left of the current block. Similarly, all or some of the left reference pixels may be used, and all or some of the lower left reference pixels may be used. Figures 6 to 8 The range of reference pixels used for the DC mode is described in detail.
[0185] Intra-frame prediction may be performed in units of a current block (e.g., a coding block, a prediction block, a transform block, etc.), or may be performed in units of predetermined sub-blocks. To this end, first information indicating whether the current block is divided into sub-blocks and intra-frame prediction is performed may be used. The first information may be encoded by an encoding device and sent with a signal. If the first information is a first value, the current block is divided into a plurality of sub-blocks, otherwise, the current block is not divided into a plurality of sub-blocks. In this article, the division may be in Figure 3 The additional partitioning is performed after the tree structure-based partitioning described in . That is, the current block may represent a coding block that is no longer partitioned into smaller coding blocks based on the tree structure.
[0186] The subblocks belonging to the current block share one intra prediction mode, but different reference pixels can be configured for each subblock. Alternatively, the subblocks can use the same intra prediction mode and reference pixels. Alternatively, the subblocks can use the same reference pixels, but different intra prediction modes can be used for each subblock.
[0187] The division may be performed in a vertical or horizontal direction. The division direction may be determined based on second information signaled by the encoding device. For example, if the second information is a first value, the division may be performed in the horizontal direction, otherwise, the division may be performed in the vertical direction. Alternatively, the division direction may be determined based on the size of the current block. For example, when the height of the current block is greater than a predetermined threshold size, the division is performed in the horizontal direction, and when the width of the current block is greater than a predetermined threshold size, the division may be performed in the vertical direction. Here, the threshold size may be a fixed value predefined in the encoding / decoding device, or may be determined based on information about the block size (e.g., the size of the maximum transform block, the size of the maximum coding block, etc.). Information about the block size may be signaled at at least one level in a sequence, picture, slice, tile, brick, or CTU row.
[0188] The current block may be divided into k sub-blocks, and k may be an integer of 2, 3, 4 or more. Alternatively, k may be limited to powers of 2, such as 1, 2, 4, etc. The number of sub-blocks may be variably determined based on the size, shape, partition depth, and intra prediction mode of the current block. For example, when the current block is 4×8 or 8×4, the current block may be divided into two sub-blocks. Alternatively, when the current block is greater than or equal to 8×8, the current block may be divided into four sub-blocks.
[0189] The prediction block of the current block can be generated by the above intra prediction. The prediction block can be corrected based on predetermined adjacent pixels and weights. Here, the adjacent pixels and weights can be determined according to the position of the pixel in the current block to be corrected (hereinafter, referred to as the current pixel). Similarly, the adjacent pixels and weights can be determined according to the intra prediction mode of the current block.
[0190] For example, when the intra prediction mode of the current block is a non-directional mode, the neighboring pixels (refL, refT) of the current pixel may belong to the first pixel row adjacent to the current block and may be located on the same horizontal / vertical row as the current pixel. The weight may include at least one of a first weight wL in the x-axis direction, a second weight wT in the y-axis direction, or a third weight wTL in the diagonal direction. The first weight may represent a weight applied to the left neighboring pixel, the second weight may represent a weight applied to the upper neighboring pixel, and the third weight may represent a weight applied to the upper left neighboring pixel. Here, the first weight and the second weight may be determined based on the position information of the current pixel and a predetermined scaling factor nScale. The scaling factor may be determined based on the width (nCbW) and height (nCbH) of the current block. For example, the first weight wL[x] of the current pixel (predSample[x][y]) may be determined as (32>>((x<<1)>>nScale)), and the second weight wT[x] may be determined as (32>>((y<<1)>>nScale)). The third weight wTL[x][y] may be determined as ((wL[x]>>4)+(wT[y]>>4)). However, when the intra prediction mode is the planar mode, the third weight may be determined as 0. The scaling factor may be set to ((Log2(nCbW)+Log2(nCbH)-2)>>2).
[0191] When the intra prediction mode of the current block is a vertical / horizontal mode, the neighboring pixels (refL, refT) of the current pixel may belong to the first pixel row adjacent to the current block and may be located on the same horizontal / vertical row as the current pixel. In the vertical mode, the first weight wL[x] of the current pixel (predSample[x][y]) may be determined as (32>>((x<<1)>>nScale)), and the second weight (wT[y]) may be determined as 0, and the third weight wTL[x][y] may be determined to be equal to the first weight. At the same time, in the horizontal mode, the first weight wL[x] of the current pixel (predSample[x][y]) may be determined as 0, and the second weight wT[y] may be determined as (32>>((y<<1)>>nScale)), and the third weight wTL[x][y] may be determined to be equal to the second weight.
[0192] When the intra prediction mode of the current block is a diagonal mode, the neighboring pixels (refL, refT) of the current pixel may belong to the first pixel row adjacent to the current block and may be located on the same diagonal as the current pixel. Here, the diagonal has the same angle as the intra prediction mode of the current block. The diagonal may represent a diagonal from the lower left to the upper right, or may represent a diagonal from the upper left to the lower right. In this case, the first weight wL[x] of the current pixel (predSample[x][y]) may be determined as (32>>((x<<1)>>nScale)), the second weight wT[y] may be determined as (32>>((y<<1)>>nScale)), and the third weight wTL[x][y] may be determined as 0.
[0193] When the intra prediction mode of the current block is equal to or less than mode 10, the neighboring pixels (refL, refT) of the current pixel may belong to the first pixel row adjacent to the current block and may be located on the same diagonal as the current pixel. Here, the diagonal has the same angle as the intra prediction mode of the current block. In this case, the neighboring pixels may be restricted so that only one of the left neighboring pixels or the upper neighboring pixels of the current block is used. The first weight wL[x] of the current pixel (predSample[x][y]) may be determined to be 0, the second weight wT[y] may be determined to be (32>>((y<<1)>>nScale)), and the third weight wTL[x][y] may be determined to be 0.
[0194] When the intra prediction mode of the current block is equal to or greater than mode 58, the neighboring pixels (refL, refT) of the current pixel may belong to the first pixel row adjacent to the current block and may be located on the same diagonal as the current pixel. Here, the diagonal has the same angle as the intra prediction mode of the current block. In this case, the neighboring pixels may be restricted so that only one of the left neighboring pixels or the upper neighboring pixels of the current block is used. The first weight wL[x] of the current pixel (predSample[x][y]) may be determined as (32>>((x<<1)>>nScale)), the second weight wT[y] may be determined as 0, and the third weight wTL[x][y] may be determined as 0.
[0195] Based on the determined neighboring pixels (refL[x][y], refT[x][y]) and weights (wL[x], wT[y], wTL[x][y]), the current pixel (predSamples[x][y]) may be corrected as shown in Equation 1 below.
[0196] [Equation 1]
[0197] predSamples[x][y]=cliplCmp((refL[x][y]*wL[x]+refT[x][y]*wT[y]-p[-1][-1]*wTL[x][y]+(64-wL[x]-wT[y]+wTL[x][y])*predSamples[x][y]+32)>>6)
[0198] However, the above correction processing can be performed only when the current block does not perform intra prediction in units of sub-blocks. The correction processing can be performed only when the adjacent pixels of the current block belong to the first pixel row. The correction processing can be performed only when the intra prediction mode of the current block corresponds to a specific mode. Here, the specific mode may include at least one of a non-directional mode, a vertical mode, a horizontal mode, a mode less than a predetermined first threshold mode, or a mode greater than a predetermined second threshold mode. The first threshold mode may be 8, 9, 10, 11 or 12, and the second threshold mode may be 56, 57, 58, 59 or 60.
[0199] Figure 6 is a diagram showing a configuration of reference pixels for a DC mode in an intra prediction mode according to an embodiment of the present invention.
[0200] In order to calculate the DC value of the DC mode, an average value of pixels spatially adjacent to the current block is defined as a DC value using Equation 2, and prediction is performed.
[0201] [Equation 2]
[0202]
[0203] In the case of using Equation 2, when the sum of nCbw and nCbh does not have a power of 2, a problem arises in performing a division operation.
[0204] Therefore, in the present invention, for the case where the sum of the width and height of a block is not a power of 2, it is proposed to use a shift operation as shown in the following Equation 3 to remove the division operation in the form of calculating the average value of the left reference pixels of the block and the average value of the upper reference pixels of the block, and then perform averaging on them again.
[0205] [Equation 3]
[0206]
[0207] In this case, ωW and ωh may be defined according to the size of the block, and predefined values may be used based on the size of the block, the difference between the width and height of the block, etc. In Equation 3, as an implementation of ωW and ωh, weight values as shown in Table 7 may be used.
[0208] [Table 7]
[0209] <![CDATA[|log 2 (nCbw)-log 2 (nCbh)|]]> <![CDATA[ω max ]]> <![CDATA[ω min ]]> <![CDATA[ω max +oh min ]]> 1 21 11 32 2 26 6 32 3 28 4 32 4 30 2 32
[0210] In Table 7, the values of ωmax and ωmmin represent the weight value on the larger side of the block width and the block height. In Table 7, the value of |log2(nCbw)-log2(nCbh)| represents the logarithm of the absolute value of the difference between the block width and the block height.
[0211] In addition, the present invention proposes a video encoding and decoding method and apparatus for selectively deriving a DC value using different equations for the case where the sum of the width and height of a block is expressed as a power of 2 or not expressed as a power of 2. When the sum of the width and height of the block is expressed as a power of 2, the DC value is derived using equation 4, and when the sum of the width and height of the block is not expressed as a power of 2, the DC value is derived using equation 3.
[0212] [Equation 4]
[0213]
[0214] In addition, in the present invention, in order to selectively obtain a DC value according to the width and height of a block, a video encoding and decoding method and apparatus are proposed, which also includes a determination unit for determining whether the sum of the width and height of the block is a power of 2.
[0215] Figure 7 is a diagram showing a configuration of reference pixels of a DC mode in an intra prediction mode for a block having a size whose sum of width and height is not expressed as a power of 2 according to an embodiment of the present invention.
[0216] A block having a size in which the sum of the width and height of the block is not expressed as a power of 2 includes a case where the width and height of the block are not the same. As described above, when the sum of the width and height of the block is not expressed as a power of 2, a problem arises in which a division operation must be performed to calculate the DC value of the DC mode.
[0217] Figure 7 is with Figure 6 A method of increasing the width and height of a block used to derive a DC value by a value obtained by dividing the smaller of the width and height of the block by 2 is described.
[0218] exist Figure 7 In the illustrated embodiment, when the sum of the width and height of the block is not expressed as a power of 2 and the difference between the logarithmic value of the block width and the logarithmic value of the block height is 1, the DC value of the DC mode is calculated using Equation 5. The average value of pixels spatially adjacent to the current block is defined as the DC value, and prediction is performed.
[0219] [Equation 5]
[0220]
[0221] In Equation 5, nCbm represents a value having a shorter length of a block width nCbw and a block height nCbh, and as Figure 7 As shown in Equation 5, among the reference pixels at the upper side of the block, the reference pixel values of (nCbm>>1) are additionally summed up to the width of the block. Similarly, among the reference pixels at the left side of the block, the reference pixel values of (nCbm>>1) are additionally summed up to the height of the block. Through this operation, (nCbw+nCbh+nCbm) is expressed as a power of 2.
[0222] Figure 8 is a diagram showing a configuration of reference pixels of a DC mode in an intra prediction mode for a block having a size whose sum of width and height is not expressed as a power of 2 according to an embodiment of the present invention.
[0223] and Figure 7 Different from what is described in Figure 8 Embodiments are concerned in which the difference between the logarithmic value of the block width and the logarithmic value of the block height is greater than or equal to 2. A method is described in which the width and height of the block used to derive the DC value are reduced by the value obtained by dividing the smaller of the width and height of the block by 2.
[0224] exist Figure 8 In the illustrated embodiment, when the sum of the width and height of the block is not expressed as a power of 2 and the difference between the logarithmic value of the block width and the logarithmic value of the block height is greater than or equal to 2, the DC value of the DC mode is calculated using Equation 6. The average value of pixels spatially adjacent to the current block is defined as the DC value, and prediction is performed.
[0225] [Equation 6]
[0226]
[0227] In Equation 6, nCbm represents a value having a shorter length of a block width nCbw and a block height nCbh, and as Figure 8 As shown in Equation 6, (nCbw+nCbh-nCbm) is expressed as a power of 2 by excluding the reference pixel values in the block width (nCbm>>1) from the sum between the reference pixels at the upper side of the block and excluding the reference pixel values in the block height (nCbm>>1) from the sum between the reference pixels at the left side of the block.
[0228] In this case, when pixels are excluded from the block width and block height (nCbm>>1), as Figure 8As shown, pixels may be excluded from the rightmost side of the upper reference sample and from the bottommost side of the left reference sample. In addition, another embodiment includes performing subsampling in the upper reference sample and the left reference sample.
[0229] The various embodiments of the present disclosure are not listed in all possible combinations but are intended to describe representative aspects of the present disclosure, and the contents described in the various embodiments may be applied independently or may be applied in combination of two or more.
[0230] In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. For hardware implementation, it may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general processors, controllers, microcontrollers, microprocessors, etc.
[0231] The scope of the present disclosure includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that allow operations according to the methods of various embodiments to be performed on a device or computer, as well as non-transitory computer-readable media that store such software or instructions, etc. and are executable on a device or computer.
[0232] Industrial Applicability
[0233] The present invention can be used for encoding / decoding video signals.
Claims
1. A method for decoding a video, comprising: Obtaining the intra prediction mode of the current block; configuring reference pixels for intra prediction of the current block; as well as performing the intra prediction of the current block based on the intra prediction mode of the current block and the reference pixels, The intra prediction mode of the current block is obtained based on the most probable mode MPM index and a candidate list including a plurality of MPM candidates. The multiple MPM candidates are obtained based on the intra prediction mode of a neighboring block adjacent to the current block, wherein the neighboring block includes at least one of a left neighboring block and an upper neighboring block, wherein the intra prediction mode of the current block is changed based on a predetermined offset, and When the width of the current block is greater than the height of the current block, and the intra-frame prediction mode of the current block is greater than or equal to 2 and less than 8, the intra-frame prediction mode of the current block is changed by adding a predetermined offset 65 to the intra-frame prediction mode of the current block.
2. The method according to claim 1, wherein: The number of the plurality of MPM candidates is 3, 4, 5 or 6.
3. The method according to claim 1, wherein: The reference pixel belongs to one pixel row among a plurality of pixel rows adjacent to the current block.
4. The method according to claim 1, further comprising: filtering the reference pixel, wherein the filtering is selectively performed based on a flag indicating whether the filtering is performed on the reference pixel, and The flag is derived based on at least one of the position / area of the reference pixel, the block size, the component type, whether intra prediction in sub-block units is applied, or the intra prediction mode.
5. The method according to claim 1, wherein: The predicted pixels of the current block are corrected based on predetermined neighboring pixels and weights.
6. The method according to claim 1, wherein: The current block is divided into a plurality of sub-blocks based on predetermined division information, and The intra prediction is performed in units of the sub-blocks.
7. A method for encoding a video, comprising: Obtaining the intra prediction mode of the current block; configuring reference pixels for intra prediction of the current block; as well as performing the intra prediction of the current block based on the intra prediction mode of the current block and the reference pixels, The intra prediction mode of the current block is obtained based on a candidate list including a plurality of most probable mode (MPM) candidates. The multiple MPM candidates are obtained based on the intra prediction mode of a neighboring block adjacent to the current block, wherein the neighboring block includes at least one of a left neighboring block and an upper neighboring block, wherein the intra prediction mode of the current block is changed based on a predetermined offset, and When the width of the current block is greater than the height of the current block, and the intra-frame prediction mode of the current block is greater than or equal to 2 and less than 8, the intra-frame prediction mode of the current block is changed by adding a predetermined offset 65 to the intra-frame prediction mode of the current block.
8. A method for sending a bit stream of a video, comprising: Obtaining the intra prediction mode of the current block; configuring reference pixels for intra prediction of the current block; generating a prediction block of the current block by performing the intra prediction of the current block based on the intra prediction mode of the current block and the reference pixels; encoding the current block based on the prediction block to generate the bitstream; as well as sending the bit stream, The intra prediction mode of the current block is obtained based on a candidate list including a plurality of most probable mode (MPM) candidates. The multiple MPM candidates are obtained based on the intra prediction mode of a neighboring block adjacent to the current block, wherein the neighboring block includes at least one of a left neighboring block and an upper neighboring block, wherein the intra prediction mode of the current block is changed based on a predetermined offset, and When the width of the current block is greater than the height of the current block, and the intra-frame prediction mode of the current block is greater than or equal to 2 and less than 8, the intra-frame prediction mode of the current block is changed by adding a predetermined offset 65 to the intra-frame prediction mode of the current block.