CN118251891A - Method and apparatus for video coding and decoding using template matching-based intra prediction - Google Patents

Method and apparatus for video coding and decoding using template matching-based intra prediction Download PDF

Info

Publication number
CN118251891A
CN118251891A CN202280076116.6A CN202280076116A CN118251891A CN 118251891 A CN118251891 A CN 118251891A CN 202280076116 A CN202280076116 A CN 202280076116A CN 118251891 A CN118251891 A CN 118251891A
Authority
CN
China
Prior art keywords
block
region
current
search
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202280076116.6A
Other languages
Chinese (zh)
Inventor
安镕照
李钟石
许镇
朴胜煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hyundai Motor Co
Kia Corp
DigitalInsights Inc
Original Assignee
Hyundai Motor Co
Kia Corp
DigitalInsights Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from KR1020220116837A external-priority patent/KR20230073970A/en
Application filed by Hyundai Motor Co, Kia Corp, DigitalInsights Inc filed Critical Hyundai Motor Co
Priority claimed from PCT/KR2022/013976 external-priority patent/WO2023090613A1/en
Publication of CN118251891A publication Critical patent/CN118251891A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Disclosed are a method and apparatus for video encoding and decoding using template matching-based intra prediction, the present embodiment provides a video encoding and decoding method and apparatus for defining previously reconstructed pixels spatially adjacent to a current block as templates and performing a template matching-based search in a previously reconstructed region around the current block to select an intra predictor.

Description

