A video encoding and decoding method and related device

By determining the right boundary of the search area based on the encoding processing delay in video encoding and decoding, the problem of difficulty in adapting to the parallel processing method in the prior art is solved, and higher video encoding quality and encoding and decoding consistency are achieved.

CN118612445BActive Publication Date: 2025-06-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410702735.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2025-06-24
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

In the prior art, when using Wavefront Parallel Processing (WPP) for video encoding and decoding, the parallel processing method cannot be effectively adapted, which makes it difficult to accurately divide the search area of ​​the reference tiles, affecting the quality of video encoding and decoding.

Method used

By determining the right boundary of the search area according to the encoding processing delay, it is determined in the encoded CTU, ensuring that the search area covers all encoded areas, and avoiding the occurrence of different reference tiles.

Benefits of technology

It effectively improves the encoding quality of the video frame to be encoded, ensures the consistency of the reference tiles during the encoding and decoding process, and improves the overall encoding quality of the video frame.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118612445B_ABST
    Figure CN118612445B_ABST
Patent Text Reader

Abstract

The present application discloses a video encoding and decoding method and related devices, which relate to parallel processing of video frames. The method first determines a current tile to be encoded in a target CTU of a video frame to be encoded, where the target CTU is located in one row of K rows of CTUs in parallel encoding processing, and the encoding progress difference between adjacent rows in parallel encoding processing is the encoding processing delay. According to the encoding processing delay, the right boundary of the search area for the current tile in the video frame to be encoded is determined, and the right boundary is in the encoded CTUs. A reference tile is determined by searching for the current tile in the search area, the current tile is encoded using the reference tile, and the next tile to be encoded is used as the current tile until the encoding of the video frame to be encoded is completed, obtaining an encoded video frame. It is possible to determine the right boundary of the search area in the encoded CTUs based on the encoding processing delay as a determination basis, ensuring that the areas covered by the search area are all encoded areas, and improving the encoding quality of the video frame to be encoded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of video encoding and decoding, and particularly to a video encoding and decoding method and related device. Background Art

[0002] In the related art, wave front parallel processing (WPP) is adopted for video encoding and decoding. In this method, due to the parallel processing, the efficiency of video encoding and decoding is relatively high. During the process of using WPP for video encoding and decoding, intra-frame prediction also needs to be combined. By delimiting a search area, the reference block of the current block is determined to achieve video compression or decompression. Intra-frame prediction refers to improving the efficiency of video compression or decompression by recording the difference information between the current block and the reference block.

[0003] However, in the related art, the method of delimiting the search area is not well applicable to the situation of video encoding and decoding based on WPP.

[0004] In order to adapt to the parallel processing mode of video encoding and decoding based on WPP, there is an urgent need for a video encoding and decoding method that can accurately divide the search area of the reference block. Summary of the Invention

[0005] To solve the above technical problems, this application provides a video encoding and decoding method and related device, which can determine the right boundary of the search area in the encoded CTU according to the encoding processing delay, ensure that the search area covers only the encoded areas, avoid the situation of different reference blocks when encoding and decoding the current block, and improve the encoding quality of the video frame to be encoded.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On the one hand, the embodiments of this application provide a video encoding method, and the method includes:

[0008] Determine a current block to be encoded from a video frame to be encoded, where the current block is in a target coding tree unit (CTU), the video frame to be encoded includes N*M CTUs, the target CTU is in the i-th row of CTUs in the video frame to be encoded, and is in one of the K rows of CTUs in parallel encoding processing, and the encoding progress difference between adjacent rows in the parallel encoding processing is the encoding processing delay, 1<K≤N;

[0009] According to the encoding processing delay, determine the right boundary of the search area of the current block in the video frame to be encoded, where the right boundary is in the encoded CTUs of the (i - 1)-th row of CTUs, and in the video frame to be encoded, the (i - 1)-th row of CTUs is above the i-th row of CTUs;

[0010] Search for the current tile in the search area to determine a reference tile in the search area, where the reference tile is an encoded tile whose pixel similarity to the current tile meets the similarity condition;

[0011] Encode the current tile using the reference tile, and use the next tile to be encoded as the current tile until the encoding of the video frame to be encoded is completed to obtain an encoded video frame.

[0012] On the other hand, an embodiment of the present application provides a video decoding method, and the method includes:

[0013] Determine a current tile to be decoded from an encoded video frame, where the current tile is in a target coding tree unit (CTU), the encoded video frame includes N*M CTUs, the target CTU is in the i-th row of CTUs in the encoded video frame, and is in one of the K rows of CTUs in parallel decoding processing, and the decoding progress difference between adjacent rows in the parallel decoding processing is the decoding processing delay, 1<K≤N;

[0014] According to the decoding processing delay, determine the right boundary of the search area of the current tile in the decoded video frame, where the right boundary is in the decoded CTUs of the (i-1)-th row of CTUs. In the encoded video frame, the (i-1)-th row of CTUs is above the i-th row of CTUs;

[0015] Search for the current tile in the search area to determine a reference tile in the search area, where the reference tile is an encoded tile whose pixel similarity to the current tile meets the similarity condition;

[0016] Decode the current tile using the reference tile, and use the next tile to be decoded as the current tile until the decoding of the encoded video frame is completed to obtain a decoded video frame.

[0017] In yet another aspect, an embodiment of the present application provides a video encoding apparatus, and the apparatus includes: a first determination module, a second determination module, a third determination module, and an encoding module;

[0018] The first determination module is configured to determine a current tile to be encoded from a video frame to be encoded, where the current tile is in a target coding tree unit (CTU), the video frame to be encoded includes N*M CTUs, the target CTU is in the i-th row of CTUs in the video frame to be encoded, and is in one of the K rows of CTUs in parallel encoding processing, and the encoding progress difference between adjacent rows in the parallel encoding processing is the encoding processing delay, 1<K≤N;

[0019] The second determination module is configured to determine a right boundary of a search region of the current tile in the video frame to be encoded according to the encoding processing delay, where the right boundary is in an encoded CTU of the CTU in the (i - 1)-th row, and in the video frame to be encoded, the CTU in the (i - 1)-th row is above the CTU in the i-th row;

[0020] The third determination module is configured to search for the current tile in the search region to determine a reference tile in the search region, where the reference tile is an encoded tile whose pixel similarity to the current tile reaches a similarity condition;

[0021] The encoding module is configured to encode the current tile by using the reference tile, and use the next tile to be encoded as the current tile until the encoding of the video frame to be encoded is completed, obtaining an encoded video frame.

[0022] In another aspect, an embodiment of the present application provides a video decoding device, where the device includes: a first determination module, a second determination module, a third determination module, and a decoding module;

[0023] The first determination module is configured to determine a current tile to be decoded from an encoded video frame, where the current tile is in a target coding tree unit (CTU), the encoded video frame includes N * M CTUs, the target CTU is in the CTU in the i-th row of the encoded video frame, and is in one of K CTUs in parallel decoding processing, and the decoding progress difference between adjacent rows in the parallel decoding processing is a decoding processing delay, 1 < K ≤ N;

[0024] The second determination module is configured to determine a right boundary of a search region of the current tile in the decoded video frame according to the decoding processing delay, where the right boundary is in a decoded CTU of the CTU in the (i - 1)-th row, and in the encoded video frame, the CTU in the (i - 1)-th row is above the CTU in the i-th row;

[0025] The third determination module is configured to search for the current tile in the search region to determine a reference tile in the search region, where the reference tile is an encoded tile whose pixel similarity to the current tile reaches a similarity condition;

[0026] The decoding module is configured to decode the current tile by using the reference tile, and use the next tile to be decoded as the current tile until the decoding of the encoded video frame is completed, obtaining a decoded video frame.

[0027] In another aspect, an embodiment of the present application provides a computer device, where the computer device includes a processor and a memory:

[0028] The memory is used to store a computer program;

[0029] The processor is used to execute the method described in the above aspects according to the computer program.

[0030] In another aspect, an embodiment of the present application provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the method described in the above aspects.

[0031] In another aspect, an embodiment of the present application provides a computer program product including a computer program, which, when running on a computer device, causes the computer device to execute the method described in the above aspects.

[0032] It can be seen from the above technical solutions that in the process of intra-frame encoding a video frame to be encoded by means of parallel encoding processing, the video frame to be encoded is divided into N*M CTUs, the target CTU where the current block to be encoded is located is in the i-th row of CTUs, and the i-th row of CTUs is one of the K rows of CTUs for parallel encoding processing. When intra-frame encoding the current block, the search area of the current block will cover a part of the area in the (i-1)-th row of CTUs and extend a certain length to the right relative to the current block in the (i-1)-th row of CTUs. Although the mechanism of parallel encoding processing is that the encoding progress of adjacent rows of CTUs is not synchronized, the encoding progress of the (i-1)-th row of CTUs is faster than that of the i-th row of CTUs, and the difference between the two is the encoding processing delay. However, in some cases, the search area of the current block will extend to the area where the encoding result in the (i-1)-th row of CTUs is uncertain. If the reference block matched from the search area is in this uncertain area, it is very likely that the reference block used for decoding is inconsistent with that used for encoding, resulting in an incorrect decoded result and affecting the quality of the video frame to be encoded. Therefore, when determining the right boundary of the search area, based on the encoding processing delay as the determination basis, the right boundary is determined in the encoded CTUs of the (i-1)-th row of CTUs to ensure that the area covered by the search area is all encoded areas, avoiding the situation of using different reference blocks for encoding and decoding the current block, and effectively improving the encoding quality of the video frame to be encoded. Description of the Drawings

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0034] Figure 1 It is a schematic diagram of the scenario of a video encoding method provided by an embodiment of the present application;

[0035] Figure 2 Flow chart of a video encoding method provided by an embodiment of the present application;

[0036] Figure 3 Schematic diagram of an encoding process;

[0037] Figure 4 Schematic diagram of a WPP encoding process provided by an embodiment of the present application;

[0038] Figure 5 Another schematic diagram of a WPP encoding process provided by an embodiment of the present application;

[0039] Figure 6 Schematic diagram of determining a pending right boundary based on first position information provided by an embodiment of the present application;

[0040] Figure 7 Another schematic diagram of determining a pending right boundary based on first position information provided by an embodiment of the present application;

[0041] Figure 8 Schematic diagram of determining a pending right boundary based on second position information provided by an embodiment of the present application;

[0042] Figure 9 Another schematic diagram of determining a pending right boundary based on second position information provided by an embodiment of the present application;

[0043] Figure 10 Schematic diagram of determining a right boundary provided by an embodiment of the present application;

[0044] Figure 11 Another schematic diagram of determining a right boundary provided by an embodiment of the present application;

[0045] Figure 12 Schematic diagram of determining a reference block provided by an embodiment of the present application;

[0046] Figure 13 Flow chart of a video encoding method provided by an embodiment of the present application;

[0047] Figure 14 Schematic diagram of a video encoding device provided by an embodiment of the present application;

[0048] Figure 15 Schematic diagram of a video decoding device provided by an embodiment of the present application;

[0049] Figure 16 Structural diagram of a terminal device provided by an embodiment of the present application;

[0050] Figure 17A structural diagram of a server provided by an embodiment of the present application. Detailed implementation manners

[0051] The embodiments of the present application will be described below with reference to the accompanying drawings.

[0052] In the related art, when performing video encoding and decoding, the WPP method can be used, that is, a video frame is divided into several rows according to Coding Tree Units (CTUs). Parallel encoding is performed on multiple rows of CTUs, and there is a processing delay of CTUs for the current row compared with the previous row. Video encoding and decoding through WPP can improve the efficiency of video encoding and decoding.

[0053] At the same time, during the process of video encoding and decoding, the intra-frame prediction method can be used. Intra-frame prediction refers to analyzing the correlation between the current block and the reference block, and performing encoding and decoding on the current block to reduce the redundancy of video data. When determining the reference block of the current block, it is necessary to determine the search area of the reference block to use the search area as the search range of the reference block in the video frame. The intra-frame prediction method can be used on the premise of using WPP for video encoding and decoding to improve the efficiency of video encoding and decoding.

[0054] In the related art, the method for determining the search range of the reference block cannot be well applied to the intra-frame prediction in the process of video encoding and decoding based on the WPP method, which will cause abnormalities in the encoding result and decoding result obtained by video encoding and decoding.

[0055] Therefore, an embodiment of the present application provides a video encoding and decoding method and related device, which can use the encoding processing delay as a determination basis to determine the right boundary of the search area in the encoded CTUs, ensure that the areas covered by the search area are all encoded areas, avoid the situation of different reference blocks when encoding and decoding the current block, and improve the encoding quality of the video frame to be encoded.

[0056] The data processing method provided by the embodiments of the present application can be implemented by a computer device, which can be a terminal device or a server. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and the present application does not limit this. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing.

[0057] Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. applied based on the cloud computing business model, which can form a resource pool and be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the background system for logical processing. Data at different levels will be processed separately, and various industry data requires the support of a powerful system background, which can only be achieved through cloud computing.

[0058] Cloud computing refers to the delivery and usage model of IT infrastructure, which means obtaining the required resources in a on-demand and easily expandable manner through the network; in a broad sense, cloud computing refers to the delivery and usage model of services, which means obtaining the required services in a on-demand and easily expandable manner through the network. Such services can be related to IT and software, the Internet, or other services. Cloud computing is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balance.

