Method and apparatus for template-based picture boundary padding in video coding

The template-matching-based method for padding out-of-boundary pixels in video coding systems addresses inefficiencies in existing methods by reducing decoder complexity and improving video quality through accurate padding, thereby enhancing coding efficiency and adaptability.

WO2025218731A1PCT designated stage Publication Date: 2025-10-23MEDIATEK INC
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/089513
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-12-30
Filing Date
2025-04-17
Publication Date
2025-10-23

AI Technical Summary

Technical Problem

Existing video coding systems face challenges in efficiently padding out-of-boundary pixels during the block reconstruction stage, leading to suboptimal video quality and increased decoder complexity.

Method used

A template-matching-based approach is employed to generate padded samples by locating a source block in a reference picture using template matching, which involves matching a target template adjacent to the target block in the current picture, and generating padding data based on the reconstructed data of the source block during the block reconstruction stage or before in-loop filtering.

Benefits of technology

This method reduces decoder complexity and improves video quality by providing more accurate padding of out-of-boundary pixels, enhancing coding efficiency and adaptability to different content types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025089513_23102025_PF_FP_ABST
    Figure CN2025089513_23102025_PF_FP_ABST
Patent Text Reader

Abstract

A method and apparatus for padding out-of-boundary pixels are disclosed. According to the method, input data associated with a current picture is received. For a target block outside a boundary of the current picture, a source block in a reference picture is located by using template matching, wherein a target template adjacent to the target block in the current picture is matched with template candidates in the reference picture according to template matching costs, and the source block is located according to a best-matched template candidate. Padding data is generated for the target block based on reconstructed data of the source block, wherein said generating padding data is performed during block reconstruction stage of the current picture or before an in-loop filtering process of the current picture. A boundary-extended current picture is provided by adding the padding data to the current picture.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD AND APPARATUS FOR TEMPLATE-BASED PICTURE BOUNDARY PADDING IN VIDEO CODINGCROSS REFERENCE TO RELATED APPLICATIONS

[0001] The present invention is a non-Provisional Application of and claims priority to U.S. Provisional Patent Application No. 63 / 635,669, filed on April 18, 2024 and U.S. Provisional Patent Application No. 63 / 739,716, filed on December 30, 2024. The U.S. Provisional Patent Application are hereby incorporated by reference in their entireties.FIELD OF THE INVENTION

[0002] The present invention relates to padding out-of-boundary pixels in video coding system. In particular, the present invention relates to generating padded samples using template-matching based approach during the block reconstruction stage. BACKGROUND AND RELATED ART

[0003] Versatile video coding (VVC) is the latest international video coding standard developed by the Joint Video Experts Team (JVET) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) . The standard has been published as an ISO standard: ISO / IEC 23090-3: 2021, Information technology -Coded representation of immersive media -Part 3: Versatile video coding, published Feb. 2021. VVC is developed based on its predecessor HEVC (High Efficiency Video Coding) by adding more coding tools to improve coding efficiency and also to handle various types of video sources including 3-dimensional (3D) video signals.

[0004] Fig. 1A illustrates an exemplary adaptive Inter / Intra video encoding system incorporating loop processing. For Intra Prediction 110, the prediction data is derived based on previously coded video data in the current picture. For Inter Prediction 112, Motion Estimation (ME) is performed at the encoder side and Motion Compensation (MC) is performed based on the result of ME to provide prediction data derived from other picture (s) and motion data. Switch 114 selects Intra Prediction 110 or Inter Prediction 112 and the selected prediction data is supplied to Adder 116 to form prediction errors, also called residues. The prediction error is then processed by Transform (T) 118 followed by Quantization (Q) 120. The transformed and quantized residues are then coded by Entropy Encoder 122 to be included in a video bitstream corresponding to the compressed video data. The bitstream associated with the transform coefficients is then packed with side information such as motion and coding modes associated with Intra prediction and Inter prediction, and other information such as parameters associated with loop filters applied to underlying image area. The side information associated with Intra Prediction 110, Inter prediction 112 and in-loop filter 130, is provided to Entropy Encoder 122 as shown in Fig. 1A. When an Inter-prediction mode is used, a reference picture or pictures have to be reconstructed at the encoder end as well. Consequently, the transformed and quantized residues are processed by Inverse Quantization (IQ) 124 and Inverse Transformation (IT) 126 to recover the residues. The residues are then added back to prediction data 136 at Reconstruction (REC) 128 to reconstruct video data. The reconstructed video data may be stored in Reference Picture Buffer 134 and used for prediction of other frames.

[0005] As shown in Fig. 1A, incoming video data undergoes a series of processing in the encoding system. The reconstructed video data from REC 128 may be subject to various impairments due to a series of processing. Accordingly, in-loop filter 130 is often applied to the reconstructed video data before the reconstructed video data are stored in the Reference Picture Buffer 134 in order to improve video quality. For example, deblocking filter (DF) , Sample Adaptive Offset (SAO) and Adaptive Loop Filter (ALF) may be used. The loop filter information may need to be incorporated in the bitstream so that a decoder can properly recover the required information. Therefore, loop filter information is also provided to Entropy Encoder 122 for incorporation into the bitstream. In Fig. 1A, Loop filter 130 is applied to the reconstructed video before the reconstructed samples are stored in the reference picture buffer 134. The system in Fig. 1A is intended to illustrate an exemplary structure of a typical video encoder. It may correspond to the High Efficiency Video Coding (HEVC) system, VP8, VP9, H. 264 or VVC.

[0006] The decoder, as shown in Fig. 1B, can use some of the functional blocks as the encoder. For example, the decoder can reuse Inverse Quantization 124 and Inverse Transform 126; however, Transform 118 and Quantization 120 are not needed at the decoder. Instead of Entropy Encoder 122, the decoder uses an Entropy Decoder 140 to decode the video bitstream into quantized transform coefficients and needed coding information (e.g. ILPF information, Intra prediction information and Inter prediction information) . The Intra prediction 150 at the decoder side does not need to perform the mode search. Instead, the decoder only needs to generate Intra prediction according to Intra prediction information received from the Entropy Decoder 140. Furthermore, for Inter prediction, the decoder only needs to perform motion compensation (MC 152) according to Inter prediction information received from the Entropy Decoder 140 without the need for motion estimation.

[0007] In VVC, the Sequence Parameter Set (SPS) and the Picture Parameter Set (PPS) contain high-level syntax elements that apply to entire coded video sequences and pictures, respectively. The Picture Header (PH) and Slice Header (SH) contain high-level syntax elements that apply to a current coded picture and a current coded slice, respectively.

