Video decoding method, video encoding method, and electronic device

CN123020807APending Publication Date: 2026-10-30ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510571980.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]然而,当前Merge模式在构造MVP候选列表的过程中,仅从几个固定的位置进行空域相邻候选的选择,但由于图像内容具有复杂性和多样性,当前这种简单的MVP候选列表构造方式可能达不到较好的MVP预测精度和效果,容易影响Merge模式的编码性能,造成视频编码效率降低,从而容易导致视频解码性能未达理想状态

Benefits of technology

[0014]本申请实施例中,首先,接收包括Merge模式的候选索引的视频码流;然后,确定当前帧中当前解码块的目标相邻位置块的可用性,当目标相邻位置块的可用性为不可用,对目标相邻位置块进行扩展,得到目标相邻位置块的扩展相邻块,并根据扩展相邻块构造MVP候选列表;接着,根据候选索引从MVP候选列表内取出当前解码块对应的目标MVP候选,并根据取出的目标MVP候选对当前解码块进行解码。由于本申请实施例在解码端采用了上述过程进行解码,因此可以使得编码端在采用对应的编码方法进行编码时,能够通过扩展空域相邻候选,从而能够从更多的空域相邻位置选择更为合适的MVP候选,进而能够进一步提高MVP预测精度,达到提高编码效率的目的。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020807A_ABST
    Figure CN123020807A_ABST
Patent Text Reader

Abstract

The application provides a video decoding method, a video encoding method and an electronic device. The decoding method comprises the following steps: receiving a video code stream comprising a candidate index of a Merge mode; determining the availability of a target neighboring position block of a current decoding block in a current frame; when the availability of the target neighboring position block is unavailable, expanding the target neighboring position block to obtain an expanded neighboring block of the target neighboring position block, and constructing an MVP candidate list according to the expanded neighboring block; then, taking out a target MVP candidate corresponding to the current decoding block from the MVP candidate list according to the candidate index, and decoding the current decoding block according to the target MVP candidate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this application relate to, but are not limited to, the field of image processing technology, and in particular to a video decoding method, a video encoding method, and an electronic device. Background Technology

[0002] Merge mode is a technique used for inter-frame prediction in video encoding and decoding. It directly predicts the motion vector (MV) of the current block by utilizing motion information from adjacent blocks in the spatial and temporal domains. It eliminates the need for motion vector difference (MVD) and the transmission of MVD and reference frame indexes, thus reducing the amount of data required for encoding. The encoder and decoder use the same method to construct a candidate list of motion vector prediction (MVP). The encoder selects the optimal MV index from the MVP candidate list using a rate-distortion criterion and transmits this index to the decoder.

[0003] However, the current Merge mode selects spatially adjacent candidates from only a few fixed positions during the construction of the MVP candidate list. Due to the complexity and diversity of image content, this simple method of constructing the MVP candidate list may not achieve good MVP prediction accuracy and effect, which may affect the coding performance of the Merge mode, reduce video coding efficiency, and thus easily lead to the video decoding performance not reaching the ideal state. Summary of the Invention

[0004] This application provides a video decoding method, a video encoding method, and an electronic device.

[0005] On one hand, embodiments of this application provide a video decoding method, including: receiving a video stream, the video stream including candidate indices of a Merge mode; determining the availability of a target adjacent position block of a current decoding block in the current frame; in response to the availability of the target adjacent position block being unavailable, expanding the target adjacent position block to obtain an expanded adjacent block of the target adjacent position block, and constructing an MVP candidate list based on the expanded adjacent block; retrieving a target MVP candidate corresponding to the current decoding block from the MVP candidate list according to the candidate index, and decoding the current decoding block based on the retrieved target MVP candidate.

[0006] On the other hand, embodiments of this application also provide a video coding method, including: determining the availability of a target adjacent position block in a current coding block of a video frame; in response to the availability of the target adjacent position block being unavailable, expanding the target adjacent position block to obtain an expanded adjacent block, and constructing an MVP candidate list based on the expanded adjacent block; performing rate-distortion-based cost calculation on each MVP candidate in the MVP candidate list to obtain an optimized cost for each MVP candidate in the MVP candidate list; encoding the current coding block based on the Merge mode according to the MVP candidate with the minimum optimized cost, and encoding the candidate index of the MVP candidate with the minimum optimized cost into the video bitstream and transmitting it to the decoding end.

[0007] On the other hand, embodiments of this application also provide an electronic device, including: at least one processor; at least one memory for storing at least one program; when at least one of the programs is executed by at least one of the processors, it implements the video decoding method described above, or implements the video encoding method described above.

[0008] On the other hand, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions, characterized in that the computer-executable instructions are used to execute the video decoding method described above, or to execute the video encoding method described above.

[0009] On the other hand, embodiments of this application also provide a computer program product, including a computer program or computer instructions, wherein the computer program or computer instructions are stored in a computer-readable storage medium, a processor of an electronic device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions to cause the electronic device to perform the video decoding method as described above, or to perform the video encoding method as described above.

[0010] On the other hand, embodiments of this application also provide a computer-readable storage medium for storing a video stream, the video stream including identification information, the identification information including at least one of the following: expansion control identification information, used to indicate whether to expand the target adjacent location block when the availability of the target adjacent location block is unavailable; expansion mode control identification information, used to indicate whether to expand all the target adjacent location blocks or expand some of the target adjacent location blocks when the expansion control identification indicates that the target adjacent location block is unavailable.

[0011] On the other hand, embodiments of this application also provide a method or apparatus for storing and / or transmitting video streams, wherein the video streams include the identification information described above.

[0012] On the other hand, embodiments of this application also provide a method or apparatus for receiving and / or storing video streams, wherein the video streams include the identification information described above.

[0013] On the other hand, embodiments of this application also provide a computer program product storing computer-executable instructions, which, when executed by the processor of an electronic device, cause the electronic device to store, send, or receive a video stream, the video stream including the identification information described above.

[0014] In this embodiment, firstly, a video bitstream including candidate indices of the Merge mode is received; then, the availability of the target adjacent position block of the current decoding block in the current frame is determined. If the availability of the target adjacent position block is unavailable, the target adjacent position block is expanded to obtain an expanded adjacent block, and an MVP candidate list is constructed based on the expanded adjacent block; next, the target MVP candidate corresponding to the current decoding block is retrieved from the MVP candidate list according to the candidate index, and the current decoding block is decoded based on the retrieved target MVP candidate. Since this embodiment uses the above process for decoding at the decoding end, the encoding end can select more suitable MVP candidates from more spatial adjacent positions by expanding the spatial adjacent candidates when using the corresponding encoding method, thereby further improving the MVP prediction accuracy and achieving the purpose of improving encoding efficiency. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the current next-generation video coding standard H.266 / VVC coding framework;

[0016] Figure 2 This is a schematic diagram of the decoding framework of the current generation video coding standard H.266 / VVC;

[0017] Figure 3 This is a schematic diagram illustrating the process of constructing spatial adjacency candidates in the Merge pattern;

[0018] Figures 4A to 4B This is a schematic diagram illustrating the process of constructing temporal candidates using the Merge pattern;

[0019] Figure 5 This is a schematic diagram illustrating the process of constructing non-adjacent candidates in the spatial domain using the Merge pattern.

[0020] Figure 6 This is a schematic diagram illustrating the process of constructing crossover candidates using the Merge pattern;

[0021] Figures 7A to 7B This is a schematic diagram illustrating the process of constructing a chain of candidates using the Merge pattern;

[0022] Figure 8 This is a schematic diagram of the system architecture for a video transmission scenario provided in one embodiment of this application;

[0023] Figure 9 This is a flowchart of a video decoding method provided in one embodiment of this application;

[0024] Figure 10A This is a schematic diagram illustrating the expansion of a target adjacent location block according to an embodiment of this application;

[0025] Figure 10B This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0026] Figure 10C This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0027] Figure 10D This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0028] Figure 10E This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0029] Figure 10F This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0030] Figure 10G This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0031] Figure 10H This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0032] Figure 10I This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0033] Figure 10J This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0034] Figure 10K This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0035] Figure 10L This is a schematic diagram illustrating the expansion of a target adjacent location block according to another embodiment of this application;

[0036] Figure 11 This is a flowchart of a video encoding method provided in one embodiment of this application;

[0037] Figure 12 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0038] To make the objectives, technical methods, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0039] It should be noted that although the flowchart shows a logical order, in some cases, the steps shown or described may be executed in a different order than that shown in the flowchart. In the description of the specification, claims, and the above-mentioned figures, "multiple" means two or more; "greater than," "less than," and "exceeding" are understood to exclude the stated number; "above," "below," and "within" are understood to include the stated number. The use of terms such as "first" and "second" is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly specifying the number of indicated technical features or their sequential relationship. Furthermore, in the description of the specification, claims, and the above-mentioned figures, the various values ​​mentioned (such as first value, second value, etc.) can be flexibly represented as single numeric codes or enumerated type values. These values ​​can clearly guide and control the execution flow and behavior patterns of various functional modules, ensuring the efficiency of decoding or encoding.

[0040] Reference Figure 1 As shown, Figure 1 This is a schematic diagram of the H.266 / VVC coding framework, a new generation video coding standard developed by the ITU-T and ISO / IEC joint video project. This coding framework includes modules such as intra-frame prediction, inter-frame prediction, transform, quantization, loop filtering, and entropy coding. The processing flow of this coding framework includes the following steps:

[0041] (1) The input video is first divided into frames and then into blocks;

[0042] (2) The divided blocks are sent to the intra-frame / inter-frame prediction module for predictive coding. The intra-frame prediction module is mainly used to remove spatial correlations in the image; the inter-frame prediction module is mainly used to remove temporal correlations in the image.

[0043] (3) Subtract the predicted value from the original block to obtain the residual value, and then transform and quantize the residual to remove frequency domain correlation and perform lossy compression on the data.

[0044] (4) Finally, all the encoding parameters and residuals are entropy encoded to form a binary stream for storage or transmission. The output data of the entropy encoding module is the original video compressed bitstream.

[0045] (5) The predicted value and the residual after inverse quantization and inverse transformation are added together to obtain the block reconstruction value, and finally the reconstructed image is formed;

[0046] (6) The reconstructed image is filtered by a loop filter and stored in the image buffer as a reference image for the future.

[0047] Reference Figure 2 As shown, Figure 2 This is a schematic diagram of the current generation video coding standard H.266 / VVC decoding framework. The processing flow of this decoding framework includes the following steps:

[0048] (1) Parse the bitstream to obtain the prediction pattern and get the prediction value;

[0049] (2) Perform inverse transformation and inverse quantization on the residual obtained from the code stream parsing;

[0050] (3) The predicted value and the residual after inverse quantization and inverse transformation are added together to obtain the block reconstruction value, and finally the reconstructed image is formed;

[0051] (4) The reconstructed image is filtered by a loop filter and stored in the image buffer as a reference image for the future.

[0052] The Merge candidate list is constructed in the following order: Adjacent Spatial Motion Vector Prediction (AMVP), Temporal Motion Vector Prediction (TMVP), Non-Adjacent Spatial Motion Vector Prediction (NAMVP), History-based Motion Vector Prediction (HMVP), Intersecting bi-TMVP, Chained Motion Vector Prediction (CMVP), Pairwise-Average Motion Vector Prediction, Affine HMVP, Additional CMVP, and Zero Candidate. This indicates that Adjacent Spatial Motion Vector Prediction is constructed first, making it the most important type of MVP candidate in the Merge model, and its performance directly determines the MVP prediction accuracy of the Merge model.

[0053] Reference Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the process of constructing spatial neighbor candidates in the Merge pattern. The process of constructing spatial neighbor candidates in the Merge pattern includes the following steps:

[0054] (1) First, iterate through each candidate in the order of position A (upper adjacent position), position L (left adjacent position), position AR (upper right adjacent position), and position BL (lower left adjacent position), selecting as many candidates as available. First, iterate through position A. When a candidate at position A is available, select the candidate at position A as one of the candidates for the Merge pattern's spatial adjacent position. Then, iterate through position L. When a candidate at position L is available, select the candidate at position L as one of the candidates for the Merge pattern's spatial adjacent position. Next, iterate through position AR. When a candidate at position AR is available, select the candidate at position AR as one of the candidates for the Merge pattern's spatial adjacent position. Finally, iterate through position BL. When a candidate at position BL is available, select the candidate at position BL as one of the candidates for the Merge pattern's spatial adjacent position.

[0055] (2) The decision to continue traversing the AL position is based on the number of available candidates. The AL position is only traversed if the number of available candidates is less than 4. If the number of available candidates is less than 4, the AL position is traversed. When a candidate at the AL position is available, the candidate at the AL position is selected as one of the candidates for spatial adjacency in the Merge mode. It is worth noting that the maximum number of spatial adjacency candidates selected in the end is limited to 4.

[0056] Reference Figure 4A and Figure 4B As shown, Figure 4A and Figure 4B This is a schematic diagram illustrating the process of constructing temporal candidates in Merge mode. Temporal candidates are constructed using the motion information of corresponding blocks (i.e., co-occurring blocks) in neighboring encoded images (corresponding images). The co-occurring image is generally the frame closest to the current frame in the reference frame list; therefore, the co-occurring image of the current frame may overlap with the reference image of the current frame. Temporal candidates are obtained by scaling the MV (Motion Motion) of the co-occurring block at the lower right corner (RB position) or the center (CT position) of the current block. For example... Figure 4A As shown, Cur_PU represents the current block, Col_PU is its co-located block, T_Cur represents the temporal distance between the current image Cur_pic and its reference image Cur_ref, and T_Col represents the temporal distance between the co-located image Col_pic and its reference image Col_ref. The temporal candidate of the current block can then be calculated using the following formula:

[0057]

[0058] Additionally, the bottom right corner and center position of the current block are as follows: Figure 4B As shown above, temporal candidates cannot directly use the MV of the co-located block; instead, they need to be scaled and adjusted proportionally based on the positional relationship between the co-located image of the current image and the reference image.