Method and apparatus for video coding and decoding using template matching-based intra prediction
Technical Field
The present invention relates to a video encoding and decoding method and apparatus using template matching-based intra prediction.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
Since video data has a large amount of data compared to audio data or still image data, the video data requires a large amount of hardware resources (which includes a memory) to store or transmit uncompressed video data.
Accordingly, encoders are typically used to compress and store or transmit video data. The decoder receives compressed video data, decompresses the received compressed video data, and plays the decompressed video data. Video compression techniques include h.264/AVC, high Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC) which increases the Coding efficiency of HEVC by about 30% or more.
However, as the image size, resolution, and frame rate gradually increase, the amount of data to be encoded also increases. Accordingly, new compression techniques that provide higher codec efficiency and improved image enhancement effects than existing compression techniques are needed.
Intra prediction is a technique of generating a prediction signal by using spatially adjacent neighboring pixels within the same image when performing prediction on a current block. To improve the codec performance of intra-prediction techniques, existing video encoding/decoding methods and apparatuses use an increased number of intra-prediction modes or apply filtering to spatially adjacent neighboring pixels used in intra-prediction. The intra prediction technique has relatively low generation performance of a predicted signal compared to the inter prediction technique due to a limitation of using a limited pixel in the same image as the current block when generating the predicted signal.
In order to improve the prediction performance of intra prediction, a plurality of line buffers may be utilized in addition to spatially adjacent pixels. For example, a Multiple Reference Line (MRL) intra prediction technique performs intra prediction by selecting one of a plurality of pixel lines located at a specific distance. In addition, there is also a matrix-weighted intra prediction (MIP) technique that generates an intra-prediction signal by using a product operation between neighboring pixels and a predefined matrix. Therefore, in order to increase video coding efficiency and improve image quality, further improvement of the intra prediction method is required.
Disclosure of Invention
Technical problem
The present invention has been made in an effort to provide a video encoding and decoding method and apparatus for selecting an intra prediction factor to improve video encoding and decoding efficiency and enhance video quality. The video encoding and decoding method and the video encoding and decoding apparatus define previously reconstructed pixels spatially adjacent to the current block as templates, and perform a search based on template matching in a previously reconstructed region adjacent to the current block.
Technical proposal
At least one aspect of the present disclosure provides a method performed by a video decoding device for decoding a current block. The method includes decoding, from the bitstream, an index indicating a search region that is one of the one or more search regions. Here, the search area is a portion of a previously reconstructed area in the current image. The method further includes setting a search area based on the index and setting a template according to pixels spatially adjacent to the current block. The method further includes searching for a similar template having the highest similarity to the template by performing a search based on template matching in a search area. The method further includes determining a matching block with the current block based on the similarity template, and selecting the matching block as an intra predictor.
Another aspect of the present invention provides a method performed by a video encoding device for encoding a current block. The method includes determining an index indicating a search area that is one of the one or more search areas. Here, the search area is a portion of a previously reconstructed area in the current image. The method further includes setting a search area based on the index and setting a template according to pixels spatially adjacent to the current block. The method further includes searching for a similar template having the highest similarity to the template by performing a search based on template matching in a search area. The method further includes determining a matching block with the current block based on the similarity template, and selecting the matching block as an intra predictor.
Still another aspect of the present invention provides a computer-readable recording medium configured to store a bitstream generated by a video encoding method. The video encoding method includes determining an index indicating a search region that is one of one or more search regions. Here, the search area is a portion of a previously reconstructed area in the current image. The video encoding method further includes setting a search area based on the index and setting a template according to pixels spatially adjacent to the current block. The video encoding method further includes searching for a similar template having the highest similarity to the template by performing a search based on template matching in the search area. The video encoding method further includes determining a matching block with the current block based on the similarity template, and selecting the matching block as an intra predictor.
Advantageous effects
As described above, the present invention provides a video encoding and decoding method and a video encoding and decoding apparatus for selecting an intra prediction factor. The video encoding and decoding method and the video encoding and decoding apparatus define previously reconstructed pixels spatially adjacent to the current block as templates, and perform a search based on template matching in a previously reconstructed region adjacent to the current block. Accordingly, the video encoding and decoding method and the video encoding and decoding apparatus can improve video encoding and decoding efficiency and can enhance video quality.
Drawings
Fig. 1 is a block diagram of a video encoding device in which the techniques of the present invention may be implemented.
Fig. 2 illustrates a method for partitioning a block using a quadtree plus binary tree trigeminal tree (QTBTTT) structure.
Fig. 3a and 3b illustrate a plurality of intra prediction modes including a wide-angle intra prediction mode.
Fig. 4 shows neighboring blocks of the current block.
Fig. 5 is a block diagram of a video decoding apparatus in which the techniques of the present invention may be implemented.
Fig. 6 is a schematic diagram conceptually illustrating intra prediction based on template matching.
Fig. 7 is a schematic diagram illustrating a template-matched search region in accordance with at least one embodiment of the present invention.
Fig. 8 is a schematic diagram illustrating search region demarcation using template matching on a per Coding Tree Unit (CTU) basis in accordance with at least one embodiment of the present invention.
Fig. 9 is a schematic diagram illustrating search region demarcation employing template matching on a per Virtual Pipeline Data Unit (VPDU) basis in accordance with at least one embodiment of the present invention.
Fig. 10 is a schematic diagram illustrating search area demarcation applying template matching on a per VPDU basis according to another embodiment of the invention.
Fig. 11 is a schematic diagram illustrating search area demarcation applying template matching on a per VPDU basis according to still another embodiment of the invention.
Fig. 12 is a schematic diagram showing search area demarcation applying template matching on a per VPDU basis according to still another embodiment of the invention.
Fig. 13 is a flowchart of a video encoding method according to at least one embodiment of the present invention.
Fig. 14 is a flowchart of a video decoding method according to at least one embodiment of the present invention.
Detailed Description
Hereinafter, some embodiments of the present invention will be described in detail with reference to the accompanying illustrative drawings. In the following description, like reference numerals denote like elements, although the elements are shown in different drawings. Furthermore, in the following description of some embodiments, detailed descriptions of related known components and functions may be omitted for clarity and conciseness when it may be considered that the subject matter of the present invention is obscured.
Fig. 1 is a block diagram of a video encoding device in which the techniques of the present invention may be implemented. Hereinafter, a video encoding apparatus and components of the apparatus are described with reference to the diagram of fig. 1.
The encoding apparatus may include: an image divider 110, a predictor 120, a subtractor 130, a transformer 140, a quantizer 145, a reordering unit 150, an entropy encoder 155, an inverse quantizer 160, an inverse transformer 165, an adder 170, a loop filtering unit 180, and a memory 190.
Each component of the encoding apparatus may be implemented as hardware or software, or as a combination of hardware and software. In addition, the function of each component may be implemented as software, and the microprocessor may also be implemented to execute the function of the software corresponding to each component.
A video is made up of one or more sequences comprising a plurality of images. Each image is divided into a plurality of regions, and encoding is performed on each region. For example, an image is segmented into one or more tiles (tiles) or/and slices (slices). Here, one or more tiles may be defined as a tile set. Each tile or/and slice is partitioned into one or more Coding Tree Units (CTUs). In addition, each CTU is partitioned into one or more Coding Units (CUs) by a tree structure. Information applied to each Coding Unit (CU) is encoded as a syntax of the CU, and information commonly applied to the CUs included in one CTU is encoded as a syntax of the CTU. In addition, information commonly applied to all blocks in one slice is encoded as a syntax of a slice header, and information applied to all blocks constituting one or more images is encoded as an image parameter set (Picture PARAMETER SET, PPS) or an image header. In addition, information commonly referred to by a plurality of images is encoded as a Sequence parameter set (Sequence PARAMETER SET, SPS). In addition, information commonly referenced by one or more SPS is encoded as a Video parameter set (Video PARAMETER SET, VPS). Furthermore, information commonly applied to one tile or group of tiles may also be encoded as syntax of the tile or group of tiles header. The syntax included in the SPS, PPS, slice header, tile, or tile set header may be referred to as a high level syntax.
The image divider 110 determines the size of a Coding Tree Unit (CTU). Information about the size of the CTU (CTU size) is encoded as a syntax of the SPS or PPS and transmitted to the video decoding apparatus.
The image divider 110 divides each image constituting a video into a plurality of Coding Tree Units (CTUs) having a predetermined size, and then recursively divides the CTUs by using a tree structure. Leaf nodes in the tree structure become Coding Units (CUs), which are the basic units of coding.
The tree structure may be a quadtree (quadtree, QT) in which a higher node (or parent node) is partitioned into four lower nodes (or child nodes) of the same size. The tree structure may also be a binary tree (binarytree, BT) in which a higher node is split into two lower nodes. The tree structure may also be a trigeminal tree (ternarytree, TT) in which the higher node is split into three lower nodes at a ratio of 1:2:1. The tree structure may also be a structure in which two or more of a QT structure, a BT structure, and a TT structure are mixed. For example, a quad-plus-binary tree (quadtree plus binarytree, QTBT) structure may be used, or a quad-plus-binary tree (quadtree plus binarytree ternarytree, QTBTTT) structure may be used. Here, a Binary Tree Trigeminal Tree (BTTT) is added to the tree structure to be called a multiple-type tree (MTT).
Fig. 2 is a schematic diagram for describing a method of dividing a block by using QTBTTT structures.
As shown in fig. 2, the CTU may be first partitioned into QT structures. Quadtree partitioning may be recursive until the size of the partitioned block reaches the minimum block size of leaf nodes allowed in QT (MinQTSize). A first flag (qt_split_flag) indicating whether each node of the QT structure is partitioned into four lower-layer nodes is encoded by the entropy encoder 155 and signaled to the video decoding apparatus. When the leaf node of QT is not greater than the maximum block size (MaxBTSize) of the root node allowed in BT, the leaf node may be further partitioned into at least one of BT structure or TT structure. There may be multiple directions of segmentation in the BT structure and/or the TT structure. For example, there may be two directions, i.e., a direction of dividing the block of the corresponding node horizontally and a direction of dividing the block of the corresponding node vertically. As shown in fig. 2, when the MTT division starts, a second flag (MTT _split_flag) indicating whether a node is divided, and a flag additionally indicating a division direction (vertical or horizontal) and/or a flag indicating a division type (binary or trigeminal) in case that a node is divided are encoded by the entropy encoder 155 and signaled to the video decoding apparatus.
Alternatively, a CU partition flag (split_cu_flag) indicating whether a node is partitioned may be further encoded before encoding a first flag (qt_split_flag) indicating whether each node is partitioned into four nodes of a lower layer. When the value of the CU partition flag (split_cu_flag) indicates that each node is not partitioned, the block of the corresponding node becomes a leaf node in the partition tree structure and becomes a CU, which is a basic unit of encoding. When the value of the CU partition flag (split_cu_flag) indicates that each node is partitioned, the video encoding apparatus first starts encoding the first flag in the above scheme.
When QTBT is used as another example of the tree structure, there may be two types, i.e., a type of horizontally dividing a block of a corresponding node into two blocks having the same size (i.e., symmetrical horizontal division) and a type of vertically dividing a block of a corresponding node into two blocks having the same size (i.e., symmetrical vertical division). A partition flag (split_flag) indicating whether each node of the BT structure is partitioned into lower-layer blocks and partition type information indicating a partition type are encoded by the entropy encoder 155 and transmitted to the video decoding apparatus. On the other hand, there may additionally be a type in which a block of a corresponding node is divided into two blocks asymmetric to each other. The asymmetric form may include a form in which a block of a corresponding node is divided into two rectangular blocks having a size ratio of 1:3, or may also include a form in which a block of a corresponding node is divided in a diagonal direction.
The CUs may have various sizes according to QTBT or QTBTTT divided from the CTU. Hereinafter, a block corresponding to a CU to be encoded or decoded (i.e., a leaf node of QTBTTT) is referred to as a "current block". When QTBTTT partitions are used, the shape of the current block may be rectangular in shape in addition to square in shape.
The predictor 120 predicts the current block to generate a predicted block. Predictor 120 includes an intra predictor 122 and an inter predictor 124.
In general, each of the current blocks in the image may be predictively encoded. In general, prediction of a current block may be performed by using an intra prediction technique using data from an image including the current block or an inter prediction technique using data from an image encoded before the image including the current block. Inter prediction includes both unidirectional prediction and bi-directional prediction.
The intra predictor 122 predicts pixels in the current block by using pixels (reference pixels) located adjacent to the current block in the current image including the current block. Depending on the prediction direction, there are multiple intra prediction modes. For example, as shown in fig. 3a, the plurality of intra prediction modes may include two non-directional modes including a Planar (Planar) mode and a DC mode, and may include 65 directional modes. The neighboring pixels and algorithm equations to be used are defined differently according to each prediction mode.
For efficient direction prediction of a current block having a rectangular shape, direction modes (# 67 to # 80) indicated by dotted arrows in fig. 3b, intra prediction modes # -1 to # -14) may be additionally used. The direction mode may be referred to as a "wide-angle intra prediction mode (WIDE ANGLE INTRA-prediction modes)". In fig. 3b, the arrows indicate the respective reference samples for prediction, rather than representing the prediction direction. The prediction direction is opposite to the direction indicated by the arrow. When the current block has a rectangular shape, the wide-angle intra prediction mode is a mode in which prediction is performed in a direction opposite to a specific direction mode without additional bit transmission. In this case, in the wide-angle intra prediction mode, some of the wide-angle intra prediction modes available for the current block may be determined by a ratio of a width to a height of the current block having a rectangular shape. For example, when the current block has a rectangular shape having a height smaller than a width, wide-angle intra prediction modes (intra prediction modes #67 to # 80) having angles smaller than 45 degrees are available. When the current block has a rectangular shape with a width greater than a height, a wide-angle intra prediction mode having an angle greater than-135 degrees is available.
The intra predictor 122 may determine intra prediction to be used for encoding the current block. In some examples, intra predictor 122 may encode the current block by utilizing a plurality of intra prediction modes, and may also select an appropriate intra prediction mode to use from among the test modes. For example, the intra predictor 122 may calculate a rate distortion value by using rate-distortion (rate-distortion) analysis of a plurality of tested intra prediction modes, and may also select an intra prediction mode having the best rate distortion characteristics among the test modes.
The intra predictor 122 selects one intra prediction mode among a plurality of intra prediction modes, and predicts the current block by using neighboring pixels (reference pixels) determined according to the selected intra prediction mode and an algorithm equation. Information about the selected intra prediction mode is encoded by the entropy encoder 155 and transmitted to a video decoding device.
The inter predictor 124 generates a prediction block of the current block by using a motion compensation process. The inter predictor 124 searches for a block most similar to the current block in a reference picture that has been encoded and decoded earlier than the current picture, and generates a predicted block of the current block by using the searched block. In addition, a Motion Vector (MV) is generated, which corresponds to a displacement (displacement) between a current block in the current image and a prediction block in the reference image. In general, motion estimation is performed on a luminance (luma) component, and a motion vector calculated based on the luminance component is used for both the luminance component and the chrominance component. Motion information including information of the reference picture and information on a motion vector for predicting the current block is encoded by the entropy encoder 155 and transmitted to a video decoding device.
The inter predictor 124 may also perform interpolation of reference pictures or reference blocks to increase the accuracy of prediction. In other words, the sub-samples are interpolated between two consecutive integer samples by applying the filter coefficients to a plurality of consecutive integer samples comprising the two integer samples. When the process of searching for a block most similar to the current block is performed on the interpolated reference image, the decimal-unit precision may be represented for the motion vector instead of the integer-sample-unit precision. The precision or resolution of the motion vector may be set differently for each target region to be encoded, e.g., a unit such as a slice, tile, CTU, CU, etc. When such an adaptive motion vector resolution (adaptive motion vector resolution, AMVR) is applied, information on the motion vector resolution to be applied to each target area should be signaled for each target area. For example, when the target area is a CU, information about the resolution of a motion vector applied to each CU is signaled. The information on the resolution of the motion vector may be information representing the accuracy of a motion vector difference to be described below.
On the other hand, the inter predictor 124 may perform inter prediction by using bi-directional prediction. In the case of bi-prediction, two reference pictures and two motion vectors representing block positions most similar to the current block in each reference picture are used. The inter predictor 124 selects a first reference picture and a second reference picture from the reference picture list0 (RefPicList 0) and the reference picture list1 (RefPicList 1), respectively. The inter predictor 124 also searches for a block most similar to the current block in the corresponding reference picture to generate a first reference block and a second reference block. Further, a prediction block of the current block is generated by averaging or weighted-averaging the first reference block and the second reference block. Further, motion information including information on two reference pictures for predicting the current block and including information on two motion vectors is transmitted to the entropy encoder 155. Here, the reference image list0 may be constituted by an image preceding the current image in display order among the pre-reconstructed images, and the reference image list1 may be constituted by an image following the current image in display order among the pre-reconstructed images. However, although not particularly limited thereto, a pre-reconstructed image following the current image in the display order may be additionally included in the reference image list 0. Conversely, a pre-reconstructed image preceding the current image may be additionally included in the reference image list 1.
In order to minimize the amount of bits consumed for encoding motion information, various methods may be used.
For example, when a reference image and a motion vector of a current block are identical to those of a neighboring block, information capable of identifying the neighboring block is encoded to transmit motion information of the current block to a video decoding apparatus. This method is called merge mode (merge mode).
In the merge mode, the inter predictor 124 selects a predetermined number of merge candidate blocks (hereinafter, referred to as "merge candidates") from neighboring blocks of the current block.
As the neighboring blocks used to derive the merge candidates, all or some of the left block A0, the lower left block A1, the upper block B0, the upper right block B1, and the upper left block B2 adjacent to the current block in the current image may be used, as shown in fig. 4. In addition, in addition to the current picture in which the current block is located, a block located within a reference picture (which may be the same as or different from the reference picture used to predict the current block) may also be used as a merging candidate. For example, a co-located block (co-located block) of a current block within a reference picture or a block adjacent to the co-located block may additionally be used as a merging candidate. If the number of merging candidates selected by the above method is less than a preset number, a zero vector is added to the merging candidates.
The inter predictor 124 configures a merge list including a predetermined number of merge candidates by using neighboring blocks. A merge candidate to be used as motion information of the current block is selected from among the merge candidates included in the merge list, and merge index information for identifying the selected candidate is generated. The generated merging index information is encoded by the entropy encoder 155 and transmitted to a video decoding apparatus.
The merge skip mode is a special case of the merge mode. After quantization, when all transform coefficients used for entropy coding are near zero, only neighboring block selection information is transmitted without transmitting a residual signal. By using the merge skip mode, relatively high encoding efficiency can be achieved for images with slight motion, still images, screen content images, and the like.
Hereinafter, the merge mode and the merge skip mode are collectively referred to as a merge/skip mode.
Another method for encoding motion information is advanced motion vector prediction (advanced motion vector prediction, AMVP) mode.
In the AMVP mode, the inter predictor 124 derives a motion vector prediction candidate for a motion vector of a current block by using neighboring blocks of the current block. As the neighboring blocks used to derive the motion vector prediction candidates, all or some of the left block A0, the lower left block A1, the upper side block B0, the upper right block B1, and the upper left block B2 adjacent to the current block in the current image shown in fig. 4 may be used. In addition, in addition to the current picture in which the current block is located, a block located within a reference picture (which may be the same as or different from a reference picture used to predict the current block) may also be used as a neighboring block used to derive a motion vector prediction candidate. For example, a co-located block of the current block within the reference picture or a block adjacent to the co-located block may be used. If the number of motion vector candidates selected by the above method is less than a preset number, a zero vector is added to the motion vector candidates.
The inter predictor 124 derives a motion vector prediction candidate by using the motion vector of the neighboring block, and determines a motion vector prediction of the motion vector of the current block by using the motion vector prediction candidate. In addition, a motion vector difference is calculated by subtracting a motion vector prediction from a motion vector of the current block.
Motion vector prediction may be obtained by applying a predefined function (e.g., median, average calculation, etc.) to the motion vector prediction candidates. In this case, the video decoding device is also aware of the predefined function. Further, since the neighboring block used to derive the motion vector prediction candidates is a block for which encoding and decoding have been completed, the video decoding apparatus may also already know the motion vector of the neighboring block. Therefore, the video encoding device does not need to encode information for identifying motion vector prediction candidates. Accordingly, in this case, information on a motion vector difference and information on a reference image for predicting a current block are encoded.
On the other hand, motion vector prediction may also be determined by selecting a scheme of any one of the motion vector prediction candidates. In this case, the information for identifying the selected motion vector prediction candidates is additionally encoded together with the information about the motion vector difference and the information about the reference picture for predicting the current block.
The subtractor 130 generates a residual block by subtracting the current block from the prediction block generated by the intra predictor 122 or the inter predictor 124.
The transformer 140 transforms a residual signal in a residual block having pixel values of a spatial domain into transform coefficients of a frequency domain. The transformer 140 may transform a residual signal in a residual block by using the entire size of the residual block as a transform unit, or may divide the residual block into a plurality of sub-blocks, and may perform the transform by using the sub-blocks as transform units. Alternatively, the residual block is divided into two sub-blocks, i.e., a transform region and a non-transform region, to transform the residual signal by using only the transform region sub-block as a transform unit. Here, the transform region sub-block may be one of two rectangular blocks having a size ratio of 1:1 based on a horizontal axis (or a vertical axis). In this case, a flag (cu_sbt_flag) indicating that only the sub-block is transformed, and direction (vertical/horizontal) information (cu_sbt_horizontal_flag) and/or position information (cu_sbt_pos_flag) are encoded by the entropy encoder 155 and signaled to the video decoding apparatus. In addition, the size of the transform region sub-block may have a size ratio of 1:3 based on the horizontal axis (or vertical axis). In this case, a flag (cu_sbt_quad_flag) dividing the corresponding division is additionally encoded by the entropy encoder 155 and signaled to the video decoding device.
On the other hand, the transformer 140 may perform transformation of the residual block separately in the horizontal direction and the vertical direction. For this transformation, various types of transformation functions or transformation matrices may be used. For example, the pair-wise transformation function for horizontal and vertical transformations may be defined as a transformation set (multiple transform set, MTS). The transformer 140 may select one transform function pair having the highest transform efficiency among the MTSs, and may transform the residual block in each of the horizontal and vertical directions. Information (mts_idx) about the transform function pairs in the MTS is encoded by the entropy encoder 155 and signaled to the video decoding means.
The quantizer 145 quantizes the transform coefficient output from the transformer 140 using a quantization parameter, and outputs the quantized transform coefficient to the entropy encoder 155. The quantizer 145 may also immediately quantize the relevant residual block without transforming any block or frame. The quantizer 145 may also apply different quantization coefficients (scaling values) according to the positions of the transform coefficients in the transform block. A quantization matrix applied to quantized transform coefficients arranged in two dimensions may be encoded and signaled to a video decoding apparatus.
The reordering unit 150 may perform the rearrangement of the coefficient values on the quantized residual values.
The rearrangement unit 150 may change the 2D coefficient array to a 1D coefficient sequence by using coefficient scanning. For example, the rearrangement unit 150 may scan the DC coefficients to the coefficients of the high frequency region using zigzag scanning (zig-zag scan) or diagonal scanning (diagonal scan) to output a 1D coefficient sequence. Instead of the zig-zag scan, a vertical scan that scans the 2D coefficient array in the column direction and a horizontal scan that scans the 2D block type coefficients in the row direction may also be utilized, depending on the size of the transform unit and the intra prediction mode. In other words, the scanning method to be used may be determined in zigzag scanning, diagonal scanning, vertical scanning, and horizontal scanning according to the size of the transform unit and the intra prediction mode.
The entropy encoder 155 encodes the sequence of the 1D quantized transform coefficients output from the rearrangement unit 150 by using various encoding schemes including Context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmetic Code, CABAC), exponential golomb (Exponential Golomb), and the like to generate a bitstream.
Further, the entropy encoder 155 encodes information related to block division (e.g., CTU size, CTU division flag, QT division flag, MTT division type, MTT division direction, etc.) so that the video decoding apparatus can divide blocks equally to the video encoding apparatus. Further, the entropy encoder 155 encodes information on a prediction type indicating whether the current block is encoded by intra prediction or inter prediction. The entropy encoder 155 encodes intra prediction information (i.e., information about an intra prediction mode) or inter prediction information (a merge index in the case of a merge mode, and information about a reference picture index and a motion vector difference in the case of an AMVP mode) according to a prediction type. Further, the entropy encoder 155 encodes information related to quantization (i.e., information about quantization parameters and information about quantization matrices).
The inverse quantizer 160 inversely quantizes the quantized transform coefficient output from the quantizer 145 to generate a transform coefficient. The inverse transformer 165 transforms the transform coefficients output from the inverse quantizer 160 from the frequency domain to the spatial domain to reconstruct the residual block.
The adder 170 adds the reconstructed residual block and the prediction block generated by the predictor 120 to reconstruct the current block. Upon intra prediction of the next block, pixels in the reconstructed current block are used as reference pixels.
The loop filtering unit 180 performs filtering on the reconstructed pixels to reduce block artifacts (blocking artifacts), ringing artifacts (RINGING ARTIFACTS), blurring artifacts (blurring artifacts), and the like, which occur due to block-based prediction and transform/quantization. The loop filtering unit 180 as an in-loop filter may include all or some of a deblocking filter 182, a Sample Adaptive Offset (SAO) filter 184, and an adaptive loop filter (adaptive loop filter, ALF) 186.
Deblocking filter 182 filters boundaries between reconstructed blocks to remove block artifacts (blocking artifacts) that occur due to block unit encoding/decoding, and SAO filter 184 and ALF 186 additionally filter the deblock filtered video. The SAO filter 184 and ALF 186 are filters for compensating for differences between reconstructed pixels and original pixels that occur due to lossy encoding (lossy coding). The SAO filter 184 applies an offset in units of CTUs to enhance subjective image quality and coding efficiency. On the other hand, the ALF 186 performs block unit filtering, and applies different filters to compensate for distortion by dividing boundaries of respective blocks and the degree of variation. Information about filter coefficients to be used for ALF may be encoded and signaled to the video decoding apparatus.
The reconstructed blocks filtered by the deblocking filter 182, the SAO filter 184, and the ALF 186 are stored in a memory 190. When all blocks in one image are reconstructed, the reconstructed image may be used as a reference image for inter prediction of blocks within a subsequently to be encoded image.
Fig. 5 is a functional block diagram of a video decoding apparatus in which the techniques of the present invention may be implemented. Hereinafter, with reference to fig. 5, a video decoding apparatus and components of the apparatus are described.
The video decoding apparatus may include an entropy decoder 510, a reordering unit 515, an inverse quantizer 520, an inverse transformer 530, a predictor 540, an adder 550, a loop filtering unit 560, and a memory 570.
Similar to the video encoding apparatus of fig. 1, each component of the video decoding apparatus may be implemented as hardware or software, or as a combination of hardware and software. In addition, the function of each component may be implemented as software, and the microprocessor may also be implemented to execute the function of the software corresponding to each component.
The entropy decoder 510 extracts information related to block segmentation by decoding a bitstream generated by a video encoding apparatus to determine a current block to be decoded, and extracts prediction information required to reconstruct the current block and information about a residual signal.
The entropy decoder 510 determines the size of CTUs by extracting information about the CTU size from a Sequence Parameter Set (SPS) or a Picture Parameter Set (PPS), and partitions a picture into CTUs having the determined size. Further, the CTU is determined as the highest layer (i.e., root node) of the tree structure, and the partition information of the CTU is extracted to partition the CTU by using the tree structure.
For example, when dividing the CTU by using the QTBTTT structure, first a first flag (qt_split_flag) related to the division of QT is extracted to divide each node into four nodes of the lower layer. In addition, a second flag (MTT _split_flag), a split direction (vertical/horizontal), and/or a split type (binary/trigeminal) related to the split of the MTT are extracted with respect to a node corresponding to a leaf node of the QT to split the corresponding leaf node into an MTT structure. As a result, each node below the leaf node of QT is recursively partitioned into BT or TT structures.
As another example, when the CTU is divided by using the QTBTTT structure, a CU division flag (split_cu_flag) indicating whether to divide the CU is extracted. When the corresponding block is partitioned, a first flag (qt_split_flag) may also be extracted. During the segmentation process, recursive MTT segmentation of 0 or more times may occur after recursive QT segmentation of 0 or more times for each node. For example, for CTUs, MTT partitioning may occur immediately, or conversely, QT partitioning may occur only multiple times.
As another example, when the CTU is divided by using the QTBT structure, a first flag (qt_split_flag) related to the division of QT is extracted to divide each node into four nodes of a lower layer. In addition, a split flag (split_flag) indicating whether or not a node corresponding to a leaf node of QT is further split into BT and split direction information are extracted.
On the other hand, when the entropy decoder 510 determines the current block to be decoded by using the partition of the tree structure, the entropy decoder 510 extracts information on a prediction type indicating whether the current block is intra-predicted or inter-predicted. When the prediction type information indicates intra prediction, the entropy decoder 510 extracts syntax elements for intra prediction information (intra prediction mode) of the current block. When the prediction type information indicates inter prediction, the entropy decoder 510 extracts information representing syntax elements of the inter prediction information, i.e., a motion vector and a reference picture to which the motion vector refers.
Further, the entropy decoder 510 extracts quantization-related information and extracts information on quantized transform coefficients of the current block as information on a residual signal.
The reordering unit 515 may change the sequence of the 1D quantized transform coefficients entropy-decoded by the entropy decoder 510 into a 2D coefficient array (i.e., block) again in the reverse order of the coefficient scan order performed by the video encoding device.
The inverse quantizer 520 inversely quantizes the quantized transform coefficient and inversely quantizes the quantized transform coefficient by using a quantization parameter. The inverse quantizer 520 may also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in 2D. The inverse quantizer 520 may perform inverse quantization by applying a matrix of quantized coefficients (scaled values) from the video encoding device to a 2D array of quantized transform coefficients.
The inverse transformer 530 reconstructs a residual signal by inversely transforming the inversely quantized transform coefficients from the frequency domain to the spatial domain to generate a residual block of the current block.
Further, when the inverse transformer 530 inversely transforms a partial region (sub-block) of the transform block, the inverse transformer 530 extracts a flag (cu_sbt_flag) transforming only the sub-block of the transform block, direction (vertical/horizontal) information (cu_sbt_horizontal_flag) of the sub-block, and/or position information (cu_sbt_pos_flag) of the sub-block. The inverse transformer 530 also inversely transforms transform coefficients of the corresponding sub-block from the frequency domain to the spatial domain to reconstruct a residual signal, and fills the region that is not inversely transformed with a value of "0" as the residual signal to generate a final residual block of the current block.
Further, when applying MTS, the inverse transformer 530 determines a transform index or a transform matrix to be applied in each of the horizontal direction and the vertical direction by using MTS information (mts_idx) signaled from the video encoding apparatus. The inverse transformer 530 also performs inverse transformation on the transform coefficients in the transform block in the horizontal direction and the vertical direction by using the determined transform function.
The predictor 540 may include an intra predictor 542 and an inter predictor 544. The intra predictor 542 is activated when the prediction type of the current block is intra prediction, and the inter predictor 544 is activated when the prediction type of the current block is inter prediction.
The intra predictor 542 determines an intra prediction mode of the current block among the plurality of intra prediction modes according to syntax elements of the intra prediction mode extracted from the entropy decoder 510. The intra predictor 542 also predicts the current block by using neighboring reference pixels of the current block according to an intra prediction mode.
The inter predictor 544 determines a motion vector of the current block and a reference picture to which the motion vector refers by using syntax elements of the inter prediction mode extracted from the entropy decoder 510.
The adder 550 reconstructs the current block by adding the residual block output from the inverse transformer 530 to the prediction block output from the inter predictor 544 or the intra predictor 542. In intra prediction of a block to be decoded later, pixels within the reconstructed current block are used as reference pixels.
The loop filtering unit 560, which is an in-loop filter, may include a deblocking filter 562, an SAO filter 564, and an ALF 566. Deblocking filter 562 performs deblocking filtering on boundaries between reconstructed blocks to remove block artifacts that occur due to block unit decoding. The SAO filter 564 and ALF 566 perform additional filtering on the reconstructed block after deblocking filtering to compensate for differences between reconstructed pixels and original pixels that occur due to lossy encoding. The filter coefficients of the ALF are determined by using information on the filter coefficients decoded from the bitstream.
The reconstructed block filtered by the deblocking filter 562, the SAO filter 564, and the ALF 566 is stored in a memory 570. When all blocks in one image are reconstructed, the reconstructed image may be used as a reference image for inter prediction of blocks within a subsequently to be encoded image.
In some embodiments the invention relates to encoding and decoding video imagery as described above. More particularly, the present invention provides a video encoding and decoding method and a video encoding and decoding apparatus that select an intra prediction factor by defining previously reconstructed pixels spatially adjacent to a current block as templates and performing a search based on template matching in a previously reconstructed region adjacent to the current block.
The following implementation may be performed by the intra predictor 122 in the video encoding apparatus and by the intra predictor 542 in the video decoding apparatus.
When performing intra prediction of the current block, the video encoding apparatus may generate signaling information related to the present embodiment in terms of optimizing rate distortion. The video encoding apparatus may encode the signaling information by using the entropy encoder 155, and may transmit the encoded signaling information to the video decoding apparatus. The video decoding apparatus may decode the signaling information from the bitstream by using the entropy decoder 510.
Further, a true value of the flag indicates a case where the flag is set to 1. In addition, a false value of the flag indicates a case where the flag is set to 0.
I. Template matching-based intra prediction
Fig. 6 is a schematic diagram conceptually illustrating intra prediction based on template matching.
As shown in fig. 6, the video encoding apparatus or the video decoding apparatus may use a template matching-based intra prediction technique with respect to a block to be currently encoded/decoded (i.e., a "current block") for obtaining a best intra predictor from a previously reconstructed region (i.e., a "codec region") within a current image. At this time, a set of pixels spatially adjacent to the current block is defined as a template. The video encoding apparatus or the video decoding apparatus performs a search based on template matching in the previously reconstructed region to search for a similar template having the highest similarity with the template of the current block. The video encoding device or the video decoding device determines the positions of the matching block and the current block based on the similar template, and then selects the matching block as the best intra predictor of the current block.
On the other hand, the existing intra block copy (IPC) technique uses a method of searching for a block position most similar to a current block within a current image and then signaling the similar block position as a block vector. In addition, when transmitting block vector information, the video encoding apparatus selects a block vector predictor among blocks adjacent to the current block and then signals an index of the selected block vector predictor and a block vector difference between the block vector and the block vector predictor.
A conventionally used method of effectively improving the aforementioned signaling method of block vector information involves demarcating a template matching-based search area for a current block into a predefined area within a previously reconstructed area. The example method as shown in fig. 6 classifies a portion of a previously reconstructed region into at least one or more rectangular search regions (R1, R2, R3, and R4), and uses one of the classified search regions as a region subjected to a template-matching-based search. In addition, by demarcating the region including the best block position matching the current block as follows, signaling overhead between the video encoding device and the video decoding device can be reduced.
Among the delimited regions, the R1 search region represents a previously reconstructed region located within a current Coding Tree Unit (CTU). If the best intra predictor search position of the current block is in the R1 region, the video encoding apparatus may signal an index of a search region mapped to the R1 region. The video decoding apparatus may select a template of the current block following the same method as the video encoding apparatus, and then based on the index of the transmitted search region, may search for the position of the best intra predictor based on template matching by using the same template in the R1 region.
The R2 region represents a previously reconstructed region located at the upper left side with respect to the current CTU. If the best intra predictor search position of the current block is in the R2 region, the video encoding apparatus may signal an index mapped to the R2 region. The video decoding apparatus may select a template of the current block and then, based on the transmitted index, may search for a position of a best intra predictor based on template matching by using the same template in the R2 region.
The R3 region represents a previously reconstructed region located at an upper side with respect to the current CTU. If the best intra predictor search position of the current block is in the R3 region, the video encoding apparatus may signal an index mapped to the R3 region. The video decoding apparatus may select a template of the current block and then, based on the transmitted index, may search for a position of a best intra predictor based on template matching by using the same template in the R3 region.
The R4 region represents the previously reconstructed region located to the left of the current CTU. If the best intra predictor search position of the current block is in the R4 region, the video encoding apparatus may signal an index mapped to the R4 region. The video decoding apparatus may select a template of the current block and then, based on the transmitted index, may search for a position of a best intra predictor based on template matching by using the same template in the R4 region.
On the other hand, information about the search area may be predefined based on the index of the search area according to a protocol between the video encoding apparatus and the video decoding apparatus. Alternatively, the video encoding apparatus may encode the information about the search area, and then may signal the information about the search area to the video decoding apparatus. Here, the information about the search area may include information indicating the size and position of the search area.
The video encoding apparatus or the video decoding apparatus may calculate the similarity between the template of the current block and the candidate templates within the previously reconstructed region using the sum of absolute differences (Sum of Absolute Difference, SAD), the sum of squared differences (Sum of Squared Difference, SSD), and the like as a cost function of the template matching. At this time, the block corresponding to the template having the smallest cost function value may be selected as a predictor of the current block.
Further, in calculating the cost function value, when the template of the current block is greater than a predefined width or a predefined height, the video encoding apparatus or the video decoding apparatus may calculate the cost function value by using pixels obtained by sub-sampling the template.
The following describes a method for demarcating an intra predictor search area as suitable for hardware implementation and pipeline processing, not only using one of the areas shown in fig. 6 as a search area of a current block.
Template matching based intra prediction according to the invention
Fig. 7 is a schematic diagram illustrating a template-matched search region in accordance with at least one embodiment of the present invention.
As shown in fig. 7, the video encoding apparatus and the video decoding apparatus may obtain the best intra prediction factor in the search region within the predefined region of the current block using an intra prediction technique based on template matching.
Unlike those predefined rectangular search areas shown in fig. 6, the video encoding apparatus and the video decoding apparatus according to the present embodiment use arbitrarily shaped search areas (R1, R2, R3, and R4) as shown in fig. 7 for intra prediction based on template matching. As described above, these search areas are part of the previously reconstructed area of the current block. The R1 region represents a region located within a current Coding Tree Unit (CTU). In addition, the R2 region and the R3 region represent L-shaped regions having a predefined width and a predefined height at the top and left sides of the current CTU. At this time, the L-shaped region is diagonally divided into two regions, with the left region indicated as the R2 region and the upper region indicated as the R3 region. In addition, the R4 region represents an L-shaped region having a predefined width and a predefined height on the upper and left sides of the current CTU, and being located outside the R2 region and the R3 region.
The search area shown in fig. 7 can also be used to effectively improve the signaling method of the block vector as described by using the search area shown in fig. 6. For example, the present invention may set four divided regions as a search region based on template matching, and then may demarcate a region containing the best predictor of the current block in the search region. Thereafter, the present invention can effectively reduce signaling overhead between the video encoding apparatus and the video decoding apparatus by signaling the index of the delimited search region.
As described above, the information about the search area may be defined in advance based on the index of the search area according to the protocol between the video encoding apparatus and the video decoding apparatus. Alternatively, the video encoding apparatus may encode the information about the search area, and then may signal the information about the search area to the video decoding apparatus.
As described above, in applying the template matching-based intra prediction technique, a predefined previously reconstructed region may be used to search for a best template matching-based intra predictor. However, when utilizing any previously reconstructed region, the process of designing the various hardware supporting this embodiment may encounter limitations in its optimal design. In addition, when applying the video encoding and decoding method and apparatus that performs pipeline parallel processing in CTU units, problems of application hardware resources may be encountered using any previously reconstructed region.
Fig. 8 is a schematic diagram illustrating search area demarcation applying template matching on a per CTU basis in accordance with at least one embodiment of the present invention.
As shown in fig. 8, the video encoding apparatus and the video decoding apparatus may obtain the best intra prediction factor in a predefined search area for the current block using an intra prediction technique based on template matching.
In the example of fig. 8, the search region includes an R1 region within the current CTU and includes CTUs spatially adjacent to the current CTU. The neighboring CTUs may include an upper left R2 CTU, an upper R3CTU, and a left R4 CTU to be used. As described above, these search areas are part of the previously reconstructed area of the current block. In addition, the demarcation of these search areas may be more applicable to optimization of hardware resources, CTU-based pipeline processing, etc. in the above-described hardware design process.
As described above, in applying the template matching-based intra prediction technique, a predefined previously reconstructed region may be used to search for a best template matching-based intra predictor. However, when any previously reconstructed region is used, difficulties in ensuring maximum hardware resources may arise in designing hardware that supports this embodiment. In addition, difficulties may also arise in the design of pipeline structures when applying video encoding and decoding methods and apparatus that perform pipeline parallel processing on a unit-by-unit basis.
Fig. 9 is a schematic diagram illustrating search area demarcation using template matching on a per Virtual Pipeline Data Unit (VPDU) basis in accordance with at least one embodiment of the present invention.
As shown in fig. 9, the video encoding apparatus and the video decoding apparatus may obtain the best intra prediction factor in a predefined search area for the current block using an intra prediction technique based on template matching.
In the example of fig. 9, the search area includes an area in units of Virtual Pipeline Data Units (VPDUs). Here, a VPDU is a data unit that can be processed by a virtual pipeline. The VPDU is the largest unit that can perform encoding and decoding each time, and can be used to reduce the cost burden of hardware implementation due to the increase in CTU size.
Further, a VPDU refers to a data processing unit for encoding and decoding, but is not necessarily limited to the lexical meaning of VPDUs. As the size of the VPDU, a predefined size may be used, and the size of the CTU divided by N (where N is a natural number) may be used. Further, the predefined size may be one of 64×64, 32×32, and 16×16. In the example of fig. 9, the VPDU has a size of one-fourth of the CTU.
In the example of fig. 9, the search area may be delimited to include: the R1 region containing the previous reconstruction in the current VPDU of the current block, the left R2 VPDU or the immediately previous VPDU of the current VPDU, the upper R3VPDU or the second previous VPDU compared to the current VPDU in the Z-order inside the CTU, and the upper left R4 VPDU or the third previous VPDU compared to the current VPDU in the Z-order inside the CTU. Here, the Z-order is a zigzag scanning order, and represents an encoding/decoding order. As described above, these search areas are part of the previously reconstructed area of the current block. In addition, the demarcation of these search areas may be more applicable to optimization of hardware resources, pipeline processing of VPDU units, etc. in the above-described hardware design process.
Fig. 10 is a schematic diagram illustrating search area demarcation applying template matching on a per VPDU basis according to another embodiment of the invention.
The example of fig. 10 is another example of solving the above-described problem that may occur when designing hardware. As with the example of fig. 9, the present embodiment sets a search region subjected to the template-matching-based intra-prediction technique on a per VPDU basis, wherein the search region is demarcated into at least one or more predefined regions of the VPDU.
In the example of fig. 9, all referenced VPDUs are present in the same CTU region as the current VPDU. On the other hand, in the example of fig. 10, the current VPDU is the first VPDU in Z-order within the current CTU. That is, many referenced VPDUs are included in the previous CTU region.
In the example of fig. 10, the search area may be delimited to include: containing a previously reconstructed R1 region in the current VPDU of the current block, a right lower R2 VPDU in the left CTU or an immediately previous VPDU of the current VPDU, a left lower R3 VPDU in the left CTU or a second previous VPDU in Z order compared to the current VPDU, and a right upper R4 VPDU in the left CTU or a third previous VPDU in Z order compared to the current VPDU. As described above, these search areas are part of the previously reconstructed area of the current block.
Fig. 11 is a schematic diagram illustrating search area demarcation applying template matching on a per VPDU basis according to still another embodiment of the invention.
In the example of fig. 9, all referenced VPDUs are present in the same CTU region as the current VPDU. On the other hand, in the example of fig. 11, the current VPDU is the second VPDU in Z-order within the current CTU. That is, many referenced VPDUs are included in the previous CTU region.
In the example of fig. 11, the search area may be delimited to include: containing the previously reconstructed R1 region in the current VPDU of the current block, the upper left R2 VPDU in the current CTU or the immediately previous VPDU of the current VPDU, the lower right R3 VPDU in the left CTU or the second previous VPDU in Z order compared to the current VPDU, and the lower left R4 VPDU in the left CTU or the third previous VPDU in Z order compared to the current VPDU. As described above, these search areas are part of the previously reconstructed area of the current block.
Fig. 12 is a schematic diagram showing search area demarcation applying template matching on a per VPDU basis according to still another embodiment of the invention.
In the example of fig. 9, all referenced VPDUs are present in the same CTU region as the current VPDU. On the other hand, in the example of fig. 12, the current VPDU is the third VPDU in Z-order within the current CTU. That is, some referenced VPDUs are included in the previous CTU region.
In the example of fig. 12, the search area may be delimited to include: containing the previously reconstructed R1 region in the current VPDU of the current block, the upper right R2 VPDU in the current CTU or the immediately previous VPDU of the current VPDU, the second previous VPDU compared to the current VPDU in the upper left R3 VPDU or Z-order in the current CTU, and the third previous VPDU compared to the current VPDU in the lower right R4 VPDU or Z-order in the left CTU. As described above, these search areas are part of the previously reconstructed area of the current block.
On the other hand, when the applicable region is demarcated into a region of the VPDU unit using an intra prediction technique based on template matching, the applicable region may be demarcated to include at least one or more VPDUs including the current VPDU of the current block. In the examples of fig. 9-12, as one set of embodiments, a total of four VPDUs including the current VPDU containing the current block are used as search regions in the pipeline processing order. However, when a search area on a per VPDU basis under template matching-based intra prediction techniques is applied, the search area is not necessarily limited to four VPDUs, and the use of at least one or more VPDUs may also be covered by the scope of the present invention.
A video encoding method and a video decoding method using template matching-based intra prediction are described below with reference to fig. 13 and 14.
Fig. 13 is a flowchart of a video encoding method according to at least one embodiment of the present invention.
The video encoding apparatus determines an index indicating a search area that is one of the one or more search areas (S1300). Here, the search area is a portion of a previously reconstructed area in the current image.
The video encoding apparatus determines information about the search area from the index (S1302). The information about the search area may be predefined based on the index of the search area according to a protocol between the video encoding apparatus and the video decoding apparatus. Alternatively, the video encoding apparatus may encode the information about the search area, and then may signal the information about the search area to the video decoding apparatus. Here, the information on the search area is information indicating the size and position of the search area.
When the search area is an arbitrary area, as shown in fig. 7, the index may indicate one of the first, second, third, and fourth areas (R1, R2, R3, and R4) as the search area. The first region is a previously reconstructed region in the current CTU including the current block. The second and third regions are L-shaped regions having a predefined width and height on the upper and left sides of the current CTU, wherein the L-shaped region is diagonally divided into two regions, i.e., the second and third regions. The fourth region is an L-shaped region having a predefined width and height on the upper and left sides of the current CTU, and is located outside the second and third regions.
When the search area is set in units of CTUs, as shown in fig. 8, the index may indicate one of a previously reconstructed area within the current CTU of the current block, an upper left CTU of the current CTU, an upper CTU of the current CTU, and a left CTU of the current CTU as the search area.
On the other hand, the search area may be determined as a processing unit for pipeline parallel processing. For example, as shown in fig. 9 to 12, the processing unit may be a VPDU.
When the search area is set as a processing unit and the search area is included in one CTU, the index may indicate one of a previously reconstructed area within a current processing unit containing the current block, a left processing unit area of the current processing unit, a top processing unit of the current processing unit, and an upper left processing unit of the current processing unit as the search area.
Further, when the search area is set as a processing unit and the search area is included in the current CTU or the previous CTU, the index may indicate a previously reconstructed area among the current processing units including the current block as the search area, or may indicate one processing unit among a preset number of processing units reconstructed before the current processing unit in the Z-order as the search area. Here, the current processing unit is included in the current CTU, and the preset number of processing units may be included in the current CTU or the previous CTU.
The video encoding apparatus sets a search area by using information on the search area (S1304).
The video encoding apparatus sets a template from pixels spatially adjacent to the current block (S1306).
The video encoding apparatus performs a search based on template matching in the search area to search for a similar template having the highest similarity to the template (S1308).
The video encoding device may use a cost function to calculate a similarity between the template of the current block and the candidate templates in the search area. At this time, the template having the smallest cost function value may be selected as the similar template. Further, when the template of the current block is greater than a predefined width or height, the video encoding apparatus may calculate the cost function value using pixels obtained by sub-sampling the template of the current block and the candidate template.
The video encoding apparatus determines a matching block with the current block based on the similarity template, and selects the matching block as an intra predictor (S1310).
The video encoding device subtracts the intra prediction factor from the current block to generate a residual block (S1312).
The video encoding device encodes the index and the residual block to generate a bitstream (S1314).
Fig. 14 is a flowchart of a video decoding method according to at least one embodiment of the present invention.
The video decoding apparatus decodes the index and the residual block from the bitstream (S1400). Here, the index indicates a search area that is one of the one or more search areas. In addition, the search area is a part of an area previously reconstructed in the current image.
The index of the video decoding apparatus may also indicate the search area in the same way as the video encoding apparatus.
The video decoding apparatus sets a search area using information about the search area according to the index (S1402). The information on the search area may be predefined according to a protocol between the video encoding apparatus and the video decoding apparatus. Alternatively, the video decoding apparatus may decode the information on the search area transmitted after being encoded by the video encoding apparatus. Here, the information on the search area is information indicating the size and position of the search area.
The video decoding apparatus sets a template according to pixels spatially adjacent to the current block (S1404).
The video decoding apparatus performs a search based on template matching in the search area to search for a similar template having the highest similarity to the template (S1406).
The video decoding device may calculate a similarity between the template of the current block and the candidate templates in the search area using a cost function. At this time, the template having the smallest cost function value may be selected as the similar template.
The video decoding apparatus determines a matching block with the current block based on the similarity template, and selects the matching block as an intra predictor (S1408).
The video decoding apparatus adds the residual block and the intra prediction factor to reconstruct the current block (S1410).
Although steps in the respective flowcharts are described as sequentially performed, these steps merely exemplify the technical ideas of some embodiments of the present invention. Accordingly, one of ordinary skill in the art to which the invention pertains may perform the steps by changing the order depicted in the various figures or by performing two or more steps in parallel. Accordingly, the steps in the various flowcharts are not limited to the order in which they occur as shown.
It should be understood that the foregoing description presents illustrative embodiments that may be implemented in various other ways. The functions described in some embodiments may be implemented by hardware, software, firmware, and/or combinations thereof. It should also be understood that the functional components described in this invention are labeled "… … units" to highlight the possibility of their independent implementation.
On the other hand, the various methods or functions described in some embodiments may be implemented as instructions stored in a non-volatile recording medium, which may be read and executed by one or more processors. The nonvolatile recording medium may include various types of recording devices that store data in a form readable by a computer system, for example. For example, the nonvolatile recording medium may include a storage medium such as an erasable programmable read-only memory (EPROM), a flash memory drive, an optical disk drive, a magnetic hard disk drive, a Solid State Drive (SSD), and the like.
Although exemplary embodiments of the present invention have been described for illustrative purposes, those skilled in the art to which the present invention pertains will appreciate that various modifications, additions and substitutions are possible, without departing from the scope and spirit of the invention. Accordingly, embodiments of the present invention have been described for brevity and clarity. The scope of the technical idea of the embodiment of the invention is not limited by the illustration. Accordingly, it will be understood by those of ordinary skill in the art that the scope of the present invention should not be limited by the embodiments explicitly described above, but by the claims and their equivalents.
Reference numerals
122: Intra-frame predictor
155: Entropy encoder
510: Entropy decoder
542: An intra predictor.
Cross Reference to Related Applications
The present application claims priority and benefit from korean patent application No.10-2021-016058, filed 11/19/2021, and korean patent application No.10-2022-0116837, filed 9/2022, which are incorporated herein by reference in their entireties.