[0008] According to VVC, an input picture is partitioned into non-overlapped square block regions referred as CTUs (Coding Tree Units) , similar to HEVC. Each CTU can be partitioned into one or multiple smaller size coding units (CUs) . The resulting CU partitions can be in square or rectangular shapes. Also, VVC divides a CTU into prediction units (PUs) as a unit to apply prediction process, such as Inter prediction, Intra prediction, etc.

[0009] In HEVC, reference pictures are extended by a perpendicular padding of the picture boundary samples. During the standardization of VVC, new methods are investigated for boundary padding, which use either inter-prediction based techniques or intra-prediction based techniques. In the present invention, an efficient padding technique by padding the out-of-boundary pixels during the reconstruction stage is disclosed.

[0010] Multi-Directional Boundary Padding (MDBP)

[0011] In JVET-J0014 (M. Albrecht, et al., “Description of SDR, HDR, and 360° video coding technology proposal by Fraunhofer HHI” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 10th Meeting: San Diego, US, 10–20 Apr. 2018, Document: JVET-J0014) , Multi-directional boundary padding (MDBP) is disclosed. Based on the coded block shape, the given motion vector and the number of interpolation filter taps, a particular area of the reference frame is used for motion compensated prediction. In HEVC and JEM (Joint Exploration Model (JEM) for Video Compression) , if this referenced sample area is partially or entirely outside the area of the reconstructed reference frame, perpendicular extension of the frame border pixels is used, which may not optimally approximate the predicted block. By exploiting different spatial prediction modes to extend the reference frame border, a better continuation might be achieved. Therefore, multi-directional boundary padding (MDBP) uses angular intra prediction to extend the reference frame border, whenever the referenced pixel area is partially or entirely outside the area of the reconstructed reference frame.

[0012] In order to reduce signalling cost for the used angular prediction mode, the best fitting mode is estimated at both the encoder and the decoder side. For the estimation, a template area is defined, which lays inside the reconstructed reference frame as shown in Fig. 2. In Fig. 2, the frame boundary line 210 located on the top side of the frame and a reference area 220 are shown, where the pixels below the frame board line 210 are inside the frame and the pixels above the frame board line 210 are outside the frame.

[0013] Furthermore, for every possible angular intra prediction mode, the prediction direction is rotated by 180° to point over the available border pixels inside the reference frame. The template area is then predicted from the adjacent border pixels and is compared with the reconstructed reference frame pixels based on the SAD measure. Finally, the angular prediction mode with the smallest template-based SAD measure is chosen, to predict the referenced pixel area outside the reference frame.

[0014] To use the available angular intra prediction for MDBP, some modifications have to be applied. First, for MDBP intra prediction the border pixels are only available at a single side of the predicted area. Therefore, only half of the angular intra prediction modes, such as either horizontal or vertical modes, are used depending on the prediction direction. Second, for the top and left boundaries of the reference frame, the angular intra prediction modes have to be rotated by 180° before applying to MDBP border extension.

[0015] Fig. 3 illustrates an example of providing a complete estimate of the entire referenced pixel area 320 outside the reference frame, and two template areas (330 and 332) being used in JVET-J0014. The first template area 330 is determined, based on the outermost pixel line parallel to the reference frame border. The second template area 332 is determined, based on the first pixel line outside the reference frame border as shown in Fig. 3, where the frame boundary line 310 is shown.

[0016] At the edges of the reference frame, the referenced pixel area overlaps with the frame border at two sides. Here MDBP is only applied at one side (the side, which overlaps with the frame border by most pixels) . The remaining side is padded with the perpendicular frame border padding already available.

[0017] Inter / Intra Boundary Padding

[0018] In HEVC, reference pictures are extended by a perpendicular padding of the picture boundary samples.

[0019] Inter-prediction based boundary padding uses motion compensated prediction to extend the area of the reference picture. The boundary extension area is divided into blocks of 4xM or Mx4 samples. Each block is filled by motion compensation using the motion information of the adjacent reference block. For boundary extension blocks without associated motion information and for boundary extension areas for which motion information points to outside of the reference picture, fall-back perpendicular padding is applied. The padding method in JVET-K0363 (Yan Zhang, et al., “CE4.5.2: Motion compensated boundary pixel padding” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 11th Meeting: Ljubljana, SI, 10–18 July 2018, Document: JVET-K0363) entails addition of an average residual offset to the boundary extension samples, while the padding method in JVET-K0117 (Minsoo Park, et al., “CE4: Results on Reference picture boundary padding in J0025” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 11th Meeting: Ljubljana, SI, 10–18 July 2018, Document: JVET-K0117) supports bi-prediction of boundary extension samples.

[0020] Intra-prediction based boundary padding as proposed in JVET-J0012 (Rickard  et al., “Description of SDR and HDR video coding technology proposal by Ericsson and Nokia” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 10th Meeting: San Diego, US, 10–20 Apr. 2018, Document: JVET-J0012) uses angular intra-prediction to fill the area of a referenced block outside the reference picture. The applied angular intra-prediction mode is chosen in the encoder and decoder using a probing approach of decoded picture samples.

[0021] In JVET-K0195, a harmonized boundary padding approach using inter-prediction and intra-prediction based boundary padding is disclosed and experimental results are reported.

[0022] Inter / Intra-Based Boundary Padding

[0023] JVET-K0195 proposes an inter / intra-prediction based boundary padding, that combines per-picture inter-prediction based boundary padding with per-reference intra-prediction based boundary padding. After generation of the inter-prediction based boundary padding, for each reference block entailing boundary padding samples, the number of boundary padding samples originated from perpendicular boundary padding is evaluated. If this number exceeds a threshold (e.g. 50%of boundary padding samples) , intra-prediction based boundary padding is used for the reference block instead.

[0024] In VVC, outside areas of a reference picture are padded by extrapolating edge pixel of a picture. In JVET-K0117, a padding method for padding outside areas of a picture with motion compensation according to motion information of edge pixel of the picture is disclosed as shown in Fig. 4. In Fig. 4, boundary block 412 in the current frame 410 is shown and details of the padding 430 around this boundary block is illustrated. The corresponding boundary block 422 in the reference picture 420 is shown in the lower right of Fig. 4 and the details 440 of the corresponding boundary block is shown in the upper right of Fig. 4. In the details 430 of the padding around this boundary block, the boundary line 434 is shown. The pixels on the left side of the boundary line of reference area 432 are not available and need to be padded. The corresponding reference area 442 is located and is used to derive reference area 432 as indicated by the arrows in Fig. 4.