[0059] With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the driving forces of demands such as search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from previous parallel distributed computing, the emergence of cloud computing will, in concept, drive revolutionary changes in the entire Internet model and enterprise management model.

[0060] The video encoding and decoding solution provided by the embodiments of this application relates to cloud computing technology. Based on cloud computing technology, parallel encoding processing is performed on CTUs in the video frame to be encoded at the video sending end, and there are differences in the encoding progress of adjacent rows during the parallel encoding processing. Video compression is achieved by encoding the video frame to be encoded, improving the video transmission efficiency. At the same time, based on cloud computing technology, parallel decoding processing is performed on CTUs in the encoded video frame at the video receiving end to achieve decompression of the encoded video frame.

[0061] Figure 1 It is a schematic diagram of the scenario of a video encoding method provided by the embodiments of this application, where the aforementioned computer device is a server.

[0062] When video encoding is required, the server needs to determine the current block to be encoded from the video frame to be encoded. As Figure 1 shown, the video frame to be encoded includes N*M (where N = 6, M = 4) CTUs. The target CTU is in the i-th row of CTUs in the video frame to be encoded (where i = 3). At the same time, this target CTU is in the third row of K rows of CTUs in the parallel encoding processing (where K = 3). During the parallel encoding processing in this figure, the encoding progress difference between adjacent rows is the encoding processing delay, and this encoding processing delay is 2 CTUs. Above Figure 1 is shown the current block, and this current block is located at the lower right of the target CTU. Since the WPP method is used for video encoding, it can be ensured that when encoding the current block, the blocks on the left and above of this current block have been encoded. Therefore, only the right boundary needs to be considered when determining the search area. According to the encoding processing delay, the right boundary of the search area corresponding to the current block in the video frame to be encoded can be determined. As shown in the figure, the determined right boundary is in the encoded CTUs of the (i - 1)-th row of CTUs (where i - 1 = 2), and the (i - 1)-th row is above the i-th row.

[0063] After determining the right boundary of the search area, the complete search area for the current block can be obtained. Based on this search area, the reference block is searched. As shown in the figure, this reference block is in the first CTU of the (i - 1)-th row. The current block is encoded using this reference block. After encoding is completed, the next block to be encoded is used as the current block. As Figure 1As shown below, the next block to be encoded is in the third CTU of the i-th row. Taking this block as the current block, repeat the above steps until the encoded video frame is obtained after encoding the video frame to be encoded. During the process, by using the encoding processing delay as the determination basis, the right boundary can be determined in the encoded CTUs of the CTUs in the (i - 1)-th row, ensuring that the search area corresponding to the current block is all encoded areas, and avoiding the situation where the reference blocks are inconsistent when encoding and decoding the current block, resulting in poor encoding and decoding quality.

[0064] Figure 2 The following is a flowchart of a video encoding method provided by an embodiment of the present application. This method can be executed by a computer device. In this embodiment, it is described by taking the computer device as a server as an example.

[0065] S201: Determine the current block to be encoded from the video frame to be encoded.

[0066] With the increase of video resolution, the storage space of the corresponding video is large. If the original video is directly transmitted, it will greatly affect the video transmission efficiency. Therefore, in the related art, when transmitting a video, a video encoding method is generally used to compress the video frames of the original video (i.e., the video frames to be encoded), and the encoded video frames obtained after the compression is completed are transmitted. Among them, the video frames to be encoded can be video frames collected in real time for instant communication (such as live broadcast, cloud game, etc.), or can also be video frames corresponding to the videos stored in advance.

[0067] CTU is an independent unit in the video frame to be encoded, and is used for intra-frame encoding in the embodiment of the present application. CTU is usually a square area, and its size can be determined by the encoding and decoding requirements of the video frame, which is not limited here. A block is the basic unit in the process of encoding and decoding a video frame. There are blocks in the CTU. When encoding the video frame to be encoded, the blocks in it need to be encoded. A block can be represented by a Coding Unit (CU), and the CU can be further divided into a Prediction Unit (PU) and a Transform Unit (TU). Among them, the shape of the CU can be square or rectangular, and its size can also be determined by the encoding and decoding requirements of the video frame, which is not limited here. The above-mentioned current block refers to the block that needs to start encoding in the video to be encoded.

[0068] In the embodiments of the present application, parallel encoding processing is performed on the video frames to be encoded of a video by means of WPP. The video frames to be encoded refer to the original video frames that have not been processed by a video encoder. Among the video frames collected in real time or stored in advance, there are multiple video frames to be encoded, and each video frame to be encoded includes multiple CTUs arranged in row and column order. The process of encoding the video frames to be encoded is as follows: encoding is performed row by row from top to bottom, and for each row, encoding is performed on each CTU in sequence from left to right. Figure 3 is a schematic diagram of an encoding process, as Figure 3 shown. The dark gray parts are the encoded CTUs, the white parts are the unencoded CTUs, and the light gray parts are the CTUs being encoded. The white dotted line with an arrow in the figure indicates that the encoding order is row by row from top to bottom and then in sequence from left to right.

[0069] The encoding method of WPP is somewhat different from Figure 3 the method shown. Although it is also row by row from top to bottom and then in sequence from left to right, there are differences in the encoding of adjacent rows. Figure 4 This is a schematic diagram of a WPP encoding process provided by an embodiment of the present application. As shown in the figure, similar to the encoding process in Figure 3 , the dark gray parts are the encoded CTUs, the white parts are the unencoded CTUs, and the light gray parts are the CTUs being encoded. The white dotted line with an arrow in the figure indicates that the encoding order is row by row from top to bottom and then in sequence from left to right. The difference is that with WPP, parallel encoding processing is performed on multiple rows of CTUs, and the encoding progress of adjacent rows differs by the same amount. The figure schematically shows a case where parallel encoding processing is performed on 3 rows of CTUs using WPP, and the encoding progress of adjacent rows differs by 2 CTUs. Here, parallel encoding processing means that encoding processing is performed simultaneously on multiple rows of CTUs in the video frames to be encoded. The "simultaneously" here does not mean that each row of CTUs starts encoding the first CTU from the left in that row at the same time, but rather that on the premise of ensuring that the encoding progress of adjacent rows differs by the same amount, multiple rows of CTUs can perform CTU encoding for their respective rows simultaneously.

[0070] See Figure 1As shown, the current tile is within the target CTU, that is, the size of the current tile is smaller than the size of the target CTU. The video frame to be encoded includes N*M CTUs. The target CTU is in the i-th row of CTUs in the video frame to be encoded and is in one of the K rows of CTUs in parallel encoding processing. The encoding progress difference between adjacent rows in parallel encoding processing is the encoding processing delay, where 1 < K ≤ N. The encoding processing delay refers to the difference in the encoding progress of CTUs between adjacent rows during parallel encoding processing. This difference can be measured by CTUs or by the number of pixels. For example, assume that the encoding progress difference of CTUs between adjacent rows is two CTUs, and the size of one CTU is 64*64 pixels. At this time, it can be considered that the encoding progress difference of CTUs between adjacent rows is 128 pixels (i.e., the side lengths of two CTUs).

[0071] Figure 5 This is another schematic diagram of the WPP encoding process provided by the embodiments of the present application. As shown, in this parallel encoding processing, the encoding progress difference between adjacent rows is 2 CTUs. Among them, CTU A represents the CTU being encoded. It can be seen that the left side and directly above CTU A are both encoded CTUs, and CTU B and CTU C are both encoded CTUs. There is such a situation in parallel encoding processing: when CTU B finishes encoding, CTU A immediately starts encoding. At this time, CTU B1 and CTU C1 may not have started encoding yet, that is, CTU B1 and CTU C1 are both CTUs that have not completed encoding. When encoding CTU A, CTU B1 and CTU C1 cannot be used as the search area for the reference tile of CTU A because they have not completed encoding.

[0072] S202: Determine the right boundary of the search area of the current tile in the video frame to be encoded according to the encoding processing delay.

[0073] The search area of the current tile refers to the area range in the video frame to be encoded involved in searching for the reference tile of the current tile. The right boundary refers to the rightmost boundary in the search area of the video frame to be encoded, that is, the rightmost part that can be reached within the range covered by the search area of the current tile.

[0074] In the embodiments of the present application, in addition to using WPP to perform parallel encoding processing on multiple rows of CTUs in the video frame to be encoded, an intra-frame prediction method is also used to determine the reference tile of the current tile in the search area. When encoding the current tile, only the difference between the current tile and the reference tile needs to be recorded. Based on the intra-frame prediction method, the compression ratio of the current tile can be improved, thereby improving the transmission efficiency of the subsequent encoded video frame.

[0075] Since the WPP method is adopted to encode the video frames to be encoded, although the encoding progress of adjacent row CTUs is not synchronized in the parallel encoding process, the encoding progress of the (i - 1)-th row CTU is faster than that of the i-th row CTU, and the difference between them is the encoding processing delay. However, in some cases, the search area of the current tile will extend to the area with uncertain encoding results in the (i - 1)-th row CTU. When using the intra prediction method to search for reference tiles for the current tile, if the reference tile matched in the search area has not been encoded (including not started encoding and being in the process of encoding), it may lead to a situation where the reference tile used for decoding is inconsistent with that used for encoding, affecting the video encoding and decoding quality.

[0076] In the embodiments of the present application, it is necessary to encode the video frames to be encoded based on both the WPP and intra prediction methods. During the intra prediction process, the encoding of the current tile needs to be based on the reconstructed pixels. Reconstructed pixels refer to the pixels that have been encoded, and the corresponding original pixels refer to the pixels that have not been encoded or have not been fully encoded. Tiles in the video frames to be encoded are composed of pixels. Since the WPP method is adopted for parallel encoding processing in the present application, there are cases where there are both reconstructed pixels and original pixels during the encoding of the video frames to be encoded. Among them, the encoding results corresponding to the reconstructed pixels are determined because they have been encoded, while the encoding results corresponding to the original pixels are uncertain because they have not been encoded or have not been fully encoded. Therefore, when encoding the current tile in the i-th row CTU based on the information in the (i - 1)-th row CTU, the determined search area may extend to the area where the unencoded or incompletely encoded pixel part in the (i - 1)-th row CTU is located (i.e., the area with uncertain encoding results).

[0077] Therefore, when using the intra prediction method to search for a reference tile for the current tile, if the reference tile matched in the search area is not composed entirely of reconstructed pixels, it means that the reference tile includes original pixels (i.e., pixels with uncertain encoding results). At this time, when encoding the current tile based on the reference tile, the accuracy of the obtained encoding result is relatively low.

[0078] In the embodiments of the present application, both the process of encoding the video frame to be encoded and the process of decoding the encoded video frame adopt the combination of WPP and intra prediction, and both are performed row by row from top to bottom and sequentially from left to right. When encoding and decoding the same current tile, since there may be a difference in the encoding and decoding speeds, if the reference tile for encoding the current tile during the encoding process is a tile that has not been encoded yet, the corresponding reference tile determined during the decoding process may not be in the same position as the reference tile during the encoding process; or the reference tiles for encoding the current tile include original pixels, while all the reference tiles determined during the decoding process are reconstructed pixels. The above two situations will both result in the reference tiles used for decoding being inconsistent with those used for encoding, thus affecting the accuracy of video frame encoding and decoding. It should also be noted that since the WPP method is used for encoding the video frame to be encoded, that is, a parallel encoding method in which the encoding progress of adjacent rows differs by the encoding processing delay, it can be ensured that when encoding the current tile, the CTUs on the left and above the current tile have been encoded (that is, the CTUs on the left and above the current tile are all reconstructed pixels and the corresponding encoding results have been determined). When determining the search area, only the right boundary of the video to be encoded needs to be determined. The determination of the right boundary needs to consider the encoding processing delay and ensure that the right boundary is within the encoded CTUs of the (i - 1)-th row CTU. In this way, it can be avoided to a certain extent that the search area includes CTUs that have not been encoded, resulting in encoding errors for the current tile to be encoded due to the influence of the CTUs that have not been encoded. When the right boundary of the search area is determined, the entire search range corresponding to the current tile is determined.

[0079] See Figure 1 As shown in Figure 1 , according to the encoding processing delay, the right boundary of the search area of the current tile is within the encoded CTUs of the (i - 1)-th row CTU. In the embodiments of the present application, the (i - 1)-th row CTU of the video frame to be encoded is above the i-th row CTU.

[0080] S203: Search for the current tile in the search area to determine the reference tiles in the search area.

[0081] The reference block is an encoded block whose pixel similarity to the current block meets the similarity condition. The pixel similarity is an index used to measure the similarity degree between the pixels of the reference block and the current block, and the similarity condition is a condition used to determine the similarity between the reference block and the current block. For example, the similarity condition can be determined as the pixel consistency degree between the reference block and the current block reaching 80%. Generally speaking, the pixel similarity between the reference block and the current block is relatively high, that is, the pixel difference between the reference block and the current block is relatively small. In this way, when encoding the current block, it is only necessary to record the difference between the reference block and the current block, which greatly improves the encoding efficiency of the video frame to be encoded and increases the compression degree of the block.

[0082] The reference block is located within the search area. Generally speaking, the reference block is located in the CTU adjacent to the current block. The reason is that according to the arrangement rule of the image content in the video frame, there is generally a high similarity between adjacent blocks. After determining the search area, the search for the current block can be carried out within the search area to determine the reference block corresponding to the current block. Suppose the similarity condition that the pixel similarity between the reference block and the current block reaches is that the consistency degree between the reference block and the current block reaches 85%. Then the difference between the reference block and the current block at this time is 15%. When the reference block is subsequently used to encode the current block, only the 15% difference part needs to be recorded, which can improve the encoding efficiency for the current block to a certain extent.