[0059] Reference Figure 5 As shown, Figure 5 This is a schematic diagram illustrating the process of constructing non-adjacent spatial candidates using the Merge pattern. (Example) Figure 5 As shown, spatially non-adjacent candidates are located after temporal motion vector prediction, and the distance between spatially non-adjacent candidates and the current coding block is based on the width and height of the current coding block.

[0060] Historical candidates are generated from a FIFO (First-In, First-Out) table, which is constructed using motion information from historically coded blocks. Each time an inter-coded block is encountered, its associated motion information is added to the last entry of this table, becoming a new historical candidate. This table is reset (cleared) each time a new CTU (Continuous Tuning Unit) is reached.

[0061] Reference Figure 6 As shown, Figure 6 This is a schematic diagram illustrating the process of constructing crossover candidates using the Merge pattern. For example... Figure 6 As shown, if the motion trajectory of a block in the reference image and the reference block crosses the current block, a bidirectional temporal motion vector prediction (bi-TMVP) candidate (i.e., a cross candidate, such as...) is added after the historical candidate. Figure 6 (See MV0 and MV1). For a given motion vector (MV), which is the motion vector of a reference block, a pair of MV0 and MV1 are constructed from this vector. If the motion trajectory of this pair of vectors passes through the current block, then these motion vectors will be used as bi-TMVP.

[0062] Reference Figure 7A As shown, Figure 7A This is a schematic diagram illustrating the process of constructing a chain of candidates using the Merge pattern. For example... Figure 7A As shown, a bootstrap block vector MVL0 k(0) (That is, the block vector MVP that already exists in the candidate list) is associated with the current block CurBlk and points to a reference block RefBlk0. If RefBlk0 has a block vector BV k(0) BV k(0) Point to another reference block RefBlk1 if RefBlk1 has a block vector MVL0 k(1) By analogy, we can define a chain of candidate MVL0s for the current block. k / m This candidate is called a chain candidate, generated by MVL0. k(0) Guidance. In deriving MVL0 k / m At times, such as Figure 7B As shown, it checks five positions in the current image: top-left (LT), top-right (RT), center (Ctr), bottom-left (LB), and bottom-right (RB).

[0063] Pairwise averaging of candidates refers to calculating the average value of existing candidates in the Merge candidate list according to a predefined grouping relationship. The predefined grouping relationship is {(0,1), (0,2), (1,2), (0,3), (1,3), (2,3)}, where the numbers represent the indices of the candidates in the Merge candidate list. The L0 and L1 average vectors are calculated separately. If two vectors are valid in a certain list, their average is calculated even if they point to different reference images. If only one vector is valid in a certain list, it is used directly. If a list has no valid motion vectors, that list is invalid.

[0064] Affine historical candidates are similar to historical candidates, except that the candidate prediction pattern is an affine pattern.

[0065] Supplementary CMVP candidates are placed before zero candidates as a supplement to the CMVP candidates.

[0066] Candidates with a zero candidate motion vector of 0 are placed at the end of the Merge candidate list. If the candidate list is not full after the candidates before the zero candidate have been filled, the zero candidate is used to fill the list until it is full.

[0067] In constructing the MVP candidate list, the Merge mode only selects spatially adjacent candidates from a few fixed positions. However, due to the complexity and diversity of image content, this simple method of constructing the MVP candidate list may not achieve good MVP prediction accuracy and effect, which may affect the coding performance of the Merge mode, reduce video coding efficiency, and thus easily lead to the video decoding performance not reaching the ideal state.

[0068] In view of the above, embodiments of this application provide a video decoding method, a video encoding method, an electronic device, a computer-readable storage medium, and a computer program product. First, a video bitstream including candidate indices of a merge mode is received. Then, the availability of the target adjacent position block of the current decoding block in the current frame is determined. If the availability of the target adjacent position block is unavailable, the target adjacent position block is expanded to obtain an expanded adjacent block, and an MVP candidate list is constructed based on the expanded adjacent block. Next, the target MVP candidate corresponding to the current decoding block is retrieved from the MVP candidate list according to the candidate index, and the current decoding block is decoded based on the retrieved target MVP candidate. Since embodiments of this application employ the above process for decoding at the decoding end, the encoding end, when using the corresponding encoding method, can select more suitable MVP candidates from more spatially adjacent positions by expanding the spatially adjacent candidates, thereby further improving MVP prediction accuracy and achieving the goal of improving encoding efficiency.

[0069] The technical solutions of this application embodiment can be applied to H.266 / VVC standards, Audio Video Coding Standards (AVS), such as AVS3, or next-generation video codec standards. This application embodiment does not limit this application.

[0070] Based on the above analysis, the embodiments of this application will be further described below with reference to the accompanying drawings.

[0071] Figure 8 This is a schematic diagram of the system architecture for a video transmission scenario provided in one embodiment of this application. For example... Figure 8 As shown, this scenario includes a terminal 810 and a server 820. The terminal 810 or server 820 can encode video using an encoder or decode video using a decoder. Alternatively, the terminal 810 or server 820 can run a video encoding program via a processor or a video decoding program via a processor. After receiving encoded data from the terminal 810 through its input interface, the server 820 can either directly transmit it to the processor for decoding or store it in a database for later decoding. After obtaining encoded data by encoding the original video frames through the processor, the server 820 can either directly send it to the terminal 810 through its output interface or store the encoded data in a database for later transmission.

[0072] The decoding method can be completed in either terminal 810 or server 820. Terminal 810 can encode the input video stream and send the encoded data to server 820, or it can receive the encoded data from server 820, decode it, and generate a decoded video stream. Server 820 can encode video frames; in this case, the encoding method is completed on server 820. If server 820 needs to decode the encoded data, the decoding method is also completed on server 820. Of course, after receiving the encoded data sent by terminal 810, server 820 can send the encoded data to the corresponding receiving terminal for decoding. It is understood that the encoding end and the decoding end can be the same end or different ends. The aforementioned computer equipment, such as a terminal or server, can be either an encoding end or a decoding end. Terminal 810 and server 820 are connected via a network. In this embodiment, terminal 810 can be a device related to image and video playback, such as: mobile phone, tablet computer, computer, laptop computer, wearable device, in-vehicle device, liquid crystal display, cathode ray tube display, holographic imaging display, or projection, etc., and this embodiment is not limited to these. Server 820 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0073] Reference Figure 9 , Figure 9This is a flowchart of a video decoding method provided in one embodiment of this application. The decoding method may include, but is not limited to, steps S910 to S940.

[0074] Step S910: Receive the video stream, which includes candidate indices for the Merge pattern;

[0075] Step S920: Determine the availability of the target adjacent position block of the current decoded block in the current frame;

[0076] Step S930: In response to the unavailability of the target adjacent location block, the target adjacent location block is expanded to obtain the expanded adjacent block of the target adjacent location block, and an MVP candidate list is constructed based on the expanded adjacent block.

[0077] Step S940: Retrieve the target MVP candidate corresponding to the current decoding block from the MVP candidate list according to the candidate index, and decode the current decoding block according to the retrieved target MVP candidate.

[0078] For example, a video bitstream refers to the binary data stream generated during video encoding, after the original video signal has undergone a series of encoding processes (such as prediction, transform, quantization, entropy coding, etc.). This data stream contains all the information of the video, such as pixel values, motion information, and encoding mode, to facilitate transmission over a network or storage on a storage device. In video encoding, motion compensation can be used to reduce redundant information between video frames.

[0079] It's important to note that video streams can be either block-level or frame-level. A block-level stream is generated by dividing a video frame into multiple smaller blocks and encoding each block individually. In modern video coding standards, video frames are typically divided into fixed-size or variable-size coding blocks, such as coding tree units (CTUs) and their further subdivisions like coding units (CUs), prediction units (PUs), and transform units (TUs). Each coding block has independent coding parameters and information, such as motion vectors, quantization parameters, and coding modes. These combined information constitute the block-level stream. A frame-level stream, on the other hand, is obtained by uniformly encoding the entire video frame. In this approach, the encoding process considers the statistical characteristics and motion information of the entire frame, assigning uniform coding parameters to the entire frame. The frame-level stream contains the image data, motion information, and other relevant coding information for the entire frame.

[0080] For example, in Merge mode, to find suitable motion vector prediction values, an MVP candidate list is typically constructed, containing multiple possible motion vector prediction values. A candidate index is a number pointing to a specific candidate in this MVP candidate list. When encoding a video block using Merge mode, the MVP candidate that best matches the current block is selected from the MVP candidate list, and its index value in the MVP candidate list (i.e., the candidate index) is encoded into the video stream. After receiving the video stream, the decoder can retrieve the corresponding motion vector prediction value from its own constructed MVP candidate list based on this candidate index, reconstruct the true motion vector of the current block, and thus complete the decoding of the video block.

[0081] For example, when determining the availability of the target neighbor block of the current decoded block in the current frame, the availability of the target neighbor block can be determined to be unavailable if the target neighbor block of the current decoded block in the current frame satisfies at least one of the following conditions:

[0082] The target's adjacent blocks do not exist;

[0083] The prediction mode for adjacent blocks of the target is non-inter-frame mode;

[0084] The prediction mode for adjacent blocks of the target is intra-frame prediction mode and not template matching prediction mode;

[0085] The target's adjacent location block and the current decoded block belong to the same motion estimation region;

[0086] The target adjacent block and the current decoded block belong to the same decoding unit;

[0087] The motion vectors of the target's adjacent blocks overlap with those of the MVP candidates in the MVP candidate list.

[0088] It should be noted that if none of the adjacent blocks of the target satisfy all of the above conditions, then the availability of the adjacent blocks of the target can be considered as available.

[0089] For example, the target adjacent position block may include at least one of the following: left adjacent position block, bottom left adjacent position block, top adjacent position block, top right adjacent position block, and top left adjacent position block. Specifically, for the Merge pattern, the target adjacent position block may include at least one of the following five: L position block (i.e., left adjacent position block), BL position block (i.e., bottom left adjacent position block), A position block (i.e., top adjacent position block), AR position block (i.e., top right adjacent position block), and AL position block (i.e., top left adjacent position block).

[0090] For example, in determining the availability of the target neighboring position block of the current decoded block in the current frame, the availability of the target neighboring position block of the current decoded block in the current frame can be determined according to a preset traversal order. For example, for Merge mode, the availability of these position blocks can be traversed sequentially in the order of position block A, position block L, position block AR, position block BL, and position block AL. If the availability of the target neighboring position block is available, the motion vector of the target neighboring position block can be directly added to the MVP candidate list as an MVP candidate, thus completing the construction of the MVP candidate list. If the availability of the target neighboring position block is unavailable, the target neighboring position block can be expanded to obtain the expanded neighboring block of the target neighboring position block. Then, it can be determined whether the availability of the expanded neighboring block is available. If the availability of the expanded neighboring block is available, the motion vector of the expanded neighboring block can be added to the MVP candidate list as an MVP candidate, thus completing the construction of the MVP candidate list. If the current extended neighbor block of the target adjacent position block is deemed unavailable, the next extended neighbor block of the target adjacent position block can be extended, and the availability of that next extended neighbor block can be checked again until the number of MVP candidates found reaches the upper limit, or until it is determined that there are no MVP candidates for the current decoded block. It should be noted that the upper limit for the number of MVP candidates can be N, where N is a positive integer. For example, N can be 7, in which case the upper limit for the number of MVP candidates is 7.

[0091] For example, in response to the unavailability of a target adjacent block, the target adjacent block can be expanded to obtain an expanded adjacent block, and then an MVP candidate list can be constructed based on the expanded adjacent blocks. When expanding the target adjacent block, the expanded adjacent block can be obtained based on at least one of the following strategies:

[0092] Expand at least one of the target's adjacent location blocks that are determined to be unavailable;

[0093] Expand the first preset number of position blocks in the traversal order;

[0094] Expand blocks that are close to the center of the current decoded block in the traversal order, and do not expand blocks that are far from the center of the current decoded block in the traversal order;

[0095] Expand at least one of the five adjacent blocks (left, lower left, upper, upper right, and upper left) that has a stronger correlation with the current decoded block.

[0096] For example, expanding at least one of the target adjacent location blocks determined to be unavailable may specifically include at least one of the following:

[0097] In response to the left adjacent block being unavailable, the left adjacent block is expanded;

[0098] In response to the lower left adjacent block being unavailable, expand the lower left adjacent block;

[0099] In response to the block at the upper adjacent position being unavailable, the block at the upper adjacent position is expanded;

[0100] In response to the top-right adjacent block being unavailable, the top-right adjacent block is expanded;

[0101] In response to the top-left adjacent block being unavailable, expand the top-left adjacent block;

[0102] In response to the fact that at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is unavailable or all of them are unavailable, at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is expanded.

[0103] For example, when expanding a target adjacent block by extending a predetermined number of position blocks in the traversal order, the predetermined number refers to the number of blocks that appear first in the traversal order. The predetermined number can be appropriately selected based on actual application needs, and is not specifically limited here. For example, the predetermined number can be 3. For instance, assuming the traversal order is from position block BL, position block L, position block AR, position block A to position block AL, and the predetermined number is 3, then extending the predetermined number of position blocks in the traversal order specifically means: sequentially extending the first traversed position blocks BL, L, and AR, but not extending the later traversed position blocks A and AL.