[0025] To use the motion information of the edge pixels, each 4x4 block is checked at the boundary of the picture. If there is motion information in the block, the location of the block is checked in the reference picture of the block. If the location is located in the image area, check whether the neighbouring area of the reference area is available.

[0026] The location of the neighbouring area may be located in four directions, up, down, left, right. The orientation of the adjacent area is the same as the location of the padding area. For example, if the padding area is located on the left side of the picture, then the inspection area is also on the left side of the pixel. The “inspection area” here means the reference samples lies around the reference blocks. For example, if left picture boundary padding is going to be performed, reference samples at left-hand side of reference block are checked. In addition, the length of the side that does not face the picture of the padding area is determined by the distance between the position of the pixel of the reference picture and the position of the edge pixel or by the size of the padding area. The shorter of them is selected. If the predetermined length is shorter than the size of the padding area, the rest of the area is filled with extrapolated edge pixels of the external picture.

[0027] The available adjacent area is derived by motion compensation. However, a conventional padding method is performed when an adjacent area is unavailable or there is no information about the motion in a boundary block. The block can have two pieces of information about movement. In this case, each information is used to create a padding image and integrate two images into one. In addition, the last pixel of each position is extrapolated to induce a left upper portion, a right upper portion, a left lower portion, and a right padding area.

[0028] Motion Compensated Boundary Pixel Padding

[0029] In JVET-K0363, motion compensated boundary pixel padding is disclosed. When motion compensation is performed in the decoder side, it is possible that the motion vector points to a reference block that is partially or entirely located outside the reference slice. Without boundary padding, these pixels will be unavailable. Traditionally, the reference slice is padded using repetitive padding method which repeats the outer most pixel in each of the four directions for a certain amount of times depending on the padding size. These padded pixels can only provide very limited information since it is very likely that the padded area does not contain any meaningful content comparing to those that lie inside the boundary.

[0030] In JVET-K0363, a new boundary pixel padding method is introduced so that more information can be provided by the padded areas in the reference slice. A motion vector is first derived from the boundary 4x4 block inside the current frame as shown in Fig. 5, where the padding is shown on the left (510) and the MC padding according to JVET-K0363 is shown on the right (520) . If the boundary 4x4 block is intra coded or the motion vector is not available, repetitive padding will be used. If the boundary 4x4 block is predicted using uni-directional inter prediction, the only motion vector within the block will be used for motion compensated boundary pixel padding. Using the position of the boundary 4x4 block and its motion vector, a corresponding starting position can be computed in the reference frame. From this starting position till the boundary of the reference slice in the given padding direction, a 4xM or Mx4 image data can be fetched where M is the distance between the horizontal / vertical coordinate of the boundary pixel position and the starting position depending on the padding direction. Here in the CE test, M is forced to be smaller than 64. In case of bi-directional inter prediction, only the motion vector, which points to the pixel position farther away from the frame boundary in the reference slice in terms of the padding direction, is used in motion compensated boundary pixel padding. The difference between the DC values of the boundary 4x4 block in the current slice and its corresponding reference 4x4 block in the reference slice is used as the offset to filter the fetched motion compensated image data before it is copied to the padding area beyond the image boundary.

[0031] In ECM-5.0, bi-prediction is performed in a way that avoids relying on reference samples out of a reference picture bounds (OOB) , if possible.

[0032] To do so, in the case of a bi-predicted block with an OOB reference block in one of the two reference pictures, the OOB prediction samples are not used. The concerned part of the block is rather uni-predicted based on non-OOB prediction samples, if available in the other reference picture.

[0033] However, for a uni-predicted block with an OOB reference block or for a bi-directional predicted block with both OOB reference samples, repetitive padded pixels are used instead of MC.

[0034] That is, in ECM-5.0, pictures are extended by an area surrounding the picture with a size of (maxCUwidth + 16) in each direction of the picture boundary. The pixel in the extended area is derived by repetitive boundary padding. When a reference block used for uni-prediction is located partially or completely out of the picture boundary (OOB) , the repetitive padded pixel is used instead of motion compensation (MC) .

[0035] In JVET-Z0130 (Zhi Zhang, et al., “EE2-related: Motion compensation boundary padding” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 26th Meeting, by teleconference, 20–29 April 2022, Document: JVET-Z0130) , a method called motion compensated boundary padding replaces the repetitive boundary padding, for increased coding efficiency.

[0036] In JVET-AA0096 (Fabrice Le Léannec, et al., “EE2-2.2: Motion compensated picture boundary padding” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 27th Meeting, by teleconference, 13–22 July 2022, Document: JVET-AA0096) , samples outside of the picture boundary are derived by motion compensation instead of using only repetitive padding as in ECM. In the implementation, the total padded area size is increased by 64 (test 2.2a) or 16 (test 2.2b) compared to ECM (Enhanced Compression Model) . This is to keep MV clipping, which implements repetitive padding, non-normative.

[0037] For motion compensated padding, MV of a 4×4 boundary block is utilized to derive an M×4 or 4×M padded block. The value M is derived as the distance of the reference block to the picture boundary as shown in Fig. 6, where MC padding areas 630 are added to the current picture 610 and reference picture 620 is shown. For a 4x4 boundary block 612, the corresponding reference block 622 is located according to a motion vector 616. The Mx4 padded block 614 for the current picture and the Mx4 padded block 624 for the reference picture are shown. Moreover, M is set at least equal to 4 as soon as the motion vector points to a position internal to the reference picture bounds. If the boundary block is intra coded, then MV is not available, and M is set equal to 0. If M is less than 64, the rest of the padded area is filled with the repetitive padded samples.

[0038] In case of bi-directional inter prediction, only one prediction direction, which has a motion vector pointing to the pixel position farther away from the picture boundary in the reference picture in terms of the padding direction, is used in MC boundary padding.

[0039] The pixels in MC padded block are corrected with an offset, which is equal to the difference between the DC values of the reconstructed boundary block and its corresponding reference block.

[0040] Out Of Boundary (OOB)

[0041] In ECM-4.0, due to the reference samples padding of the reference picture, it is possible for an inter CU to have a reference block located outside the reference picture partially or totally as illustrated in Fig. 7. In Fig. 7, bi-directional motion compensation is performed to generate the inter prediction block of the current block. In this example, list 0 reference block is partially out-of-boundary (OOB) while list 1 reference block is fully inside the reference picture. However, the OOB part of the motion compensated blocks usually provides less prediction efficiency because the OOB part is simply repetitive samples derived from the boundary samples within the reference picture.