[0083] S204: Encode the current block using the reference block, and use the next block to be encoded as the current block until the encoding of the video frame to be encoded is completed, obtaining an encoded video frame.

[0084] When the reference block corresponding to the current block is determined within the search area, the current block is encoded using the reference block. During the encoding process, the corresponding relationship between the current block and the reference block, as well as the difference between the current block and the reference block, can be recorded. After completing the encoding of the current block, the next block in the video frame to be encoded is used as the current block to continue the processes of determining the search area, searching for the reference block, and encoding until the encoding of all blocks in the video frame to be encoded is completed, obtaining an encoded video frame.

[0085] As can be seen from the above technical solution, in the process of intra-frame encoding of the video frame to be encoded by means of parallel encoding processing, the video frame to be encoded is divided into N*M CTUs. The target CTU where the current block to be encoded is located is in the i-th row of CTUs, and the i-th row of CTUs is one of the K rows of CTUs for parallel encoding processing. When performing intra-frame encoding on the current block, the search area of the current block will cover a partial area in the (i-1)-th row of CTUs and extend a certain length to the right relative to the current block in the (i-1)-th row of CTUs. Although the mechanism of parallel encoding processing is that the encoding progress of adjacent rows of CTUs is not synchronized, the encoding progress of the (i-1)-th row of CTUs is faster than that of the i-th row of CTUs, and the difference between the two is the encoding processing delay. However, in some cases, the search area of the current block will extend to the area where the encoding result is uncertain in the (i-1)-th row of CTUs. If the reference block matched from the search area is in this uncertain area, it is very likely that the reference block used for decoding is inconsistent with that used for encoding, resulting in incorrect decoding results and affecting the quality of the video frame to be encoded. Therefore, when determining the right boundary of the search area, based on the encoding processing delay as the determination basis, the right boundary is determined in the encoded CTUs of the (i-1)-th row of CTUs to ensure that the areas covered by the search area are all encoded areas, avoiding the situation of using different reference blocks for encoding and decoding the current block, and effectively improving the encoding quality of the video frame to be encoded.

[0086] In the above-mentioned S202, it is mentioned that "determine the right boundary of the search area of the current block in the video frame to be encoded according to the encoding processing delay". Different bases can be considered in the process of determining the right boundary. The bases can include the following two. One is the encoding gain and complexity, and the other is the encoding processing delay. Based on the above two consideration bases, two different methods for determining the right boundary can be determined, and one of them can be selected according to the actual situation in practical applications. Therefore, in a possible implementation manner, the method for determining the right boundary can be:

[0087] A1: Determine the first tentative right boundary of the search area in the video frame to be encoded according to the encoding gain and complexity, and the first position information of the current block in the video frame to be encoded.

[0088] The encoding gain refers to the compression ratio or performance improvement achieved by encoding the current block in the video frame to be encoded. In the embodiments of the present application, the compression ratio or performance improvement can be equivalent to the relatively high quality of the reference block searched for the current block (i.e., the relatively high pixel similarity with the current block). In practical applications, the encoding gain can be evaluated by indicators such as the size and transmission speed of the video files before and after encoding.

[0089] Complexity refers to the computing resources and time required for encoding the current tile in the encoded video frame. When the search area is large, the corresponding complexity is greater, and more computing resources and time are required for encoding; when the search area is small, the corresponding complexity is smaller, and less computing resources and time are required for encoding. Generally speaking, when the complexity is low, the corresponding encoding efficiency is high.

[0090] When determining the search area, it is necessary to balance the two-dimensional factors of encoding gain and complexity at the same time. When the range of the search area is large, the corresponding encoding gain may increase (which is beneficial to finding a reference tile with better quality for encoding the current tile), and the corresponding complexity will also increase (the corresponding consumed computing resources will also increase), which will affect the encoding efficiency; when the search range is small, a certain encoding gain may be lost, but the corresponding complexity is lower. Therefore, it is necessary to focus on encoding gain and complexity in combination with different scenarios, which will not be elaborated here.

[0091] The method for determining the first tentative right boundary mentioned in A1 is determined according to the encoding gain and complexity, and the first position information of the current tile in the video frame to be encoded. When encoding the video frame to be encoded, the upper left corner of the video frame to be encoded is used as the coordinate origin. The first position information of the current tile in the video frame to be encoded can be the coordinate information corresponding to the upper left corner of the current tile, and the coordinate information can include the x-axis coordinate and the y-axis coordinate. That is, on the premise of considering the encoding gain and complexity, the first tentative right boundary is determined according to the first position information of the current tile. Through the first position information of the current tile, the position of the current tile in the video frame to be encoded can be clarified. Then, in combination with the consideration of encoding gain and complexity, the size of the search area for the current tile can be determined. The size of the search area depends on the position of the first tentative right boundary. At the same time, the search area is provided for the search of the reference tile for the current tile. Therefore, it is necessary to combine the first position information of the current tile to determine the position of the search area, and the size of the search area determined according to the encoding gain and complexity, to obtain the first tentative right boundary.

[0092] A2: Determine the second tentative right boundary of the search area in the video frame to be encoded according to the encoding processing delay and the second position information of the target CTU in the video frame to be encoded.

[0093] The coding processing delay refers to the difference in the coding progress between adjacent lines in the WPP coding processing mode. During the process of determining the second tentative right boundary, the second position information of the target CTU in the video frame to be coded and the coding processing delay are taken into consideration. It can be seen that the difference between the method of determining the second tentative right boundary mentioned in A2 and the method of determining the first tentative right boundary mentioned in A1 is that in the method of determining the second tentative right boundary in A2, the coding processing delay needs to be considered, and the second tentative right boundary is determined based on the coding processing delay, so that the second tentative right boundary is located in the already coded CTU, and the coding processing delay is determined based on the CTU. The specific delay value can be a fixed number of pixels or determined in units of the width of a single CTU. Therefore, when determining the second tentative right boundary, it is not necessary to consider the position of the current tile in the target CTU, and it can be determined in combination with the situation of the target CTU. In the case of the second tentative right boundary, the determination process is simpler than that in A1.

[0094] A3: Determine the right boundary of the search area of the current tile in the video frame to be coded through the first tentative right boundary and the second tentative right boundary.

[0095] When determining the right boundary of the search area of the current tile in the video frame to be coded, the first tentative right boundary and the second tentative right boundary can be selected according to the actual situation, and the coding gain and complexity also need to be considered.

[0096] Among them, the method in A1 determines the right boundary based on the information of the current tile, and the method in A2 determines the right boundary based on the information of the target CTU. For different consideration bases, the right boundary of the search area of the current tile can be determined from the first tentative right boundary and the second tentative right boundary.

[0097] For example, when the color complexity in the video frame to be encoded is relatively high, it is preferable to select the method in A1 for determining the right boundary based on the information of the current tile. The reason is that the target CTU is larger in size compared to the current tile, which can also be understood as having a coarser partitioning granularity compared to the current tile. When the color complexity in the video frame to be encoded is relatively high, the partitioning granularity of the corresponding tiles is smaller, that is, a larger number of tiles will be accommodated within the unit search area in the video frame to be encoded. At this time, the first tentative right boundary determined by considering the coding gain, complexity, and the first position information of the current tile in the video frame to be encoded is more in line with the search area requirements of the current tile compared to the second tentative right boundary determined based on the information of the target CTU. That is, when the tile density in the video frame to be encoded is relatively high, the current tile tends to determine the corresponding reference tile within a smaller search area (because a larger number of tiles are included in a smaller search area), so using the information of the current tile as a reference for determining the right boundary (i.e., A1) is sufficient to meet the search requirements.

[0098] When the color complexity of the tiles in the video frame to be encoded is relatively low, it is preferable to select the method in A2 for determining the right boundary based on the information of the target CTU. The reason is that when the color complexity in the video frame to be encoded is relatively low, the partitioning granularity of the corresponding tiles is larger, that is, a smaller number of tiles will be accommodated within the unit search area in the video frame to be encoded. At this time, the second tentative right boundary determined based on the information of the target CTU is more in line with the search area requirements of the current tile compared to the first tentative right boundary determined based on the information of the current tile. That is, when the tile density in the video frame to be encoded is relatively low, to ensure the quality of the reference tile searched, it is necessary to ensure that the number of tiles searched reaches a certain quantity, that is, at this time the current tile tends to determine the corresponding reference tile within a larger search area, so using the information of the target CTU as a reference for determining the right boundary (i.e., A2) to meet the search requirements of the current tile.

[0099] In a possible implementation, when the second tentative right boundary is closer to the current tile than the first tentative right boundary and both the second tentative right boundary and the first tentative right boundary are within the encoded CTU, if you want to improve the coding gain at this time, you can consider appropriately expanding the search area compared to the second tentative right boundary. The way to expand the search area can be to calculate the average value of the first tentative right boundary and the second tentative right boundary and use this average value as the right boundary of the search area of the current tile in the video frame to be encoded.

[0100] Through the method for determining the right boundary provided above, two different dimensions for determining the pending right boundary are provided. Different dimensions correspond to different considerations. For the aforementioned two methods for determining the pending right boundary, combined with the comprehensive considerations of specific application scenarios, coding gain, and complexity, the method for determining the right boundary in different scenarios can be determined to meet the requirements for determining the right boundary of the search area of the current block.

[0101] As mentioned in the foregoing A1, "According to the coding gain and complexity, and the first position information of the current block in the video frame to be encoded, determine the first pending right boundary of the search area in the video frame to be encoded." The process of determining the first pending right boundary needs to be based on the first position information of the current block in the video frame to be encoded and extend a certain number of pixels to the right according to the rules of the coding process. In one possible implementation, the method for determining the first pending right boundary is as follows: First, determine the degree coefficient by which the search area can extend to the right according to the coding gain and complexity. Then, based on the degree coefficient and the width of the current block, determine the first number of pixels extended to the right of the search area relative to the first position information. Finally, determine the first pending right boundary according to the first number of pixels extended to the right.

[0102] The degree coefficient is obtained by weighing the coding gain and complexity. This degree coefficient is used to determine the degree to which the search area can extend to the right in the determination of the first pending right boundary. The specific degree coefficient can be set by those skilled in the art according to the actual situation and application scenarios, and is not limited herein. For example, in the next-generation video coding standard reference software platform (Enhanced Compression Model, ECM), the degree coefficient is 5.

[0103] When the degree coefficient is determined, it is necessary to determine the first number of pixels extended to the right of the search area relative to the first position information based on the degree coefficient and the width of the current block. The first position information of the current block may refer to the position of the left upper endpoint of the current block on the x-axis. The block is generally square or rectangular. The first number of pixels extended to the right refers to the number of pixels extended to the right relative to the first position information of the current block.

[0104] Assume that the first position information of the current block in the video frame to be encoded is (BlkX, BlkY), the width of the current block is BlkW, and the height is BlkH. At this time, the first pending right boundary HorMax1 can be calculated by the following formula:

[0105] HorMax1 = BlkX + a * BlkW

[0106] Where a is the degree coefficient. From the above formula, it can be seen that the determination of the first pending right boundary is related to the size and position of the current block.

[0107] Example 1:

[0108] Figure 6 This is a schematic diagram for determining a pending right boundary based on the first position information provided by an embodiment of the present application. Assume a = 5, the coding progress difference between adjacent rows encoded using WPP is 2 CTUs, the size of the target CTU is 64*64 pixels, the first position information of the current tile is (96, 96), and the size of the current tile is 32*32 pixels, that is, both the length and width of the current tile are 32. At this time, the number of pixels extended to the right for the first time is calculated according to the above formula: 96 + 5 * 32 = 256. As shown in the figure, the determined first pending right boundary is located in the CTU that has not been encoded yet. Therefore, in the embodiment of the present application, in addition to using the first pending right boundary to determine the right boundary of the search area of the current tile, a second pending right boundary of the search area in the video frame to be encoded is determined based on the coding processing delay and the second position information of the target CTU in the video frame to be encoded. When the first pending right boundary does not meet the condition of being located in the encoded CTU, it is considered to be replaced by the second pending right boundary.

[0109] Of course, in the embodiment of the present application, there are scenarios where it is applicable to use the first pending right boundary as the right boundary of the search area of the current tile. Generally speaking, when the size of the target CTU remains unchanged and the size of the current tile is relatively small, the first pending right boundary determined by the corresponding calculated number of pixels extended to the right for the first time will be located in the encoded CTU.

[0110] Example 2:

[0111] Figure 7 This is another schematic diagram for determining a pending right boundary based on the first position information provided by an embodiment of the present application. Assume a = 5, the coding progress difference between adjacent rows encoded using WPP is 2 CTUs, the size of the target CTU is 64*64 pixels, the first position information of the current tile is (80, 80), and the size of the current tile is 16*16 pixels, that is, both the length and width of the current tile are 16. At this time, the number of pixels extended to the right for the first time is calculated according to the above formula: 80 + 5 * 16 = 160. As shown in the figure, the determined right boundary is located in the encoded CTU. That is, when the first pending right boundary meets the condition of being located in the encoded CTU, it can be used as the pending right boundary of the right boundary of the current tile.

[0112] As can be seen from the above two examples, in the process of determining the first tentative right boundary of the search region in the video frame to be encoded according to the coding gain, complexity, and the first position information of the current block in the video frame to be encoded, it is necessary to consider the partitioning granularity of the current block, which is reflected in the size of the width of the current block. When the width of the current block is larger, the corresponding partitioning granularity of the current block is larger; when the width of the current block is smaller, the corresponding partitioning granularity of the current block is smaller. As can be seen from the above examples, compared with the current block with a width of 32, the partitioning granularity of the current block with a width of 16 is larger. Determining the first tentative right boundary as the right boundary of the search region of the current block needs to be based on the premise that the partitioning granularity of the current block is smaller.

[0113] That is, the partitioning granularity of the current block will affect the trade-off between coding gain and complexity. The partitioning granularity of the current block can be determined by the size of the current block. For example, assume that the size of the current block is 4*4 pixels or 16*16 pixels. The partitioning granularity of the current block with 4*4 pixels is smaller than that of the current block with 16*16 pixels.

[0114] The partitioning granularity of the current block will affect the determination of the first tentative right boundary. As mentioned above, on the premise of using WPP for encoding, the determination of the first tentative right boundary can be understood as the determination of the search region. If the partitioning granularity of the current block is smaller, the corresponding first tentative right boundary can be determined closer to the current block. The reason is that when the partitioning granularity of the current block is smaller, it means that the number of blocks in the video frame to be encoded is larger, and more blocks can be accommodated in a smaller search region. When the coding requirement is certain, it is sufficient to determine the reference block for the current block within this search region, so there is no need to increase the number of searchable blocks by greatly expanding the search region.

[0115] If the partitioning granularity of the current block is larger, the corresponding first tentative right boundary can be determined to be farther away from the current block. The reason is that when the partitioning granularity of the current block is larger, it means that the number of blocks in the video frame to be encoded is smaller, and the number of blocks that may be accommodated in a larger search region is not very large. When the coding requirement is certain, in order to ensure the coding gain at this time, it is necessary to consider expanding the search region to increase the number of searchable blocks.

[0116] Through the method for determining the first undetermined right boundary provided above, the first number of pixels extended to the right of the search area relative to the first position information can be determined according to the determined degree coefficient and the width of the current tile, and the first undetermined right boundary can be obtained according to the first number of pixels extended to the right. That is to say, in the process of determining the first undetermined right boundary, the size of the current tile needs to be considered, and different sizes of the current tile will affect the feasibility of the first undetermined right boundary as the right boundary of the search area of the current tile.

[0117] It is mentioned in the foregoing A2 that "according to the encoding processing delay and the second position information of the target CTU in the video frame to be encoded, determine the second undetermined right boundary of the search area in the video frame to be encoded". The process of determining the second undetermined right boundary needs to be based on the second position information of the target CTU and extend a certain number of pixels to the right according to the rules of the encoding process. In a possible implementation manner, the method for determining the second undetermined right boundary is as follows: First, determine the encoding processing delay, and determine the second number of pixels extended to the right of the search area relative to the second position information. Then, according to the second number of pixels extended to the right, determine the second undetermined right boundary.

[0118] The encoding processing delay refers to the difference in the encoding progress of adjacent row CTUs during parallel encoding processing under WPP. In the embodiments of the present application, the encoding processing delay can be 1 CTU or 2 CTUs. When the encoding processing delay is determined, the second number of pixels extended to the right of the search area relative to the second position information of the target CTU can be determined based on the encoding processing delay and the second position information of the target CTU. The second number of pixels extended to the right refers to the number of pixels extended to the right relative to the second position information of the target CTU.

[0119] Assume that the second position information of the target CTU in the video frame to be encoded is (ctu_x_cur, ctu_y_cur), the encoding processing delay is wpp_delay = 2 CTUs, and the width of one CTU is ctu_width. At this time, the second undetermined right boundary HorMax2 can be calculated by the following formula:

[0120] HorMax2 = ctu_x_cur + ctu_width * wpp_delay

[0121] It can be seen from the above formula that the determination of the second undetermined right boundary is related to the size and position of the target CTU.

[0122] Example 3:

[0123] Figure 8Schematic diagram for determining a pending right boundary based on second position information provided by an embodiment of the present application. Assume that the coding progress difference between adjacent rows encoded using WPP is 2 CTUs, the size of the target CTU is 64*64 pixels, the second position information of the target CTU is (64, 64), and the width of the target CTU is 64 pixels. At this time, the number of pixels extended to the right for the second time is calculated according to the above formula: 64 + 2*64 = 192. As shown in the figure, the determined second pending right boundary is within the encoded CTU, satisfying the condition that the second pending right boundary is within the encoded CTU, and can be used as the pending right boundary of the right boundary of the current tile.

[0124] Example 4:

[0125] Figure 9 Another schematic diagram for determining a pending right boundary based on second position information provided by an embodiment of the present application. Assume that the coding progress difference between adjacent rows encoded using WPP is 1 CTU, the size of the target CTU is 64*64 pixels, the second position information of the target CTU is (64, 64), and the width of the target CTU is 64 pixels. At this time, the number of pixels extended to the right for the second time is calculated according to the above formula: 64 + 1*64 = 128. As shown in the figure, the determined second pending right boundary is within the encoded CTU, satisfying the condition that the second pending right boundary is within the encoded CTU, and can be used as the pending right boundary of the right boundary of the current tile.

[0126] In the process of determining the second pending right boundary, it can be seen that only the coding processing delay, the position and size of the target CTU are required, without considering the size and position of the current tile. The calculation process is relatively simple, and regardless of whether the division granularity of the current tile is large or small, it can ensure that the determined second pending right boundary is within the encoded CTU, and can be used as the pending right boundary of the right boundary of the search area of the current tile.

[0127] Through the method for determining the second pending right boundary provided above, the number of pixels extended to the right for the second time can be determined according to the second position information of the target CTU and the coding processing delay, and the second pending right boundary can be obtained based on the number of pixels extended to the right for the second time. In the method for determining the second pending right boundary, there is no need to consider the division granularity of the current tile, and it can ensure that the second pending right boundary is within the encoded CTU. When determining the second pending right boundary, the determination method is simple and can avoid the situation that the search area determined based on the second pending right boundary contains unencoded CTUs, ensuring the accuracy of coding.

[0128] It is mentioned in the foregoing A3 that "the right boundary of the search area of the current tile in the video frame to be encoded is determined by the first to-be-determined right boundary and the second to-be-determined right boundary". In the foregoing introduction, a general introduction to the determination of the right boundary is given according to different situations of the video frame to be encoded. At the same time, the determination methods of the first to-be-determined right boundary and the second to-be-determined right boundary are introduced. Among them, the first to-be-determined right boundary has limitations in scenarios. In the actual application process, the right boundary of the search area of the current tile can be determined from the first to-be-determined right boundary and the second to-be-determined right boundary based on a quantifiable method. Therefore, in a possible implementation manner, the method for determining the right boundary of the search area of the current tile is as follows: The right boundary of the search area of the current tile in the video frame to be encoded is determined according to the to-be-determined right boundary closest to the current tile among the first to-be-determined right boundary and the second to-be-determined right boundary.

[0129] When determining the right boundary of the search area of the current tile, the first to-be-determined right boundary and the second to-be-determined right boundary can be determined in advance, and then the distances to the current tile are determined. The specific determination methods of the first to-be-determined right boundary and the second to-be-determined right boundary have been introduced in detail above and will not be elaborated here. According to the determined distances, the one with the closest distance to the current tile among the first to-be-determined right boundary and the second to-be-determined right boundary is determined as the right boundary of the search area of the current tile in the video frame to be encoded.

[0130] In the method for determining the right boundary of the search area of the current tile in this embodiment, there are two determination results. One is to determine the first to-be-determined right boundary as the right boundary of the search area, and the other is to determine the second to-be-determined right boundary as the right boundary of the search area. It should be noted that both the first to-be-determined right boundary and the second to-be-determined right boundary are located in the encoded CTU.

[0131] Taking the foregoing Example 1 and Example 3 as examples, assume a = 5. The encoding progress difference between adjacent rows encoded using WPP is 2 CTUs. The size of the target CTU is 64 * 64 pixels (i.e., the width is 64), the second position information of the target CTU is (64, 64), the first position information of the current tile is (96, 96), and the size of the current tile is 32 * 32 pixels, that is, both the length and width of the current tile are 32. The first number of pixels extended to the right calculated at this time: 96 + 5 * 32 = 256, and the second number of pixels extended to the right: 64 + 2 * 64 = 192. Figure 10A schematic diagram for determining the right boundary provided by an embodiment of the present application is shown in the figure. As shown, the determined first tentative right boundary is located in the CTU that has not been encoded, and the determined second tentative right boundary is located within the encoded CTU, satisfying the condition that the second tentative right boundary is located within the encoded CTU. At this time, it is required that the second tentative right boundary is the closest to the current block compared to the first tentative right boundary, and only the second tentative right boundary satisfies the condition of being located within the encoded CTU. Therefore, the second tentative right boundary needs to be used as the right boundary of the search area of the current block in the video frame to be encoded.

[0132] As can be seen from the above example, when the partitioning granularity of the current block is relatively large, the corresponding first tentative right boundary may be located in the CTU that has not been encoded. And when the second tentative right boundary is used as the right boundary of the search area, it means that the second tentative right boundary is closer to the current block compared to the first tentative right boundary. The first tentative right boundary is determined based on coding gain and complexity. Selecting the second tentative right boundary as the right boundary of the search area indicates that, compared to the first tentative right boundary, it is necessary to sacrifice coding gain to reduce the complexity of the search process and improve the search efficiency.

[0133] Taking the aforementioned Examples 2 and 3 as an example, assuming a = 5, the coding progress difference between adjacent rows encoded using WPP is 2 CTUs. The size of the target CTU is 64 * 64 pixels (i.e., the width is 64), the second position information of the target CTU is (64, 64), the first position information of the current block is (80, 80), and the size of the current block is 16 * 16 pixels, that is, both the length and width of the current block are 16. At this time, the number of pixels extended to the right for the first one: 80 + 5 * 16 = 160, and the number of pixels extended to the right for the second one: 64 + 2 * 64 = 192. Figure 11 Another schematic diagram for determining the right boundary provided by an embodiment of the present application is shown in the figure. As shown, the determined first tentative right boundary is located in the CTU that has been encoded, and the determined second tentative right boundary is located within the encoded CTU, that is, both the first tentative right boundary and the second tentative right boundary satisfy the condition of being located within the encoded CTU. At this time, the right boundary of the search area of the current block can be determined according to the distances between the first tentative right boundary and the second tentative right boundary and the current block. It can be seen that the distance between the first tentative right boundary and the current block is less than the distance between the second tentative right boundary and the current block. Therefore, the first tentative right boundary is used as the right boundary of the search area of the current block in the video frame to be encoded.

[0134] The first undetermined right boundary is determined based on coding gain and complexity. When the first undetermined right boundary is used as the right boundary of the search area, it means that the first undetermined right boundary is closer to the current block than the second undetermined right boundary. Selecting the first undetermined right boundary at this time can balance coding gain and complexity simultaneously. Compared with the second undetermined right boundary, it can avoid the increase in search process complexity caused by the expansion of the search area, thereby improving the search efficiency. Generally speaking, expanding the search area can increase coding gain while causing an increase in complexity.

[0135] In the embodiment of the present application, the method for determining the right boundary HorMax can be based on the following formula:

[0136] HorMax = min(BlkX + a * BlkW, ctu_x_cur + ctu_width * wpp_delay)

[0137] Among them, the coding processing delay is wpp_delay, the width of a CTU is ctu_width, the second position information of the target CTU in the video frame to be encoded is (ctu_x_cur, ctu_y_cur), the first position information of the current block in the video frame to be encoded is (BlkX, BlkY), the width of the current block is BlkW, the height is BlkH, and a is a degree coefficient. This formula includes the determination methods of both the first number of pixels extended to the right and the second number of pixels extended to the right (i.e., the determination methods of the first undetermined right boundary and the second undetermined right boundary). When determining the right boundary of the search area of the current block, the undetermined right boundary closest to the current block among the first undetermined right boundary and the second undetermined right boundary is used as the right boundary of the search area.

[0138] Combined with the different situations of the video frame to be encoded mentioned above, when the first undetermined right boundary is determined as the right boundary of the search area of the current block, the color complexity of the block in the corresponding video frame to be encoded is relatively high, that is, the partitioning granularity of the current block is relatively small; when the second undetermined right boundary is determined as the right boundary of the search area of the current block, the color complexity of the block in the video frame to be encoded is relatively low, that is, the partitioning granularity of the current block is relatively small.

[0139] Through the above-provided method for determining the right boundary of the search area of the current block, the undetermined right boundary closest to the current block among the first undetermined right boundary and the second undetermined right boundary is used as the right boundary of the search area of the current block. According to the quantifiable determination method of the closest distance, it can be applicable to the actual situations of two different video frames to be encoded, and adaptively select and determine a better right boundary of the search area according to the partitioning granularity of the current block.

[0140] As mentioned above, "determine the right boundary of the search area of the current tile in the video frame to be encoded". When the second undetermined right boundary is the undetermined right boundary closest to the current tile, the color complexity of the tile in the corresponding video frame to be encoded is relatively low, that is, the division granularity of the current tile is small. At this time, the requirement for encoding accuracy is not very high. If there is a need to further accelerate the encoding speed, it can be considered to further narrow the search area. Therefore, in a possible implementation, the method for determining the right boundary based on the second undetermined right boundary is: move the second undetermined right boundary to the left by a fixed pixel length and use it as the right boundary of the search area of the current tile in the video frame to be encoded.

[0141] The reason for moving the second undetermined right boundary to the left is that the encoding process in the embodiments of the present application follows the method of encoding line by line from top to bottom and encoding each CTU one by one from left to right. When moving the second undetermined right boundary to the left, it means narrowing the search area of the current tile. When moving the second undetermined right boundary to the right, it means expanding the search area of the current tile.

[0142] In the embodiments of the present application, the method of moving the second undetermined right boundary by a fixed pixel length is adopted to determine the right boundary of the search area of the current tile in the video frame to be encoded. In fact, in addition to moving by a fixed pixel length, the way of moving the second undetermined right boundary can also be: moving by a random pixel length, calculating the pixel length during the movement, and moving different pixel lengths based on the situations of different tiles.

[0143] The reason for choosing to move the second undetermined right boundary by a fixed pixel length is that when using the method of moving by a random pixel length to determine the right boundary of the search area of the current tile in the video frame to be encoded, when the video frame to be encoded is completed and encoded into an encoded video frame, when decoding the encoded video frame, since the right boundary of the current tile during the encoding process is randomly determined, when decoding the encoded current tile, the right boundary cannot be accurately determined. Therefore, the reference tiles determined during the encoding and decoding processes for the same tile will be inconsistent, affecting the efficiency of encoding and decoding.

[0144] When using the method of calculating the pixel length during the movement and moving different pixel lengths based on the situations of different tiles, although the right boundary can be determined, a large amount of pixel lengths generated during the movement need to be additionally stored in the encoded video frame, which will increase the data volume in the encoded video frame, contrary to the original intention of encoding the video frame to be encoded.

[0145] In summary, it can be seen that methods such as moving the random pixel length, calculating the pixel length during the movement, and moving different pixel lengths based on different tile conditions cannot well meet the requirements of improving the encoding efficiency while reducing the amount of transmitted data. When using the method of moving a fixed pixel length and using it as the right boundary of the search area of the current tile in the video frame to be encoded, since the moved pixel length is fixed, when decoding the encoded current tile, the right boundary can be accurately determined based on this fixed pixel length. Therefore, there will be no situation where the reference tiles determined during the encoding and decoding processes for the same tile are inconsistent. At the same time, since the search area for the current tile is reduced, the search efficiency for the reference tile can be improved, thereby improving the encoding efficiency of the video frame to be encoded.

[0146] Through the method of determining the right boundary provided above, on the premise that the color complexity of the tile in the video frame to be encoded is relatively low, the right boundary of the search area of the current tile is re-determined by moving a fixed pixel length to the left based on the second undetermined right boundary. This can reduce the search area of the current tile and improve the encoding efficiency. At the same time, when decoding the video frame to be encoded (i.e., the encoded video frame) that has completed encoding, accurate decoding can be performed based on this fixed pixel length, ensuring the accuracy of encoding and decoding to a certain extent.

[0147] In the aforementioned S203, it is mentioned that "search for the current tile in the search area to determine the reference tile in the search area". When searching for the reference tile of the current tile in the search area based on the current tile, since the current tile is an uncoded tile and the reference tile is an encoded tile, the determined reference tile corresponding to the current tile will be inaccurate. Therefore, to solve this problem, when searching for the reference tile of the current tile, the encoded part adjacent to the current tile can be considered to replace the current tile for the search of the reference tile. Therefore, in a possible implementation manner, the method for determining the reference tile is as follows:

[0148] B1: Determine the first encoded template representing the current tile in the encoded area adjacent to the current tile.

[0149] The first encoded template is an area that is adjacent to the current block and has been encoded. Since the first encoded template is in close proximity to the current block, according to the pixel distribution law of the image in the video frame to be encoded, generally the pixel differences between adjacent blocks are small. Therefore, adjacent blocks can replace the original block for the search of reference blocks, that is, the first encoded template can replace the current block for the search of reference blocks. At the same time, since the first encoded template and the reference block are both encoded, and the first encoded template has a high consistency with the current block, using the first encoded template to replace the current block for the search of reference blocks can achieve better results.

[0150] In addition, the relative positional relationship between the current block and the first encoded template is a preset relationship. This preset relationship has a certain relationship with the encoding method of the video frame to be encoded. When the encoding method is line-by-line encoding from top to bottom and CTU-by-CTU encoding from left to right, it means that when encoding the current block, the parts on the left and above of the current block have been encoded. And the first encoded template needs to be adjacent to the current block and completed encoding. Therefore, the relative positional relationship between the first encoded template and the current block is: the first encoded template is located above and to the left of the current block adjacent to it.

[0151] Figure 12 It is a schematic diagram for determining a reference block provided by an embodiment of the present application. Refer to Figure 12 As shown, the figure includes four areas R1, R2, R3, and R4, and all these four areas are encoded CTUs. When searching for reference blocks, the above four areas can be searched in a certain order, such as from top to bottom, from left to right, etc. The specific search order is not limited here. Among them, R1 is within the current CTU, R2 is at the upper left of the current CTU, R3 is at the upper right of the current CTU, R4 is on the left of the current CTU, and the first encoded template is an L-shaped template.

[0152] B2: Perform pixel similarity matching in the search area according to the first encoded template, and determine a second encoded template in the search area whose pixel similarity reaches the similarity condition;

[0153] Search in the search area according to the determined first encoded module, and the search process is the process of pixel similarity matching. Pixel similarity refers to the similarity degree of pixels between blocks, and the similarity condition refers to the condition for determining that two blocks are similar blocks. For example, the similarity condition can be set to 90%. At this time, it means that when there is a block in the search area whose pixel similarity with the first encoded template meets 90%, it can be determined as the second encoded template.

[0154] B3: Determine the reference tile according to the preset relationship and the second encoded template.

[0155] According to the aforementioned preset relationship, that is, the relative position relationship between the current tile and the first encoded template, and the second encoded template whose pixel similarity with the first encoded template reaches the similarity condition, the corresponding reference tile can be determined. That is, the relative position relationship between the reference tile and the second encoded template is consistent with the relative position relationship between the current tile and the first encoded template.

[0156] In a possible implementation manner, the determination of the reference tile can be implemented by means of Intra Template Matching Prediction (Intra TMP). This method obtains the reference tile of the current tile by searching for the second encoded template that matches the first encoded template within a predefined search area, and can implement using the tiles in the already reconstructed (already encoded) search area as the reference tile to encode the current tile. Furthermore, it reduces the spatial redundancy and improves the encoding quality. In this method, the first encoded template performs pixel similarity matching in the search area, and determines the second encoded template whose pixel similarity reaches the similarity condition from the search area, where the similarity condition refers to the minimum sum of absolute differences (Sum of Absolute Differences, SAD) between the first encoded template and the second encoded template.

[0157] By using the method for determining the reference tile provided above, using the first encoded template adjacent to the current tile as a substitute for the unencoded current tile to search for the reference tile can avoid the problem that when determining and matching the pixel similarity between the unencoded current tile and the encoded reference tile, the difference between the determined reference tile and the actually encoded current tile is relatively large, and improve the accuracy of encoding the video frame to be encoded.

[0158] The aforementioned encoding processing delay is the encoding progress difference between adjacent rows in parallel encoding processing using WPP. To ensure the accuracy of determining the reference tile within the search area of the current tile, the encoding processing delay needs to be at least the sum of the side lengths of one CTU.

[0159] The reason is that in the application scenario provided by the embodiments of the present application, on the premise that WPP is used to perform parallel encoding processing on multiple rows of CTUs in the video frame to be encoded, in the processing mode of WPP, it is required that there is a certain encoding processing delay between adjacent rows, that is, for the i-th row CTU, the number of encoded CTUs of the (i - 1)-th row CTU is larger, where the (i - 1)-th row CTU is above the i-th row CTU. Generally speaking, the current row has a delay of one or more CTUs compared to the previous row. The more the number of delayed CTUs, the more available information during encoding (or decoding), and the higher the compression ratio.

[0160] The reason for requiring the encoding processing delay is to ensure the correctness and efficiency of encoding. Because only when there is a difference in the encoding progress between adjacent rows, can the encoded content in the previous row CTU be accessed when encoding the current row CTU. Compared with the synchronous encoding processing of multiple rows of CTUs, the parallel encoding processing method with encoding processing delay can make full use of the spatial correlation of the blocks in the video frame to be encoded, and determine the search area of the encoded CTUs for intra-frame prediction of the current block.

[0161] Specifically, when the encoding processing delay is at least the sum of the side lengths of one CTU, when encoding the current block, the CTUs in the upper left, left, and directly above the current block have been encoded, and there is a situation where the upper right CTU has not been fully encoded (that is, there are both fully encoded blocks and blocks that have not been fully encoded). When searching for reference blocks for the current block, the fully encoded blocks in the upper left, left, directly above, and upper right of the current block can be used as the search area simultaneously for searching for reference blocks. The coverage range of the search area is relatively large, which can ensure the quality of the searched reference blocks and improve the encoding efficiency.

[0162] Through the method for determining the encoding processing delay provided above, determining the encoding processing delay as at least the sum of the side lengths of one CTU can make the corresponding search area range larger when encoding the current block, and can provide more optional ranges for the search of reference blocks. Since the optional range increases, it can ensure the quality of the reference blocks searched for the current block to a certain extent. When the quality of the reference blocks is guaranteed, the encoding accuracy for the current block is also guaranteed, thereby improving the encoding accuracy of the video to be encoded.

[0163] Figure 13 FIG. 13 is a flowchart of a video encoding method provided by an embodiment of the present application. This method can be executed by a computer device. In this embodiment, it is described by taking the computer device as a server as an example.

[0164] S1301: Determine the current block to be decoded from the encoded video frame.

[0165] An encoded video frame refers to the video frame obtained after encoding the aforementioned video frame to be encoded. At the receiving end of the encoded video frame, the encoded video frame needs to be decoded so that the encoded video frame compressed and encoded by the aforementioned video encoding method can be restored to a visual video.

[0166] The encoded video frame includes tiles to be decoded. When decoding the encoded video frame, the tiles therein need to be decoded. The decoding process of the encoded video frame is the same as the encoding process of the video frame to be encoded (both adopt the WPP and intra prediction methods, and the process is row by row from top to bottom and in sequence from left to right), and the only difference is that the decoding object when decoding the encoded video frame is the current tile to be decoded, while the encoding object when encoding the video frame to be encoded is the current tile to be encoded.

[0167] The current tile is in the target coding tree unit CTU. The encoded video frame includes N*M CTUs. The target CTU is in the i-th row CTU of the encoded video frame and is in one of the K row CTUs in parallel decoding processing. The decoding progress difference between adjacent rows in parallel decoding processing is the decoding processing delay, and 1<K≤N.

[0168] S1302: Determine the right boundary of the search area of the current tile in the decoded video frame according to the decoding processing delay.

[0169] The decoding processing delay refers to the difference in the decoding progress of CTUs between adjacent rows during parallel decoding processing. This difference can be measured by CTUs or according to the number of pixels. The search area of the current tile refers to the area range in the encoded video frame involved in searching for reference tiles for the current tile. The right boundary refers to the rightmost boundary in the search area of the encoded video frame, that is, the rightmost part that can be reached within the range covered by the search area of the current tile.

[0170] During the process of decoding the encoded video frame, the determined right boundary is in the decoded CTUs of the (i - 1)-th row CTU in the encoded video frame, and the (i - 1)-th row CTU in the encoded video frame is above the i-th row CTU. The reason for determining the right boundary of the search area in the decoded CTUs is the same as the video encoding process. For details, refer to the description in S201~S204 above and will not be elaborated here.

[0171] S1303: Search for the current tile in the search area to determine the reference tile in the search area.

[0172] The reference block is an encoded block whose pixel similarity to the current block reaches the similarity condition. For a detailed introduction to the reference block, refer to the content in S203 above. The difference is that when decoding the current block to be decoded, the search area where the corresponding reference block is located includes the decoded blocks, and the reference block is a decoded block.

[0173] S1304: Decode the current block using the reference block, and use the next block to be decoded as the current block until the decoding of the encoded video frame is completed, obtaining a decoded video frame.

[0174] When the reference block corresponding to the current block is determined within the search area, use this reference block to decode the current block. During the decoding process, it can be carried out based on the corresponding relationship between the current block and the reference block, and the recorded differences between the current block and the reference block. After the decoding of the current block is completed, use the next block in the encoded video frame as the current block to continue the processes of determining the search area, searching for the reference block, and decoding, until the decoding of all blocks in the encoded video frame is completed, obtaining a decoded video frame.

[0175] It can be seen from the above technical solution that during the process of intra-frame decoding of an encoded video frame by means of parallel decoding processing, the encoded video frame is divided into N*M CTUs. The target CTU where the current block to be decoded is located is in the i-th row of CTUs, and the i-th row of CTUs is one of the K rows of CTUs for parallel decoding processing. When performing intra-frame decoding on the current block, the search area of the current block will cover a partial area in the (i - 1)-th row of CTUs and extend a certain length to the right relative to the current block in the (i - 1)-th row of CTUs. Although the mechanism of parallel decoding processing is that the decoding progress of adjacent rows of CTUs is not synchronized, the decoding progress of the (i - 1)-th row of CTUs is faster than that of the i-th row of CTUs, and the difference between them is the decoding processing delay. However, in some cases, the search area of the current block will extend to the area where the decoding result of the (i - 1)-th row of CTUs is uncertain. If the reference block matched from the search area is in this uncertain area, it is very likely to lead to incorrect decoding results and affect the quality of the decoded video frame. Therefore, when determining the right boundary of the search area, based on the decoding processing delay as the determination basis, the right boundary is determined within the decoded CTUs of the (i - 1)-th row of CTUs, so as to ensure that the area covered by the search area is all decoded areas, avoiding the situation of using different reference blocks when encoding and decoding the current block, and effectively improving the decoding quality of the encoded video frame.

[0176] In the above-mentioned S1302, it is mentioned that "according to the decoding processing delay, determine the right boundary of the search area of the current tile in the decoded video frame". In the process of determining the right boundary, different bases can be considered. The bases can include the following two types. One is decoding gain and complexity, and the other is decoding processing delay. Based on the above two considerations, two different methods for determining the right boundary can be determined, and one of them can be selected according to the actual situation in practical applications. Therefore, in a possible implementation, the method for determining the right boundary can be as follows:

[0177] C1: According to the decoding gain and complexity, and the first position information of the current tile in the encoded video frame, determine the first tentative right boundary of the search area in the encoded video frame.

[0178] The decoding gain refers to the decompression ratio or video quality improvement achieved by decoding the current tile in the encoded video frame. In the embodiments of the present application, the decompression ratio or video quality improvement can be equivalent to that the quality of the reference tile searched for the current tile is higher (that is, the pixel similarity with the current tile is higher). In practical applications, the decoding gain can be evaluated by indicators such as the size and video clarity of the video file before and after decoding.

[0179] The complexity refers to the computing resources and time required for decoding the current tile in the encoded video frame. When the search area is large, the corresponding complexity is greater, and the more computing resources and time required for decoding; when the search area is small, the corresponding complexity is smaller, and the less computing resources and time required for decoding. Generally speaking, when the complexity is low, the corresponding decoding efficiency is high.

[0180] The method for determining the first tentative right boundary in C1 can refer to the description in the above-mentioned A1. The difference is that in A1, the coding gain and complexity are weighed and combined with the first position information in the video frame to be encoded for determination, while in C1, the decoding gain and complexity are weighed and combined with the first position information in the encoded video frame for determination.

[0181] C2: According to the decoding processing delay and the second position information of the target CTU in the encoded video frame, determine the second tentative right boundary of the search area in the encoded video frame.

[0182] The decoding processing delay refers to the difference in the decoding progress between adjacent rows in the decoding processing mode based on WPP. In the process of determining the second tentative right boundary, the second position information of the target CTU in the encoded video frame and the decoding processing delay are considered.

[0183] C3: Determine the right boundary of the search area of the current tile in the encoded video frame through the first tentative right boundary and the second tentative right boundary.

[0184] When determining the right boundary of the search area of the current tile in the encoded video frame, either the first tentative right boundary or the second tentative right boundary can be selected according to the actual situation, and the decoding gain and complexity also need to be considered.

[0185] For the specific introduction of C1 to C3, reference can be made to the description content of A1 to A3 above. The difference between C1 to C3 and A1 to A3 is only that C1 to C3 are the processes of determining the right boundary when decoding the encoded video frame, and C1 to C3 are the processes of determining the right boundary when encoding the video frame to be encoded.

[0186] Through the method of determining the right boundary provided above, two different dimensions for determining the tentative right boundary are provided. Different dimensions correspond to different considerations. For the above two methods of determining the tentative right boundary, combined with the comprehensive consideration of the specific application scenario, decoding gain, and complexity, the determination method of the right boundary in different scenarios can be determined to meet the determination requirements of the right boundary of the search area of the current tile.

[0187] It is mentioned in C1 above that "According to the decoding gain and complexity, and the first position information of the current tile in the encoded video frame, determine the first tentative right boundary of the search area in the encoded video frame". The determination method of the first tentative right boundary is as follows: First, according to the decoding gain and complexity, determine the degree coefficient of the extent to which the search area can extend to the right. Then, based on the degree coefficient and the width of the current tile, determine the number of pixels that the search area extends to the right relative to the first position information. Finally, according to the number of pixels that the search area extends to the right for the first time, determine the first tentative right boundary.

[0188] The degree coefficient is obtained by weighing the decoding gain and complexity. This degree coefficient is used to determine the extent to which the search area can extend to the right in the determination of the first tentative right boundary. The specific degree coefficient can be set by those skilled in the art according to the actual situation and application scenario, and is not limited here.

[0189] The specific determination method of the first tentative right boundary is generally the same as the determination method of the first tentative right boundary mentioned in the above video coding method. The difference is that the current tile in the determination method of the first tentative right boundary mentioned in the above video coding method is the tile to be encoded, while the current tile in the current determination method of the first tentative right boundary is the tile to be decoded.

[0190] Through the method for determining the first undetermined right boundary provided above, the first number of pixels extending to the right of the search region relative to the first position information can be determined according to the determined degree coefficient and the width of the current tile, and the first undetermined right boundary can be obtained based on the first number of pixels extending to the right. That is to say, during the process of determining the first undetermined right boundary, the size of the current tile needs to be considered, and different sizes of the current tile will affect the feasibility of the first undetermined right boundary as the right boundary of the search region of the current tile.

[0191] It is mentioned in the foregoing C2 that "according to the decoding processing delay and the second position information of the target CTU in the encoded video frame, determine the second undetermined right boundary of the search region in the encoded video frame". In a possible implementation manner, the determination method of the second undetermined right boundary is as follows: First, determine the encoding processing delay, and determine the second number of pixels extending to the right of the search region relative to the second position information. Then, according to the second number of pixels extending to the right, determine the second undetermined right boundary.

[0192] The decoding processing delay refers to the difference in the decoding progress of adjacent row CTUs during parallel decoding processing under WPP. In the embodiments of the present application, the decoding processing delay is the same as the foregoing encoding processing delay and can be 1 CTU or 2 CTUs. When the decoding processing delay is determined, the second number of pixels extending to the right of the search region relative to the second position information of the target CTU can be determined based on the decoding processing delay and the second position information of the target CTU. The second number of pixels extending to the right refers to the number of pixels extending to the right relative to the second position information of the target CTU.

[0193] Specifically, the determination method of the second undetermined right boundary is generally the same as the determination method of the second undetermined right boundary mentioned in the foregoing video encoding method. The implementation manner can refer to the previous description. The difference is that the target CTU in the determination method of the second undetermined right boundary mentioned in the foregoing video encoding method includes the current tile to be encoded, while the target CTU in the current determination method of the second undetermined right boundary includes the current tile to be decoded.

[0194] Through the method for determining the second undetermined right boundary provided above, the second number of pixels extending to the right can be determined according to the second position information of the target CTU and the encoding processing delay, and the second undetermined right boundary can be obtained based on the second number of pixels extending to the right. In the determination method of the second undetermined right boundary, the division granularity of the current tile does not need to be considered, and it can be ensured that the second undetermined right boundary is located in the encoded CTUs. When determining the second undetermined right boundary, the determination method is simple and can avoid the situation that the search region determined based on the second undetermined right boundary contains uncompleted encoded CTUs, ensuring the accuracy of encoding.

[0195] As mentioned in the above C3, "determine the right boundary of the search region of the current tile in the encoded video frame through the first undetermined right boundary and the second undetermined right boundary". In a possible implementation, the method for determining the right boundary of the search region of the current tile is as follows: determine the right boundary of the search region of the current tile in the encoded video frame according to the undetermined right boundary closest to the current tile among the first undetermined right boundary and the second undetermined right boundary.

[0196] For the specific process of determining the right boundary of the search region of the current tile, reference can be made to the method for determining the right boundary of the search region of the current tile mentioned in the above process of encoding the video frame to be encoded. The difference between the two is that the determination of the first undetermined right boundary during the encoding process is based on the encoding gain and complexity, and the first position information of the current tile in the video frame to be encoded, and the determination of the second undetermined right boundary is based on the encoding processing delay and the second position information of the target CTU in the video frame to be encoded. While the determination of the first undetermined right boundary during the decoding process is based on the decoding gain and complexity, and the first position information of the current tile in the encoded video frame, and the determination of the second undetermined right boundary is based on the decoding processing delay and the second position information of the target CTU in the encoded video frame.

[0197] Through the above-provided method for determining the right boundary of the search region of the current tile, take the one closest to the current tile among the first undetermined right boundary and the second undetermined right boundary as the right boundary of the search region of the current tile. According to this quantifiable determination method of the closest distance, it can be applicable to the actual situations of two different encoded video frames, and adaptively select and determine a better right boundary of the search region according to the division granularity of the current tile.

[0198] As mentioned above, "determine the right boundary of the search region of the current tile in the encoded video frame". When the second undetermined right boundary is the undetermined right boundary closest to the current tile, the color complexity of the tile in the corresponding encoded video frame is relatively low, that is, the division granularity of the current tile is relatively small. At this time, the requirement for decoding accuracy is not very high. If there is a need to further accelerate the decoding speed, it can be considered to further narrow the search region. Therefore, in a possible implementation, the method for determining the right boundary based on the second undetermined right boundary is: move the second undetermined right boundary to the left by a fixed number of pixel lengths and use it as the right boundary of the search region of the current tile in the encoded video frame.

[0199] For the specific process of determining the right boundary based on the second tentative right boundary, reference can be made to the introduction of the method involving determining the right boundary based on the second tentative right boundary in the aforementioned video encoding process. The difference between the two is that in the video encoding process, the determination of the second tentative right boundary is based on the encoding processing delay and the second position information of the target CTU (including the tile to be encoded). While in the current video decoding process, the determination of the second tentative right boundary is based on the decoding processing delay and the second position information of the target CTU (including the tile to be decoded).

[0200] Through the method for determining the right boundary provided above, on the premise that the color complexity of the tile in the encoded video frame is relatively low, the right boundary of the search area of the current tile is re-determined by moving left from the second tentative right boundary by a fixed pixel length consistent with the encoding process. This can narrow the search area of the current tile, improve the decoding efficiency, and ensure the decoding accuracy at the same time.

[0201] In S1303 mentioned above, it is stated that "search for the current tile in the search area to determine the reference tile in the search area". When searching for the reference tile of the current tile in the search area based on the current tile, since the current tile is an undecoded tile while the reference tile is an encoded tile, the determined reference tile corresponding to the current tile will be inaccurate. Therefore, to solve this problem, when searching for the reference tile of the current tile, the decoded part adjacent to the current tile can be considered to replace the current tile for the search of the reference tile.

[0202] Therefore, in a possible implementation, the method for determining the reference tile is as follows:

[0203] D1: Determine the first decoded template representing the current tile in the decoded area adjacent to the current tile.

[0204] The first decoded template is the area adjacent to the current tile and has been decoded. Since the first decoded template is adjacent to the current tile, according to the pixel distribution law of the image in the encoded video frame, generally, the pixel difference between adjacent tiles is small. Therefore, the adjacent tiles can replace the original tile for the search of the reference tile, that is, the first decoded template can replace the current tile for the search of the reference tile. The relative position relationship between the current tile and the first decoded template is a preset relationship. Since the decoding process is the same as the encoding process, both are performed row by row from top to bottom and sequentially from left to right using WPP, the relative position relationship between the first decoded template and the current tile is: the first decoded template is located above and to the left of the current tile.

[0205] D2: Perform pixel similarity matching in the search area according to the first decoded template, and determine a second decoded template in the search area whose pixel similarity reaches the similarity condition.

[0206] D3: Determine the reference tile according to the preset relationship and the second decoded template.

[0207] For the specific implementation processes of D2 - D3, reference can be made to the introductions in B2 - B3 mentioned above. The difference between the two is that B2 - B3 are for determining the reference tile according to the second encoded template, while D2 - D3 are for determining the reference tile according to the second decoded template.

[0208] Through the method for determining a reference tile provided above, using the first decoded template adjacent to the current tile as a substitute for the undecoded current tile to search for the reference tile can avoid the problem that when determining and matching the pixel similarity between the undecoded current tile and the decoded reference tile, the difference between the determined reference tile and the actually decoded current tile is relatively large, and improve the accuracy of decoding the encoded video frame.

[0209] As mentioned above, the decoding processing delay is the difference in the decoding progress of adjacent rows in parallel decoding processing using WPP. To ensure the accuracy of determining the reference tile within the search area for the current tile, the decoding processing delay needs to be at least the sum of the side lengths of one CTU.

[0210] For the specific process of determining the decoding processing delay, reference can be made to the method for determining the encoding processing delay mentioned above, which will not be elaborated here.

[0211] Through the method for determining the decoding processing delay provided above, determining the decoding processing delay to be at least the sum of the side lengths of one CTU can make the corresponding range that can be used as the search area larger when decoding the current tile, providing more optional ranges for the search of the reference tile. Since the optional range increases, it can ensure the quality of the reference tile searched for the current tile to a certain extent. When the quality of the reference tile is guaranteed, the accuracy of decoding the current tile is also guaranteed, thereby improving the decoding accuracy of the encoded video.

[0212] Based on the foregoing Figure 1-13 corresponding embodiments, Figure 14 is a schematic diagram of a video encoding device provided in an embodiment of the present application. The video encoding device 1400 includes: a first determination module 1401, a second determination module 1402, a third determination module 1403, and an encoding module 1404;