[0104] For example, when expanding adjacent blocks of the target location, several blocks that are close to the center of the current decoded block in the traversal order can be expanded according to their distance from the center of the current decoded block. After expanding these blocks, the remaining blocks are not expanded. In other words, blocks close to the center of the current decoded block in the traversal order are expanded, while blocks far from the center are not expanded. Here, "several blocks" can refer to one block, two blocks, or more blocks, etc., and the appropriate selection can be made according to the actual application needs; no specific limitation is made here. For example, assuming the traversal order is from BL, L, AR, A to AL, where "several position blocks" refers to two position blocks, then: First, traverse the BL position block. Since the BL position block is farther from the center of the current decoded block than the L position block, it is not expanded. Then, traverse the L position block. Since the L position block is closer to the center of the current decoded block among the BL, L, AR, A, and AL position blocks, it is expanded. Next, traverse the AR position block. Since the AR position block is farther from the center of the current decoded block than both the L and A position blocks, it is not expanded. Now, traverse the A position block. Since the A position block is closer to the center of the current decoded block among the BL, L, AR, A, and AL position blocks, it is expanded. At this point, the number of expanded position blocks has reached the preset value, so the AL position block is not expanded.

[0105] For example, when expanding the target adjacent position block, at least one position block among the five adjacent position blocks (left, lower left, upper, upper right, and upper left) that has a stronger correlation with the current decoded block can also be expanded. The correlation with the current decoded block can include at least one of spatial compactness and motion information correlation. For example, among the five adjacent blocks (left, bottom left, top, top right, and top left), the left adjacent block (L) and the top adjacent block (A) are spatially close to the current decoded block, and their motion information correlation is high. However, the bottom left adjacent block (BL), the top right adjacent block (AR), and the top left adjacent block (AL) are spatially farther from the current decoded block, and their motion information correlation is weaker. Therefore, in summary, the left and top adjacent blocks have a stronger correlation with the current decoded block, while the bottom left, top right, and top left adjacent blocks have a weaker correlation. Thus, at least one of the left and top adjacent blocks can be selected for expansion.

[0106] For example, expanding the target adjacent location block can include at least one of the following:

[0107] For the adjacent block above, expand horizontally;

[0108] For the left adjacent block, expand vertically;

[0109] For the block adjacent to the top right position, expand horizontally or diagonally;

[0110] For the block adjacent to the bottom left, expand it vertically or diagonally;

[0111] For the block adjacent to the top left, expand it horizontally, vertically, or diagonally.

[0112] Reference Figures 10A to 10L As shown, Figures 10A to 10L Several methods for expanding a target's adjacent location block are exemplified. For example, in... Figure 10AIn the context of a block, for the left adjacent block, vertical expansion can begin or end with that block; for the bottom-left adjacent block, vertical expansion can begin or end with that block; for the top-left adjacent block, vertical expansion can begin or end with that block; for the top adjacent block, horizontal expansion can begin or end with that block; and for the top-right adjacent block, horizontal expansion can begin or end with that block. For example, in... Figure 10B In the context of a block, for the left adjacent block, vertical expansion can begin or end with the left adjacent block; for the bottom-left adjacent block, vertical expansion can begin or end with the bottom-left adjacent block; for the top-left adjacent block, diagonal expansion can begin or end with the top-left adjacent block; for the top adjacent block, horizontal expansion can begin or end with the top-upper adjacent block; and for the top-right adjacent block, horizontal expansion can begin or end with the top-right adjacent block. For example, in... Figure 10C In the context of a block, for the left adjacent block, vertical expansion can begin or end with that block; for the bottom-left adjacent block, vertical expansion can begin or end with that block; for the top-left adjacent block, horizontal expansion can begin or end with that block; for the top adjacent block, horizontal expansion can begin or end with that block; and for the top-right adjacent block, horizontal expansion can begin or end with that block. For example, in... Figure 10D In the context of a game, for a left-adjacent block, vertical expansion can begin or end with that block; for a bottom-left adjacent block, vertical expansion can begin or end with that block; for a top-left adjacent block, horizontal expansion can begin or end with that block; for a top adjacent block, horizontal expansion can begin or end with that block; and for a top-right adjacent block, diagonal expansion can begin or end with that block. For example, in... Figure 10EIn the context of a block, for the left adjacent block, expansion can begin or end vertically; for the bottom-left adjacent block, expansion can begin diagonally; for the top-left adjacent block, expansion can begin or end horizontally; for the top adjacent block, expansion can begin or end horizontally; and for the top-right adjacent block, expansion can begin or end horizontally. For example, in... Figure 10F In the context of a game, for a left-adjacent block, expansion can begin or end vertically from that block; for a bottom-left adjacent block, expansion can begin diagonally from that block; for a top-left adjacent block, expansion can begin horizontally from that block; for a top adjacent block, expansion can begin horizontally from that block; and for a top-right adjacent block, expansion can begin diagonally from that block. For example, in... Figure 10G In the context of a game, for a left-adjacent block, vertical expansion can begin or end with that block; for a bottom-left adjacent block, vertical expansion can begin or end with that block; for a top-left adjacent block, vertical expansion can begin or end with that block; for a top adjacent block, horizontal expansion can begin or end with that block; and for a top-right adjacent block, diagonal expansion can begin or end with that block. For example, in... Figure 10H In the context of a game, for a left-adjacent block, expansion can begin or end vertically from that block; for a bottom-left adjacent block, expansion can begin or end vertically from that block; for a top-left adjacent block, expansion can begin or end diagonally from that block; for a top adjacent block, expansion can begin or end horizontally from that block; and for a top-right adjacent block, expansion can begin or end diagonally from that block. For example, in... Figure 10IIn the context of a block, for the left adjacent block, vertical expansion can begin or end with that block; for the bottom-left adjacent block, diagonal expansion can begin or end with that block; for the top-left adjacent block, vertical expansion can begin or end with that block; for the top adjacent block, horizontal expansion can begin or end with that block; and for the top-right adjacent block, horizontal expansion can begin or end with that block. For example, in... Figure 10J In the context of a game, for a left-adjacent block, expansion can begin or end vertically from that block; for a bottom-left adjacent block, expansion can begin diagonally from that block; for a top-left adjacent block, expansion can begin or end diagonally from that block; for a top adjacent block, expansion can begin or end horizontally from that block; and for a top-right adjacent block, expansion can begin or end horizontally from that block. For example, in... Figure 10K In the context of a game, for a left-adjacent block, expansion can begin or end vertically from that block; for a bottom-left adjacent block, expansion can begin diagonally from that block; for a top-left adjacent block, expansion can begin or end vertically from that block; for a top adjacent block, expansion can begin or end horizontally from that block; and for a top-right adjacent block, expansion can begin or end diagonally from that block. For example, in... Figure 10L In the middle, for the left adjacent block, the expansion can be carried out vertically, starting from or ending with the left adjacent block; for the bottom left adjacent block, the expansion can be carried out diagonally, starting from or ending with the bottom left adjacent block; for the top left adjacent block, the expansion can be carried out diagonally, starting from or ending with the top left adjacent block; for the top adjacent block, the expansion can be carried out horizontally, starting from or ending with the top above adjacent block; and for the top right adjacent block, the expansion can be carried out diagonally, starting from or ending with the top right adjacent block.

[0113] For example, the target adjacent location block can have one or more extended adjacent blocks. The number of extended adjacent blocks can be appropriately selected according to the actual application, and is not specifically limited here. For example Figure 10A In the middle, the number of extended neighboring blocks of the left adjacent block, the number of extended neighboring blocks of the bottom left adjacent block, the number of extended neighboring blocks of the top adjacent block, the number of extended neighboring blocks of the top right adjacent block, and the number of extended neighboring blocks of the top left adjacent block are all 7.

[0114] For example, when constructing the MVP candidate list based on extended neighbor blocks, the motion vector of the first available extended neighbor block of the target adjacent position block can be added to the MVP candidate list as an MVP candidate, or the average motion vector of multiple available extended neighbor blocks of the target adjacent position block can be added to the MVP candidate list as an MVP candidate. Specifically, when adding the motion vector of the first available extended neighbor block of the target adjacent position block to the MVP candidate list, if the first extended neighbor block of the target adjacent position block is available, then that first extended neighbor block is the first available extended neighbor block, and its motion vector can be directly added to the MVP candidate list. This completes the processing of the current target adjacent position block, and the next target adjacent position block can be processed. If the first extended neighbor block of the target adjacent position block is unavailable, then a second extended neighbor block of the target adjacent position block is extended, and its availability is determined. If the second extended neighbor block is available, then that second extended neighbor block is the first available extended neighbor block, and its motion vector can be added to the MVP candidate list as an MVP candidate. In addition, when adding the average motion vector of multiple available extended neighbor blocks of the target adjacent position block as MVP candidates to the MVP candidate list, multiple extended neighbor blocks of the target adjacent position block can be extended first. These extended neighbor blocks do not include available extended neighbor blocks and unavailable extended neighbor blocks. At this time, the average motion vector of all available extended neighbor blocks can be determined as the MVP candidate of the current decoding block and added to the MVP candidate list.

[0115] For example, the constructed MVP candidate list can include multiple types of MVP candidates, including spatially adjacent candidate types. In this case, when constructing the MVP candidate list based on extended adjacent blocks, the motion vector of the extended adjacent block can be used as an MVP candidate and placed among the MVP candidates of the spatially adjacent candidate type; alternatively, the motion vector of the extended adjacent block can be used as an MVP candidate and placed between any two adjacent MVP candidates from the multiple types. For example, the motion vector of the extended adjacent block can be used as an MVP candidate and placed between temporal candidates and spatially non-adjacent candidates.

[0116] For example, in addition to regular information, the video stream may also include an extension control flag, which indicates whether to extend the target adjacent location block when its availability is unavailable. If the extension control flag indicates that the target adjacent location block should be extended when its availability is unavailable, its value can be set to a specific value (e.g., 1); if the extension control flag indicates that the target adjacent location block should not be extended when its availability is unavailable, its value can be set to another specific value (e.g., 0). After receiving the video stream, it can be first determined whether the extension control flag in the video stream has the extension function enabled. If it is confirmed that the extension function is enabled (e.g., the extension control flag value is 1), then when the availability of the target adjacent location block is unavailable, the target adjacent location block will be extended to obtain the extended adjacent block of the target adjacent location block, and then an MVP candidate list will be constructed based on the extended adjacent block. If it is confirmed that the extension function is not enabled (e.g., the extension control flag is set to 0), then when the availability of the target adjacent position block is unavailable, the target adjacent position block will not be extended. Instead, it will determine whether the next target adjacent position block is available. If the next target adjacent position block is available, then the motion vector of the next target adjacent position block will be added to the MVP candidate list as the MVP candidate of the current decoding block.

[0117] For example, the extension control flag can be set in at least one of the following six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. Setting the extension control flag in different parameter sets corresponds to extension control flags operating at different levels. For instance, when the extension control flag is set in the video parameter set, its value has a global indicative meaning. For example, if the video-level extension control flag is set to 1, it means that during the entire video decoding process, for all relevant decoded blocks, the target adjacent position block will be extended when its availability is unavailable. Similarly, when the extension control flag is set in the sequence parameter set, its value has an indicative meaning for a specific video sequence. For example, if the sequence-level extension control flag is set to 1, it means that during the decoding process of a specific video sequence, for all relevant decoded blocks in that video sequence, the target adjacent position block will be extended when its availability is unavailable. Furthermore, when the extension control flag is set in the coding unit parameter set, a coding unit-level extension control flag is formed. For example, if the extension control flag of a certain coding unit is set to 1, it means that the target adjacent location block is extended only when the availability of the target adjacent location block is unavailable for that coding unit.

[0118] It is worth noting that in practical applications, multiple levels of extension control flags may coexist with different values. Generally, a priority rule is followed to determine whether to extend the target's adjacent block when its availability is unavailable. For example, video-level extension control flags have the highest priority, followed by sequence-level, image-level, title sequence-level, and finally coding unit-level flags. That is, when a video-level extension control flag has an explicit indication, the video-level setting is followed first; if the video-level flag is not set or has no explicit indication, the sequence-level extension control flag is referenced; if the sequence-level extension control flag also has no valid indication, the image-level extension control flag is then used, and so on.

[0119] It should be noted that this embodiment does not limit the specific value of the extension control flag. The value can be set not only to 1 or 0, but also to "true" or "false", or other types of characters or symbols can be used to replace "1" and "0", as long as its value can indicate whether to extend the target adjacent location block when the availability of the target adjacent location block is unavailable.

[0120] For example, the expansion control identifier may include multiple expansion control sub-identifiers set in different level parameter sets. The expansion control sub-identifiers set in different level parameter sets are used to indicate whether to expand the target adjacent location block when the availability of the target adjacent location block is unavailable in the corresponding different image processing levels.

[0121] For example, these extended control sub-identifiers may include a first extended control sub-identifier and a second extended control sub-identifier. The first extended control sub-identifier is set in one of six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended control sub-identifier is set in the other of these six sets. For instance, the first extended control sub-identifier may be set in the video parameter set, in which case the second extended control sub-identifier may be set in any one of the five sets: sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. Alternatively, the first extended control sub-identifier may be set in the sequence parameter set, in which case the second extended control sub-identifier may be set in any one of the four sets: image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. And so on.

[0122] The following example illustrates the function of setting the first and second extended control sub-identifiers.

[0123] Assuming the first extension control sub-identifier is set in the video parameter set and the second extension control sub-identifier is set in the sequence parameter set, there are four possible scenarios: Scenario 1: Both the first and second extension control sub-identifiers indicate that the extension function is enabled. Scenario 2: The first extension control sub-identifier indicates that the extension function is enabled, and the second extension control sub-identifier indicates that the extension function is disabled. Scenario 3: The first extension control sub-identifier indicates that the extension function is disabled, and the second extension control sub-identifier indicates that the extension function is enabled. Scenario 4: Both the first and second extension control sub-identifiers indicate that the extension function is disabled. Specifically, for Scenario 1, when both the value of the first extension control sub-identifier in the video parameter set and the value of the second extension control sub-identifier in the sequence parameter set indicate that the extension function should be enabled, then for the corresponding sequence, the target adjacent position block is extended when the availability of the target adjacent position block is unavailable. In case 2, when the value of the first extension control sub-identifier in the video parameter set indicates that the extension function is enabled, but the value of the second extension control sub-identifier in the sequence parameter set of a certain sequence indicates that the extension function is not enabled, since the second extension control sub-identifier negates enabling the extension function at a more specific sequence level, in order to follow more detailed control instructions to adapt to the decoding requirements of the specific sequence, the target adjacent position block is not extended when its availability is unavailable for that sequence. However, for other sequences, the target adjacent position block will still be extended when its availability is unavailable. In cases 3 and 4, when the value of the first extension control sub-identifier in the video parameter set indicates that the extension function is not enabled, since the first extension control sub-identifier in the higher-level parameter set indicates that the extension function is not enabled, the specific instructions of the second extension control sub-identifier in the lower-level parameter set do not need to be considered. In this case, for any sequence, the target adjacent position block will not be extended when its availability is unavailable.