[0042] Documents JVET-Y0125 and JVET-Y0219 from the JVET-Y meeting propose to handle OOB of bi-directional motion compensation. The methods in these two contributions were included in Exploration Experiment 2 (EE2) for further study.

[0043] In Test-2.2a, when combining multiple prediction blocks, the OOB prediction samples are discarded and only the non-OOB predictors are used to generate the final predictor. Specifically, let Pos_xi, j and Pos_yi, j the position of one prediction sample in one current block,  and  (x = 0 or 1) denote the MV of the current block; PosLeftBdry, PosRightBdry, PosTopBdry, PosBottomBdry are the positions of four boundaries of the picture. One prediction sample is regarded as OOB when at least one of the following conditions is satisfied: where half_pixel is equal to 8 that represents the half-pel sample distance in the 1 / 16-pel  sample precision.

[0044] After examining the OOB condition for each sample, the final prediction samples of one bi-directional block is generated as follows: If is OOB and is non-OOB, else if is non-OOB and is OOB, else

[0045] Note that the above OOB checking process is also applicable when BCW is enabled.

[0046] In Test-2.2b, the OOB checking is conducted prior to the BDOF process, where an OOB samples in one uni-directional prediction block is replaced by its collocated prediction sample from the other direction if the collocated sample is non-OOB, as depicted as If is OOB and is non-OOB, else if is non-OOB and is OOB,

[0047] Then, the existing BDOF or weighted averaging is applied without any modifications.

[0048] Template Matching Picture Boundary Padding

[0049] In JVET-AH0168, it proposes a method to divide the outside area of the reference picture into target blocks, which are predicted by template matching. First, a template is defined adjacent to the target block. Then, a search is performed in a defined area for matching structures with the sum of absolute differences (SAD) as similarity metric. For the best matched structures, so called source blocks are extracted and averaged to form the prediction for the target block. The general algorithm is described in an article by N. Horst, et al., entitled “ATemplate Matching Approach for Reference Picture Padding in Video Coding” 2003 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP 2023) . Fig. 8 illustrates an example of search with template matching picture boundary padding, where search area 810, template 820, matching structure 830, target block 832 and source block 822 are shown. The search only considers the luma component to reduce complexity.

[0050] The best matching structures are selected by adaptive candidate selection as described by N. Horst, et al. in the ICASSP 2023 article. First, the structure with the lowest SAD is determined. Then, the lowest SAD is multiplied with a factor 1.5 and the result is used as a threshold for the other structures, which are called candidates. This excludes outliers from the averaging process. Additionally, a maximum number of candidates is set to 4. The parameters were found empirically and were fixed for all experiments. They can potentially be signalled in the bitstream for more flexibility.

[0051] The search area is defined by the L1 distance to the template, which results in a triangle. The search starts with distance of 3 and is gradually increases until the stopping criterion is met or the maximum distance of 12 is reached. An example of the template matching search area is shown in Fig. 9, where different grey levels mark different steps in the process. The stopping criterion is met when one of the candidates in the search area has an SAD value of 24 or lower. This search area shape and parameters are found as a good compromise between the compression efficiency and complexity.

[0052] It was fixed for all experiments but can potentially be signalled in the bitstream for more flexibility. This procedure reduces the complexity of the search by early stopping if a good candidate is found. The early stopping procedure is described in an article by N. Horst, et al., entitled “Balancing Complexity of Template Matching-based Reference Picture Padding for Video Coding” in 2024 Picture Coding Symposium (PCS 2024) .

[0053] The target block size is set to 12x1 in the direction parallel and perpendicular to the picture boundary respectively. The template size is set to 16x2 in those dimensions, and it is centred adjacent to the target block. For the corners of the picture, the target block size is increased by 2 pixels so that the template is fully available as shown in Fig. 10. Fig. 10 illustrates an example of a target block 1020 located at the lower boundary 1080 of the picture 1010. The template 1050 is adjacent to the target block 1020. The target block size is increased by 2 pixels (1030 and 1040) on both sides of the target block 1020. The template is also extended by 2 pixels (1060 and 1070) on both sides of the template 1050. The search is performed for all target blocks adjacent to the picture boundary. The search results are then reused for outward target blocks. The outward target blocks are aligned perpendicular to the picture boundary and target blocks with the same alignment share the search results. Reusing the search results was found to reduce complexity significantly without reducing compression efficiency and was initially proposed in an article by N. Horst, et al., entitled “Complexity Reduction of Template Matching-based Reference Picture Padding in Video Coding” in 2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP 2024) . The template and target block sizes influence the complexity of the method. The described parameters are found to reduce compression efficiency only minimally compared to other configurations and simultaneously result in very reasonable complexity. Different configurations can be defined to better adapt to different content.

[0054] The luma and chroma components need to be processed jointly to avoid colour artefacts. To cope with chroma subsampled material, a process is applied that emulates and upsampling and downsampling step without performing the actual upsampling and downsampling, as described by N. Horst, et al. in the ICASSP 2024 article. This reduces complexity of the algorithm compared to actual upsampling and downsampling. The search results are described by displacement vectors as shown in Fig. 11, which indicate the shift from source block to target block. To derive the chroma, the virtual (upsampled) chroma values are derived by following the displacement vectors of the luma component. The value for the shifted virtual chroma position is found by nearest neighbour lookup from the downsampled domain. If the derived value is undefined because it is not yet padded, the displacement vector of the new position is followed until a defined value can be retrieved from the downsampled domain. The final value in the downsampled domain is derived by averaging the virtual upsampled chroma values corresponding to it. The process is executed, starting from the chroma values at the picture border moving outward.

[0055] The process pads the reference picture by only 16 pixels to the outside to reduce complexity and memory demands. It was found that compression efficiency does not increase if the template matching padding is executed further outward. This observation is in line with the findings for motion compensated padding in JVET-AA0096 (Fabrice Le Léannec, et al., “EE2-2.2: Motion compensated picture boundary padding” , Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 27th Meeting, by teleconference, 13–22 July 2022, Document: JVET-AA0096) . Repetitive padding is used further out.

[0056] In the present application, innovative template-matching-based padding sample generation is disclosed, which can reduce the decoder complexity and is hardware friendly. BRIEF SUMMARY OF THE INVENTION

