Image decoding apparatus, image encoding apparatus, apparatus for transmitting image data
By configuring multiple reference sample lines and adaptive filtering technology, the compression efficiency problem of high-resolution and high-quality image data is solved, achieving more efficient encoding and decoding, and reducing transmission and storage costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LX SEMICON CO LTD
- Filing Date
- 2018-06-21
- Publication Date
- 2026-07-31
AI Technical Summary
High-resolution and high-quality image data increases the amount of data, leading to increased transmission and storage costs, and necessitates improving the compression efficiency of image encoding/decoding.
By configuring multiple reference sample lines, the intra-prediction mode of the current block is reconstructed, and intra-prediction is performed based on the intra-prediction mode and reference sample lines. The filtering and filter type are adaptively determined, thereby improving encoding and decoding efficiency.
It improves image compression efficiency and reduces sending and storage costs.
Smart Images

Figure CN117499630B_ABST
Abstract
Description
[0001] This application is a divisional application of the original invention patent application No. 201880044811.8 (filed on June 21, 2018, international application No. PCT / KR2018 / 007016, invention title: method and apparatus for encoding / decoding images and recording medium for storing bit streams). Technical Field
[0002] This invention relates to a method and apparatus for encoding / decoding images, and a recording medium for storing bitstreams. In particular, this invention relates to a method and apparatus for encoding / decoding images using intra-frame prediction, and a recording medium for storing bitstreams generated by the image encoding method / apparatus of this invention. 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, high-resolution and high-quality image data involves a significant increase in data volume compared to conventional image data. Consequently, 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 technologies are needed for higher resolution and higher quality images.
[0004] Image compression techniques encompass a variety of methods, including: inter-frame prediction, which predicts pixel values in the current frame from previous or subsequent frames; intra-frame prediction, which predicts pixel values in the current frame using pixel information from the current frame; transform and quantization techniques for compressing the energy of residual signals; entropy coding, which assigns short codes to values with high frequency of occurrence and long codes to values with low frequency of occurrence; and so on. Image data can be efficiently compressed using such image compression techniques and can then be transmitted or stored. Summary of the Invention
[0005] Technical issues
[0006] The purpose of this invention is to provide a method and apparatus for encoding and decoding images to improve compression efficiency.
[0007] Another object of the present invention is to provide a method and apparatus for encoding and decoding images using intra-frame prediction to improve compression efficiency.
[0008] Another object of the present invention is to provide a recording medium for storing a bitstream generated by the image encoding method / device of the present invention.
[0009] Technical solution
[0010] According to the present invention, an image decoding method is provided, wherein the image decoding method includes: configuring a plurality of reference sample lines; reconstructing the intra-prediction mode of the current block; and performing intra-prediction on the current block based on the intra-prediction mode and the plurality of reference sample lines.
[0011] In the image decoding method according to the present invention, the step of configuring multiple reference sample lines can perform filling on reference samples located at predetermined positions without determining the availability of the reference samples.
[0012] In the image decoding method according to the present invention, when the lengths of the horizontal side and the vertical side of the current block are W and H respectively, the x-coordinate or y-coordinate of the predetermined position can be equal to or greater than W+H.
[0013] In the image decoding method according to the present invention, the filling step may be performed using a reference sample point adjacent to the predetermined position, the reference sample point being located at a position with x-coordinate or y-coordinate of W+H-1.
[0014] In the image decoding method according to the present invention, the step of configuring multiple reference sample lines may include: performing filtering on each of the multiple reference sample lines.
[0015] In the image decoding method according to the present invention, it can be adaptively determined whether to apply at least one of the filtering and filter types based on at least one of the intra-frame prediction mode, size, shape and target reference sample line of the current block.
[0016] In the image decoding method according to the present invention, the number of the plurality of reference sample lines can be adaptively determined based on the intra-frame prediction mode of the current block.
[0017] In the image decoding method according to the present invention, the number of the plurality of reference sample lines can be adaptively determined based on whether the left boundary or the upper boundary of the current block corresponds to the boundary of a predetermined image region.
[0018] In the image decoding method according to the present invention, when the left boundary of the current block is the boundary of the predetermined image region, a single reference sample line can be used for the sample points on the left side of the current block, and when the upper boundary of the current block is the boundary of the predetermined image region, a single reference sample line can be used for the sample points on the upper side of the current block.
[0019] In the image decoding method according to the present invention, the predetermined image region may be at least one of a frame, a parallel block, a stripe, and a coding tree block (CTB).
[0020] Furthermore, according to the present invention, an image coding method may be provided, the image coding method comprising: determining an intra-prediction mode for a current block; configuring multiple reference sample lines; and performing intra-prediction on the current block based on the intra-prediction mode and the multiple reference sample lines.
[0021] In the image encoding method according to the present invention, the step of configuring multiple reference sample lines can perform filling on reference samples located at predetermined positions without determining the availability of the reference samples.
[0022] In the image encoding method according to the present invention, when the lengths of the horizontal side and the vertical side of the current block are W and H respectively, the x-coordinate or y-coordinate of the predetermined position can be equal to or greater than W+H.
[0023] In the image encoding method according to the present invention, the filling step may be performed using a reference sample point adjacent to the predetermined position, the reference sample point being located at a position with x-coordinate or y-coordinate of W+H-1.
[0024] In the image encoding method according to the present invention, the step of configuring multiple reference sample lines may include: performing filtering on each of the multiple reference sample lines.
[0025] In the image coding method according to the present invention, it can be adaptively determined whether to apply at least one of the filtering and filter types based on at least one of the intra-frame prediction mode, size, shape, and target reference sample line of the current block.
[0026] In the image coding method according to the present invention, the number of the plurality of reference sample lines can be adaptively determined based on the intra-frame prediction mode of the current block.
[0027] In the image encoding method according to the present invention, the number of the plurality of reference sample lines can be adaptively determined based on whether the left boundary or the upper boundary of the current block corresponds to the boundary of a predetermined image region.
[0028] In the image encoding method according to the present invention, when the left boundary of the current block is the boundary of the predetermined image region, a single reference sample line can be used for the sample points on the left side of the current block, and when the upper boundary of the current block is the boundary of the predetermined image region, a single reference sample line can be used for the sample points on the upper side of the current block.
[0029] Furthermore, the recording medium according to the invention can store bitstreams generated by the image encoding method according to the invention.
[0030] Beneficial effects
[0031] According to the present invention, a method and apparatus for encoding and decoding images to improve compression efficiency can be provided.
[0032] According to the present invention, a method and apparatus for encoding and decoding images using intra-frame prediction to improve compression efficiency can be provided.
[0033] According to the present invention, a recording medium for storing a bitstream generated by the image encoding method / device of the present invention can be provided. Attached Figure Description
[0034] Figure 1 This is a block diagram illustrating the configuration of an encoding device according to an embodiment of the present invention.
[0035] Figure 2 This is a block diagram illustrating the configuration of a decoding device according to an embodiment of the present invention.
[0036] Figure 3 It is a schematic diagram illustrating the partitioning structure of an image when it is encoded and decoded.
[0037] Figure 4 This is a diagram illustrating an embodiment of intra-frame prediction processing.
[0038] Figure 5 This is a diagram used to illustrate intra-frame prediction according to the present invention.
[0039] Figure 6 This is an exemplary diagram illustrating the relationship between luminance blocks and chrominance blocks.
[0040] Figure 7 It is a diagram used to describe multiple reconstructed sample point lines.
[0041] Figure 8 This is a diagram used to describe the process of replacing unavailable samples with available samples.
[0042] Figure 9 Various filter shapes are shown.
[0043] Figure 10 It is a diagram used to describe intra-frame prediction based on the shape of the current block.
[0044] Figure 11 This is a diagram illustrating an embodiment using two reference sample lines.
[0045] Figure 12 It is a diagram of neighboring samples used to describe the parameters of the linear model used to predict the chromaticity component from the luminance component in the current block.
[0046] Figure 13 This is an exemplary diagram illustrating the process of reconstructing color component blocks.
[0047] Figure 14This is a diagram illustrating an embodiment of performing reconstruction using multiple upper reference sample lines and / or multiple left reference sample lines.
[0048] Figure 15 This is an exemplary diagram showing reference samples used for reconstruction operations based on the intra-frame prediction mode or coding parameters of the corresponding block.
[0049] Figure 16 This is an illustration of an exemplary reconstructed first color component corresponding block when the target block predicted by the second color component is a 4×4 block.
[0050] Figure 17 This is a diagram showing the sample points of the first color component and the sample points of the second color component. Detailed Implementation
[0051] Various modifications can be made to this invention, and various embodiments of the invention exist, wherein examples of various embodiments of the invention will now be provided and described in detail with reference to the accompanying drawings. However, the invention is not limited thereto, although exemplary embodiments may be interpreted as including all modifications, equivalents, or substitutions within the technical concept and scope of the invention. In various respects, similar reference numerals refer to the same or similar functions. In the drawings, the shape and size of elements may be exaggerated for clarity. In the following detailed description of the invention, reference is made to the accompanying drawings, which illustrate specific embodiments in which the invention may be practiced. These embodiments have been described in sufficient detail to enable those skilled in the art to practice this disclosure. It should be understood that the various embodiments of this disclosure, though different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments without departing from the spirit and scope of this disclosure. Furthermore, it should be understood that the position or arrangement of various elements within each disclosed embodiment may be modified without departing from the spirit and scope of this disclosure. Therefore, the following detailed description should not be considered limiting, and the scope of this disclosure is defined only by the appended claims (and, where appropriate, the full scope of the equivalents claimed in the claims).
[0052] The terms "first," "second," etc., used in this specification may be used to describe various components, but the components should not be construed as limited to these terms. These terms are used only to distinguish one component from other components. For example, without departing from the scope of the invention, a "first" component may be named a "second" component, and a "second" component may similarly be named a "first" component. The term "and / or" includes a combination of multiple items or any one of multiple items.
[0053] It will be understood that in this specification, when an element is referred to merely as "connected to" or "coupled to" another element rather than "directly connected to" or "directly coupled to" another element, it may be "directly connected to" or "directly coupled to" another element, or connected to or coupled to another element where there is another element intervening between the element and the other element. Conversely, it should be understood that when an element is referred to as "directly coupled to" or "directly connected" to another element, there is no intermediate element.
[0054] Furthermore, the constituent parts shown in the embodiments of the present invention are illustrated independently to represent different functional characteristics. Therefore, this does not imply that each constituent part is constructed as 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 one constituent part, or a constituent part can be divided into multiple constituent parts to perform each function. Embodiments that combine each constituent part and embodiments that divide a constituent part are also included within the scope of the present invention without departing from its spirit.
[0055] The terminology used in this specification is for describing particular embodiments only and is not intended to limit the invention. Unless the context clearly distinguishes them, expressions used in the singular include those used in the plural. It should be understood throughout this specification that terms such as “comprising,” “having,” etc., are intended to indicate the presence of features, numbers, steps, actions, elements, components, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, components, or combinations thereof may be present or added. In other words, when a particular element is referred to as “comprising,” it does not exclude elements other than the corresponding element, but rather includes additional elements within the embodiments of the invention or the scope of the invention.
[0056] Furthermore, some components may not be essential for performing the basic functions of the invention, but rather selective components that only improve its performance. The invention can be implemented by including only the essential components necessary for achieving the essence of the invention, excluding components used to improve performance. Structures that include only the essential components and exclude selective components used only to improve performance are also included within the scope of the invention.
[0057] In the following, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing exemplary embodiments of the invention, well-known functions or structures will not be described in detail, as they may unnecessarily obscure the understanding of the invention. Like constituent elements in the drawings are indicated by like reference numerals, and repeated descriptions of like elements will be omitted.
[0058] In the following text, an image may refer to a frame that constitutes a video, or it may refer to the video itself. For example, "encoding or decoding an image or both" may refer to "encoding or decoding a moving image or both", and may refer to "encoding or decoding an image within an image of a moving image or both".
[0059] In the following text, the terms "moving images" and "video" are used to mean the same thing and are interchangeable.
[0060] In the following text, the target image can be an encoded target image that serves as an encoding target and / or a decoded target image that serves as a decoding target. Furthermore, the target image can be an input image input to an encoding device and an input image input to a decoding device. Here, the target image may have the same meaning as the current image.
[0061] In the following text, the terms “image,” “picture,” “frame,” and “screen” may be used as having the same meaning and interchangeably with each other.
[0062] In the following text, a target block can be an encoding target block that serves as an encoding target and / or a decoding target block that serves as a decoding target. Furthermore, a target block can be the current block that serves as the current encoding and / or decoding target. For example, the terms "target block" and "current block" can be used to mean the same thing and are interchangeable.
[0063] In the following text, the terms “block” and “unit” may be used to mean the same thing and are interchangeable. Alternatively, “block” may refer to a specific unit.
[0064] In the following text, the terms “region” and “fragment” are used interchangeably.
[0065] In the following text, a specific signal can be a signal representing a specific block. For example, the original signal can be a signal representing the target block. The prediction signal can be a signal representing the prediction block. The residual signal can be a signal representing the residual block.
[0066] In this embodiment, each of the specific information, data, flags, indexes, elements, and attributes may have a value. A value equal to "0" for information, data, flags, indexes, elements, and attributes may represent logical false or a first predefined value. In other words, the values "0", false, logical false, and the first predefined value can be interchanged with each other. A value equal to "1" for information, data, flags, indexes, elements, and attributes may represent logical true or a second predefined value. In other words, the values "1", true, logical true, and the second predefined value can be interchanged with each other.
[0067] When variables i or j are used to represent columns, rows, or indices, the value of i can be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, columns, rows, indices, etc., can be counted starting from 0, or they can be counted starting from 1.
[0068] Terminology Description
[0069] Encoder: Represents the device that performs encoding. In other words, it refers to the encoding device.
[0070] Decoder: Represents the device that performs decoding. In other words, it refers to the decoding device.
[0071] A block is an M×N sample array. Here, M and N can represent positive integers, and a block can represent a two-dimensional sample array. A block can refer to a unit. The current block can represent a coding target block that becomes the target during encoding, or a decoding target block that becomes the target during decoding. Furthermore, the current block can be at least one of a coding block, a prediction block, a residual block, and a transform block.
[0072] Samples are the basic units that make up a block. Based on the bit depth (Bd), samples can be represented as numbers from 0 to 2. Bd The value is -1. In this invention, a sample point can be used to represent a pixel. That is, a sample point, a pel, and a pixel can have the same meaning.
[0073] Unit: Refers to both encoding and decoding units. When encoding and decoding an image, a unit can be a region generated by partitioning a single image. Furthermore, a unit can represent a sub-partitioning unit when a single image is partitioned into sub-partitioning units during encoding or decoding. That is, an image can be partitioned into multiple units. When encoding and decoding an image, predetermined processing can be performed for each unit. A single unit can be partitioned into sub-units smaller than the unit's size. Depending on the function, a unit can represent a block, macroblock, coding tree unit, coding tree block, coding unit, coding block, prediction unit, prediction block, residual unit, residual block, transform unit, transform block, etc. Furthermore, to distinguish a unit from a block, a unit can include a luma component block, a chroma component block associated with the luma component block, and syntax elements for each chroma component block. Units can have various sizes and shapes; specifically, the shape of a unit can be a two-dimensional geometric figure, such as a square, rectangle, trapezoid, triangle, pentagon, etc. In addition, the cell information may include at least one of the following: cell type indicating coding cell, prediction cell, transform cell, etc., cell size, cell depth, and the order of encoding and decoding of the cell.
[0074] A coding tree unit is a single coding tree block configured with the luminance component Y and two coding tree blocks associated with the chrominance components Cb and Cr. Furthermore, a coding tree unit can represent a block and the syntax elements of each block. Each coding tree unit can be partitioned using at least one of quadtree partitioning, binary tree partitioning, ternary tree partitioning, etc., to configure lower-level units such as coding units, prediction units, transform units, etc. A coding tree unit can be used as a term to specify a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, a quadtree can represent a quaternion tree.
[0075] When the size of the coded block falls within a first predetermined range, only quadtree partitioning is permitted for the coded block. Here, the first predetermined range can be defined by at least one of the maximum and minimum sizes of the coded blocks that can be partitioned only by quadtree partitioning. Information indicating the maximum / minimum size of the coded block that is permitted for quadtree partitioning can be transmitted as data included in the bitstream, and this information can be transmitted as signals in units of at least one of sequence, frame parameters, and stripes (segments). Optionally, the maximum / minimum size of the coded block can be a fixed size preset in the encoder / decoder. For example, when the size of the coded block is in the range of 64×64 to 256×256, the coded block can be partitioned only by quadtree partitioning. Optionally, when the size of the coded block is greater than the maximum size of the transform block (TB), the coded block can be partitioned only by quadtree partitioning. In this case, the block to be partitioned into quadrants can be either a coded block or a transform block. In this case, information indicating quadtree partitioning of the coded block (e.g., split_flag) can be a flag indicating whether the coded unit is partitioned by quadtree partitioning. When the size of the coded block falls within the second predetermined range, the coded block can only be partitioned using binary tree partitioning or ternary tree partitioning. In this case, the above description of quadtree partitioning can also be applied to binary tree partitioning or ternary tree partitioning.
[0076] Encoding block: can be used as a term to specify any one of the Y encoding block, Cb encoding block, and Cr encoding block.
[0077] Neighboring blocks: These can represent blocks adjacent to the current block. A block adjacent to the current block can be a block that touches the boundary of the current block, or a block located within a predetermined distance from the current block. A neighboring block can also represent a block adjacent to a vertex of the current block. Here, a block adjacent to a vertex of the current block can be a block that is vertically adjacent to a block horizontally adjacent to the current block, or a block that is horizontally adjacent to a block vertically adjacent to the current block.
[0078] Reconstructed neighboring blocks: These can represent neighboring blocks that are adjacent to the current block and have already been spatially / temporally encoded or decoded. Here, reconstructed neighboring blocks can represent reconstructed neighboring units. Reconstructed spatial neighboring blocks can be blocks within the current frame that have already been reconstructed through encoding or decoding, or both. Reconstructed temporally neighboring blocks are blocks within the reference image that are located at the position corresponding to the current block in the current frame, or are neighboring blocks of that block.
[0079] Cell depth: Represents the degree of cell partitioning. In a tree structure, the highest node (root node) corresponds to the first unpartitioned cell. Furthermore, the highest node can have the minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 represents a cell generated by partitioning the first cell once. A node with a depth of level 2 represents a cell generated by partitioning the first cell twice. A node with a depth of level n represents a cell generated by partitioning the first cell n times. Leaf nodes can be the lowest-level nodes and cannot be further partitioned. The depth of a leaf node can be the highest-level. For example, a predefined value for the highest-level can be 3. The root node can have the lowest depth, and the leaf nodes can have the deepest depth. Additionally, when cells are represented as a tree structure, the level at which the cell exists can represent the cell depth.
[0080] Bitstream: A bitstream that can represent encoded image information.
[0081] Parameter set: Corresponds to the header information in the configuration within the bitstream. At least one of the video parameter set, sequence parameter set, frame parameter set, and adaptive parameter set may be included in the parameter set. In addition, the parameter set may include slice header and tile header information.
[0082] Explanation: This could mean determining the value of a syntax element by performing entropy decoding, or it could mean entropy decoding itself.
[0083] Symbols: can represent at least one of the syntax elements, encoding parameters, and transform coefficient values of the encoding / decoding target unit. Additionally, symbols can represent entropy encoding targets or entropy decoding results.
[0084] Prediction mode: This can be information indicating the mode of encoding / decoding using intra-frame prediction or the mode of encoding / decoding using inter-frame prediction.
[0085] Prediction Unit: A basic unit that can represent the process of performing prediction (such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation). A single prediction unit can be partitioned into multiple partitions of smaller size, or into multiple lower-level prediction units. Multiple partitions can be the basic units when performing prediction or compensation. Partitions generated by dividing prediction units can also be prediction units.
[0086] Prediction unit partitioning: can be represented by the form obtained by partitioning prediction units.
[0087] Transform unit: This can represent the basic unit used in performing encoding / decoding (such as transforming, inverse transforming, quantizing, dequantizing, and encoding / decoding transform coefficients of residual signals). A single transform unit can be partitioned into multiple lower-level transform units with smaller sizes. Here, the transform / inverse transform may include at least one of a first transform / first inverse transform and a second transform / second inverse transform.
[0088] Scaling: This refers to the process of multiplying the quantization level by a factor. Transform coefficients can be generated by scaling the quantization level. Scaling can also be called inverse quantization.
[0089] Quantization parameters: These represent values used when generating quantization levels using transform coefficients during quantization. Quantization parameters can also represent values used when generating transform coefficients by scaling the quantization levels during dequantization. Quantization parameters can be values mapped to the quantization step size.
[0090] Incremental quantization parameter: can represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0091] Scan: This can represent a method of sorting coefficients within a cell, block, or matrix. For example, the operation of changing a two-dimensional matrix of coefficients into a one-dimensional matrix can be called a scan, and the operation of changing a one-dimensional matrix of coefficients into a two-dimensional matrix can be called a scan or inverse scan.
[0092] Transform coefficients: These represent the coefficient values generated after a transform is performed in the encoder. Transform coefficients can also represent the coefficient values generated after at least one of entropy decoding and dequantization is performed in the decoder. The quantization level obtained by quantizing the transform coefficients or residual signal, or the quantized transform coefficient level, can also fall within the meaning of transform coefficients.
[0093] Quantization level: This can represent the value generated in the encoder by quantizing the transform coefficients or residual signal. Optionally, the quantization level can represent the value that is the target of dequantization to be dequantized in the decoder. Similarly, the transform coefficient level, as a result of transform and quantization, can also fall within the meaning of quantization level.
[0094] Non-zero transform coefficients: can represent transform coefficients with values other than zero, or transform coefficient levels or quantization levels with values other than zero.
[0095] Quantization matrix: A matrix used in quantization or dequantization processes to improve subjective or objective image quality. The quantization matrix can also be referred to as a scaling list.
[0096] Quantization matrix coefficients: These represent each element within the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.
[0097] Default matrix: can represent a predefined quantization matrix in the encoder or decoder.
[0098] Non-default matrix: can represent a quantization matrix that is not predefined in the encoder or decoder but is sent by the user via signal.
[0099] Statistical value: A statistical value for at least one of the following: a variable, coding parameter, constant value, etc., that has a computable specific value can be one or more of the following: mean, weighted average, weighted sum, minimum, maximum, most frequent value, median, interpolation value.
[0100] Figure 1 This is a block diagram illustrating the configuration of an encoding device according to an embodiment of the present invention.
[0101] Encoding device 100 may be an encoder, a video encoding device, or an image encoding device. The video may include at least one image. Encoding device 100 may encode at least one image sequentially.
[0102] Reference Figure 1 The encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switcher 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy coding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference frame buffer 190.
[0103] Encoding device 100 can encode the input image using intra-frame mode, inter-frame mode, or both. Furthermore, encoding device 100 can generate a bitstream including encoding information by encoding the input image and output the generated bitstream. The generated bitstream can be stored in a computer-readable recording medium or streamed via a wired / wireless transmission medium. When intra-frame mode is used as the prediction mode, switcher 115 can switch to intra-frame mode. Optionally, when inter-frame mode is used as the prediction mode, switcher 115 can switch to inter-frame mode. Here, intra-frame mode can refer to intra-frame prediction mode, and inter-frame mode can refer to inter-frame prediction mode. Encoding device 100 can generate prediction blocks for input blocks of the input image. Furthermore, encoding device 100 can encode residual blocks using the residual between the input block and the prediction block after generating the prediction blocks. The input image can be referred to as the current image as the current encoding target. The input block can be referred to as the current block as the current encoding target, or as the encoding target block.
[0104] When the prediction mode is intra-frame mode, the intra-frame prediction unit 120 can use samples from blocks that have been encoded / decoded and are adjacent to the current block as reference samples. The intra-frame prediction unit 120 can perform spatial prediction on the current block using the reference samples, or generate prediction samples for the input block by performing spatial prediction. Here, intra-frame prediction can refer to prediction within a frame.
[0105] When the prediction mode is inter-frame mode, the motion prediction unit 111 can retrieve the region that best matches the input block from the reference image during motion prediction and derive the motion vector using the retrieved region. In this case, the search region can be used as the region. The reference image can be stored in the reference frame buffer 190. Here, the reference image can be stored in the reference frame buffer 190 when encoding / decoding the reference image is performed.
[0106] The motion compensation unit 112 can generate a prediction block by performing motion compensation on the current block using motion vectors. Here, inter-frame prediction can refer to prediction or motion compensation between frames.
[0107] When the value of the motion vector is not an integer, motion prediction unit 111 and motion compensation unit 112 can generate prediction blocks by applying an interpolation filter to a portion of the reference frame. To perform inter-frame prediction or motion compensation on the coding unit, it can be determined which mode—skip mode, merge mode, Advanced Motion Vector Prediction (AMVP) mode, or current frame reference mode—will be used for motion prediction and motion compensation of the prediction units included in the corresponding coding unit. Then, depending on the determined mode, inter-frame prediction or motion compensation can be performed differently.
[0108] Subtractor 125 can generate a residual block using the residual between the input block and the prediction block. The residual block can be referred to as a residual signal. The residual signal can represent the difference between the original signal and the predicted signal. Furthermore, the residual signal can be a signal generated by transforming or quantizing, or transforming and quantizing, the difference between the original signal and the predicted signal. The residual block can be the residual signal of a block cell.
[0109] Transform unit 130 can generate transform coefficients by performing a transform on the residual block and output the generated transform coefficients. Here, the transform coefficients can be coefficient values generated by performing a transform on the residual block. When a transform skip mode is applied, transform unit 130 can skip the transform on the residual block.
[0110] The level of quantization can be generated by applying quantization to the transform coefficients or to the residual signal. In the following examples, the level of quantization may also be referred to as the transform coefficients.
[0111] The quantization unit 140 can generate a quantization level by quantizing the transform coefficients or residual signal according to parameters, and output the generated quantization level. Here, the quantization unit 140 can quantize the transform coefficients using a quantization matrix.
[0112] Entropy coding unit 150 can generate a bitstream by performing entropy coding on the values calculated by quantization unit 140 according to a probability distribution or on the coding parameter values calculated during encoding, and output the generated bitstream. Entropy coding unit 150 can perform entropy coding on sample information of the image and information used for decoding the image. For example, the information used for decoding the image may include syntax elements.
[0113] When entropy coding is applied, symbols are represented such that fewer bits are allocated to symbols with high generation probability and more bits are allocated to symbols with low generation probability, thus reducing the size of the bitstream used to encode the symbols. The entropy coding unit 150 can use coding methods for entropy coding such as Exponential Golomb, Context Adaptive Variable Length Coding (CAVLC), and Context Adaptive Binary Arithmetic Coding (CABAC). For example, the entropy coding unit 150 can perform entropy coding by using a variable-length code (VLC) table. Furthermore, the entropy coding unit 150 can derive a binarization method for the target symbol and a probability model for the target symbol / bits, and perform arithmetic coding by using the derived binarization method and context model.
[0114] In order to encode the transform coefficient levels (quantization levels), the entropy coding unit 150 can change the coefficients in two-dimensional block form into one-dimensional vector form by using a transform coefficient scanning method.
[0115] Encoding parameters may include information such as syntax elements (flags, indexes, etc.) encoded in the encoder and signaled to the decoder, as well as information derived during encoding or decoding. Encoding parameters can represent the information required when encoding or decoding an image. For example, at least one value of the following, or a combination thereof, may be included in the encoding parameters: cell / block size, cell / block depth, cell / block partitioning information, cell / block shape, cell / block partitioning structure, whether quadtree partitioning is performed, whether binary tree partitioning is performed, binary tree partitioning direction (horizontal or vertical), binary tree partitioning form (symmetric or asymmetric), whether ternary tree partitioning is performed, ternary tree partitioning direction (horizontal or vertical), ternary tree partitioning form (symmetric or asymmetric), whether multi-type tree partitioning is performed, and multi-type tree partitioning direction (…). Horizontal or vertical orientation), multi-type tree partitioning (symmetric or asymmetric partitioning), multi-type tree partitioning, prediction mode (intra-frame prediction or inter-frame prediction), luma intra-frame prediction mode / direction, chroma intra-frame prediction mode / direction, intra-frame partitioning information, inter-frame partitioning information, coded block partitioning flag, prediction block partitioning flag, transform block partitioning flag, reference sample filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, intra-frame prediction mode, inter-frame prediction mode, motion signal Information, Motion Vector, Motion Vector Difference, Reference Frame Index, Inter-Frame Prediction Angle, Inter-Frame Prediction Indicator, Prediction List Utilization Flag, Reference Frame List, Reference Frame, Motion Vector Predictor Index, Motion Vector Predictor Candidates, Motion Vector Candidate List, Whether to Use Merge Mode, Merge Index, Merge Candidates, Merge Candidate List, Whether to Use Skip Mode, Interpolation Filter Type, Interpolation Filter Taps, Interpolation Filter Coefficients, Motion Vector Magnitude, Motion Vector Representation Accuracy, Transform Type, Transform Size, Information on Whether the Primary (First) Transform is Used, Information on Whether the Secondary Transform is Used, Primary Transform Index, Secondary Transform Index, Whether the Residual Signal exists Information, code block style, code block flag (CBF), quantization parameters, quantization parameter residuals, quantization matrix, whether intra-loop filter is applied, intra-loop filter coefficients, intra-loop filter taps, intra-loop filter shape / form, whether deblocking filter is applied, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether adaptive sample offset is applied, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether adaptive loop filter is applied, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form, binarization / inverse binarization method,Context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bits, bypass binary bits, valid coefficient flag, last valid coefficient flag, encoding flag for the unit of the coefficient group, position of the last valid coefficient, flag indicating whether the coefficient value is greater than 1, flag indicating whether the coefficient value is greater than 2, flag indicating whether the coefficient value is greater than 3, information about the remaining coefficient values, symbol information, reconstructed luminance samples, reconstructed chrominance samples, residual luminance samples, residual chrominance samples, luminance transformation coefficient, chrominance transformation coefficient, quantized luminance level, quantized chrominance level, transformation coefficient level scanning method, in decoding The dimensions of the motion vector search region on the decoder side, the shape of the motion vector search region on the decoder side, the number of motion vector searches on the decoder side, information about the CTU size, information about the minimum block size, information about the maximum block size, information about the maximum block depth, information about the minimum block depth, image display / output order, strip identification information, strip type, strip partition information, parallel block identification information, parallel block type, parallel block partition information, picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantization levels, and information about the luminance signal or the chrominance signal.
[0116] Here, sending a flag or index with a signal can represent the encoder entropy encoding the corresponding flag or index and including the corresponding flag or index in the bit stream, and can also represent the decoder entropy decoding the corresponding flag or index from the bit stream.
[0117] When the encoding device 100 performs encoding via inter-frame prediction, the encoded current image can be used as a reference image for another image that is subsequently processed. Therefore, the encoding device 100 can reconstruct or decode the encoded current image, or store the reconstructed or decoded image as a reference image in the reference frame buffer 190.
[0118] The quantization level can be dequantized in dequantization unit 160 or inverse transformed in inverse transform unit 170. The coefficients that have undergone dequantization or inverse transform, or both, can be added to the prediction block by adder 175. A reconstruction block can be generated by adding the coefficients that have undergone dequantization or inverse transform, or both, to the prediction block. Here, the coefficients that have undergone dequantization or inverse transform, or both, can represent coefficients for which at least one of dequantization and inverse transform has been performed, and can represent the reconstructed residual block.
[0119] The reconstructed block can be passed through filter unit 180. Filter unit 180 can apply at least one of deblocking filter, sample adaptive offset (SAO), and adaptive loop filter (ALF) to the reconstructed sample, reconstructed block, or reconstructed image. Filter unit 180 may be referred to as an in-loop filter.
[0120] Deblocking filters remove block distortion generated at the boundaries between blocks. To determine whether to apply a deblocking filter, samples from several rows or columns included in the block can be used. When a deblocking filter is applied to a block, another filter can be applied based on the desired deblocking intensity.
[0121] To compensate for coding errors, a suitable offset value can be added to the sample value using a sample-adaptive offset. The sample-adaptive offset corrects the offset between the deblocked image and the original image on a sample-by-sample basis. This can be achieved by considering edge information about each sample point when applying the offset, or by dividing the image's samples into a predetermined number of regions, determining the regions where the offset will be applied, and then applying the offset to those regions.
[0122] An adaptive loop filter (ALF) performs filtering based on a comparison between the filtered reconstructed image and the original image. Samples included in the image can be partitioned into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed on each group. Information regarding whether to apply the ALF can be transmitted via a signal through the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can vary.
[0123] The reconstructed blocks or reconstructed image that have passed through filter unit 180 can be stored in reference frame buffer 190. The reconstructed blocks processed by filter unit 180 can be a portion of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by filter unit 180. The stored reference image can be used later for inter-frame prediction or motion compensation.
[0124] Figure 2 This is a block diagram illustrating the configuration of a decoding device according to an embodiment of the present invention.
[0125] Decoding device 200 can be a decoder, video decoding device, or image decoding device.
[0126] Reference Figure 2 The decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 225, a filter unit 260, and a reference frame buffer 270.
[0127] Decoding device 200 can receive bitstreams output from encoding device 100. Decoding device 200 can receive bitstreams stored on a computer-readable recording medium, or bitstreams streamed via wired / wireless transmission media. Decoding device 200 can decode the bitstreams using intra-frame mode or inter-frame mode. Furthermore, decoding device 200 can generate and output reconstructed or decoded images generated through decoding.
[0128] When the prediction mode used during decoding is intra-frame mode, the switcher can be switched to intra-frame mode. Optionally, when the prediction mode used during decoding is inter-frame mode, the switcher can be switched to inter-frame mode.
[0129] Decoding device 200 obtains a reconstructed residual block and generates a prediction block by decoding the input bitstream. Once the reconstructed residual block and prediction block are obtained, decoding device 200 generates a reconstructed block that becomes the decoding target by adding the reconstructed residual block and the prediction block. The decoding target block can be referred to as the current block.
[0130] The entropy decoding unit 210 can generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols may include symbols in quantized hierarchical form. Here, the entropy decoding method can be the inverse process of the entropy encoding method described above.
[0131] In order to decode the transform coefficient levels (quantization levels), the entropy decoding unit 210 can change the coefficients in one-dimensional vector form into two-dimensional block form by using a transform coefficient scanning method.
[0132] The quantization level can be dequantized in the dequantization unit 220, or inversely transformed in the inverse transform unit 230. The quantization level can be the result of dequantization, inverse transformation, or both, and can be generated as a reconstruction residual block. Here, the dequantization unit 220 can apply the quantization matrix to the quantization level.
[0133] When using intra-frame mode, intra-frame prediction unit 240 can generate a prediction block by performing spatial prediction on the current block using sample values of blocks adjacent to and already decoded that are already in the target block.
[0134] When using inter-frame mode, motion compensation unit 250 can generate a prediction block by performing motion compensation on the current block using a reference image and motion vectors stored in reference frame buffer 270.
[0135] Adder 225 generates a reconstructed block by adding the reconstructed residual block to the prediction block. Filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or reconstructed image. Filter unit 260 can output a reconstructed image. The reconstructed block or reconstructed image can be stored in a reference frame buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by filter unit 260 can be a portion of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by filter unit 260. The stored reference image can be used later during inter-frame prediction or motion compensation.
[0136] Figure 3 It is a schematic diagram illustrating the partitioning structure of an image when it is encoded and decoded. Figure 3 An example of partitioning a single cell into multiple lower-level cells is illustrated schematically.
[0137] To effectively partition an image, coding units (CUs) can be used during encoding and decoding. A coding unit can serve as the basic unit when encoding / decoding an image. Furthermore, a coding unit can be used to distinguish between intra-frame prediction modes and inter-frame prediction modes during image encoding / decoding. A coding unit can be the basic unit used for prediction, transformation, quantization, inverse transform, dequantization, or encoding / decoding processing of transform coefficients.
[0138] Reference Figure 3 Image 300 is partitioned sequentially according to the Largest Coding Unit (LCU), and the LCU unit is determined as the partitioning structure. Here, LCU can be used with the same meaning as Coding Tree Unit (CTU). Unit partitioning can represent partitioning of the block associated with that unit. The block partitioning information may include information about the unit depth. The depth information may represent the number or degree to which the unit is partitioned, or both. A single unit can be partitioned into multiple lower-level units that are hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning that unit may correspond to a node and the child nodes of that node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information representing the size of the CU and may be stored in each CU. The unit depth represents the number and / or degree associated with partitioning the unit. Therefore, the partitioning information of the lower-level units may include information about the size of the lower-level units.
[0139] The partitioning structure represents the distribution of coding units (CUs) within the CTU 310. This distribution can be determined by whether a single CU is partitioned into multiple CUs (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.). Depending on the number of partitions, the horizontal and vertical dimensions of the CUs generated by partitioning can be half the horizontal and vertical dimensions of the CUs before partitioning, or they can have dimensions smaller than the horizontal and vertical dimensions before partitioning. CUs can be recursively partitioned into multiple CUs. Through recursive partitioning, at least one of the height and width of the CU after partitioning can be reduced compared to at least one of the height and width of the CU before partitioning. CU partitioning can be performed recursively until a predefined depth or predefined size is reached. For example, the depth of the CTU can be 0, and the depth of the minimum coding unit (SCU) can be a predefined maximum depth. Here, as mentioned above, the CTU can be a coding unit with the maximum coding unit size, and the SCU can be a coding unit with the minimum coding unit size. Partitioning begins with CTU 310. The CU depth increases by 1 when the horizontal or vertical dimension of a CU, or both, are reduced through partitioning. For example, for each depth, the size of an unpartitioned CU can be 2N × 2N. Furthermore, in the case of partitioned CUs, a CU of size 2N × 2N can be partitioned into four CUs of size N × N. When the depth increases by 1, the size of N can be halved.
[0140] Furthermore, partition information of a CU can be used to indicate whether a CU is partitioned. Partition information can be 1 bit. All CUs except SCUs can include partition information. For example, when the value of the partition information is the first value, the CU may not be partitioned; when the value of the partition information is the second value, the CU may be partitioned.
[0141] Reference Figure 3 A CTU with depth 0 can be a 64×64 block. 0 can be the minimum depth. An SCU with depth 3 can be an 8×8 block. 3 can be the maximum depth. CUs with depths of 32×32 and 16×16 can be represented as depth 1 and depth 2, respectively.
[0142] For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical dimensions of the four partitioned coding units can be half the horizontal and vertical dimensions of the original CU before partitioning. In one embodiment, when a 32×32 coding unit is partitioned into four coding units, the size of each of the four partitioned coding units can be 16×16. When a single coding unit is partitioned into four coding units, the coding unit can be said to be partitioned (quadtree partitioned) into a quadtree form.
[0143] For example, when a single coding unit is partitioned into two coding units, the horizontal or vertical dimensions of the two coding units can be half the horizontal or vertical dimensions of the coding unit before partitioning. For example, when a 32×32 coding unit is partitioned vertically, the size of each of the two resulting coding units can be 16×32. For example, when an 8×32 coding unit is horizontally partitioned into two sub-coding units, the size of each of the two sub-coding units can be 8×16. When a single coding unit is partitioned into two coding units, the coding unit can be said to be partitioned in the form of a binary tree (binary tree partitioning).
[0144] For example, when a coding unit is divided into three sub-coding units, the horizontal or vertical dimensions of the coding unit can be partitioned in a 1:2:1 ratio, resulting in three sub-coding units with a horizontal or vertical dimension ratio of 1:2:1. For instance, when a 16×32 coding unit is horizontally divided into three sub-coding units, the three sub-coding units, in order from the top to the bottom, can have dimensions of 16×8, 16×16, and 16×8, respectively. Similarly, when a 32×32 coding unit is vertically divided into three sub-coding units, the three sub-coding units, in order from the left to the right, can have dimensions of 8×32, 16×32, and 8×32, respectively. When a coding unit is divided into three sub-coding units, it can be said that the coding unit is partitioned by a ternary tree or partitioned through a ternary tree partitioning structure.
[0145] exist Figure 3 In the example, the Coding Tree Unit (CTU) 320 is an example of a CTU that fully applies quadtree partitioning, binary tree partitioning, and ternary tree partitioning structures.
[0146] As described above, to partition a CTU, at least one of a quadtree partitioning structure, a binary tree partitioning structure, and a ternary tree partitioning structure can be applied. Various tree partitioning structures can be applied sequentially to the CTU according to a predetermined priority order. For example, a quadtree partitioning structure can be preferentially applied to the CTU. Encoding units that cannot be further partitioned using a quadtree partitioning structure can correspond to leaf nodes of a quadtree. Encoding units corresponding to leaf nodes of a quadtree can be used as root nodes of binary and / or ternary tree partitioning structures. That is, encoding units corresponding to leaf nodes of a quadtree can be further partitioned using a binary or ternary tree partitioning structure, or they can be left unpartitioned. Therefore, by preventing the encoded blocks generated by binary or ternary tree partitioning of encoding units corresponding to leaf nodes of a quadtree from undergoing further quadtree partitioning, signaling for block partitioning and / or partitioning information can be effectively executed.
[0147] The fact that a coding unit corresponding to a node in a quadtree is partitioned can be signaled using four-partition information. Four-partition information with a first value (e.g., "1") indicates that the current coding unit has been partitioned through the quadtree partitioning structure. Four-partition information with a second value (e.g., "0") indicates that the current coding unit has not been partitioned through the quadtree partitioning structure. The four-partition information can be a flag with a predetermined length (e.g., one bit).
[0148] There may be no priority between binary tree partitions and ternary tree partitions. That is, the coding unit corresponding to the leaf node of the quadtree can further undergo any partition in either the binary tree partition or the ternary tree partition. In addition, the coding unit generated by the binary tree partition or the ternary tree partition may undergo further binary tree partitions or further ternary tree partitions, or it may not be further partitioned.
[0149] A tree structure in which there is no priority in binary and ternary tree partitioning is called a multi-type tree structure. The coding unit corresponding to the leaf node of a quadtree can be used as the root node of a multi-type tree. At least one of multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information can be used to signal whether to partition the coding unit corresponding to a node in the multi-type tree. To partition the coding unit corresponding to a node in the multi-type tree, the multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information can be signaled sequentially.
[0150] A multi-type tree partitioning indication with a first value (e.g., "1") indicates that the current coding unit will undergo a multi-type tree partition. A multi-type tree partitioning indication with a second value (e.g., "0") indicates that the current coding unit will not undergo a multi-type tree partition.
[0151] When a coding unit corresponding to a node of a multi-type tree is partitioned using a multi-type tree partitioning structure, the coding unit may further include partitioning direction information. The partitioning direction information indicates in which direction the current coding unit will be partitioned using the multi-type tree partitioning. Partitioning direction information with a first value (e.g., "1") indicates that the current coding unit will be vertically partitioned. Partitioning direction information with a second value (e.g., "0") indicates that the current coding unit will be horizontally partitioned.
[0152] When a coding unit corresponding to a node of a multi-type tree is partitioned using a multi-type tree partitioning structure, the current coding unit may also include partitioning tree information. The partitioning tree information may indicate the tree partitioning structure that will be used to partition the nodes of the multi-type tree. Partitioning tree information with a first value (e.g., "1") may indicate that the current coding unit will be partitioned using a binary tree partitioning structure. Partitioning tree information with a second value (e.g., "0") may indicate that the current coding unit will be partitioned using a ternary tree partitioning structure.
[0153] Partition indication information, partition tree information, and partition direction information can all be flags with a predetermined length (e.g., one bit).
[0154] At least one of the following—quadtree partitioning indication information, multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information—can be entropy encoded / decoded. To entropy encode / decode those types of information, information about neighboring coding units adjacent to the current coding unit can be used. For example, there is a high probability that the partitioning type (partitioned or unpartitioned, partitioning tree, and / or partitioning direction) of the left-hand neighboring coding unit and / or above-hand neighboring coding unit is similar to the partitioning type of the current coding unit. Therefore, contextual information for entropy encoding / decoding of information about the current coding unit can be derived from the information about neighboring coding units. Information about neighboring coding units may include at least one of the following: quadtree partitioning information, multi-type tree partitioning indication information, partitioning direction information, and partitioning tree information.
[0155] As another example, in binary tree partitioning and ternary tree partitioning, binary tree partitioning can be performed first. That is, the current coding unit can first go through binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree can be set as the root node for ternary tree partitioning. In this case, quadtree partitioning or binary tree partitioning can be omitted from the coding units corresponding to the nodes of the ternary tree.
[0156] Encoding units that cannot be partitioned using quadtree, binary tree, and / or ternary tree partitioning structures become the basic units for encoding, prediction, and / or transformation. In other words, these encoding units cannot be further partitioned for prediction and / or transformation. Therefore, partitioning structure information and partitioning information for dividing encoding units into prediction and / or transformation units may not exist in the bitstream.
[0157] However, when the size of the coding unit (i.e., the basic unit used for partitioning) is larger than the size of the maximum transform block, the coding unit can be partitioned recursively until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and the size of the maximum transform block is 32×32, the coding unit can be partitioned into four 32×32 blocks for transformation. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit can be partitioned into two 32×32 blocks for transformation. In this case, the partitions of the coding unit for transformation are not sent separately by signal, and the partitions of the coding unit for transformation can be determined by comparing the horizontal or vertical dimensions of the coding unit with the horizontal or vertical dimensions of the maximum transform block. For example, when the horizontal dimension (width) of the coding unit is greater than the horizontal dimension (width) of the maximum transform block, the coding unit can be vertically bisected. For example, when the vertical dimension (length) of the coding unit is greater than the vertical dimension (length) of the maximum transform block, the coding unit can be horizontally bisected.
[0158] Information regarding the maximum and / or minimum size of the coding unit and the maximum and / or minimum size of the transform block can be transmitted or determined at a higher level than the coding unit. This higher level can be, for example, the sequence level, the picture level, or the stripe level. For example, the minimum size of the coding unit can be determined to be 4×4. For example, the maximum size of the transform block can be determined to be 64×64. For example, the minimum size of the transform block can be determined to be 4×4.
[0159] Information regarding the minimum size of the coding unit corresponding to the leaf node of the quadtree (minimum size of the quadtree) and / or the maximum depth of the multi-type tree from the root node to the leaf node (maximum depth of the multi-type tree) can be signaled or determined at a higher level of the coding unit. For example, this higher level could be the sequence level, the frame level, or the stripe level. Information regarding the minimum size of the quadtree and / or the maximum depth of the multi-type tree can be signaled or determined for each of the intra-frame stripes and inter-frame stripes.
[0160] The difference information between the size of the CTU and the maximum size of the transform block can be signaled or determined at a higher level of the coding unit. For example, this higher level could be the sequence level, the frame level, or the stripe level. The maximum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the maximum size of the binary tree) can be determined based on the size and difference information of the coding tree units. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) can vary depending on the type of stripe. For example, for intra-frame stripes, the maximum size of the ternary tree can be 32×32. For example, for inter-frame stripes, the maximum size of the ternary tree can be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) can be set as the minimum size of the coding block.
[0161] As another example, the maximum size of a binary tree and / or the maximum size of a ternary tree can be signaled or determined at the stripe level. Alternatively, the minimum size of a binary tree and / or the minimum size of a ternary tree can be signaled or determined at the stripe level.
[0162] Based on the size and depth information of the various blocks mentioned above, the four-partition information, multi-type tree partition indication information, partition tree information and / or partition direction information may or may not be included in the bitstream.
[0163] For example, when the size of the coding unit is no greater than the minimum size of the quadtree, the coding unit does not contain four-partition information. Therefore, the four-partition information can be derived from the second value.
[0164] For example, when the size (horizontal and vertical dimensions) of the coding unit corresponding to a node of a multi-type tree is greater than the maximum size (horizontal and vertical dimensions) of a binary tree and / or the maximum size (horizontal and vertical dimensions) of a ternary tree, the coding unit may not be partitioned by the binary tree or the ternary tree. Therefore, multi-type tree partitioning indication information can be sent without a signal, but it can be derived from a second value.
[0165] Optionally, when the size (horizontal and vertical dimensions) of the coding unit corresponding to a node of a multi-type tree is the same as the maximum size (horizontal and vertical dimensions) of a binary tree, and / or twice the maximum size (horizontal and vertical dimensions) of a ternary tree, the coding unit may not be further partitioned into binary or ternary trees. Therefore, multi-type tree partitioning indication information does not need to be sent via signaling, but it can be derived from the second value. This is because when the coding unit is partitioned using a binary tree partitioning structure and / or a ternary tree partitioning structure, coding units smaller than the minimum size of a binary tree and / or a ternary tree are generated.
[0166] Optionally, when the depth of the coding unit corresponding to a node of the multi-type tree is equal to the maximum depth of the multi-type tree, further binary tree partitioning and / or ternary tree partitioning of the coding unit is not required. Therefore, multi-type tree partitioning indication information does not need to be sent by signal, but it can be derived from the second value.
[0167] Optionally, multi-type tree partitioning indication information may be signaled only if at least one of the vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, binary tree partitioning and / or ternary tree partitioning of the coding unit may not be possible. Therefore, multi-type tree partitioning indication information may not be signaled, but it may be derived from the second value.
[0168] Optionally, partition direction information may be signaled only if both vertical binary tree partitioning and horizontal binary tree partitioning, or both vertical ternary tree partitioning and horizontal ternary tree partitioning, are feasible for the coding units corresponding to the nodes of the multi-type tree. Otherwise, partition direction information may not be signaled, but it may be derived from the values indicating possible partition directions.
[0169] Optionally, partition tree information may be signaled only if both vertical binary tree partitioning and vertical ternary tree partitioning, or both horizontal binary tree partitioning and horizontal ternary tree partitioning, are feasible for the encoded tree corresponding to the nodes of the multi-type tree. Otherwise, partition tree information may not be signaled, but it may be derived from values indicating possible partition tree structures.
[0170] Figure 4 This is a diagram illustrating intra-frame prediction processing.
[0171] Figure 4 The arrows from the center to the outside in the image can indicate the prediction direction of the intra-frame prediction mode.
[0172] Intra-frame coding and / or decoding can be performed using reference samples from neighboring blocks of the current block. A neighboring block can be a reconstructed neighboring block. For example, intra-frame coding and / or decoding can be performed using coding parameters or values of reference samples included in the reconstructed neighboring block.
[0173] A prediction block can represent a block generated by performing intra-frame prediction. A prediction block can correspond to at least one of CU, PU, and TU. The cells of a prediction block can have the size of one of CU, PU, and TU. A prediction block can be a square block with dimensions such as 2×2, 4×4, 16×16, 32×32, or 64×64, or a rectangular block with dimensions such as 2×8, 4×8, 2×16, 4×16, and 8×16.
[0174] Intra-prediction can be performed based on the intra-prediction mode for the current block. The number of intra-prediction modes that the current block can have can be a fixed value, or it can be a value determined differently depending on the attributes of the predicted block. For example, the attributes of the predicted block can include the size and shape of the predicted block.
[0175] Regardless of the block size, the number of intra-prediction modes can be fixed at N. Alternatively, the number of intra-prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, 67, or 131, etc. Optionally, the number of intra-prediction modes can vary depending on the block size or color component type, or both. For example, the number of intra-prediction modes can vary depending on whether the color component is a luma signal or a chrominance signal. For example, the number of intra-prediction modes can increase as the block size increases. Optionally, the number of intra-prediction modes for the luma component block can be greater than the number of intra-prediction modes for the chrominance component block.
[0176] Intra-frame prediction modes can be non-angular or angular. Non-angular modes can be DC or planar modes, and angular modes can be prediction modes with a specific direction or angle. Intra-frame prediction modes can be represented by at least one of mode number, mode value, mode number, mode angle, and mode direction. The number of intra-frame prediction modes can be greater than 1M, including both non-angular and angular modes.
[0177] To perform intra-frame prediction on the current block, a step can be performed to determine whether a sample included in a reconstructed neighboring block can be used as a reference sample for the current block. When there are samples that cannot be used as reference samples for the current block, the value obtained by copying or interpolating at least one sample value included in a reconstructed neighboring block, or by performing both copying and interpolation, can be used to replace the unavailable sample value of the sample. Therefore, the replaced sample value is used as a reference sample for the current block.
[0178] When performing intra-frame prediction, filters can be applied to at least one of the reference samples and the prediction samples based on the intra-frame prediction mode and the size of the current block.
[0179] In planar mode, when generating the prediction block for the current block, the sample value of the target sample is generated by using a weighted sum of the upper and left reference samples of the current sample, and the upper right and lower left reference samples of the current block, based on the position of the target sample within the prediction block. Furthermore, in DC mode, the average of the upper and left reference samples of the current block can be used when generating the prediction block. Additionally, in angle mode, the prediction block can be generated using the upper, left, upper right, and / or lower left reference samples of the current block. Interpolation can be performed on real cells to generate the prediction sample values.
[0180] The intra-prediction mode of the current block can be entropy-coded / decoded by predicting the intra-prediction modes of adjacent blocks. When the intra-prediction modes of the current block and its neighboring blocks are the same, information indicating that the intra-prediction modes of the current block and its neighboring blocks are the same can be signaled using predetermined flag information. Furthermore, indicator information indicating that the intra-prediction mode of the current block is the same as the intra-prediction mode of multiple neighboring blocks can be signaled. When the intra-prediction modes of the current block and its neighboring blocks are different, the intra-prediction mode information of the current block can be entropy-coded / decoded by performing entropy coding / decoding based on the intra-prediction modes of neighboring blocks.
[0181] Figure 5 This is a diagram illustrating intra-frame prediction according to the present invention.
[0182] Intra-prediction of the current block may include: step S510 of deriving intra-prediction mode, step S520 of configuring reference samples, and / or step S530 of performing intra-prediction.
[0183] In step S510, the intra-prediction mode of the current block can be derived. This can be achieved by using methods employing intra-prediction modes of neighboring blocks, entropy coding / entropy decoding of the intra-prediction mode of the current block from the bitstream, using coding parameters of neighboring blocks, or using intra-prediction modes of color components. According to the method using intra-prediction modes of neighboring blocks, the intra-prediction mode of the current block can be derived using at least one intra-prediction mode derived from the intra-prediction modes of neighboring blocks, a combination of at least one intra-prediction mode of neighboring blocks, and at least one MPM.
[0184] In step S520, the reference sample can be configured by performing at least one of reference sample selection, reference sample filling, and reference sample filtering.
[0185] In step S530, intra-frame prediction can be performed by executing at least one of non-angle prediction, angle prediction, and prediction based on predicted position information and color components. When performing angle prediction, prediction with different angle or interpolation filter types depending on a predetermined unit including at least one sample point of the current block can be performed. The predetermined unit can be, for example, at least one of a single sample point, a group of sample points, a line, and a block. In step S530, filtering of the predicted sample points can be additionally performed. The filter type can represent at least one of filter taps, filter coefficients, and filter shape.
[0186] Intra-frame prediction can be adaptively performed based on at least one of the intra-frame prediction mode, the size of the current block, the form of the current block, and the location of the predicted samples. For example, it can be adaptively determined whether to use multiple reference sample lines, whether to perform interpolation filtering, the coefficients of the interpolation filter, whether to perform filtering, whether to perform weighted averaging, and / or the weights used for weighted averaging, based on at least one of the intra-frame prediction mode, the size of the current block, the form of the current block, and the location of the predicted samples. The explanations for the above will be provided later.
[0187] To derive the intra-prediction mode of the current block, at least one reconstructed neighboring block can be used. The location of the reconstructed neighboring block can be a predefined fixed location, or it can be a location derived through encoding / decoding. In the following text, encoding / decoding can refer to entropy encoding and entropy decoding. For example, when the coordinates of the top-left side sample of the current block of size W×H are (0,0), the neighboring block can be at least one of the following blocks: the block adjacent to coordinates (-1,H-1), the block adjacent to coordinates (W-1,-1), the block adjacent to coordinates (W,-1), the block adjacent to coordinates (-1,H), and the block adjacent to coordinates (-1,-1), as well as the neighboring blocks of the above blocks. Here, W and H can represent the number of samples or the length of the width (W) and height (H) of the current block.
[0188] An unavailable intra-prediction mode for a neighboring block can be replaced by a predetermined intra-prediction mode. The predetermined intra-prediction mode can be, for example, DC mode, planar mode, vertical mode, horizontal mode, and / or diagonal mode. For example, inter-prediction is performed on the neighboring block when it is located outside the boundary of at least one predetermined unit among a frame, stripe, parallel block, and coding tree unit; or the corresponding block can be determined as unavailable when it is encoded in PCM mode. Optionally, when the neighboring block is unavailable, the intra-prediction mode of the corresponding block is not replaced and is not used.
[0189] The intra-prediction mode of the current block can be derived as the intra-prediction mode of neighboring blocks at a predetermined position, or as a statistical value of the intra-prediction modes of at least two neighboring blocks. In this specification, the statistical value may represent at least one of the following: mean, maximum, minimum, mode, median, weighted average, and interpolation.
[0190] Optionally, the intra-prediction mode of the current block can be derived based on the size of neighboring blocks. For example, the intra-prediction mode of a neighboring block with a relatively large size can be derived as the intra-prediction mode of the current block. Optionally, statistics can be calculated by assigning larger weights to the intra-prediction modes of blocks with relatively large sizes. Optionally, modes assigned relatively large weights can be predefined or signaled. For example, relatively large weights can be assigned to at least one of a vertical mode, a horizontal mode, a diagonal mode, and a non-directional mode. The same weights can be assigned to the aforementioned modes.
[0191] Optionally, it may be considered whether the intra-prediction mode of neighboring blocks is an angular mode. For example, when the intra-prediction mode of a neighboring block is a non-angular mode, the non-angular mode can be derived as the intra-prediction mode of the current block. Optionally, in addition to non-angular modes, the intra-prediction modes of other neighboring blocks can also be derived as the intra-prediction mode of the current block.
[0192] To derive the intra prediction mode for the current block, one or more most probable mode (MPM) lists can be configured using the intra prediction modes of neighboring blocks. The number N of candidate modes included in the MPM lists can be fixed, or it can be determined based on the size or form of the current block, or both. The MPM lists can be configured to exclude overlapping modes. When the number of available candidate modes is less than N, predetermined candidate modes from the available candidate modes (e.g., modes obtained by adding an angle mode to a predetermined offset or subtracting a predetermined offset from an angle mode) can be added to one or more MPM lists. Optionally, at least one of the following can be added to the MPM lists: horizontal mode, vertical mode, 45° angle mode, 135° angle mode, 225° angle mode, and non-angle mode. The predetermined offset can be 1, 2, 3, 4, or a positive integer.
[0193] The MPM list can be configured in a predetermined order based on the positions of neighboring blocks. For example, the predetermined order could be the order of blocks adjacent to the left, bottom left, top right, and top left sides of the current block. Non-angular modes can be included in the MPM list at any position. For example, a non-angular mode can be added to the next intra-prediction mode of the block adjacent to the left and top sides.
[0194] The MPM list generated based on the current block can be used as an MPM list for at least one sub-block included in the current block. The order among candidate patterns in configuring the MPM list, the number of candidate patterns included in the MPM list, etc., can be determined based on the size, form, and / or composition of the current block.
[0195] Alternatively, a set of patterns can be configured by selecting a subset of patterns not included in the MPM list. The configured set of patterns can be used as another list. For example, a set of patterns can be configured using patterns obtained by sampling at predetermined intervals after arranging patterns that are not MPM candidates, or using patterns obtained by adding MPM candidate patterns to n (where n is an integer equal to or greater than 1) / subtracting MPM candidate patterns from n.
[0196] As another embodiment, the intra-prediction mode of the current block can be derived using the intra-prediction mode derived by using the MPM list and the intra-prediction modes of neighboring blocks. For example, when the intra-prediction mode derived by using the MPM list is Pred_mpm, Pred_mpm can be changed by using the intra-prediction modes of neighboring blocks. For example, when Pred_mpm is greater than the intra-prediction modes of neighboring blocks (or greater than the statistical values of at least two intra-prediction modes), Pred_mpm can be increased by n; otherwise, Pred_mpm can be decreased by n. Here, n can be a predetermined integer, such as +1, +2, +3, 0, -1, -2, -3, etc. The intra-prediction mode of the current block can be derived as the changed Pred_mpm. Optionally, when at least one of Pred_mpm and the intra-prediction modes of neighboring blocks is a non-angular mode, the intra-prediction mode of the current block can be derived as a non-angular mode. Optionally, the intra-prediction mode of the current block can be derived as an angular mode.
[0197] According to another embodiment of the method for deriving intra-prediction modes of the present invention, the intra-prediction mode of the current block can be derived by using intra-prediction modes of different color components. For example, when the current block is a chroma block, the intra-prediction mode of the luma block corresponding to the chroma block can be used to derive the intra-prediction mode of the chroma block. One or more luma blocks may exist as luma blocks corresponding to the chroma blocks. The corresponding luma block can be determined based on at least one of the size, shape, and coding parameters of the chroma block. Optionally, the corresponding luma block can be determined based on at least one of the size, shape, and coding parameters of the luma block.
[0198] A luma block corresponding to a chroma block can consist of multiple partitions. All or part of these partitions can have different intra-prediction modes. The intra-prediction mode of the chroma block can be derived based on all or part of the multiple partitions included in the corresponding luma block. In this case, some partitions can be selectively used, wherein the partitions used are selected based on comparing the block size, shape, depth information, etc., of the chroma block with the block size, shape, depth information, etc., of the luma block (all or part of the multiple partitions). A partition at a position in the luma block corresponding to a predetermined position in the chroma block can be selectively used. The predetermined position can refer to the corner sample point (e.g., the top-left sample point) position or the center sample point position in the chroma block.
[0199] The method of deriving the intra-prediction mode of a color component block using intra-prediction modes of different color component blocks (i.e., inter-frame color component intra-prediction modes) according to the present invention is not limited to the example of using the intra-prediction mode of the luma block corresponding to the chroma block. For example, the intra-prediction mode of the chroma block can be derived by using or sharing at least one of the MPM list and MPM index mpm_idx of the luma block corresponding to the chroma block.
[0200] Figure 6 This is an exemplary diagram illustrating the relationship between luminance blocks and chrominance blocks.
[0201] exist Figure 6 In the example shown, the color components are sampled at a rate of 4:2:0, and at least one of the luminance blocks A, B, C, and D corresponds to a chrominance block.
[0202] Reference Figure 6 The intra-prediction mode of a chroma block can be derived using the intra-prediction mode of luma block A corresponding to the sample at the top-left position (0,0) or the intra-prediction mode of luma block D corresponding to the sample at the center position (nS / 2, nS / 2) in the chroma block. The predetermined position in the chroma block is not limited to the top-left position (0,0) or the center position (nS / 2, nS / 2). For example, the predetermined position could be the top-right position, the bottom-left position, and / or the bottom-right position.
[0203] The predetermined position can be selected based on the shape of the chroma block. For example, if the chroma block has a square shape, the predetermined position can be the center sample point position. If the chroma block has a rectangular shape, the predetermined position can be the top-left sample point position. Alternatively, the predetermined position can be the position of the top-left sample point in a chroma block with a square shape or the position of the center sample point in a chroma block with a rectangular shape.
[0204] According to another embodiment, the intra-prediction mode of the chroma block can be derived by using statistical values of one or more intra-prediction modes of the luminance block having the same size as the chroma block.
[0205] exist Figure 6 In the example shown, the mode corresponding to the average of the intra-prediction modes of luma blocks A and D, or the mode corresponding to the average of the intra-prediction modes of blocks A, B, C, and D within the luma block corresponding to the size of the chroma block, is derived as the intra-prediction mode of the chroma block.
[0206] When multiple intra-prediction modes for a luma block are available, all or some of them can be selected. This selection is based on a predetermined position within the chroma block or on the size, shape, and / or depth of the chroma block, luma block, or both. The intra-prediction mode for the chroma block can be derived using the selected intra-prediction mode for the luma block.
[0207] For example, the size of luma block A corresponding to the top left sample point position (0,0) in the chroma block is compared with the size of luma block D corresponding to the center sample point position (nS / 2,nS / 2) in the chroma block, and the intra-prediction mode of luma block D with the larger size can be used to derive the intra-prediction mode of the chroma block.
[0208] Optionally, when the size of the luma block corresponding to a predetermined position in the chroma block is equal to or greater than the size of the chroma block, the intra-prediction mode of the chroma block is derived by using the intra-prediction mode of the luma block.
[0209] Optionally, when the size of the chroma block is within a predetermined range, the intra-prediction mode of the chroma block is derived by using the intra-prediction mode of the luma block corresponding to the top-left sample point position (0,0) in the chroma block.
[0210] Optionally, when the size of the chroma block is within the predetermined range, the size of the luma block corresponding to the predetermined position (0,0) of the chroma block is compared with the size of the luma block arranged at another predetermined position (nS / 2,nS / 2) of the chroma block, and the intra-prediction mode of the chroma block is derived by using the intra-prediction mode of the luma block with the larger size.
[0211] The predetermined range can be derived from at least one of the following: information transmitted via a bitstream signal, information about the size (and / or depth) of the block (chroma block, luma block, or both chroma block and luma block), and information predefined in the encoder or decoder.
[0212] Alternatively, when the chroma block has a rectangular shape, the intra-prediction mode of the chroma block can be derived by using the intra-prediction mode of the luma block corresponding to the center sample position (nS / 2, nS / 2) in the chroma block.
[0213] Within the multiple partitions of a luma block, a partition with the same shape as the chroma block can be used. For example, when the chroma block has a square shape or a non-square shape, a partition with a square shape or a non-square shape selected from the multiple partitions of the luma block can be used.
[0214] In reference Figure 6 In the described example, the method of deriving the intra-prediction mode of the chroma block using the intra-prediction mode of the luma block is also applicable to the case where the intra-prediction mode of the luma block is directly used as the intra-prediction mode of the chroma block. The method of deriving the intra-prediction mode of the chroma block is not limited to the method of using the intra-prediction mode of the corresponding luma block. For example, the intra-prediction mode of the chroma block can be derived from information including the MPM list and MPM index mpm_idx used to derive the intra-prediction mode of the luma block.
[0215] Optionally, the MPM list of a chroma block can be constructed using the intra-prediction mode of the luma block corresponding to a sample point at a predetermined position in the chroma block. In this case, the mpm_idx information of the chroma block can be encoded and transmitted as a signal. The MPM list of the chroma block can be constructed in a similar manner to constructing the MPM list of the luma block. The MPM candidates of the chroma block may include the intra-prediction modes of neighboring chroma blocks and / or the intra-prediction modes of the luma block corresponding to that chroma block.
[0216] When the MPM flag is 0, a second MPM list can be configured, including at least one intra-prediction mode, and the intra-prediction mode of the current block can be inferred using the second MPM index (2nd_mpm_idx). Here, a second indicator (e.g., the second MPM flag) indicating whether the intra-prediction mode of the current block is included in the second MPM list can be encoded / decoded. Similar to the first MPM list, the second MPM list can be configured using the intra-prediction modes of neighboring blocks. Here, intra-prediction modes included in the first MPM list may not be included in the second MPM list. The number of MPM lists is not limited to 1 or 2; N MPM lists can be used.
[0217] When the intra-prediction mode of the current block is not included in one of the multiple MPM lists, the luma component intra-prediction mode of the current block can be encoded / decoded. Furthermore, the chroma component intra-prediction mode can be derived based on the associated luma component intra-prediction mode and encoded / decoded accordingly.
[0218] When the current block is partitioned into multiple sub-blocks, at least one of the described methods can be applied to derive the intra-prediction mode for each sub-block.
[0219] The size or form of a sub-block, or both, can be a predetermined size or block, or both (e.g., 4×4), or can be determined based on the size or form of the current block, or both. Optionally, the size of a sub-block can be determined based on whether neighboring blocks of the current block are partitioned, or based on the intra-prediction modes of neighboring blocks of the current block. For example, the current block can be partitioned based on a boundary where the intra-prediction modes of neighboring blocks are different. Optionally, the current block can be partitioned based on whether neighboring blocks are intra-coded blocks or inter-coded blocks.
[0220] Indicators (e.g., NDIP_flag) that represent the intra prediction mode of the current block derived by using the intra prediction modes of neighboring blocks can be encoded / decoded. The indicator can be encoded / decoded using at least one unit in the current block and sub-blocks. Here, the indicator can be encoded / decoded when the size of the current block or sub-block corresponds to a predetermined size or a predetermined size range.
[0221] The determination of whether the size of the current block corresponds to a predetermined size can be performed based on the horizontal or vertical length of the current block. For example, when the horizontal or vertical length is a length that can be partitioned, the size of the current block is determined to correspond to a predetermined size.
[0222] When the current block is divided into multiple sub-blocks, the intra-prediction modes of the multiple sub-blocks can be derived in a zigzag order, or they can be derived in parallel. The intra-prediction modes of the sub-blocks can be derived using at least one of the methods for deriving the intra-prediction mode of the current block. Here, neighboring blocks of the current block can be used as neighboring blocks of each sub-block. Optionally, sub-blocks within the current block can be used as neighboring blocks of each sub-block.
[0223] The intra-prediction mode for the first sub-block within the current block can be derived using a different method than for other sub-blocks. The first sub-block could be, for example, the first sub-block in the scan order.
[0224] The intra-prediction modes of sub-blocks included in the current block can be derived by using the intra-prediction mode of the current block and the average of the intra-prediction modes of the blocks to the upper left of the sample point at (0,0) of each sub-block. For example, if the intra-prediction mode of the current block is greater than the average mentioned above, half of the average can be subtracted from the derived intra-prediction mode. If the intra-prediction mode of the current block is equal to or less than the average mentioned above, half of the average can be added to the derived intra-prediction mode.
[0225] Intra-frame prediction information can be transmitted via signaling using at least one of the following: Video Parameter Set (VPS), Sequence Parameter Set (SPS), Picture Parameter Set (PPS), Adaptation Parameter Set (APS), Slice Header, and Parallel Block Header. In the case of a predetermined block size or smaller, at least one piece of intra-frame prediction information may be transmitted without signaling. Here, intra-frame prediction information from previously encoded / decoded blocks (e.g., higher-level blocks) can be used.
[0226] Reference samples for intra-frame prediction can be configured based on the derived intra-frame prediction mode. In the following description, the current block can represent a prediction block or a sub-block with a size / form smaller than the prediction block. Reference samples can be configured by using at least one sample reconstructed from a neighboring block or by using a combination of samples. Furthermore, filtering can be applied to the configured reference samples.
[0227] The number or position of the reconstructed sample lines used to configure reference samples, or both, can vary depending on the current block's position within the coding tree block. Each reconstructed sample on multiple reconstructed sample lines can be used directly as a reference sample. Alternatively, predetermined filters can be applied to the reconstructed samples, and reference samples can be generated using the filtered reconstructed samples. Reconstructed samples with filters applied can be included in the same reconstructed sample line or in different reconstructed sample lines.
[0228] The configured reference sample can be represented as ref[m,n], and the sample obtained by applying a filter to the configured reference sample can be represented as rec[m,n]. Here, m or n can be a predetermined integer value representing the position of the sample. When the position of the top-left sample in the current block is (0,0), the position of the top-left reference sample in the current block can be set to (-1,-1).
[0229] Figure 7 It is a diagram used to describe multiple reconstructed sample lines.
[0230] Reference samples can be constructed by selecting one or more reconstructed sample lines adjacent to the current block. For example, in Figure 7 In the process, one of multiple reconstruction sample lines can be selected to construct a reference sample.
[0231] For example, to construct reference points, a specific reconstruction sample line from multiple reconstruction sample lines can be selected either fixedly or adaptively, or any reconstruction sample line can be selected adaptively.
[0232] In another embodiment, in order to construct reference samples, it is possible to... Figure 7 The multiple reconstructed sample lines shown can be selected, one or more reconstructed sample lines can be selected, and the selected reconstructed sample lines can be combined.
[0233] For example, as shown in Equation 1, a reference sample can be constructed using a weighted average of the reconstructed samples, where the weights of the reconstructed samples vary depending on the distance between the reconstructed sample and the current block.
[0234] [Equation 1]
[0235] ref[-1,-1]=(rec[-2,-1]+2×rec[-1,-1]+rec[-1,-2]+2)>>2
[0236] ref[x,-1]=(rec[x,-2]+3×rec[x,-1]+2)>>2,(x=0 to H+W-1)
[0237] ref[-1,y]=(rec[-2,y]+3×rec[-1,y]+2)>>2,(y=0 to H+W-1)
[0238] Optionally, reference samples can be constructed using at least one of the average, maximum, minimum, median, and mode values of multiple reconstruction samples, based on at least one of the distance from the current block to the corresponding reconstruction sample and the intra-prediction mode of the current block.
[0239] Optionally, reference samples can be constructed based on the variation (amount of variation) between each of the sample values of consecutive reconstructed samples. For example, reference samples can be constructed based on at least one of the following: determining whether the difference between the values of two consecutive reconstructed samples is greater than a threshold, and determining whether the values of consecutive reconstructed samples change continuously or discontinuously. For example, when the difference between the value of rec[-1,-1] and the value of rec[-2,-1] is greater than a threshold, the value of ref[-1,-1] can be determined as having the value of rec[-1,-1] or as a value corresponding to the weighted average obtained by applying predetermined weights to the value of rec[-1,-1]. For example, as the distance between the reconstructed sample and the current block decreases, each of the values of consecutive reconstructed samples changes by n, and therefore the value of ref[-1,-1] is represented as "ref[-1,-1] = rec[-1,-1] - n".
[0240] In different embodiments, reference is made to Figure 7 You can select two or more reconstructed sample lines to construct reference samples. For example, you can select two lines, including reconstructed sample line 1 and reconstructed sample line 2, or you can select four lines from reconstructed sample line 1 to reconstructed sample line 4 to construct reference samples.
[0241] Optionally, two or more reconstructed sample lines can be adaptively selected to construct reference samples. For example, one reconstructed sample line can be fixedly selected, and one or more reconstructed sample lines can be adaptively selected from other reconstructed sample lines to construct reference samples.
[0242] Fixed selections of reconstructed sample lines can be predefined in the encoder / decoder. With predefined fixed selections of reconstructed sample lines, information about these fixed selections can be sent without signal transmission.
[0243] Information about the adaptively selected reconstructed sample lines can be signaled in the form of indicators or indices. The adaptively selected reconstructed sample lines can be determined based on at least one of the coding parameters of the current block or the coding parameters of blocks adjacent to the current block. For example, the adaptively selected reconstructed sample lines can be determined based on at least one of the intra-prediction mode and size / shape of the current block or the intra-prediction mode and size / shape of blocks adjacent to the current block. In this case, the information necessary for selection can be selected without signaling.
[0244] A reference sample line may include one or more sample points. For example, a reference sample line may include sample points with a length equal to the width (i.e., horizontal dimension) or height (i.e., vertical dimension) of the current block. As another example, a reference sample line may include sample points with a length equal to twice the width or height of the current block. As yet another example, a reference sample line may include sample points with a length equal to twice the sum of the width and height of N sample points (N being 1, 2, 3, ...). That is, a reference sample line may include reference sample points corresponding to 2X(W+H)+N (where W and H are the width and height of the current block, and N is an integer of 1 or greater).
[0245] The methods for constructing reference samples adjacent to the upper part of the current block and the methods for constructing reference samples adjacent to the left part of the current block can differ. For example, the number of reference sample lines above the current block and the number of reference sample lines to the left of the current block can differ. For example, depending on at least one of the intra-prediction mode of the current block and the width or height of the current block, the number of reference sample lines adjacent to the upper part of the current block can be one, while the number of reference sample lines adjacent to the left of the current block can be two. For example, the lengths of the reference sample lines above the current block and the lengths of the reference sample lines to the left of the current block can differ. For example, the lengths of the reference sample lines can vary depending on at least one of the intra-prediction mode of the current block and the width or height of the current block.
[0246] Each reference sample line can have a different length. For example, the reference... Figure 7 The length of the reconstructed sample line 2 to 4 can be longer than the length of the reconstructed sample line 1 by the length corresponding to one or more sample points.
[0247] The length of the reference sample line can vary for each reconstructed sample line. For example, reconstructed sample line n can be longer or shorter than reconstructed sample line n-1 by the length corresponding to m samples. Figure 7 In the example shown, the reconstructed sample line n is longer than the reconstructed sample line n-1 by the length corresponding to one sample.
[0248] Optionally, the reference sample line can be reconstructed by shifting it according to the intra-prediction mode of the current block. For example, when a reference sample is not present at a location referenced by a specific intra-prediction mode, the reference sample line can be shifted so that the reference sample becomes available at the location referenced by the intra-prediction mode. Which reference sample line will be shifted and by how far can it be shifted can be determined based on which intra-prediction mode is used for the current block, the angle of the prediction direction, and / or the location of the reference sample line.
[0249] As described above, information regarding whether to construct a reference sample using only the nearest reference sample line or using multiple reference sample lines can be encoded / decoded. For example, this information can be encoded / decoded at at least one of the following levels: sequence, frame, stripe, parallel block, CTU, CU, PU, and TU. Furthermore, information regarding the availability of each of the multiple reference sample lines can be signaled at a higher level.
[0250] When the upper or left boundary of the current block corresponds to the boundary of at least one of a frame, stripe, parallel block, and coding tree block (CTB), at least one of the following can be set differently when constructing reference samples: the number, position, and configuration of the reconstructed sample lines. For example, when constructing two or more reference sample lines, a reference sample line adjacent to the upper part of the current block can be constructed when the upper boundary of the current block corresponds to the boundary of at least one of a frame, parallel block, stripe, and coding tree block (CTB). For example, one reference sample line can be configured when the upper boundary of the current block corresponds to the upper boundary of the CTU; otherwise, two or more reference sample lines can be configured. In this case, since only one reference sample line is used at the upper boundary of the CTU, the size of the line buffer used to store the reference sample data of the reference sample line can be reduced.
[0251] When a reference sample is selected, availability determination and reference sample filling can be performed on the block containing the reference sample to be used. For example, when the block containing the reference sample is available, the corresponding reference sample can be used. On the other hand, when the block containing the reference sample is unavailable, one or more available neighboring reference samples can be used to fill the unavailable reference sample in the block.
[0252] A reference sample may be determined as unavailable when it is located outside the boundary of at least one of a frame, parallel block, stripe, or coding tree block (CTB). When encoding the current block using constrained intra-frame prediction (CIP), the reference sample may be determined as unavailable if the block including the reference sample has already been encoded / decoded in inter-frame prediction mode.
[0253] Figure 8 It is a diagram used to describe the process of replacing unavailable samples with available samples.
[0254] When it is determined that the reconstructed neighboring samples are unavailable, the unavailable samples can be replaced by reconstructed neighboring samples that are used as available samples. For example, ... Figure 8 As shown, when both available and unavailable samples exist, one or more available samples can be used to replace one or more unavailable samples.
[0255] Unavailable sample values can be replaced with available sample values in a predetermined order. The available sample used to replace the unavailable sample can be an available sample located adjacent to the unavailable sample. When there is no available sample adjacent to the unavailable sample, the earliest or closest available sample can be used to replace the unavailable sample. The replacement order of unavailable samples can be, for example, from the bottom left to the top right. Optionally, the replacement order can be from the top right to the bottom left. Specifically, the replacement order can be from the top left corner to the top right and / or the bottom left. Optionally, the replacement order can be from the top right and / or from the bottom left corner to the top left corner.
[0256] For example, unavailable samples can be filled using the values of available samples, starting from position 0, which is the bottom left sample location. That is, the first four unavailable samples can be filled with the value "a", and the subsequent 13 unavailable samples can be filled with the value "b".
[0257] For example, unavailable samples can be filled with a combination of available sample values. For example, unavailable samples can be filled with the average or interpolated value of the available samples adjacent to both ends of the line containing the unavailable sample. That is, the first four unavailable samples can be filled with the value "a", and the next 13 unavailable samples can be filled with the average of the values "b" and "c", or by interpolating the values "b" and "c".
[0258] Optionally, the 13 unavailable samples can be filled using any intermediate value between the sample values "b" and "c" of the available samples. In this case, the unavailable samples can be filled with various different values. For example, as the distance from an unavailable sample to an available sample with the value "a" decreases, the unavailable sample will be filled with a value closer to the value "a". For example, the closer an unavailable sample is to an available sample with the value "b", the closer the value filling the unavailable sample will be to the value "b". That is, the value of the unavailable sample can be determined based on the distance between the unavailable sample and an available sample with the values "a" or "b". To replace unavailable samples with available samples, one or more replacement methods, including the methods described above, can be used adaptively. The method for replacing unavailable samples with available samples can be transmitted as information contained in the bitstream by a signal, or it can be predetermined in the encoder / decoder. Optionally, the replacement method can be derived according to a predetermined determination method. For example, the replacement method can be determined based on the difference between the values "a" and "b" or based on the number of unavailable samples. More specifically, the replacement method can be determined by comparing the difference between the values of two available samples with a threshold and / or by comparing the number of unavailable samples with a threshold. For example, when the difference between the values of two available samples is greater than a threshold, and / or when the number of unavailable samples is greater than a threshold, unavailable samples can be replaced with values that are different from each other. The selection of a method for replacing unavailable samples with available samples can be performed based on each predetermined unit. For example, the replacement method can be selected based on each video, each sequence, each frame, each strip, each parallel block, each coding tree unit (CTU), each coding unit (CU), each prediction unit (PU), each transform unit (TU), or each block. In this case, the selection of a method for replacing unavailable samples with available samples can be determined based on information transmitted by signal on a per-predetermined-unit basis, or the selection of a method for replacing unavailable samples with available samples can be derived based on each predetermined unit. Optionally, the selection method for the replacement method can be predetermined in the encoder / decoder.
[0259] When the reference sample point is located at a predetermined position, filling can be performed automatically without determining whether the block containing the reference sample point is available. For example, referencing... Figure 7 When the position (x,y) of the top left corner sample point of the current block is (0,0), the availability of sample points may not be determined for sample points located at (x,y) where the x-coordinate or y-coordinate is equal to or greater than W+H (x = W+H or greater or y = W+H or greater), and these sample points can be filled using neighboring reference sample points.
[0260] For example, the sample point ref[W+H,-2] can be filled with the value of sample point ref[W+H-1,-2] without performing availability determination on sample point ref[W+H,-2]. As another example, the sample point ref[W+H,-3] can be filled with the value of sample point ref[W+H-1,-3] without performing availability determination on sample point [W+H,-3]. That is, sample points located at these positions (x,y: x equals or is greater than W+H or y equals or is greater than W+H) can be filled using the nearest sample point on the same sample line without performing availability determination on sample points located at these positions (x,y: x equals or is greater than W+H or y equals or is greater than W+H).
[0261] When the top-left corner sample of the current block is at (0,0), availability determination will be performed on samples located above the current block at these positions (x,y: x equals or greater than W and less than W+H), and then filling will be performed based on the availability determination result. Availability determination will be performed on samples located to the left of the current block at these positions (x,y: y equals or greater than H and less than W+H), and filling will be performed based on the availability determination.
[0262] For example, when the position of the top-left sample point of the current block is (0,0), availability determination and filling can be performed on the sample points corresponding to rec[x,-1] (x ranges from -1 to W+H-1) and / or the sample points corresponding to rec[-1,y] (y ranges from 0 to H+W-1).
[0263] For filling, multiple reference sample lines can be used. For example, when filling the first reference sample line that is adjacent to (i.e., closest to) the current block, the second reference sample line that is second closest to the current block can be used. For example, filling can be performed according to Equation 2. That is, the sample value of the first reference sample line can be derived by using a weighted average of the samples selected from the first reconstructed reference sample line and the samples selected from the second reconstructed reference sample line. In this case, the selected reconstructed sample point can be one located at the current sample point location or one located at a location adjacent to the current sample point location.
[0264] [Equation 2]
[0265] ref[x,-1]=(rec[x,-2]+3×rec[x,-1]+2)>>2,(x=0~H+W-1)
[0266] Filtering can be performed on one or more reference samples constructed as described above. Filtering can be adaptively performed based on at least one of the intra-prediction mode of the current block, the size of the current block, and the shape of the current block. For example, at least one of the following can be adaptively determined: whether to apply filtering, the filter type, the filter strength, and the filter coefficients.
[0267] For example, it can be determined whether to apply filtering for each of multiple reference sample lines. For example, filtering can be applied to the first reference sample line adjacent to the current block, while filtering can be left unapplied to the second reference sample line. For example, both filtered and unfiltered values can be used for the same reference sample.
[0268] For example, at least one of a 3-tap filter, a 5-tap filter, a 7-tap filter, and an N-tap filter can be selectively applied based on at least one of the intra-prediction mode of the current block, the size of the current block, and the shape of the current block. In this case, M is an integer equal to or greater than 3.
[0269] For example, filters with different shapes can be selectively used based on at least one of the intra-prediction mode, size, and shape of the current block. Figure 9 Various filter shapes are shown.
[0270] The shape of the current block can be determined by comparing its width (horizontal dimension) with its height (vertical dimension). For example, at least one of the following determinations—whether to apply a filter, filter type, filter strength, and filter coefficients—can be adaptively determined based on whether the current block is a horizontal or vertical rectangle. Alternatively, at least one of the following determinations—whether to apply filtering, filter type, filter strength, and filter coefficients—can be adaptively determined based on whether the current block is a rectangle or a square.
[0271] Intra-prediction for the current block can be performed based on the derived intra-prediction mode and the constructed reference samples.
[0272] For example, non-directional intra-prediction can be performed for the current block. The mode of non-directional intra-prediction can be at least one of DC mode, planar mode, and LM mode.
[0273] For DC mode, prediction can be performed using the average of one or more constructed reference samples. In this case, filtering can be applied to one or more prediction samples (also called predicted samples) located at the boundaries of the current block. DC prediction can be adaptively performed based on at least one of the size and shape of the current block. Furthermore, the range of reference samples used in DC mode can be determined based on at least one of the size and shape of the current block.
[0274] Figure 10 It is a diagram used to describe intra-frame prediction based on the shape of the current block.
[0275] For example, when the current block is a square block, such as Figure 10 As shown in (a), DC prediction can be performed by using the average of the reference sample points located above the current block and the reference sample points located to the left of the current block.
[0276] For example, when the current block is a non-square block, neighboring samples adjacent to the left and top edges of the current block can be selectively used. When the current block is a rectangular block, such as Figure 10 As shown in (b), prediction can be performed using the average of reference samples adjacent to the longer side of the current block's left and top sides.
[0277] For example, when the size of the current block corresponds to a predetermined size or falls within a predetermined range, a predetermined number of reference samples are selected from the reference samples located above or to the left of the current block, and the average value of the selected reference samples is used to perform prediction. The predetermined size can be a fixed size of N×M preset in the encoder / decoder. In this case, N and M are integers greater than 0, and N and M can be the same or different from each other. The predetermined range can represent a threshold for selecting reference samples for prediction of the current block. This threshold can be set using at least one of a minimum value and a maximum value. The minimum value and / or the maximum value can be one or more fixed values preset in the encoder / decoder, or one or more variable values encoded by the encoder and subsequently transmitted as a signal.
[0278] For example, one or more averages can be used to perform the prediction. When the current block is a square block or a non-square block, at least one of a first average or a second average can be used, wherein the first average is the average of reference points located above the current block, and the second average is the average of reference points located to the left of the current block. The DC prediction value of the current block can be either the first average or the second average. Optionally, the DC prediction value of the current block can be a weighted sum obtained by weighting the first average and the second average. For example, the weights of the first average and the second average can be the same (i.e., 1:1).
[0279] According to the method described above, shift operations can be used to calculate all DC values. For example, the method can be used even when the sample length representing the width, height, or sum of the width and height of the current block is not a power of 2. The method can be applied to both luminance DC prediction and chrominance DC prediction. Optionally, the method can be applied to either luminance DC prediction or chrominance DC prediction.
[0280] For example, when the current block is not a square block, prediction can be performed based on the width or height of the current block. For instance, the prediction can be obtained by dividing the sum of the values of the top and left reference points by the length of the longer side (i.e., width or height) of the current block. In this case, a shift operation can be used to perform a division operation using the value corresponding to the longer of the width and height.
[0281] For example, multiple reference sample lines can be used to perform DC prediction. For example, such as... Figure 10 As shown in (c), two reference sample lines can be used to perform predictions.
[0282] For example, the average value of the reference points included in the two reference sample point lines can be determined as the DC prediction value for the current block.
[0283] Optionally, different weights can be applied to the reference samples of the first and second neighboring lines of the current block. For example, a weighted average of each sample in the first and second reference sample lines can be calculated by applying a weight of 3:1 to each sample in the first and second reference sample lines (i.e., (3 × reference sample of the first line + reference sample of the second line + 2) >> 2), and the average of the weighted averages can be determined as the DC prediction value for the current block. Optionally, a result of ((3 × sample of the first line - sample of the second line) >> 1) can be obtained, and the average of these values can be determined as the DC prediction value for the current block. The weights are not limited to the above examples, and any weights can be used. In this case, the closer the reference sample line is to the current block, the greater the weight applied to that reference sample line. The number of reference sample lines that can be used is not limited to two, and three or more reference sample lines can be used for prediction.
[0284] Prediction can be performed using one or more averages generated using one or more reference samples. For example, at least one of the following averages can be used to perform DC prediction: the average of reference samples in a first reference sample line above the current block, the average of reference samples in a second reference sample line above the current block, the average of reference samples in a first reference sample line to the left of the current block, and the average of reference samples in a second reference sample line to the left of the current block.
[0285] Optionally, the difference between the reference points in the first reference sample line and the reference points in the second reference sample line can be used for DC prediction. For example, the result of calculating (each reference point in the first reference sample line + (each reference point in the first reference sample line - each reference point in the second reference sample line) >> 1) can be used, and the average of these differences can be determined as the DC prediction value for the current block.
[0286] For planar mode, prediction can be performed using a weighted sum, where the weighted sum is a function of the distance from at least one reference sample to the intra-predicted target sample located in the current block.
[0287] Filtering can be performed on reference samples or predicted samples (i.e., predicted samples) of the current block. For example, after applying filtering to reference samples, planar prediction can be performed, and then filtering can be performed on one or more predicted samples. Among the predicted samples, filtering can be performed on samples in one, two, or N sample lines located at the upper or left boundary of the current block.
[0288] To perform planar prediction, a weighted sum of one or more reference samples can be used. For example, such as Figure 10 As shown in (d), five reference samples can be used. For example, to generate a prediction sample for the target location [x,y], reference samples r[-1,-1], r[x,-1], r[-1,y], r[W,-1], and r[-1,H] can be used. In this case, W and H are the width and height of the current block, respectively. For example, the prediction sample pred[x,y] can be generated using Equation 3. In Equation 3, a, b, c, d, and e represent weights. N can be log2(a+b+c+d+e).
[0289] [Equation 3]
[0290] pred[x,y]=(a×r[-1,-1]+b×r[x,-1]+c×r[-1,y]+d×r[W,-1]+e×r[-1,H])>>N
[0291] As another example, multiple reference sample lines can be used to perform plane prediction. For instance, a weighted sum of two reference sample lines can be used to perform plane prediction. As yet another example, a weighted sum of reference samples from two reference sample lines can be used to perform plane prediction. In this case, the reference sample selected from the second reference sample line can be a sample adjacent to the reference sample selected from the first reference sample line. That is, when a reference sample located at position (-1, -1) is selected, a reference sample located at position (-2, -2) can be selected. Plane prediction can be performed by calculating the weighted sum of the selected reference samples, and in this case, the same weights used for DC prediction can be used.
[0292] The direction prediction mode refers to at least one of the following: horizontal mode, vertical mode, and angle mode with a predetermined angle.
[0293] In horizontal or vertical mode, prediction is performed using one or more reference points arranged along a straight line (i.e., horizontal or vertical). Multiple reference point lines can be used. For example, when using two reference point lines, prediction can be performed using two reference points arranged along a horizontal or vertical line. Similarly, when using N reference point lines, N reference points on a horizontal or vertical line can be used.
[0294] For the vertical mode, the statistics of the first reference sample (e.g., r[x,-1]) on the first reference sample line and the second reference sample (e.g., r[x,-2]) on the second reference sample line can be used to perform direction prediction.
[0295] For example, the predicted value of the vertical pattern can be determined by calculating the result of (3×r[x,-1]+r[x,-2]+2)>>2. Alternatively, the predicted value of the vertical pattern can be determined by calculating the result of (3×r[x,-1]-r[x,-2]+1)>>1. In another option, the predicted value of the vertical pattern can be determined by calculating the value of (r[x,-1]+r[x,-2]+1)>>1.
[0296] For example, the variation between the values of each sample point on the vertical line can be considered. For instance, the predicted value of the vertical pattern can be determined by calculating the result of (r[x, -1] + (r[x, -1] – r[x, -2]) >> 1). In this case, N can be an integer equal to or greater than 1. A fixed value can be used for N. Alternatively, N can increase as the y-coordinate of the predicted target sample point increases. For example, N = y + 1.
[0297] Even for horizontal mode, one or more methods used for vertical mode can be used.
[0298] For a specific angle pattern, prediction can be performed using one or more reference samples arranged along the tilt direction from the intra-frame predicted target samples of the current block, or using one or more samples adjacent to the reference samples located in the tilt direction. In this case, a total of N reference samples can be used, where N can be 2, 3, 4, 5, or 6. Prediction can also be performed by applying at least one of N tap filters to the N reference samples. Examples of N tap filters include 2-tap filters, 3-tap filters, 4-tap filters, 5-tap filters, and 6-tap filters. In this case, at least one of the reference samples can be located above the current block, while the remaining reference samples can be located to the left of the current block. Reference samples located above the current block (or to the left of the current block) can be located on the same line or on different lines.
[0299] According to another embodiment, intra-frame prediction can be performed based on location information. In this case, the location information can be encoded / decoded, and the reconstructed sample block located at the aforementioned location can be derived as the intra-frame prediction block of the current block. Optionally, the decoder can search for blocks similar to the current block, and the found blocks can be derived as the intra-frame prediction blocks of the current block.
[0300] According to another embodiment, intra-frame prediction between color components is performed. For example, intra-frame prediction of the chrominance component can be performed from the corresponding reconstructed luma component of the current block. Alternatively, intra-frame prediction of the corresponding chrominance component Cr can be performed from a reconstructed chrominance component Cb of the current block.
[0301] In the various embodiments described above, unfiltered reference samples can be used in the reference sample construction process for intra-frame prediction. That is, directional or non-directional prediction can be performed using unfiltered reference samples. Since filtering is not performed in the reference sample construction process, the complexity of the encoder / decoder can be reduced, and hardware configuration can be simplified.
[0302] In intra-frame prediction, one or more reference samples may be used for interpolation prediction. In intra-frame prediction, at least one of the following parameters may vary depending on at least one of the following: the number of reference sample lines, the number of interpolation filter taps, interpolation filter coefficients, information about the application / non-application of filters, the weighted average calculation method, and the weights.
[0303] For example, one or more reference sample lines can be used, and the number of reference sample lines used can vary depending on one or more coding parameters. Multiple reference sample lines can be used. Figure 11 This is a diagram illustrating an embodiment using two reference sample lines.
[0304] The number of reference sample lines used for prediction varies depending on the intra-prediction mode or the directionality of the intra-prediction mode of the current block. For example, when the intra-prediction mode of the current block is a non-directional mode (such as DC mode or planar mode), one reference sample line can be used. When the intra-prediction mode of the current block is a directional mode, two reference sample lines can be used. The number of reference sample lines can also vary depending on whether the directional mode meets predetermined conditions or falls within a predetermined range. That is, when the directional mode is an even-numbered mode, two reference sample lines can be used. When the directional mode is an odd-numbered mode, one reference sample line can be used. For example, one reference sample line can be used for either horizontal or vertical modes. Multiple reference sample lines can be used when the intra-prediction mode falls within a predetermined range. Otherwise, a single reference sample line can be used.
[0305] The number of reference point lines can vary depending on the size and / or shape of the current block. For example, one reference point line can be used when the current block is smaller than a predetermined size, while two reference point lines can be used when the current block is larger than a predetermined size. That is, one reference point line can be used when the current block is smaller than or equal to 16×16 (i.e., 256 points), while two reference point lines can be used when the current block is larger than or equal to 16×16. Conversely, two reference point lines can be used for smaller blocks, while one reference point line can be used for larger blocks. For example, two reference point lines can be used when the current block is a square block, while one reference point line can be used when the current block is not a square block. The number of reference point lines can also vary depending on the position of the reference point (i.e., whether the reference point is located above or to the left of the current block).
[0306] Optionally, the number of reference point lines can vary based on the width (horizontal dimension) or height (vertical dimension) of the current block. For example, multiple reference point lines can be used when the width or height of the current block is greater than a predetermined value. Conversely, one reference point line can be used when the width or height of the current block is equal to or less than a predetermined value. For example, only one reference point line can be used when the current block is a 4×N or N×4 block; otherwise, two or more reference point lines can be used. The same weight can be applied to two or more reference point lines. For example, multiple reference point lines can be used when the statistics of the width and height of the current block are within a predetermined range. Otherwise, one reference point line can be used.
[0307] The number of reference sample lines can vary depending on the intra-prediction mode of the current block and the length (horizontal or vertical, i.e., width or height) of the current block. For example, when the intra-prediction mode is vertical, the number of reference sample lines can vary depending on the width (horizontal dimension) of the current block. For example, when the intra-prediction mode of the current block is horizontal, the number of reference sample lines can vary depending on the height (vertical dimension) of the current block. For example, when the intra-prediction mode of the current block is non-directional, the number of reference sample lines can vary depending on whether the length of the horizontal and / or vertical dimensions of the current block corresponds to a predetermined value or falls within a predetermined range.
[0308] The number of reference sample lines can vary depending on the color components of the current block. For example, multiple (i.e., two or more) reference sample lines can be used for the luminance component, and one reference sample line can be used for each chrominance component.
[0309] The number of reference sample lines can be set differently when the boundary of the current block corresponds to the boundary of a predetermined unit. For example, when the upper boundary of the current block corresponds to the boundary of at least one of a frame, stripe, parallel block, coding tree unit (CTU), and block of any size, a reference sample line can be used for the samples in the upper boundary of the current block. Similarly, when the left boundary of the current block corresponds to the boundary of at least one of a frame, stripe, parallel block, coding tree unit (CTU), and block of any size, a reference sample line can be used for the samples in the left boundary of the current block. Arbitrary block sizes can be transmitted via signals or predefined in the encoder / decoder.
[0310] When using multiple reference sample lines, the choice of which reference sample lines to use can be set differently based on coding parameters (e.g., intra-prediction mode). For example, the first reference sample line can be used when the intra-prediction mode of the current block is an even-numbered mode, while the second reference sample line can be used when the intra-prediction mode of the current block is an odd-numbered mode.
[0311] When performing direction prediction on the current block, an interpolation filter can be used. The interpolation filter can be a filter with at least one of 2 taps, 4 taps, 6 taps, and N taps (N is a positive integer). Each interpolation filter tap has one or more filter coefficients.
[0312] For example, a 6-tap filter can be applied according to Equation 4. Figure 11 The sample points are S00 to S05, and the filter coefficients can be in the range from a to f.
[0313] [Equation 4]
[0314] S_F=(a×S00+b×S01+c×S02+d×S03+e×S04+f×S05+2 g-1 )>>g
[0315] The sum of the filter coefficients can be at least one of 32, 64, 128, 256, 512, 1024, and N, and each filter coefficient can be an integer value. The sum of the filter coefficients can be equal to 2 raised to the power of g. For example, when the sum of the filter coefficients is 1024, g can be 10.
[0316] The interpolation filter taps or coefficients can vary depending on at least one of the current block size, the current block shape, the location of the predicted target sample, and the intra-prediction mode of the current block.
[0317] The interpolation filter taps or coefficients can vary depending on the intra-prediction mode. For example, a 4-tap filter can be applied when the intra-prediction mode is a predetermined mode, while a 2-tap filter can be applied when the intra-prediction mode is not a predetermined mode. Furthermore, the filter coefficients can vary depending on the angle of the intra-prediction mode. For example, as shown in Table 1, two filter types (i.e., filter 1 and filter 2) can be used for a 6-tap filter. The 6-tap filter can have filter coefficients {a,b,c,d,e,f}, and the filter coefficients can be stored in the form of a lookup table (LUT). In this case, the index information used to reference the lookup table can be encoded / decoded.
[0318] [Table 1]
[0319] 6-tap filter 1 6-tap filter 2 Angle 0 {0,256,512,256,0,0} {47,255,416,256,49,1} Angle 1 {-3,246,509,267,6,-1} {43,247,416,264,53,1} Angle 2 {-5,237,506,278,11,-3} {40,240,414,270,58,2} Angle 3 {-7,228,502,288,17,-4} {37,233,413,277,62,2} Angle 4 {-9,218,497,299,24,-5} {34,226,412,284,66,2} Angle 5 {-10,210,493,309,29,-7} {31,218,410,292,71,2} Angle 6 {-12,200,488,320,36,-8} {28,210,407,299,77,3} Angle 7 {-13,191,482,330,43,-9} {26,203,404,306,82,3} Angle 8 {-14,182,476,340,50,-10} {23,195,401,313,88,4} Angle 9 {-15,173,470,350,57,-11} {21,188,398,320,93,4} Angle 10 {-16,163,463,361,65,-12} {19,180,393,327,100,5} Angle 11 {-16,155,456,370,72,-13} {17,173,389,333,106,6} Angle 12 {-16,147,449,379,79,-14} {16,167,385,339,111,6} Angle 13 {-16,138,440,388,88,-14} {14,159,380,346,118,7} Angle 14 {-17,128,433,399,96,-15} {13,153,375,351,124,8} Angle 15 {-16,121,425,407,103,-16} {11,145,370,358,131,9} Angle 16 {-16,112,416,416,112,-16} {10,138,364,364,138,10}
[0320] As can be seen from Table 1, reference samples that are close to the angle line of the direction mode can be assigned a larger weight. For example, the first filter can be applied when the intra-prediction mode of the current block is an even-numbered mode, while the second filter can be applied when the intra-prediction mode of the current block is an odd-numbered mode.
[0321] Optionally, a first filter may be applied when the intra-prediction mode has an angle corresponding to a multiple of 45 degrees, and a second filter may be applied when the intra-prediction mode has one of the other angles. The first filter and the second filter differ in at least one aspect of filter taps, filter coefficients, and filter shape.
[0322] The interpolation filter taps or coefficients can vary depending on the position of the predicted target sample within the current block. For example, a first interpolation filter can be applied when the predicted target sample is close to a reference sample, and a second interpolation filter can be applied when the predicted target sample is far from the reference sample. A third, fourth, ..., and Nth interpolation filter can be applied based on the position of the predicted target sample, and the number of interpolation filters can vary depending on the size and / or shape of the current block. Multiple interpolation filters can have the same filter taps and different filter coefficients. Optionally, multiple interpolation filters can have different filter taps and different filter coefficients.
[0323] For example, a first filter can be applied when the width or height of the current block has a first length, and a second filter can be applied when the width or height of the current block has a second length.
[0324] For example, a first filter can be applied when the width or height of the current block corresponding to the reference sample area used in the orientation prediction mode is less than or equal to 8, while a second filter can be applied when the width or height is greater than 8.
[0325] For example, when the block size is 64 or smaller, a first filter can be used. Otherwise, a second filter can be used. Both types of filters can be used selectively based on the location of the predicted target samples. For example, when the intra-frame prediction mode falls within the range of 34 to 66, the first filter can be applied to the predicted target samples located at the top of the current block, and the second filter can be applied to the predicted target samples located at the bottom of the current block. Similarly, when the intra-frame prediction mode falls within the range of 2 to 33, the first filter can be applied to the predicted target samples located at the left side of the current block, and the second filter can be applied to the predicted target samples located at the right side of the current block. In the above embodiments, the first filter can be a cubic interpolation filter, and the second filter can be a Gaussian interpolation filter.
[0326] For example, filter coefficients can be adaptively selected and applied based on the width or height of the current block.
[0327] The interpolation filter taps or filter coefficients can vary based on the color components of the current block. For example, a first filter can be applied to the luminance signal sample, and a second filter can be applied to the chrominance signal sample. For example, a 4-tap filter can be applied to the luminance signal sample, and a 2-tap (bilinear) filter can be applied to the chrominance signal sample.
[0328] When using multiple reference sample lines, the interpolation filter taps or filter coefficients can vary depending on which reference sample line is used. For example, a first filter can be applied to a first reference sample line adjacent to the current block, and a second filter can be applied to a second reference sample line. Figure 11 As shown, when performing direction prediction, a first interpolation filter can be applied to samples S00 to S05 located in the first reference sample line, and a second interpolation filter can be applied to samples S12 to S13 located in the second reference sample line.
[0329] For example, the first filter can be applied to all of the multiple reference sample lines. In this case, the filter coefficients applied to the first reference sample line and the filter coefficients applied to the second reference sample line can be different from each other.
[0330] At this point, when the direction of the direction prediction mode crosses a predetermined position between two reference samples, the positions of the reference samples selected from each reference sample line can be different. For example, samples S02 and S03 located in the first reference sample line can be used to perform a 2-tap interpolation filter, and samples S13 and S14 located in the second reference sample line can be used to perform a 2-tap interpolation filter.
[0331] When using multiple reference sample lines, the interpolation filter can have a two-dimensional shape. For example, an interpolation filter with a shape similar to... Figure 9The example shown is the first filter with the same shape.
[0332] For example, reference samples that have not been filtered by an interpolation filter can be used for direction prediction. For instance, reference samples that have not been filtered by an interpolation filter can be used when the reference sample corresponding to the direction prediction mode exists at an integer position. At least one of a 3-tap, 5-tap, and N-tap filter can be applied to reference samples that have not been filtered by an interpolation filter. For example, a {1,2,1} filter can be applied to the reference sample. Whether to apply a filter to the reference sample can be determined based on at least one of the intra-prediction mode of the current block, the size of the current block, and the shape of the current block.
[0333] For example, when using multiple reference sample lines, an interpolation filter or weighted average can be applied to multiple values obtained by applying the interpolation filter to each reference sample line. For example, as in Equation 5, the weighted average of values S-F1 and S-F2 can be derived to the predicted value S-P, where value S-F1 is obtained by applying a first interpolation filter to a first reference sample line, and value S-F2 is obtained by applying a second interpolation filter to a second reference sample line. Here, h and i can be weights, and h+i can be a value corresponding to 2 raised to the power of j. For example, h = 3, i = 1, j = 2. Optionally, h, i, and j can all be 1. The first interpolation filter and the second interpolation filter can be different filter types. For example, the first interpolation filter and the second interpolation filter can differ in at least one aspect, such as filter taps and filter coefficients.
[0334] [Equation 5]
[0335] S_P=(h×S_F1+i×S_F2+2 j-1 )>>j
[0336] Alternatively, the predicted value can be determined by taking into account the amount of change between each angle line (such as vertical prediction) (e.g., S_F1+(S_F1-S_F2)>>j).
[0337] The preceding text described performing different interpolations on the first and second reference sample lines adjacent to the current block among multiple reference sample lines. However, the above operation is not limited to the first and second reference sample lines among multiple reference sample lines. For example, the first and second reference sample lines can be replaced by any first and any second reference sample line from the multiple reference sample lines, respectively.
[0338] When applying an interpolation filter, padding can be performed when using samples located outside the configured reference sample region. For example, in direction prediction mode and in... Figure 11When the directions traversed between reference sample S04 and reference sample S05 correspond, when a 6-tap filter is applied, the two samples located on the right and deviating from the direction prediction mode can be filled with reference sample S05, and an interpolation filter can then be applied. In the case of angle mode, the configured reference samples can be reconfigured based on the angle prediction mode. For example, when the angle prediction mode is a mode that uses all left and top reference samples, a one-dimensional array can be configured for either the left or top reference samples. Optionally, the top reference sample can be configured by shifting the left reference sample, or by using a weighted sum of at least one left reference sample.
[0339] Different angle intra-frame prediction or interpolation filtering can be performed on predetermined sample group units of the current block. Predetermined sample group units can be blocks, sub-blocks, lines, or individual samples.
[0340] According to another embodiment of the present invention, inter-component intra-frame prediction can be performed. Inter-component intra-frame prediction includes a color component block reconstruction step, a prediction parameter derivation step, and / or an inter-component prediction execution step. The term "color component" can refer to at least one of a luminance signal, a chrominance signal, red, green, blue, Y, Cb, and Cr. Prediction of the first color component can be performed using at least one of a second color component, a third color component, and a fourth color component. The signal used for predicting the color component can include at least one of the original signal, the reconstructed signal, the residual signal, and the predicted signal.
[0341] When performing intra-frame prediction on a second color component target block, samples from the corresponding block of the first color component block, samples from neighboring blocks of the corresponding first color component block, or both samples from the corresponding block of the first color component block and samples from neighboring blocks of the corresponding first color component block can be used. For example, when performing intra-frame prediction on a chrominance component block Cb or Cr, the reconstructed luminance component block Y corresponding to the chrominance component block Cb or Cr can be used.
[0342] When predicting the chromaticity component based on the luminance component, the prediction can be performed according to Equation 6.
[0343] [Equation 6]
[0344] Pred C (i,j)=α·rec L '(i,j)+β
[0345] In Equation 6, Pred C (i,j) represents the predicted chroma sample points of the current block, rec L (i,j) represents the reconstructed brightness sample points of the current block. At this point, rec...L '(i,j) can be the downsampled reconstructed luminance sample. The parameters α and β can be derived by minimizing the regression error between the reconstructed neighboring luminance samples and the reconstructed neighboring chrominance samples around the current block.
[0346] There are two modes for predicting chromaticity components using the luminance component. These modes can be a single-model mode and a multi-model mode. When predicting the chromaticity component from the luminance component for the current block, the single-model mode uses one linear model. The multi-model mode uses two linear models.
[0347] In multi-model mode, samples adjacent to the current block (i.e., neighboring luminance samples and neighboring chrominance samples) can be classified into two groups. That is, parameters α and β for each of the two groups can be derived. Furthermore, the luminance samples of the current block can be classified according to the rules used to classify the luminance samples adjacent to the current block.
[0348] For example, a threshold can be calculated to classify neighboring samples into two groups. The threshold can be calculated using the average value of the reconstructed neighboring brightness samples. However, the calculation of the threshold is not limited to this. At least one of the various statistical values recognized in this specification can be used instead of the average value. When the value of a neighboring sample is greater than the threshold, the neighboring sample can be classified into the first group. Otherwise, the neighboring sample can be classified into the second group.
[0349] Although the above embodiments describe a multi-model mode using two linear models, the invention is not limited thereto and can cover other cases using two or more linear models. When using N linear models, the samples can be classified into N groups. For this purpose, N-1 thresholds can be calculated.
[0350] As described above, a linear model can be used when predicting the chrominance component from the luminance component. In this case, the linear model can include a simple linear model (hereinafter referred to as "LM1"), a complex linear model (hereinafter referred to as "LM2"), and a complex filter linear model (hereinafter referred to as "LM3"). The parameters of the above models can be derived by minimizing the regression error between the reconstructed luminance samples around the current block and the corresponding reconstructed chrominance samples around the current block.
[0351] Figure 12 This is a diagram of the "neighboring samples of the current block" (hereinafter referred to as the "neighboring dataset") used to describe the parameters used to derive the model.
[0352] The neighborhood dataset used to derive the parameters of LM1 can consist of a pair of sample points, wherein the pair of sample points includes Figure 12The diagram shows luminance and chrominance samples in each of line regions B and C. The neighbor dataset used to derive the parameters of LM2 and LM3 can consist of a pair of samples, wherein the pair of samples includes... Figure 12 The luminance and chrominance samples in each of the line regions B, C, E, and F shown in the figure.
[0353] However, the nearest neighbor dataset is not limited to the examples above. For instance, to cover various linear relationships between luminance and chrominance samples in the current block, N nearest neighbor datasets can be used for each mode. For example, N can be an integer of 2 or greater, and specifically 3.
[0354] The parameters of a linear model can be calculated using both the top template and the left template. Optionally, there are two LM modes (LM_A mode and LM_L mode), and the top template and the left template can be used in LM_A mode and LM_L mode respectively. That is, in LM_A mode, only the top template can be used to obtain the linear model parameters. When the position of the top-left sample point of the current block is (0,0), the top template can be extended to the range from (0,-n) to (W+H-1,-n). In this case, n is an integer equal to or greater than 1. That is, in LM_L mode, only the left template can be used to obtain the linear model parameters. The left template can be extended to the range from (-n,0) to (-n,H+W-1). In this case, n is an integer equal to or greater than 1.
[0355] The parameters of a linear model can be derived using a power of two of the sample points. When the current chroma block is a non-square block, the sample points used to derive the parameters of the linear model can be determined based on the number of sample points on the shorter of the horizontal and vertical edges of the current block. According to one embodiment, when the size of the current block is n×m (where n>m), m sample points out of n neighboring sample points adjacent to the upper boundary of the current block can be selected, for example, by uniformly performing subsampling. In this case, the number of sample points used to derive the parameters of the linear model can be 2m. As another example, when the size of the current block is n×m (where n>m), m sample points out of n neighboring sample points adjacent to the upper boundary of the current block may not be used. For example, out of n sample points, the m sample points farthest from the shorter of the horizontal and vertical edges of the current block may not be used. In this case, the number of sample points used to derive the parameters of the linear model can be n(nm sample points adjacent to the upper boundary of the current block + m sample points adjacent to the left boundary of the current block).
[0356] Optionally, when performing intra-frame prediction on the chrominance component block Cr, the chrominance component block Cb can be used. Optionally, when performing intra-frame prediction on the fourth color component block, at least one of the first color component block, the second color component block, and the third color component corresponding to the fourth color component block can be used.
[0357] Whether to perform inter-color component intra-frame prediction can be determined based on at least one of the size and shape of the current target block. For example, inter-color component intra-frame prediction can be performed on the target block when its size is equal to the size of the coding tree unit (CTU), larger than a predetermined size, or within a predetermined size range. Optionally, inter-color component intra-frame prediction can be performed on the target block when its shape is a predetermined shape. The predetermined shape can be a square shape. In this case, when the target block has a rectangular shape, inter-color component intra-frame prediction may not be performed on the target block. Alternatively, when the predetermined shape is a rectangle, the above embodiments operate in reverse.
[0358] Optionally, whether to perform inter-color component intra-frame prediction on the target block can be determined based on the encoding parameters of at least one block selected from the corresponding block and its neighboring blocks. For example, if the corresponding block has already been predicted using an intra-frame prediction method in a constrained intra-frame prediction (CIP) environment, inter-color component intra-frame prediction may not be performed on the target block. Optionally, inter-color component intra-frame prediction can be performed on the target block when the intra-frame prediction mode of the corresponding block is a predetermined mode. Further optionally, whether to perform inter-color component intra-frame prediction can be determined based on at least one of the CBF information of the corresponding block and the CBF information of its neighboring blocks. The encoding parameters are not limited to the prediction mode of the block, but can use various parameters that can be used for encoding / decoding.
[0359] The steps for reconstructing color component blocks will be described below.
[0360] The first color component block can be reconstructed when a second color component block is predicted using a first color component block. For example, when the image has a YCbCr color space and the color component sampling rate is one of 4:4:4, 4:2:2, and 4:2:0, the block sizes of the color components can be different from each other. Therefore, when the second color component block is predicted using a first color component block with a different size than the second color component block, the first color component block can be reconstructed such that the block sizes of the first and second color components are equal. The reconstructed block may include at least one of samples from the first color component block (which is the corresponding block) and samples from neighboring blocks of the first color component block. Figure 13 This is an exemplary diagram illustrating the process of reconstructing color component blocks.
[0361] exist Figure 13In (a), p1[x,y] represents the sample point at position (x,y) in the first color component block. Figure 13 In (b), p1'[x,y] represents the sample point at position (x,y) in the reconstructed block generated by reconstructing the first color component block.
[0362] When the first color component block has a larger size than the second color component block, the first color component block is downsampled to have a size equal to that of the second color component block. Downsampling can be performed by applying an N-tap filter to one or more samples (N is an integer equal to or greater than 1). At least any one of equations 7 to 11 can be used for downsampling. When selectively using any of the various downsampling methods, the encoder can select a downsampling method as a predetermined downsampling method. For example, the encoder can select the downsampling method that has the best effect. The selected downsampling method is encoded and sent to the decoder as a signal. The information sent as a signal can be index information indicating the downsampling method.
[0363] [Equation 7]
[0364] p1'[x,y]=(p1[2x,2y]+p1[2x,2y+1]+1)>>1
[0365] [Equation 8]
[0366] p1'[x,y]=(p1[2x+1,2y]+p1[2x+1,2y+1]+1)>>1
[0367] [Equation 9]
[0368] p1'[x,y]=(p1[2x-1,2y]+2×p1[2x,2y]+p1[2x+1,2y]+2)>>2
[0369] [Equation 10]
[0370] p1'[x,y]=(p1[2x-1,2y+1]+2×p1[2x,2y+1]+p1[2x+1,2y+1]+2)>>2
[0371] [Equation 11]
[0372] p1'[x,y]=(p1[2x-1,2y]+2×p1[2x,2y]+p1[2x+1,2y]+p1[2x-1,2y+1]+2×p1[2x,2y+1]+p1[2x+1,2y+1]+4)>>3
[0373] The downsampling method performed on two or more sample points is not limited to any of the examples in Equations 7 to 11. For example, two or more sample points can be selected from a group of sample points consisting of sample point p1[2x,2y] and its neighboring sample points for calculating the downsampled value p1'[x,y]. The neighboring sample points can be selected from p1[2x-1,2y-1], p1[2x-1,2y], p1[2x-1,2y+1], p1[2x,2y-1], p1[2x,2y+1], p1[2x+1,2y-1], p1[2x+1,2y], and p1[2x+1,2y+1]. Downsampling can be performed by calculating the average or weighted average of the two or more sample points.
[0374] Alternatively, downsampling can be performed by selecting specific sample points from one or more sample points. In this case, at least any one of the following equations (Equations 12 to 15) can be used for downsampling.
[0375] [Equation 12]
[0376] p1'[x,y]=p1[2x,2y]
[0377] [Equation 13]
[0378] p1'[x,y]=p1[2x,2y+1]
[0379] [Equation 14]
[0380] p1'[x,y]=p1[2x+1,2y]
[0381] [Equation 15]
[0382] p1'[x,y]=p1[2x+1,2y+1]
[0383] When the first color component block has a smaller size than the second color component block, the first color component block is upsampled to be reconstructed so that the sizes of the first and second color component blocks are equal. In this case, upsampling is performed according to Equation 16.
[0384] [Equation 16]
[0385] p1'[2x,2y]=p1[x,y],
[0386] p1'[2x+1,2y]=(p1[x,y]+p1[x+1,y]+1)>>1,
[0387] p1'[2x,2y+1]=(p1[x,y]+p1[x,y+1]+1)>>1,
[0388] p1'[2x+1,2y+1]=(p1[x+1,y]+p1[x,y+1]+1)>>1
[0389] In the reconstruction process, a filter may be applied to one or more samples. For example, a filter may be applied to one or more samples including at least one of a first color component block (i.e., the corresponding block), the neighboring blocks of the corresponding block, a second color component block (i.e., the target block), and the neighboring blocks of the target block.
[0390] In the above-described reference sample reconstruction step, an indicator corresponding to a predetermined reference sample line among a plurality of reference sample lines can be transmitted via a signal. In this case, during the reconstruction process, reconstruction is performed using the predetermined reference sample line corresponding to the indicator transmitted via the signal.
[0391] During reconstruction, when the boundary of the second color component block (target block) or the boundary of the first color component block (corresponding block) is the boundary of a predetermined area, different reference points can be selected for the reconstruction operation. In this case, the number of reference point lines on the upper side can be different from the number of reference point lines on the left side. The predetermined area can be at least one of a frame, strip, parallel block, CTU, and CU.
[0392] For example, when the upper boundary of the corresponding block of the first color component is the boundary of the predetermined region, the upper reference points may not be used in the reconstruction operation, and only the left reference points may be used. When the left boundary of the corresponding block of the first color component is the boundary of the predetermined region, the left reference points may not be used in the reconstruction operation, and only the upper reference points may be used. Optionally, the N upper reference point lines and the M left reference point lines can all be used in the reconstruction operation, where N can be less than M. For example, when the upper boundary corresponds to the boundary of the predetermined region, N can be 1. Additionally, when the left boundary corresponds to the boundary of the predetermined region, M can be 1.
[0393] Alternatively, the reconstruction operation can be performed by using N reference sample lines on the upper side and M reference left sample lines on the left side of the corresponding block of the first color component, regardless of whether the boundary of the predetermined region is the upper boundary or the left boundary of the first color component block.
[0394] Figure 14 This is a diagram illustrating an embodiment of performing reconstruction using multiple upper reference sample lines and / or multiple left reference sample lines.
[0395] like Figure 14 As shown in (a), the reconstruction operation can be performed using four upper reference sample lines and four left reference sample lines.
[0396] For example, when the upper or left boundary of the corresponding block of the first color component is the boundary of a predetermined region, the number of upper reference sample lines and the number of left reference sample lines used for the reconstruction operation can be different from each other. For example, as Figure 14 (b) to Figure 14 As shown in (d), any combination of the following can be used for the reconstruction operation: two upper reference sample lines and four left reference sample lines; one upper reference sample line and three left reference sample lines; and one upper reference sample line and two left reference sample lines.
[0397] The number of reference sample lines used for reconstruction operations is not limited to the combinations described above. That is, N upper reference sample lines and M left reference sample lines can be used, where N and M are equal to or different from each other. N and M can be equal to each other when the upper and left boundaries of the corresponding blocks correspond to the boundaries of the predetermined region. That is, N and M can both be 1. Optionally, under the same conditions, N can be set to be less than M. This is because upper reference sample lines require more resources (memory) than left reference sample lines.
[0398] Optionally, such as Figure 14 As shown in (e), one or more reference samples within a region whose vertical and horizontal lengths are no greater than the vertical and horizontal lengths of the corresponding block of the first color component can be used for the reconstruction operation.
[0399] When performing reconstruction processing, the reference sample points of the first color component corresponding block can be set differently based on any one of the block size, block shape, and encoding parameters of at least one of the following blocks: the first color component corresponding block, the neighboring block of the first color component corresponding block, the second color component target block, and the neighboring block of the second color component target block.
[0400] For example, in the samples of the first color component corresponding block and the neighboring blocks of the first color component corresponding block, the samples of the block with the inter-frame coding mode are not used, and only the samples of the block with the intra-frame coding mode are used for the reconstruction operation.
[0401] Figure 15 This is an exemplary diagram illustrating reference samples used for reconstruction operations based on the intra-prediction mode or coding parameters of the corresponding block. The reconstruction operation of the reference samples of the first color component block can be performed differently depending on the intra-prediction mode of the corresponding block of the first color component. For example, as... Figure 15 As shown in (a), when the intra-prediction mode of the corresponding block is a non-angular mode (such as DC mode and planar mode) or an angular mode using both the upper reference sample and the left reference sample, at least one of the upper reference sample and the left reference sample is used for the reconstruction operation. Optionally, as Figure 15As shown in (b), when the intra-prediction mode of the corresponding block is an angle mode that uses both the upper reference sample and the upper right reference sample, at least one of the upper reference sample and the upper right reference sample is used for the reconstruction operation. Optionally, as Figure 15 As shown in (c), when the intra-prediction mode of the corresponding block is an angle mode that uses both the left reference sample and the lower left reference sample, at least one of the left reference sample and the lower left reference sample is used for the reconstruction operation.
[0402] Optionally, reference samples for reconstructing the first color component corresponding block are selected differently based on the quantization parameters of at least one of the corresponding blocks of the first color component and its neighboring blocks. For example, as Figure 15 As shown in (d), reference samples in the upper block arranged on the upper side of the corresponding block are used for the reconstruction operation of the corresponding block, wherein the neighboring blocks of the upper block have relatively small quantization parameter values.
[0403] Optionally, when the second color component target block has a rectangular shape, reference points arranged around the corresponding first color component block having a square shape are used for the reconstruction operation.
[0404] Optionally, when the second color component target block is partitioned into two sub-blocks (e.g., two 16×8 size sub-blocks) and the corresponding first color component block is a 32×16 size block, reference samples arranged around the 32×32 size block can be used for the reconstruction operation of the corresponding block. In this case, the reference samples around the reconstructed 32×32 size block can be shared as reference samples of the first color component block corresponding to the second 16×8 size sub-block arranged on the lower side of the two sub-blocks partitioned from the second color component target block.
[0405] The derivation steps for the prediction parameters will be described below.
[0406] The prediction parameters can be derived using at least one of the reference points of the corresponding block of the reconstructed first color component and the reference points of the target block of the second color component. In the following text, the terms "first color component" and "first color component block" may refer to the reconstructed first color component and the reconstructed first color component block, respectively.
[0407] Figure 16 This is an illustration of an exemplary reconstructed block for the corresponding first color component when the target block predicted by the second color component is a 4×4 block. In this case, the number of reference sample lines can be N.
[0408] like Figure 16As shown in (a), the prediction parameters can be derived using reference samples arranged on the top and left sides of the corresponding block of the first color component or the prediction target block of the second color component.
[0409] For example, prediction parameters can be derived by adaptively using reference samples of the reconstructed first color component based on the intra-prediction mode of the corresponding block of the first color component. In this case, reference samples of the second color component can be adaptively used based on the intra-prediction mode of the corresponding block of the first color component.
[0410] like Figure 16 As shown in (a), when the intra-prediction mode of the first color component corresponding block is a non-angular mode (such as DC mode or planar mode) or an angular mode using both the upper reference sample and the left reference sample, the upper and left reference samples of the first color component corresponding block can be used.
[0411] like Figure 16 (b) or Figure 16 As shown in (c), when the intra-prediction mode of the corresponding block of the first color component is a non-angular mode using the upper reference sample, the upper reference sample of the corresponding block of the first color component can be used.
[0412] like Figure 16 (d) or Figure 16 As shown in (e), when the intra-prediction mode of the corresponding block of the first color component is the angle mode using the left reference sample, the reference sample on the left side of the corresponding block of the first color component can be used.
[0413] Optionally, when the intra-prediction mode of the corresponding block of the first color component is angle mode, the reference sample points used in each prediction mode can be used as reference sample points for the first color component. For example, when the intra-prediction mode is vertical mode, the reference sample points used in each prediction mode can be used. Figure 16 The reference sample points shown in (b) can be used when the intra-frame prediction mode is horizontal mode. Figure 16 The reference sample points shown in (d) can be used when the intra-frame prediction mode is the upper-right diagonal mode. Figure 16 The reference sample points shown in (c) can be used when the intra-frame prediction mode is the bottom-left diagonal mode. Figure 16 The reference sample points shown in (e) can be used when the intra-frame prediction mode is between the vertical mode and the upper-right diagonal mode. Figure 16 The reference sample points are shown in (f). When the intra-frame prediction mode is a 45° diagonal angle mode, the following is used: Figure 16 The upper right reference sample, lower left reference sample, or both upper right and lower left reference samples are shown in (g). Reference samples selected differently for each intra-frame prediction mode are stored in a lookup table format for ease of use.
[0414] Prediction parameters can be derived by adaptively using reference samples of the first or second color component based on the size and / or shape of the first and / or second color component blocks.
[0415] For example, when the size of the second color component target block is 64×64, 32, 16, or 8 reference samples from the top or left side of the first or second color component block can be used. As described above, when the size of the second color component target block is a predetermined size, the reference samples of the first or second color component block can be used adaptively. The predetermined size is not limited to 64×64, but can be a size transmitted by signaling via a bitstream or a size derived based on the encoding parameters of the current block or its neighboring blocks.
[0416] Optionally, when the second color component target block has a rectangular shape, a reference sample point adjacent to the longer side of the second color component target block can be used, wherein the longer side is a vertical side or a horizontal side. For example, when the target block size is 32×8, a reference sample point on the upper side of the first color component block or the second color component block can be used.
[0417] Optionally, when the target block of the second color component has a rectangular shape, reference points around a square block can be used. For example, when the target block is a 32×8 block, reference points around a 32×32 block can be used.
[0418] Prediction parameters can be derived using reference samples around the reconstructed first color component block and reference samples around the second color component block. Prediction parameters can be derived based on any of the factors including the correlation, variation, mean, and distribution of the color components. In this case, any method such as least squares (LS), least mean squares (LMS), etc., can be used.
[0419] When deriving prediction parameters using the LMS method, the prediction parameters can be a and b, α and β, or both. Equation 17 can be used to derive prediction parameters that minimize the error between the reference points of the first color component and the reference points of the second color component.
[0420] [Equation 17]
[0421]
[0422] In equation 17, p2 n The reference sample point represents the second color component, and p1′ nThis represents the reference sample points for the reconstructed first color component. N is the number of reference sample points used, arranged vertically or horizontally, and a and b represent the prediction parameters.
[0423] In this case, the correlation between the reference samples can be calculated using Equation 18.
[0424] [Equation 18]
[0425] k=Max(0,BitDepth+log2(N)-15)
[0426]
[0427]
[0428]
[0429]
[0430] In Equation 18, BitDepth represents the bit depth. p1′ represents the sample of the reconstructed first color component, and p2 represents the sample of the second color component. Figure 17 This is a diagram showing the sample points of the first color component and the sample points of the second color component.
[0431] When there are regions without reference samples in the process of deriving prediction parameters, the prediction parameters can be derived using only the existing samples.
[0432] One or more prediction parameters can be derived. For example, a first prediction parameter can be derived from reference samples with values that meet a specific requirement. Furthermore, a second prediction parameter can be derived from reference samples with values that do not meet a specific requirement. The specific requirement could be that the value of the reference sample is less than a statistical value (e.g., the mean).
[0433] According to another embodiment of the invention, basic prediction parameters (default parameters) can be used without deriving the prediction parameters from the values of reference samples. Default parameters can be predefined in the encoder and decoder. For example, prediction parameters a and b can be 1 and 0, respectively.
[0434] Optionally, when deriving prediction parameters from reference samples, the derived prediction parameters can be encoded and decoded.
[0435] When performing inter-color component prediction among color components Y, Cb, and Cr, prediction parameters for predicting color components Cb and Cr can be derived from color component Y. Prediction parameters for predicting color component Cr can be derived from color component Cb. Alternatively, prediction parameters already derived from color component Y for predicting color component Cb can be directly used as prediction parameters for predicting color component Cr, without deriving new prediction parameters for predicting color component Cr.
[0436] The steps for predicting between color components will be described below.
[0437] As described above, after deriving the prediction parameters, at least one of the derived prediction parameters can be used to perform intra-frame prediction between color components.
[0438] For example, according to Equation 19, the prediction of the target block of the second color component can be performed by applying the derived prediction parameters to the reconstructed signal of the first color component.
[0439] [Equation 19]
[0440] p2[x,y]=a×p1′[x,y]+b
[0441] In Equation 19, p2[x,y] represents the predicted block of the second color component target block. p1′[x,y] represents the first color component block or the reconstructed first color component block.
[0442] Alternatively, according to Equation 20, the prediction of the target block of the second color component can be performed by applying the derived prediction parameters to the residual signal of the reconstructed first color component.
[0443] [Equation 20]
[0444] p2[x,y]=p2_pred[x,y]+a×p1′_residual[x,y]
[0445] In Equation 20, p1′_residual represents the residual signal of the first color component, and p2_pred represents the prediction signal obtained by performing intra-frame prediction on the target block of the second color component.
[0446] When there are one or more derived prediction parameters, one or more prediction parameters can be applied to the reconstructed samples of the first color component. For example, when the reconstructed samples of the first color component meet a specific requirement, inter-color component intra-frame prediction can be performed by applying a first prediction parameter derived from a reference sample that meets the specific requirement. Conversely, when the reconstructed samples of the first color component do not meet the specific requirement, inter-color component intra-frame prediction can be performed by applying a second prediction parameter derived from a reference sample that does not meet the specific requirement. The specific requirement represents a condition where the value of the reference sample is less than the statistical value (e.g., the average value) of the reference sample of the first color component.
[0447] Inter-component prediction methods can be used in inter-frame prediction mode. For example, when performing inter-frame prediction on the current block, inter-frame prediction is performed on the first color component, and inter-component prediction can be performed on the second color component, or a combination of inter-frame prediction and inter-component prediction can be used. For example, the first color component can be a luma component, and the second color component can be a chroma component. Furthermore, inter-component prediction can be performed adaptively based on the coding parameters of the first color component. For example, whether to perform inter-component prediction can be determined based on the CBF information of the first color component. The CBF information can be information indicating the presence of a residual signal. That is, when the CBF of the first color component is 1, inter-component prediction can be performed on the second color component. When the CBF of the first color component is 0, inter-component prediction can be not performed on the second color component, and inter-frame prediction can be performed on the second color component. Optionally, a flag indicating whether to perform inter-component prediction can be sent using a signal.
[0448] Intra-prediction can be performed by combining one or more intra-prediction modes. For example, an intra-prediction block for the current block can be constructed by calculating a weighted average of blocks predicted using a predetermined non-directional intra-prediction mode and blocks predicted using a predetermined directional intra-prediction mode. Intra-prediction can also be performed by calculating a weighted sum of values predicted using an inter-color component prediction mode and values predicted using a predetermined intra-prediction mode. In this case, the weights can vary based on at least one of the intra-prediction mode of the current block, the size of the current block, the shape of the current block, and the position of the predicted samples. For example, when combining one or more intra-prediction modes, a prediction block can be constructed by calculating a weighted average of values predicted using the intra-prediction mode of the current block and values predicted using predetermined modes present in the MPM list. When combining one or more intra-prediction modes, a representative intra-prediction mode can be determined. For example, processing (e.g., transform and scan) can be performed adaptively based on the intra-prediction mode of the current block based on the representative intra-prediction mode. The representative intra-prediction mode can be an intra-prediction mode assigned a larger weight. Optionally, the one or more intra-prediction modes used for the combination operation can be directional or non-directional modes. When combining one or more prediction modes, values predicted using an intra-prediction mode can be combined with values predicted using an inter-prediction mode.
[0449] Intra-frame prediction can be performed using one or more sets of reference samples. For example, intra-frame prediction for the current block can be performed using a weighted average of a block obtained by performing intra-frame prediction on reference samples reconstructed from an unfiltered wave and a block obtained by performing intra-frame prediction on reference samples filtered from a wave.
[0450] In the process of performing intra-prediction, filtering using neighboring reconstructed samples can be performed. Whether to perform filtering can be determined based on at least one of the intra-prediction mode of the current block, the size of the current block, and the shape of the current block. Filtering can be included as a step in the intra-prediction process. When filtering is performed, at least one of the filter taps, filter coefficients, filter shape, the number of reference sample lines to which filtering will be applied, and the number of samples to which filtering will be applied can vary depending on at least one of the intra-prediction mode, size, and shape of the current block.
[0451] In the process of dividing the current block into sub-blocks, deriving the intra-prediction mode of each sub-block based on the intra-prediction modes of neighboring blocks, and performing intra-prediction for each sub-block based on the derived intra-prediction modes, filtering can be applied to each sub-block within the current block. For example, a low-pass filter can be applied to the entire region of the current block. Alternatively, the filter can be applied to samples located at the boundaries of each sub-block.
[0452] When the current block is divided into sub-blocks and intra-prediction is performed based on the sub-blocks, each sub-block can be at least one of an coded / decoded block, a prediction block, and a transform block. For example, when the current block size is 64×64 and the sub-block size is 16×16, an intra-prediction mode can be derived for each sub-block, allowing intra-prediction to be performed for each sub-block. In this case, when one or more sub-blocks are further divided into smaller 8×8 or 4×4 blocks, each 8×8 or 4×4 block can be a transform block. In this case, the intra-prediction mode of the 16×16 block can be used to predict each block in the 8×8 or 4×4 block.
[0453] After performing intra-frame prediction to generate a prediction block, filtering can be applied to the prediction block. For example, at least one of a low-pass filter and a bilateral filter can be applied. Whether to apply filtering can be determined based on at least one of the intra-frame prediction mode of the current block, the location of the predicted samples, the size of the current block, and the shape of the current block. Optionally, filtering can be applied only if each predicted sample (i.e., each predicted sample) satisfies a specific condition. When applying filtering to a prediction block, multiple reference sample lines can be used. For example, when filtering predicted samples located at the boundary between the current block and reference samples, two or more adjacent reference sample lines can be used to perform the filtering.
[0454] Filtering can be applied to predicted blocks obtained by performing intra-frame prediction on the current block and blocks reconstructed using residual blocks. For example, at least one of a low-pass filter and a bilateral filter can be applied. Whether to apply filtering can be determined based on the intra-frame prediction mode of the current block and at least one of size and shape. Optionally, filtering can be applied only if each predicted sample (i.e., each predicted sample) satisfies a specific condition.
[0455] The above embodiments can be performed in the same way in both the encoder and decoder.
[0456] The order in which the above embodiments are applied may differ between the encoder and the decoder, or the order in which the above embodiments are applied may be the same in the encoder and the decoder.
[0457] The above embodiments can be performed on each luminance signal and chrominance signal, or the above embodiments can be performed on both luminance and chrominance signals in the same way.
[0458] The block shape of the above embodiments of the present invention can be square or non-square.
[0459] The above embodiments of the present invention can be applied based on the size of at least one of the coding block, prediction block, transform block, block, current block, coding unit, prediction unit, transform unit, unit, and current unit. Here, size can be defined as the minimum size or maximum size, or both, for which the above embodiments are applied, or it can be defined as a fixed size to which the above embodiments are applied. Furthermore, in the above embodiments, a first embodiment can be applied to a first size, and a second embodiment can be applied to a second size. In other words, the above embodiments can be applied in combination based on sizes. Furthermore, the above embodiments can be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, the above embodiments can be applied when the block size is included within a specific range.
[0460] For example, the above embodiments can be applied when the size of the current block is 8×8 or larger. For example, the above embodiments can be applied when the size of the current block is only 4×4. For example, the above embodiments can be applied when the size of the current block is 16×16 or smaller. For example, the above embodiments can be applied when the size of the current block is equal to or greater than 16×16 and equal to or less than 64×64.
[0461] The above embodiments of the present invention can be applied according to time layers. To identify the time layer to which the above embodiments can be applied, an additional identifier can be signaled, and the above embodiments can be applied to a specified time layer identified by the corresponding identifier. Here, the identifier can be defined as the lowest or highest layer to which the above embodiments can be applied, or both, or it can be defined as indicating a specific layer to which the embodiment is applied. Furthermore, a fixed time layer to which the embodiments are applied can be defined.
[0462] For example, the above embodiments can be applied when the time layer of the current image is the lowest layer. For example, the above embodiments can be applied when the time layer identifier of the current image is 1. For example, the above embodiments can be applied when the time layer of the current image is the highest layer.
[0463] The strip types to which the above embodiments of the present invention are applied can be defined, and the above embodiments can be applied according to the corresponding strip types.
[0464] In the above embodiments, the method is described based on a flowchart having a series of steps or units. However, the present invention is not limited to the order of these steps, but some steps may be performed simultaneously with other steps or in a different order. Furthermore, those skilled in the art should understand that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart or some steps may be deleted from the flowchart without affecting the scope of the present invention.
[0465] The embodiments include various aspects of the examples. Not all possible combinations of the aspects may be described, but those skilled in the art will recognize different combinations. Therefore, the invention may include all substitutions, modifications, and alterations within the scope of the claims.
[0466] Embodiments of the present invention 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. The computer-readable recording medium may individually include program instructions, data files, data structures, etc., or may include a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable recording medium may be specifically designed and constructed for the present invention, or may be well known to those skilled in the art of computer software. Examples of computer-readable recording media include magnetic recording media (such as hard disks, floppy disks, and magnetic tapes), optical data storage media (such as CD-ROMs or DVD-ROMs), magneto-optical media (such as floppy disks), and hardware devices specifically configured to store and implement program instructions (such as read-only memory (ROM), random access memory (RAM), flash memory, etc.). Examples of program instructions include not only machine language code formatted by a compiler, but also high-level language code that can be implemented by a computer using an interpreter. The hardware device may be configured to operate by one or more software modules or vice versa to perform processing according to the present invention.
[0467] Although the invention has been described with respect to specific items (such as detailed elements) and limited embodiments and drawings, these are provided only to aid in a more complete understanding of the invention, and the invention is not limited to the embodiments described above. Those skilled in the art will understand that various modifications and changes can be made based on the above description.
[0468] Therefore, the spirit of the present invention should not be limited to the above embodiments, and the entire scope of the claims and their equivalents shall fall within the scope and spirit of the present invention.
[0469] Industrial applicability
[0470] This invention can be used to encode / decode images.
Claims
1. An image decoding device, the image decoding device being used for image decoding, the image decoding device comprising: Memory; as well as At least one processor, connected to the memory, is configured to: Receive residual information; The prediction mode of the current block is derived as the intra-frame prediction mode; Derive the reference sample points adjacent to the current block; Based on the prediction mode of the current block and the reference sample points, the prediction sample points of the current block are derived. Whether to apply filtering to the reference sample points is determined based on the prediction mode of the current block and the size of the current block; as well as Residual samples of the current block are generated based on the residual information. The reference sample points include the upper neighbor reference sample point and the left neighbor reference sample point of the current block. Specifically, for filtering the reference samples, a 3-tap filter or a 5-tap filter is used based on the size of the current block, and... Specifically, based on the fact that the prediction mode is a directional mode, a 4-tap interpolation filter is used to derive the prediction samples.
2. The image decoding device according to claim 1, wherein, Based on the application of filtering to the reference sample, filtering of the reference sample is performed based on the neighboring samples of the reference sample, and The neighboring sample points of the reference sample point include a first sample point adjacent to the reference sample point in the horizontal direction and a second sample point adjacent to the reference sample point in the vertical direction.
3. The image decoding device according to claim 1, wherein, The predicted samples are derived based on the first predicted samples derived from the first intra-frame prediction mode and the second predicted samples derived from the second intra-frame prediction mode. Among them, one of the first intra-frame prediction mode and the second intra-frame prediction mode is a non-directional mode.
4. The image decoding device according to claim 1, wherein, The filtering of the reference samples is performed based on the filter strength, and The filter strength is derived based on the size of the current block.
5. An image encoding device, the image encoding device being used for image encoding, the image encoding device comprising: Memory; as well as At least one processor, connected to the memory, is configured to: The prediction mode of the current block is derived as the intra-frame prediction mode; Derive the reference sample points adjacent to the current block; Based on the prediction mode of the current block and the reference sample points, the prediction sample points of the current block are derived. Whether to apply filtering to the reference sample points is determined based on the prediction mode of the current block and the size of the current block; Residual samples of the current block are generated based on the predicted samples; Residual information is generated based on the residual samples; as well as The image information is encoded, and the image information includes inter-frame prediction mode information for the current block and the residual information. The reference sample points include the upper neighbor reference sample point and the left neighbor reference sample point of the current block. Specifically, for filtering the reference samples, a 3-tap filter or a 5-tap filter is used based on the size of the current block, and... Specifically, based on the fact that the prediction mode is a directional mode, a 4-tap interpolation filter is used to derive the prediction samples.
6. The image encoding device according to claim 5, wherein, Based on the application of filtering to the reference sample, filtering of the reference sample is performed based on the neighboring samples of the reference sample, and The neighboring sample points of the reference sample point include a first sample point that is adjacent to the reference sample point in the horizontal direction and a second sample point that is adjacent to the reference sample point in the vertical direction.
7. A device for transmitting image data, said device being configured to: Obtain the bitstream used for image data, where, The bitstream is generated based on the following operations: deriving the prediction mode of the current block into an intra-frame prediction mode; deriving the reference sample of the current block; and deriving the prediction sample of the current block based on the prediction mode of the current block and the reference sample. Based on the prediction mode and the size of the current block, determine whether to apply filtering to the reference sample points; generate residual sample points for the current block based on the prediction sample points; Residual information is generated based on the residual samples; and image information is encoded, the image information including inter-frame prediction mode information for the current block and the residual information; as well as Send the image data including the bitstream. The reference sample points include the upper neighbor reference sample point and the left neighbor reference sample point of the current block. Specifically, for filtering the reference samples, a 3-tap filter or a 5-tap filter is used based on the size of the current block, and... Specifically, based on the fact that the prediction mode is a directional mode, a 4-tap interpolation filter is used to derive the prediction samples.