Video coding method, method and device for transmitting and storing bit stream, storage medium and program product
By introducing a fast encoding decision logic, unnecessary video encoding processing stages are skipped, solving the problem of high encoding complexity in existing technologies and achieving the effect of reducing costs and increasing speed while maintaining compression efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ALIBABA (SHENZHEN) TECH CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-05-05
AI Technical Summary
While maintaining compression efficiency, existing video coding technologies have high encoding complexity and cost, making it difficult to meet the needs of applications such as real-time communication and live streaming.
A fast coding decision logic is introduced. During the video coding process, based on the encoded information of the reference coding unit and the relevant cost information of the current coding unit, it is determined whether to skip the selection process of the first prediction mode set, the search process of the second prediction mode set, and the block partitioning process. If it is determined to skip, the process will proceed directly to the next step.
It effectively reduces coding complexity, improves coding speed and efficiency, reduces coding costs, and ensures coding quality.
Smart Images

Figure CN121985135A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video coding technology, and in particular to a video coding method and a method, device, storage medium and program product for transmitting and storing bit streams. Background Technology
[0002] With the rapid development of information technology, video has become an important component of digital content. From traditional television broadcasting to high-definition streaming media, and then to virtual reality and augmented reality, the demand for video data is growing exponentially. This growth places higher demands on bandwidth, storage space, and transmission efficiency.
[0003] Video coding technology, as a key means to reduce video data redundancy and improve compression efficiency, has undergone multiple iterations, from H.264 / AVC (Advanced Video Coding) to H.265 / HEVC (High-Efficiency Video Coding), and then to H.266 / VVC (Versatile Video Coding). H.266 / VVC significantly improves compression efficiency by introducing more flexible block partitioning structures, enhanced intra / inter-frame prediction modes, and other diverse and complex coding tools.
[0004] As encoding standards become increasingly complex, the search space and computational complexity of encoding decisions increase significantly, leading to a substantial increase in encoding latency. This makes it difficult to meet the high-speed requirements of applications such as real-time communication, live streaming, and cloud gaming. Therefore, how to reduce encoding complexity, improve encoding speed, and lower encoding costs while maintaining compression efficiency advantages is one of the most pressing technical challenges in the field of video encoding. Summary of the Invention
[0005] This application provides a video encoding method and a method, device, storage medium, and program product for transmitting and storing bit streams, which can reduce encoding complexity, increase encoding speed, and reduce encoding cost while maintaining its compression efficiency advantage.
[0006] This application provides a video coding method, including: obtaining a current coding unit to be encoded in a current video frame, and determining a reference coding unit adapted to the current coding unit from the already encoded units of the current video frame; performing a coarse selection process of a first prediction mode set for the current coding unit, the result of the coarse selection process being used to participate in a fine selection process of the first prediction mode set to obtain a first prediction mode; if it is determined to skip the fine selection process based on the already encoded information of the reference coding unit and the cost information in the coarse selection process, then obtaining target cost information corresponding to the first prediction mode set; if it is determined not to skip the search process of a second prediction mode set based on the already encoded information of the reference coding unit and the target cost information, then performing a search process of the second prediction mode set to obtain a second prediction mode, and selecting the second prediction mode as a target prediction mode; if it is determined to skip the block partitioning process for the current coding unit based on the already encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, then performing video coding processing on the current coding unit according to the target prediction mode.
[0007] This application embodiment also provides a video coding method, including: obtaining a current coding unit to be encoded in a current video frame, and determining a reference coding unit adapted to the current coding unit from the already encoded units of the current video frame; performing a coarse selection process of a first prediction mode set for the current coding unit, the result of the coarse selection process being used to participate in a fine selection process of the first prediction mode set to obtain a first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information in the coarse selection process, not to skip the fine selection process, then performing the fine selection process to obtain the first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, to skip the search process of the second prediction mode set, then selecting the first prediction mode as the target prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then performing video coding processing on the current coding unit according to the target prediction mode.
[0008] This application embodiment also provides a video coding method, including: obtaining a current coding unit to be encoded in a current video frame, and determining a reference coding unit adapted to the current coding unit from the already encoded units of the current video frame; performing a coarse selection process of a first prediction mode set for the current coding unit, the result of the coarse selection process being used to participate in a fine selection process of the first prediction mode set to obtain a first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information in the coarse selection process, not to skip the fine selection process, then performing the fine selection process to obtain the first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, not to skip the search process of the second prediction mode set, then performing the search process of the second prediction mode set to obtain a second prediction mode; selecting a target prediction mode from the first prediction mode and the second prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then performing video coding processing on the current coding unit according to the target prediction mode.
[0009] This application provides a method for transmitting a bit stream, comprising: performing any of the video encoding methods provided in this application to output a bit stream, and transmitting the bit stream.
[0010] This application provides a method for storing a bitstream, comprising: performing any of the video encoding methods provided in this application to output a bitstream, and storing the bitstream.
[0011] This application also provides an electronic device, including a memory and a processor. The memory is used to store a computer program, and the processor is coupled to the memory to execute the computer program to implement the steps in the methods described above.
[0012] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps in the methods described above.
[0013] This application also provides a computer program product, which includes a computer program / instructions that, when executed by a processor, enable the processor to implement the steps described in the above method embodiments.
[0014] In this embodiment, the video encoding process is optimized by introducing fast encoding decision logic. After the current encoding unit performs coarse selection processing of the first prediction mode set, based on the encoded information of the reference encoding unit and the relevant cost information corresponding to the current encoding unit, it is determined whether to skip the fine selection processing of the first prediction mode set, the search processing of the second prediction mode set, and the block partitioning processing. If it is determined to skip, the corresponding processing is skipped, and the process proceeds directly to the subsequent steps. By performing the skip judgment before the execution of each stage, redundant calculations can be effectively avoided, reducing encoding complexity, improving encoding efficiency, and saving encoding costs while ensuring encoding quality. Attached Figure Description
[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a video encoding method provided for an exemplary embodiment of this application; Figure 2 This is a flowchart illustrating a video encoding method in another exemplary embodiment of this application; Figure 3a A schematic diagram of the structure of a video frame provided for another exemplary embodiment of this application; Figure 3b A schematic diagram of the structure of a video frame provided for another exemplary embodiment of this application; Figure 3c A schematic diagram of the structure of a video frame provided for another exemplary embodiment of this application; Figure 4 A flowchart illustrating a video encoding method provided as another exemplary embodiment of this application; Figure 5 A flowchart illustrating a video encoding method provided as another exemplary embodiment of this application; Figure 6 A flowchart illustrating yet another exemplary embodiment of the video encoding method provided in this application; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with relevant laws, regulations, and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.
[0018] To address the technical challenge of maintaining compression efficiency while reducing encoding complexity, increasing encoding speed, and lowering encoding costs, this application optimizes the video encoding process by introducing fast encoding decision logic. After the current encoding unit performs coarse selection processing of the first prediction mode set, based on the encoded information of the reference encoding unit and the relevant cost information corresponding to the current encoding unit, it determines whether to skip the fine selection processing of the first prediction mode set, the search processing of the second prediction mode set, and the block partitioning processing. If it is determined to skip, the corresponding processing is skipped, and the process proceeds directly to the subsequent steps. By performing skip checks before the execution of each stage, redundant calculations can be effectively avoided, reducing encoding complexity, improving encoding efficiency, and saving encoding costs while ensuring encoding quality.
[0019] The embodiments of this application are suitable for various encoding standards, such as, but not limited to, H.264 / AVC, H.265 / HEVC, H.266 / VVC, etc.; and are applicable to various encoders that adopt various encoding standards, such as general encoders, dedicated encoders, self-developed encoders, etc.
[0020] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0021] Figure 1 This is a flowchart illustrating a video encoding method provided as an exemplary embodiment of this application. Figure 1 As shown, the method includes: S101: Obtain the current coding unit to be encoded in the current video frame, and determine the reference coding unit that matches the current coding unit from the encoded units in the current video frame; S102: For the current coding unit, perform a coarse selection process of the first prediction mode set. The result of the coarse selection process is used to participate in the fine selection process of the first prediction mode set to obtain the first prediction mode. S103: If it is determined to skip the fine selection process based on the encoded information of the reference coding unit and the cost information in the coarse selection process, then obtain the target cost information corresponding to the first prediction mode set. S104: If it is determined, based on the encoded information of the reference coding unit and the target cost information, that the search process of the second prediction mode set should not be skipped, then the search process of the second prediction mode set is performed to obtain the second prediction mode, and the second prediction mode is selected as the target prediction mode. S105: If it is determined to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, then video coding processing is performed on the current coding unit according to the target prediction mode.
[0022] In this embodiment, the current coding unit (CU) to be encoded in the current video frame is obtained. The current coding unit can be a coding unit obtained by partitioning a basic coding block. In some embodiments, the basic coding block can be implemented as a coding tree unit (CTU), and correspondingly, the CU can be generated with the CTU as the root node through a multi-way tree or recursive partitioning method, and is a coding unit for predictive coding. The implementation of the basic coding block and the coding unit varies depending on the coding standard, and this embodiment does not limit this.
[0023] It should be noted that various partitioning techniques can be used during the encoding process, such as quadtrees (QT), binary trees (BT), and ternary trees (TT), to iteratively divide the video frames to be encoded into multiple encoding units. The size of these encoding units varies depending on the encoding standard. For example, in encoding standards such as H.265 / HEVC or H.266 / VVC, the size of the encoding unit may be different, such as 128×128, 64×64, or 32×32. For ease of description, in the embodiments of this application, they are uniformly referred to as "encoding units".
[0024] In this embodiment, a reference coding unit that is compatible with the current coding unit is determined from among the multiple coded units that have been encoded in the current video frame.
[0025] The reference coding unit can be a coded unit that is spatially adjacent to the current coding unit, such as a coded unit located to the left, above, or to the upper left of the current coding unit.
[0026] In some embodiments, the reference coding unit has an encoded unit of the same or similar size as the current coding unit. Because they are consistent in coding granularity, the encoded information of the reference coding unit can be directly reused without scaling or normalization, improving the accuracy and efficiency of information reuse and reducing the complexity of information processing.
[0027] In other embodiments, the reference coding unit may also be a coded unit of different sizes, thereby enriching the available sources of reference information by introducing coded information at different coding granularities.
[0028] In the encoding process of this embodiment, for the current encoding unit, the search process of the first prediction mode set needs to be executed sequentially. This search process includes a pre-selection operation (which can also be called a coarse selection process, coarse selection operation, coarse selection stage, etc.) and a final selection operation (which can also be called a fine selection process, fine selection operation, fine selection stage, etc.), the search process of the second prediction mode set, block partitioning processing, and encoding processing. The search process of the second prediction mode set may include a single-stage search process, or it may include two or more stages of search process. For example, it may also include coarse selection processing and fine selection processing, and there is no limitation thereto.
[0029] Furthermore, in this embodiment, the above encoding process is optimized by adding fast encoding decision logic, such as... Figure 2 As shown, a fast encoding decision logic is added before the selection process, the search process for the second prediction pattern set, and the block partitioning process to determine whether to skip the corresponding process. If the decision result is that it needs to be skipped, the corresponding process is skipped, and then the subsequent processes are continued. By skipping unnecessary processes, encoding efficiency can be improved and encoding costs can be saved while ensuring encoding quality. A detailed introduction follows.
[0030] In this embodiment, the entire set of prediction modes used for video coding is divided into two sets: a first prediction mode set and a second prediction mode set. The first prediction mode set includes several prediction modes; the second prediction mode set includes the remaining prediction modes in the entire set excluding those in the first set. In this embodiment, the scope of the entire prediction mode set varies depending on the application scenario and the video coding standard used. For example, the entire prediction mode set may include some inter-frame prediction modes and some intra-frame prediction modes; or, it may include all inter-frame prediction modes and all intra-frame prediction modes, and so on.
[0031] In this embodiment, the division between the first prediction mode set and the second prediction mode set is not limited and can be flexibly set according to different application scenarios and video coding standards.
[0032] For example, the first prediction mode set may include prediction modes suitable for video frames with simple textures, such as inter-frame prediction modes, such as Merge and Skip modes. Merge / Skip modes are important techniques in video coding and are widely adopted in many video coding standards (such as HEVC and VVC). Their basic principle is to use motion information from neighboring coded units to predict the current coded unit, reducing coding bit overhead and thus improving coding efficiency. Correspondingly, the second prediction mode set may include prediction modes suitable for video frames with complex textures, such as other inter-frame prediction modes and all intra-frame prediction modes.
[0033] For example, the first prediction mode set may include prediction modes suitable for video frames with complex textures, such as inter-frame prediction modes other than Merge and Skip, and all intra-frame prediction modes. Correspondingly, the second prediction mode set may include prediction modes suitable for video frames with simple textures, such as Merge mode and Skip mode.
[0034] For example, the first prediction mode set may include some intra-frame prediction modes and some inter-frame prediction modes. Correspondingly, the second prediction mode set may include the remaining intra-frame prediction modes and the remaining inter-frame prediction modes.
[0035] In this embodiment, as Figure 2 As shown in S11, for the current coding unit, a coarse selection process of the first prediction mode set is performed. The result of the coarse selection process is used to participate in the fine selection process of the first prediction mode set to obtain the first prediction mode. Specifically, the coarse selection process is used to evaluate the cost of multiple candidate objects in the first prediction mode set. Based on the cost information of the coarse selection process, the objects participating in the fine selection process can be selected from the multiple candidate objects, which is the result of the coarse selection process.
[0036] The candidate objects vary depending on the prediction modes included in the first prediction mode set. For example, when the first prediction mode set includes inter-frame prediction modes, each inter-frame prediction mode corresponds to multiple motion vector candidates. The purpose of the search operation of the first prediction mode set is to select a target motion vector candidate from among the multiple motion vector candidates for participation in the coding process of the current coding unit. Specifically, the coarse selection process selects at least one motion vector candidate from among the multiple motion vector candidates as the object to participate in the fine selection process, and the fine selection process selects the target motion vector candidate from among the at least one motion vector candidate that has entered the fine selection process. When the first prediction mode set contains multiple prediction modes, the purpose of the search operation of the first prediction mode set is to select a target prediction mode from among the multiple prediction modes for participation in the coding process of the current coding unit. Specifically, the coarse selection process selects at least one prediction mode from among the multiple prediction modes as the object to participate in the fine selection process, and the fine selection process selects the target prediction mode from among the at least one prediction mode that has entered the fine selection process.
[0037] In this embodiment, the coarse selection process can employ a cost evaluation method with low computational complexity, such as SatdCost (Sum of Absolute Transformed Differences Cost). SatdCost measures the prediction error and has relatively low computational complexity. When the first prediction mode set includes inter-frame prediction modes, the coarse selection process calculates the SatdCost of multiple motion vector candidates and selects at least one motion vector candidate from these candidates based on the SatdCost. For example, it selects several motion vector candidates with smaller SatdCosts to proceed to the fine selection process. When the first prediction mode set contains multiple prediction modes, the coarse selection process calculates the SatdCost of multiple prediction modes and selects at least one or more prediction modes from these modes based on the SatdCost. For example, it selects several or more prediction modes with smaller SatdCosts to proceed to the fine selection process.
[0038] In this embodiment, as Figure 2 As shown in S12, before performing the fine search process, it is determined whether to skip the fine search process based on the encoded information of the reference coding unit and the cost information from the coarse search process. If it is determined to skip the fine search process, the target cost information corresponding to the first prediction mode set is obtained.
[0039] The target cost information refers to the cost information associated with the first prediction pattern set, used to assist in determining whether to skip the search process of the second prediction pattern set. For example, the target cost information could be the default cost information corresponding to the first prediction pattern set. This default cost information could be a preset upper limit value used to characterize the cost information that the selection process might generate, or it could be considered the default cost information corresponding to the selection process. Alternatively, the target cost information could also be the maximum cost information in the coarse selection process, that is, the maximum cost information among all the cost information calculated in the coarse selection process.
[0040] Furthermore, given the acquisition of the target cost information corresponding to the first prediction pattern set, such as... Figure 2 As shown in S14, based on the encoded information and target cost information of the reference coding unit, it is determined whether to skip the search process of the second prediction mode set. It should be understood that if the selection process of the first prediction mode set has been skipped, in order to ensure that the current coding unit completes the determination of the prediction mode based on at least one prediction mode set, the determination result is that the search process of the second prediction mode set needs to be performed, that is, the search process of the second prediction mode set is not skipped.
[0041] In this embodiment, if it is determined, based on the encoded information of the reference coding unit and the target cost information, that the search process for not skipping the second prediction mode set is not performed, then as follows: Figure 2 As shown in step S15, a search process for the second prediction mode set is performed to obtain the second prediction mode, and the second prediction mode is selected as the target prediction mode. Optionally, selecting the second prediction mode as the target prediction mode includes: selecting the target prediction mode from the second prediction mode and each prediction mode included in the first prediction mode set based on the target cost information corresponding to the first prediction mode set and the cost information corresponding to the second prediction mode; that is, comparing the two cost information and selecting the prediction mode with the smaller cost information as the target prediction mode; wherein, when skipping the selection process, the target cost information corresponding to the first prediction mode set is usually larger, and the cost information corresponding to the second prediction mode will be smaller than the target cost information, so the second prediction mode will be selected as the target prediction mode.
[0042] Furthermore, given a defined target prediction model, such as Figure 2 As shown in S16, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, it is determined whether to skip the block partitioning process for the current coding unit.
[0043] In this embodiment, when the determination result indicates that the block partitioning process for the current coding unit is skipped, it means that the current coding unit can obtain relatively better cost information by performing coding processing based on the target prediction mode, and that performing block partitioning processing on the current coding unit, combined with the already encoded information of the reference coding unit, does not yield better cost benefits. Based on this, block partitioning processing can be skipped for the current coding unit, and video coding processing can be performed on the current coding unit according to the target prediction mode instead.
[0044] In this embodiment, the video encoding process is optimized by introducing fast encoding decision logic. After the current encoding unit performs coarse selection processing of the first prediction mode set, based on the encoded information of the reference encoding unit and the relevant cost information corresponding to the current encoding unit, it is determined whether to skip the fine selection processing of the first prediction mode set, the search processing of the second prediction mode set, and the block partitioning processing. If it is determined to skip, the corresponding processing is skipped, and the process proceeds directly to the subsequent steps. By performing the skip judgment before the execution of each stage, redundant calculations can be effectively avoided, reducing encoding complexity, improving encoding efficiency, and saving encoding costs while ensuring encoding quality.
[0045] In one optional embodiment, when determining a reference coding unit adapted to the current coding unit from the coded units of the current video frame, the process includes: determining the current reference coding block to which the current coding unit belongs; and determining, from the current reference coding block and the reference coding blocks located to the left and above the current reference coding block, coded units of the same size as the current coding unit as reference coding units.
[0046] In this embodiment, a reference coding unit is selected from the current reference coding block and the reference coding blocks spatially adjacent to the current reference coding block. The adjacent reference coding blocks may include the reference coding block to the left of the current reference coding block and the reference coding block above the current reference coding block. Further, among the aforementioned reference coding blocks, a reference coding unit that is the same size as the current coding unit is determined, and this selected reference coding unit is used as the reference coding unit.
[0047] In one example, such as Figure 3aAs shown, solid boxes represent reference coding blocks, and dashed boxes represent coding units. Copied units are selected as reference coding units from the current reference coding block C and its spatially adjacent reference coding blocks. In this example, adjacent reference coding blocks may include reference coding block L to the left of the current reference coding block C and reference coding block A above the current reference coding block C. Further, among the aforementioned reference coding blocks, encoded units of the same size as the current coding unit are determined, and these selected encoded units are used as reference coding units. For example, encoded units L1 and L2 are selected from the left reference coding block L; encoded unit A1 is selected from the upper reference coding block A; and encoded unit C1 is selected from the current reference coding block. It should be understood that the encoded units only need to be within the adjacent reference coding blocks of the current reference coding block; the size and whether they share a common edge with the current coding unit are not limited in this embodiment.
[0048] In yet another example, such as Figure 3b As shown, encoded units L1 and L2 are selected from the left reference coding block L. In this example, L1 does not share a common edge with the current coding unit.
[0049] In yet another example, such as Figure 3c As shown, an encoded unit L1 is selected from the left reference coding block L. In this example, L1 does not share an edge with the current coding unit. Also, an encoded unit C1 located inside the current reference block may not share an edge with the current coding unit.
[0050] In this embodiment, by selecting a reference coding unit in the above manner, it is possible to ensure that the reference coding unit and the current coding unit are spatially adjacent and consistent in coding granularity. This allows the encoded information of the reference coding unit to provide high reference value in the subsequent coding decision process, thereby making the skip decision based on the encoded information of the reference coding unit more reasonable, reducing unnecessary search processing and block partitioning processing, and effectively reducing coding complexity and improving overall coding efficiency while ensuring stable coding performance.
[0051] In an optional embodiment, the method further includes: if it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, that the block partitioning process for the current coding unit should not be skipped, then... Figure 2As shown in step S17, block partitioning is performed to attempt to partition the current coding unit and determine the target partitioning method. If the cost information of the target partitioning method is greater than or equal to the cost information corresponding to the target prediction mode, then video coding processing is performed on the current coding unit according to the target prediction mode. If the cost information of the target partitioning method is less than the cost information corresponding to the target prediction mode, then video coding processing is performed on the sub-coding units partitioned according to the target partitioning method. In this embodiment, by comparing the cost information corresponding to the target partitioning method and the target prediction mode, when block partitioning does not bring significant cost benefits, the target prediction mode is directly used to encode the current coding unit, thereby avoiding unnecessary coding processing on the sub-coding units and reducing computational overhead. When block partitioning can bring significant cost benefits, the block partitioning result is used for coding to improve the rationality of coding decisions and thus improve video coding efficiency.
[0052] In this embodiment, if it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, that the block partitioning process for the current coding unit should not be skipped, then the block partitioning process is executed. During the block partitioning process, multiple different partitioning methods can be attempted for the current coding unit. For each partitioning method, the current coding unit is divided into multiple sub-coding units. For each sub-coding unit obtained by any partitioning method, prediction mode selection and cost evaluation are performed on each sub-coding unit to determine the target prediction mode and its corresponding cost information for each sub-coding unit. Furthermore, the sum of the cost information corresponding to each sub-coding unit under the same partitioning method is taken as the cost information for that partitioning method. When multiple partitioning methods are obtained, the partitioning method with the smaller cost information is selected as the target partitioning method.
[0053] In this embodiment, when the target partitioning method is determined, the cost information corresponding to the target partitioning method is compared with the cost information of the target prediction mode of the current coding unit without block partitioning. If the cost information of the target partitioning method is greater than or equal to the cost information corresponding to the target prediction mode, then video coding processing is performed on the current coding unit according to the target prediction mode; if the cost information of the target partitioning method is less than the cost information corresponding to the target prediction mode, then the current coding unit is partitioned according to the target partitioning method, and video coding processing is performed on each of the resulting sub-coding units.
[0054] Further, optionally, if it is determined, based on the encoded information of the reference coding unit and the cost information in the coarse selection process, that the fine selection process should not be skipped, then as follows: Figure 2As shown in step S13, a selection process is performed to obtain a first prediction mode; if it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, to skip the search process of the second prediction mode set, the first prediction mode is taken as the target prediction mode; and, an operation is performed to determine whether to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode. In this embodiment, by utilizing the encoded information of the reference coding unit, a skip control is added before the search process of the second prediction mode set and the block partitioning process to reduce the search calculation of the second prediction mode set and unnecessary block partitioning processes, thereby reducing the overall coding complexity and improving coding efficiency.
[0055] In this embodiment, for the current coding unit, after performing the coarse selection process of the first prediction mode set, it is determined whether to skip the fine selection process of the first prediction mode set based on the encoded information of the reference coding unit and the cost information in the coarse selection process. When the determination result is not to skip the fine selection process, the fine selection process is performed to determine the first prediction mode from the coarse selection result.
[0056] Given a first prediction mode, based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, it is determined whether to skip the search process for the second prediction mode set. If the determination result is to skip the search process for the second prediction mode set, the first prediction mode is taken as the target prediction mode for the current coding unit. If the target prediction mode is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, it is determined whether to perform block partitioning processing on the current coding unit. If it is determined to skip the block partitioning processing for the current coding unit, block partitioning processing is not performed on the current coding unit; instead, video coding processing is performed on the current coding unit according to the target prediction mode. If it is determined not to skip the block partitioning processing for the current coding unit, block partitioning processing is performed on the current coding unit, attempting to partition the current coding unit and determining the target partitioning method.
[0057] Once the target partitioning method is determined, the cost information of the target partitioning method can be obtained. The method for obtaining the cost information of the target partitioning method can be referred to the above embodiment. After obtaining the target partitioning method and its corresponding cost information, the cost information of the target partitioning method is compared with the cost information corresponding to the target prediction mode. If the cost information of the target partitioning method is greater than or equal to the cost information corresponding to the target prediction mode, then video encoding processing is performed on the current coding unit according to the target prediction mode; if the cost information of the target partitioning method is less than the cost information corresponding to the target prediction mode, then video encoding processing is performed on the sub-coding units partitioned according to the target partitioning method. Specifically, performing video encoding processing on each sub-coding unit can be done by repeatedly executing the process, treating each sub-coding unit as the current coding unit. Figure 1 The process of the method provided in the illustrated embodiment.
[0058] Further optionally, the above method further includes: if it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, that the search process of the second prediction mode set should not be skipped, then performing the search process of the second prediction mode set to obtain the second prediction mode; selecting a target prediction mode from the first prediction mode and the second prediction mode, specifically, comparing the cost information corresponding to the first prediction mode and the cost information corresponding to the second prediction mode, and selecting the one with smaller cost information as the target prediction mode; and performing the operation of determining whether to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode.
[0059] In this embodiment, when the determination result is that the search process of the second prediction mode set should not be skipped, the search process of the second prediction mode set is performed for the current coding unit to obtain the second prediction mode. Optionally, when the second prediction mode set includes two modes, inter-frame prediction mode and intra-frame prediction mode, the second type of inter-frame prediction mode with the minimum cost information (referred to as optimal) is obtained by using inter-frame search, and the intra-frame prediction mode with the minimum cost information (referred to as optimal) is obtained by using intra-frame search. The better one is selected from the optimal second type of inter-frame prediction mode and the optimal intra-frame prediction mode, that is, the one with the smaller cost information, as the second prediction mode. The second prediction mode can be either the second type of inter-frame prediction mode or the intra-frame prediction mode.
[0060] In this embodiment, without skipping the search for the second prediction mode set, a target prediction mode is selected by performing the second prediction mode set search process and combining the cost information of the first and second prediction modes to choose the prediction mode with the lower encoding cost for the current coding unit. Further, by referring to the already encoded information of the coding unit and the cost information corresponding to the target prediction mode, it is determined whether to perform block partitioning. If it is determined to skip the block partitioning process for the current coding unit, then block partitioning is not performed on the current coding unit; instead, video encoding is performed on the current coding unit according to the target prediction mode. This avoids introducing additional computation when block partitioning has no significant cost benefit, thereby reducing encoding complexity and improving video encoding efficiency. Further, if it is determined not to skip the block partitioning process for the current coding unit, then block partitioning is performed on the current coding unit. A detailed description of the relevant block partitioning process can be found in the foregoing embodiments and will not be repeated here.
[0061] In the foregoing embodiments of this application, the prediction modes included in the first prediction mode set and the second prediction mode set are not limited. In an optional embodiment, the first prediction mode set includes a first type of inter-frame prediction mode, and the second prediction mode set includes a second type of inter-frame prediction mode and multiple intra-frame prediction modes; the first type of inter-frame prediction mode refers to an inter-frame prediction mode that only supports motion compensation, and the second type of inter-frame prediction mode refers to an inter-frame prediction mode that simultaneously supports motion estimation and motion compensation.
[0062] Optionally, the first type of inter-frame prediction mode may include Merge mode and Skip mode, etc. Merge mode can generate predictions based on candidate motion information and encode residual signals; Skip mode can generate predictions based on candidate motion information but does not encode residual signals. The above are merely examples, and the first type of inter-frame prediction mode is not limited to these.
[0063] Optionally, the second type of inter-frame prediction mode may include the Advanced Motion Vector Prediction (AMVP) inter-frame prediction mode and other inter-frame prediction modes that support motion estimation and motion compensation.
[0064] In this embodiment, when predicting the current coding unit using the first type of inter-frame prediction mode, motion estimation is not required for the current coding unit. Instead, motion compensation is performed based on existing motion information to obtain the prediction result for the current coding unit. Therefore, the computational complexity is relatively low, making it suitable for rapid evaluation in the early stages of prediction mode search.
[0065] In this embodiment, when predicting the current coding unit using the second type of inter-frame prediction mode, motion estimation processing needs to be performed on the current coding unit first to search for and determine the corresponding motion information. Then, motion compensation processing is performed based on the determined motion information to obtain the prediction result of the current coding unit. Compared with the first type of inter-frame prediction mode, the second type of inter-frame prediction mode has higher computational complexity, but can provide better prediction results under certain circumstances.
[0066] In addition, the second prediction mode set includes several intra-frame prediction modes. Intra-frame prediction modes are used to predict the current coding unit within the current video frame.
[0067] Intra-frame prediction technology is used in various video coding standards, such as H.264 / AVC, H.265 / HEVC, H.266 / VVC, and AVS2 (Audio Video Coding Standard). Therefore, the embodiments of this application are applicable to any video coding standard that uses intra-frame prediction technology. However, different video coding standards support different intra-frame prediction modes.
[0068] For example, H.264 / AVC supports prediction of 4×4, 16×16 luma blocks and 8×8 chroma blocks; among them, the 4×4 luma block supports 9 intra-frame prediction modes, namely 1 DC (direct current component prediction) mode and 8 directional modes; the 16×16 luma block supports 4 intra-frame prediction modes, namely vertical mode, horizontal mode, mean mode and planar mode.
[0069] For example, the H.265 / HEVC extended prediction cell size ranges from 4×4 to 64×64; 35 intra-frame prediction modes are introduced for the luma component, including 33 angle modes, DC mode, and Plane (planar prediction) mode.
[0070] For example, AVS2 employs 33 luminance prediction modes and 5 chrominance prediction modes; among them, the 33 luminance prediction modes include 30 angle modes, DC mode, Plane mode, and Bilinear (bilinear prediction) mode.
[0071] In an optional embodiment, the encoded information of the reference coding unit includes: coarse selection cost information of the reference coding unit. For example, the coarse selection cost information can be implemented as SatdCost. In a specific implementation, the coarse selection cost information of the reference coding unit can be the minimum value among the coarse selection cost information of each motion vector candidate in the coarse selection stage. In this optional embodiment, the method further includes: determining whether to skip the fine selection process based on the encoded information of the reference coding unit and the cost information in the coarse selection process, specifically: calculating first reference cost information based on the coarse selection cost information of the reference coding unit; determining whether the current coding unit is suitable for the first type of inter-frame prediction mode based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information; if it is determined that the current coding unit is not suitable for the first type of inter-frame prediction mode, determining to skip the fine selection process; if it is determined that the current coding unit is suitable for the first type of inter-frame prediction mode, determining not to skip the fine selection process. In this embodiment, by calculating the first reference cost information based on the coarse selection cost information of the reference coding unit and comparing it with the coarse selection cost of each motion vector candidate of the current coding unit, it is possible to determine whether the current coding unit is suitable for the first type of inter-frame prediction mode before performing the fine selection process. If the selection is deemed unsuitable, the selection process can be skipped to avoid ineffective cost evaluation; if it is deemed suitable, the selection process continues. This method can effectively reduce computational overhead, lower coding complexity, and improve coding efficiency while ensuring the accuracy of prediction mode selection.
[0072] In this embodiment, first reference cost information is calculated based on the coarse selection cost information of the reference coding unit. The first reference cost information is used to characterize the coarse selection cost level of the reference coding unit in the first type of inter-frame prediction mode. The first reference cost information can be calculated by statistically processing the coarse selection cost information of one or more reference coding units, such as by averaging, weighting, etc., and this embodiment does not limit this method.
[0073] Furthermore, the coarse selection cost information of each motion vector candidate corresponding to the current coding unit is compared with the first reference cost information to determine whether the current coding unit is suitable for the first type of inter-frame prediction mode. If the comparison result shows that the number of candidates whose coarse selection cost information of each motion vector candidate corresponding to the current coding unit is greater than the first reference cost information exceeds a first preset proportion threshold, such as 70%, 80%, or 90%, it indicates that the prediction effect of the current coding unit in the first type of inter-frame prediction mode is relatively poor, and it is determined to skip the selection process.
[0074] In an optional embodiment, if the coarse selection cost information of all motion vector candidates corresponding to the current coding unit is greater than the first reference cost information, then it is determined that the current coding unit is not suitable for the first type of inter-frame prediction mode, and the selection process is skipped.
[0075] In this embodiment, if the comparison result shows that the number of candidates whose coarse selection cost information of the motion vector candidate corresponding to the current coding unit is less than or equal to the number of candidates whose first reference cost information is not less than the second preset ratio threshold, then the current coding unit is determined to be suitable for the first type of inter-frame prediction mode, and accordingly it is determined not to skip the selection process.
[0076] In an optional embodiment, if at least one candidate among the motion vector candidates corresponding to the current coding unit has a coarse selection cost information that is less than or equal to the first reference cost information, then the current coding unit is determined to be suitable for the first type of inter-frame prediction mode, and the fine selection process is not skipped.
[0077] Optionally, the encoded information of the reference coding unit further includes at least one of the following auxiliary information: prediction mode, prediction direction, and angle corresponding to the reference coding unit. Then, when determining whether the current coding unit is suitable for the first type of inter-frame prediction mode based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, the determination includes: based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, combined with at least one auxiliary information, determining whether the current coding unit is suitable for the first type of inter-frame prediction mode. By introducing auxiliary information such as the prediction mode, prediction direction, or angle of the reference coding unit for joint judgment based on the coarse selection cost information, the suitability of the current coding unit for the first type of inter-frame prediction mode can be determined more accurately, reducing misjudgments caused by single cost information, improving the accuracy and reliability of skipping the selection processing decision, further reducing redundant calculations, and optimizing coding efficiency.
[0078] In this embodiment, when determining whether the current coding unit is suitable for the first type of inter-frame prediction mode based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, at least one auxiliary information can also be used for the judgment. Specifically, based on comparing the coarse selection cost information of each motion vector candidate corresponding to the current coding unit with the first reference cost information, at least one auxiliary information among the prediction mode, prediction direction, and / or prediction angle adopted by the coding unit is further referenced to determine whether the current coding unit is suitable for the first type of inter-frame prediction mode.
[0079] Specifically, when at least one piece of auxiliary information is consistent with or similar to the motion direction or prediction direction reflected by the motion vector candidate corresponding to the current coding unit, the current coding unit is determined to be suitable for the first type of inter-frame prediction mode; when at least one piece of auxiliary information is significantly different from the motion direction or prediction direction reflected by the motion vector candidate corresponding to the current coding unit, the current coding unit is determined to be unsuitable for the first type of inter-frame prediction mode.
[0080] In this embodiment, when the prediction mode corresponding to the reference coding unit is used as auxiliary information, if it is determined to skip the selection process based on the comparison result between the coarse selection cost information and the first reference cost information, it is further determined whether the prediction mode adopted by the reference coding unit is a first type of inter-frame prediction mode; if the prediction mode adopted by the reference coding unit is not a first type of inter-frame prediction mode, it is determined that the current coding unit is not suitable for the first type of inter-frame prediction mode, thereby determining to skip the selection process; if the prediction mode adopted by the reference coding unit is a first type of inter-frame prediction mode, the comparison result between the coarse selection cost information and the first reference cost information is used as the basis for determining whether to skip the selection process.
[0081] In this embodiment, at least one piece of auxiliary information includes the prediction angle and / or prediction direction corresponding to the reference coding unit. When determining whether the current coding unit is suitable for the first type of inter-frame prediction mode based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, the prediction angle and prediction direction can be used to filter the coarse selection cost information participating in the comparison.
[0082] Specifically, after obtaining the coarse cost information of multiple motion vector candidates corresponding to the current coding unit, the coarse cost information corresponding to the motion vector candidate whose prediction angle and / or prediction direction is the same as or similar to the prediction angle and / or prediction direction of the reference coding unit is selected for comparison with the first reference cost information; and based on the comparison result, it is determined whether the current coding unit is suitable for the first type of inter-frame prediction mode.
[0083] In an optional embodiment, the encoded information of the reference coding unit includes: selected cost information when the reference coding unit selects a first type of inter-frame prediction mode. In this embodiment, the selected cost information can be implemented as Rate-Distortion Cost (RDCost). In this optional embodiment, the method further includes: determining whether to skip the search process of the second prediction mode set based on the encoded information of the reference coding unit and the target cost information, specifically: determining a target reference coding unit that selects a specific inter-frame prediction mode, wherein the specific inter-frame prediction mode is one of the first type of inter-frame prediction modes; calculating the second reference cost information based on the selected cost information when the target reference coding unit selects the specific inter-frame prediction mode; if the target cost information is less than the second reference cost information, determining to skip the search process of the second prediction mode set; if the target cost information is greater than or equal to the second reference cost information, determining not to skip the search process of the second prediction mode set. By constructing a second reference cost information using the carefully selected cost information of the reference coding unit when selecting a specific inter-frame prediction mode, and comparing it with the target cost information of the current coding unit, a skip decision strategy for coding units based on a specific inter-frame prediction mode is implemented, improving the flexibility of control over the search process of the second prediction mode set. When the current coding unit has already obtained a better prediction cost, this approach helps to avoid performing the search process of the second prediction mode set, reducing redundant calculations, lowering coding complexity, and improving coding efficiency.
[0084] In this embodiment, during the selection process of the first type of inter-frame prediction modes, for each coding unit, a suitable prediction mode is selected from the first type of inter-frame prediction modes as the prediction mode for the current coding unit based on the selection cost information. For example, in some implementations, the first type of inter-frame prediction modes includes a Merge mode and a Skip mode, and a selection can be made from the Merge mode and the Skip mode based on the selection cost information.
[0085] In this embodiment, when determining whether to skip the search process of the second prediction mode set based on the encoded information and target cost information of the reference coding unit, a target reference coding unit that has selected a specific inter-frame prediction mode is identified within the reference coding unit. The specific inter-frame prediction mode is one of the first type of inter-frame prediction modes.
[0086] In this embodiment, the selected cost information corresponding to a specific inter-frame prediction mode can reflect the prediction performance of the reference coding unit under that prediction mode. Therefore, the selected cost information of a specific inter-frame prediction mode can serve as a reference for determining whether the current coding unit should further perform the search process of the second prediction mode set.
[0087] In this embodiment, a specific inter-frame prediction mode can have the characteristics of not requiring the encoding of residual information and having low encoding complexity. When a reference coding unit selects a specific inter-frame prediction mode during the selection process, it indicates that the video region corresponding to that reference coding unit has relatively simple motion characteristics. Therefore, the selection cost information corresponding to the target reference coding unit when selecting a specific inter-frame prediction mode can serve as a reference for determining whether the current coding unit should further perform the second prediction mode set search process. In one example, the specific inter-frame prediction mode can be a Skip mode, but it is not limited to this.
[0088] Given a target reference coding unit, second reference cost information is calculated based on the selected cost information corresponding to the target reference coding unit when selecting a specific inter-frame prediction mode. Then, the target cost information is compared with the second reference cost information. If the target cost information is less than the second reference cost information, it is determined that the search process for the second prediction mode set should be skipped; if the target cost information is greater than or equal to the second reference cost information, it is determined that the search process for the second prediction mode set should not be skipped.
[0089] In some embodiments, after completing the coarse selection process of the first prediction mode set, the current encoding unit does not skip the fine selection process and performs the fine selection process; in this case, the first prediction mode obtained in the fine selection process can be used as the target prediction mode. Accordingly, the target cost information can be specifically implemented as the RDCost corresponding to the Skip mode selected by the current encoding unit in the fine selection process.
[0090] In an optional embodiment, the encoded information of the reference coding unit includes: the predictive coding cost information corresponding to the encoding of the reference coding unit; the method further includes: determining whether to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, specifically: calculating third reference cost information based on the predictive coding cost information corresponding to the reference coding unit; if the cost information corresponding to the target prediction mode is less than the third reference cost information, determining to skip the block partitioning process for the current coding unit; if the cost information corresponding to the target prediction mode is greater than or equal to the third reference cost information, determining not to skip the block partitioning process for the current coding unit.
[0091] In this embodiment, the encoded information of the reference coding unit includes the predictive coding cost information corresponding to the reference coding unit when it completes coding. The predictive coding cost information refers to the cost information corresponding to the reference coding unit when it uses its finally determined prediction mode for coding, reflecting the cost information of the reference coding unit during the predictive coding process. In one example, the predictive coding cost information can be implemented as RDCost. Here, RDCost is the predictive coding cost calculated by the reference coding unit under the finally determined prediction mode used for coding.
[0092] In this embodiment, given the target prediction mode of the current coding unit, it is determined whether to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode. Specifically, a third reference cost information is calculated based on the prediction coding cost information corresponding to the reference coding unit. This third reference cost information serves as a reference for determining whether the current coding unit should undergo block partitioning.
[0093] In this embodiment, when the cost information corresponding to the target prediction mode is less than the third reference cost information, it indicates that, without performing block partitioning on the current coding unit, the cost information obtained based on the target prediction mode is better than the predicted coding cost information corresponding to the reference coding unit. In this case, continuing to perform block partitioning on the current coding unit is unlikely to yield a cost advantage better than the current cost information. Therefore, it is determined to skip the block partitioning on the current coding unit and perform video coding on the current coding unit based on the target prediction mode.
[0094] In this embodiment, when the cost information corresponding to the target prediction mode is greater than or equal to the third reference cost information, it indicates that the cost information of the current coding unit at the current coding granularity still has room for further reduction compared to the predicted coding cost information of the reference coding unit. In this case, block partitioning can be performed on the current coding unit. By performing prediction and coding on the sub-coding units separately, we can try to obtain smaller cost information. Therefore, we determine not to skip the block partitioning process for the current coding unit.
[0095] In this embodiment, when the cost information corresponding to the target prediction mode is less than the third reference cost information, it indicates that a relatively better coding cost has been obtained at the current coding unit granularity, thus determining to skip the block partitioning process; when the cost information corresponding to the target prediction mode is greater than or equal to the third reference cost information, it indicates that a better coding cost may still be obtained through block partitioning, thus determining not to skip the block partitioning process. Through this method, block partitioning is performed only when there is a significant cost benefit, ensuring the effectiveness of coding decisions while reducing unnecessary block partitioning calculations, lowering coding complexity, and improving video coding efficiency.
[0096] Figure 4 This is a flowchart illustrating a video encoding method as provided in another exemplary embodiment of this application. Figure 4 As shown, the method includes: S401: Obtain the current coding unit to be encoded in the current video frame, and determine the reference coding unit that matches the current coding unit from the encoded units in the current video frame; S402: For the current coding unit, perform a coarse selection process of the first prediction mode set. The result of the coarse selection process is used to participate in the fine selection process of the first prediction mode set to obtain the first prediction mode. S403: If it is determined, based on the encoded information of the reference coding unit and the cost information in the coarse selection process, that the fine selection process should not be skipped, then the fine selection process is performed to obtain the first prediction mode; S404: If it is determined to skip the search process of the second prediction mode set based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, the first prediction mode shall be used as the target prediction mode. S405: If it is determined to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, then video coding processing is performed on the current coding unit according to the target prediction mode.
[0097] Figure 5 This is a flowchart illustrating a video encoding method as provided in another exemplary embodiment of this application. Figure 5 As shown, the method includes: S501: Obtain the current coding unit to be encoded in the current video frame, and determine the reference coding unit that matches the current coding unit from the encoded units in the current video frame; S502: For the current coding unit, perform a coarse selection process of the first prediction mode set. The result of the coarse selection process is used to participate in the fine selection process of the first prediction mode set to obtain the first prediction mode. S503: If it is determined, based on the encoded information of the reference coding unit and the cost information in the coarse selection process, that the fine selection process should not be skipped, then the fine selection process is executed to obtain the first prediction mode; S504: If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, that the search process of the second prediction mode set is not skipped, the search process of the second prediction mode set is executed to obtain the second prediction mode. S505: Select the target prediction mode from the first prediction mode and the second prediction mode; S506: If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then video coding processing is performed on the current coding unit according to the target prediction mode.
[0098] The above embodiments provide video encoding methods, which have diverse application scenarios. The technical solutions provided by the embodiments of this application will be described in detail below with reference to some application scenarios. It should be understood that the illustrative examples in these scenario embodiments do not constitute a limitation on the embodiments of this application.
[0099] The video coding process essentially utilizes the spatiotemporal correlation of video content to reduce data redundancy, thereby achieving data compression. Video frames are typically composed of contiguous regions with consistent texture and structure. During encoding, the prediction patterns and partitioning methods of adjacent coding units within a region also usually exhibit continuity. Therefore, the encoded information of spatially adjacent coding units has significant guiding and reference value for the encoding of the current coding unit.
[0100] In this embodiment, when predictive coding is performed on the current coding unit, the coding units in the reference coding blocks to its left and above, as well as the coding units inside the current reference coding block that are arranged in coding order in front of the current coding unit, have been coded. The corresponding coded information can be used to guide the predictive coding of the current coding unit.
[0101] In this embodiment, encoded units of the same size as the current coding unit are determined from the current reference coding block and the reference coding blocks located to the left and above the current reference coding block, respectively, and used as reference coding units. The encoded information of the reference coding units of the same size as the current coding unit in the reference coding blocks to the left and above the current coding unit, as well as the encoded information of the coding units of the same size as the current coding unit within the current reference block, are obtained. Figure 3a As shown, solid boxes represent reference coding blocks, and dashed boxes represent coding units. When performing predictive coding on the current coding unit, the encoded information of the four reference coding units A1, L1, L2, and C1 is obtained to guide the predictive coding of the current coding unit.
[0102] In this embodiment, various types of information about coding units of different sizes within a reference coding block are statistically analyzed, using the reference coding block as the unit. The following provides an illustrative description of the statistically analyzed information.
[0103] The first prediction mode set includes, for example, Merge / Skip modes. A specific inter-frame prediction mode could be a Skip mode. Coarse selection cost information could be, for example, SatdCost. Fine selection cost information could be, for example, RDCost. The prediction coding cost information for the reference unit could be, for example, the RDCost of the optimal mode for the reference unit.
[0104] Among them, SatdCost in Merge / Skip mode is used for fast Merge / Skip mode decision-making, RDCost in Skip mode is used for fast intra-frame / inter-frame residual mode decision-making, and RDCost in optimal mode is used for fast block partitioning mode decision-making. These are described below: (a) Decision-making using the first prediction model set: The first type of inter-frame prediction mode includes Merge mode and Skip mode. Merge / Skip mode is an important technique in video coding and has been widely adopted in many video coding standards (such as HEVC, VVC, etc.). Its basic principle is to use the motion information of adjacent coded blocks to predict the current block, reduce coding bit overhead, and thus improve coding efficiency.
[0105] In this embodiment, the implementation process of the Merge / Skip mode is simplified and mainly divided into two stages: coarse selection and fine selection.
[0106] In this embodiment, as Figure 6 As shown in S61, when performing coarse selection processing of the first prediction mode set for the current coding unit, the Merge mode and Skip mode can be evaluated, and the coarse selection cost information of each candidate can be calculated. The coarse selection cost information can be implemented as SatdCost, for example. In this embodiment, the candidate refers to the motion vector candidate, which is used to characterize the candidate motion parameters of the current coding unit's motion relationship.
[0107] In this embodiment, a neighboring coding unit of the same size as the current coding unit and selected for Merge / Skip mode encoding is used as a reference coding unit. Its encoded information is obtained, including the coarse selection cost information of the reference coding unit, such as SatdCost. Based on this, a first reference cost information is calculated. The first reference cost information can be implemented, for example, as the average value of SatdCost of each reference coding unit. .
[0108] Then, obtain the coarse selection cost information of each candidate after the current coding unit has undergone the Merge / Skip coarse selection process, such as SatdCost, and denot it as... .like Figure 6 As shown in S62, based on the encoded information of the reference coding unit and the cost information in the coarse selection process, it is determined whether to skip the fine selection process of the Merge / Skip mode.
[0109] Specifically, it can be and Compare; if Then this candidate will no longer participate in the selection process. If the SatdCost of all candidates is greater than... If it is determined that the current coding unit is not suitable for the first type of inter-frame prediction mode, then the selection process is skipped directly. If at least one If so, it indicates that the current coding unit is suitable for the first type of inter-frame prediction mode, and based on this, it is determined not to skip the selection process. If the selection process is not skipped, such as... Figure 6 As shown in S63, select The candidates, as the result of the coarse selection, participate in the fine selection process. In the fine selection process, the cost of the candidates is evaluated, and the first prediction model is determined based on the fine selection cost information. It should be noted that the SatdCost of all candidates is greater than... This is merely one implementation method for determining whether the current coding unit is suitable for the first type of inter-frame prediction mode, and is not limited thereto.
[0110] In one example, The calculation formula can be expressed as: in, This indicates the number of reference coding units in the upper base coding block that meet the conditions. This indicates the corresponding SatdCost; This indicates the number of reference coding units in the left-hand base coding block that meet the conditions. This indicates the corresponding SatdCost; This indicates the number of reference coding units that meet the conditions within the current base coding block. This indicates the corresponding SatdCost. and , where is the weighting coefficient, used to characterize the importance of the encoded information in the current reference coding block and adjacent reference coding blocks. In this embodiment, the information provided by adjacent coding units closer to the current coding unit has greater reference value. In one example, here... The value is 3. The value is 2.
[0111] (ii) Decision-making using the fast second prediction model set: Besides the Merge / Skip mode, inter-frame prediction involves many complex coding modes, which typically lead to a significant increase in computational complexity. Especially in the VVC standard, advanced techniques such as Affine Motion Compensation (AMC) and Adaptive Motion Vector Resolution (AMVR) are introduced to further improve compression efficiency. Implementing these techniques usually requires extensive motion estimation and motion compensation calculations to accurately capture and predict the dynamic changes of video frames, thereby improving prediction accuracy. Furthermore, in intra-frame prediction, VVC also introduces a series of high-performance but complex prediction algorithms, such as more refined angle prediction (67 types) and Intra Sub-partition (ISP). While these effectively improve compression performance, they also significantly increase computational complexity. Therefore, this embodiment introduces a fast intra / inter-frame mode decision algorithm that skips the second prediction mode search process in advance based on adjacent encoded information and the prediction modes already attempted by the current coding unit, thereby saving computation and improving coding speed. In this embodiment, the second prediction mode set includes a second type of inter-frame prediction mode and multiple intra-frame prediction modes as an example, but this does not constitute a limitation on this embodiment.
[0112] Specifically, the process involves acquiring selected cost information from neighboring target reference coding units of the same size as the current coding unit and with a selected inter-frame prediction mode, such as the Skip mode, and selected cost information such as RDCost. Then, second reference cost information is calculated, which can be implemented as the average RDCost of the target reference coding units. Furthermore, the target cost information of the current coding unit after the Merge / Skip mode is obtained. The target cost information can be implemented as the selected cost information of the Skip mode, such as RDCost, and denoted as... Based on the target cost information and the second reference cost information, determine whether to skip the search process for the second prediction pattern set.
[0113] Specifically, such as Figure 6 As shown in S64, it can be compared and The size of the value determines whether to skip the search process of the second prediction pattern set in advance. If If so, then skip the search process for the second prediction pattern set; otherwise, if Then, the search process for the second prediction mode set is performed. In this embodiment, taking the second prediction mode set as an example, which includes a second type of inter-frame prediction mode and multiple intra-frame prediction modes, in this case, such as Figure 6 As shown in S65 and S66, a search process for the second type of inter-frame prediction mode is performed to obtain the optimal second type of inter-frame prediction mode. Then, a search process for multiple intra-frame prediction modes is performed to obtain the optimal intra-frame prediction mode. Finally, the better of the optimal second type of inter-frame prediction mode and the optimal intra-frame prediction mode is selected as the second prediction mode. The second prediction mode can be either the second type of inter-frame prediction mode or the intra-frame prediction mode.
[0114] In one example, The calculation formula can be expressed as: in, , , These represent the number of condition-compliant coding units in the upper reference coding block, the left reference coding block, and the current reference coding block, respectively. , , These represent the RDCost of the condition-compliant coding units in the upper reference coding block, the left reference coding block, and the current reference coding block, respectively. and For the weighting coefficients, in one example, The value is 4. The value is 1.
[0115] (III) Fast block partitioning decision: Block partitioning is a crucial step in video coding. Its core principle lies in dynamically dividing the image into coding units of different sizes and shapes based on the complexity of the video content, precisely adapting to the texture and motion features of different regions. This method effectively improves coding flexibility and compression efficiency. Especially in the latest VVC standard, a multi-branch tree partitioning mechanism has been introduced, supporting more diverse block sizes and further improving compression performance, but also significantly increasing coding time. To accelerate the block partitioning process, this embodiment proposes a fast block partitioning mode decision algorithm. This algorithm skips the block partitioning decision process in advance based on the encoded information of adjacent reference coding units of the same size and the predicted mode information already attempted by the current coding unit, thereby improving coding speed. A detailed description follows.
[0116] First, obtain the prediction coding cost information of adjacent reference coding units of the same size, such as the RDCost when the optimal prediction mode is selected, and calculate the third reference information accordingly. For example, the third reference information can be implemented as the average RDCost of the reference coding units. Furthermore, the cost information corresponding to the target prediction mode of the current coding unit is obtained. For example, the cost information corresponding to the target prediction mode can be implemented as the optimal selected cost information of the tried modes. The selected cost information is, for example, RDCost, and is denoted as... Based on the optimal cost information of the tried modes and the third reference cost information, determine whether to skip the block partitioning process for the current coding unit; Specifically, such as Figure 6 As shown in S67, by comparison and The size of the block is used to decide whether to skip the block partitioning process in advance. If the current coding unit can obtain relatively better cost information by encoding based on the optimal selected cost information of the tried modes, then the block partitioning process is skipped; otherwise, if When block partitioning can bring significant cost-benefit processing, then as follows: Figure 6 As shown in S68, block partitioning processing is performed.
[0117] In one example, The calculation formula can be expressed as: in, , , These represent the number of condition-compliant reference coding units in the upper reference block, the left reference block, and the current reference block, respectively. , , These represent the RDCost of the reference coding units that meet the conditions in the upper reference block, the left reference block, and the current reference block, respectively. and These are weighting coefficients. In one example, [the weighting coefficient is missing]. The value is 3. The value is 2.
[0118] In this embodiment, not only is the information carried by the current reference coding block itself mined, but the encoded information of adjacent reference coding blocks is also fully utilized in conjunction with the principle of spatial correlation to guide the current reference coding block to more accurately skip unnecessary mode decision-making processes. In an optional embodiment, based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, auxiliary information is combined to determine whether the current coding unit is suitable for the first type of inter-frame prediction mode. The auxiliary information includes at least one of the prediction mode, prediction direction, and prediction angle selected by adjacent coding units. By introducing auxiliary information such as the prediction mode, prediction direction, or angle of the reference coding unit for joint judgment, the suitability of the current coding unit for the first type of inter-frame prediction mode can be determined more accurately, reducing misjudgments caused by single cost information, improving the accuracy and reliability of skipping the selection process decision, further reducing redundant calculations, and optimizing coding efficiency.
[0119] In addition, in this embodiment, the cost information (such as RDCost and SatdCost) in the actual encoding process is used as the core feature. This can reflect the texture complexity of the current encoding reference block itself, as well as the similarity between the current reference encoding block and the adjacent reference encoding blocks, without bringing additional computational complexity. This is more suitable for application in real-time encoding scenarios.
[0120] The overall performance of the solution in this application embodiment applied to the H.266 encoder live streaming client is as follows: Table 1: In one embodiment, taking the H.266 (VVC) video coding standard as an example, Table 1 shows the parameters for the video encoder, for example... Figure 6 The traditional coding scheme and the proposed technical scheme are compared under the same conditions. Specifically, the same set of test sequences were encoded using both the traditional coding scheme and the proposed technical scheme under the same test conditions, and the quality and speed of the encoding results were statistically analyzed.
[0121] As shown in Table 1, comparative tests were conducted under the Ultrafast encoding configuration. The video encoding method provided in this application maintains a relatively stable encoding quality compared to traditional encoding schemes. Specifically, the changes in BD-rate (Bjøntegaard DeltaRate) for metrics such as Global Peak Signal-to-Noise Ratio (Global PSNR), Structural Similarity Index (SSIM), Video Multimethod Assessment Fusion (VMAF), and VMAF-NEG (Negative VMAF) are all controlled within a small range, indicating that no significant degradation is introduced in terms of subjective or objective quality. Global PSNR and SSIM are objective quality evaluation metrics used to measure the differences between the reconstructed video and the original video in terms of pixel distortion and structural similarity; VMAF and VMAF-NEG are subjective quality evaluation metrics used to reflect the overall quality of the video under conditions close to human visual perception. BD-rate: The rate of change in bitrate under the same objective quality. It is used to measure coding efficiency. A negative value indicates a saving in bitrate, while a positive value indicates an increase in bitrate.
[0122] Based on this, as shown in Table 1, the video coding method provided in this application embodiment achieves an improvement of approximately 7.15% in coding speed. Therefore, it can be seen that the video coding method provided in this application embodiment, by introducing a fast coding decision mechanism, effectively reduces redundant coding calculations and significantly improves coding efficiency while ensuring that coding quality is largely unaffected, demonstrating superior overall performance.
[0123] The performance improvements for the three parts—fast Merge / Skip mode decision, fast intra / inter-frame surplus mode decision, and fast block partitioning mode decision—are as follows: In one embodiment, taking the H.266 (VVC) encoding standard as an example, the performance impact of introducing a fast encoding decision mechanism at different mode decision stages of the video encoding method provided in this application embodiment was tested on a video encoder. Specifically, fast Merge / Skip mode decision, fast intra-frame / inter-frame residual mode decision, and fast block partitioning mode decision were enabled respectively, and compared with traditional encoding schemes without the corresponding fast decision mechanism enabled. The test results are shown in Table 2.
[0124] As shown in Table 2, when the fast Merge / Skip mode decision is enabled, the coding quality indicators remain basically stable, and the coding speed is improved by about 1.05%; when the fast intra-frame / inter-frame remainder mode decision is enabled, the coding speed is improved by about 3.50%; and when the fast block partitioning mode decision is enabled, the coding speed is improved by about 2.50%. The changes in coding quality at each stage are all within an acceptable range.
[0125] It is evident that this technical solution can improve coding efficiency by skipping redundant calculations in different mode decision-making stages, while ensuring that coding quality is not significantly affected. The synergistic effect of various fast decision-making mechanisms is conducive to improving overall coding performance.
[0126] In one optional embodiment, the video encoding method provided in the above embodiments is applied to a real-time video live streaming scenario. The live streaming system includes a broadcaster, a server, and a user, which communicate and cooperate to complete the acquisition, encoding, transmission, and playback of live video. The broadcaster can be a mobile terminal, a camera device, or other terminal device with video acquisition capabilities, used to continuously acquire video images and form video frame data during the live stream; the broadcaster uploads the video frame data to the server.
[0127] In this embodiment, the server receives video frame data uploaded by the broadcaster and performs encoding processing on the video frames using a deployed video encoder to generate a bitstream. When encoding any current video frame, the encoder obtains the current coding unit to be encoded and determines a reference coding unit that matches the current coding unit from the already encoded units of the current video frame, obtaining the encoded information of the reference coding unit. In this embodiment, the current reference coding block to which the current coding unit belongs can be determined, and the already encoded units of the same size as the current coding unit can be determined from the current reference coding block and the reference coding blocks located to its left and above as reference coding units.
[0128] Furthermore, the encoder performs a coarse selection process on the first prediction mode set for the current coding unit to obtain coarse selection cost information, and determines whether to skip the fine selection process on the first prediction mode set by combining the encoded information of the reference coding unit: if skipped, the target cost information corresponding to the first prediction mode set is obtained; if not skipped, the fine selection process is performed to obtain the first prediction mode and its cost information.
[0129] Furthermore, the encoder determines whether to skip the search process for the second prediction mode set based on the encoded information of the reference coding unit and the target cost information (or the cost information corresponding to the first prediction mode): if not skipped, the search process for the second prediction mode set is performed to obtain the second prediction mode, and the second prediction mode is selected as the target prediction mode; if skipped, the first prediction mode can be used as the target prediction mode. When the target prediction mode is determined, the encoder determines whether to skip the block partitioning process based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode: if skipped, video encoding of the current coding unit is performed directly according to the target prediction mode; if not skipped, block partitioning is performed and the target partitioning method is determined. If the cost information of the target partitioning method is not better than the cost information corresponding to the target prediction mode, the target prediction mode is still used for encoding; otherwise, the sub-coding units obtained from the partitioning are encoded separately. After completing the encoding of the current video frame, the server generates the corresponding bitstream. The bitstream can be stored and transmitted to the user terminal via the network. The user terminal can be an electronic device such as a mobile terminal, computer, or smart TV, used to receive the bitstream sent by the server, decode the bitstream to obtain the decoded video frame, and play it.
[0130] In an optional scenario embodiment, in addition to encoding video data on the server side, video encoding processing can also be completed on the broadcaster's end. Specifically, after collecting video data, the broadcaster encodes the video data based on the video encoding method provided in this application embodiment, and uploads the encoded bitstream to the server side; after receiving the bitstream, the server side can either directly push the stream according to the user's playback request, or decode the bitstream and re-encode it before sending it to the user side.
[0131] It should be understood that regardless of whether the video encoding process is performed on the broadcaster's end, the server end, or other nodes with encoding capabilities, as long as the video encoding process is involved, the video encoding method provided in the embodiments of this application can be used.
[0132] This application provides a method for transmitting a bit stream, comprising: performing any of the video encoding methods provided in this application to output a bit stream, and transmitting the bit stream.
[0133] This application provides a method for storing a bitstream, comprising: performing any of the video encoding methods provided in this application to output a bitstream, and storing the bitstream.
[0134] The detailed implementation methods and beneficial effects of each step in this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated here.
[0135] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 101 to 103 can be device A; or the execution subject of steps 101 and 102 can be device A, and the execution subject of step 103 can be device B; and so on.
[0136] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0137] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device includes a memory 74 and a processor 75.
[0138] Memory 74 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, data structures, contact data, phone book data, messages, pictures, videos, etc.
[0139] Processor 75, coupled to memory 74, is configured to execute a computer program in memory 74 for: acquiring a current coding unit to be encoded in the current video frame, and determining a reference coding unit adapted to the current coding unit from the encoded units of the current video frame; performing a coarse selection process of a first prediction mode set for the current coding unit, the result of which is used to participate in a fine selection process of the first prediction mode set to obtain a first prediction mode; if it is determined to skip the fine selection process based on the encoded information of the reference coding unit and the cost information in the coarse selection process, then acquiring target cost information corresponding to the first prediction mode set; if it is determined not to skip the search process of a second prediction mode set based on the encoded information of the reference coding unit and the target cost information, then performing a search process of the second prediction mode set to obtain a second prediction mode, and selecting the second prediction mode as the target prediction mode; if it is determined to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, then performing video encoding processing on the current coding unit according to the target prediction mode.
[0140] For detailed implementation of each of the above processes, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0141] Furthermore, such as Figure 7 As shown, the electronic device also includes other components such as a communication component 76, a display 77, a power supply component 78, and an audio component 79. Figure 7 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 7 The components shown. Additionally... Figure 7 The components within the dashed box are optional, not mandatory, and their specific requirements depend on the product form of the electronic device. The electronic device in this embodiment can be a terminal device such as a desktop computer, laptop computer, smartphone, or IoT device, or a server-side device such as a conventional server, cloud server, or server array. If the electronic device in this embodiment is a terminal device such as a desktop computer, laptop computer, or smartphone, it may include... Figure 7 The components within the dashed box; if the electronic device in this embodiment is implemented as a conventional server, cloud server, or server array, etc., it may be omitted. Figure 7 The component within the dashed box.
[0142] This application also provides an electronic device, the implementation structure of which is similar to... Figure 7 The implementation structure of the electronic devices shown is the same or similar, and can be referred to accordingly. Figure 7 The structure of the electronic device shown is implemented. The electronic device provided in this embodiment is similar to... Figure 7The main difference between the electronic devices in the illustrated embodiments lies in the different functions implemented by the processor executing the computer program stored in the memory. For the electronic device provided in this embodiment, the processor executing the computer program stored in the memory can be used to: obtain the current coding unit to be encoded in the current video frame, and determine a reference coding unit adapted to the current coding unit from the already encoded units of the current video frame; perform a coarse selection process of a first prediction mode set for the current coding unit, the result of which is used to participate in a fine selection process of the first prediction mode set to obtain a first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information in the coarse selection process, not to skip the fine selection process, then perform the fine selection process to obtain the first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, to skip the search process of the second prediction mode set, and select the first prediction mode as the target prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then perform video encoding processing on the current coding unit according to the target prediction mode.
[0143] For detailed implementation of each of the above processes, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0144] This application also provides an electronic device, the implementation structure of which is similar to... Figure 7 The implementation structure of the electronic devices shown is the same or similar, and can be referred to accordingly. Figure 7 The structure of the electronic device shown is implemented. The electronic device provided in this embodiment is similar to... Figure 7The main difference between the electronic devices in the illustrated embodiments lies in the different functions implemented by the processor executing the computer programs stored in the memory. For the electronic device provided in this embodiment, its processor executes a computer program stored in its memory, which can be used to: obtain the current coding unit to be encoded in the current video frame, and determine a reference coding unit adapted to the current coding unit from the already encoded units of the current video frame; perform a coarse selection process of a first prediction mode set for the current coding unit, the result of which is used to participate in a fine selection process of the first prediction mode set to obtain a first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information in the coarse selection process, not to skip the fine selection process, then perform the fine selection process to obtain the first prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, not to skip the search process of the second prediction mode set, then perform a search process of the second prediction mode set to obtain a second prediction mode; select the target prediction mode from the first prediction mode and the second prediction mode; if it is determined, based on the already encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then perform video encoding processing on the current coding unit according to the target prediction mode.
[0145] For detailed implementation of each of the above processes, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0146] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0147] The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.
[0148] The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen can be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.
[0149] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0150] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0151] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile components, or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium. Accordingly, this application also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above method embodiments.
[0152] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0153] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A video encoding method, characterized in that, include: Obtain the current coding unit to be encoded in the current video frame, and determine the reference coding unit that matches the current coding unit from the already encoded units in the current video frame; For the current coding unit, a coarse selection process of the first prediction mode set is performed, and the result of the coarse selection process is used to participate in the fine selection process of the first prediction mode set to obtain the first prediction mode. If it is determined to skip the fine selection process based on the encoded information of the reference coding unit and the cost information in the coarse selection process, then the target cost information corresponding to the first prediction mode set is obtained. If it is determined, based on the encoded information of the reference coding unit and the target cost information, that the search process of the second prediction mode set should not be skipped, then the search process of the second prediction mode set is performed to obtain the second prediction mode, and the second prediction mode is selected as the target prediction mode. If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then video coding processing is performed on the current coding unit according to the target prediction mode.
2. The method according to claim 1, characterized in that, Also includes: If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, that the block partitioning process for the current coding unit should not be skipped, then the block partitioning process is executed to attempt to partition the current coding unit and determine the target partitioning method. If the cost information of the target partitioning method is greater than or equal to the cost information corresponding to the target prediction mode, then the current coding unit is subjected to video coding processing according to the target prediction mode. If the cost information of the target partitioning method is less than the cost information corresponding to the target prediction mode, then video coding processing is performed on the sub-coding units partitioned according to the target partitioning method.
3. The method according to claim 1 or 2, characterized in that, Also includes: If it is determined, based on the encoded information of the reference coding unit and the cost information in the coarse selection process, that the fine selection process should not be skipped, then the fine selection process is executed to obtain the first prediction mode. If it is determined to skip the search process of the second prediction mode set based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, the first prediction mode is taken as the target prediction mode. as well as The operation determines whether to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode.
4. The method according to claim 3, characterized in that, Also includes: If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, that the search process of the second prediction mode set should not be skipped, then the search process of the second prediction mode set is executed to obtain the second prediction mode. Select the target prediction mode from the first prediction mode and the second prediction mode; as well as The operation determines whether to skip the block partitioning process for the current coding unit based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode.
5. The method according to claim 1, 2, or 4, characterized in that, The first prediction mode set includes a first type of inter-frame prediction mode, and the second prediction mode set includes a second type of inter-frame prediction mode and multiple intra-frame prediction modes; The first type of inter-frame prediction mode refers to an inter-frame prediction mode that only supports motion compensation, while the second type of inter-frame prediction mode refers to an inter-frame prediction mode that supports both motion estimation and motion compensation.
6. The method according to claim 5, characterized in that, The encoded information of the reference coding unit includes: the coarse selection cost information of the reference coding unit; the method further includes: The determination of whether to skip the fine selection process is based on the encoded information of the reference coding unit and the cost information in the coarse selection process, specifically: Calculate the first reference cost information based on the coarse selection cost information of the reference coding unit; Based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, determine whether the current coding unit is suitable for the first type of inter-frame prediction mode. If it is determined that the current coding unit is not suitable for the first type of inter-frame prediction mode, then the selection process is skipped. If it is determined that the current coding unit is suitable for the first type of inter-frame prediction mode, then it is determined not to skip the selection process.
7. The method according to claim 6, characterized in that, The encoded information of the reference coding unit also includes at least one of the following auxiliary information: the prediction mode, prediction direction, and angle corresponding to the reference coding unit; Based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, determine whether the current coding unit is suitable for the first type of inter-frame prediction mode, including: Based on the coarse selection cost information of each motion vector candidate corresponding to the current coding unit and the first reference cost information, combined with the at least one auxiliary information, it is determined whether the current coding unit is suitable for the first type of inter-frame prediction mode.
8. The method according to claim 5, characterized in that, The encoded information of the reference coding unit includes: selected cost information when the reference coding unit selects the first type of inter-frame prediction mode; the method further includes: The process of skipping the search for the second prediction mode set is determined based on the encoded information of the reference coding unit and the target cost information, specifically as follows: A target reference coding unit with a specific inter-frame prediction mode is selected from the reference coding units, wherein the specific inter-frame prediction mode is one of the first type of inter-frame prediction modes; The second reference cost information is calculated based on the selected cost information when the target reference coding unit selects a specific inter-frame prediction mode. If the target cost information is less than the second reference cost information, then it is determined to skip the search process of the second prediction pattern set; If the target cost information is greater than or equal to the second reference cost information, then it is determined that the search process for the second prediction pattern set will not be skipped.
9. The method according to claim 5, characterized in that, The encoded information of the reference coding unit includes: the predictive coding cost information corresponding to the encoding of the reference coding unit; the method further includes: Based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, it is determined whether to skip the block partitioning process for the current coding unit, specifically as follows: The third reference cost information is calculated based on the predictive coding cost information corresponding to the reference coding unit; If the cost information corresponding to the target prediction mode is less than the third reference cost information, it is determined to skip the block partitioning process for the current coding unit. If the cost information corresponding to the target prediction mode is greater than or equal to the third reference cost information, it is determined that the block partitioning process for the current coding unit will not be skipped.
10. The method according to any one of claims 1-2, 4, 6-9, characterized in that, From the encoded units of the current video frame, determine the reference coding unit that is compatible with the current coding unit, including: Determine the current base coding block to which the current coding unit belongs; From the current reference coding block and the reference coding blocks located to the left and above the current reference coding block, respectively, we determine the coded units with the same size as the current coding unit, and use them as the reference coding units.
11. A video encoding method, characterized in that, include: Obtain the current coding unit to be encoded in the current video frame, and determine the reference coding unit that matches the current coding unit from the already encoded units in the current video frame; For the current coding unit, a coarse selection process of the first prediction mode set is performed, and the result of the coarse selection process is used to participate in the fine selection process of the first prediction mode set to obtain the first prediction mode. If it is determined, based on the encoded information of the reference coding unit and the cost information in the coarse selection process, that the fine selection process should not be skipped, then the fine selection process is executed to obtain the first prediction mode. If it is determined to skip the search process of the second prediction mode set based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, the first prediction mode is selected as the target prediction mode. If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then video coding processing is performed on the current coding unit according to the target prediction mode.
12. A video encoding method, characterized in that, include: Obtain the current coding unit to be encoded in the current video frame, and determine the reference coding unit that matches the current coding unit from the already encoded units in the current video frame; For the current coding unit, a coarse selection process of the first prediction mode set is performed, and the result of the coarse selection process is used to participate in the fine selection process of the first prediction mode set to obtain the first prediction mode. If it is determined, based on the encoded information of the reference coding unit and the cost information in the coarse selection process, that the fine selection process should not be skipped, then the fine selection process is executed to obtain the first prediction mode. If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the first prediction mode, that the search process of the second prediction mode set is not skipped, the search process of the second prediction mode set is executed to obtain the second prediction mode. Select the target prediction mode from the first prediction mode and the second prediction mode; If it is determined, based on the encoded information of the reference coding unit and the cost information corresponding to the target prediction mode, to skip the block partitioning process for the current coding unit, then video coding processing is performed on the current coding unit according to the target prediction mode.
13. A method for transmitting a bit stream, characterized in that, include: Perform the video encoding method according to any one of claims 1-10, 11 or 12 to output a bit stream, and transmit the bit stream.
14. A method for storing a bit stream, characterized in that, include: Perform the video encoding method according to any one of claims 1-10, 11 or 12 to output a bitstream, and store the bitstream.
15. An electronic device, characterized in that, include: A processor and a memory; the memory stores a computer program, and the processor, after running the computer program, performs the method according to any one of claims 1-10, 11, 12, 13 or 14.
16. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, performs the method described in any one of claims 1-10, 11, 12, 13, or 14.
17. A computer program product, characterized in that, include: Computer instructions, when executed by a processor, perform the method described in any one of claims 1-10, 11, 12, 13, or 14.