[0124] For example, the video stream may also include an expansion mode control identifier, which is used to indicate whether to expand all target neighboring blocks or only some target neighboring blocks when the expansion control identifier indicates that the target neighboring block is unavailable. For example, if the expansion mode control identifier is used to indicate that all target neighboring blocks are expanded, the value of the expansion mode control identifier can be set to a specific value (e.g., 0); if the expansion mode control identifier is used to indicate that only some target neighboring blocks are expanded, the value of the expansion mode control identifier can be set to another specific value (e.g., 1). After receiving the video stream, the expansion mode indicated by the expansion mode control identifier in the video stream can be determined. If the expansion mode is to expand all target neighboring blocks (e.g., the expansion mode control identifier is set to 0), then all target neighboring blocks that are unavailable will be expanded to obtain corresponding expanded neighboring blocks, and then an MVP candidate list will be constructed based on the expanded neighboring blocks. If the expansion method is to expand some target adjacent location blocks (for example, the expansion method control flag is set to 1), then the target adjacent location blocks with unavailability will be expanded to obtain the corresponding expanded adjacent blocks.

[0125] For example, the extended mode control identifier is set in at least one of the following six parameters: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The level of the highest-level parameter set in the parameter set containing the extended mode control identifier is lower than or equal to the level of the highest-level parameter set in the parameter set containing the extended control identifier. In other words, the extended mode control identifier and the extended control identifier can be set in the same parameter set or in different parameter sets. However, when the extended mode control identifier and the extended control identifier are set in different parameter sets, the level of the highest-level parameter set in the parameter set containing the extended mode control identifier is lower than or equal to the level of the highest-level parameter set in the parameter set containing the extended control identifier. For example, if the extended control identifier is set in the video parameter set, then the extended mode control identifier can be set in any one of the six: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. If the extended control identifier is set in the sequence parameter set, then the extended mode control identifier cannot be set in the video parameter set, but can only be set in any one of the five: sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

[0126] For example, the extension mode control flag is set in different parameter sets, corresponding to extension mode control flags operating at different levels. For instance, when the extension mode control flag is set in the video parameter set, its value has a global indicative meaning. For example, if the video-level extension mode control flag is set to 0, it means that during the entire video decoding process, for all relevant decoded blocks, extension will be performed on all target adjacent blocks when the extension control flag indicates that the availability of the target adjacent block is unavailable. As another example, when the extension mode control flag is set in the sequence parameter set, its value has an indicative meaning for a specific video sequence. For example, if the sequence-level extension mode control flag is set to 1, it means that during the decoding process of a certain video sequence, for all relevant decoded blocks in that video sequence, extension will be performed on some target adjacent blocks when the extension control flag indicates that the availability of the target adjacent block is unavailable. Furthermore, when the extension mode control flag is set in the coding unit parameter set, a coding unit-level extension mode control flag is formed. For example, if the expansion control flag of a certain coding unit is set to 0, it means that only for that coding unit, when the expansion control flag indicates that the target adjacent location block is not available, all target adjacent location blocks will be expanded.

[0127] It should be noted that this embodiment does not limit the specific value of the extension mode control flag. The value can be set not only to 1 or 0, but also to "true" or "false", or other types of characters or symbols can be used to replace "1" and "0", as long as its value can indicate that all target adjacent position blocks or some target adjacent position blocks are extended when the availability of the target adjacent position block is unavailable.

[0128] For example, the expansion mode control identifier may include multiple expansion mode control sub-identifiers set in different level parameter sets. The expansion mode control sub-identifiers set in different level parameter sets are used to indicate whether, in the corresponding different image processing levels, when it is determined that the target adjacent location blocks need to be expanded, all target adjacent location blocks are expanded or only some target adjacent location blocks are expanded.

[0129] For example, these extended mode control sub-identifiers may include a first extended mode control sub-identifier and a second extended mode control sub-identifier. The first extended mode control sub-identifier can be set to one of six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended mode control sub-identifier can be set to the other of these six sets. For instance, the first extended mode control sub-identifier can be set to the video parameter set, in which case the second extended mode control sub-identifier can be set to any one of the five sets: sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. Alternatively, the first extended mode control sub-identifier can be set to the sequence parameter set, in which case the second extended mode control sub-identifier can be set to any one of the four sets: image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. And so on.

[0130] In addition, to achieve efficient encoding of coded blocks in video frames, embodiments of this application also propose a video encoding method. (Refer to...) Figure 11 , Figure 11 This is a flowchart of a video encoding method provided in one embodiment of this application. The encoding method may include, but is not limited to, steps S1110 to S1140.

[0131] Step S1110: Determine the availability of the target adjacent position block in the current coded block of the video frame;

[0132] Step S1120: In response to the unavailability of the target adjacent location block, the target adjacent location block is expanded to obtain the expanded adjacent block of the target adjacent location block, and an MVP candidate list is constructed based on the expanded adjacent block.

[0133] Step S1130: Perform cost calculation based on rate-distortion optimization for each MVP candidate in the MVP candidate list to obtain the target MVP candidate in the MVP candidate list;

[0134] Step S1140: Encode the current coding block based on the Merge mode according to the target MVP candidate to obtain the video bitstream, and encode the candidate index of the target MVP candidate into the video bitstream and transmit it to the decoding end.

[0135] For example, the target MVP candidate refers to the MVP candidate with the lowest cost within the MVP candidate list. The MVP candidate list contains multiple possible motion vector prediction values. The candidate index is a number pointing to a specific candidate in this MVP candidate list. When encoding a video block using the Merge mode, the MVP candidate that best matches the current block can be selected from the MVP candidate list, and its index value in the MVP candidate list (i.e., the candidate index) is encoded into the video stream. After receiving the video stream, the decoder can retrieve the corresponding motion vector prediction value from its own constructed MVP candidate list based on this candidate index, recover the true motion vector of the current block, and thus complete the decoding of the video block.

[0136] For example, when determining the availability of a target neighboring block in a video frame, the availability of the target neighboring block can be determined to be unavailable if the target neighboring block in the video frame satisfies at least one of the following conditions:

[0137] The target's adjacent blocks do not exist;

[0138] The prediction mode for adjacent blocks of the target is non-inter-frame mode;

[0139] The prediction mode for adjacent blocks of the target is intra-frame prediction mode and not template matching prediction mode;

[0140] The target's adjacent location block and the current encoded block belong to the same motion estimation region;

[0141] The target adjacent block and the current coding block belong to the same coding unit;

[0142] The motion vectors of the target's adjacent blocks overlap with those of the MVP candidates in the MVP candidate list.

[0143] It should be noted that if none of the adjacent blocks of the target satisfy all of the above conditions, then the availability of the adjacent blocks of the target can be considered as available.

[0144] For example, the target adjacent position block may include at least one of the following: left adjacent position block, bottom left adjacent position block, top adjacent position block, top right adjacent position block, and top left adjacent position block. Specifically, for the Merge pattern, the target adjacent position block may include at least one of the following five: L position block (i.e., left adjacent position block), BL position block (i.e., bottom left adjacent position block), A position block (i.e., top adjacent position block), AR position block (i.e., top right adjacent position block), and AL position block (i.e., top left adjacent position block).

[0145] For example, in determining the availability of the target neighboring position block of the current coding block in a video frame, the availability of the target neighboring position block of the current coding block in the video frame can be determined according to a preset traversal order. For example, for Merge mode, the availability of these position blocks can be traversed sequentially in the order of position block A, position block L, position block AR, position block BL, and position block AL. If the availability of the target neighboring position block is available, the motion vector of the target neighboring position block can be directly added to the MVP candidate list as an MVP candidate, thus completing the construction of the MVP candidate list. If the availability of the target neighboring position block is unavailable, the target neighboring position block can be expanded to obtain the expanded neighboring block of the target neighboring position block. Then, it can be determined whether the availability of the expanded neighboring block is available. If the availability of the expanded neighboring block is available, the motion vector of the expanded neighboring block can be added to the MVP candidate list as an MVP candidate, thus completing the construction of the MVP candidate list. If the current extended neighbor block of the target adjacent position is deemed unavailable, the next extended neighbor block can be extended, and the availability of that next extended neighbor block can be checked again until the number of MVP candidates found reaches the upper limit, or until it is determined that the current coded block has no MVP candidates. It should be noted that the upper limit for the number of MVP candidates can be N, where N is a positive integer. For example, N can be 7, in which case the upper limit for the number of MVP candidates is 7.

[0146] For example, in response to the unavailability of a target adjacent block, the target adjacent block can be expanded to obtain an expanded adjacent block, and then an MVP candidate list can be constructed based on the expanded adjacent blocks. When expanding the target adjacent block, the expanded adjacent block can be obtained based on at least one of the following strategies:

[0147] Expand at least one of the target's adjacent location blocks that are determined to be unavailable;

[0148] Expand the first preset number of position blocks in the traversal order;

[0149] Expand blocks that are close to the center of the current decoded block in the traversal order, and do not expand blocks that are far from the center of the current decoded block in the traversal order;

[0150] Expand at least one of the five adjacent blocks (left, lower left, upper, upper right, and upper left) that has a stronger correlation with the current decoded block.

[0151] For example, expanding at least one of the target adjacent location blocks determined to be unavailable may specifically include at least one of the following:

[0152] In response to the left adjacent block being unavailable, the left adjacent block is expanded;

[0153] In response to the lower left adjacent block being unavailable, expand the lower left adjacent block;

[0154] In response to the block at the upper adjacent position being unavailable, the block at the upper adjacent position is expanded;

[0155] In response to the top-right adjacent block being unavailable, the top-right adjacent block is expanded;

[0156] In response to the top-left adjacent block being unavailable, expand the top-left adjacent block;

[0157] In response to the fact that at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is unavailable or all of them are unavailable, at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is expanded.

[0158] For example, when expanding a target adjacent block by extending a predetermined number of position blocks in the traversal order, the predetermined number refers to the number of blocks that appear first in the traversal order. The predetermined number can be appropriately selected based on actual application needs, and is not specifically limited here. For example, the predetermined number can be 3. For instance, assuming the traversal order is from position block BL, position block L, position block AR, position block A to position block AL, and the predetermined number is 3, then extending the predetermined number of position blocks in the traversal order specifically means: sequentially extending the first traversed position blocks BL, L, and AR, but not extending the later traversed position blocks A and AL.

[0159] For example, when expanding adjacent blocks of the target location, several blocks that are close to the center of the current decoded block in the traversal order can be expanded according to their distance from the center of the current decoded block. After expanding these blocks, the remaining blocks are not expanded. In other words, blocks close to the center of the current decoded block in the traversal order are expanded, while blocks far from the center are not expanded. Here, "several blocks" can refer to one block, two blocks, or more blocks, etc., and the appropriate selection can be made according to the actual application needs; no specific limitation is made here. For example, assuming the traversal order is from BL, L, AR, A to AL, where "several position blocks" refers to two position blocks, then: First, traverse the BL position block. Since the BL position block is farther from the center of the current decoded block than the L position block, it is not expanded. Then, traverse the L position block. Since the L position block is closer to the center of the current decoded block among the BL, L, AR, A, and AL position blocks, it is expanded. Next, traverse the AR position block. Since the AR position block is farther from the center of the current decoded block than both the L and A position blocks, it is not expanded. Now, traverse the A position block. Since the A position block is closer to the center of the current decoded block among the BL, L, AR, A, and AL position blocks, it is expanded. At this point, the number of expanded position blocks has reached the preset value, so the AL position block is not expanded.

[0160] For example, when expanding the target adjacent position block, at least one position block among the five adjacent position blocks (left, lower left, upper, upper right, and upper left) that has a stronger correlation with the current decoded block can also be expanded. The correlation with the current decoded block can include at least one of spatial compactness and motion information correlation. For example, among the five adjacent blocks (left, bottom left, top, top right, and top left), the left adjacent block (L) and the top adjacent block (A) are spatially close to the current decoded block, and their motion information correlation is high. However, the bottom left adjacent block (BL), the top right adjacent block (AR), and the top left adjacent block (AL) are spatially farther from the current decoded block, and their motion information correlation is weaker. Therefore, in summary, the left and top adjacent blocks have a stronger correlation with the current decoded block, while the bottom left, top right, and top left adjacent blocks have a weaker correlation. Thus, at least one of the left and top adjacent blocks can be selected for expansion.

[0161] For example, expanding the target adjacent location block can include at least one of the following:

[0162] For the adjacent block above, expand horizontally;

[0163] For the left adjacent block, expand vertically;

[0164] For the block adjacent to the top right position, expand horizontally or diagonally;

[0165] For the block adjacent to the bottom left, expand it vertically or diagonally;

[0166] For the block adjacent to the top left, expand it horizontally, vertically, or diagonally.

[0167] For example, the target adjacent location block can have one or more extended adjacent blocks. The number of extended adjacent blocks can be appropriately selected according to the actual application, and is not specifically limited here. For example Figure 10A In the middle, the number of extended neighboring blocks of the left adjacent block, the number of extended neighboring blocks of the bottom left adjacent block, the number of extended neighboring blocks of the top adjacent block, the number of extended neighboring blocks of the top right adjacent block, and the number of extended neighboring blocks of the top left adjacent block are all 7.

[0168] For example, when constructing the MVP candidate list based on extended neighbor blocks, the motion vector of the first available extended neighbor block of the target adjacent position block can be added to the MVP candidate list as an MVP candidate, or the average motion vector of multiple available extended neighbor blocks of the target adjacent position block can be added to the MVP candidate list as an MVP candidate. Specifically, when adding the motion vector of the first available extended neighbor block of the target adjacent position block to the MVP candidate list, if the first extended neighbor block of the target adjacent position block is available, then that first extended neighbor block is the first available extended neighbor block, and its motion vector can be directly added to the MVP candidate list. This completes the processing of the current target adjacent position block, and the next target adjacent position block can be processed. If the first extended neighbor block of the target adjacent position block is unavailable, then a second extended neighbor block of the target adjacent position block is extended, and its availability is determined. If the second extended neighbor block is available, then that second extended neighbor block is the first available extended neighbor block, and its motion vector can be added to the MVP candidate list as an MVP candidate. In addition, when adding the average motion vector of multiple available extended neighbor blocks of the target adjacent position block as MVP candidates to the MVP candidate list, multiple extended neighbor blocks of the target adjacent position block can be extended first. These extended neighbor blocks do not include available extended neighbor blocks and unavailable extended neighbor blocks. At this time, the average motion vector of all available extended neighbor blocks can be determined as the MVP candidate of the current coding block and added to the MVP candidate list.

[0169] For example, the constructed MVP candidate list can include multiple types of MVP candidates, including spatially adjacent candidate types. In this case, when constructing the MVP candidate list based on extended adjacent blocks, the motion vector of the extended adjacent block can be used as an MVP candidate and placed among the MVP candidates of the spatially adjacent candidate type; alternatively, the motion vector of the extended adjacent block can be used as an MVP candidate and placed between any two adjacent MVP candidates from the multiple types. For example, the motion vector of the extended adjacent block can be used as an MVP candidate and placed between temporal candidates and spatially non-adjacent candidates.

[0170] For example, in addition to regular information, the video stream may also include an extension control flag, which indicates whether to extend the target adjacent location block when its availability is unavailable. If the extension control flag indicates that the target adjacent location block should be extended when its availability is unavailable, its value can be set to a specific value (e.g., 1); if the extension control flag indicates that the target adjacent location block should not be extended when its availability is unavailable, its value can be set to another specific value (e.g., 0). For example, when encoding video frames, if the extension function is enabled, the extension control flag can be set to 1, thus indicating that the target adjacent location block should be extended when its availability is unavailable. If the extension function is not enabled, the extension control flag can be set to 0, thus indicating that the target adjacent location block should not be extended when its availability is unavailable.

[0171] For example, the extension control flag can be set in at least one of the following six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. Setting the extension control flag in different parameter sets corresponds to extension control flags operating at different levels. For instance, when the extension control flag is set in the video parameter set, its value has a global indicative meaning. For example, if the video-level extension control flag is set to 1, it means that during the entire video encoding process, for all relevant coding blocks, the target adjacent position block will be extended when its availability is unavailable. Similarly, when the extension control flag is set in the sequence parameter set, its value has an indicative meaning for a specific video sequence. For example, if the sequence-level extension control flag is set to 1, it means that during the encoding process of a specific video sequence, for all relevant coding blocks in that video sequence, the target adjacent position block will be extended when its availability is unavailable. Furthermore, when the extension control flag is set in the coding unit parameter set, a coding unit-level extension control flag is formed. For example, if the extension control flag of a certain coding unit is set to 1, it means that the target adjacent location block is extended only when the availability of the target adjacent location block is unavailable for that coding unit.

[0172] It is worth noting that in practical applications, multiple levels of extension control flags may coexist with different values. Generally, a priority rule is followed to determine whether to extend the target's adjacent block when its availability is unavailable. For example, video-level extension control flags have the highest priority, followed by sequence-level, image-level, title sequence-level, and finally coding unit-level flags. That is, when a video-level extension control flag has an explicit indication, the video-level setting is followed first; if the video-level flag is not set or has no explicit indication, the sequence-level extension control flag is referenced; if the sequence-level extension control flag also has no valid indication, the image-level extension control flag is then used, and so on.

[0173] It should be noted that this embodiment does not limit the specific value of the extension control flag. The value can be set not only to 1 or 0, but also to "true" or "false", or other types of characters or symbols can be used to replace "1" and "0", as long as its value can indicate whether to extend the target adjacent location block when the availability of the target adjacent location block is unavailable.

[0174] For example, the expansion control identifier may include multiple expansion control sub-identifiers set in different level parameter sets. The expansion control sub-identifiers set in different level parameter sets are used to indicate whether to expand the target adjacent location block when the availability of the target adjacent location block is unavailable in the corresponding different image processing levels.

[0175] For example, these extended control sub-identifiers may include a first extended control sub-identifier and a second extended control sub-identifier. The first extended control sub-identifier is set in one of six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended control sub-identifier is set in the other of these six sets. For instance, the first extended control sub-identifier may be set in the video parameter set, in which case the second extended control sub-identifier may be set in any one of the five sets: sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. Alternatively, the first extended control sub-identifier may be set in the sequence parameter set, in which case the second extended control sub-identifier may be set in any one of the four sets: image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. And so on.

[0176] For example, the video stream may also include an expansion mode control identifier, which is used to indicate whether to expand all target neighboring blocks or only some target neighboring blocks when the expansion control identifier indicates that the target neighboring block is unavailable. For example, if the expansion mode control identifier is used to indicate that all target neighboring blocks are expanded, the value of the expansion mode control identifier can be set to a specific value (e.g., 0); if the expansion mode control identifier is used to indicate that only some target neighboring blocks are expanded, the value of the expansion mode control identifier can be set to another specific value (e.g., 1). After receiving the video stream, the expansion mode indicated by the expansion mode control identifier in the video stream can be determined. If the expansion mode is to expand all target neighboring blocks (e.g., the expansion mode control identifier is set to 0), then all target neighboring blocks that are unavailable will be expanded to obtain corresponding expanded neighboring blocks, and then an MVP candidate list will be constructed based on the expanded neighboring blocks. If the expansion method is to expand some target adjacent location blocks (for example, the expansion method control flag is set to 1), then the target adjacent location blocks with unavailability will be expanded to obtain the corresponding expanded adjacent blocks.

[0177] For example, the extended mode control identifier is set in at least one of the following six parameters: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The level of the highest-level parameter set in the parameter set containing the extended mode control identifier is lower than or equal to the level of the highest-level parameter set in the parameter set containing the extended control identifier. In other words, the extended mode control identifier and the extended control identifier can be set in the same parameter set or in different parameter sets. However, when the extended mode control identifier and the extended control identifier are set in different parameter sets, the level of the highest-level parameter set in the parameter set containing the extended mode control identifier is lower than or equal to the level of the highest-level parameter set in the parameter set containing the extended control identifier. For example, if the extended control identifier is set in the video parameter set, then the extended mode control identifier can be set in any one of the six: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. If the extended control identifier is set in the sequence parameter set, then the extended mode control identifier cannot be set in the video parameter set, but can only be set in any one of the five: sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

[0178] For example, the extension mode control flag is set in different parameter sets, corresponding to extension mode control flags operating at different levels. For instance, when the extension mode control flag is set in the video parameter set, its value has a global indicative meaning. For example, if the video-level extension mode control flag is set to 0, it means that during the entire video decoding process, for all relevant decoded blocks, extension will be performed on all target adjacent blocks when the extension control flag indicates that the availability of the target adjacent block is unavailable. As another example, when the extension mode control flag is set in the sequence parameter set, its value has an indicative meaning for a specific video sequence. For example, if the sequence-level extension mode control flag is set to 1, it means that during the decoding process of a certain video sequence, for all relevant decoded blocks in that video sequence, extension will be performed on some target adjacent blocks when the extension control flag indicates that the availability of the target adjacent block is unavailable. Furthermore, when the extension mode control flag is set in the coding unit parameter set, a coding unit-level extension mode control flag is formed. For example, if the expansion control flag of a certain coding unit is set to 0, it means that only for that coding unit, when the expansion control flag indicates that the target adjacent location block is not available, all target adjacent location blocks will be expanded.

[0179] It should be noted that this embodiment does not limit the specific value of the extension mode control flag. The value can be set not only to 1 or 0, but also to "true" or "false", or other types of characters or symbols can be used to replace "1" and "0", as long as its value can indicate that all target adjacent position blocks or some target adjacent position blocks are extended when the availability of the target adjacent position block is unavailable.

[0180] For example, the expansion mode control identifier may include multiple expansion mode control sub-identifiers set in different level parameter sets. The expansion mode control sub-identifiers set in different level parameter sets are used to indicate whether, in the corresponding different image processing levels, when it is determined that the target adjacent location blocks need to be expanded, all target adjacent location blocks are expanded or only some target adjacent location blocks are expanded.

[0181] For example, these extended mode control sub-identifiers may include a first extended mode control sub-identifier and a second extended mode control sub-identifier. The first extended mode control sub-identifier can be set to one of six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended mode control sub-identifier can be set to the other of these six sets. For instance, the first extended mode control sub-identifier can be set to the video parameter set, in which case the second extended mode control sub-identifier can be set to any one of the five sets: sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. Alternatively, the first extended mode control sub-identifier can be set to the sequence parameter set, in which case the second extended mode control sub-identifier can be set to any one of the four sets: image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. And so on.

[0182] The encoding and decoding methods provided in this application will be described in detail below with reference to different specific embodiments.

[0183] Example 1:

[0184] This embodiment provides an encoding method for the encoding end, which involves the construction candidate (spatial adjacency candidate) expansion of the Merge pattern.

[0185] The specific implementation process of this method is as follows:

[0186] (1) Iterate through each candidate sequentially from position A → position L → position AR → position BL. First, iterate through position A. If a candidate for position A is available, select that candidate as the candidate for the adjacent position A in the Merge pattern's airspace. Otherwise, expand the adjacent candidates in the airspace of position A, and take the first available expanded adjacent candidate as the candidate for the adjacent position A in the Merge pattern's airspace. Then, iterate through position L. If a candidate for position L is available, select that candidate as the candidate for the adjacent position L in the Merge pattern's airspace. Otherwise, expand the adjacent candidates in the airspace of position L, and take the first available expanded adjacent candidate as the candidate for the adjacent position L in the airspace of the Merge pattern. Then, iterate through position A... For position R, if a candidate for position AR is available, select that candidate as a candidate for adjacent position AR in the Merge mode airspace; otherwise, expand the airspace adjacent candidates of position AR, and take the first available expanded airspace adjacent candidate as a candidate for adjacent position AR in the Merge mode airspace. Finally, traverse positions BL. If a candidate for position BL is available, select that candidate as a candidate for adjacent position BL in the Merge mode airspace; otherwise, expand the airspace adjacent candidates of position BL, and take the first available expanded airspace adjacent candidate as a candidate for adjacent position BL in the Merge mode airspace.

[0187] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When a candidate of AL position is available, select the candidate as the candidate of the adjacent AL position in the Merge mode airspace. Otherwise, expand the adjacent candidates of AL position airspace and take the first available extended adjacent candidate as the candidate of the adjacent AL position in the Merge mode airspace.

[0188] It should be noted that in the above implementation process, when the expansion block at the corresponding position is unavailable, the MVP candidate at the corresponding position is considered to be non-existent.

[0189] For Merge pattern construction candidates, adjacent blocks are considered unusable if at least one of the following conditions is met:

[0190] The adjacent block does not exist, for example, the adjacent block is located at the image boundary or the adjacent block has not been encoded;

[0191] The prediction mode for adjacent blocks is non-inter-frame mode;

[0192] Adjacent position blocks are in intra-frame mode and not TMP (Template Matching Prediction);

[0193] Adjacent blocks and the current coded block belong to the same MER (Motion Estimation Region);

[0194] The adjacent block and the current coded block belong to the same coded unit;

[0195] If the motion vector of an adjacent block is available, but the motion vector is duplicated with an existing MVP candidate in the MVP candidate list, then the adjacent block is also considered unavailable.

[0196] In some cases, the use of the feature to expand adjacent candidates in the airspace can be controlled by a syntax element identifier (i.e., an expansion control identifier).

[0197] The following is a detailed description of each syntax element identifier (i.e., extension control identifier). It should be noted that the syntax element identifiers in this embodiment include, but are not limited to, the various element identifiers described below.

[0198] In some implementations, the use of extended control identifiers is notified at the video layer of the encoded bitstream, namely the Video Parameter Set (VPS).

[0199] As shown in Table 1 below, Table 1 is a syntax table of the video parameter set at the video level of the encoded bitstream. It should be noted that the values ​​of each identifier in the following tables of this embodiment are only illustrative examples. In practical applications, other types of values ​​can also be used. For example, "true" and "false" can be used to replace "1" and "0", or other types of characters or symbols can be used to replace "1" and "0", etc.

[0200] Table 1

[0201]

[0202] The semantic descriptions of the relevant syntax fields in Table 1 are as follows:

[0203] `vps_spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the extension function is enabled at the video layer level. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of the syntax fields in Table 1 is not limited to this embodiment.

[0204] In some implementations, the use of extended control flags is notified at the sequence level of the encoded bitstream, namely the Sequence Parameter Set (SPS).

[0205] As shown in Table 2 below, Table 2 is the syntax table of the video parameter set at the encoded bitstream sequence level, as detailed below.

[0206] Table 2

[0207]

[0208] The semantic descriptions of the relevant syntax fields in Table 2 are as follows:

[0209] `sps_spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the extension function is enabled at the sequence level. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of the syntax fields in Table 2 is not limited to this embodiment.

[0210] In some implementations, the use of extended control identifiers is notified at the image level of the encoded bitstream, namely in the Picture Parameter Set (PPS) or Picture Header (PH).

[0211] As shown in Table 3 below, Table 3 is the syntax table of the video parameter set at the encoded bitstream image level, as detailed below.