[0057] A method and apparatus for padding out-of-boundary pixels are disclosed. According to the method, input data associated with a current picture is received. For a target block outside a boundary of the current picture, a source block in a reference picture is located by using template matching, wherein a target template adjacent to the target block in the current picture is matched with template candidates in the reference picture according to template matching costs, and the source block is located according to a best-matched template candidate. Padding data is generated for the target block based on reconstructed data of the source block, wherein said generating padding data is performed during block reconstruction stage of the current picture or before an in-loop filtering process of the current picture. A boundary-extended current picture is provided by adding the padding data to the current picture.

[0058] In one embodiment, the in-loop filtering process is performed at both current picture samples and padded current picture samples at a corresponding picture boundary.

[0059] In one embodiment, the current picture is coded in an inter-prediction mode. In another embodiment, the current picture is coded in an IBC (Intra Block Copy) or intraTMP (intra Template Matching Prediction) mode.

[0060] In one embodiment, cost metric for the template matching costs comprises SATD, SAD, or SSE. In one embodiment, the cost metric is determined adaptively. In one embodiment, the cost metric is determined explicitly by signalling. In another embodiment, the cost metric is determined implicitly.

[0061] In one embodiment, different weightings for the template matching costs are used for template samples inside the target template and a corresponding template candidate. In one embodiment, the template samples closer to the target block are assigned larger weightings and the template samples further away from the target block are assigned smaller weightings.BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Fig. 1A illustrates an exemplary adaptive Inter / Intra video coding system incorporating loop processing.

[0063] Fig. 1B illustrates a corresponding decoder for the encoder in Fig. 1A.

[0064] Fig. 2 illustrates an example of the template area used for estimating the MDBP (Multi-Directional Boundary Padding) angular mode.

[0065] Fig. 3 illustrates an example of the two MDBP template areas T1 and T2 based on the outermost and the first pixel line respectively, which lay outside of the reference frame.

[0066] Fig. 4 illustrates an example of boundary pixel padding using motion compensation according to JVET-K0117.

[0067] Fig. 5 illustrates an example of motion-compensated boundary padding method.

[0068] Fig. 6 illustrates an example of deriving an M×4 padded block with a left padding direction.

[0069] Fig. 7 illustrates an example of bi-directional prediction with the out-of-boundary (OOB) process according to ECM 4.0.

[0070] Fig. 8 illustrates an example of search with template matching picture boundary padding, where search area, template, matching structure, target block and source block are shown.

[0071] Fig. 9. illustrates template matching search area, where grey levels mark different steps in the process.

[0072] Fig. 10 illustrates an example of template and target block size for picture boundary padding, where virtual target block, extended target block size at the corners of the picture and extended template are shown.

[0073] Fig. 11 illustrates an example of chroma handling samples handling using luma displacement vectors.

[0074] Fig. 12 illustrates an example of intra-picture (POC0) padding by using a first inter-picture (POC32) .

[0075] Fig. 13A illustrates another example of intra-picture padding using multiple inter-pictures, where the intra-picture (POC0) and two inter-pictures (POC16 and POC32) are shown.

[0076] Fig. 13B illustrates another example of intra-picture padding based on Fig. 13A, where template-matching / MV from POC32 and template-matching / MV from POC16 are utilized to generate padding samples and the padding samples are added to POC0.

[0077] Fig. 14A illustrates an example of distance weighting in template-matching-based picture boundary padding.

[0078] Fig. 14B illustrates an example of spatial weighting in template-matching-based picture boundary padding.

[0079] Fig. 15 illustrates an example of spatial weighting WS and distance weighting WD in template region.

[0080] Fig. 16 illustrates an example of using intra prediction angle inherited from a boundary block to generate padding samples.

[0081] Fig. 17 illustrates an example of using intra prediction angle inherited from a boundary block derived from TIMD to generate padding samples.

[0082] Fig. 18 illustrates an example of using both L0 motion vector and L1 motion vector inherited from a boundary block to generate padding samples.

[0083] Fig. 19 illustrates an example of motion shift from template matching search inherited from a boundary block to generate padding samples.

[0084] Fig. 20 illustrates a flowchart of an exemplary video coding system that generates template-matching-based padding samples during the reconstruction stage or before the in-loop filtering stage according to an embodiment of the present invention.DETAILED DESCRIPTION OF THE INVENTION

[0085] It will be readily understood that the components of the present invention, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the systems and methods of the present invention, as represented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. References throughout this specification to “one embodiment, ” “an embodiment, ” or similar language mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment.

[0086] Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize, however, that the invention can be practiced without one or more of the specific details, or with other methods, components, etc. In other instances, well-known structures, or operations are not shown or described in detail to avoid obscuring aspects of the invention. The illustrated embodiments of the invention will be best understood by reference to the drawings, wherein like parts are designated by like numerals throughout. The following description is intended only by way of example, and simply illustrates certain selected embodiments of apparatus and methods that are consistent with the invention as claimed herein.

[0087] Picture Boundary Padding

[0088] Several new methods of template-matching-based picture boundary padding are disclosed. A virtual reference frame padding method using the current picture to perform previous coded picture padding is proposed. Furthermore, a weighted template matching used in template search can be considered in template-matching-based picture boundary padding. Besides, different cost metrics, such as SATD or SAD, can be adaptively switched and be signalled in bitstream or inferred. For picture corner handling, several template matching methods are performed. In addition, the template-matching search range in picture boundary padding can be the same as in inter-prediction, and padding samples are generated during CU reconstruction stage or block reconstruction stages jointly. Moreover, in existing ECM, motion-compensated picture boundary padding is performed. It is also proposed to jointly perform motion-compensated picture boundary padding and template-matching-based picture boundary padding.

[0089] Example 1-1: Intra-picture padding

[0090] In one embodiment, after encoding / decoding the first inter-picture, use the first inter-picture to perform padding at intra-picture. For example, as shown in Fig. 12, POC0 and POC32 denote the intra-picture and the first inter-picture, respectively. In the proposed method, template-matching or MV from POC32 is utilized to generate padding samples and the padding samples are added to POC0. To be more specific, one or multiple source blocks are located in the inter-picture and are identified through the template matching mechanism. Following the similar mechanism as described in the Section of “Template Matching Picture Boundary Padding” , the target blocks and the associated templates are located in the intra picture, while the matching structures and source blocks are located in the inter picture. In yet another scheme, when an inter mode coded block in the inter-picture has a reference block in the intra-picture and the reference block has at least one reference samples located at the outside of the intra-picture, this reconstructed samples of this inter mode coded block is copied to replace the corresponding reference samples, which are located at outside of the intra picture boundaries. The padded intra-picture is further utilized as reference picture.

[0091] In another embodiment, after encoding / decoding the first inter-picture, use multiple inter-pictures to perform padding at intra-picture. For example, as shown in Fig. 13, POC0, POC32 and POC16 denote the intra-picture, the first inter-picture and the second inter-picture, respectively as shown in Fig. 13A. In the proposed method, the template-matching or MV from POC32 and the template-matching or MV from POC16 (shown in Fig. 13B) are utilized to generate padding samples and the padding samples are added to POC0. To be more specific, one or multiple source blocks are located in the inter-pictures and are identified through the template matching mechanism. Following the similar mechanism as described in the section of “Template Matching Picture Boundary Padding” , the target blocks and the associated templates are located in the intra-picture while the matching structures and source blocks are located in the inter-pictures. In yet another scheme, when an inter mode coded block in the inter-pictures has a reference block in the intra picture and the reference block has at least one reference samples located at the outside of the intra-picture, this reconstructed samples of this inter mode coded block is copied to replace the corresponding reference samples which are located at outside of the intra picture boundaries. The padded intra-picture is further utilized as a reference picture.

[0092] In another embodiment, in the intra-picture, template-matching-based picture boundary padding is performed. To be more specific, one or multiple source blocks are located in the intra-picture itself and are identified through the template matching mechanism. Following the similar mechanism as described in the section of “Template Matching Picture Boundary Padding” , the target blocks and the associated templates are located in the intra-picture while the matching structures and source blocks are also located in the same intra-picture. In yet another scheme, when a IBC or intra TMP mode coded block in the intra-picture has a reference block in the same intra-picture and the reference block has at least one reference sample located at the outside of the intra-picture, the reconstructed samples of this IBC or intra TMP mode coded block is copied to replace the corresponding reference samples which are located at outside of the intra-picture boundaries.

[0093] In another embodiment, in the intra-picture, template-matching-based picture boundary padding is performed in the block reconstruction stage or before in-loop filtering stage.

[0094] In another embodiment, in the intra-picture, block vector-based padding is performed in the block reconstruction stage or before the in-loop filtering stage.

[0095] In another embodiment, in the proposed method, since template-matching-based picture boundary padding or block vector-based padding is performed in the block reconstruction stage or before the in-loop filtering stage, it is possible that there is no reference block for some boundary blocks. For example, the top boundary blocks, the left boundary blocks, or the left-top corner boundary blocks are less likely to have reference regions. For those unavailable reference block region, repetitive padding or intra-prediction-based picture boundary padding is utilized.

[0096] Example 1-2: Weighted template matching in boundary sample generation

[0097] In one embodiment, there can be different weightings inside the template in template-matching-based picture boundary.

[0098] In another embodiment, for those samples that are closer to the target block in the template region, the template weightings can be larger. For those samples that are further away from the target block in the template region, the template weightings can be smaller. Some spatial weighting and distance weighting examples are shown in Fig. 14A and Fig. 14B.

[0099] In another embodiment, during template-matching cost calculation, either spatial weighting or distance weighting is used in template-matching-based boundary sample generation as shown in the example of Fig. 15.

[0100] In another embodiment, both spatial weighting and distance weighting are used in template-matching-based boundary sample generation as shown in the example of Fig. 15.

[0101] In another embodiment, because the template region is reversed compared to the template location in inter-prediction, either reversed spatial weighting or reversed distance weighting is used in template-matching-based boundary sample generation.

[0102] In another embodiment, because the template region is reversed compared to template location in inter-prediction, both reversed spatial weighting and reversed distance weighting are used in template-matching-based boundary sample generation.

[0103] Example 1-3: Adaptive cost metric

[0104] In one embodiment, SATD, SAD, or SSE cost metric can be adaptively selected when performing template-matching-based picture boundary padding. The selected cost metric is implicitly inferred.

[0105] In another embodiment, SATD, SAD, or SSE cost metric can be adaptively selected when performing template-matching-based picture boundary padding. The selected cost metric is signalled per picture, per boundary, per CTU, or per block.

[0106] Example 1-4: Picture corner handling

[0107] In one embodiment, for picture corner padding, instead of using rectangular shape for template-matching, a square template is utilized. For example, an MxM template can be used, where M is larger than 0.

[0108] Example 1-5: Template-matching search range in boundary padding and inter-prediction

[0109] In one embodiment, the template-matching search range in boundary padding and inter-prediction are unified. That is, instead of using L1 distance in boundary padding search range, regular inter-prediction template-matching search range is used.

[0110] In another embodiment, the template-matching search range in boundary padding and inter-prediction are unified. That is, L1 distance search range is used in regular inter-prediction template-matching search range.

[0111] In another embodiment, in template-matching-based picture boundary padding, fractional-pel template-matching search is also supported. That is, padding samples may come from the fractional samples from template-matching search.

[0112] Example 1-6: Template-matching-based padding samples generation in block reconstruction stage

[0113] In one embodiment, the template-matching-based padding samples are generated together at block reconstruction stage. That is, when reconstructing blocks at the picture boundary, template-matching is further performed to generate extra padding samples along with reconstructed samples.

[0114] In another embodiment, the template-matching-based padding samples are generated before the in-loop filtering stage.

[0115] In another embodiment, after template-matching-based padding samples are generated in block reconstruction stage, the in-loop filter will be performed at both inside picture samples and padded samples to avoid discontinuity between these two kinds of samples.

[0116] In another embodiment, some DC offset terms may be added to template-matching-based padding samples to adjust the luminance or chrominance different between inside boundary samples and padded samples.

[0117] In another embodiment, when some DC offset terms are added to template-matching-based padding samples, reconstruction samples in the sample reconstruction stage, CU reconstruction stage, or before any in-loop filtering is used in offset terms computation.

[0118] In another embodiment, when some DC offset terms are added to template-matching-based padding samples, the offset term is calculated in sample reconstruction stage or CU reconstruction stage or before any in-loop filtering is performed, instead of after loop filtering.

[0119] Picture Boundary Padding Using Inherited Information

