Intra prediction method and device for video coding, storage medium and electronic device
By determining the predicted reconstructed pixels for video coding using a linear prediction model, calculating the rate-distortion cost, and selecting an intra-frame prediction mode below a threshold, the problem of inaccurate intra-frame prediction in existing technologies is solved, achieving more efficient video coding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU WEIMING XINKE TECH CO LTD
- Filing Date
- 2022-01-27
- Publication Date
- 2026-05-12
AI Technical Summary
In existing video coding technologies, the accuracy of intra-frame prediction is low. It is impossible to obtain reconstructed pixels in advance for prediction after the mode decision is completed, resulting in inaccurate intra-frame prediction.
A linear prediction model based on original pixels and quantization parameters is adopted. The predicted reconstructed pixels of the coding tree unit are determined by the preset model, and the rate-distortion cost of the intra-frame prediction mode is calculated based on the predicted reconstructed pixels. The mode with a rate-distortion cost less than the threshold is selected as the target intra-frame prediction mode set.
提高了视频编码的帧内预测准确性,解决了在模式决策过程中无法提前获得重构像素的问题,简化了硬件实现,提升了帧内预测效率。
Smart Images

Figure CN114630114B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to an intra-frame prediction method and apparatus for video coding, a storage medium, and an electronic device. Background Technology
[0002] In video coding, intra-frame prediction effectively eliminates spatial redundancy and is a crucial component. To achieve more accurate intra-frame predictions and smaller prediction residuals, current mainstream video coding standards employ multiple prediction modes for the intra-frame prediction process. The mode decision-making process consists of two steps: Rough Mode Decision (RMD) and mode selection. The RMD process selects N modes from 33 intra-frame prediction modes to proceed to the next step, rate-distortion optimization mode decision. For ease of hardware implementation, current RMD uses 64x64 LCUs as units, selecting nearby and internal raw pixels of the LCU itself as reference pixels for each Coding Unit (CU) for prediction. Compared to coding standards that use reconstructed pixels around the CU as reference pixels for calculation, this method cannot accurately predict video frames intra-frame. Summary of the Invention
[0003] This invention provides a method and apparatus for intra-frame prediction in video coding, a storage medium, and an electronic device to at least solve the technical problem of low accuracy in intra-frame prediction of video coding.
[0004] According to one aspect of the present invention, an intra-frame prediction method for video coding is provided, comprising: obtaining raw pixels and quantization parameters qp required for a coarse mode selection (RMD) of the current video frame; determining the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the raw pixels and qp using a preset linear prediction model; determining the rate-distortion cost of the intra-frame prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels; and selecting at least one intra-frame prediction mode with a rate-distortion cost less than a preset threshold as a set of target intra-frame prediction modes for each PU.
[0005] According to another aspect of the present invention, an intra-frame prediction apparatus for video coding is also provided, comprising: an acquisition unit for acquiring raw pixels and quantization parameters qp required for coarse mode selection (RMD) of the current video frame; a first determination unit for determining the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the raw pixels and qp using a preset linear prediction model; a second determination unit for determining the rate-distortion cost of the intra-frame prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels; and a third determination unit for selecting at least one intra-frame prediction mode with a rate-distortion cost less than a preset threshold as a set of target intra-frame prediction modes for each PU.
[0006] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute the above-described video coding intra-frame prediction method through the computer program.
[0007] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the above-described intra-frame prediction method for video encoding at runtime.
[0008] In this embodiment of the invention, a method is employed to determine the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the original pixels and qp using a preset linear prediction model; to determine the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels; and to use at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU. In this method, since the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame are determined based on the original pixels and qp using a preset linear prediction model, the problem of obtaining reconstructed pixels without needing to complete mode decision (MD) in the video coding pipeline is not only solved, but the accuracy of intra-prediction in video coding is also improved. Attached Figure Description
[0009] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0010] Figure 1 This is a schematic diagram of an application environment for an optional intra-frame prediction method for video coding according to an embodiment of the present invention;
[0011] Figure 2This is a schematic diagram of an application environment for another optional intra-frame prediction method for video coding according to an embodiment of the present invention;
[0012] Figure 3 This is a schematic diagram of a video encoding process in an optional related technology according to an embodiment of the present invention;
[0013] Figure 4 This is a flowchart illustrating an optional intra-frame prediction method for video coding according to an embodiment of the present invention.
[0014] Figure 5 This is a schematic diagram of reconstructed pixels of an optional intra-frame prediction method for video coding according to an embodiment of the present invention;
[0015] Figure 6 This is a schematic diagram illustrating mode selection for another optional intra-frame prediction method for video coding according to an embodiment of the present invention;
[0016] Figure 7 This is a flowchart illustrating another optional video coding intra-frame prediction method according to an embodiment of the present invention;
[0017] Figure 8 This is a schematic diagram of the structure of an optional intra-frame prediction device for video coding according to an embodiment of the present invention;
[0018] Figure 9 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0019] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0020] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0021] According to one aspect of the present invention, an intra-frame prediction method for video coding is provided. Optionally, as an alternative implementation, the above-described intra-frame prediction method for video coding can be applied, but is not limited to, to applications such as... Figure 1 The application environment shown includes: a terminal device 102 for user interaction, a network 104, and a server 106. User 108 can interact with terminal device 102, which runs an intra-frame prediction application with video encoding. Terminal device 102 includes a human-computer interaction screen 1022, a processor 1024, and a memory 1026. The human-computer interaction screen 1022 is used to obtain the target intra-frame prediction mode set; the processor 1024 is used to obtain the raw pixels and quantization parameters qp required for the coarse mode selection (RMD) of the current video frame; and the memory 1026 is used to store the target intra-frame prediction mode set.
[0022] Furthermore, server 106 includes database 1062 and processing engine 1064. Database 1062 stores the aforementioned target intra-prediction mode set. Processing engine 1064 determines the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the original pixels and qp using a preset linear prediction model; determines the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels; selects at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU; and sends the target intra-prediction mode set for each PU to the client of terminal device 102.
[0023] In one or more embodiments, the intra-frame prediction method for video coding described above in this application can be applied to... Figure 2 The application environment shown. For example... Figure 2As shown, user 202 and user equipment 204 can interact with each other. User equipment 204 includes memory 206 and processor 208. In this embodiment, user equipment 204 can, but is not limited to, referencing and executing the operations performed by terminal device 102 to obtain the target intra-frame prediction mode set for each PU.
[0024] Optionally, the terminal device 102 and user device 204 mentioned above include, but are not limited to, mobile phones, tablets, laptops, PCs, in-vehicle electronic devices, wearable devices, and other terminals. The network 104 mentioned above may include, but is not limited to, wireless networks or wired networks. The wireless network includes Wi-Fi and other networks that enable wireless communication. The wired network may include, but is not limited to, wide area networks (WANs), metropolitan area networks (MANs), and local area networks (LANs). The server 106 mentioned above may include, but is not limited to, any hardware device capable of computing. The server may be a single server, a server cluster consisting of multiple servers, or a cloud server. The above is merely an example, and no limitations are imposed in this embodiment.
[0025] like Figure 3 As shown, in the coding standards of related technologies, the RMD mode is extracted as a separate pipeline stage. Each CU will use the reconstructed pixels of the surrounding CUs that have been coded as reference pixels to perform intra-frame prediction. Under this pipeline arrangement, the reconstructed pixels can only be obtained after the mode decision (MD) is completed. Therefore, the RMD mode cannot obtain the reconstructed pixels in advance to perform intra-frame prediction.
[0026] To address the aforementioned technical problems, as an optional implementation method, such as Figure 4 As shown, this embodiment of the invention provides an intra-frame prediction method for video coding, including the following steps:
[0027] S402, obtain the raw pixels and quantization parameters qp required for the coarse mode selection RMD of the current video frame.
[0028] Specifically, based on the coarse mode selection of video frames, the raw pixels and quantization parameters qp required for RMD are used to obtain the reconstructed pixels of the CUs that have been encoded around each CU.
[0029] S404, based on the above original pixels and qp, determine the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame through a preset linear prediction model.
[0030] Here, the preset linear prediction model includes, but is not limited to, a trained linear model that predicts reconstructed pixels from the original pixels.
[0031] S406, Based on the above-mentioned predicted reconstructed pixels, determine the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame.
[0032] In this embodiment of the invention, the reconstructed pixels of the CUs that have been encoded around each CU are obtained through the above-mentioned preset linear prediction model. Then, the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) can be used to obtain the rate-distortion cost of multiple intra-prediction modes in the RMD mode of the current video frame.
[0033] S408, take at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU.
[0034] Specifically, after obtaining the rate-distortion cost of multiple intra-prediction modes, a preset threshold is set according to the needs of the current application scenario to obtain one or more intra-prediction modes with a rate-distortion cost less than the preset threshold as the target intra-prediction mode set for each PU.
[0035] In this embodiment of the invention, a method is employed to determine the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the original pixels and qp using a preset linear prediction model; to determine the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels; and to use at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU. In this method, since the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame are determined based on the original pixels and qp using a preset linear prediction model, the problem of obtaining reconstructed pixels without needing to complete mode decision (MD) in the video coding pipeline is not only solved, but the accuracy of intra-prediction in video coding is also improved.
[0036] In one or more embodiments, the above-mentioned determination of the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the original pixels and qp using a preset linear estimation model includes:
[0037] The predicted reconstructed pixel of each CU in each coding tree unit (CTU) in the current frame is determined by the following formula:
[0038]
[0039] Among them, Rec CTU (x, y) represents the reconstructed pixels surrounding the current CTU, Org CTU (x, y) represents the original pixels of the current CTU, Org CU (x, y) represents the original pixel of the current encoded CU in the current CTU, α and β are the fitting parameters, margin is the quantization parameter qp preset threshold, and F(O) is the fitted predicted reconstructed pixel.
[0040] In embodiments of the present invention, such as Figure 5 As shown, the fitted samples are selected from the reconstructed pixels and original pixels of the CTU above and to the left of the CU of the current 4x4 size encoding, while the reconstructed pixels around the CTU have already been obtained. When the qp is large, that is, the quantization step size is large, the accuracy of the fitted pixels is low. Therefore, when the value is below the margin, the fitted method is used to obtain the reconstructed pixels, and when the value is greater than or equal to the preset threshold margin, the original pixels are used directly for prediction.
[0041] In one or more embodiments, the rate-distortion cost of determining the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels includes:
[0042] Using the above-mentioned predicted reconstructed pixels as reference pixels, the rate-distortion cost of the intra-prediction mode of each prediction unit PU in the current video frame is determined by formula (1).
[0043] J=λ·R+D (1)
[0044] Where λ is the Lagrange multiplier, R is the code rate required for encoding, D is the distortion error, and J is the calculated rate-distortion cost;
[0045] In the third-generation audio and video coding standard AVS3, the R value of intra-frame prediction is determined based on the MPM, as shown in formula (2). When the current mode is equal to MPM0 or MPM1, the R value is 2, otherwise it is 6. The MPM value is determined based on the encoded blocks on the left and top sides. In the existing coding process, this part has not yet been completed, so the MPM value cannot be obtained in advance, and therefore the R value cannot be obtained.
[0046]
[0047] In this embodiment of the invention, in formula (1), the above-mentioned R is obtained through formula (3), and can be used as the value of R to accurately calculate the rate distortion cost.
[0048] R = log2(mode + 1) + 1 (3)
[0049] Where mode is the value of the current intra-frame prediction mode.
[0050] In one or more embodiments, the rate-distortion cost of determining the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels further includes:
[0051] Iterate through each prediction unit (PU) in the current video frame and perform the following operation until the rate-distortion cost of the intra-prediction mode for each prediction unit in the current video frame is obtained:
[0052] The rate-distortion cost of the intra-prediction mode of any two determined PUs is used as the rate-distortion cost of the intra-prediction mode of the parent PU of any two PUs.
[0053] In embodiments of the present invention, the method of estimating the rate-distortion cost of a large-size PU by using small-size PUs to splice upwards is included, but is not limited to. For example, the rate-distortion cost of each mode of an 8x4 PU can be obtained by adding the rate-distortion costs of the corresponding modes of the two 4x4 PUs it contains. The above-mentioned technical means can reduce the number of circuits for video encoding and save hardware resources.
[0054] In one or more embodiments, the above-mentioned at least one intra-prediction mode with a rate-distortion cost less than a preset threshold is used as the target intra-prediction mode set for each PU, including:
[0055] For a subset of PUs partitioned by a quadtree, if there is a PU in the subset whose target intra-prediction mode set has not been determined, the intersection of the target intra-prediction mode sets of the other three PUs in the subset is taken as the target intra-prediction mode set of the PU in the subset.
[0056] In this embodiment of the invention, the rate-distortion cost of 33 intra-frame prediction modes for each size of PU is sorted to obtain N modes with a rate-distortion cost less than a preset threshold, which are then saved and output. Specifically, for a 16x16 PU with quadtree-partitioned modes, to reduce sorting time, the mode used for sorting the bottom-right PU (the fourth PU processed) is selected based on the modes chosen by the top-left, top-right, and left-side PUs. Referring to the modes ultimately selected by these three PUs, they are used as candidates for final sorting, resulting in N modes, such as... Figure 6 As shown, the candidate modes for PU3 will be obtained from PU0 to PU2.
[0057] In one or more embodiments, the value of the above margin is 30.
[0058] In one or more embodiments, after taking at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU, the method further includes: outputting the target intra-prediction mode set for each PU.
[0059] Based on the above embodiments, such as Figure 7 As shown in one application embodiment, the above-described intra-frame prediction method for video coding further includes the following steps:
[0060] S702, acquire reference pixels and reference information (i.e., the raw pixels and quantization parameters qp required for the coarse mode selection RMD of the current video frame).
[0061] S704 analyzes the parameter information and fits a linear model.
[0062] S706, input the reference pixel into the above-mentioned fitted linear model for calculation, and obtain the fitted reconstructed pixel.
[0063] S708, calculate the rate-distortion cost of a 4x4 PU.
[0064] S710 calculates the rate distortion cost of a PU larger than a 4x4 PU.
[0065] S712 sorts the intra-prediction modes of each PU size according to rate-distortion cost.
[0066] S714, take at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU.
[0067] The embodiments of the present invention also have the following beneficial effects:
[0068] 1. The embodiments of the present invention are not only easy to implement in hardware, but also can meet the purpose of parallel computing of the RMD module.
[0069] 2. The embodiments of the present invention can improve the efficiency of intra-frame prediction. Compared with directly using the original pixel as the reference pixel, the embodiments of the present invention can use the composite pixel that is closer to the reconstructed pixel as the reference pixel, and finally obtain more accurate results when performing RMD.
[0070] 3. Reducing the time required for sorting operations can shorten the process of obtaining the intra-prediction sorting pattern of one of the CUs partitioned by the quadtree.
[0071] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0072] According to another aspect of the present invention, an intra-frame prediction apparatus for implementing the above-described intra-frame prediction method for video coding is also provided. For example... Figure 8 As shown, the device includes:
[0073] Acquisition unit 802 acquires the raw pixels and quantization parameters qp required for the coarse mode selection RMD of the current video frame;
[0074] The first determining unit 804 is used to determine the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the original pixels and qp using a preset linear prediction model.
[0075] The second determining unit 806 is used to determine the rate-distortion cost of the intra-frame prediction mode of each prediction unit PU in the current video frame based on the above-mentioned predicted reconstructed pixels.
[0076] The third determining unit 808 is used to take at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each of the above PUs.
[0077] In this embodiment of the invention, a method is employed to determine the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame based on the original pixels and qp using a preset linear prediction model; to determine the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels; and to use at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU. In this method, since the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame are determined based on the original pixels and qp using a preset linear prediction model, the problem of obtaining reconstructed pixels without needing to complete mode decision (MD) in the video coding pipeline is not only solved, but the accuracy of intra-prediction in video coding is also improved.
[0078] In one or more embodiments, the first determining unit 804 specifically includes:
[0079] The first determining module is used to determine the predicted reconstructed pixel of each CU in each coding tree unit (CTU) in the current frame using the following formula:
[0080]
[0081] Among them, Rec CTU (x, y) represents the reconstructed pixels surrounding the current CTU, Org CTU (x, y) represents the original pixels of the current CTU, Org CU (x, y) represents the original pixel of the current encoded CU in the current CTU, α and β are the fitting parameters, margin is the quantization parameter qp preset threshold, and F(O) is the fitted predicted reconstructed pixel.
[0082] In one or more embodiments, the second determining unit 806 specifically includes:
[0083] The second determining module is used to take the above-mentioned predicted and reconstructed pixels as reference pixels and determine the rate-distortion cost of the intra-prediction mode of each prediction unit PU in the current video frame using formula (1); J=λ·R+D (1)
[0084] Where λ is the Lagrange multiplier, R is the code rate required for encoding, D is the distortion error, and J is the calculated rate-distortion cost;
[0085] In formula (1), the above R is obtained through formula (2);
[0086] R = log2(mode + 1) + 1 (2)
[0087] Where mode is the value of the current intra-frame prediction mode.
[0088] In one or more embodiments, the second determining unit 806 further includes:
[0089] The traversal module iterates through each prediction unit (PU) in the current video frame, performing the following operations until the rate-distortion cost of the intra-prediction mode for each prediction unit in the current video frame is obtained:
[0090] The third determining module is used to take the rate-distortion cost of the intra-prediction mode of any two determined PUs as the rate-distortion cost of the intra-prediction mode of the parent PU of the above two PUs.
[0091] In one or more embodiments, the third determining unit 808 specifically includes:
[0092] The fourth determination module is used to determine the target intra-prediction mode set of the other three PUs in the quadtree-partitioned PU subset when there is a pending PU in the PU subset whose target intra-prediction mode set has not been determined.
[0093] In one or more embodiments, the value of the margin in the above-described video coding intra-frame prediction apparatus is 30.
[0094] In one or more embodiments, the above-described intra-frame prediction apparatus for video coding further includes:
[0095] The output unit is used to output the target intra-frame prediction mode set for each of the above PUs.
[0096] According to another aspect of the present invention, an electronic device for implementing the above-described intra-frame prediction method for video coding is also provided. This electronic device may be... Figure 9 The terminal device or server shown. This embodiment uses this electronic device as an example for illustration. Figure 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps of any of the above method embodiments through the computer program.
[0097] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0098] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0099] S1, obtain the raw pixels and quantization parameters qp required for the coarse mode selection RMD of the current video frame;
[0100] S2, based on the above original pixels and qp, determine the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame through a preset linear prediction model;
[0101] S3, determine the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the above-mentioned predicted reconstructed pixels.
[0102] S4, take at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU.
[0103] Alternatively, as those skilled in the art will understand, Figure 9 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 9 This does not limit the structure of the aforementioned electronic devices or electronic equipment. For example, electronic devices or electronic equipment may also include components that are more... Figure 9 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 9 The different configurations shown.
[0104] The memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the video coding intra-frame prediction method and apparatus in this embodiment of the invention. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, thereby realizing the aforementioned video coding intra-frame prediction method. The memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include memory remotely located relative to the processor 904, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 902 may be used, but is not limited to, to store information such as a target intra-frame prediction mode set. As an example, such as... Figure 9 As shown, the memory 902 may include, but is not limited to, the acquisition unit 802, the first determination unit 804, the second determination unit 806, and the third determination unit 808 from the intra-frame prediction device for video encoding. Furthermore, it may include, but is not limited to, other module units from the intra-frame prediction device for video encoding, which will not be elaborated upon in this example.
[0105] Optionally, the transmission device 906 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 906 includes a Network Interface Controller (NIC), which can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 906 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0106] In addition, the aforementioned electronic device also includes: a display 908 for displaying the aforementioned target intra-frame prediction mode set; and a connection bus 910 for connecting the various module components in the aforementioned electronic device.
[0107] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0108] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the intra-frame prediction method for video coding described above, wherein the computer program is configured to execute the steps of any of the method embodiments described above during runtime.
[0109] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:
[0110] S1, obtain the raw pixels and quantization parameters qp required for the coarse mode selection RMD of the current video frame;
[0111] S2, based on the above original pixels and qp, determine the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame through a preset linear prediction model;
[0112] S3, determine the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the above-mentioned predicted reconstructed pixels.
[0113] S4, take at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU.
[0114] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0115] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0116] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention.
[0117] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0120] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0121] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An intra-frame prediction method for video coding, characterized in that, include: Obtain the raw pixels and quantization parameter qp required for the coarse mode selection RMD of the current video frame; Based on the original pixels and qp, the predicted reconstructed pixels of each coding tree unit (CTU) in the current frame are determined using a preset linear prediction model, including: determining the predicted reconstructed pixels of each CU in each coding tree unit (CTU) of the current frame using the following formula: in, For the reconstructed pixels around the current CTU, The original pixels of the current CTU, The original pixels of the currently encoded CU in the current CTU. , Here, qp is the fitting parameter, and margin is the preset threshold for the quantization parameter qp. Reconstruct pixels for the fitted prediction; The rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame is determined based on the predicted reconstructed pixels. At least one intra-prediction mode with a rate-distortion cost less than a preset threshold is taken as the target intra-prediction mode set for each PU.
2. The method according to claim 1, characterized in that, The step of determining the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels includes: Using the predicted reconstructed pixel as a reference pixel, the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame is determined by formula (1). (1) in, R is the Lagrange multiplier, D is the required code rate, and J is the distortion error. In formula (1), R is obtained through formula (2); (2) in, This is the value of the current intra-frame prediction mode.
3. The method according to claim 2, characterized in that, The step of determining the rate-distortion cost of the intra-prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels further includes: Iterate through each prediction unit (PU) in the current video frame and perform the following operations until the rate-distortion cost of the intra-prediction mode for each prediction unit (PU) in the current video frame is obtained: The rate-distortion cost of the intra-prediction mode of any two determined PUs is used as the rate-distortion cost of the intra-prediction mode of the parent PU of the two PUs.
4. The method according to claim 1, characterized in that, The step of selecting at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU includes: For a subset of PUs partitioned by a quadtree, if there is a pending PU in the subset of PUs whose target intra-prediction mode set has not been determined, the intersection of the target intra-prediction mode sets of the other three PUs in the subset of PUs shall be taken as the target intra-prediction mode set of the pending PU.
5. The method according to claim 1, characterized in that, The margin value is 30.
6. The method according to claim 1, characterized in that, After selecting at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU, the method further includes: Output the target intra-frame prediction mode set for each PU.
7. An image processing apparatus, characterized in that, include: The acquisition unit acquires the raw pixels and quantization parameters qp required for the coarse mode selection RMD of the current video frame; The first determining unit is configured to determine the predicted reconstructed pixel of each coding tree unit (CTU) in the current frame based on the original pixel and qp using a preset linear prediction model, including: determining the predicted reconstructed pixel of each CU in each coding tree unit (CTU) of the current frame using the following formula: in, For the reconstructed pixels around the current CTU, The original pixels of the current CTU, The original pixels of the currently encoded CU in the current CTU. , Here, qp is the fitting parameter, and margin is the preset threshold for the quantization parameter qp. Reconstruct pixels for the fitted prediction; The second determining unit is used to determine the rate-distortion cost of the intra-frame prediction mode of each prediction unit (PU) in the current video frame based on the predicted reconstructed pixels. The third determining unit is used to select at least one intra-prediction mode with a rate-distortion cost less than a preset threshold as the target intra-prediction mode set for each PU.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 through the computer program.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method according to any one of claims 1 to 6.