Claims (15)

1. A method performed by a video decoding device for decoding a current block, the method comprising:
Decoding an index from a bitstream indicating a search region that is one of one or more search regions, the search region being part of a previously reconstructed region in a current image;
Setting a search area based on the index;
setting a template according to pixels spatially adjacent to the current block;
Searching for a similar template having the highest similarity to the template by performing a search based on template matching in a search area; and
A matching block to the current block is determined based on the similarity template, and the matching block is selected as an intra predictor.
2. The method of claim 1, further comprising:
indicating one of the first region, the second region, the third region, and the fourth region as a search region by index, and
Wherein the first region includes:
including previously reconstructed regions within a current Coding Tree Unit (CTU) of the current block.
3. The method of claim 2, wherein the second region and the third region comprise:
an L-shaped region having a predefined width and height on the upper and left sides of the current CTU and being diagonally divided into a second region and a third region.
4. A method according to claim 3, wherein the fourth region comprises:
an L-shaped region having a predefined width and a predefined height on the upper and left sides of the current CTU and located outside the second and third regions.
5. The method of claim 1, wherein setting a search area comprises:
The search area is set by using information on the search area according to the index, the information on the search area being predefined according to a protocol between the video encoding apparatus and the video decoding apparatus.
6. The method of claim 1, wherein searching for similar templates comprises:
the similarity templates are searched based on a cost function that calculates the similarity between the templates and the candidate templates in the search area.
7. The method of claim 6, wherein searching for similar templates comprises:
When the template is greater than a predefined width or a predefined height, a value of the cost function is calculated by using pixels obtained by sub-sampling the template and the candidate template.
8. The method of claim 1, further comprising:
Decoding a residual block from the bitstream; and
The target block is reconstructed by adding the intra predictor and the residual block.
9. The method of claim 1, further comprising:
when the search area is a processing unit for pipeline parallel processing and one or more search areas are included in a Coding Tree Unit (CTU), a previously reconstructed area in a current processing unit including a current block or one area within a preset number of processing units previously reconstructed to the current processing unit based on a scan order is indicated by an index as a search area.
10. The method of claim 1, further comprising:
When the search region is a processing unit for pipeline parallel processing and one or more search regions are included in the current CTU or the previous CTU, a region previously reconstructed in the current processing unit including the current block or one region within a preset number of processing units reconstructed before the current processing unit based on the scan order is indicated by an index as the search region.
11. The method of claim 10, further comprising:
including the current processing unit in the current CTU; and
A preset number of processing units included in the current CTU or the previous CTU.
12. A method performed by a video encoding device configured to encode a current block, the method comprising:
determining an index indicating a search area that is one of one or more search areas, the search area being part of a previously reconstructed area in the current image;
Setting a search area based on the index;
setting a template according to pixels spatially adjacent to the current block;
Searching for a similar template having the highest similarity to the template by performing a search based on template matching in a search area; and
A matching block to the current block is determined based on the similarity template, and the matching block is selected as an intra predictor.
13. The method of claim 12, wherein setting a search area comprises:
by setting the search area with information about the search area, the information about the search area is predefined according to a protocol between the video encoding apparatus and the video decoding apparatus.
14. The method of claim 12, further comprising:
generating a residual block by subtracting the intra prediction factor from the current block; and
The index and residual block are encoded.
15. A computer-readable recording medium configured to store a bitstream generated by a video encoding method, the video encoding method comprising:
determining an index indicating a search area that is one of one or more search areas, the search area being part of a previously reconstructed area in the current image;
Setting a search area based on the index;
setting a template according to pixels spatially adjacent to the current block;
Searching for a similar template having the highest similarity to the template by performing a search based on template matching in a search area; and
A matching block to the current block is determined based on the similarity template, and the matching block is selected as an intra predictor.
CN202280076116.6A 2021-11-19 2022-09-19 Method and apparatus for video coding and decoding using template matching-based intra prediction Pending CN118251891A (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2021-0160587 2021-11-19
KR1020220116837A KR20230073970A (en) 2021-11-19 2022-09-16 Method And Apparatus for Video Coding Using Template Matching Based Intra Prediction
KR10-2022-0116837 2022-09-16
PCT/KR2022/013976 WO2023090613A1 (en) 2021-11-19 2022-09-19 Method and device for video coding using intra prediction based on template matching

Publications (1)

Publication Number Publication Date
CN118251891A true CN118251891A (en) 2024-06-25

Family

ID=91551475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202280076116.6A Pending CN118251891A (en) 2021-11-19 2022-09-19 Method and apparatus for video coding and decoding using template matching-based intra prediction

Country Status (1)

Country Link
CN (1) CN118251891A (en)

Similar Documents

Publication Publication Date Title
CN113812147B (en) Image encoding and decoding using intra-block copy
CN116472709A (en) Apparatus and method for video encoding and decoding
CN116530082A (en) Method and apparatus for video coding using intra prediction
CN116941241A (en) Video encoding and decoding method and apparatus using matrix-based cross component prediction
CN116636211A (en) Method and apparatus for encoding video using block merging
CN116491114A (en) Image encoding and decoding method and apparatus using sub-block unit intra prediction
CN116530084A (en) Video codec using block-based deep learning model
US20240305815A1 (en) Method and apparatus for video coding using intra prediction based on template matching
CN118251891A (en) Method and apparatus for video coding and decoding using template matching-based intra prediction
US20240323356A1 (en) Method and apparatus for video coding using intra prediction based on reference sample line derivation
US20230283768A1 (en) Method for predicting quantization parameter used in a video encoding/decoding apparatus
CN117044200A (en) Method and apparatus for video encoding and decoding using spiral scan order
CN116918323A (en) Video encoding and decoding method and apparatus for improving prediction signal of intra prediction
KR20230059135A (en) Video Coding Method And Apparatus Using Various Block Partitioning Structure
CN118160304A (en) Video encoding method and apparatus using various block division structures
CN117044197A (en) Method and apparatus for video encoding and decoding using derived intra prediction modes
KR20230073970A (en) Method And Apparatus for Video Coding Using Template Matching Based Intra Prediction
CN118489244A (en) Method and apparatus for video encoding and decoding using improved AMVP-MERGE mode
CN118901240A (en) Video coding method and apparatus using context model initialization
CN117917071A (en) Method and apparatus for video coding using sub-block coding order change and intra prediction according to sub-block coding order change
CN116472710A (en) Method and apparatus for generating residual signal using reference between components
KR20230036967A (en) Video Coding Method And Apparatus Using Subblcok Coding Order Change And Intra Prediction According Thereto
CN118140476A (en) Method and apparatus for video encoding and decoding using geometric intra prediction modes
CN116648907A (en) Block partitioning structure for efficient prediction and transformation, and method and apparatus for video encoding and decoding using the same
CN117581534A (en) Video encoding/decoding method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication