Methods for decoding and encoding video, and methods for transmitting video.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-09-20
- Publication Date
- 2026-08-11
AI Technical Summary
因此,在通过使用介质例如常规的有线和无线宽带网络传输图像数据时,或者在通过使用常规的存储介质存储图像数据时,传输和存储的成本增加了
[0021] According to the present invention, intra-frame prediction can be performed efficiently for the encoded/decoded target block.
Smart Images

Figure CN116437079B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application filed on September 20, 2017, with application number 201780057631.9 (international phase application number PCT / KR2017 / 010353) and entitled "Method and apparatus for processing video signals". Technical Field
[0002] This invention relates to methods and apparatus for processing video signals. Background Technology
[0003] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) and ultra-high-definition (UHD) images, has increased across various application areas. However, the data volume of higher resolution and quality image data increases compared to regular image data. Therefore, the costs of transmission and storage increase when transmitting image data using media such as conventional wired and wireless broadband networks, or when storing image data using conventional storage media. To address these issues arising from the increasing resolution and quality of image data, efficient image encoding / decoding techniques can be utilized.
[0004] Image compression techniques encompass various methods, including: inter-frame prediction techniques that predict pixel values included in the current image based on previous or subsequent images; intra-frame prediction techniques that predict pixel values included in the current image using pixel information from the current image; and entropy coding techniques that assign short codes to frequently occurring values and long codes to less frequently occurring values. Image data can be effectively compressed using such image compression techniques, and image data can be transmitted or stored.
[0005] Simultaneously, with the increasing demand for high-resolution images, the demand for stereoscopic image content as a new image service is also increasing. Video compression techniques for effectively delivering stereoscopic image content with high and ultra-high resolution are being discussed. Summary of the Invention
[0006] Technical issues
[0007] The purpose of this invention is to provide a method and apparatus for effectively performing intra-frame prediction on target blocks during the encoding / decoding of video signals.
[0008] The purpose of this invention is to provide a method and apparatus for performing intra-frame prediction using multiple reference samples through weighted prediction when encoding / decoding video signals.
[0009] The technical objectives of this invention are not limited to the aforementioned technical problems. Furthermore, those skilled in the art will readily understand other technical problems not mentioned below based on the following description.
[0010] Technical solution
[0011] The method and apparatus for decoding video signals according to the present invention can: determine an intra-frame prediction mode for a current block; determine a first reference sample for a predicted target sample included in the current block based on the intra-frame prediction mode; generate a first predicted sample for the predicted target sample using the first reference sample; and generate a second predicted sample for the predicted target sample using the first predicted sample and a second reference sample located at a different position than the first reference sample.
[0012] The method and apparatus for encoding video signals according to the present invention can: determine an intra-prediction mode for a current block; determine a first reference sample for a predicted target sample included in the current block based on the intra-prediction mode; generate a first predicted sample for the predicted target sample using the first reference sample; and generate a second predicted sample for the predicted target sample using the first predicted sample and a second reference sample located at a different position than the first reference sample.
[0013] In the method and apparatus for encoding / decoding video signals according to the present invention, the second reference sample may include at least one of the following: a reference sample located on the same horizontal line as the predicted target sample, or a reference sample located on the same vertical line as the predicted target sample.
[0014] In the method and apparatus for encoding / decoding video signals according to the present invention, each of the first reference sample and the second reference sample may be adjacent to a different boundary of the current block.
[0015] In the method and apparatus for encoding / decoding video signals according to the present invention, the position of the second reference sample can be determined based on the directionality of the intra-frame prediction mode.
[0016] In the method and apparatus for encoding / decoding video signals according to the present invention, a second prediction sample can be generated based on a weighted sum of a first prediction sample and a second reference sample.
[0017] In the method and apparatus for encoding / decoding video signals according to the present invention, the weights applied to each of the first prediction sample and the second reference sample can be determined based on the positions of the first reference sample and the second reference sample.
[0018] In the method and apparatus for encoding / decoding video signals according to the present invention, it can be determined whether to generate a second prediction sample based on the directionality of the intra-frame prediction mode.
[0019] The features briefly outlined above are merely illustrative aspects of the invention as described in the following detailed description and do not limit the scope of the invention.
[0020] Beneficial effects
[0021] According to the present invention, intra-frame prediction can be performed efficiently for the encoded / decoded target block.
[0022] According to the present invention, intra-frame prediction can be performed using multiple reference samples based on weighted prediction.
[0023] The effects that can be obtained by the present invention are not limited to those described above, and other effects not mentioned can be clearly understood by those skilled in the art based on the following description. Attached Figure Description
[0024] Figure 1 This is a block diagram illustrating an apparatus for encoding video according to an embodiment of the present invention.
[0025] Figure 2 This is a block diagram illustrating an apparatus for decoding video according to an embodiment of the present invention.
[0026] Figure 3 This is a diagram illustrating an example of hierarchical partitioning of coded blocks based on a tree structure according to an embodiment of the present invention.
[0027] Figure 4 This is a diagram illustrating partitioning types that allow binary tree-based partitioning according to an embodiment of the present invention.
[0028] Figure 5 This is a diagram illustrating an example of binary tree-based partitioning that allows only predetermined types according to an embodiment of the present invention.
[0029] Figure 6 This is a diagram illustrating an example of encoding / decoding information related to the permissible number of binary tree partitions according to an embodiment of the present invention.
[0030] Figure 7 This is a diagram illustrating a partitioning pattern applicable to coded blocks according to an embodiment of the present invention.
[0031] Figure 8 This is a diagram illustrating the types of predefined intra-frame prediction modes of a device for encoding / decoding video according to an embodiment of the present invention.
[0032] Figure 9 This is a diagram illustrating a type of extended intra-frame prediction mode according to an embodiment of the present invention.
[0033] Figure 10This is a flowchart that briefly illustrates an intra-frame prediction method according to an embodiment of the present invention.
[0034] Figure 11 This is a diagram illustrating a method for correcting the predicted sample of the current block based on the difference information of neighboring samples according to an embodiment of the present invention.
[0035] Figure 12 and Figure 13 This is a diagram illustrating a method for correcting predicted samples based on a predetermined correction filter according to an embodiment of the present invention.
[0036] Figure 14 The range of reference samples for intra-frame prediction according to an embodiment of the present invention is shown.
[0037] Figures 15 to 17 An example of filtering a reference sample according to an embodiment of the present invention is shown.
[0038] Figure 18 This is a diagram illustrating an example of using multiple reference samples to obtain a right-side reference sample or a bottom-side reference sample.
[0039] Figure 19 and Figure 20 This is a diagram illustrating the determination of the right-side reference sample and the bottom-side reference sample for a non-square block according to an embodiment of the present invention.
[0040] Figure 21 and Figure 22 This is a diagram showing a one-dimensional set of reference samples where the reference samples are rearranged into a line.
[0041] Figure 23 It is a graph used to illustrate the distance between the first reference sample and the predicted target sample.
[0042] Figure 24 and Figure 25 This is a diagram showing the positions of the first reference sample and the second reference sample.
[0043] Figure 26 This is a diagram showing the positions of the first reference sample and the second reference sample.
[0044] Figure 27 This is a flowchart illustrating the process of obtaining residual samples according to an embodiment of the present invention. Detailed Implementation
[0045] Various modifications can be made to this invention, and various embodiments of the invention exist. Examples of various embodiments will now be provided with reference to the accompanying drawings, and examples of various embodiments will be described in detail. However, the invention is not limited thereto, and the exemplary embodiments can be interpreted as including all modifications, equivalents, or alternatives within the technical concept and scope of the invention. In the described drawings, similar reference numerals refer to similar elements.
[0046] The terms "first," "second," etc., used in this specification may be used to describe various components, but these components are not to be construed as limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the invention, a "first" component may be referred to as a "second" component, and a "second" component may similarly be referred to as a "first" component. The term "and / or" includes a combination of multiple items or any one of multiple terms.
[0047] It should be understood that in this specification, when an element is simply referred to as "connected to" or "coupled to" another element rather than "directly connected to" or "directly coupled to" another element, the element may be "directly connected to" or "directly coupled to" another element, or the element may be connected to or coupled to another element with other elements in between. Conversely, it should be understood that when an element is referred to as "directly coupled to" or "directly connected to" another element, there are no intermediate elements.
[0048] The terminology used in this specification is for describing particular embodiments only and is not intended to limit the invention. Expressions used in the singular include expressions in the plural unless they have a distinct meaning in the context. It should be understood in this specification that terms such as “comprising,” “having,” etc., are intended to indicate the presence of features, numbers, steps, actions, elements, portions, or combinations thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, portions, or combinations thereof may be present or added.
[0049] Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings. In the following drawings, the same constituent elements are indicated by the same reference numerals, and repeated descriptions of the same elements will be omitted.
[0050] Figure 1 This is a block diagram illustrating an apparatus for encoding video according to an embodiment of the present invention.
[0051] Reference Figure 1The device 100 for encoding video may include: an image segmentation module 110, prediction modules 120 and 125, a transformation module 130, a quantization module 135, a rearrangement module 160, an entropy coding module 165, an inverse quantization module 140, an inverse transformation module 145, a filter module 150, and a memory 155.
[0052] Figure 1 The constituent parts shown are illustrated independently to represent different functional characteristics within a device for encoding video. Therefore, this does not imply that each constituent part is composed of a separate hardware or software unit. In other words, for convenience, each constituent part includes each of the listed constituent parts. Thus, at least two constituent parts of each constituent part can be combined to form a single constituent part, or a constituent part can be divided into multiple constituent parts to perform each function. Embodiments combining each constituent part and embodiments dividing a constituent part are also included within the scope of this invention without departing from its spirit.
[0053] Furthermore, some of the constituent parts may not be essential components for performing the basic functions of the invention, but rather optional components used only to improve the performance of the invention. The invention can be implemented by excluding components used to improve performance and including only those essential for achieving the essence of the invention. Structures that exclude optional components used only to improve performance and include only essential components are also included within the scope of the invention.
[0054] Image partitioning module 110 can partition an input image into one or more processing units. Here, the processing unit can be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). Image partitioning module 110 can partition an image into a combination of multiple coding units, prediction units, and transform units, and can encode the image by selecting a combination of coding units, prediction units, and transform units using a predetermined criterion (e.g., a cost function).
[0055] For example, an image can be divided into multiple coding units. A recursive tree structure, such as a quadtree, can be used to divide the image into coding units. Coding units that are further divided into other coding units, with the image or the largest coding unit as the root, can be divided in such a way that the number of child nodes corresponds to the number of coding units in the division. Coding units that cannot be further divided by a predetermined constraint are used as leaf nodes. That is, when it is assumed that only a square partition is feasible for a coding unit, a coding unit can be divided into at most four other coding units.
[0056] In the following, in embodiments of the present invention, the encoding unit may refer to a unit that performs encoding or a unit that performs decoding.
[0057] A prediction unit can be one of the partitions that are square or rectangular in shape and have the same size in a single coding unit, or a prediction unit can be one of the partitions that have different shapes / sizes in a single coding unit.
[0058] When a prediction unit to be performed is generated based on a coding unit and the coding unit is not the smallest coding unit, intra-frame prediction can be performed without dividing the coding unit into multiple prediction units N×N.
[0059] Prediction modules 120 and 125 may include an inter-frame prediction module 120 performing inter-frame prediction and an intra-frame prediction module 125 performing intra-frame prediction. It can be determined whether inter-frame or intra-frame prediction is performed for a prediction unit, and detailed information based on each prediction method (e.g., intra-frame prediction mode, motion vectors, reference image, etc.) can be determined. Here, the processing unit performing the prediction may be different from the processing unit that determines the prediction method and details. For example, the prediction method, prediction mode, etc., may be determined by the prediction unit, and the prediction may be performed by the transform unit. The residual value (residual block) between the generated prediction block and the original block can be input to the transform module 130. Furthermore, prediction mode information, motion vector information, etc., used for prediction can be encoded together with the residual value by the entropy coding module 165 and can be transmitted to the device for decoding the video. When using a specific coding mode, the original block can be encoded as is and transmitted to the device for decoding the video without generating a prediction block through prediction modules 120 and 125.
[0060] The inter-frame prediction module 120 can predict prediction units based on information from at least one of the previous or subsequent images of the current image, or in some cases, it can predict prediction units based on information from some coded regions in the current image. The inter-frame prediction module 120 may include a reference image interpolation module, a motion prediction module, and a motion compensation module.
[0061] The reference image interpolation module can receive reference image information from the memory 155 and generate pixel information (integer pixels or smaller) based on the reference image. In the case of luminance pixels, an 8-tap DCT-based interpolation filter with different filter coefficients can be used to generate pixel information (integer pixels or smaller) in 1 / 4-pixel units. In the case of chrominance signals, a 4-tap DCT-based interpolation filter with different filter coefficients can be used to generate pixel information (integer pixels or smaller) in 1 / 8-pixel units.
[0062] The motion prediction module can perform motion prediction based on a reference image interpolated by the reference image interpolation module. Various methods can be used to calculate motion vectors, such as Full Search-Based Block Matching (FBMA), Three-Step Search (TSS), and New Three-Step Search (NTS). Based on the interpolated pixels, the motion vector can have motion vector values in units of 1 / 2 pixel or 1 / 4 pixel. The motion prediction module can predict the current prediction unit by changing the motion prediction method. Various methods can be used as motion prediction methods, such as skipping methods, merging methods, AMVP (Advanced Motion Vector Prediction) methods, and intra-block copying methods.
[0063] The intra-frame prediction module 125 can generate prediction units based on reference pixel information adjacent to the current block, which serves as pixel information in the current image. When the neighboring block of the current prediction unit is a block to be inter-frame predicted, and therefore the reference pixel is a pixel to be inter-frame predicted, the reference pixel information of the neighboring block to be intra-frame predicted can be used to replace the reference pixel included in the block to be inter-frame predicted. That is, when a reference pixel is unavailable, at least one of the available reference pixels can be used to replace the unavailable reference pixel information.
[0064] Intra-frame prediction can include directional prediction modes that use reference pixel information depending on the prediction direction and non-directional prediction modes that do not use directional information when performing prediction. The mode used to predict luminance information can be different from the mode used to predict chrominance information, and to predict chrominance information, either the intra-frame prediction mode information used to predict luminance information or the predicted luminance signal information can be used.
[0065] When performing intra-prediction, if the size of the prediction unit is the same as the size of the transform unit, intra-prediction can be performed based on the pixels located to the left, upper left, and upper side of the prediction unit. However, when performing intra-prediction, if the size of the prediction unit is different from the size of the transform unit, intra-prediction can be performed using reference pixels based on the transform unit. Furthermore, intra-prediction using an N×N partition can be used only for the smallest coding unit.
[0066] In intra-frame prediction methods, prediction blocks can be generated after applying an AIS (Adaptive Intra-Frame Smoothing) filter to a reference pixel, depending on the prediction mode. The type of AIS filter applied to the reference pixel can vary. To perform intra-frame prediction, the intra-frame prediction mode of the current prediction unit can be predicted based on the intra-frame prediction modes of prediction units adjacent to it. When predicting the prediction mode of the current prediction unit using mode information predicted by neighboring prediction units, if the intra-frame prediction mode of the current prediction unit is the same as that of neighboring prediction units, predetermined flag information can be used to transmit information indicating that the prediction modes of the current prediction unit and those of neighboring prediction units are identical. If the prediction mode of the current prediction unit differs from that of neighboring prediction units, entropy coding can be performed to encode the prediction mode information of the current block.
[0067] Furthermore, residual blocks containing information about residual values—the difference between the prediction unit to be predicted and the original block of the prediction unit—can be generated based on the prediction units generated by prediction modules 120 and 125. The generated residual blocks can then be input to transformation module 130.
[0068] Transform module 130 can transform the residual block using transformation methods such as Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), and KLT. The residual block includes information about the residual values between the original block and the prediction units generated by prediction modules 120 and 125. Whether to apply DCT, DST, or KLT to transform the residual block can be determined based on the intra-frame prediction mode information of the prediction units used to generate the residual block.
[0069] The quantization module 135 can quantize the values transformed to the frequency domain by the transformation module 130. The quantization coefficients can vary depending on the blocks or importance of the image. The values calculated by the quantization module 135 can be provided to the inverse quantization module 140 and the rearrangement module 160.
[0070] The rearrangement module 160 can rearrange the coefficients of the quantized residual values.
[0071] The rearrangement module 160 can transform coefficients in two-dimensional block form into coefficients in one-dimensional vector form using a coefficient scanning method. For example, the rearrangement module 160 can use a zigzag scanning method to scan from DC coefficients to coefficients in the high-frequency domain to transform the coefficients into one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, a vertical scan along the column direction or a horizontal scan along the row direction can be used instead of a zigzag scan. That is, the choice between zigzag scanning, vertical scanning, and horizontal scanning can be determined based on the size of the transform unit and the intra-frame prediction mode.
[0072] Entropy coding module 165 can perform entropy coding based on the value calculated by rearrangement module 160. Entropy coding can use various coding methods, such as exponential Golomb coding, context-adaptive variable-length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).
[0073] The entropy coding module 165 can encode various information from the rearrangement module 160 and the prediction modules 120 and 125, such as residual coefficient information and block type information of coding units, prediction mode information, partitioning unit information, prediction unit information, transform unit information, motion vector information, reference frame information, block interpolation information, filtering information, etc.
[0074] The entropy coding module 165 can entropy code the coefficients of the coding units input from the rearrangement module 160.
[0075] The inverse quantization module 140 can inverse quantize the value quantized by the quantization module 135, and the inverse transform module 145 can inverse transform the value transformed by the transform module 130. The residual value generated by the inverse quantization module 140 and the inverse transform module 145 can be combined with the prediction units predicted by the motion estimation module, motion compensation module and intra-frame prediction module of prediction modules 120 and 125 to generate a reconstruction block.
[0076] The filter module 150 may include at least one of a deblocking filter, an offset correction unit, and an adaptive loop filter (ALF).
[0077] Deblocking filters can remove block distortion caused by boundaries between blocks in a reconstructed image. To determine whether to perform deblocking, the pixels included in several rows or columns of a block can be the basis for deciding whether to apply a deblocking filter to the current block. When a deblocking filter is applied to a block, a strong or weak filter can be applied depending on the desired deblocking filtering intensity. Furthermore, horizontal and vertical filtering can be processed in parallel when applying a deblocking filter.
[0078] The offset correction module can correct the offset from the original image on a pixel-by-pixel basis in the image to be deblocked. To perform offset correction on a specific image, a method that considers the edge information of each pixel to apply the offset can be used, or the following method can be used: divide the image's pixels into a predetermined number of regions, determine the regions to be offset, and apply the offset to the determined regions.
[0079] Adaptive Loop Filtering (ALF) can be performed based on values obtained by comparing the filtered reconstructed image with the original image. Pixels included in the image can be divided into predetermined groups, the filter to be applied to each group can be determined, and filtering can be performed individually for each group. Information about whether ALF is applied and the luminance signal can be transmitted via the coding unit (CU). The shape and filter coefficients of the filter used for ALF can vary depending on each block. Furthermore, a filter of the same shape (fixed shape) used for ALF can be applied regardless of the characteristics of the target block.
[0080] The memory 155 can store reconstructed blocks or reconstructed images calculated by the filter module 150. The stored reconstructed blocks or reconstructed images can be provided to the prediction modules 120 and 125 during inter-frame prediction.
[0081] Figure 2 This is a block diagram illustrating an apparatus for decoding video according to an embodiment of the present invention.
[0082] Reference Figure 2 The device 200 for decoding video may include: an entropy decoding module 210, a rearrangement module 215, an inverse quantization module 220, an inverse transform module 225, prediction modules 230 and 235, a filter module 240, and a memory 245.
[0083] When a video bitstream is input from a device used to encode video, the input bitstream can be decoded by inverse processing of the device used to encode video.
[0084] The entropy decoding module 210 can perform entropy decoding based on the inverse processing of entropy encoding performed by the entropy encoding module of the device used to encode the video. For example, various methods can be applied corresponding to the method performed by the device used to encode the video, such as exponential Golomb coding, context-adaptive variable-length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC).
[0085] The entropy decoding module 210 can decode information about intra-frame prediction and inter-frame prediction performed by the device used to encode the video.
[0086] The rearrangement module 215 can rearrange the bitstream entropy decoded by the entropy decoding module 210 based on the rearrangement method used in the device for encoding video. The rearrangement module can reconstruct and rearrange coefficients in one-dimensional vector form into coefficients in two-dimensional block form. The rearrangement module 215 can receive information related to the coefficient scan performed in the device for encoding video, and can perform the rearrangement via a method that inversely scans the coefficients based on the scan order performed in the device for encoding video.
[0087] The inverse quantization module 220 can perform inverse quantization based on the quantization parameters received from the device used to encode the video and the coefficients of the rearranged block.
[0088] The inverse transform module 225 can perform inverse transforms, namely inverse DCT, inverse DST, and inverse KLT. These are the inverse processes of DCT, DST, and KLT, which are performed by the transform module on the quantization results of the device used to encode the video. The inverse transform can be performed based on the transform units determined by the device used to encode the video. The inverse transform module 225 of the device used to decode the video can selectively execute transform schemes such as DCT, DST, and KLT based on multiple pieces of information, such as the prediction method, the size of the current block, and the prediction direction.
[0089] Prediction modules 230 and 235 can generate prediction blocks based on information about prediction block generation received from entropy decoding module 210 and previously decoded block or image information received from memory 245.
[0090] As described above, similar to the operation of a device used for encoding video, when performing intra-frame prediction, if the size of the prediction unit is the same as the size of the transform unit, intra-frame prediction can be performed based on the pixels located to the left, upper left, and top of the prediction unit. When performing intra-frame prediction, if the size of the prediction unit is different from the size of the transform unit, intra-frame prediction can be performed using reference pixels based on the transform unit. Furthermore, intra-frame prediction using an N×N partition can be used only for the smallest coding unit.
[0091] Prediction modules 230 and 235 may include a prediction unit determination module, an inter-frame prediction module, and an intra-frame prediction module. The prediction unit determination module can receive various information from the entropy decoding module 210, such as prediction unit information, prediction mode information of the intra-frame prediction method, motion prediction information about the inter-frame prediction method, etc., and can divide the current coding unit into prediction units and determine whether to perform inter-frame prediction or intra-frame prediction on the prediction unit. By using the information required for inter-frame prediction of the current prediction unit received from the device for encoding video, the inter-frame prediction module 230 can perform inter-frame prediction on the current prediction unit based on information from at least one of the previous or subsequent images that include the current image of the current prediction unit. Alternatively, inter-frame prediction can be performed based on information from some pre-reconstructed regions in the current image that includes the current prediction unit.
[0092] To perform inter-frame prediction, it is possible to determine for the coding unit which of the following modes—skip mode, merge mode, AMVP mode, and inter-block copy mode—will be used as the motion prediction method for the prediction unit included in the coding unit.
[0093] Intra-prediction module 235 can generate prediction blocks based on pixel information in the current image. When the prediction unit is a prediction unit to be intra-predicted, intra-prediction can be performed based on intra-prediction mode information of the prediction unit received from the device used to encode the video. Intra-prediction module 235 may include an adaptive intra-smoothing (AIS) filter, a reference pixel interpolation module, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block and can determine whether to apply the filter based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block using the prediction mode of the prediction unit and AIS filter information received from the device used to encode the video. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.
[0094] When the prediction mode of the prediction unit is a prediction mode that performs intra-frame prediction based on pixel values obtained by interpolating reference pixels, the reference pixel interpolation module can interpolate the reference pixels to generate reference pixels of integer pixels or less than integer pixels. When the prediction mode of the current prediction unit is a prediction mode that generates prediction blocks without interpolating reference pixels, interpolation of reference pixels is not required. When the prediction mode of the current block is DC mode, the DC filter can generate prediction blocks through filtering.
[0095] The reconstructed block or reconstructed image can be provided to the filter module 240. The filter module 240 may include a deblocking filter, an offset correction module, and an ALF.
[0096] The device used for encoding video can receive information about whether a deblocking filter should be applied to a corresponding block or image, and which filter (strong or weak) should be applied when using the deblocking filter. The device used for decoding video can receive this information from the device used for encoding video and can perform deblocking filtering on the corresponding blocks.
[0097] The offset correction module can perform offset correction on the reconstructed image based on the type and offset value information of the offset correction applied to the image during encoding.
[0098] ALF can be applied to the coding unit based on information received from the device used to encode the video, such as whether ALF is applied and ALF coefficient information. ALF information can be provided as included in a specific parameter set.
[0099] The memory 245 can store reconstructed images or reconstructed blocks for use as reference images or reference blocks, and can provide the reconstructed images to the output module.
[0100] As described above, in embodiments of the present invention, for ease of explanation, the term "encoding unit" is used to refer to a unit used for encoding; however, the term "encoding unit" can also be used to refer to a unit that performs both decoding and encoding.
[0101] Furthermore, the current block can represent the target block to be encoded / decoded. And, depending on the encoding / decoding steps, the current block can represent a coding tree block (or coding tree unit), a coding block (or coding unit), a transform block (or transform unit), a prediction block (or prediction unit), etc.
[0102] Images can be encoded / decoded by dividing them into basic blocks of square or non-square shapes. These basic blocks are called coding tree units (CRUs). A CRU can be defined as the largest allowed coding unit within a sequence or slice. Information about the shape of the CRU, whether it is square or non-square, or its size, can be signaled via sequence parameter sets, image parameter sets, or slice headers. CRUs can be further divided into smaller partitions. For example, if the partition depth generated by dividing a CRU is 1, then the partition depth generated by dividing a CRU with depth 1 can be defined as 2. That is, the partition generated by dividing a CRU with depth k can be defined as having depth k+1.
[0103] A partition of arbitrary size generated by dividing the coding tree into units can be defined as a coding unit. A coding unit can be recursively divided or divided into basic units for performing prediction, quantization, transform, or loop filtering, etc. For example, a partition of arbitrary size generated by dividing coding units can be defined as a coding unit, or it can be defined as a transform unit or prediction unit, which is a basic unit for performing prediction, quantization, transform, or loop filtering, etc.
[0104] The partitioning of a coding tree unit or coding unit can be performed based on at least one of vertical and horizontal lines. Furthermore, the number of vertical or horizontal lines used to partition the coding tree unit or coding unit can be at least one or more. For example, a coding tree unit or coding unit can be divided into two partitions using one vertical line or one horizontal line, or into three partitions using two vertical lines or two horizontal lines. Alternatively, a coding tree unit or coding unit can be divided into four partitions with a length and width of 1 / 2 using one vertical line and one horizontal line.
[0105] When dividing a coding tree unit or coding unit into multiple partitions using at least one vertical line or at least one horizontal line, the partitions may have a uniform size or different sizes. Alternatively, any one partition may have a different size than the other partitions.
[0106] In the embodiments described below, it is assumed that the coding tree unit or coding unit is divided into a quadtree structure or a binary tree structure. However, it is also possible to use a greater number of vertical lines or a greater number of horizontal lines to divide the coding tree unit or coding unit.
[0107] Figure 3 This is a diagram illustrating an example of hierarchical partitioning of coded blocks based on a tree structure according to an embodiment of the present invention.
[0108] The input video signal is decoded in predetermined block units. The default unit for decoding the input video signal is the coding block. A coding block can be a block that performs intra / inter-frame prediction, transform, and quantization. Furthermore, a prediction mode (e.g., intra-frame prediction mode or inter-frame prediction mode) is determined on a block-by-block basis, and prediction blocks included in a coding block can share the determined prediction mode. A coding block can be a square or non-square block of any size in the range of 8×8 to 64×64, or it can be a square or non-square block of 128×128, 256×256, or larger.
[0109] Specifically, the coded blocks can be partitioned hierarchically based on at least one of quadtrees and binary trees. Here, quadtree-based partitioning means dividing a 2N×2N coded block into four N×N coded blocks, and binary tree-based partitioning means dividing one coded block into two coded blocks. Even when performing binary tree-based partitioning, square-shaped coded blocks can exist at a lower depth.
[0110] Binary tree-based partitioning can be performed symmetrically or asymmetrically. The coded blocks resulting from binary tree partitioning can be square or non-square, such as rectangular. For example, partitioning types that allow binary tree-based partitioning may include at least one of the following: symmetrical types of 2N×N (horizontal non-square coding units) or N×2N (vertical non-square coding units); and asymmetrical types of nL×2N, nR×2N, 2N×nU, or 2N×nD.
[0111] Binary tree-based partitioning can be restricted to either symmetric or asymmetric partitioning. In this case, constructing coding tree units using square blocks corresponds to quadtree CU partitioning, and constructing coding tree units using symmetric non-square blocks corresponds to binary tree partitioning. Constructing coding tree units using both square blocks and symmetric non-square blocks corresponds to quadtree CU partitioning and binary tree CU partitioning, respectively.
[0112] Binary tree-based partitioning can be performed on coded blocks that no longer require quadtree-based partitioning. Quadtree-based partitioning can be omitted from coded blocks that already require binary tree-based partitioning.
[0113] Furthermore, the partitioning type at a lower depth can be determined based on the partitioning type at a higher depth. For example, if binary tree-based partitioning is allowed at two or more depths, then only the same type of binary tree partitioning as at higher depths can be allowed at lower depths. For instance, if a binary tree-based partition at a higher depth is performed using a 2N×N type, then a binary tree-based partitioning at a lower depth is also performed using a 2N×N type. Alternatively, if a binary tree-based partition at a higher depth is performed using an N×2N type, then a binary tree-based partitioning at a lower depth is also performed using an N×2N type.
[0114] In contrast, it is also possible to allow only types that are different from the binary tree partitioning types at lower depths.
[0115] It is possible to restrict the use of only specific types of binary tree-based partitions for sequences, slices, coded tree units, or coded units. For example, for coded tree units, only 2N×N or N×2N type binary tree-based partitions may be allowed. Available partition types can be predefined in the encoder or decoder. Alternatively, information about available partition types or unavailable partition types can be encoded and then transmitted as a signal via a bitstream.
[0116] Figure 5 This is a diagram illustrating an example of binary tree-based partitioning that only allows specific types of partitioning. Figure 5 A shows an example that only allows binary tree-based partitioning of type N×2N, and Figure 5 B illustrates an example that only allows binary tree-based partitioning of type 2N×N. To implement adaptive partitioning based on quadtrees or binary trees, the following information can be used: information indicating quadtree-based partitioning, information about the size / depth of the coded blocks that allow quadtree-based partitioning, information indicating binary tree-based partitioning, information about the size / depth of the coded blocks that allow binary tree-based partitioning, information about the size / depth of the coded blocks that do not allow binary tree-based partitioning, information about whether binary tree-based partitioning is performed vertically or horizontally, etc.
[0117] Additionally, the following information can be obtained for a coding tree unit or a specific coding unit: the number of allowed binary tree partitions, the depth of allowed binary tree partitions, or the number of allowed binary tree partition depths. Information can be encoded in units of coding tree units or coding units, and this information can be transmitted to the decoder via a bitstream.
[0118] For example, the syntax "max_binary_depth_idx_minus1" indicating the maximum allowed depth of a binary tree partition can be encoded / decoded via a bitstream. In this case, max_binary_depth_idx_minus1+1 can indicate the maximum allowed depth of a binary tree partition.
[0119] Reference Figure 6 The example shown is in Figure 6 In the code, binary tree partitioning has already been performed for coding units of depth 2 and depth 3. Therefore, the bitstream can be encoded / decoded using at least one of the following: information indicating the number of times a binary tree partition has been performed in the coding unit (i.e., 2 times), information indicating the maximum depth of binary tree partitioning allowed in the coding unit (i.e., depth 3), or information indicating the number of depths of binary tree partitioning performed in the coding unit (i.e., 2 (depth 2 and depth 3)).
[0120] As another example, at least one of the following information can be obtained for each sequence or slice: the number of allowed binary tree partitions, the allowed depth of binary tree partitions, or the number of allowed depths of binary tree partitions. For example, this information can be encoded in units of sequences, images, or slices and transmitted via a bitstream. Therefore, at least one of the following—the number of binary tree partitions in the first slice, the maximum allowed depth of binary tree partitions in the first slice, or the number of depths at which binary tree partitions are performed in the first slice—can differ from that in the second slice. For example, in the first slice, binary tree partitions can be allowed for only one depth, while in the second slice, binary tree partitions can be allowed for two depths.
[0121] As another example, the allowed number of binary tree partitions, the allowed depth of binary tree partitions, or the allowed depth of binary tree partitions can be set differently based on the temporal ID of the slice or image. Here, the temporal ID is used to identify each of multiple video layers that have scalability in at least one of view, space, time, or quality.
[0122] like Figure 3As shown, a first coding block 300 with a partition depth (splitting depth) of k can be divided into multiple second coding blocks based on a quadtree. For example, second coding blocks 310 to 340 can be square blocks with half the width and half the height of the first coding block, and the partition depth of the second coding blocks can be increased to k+1.
[0123] A second coding block 310 with a partitioning depth of k+1 can be partitioned into multiple third coding blocks with a partitioning depth of k+2. The partitioning of the second coding block 310 can be performed by selectively using either a quadtree or a binary tree, depending on the partitioning method. Here, the partitioning method can be determined based on at least one of information indicating quadtree-based partitioning and information indicating binary tree-based partitioning.
[0124] When partitioning the second coding block 310 based on a quadtree, the second coding block 310 can be divided into four third coding blocks 310a, each having half the width and half the height of the second coding block, and the partitioning depth of the third coding blocks 310a can be increased to k+2. In contrast, when partitioning the second coding block 310 based on a binary tree, the second coding block 310 can be divided into two third coding blocks. Here, each of the two third coding blocks can be a non-square block having half the width and half the height of the second coding block, and the partitioning depth can be increased to k+2. The second coding block can be determined as a horizontal or vertical non-square block depending on the partitioning direction, and the partitioning direction can be determined based on information about whether the binary tree-based partitioning is performed along the vertical or horizontal direction.
[0125] Meanwhile, the second coding block 310 can be determined as a leaf coding block that is no longer partitioned based on a quadtree or binary tree. In this case, the leaf coding block can be used as a prediction block or a transform block.
[0126] Similar to the division of the second coding block 310, the third coding block 310a can be determined as a leaf coding block, or it can be further divided based on a quadtree or a binary tree.
[0127] Simultaneously, the third coding block 310b, based on the binary tree partitioning, can be further divided into vertical coding blocks 310b-2 or horizontal coding blocks 310b-3, and the partitioning depth of the relevant coding blocks can be increased to k+3. Alternatively, the third coding block 310b can be determined as a leaf coding block 310b-1 that is no longer partitioned based on the binary tree. In this case, coding block 310b-1 can be used as a prediction block or a transform block. However, the above partitioning process can be performed restrictively based on at least one of the following information: information about the size / depth of coding blocks that allow quadtree-based partitioning, information about the size / depth of coding blocks that allow binary tree-based partitioning, and information about the size / depth of coding blocks that do not allow binary tree-based partitioning.
[0128] The number of candidates representing the size of a coded block can be limited to a predetermined number, or the size of the coded block within a predetermined unit can have a fixed value. For example, the size of a coded block in a sequence or image can be limited to 256×256, 128×128, or 32×32. Information indicating the size of the coded blocks in a sequence or image can be sent via signals through the sequence header or image header.
[0129] As a result of partitioning based on quadtrees and binary trees, the coding unit can be represented as a square or rectangle of arbitrary size.
[0130] The coded block is encoded using at least one of skip mode, intra-frame prediction, inter-frame prediction, or skip method. Once the coded block is determined, the prediction block can be determined by predicting the coded block. The prediction block can be partitioned using a partition mode (Part_mode) that indicates the partition type of the coded block. The size or shape of the prediction block can be determined based on the partition mode. For example, the size of the prediction block determined by the partition mode can be equal to or smaller than the size of the coded block.
[0131] Figure 7 This is a diagram showing the partitioning patterns that can be applied to a coding block when encoding a coding block via inter-frame prediction.
[0132] When encoding a coded block using inter-frame prediction, one of eight partitioning patterns can be applied to the coded block, such as... Figure 7 The example shown.
[0133] When encoding a coding block using intra-frame prediction, the partitioning mode PART_2N×2N or the partitioning mode PART_N×N can be applied to the coding block.
[0134] When a coded block has a minimum size, PART_N×N can be applied. Here, the minimum size of the coded block can be predefined in the encoder and decoder. Alternatively, information about the minimum size of the coded block can be sent via a signal through the bitstream. For example, the minimum size of the coded block can be sent via a signal in the chip header, allowing the minimum size of the coded block to be defined for each chip.
[0135] Typically, prediction blocks can have sizes ranging from 64×64 to 4×4. However, when encoding coded blocks via inter-frame prediction, the prediction blocks can be restricted to a size other than 4×4 to reduce memory bandwidth when performing motion compensation.
[0136] Figure 8 A diagram illustrating the types of predefined intra-frame prediction modes of a device for encoding / decoding video according to an embodiment of the present invention.
[0137] Devices used for encoding / decoding video can perform intra-prediction using one of the predefined intra-prediction modes. The predefined intra-prediction modes for intra-prediction can include non-directional prediction modes (e.g., planar mode, DC mode) and 33 directional prediction modes.
[0138] Alternatively, to improve the accuracy of intra-frame prediction, a greater number of directional prediction modes than 33 can be used. That is, M extended directional prediction modes (M>33) can be defined by subdividing the directional prediction modes by angle, and a directional prediction mode with a predetermined angle can be obtained by using at least one of the 33 predefined directional prediction modes.
[0139] More than Figure 8 The diagram shows a greater number of intra prediction modes than the 35 shown. For example, more intra prediction modes than 35 can be used by subdividing the angles of the directional prediction modes, or by using at least one of a predefined number of directional prediction modes to obtain a directional prediction mode with a predetermined angle. In this case, the use of more intra prediction modes than 35 can be referred to as extended intra prediction modes.
[0140] Figure 9 An example of extended intra-prediction modes is shown, and extended intra-prediction modes can include two non-directional prediction modes and 65 extended directional prediction modes. The same number of extended intra-prediction modes can be used for the luma and chroma components, or a different number of intra-prediction modes can be used for each component. For example, 67 extended intra-prediction modes can be used for the luma component and 35 intra-prediction modes can be used for the chroma component.
[0141] Alternatively, depending on the chroma format, a different number of intra-prediction modes can be used when performing intra-prediction. For example, in the 4:2:0 format, 67 intra-prediction modes can be used for the luma component to perform intra-prediction, and 35 intra-prediction modes can be used for the chroma component. In the 4:4:4 format, 67 intra-prediction modes can be used for both the luma and chroma components to perform intra-prediction.
[0142] Alternatively, depending on the size and / or shape of the block, different numbers of intra-prediction modes can be used to perform intra-prediction. That is, depending on the size and / or shape of the PU or CU, either 35 or 67 intra-prediction modes can be used. For example, if the CU or PU has a size smaller than 64×64 or is asymmetrically partitioned, 35 intra-prediction modes can be used. If the CU or PU is equal to or greater than 64×64, 67 intra-prediction modes can be used. For Intra_2Nx2N, 65 directional intra-prediction modes are allowed, and for Intra_NxN, only 35 directional intra-prediction modes are allowed.
[0143] The size of the block to which the extended intra-mode prediction mode is applied can be set differently for each sequence, image, or slice. For example, the extended intra-mode prediction mode can be set to apply to blocks (e.g., CU or PU) with a size greater than 64×64 in the first slice. On the other hand, the extended intra-mode prediction mode can be set to apply to blocks with a size greater than 32×32 in the second slice. Information indicating the size of the block to which the extended intra-mode prediction mode is applied can be signaled on a sequence, image, or slice basis. For example, information indicating the size of the block to which the extended intra-mode prediction mode is applied can be defined as 'log2_extended_intra_mode_size_minus4', obtained by taking the logarithm of the block size and then subtracting the integer 4. For example, if the value of log2_extended_intra_mode_size_minus4 is 0, this can indicate that the extended intra-mode prediction mode can be applied to blocks with a size equal to or greater than 16×16. If the value of log2_extended_intra_mode_size_minus4 is 1, this can indicate that the extended intra-mode prediction mode can be applied to blocks with a size equal to or greater than 32×32.
[0144] As described above, the number of intra-prediction modes can be determined by considering at least one of color components, chroma format, and block size or shape. Additionally, the number of intra-prediction mode candidates (e.g., the number of MPMs) for determining the intra-prediction mode of the current block to be encoded / decoded can be determined based on at least one of color components, color format, and block size or shape. The method for determining the intra-prediction mode of the current block to be encoded / decoded and the method for performing intra-prediction using the determined intra-prediction mode will be described with reference to the accompanying drawings.
[0145] Figure 10 This is a flowchart that briefly illustrates an intra-frame prediction method according to an embodiment of the present invention.
[0146] Reference Figure 10 In step S1000, the intra-prediction mode of the current block can be determined.
[0147] Specifically, the intra-prediction mode of the current block can be obtained based on a candidate list and an index. Here, the candidate list contains multiple candidates, and these candidates can be determined based on the intra-prediction modes of neighboring blocks adjacent to the current block. Neighboring blocks can include at least one block located above, below, to the left, to the right, or in a corner of the current block. An index can specify one of the multiple candidates in the candidate list. The candidate specified by the index can be set as the intra-prediction mode of the current block.
[0148] Intra-prediction modes used for intra-prediction in adjacent blocks can be set as candidates. Additionally, intra-prediction modes with directionality similar to that of the intra-prediction modes in adjacent blocks can be set as candidates. Here, intra-prediction modes with similar directionality can be determined by adding a predetermined constant value to or subtracting a predetermined constant value from the intra-prediction modes of adjacent blocks. The predetermined constant value can be an integer, such as one, two, or more.
[0149] The candidate list may also include a default mode. The default mode may include at least one of the following: planar mode, DC mode, vertical mode, and horizontal mode. Default modes can be added adaptively, taking into account the maximum number of candidates that can be included in the candidate list of the current block.
[0150] The maximum number of candidates that can be included in the candidate list can be three, four, five, six, or more. The maximum number of candidates that can be included in the candidate list can be a fixed value preset in the device used for encoding / decoding video, or it can be variably determined based on the characteristics of the current block. Characteristics can refer to the block's position / size / shape, the number / type of intra-prediction modes that the block can use, color type, color format, etc. Alternatively, information indicating the maximum number of candidates that can be included in the candidate list can be separately transmitted by signaling, and this information can be used to variably determine the maximum number of candidates that can be included in the candidate list. Information indicating the maximum number of candidates can be transmitted by signaling at at least one of the sequence level, picture level, slice level, and block level.
[0151] When selectively using extended intra prediction modes and 35 predefined intra prediction modes, the intra prediction modes of adjacent blocks can be transformed to indices corresponding to either the extended intra prediction mode or the 35 predefined intra prediction modes, thereby generating candidates. To transform to indices, a predefined table can be used, or a scaling operation based on predetermined values can be used. Here, the predefined table can define the mapping relationships between different groups of intra prediction modes (e.g., extended intra prediction mode and 35 predefined intra prediction modes).
[0152] For example, if the left adjacent block uses 35 intra-prediction modes and the left adjacent block has an intra-prediction mode of 10 (horizontal mode), it can be transformed into index 16, which corresponds to the horizontal mode in the extended intra-prediction modes.
[0153] Alternatively, if the upper adjacent block uses an extended intra-prediction mode and the upper adjacent block's intra-prediction mode has index 50 (vertical mode), it can be transformed to index 26, which corresponds to the vertical mode among the 35 intra-prediction modes.
[0154] Based on the above method for determining the intra-prediction mode, the intra-prediction mode can be obtained independently for each of the luma and chroma components, or the intra-prediction mode of the chroma component can be obtained based on the intra-prediction mode of the luma component.
[0155] Specifically, as shown in Table 1 below, the intra-prediction mode of the chrominance component can be determined based on the intra-prediction mode of the luminance component.
[0156] [Table 1]
[0157]
[0158] In Table 1, intra_chroma_pred_mode means sending information via signal to specify the intra prediction mode of the chroma component, and IntraPredModeY indicates the intra prediction mode of the luma component.
[0159] Reference Figure 10 In step S1010, reference samples for intra-frame prediction of the current block can be obtained.
[0160] Specifically, reference samples for intra-frame prediction can be obtained based on neighboring samples of the current block. Neighboring samples can be reconstructed samples of neighboring blocks, and the reconstructed samples can be reconstructed samples before or after the application of the loop filter.
[0161] Neighboring samples reconstructed before the current block can be used as reference samples, and neighboring samples filtered based on a predetermined intra-frame filter can also be used as reference samples. Filtering neighboring samples using an intra-frame filter can also be called reference sample smoothing. An intra-frame filter can include at least one of the following filters: a first intra-frame filter applied to multiple neighboring samples located on the same horizontal line, and a second intra-frame filter applied to multiple neighboring samples located on the same vertical line. Depending on the position of the neighboring samples, one of the first intra-frame filter and the second intra-frame filter can be selectively applied, or both intra-frame filters can be applied. In this case, at least one filter coefficient of the first intra-frame filter or the second intra-frame filter can be (1,2,1), but is not limited to this.
[0162] Filtering can be adaptively performed based on at least one of the intra-prediction mode of the current block and the size of the transform block used for the current block. For example, if the intra-prediction mode of the current block is DC mode, vertical mode, or horizontal mode, filtering may not be performed. If the transform block size is N×M, filtering may not be performed. Here, N and M can be the same value or different values, or they can be 4, 8, 16, or more. For example, if the transform block size is 4×4, filtering may not be performed. Alternatively, filtering can be selectively performed based on the result of a comparison between the difference between the intra-prediction mode of the current block and the vertical mode (or horizontal mode) and a predefined threshold. For example, filtering may be performed if the difference between the intra-prediction mode of the current block and the vertical mode is greater than the threshold. As shown in Table 2, the threshold can be defined for each transform block size.
[0163] [Table 2]
[0164] 8×8 transformation 16×16 transformation 32×32 transformation threshold 7 1 0
[0165] Intra-frame filters can be determined as one of a plurality of predefined intra-frame filter candidates in a device used for encoding / decoding video. To do this, an index of the intra-frame filter for the current block among the plurality of intra-frame filter candidates can be sent by signaling. Alternatively, the intra-frame filter can be determined based on at least one of the following: the size / shape of the current block, the size / shape of the transform block, information about the filter strength, and changes in adjacent samples.
[0166] Reference Figure 10 In step S1020, intra-prediction can be performed using the intra-prediction mode of the current block and the reference sample.
[0167] In other words, the intra-prediction mode determined in step S1000 and the reference sample obtained in step S1010 can be used to obtain the prediction sample for the current block. However, in the case of intra-prediction, boundary samples of adjacent blocks may be used, and therefore the quality of the predicted image may be reduced. Therefore, a correction process can be performed on the prediction sample generated by the above prediction process, and the reference sample can be used to correct the prediction. Figures 11 to 13 The correction process will be described in detail below. However, the correction process is not limited to intra-frame prediction samples, but can also be applied to inter-frame prediction samples or reconstructed samples.
[0168] Figure 11 This is a diagram illustrating a method for correcting the predicted sample of the current block based on the difference information of neighboring samples according to an embodiment of the present invention.
[0169] The predicted samples of the current block can be corrected based on the difference information of multiple neighboring samples. Correction can be performed on all predicted samples in the current block, or it can be performed on predicted samples in a predetermined partial region. The partial region can be one row / column or multiple rows / columns, and these regions can be preset regions for correction in a device used for encoding / decoding video. For example, correction can be performed on one row / column located at the boundary of the current block, or correction can be performed on multiple rows / columns from the boundary of the current block. Alternatively, the partial region can be variably determined based on at least one of the size / shape of the current block and the intra-frame prediction mode.
[0170] Neighboring samples can belong to neighboring blocks located above, to the left, and at the top left corner of the current block. The number of neighboring samples used for correction can be two, three, four, or more. The positions of neighboring samples can be variably determined based on the position of the predicted sample that serves as the correction target in the current block. Alternatively, some neighboring samples can have fixed positions regardless of the position of the predicted sample that serves as the correction target, and the remaining neighboring samples can have variable positions depending on the position of the predicted sample that serves as the correction target.
[0171] The difference information between adjacent samples can refer to the difference between adjacent samples, or it can refer to the value obtained by scaling the difference sample by a predetermined constant value (e.g., one, two, three, etc.). Here, the predetermined constant value can be determined by considering the position of the predicted sample as the correction target, including the column or row position of the predicted sample as the correction target, and the position of the predicted sample within the column or row.
[0172] For example, if the intra-frame prediction mode of the current block is vertical mode, the difference sample between the neighboring sample p(-1,y) adjacent to the left boundary of the current block and the upper left neighboring sample p(-1,-1) can be used to obtain the final prediction sample, as shown in Equation 1.
[0173] [Formula 1]
[0174] P'(0,y)=P(0,y)+((p(-1,y)-p(-1,-1))>>1where y=0...N-1
[0175] For example, when the intra-frame prediction mode of the current block is horizontal mode, the difference sample between the neighboring sample p(x, -1) adjacent to the upper boundary of the current block and the left-upper neighboring sample p(-1, -1) can be used to obtain the final prediction sample, as shown in Equation 2.
[0176] [Equation 2]
[0177] P′(x, 0)=p(x, 0)+((p(x, -1)-p(-1, -1))>>1 where x=0...N-1
[0178] For example, if the intra-frame prediction mode of the current block is vertical, the difference sample between the neighboring sample p(-1, y) adjacent to the left boundary of the current block and the top-left neighboring sample p(-1, -1) can be used to obtain the final prediction sample. Here, the difference sample can be added to the prediction sample, or the difference sample can be scaled by a predetermined constant value and then added to the prediction sample. The predetermined constant value used in scaling can be determined differently depending on the column and / or row. For example, the prediction sample can be corrected as shown in Equations 3 and 4.
[0179] [Formula 3]
[0180] P'(0,y)=P(0,y)+((p(-1,y)-p(-1,-1))>>1where y=0...N-1
[0181] [Formula 4]
[0182] P'(1,y)=P(1,y)+((p(-1,y)-p(-1,-1))>>2 where y=0...N-1
[0183] For example, when the intra-frame prediction mode of the current block is horizontal, the difference sample between the neighboring sample p(x, -1) adjacent to the upper boundary of the current block and the upper-left neighboring sample p(-1, -1) can be used to obtain the final prediction sample, as described in the case of vertical mode. For example, the prediction sample can be corrected as shown in Equations 5 and 6.
[0184] [Formula 5]
[0185] P′(x, 0)=p(x, 0)+((p(x, -1)-p(-1, -1))>>1 where x=0...N-1
[0186] [Formula 6]
[0187] P′(x, 1)=p(x, 1)+((p(x, -1)-p(-1, -1))>>2 where x=0...N-1
[0188] Figure 12 and Figure 13 This is a diagram illustrating a method for correcting predicted samples based on a predetermined correction filter according to an embodiment of the present invention.
[0189] The predicted sample can be corrected based on neighboring samples of the predicted sample as the correction target and a predetermined correction filter. Here, neighboring samples can be specified by the angle line of the directional prediction mode of the current block, or neighboring samples can be at least one sample located on the same angle line as the predicted sample as the correction target. Furthermore, neighboring samples can be predicted samples in the current block, or reconstructed samples in neighboring blocks reconstructed before the current block.
[0190] The number of taps, strength, and filter coefficients of the correction filter can be determined based on at least one of the following: the position of the prediction sample as the correction target, whether the prediction sample as the correction target is located at the boundary of the current block, the intra-prediction mode of the current block, the angle of the directional prediction mode, the prediction mode of adjacent blocks (inter-frame mode or intra-frame mode), and the size / shape of the current block.
[0191] Reference Figure 12 When the directional prediction pattern has index 2 or index 34, the final prediction sample can be obtained using at least one prediction / reconstruction sample located to the lower left of the prediction sample that serves as the correction target, along with a predetermined correction filter. Here, the prediction / reconstruction sample to the lower left can belong to a line preceding the line that includes the prediction sample that serves as the correction target. The prediction / reconstruction sample to the lower left can belong to the same block as the current sample, or to a neighboring block adjacent to the current block.
[0192] Filtering of the predicted samples can be performed on only the lines located at the block boundaries, or it can be performed on multiple lines. Correction filters can be used, where at least one of the number of filter taps and filter coefficients is different for each line. For example, a (1 / 2, 1 / 2) filter can be used on the first line closest to the block boundary on the left, a (12 / 16, 4 / 16) filter on the second line, a (14 / 16, 2 / 16) filter on the third line, and a (15 / 16, 1 / 16) filter on the fourth line.
[0193] Alternatively, when the directional prediction model has indices 3 to 6 or indices 30 to 33, it can be as follows: Figure 13 The block boundary filtering shown can be performed using a 3-tap correction filter to correct the predicted samples. Filtering can be performed using the lower-left sample of the predicted sample as the correction target, the sample below the lower-left sample, and the 3-tap correction filter with the predicted sample as the correction target as input. The positions of adjacent samples used by the correction filter can be determined differently based on the directional prediction pattern. The filter coefficients of the correction filter can be determined differently based on the directional prediction pattern.
[0194] Different correction filters can be applied depending on whether adjacent blocks are encoded in inter-frame or intra-frame mode. When adjacent blocks are encoded in intra-frame mode, filtering methods that assign more weight to the prediction samples can be used compared to those encoded in inter-frame mode. For example, with intra-frame prediction mode 34, a (1 / 2, 1 / 2) filter can be used when adjacent blocks are encoded in inter-frame mode, and a (4 / 16, 12 / 16) filter can be used when adjacent blocks are encoded in intra-frame mode.
[0195] The number of lines to be filtered in the current block can vary depending on the size / shape of the current block (e.g., the coding block or the prediction block). For example, if the size of the current block is equal to or less than 32×32, filtering can be performed on only one line at the block boundary; otherwise, filtering can be performed on multiple lines, including one line at the block boundary.
[0196] Figure 12 and Figure 13 Based on the use Figure 7 This applies to the 35 intra-prediction modes in the example, but can be applied in the same / similar way to the cases using extended intra-prediction modes.
[0197] Figure 14 The range of reference samples for intra-frame prediction according to an embodiment of the present invention is shown.
[0198] Intra-frame prediction for the current block can be performed using reference samples obtained from reconstructed samples included in neighboring blocks. Here, reconstructed samples refer to samples that are encoded / decoded before the current block is encoded / decoded. For example, intra-frame prediction for the current block can be performed based on at least one of reference samples P(-1,-1), P(-1,y) (0<=y<=2N-1), and P(x,-1) (0<=x<=2N-1). In this case, filtering of the reference samples is selectively performed based on at least one of the intra-frame prediction mode of the current block (e.g., the index, directionality, angle, etc. of the intra-frame prediction mode) or the size of the transform block associated with the current block.
[0199] The reference sample can be filtered using predefined intra-frame filters in the encoder and decoder. For example, the final reference sample for intra-frame prediction can be obtained using an intra-frame filter with coefficients (1,2,1) or an intra-frame filter with coefficients (2,3,6,3,2).
[0200] Alternatively, at least one of a plurality of intra-frame filter candidates can be selected to perform filtering on the reference sample. Here, the plurality of intra-frame filter candidates may differ from each other in at least one of the following aspects: filter strength, filter coefficients, or number of taps (e.g., the number of filter coefficients, filter length). A plurality of intra-frame filter candidates may be defined at at least one of the sequence level, picture level, slice level, or block level. That is, a sequence, picture, slice, or block including the current block may use the same plurality of intra-frame filter candidates.
[0201] In the following text, for ease of explanation, it is assumed that the multiple intra-frame filter candidates include a first intra-frame filter and a second intra-frame filter. It is also assumed that the first intra-frame filter is a (1,2,1)3-tap filter and the second intra-frame filter is a (2,3,6,3,2)5-tap filter.
[0202] When the reference sample is filtered by applying the first intra-frame filter, the filtered reference sample can be obtained as shown in Equation 7.
[0203] [Formula 7]
[0204] P(-1,-1)=(P(-1,0)+2P(-1,-1)+P(0,-1)+2)>>2
[0205] P(-1,y)=(P(-1,y+1)+2P(-1,y)+P(-1,y-1)+2)>>2
[0206] P(x,-1)=(P(x+1,-1)+2P(x,-1)+P(x-1,-1)+2)>>2
[0207] When the reference sample is filtered by applying the second intra-frame filter, the filtered reference sample can be obtained as shown in Equation 8.
[0208] [Formula 8]
[0209] P(-1,-1)=(2P(-2,0)+3P(-1,0)+6P(-1,-1)+3P(0,-1)+2P(0,-2)+8)>>4
[0210] P(-1,y)=(2P(-1,y+2)+3P(-1,y+1)+6P(-1,y)+3P(-1,y-1)+2P(-1,y-2)+8)>>4
[0211] P(x,-1)=(2P(x+2,-1)+3P(x+1,-1)+6P(x,-1)+3P(x-1,-1)+2P(x-2,-1)+8)>>4
[0212] In Equations 7 and 8 above, x can be an integer between 0 and 2N-2, and y can be an integer between 0 and 2N-2.
[0213] Alternatively, based on the position of the reference sample, one of a plurality of intra-frame filter candidates can be determined, and filtering of the reference sample can be performed using the determined intra-frame filter candidate. For example, a first intra-frame filter can be applied to reference samples included in a first range, and a second intra-frame filter can be applied to reference samples included in a second range. Here, the first and second ranges can be distinguished based on whether they are adjacent to the boundary of the current block, whether they are located above or to the left of the current block, or whether they are adjacent to the corner of the current block. For example, as Figure 15 As shown, filtering of reference samples (P(-1, -1), P(-1, 0), P(-1, 1), ..., P(-1, N-1) and P(0, -1), P(1, -1), ...) adjacent to the boundary of the current block is performed by applying a first intra-frame filter as shown in Equation 7, and filtering of other reference samples not adjacent to the boundary of the current block is performed by applying a second intra-frame filter as shown in Equation 8. One of a plurality of intra-frame filter candidates can be selected based on the transform type used for the current block, and the selected intra-frame filter candidate is used to perform filtering of the reference samples. Here, transform type may mean (1) a transform scheme such as DCT, DST, or KLT, (2) a transform mode indicator such as 2D transform, 1D transform, or no transform, or (3) the number of transforms such as the first transform and the second transform. In the following, for ease of description, it is assumed that transform type means a transform scheme such as DCT, DST, and KLT.
[0214] For example, if the current block is encoded using DCT, filtering can be performed using a first intra-frame filter, and if the current block is encoded using DST, filtering can be performed using a second intra-frame filter. Alternatively, if the current block is encoded using either DCT or DST, filtering can be performed using a first intra-frame filter, and if the current block is encoded using KLT, filtering can be performed using a second intra-frame filter.
[0215] Filtering can be performed using filters selected based on the transform type of the current block and the position of the reference samples. For example, if the current block is encoded using DCT, filtering of reference samples P(-1,-1), P(-1,0), P(-1,1), ..., P(-1,N-1) and P(0,-1), P(1,-1), ..., P(N-1,-1) can be performed using a first intra-frame filter, and filtering of other reference samples can be performed using a second intra-frame filter. If the current block is encoded using DST, filtering of reference samples P(-1,-1), P(-1,0), P(-1,1), ..., P(-1,N-1) and P(0,-1), P(1,-1), ..., P(N-1,-1) can be performed using a second intra-frame filter, and filtering of other reference samples can be performed using a first intra-frame filter.
[0216] One of several intra-frame filter candidates can be selected based on whether the transform type of neighboring blocks, including reference samples, is the same as the transform type of the current block, and filtering can be performed using the selected intra-frame filter candidate. For example, if the current block and neighboring blocks use the same transform type, filtering is performed using a first intra-frame filter, and if the transform type of the current block is different from that of the neighboring blocks, filtering can be performed using a second intra-frame filter.
[0217] Multiple intra-filter candidates can be selected based on the transform type of adjacent blocks, and the selected intra-filter candidate can be used to filter the reference sample. In other words, the specific filter can be selected by considering the transform type of the block including the reference sample. For example, ... Figure 16 As shown, if the block adjacent to the left / lower left of the current block is a block encoded using DCT, and the block adjacent to the upper / upper right of the current block is a block encoded using DST, then filtering of the reference samples adjacent to the left / lower left of the current block is performed by applying a first intra-frame filter, and filtering of the reference samples adjacent to the upper / upper right of the current block is performed by applying a second intra-frame filter.
[0218] Filters that can be used in a given region can be defined. In this paper, the unit of a predetermined region can be any of a sequence, image, slice, block group (e.g., a row of a coding tree unit), or block (e.g., a coding tree unit). Alternatively, another region can be defined that shares one or more filters. Reference samples can be filtered using filters mapped to regions that include the current block.
[0219] For example, such as Figure 17 As shown, different filters can be used to filter the reference sample at the CTU level. In this case, information such as whether the same filter is used in the sequence or picture can be sent via a signal via the Sequence Parameter Set (SPS) or Picture Parameter Set (PPS), indicating whether the same filter is used in the sequence or picture, the type of filter used for each CTU, and specifying the index of the filter for the corresponding CTU from the available intra-frame filter candidates.
[0220] The intra-frame filters described above can be applied on a unit-by-unit basis. For example, filtering can be performed by applying a first intra-frame filter or a second intra-frame filter to reference samples surrounding the coding unit.
[0221] When using directional prediction mode or DC mode, image quality degradation may occur at block boundaries. On the other hand, in planar mode, there is an advantage of relatively less image quality degradation at block boundaries compared to the aforementioned prediction modes.
[0222] Planar prediction can be performed by generating a first prediction image (i.e., the first prediction sample) in the horizontal direction and a second prediction image (i.e., the second prediction sample) in the vertical direction using reference samples, and then performing a weighted prediction on the first and second prediction images.
[0223] Here, a first predicted image can be generated based on reference samples adjacent to the current block and located in the horizontal direction of the predicted sample. For example, the first predicted image can be generated based on a weighted sum of reference samples in the horizontal direction of the predicted sample, and the weight applied to each reference sample can be determined based on the distance from the predicted target sample or the size of the current block. Samples in the horizontal direction can include left reference samples located to the left of the predicted target sample and right reference samples located to the right of the predicted target sample. In this case, the right reference sample can be obtained based on the upper reference sample of the current block. For example, the right reference sample can be obtained by copying the value of one of the upper reference samples, or by a weighted sum or average of the upper reference samples. Here, the upper reference sample can be a reference sample located on the same vertical line as the right reference sample, and can be a reference sample adjacent to the upper right corner of the current block. Alternatively, the position of the upper reference sample can be determined differently depending on the position of the predicted target sample.
[0224] A second predicted image can be generated based on reference samples adjacent to the current block and located in the vertical direction of the predicted sample. For example, the second predicted image can be generated based on a weighted sum of reference samples in the vertical direction of the predicted sample, and the weight applied to each reference sample can be determined based on the distance from the predicted target sample or the size of the current block. Samples in the vertical direction can include an upper reference sample located above the predicted target sample and a lower reference sample located below the predicted target sample. In this case, the lower reference sample can be obtained based on the left reference sample of the current block. For example, the lower reference sample can be obtained by copying the value of one of the left reference samples, or by a weighted sum or average of the left reference samples. Here, the left reference sample can be a reference sample located on the same horizontal line as the lower reference sample, and can be a reference sample adjacent to the lower left corner of the current block. Alternatively, the position of the upper reference sample can be determined differently depending on the position of the predicted target sample.
[0225] As another example, multiple reference samples can be used to obtain a right-side reference sample and a bottom-side reference sample.
[0226] For example, a right-side reference sample or a bottom-side reference sample can be obtained using both the upper and left-side reference samples of the current block. For example, at least one of the right-side or bottom-side reference samples can be determined as a weighted sum or average of the upper and left-side reference samples of the current block.
[0227] Alternatively, a weighted sum or average of the upper and left reference samples of the current block can be calculated, and then a right reference sample can be obtained based on the calculated value and the weighted sum or average of the upper reference samples. If the right reference sample is obtained by calculating the weighted sum of the calculated value and the upper reference sample, the weights can be determined by considering the size of the current block, the shape of the current block, the position of the right reference sample, or the distance between the right reference sample and the upper reference sample.
[0228] Additionally, after calculating the weighted sum or average of the upper and left reference samples of the current block, the lower reference sample can be obtained based on the weighted sum or average of the calculated value and the left reference sample. If the right reference sample is obtained by weighting the calculated value and the left reference sample, the weight can be determined by considering the size of the current block, the shape of the current block, the position of the lower reference sample, or the distance between the lower reference sample and the left reference sample.
[0229] The positions of the multiple reference samples used to obtain the right-side or left-side reference samples can be fixed or can vary depending on the position of the target sample. For example, the upper reference sample can have a fixed position, such as a reference sample adjacent to the upper right corner of the current block and located on the same vertical line as the right-side reference sample, and the left reference sample can have a fixed position, such as a reference sample adjacent to the lower left corner of the current block and located on the same horizontal line as the lower reference sample. Alternatively, when obtaining the right-side reference sample, an upper reference sample with a fixed position, such as a reference sample adjacent to the upper right corner of the current block, can be used, while a left reference sample, such as a reference sample located on the same horizontal line as the target sample, can be used. When obtaining the lower reference sample, a left reference sample with a fixed position, such as a reference sample adjacent to the lower left corner of the current block, can be used, while an upper reference sample, such as a reference sample located on the same vertical line as the target sample, can be used.
[0230] Figure 18 This is a diagram illustrating an example of obtaining a right-side or bottom-side reference sample using multiple reference samples. Assume the current block is a block of size W×H.
[0231] Reference Figure 18(a) First, a lower-right reference sample P(W,H) can be generated based on the weighted sum or average of the upper reference sample P(W,-1) and the left reference sample P(-1,H) of the current block. Furthermore, a right-side reference sample P(W,y) for the predicted target sample (x,y) can be generated based on the lower-right reference sample P(W,H) and the upper reference sample P(W,-1). For example, the right-side predicted sample P(W,y) can be calculated as the weighted sum or average of the lower-right reference sample P(W,H) and the upper reference sample P(W,-1). Additionally, a lower-side reference sample P(x,H) for the predicted target sample (x,y) can be generated based on the lower-right reference sample P(W,H) and the left reference sample P(-1,H). For example, the lower-side reference sample P(x,H) can be calculated as the weighted sum or average of the lower-right reference sample P(W,H) and the left reference sample P(-1,H).
[0232] like Figure 18 As shown in (b), if a right-side reference sample and a lower-side reference sample are generated, a first prediction sample P for predicting the target block can be generated based on the generated reference samples. h (x,y) and the second predicted sample P v (x,y). At this point, the first predicted sample P can be generated based on the weighted sum of the left reference sample P(-1,y) and the right reference sample P(W,y). h (x,y) and a second predicted sample can be generated based on the weighted sum of the upper reference sample P(x,-1) and the lower reference sample P(x,H).
[0233] The positions of the reference samples used to generate the first and second predicted images can vary depending on the size or shape of the current block. That is, the positions of the upper or left reference samples used to obtain the right or lower reference samples can vary depending on the size or shape of the current block.
[0234] For example, if the current block is a square block of size N×N, a right-side reference sample can be obtained based on P(N,-1), and a bottom-side reference sample can be obtained based on P(-1,N). Alternatively, the right-side and bottom-side reference samples can be obtained based on at least one of the weighted sum, average, minimum, or maximum values of P(N,-1) and P(-1,N). On the other hand, if the current block is not a square block, the positions of the reference samples used to obtain the right-side and bottom-side reference samples can be determined differently depending on the shape of the current block.
[0235] Figure 19 and Figure 20 This is a diagram illustrating the determination of the right-side reference sample and the bottom-side reference sample for a non-square block according to an embodiment of the present invention.
[0236] like Figure 19 In the example shown, when the current block is a non-square block of size (N / 2)×N, the right reference sample is obtained based on the upper reference sample P(N / 2,-1), and the lower reference sample is obtained based on the left reference sample P(-1,N).
[0237] Alternatively, the right-side or lower-side reference sample can be obtained based on at least one of the weighted sum, average, minimum, or maximum values of the upper-side reference sample P(N / 2,-1) and the left-side reference sample P(-1,N). For example, the right-side reference sample can be obtained as the weighted sum or average of P(N / 2,-1) and P(-1,N), or it can be obtained as the weighted sum or average of the calculated value and the upper-side reference sample. Alternatively, the lower-side reference sample can be obtained as the weighted sum or average of P(N / 2,-1) and P(-1,N), or it can be obtained as the weighted sum or average of the calculated value and the left-side reference sample.
[0238] On the other hand, such as in Figure 20 In the example shown, if the current block is a non-square block of size N×(N / 2), the right reference sample can be obtained based on the upper reference sample P(N,-1), and the lower reference sample can be obtained based on the left reference sample P(-1,N / 2).
[0239] Alternatively, the right-side or lower-side reference sample can be obtained based on at least one of the weighted sum, average, minimum, or maximum values of the upper-side reference sample P(N,-1) and the left-side reference sample P(-1,N / 2). For example, the right-side reference sample can be obtained as the weighted sum or average of P(N,-1) and P(-1,N / 2), or as the weighted sum or average of the calculated value above and the upper-side reference sample. Alternatively, the lower-side reference sample can be obtained as the weighted sum or average of P(N,-1) and P(-1,N / 2), or as the weighted sum or average of the calculated value above and the left-side reference sample.
[0240] In other words, the lower reference sample can be obtained based on at least one of the lower left reference sample of the current block that is on the same horizontal line as the lower reference sample or the upper right reference sample of the current block that is on the same vertical line as the right reference sample, and the right reference sample can be obtained based on at least one of the upper right reference sample of the current block that is on the same vertical line as the right reference sample or the lower left reference sample of the current block that is on the same horizontal line as the lower reference sample.
[0241] A first predicted image can be calculated based on a weighted prediction of reference samples located on the same horizontal line as the target sample. Conversely, a second predicted image can be calculated based on a weighted prediction of reference samples located on the same vertical line as the target sample.
[0242] Alternatively, a first or second predicted image can be generated based on the average, minimum, or maximum value of a reference sample.
[0243] The method for obtaining the reference sample or the method for obtaining the first or second predicted image can be set differently depending on whether the predicted target sample is included in a predetermined region of the current block, the size or shape of the current block. Specifically, the number or position of the reference samples used to obtain the right-side or lower-side reference sample can be determined differently depending on the position of the predicted target sample, or the weight or number of the reference samples used to obtain the first or second predicted image can be set differently depending on the position of the predicted target sample.
[0244] For example, a right reference sample for obtaining a first predicted image containing predicted target samples within a predetermined region can be obtained using only the upper reference sample, and a right reference sample for obtaining a first predicted image containing predicted target samples outside the predetermined region can be obtained based on a weighted sum or average of the upper and left reference samples.
[0245] For example, as in Figure 19 In the example shown, when the current block is a non-square block whose height is greater than its width, a right-hand reference sample for the predicted target sample located at (x,y) and included in a predetermined region of the current block can be obtained based on P(N / 2,-1). On the other hand, a right-hand reference sample for the predicted target sample located at (x',y') and outside the predetermined region of the current block can be obtained based on a weighted sum or average of P(N / 2,-1) and P(-1,N).
[0246] Alternative locations, such as in Figure 20 In the example shown, when the current block is a non-square block with a width greater than its height, a lower reference sample of the predicted target sample located at (x,y) and included in a predetermined region of the current block can be obtained based on P(-1,N / 2). On the other hand, a lower reference sample of the predicted target sample located at (x',y') and outside the predetermined region of the current block can be obtained based on a weighted sum or average of P(N,-1) and P(-1,N / 2).
[0247] For example, a first or second predicted image of the target sample within a predetermined region can be generated based on a weighted sum of reference samples. Alternatively, a first or second predicted image of the target sample outside the predetermined region can be generated using the average, minimum, or maximum value of the reference samples, or it can be generated using only one of the reference samples located at a predetermined position. For example, as... Figure 19 As shown in the example, if the current block is a non-square block whose height is greater than its width, a first predicted image of the target sample located at (x,y) and included in the predetermined region can be generated by using only one of the right reference sample P(N / 2,y) obtained according to P(N / 2,-1) or the left reference sample located at P(-1,y). On the other hand, a first predicted image of the target sample located at (x',y') and outside the predetermined region can be generated based on the weighted sum or average of the right reference sample P(N / 2,y') obtained according to P(N / 2,-1) and the reference sample located at P(-1,y').
[0248] Alternative locations, such as in Figure 20 In the example shown, if the current block is a non-square block with a width greater than its height, a second predicted image of the predicted target sample located at (x,y) and included in a predetermined region of the current block can be generated using only one of the lower reference sample P(x,N / 2) obtained according to P(-1,N / 2) or the upper reference sample located at P(x,-1). Alternatively, a second predicted image of the predicted target sample located at (x',y') and not included in the predetermined region can be generated based on a weighted sum or average of the lower reference sample P(x',N / 2) obtained according to P(-1,N / 2) and the reference sample located at P(-1,y').
[0249] In the embodiments described above, the predetermined region or the outer region of the predetermined region may include the remaining region excluding the sample located at the boundary of the current block. The boundary of the current block may include at least one of a left boundary, a right boundary, a top boundary, or a bottom boundary. Furthermore, the number or location of the boundaries included in the predetermined region or the outer region of the predetermined region may be set differently depending on the shape of the current block.
[0250] In planar mode, the final predicted image can be obtained based on the weighted sum, average, minimum, or maximum value of the first and second predicted images.
[0251] For example, Equation 9 below shows the prediction based on the first predicted image P. h An example of generating the final predicted image P by weighting and summing the second predicted image Pv.
[0252] [Formula 9]
[0253] P(x, y) = (w*P h (x, y)+(1-w)*Pv(x, y)+N)>>(log2(N)+1)
[0254] In Equation 9, the prediction weight w can vary depending on the shape or size of the current block or the location of the target sample to be predicted.
[0255] For example, the prediction weight w can be obtained by considering the width of the current block, the height of the current block, or the ratio between the width and height. If the current block is a non-square block whose width is greater than its height, w can be set to assign more weight to the first prediction image. On the other hand, if the current block is a non-square block whose height is greater than its width, w can be set to assign more weight to the second prediction image.
[0256] For example, if the current block is a square, the prediction weight w can have a value of 1 / 2. On the other hand, if the current block is a non-square block whose height is greater than its width (e.g., (N / 2) × N), the prediction weight w can be set to 1 / 4, and if the current block is a non-square block whose width is greater than its height (e.g., N × (N / 2)), the prediction weight w can be set to 3 / 4.
[0257] When the intra-prediction mode of the current block is directional prediction mode, intra-prediction of the current block can be performed based on the directionality of the directional prediction mode. For example, Table 3 shows the following: Figure 8 The intra-predAng parameters (intraPredAng) of modes 2 to 34 of the directional intra-prediction mode are shown.
[0258] [Table 3]
[0259]
[0260] Table 3 lists 33 directional intra-prediction modes, but more or fewer directional intra-prediction modes can be defined.
[0261] The intra-frame direction parameters for the current block can be determined using a lookup table that defines the mapping between directional intra-frame prediction modes and intra-frame direction parameters. Alternatively, the intra-frame direction parameters for the current block can be determined based on information transmitted via a bitstream signal.
[0262] Intra-prediction of the current block can be performed using at least one of a left-side reference sample or a top-side reference sample, depending on the directionality of the directional intra-prediction mode. Here, a top-side reference sample means a reference sample whose y-axis coordinate is less than the prediction sample (x,0) included in the top row of the current block (e.g., (-1,-1) to (2W-1,-1)), and a left-side reference sample means a reference sample whose x-axis coordinate is less than the prediction sample (0,y) included in the leftmost column of the current block (e.g., (-1,-1) to (-1,2H-1)).
[0263] Reference samples for the current block can be arranged in one dimension based on the directionality of the intra-prediction mode. Specifically, when both the upper reference sample and the left reference sample are to be used for intra-prediction of the current block, reference samples for each prediction target sample can be selected, assuming they are arranged in a line in the vertical or horizontal direction.
[0264] For example, when the intra-frame orientation parameter is negative (e.g., in the case of intra-frame prediction modes corresponding to modes 11 to 25 in Table 3), a one-dimensional reference sample set (P_ref_1D) can be constructed by rearranging the upper reference sample and the left reference sample in the horizontal or vertical direction.
[0265] Figure 21 and Figure 22 This is a diagram showing a one-dimensional set of reference samples where the reference samples are rearranged into a line.
[0266] The orientation of the intra-frame prediction mode can be used to determine whether the reference samples are rearranged in the vertical or horizontal direction. For example, as in Figure 21 In the example shown, if the intra-frame prediction mode index is between 11 and 18, the upper reference sample of the current block is rotated counterclockwise to generate a one-dimensional reference sample group in which the left reference sample and the upper reference sample are arranged vertically.
[0267] On the other hand, such as in Figure 22 In the example shown, when the intra-frame prediction mode index is between 19 and 25, the left reference sample of the current block is rotated clockwise to generate a one-dimensional reference sample group in which the left reference sample and the top reference sample are arranged horizontally.
[0268] If the intra-direction parameter of the current block is not negative, intra-prediction of the current block can be performed using only the left or top reference sample. Therefore, a one-dimensional reference sample set for intra-prediction modes with non-negative intra-direction parameters can be generated by using only the left or top reference sample.
[0269] Based on the intra-frame orientation parameters, the reference sample determination index iIdx can be obtained to specify at least one reference sample for predicting the target sample. Additionally, the weight-related parameters i used to determine the weights applied to each reference sample can be obtained based on the intra-frame orientation parameters. fact For example, Equations 10 and 11 below show examples of obtaining reference samples to determine index and weight-related parameters.
[0270] [Formula 10]
[0271] iIdx=(y+1)*(P ang / 32)
[0272] ifact = [(y+1)*P ang ]31
[0273] Determining the index based on reference samples allows for the specification of at least one reference sample for each predicted target sample. For example, determining the index based on reference samples can specify the position of a reference sample in a one-dimensional reference sample set used to predict the predicted target sample in the current block. Based on the reference sample at the specified position, a predicted image (i.e., a predicted sample) can be generated for predicting the target sample.
[0274] Multiple intra-prediction modes can be used to perform intra-prediction on the current block. For example, different intra-prediction modes or different directional intra-prediction modes can be applied to each predicted target sample in the current block. Alternatively, different intra-prediction modes or different directional intra-prediction modes can be applied to each predetermined sample group in the current block. Here, the predetermined sample group can represent a sub-block of a predetermined size / shape, a block including a predetermined number of predicted target samples, or a predetermined region. The number of sample groups can be variably determined based on the size / shape of the current block, the number of predicted target samples included in the current block, the intra-prediction mode of the current block, etc., or the number of sample groups can have a fixed number predefined in the encoder and decoder. Alternatively, the number of sample groups included in the current block can also be signaled via a bitstream.
[0275] Multiple intra prediction modes used for the current block can be represented by combinations of multiple intra prediction modes. For example, multiple intra prediction modes can be represented by combinations of multiple non-directional intra prediction modes, combinations of directional and non-directional intra prediction modes, or combinations of multiple directional intra prediction modes. Alternatively, intra prediction modes can be encoded / decoded for each unit to which different intra prediction modes are applied.
[0276] When considering the intra-prediction mode of the current block, if it is determined that the target sample cannot be predicted using only a single reference sample, multiple reference samples can be used to perform the prediction of the target sample. Specifically, depending on the intra-prediction mode of the current block, the prediction of the target sample can be performed by interpolating the reference sample at a predetermined position and by interpolating the adjacent reference samples adjacent to the reference sample at the predetermined position.
[0277] For example, if the imaginary angle line following the slope of the intra-prediction mode or the angle of the intra-prediction mode does not pass through integer pixels in the one-dimensional reference sample group (i.e., reference samples at integer positions), a predicted image for predicting the target sample can be generated by interpolating the reference samples located on the angle line and the reference samples adjacent to the left / right or top / bottom sides of the reference samples. For example, Equation 11 below shows an example of interpolating two or more reference samples to generate a predicted sample P(x,y) for predicting the target sample.
[0278] [Equation 11]
[0279] P(x, y) = (32 - i fact ) / 32*P_ref_1D(x+iIdx+1)+i fact / 32*P_ref_1D(x+iIdx+2)
[0280] It can be based on the weight-related parameter i fact The coefficients of the interpolation filter are then determined. For example, the coefficients of the interpolation filter can be determined based on the distance between fractional pixels and integer pixels located on the angle line (i.e., the integer position of each reference sample).
[0281] Considering the intra-prediction mode of the current block, if the target sample can be predicted using only a reference sample, a predicted image for predicting the target sample can be generated based on the reference sample specified by the intra-prediction mode of the current block.
[0282] For example, following the slope or angle of the intra-prediction mode, an imaginary angle line passing through integer pixels in a one-dimensional reference sample set (i.e., reference samples at integer positions) can generate a predicted image for the target sample by either copying the reference sample at the integer pixel or by considering the distance between the reference sample at the integer pixel and the target sample. For example, Equation 12 below is an example of generating a predicted image P(x,y) for the target sample by copying the reference sample P_ref_1D(x+iIdx+1) specified by the intra-prediction mode of the current block in a one-dimensional sample set.
[0283] [Equation 12]
[0284] P(x, y) = P_ref_1D(x + iIdx + 1)
[0285] For ease of explanation, in the embodiments described later, a reference sample specified by the intra-prediction mode of the current block or a one-dimensional reference sample specified by the intra-prediction mode of the current block will be referred to as a first reference sample. For example, in planar mode, a reference sample used to obtain a horizontal or vertical prediction image of the predicted target sample may be referred to as a first reference sample, and in directional intra-prediction mode, a reference sample of the predicted target sample specified by the directionality of the intra-prediction mode may be referred to as a first prediction reference sample. In addition, a prediction sample generated by predicting the predicted target sample based on the first reference sample will be referred to as a first prediction image (or first prediction sample), and intra-prediction using the first reference sample will be referred to as a first intra-prediction.
[0286] According to the present invention, in order to improve the efficiency of intra-frame prediction, a second prediction image (or second prediction sample) for predicting the target sample can be obtained by using a second reference sample at a predetermined position. Specifically, the second prediction sample for predicting the target sample can be generated by a weighted prediction of a first prediction image generated as a result of a first intra-frame prediction and a second reference sample at a predetermined position.
[0287] Whether to generate a second prediction sample can be determined based on factors such as the size and shape of the current block, the intra-prediction mode of the current block (e.g., whether it is a directional intra-prediction mode), the direction of the intra-prediction mode, and the distance between the predicted target sample and the first reference sample. Here, the distance between the first reference sample and the predicted target sample can be calculated based on the x-axis distance and the y-axis distance between them.
[0288] Figure 23 This is a graph used to illustrate the distance between the first reference sample and the predicted target sample. Figure 23 The example illustrates how the distance between the first reference sample and the predicted target sample is calculated by summing the absolute value of the difference between the x-coordinates of the first reference sample and the absolute value of the difference between the y-coordinates of the first reference sample and the predicted target sample.
[0289] As an example, the distance between the predicted target sample and the first reference sample can be compared with a threshold, and then the result of the comparison can be used to determine whether to generate a second predicted image. The threshold can be determined based on the width, height, intra-frame prediction mode (e.g., whether it is a directional intra-frame prediction mode), or the slope of the intra-frame prediction mode.
[0290] A first reference sample used in the prediction within the first frame can be set as a second reference sample. For example, if multiple reference samples are used in the prediction within the first frame, any one of the multiple reference samples can be set as the second reference sample.
[0291] Alternatively, a reference sample located at a different position than the first reference sample can be set as the second reference sample. In this case, the first and second reference samples can be adjacent to the same boundary of the current block, or they can be adjacent to different boundaries of the current block. For example, both the first and second reference samples can be the upper reference sample or the left reference sample of the current block, or the first or second reference sample can be the upper reference sample, while the other reference sample can be the left reference sample.
[0292] Figure 24 and Figure 25 This is a diagram showing the positions of the first reference sample and the second reference sample.
[0293] Figure 24 An example is shown where the first and second reference samples are adjacent to the same boundary of the current block. Figure 25 Examples are shown of each of the first and second reference samples that are adjacent to a different boundary of the current block.
[0294] Specifically, in Figure 24 The text describes a first reference sample and a second reference sample, both of which are upper reference samples of the current block. Figure 25 The text describes the first reference sample of the current block as the top reference sample, and the second reference sample as the left reference sample of the current block.
[0295] The second reference sample may include the reference sample that is closest to the target sample. Here, the reference sample that is closest to the target sample may include at least one of the following: a reference sample that is located on the same horizontal line as the target sample, or a reference sample that is located on the same vertical line as the target sample.
[0296] Alternatively, a reference sample adjacent to the first reference sample can be designated as the second reference sample.
[0297] As another example, a second reference sample can be determined based on the directionality of the intra-prediction mode of the current block. For example, the second reference sample can be specified by a virtual angle line that follows the slope of the intra-prediction mode of the current block. For example, as the angle line extends to both sides, a reference sample located on one side of the angle line can be set as a first reference sample, and a reference sample located on the other side of the angle line can be set as a second reference sample.
[0298] Figure 26This is a diagram showing the positions of the first and second reference samples. If we assume the intra-prediction mode of the current block is in the lower left diagonal direction (e.g., Figure 8 Pattern 2 shown in the diagram) or the upper right diagonal direction (e.g., Figure 8 In mode 34 shown, when the angle line defined by the intra-prediction mode extends from the predicted target sample to both sides, reference samples located at positions passing through the angle line can be set as first and second reference samples. For example, if the intra-prediction mode of the current block is the upper right diagonal direction, the reference sample at position r(x+y+2,-1) is determined as the first reference sample and the reference sample at position r(-1,x+y+2) is determined as the second reference sample for the predicted target sample located at (2,2). On the other hand, if the intra-prediction mode of the current block is the lower left diagonal direction, the reference sample at position r(-1,x+y+2) is determined as the first reference sample and the reference sample at position r(x+y+2,-1) is determined as the second reference sample for the predicted target sample located at (2,2).
[0299] Alternatively, a reference sample at a predefined location can be set as a second reference sample. For example, a reference sample adjacent to the top-left corner of the current block, a reference sample adjacent to the top-right corner of the current block, or a reference sample adjacent to the bottom-left corner of the current block can be set as a second reference sample.
[0300] Multiple reference samples can be selected as second reference samples. For example, multiple reference samples that meet the above conditions can be selected as second reference samples for intra-frame prediction.
[0301] A second predicted image can be generated by a weighted sum of a first predicted image and a second reference sample. For example, Equation 13 below represents an example of generating a second predicted image P'(x,y) for predicting a target sample (x,y) by a weighted sum of a second reference sample P_ref_2nd and a first predicted image P(x,y).
[0302] [Equation 13]
[0303] P'(x, y)=(1-w)*P_ref_2nd+w*P(x, y)
[0304] Since the first predicted image is generated by copying the first reference sample or interpolating multiple first reference samples, it can be understood that the second predicted image is generated by a weighted sum of the first reference sample P_ref_1st and the second reference sample P_ref_2nd.
[0305] The weights assigned to each of the first prediction image and the second reference sample can be determined based on at least one of the following: the size of the current block, the shape of the current block, the intra-frame prediction mode of the current block, the position of the predicted target sample, the position of the first reference sample, or the position of the second reference sample. For example, the weights assigned to each of the first prediction image and the second reference image can be determined based on the distance between the predicted target sample and the first reference sample or the distance between the predicted target sample and the second reference sample.
[0306] For example, when the distance between the predicted target sample and the first reference sample is f1 and the distance between the predicted target sample and the reference sample is f2, the weighted prediction parameter w can be set to f2 / f1, f1 / f2, f2 / (f1+f2) or f2 / (f1+f2).
[0307] The final predicted image of the predicted target sample can be designated as either a first predicted image or a second predicted image. In this case, the choice between the first and second predicted images can be determined based on factors such as the size and shape of the current block, the intra-frame prediction mode of the current block, and the position of the predicted target sample. For example, the final predicted image of the predicted target sample included in a first region within the current block can be designated as the first predicted image, while the final predicted image of the predicted target sample included in a second region different from the first region can be designated as the second predicted image.
[0308] Figure 27 This is a flowchart illustrating the process of obtaining residual samples according to an embodiment of the present invention.
[0309] First, the residual coefficients S2710 of the current block can be obtained. The decoder can obtain the residual coefficients through coefficient scanning methods. For example, the decoder can perform coefficient scanning using diagonal scanning, jig-zag scanning, top-right scanning, vertical scanning, or horizontal scanning, and can obtain residual coefficients in the form of two-dimensional blocks.
[0310] Inverse quantization (S2720) can be performed on the residual coefficients of the current block.
[0311] It can be determined whether to skip the inverse transform of the dequantized residual coefficients of the current block S2730. Specifically, the decoder can determine whether to skip the inverse transform in at least one direction, either horizontal or vertical, of the current block. When it is determined that an inverse transform should be applied in at least one direction, either horizontal or vertical, the residual sample of the current block can be obtained by performing an inverse transform on the dequantized residual coefficients of the current block S2740. Here, at least one of DCT, DST, and KLT can be used to perform the inverse transform.
[0312] If the inverse transform is skipped in both the horizontal and vertical directions of the current block, then the inverse transform is not performed in the horizontal and vertical directions of the current block. In this case, the residual sample S2750 of the current block can be obtained by scaling the dequantized residual coefficients with a predetermined value.
[0313] Skipping the inverse transform in the horizontal direction means performing the inverse transform in the vertical direction instead of the horizontal one. In this case, scaling can be performed in the horizontal direction.
[0314] Skipping the inverse transform in the vertical direction means performing the inverse transform in the horizontal direction instead of the vertical one. In this case, scaling can be performed in the vertical direction.
[0315] The type of partitioning the current block can be used to determine whether an inverse transform skipping technique can be applied to the current block. For example, if the current block is generated through a binary tree-based partition, the inverse transform skipping scheme can be restricted for the current block. Therefore, when generating the current block through a binary tree-based partition, the residual sample of the current block can be obtained by performing an inverse transform on the current block. Furthermore, when generating the current block through a binary tree-based partition, the encoding / decoding of information indicating whether to skip the inverse transform (e.g., transform_skip_flag) can be omitted.
[0316] Alternatively, when generating the current block through binary tree-based partitioning, the inverse transform skipping scheme can be restricted to at least one of the horizontal or vertical directions. Here, the direction in which the inverse transform skipping scheme is restricted can be determined based on information decoded from the bitstream, or it can be adaptively determined based on at least one of the current block size, the current block shape, or the intra-frame prediction mode of the current block.
[0317] For example, when the current block is a non-square block with a width greater than its height, inverse transformation skipping schemes can be allowed only in the vertical direction and restricted in the horizontal direction. That is, when the current block is 2N×N, the inverse transformation is performed in the horizontal direction of the current block, and the inverse transformation can be selectively performed in the vertical direction.
[0318] On the other hand, when the current block is a non-square block with a height greater than its width, inverse transformation skipping schemes can be allowed only in the horizontal direction and restricted in the vertical direction. That is, when the current block is N×2N, the inverse transformation is performed in the vertical direction of the current block, and the inverse transformation can be selectively performed in the horizontal direction.
[0319] Compared to the example above, when the current block is a non-square block with a width greater than its height, the inverse transformation skipping scheme can be allowed only in the horizontal direction, and when the current block is a non-square block with a height greater than its width, the inverse transformation skipping scheme can be allowed only in the vertical direction.
[0320] Information indicating whether to skip the inverse transform in the horizontal direction or the vertical direction can be transmitted via a bitstream signal. For example, the information indicating whether to skip the inverse transform in the horizontal direction is a 1-bit flag "hor_transform_skip_flag", and the information indicating whether to skip the inverse transform in the vertical direction is a 1-bit flag "ver_transform_skip_flag". The encoder can encode at least one of "hor_transform_skip_flag" or "ver_transform_skip_flag" based on the shape of the current block. Furthermore, the decoder can determine whether to skip the inverse transform in the horizontal or vertical direction by using at least one of "hor_transform_skip_flag" or "ver_transform_skip_flag".
[0321] It can be configured to skip the inverse transformation of the current block in either direction, depending on the partition type of the current block. For example, if the current block is generated by a binary tree-based partition, the inverse transformation in either the horizontal or vertical direction can be skipped. That is, if the current block is generated by a binary tree-based partition, it is possible to determine whether to skip the inverse transformation of the current block in at least one direction, either horizontally or vertically, without encoding / decoding information indicating whether to skip the inverse transformation of the current block (e.g., transform_skip_flag, hor_transform_skip_flag, ver_transform_skip_flag).
[0322] In addition, the following configuration is provided according to this disclosure.
[0323] 1. A method for decoding video, the method comprising:
[0324] Determine the intra-prediction mode for the current block;
[0325] The first reference sample of the predicted target sample included in the current block is determined based on the intra-frame prediction mode;
[0326] A first predicted sample of the predicted target sample is generated using the first reference sample; and
[0327] A second prediction sample is generated using the first prediction sample and a second reference sample located at a different position than the first reference sample.
[0328] 2. The method according to configuration 1, wherein the second reference sample includes at least one of the following reference samples: a reference sample located on the same horizontal line as the predicted target sample, or a reference sample located on the same vertical line as the predicted target sample.
[0329] 3. The method according to configuration 1, wherein each of the first reference sample and the second reference sample is adjacent to a different boundary of the current block.
[0330] 4. The method according to configuration 3, wherein the position of the second reference sample is determined based on the directionality of the intra-frame prediction mode.
[0331] 5. The method according to configuration 1, wherein the second prediction sample is generated based on the weighted sum of the first prediction sample and the second reference sample.
[0332] 6. The method according to configuration 5, wherein a weight applied to each of the first prediction sample and the second reference sample is determined based on the position of the first reference sample and the position of the second reference sample.
[0333] 7. The method according to configuration 1, wherein whether to generate the second prediction sample is determined based on the directionality of the intra-frame prediction mode.
[0334] 8. A method for encoding video, the method comprising:
[0335] Determine the intra-prediction mode for the current block;
[0336] The first reference sample of the predicted target sample included in the current block is determined based on the intra-frame prediction mode;
[0337] A first predicted sample of the predicted target sample is generated using the first reference sample; and
[0338] A second prediction sample is generated using the first prediction sample and a second reference sample located at a different position than the first reference sample.
[0339] 9. The method according to configuration 8, wherein the second reference sample includes at least one of the following reference samples: a reference sample located on the same horizontal line as the predicted target sample, or a reference sample located on the same vertical line as the predicted target sample.
[0340] 10. The method according to configuration 8, wherein each of the first reference sample and the second reference sample is adjacent to a different boundary of the current block.
[0341] 11. The method according to configuration 10, wherein the position of the second reference sample is determined based on the directionality of the intra-frame prediction mode.
[0342] 12. The second prediction sample is generated based on the weighted sum of the first prediction sample and the second reference sample, according to the method described in configuration 8.
[0343] 13. The method according to configuration 12, wherein a weight applied to each of the first prediction sample and the second reference sample is determined based on the position of the first reference sample and the position of the second reference sample.
[0344] 14. The method according to configuration 8, wherein whether to generate the second prediction sample is determined based on the directionality of the intra-frame prediction mode.
[0345] 15. An apparatus for decoding video, the apparatus comprising:
[0346] An intra-prediction unit is configured to: determine an intra-prediction mode for a current block; determine a first reference sample for a predicted target sample included in the current block based on the intra-prediction mode; generate a first predicted sample for the predicted target sample using the first reference sample; and generate a second predicted sample for the predicted target sample using the first predicted sample and a second reference sample located at a different position than the first reference sample.
[0347] Although the above embodiments have been described based on a series of steps or flowcharts, they do not limit the temporal order of the invention and can be executed simultaneously or in different orders as needed. Furthermore, each of the components (e.g., units, modules, etc.) constituting the block diagrams in the above embodiments can be implemented by hardware devices or software and multiple components. Alternatively, multiple components can be combined and implemented by a single hardware device or software. The above embodiments can be implemented in the form of program instructions, which can be executed by various computer components and recorded in a computer-readable recording medium. A computer-readable recording medium can include one or a combination of program commands, data files, data structures, etc. Examples of computer-readable media include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs and DVDs; magneto-optical media such as optical-magnetic floppy disks; media; and hardware devices specifically configured to store and execute program instructions, such as ROMs, RAMs, flash memory, etc. Hardware devices can be configured to operate as one or more software modules to perform the processing according to the invention, and vice versa.
[0348] Industrial application
[0349] This invention can be applied to electronic devices capable of encoding / decoding video.
Claims
1. A method for decoding video, the method comprising: The residual coefficients of the current block are obtained from the bit stream based on the scanning order of diagonal scanning; Perform inverse quantization on the residual coefficients of the current block; as well as The residual samples of the current block are obtained by performing an inverse transform on the inverse-quantized residual coefficients. Specifically, the inverse transform is selectively performed based on a transform skip flag that indicates whether to skip the inverse transform. The inverse transform includes the vertical inverse transform and the horizontal inverse transform, as well as Specifically, when the current block is one of the two partitions obtained by dividing the coded block using a binary method, the transform skip flag of the current block is not parsed from the bitstream.
2. The method according to claim 1, wherein, When the current block is one of two partitions obtained by dividing the coded block using a bisection method, skipping the inverse transform for the current block is not allowed.
3. The method according to claim 2, wherein, The inverse transform is performed by using at least one of a transform type based on discrete cosine transform and a transform type based on discrete sine transform.
4. The method according to claim 3, wherein, The coded block is divided into two partitions, either symmetrically or asymmetrically.
5. The method according to claim 4, wherein, When a coded block is asymmetrically divided into two partitions, one of the partitions has 1 / 4 the size of the coded block, and the other of the partitions has 3 / 4 the size of the coded block.
6. A method for encoding video, the method comprising: Determine whether to perform a transformation on the residual samples of the current block; The transformation coefficients are obtained by performing or skipping the transformation on the residual samples of the current block; The quantized transform coefficients are obtained by performing quantization on the transform coefficients of the current block; as well as The quantized transform coefficients are encoded based on the scanning order of diagonal scanning. Specifically, a transform skip flag, indicating whether to skip a transform, is encoded by determining whether to perform a transform on the residual samples of the current block. The transformations include vertical transformations and horizontal transformations, as well as... Specifically, when the current block is one of the two partitions obtained by dividing the coded block using a binary division method, the transformation skip flag of the current block is not encoded into the bit stream.
7. A transmission method, comprising: Determine whether to perform a transformation on the residual samples of the current block; The transformation coefficients are obtained by performing or skipping the transformation on the residual samples of the current block; The quantized transform coefficients are obtained by performing quantization on the transform coefficients of the current block; A bitstream is generated by encoding the quantized transform coefficients based on a diagonal scan sequence; as well as Transmit bit stream, Specifically, the transform skip flag, which indicates whether to skip the transform, is encoded by determining whether to perform a transform on the residual samples of the current block. The transformations include vertical transformations and horizontal transformations, as well as... Specifically, when the current block is one of the two partitions obtained by dividing the coded block using a binary division method, the transformation skip flag of the current block is not encoded into the bit stream.
Citation Information
Patent Citations
Coding significant coefficient information in transform skip mode
CN103999460A
Method and apparatus for intra transform skip mode
CN104380734A