[0213] The first determination module 1401 is configured to determine a current tile to be encoded from a video frame to be encoded, where the current tile is in a target coding tree unit (CTU). The video frame to be encoded includes N*M CTUs. The target CTU is in the i-th row of CTUs in the video frame to be encoded and is in one of the K rows of CTUs in parallel coding processing, where the coding progress difference between adjacent rows in the parallel coding processing is a coding processing delay, and 1 < K ≤ N;

[0214] The second determination module 1402 is configured to determine a right boundary of a search region of the current tile in the video frame to be encoded according to the coding processing delay. The right boundary is in the encoded CTUs of the (i - 1)-th row of CTUs in the video frame to be encoded. In the video frame to be encoded, the (i - 1)-th row of CTUs is above the i-th row of CTUs;

[0215] The third determination module 1403 is configured to search for the current tile in the search region to determine a reference tile in the search region, where the reference tile is an encoded tile whose pixel similarity to the current tile reaches a similarity condition;

[0216] The encoding module 1404 is configured to encode the current tile using the reference tile, and use the next tile to be encoded as the current tile until the encoding of the video frame to be encoded is completed to obtain an encoded video frame.

[0217] In a possible implementation, the second determination module 1402 is configured to:

[0218] Determine a first tentative right boundary of the search region in the video frame to be encoded according to coding gain, complexity, and first position information of the current tile in the video frame to be encoded;

[0219] Determine a second tentative right boundary of the search region in the video frame to be encoded according to the coding processing delay and second position information of the target CTU in the video frame to be encoded;

[0220] Determine the right boundary of the search region of the current tile in the video frame to be encoded through the first tentative right boundary and the second tentative right boundary.

[0221] In a possible implementation, the second determination module 1402 is configured to:

[0222] Determine the right boundary of the search region of the current tile in the video frame to be encoded according to the tentative right boundary closest to the current tile among the first tentative right boundary and the second tentative right boundary.

[0223] In a possible implementation, the second determination module 1402 is configured to:

[0224] Determine a degree coefficient by which the search area can extend to the right according to the coding gain and complexity;

[0225] Based on the degree coefficient and the width of the current tile, determine a first number of pixels to extend to the right of the search area relative to the first position information;

[0226] Determine the first pending right boundary according to the first number of pixels to extend to the right.

[0227] In a possible implementation, the second determination module 1402 is configured to:

[0228] Determine the coding processing delay, and determine a second number of pixels to extend to the right of the search area relative to the second position information;

[0229] Determine the second pending right boundary according to the second number of pixels to extend to the right.

[0230] In a possible implementation, when the second pending right boundary is the pending right boundary closest to the current tile, the second determination module 1402 is configured to:

[0231] Use the second pending right boundary after moving it left by a fixed number of pixel lengths as the right boundary of the search area of the current tile in the video frame to be encoded.

[0232] In a possible implementation, the third determination module 1403 is configured to:

[0233] Determine a first encoded template representing the current tile in the encoded area adjacent to the current tile, where the relative positional relationship between the current tile and the first encoded template is a preset relationship;

[0234] Perform pixel similarity matching in the search area according to the first encoded template, and determine a second encoded template in the search area whose pixel similarity reaches the similarity condition;

[0235] Determine the reference tile according to the preset relationship and the second encoded template.

[0236] In a possible implementation, the coding processing delay is the sum of the side lengths of at least one CTU.

[0237] As can be seen from the video encoding device provided above, during the in-frame encoding of the video frame to be encoded by means of parallel encoding processing, the video frame to be encoded is divided into N*M CTUs. The target CTU where the current block to be encoded is located is in the i-th row of CTUs, and the i-th row of CTUs is one of the K rows of CTUs for parallel encoding processing. When performing in-frame encoding on the current block, the search area of the current block will cover a partial area in the (i - 1)-th row of CTUs and extend a certain length to the right relative to the current block in the (i - 1)-th row of CTUs. Although the mechanism of parallel encoding processing is that the encoding progress of adjacent rows of CTUs is not synchronized, the encoding progress of the (i - 1)-th row of CTUs is faster than that of the i-th row of CTUs, and the difference between them is the encoding processing delay. However, in some cases, the search area of the current block will extend to the area with uncertain encoding results in the (i - 1)-th row of CTUs. If the reference block matched from the search area is in this uncertain area, it is very likely that the reference block used for decoding is inconsistent with that used for encoding, resulting in incorrect decoded results and affecting the quality of the video frame to be encoded. Therefore, when determining the right boundary of the search area, based on the encoding processing delay as the determination basis, the right boundary is determined in the encoded CTUs of the (i - 1)-th row of CTUs, so as to ensure that the areas covered by the search area are all encoded areas, avoid the situation of using different reference blocks during the encoding and decoding of the current block, and effectively improve the encoding quality of the video frame to be encoded.

[0238] Figure 15 FIG. is a schematic diagram of a video decoding device provided by an embodiment of the present application. The video decoding device 1500 includes: a first determination module 1501, a second determination module 1502, a third determination module 1503, and a decoding module 1504;

[0239] The first determination module 1501 is configured to determine a current block to be decoded from an encoded video frame. The current block is in a target coding tree unit (CTU). The encoded video frame includes N*M CTUs. The target CTU is in the i-th row of CTUs of the encoded video frame and is in one of the K rows of CTUs for parallel decoding processing. In the parallel decoding processing, the decoding progress difference between adjacent rows is the decoding processing delay, and 1 < K ≤ N;

[0240] The second determination module 1502 is configured to determine the right boundary of the search area of the current block in the decoded video frame according to the decoding processing delay. The right boundary is in the decoded CTUs of the (i - 1)-th row of CTUs. In the encoded video frame, the (i - 1)-th row of CTUs is above the i-th row of CTUs;

[0241] The third determination module 1503 is configured to search for the current tile in the search area to determine a reference tile in the search area, where the reference tile is an encoded tile whose pixel similarity to the current tile reaches a similarity condition;

[0242] The decoding module 1504 is configured to decode the current tile using the reference tile, and use the next tile to be decoded as the current tile until the encoded video frame is decoded completely to obtain a decoded video frame.

[0243] In a possible implementation, the second determination module 1502 is configured to:

[0244] Determine a first pending right boundary of the search area in the encoded video frame according to the decoding gain and complexity, and the first position information of the current tile in the encoded video frame;

[0245] Determine a second pending right boundary of the search area in the encoded video frame according to the decoding processing delay and the second position information of the target CTU in the encoded video frame;

[0246] Determine the right boundary of the search area of the current tile in the encoded video frame through the first pending right boundary and the second pending right boundary.

[0247] In a possible implementation, the second determination module 1502 is configured to:

[0248] Determine the right boundary of the search area of the current tile in the encoded video frame according to the pending right boundary closest to the current tile among the first pending right boundary and the second pending right boundary.

[0249] In a possible implementation, the second determination module 1502 is configured to:

[0250] Determine a degree coefficient of the extent to which the search area can extend to the right according to the decoding gain and complexity;

[0251] Based on the degree coefficient and the width of the current tile, determine a first pixel value extended to the right of the search area relative to the first position information;

[0252] Determine the first pending right boundary according to the first pixel value extended to the right and the first position information of the current tile in the encoded video frame.

[0253] In a possible implementation, the second determination module 1502 is configured to:

[0254] Determine the decoding processing delay, and determine a second right extension pixel value of the search area relative to the second position information;

[0255] Determine the second pending right boundary according to the second right extension pixel value and the second position information of the target CTU in the encoded video frame.

[0256] In a possible implementation manner, when the second pending right boundary is the pending right boundary closest to the current tile, the second determination module 1502 is configured to:

[0257] Use the second pending right boundary after moving it left by a fixed pixel length as the right boundary of the search area of the current tile in the encoded video frame.

[0258] In a possible implementation manner, the third determination module 1503 is configured to:

[0259] Determine a first decoded template representing the current tile in the decoded area adjacent to the current tile, where the relative position relationship between the current tile and the first decoded template is a preset relationship;

[0260] Perform pixel similarity matching in the search area according to the first decoded template, and determine a second decoded template in the search area whose pixel similarity reaches the similarity condition;

[0261] Determine the reference tile according to the preset relationship and the second decoded template.

[0262] In a possible implementation manner, the decoding processing delay is the sum of the side lengths of at least one CTU.

[0263] As can be seen from the video decoding device provided above, during the process of intra-frame decoding of an encoded video frame by means of parallel decoding processing, the encoded video frame is divided into N*M CTUs. The target CTU where the current block to be decoded is located is in the i-th row of CTUs, and the i-th row of CTUs is one of the K rows of CTUs for parallel decoding processing. When performing intra-frame decoding on the current block, the search area of the current block will cover a partial area in the (i-1)-th row of CTUs and extend a certain length to the right relative to the current block in the (i-1)-th row of CTUs. Although the mechanism of parallel decoding processing is that the decoding progress of adjacent rows of CTUs is not synchronized, the decoding progress of the (i-1)-th row of CTUs is faster than that of the i-th row of CTUs, and the difference between the two is the decoding processing delay. However, in some cases, the search area of the current block will extend to the area where the decoding result in the (i-1)-th row of CTUs is uncertain. If the reference block matched from the search area is in this uncertain area, it is very likely to cause an incorrect decoding result and affect the quality of the decoded video frame. Therefore, when determining the right boundary of the search area, based on the decoding processing delay as the determination basis, the right boundary is determined in the decoded CTUs of the (i-1)-th row of CTUs, so as to ensure that the areas covered by the search area are all decoded areas, avoid the situation of different reference blocks when encoding and decoding the current block, and effectively improve the decoding quality of the encoded video frame.

[0264] An embodiment of the present application further provides a computer device, including a terminal device or a server. The foregoing video encoding device and video decoding device can be configured in this computer device. The following introduces this computer device with reference to the accompanying drawings.

[0265] If this computer device is a terminal device, please refer to Figure 16 As shown, an embodiment of the present application provides a terminal device. Taking the terminal device as a mobile phone as an example:

[0266] Figure 16 Shown is a block diagram of a part of the structure of the mobile phone provided by an embodiment of the present application. Refer to Figure 16 , the mobile phone includes: a radio frequency (RF) circuit 1410, a memory 1420, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a wireless fidelity (WiFi) module 1470, a processor 1480, and a power supply 1490 and other components. Those skilled in the art can understand that Figure 16 the structure of the mobile phone shown in

[0267] does not constitute a limitation on the mobile phone and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements. Figure 16 The following specifically introduces each component of the mobile phone in combination with

[0268] The RF circuit 1410 can be used for receiving and transmitting information or signals during calls. Specifically, after receiving the downlink information from the base station, it is processed by the processor 1480. Additionally, it sends the uplink data designed to the base station.

[0269] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1420. The memory 1420 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the voice playback function, image playback function, etc.); the data storage area can store the data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 1420 can include high-speed random access memory and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices.

[0270] The input unit 1430 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the mobile phone. Specifically, the input unit 1430 can include a touch panel 1431 and other input devices 1432.

[0271] The display unit 1440 can be used to display the information input by the user, the information provided to the user, and various menus of the mobile phone. The display unit 1440 can include a display panel 1441.

[0272] The mobile phone can also include at least one sensor 1450, such as a light sensor, motion sensor, and other sensors.

[0273] The audio circuit 1460, speaker 1461, and microphone 1462 can provide an audio interface between the user and the mobile phone.

[0274] WiFi belongs to short-range wireless transmission technology. The mobile phone can help users receive and send emails, browse the web, and access streaming media through the WiFi module 1470, providing users with wireless broadband Internet access.

[0275] The processor 1480 is the control center of the mobile phone, connecting various parts of the entire mobile phone using various interfaces and lines. By running or executing the software programs and / or modules stored in the memory 1420, and calling the data stored in the memory 1420, it executes various functions of the mobile phone and processes data.

[0276] The mobile phone also includes a power supply 1490 (such as a battery) that powers each component.

[0277] In this embodiment, the processor 1480 included in the terminal device is further configured to execute the steps in the methods of the embodiments of the present application.

[0278] If the computer device is a server, an embodiment of the present application further provides a server. Please refer to Figure 17 as shown Figure 17 FIG. 1500 is a structural diagram of the server 1500 provided by the embodiment of the present application. The server 1500 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 1522 (for example, one or more processors) and a memory 1532, and one or more storage media 1530 for storing application programs 1542 or data 1544 (for example, one or more mass storage devices). Among them, the memory 1532 and the storage media 1530 may be transient storage or persistent storage. The program stored in the storage media 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Further, the central processing unit 1522 may be configured to communicate with the storage media 1530 and execute a series of instruction operations in the storage media 1530 on the server 1500.

[0279] The server 1500 may further include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input / output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.

[0280] The steps performed by the server in the above embodiments may be based on Figure 17 the server structure shown

[0281] In addition, an embodiment of the present application further provides a storage medium, which is used to store a computer program, and the computer program is used to execute the method provided in the above embodiment.

[0282] An embodiment of the present application further provides a computer program product including a computer program. When it runs on a computer device, it causes the computer device to execute the method provided in the above embodiment.

[0283] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including those of the above method embodiments. The foregoing storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk, or optical disc, etc., which can store computer programs.

[0284] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.