[0120] In existing motion compensated picture boundary padding, partial motion information from boundary blocks will be used to generate padding samples. For example, when boundary block is bi-predicted, only one of the motion vectors will be used to locate reference block and to generate padding samples. However, partial motion information cannot be adequate to provide accurate reference data and may fail to generate meaningful boundary padding samples. Thus, it is proposed to inherit motion information, boundary information, prediction information, or boundary parameters from one or more boundary blocks when performing padding sample generation using intra prediction based method, inter prediction based method, block vector based prediction method, or template matching based prediction method. Intra prediction based method can use intra prediction angle to generate padding samples, wherein intra prediction angle is derived according to some methods, such as conventional intra prediction search or decoder-side derived intra prediction methods. Inter prediction based method and template matching based method can use the inter motion vector to generate padding samples from a reference block, wherein the inter motion vector is derived according to some methods, such as signalling or template matching search. Block vector based method can use block vector to generate padding samples from a reference block, wherein block vector is derived according to some methods, such as signalling or template matching.

[0121] Example 2-1: Boundary information / prediction information / boundary parameter inheritance for intra predicted boundary block

[0122] When a boundary block is intra predicted, the intra prediction information or intra prediction parameters of the boundary block can be partially or fully utilized to generate its boundary padding samples.

[0123] In one embodiment, intra prediction boundary parameters in padding samples generation can be inherited from or be partially the same as the boundary block. For example, intra prediction parameters including, but not limited to, intra prediction angle, PDPC, mode dependent intra smoothing, multi-reference line index, ISP, and template based MRL. Intra prediction angle or reference samples can be reversed depending on the picture boundary position.

[0124] In another embodiment, intra prediction information in padding samples generation can be inherited from or be partially the same as the boundary block. For intra prediction information may include, but not limited to, MIP, TIMD, DIMD, OBIC, intra prediction fusion, fusion of chroma intra prediction, PDP, CCP, CCCM, BVGCCCM, GLM, extended MRL, EIP, DIP, SGPM, etc.

[0125] In another embodiment, luminance compensation offset or chrominance compensation offset can be derived using the information of the boundary block before the loop filtering process.

[0126] In one example, intra prediction angle from the boundary block can be inherited to generate padding samples, as shown in Fig. 16.

[0127] In another example, intra prediction angle from boundary block derived from TIMD can be inherited to generate padding samples, as shown in Fig. 17. The inherited intra prediction angle can be reversed depending on the location of picture boundary. For example, the angle can be reversed when padding samples are located at the top picture boundary.

[0128] In another example, the number of reference lines and selected reference lines can be inherited to generate padding samples.

[0129] In another example, CCP model, CCCM model, EIP model, or DIP model at boundary blocks can be inherited to generate padding samples.

[0130] Example 2-2: Boundary information / prediction information / boundary parameter / prediction information inheritance for inter predicted boundary block

[0131] In one embodiment, inter prediction boundary parameters in padding samples generation can be inherited or be partially the same as the boundary block. For example, inter prediction parameters may include, but not limited to, motion vectors, prediction direction interDir, uni-prediction or bi-prediction, BCW index, DMVR flag, BDOF flag, merge index, OBMC flag, interpolation filter flag or interpolation filter index or interpolation filter type, LIC flag, etc.

[0132] In another embodiment, intra prediction information in padding samples generation can be inherited from or be partially the same as the boundary block. For inter prediction information may include, but not limited to, MHP flag, GPM flag, affine flag, and subblock mode flag.

[0133] In another embodiment, luminance compensation offset or chrominance compensation offset can be derived using the information of boundary block before the loop filtering process.

[0134] In one example, both L0 motion vector and L1 motion vector at boundary block can be inherited to generate padding samples, as shown in Fig. 18.

[0135] In another example, the interpolation filter used at the boundary block can be inherited to generate padding samples. For instance, a 12-tap interpolation filter can be used at the boundary block, and the same 12-tap interpolation filter can also be used to generate padding samples.

[0136] In another example, LIC model or LIC parameters at the boundary block can be inherited to generate padding samples.

[0137] In another example, affine models or affine parameters at the boundary block can be inherited to generate padding samples.

[0138] In another example, GPM partition angle at the boundary block can be inherited to generate padding samples.

[0139] Example 2-3: Boundary information / prediction information / prediction information / boundary parameter inheritance for template matching predicted boundary block

[0140] In one embodiment, template matching boundary parameters or template matching prediction information in padding samples generation can be inherited from or be partially the same as the boundary block. For example, the template matching search pattern, weightings on template, template matching prediction mode, motion shift from template matching, interpolation filter type or interpolation filter index can be inherited.

[0141] In another embodiment, the luminance compensation offset or chrominance compensation offset can be derived using the information of boundary block before the loop filtering process.

[0142] In one example, the motion shift from the template matching search from the boundary block can be inherited in padding samples generation, as shown in Fig. 19.

[0143] In another example, the interpolation filter used at the boundary block template matching search can be inherited in padding samples generation.

[0144] Example 2-4: Boundary information / prediction information / prediction information / boundary parameter inheritance for IBC or IntraTMP predicted boundary block

[0145] In one embodiment, IntraTMP (Intra Template Matching Prediction) boundary parameters or IntraTMP prediction information in padding samples generation can be inherited from or be partially the same as the boundary block. For example, IntraTMP boundary parameters or prediction information may include, but not limited to, block vector, interpolation filter flag or interpolation filter index or interpolation filter type, predictor fusion flag, LIC flag, BVP type or BVP flag.

[0146] In another embodiment, IBC (Intra Block Copy) boundary parameters or IBC prediction information in padding samples generation can be inherited form or be partially the same as the boundary block. For IBC boundary parameters or IBC prediction information may include, but not limited to, IBC merge index, TM merge flag, MBVD merge index, IBC filtering flag, IBC-CIIP flag, IBC-LIC flag, IBC-GPM flag, bi-prediction IBC flag, RRIBC flag, chroma DBV mode flag.

[0147] In another embodiment, the luminance compensation offset or chrominance compensation offset can be derived using boundary block’s information before the loop filtering process.

[0148] In one example, the block vector from IBC or IntraTMP coded boundary block can be inherited in padding samples generation.

[0149] In another example, LIC flag or LIC models or LIC parameters from IBC or IntraTMP coded boundary block can be inherited in padding samples generation.

[0150] In another example, GPM partition angle or one or more GPM partition block vector from IBC or IntraTMP coded boundary block can be inherited in padding samples generation.

[0151] In another example, reconstruction-reorder (RR) flag at the boundary block can be inherited in padding samples generation.

