Video coding and decoding method and related device
By determining the right boundary of the search area based on the encoding processing delay in WPP mode, the problem of inaccurate reference block division in video encoding and decoding is solved and the encoding quality is improved.
Patent Information
- Application Number
- CN202410702735.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-31
AI Technical Summary
In the existing technology, in the Wave Front Parallel Processing (WPP) mode, it is difficult to accurately divide the search area of the reference block during video encoding and decoding, resulting in a decrease in encoding and decoding quality.
Determine the right boundary of the search area based on the coding processing delay to ensure that it is within the coded area, avoid relying on different reference blocks, and improve coding quality.
By determining the search area within the coded area, the consistency of the reference blocks during encoding and decoding is ensured, and the encoding quality of the video frame to be encoded is improved.
Smart Images

Figure CN118612445A
Abstract
Description
Technical Field
[0001] The present application relates to the field of video coding and decoding, and in particular to a video coding and decoding method and related devices. Background Art
[0002] In the related art, the Wave Front Parallel Processing (WPP) method is used to encode and decode the video. In this method, the efficiency of video encoding and decoding is high due to the use of parallel processing. In the process of using WPP for video encoding and decoding, it is also necessary to combine the intra-frame prediction method to determine the reference block of the current block by defining the search area 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, the method of defining the search area in the related art is not well applicable to the case of video encoding and decoding based on WPP.
[0004] In order to adapt to the parallel processing mode of WPP for video encoding and decoding, a video encoding and decoding method capable of accurately dividing the search area of the reference block is urgently needed. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a video encoding and decoding method and related devices, which can determine the right boundary of the search area in the encoded CTU based on the encoding processing delay, ensure that the search area covers all encoded areas, avoid the situation of using 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 the present application disclose the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a video encoding method, the method comprising:
[0008] 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;
[0009] Determine, according to the encoding process delay, 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;
[0010] 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;
[0011] 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.
[0012] On the other hand, an embodiment of the present application provides a video decoding method, the method comprising:
[0013] 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;
[0014] Determine, according to the decoding process delay, a right boundary of the search area of the current tile in the decoded 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;
[0015] 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;
[0016] 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.
[0017] In yet another aspect, an embodiment of the present application provides a video encoding device, the device comprising: a first determination module, a second determination module, a third determination module and an encoding module;
[0018] 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;
[0019] The second determination module is used to determine, according to the encoding process delay, 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;
[0020] 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;
[0021] 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.
[0022] In yet another aspect, an embodiment of the present application provides a video decoding device, the device comprising: a first determination module, a second determination module, a third determination module and a decoding module;
[0023] 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;
[0024] The second determination module is used to determine, according to the decoding process delay, a right boundary of the search area of the current tile in the decoded 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;
[0025] 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;
[0026] 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.
[0027] In another aspect, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:
[0028] The memory is used to store computer programs;
[0029] The processor is configured to execute the method described above according to the computer program.
[0030] In another aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above aspects.
[0031] On the other hand, an embodiment of the present application provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method described in the above aspects.
[0032] It can be seen from the above technical solution that in the process of intra-frame encoding of the video frame to be encoded by 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 CTU, and the i-th row CTU is a row in the K rows of CTUs processed in parallel. When the current block is intra-frame encoded, the search area of the current block will cover part of the area in the i-1th row CTU, and extend a certain length to the right of the i-1th row CTU relative to the current block. 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-1th row CTU is faster than that of the i-th row CTU, and the difference between the two is the encoding processing delay, but in some cases, the search area of the current block will extend to the area where the encoding result is uncertain in the i-1th row CTU. If the reference block matched from the search area is in the uncertain area, it is likely that the reference block based on decoding is inconsistent with that based on encoding, and an erroneous result is decoded, affecting the quality of the video frame to be encoded. To this end, when determining the right boundary of the search area, the right boundary is determined in the encoded CTU of the i-1th row of CTU based on the encoding processing delay to ensure that the search area covers all encoded areas, avoiding the situation where different reference blocks are used when encoding and decoding the current block, and effectively improving the encoding quality of the video frame to be encoded. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 A schematic diagram of a scenario of a video encoding method provided in an embodiment of the present application;
[0035] Figure 2 A flowchart of a video encoding method provided in an embodiment of the present application;
[0036] Figure 3 A schematic diagram of an encoding process;
[0037] Figure 4 A schematic diagram of a WPP encoding process provided in an embodiment of the present application;
[0038] Figure 5 A schematic diagram of another WPP encoding process provided in an embodiment of the present application;
[0039] Figure 6 A schematic diagram of determining a pending right boundary based on first position information provided in an embodiment of the present application;
[0040] Figure 7 A schematic diagram of another method of determining a pending right boundary based on first position information provided in an embodiment of the present application;
[0041] Figure 8 A schematic diagram of determining a pending right boundary based on second position information provided in an embodiment of the present application;
[0042] Fig. 9 A schematic diagram of another method of determining a pending right boundary based on second position information provided in an embodiment of the present application;
[0043] Fig.10 A schematic diagram of determining a right boundary provided in an embodiment of the present application;
[0044] Fig.11 A schematic diagram of another method for determining a right boundary provided in an embodiment of the present application;
[0045] Fig.12 A schematic diagram of determining a reference block provided in an embodiment of the present application;
[0046] Fig.13 A flowchart of a video encoding method provided in an embodiment of the present application;
[0047] Fig.14 A schematic diagram of a video encoding device provided in an embodiment of the present application;
[0048] Fig.15 A schematic diagram of a video decoding device provided in an embodiment of the present application;
[0049] Fig.16 A structural diagram of a terminal device provided in an embodiment of the present application;
[0050] Fig.17A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0052] In the related art, the video encoding and decoding process can be performed in a WPP manner, that is, a video frame is divided into several rows according to a coding tree unit (CTU), multiple rows of CTU are encoded in parallel, and the current row has a CTU processing delay compared to the previous row. Video encoding and decoding through WPP can improve the efficiency of video encoding and decoding.
[0053] At the same time, in the process of video encoding and decoding, intra-frame prediction can be used. Intra-frame prediction refers to encoding and decoding the current block by analyzing the correlation between the current block and the reference 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 so that the search area is used as the search range of the reference block in the video frame. The intra-frame prediction method can be used under the premise of using WPP for video encoding and decoding to improve the efficiency of video encoding and decoding.
[0054] The method of determining the search range of the reference block in the related art cannot be well applied to the intra-frame prediction in the process of video encoding and decoding based on the WPP method, which may cause abnormalities in the encoding and decoding results obtained by the video encoding and decoding.
[0055] To this end, a video encoding and decoding method and related devices are provided in an embodiment of the present application. The right boundary of the search area can be determined in the encoded CTU based on the encoding processing delay, ensuring that the search area covers all encoded areas, avoiding the situation of using different reference blocks when encoding and decoding the current block, and improving the encoding quality of the video frame to be encoded.
[0056] The data processing method provided in the embodiment of the present application can be implemented by a computer device, which can be a terminal device or a server, wherein 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, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application is not limited here. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data.
[0057] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend 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 rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0058] Cloud computing refers to the delivery and use model of IT infrastructure, which means obtaining required resources through the network in an on-demand and easily scalable manner; in a broad sense, cloud computing refers to the delivery and use model of services, which means obtaining required services through the network in an on-demand and easily scalable manner. This service 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 balancing.
[0059] With the development of the Internet, real-time data streams, and the diversification of connected devices, as well as the demand for search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Different from the previous parallel distributed computing, the emergence of cloud computing will promote revolutionary changes in the entire Internet model and enterprise management model from a conceptual perspective.
[0060] The video encoding and decoding scheme provided in the embodiment of the present application involves cloud computing technology. Based on cloud computing technology, parallel encoding processing of CTUs in the video frame to be encoded is implemented at the video sending end, and the encoding progress of adjacent rows in the parallel encoding process is different. By encoding the video frame to be encoded, video compression is achieved, and the transmission efficiency of the video is improved. At the same time, based on cloud computing technology, parallel decoding processing of CTUs in the encoded video frame is performed at the video receiving end to achieve decompression of the encoded video frame.
[0061] Figure 1 A scenario diagram of a video encoding method provided in an embodiment of the present application, wherein the aforementioned computer device is a server.
[0062] When a video needs to be encoded, the server needs to determine the current block to be encoded from the video frame to be encoded. Figure 1 As shown in the figure, the video frame to be encoded includes N*M (where N=6, M=4) CTUs, the target CTU is located in the i-th row CTU of the video frame to be encoded (where i=3), and the target CTU is located in the third row of the K rows of CTUs in parallel encoding processing (where K=3). In the figure, the encoding progress of adjacent rows in the parallel encoding process differs by the encoding processing delay, which is 2 CTUs. Figure 1 The current block is shown above, and the 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 the current block is encoded, the blocks on the left and above the current block have been encoded. Therefore, when determining the search area, only the right boundary needs to be considered. According to the encoding processing delay, the right boundary of the search area of the reference block 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 located in the encoded CTU of the i-1th row CTU (where i-1=2), and the i-1th row is located 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 the search area, the reference block is searched. As shown in the figure, the reference block is located in the first CTU of the i-1th row. The current block is encoded using the reference block. After the encoding is completed, the next block to be encoded is used as the current block. Figure 1As shown below, the next tile to be encoded is located in the third CTU of the i-th row. The above steps are repeated with this tile as the current tile until the encoded video frame is encoded to obtain the encoded video frame. In the process, the right boundary can be determined in the encoded CTU of the i-1th row CTU by using the encoding processing delay as the basis for determination, ensuring that the search area corresponding to the current tile is all the encoded area, avoiding the situation where the reference tile is inconsistent when the current tile is encoded and decoded, resulting in poor encoding and decoding quality.
[0064] Figure 2 A flowchart of a video encoding method provided in an embodiment of the present application, the method can be executed by a computer device. In this embodiment, the computer device is taken as a server for example.
[0065] S201: Determine a current block to be encoded from a video frame to be encoded.
[0066] As the video resolution increases, the corresponding video storage space becomes larger. If the original video is directly transmitted, the transmission efficiency of the video will be greatly affected. Therefore, in the related art, when transmitting a video, the video frame of the original video (i.e., the video frame to be encoded) is generally compressed by video encoding, and the encoded video frame obtained after the compression is transmitted. Among them, the video frame to be encoded can be a video frame collected in real time, which is used for instant communication (such as live broadcast, cloud games, etc.), and can also be a video frame corresponding to a pre-stored video.
[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 the size can be determined by the encoding and decoding requirements of the video frame, which is not limited here. The tile is the basic unit of the encoding and decoding process of the video frame. The CTU includes tiles. When encoding the video frame to be encoded, the tiles therein need to be encoded. The tile can be represented by a coding unit (Coding Unit, CU), and the CU can be further divided into a prediction unit (Prediction Unit, PU) and a transform unit (Transform Unit, TU). The shape of the CU can be a square or a rectangle, and the size can also be determined by the encoding and decoding requirements of the video frame, which is not limited here. The current tile mentioned above refers to the tile in the video to be encoded that needs to start encoding.
[0068] In the embodiment of the present application, the video frames to be encoded of the video are encoded in parallel by WPP, and the video frames to be encoded refer to the original video frames that have not been processed by the video encoder. The video frames collected in real time or stored in advance include multiple video frames to be encoded, and the video frames to be encoded include multiple CTUs arranged in row and column order. The process of encoding the video frames to be encoded is: encoding row by row from top to bottom, and encoding CTU by CTU from left to right. Figure 3 A schematic diagram of the encoding process is shown in Figure 3 As shown, the dark gray part is the encoded CTU, the white part is the unencoded CTU, and the light gray part is the CTU being encoded. The white dotted line with an arrow in the figure indicates that the encoding sequence is from top to bottom row by row and from left to right.
[0069] WPP encoding method and Figure 3 There are some differences in the methods shown. Although it is also carried out row by row from top to bottom and from left to right, the encoding of adjacent rows is different. Figure 4 A schematic diagram of a WPP encoding process provided in an embodiment of the present application, as shown in the figure, Figure 3 The encoding process is similar to that in , where the dark gray part is the encoded CTU, the white part is the unencoded CTU, and the light gray part is the CTU being encoded. The white dotted line with an arrow in the figure indicates that the encoding sequence is from top to bottom, row by row, and from left to right. The difference is that: using WPP will perform parallel encoding on multiple rows of CTUs, and the encoding progress between adjacent rows is the same. The figure schematically shows the situation where 3 rows of CTUs are processed in parallel using WPP, and the encoding progress of adjacent rows differs by 2 CTUs. Parallel encoding refers to the simultaneous encoding of multiple rows of CTUs in the video frame to be encoded. The "simultaneous" here does not mean that each row of CTU starts to encode the first CTU from the left of the row at the same time, but that multiple rows of CTUs can simultaneously encode their own rows of CTUs on the premise that the encoding progress between adjacent rows is the same.
[0070] See also Figure 1As shown, the current tile is in 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 of CTUs between adjacent rows differs by two CTUs, and the size of one CTU is 64*64 pixels. At this time, it can be considered that the difference in the encoding progress 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 of adjacent rows differs by 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 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 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 used to encode the video frame, 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-1th row of CTU is faster than that of the i-th row of CTU, and the difference between the two is the encoding processing delay, but in some cases, the search area of the current block will extend to the area where the encoding result is uncertain in the i-1th row of CTU. When searching for reference blocks for the current block using intra-frame prediction, if the reference blocks matched in the search area have not been encoded (including those that have not yet started encoding and are being encoded), this may cause the reference blocks used during decoding to be inconsistent with those used during encoding, affecting the encoding and decoding quality of the video.
[0076] In the embodiment of the present application, it is necessary to encode the video frame to be encoded based on both WPP and intra-frame prediction. In the process of intra-frame prediction, it is necessary to encode the current block based on reconstructed pixels. Reconstructed pixels refer to pixels that have been encoded, as opposed to original pixels, which refer to pixels that have not been or have not been completely encoded. In the video frame to be encoded, the blocks are composed of pixels. Since the WPP method is used for parallel encoding processing in the present application, there are both reconstructed pixels and original pixels in the encoding process of the video frame to be encoded. Among them, the reconstructed pixels have a certain encoding result because the encoding has been completed, and the original pixels have an uncertain encoding result because the encoding has not been performed or has not been completed. Therefore, when the current block in the i-th row CTU is encoded based on the information in the i-1th row CTU, the determined search area may extend to the area where the pixel part of the i-1th row CTU that has not been or has not been completely encoded is located (that is, the area where the encoding result is uncertain).
[0077] Therefore, when searching for a reference block for the current block using intra-frame prediction, if the block matched in the search area is not entirely composed of reconstructed pixels as the reference block, it means that the reference block includes original pixels (i.e., pixels with uncertain encoding results). At this time, the current block is encoded based on the reference block, and the accuracy of the encoding result obtained is low.
[0078] In an embodiment of the present application, the process of encoding the video frame to be encoded and decoding the encoded video frame both adopts a combination of WPP and intra-frame prediction, and both are performed row by row from top to bottom and from left to right. When encoding and decoding the same current block, since there may be differences in the encoding and decoding speeds, if the reference block for encoding the current block in the encoding process is an unfinished encoded block, the corresponding reference block determined in the decoding process may be inconsistent with the position of the reference block in the encoding process; or the reference block for encoding the current block includes original pixels, while the reference blocks determined in the decoding process are all reconstructed pixels. Both of the above situations will result in the reference block used for decoding being inconsistent with that used for encoding, which will affect the accuracy of encoding and decoding of video frames. It should also be noted that, since the encoding of the video frame to be encoded is performed in a WPP manner, that is, a parallel encoding method is adopted in which the encoding progress of adjacent rows differs by the encoding processing delay, it can be made that when the current block is encoded, the CTUs on the left and above the current block have been encoded (that is, the CTUs on the left and above the current block are all reconstructed pixels, and the corresponding encoding results have been determined). When determining the search area, it is only necessary to determine the right boundary in the video to be encoded. The determination of the right boundary needs to take into account the encoding processing delay and ensure that the right boundary is located in the CTU that has been encoded. This can avoid, to a certain extent, the inclusion of CTUs that have not been encoded in the search area, resulting in the current block to be encoded being affected by the CTUs that have not been encoded and resulting in encoding errors. When the right boundary of the search area is determined, the determination of the entire search range corresponding to the current block is completed.
[0079] See also Figure 1 As shown, in Figure 1 According to the encoding process delay, the right boundary of the current tile search area is determined to be in the encoded CTU of the i-1th row of CTUs. In the embodiment of the present application, the i-1th row of CTUs of the video frame to be encoded is located above the i-th row of CTUs.
[0080] S203: Search the current image block in the search area to determine a reference image block in the search area.
[0081] The reference block is an encoded block whose pixel similarity with the current block meets the similarity condition. Pixel similarity is an indicator used to measure the similarity 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 between the reference block and the current block reaches 80%. Generally speaking, the pixel similarity between the reference block and the current block is high, that is, the pixel difference between the reference block and the current block is small. This makes it convenient to record only the difference between the reference block and the current block when encoding the current block, greatly improving the encoding efficiency of the video frame to be encoded and increasing the compression degree of the block.
[0082] The reference block is located in 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 pattern of the image content in the video frame, adjacent blocks generally have a high similarity. After the search area is determined, the current block can be searched in the search area to determine the reference block corresponding to the current block. Assuming that the similarity condition reached by the pixel similarity between the reference block and the current block is that the degree of consistency between the reference block and the current block reaches 85%, then the difference between the reference block and the current block is 15%. When the reference block is subsequently used to encode the current block, only the 15% difference needs to be recorded, which can improve the efficiency of encoding the current block to a certain extent.
[0083] S204: 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.
[0084] When a reference block corresponding to the current block is determined in the search area, the reference block is used to encode the current 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 the encoding of the current block is completed, the next block in the video frame to be encoded is used as the current block to continue the process of determining the search area, searching for the reference block, and encoding until all the blocks in the video frame to be encoded are encoded, and an encoded video frame is obtained.
[0085] It can be seen from the above technical solution that in the process of intra-frame encoding of the video frame to be encoded by 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 CTU, and the i-th row CTU is a row in the K rows of CTUs processed in parallel. When the current block is intra-frame encoded, the search area of the current block will cover part of the area in the i-1th row CTU, and extend a certain length to the right of the i-1th row CTU relative to the current block. 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-1th row CTU is faster than that of the i-th row CTU, and the difference between the two is the encoding processing delay, but in some cases, the search area of the current block will extend to the area where the encoding result is uncertain in the i-1th row CTU. If the reference block matched from the search area is in the uncertain area, it is likely that the reference block based on decoding is inconsistent with that based on encoding, and an erroneous result is decoded, affecting the quality of the video frame to be encoded. To this end, when determining the right boundary of the search area, the right boundary is determined in the encoded CTU of the i-1th row of CTU based on the encoding processing delay to ensure that the search area covers all encoded areas, avoiding the situation where different reference blocks are used when encoding and decoding the current block, and effectively improving the encoding quality of the video frame to be encoded.
[0086] In the aforementioned S202, it is mentioned that "according to the coding process delay, the right boundary of the search area of the current block in the video frame to be coded is determined". In the process of determining the right boundary, different bases can be considered, and the bases may include the following two bases: one is coding gain and complexity, and the other is coding process delay. Based on the above two considerations, two different methods of determining the right boundary can be determined, and one is selected according to the actual situation in practical applications. Therefore, in a possible implementation method, the method of determining the right boundary can be:
[0087] A1: Determine a first pending right boundary of the search area in the video frame to be encoded according to the coding gain and complexity, and the first position information of the current block in the video frame to be encoded.
[0088] Coding gain refers to the compression ratio or performance improvement achieved by encoding the current block in the video frame to be encoded. In the embodiment of the present application, the compression ratio or performance improvement can be equivalent to the reference block searched for the current block having a higher quality (i.e., a higher pixel similarity with the current block). In practical applications, coding gain can be evaluated by indicators such as the size of the video file before and after encoding and the transmission speed.
[0089] Complexity refers to the computational resources and time required to encode the current block in the video frame to be encoded. When the search area is large, the corresponding complexity is greater, and more computational resources and time are required for encoding; when the search area is small, the corresponding complexity is smaller, and the computational resources and time required for encoding are smaller. Generally speaking, when the complexity is lower, the corresponding encoding efficiency is higher.
[0090] When determining the search area, it is necessary to weigh the two dimensions of coding gain and complexity. When the search area is large, the corresponding coding gain may be improved (which is conducive to finding a better quality reference block for encoding the current block), and the corresponding complexity will also increase (the corresponding consumption of computing resources will also increase), which will affect the efficiency of encoding; when the search range is small, a certain amount of coding gain may be lost, but the corresponding complexity is also lower. Therefore, it is necessary to combine different scenarios and focus on coding gain and complexity, which will not be repeated here.
[0091] The method for determining the first pending right boundary mentioned in A1 is determined based on the coding gain and complexity, and the first position information of the current block in the video frame to be encoded. In the process of encoding the video frame to be encoded, the upper left corner of the video frame to be encoded is used as the coordinate origin, and the first position information of the current block in the video frame to be encoded can be the coordinate information corresponding to the upper left corner of the current block, and the coordinate information can include the x-axis coordinate and the y-axis coordinate. That is, under the premise of considering the coding gain and complexity, the first pending right boundary is determined according to the first position information of the current block. The position of the current block in the video frame to be encoded can be clearly determined by the first position information of the current block, and the size of the search area for the current block can be determined in combination with the consideration of the coding gain and complexity. The size of the search area depends on the location of the first pending right boundary. At the same time, the search area is provided to the current block for searching the reference block, so it is necessary to determine the position of the search area in combination with the first position information of the current block, and the size of the search area determined according to the coding gain and complexity to obtain the first pending right boundary.
[0092] A2: Determine a second pending 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 process delay refers to the difference in coding progress between adjacent rows under the WPP coding process. In the process of determining the second pending right boundary, the second position information of the target CTU in the video frame to be encoded and the coding process delay are considered. It can be seen that the difference between the method for determining the second pending right boundary mentioned in A2 and the method for determining the first pending right boundary mentioned in A1 is that in the method for determining the second pending right boundary of A2, the coding process delay needs to be considered, and the second pending right boundary is determined according to the coding process delay, so that the second pending right boundary is located in the encoded CTU, and the coding process delay is determined based on the CTU, and 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 pending right boundary, there is no need to consider the position of the current block in the target CTU, and it can be determined in combination with the situation of the target CTU. In the second pending right boundary method, the determination process is simpler than A1.
[0094] A3: Determine the right boundary of the search area of the current block in the to-be-determined video frame through the first to-be-determined right boundary and the second to-be-determined right boundary.
[0095] When determining the right boundary of the search area of the current block in the to-be-coded video frame, the first to-be-determined right boundary and the second to-be-determined right boundary may be selected according to actual conditions, while also considering coding gain and complexity.
[0096] The A1 method determines the right boundary based on the information of the current tile, and the A2 method determines the right boundary based on the information of the target CTU. According to different considerations, the right boundary of the search area of the current tile can be determined from the first pending right boundary and the second pending right boundary.
[0097] For example, when the color complexity in the video frame to be encoded is high, the method of determining the right boundary based on the information of the current block in A1 may be preferred. The reason is that the target CTU is larger in size than the current block, which can also be understood as the target CTU having a larger division granularity than the current block. When the color complexity in the video frame to be encoded is high, the corresponding block division granularity is small, that is, more blocks will be accommodated in the unit search area in the video frame to be encoded. At this time, by considering the coding gain and complexity, and the first pending right boundary determined by the first position information of the current block in the video frame to be encoded, it is more in line with the requirements of the search area of the current block than the second pending right boundary determined according to the information of the target CTU. That is, when the block density in the video frame to be encoded is high, the current block tends to determine the corresponding reference block in a smaller search area (because a smaller search area contains more blocks), so the determination of the right boundary (i.e., A1) is performed with reference to the information of the current block, which is sufficient to meet the search requirements.
[0098] When the color complexity of the tiles in the video frame to be encoded is low, the method of determining the right boundary according to the information of the target CTU in A2 may be preferred. The reason is that when the color complexity in the video frame to be encoded is low, the granularity of the corresponding tile division is large, that is, fewer tiles will be accommodated in the unit search area in the video frame to be encoded. At this time, the second pending right boundary determined according to the information of the target CTU is more in line with the requirements of the search area of the current tile than the first pending right boundary determined according to the information of the current tile. That is, when the tile density in the video frame to be encoded is low, in order to ensure the quality of the searched reference tile, it is necessary to ensure that the number of searched tiles reaches a certain number, that is, at this time, the current tile tends to determine the corresponding reference tile in a larger search area, so the information of the target CTU is used as a reference to determine the right boundary (ie A2) to meet the search requirements of the current tile.
[0099] In a possible implementation, when the second pending right boundary is closer to the current block than the first pending right boundary, the second pending right boundary and the first pending right boundary are both located in the encoded CTU. At this time, if you want to improve the coding gain, you can consider appropriately expanding the search area compared to the second pending right boundary. The method of expanding the search area can be to calculate the average value of the first pending right boundary and the second pending right boundary, and use the average value as the right boundary of the search area of the current block 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, and different dimensions correspond to different considerations. For the two aforementioned methods of determining the pending right boundary, combined with 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] The aforementioned A1 mentioned that "according to the coding gain and complexity, and the first position information of the current block in the video frame to be encoded, the first pending right boundary of the search area in the video frame to be encoded is determined". 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 is obtained by extending a certain number of pixels to the right according to the rules of the encoding process. In one possible implementation method, the first pending right boundary is determined as follows: First, based on the coding gain and complexity, determine the degree coefficient to which the search area can be extended to the right. Then, based on the degree coefficient and the width of the current block, determine the first number of pixels to the right extending the search area relative to the first position information. Finally, based on the first number of pixels to the right extending, determine the first pending right boundary.
[0102] The degree coefficient is obtained after weighing the coding gain and complexity. The degree coefficient is used to determine the extent to which the search area can be extended to the right in determining the first pending right boundary. The specific degree coefficient can be set by technical personnel in this field according to actual conditions and application scenarios, and is not limited here. 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 rightward extension pixel number 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 upper left end point of the current block on the x-axis, and the block may generally be a square or a rectangle. The first rightward extension pixel number refers to the number of pixels extending to the right relative to the first position information of the current block.
[0104] Assuming 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, the first pending right boundary HorMax1 can be calculated by the following formula:
[0105] HorMax1=BlkX+a*BlkW
[0106] Wherein a is the degree coefficient. It can be seen from the above formula 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 A schematic diagram of determining a pending right boundary based on first position information provided in an embodiment of the present application, assuming a=5, the difference in encoding progress 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 block is (96, 96), the size of the current block is 32*32 pixels, that is, the length and width of the current block are both 32, and the first number of pixels extending to the right 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. Therefore, in addition to using the first pending right boundary to determine the right boundary of the search area of the current block in the embodiment of the present application, a second pending right boundary based on the encoding processing delay and the second position information of the target CTU in the video frame to be encoded is set to determine the search area 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, consider replacing it with the second pending right boundary.
[0109] Of course, in the embodiments of the present application, there are scenarios where the first pending right boundary is used 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 small, the first pending right boundary determined by the calculated first number of rightward extending pixels will be located in the encoded CTU.
[0110] Example 2:
[0111] Figure 7 Another schematic diagram of determining a pending right boundary based on the first position information provided for an embodiment of the present application. Assuming a=5, the difference in encoding progress 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 block is (80, 80), and the size of the current block is 16*16 pixels, that is, the length and width of the current block are both 16. At this time, the first number of pixels extending to the right 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 block.
[0112] It can be seen from the above two examples that when determining the first pending right boundary of the search area in the video frame to be encoded based on the coding gain and complexity, as well as the first position information of the current block in the video frame to be encoded, it is necessary to take into account the division 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 division granularity of the current block is larger; when the width of the current block is smaller, the corresponding division granularity of the current block is smaller. Referring to the above examples, it can be seen that the division granularity of the current block with a width of 16 is larger than that of the current block with a width of 32. Determining the first pending right boundary as the right boundary of the search area of the current block needs to be based on the premise that the division granularity of the current block is small.
[0113] That is, the division granularity of the current block will affect the trade-off between coding gain and complexity. The division granularity of the current block can be determined by the size of the current block. For example, assuming that the size of the current block is 4*4 pixels or 16*16 pixels, the division granularity of the current block of 4*4 pixels is smaller than the division granularity of the current block of 16*16 pixels.
[0114] The division granularity of the current tile will affect the determination of the first pending right boundary. As mentioned above, under the premise of adopting WPP for encoding, the determination of the first pending right boundary can be understood as the determination of the search area. If the division granularity of the current tile is small, the corresponding first pending right boundary can be determined at a position closer to the current tile. The reason is that when the division granularity of the current tile is small, it means that there are more tiles in the video frame to be encoded, and more tiles can be accommodated in a smaller search area. When the encoding requirements are certain, the search area is sufficient for the current tile to determine the reference tile, so there is no need to increase the number of searchable tiles by expanding the search area a lot.
[0115] If the current block is divided into a larger granularity, the corresponding first pending right boundary can be determined as a position relatively far from the current block. The reason is that when the current block is divided into a larger granularity, it means that the number of blocks in the video frame to be encoded is small, and the number of blocks that can be accommodated in a larger search area is not large. When the encoding requirements are certain, in order to ensure the encoding gain, it is necessary to consider increasing the number of searchable blocks by expanding the search area.
[0116] Through the above-mentioned method for determining the first pending right boundary, the first rightward extension pixel number 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 image block, and the first pending right boundary can be obtained according to the first rightward extension pixel number. That is to say, in the process of determining the first pending right boundary, the size of the current image block needs to be considered, and different current image block sizes will affect the feasibility of the first pending right boundary as the right boundary of the search area of the current image block.
[0117] The aforementioned A2 mentions "determining the second pending 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". The process of determining the second pending right boundary needs to be based on the second position information of the target CTU and extended to the right by a certain number of pixels according to the rules of the encoding process. In one possible implementation, the second pending right boundary is determined as follows: first, the encoding processing delay is determined, and the second number of pixels extending to the right of the search area relative to the second position information is determined. Then, based on the second number of pixels extended to the right, the second pending right boundary is determined.
[0118] The coding process delay refers to the difference in coding progress between adjacent rows of CTUs when parallel coding is performed under WPP. In the embodiment of the present application, the coding process delay can be 1 CTU or 2 CTUs. When the coding process delay is determined, the second rightward extension pixel number of the search area relative to the second position information can be determined based on the coding process delay and the second position information of the target CTU. The second rightward extension pixel number refers to the number of pixels extending 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 a CTU is ctu_width. At this time, the second pending 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 pending right boundary is related to the size, ie, the position, of the target CTU.
[0122] Example 3:
[0123] Figure 8A schematic diagram of determining a pending right boundary based on second position information is provided for an embodiment of the present application. It is assumed that the encoding 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 second number of pixels extending to the right is calculated according to the above formula: 64+2*64=192. As shown in the figure, the determined second pending right boundary is located in the encoded CTU, which satisfies the condition that the second pending right boundary is located in the encoded CTU, and can be used as the pending right boundary of the right boundary of the current block.
[0124] Example 4:
[0125] Fig. 9 A schematic diagram of another method of determining a pending right boundary based on the second position information is provided for an embodiment of the present application. It is assumed that the encoding 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 second number of pixels extending to the right is calculated according to the above formula: 64+1*64=128. As shown in the figure, the determined second pending right boundary is located in the encoded CTU, which satisfies the condition that the second pending right boundary is located in the encoded CTU, and can be used as the pending right boundary of the right boundary of the current block.
[0126] In the process of performing the second pending right boundary, it can be seen that the encoding processing delay, the position and size of the target CTU are sufficient, and there is no need to consider the size and position of the current block. The calculation process is relatively simple, and no matter whether the division granularity of the current block is large or small, it can be guaranteed that the determined second pending right boundary is located in the encoded CTU, and can be used as the pending right boundary of the right boundary of the search area of the current block.
[0127] Through the method for determining the second pending 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 pending right boundary can be obtained based on the second number of pixels extending to the right. In the method for determining the second pending right boundary, there is no need to consider the division granularity of the current block, and it can be ensured that the second pending right boundary is located in the encoded CTU. When determining the second pending right boundary, the determination method is simple and can avoid the situation where the search area determined based on the second pending right boundary contains a CTU that has not been completely encoded, thereby ensuring the accuracy of the encoding.
[0128] The aforementioned A3 mentions "determining the right boundary of the search area of the current block in the video frame to be encoded by using the first pending right boundary and the second pending right boundary". In the aforementioned introduction, the determination of the right boundary is generally introduced according to the different situations of the video frame to be encoded. At the same time, the method for determining the first pending right boundary and the second pending right boundary is introduced, wherein the first pending right boundary has scene limitations. In the process of actual application, the right boundary of the search area of the current block can be determined from the first pending right boundary and the second pending right boundary based on a quantifiable method. Therefore, in one possible implementation method, the method for determining the right boundary of the search area of the current block is: determining the right boundary of the search area of the current block in the video frame to be encoded according to the pending right boundary closest to the current block in the first pending right boundary and the second pending right boundary.
[0129] When determining the right boundary of the search area of the current tile, the first pending right boundary and the second pending right boundary can be determined in advance, and then the distance between the first pending right boundary and the second pending right boundary can be determined. The specific method for determining the first pending right boundary and the second pending right boundary has been introduced in detail above and will not be repeated here. According to the determined distance, the first pending right boundary and the second pending right boundary with the closest distance to the current tile are 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 the to-be-encoded video frame 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 above-mentioned Example 1 and Example 3 as examples, assuming that 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 block is (96, 96), the size of the current block is 32*32 pixels, that is, the length and width of the current block are both 32. At this time, the first number of pixels extending to the right calculated is: 96+5*32=256, and the second number of pixels extending to the right is: 64+2*64=192. Fig.10A schematic diagram of determining a right boundary provided for an embodiment of the present application, as shown in the figure, the first pending right boundary determined is located in a CTU that has not been completely encoded, and the second pending right boundary determined is located in an encoded CTU, satisfying the condition that the second pending right boundary is located in the encoded CTU. At this time, the second pending right boundary needs to be closest to the current block compared to the first pending right boundary, and only the second pending right boundary satisfies the condition of being located in the encoded CTU, so the second pending 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] From the above example, it can be seen that when the division granularity of the current block is large, the corresponding first pending right boundary may be located in a CTU that has not been fully encoded. And when the second pending right boundary is used as the right boundary of the search area, it means that the second pending right boundary is closer to the current block than the first pending right boundary. The first pending right boundary is determined based on coding gain and complexity. The selection of the second pending right boundary as the right boundary of the search area indicates that compared with the first pending right boundary, it is necessary to reduce the complexity of the search process and improve the search efficiency by sacrificing coding gain.
[0133] Taking the above-mentioned Example 2 and Example 3 as examples, assuming that a=5, the difference in encoding progress 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), the size of the current block is 16*16 pixels, that is, the length and width of the current block are both 16. At this time, the first number of pixels extended to the right is: 80+5*16=160, and the second number of pixels extended to the right is: 64+2*64=192. Fig.11 Another schematic diagram for determining the right boundary is provided for an embodiment of the present application. As shown in the figure, the first pending right boundary determined is located in the CTU that has been encoded, and the second pending right boundary determined is located in the encoded CTU, that is, the first pending right boundary and the second pending right boundary both meet the condition of being located in the encoded CTU. At this time, the right boundary of the search area of the current block can be determined based on the distance between the first pending right boundary and the second pending right boundary and the current block. It can be seen that the distance between the first pending right boundary and the current block is less than the distance between the second pending right boundary and the current block, so the first pending 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 pending right boundary is determined based on coding gain and complexity. When the first pending right boundary is used as the right boundary of the search area, it means that the first pending right boundary is closer to the current block than the second pending right boundary. At this time, selecting the first pending right boundary can balance coding gain and complexity at the same time. Compared with the second pending right boundary, it can avoid the increase in search process complexity caused by the expansion of the search area, thereby improving search efficiency. Generally speaking, expanding the search area can increase coding gain, but also lead to increased 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 encoding 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 the degree coefficient. The formula also includes the determination method of the first number of pixels extending to the right and the second number of pixels extending to the right (i.e., the determination method of the first pending right boundary and the second pending right boundary). When determining the right boundary of the search area of the current block, the pending right boundary closest to the current block in the first pending right boundary and the second pending right boundary is used as the right boundary of the search area.
[0138] In combination with the different situations of the video frames to be encoded mentioned above, when the first pending right boundary is determined as the right boundary of the search area of the current block, the corresponding block color complexity of the video frame to be encoded is higher, that is, the division granularity of the current block is smaller; when the second pending right boundary is determined as the right boundary of the search area of the current block, the block color complexity in the video frame to be encoded is lower, that is, the division granularity of the current block is smaller.
[0139] Through the above-mentioned method for determining the right boundary of the search area of the current block, the first to-be-determined right boundary and the second to-be-determined right boundary that is closest to the current block 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 applied to the actual conditions of two different video frames to be encoded, and the right boundary of the better search area is determined according to the adaptive selection of the division granularity of the current block.
[0140] The aforementioned "determine the right boundary of the search area of the current tile in the video frame to be encoded". When the second pending right boundary is the pending right boundary closest to the current tile, the color complexity of the corresponding tile in the video frame to be encoded is low, that is, the division granularity of the current tile is small. At this time, the coding accuracy requirement is not too high. If there is a need to further speed up the coding speed, you can consider further narrowing the search area. Therefore, in one possible implementation method, the method for determining the right boundary based on the second pending right boundary is: move the second pending 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 why the second pending right boundary is moved to the left is that the encoding process in the embodiment of the present application follows the method of encoding row by row from top to bottom and encoding CTU by CTU from left to right. When the second pending right boundary is moved to the left, it means that the search area of the current tile is reduced, and when the second pending right boundary is moved to the right, it means that the search area of the current tile is expanded.
[0142] In an embodiment of the present application, the second pending right boundary is moved by a fixed pixel length to determine the right boundary of the search area of the current block in the video frame to be encoded. In fact, in addition to moving the fixed pixel length, the second pending right boundary can also be moved by: moving a random pixel length, calculating the pixel length during the movement, and moving different pixel lengths based on the situation of different blocks.
[0143] The reason for choosing the method of moving the second pending right boundary by a fixed pixel length is that the method of moving the random pixel length is used to determine the right boundary of the search area of the current block in the video frame to be encoded. When the video frame to be encoded is encoded to obtain the encoded video frame, when the encoded video frame is decoded, since the right boundary of the current block in the encoding process is randomly determined, when the encoded current block is decoded, the right boundary cannot be accurately determined, which will lead to inconsistency in the reference blocks determined for the same block during the encoding and decoding processes, affecting the efficiency of encoding and decoding.
[0144] However, by calculating the pixel length during the movement and moving different pixel lengths based on the conditions of different blocks, although the right boundary can be determined, a large number of pixel lengths generated during the movement need to be additionally stored in the encoded video frame, which increases the amount of data in the encoded video frame, which is contrary to the original intention of encoding the video frame to be encoded.
[0145] In summary, it can be seen that the method of moving random pixel lengths, calculating pixel lengths during the movement, and moving different pixel lengths based on the situation of different blocks cannot well meet the requirements of improving coding efficiency while reducing the amount of transmitted data. When a fixed pixel length is used as the right boundary of the search area of the current block in the video frame to be encoded, since the pixel length of the movement is fixed, when decoding the encoded current block, the right boundary can be accurately determined based on the fixed pixel length, so there will be no inconsistency in the reference blocks determined during the encoding and decoding process for the same block. At the same time, since the search area for the current block is reduced, the search efficiency for the reference block can be improved, thereby improving the encoding efficiency of the video frame to be encoded.
[0146] Through the method for determining the right boundary provided above, under the premise that the color complexity of the blocks in the video frame to be encoded is low, the right boundary of the search area of the current block is re-determined by moving the second right boundary to the left by a fixed pixel length. This can reduce the search area of the current block and improve the encoding efficiency. At the same time, when the encoded video frame to be encoded (i.e., the encoded video frame) is decoded, it can be accurately decoded according to the fixed pixel length, thereby ensuring the accuracy of encoding and decoding to a certain extent.
[0147] The aforementioned S203 mentions "searching for the current block in the search area to determine the reference block in the search area". When searching for the reference block of the current block in the search area based on the current block, since the current block is an uncoded block and the reference block is a coded block, the reference block corresponding to the current block determined at this time will be inaccurate. Therefore, in order to solve this problem, when searching for the reference block of the current block, it can be considered to use the coded part adjacent to the current block to replace the current block to search for the reference block. Therefore, in a possible implementation method, the method of determining the reference block is:
[0148] B1: Determine a first encoded template representing the current image block in an encoded area adjacent to the current image block.
[0149] The first encoded template is an area adjacent to the current block and has been encoded. Since the first encoded template is located in close proximity to the current block, in the video frame to be encoded, according to the pixel distribution law of the image, the pixel difference between adjacent blocks is generally small. Therefore, the adjacent block can replace the original block to search for the reference block, that is, the first encoded template can replace the current block to search for the reference block. At the same time, since the first encoded template and the reference block have been encoded consistently, and the first encoded template and the current block have a high consistency, using the first encoded template to replace the current block to search for the reference block can have a better effect.
[0150] In addition, the relative position relationship between the current tile and the first encoded template is a preset relationship. The preset relationship here has a certain relationship with the way of encoding the video frame to be encoded. When the encoding method is encoding line by line from top to bottom and encoding CTU by CTU from left to right, it means that when encoding the current tile, the left and upper parts of the current tile have been encoded, and the first encoded template needs to be adjacent to the current tile and complete the encoding, so the relative position relationship between the first encoded template and the current tile is: the first encoded template is located above and on the left side of the current tile.
[0151] Fig.12 A schematic diagram of determining a reference block provided in an embodiment of the present application, see Fig.12 As shown in the figure, the four regions R1, R2, R3 and R4 are included, and these four regions are all coded CTUs. When searching for reference blocks, the above four regions 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 located in the current CTU, R2 is located in the upper left of the current CTU, R3 is located in the upper right of the current CTU, and R4 is located on the left side of the current CTU. The first coded template is an L-shaped template.
[0152] B2: 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;
[0153] The search is performed in the search area according to the determined first encoded template, and the search process is the process of pixel similarity matching. Pixel similarity refers to the degree of similarity between pixels of blocks, and the similarity condition refers to the condition for identifying two blocks as similar blocks. For example, the similarity condition can be set to 90%, which means that when there is a block in the search area that meets 90% of the pixel similarity with the first encoded template, it can be determined as the second encoded template.
[0154] B3: Determine the reference image block according to the preset relationship and the second encoded template.
[0155] According to the preset relationship mentioned above, that is, the relative position relationship between the current image block and the first encoded template, and the second encoded template whose pixel similarity with the first encoded template meets the similarity condition, the corresponding reference image block can be determined. That is, the relative position relationship between the reference image block and the second encoded template is consistent with the relative position relationship between the current image block and the first encoded template.
[0156] In a possible implementation, the determination of the reference block can be achieved by using intra template matching prediction (Intra Template Matching Prediction, Intra TMP). This method obtains the reference block of the current block by searching for a second encoded template that matches the first encoded template in a predefined search area, and can use the block in the search area that has been reconstructed (encoded) as a reference block to encode the current block. This reduces spatial redundancy and improves encoding quality. In this method, the first encoded template performs pixel similarity matching in the search area, and determines a second encoded template whose pixel similarity meets a similarity condition from the search area, wherein the similarity condition refers to the minimum sum of absolute differences (SAD) between the first encoded template and the second encoded template.
[0157] By using the method for determining a reference block provided above, the first encoded template adjacent to the current block is used as a substitute for the unencoded current block to search for the reference block. This can avoid the problem of a large difference between the determined reference block and the actual encoded current block when determining and matching pixel similarity with the encoded reference block due to the current block not being encoded, thereby improving the encoding accuracy of the video frame to be encoded.
[0158] The aforementioned encoding processing delay is the difference in encoding progress between adjacent rows in parallel encoding processing using WPP. In order to ensure the accuracy of determining the reference block within the search area of the current block, the encoding processing delay needs to be at least the sum of the side lengths of a CTU.
[0159] The reason is that, in the application scenario provided by the embodiment of the present application, it is premised on the use of WPP to perform parallel encoding processing on multiple rows of CTUs in the video frame to be encoded. Under the processing mode of WPP, it is required that there is a certain encoding processing delay between adjacent rows, that is, the number of encoded CTUs in the i-1th row of CTU is greater than that in the i-th row of CTU, where the i-1th row of CTU is located above the i-th row of CTU. Generally speaking, the current row is delayed by one or more CTUs compared to the previous row. The more delayed CTUs, the more available information is during encoding (or decoding), and the higher the compression rate will be.
[0160] The reason for requiring coding delay is to ensure the correctness and efficiency of coding, because only when there is a difference in the coding progress between adjacent rows, can the coded content in the previous row of CTU be accessed when the current row of CTU is coded. Compared with the synchronous coding of multiple rows of CTU, the parallel coding method with coding delay can make full use of the spatial correlation of the tiles in the video frame to be coded, and determine the search area of the coded CTU for intra-frame prediction of the current tile.
[0161] Specifically, when the encoding processing delay is the sum of the side lengths of at least one CTU, when encoding the current tile, the CTUs to the upper left, left, and directly above the current tile have been encoded, and the upper right CTU has not yet been encoded (that is, there are both tiles that have been encoded and tiles that have not been encoded). When searching for reference tiles for the current tile, the reference tiles can be searched based on the upper left, left, directly above, and upper right tiles that have been encoded as search areas. The search area covers a large range, which can ensure the quality of the reference tiles searched and improve the efficiency of encoding.
[0162] By using the method for determining the encoding processing delay provided above, the encoding processing delay is determined as the sum of the side lengths of at least one CTU, so that when encoding the current image block, the corresponding range that can be used as the search area is larger, and more optional ranges can be provided for searching the reference image block. Since the optional range is increased, the quality of the reference image block searched for the current image block can be guaranteed to a certain extent. When the quality of the reference image block is guaranteed, the accuracy of encoding the current image block is also guaranteed, thereby improving the encoding accuracy of the video to be encoded.
[0163] Fig.13 A flowchart of a video encoding method provided in an embodiment of the present application, the method can be executed by a computer device. In this embodiment, the computer device is taken as a server for example.
[0164] S1301: Determine a current tile to be decoded from an encoded video frame.
[0165] The encoded video frame refers to the video frame obtained after encoding the aforementioned video frame to be encoded. The encoded video frame needs to be decoded at the receiving end of the encoded video frame 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 the 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 consistent with the encoding process of the video frame to be encoded (both use WPP and intra-frame prediction, and the process is performed row by row from top to bottom and from left to right in sequence). The only difference is that the decoding object for decoding the encoded video frame is the current tile to be decoded, while the encoding object for 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 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. The difference in decoding progress of adjacent rows in parallel decoding is the decoding processing delay, 1 <K≤N。
[0168] S1302: Determine, according to the decoding process delay, a right boundary of the search area of the current tile in the decoded video frame.
[0169] The decoding process delay refers to the difference in the decoding progress of CTUs between adjacent rows during the parallel decoding process. The difference can be measured by CTU or by the number of pixels. The search area of the current tile refers to the area in the encoded video frame involved in the search for reference tiles for the current tile. The right border refers to the rightmost border in the search area of the encoded video frame, that is, the rightmost part that can be reached in the range covered by the search area of the current tile.
[0170] In the process of decoding the encoded video frame, the determined right boundary is in the decoded CTU of the i-1th row CTU, and the i-1th row CTU in the encoded video frame is located above the i-th row CTU. The specific reason why the right boundary of the search area is determined in the decoded CTU is consistent with the process of video encoding, and can be referred to the description in the aforementioned S201 to S204, which will not be repeated here.
[0171] S1303: Search the current image block in the search area to determine a reference image block in the search area.
[0172] The reference block is an encoded block whose pixel similarity with the current block meets the similarity condition. For a detailed introduction of the reference block, please refer to the content in the aforementioned S203, except that when decoding the current block to be decoded, the search area where the corresponding reference block is located includes the decoded block, and the reference block is the decoded block.
[0173] S1304: Use the reference image block to decode the current image block, and use the next image block to be decoded as the current image block, until the decoding of the encoded video frame is completed to obtain a decoded video frame.
[0174] When a reference block corresponding to the current block is determined in the search area, the reference block is used to decode the current block. The decoding process can be based on the correspondence between the current block and the reference block, and the difference between the current block and the reference block. After the decoding of the current block is completed, the next block in the encoded video frame is used as the current block to continue the search area determination, reference block search and decoding processes until all blocks in the encoded video frame are decoded to obtain a decoded video frame.
[0175] It can be seen from the above technical solution that in the process of intra-frame decoding of the 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 tile to be decoded is located is in the i-th row of CTU, and the i-th row of CTU is a row in the K rows of CTUs processed in parallel. When intra-frame decoding is performed on the current tile, the search area of the current tile will cover part of the area in the i-1th row of CTU, and extend a certain length to the right of the i-1th row of CTU relative to the current tile. 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-1th row of CTU is faster than that of the i-th row of CTU, and the difference between the two is the decoding processing delay, but in some cases, the search area of the current tile will extend to the area where the decoding result is uncertain in the i-1th row of CTU. If the reference tile matched from the search area is in the uncertain area, it is likely to cause an erroneous decoding result, affecting the quality of the decoded video frame. To this end, when determining the right boundary of the search area, the right boundary is determined in the decoded CTU of the i-1th row of CTU based on the decoding processing delay to ensure that the search area covers all decoded areas, avoiding the situation where different reference blocks are used when encoding and decoding the current block, and effectively improving the decoding quality of the encoded video frame.
[0176] In the aforementioned S1302, it is mentioned that "according to the decoding processing delay, the right boundary of the search area of the current block in the decoded video frame is determined". In the process of determining the right boundary, different bases can be considered, and the bases may include the following two bases: one is decoding gain and complexity, and the other is decoding processing delay. Based on the above two considerations, two different methods of determining the right boundary can be determined, and one can be selected according to the actual situation in practical applications. Therefore, in a possible implementation method, the method of determining the right boundary can be:
[0177] C1: determining a first pending right boundary of the search area in the encoded video frame according to decoding gain and complexity and first position information of the current block in the encoded video frame.
[0178] Decoding gain refers to the decompression ratio or video quality improvement achieved by decoding the current block in the encoded video frame. In the embodiment of the present application, the decompression ratio or video quality improvement can be equivalent to the reference block searched for the current block having a higher quality (i.e., a higher pixel similarity with the current block). In practical applications, decoding gain can be evaluated by indicators such as the size of the video file before and after decoding and the video clarity.
[0179] Complexity refers to the computational resources and time required to decode the current block in the encoded video frame. When the search area is large, the corresponding complexity is greater, and the corresponding decoding requires more computational resources and time; when the search area is small, the corresponding complexity is smaller, and the corresponding decoding requires less computational resources and time. Generally speaking, when the complexity is low, the corresponding decoding efficiency is higher.
[0180] The method for determining the first pending right boundary in C1 can be referred to the description in the aforementioned A1, with the difference being that A1 weighs the coding gain and complexity and determines it in combination with the first position information in the video frame to be encoded, while C1 weighs the decoding gain and complexity and determines it in combination with the first position information in the encoded video frame.
[0181] C2: 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.
[0182] The decoding process delay refers to the difference in decoding progress between adjacent rows in a decoding process based on WPP. In the process of determining the second pending right boundary, the second position information of the target CTU in the encoded video frame and the decoding process delay are considered.
[0183] C3: Determine the right boundary of the search area of the current block in the encoded video frame through the first pending right boundary and the second pending right boundary.
[0184] When determining the right boundary of the search area of the current tile in the encoded video frame, the first to-be-determined right boundary and the second to-be-determined right boundary may be selected according to actual conditions, while also considering decoding gain and complexity.
[0185] For the specific introduction of C1~C3, please refer to the description of A1~A3 mentioned above. The only difference between C1~C3 and A1~A3 is that C1~C3 is the process of determining the right boundary when decoding the encoded video frame, and C1~C3 is the process of determining the right boundary when encoding the video frame to be encoded.
[0186] Through the method for determining the right boundary provided above, two different dimensions for determining the pending right boundary are provided, and different dimensions correspond to different considerations. For the two aforementioned methods of determining the pending right boundary, combined with the comprehensive consideration of specific application scenarios, decoding 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.
[0187] The aforementioned C1 mentioned that "according to the decoding gain and complexity, and the first position information of the current block in the encoded video frame, the first pending right boundary of the search area in the encoded video frame is determined". The first pending right boundary is determined as follows: First, according to the decoding gain and complexity, the degree coefficient of the search area that can be extended to the right is determined. Then, based on the degree coefficient and the width of the current block, the first rightward extension pixel number of the search area relative to the first position information is determined. Finally, according to the first rightward extension pixel number, the first pending right boundary is determined.
[0188] The degree coefficient is obtained after weighing the decoding gain and complexity. The degree coefficient is used to determine the extent to which the search area can be extended to the right in determining the first pending right boundary. The specific degree coefficient can be set by technical personnel in this field according to actual conditions and application scenarios, and is not limited here.
[0189] The specific method for determining the first pending right boundary is generally consistent with the method for determining the first pending right boundary mentioned in the aforementioned video encoding method. The difference lies in that the current block in the method for determining the first pending right boundary mentioned in the aforementioned video encoding method is a block to be encoded, while the current block in the current method for determining the first pending right boundary is a block to be decoded.
[0190] Through the above-mentioned method for determining the first pending right boundary, the first rightward extension pixel number 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 image block, and the first pending right boundary can be obtained according to the first rightward extension pixel number. That is to say, in the process of determining the first pending right boundary, the size of the current image block needs to be considered, and different current image block sizes will affect the feasibility of the first pending right boundary as the right boundary of the search area of the current image block.
[0191] In the aforementioned C2, it is mentioned that "according to the decoding processing delay and the second position information of the target CTU in the encoded video frame, the second pending right boundary of the search area in the encoded video frame is determined". In a possible implementation, the second pending right boundary is determined as follows: first, the encoding processing delay is determined, and the second rightward extension pixel number of the search area relative to the second position information is determined. Then, according to the second rightward extension pixel number, the second pending right boundary is determined.
[0192] The decoding processing delay refers to the difference in decoding progress of adjacent row CTUs when parallel decoding processing is performed under WPP. In the embodiment of the present application, the decoding processing delay is consistent with the aforementioned encoding processing delay and can be 1 CTU or 2 CTUs. When the decoding processing delay is determined, the second rightward extending pixel number of the search area relative to the second position information can be determined based on the decoding processing delay and the second position information of the target CTU. The second rightward extending pixel number refers to the number of pixels extending to the right relative to the second position information of the target CTU.
[0193] The specific method for determining the second pending right boundary is generally consistent with the method for determining the second pending right boundary mentioned in the aforementioned video encoding method. The implementation method can refer to the previous description. The difference is that the target CTU in the method for determining the second pending right boundary mentioned in the aforementioned video encoding method includes the current picture block to be encoded, while the target CTU in the current method for determining the second pending right boundary includes the current picture block to be decoded.
[0194] Through the method for determining the second pending 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 pending right boundary can be obtained based on the second number of pixels extending to the right. In the method for determining the second pending right boundary, there is no need to consider the division granularity of the current block, and it can be ensured that the second pending right boundary is located in the encoded CTU. When determining the second pending right boundary, the determination method is simple and can avoid the situation where the search area determined based on the second pending right boundary contains a CTU that has not been completely encoded, thereby ensuring the accuracy of the encoding.
[0195] The aforementioned C3 mentions "determining the right boundary of the search area of the current block in the encoded video frame through the first pending right boundary and the second pending right boundary". In a possible implementation method, the method for determining the right boundary of the search area of the current block is: determining the right boundary of the search area of the current block in the encoded video frame according to the pending right boundary closest to the current block between the first pending right boundary and the second pending right boundary.
[0196] For the specific process of determining the right boundary of the search area of the current tile, please refer to the method for determining the right boundary of the search area of the current tile mentioned in the aforementioned process of encoding the video frame to be encoded. The difference between the two is that the determination of the first pending right boundary in the encoding process is based on the coding gain and complexity, as well as the first position information of the current tile in the video frame to be encoded, and the determination of the second pending right boundary is based on the coding processing delay and the second position information of the target CTU in the video frame to be encoded. The determination of the first pending right boundary in the decoding process is based on the decoding gain and complexity, as well as the first position information of the current tile in the encoded video frame, and the determination of the second pending 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-mentioned method for determining the right boundary of the search area of the current image block, the first to-be-determined right boundary and the second to-be-determined right boundary that is closest to the current image block is used as the right boundary of the search area of the current image block. According to the quantifiable determination method of the closest distance, it can be applied to the actual situation of two different encoded video frames, and the right boundary of the better search area is determined according to the adaptive selection of the division granularity of the current image block.
[0198] The aforementioned "determine the right boundary of the search area of the current tile in the encoded video frame". When the second pending right boundary is the pending right boundary closest to the current tile, the color complexity of the corresponding tile in the encoded video frame is low, that is, the division granularity of the current tile is small. At this time, the accuracy requirement for decoding is not too high. If there is a need to further speed up the decoding speed, you can consider further narrowing the search area. Therefore, in one possible implementation method, the method for determining the right boundary based on the second pending right boundary is: move the second pending 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 encoded video frame.
[0199] For the specific process of determining the right boundary based on the second pending right boundary, please refer to the introduction of the method for determining the right boundary based on the second pending right boundary in the aforementioned video encoding process. The difference between the two is that in the video encoding process, the second pending right boundary is determined based on the encoding processing delay and the second position information of the target CTU (including the tile to be encoded). In the current video decoding process, the second pending right boundary is determined 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, under the premise that the color complexity of the blocks in the encoded video frame is low, the right boundary of the search area of the current block is re-determined based on the second pending right boundary being moved to the left by a fixed pixel length consistent with the encoding process, which can reduce the search area of the current block, improve decoding efficiency and ensure decoding accuracy.
[0201] The aforementioned S1303 mentions "searching for the current block in the search area to determine the reference block in the search area". When searching for the reference block of the current block in the search area based on the current block, since the current block is an undecoded block and the reference block is an encoded block, the reference block corresponding to the current block determined at this time will be inaccurate. Therefore, in order to solve this problem, when searching for the reference block of the current block, it can be considered to use the decoded part adjacent to the current block instead of the current block to search for the reference block.
[0202] Therefore, in a possible implementation, the reference block is determined as follows:
[0203] D1: Determine a first decoded template representing the current image block in a decoded area adjacent to the current image block.
[0204] The first decoded template is an area adjacent to the current block and has been decoded. Since the first decoded template is adjacent to the current block, in the encoded video frame, according to the pixel distribution law of the image, the pixel difference between adjacent blocks is generally small. Therefore, the adjacent block can replace the original block to search for the reference block, that is, the first decoded template can replace the current block to search for the reference block. The relative position relationship between the current block and the first decoded template is a preset relationship. Since the decoding process is consistent with the encoding process, both use WPP from top to bottom row by row, and from left to right in sequence, so the relative position relationship between the first decoded template and the current block is: the first decoded template is located above and on the left side of the current block.
[0205] D2: 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.
[0206] D3: Determine the reference image block according to the preset relationship and the second decoded template.
[0207] The specific implementation process of D2~D3 can refer to the introduction in the aforementioned B2~B3. The difference between the two is that B2~B3 is for determining the reference block based on the second encoded template, while D2~D3 is for determining the reference block based on the second decoded template.
[0208] By using the method for determining a reference block provided above, the first decoded template adjacent to the current block is used as a substitute for the undecoded current block to search for the reference block. This can avoid the problem of a large difference between the determined reference block and the actual decoded current block when determining and matching pixel similarity with the decoded reference block due to the current block not being decoded, thereby improving the accuracy of decoding of the encoded video frame.
[0209] The aforementioned decoding processing delay is the difference in decoding progress of adjacent rows in parallel decoding processing using WPP. In order to ensure the accuracy of determining the reference block within the search area of the current block, the decoding processing delay needs to be at least the sum of the side lengths of a CTU.
[0210] The specific process of determining the decoding processing delay can refer to the aforementioned method for determining the encoding processing delay, which will not be repeated here.
[0211] By using the method for determining the decoding processing delay provided above, the decoding processing delay is determined as the sum of the side lengths of at least one CTU, so that when decoding the current image block, the corresponding range that can be used as the search area is larger, and more optional ranges can be provided for searching the reference image block. Since the optional range is increased, the quality of the reference image block searched for the current image block can be guaranteed to a certain extent. When the quality of the reference image block is guaranteed, the accuracy of decoding the current image block is also guaranteed, thereby improving the decoding accuracy of the encoded video.
[0212] In the aforementioned Figure 1-13 Based on the corresponding embodiments, Fig.14 A schematic diagram of a video encoding device provided in an embodiment of the present application, wherein the video encoding device 1400 includes: a first determining module 1401, a second determining module 1402, a third determining module 1403 and an encoding module 1404;
[0213] The first determination module 1401 is used to determine a current block to be encoded 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, the encoding progress difference between adjacent rows in the parallel encoding processing is the encoding processing delay, 1 <K≤N;
[0214] The second determination module 1402 is used to determine, according to the encoding process delay, 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;
[0215] The third determination module 1403 is configured to search the current image block in the search area to determine a reference image block in the search area, where the reference image block is an encoded image block whose pixel similarity with the current image block meets a similarity condition;
[0216] The encoding module 1404 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.
[0217] In a possible implementation, the second determining module 1402 is used to:
[0218] Determine a first pending right boundary of the search area in the video frame to be encoded according to the coding gain and complexity and the first position information of the current picture block in the video frame to be encoded;
[0219] 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;
[0220] The right boundary of the search area of the current block in the to-be-determined video frame is determined by using the first to-be-determined right boundary and the second to-be-determined right boundary.
[0221] In a possible implementation, the second determining module 1402 is used to:
[0222] 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.
[0223] In a possible implementation, the second determining module 1402 is used to:
[0224] 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;
[0225] 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;
[0226] The first pending right boundary is determined according to the first rightward extending pixel number.
[0227] In a possible implementation, the second determining module 1402 is used to:
[0228] determining the encoding processing delay, and determining a second rightward extending pixel number of the search area relative to the second position information;
[0229] The second undetermined right boundary is determined according to the second rightward extending pixel number.
[0230] In a possible implementation, when the second undetermined right boundary is the undetermined right boundary closest to the current tile, the second determining module 1402 is configured to:
[0231] 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.
[0232] In a possible implementation, the third determining module 1403 is used to:
[0233] 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;
[0234] 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;
[0235] The reference image block is determined according to the preset relationship and the second encoded template.
[0236] In a possible implementation manner, the encoding processing delay is the sum of the side lengths of at least one CTU.
[0237] It can be seen from the video encoding device provided above that in the process of intra-frame encoding of the video frame to be encoded by 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 CTU, and the i-th row CTU is a row in the K rows of CTUs processed in parallel. When the current block is intra-frame encoded, the search area of the current block will cover part of the area in the i-1th row CTU, and extend a certain length to the right of the i-1th row CTU relative to the current block. 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-1th row CTU is faster than that of the i-th row CTU, and the difference between the two is the encoding processing delay, but in some cases, the search area of the current block will extend to the area in the i-1th row CTU where the encoding result is uncertain. If the reference block matched from the search area is in the uncertain area, it is likely that the reference block based on decoding is inconsistent with that based on encoding, and an erroneous result is decoded, affecting the quality of the video frame to be encoded. To this end, when determining the right boundary of the search area, the right boundary is determined in the encoded CTU of the i-1th row of CTU based on the encoding processing delay to ensure that the search area covers all encoded areas, avoiding the situation where different reference blocks are used when encoding and decoding the current block, and effectively improving the encoding quality of the video frame to be encoded.
[0238] Fig.15 A schematic diagram of a video decoding device provided by an embodiment of the present application, wherein 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 used to determine a current tile to be decoded 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;
[0240] The second determination module 1502 is used to determine, according to the decoding process delay, a right boundary of the search area of the current tile in the decoded 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;
[0241] The third determination module 1503 is configured to search the current image block in the search area to determine a reference image block in the search area, where the reference image block is an encoded image block whose pixel similarity with the current image block meets a similarity condition;
[0242] The decoding module 1504 is used to decode the current image block using the reference image block, and use the next image block to be decoded as the current image block, until the decoding of the encoded video frame is completed to obtain a decoded video frame.
[0243] In a possible implementation, the second determining module 1502 is used 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 picture block 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 process delay and second position information of the target CTU in the encoded video frame;
[0246] The right boundary of the search area of the current block in the encoded video frame is determined by using the first pending right boundary and the second pending right boundary.
[0247] In a possible implementation, the second determining module 1502 is used to:
[0248] 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.
[0249] In a possible implementation, the second determining module 1502 is used to:
[0250] 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;
[0251] 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;
[0252] 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.
[0253] In a possible implementation, the second determining module 1502 is used to:
[0254] determining the decoding process delay, and determining a second rightward extending pixel value of the search area relative to the second position information;
[0255] The second to-be-determined right boundary is determined according to the second right-extended pixel value and second position information of the target CTU in the encoded video frame.
[0256] In a possible implementation, when the second undetermined right boundary is the undetermined right boundary closest to the current tile, the second determining module 1502 is configured to:
[0257] 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.
[0258] In a possible implementation, the third determining module 1503 is used to:
[0259] 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;
[0260] 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;
[0261] The reference image block is determined according to the preset relationship and the second decoded template.
[0262] In a possible implementation manner, the decoding process delay is the sum of the side lengths of at least one CTU.
[0263] It can be seen from the video decoding device provided above that in the process of intra-frame decoding of the 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 CTU, and the i-th row CTU is a row in the K rows of CTUs processed in parallel. When intra-frame decoding is performed on the current block, the search area of the current block will cover part of the area in the i-1th row CTU, and extend a certain length to the right of the i-1th row CTU relative to the current block. 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-1th row CTU is faster than that of the i-th row CTU, and the difference between the two is the decoding processing delay, but in some cases, the search area of the current block will extend to the area where the decoding result is uncertain in the i-1th row CTU. If the reference block matched from the search area is in the uncertain area, it is likely to cause an erroneous decoding result, affecting the quality of the decoded video frame. To this end, when determining the right boundary of the search area, the right boundary is determined in the decoded CTU of the i-1th row of CTU based on the decoding processing delay to ensure that the search area covers all decoded areas, avoiding the situation where different reference blocks are used when encoding and decoding the current block, and effectively improving the decoding quality of the encoded video frame.
[0264] The embodiment of the present application further provides a computer device, including a terminal device or a server, in which the aforementioned video encoding device and video decoding device can be configured. The computer device is introduced below in conjunction with the accompanying drawings.
[0265] If the computer device is a terminal device, see Fig.16 As shown, the embodiment of the present application provides a terminal device, taking the terminal device as a mobile phone as an example:
[0266] Fig.16 The block diagram shows a partial structure of a mobile phone provided in an embodiment of the present application. Fig.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. Those skilled in the art can understand that Fig.16 The mobile phone structure shown in the figure 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 arrange the components differently.
[0267] Combine the following Fig.16 A detailed introduction to the various components of the mobile phone:
[0268] The RF circuit 1410 may be used for receiving and sending signals during information transmission or communication or during a call. In particular, after receiving downlink information from a base station, the information is sent to the processor 1480 for processing. In addition, the uplink data is sent 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 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1420 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0270] The input unit 1430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile phone. Specifically, the input unit 1430 may include a touch panel 1431 and other input devices 1432 .
[0271] The display unit 1440 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1440 may include a display panel 1441.
[0272] The mobile phone may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors.
[0273] The audio circuit 1460 , the speaker 1461 , and the microphone 1462 can provide an audio interface between the user and the mobile phone.
[0274] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 1470. It provides users with wireless broadband Internet access.
[0275] Processor 1480 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in memory 1420 and calling data stored in memory 1420.
[0276] The mobile phone also includes a power source 1490 (such as a battery) for supplying power to various components.
[0277] In this embodiment, the processor 1480 included in the terminal device is also used to execute the steps in the methods of each embodiment of the present application.
[0278] If the computer device is a server, the present application embodiment also provides a server, see Fig.17 As shown, Fig.17 The structural diagram of the server 1500 provided in the embodiment of the present application, the server 1500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1522 (for example, one or more processors) and a memory 1532, and one or more storage media 1530 (for example, one or more mass storage devices) storing application programs 1542 or data 1544. Among them, the memory 1532 and the storage medium 1530 can be short-term storage or permanent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1522 can be configured to communicate with the storage medium 1530 and execute a series of instruction operations in the storage medium 1530 on the server 1500.
[0279] The server 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558, and / or one or more operating systems 1541, such as Windows Server 2003 or Windows Server 2008. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0280] The steps performed by the server in the above embodiment can be based on Fig.17 The server structure shown.
[0281] In addition, an embodiment of the present application further provides a storage medium, wherein the storage medium is used to store a computer program, and the computer program is used to execute the method provided in the above embodiment.
[0282] The embodiments of the present application also provide a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method provided in the above embodiments.
[0283] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store computer programs.
[0284] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a 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 part of an overall module or unit that includes the function of the module or unit.
[0285] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on 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 refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0286] The above is only a specific implementation 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 a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Moreover, based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on 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, according to the encoding process delay, 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 step of determining, according to the encoding processing delay, a right boundary of the search area of the current picture block in the to-be-encoded video frame comprises: Determine a first pending right boundary of the search area in the video frame to be encoded according to the coding gain and complexity and the first position information of the current picture 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; The right boundary of the search area of the current block in the to-be-determined video frame is determined by using the first to-be-determined right boundary and the second to-be-determined right boundary.
3. The method according to claim 2, 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.
4. The method according to claim 2, characterized in that: The determining, according to the coding gain and complexity, and the first position information of the current block in the video frame to be encoded, a first pending right boundary of the search area 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.
5. The method according to claim 2, 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 processing delay, and determining a second rightward extending 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.
6. The method according to claim 3, 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.
7. The method according to any one of claims 1 to 6, 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.
8. The method according to any one of claims 1 to 6, characterized in that: The encoding process delay is the sum of the side lengths of at least one CTU.
9. 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 process delay, a right boundary of the search area of the current tile in the decoded 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.
10. The method according to claim 9, characterized in that The step of determining, according to the decoding process delay, a right boundary of the search area of the current picture block in the decoded video frame comprises: 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 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; The right boundary of the search area of the current block in the encoded video frame is determined by using the first pending right boundary and the second pending right boundary.
11. The method according to claim 10, 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.
12. The method according to claim 10, characterized in that The determining, according to the decoding gain and complexity, and the first position information of the current block in the encoded video frame, a first pending right boundary of the search area 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.
13. The method according to claim 10, 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 to-be-determined right boundary is determined according to the second right-extended pixel value and second position information of the target CTU in the encoded video frame.
14. The method according to claim 11, 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.
15. The method according to any one of claims 9 to 14, 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.
16. 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, according to the encoding process delay, 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; 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.
17. 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, according to the decoding process delay, a right boundary of the search area of the current tile in the decoded 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; 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.
18. 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-8 or 9-15 according to the computer program.
19. 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 8 or 9 to 15 is implemented.
20. 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 8 or 9 to 15.
Citation Information
Patent Citations
Search region determination for intra block copy in video coding
CN106134196A
Image / video coding method, device and system and computer readable storage medium
CN113596475A
Video encoding and decoding method and related device
CN116320401A
Method and apparatus for intra block copy mode coding and decoding with search range limitation
CN116724552A
Method of Intra Block Copy Search and Compensation Range
US20170094271A1
Cited By
Wavefront parallel processing control method and device suitable for AVS3, storage medium and computer equipment
CN121078236A