[0285] It should be noted that the embodiments in this specification are all described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and system embodiments described above are only illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0286] As described above, this is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Moreover, based on the implementation manners provided in the above aspects, the present application can be further combined to provide more implementation manners. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A video encoding method, characterized in that: The method comprises: A current block to be encoded is determined from a video frame to be encoded, the current block is in a target coding tree unit CTU, the video frame to be encoded includes N*M CTUs, the target CTU is located in the i-th row CTU of the video frame to be encoded, and is located in a row of K rows of CTUs in parallel encoding processing, and the encoding progress of adjacent rows in the parallel encoding processing differs by the encoding processing delay, 1 <K≤N; Determine a first pending right boundary of a search area of ​​the current image block in the video frame to be encoded according to the coding gain and complexity and the first position information of the current image block in the video frame to be encoded; Determine a second pending right boundary of the search area in the video frame to be encoded according to the encoding processing delay and second position information of the target CTU in the video frame to be encoded; Determine, by using the first to-be-determined right boundary and the second to-be-determined right boundary, a right boundary of the search area of ​​the current picture block in the to-be-encoded video frame, wherein the right boundary is in an encoded CTU of an i-1th row of CTUs, and in the to-be-encoded video frame, the i-1th row of CTUs is located above the i-th row of CTUs; Searching for the current picture block in the search area to determine a reference picture block in the search area, wherein the reference picture block is an encoded picture block whose pixel similarity with the current picture block meets a similarity condition; The current image block is encoded using the reference image block, and the next image block to be encoded is used as the current image block, until the encoding of the video frame to be encoded is completed, thereby obtaining an encoded video frame.

2. The method according to claim 1, characterized in that The determining, by using the first pending right boundary and the second pending right boundary, a right boundary of the search area of ​​the current picture block in the to-be-coded video frame comprises: The right boundary of the search area of ​​the current image block in the to-be-determined video frame is determined according to the to-be-determined right boundary closest to the current image block among the first to-be-determined right boundary and the second to-be-determined right boundary.

3. The method according to claim 1, characterized in that The determining, according to the coding gain and complexity, and the first position information of the current picture block in the video frame to be encoded, a first pending right boundary of the search area of ​​the current picture block in the video frame to be encoded, comprises: Determining, according to the coding gain and the complexity, a coefficient of the extent to which the search area can be extended to the right; Based on the degree coefficient and the width of the current image block, determining a first rightward extension pixel number of the search area relative to the first position information; The first pending right boundary is determined according to the first rightward extending pixel number.

4. The method according to claim 1, characterized in that The determining, according to the encoding processing delay and the second position information of the target CTU in the video frame to be encoded, a second pending right boundary of the search area in the video frame to be encoded, comprises: determining the encoding process delay, and determining a second rightward extension pixel number of the search area relative to the second position information; The second undetermined right boundary is determined according to the second rightward extending pixel number.

5. The method according to claim 2, characterized in that: When the second undetermined right boundary is the undetermined right boundary closest to the current image block, determining the right boundary of the search area of ​​the current image block in the to-be-encoded video frame includes: The second undetermined right boundary is moved leftward by a fixed pixel length to serve as the right boundary of the search area of ​​the current block in the to-be-encoded video frame.

6. The method according to any one of claims 1 to 5, characterized in that: The searching for the current image block in the search area to determine a reference image block in the search area includes: Determine a first encoded template representing the current image block in an encoded region adjacent to the current image block, wherein a relative position relationship between the current image block and the first encoded template is a preset relationship; Performing pixel similarity matching in the search area according to the first encoded template, and determining a second encoded template whose pixel similarity meets the similarity condition from the search area; The reference image block is determined according to the preset relationship and the second encoded template.

7. The method according to any one of claims 1 to 5, characterized in that: The encoding process delay is the sum of the side lengths of at least one CTU.

8. A video decoding method, characterized in that: The method comprises: A current tile to be decoded is determined from an encoded video frame, the current tile is in a target coding tree unit CTU, the encoded video frame includes N*M CTUs, the target CTU is in the i-th row CTU of the encoded video frame, and is in a row of K rows of CTUs in parallel decoding processing, the decoding progress of adjacent rows in the parallel decoding processing differs by a decoding processing delay, 1 <K≤N; Determine, according to the decoding gain and complexity, and the first position information of the current picture block in the encoded video frame, a first pending right boundary of the search area of ​​the current picture block in the encoded video frame; Determine a second pending right boundary of the search area in the encoded video frame according to the decoding process delay and second position information of the target CTU in the encoded video frame; Determine, by using the first pending right boundary and the second pending right boundary, a right boundary of the search area of ​​the current tile in the encoded video frame, wherein the right boundary is in a decoded CTU of an i-1th row of CTUs, and in the encoded video frame, the i-1th row of CTUs is located above the i-th row of CTUs; Searching for the current picture block in the search area to determine a reference picture block in the search area, wherein the reference picture block is an encoded picture block whose pixel similarity with the current picture block meets a similarity condition; The current image block is decoded using the reference image block, and the next image block to be decoded is used as the current image block, until the decoding of the encoded video frame is completed to obtain a decoded video frame.

9. The method according to claim 8, characterized in that The determining, by using the first pending right boundary and the second pending right boundary, a right boundary of the search area of ​​the current picture block in the encoded video frame comprises: The right boundary of the search area of ​​the current image block in the encoded video frame is determined according to the pending right boundary closest to the current image block among the first pending right boundary and the second pending right boundary.

10. The method according to claim 8, characterized in that The determining, according to the decoding gain and complexity, and the first position information of the current picture block in the encoded video frame, a first pending right boundary of the search area of ​​the current picture block in the encoded video frame comprises: Determining, according to the decoding gain and the complexity, a coefficient of the extent to which the search area can be extended to the right; Determine, based on the degree coefficient and the width of the current image block, a first rightward extending pixel value of the search area relative to the first position information; The first pending right boundary is determined according to the first right-extending pixel value and first position information of the current block in the encoded video frame.

11. The method according to claim 8, characterized in that The determining, according to the decoding processing delay and the second position information of the target CTU in the encoded video frame, a second pending right boundary of the search area in the encoded video frame comprises: determining the decoding process delay, and determining a second rightward extending pixel value of the search area relative to the second position information; The second pending right boundary is determined according to the second right-extending pixel value and second position information of the target CTU in the encoded video frame.

12. The method according to claim 9, characterized in that When the second pending right boundary is the pending right boundary closest to the current image block, determining the right boundary of the search area of ​​the current image block in the encoded video frame includes: The second undetermined right boundary is moved leftward by a fixed pixel length to serve as the right boundary of the search area of ​​the current block in the encoded video frame.

13. The method according to any one of claims 8 to 12, characterized in that: The searching for the current image block in the search area to determine a reference image block in the search area includes: Determining a first decoded template representing the current image block in a decoded area adjacent to the current image block, wherein a relative position relationship between the current image block and the first decoded template is a preset relationship; Performing pixel similarity matching in the search area according to the first decoded template, and determining a second decoded template whose pixel similarity meets the similarity condition from the search area; The reference image block is determined according to the preset relationship and the second decoded template.

14. A video encoding device, characterized in that: The device comprises: a first determination module, a second determination module, a third determination module and an encoding module; The first determination module is used to determine a current image block to be encoded from a video frame to be encoded, the current image block is in a target coding tree unit CTU, the video frame to be encoded includes N*M CTUs, the target CTU is located in the i-th row CTU of the video frame to be encoded, and is located in a row of K rows of CTUs in parallel encoding processing, and the encoding progress difference between adjacent rows in the parallel encoding processing is the encoding processing delay, 1 <K≤N; The second determination module is used to determine a first pending right boundary of a search area of ​​the current image block in the video frame to be encoded according to the coding gain and complexity, and the first position information of the current image block in the video frame to be encoded; determine a second pending right boundary of the search area in the video frame to be encoded according to the coding processing delay and the second position information of the target CTU in the video frame to be encoded; determine a right boundary of the search area of ​​the current image block in the video frame to be encoded by using the first pending right boundary and the second pending right boundary, the right boundary is in an encoded CTU of an i-1th row of CTUs, and in the video frame to be encoded, the i-1th row of CTUs is located above the i-th row of CTUs; The third determination module is configured to search the current image block in the search area to determine a reference image block in the search area, wherein the reference image block is an encoded image block whose pixel similarity with the current image block meets a similarity condition; The encoding module is used to encode the current image block using the reference image block, and use the next image block to be encoded as the current image block, until the encoding of the video frame to be encoded is completed to obtain an encoded video frame.

15. The device according to claim 14, characterized in that The second determining module is used to: The right boundary of the search area of ​​the current image block in the to-be-determined video frame is determined according to the to-be-determined right boundary closest to the current image block among the first to-be-determined right boundary and the second to-be-determined right boundary.

16. The device according to claim 14, characterized in that The second determining module is used to: Determining, according to the coding gain and the complexity, a coefficient of the extent to which the search area can be extended to the right; Based on the degree coefficient and the width of the current image block, determining a first rightward extension pixel number of the search area relative to the first position information; The first pending right boundary is determined according to the first rightward extending pixel number.

17. The device according to claim 14, characterized in that The second determining module is used to: determining the encoding process delay, and determining a second rightward extension pixel number of the search area relative to the second position information; The second undetermined right boundary is determined according to the second rightward extending pixel number.

18. The device according to claim 15, characterized in that When the second pending right boundary is the pending right boundary closest to the current block, the second determining module is configured to: The second undetermined right boundary is moved leftward by a fixed pixel length to serve as the right boundary of the search area of ​​the current block in the to-be-encoded video frame.

19. The device according to any one of claims 14 to 18, characterized in that: The third determining module is used to: Determine a first encoded template representing the current image block in an encoded region adjacent to the current image block, wherein a relative position relationship between the current image block and the first encoded template is a preset relationship; Performing pixel similarity matching in the search area according to the first encoded template, and determining a second encoded template whose pixel similarity meets the similarity condition from the search area; The reference image block is determined according to the preset relationship and the second encoded template.

20. The device according to any one of claims 14 to 18, characterized in that: The encoding process delay is the sum of the side lengths of at least one CTU.

21. A video decoding device, characterized in that: The device comprises: a first determination module, a second determination module, a third determination module and a decoding module; The first determination module is used to determine a current image block to be decoded from an encoded video frame, the current image block is in a target coding tree unit CTU, the encoded video frame includes N*M CTUs, the target CTU is located in the i-th row CTU of the encoded video frame, and is located in a row of K rows of CTUs in parallel decoding processing, and the difference in decoding progress of adjacent rows in the parallel decoding processing is a decoding processing delay, 1 <K≤N; The second determination module is used to determine a first pending right boundary of a search area of ​​the current image block in the encoded video frame according to the decoding gain and complexity and the first position information of the current image block in the encoded video frame; determine a second pending right boundary of the search area in the encoded video frame according to the decoding processing delay and the second position information of the target CTU in the encoded video frame; determine a right boundary of the search area of ​​the current image block in the encoded video frame through the first pending right boundary and the second pending right boundary, the right boundary is in a decoded CTU of an i-1th row of CTUs, and in the encoded video frame, the i-1th row of CTUs is located above the i-th row of CTUs; The third determination module is configured to search the current image block in the search area to determine a reference image block in the search area, wherein the reference image block is an encoded image block whose pixel similarity with the current image block meets a similarity condition; The decoding module is used to decode the current picture block using the reference picture block, and use the next picture block to be decoded as the current picture block, until the decoding of the encoded video frame is completed to obtain a decoded video frame.

22. The device according to claim 21, characterized in that The second determining module is used to: The right boundary of the search area of ​​the current image block in the encoded video frame is determined according to the pending right boundary closest to the current image block among the first pending right boundary and the second pending right boundary.

23. The device according to claim 21, characterized in that The second determining module is used to: Determining, according to the decoding gain and the complexity, a coefficient of the extent to which the search area can be extended to the right; Determine, based on the degree coefficient and the width of the current image block, a first rightward extending pixel value of the search area relative to the first position information; The first pending right boundary is determined according to the first right-extending pixel value and first position information of the current block in the encoded video frame.

24. The device according to claim 21, characterized in that The second determining module is used to: determining the decoding process delay, and determining a second rightward extending pixel value of the search area relative to the second position information; The second pending right boundary is determined according to the second right-extending pixel value and second position information of the target CTU in the encoded video frame.

25. The device according to claim 22, characterized in that When the second pending right boundary is the pending right boundary closest to the current block, the second determining module is configured to: The second undetermined right boundary is moved leftward by a fixed pixel length to serve as the right boundary of the search area of ​​the current block in the encoded video frame.

26. The device according to any one of claims 21 to 25, characterized in that The third determining module is used to: Determining a first decoded template representing the current image block in a decoded area adjacent to the current image block, wherein a relative position relationship between the current image block and the first decoded template is a preset relationship; Performing pixel similarity matching in the search area according to the first decoded template, and determining a second decoded template whose pixel similarity meets the similarity condition from the search area; The reference image block is determined according to the preset relationship and the second decoded template.

27. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store computer programs; The processor is configured to execute the method of any one of claims 1-7 or 8-13 according to the computer program.

28. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a computer device, the method according to any one of claims 1 to 7 or 8 to 13 is implemented.

29. A computer program product comprising a computer program, which, when executed on a computer device, causes the computer device to perform the method of any one of claims 1 to 7 or 8 to 13.

Citation Information

Patent Citations

  • Search region determination for intra block copy in video coding

    CN106134196A

  • Method of Intra Block Copy Search and Compensation Range

    US20170094271A1