[0152] Any of the foregoing proposed methods can be implemented in encoders and / or decoders. For example, any of the proposed methods can be implemented in the predictor derivation module of an encoder, and / or a predictor derivation module of a decoder. Alternatively, any of the proposed methods can be implemented as a circuit coupled to the predictor derivation module of the encoder and / or the predictor derivation module of the decoder, so as to provide the information needed by the predictor derivation module.

[0153] Any of the foregoing proposed sample padding methods for picture boundary pixels can be implemented in encoders and / or decoders. For example, any of the proposed sample padding methods can be implemented in the predictor derivation module (e.g. Inter pred. 112 and / or Intra Pred. 110 in Fig. 1A) and reconstruction stage (e.g. REC 128 in Fig. 1A) of an encoder, and / or a predictor derivation module (e.g. MC 152 and / or Intra Pred. 150 in Fig. 1B) and reconstruction stage (e.g. REC 128 in Fig. 1A) of a decoder. Alternatively, any of the proposed methods can be implemented as a circuit coupled to the predictor derivation module and reconstruction stage of the encoder and / or the predictor derivation module and reconstruction stage of the decoder, so as to provide the information needed by the predictor derivation module. The padding methods may also be implemented using executable software or firmware codes stored on a media, such as hard disk or flash memory, for a CPU (Central Processing Unit) or programmable devices (e.g. DSP (Digital Signal Processor) or FPGA (Field Programmable Gate Array) ) .

[0154] Fig. 20 illustrates a flowchart of an exemplary video coding system that generates template-matching-based padding samples during the reconstruction stage or before the in-loop filtering stage according to an embodiment of the present invention. The steps shown in the flowchart may be implemented as program codes executable on one or more processors (e.g., one or more CPUs) at the encoder side. The steps shown in the flowchart may also be implemented based hardware such as one or more electronic devices or processors arranged to perform the steps in the flowchart. According to the method, input data associated with a current picture is received in step 2010. For a target block outside a boundary of the current picture, a source block in a reference picture is located by using template matching in step 2020, wherein a target template adjacent to the target block in the current picture is matched with template candidates in the reference picture according to template matching costs, and the source block is located according to a best-matched template candidate. Padding data is generated for the target block based on reconstructed data of the source block in step 2030, wherein said generating padding data is performed during block reconstruction stage of the current picture or before an in-loop filtering process of the current picture. A boundary-extended current picture is provided by adding the padding data to the current picture in step 2040.

[0155] The flowchart shown is intended to illustrate an example of video coding according to the present invention. A person skilled in the art may modify each step, re-arranges the steps, split a step, or combine steps to practice the present invention without departing from the spirit of the present invention. In the disclosure, specific syntax and semantics have been used to illustrate examples to implement embodiments of the present invention. A skilled person may practice the present invention by substituting the syntax and semantics with equivalent syntax and semantics without departing from the spirit of the present invention.

[0156] The above description is presented to enable a person of ordinary skill in the art to practice the present invention as provided in the context of a particular application and its requirement. Various modifications to the described embodiments will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed. In the above detailed description, various specific details are illustrated in order to provide a thorough understanding of the present invention. Nevertheless, it will be understood by those skilled in the art that the present invention may be practiced.

[0157] Embodiment of the present invention as described above may be implemented in various hardware, software codes, or a combination of both. For example, an embodiment of the present invention can be one or more circuit circuits integrated into a video compression chip or program code integrated into video compression software to perform the processing described herein. An embodiment of the present invention may also be program code to be executed on a Digital Signal Processor (DSP) to perform the processing described herein. The invention may also involve a number of functions to be performed by a computer processor, a digital signal processor, a microprocessor, or field programmable gate array (FPGA) . These processors can be configured to perform particular tasks according to the invention, by executing machine-readable software code or firmware code that defines the particular methods embodied by the invention. The software code or firmware code may be developed in different programming languages and different formats or styles. The software code may also be compiled for different target platforms. However, different code formats, styles and languages of software codes and other means of configuring code to perform the tasks in accordance with the invention will not depart from the spirit and scope of the invention.

[0158] The invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described examples are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.

Claims

1.A method of video coding, the method comprising:receiving input data associated with a current picture;for a target block outside a boundary of the current picture, locating a source block in a reference picture by using template matching, wherein a target template adjacent to the target block in the current picture is matched with template candidates in the reference picture according to template matching costs, and the source block is located according to a best-matched template candidate;generating padding data for the target block based on reconstructed data of the source block, wherein said generating padding data is performed during block reconstruction stage of the current picture or before an in-loop filtering process of the current picture; andproviding a boundary-extended current picture by adding the padding data to the current picture.2.The method of Claim 1, wherein the in-loop filtering process is performed at both current picture samples and padded current picture samples at a corresponding picture boundary.3.The method of Claim 1, wherein the current picture is coded in an inter-prediction mode.4.The method of Claim 1, wherein the current picture is coded in an IBC (Intra Block Copy) or IntraTMP (Intra Template Matching Prediction) mode.5.The method of Claim 1, wherein cost metric for the template matching costs comprises SATD, SAD, or SSE.6.The method of Claim 5, wherein the cost metric is determined adaptively.7.The method of Claim 5, wherein the cost metric is determined explicitly by signalling.8.The method of Claim 5, wherein the cost metric is determined implicitly.9.The method of Claim 1, wherein different weightings for the template matching costs are used for template samples inside the target template and a corresponding template candidate.10.The method of Claim 9, wherein the template samples closer to the target block are assigned larger weightings and the template samples farther away from the target block are assigned smaller weightings.11.An apparatus for video coding, the apparatus comprising one or more electronics or processors arranged to:receive input data associated with a current picture;for a target block outside a boundary of the current picture, locate a source block in a reference picture by using template matching, wherein a target template adjacent to the target block in the current picture is matched with template candidates in the reference picture according to template matching costs, and the source block is located according to a best-matched template candidate;generate padding data for the target block based on reconstructed data of the source block, wherein the padding data is generated during block reconstruction stage of the current picture or before an in-loop filtering process of the current picture; andprovide a boundary-extended current picture by adding the padding data to the current picture.

Citation Information

Patent Citations

  • Partial reconstruction based template matching for motion vector derivation

    CN110915214A

  • Video signal processing method and apparatus using adaptive motion vector resolution

    CN112237001A

  • Refining candidate selection using template matching

    CN117837145A

  • Motion compensated boundary pixel padding

    US20190082193A1

  • Method and apparatus for picture padding in video coding

    WO2024017061A1