[0212] Table 3

[0213]

[0214] The semantic descriptions of the relevant syntax fields in Table 3 are as follows:

[0215] `ph_spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the extension function is enabled at the image layer level. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of the syntax fields in Table 3 is not limited to this embodiment.

[0216] In some implementations, the use of extended control identifiers is indicated at the slice level of the encoded bitstream, i.e., in the slice header (SH).

[0217] As shown in Table 4 below, Table 4 is the syntax table for the header of the bit stream layer of the encoding, as detailed below.

[0218] Table 4

[0219]

[0220] The semantic descriptions of the relevant syntax fields in Table 4 are as follows:

[0221] `sh_spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the extension function is enabled at the slice level (Slice level). A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of the syntax fields in Table 4 is not limited to this embodiment.

[0222] In some implementations, the use of extended control identifiers is notified at the coding unit level of the encoded bitstream, i.e., in the coding unit syntax.

[0223] As shown in Table 5 below, Table 5 is the syntax table of coding units at the coding bitstream coding unit level, as detailed below.

[0224] Table 5

[0225]

[0226] The semantic descriptions of the relevant syntax fields in Table 5 are as follows:

[0227] `spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the encoding unit enables the extension function. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of the syntax fields in Table 5 is not limited to this embodiment.

[0228] It should be noted that the above-mentioned syntax element identifiers (i.e., extension control identifiers) can be used in any combination or individually, and this embodiment does not impose any specific limitations on this.

[0229] Example 2:

[0230] This embodiment provides a decoding method for the decoding end, which involves expanding the construction candidates (spatial adjacency candidates) of the Merge pattern. This embodiment places the expanded spatial adjacency candidates at corresponding positions within the spatial adjacency MVP candidate list.

[0231] The specific implementation process of this method is as follows:

[0232] First, the extended control identifier is parsed from the video bitstream. The syntax design of the extended control identifier is the same as in Implementation Example 1, and will not be repeated here.

[0233] Then, based on the parsed extended control identifier, it is determined whether the function of extending adjacent candidates in the spatial domain is enabled, and different processing is performed according to the determination result.

[0234] If the determination result is that the extension function is not enabled, then the common method is used to construct the spatially adjacent MVP candidate list. The construction process is as follows:

[0235] (1) Traverse each candidate in the order of position A → position L → position AR → position BL. First, traverse position A. When a candidate for position A is available, select that candidate as the candidate for the adjacent position A in the Merge pattern airspace. Then, traverse position L. When a candidate for position L is available, select that candidate as the candidate for the adjacent position L in the Merge pattern airspace. Next, traverse position AR. When a candidate for position AR is available, select that candidate as the candidate for the adjacent position AR in the Merge pattern airspace. Finally, traverse position BL. When a candidate for position BL is available, select that candidate as the candidate for the adjacent position BL in the Merge pattern airspace.

[0236] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When a candidate of AL position is available, then select the candidate as the candidate of the adjacent AL position in the Merge mode spatial domain.

[0237] If the determination result is to enable the extended function, the method provided in the embodiments of this application is used to construct the spatial adjacent MVP candidate list. The construction process is the same as the process described in Embodiment 1, and will not be repeated here.

[0238] Example 3:

[0239] This embodiment provides an encoding method for the encoding end, which involves expanding the construction candidates (spatial adjacency candidates) of the Merge pattern. This embodiment places the expanded spatial adjacency candidates at corresponding positions within the spatial adjacency MVP candidate list.

[0240] The specific implementation process of this method is as follows:

[0241] (1) Traverse each candidate in the order of position A → position L → position AR → position BL. The difference between this embodiment and embodiment one is that when a candidate at a certain position is unavailable, the expansion of the adjacent candidates in the spatial domain of that position can be performed or not, depending on whether the set rules are met. That is, when there are unavailable candidates at positions A, L, AR, BL and AL, at least one candidate at that position is expanded.

[0242] For example, first iterate through position A. If a candidate for position A is available, select that candidate as the candidate for the spatial neighbor of position A in the Merge pattern. Otherwise, expand the spatial neighbor candidates for position A and take the first available expanded spatial neighbor candidate as the candidate for the spatial neighbor of position A in the Merge pattern. Then iterate through position L. If a candidate for position L is available, select that candidate as the candidate for the spatial neighbor of position L in the Merge pattern. Otherwise, expand the spatial neighbor candidates for position L and take the first available expanded spatial neighbor candidate as the candidate for the spatial neighbor of position L in the Merge pattern. Next, iterate through position AR. If a candidate for position AR is available, select that candidate as the candidate for the spatial neighbor of position AR in the Merge pattern. Otherwise, do not expand the spatial neighbor candidates for position AR, and at this time, the candidate for position AR is unavailable. Finally, iterate through position BL. If a candidate for position BL is available, select that candidate as the candidate for the spatial neighbor of position BL in the Merge pattern. Otherwise, do not expand the spatial neighbor candidates for position BL, and at this time, the candidate for position BL is unavailable.

[0243] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When the candidate of AL position is available, then select the candidate as the candidate of the spatial adjacent AL position of Merge mode. Otherwise, do not expand the spatial adjacent candidate of AL position. At this time, the candidate of AL position is unavailable.

[0244] It should be noted that in the above implementation process, when the expansion block at the corresponding position is unavailable, the MVP candidate at the corresponding position is considered to be non-existent.

[0245] It should be noted that in the above implementation process, the method for determining whether the candidates at adjacent positions are available can follow the determination method in Embodiment 1. That is, if at least one of the multiple conditions described in Embodiment 1 is met, the adjacent position block is considered unavailable.

[0246] It should be noted that the rule described in this embodiment, "when a candidate for a certain location is unavailable, the expansion of the spatial adjacent candidates for that location can be selected or not based on whether the set rules are met," may include, but is not limited to, the following situations:

[0247] Case 1: If the left adjacent block is unavailable, expand the left adjacent block; if the bottom left adjacent block is unavailable, expand the bottom left adjacent block; if the top adjacent block is unavailable, expand the top adjacent block; if the top right adjacent block is unavailable, expand the top right adjacent block; if the top left adjacent block is unavailable, expand the top left adjacent block.

[0248] If at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is unavailable or all of them are unavailable, then expand the position of at least one of the five adjacent blocks (left, bottom left, top, top right, and top left).

[0249] Scenario 2: When the adjacent blocks at the corresponding position are unavailable, the decision to expand or not to expand is made based on certain judgment conditions, such as the order in which the positions are traversed. For example, only the positions traversed first are expanded, while the positions traversed later are not expanded.

[0250] Scenario 3: When the adjacent blocks at the corresponding position are unavailable, the decision to extend or not to extend is made based on certain judgment conditions, such as the distance between the extended block and the center of the current coding block. For example, only blocks that are close to the center of the current coding block are extended, while those that are far away are not extended.

[0251] Case 4: When the adjacent blocks at the corresponding position are unavailable, only certain specific positions are expanded. For example, when the left adjacent block, the top adjacent block, and the bottom left adjacent block are all unavailable, only the left adjacent block and the top adjacent block are expanded.

[0252] In some cases, the use of the feature to expand adjacent candidates in the airspace can be controlled by syntax element identifiers (including expansion control identifiers and expansion mode control identifiers).

[0253] The following provides a detailed description of each syntax element identifier (including extension control identifier and extension mode control identifier). It should be noted that the syntax element identifiers in this embodiment include, but are not limited to, the various element identifiers described below.

[0254] In some implementations, at the video level of the encoded bitstream, i.e., in the video parameter set notification, extended control identifiers and extended mode control identifiers are used.

[0255] As shown in Table 6 below, Table 6 is a syntax table of the video parameter set at the video level of the encoded bitstream. It should be noted that the values ​​of each identifier in the following tables of this embodiment are only illustrative examples. In practical applications, other types of values ​​can also be used. For example, "true" and "false" can be used to replace "1" and "0", or other types of characters or symbols can be used to replace "1" and "0", etc.

[0256] Table 6

[0257]

[0258] The semantic descriptions of the relevant syntax fields in Table 6 are as follows:

[0259] `vps_spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the extension function is enabled at the video layer level. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of this syntax field in Table 6 is not limited to this embodiment.

[0260] `vps_spatial_adjacent_condition_ext_flag`: This flag controls the expansion method. When expansion is enabled at the video layer, it indicates whether conditional expansion is enabled. A value of 0 indicates that all adjacent blocks are expanded if one is unavailable, while a value of 1 indicates that only a portion of the adjacent blocks are conditionally expanded if one is unavailable. It should be noted that the representation of this syntax field in Table 6 is not limited to this embodiment.

[0261] In some implementations, at the sequence level of the encoded bitstream, i.e., in the sequence parameter set, the use of extended control flags and extended mode control flags is notified.

[0262] As shown in Table 7 below, Table 7 is the syntax table for the video parameter set at the encoded bitstream sequence level, as detailed below.

[0263] Table 7

[0264]

[0265] The semantic descriptions of the relevant syntax fields in Table 7 are as follows:

[0266] `sps_spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the extension function is enabled at the sequence level. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of this syntax field in Table 7 is not limited to this embodiment.

[0267] `sps_spatial_adjacent_condition_ext_flag`: This flag controls the extension method. When extension is enabled at the sequence level, it indicates whether conditional extension is enabled. A value of 0 indicates that all adjacent blocks are extended if one is unavailable, while a value of 1 indicates that only a portion of the adjacent blocks are conditionally extended if one is unavailable. It should be noted that the representation of this syntax field in Table 7 is not limited to this embodiment.

[0268] In some implementations, the use of extended control flags and extended mode control flags is indicated at the image level of the encoded bitstream, i.e., in the image parameter set or image header.

[0269] As shown in Table 8 below, Table 8 is the syntax table for the video parameter set at the encoded bitstream image level, as detailed below.

[0270] Table 8

[0271]

[0272] The semantic descriptions of the relevant syntax fields in Table 8 are as follows:

[0273] ph_spatial_adjacent_ext_enabled_flag: This represents the extension control flag, used to indicate whether the extension function is enabled at the image layer level. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of this syntax field in Table 8 is not limited to this embodiment.

[0274] `ph_spatial_adjacent_condition_ext_flag`: This flag controls the expansion method. When expansion is enabled at the image layer level, it indicates whether conditional expansion is enabled. A value of 0 indicates that all adjacent blocks are expanded if one is unavailable, while a value of 1 indicates that only a portion of the adjacent blocks are conditionally expanded if one is unavailable. It should be noted that the representation of this syntax field in Table 8 is not limited to this embodiment.

[0275] In some implementations, the use of extended control flags and extended mode control flags is notified at the slice level of the encoded bitstream, i.e., in the slice header.

[0276] As shown in Table 9 below, Table 9 is the syntax table for the header of the encoded bit stream layer, as detailed below.

[0277] Table 9

[0278]

[0279] The semantic descriptions of the relevant syntax fields in Table 9 are as follows:

[0280] sh_spatial_adjacent_ext_enabled_flag: This represents the extension control flag, used to indicate whether the extension function is enabled at the fragment level. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of this syntax field in Table 9 is not limited to this embodiment.

[0281] `sh_spatial_adjacent_condition_ext_flag`: This flag controls the expansion method. When expansion is enabled at the slice level, it indicates whether conditional expansion is enabled. A value of 0 indicates that all adjacent blocks are expanded if one is unavailable, while a value of 1 indicates that only a portion of the adjacent blocks are conditionally expanded if one is unavailable. It should be noted that the representation of this syntax field in Table 9 is not limited to this embodiment.

[0282] In some implementations, the use of extended control flags and extended mode control flags is indicated at the coding unit level of the encoded bitstream, i.e., in the coding unit syntax.

[0283] As shown in Table 10 below, Table 10 is the syntax table of coding units at the coding bitstream coding unit level, as detailed below.

[0284] Table 10

[0285]

[0286] The semantic descriptions of the relevant syntax fields in Table 10 are as follows:

[0287] `spatial_adjacent_ext_enabled_flag`: This represents the extension control flag, used to indicate whether the encoding unit enables the extension function. A value of 1 indicates that it is enabled, and a value of 0 indicates that it is not enabled. It should be noted that the representation of this syntax field in Table 10 is not limited to this embodiment.

[0288] `spatial_adjacent_condition_ext_flag`: This flag controls the extension method. When extension functionality is enabled in the encoding unit, it indicates whether conditional extension is enabled. A value of 0 indicates that all adjacent blocks are extended if one is unavailable, while a value of 1 indicates that only a portion of the adjacent blocks are conditionally extended if one is unavailable. It should be noted that the representation of this syntax field in Table 10 is not limited to this embodiment.

[0289] It should be noted that the above-mentioned syntax element identifiers (including extension control identifiers and extension mode control identifiers) can be used in any combination or individually, and this embodiment does not impose any specific limitations on this.

[0290] Example 4:

[0291] This embodiment provides a decoding method for the decoding end, which involves expanding the construction candidates (spatial adjacency candidates) of the Merge pattern. This embodiment places the expanded spatial adjacency candidates at corresponding positions within the spatial adjacency MVP candidate list.

[0292] The specific implementation process of this method is as follows:

[0293] First, the extended control identifier and the extended mode control identifier are parsed from the video bitstream. The syntax design of the extended control identifier and the extended mode control identifier is the same as in Example 3, and will not be repeated here.

[0294] Then, based on the parsed extension control identifier, it is determined whether the function of extending adjacent candidates in the airspace is enabled, and based on the parsed extension method control identifier, it is determined whether the full extension function or the partial extension function is enabled, and different processing is performed according to the judgment results.

[0295] If the determination result is that the extension function is not enabled, then the common method is used to construct the spatially adjacent MVP candidate list. The construction process is as follows:

[0296] (1) Traverse each candidate in the order of position A → position L → position AR → position BL. First, traverse position A. When a candidate for position A is available, select that candidate as the candidate for the adjacent position A in the Merge pattern airspace. Then, traverse position L. When a candidate for position L is available, select that candidate as the candidate for the adjacent position L in the Merge pattern airspace. Next, traverse position AR. When a candidate for position AR is available, select that candidate as the candidate for the adjacent position AR in the Merge pattern airspace. Finally, traverse position BL. When a candidate for position BL is available, select that candidate as the candidate for the adjacent position BL in the Merge pattern airspace.

[0297] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When a candidate of AL position is available, then select the candidate as the candidate of the adjacent AL position in the Merge mode spatial domain.

[0298] If the determination result is that the extended function is enabled, and all or part of the extended function is enabled, then the corresponding method provided in the embodiments of this application is used to construct the spatial adjacent MVP candidate list. The construction process is the same as the process described in Embodiment 3, and will not be repeated here.

[0299] Example 5:

[0300] This embodiment provides an encoding method for the encoding end, which involves expanding the construction candidates (spatial adjacency candidates) of the Merge pattern. This embodiment places the expanded spatial adjacency candidates between any two adjacent candidate types from the ten categories included in the MVP candidate list: spatial adjacency candidates, temporal candidates, spatial non-adjacency candidates, historical candidates, cross-candidates, chained candidates, pairwise average candidates, affine historical candidates, supplementary CMVP candidates, and zero candidates. For example, the expanded spatial adjacency candidates are placed in the position "after temporal candidates and before spatial non-adjacency candidates" in the MVP candidate list.

[0301] The specific implementation process of this method is as follows:

[0302] (1) Iterate through each candidate in the order of position A → position L → position AR → position BL. First, iterate through position A. If a candidate for position A is available, select that candidate as the candidate for the adjacent position A in the Merge pattern's airspace. Otherwise, expand the adjacent candidates in the airspace of position A, and take the first available expanded adjacent candidate as the candidate for the adjacent position A in the Merge pattern's airspace. Then, iterate through position L. If a candidate for position L is available, select that candidate as the candidate for the adjacent position L in the Merge pattern's airspace. Otherwise, expand the adjacent candidates in the airspace of position L, and take the first available expanded adjacent candidate as the candidate for the adjacent position L in the airspace of the Merge pattern. Then, iterate through position A... For position R, if a candidate for position AR is available, select that candidate as a candidate for adjacent position AR in the Merge mode airspace; otherwise, expand the airspace adjacent candidates of position AR, and take the first available expanded airspace adjacent candidate as a candidate for adjacent position AR in the Merge mode airspace. Finally, traverse positions BL. If a candidate for position BL is available, select that candidate as a candidate for adjacent position BL in the Merge mode airspace; otherwise, expand the airspace adjacent candidates of position BL, and take the first available expanded airspace adjacent candidate as a candidate for adjacent position BL in the Merge mode airspace.

[0303] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When a candidate of AL position is available, select the candidate as the candidate of the adjacent AL position in the Merge mode airspace. Otherwise, expand the adjacent candidates of AL position airspace and take the first available extended adjacent candidate as the candidate of the adjacent AL position in the Merge mode airspace.

[0304] It should be noted that in the above implementation process, when the expansion block at the corresponding position is unavailable, the MVP candidate at the corresponding position is considered to be non-existent.

[0305] It should be noted that in the above implementation process, the method for determining whether the candidates at adjacent positions are available can follow the determination method in Embodiment 1. That is, if at least one of the multiple conditions described in Embodiment 1 is met, the adjacent position block is considered unavailable.

[0306] In some cases, the use of the function to expand adjacent candidates in the spatial domain can be controlled by a syntax element identifier (i.e., the expansion control identifier). It should be noted that the design of this syntax element identifier (i.e., the expansion control identifier) ​​is the same as in Embodiment 1, and will not be repeated here.

[0307] Example 6:

[0308] This embodiment provides a decoding method for the decoding end, which involves expanding the construction candidates (spatial adjacency candidates) of the Merge pattern. This embodiment places the expanded spatial adjacency candidates between any two adjacent candidate types from the ten categories included in the MVP candidate list: spatial adjacency candidates, temporal candidates, spatial non-adjacency candidates, historical candidates, cross-candidates, chained candidates, pairwise average candidates, affine historical candidates, supplementary CMVP candidates, and zero candidates. For example, the expanded spatial adjacency candidates are placed in the position "after temporal candidates and before spatial non-adjacency candidates" in the MVP candidate list.

[0309] The specific implementation process of this method is as follows:

[0310] First, the extended control identifier is parsed from the video bitstream. The syntax design of the extended control identifier is the same as in Implementation Example 1, and will not be repeated here.

[0311] Then, based on the parsed extended control identifier, it is determined whether the function of extending adjacent candidates in the spatial domain is enabled, and different processing is performed according to the determination result.

[0312] If the determination result is that the extension function is not enabled, then the common method is used to construct the spatially adjacent MVP candidate list. The construction process is as follows:

[0313] (1) Traverse each candidate in the order of position A → position L → position AR → position BL. First, traverse position A. When a candidate for position A is available, select that candidate as the candidate for the adjacent position A in the Merge pattern airspace. Then, traverse position L. When a candidate for position L is available, select that candidate as the candidate for the adjacent position L in the Merge pattern airspace. Next, traverse position AR. When a candidate for position AR is available, select that candidate as the candidate for the adjacent position AR in the Merge pattern airspace. Finally, traverse position BL. When a candidate for position BL is available, select that candidate as the candidate for the adjacent position BL in the Merge pattern airspace.

[0314] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When a candidate of AL position is available, then select the candidate as the candidate of the adjacent AL position in the Merge mode spatial domain.

[0315] If the determination result is to enable the extended function, the method provided in the embodiments of this application is used to construct the spatial adjacent MVP candidate list. The construction process is the same as the process described in Embodiment 5, and will not be repeated here.

[0316] Example 7:

[0317] This embodiment provides an encoding method for the encoding end, which involves expanding the construction candidates (spatial adjacency candidates) of the Merge pattern. This embodiment places the expanded spatial adjacency candidates between any two adjacent candidate types from the ten categories included in the MVP candidate list: spatial adjacency candidates, temporal candidates, spatial non-adjacency candidates, historical candidates, cross-candidates, chained candidates, pairwise average candidates, affine historical candidates, supplementary CMVP candidates, and zero candidates. For example, the expanded spatial adjacency candidates are placed in the position "after temporal candidates and before spatial non-adjacency candidates" in the MVP candidate list.

[0318] The specific implementation process of this method is as follows:

[0319] (1) Traverse each candidate in the order of position A → position L → position AR → position BL. The difference between this embodiment and embodiment one is that when a candidate at a certain position is unavailable, the expansion of the adjacent candidates in the spatial domain of that position can be performed or not, depending on whether the set rules are met. That is, when there are unavailable candidates at positions A, L, AR, BL and AL, at least one candidate at that position is expanded.

[0320] For example, first iterate through position A. If a candidate for position A is available, select that candidate as the candidate for the spatial neighbor of position A in the Merge pattern. Otherwise, expand the spatial neighbor candidates for position A and take the first available expanded spatial neighbor candidate as the candidate for the spatial neighbor of position A in the Merge pattern. Then iterate through position L. If a candidate for position L is available, select that candidate as the candidate for the spatial neighbor of position L in the Merge pattern. Otherwise, expand the spatial neighbor candidates for position L and take the first available expanded spatial neighbor candidate as the candidate for the spatial neighbor of position L in the Merge pattern. Next, iterate through position AR. If a candidate for position AR is available, select that candidate as the candidate for the spatial neighbor of position AR in the Merge pattern. Otherwise, do not expand the spatial neighbor candidates for position AR, and at this time, the candidate for position AR is unavailable. Finally, iterate through position BL. If a candidate for position BL is available, select that candidate as the candidate for the spatial neighbor of position BL in the Merge pattern. Otherwise, do not expand the spatial neighbor candidates for position BL, and at this time, the candidate for position BL is unavailable.

[0321] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When the candidate of AL position is available, then select the candidate as the candidate of the spatial adjacent AL position of Merge mode. Otherwise, do not expand the spatial adjacent candidate of AL position. At this time, the candidate of AL position is unavailable.

[0322] It should be noted that in the above implementation process, when the expansion block at the corresponding position is unavailable, the MVP candidate at the corresponding position is considered to be non-existent.

[0323] It should be noted that in the above implementation process, the method for determining whether the candidates at adjacent positions are available can follow the determination method in Embodiment 1. That is, if at least one of the multiple conditions described in Embodiment 1 is met, the adjacent position block is considered unavailable.

[0324] It should be noted that the rule described in this embodiment, "when a candidate for a certain location is unavailable, the expansion of the spatial adjacent candidates for that location can be selected or not based on whether the set rules are met," may include, but is not limited to, the following situations:

[0325] Case 1: If the left adjacent block is unavailable, expand the left adjacent block; if the bottom left adjacent block is unavailable, expand the bottom left adjacent block; if the top adjacent block is unavailable, expand the top adjacent block; if the top right adjacent block is unavailable, expand the top right adjacent block; if the top left adjacent block is unavailable, expand the top left adjacent block.

[0326] If at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is unavailable or all of them are unavailable, then expand the position of at least one of the five adjacent blocks (left, bottom left, top, top right, and top left).

[0327] Scenario 2: When the adjacent blocks at the corresponding position are unavailable, the decision to expand or not to expand is made based on certain judgment conditions, such as the order in which the positions are traversed. For example, only the positions traversed first are expanded, while the positions traversed later are not expanded.

[0328] Scenario 3: When the adjacent blocks at the corresponding position are unavailable, the decision to extend or not to extend is made based on certain judgment conditions, such as the distance between the extended block and the center of the current coding block. For example, only blocks that are close to the center of the current coding block are extended, while those that are far away are not extended.

[0329] Case 4: When the adjacent blocks at the corresponding position are unavailable, only certain specific positions are expanded. For example, when the left adjacent block, the top adjacent block, and the bottom left adjacent block are all unavailable, only the left adjacent block and the top adjacent block are expanded.

[0330] In some cases, to identify whether the function of expanding adjacent candidates in the spatial domain is used, it can be controlled by syntax element identifiers (i.e., expansion control identifiers and expansion mode control identifiers). It should be noted that the design of these syntax element identifiers (i.e., expansion control identifiers and expansion mode control identifiers) is the same as in Embodiment 3, and will not be repeated here.

[0331] Example 8:

[0332] This embodiment provides a decoding method for the decoding end, which involves expanding the construction candidates (spatial adjacency candidates) of the Merge pattern. This embodiment places the expanded spatial adjacency candidates between any two adjacent candidate types from the ten categories included in the MVP candidate list: spatial adjacency candidates, temporal candidates, spatial non-adjacency candidates, historical candidates, cross-candidates, chained candidates, pairwise average candidates, affine historical candidates, supplementary CMVP candidates, and zero candidates. For example, the expanded spatial adjacency candidates are placed in the position "after temporal candidates and before spatial non-adjacency candidates" in the MVP candidate list.

[0333] The specific implementation process of this method is as follows:

[0334] First, the extended control identifier is parsed from the video bitstream. The syntax design of the extended control identifier is the same as in Example 3, and will not be repeated here.

[0335] Then, based on the parsed extended control identifier, it is determined whether the function of extending adjacent candidates in the spatial domain is enabled, and different processing is performed according to the determination result.

[0336] If the determination result is that the extension function is not enabled, then the common method is used to construct the spatially adjacent MVP candidate list. The construction process is as follows:

[0337] (1) Traverse each candidate in the order of position A → position L → position AR → position BL. First, traverse position A. When a candidate for position A is available, select that candidate as the candidate for the adjacent position A in the Merge pattern airspace. Then, traverse position L. When a candidate for position L is available, select that candidate as the candidate for the adjacent position L in the Merge pattern airspace. Next, traverse position AR. When a candidate for position AR is available, select that candidate as the candidate for the adjacent position AR in the Merge pattern airspace. Finally, traverse position BL. When a candidate for position BL is available, select that candidate as the candidate for the adjacent position BL in the Merge pattern airspace.

[0338] (2) If the number of candidates traversed in the order of A position → L position → AR position → BL position is less than 4, then continue to traverse AL position. When a candidate of AL position is available, then select the candidate as the candidate of the adjacent AL position in the Merge mode spatial domain.

[0339] If the determination result is to enable the extended function, the method provided in the embodiment of this application is used to construct the spatial adjacent MVP candidate list. The construction process is the same as the process described in Embodiment 7, and will not be repeated here.

[0340] It should be noted that the above embodiments one to eight are only applied to processing blocks of a limited size. That is, the processing process provided in this embodiment is only applied when the width or height of the current block (e.g., the current encoding block or the current decoding block) is greater than or equal to the given value, or the area is greater than or equal to the given value.

[0341] Additionally, refer to Figure 12 As shown, one embodiment of this application also discloses an electronic device 1200, which includes at least one processor 1210; at least one memory 1220 for storing at least one program; when the at least one program is executed by the at least one processor 1210, it implements the decoding method as in any of the preceding embodiments, or implements the encoding method as in any of the preceding embodiments.

[0342] In addition, one embodiment of this application discloses a computer-readable storage medium storing computer-executable instructions for performing the decoding method as described in any of the preceding embodiments, or for performing the encoding method as described in any of the preceding embodiments.

[0343] Furthermore, one embodiment of this application discloses a computer program product, including a computer program or computer instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer instructions from the computer-readable storage medium and executes the computer program or computer instructions, causing the electronic device to perform a decoding method as described in any of the preceding embodiments, or to perform an encoding method as described in any of the preceding embodiments.

[0344] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a video stream, the video stream including identification information, the identification information including at least one of the following:

[0345] Extended control identification information is used to indicate whether to extend the target adjacent location block when the availability of the target adjacent location block is unavailable;

[0346] The extension method control identifier information is used to indicate whether to extend all target adjacent blocks or to extend only a portion of target adjacent blocks when the extension control identifier indicates that the target adjacent block should be extended when the availability of the target adjacent block is unavailable.

[0347] Furthermore, embodiments of this application also provide a method or apparatus for storing and / or transmitting video streams, the video streams including the identification information described in the preceding embodiments.

[0348] Furthermore, embodiments of this application also provide a method or apparatus for receiving and / or storing video streams, the video streams including the identification information described in the preceding embodiments.

[0349] Furthermore, this application also provides a computer program product storing computer-executable instructions, which, when executed by the processor of an electronic device, cause the electronic device to store, transmit, or receive a video stream, the video stream including the identification information described in the preceding embodiments.

[0350] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0351] The above is a detailed description of the preferred embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A video decoding method, comprising: Receive the video stream, which includes candidate indices for the Merge pattern; Determine the availability of the target adjacent block in the current frame for the current decoded block; In response to the unavailability of the target adjacent location block, the target adjacent location block is expanded to obtain the expanded adjacent block of the target adjacent location block, and a motion vector prediction MVP candidate list is constructed based on the expanded adjacent block; The target MVP candidate corresponding to the current decoding block is retrieved from the MVP candidate list according to the candidate index, and the current decoding block is decoded according to the retrieved target MVP candidate.

2. The decoding method according to claim 1, characterized in that, The MVP candidate list includes multiple types of MVP candidates, including spatial adjacency candidate types. The construction of the MVP candidate list based on the extended adjacent blocks includes one of the following: The motion vectors of the extended adjacent blocks are used as MVP candidates and placed into the MVP candidates of the spatial adjacent candidate type. The motion vectors of the extended adjacent blocks are used as MVP candidates and placed between any two adjacent MVP candidates from the various types.

3. The decoding method according to claim 1, characterized in that, Determining the availability of the target adjacent position block of the current decoded block in the current frame includes: The availability of the target neighboring block is determined to be unavailable in response to the target neighboring block of the current decoded block in the current frame satisfying at least one of the following conditions: The target adjacent location block does not exist; The prediction mode for the adjacent blocks of the target is a non-inter-frame mode; The prediction mode for the target adjacent location block is the intra-frame prediction mode and not the template matching prediction mode. The target adjacent location block and the current decoded block belong to the same motion estimation region; The target adjacent position block and the current decoding block belong to the same decoding unit; The motion vector of the target adjacent location block is the same as that of the MVP candidate in the MVP candidate list.

4. The decoding method according to claim 1, characterized in that, Determining the availability of the target adjacent position block of the current decoded block in the current frame includes: The availability of the target adjacent position block in the current frame is determined according to the preset traversal order.

5. The decoding method according to claim 4, characterized in that, The target adjacent location block includes at least one of the following: Left adjacent block, bottom left adjacent block, top adjacent block, top right adjacent block, top left adjacent block.

6. The decoding method according to claim 5, characterized in that, The step of expanding the target adjacent location block to obtain the expanded adjacent block of the target adjacent location block includes: The target adjacent location block is expanded based on at least one of the following strategies to obtain the expanded adjacent block of the target adjacent location block: Expand at least one of the target adjacent location blocks that are determined to be unavailable; Expand the first preset number of position blocks in the traversal order; The blocks that are close to the center of the current decoded block in the traversal order are expanded, while the blocks that are far from the center of the current decoded block in the traversal order are not expanded. Among the five adjacent blocks (left, lower left, upper, upper right, and upper left), at least one block with a stronger correlation to the current decoding block is expanded.

7. The decoding method according to claim 6, characterized in that, Expanding at least one of the target adjacent location blocks determined to be unavailable includes at least one of the following: In response to the left adjacent position block being unavailable, the left adjacent position block is expanded; In response to the lower left adjacent block being unavailable, the lower left adjacent block is expanded; In response to the above adjacent position block being unavailable, the above adjacent position block is expanded; In response to the top-right adjacent block being unavailable, the top-right adjacent block is expanded; In response to the top-left adjacent block being unavailable, the top-left adjacent block is expanded; In response to at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) being unavailable or all of them being unavailable, at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is expanded.

8. The decoding method according to claim 6, characterized in that, The expansion of the target adjacent location block includes at least one of the following methods: For the adjacent blocks above, expand horizontally; For the left adjacent position block, expand vertically; For the adjacent block at the upper right position, expand it horizontally or diagonally; For the lower left adjacent block, expand it vertically or diagonally; For the block adjacent to the upper left position, expand it horizontally, vertically, or diagonally.

9. The decoding method according to claim 6, characterized in that, The number of the extended adjacent blocks is one or more.

10. The decoding method according to claim 9, characterized in that, The construction of the MVP candidate list based on the extended adjacent blocks includes one of the following: The motion vector of the first available extended neighboring block of the target adjacent position block is used as an MVP candidate and added to the MVP candidate list. The average motion vectors of multiple available extended neighboring blocks of the target neighboring location block are used as MVP candidates and added to the MVP candidate list.

11. The decoding method according to claim 1, characterized in that, The video stream also includes an extension control identifier, which indicates whether to extend the target adjacent location block if the availability of the target adjacent location block is unavailable.

12. The decoding method according to claim 11, characterized in that, The extended control identifier is set in at least one of the following six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

13. The decoding method according to claim 12, characterized in that, The expansion control identifier includes multiple expansion control sub-identifiers set in different level parameter sets; the expansion control sub-identifiers set in different level parameter sets are used to indicate whether to expand the target adjacent location block when the availability of the target adjacent location block is unavailable in the corresponding different image processing levels.

14. The decoding method according to claim 13, characterized in that, The plurality of extended control sub-identifiers include a first extended control sub-identifier and a second extended control sub-identifier. The first extended control sub-identifier is set in one of the six sets of video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended control sub-identifier is set in the other of the six sets of video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

15. The decoding method according to claim 11, characterized in that, The video stream also includes an expansion mode control identifier, which is used to indicate whether to expand all or some of the target adjacent location blocks when the expansion control identifier indicates that the target adjacent location blocks should be expanded when the availability of the target adjacent location blocks is unavailable.

16. The decoding method according to claim 15, characterized in that, The extended mode control identifier is set in at least one of the following six parameters: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The parameter set with the extended mode control identifier is at a level lower than or equal to the level of the parameter set with the extended mode control identifier.

17. The decoding method according to claim 16, characterized in that, The expansion mode control identifier includes multiple expansion mode control sub-identifiers set in different level parameter sets; the expansion mode control sub-identifiers set in different level parameter sets are used to indicate that in the corresponding different image processing levels, when it is determined that the target adjacent position blocks need to be expanded, all the target adjacent position blocks are expanded or some of the target adjacent position blocks are expanded.

18. The decoding method according to claim 17, characterized in that, The plurality of extended mode control sub-identifiers include a first extended mode control sub-identifier and a second extended mode control sub-identifier. The first extended mode control sub-identifier is set in one of the six: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended mode control sub-identifier is set in the other of the six: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

19. A video coding method, comprising: Determine the availability of the target adjacent block in the current coded block of the video frame; In response to the unavailability of the target adjacent location block, the target adjacent location block is expanded to obtain the expanded adjacent block of the target adjacent location block, and an MVP candidate list is constructed based on the expanded adjacent block; For each MVP candidate in the MVP candidate list, a cost calculation based on rate-distortion optimization is performed to obtain the target MVP candidate in the MVP candidate list; The current coding block is encoded using the Merge mode based on the target MVP candidate to obtain a video stream, and the candidate index of the target MVP candidate is encoded into the video stream and transmitted to the decoding end.

20. The encoding method according to claim 19, characterized in that, The target MVP candidate is the MVP candidate with the lowest cost within the MVP candidate list.

21. The encoding method according to claim 19, characterized in that, The MVP candidate list includes multiple types of MVP candidates, including spatial adjacency candidate types. The construction of the MVP candidate list based on the extended adjacent blocks includes one of the following: The motion vectors of the extended adjacent blocks are used as MVP candidates and placed into the MVP candidates of the spatial adjacent candidate type. The motion vectors of the extended adjacent blocks are used as MVP candidates and placed between any two adjacent MVP candidates from the various types.

22. The encoding method according to claim 19, characterized in that, Determining the availability of the target adjacent position block of the current coded block in the video frame includes: The availability of a target neighboring block is determined to be unavailable in response to the target neighboring block of the current coded block in the video frame satisfying at least one of the following conditions: The target adjacent location block does not exist; The prediction mode for the adjacent blocks of the target is a non-inter-frame mode; The prediction mode for the target adjacent location block is the intra-frame prediction mode and not the template matching prediction mode. The target adjacent location block and the current encoded block belong to the same motion estimation region; The target adjacent location block and the current coding block belong to the same coding unit; The motion vector of the target adjacent location block is the same as that of the MVP candidate in the MVP candidate list.

23. The encoding method according to claim 19, characterized in that, Determining the availability of the target adjacent position block of the current coded block in the video frame includes: The availability of the target adjacent position block of the current coded block in the video frame is determined according to a preset traversal order.

24. The encoding method according to claim 23, characterized in that, The target adjacent location block includes at least one of the following: Left adjacent block, bottom left adjacent block, top adjacent block, top right adjacent block, top left adjacent block.

25. The encoding method according to claim 24, characterized in that, The step of expanding the target adjacent location block to obtain the expanded adjacent block of the target adjacent location block includes: The target adjacent location block is expanded based on at least one of the following strategies to obtain the expanded adjacent block of the target adjacent location block: Expand at least one of the target adjacent location blocks that are determined to be unavailable; Expand the first preset number of position blocks in the traversal order; The blocks that are close to the center of the current decoded block in the traversal order are expanded, while the blocks that are far from the center of the current decoded block in the traversal order are not expanded. Among the five adjacent blocks (left, lower left, upper, upper right, and upper left), at least one block with a stronger correlation to the current decoding block is expanded.

26. The encoding method according to claim 25, characterized in that, Expanding at least one of the target adjacent location blocks determined to be unavailable includes at least one of the following: In response to the left adjacent position block being unavailable, the left adjacent position block is expanded; In response to the lower left adjacent block being unavailable, the lower left adjacent block is expanded; In response to the above adjacent position block being unavailable, the above adjacent position block is expanded; In response to the top-right adjacent block being unavailable, the top-right adjacent block is expanded; In response to the top-left adjacent block being unavailable, the top-left adjacent block is expanded; In response to at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) being unavailable or all of them being unavailable, at least one of the five adjacent blocks (left, bottom left, top, top right, and top left) is expanded.

27. The encoding method according to claim 25, characterized in that, The expansion of the target adjacent location block includes at least one of the following methods: For the adjacent blocks above, expand horizontally; For the left adjacent position block, expand vertically; For the adjacent block at the upper right position, expand it horizontally or diagonally; For the lower left adjacent block, expand it vertically or diagonally; For the block adjacent to the upper left position, expand it horizontally, vertically, or diagonally.

28. The encoding method according to claim 25, characterized in that, The number of the extended adjacent blocks is one or more.

29. The encoding method according to claim 28, characterized in that, The construction of the MVP candidate list based on the extended adjacent blocks includes one of the following: The motion vector of the first available extended neighboring block of the target adjacent position block is used as an MVP candidate and added to the MVP candidate list. The average motion vectors of multiple available extended neighboring blocks of the target neighboring location block are used as MVP candidates and added to the MVP candidate list.

30. The encoding method according to claim 19, characterized in that, The video stream also includes an extension control identifier, which indicates whether to extend the target adjacent location block if the availability of the target adjacent location block is unavailable.

31. The encoding method according to claim 30, characterized in that, The extended control identifier is set in at least one of the following six sets: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

32. The encoding method according to claim 31, characterized in that, The expansion control identifier includes multiple expansion control sub-identifiers set in different level parameter sets; the expansion control sub-identifiers set in different level parameter sets are used to indicate whether to expand the target adjacent location block when the availability of the target adjacent location block is unavailable in the corresponding different image processing levels.

33. The encoding method according to claim 32, characterized in that, The plurality of extended control sub-identifiers include a first extended control sub-identifier and a second extended control sub-identifier. The first extended control sub-identifier is set in one of the six sets of video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended control sub-identifier is set in the other of the six sets of video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

34. The encoding method according to claim 30, characterized in that, The video stream also includes an expansion mode control identifier, which is used to indicate whether to expand all or some of the target adjacent location blocks when the expansion control identifier indicates that the target adjacent location blocks should be expanded when the availability of the target adjacent location blocks is unavailable.

35. The encoding method according to claim 34, characterized in that, The extended mode control identifier is set in at least one of the following six parameters: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The parameter set with the extended mode control identifier is at a level lower than or equal to the level of the parameter set with the extended mode control identifier.

36. The encoding method according to claim 35, characterized in that, The expansion mode control identifier includes multiple expansion mode control sub-identifiers set in different level parameter sets; the expansion mode control sub-identifiers set in different level parameter sets are used to indicate that in the corresponding different image processing levels, when it is determined that the target adjacent position blocks need to be expanded, all the target adjacent position blocks are expanded or some of the target adjacent position blocks are expanded.

37. The encoding method according to claim 36, characterized in that, The plurality of extended mode control sub-identifiers include a first extended mode control sub-identifier and a second extended mode control sub-identifier. The first extended mode control sub-identifier is set in one of the six: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set. The second extended mode control sub-identifier is set in the other of the six: video parameter set, sequence parameter set, image parameter set, image header parameter set, title sequence parameter set, and coding unit parameter set.

38. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, it implements the video decoding method of any one of claims 1 to 18, or the video encoding method of any one of claims 19 to 37.

39. A computer-readable storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the video decoding method according to any one of claims 1 to 18, or to execute the video encoding method according to any one of claims 19 to 37.

40. A computer program product, comprising a computer program or computer instructions, characterized in that, The computer program or the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer program or the computer instructions from the computer-readable storage medium. The processor executes the computer program or the computer instructions, causing the electronic device to perform the video decoding method according to any one of claims 1 to 18, or the video encoding method according to any one of claims 19 to 37.