Intra-frame prediction coding method, device, equipment and storage medium
By using SATD cost and RDO cost models to select intra prediction mode in video encoding, the problem that intra prediction mode in the prior art cannot take into account both objective quality and subjective experience, and better encoding effect is achieved.
Patent Information
- Application Number
- CN202210963290.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-08-11
AI Technical Summary
During the encoding process of existing video encoders, the intra prediction mode selection cannot take into account both objective quality and subjective experience, resulting in the occurrence of mosaic phenomenon.
The intra prediction mode is selected using the SATD cost and RDO cost model. By calculating the SATD cost and RDO cost of the original intra prediction mode, the target intra prediction mode is selected for encoding.
It improves the objective and subjective experience of video encoding and reduces the emergence of mosaic phenomena.
Smart Images

Figure CN115334309B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, specifically cloud computing, video processing, and media cloud technology, and can be applied in smart cloud and video cloud scenarios. Background Art
[0002] Currently, video encoders typically use a rate-distortion cost model to select encoding modes during the encoding process. The goal of a rate-distortion cost model is to minimize video distortion while maintaining a limited bitrate. Distortion in this context is often correlated with objective quality. Therefore, this model can only optimize objective metrics, not the subjective experience of the human eye. In some cases, the optimal mode selected using this model may result in pixelation.
[0003] Video coding involves two modes: intra-frame prediction and inter-frame prediction. Intra-frame prediction primarily uses information about adjacent pixels in the current image block to predict the current image block, while inter-frame prediction primarily uses encoded temporal information to predict the current image block. Intra-frame prediction often produces mosaic artifacts in flat areas, which are often carried over to subsequent frames and are more easily perceived by the human eye. Summary of the Invention
[0004] The embodiments of the present disclosure provide an intra-frame prediction coding method, apparatus, device, storage medium, and program product.
[0005] In a first aspect, an embodiment of the present disclosure proposes an intra-frame prediction coding method, comprising: for a current image block, calculating the SATD cost for each original intra-frame prediction mode in the original intra-frame prediction mode set; based on the SATD cost, selecting a candidate intra-frame prediction mode set from the original intra-frame prediction mode set; calculating the RDO cost of each candidate intra-frame prediction mode in the candidate intra-frame prediction mode set; based on the RDO cost, selecting a target intra-frame prediction mode from the candidate intra-frame prediction mode set; and encoding the current image block using the target intra-frame prediction mode.
[0006] In the second aspect, an embodiment of the present disclosure proposes an intra-frame prediction encoding device, including: a first calculation module, configured to calculate the SATD cost of the original intra-frame prediction modes in the original intra-frame prediction mode set for the current image block; a first selection module, configured to select a candidate intra-frame prediction mode set from the original intra-frame prediction mode set based on the SATD cost; a second calculation module, configured to calculate the RDO cost of the candidate intra-frame prediction modes in the candidate intra-frame prediction mode set respectively; a second selection module, configured to select a target intra-frame prediction mode from the candidate intra-frame prediction mode set based on the RDO cost; and an encoding module, configured to encode the current image block using the target intra-frame prediction mode.
[0007] In a third aspect, an embodiment of the present disclosure proposes an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in any implementation manner in the first aspect.
[0008] In a fourth aspect, an embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to enable a computer to execute the method described in any implementation manner in the first aspect.
[0009] In a fifth aspect, an embodiment of the present disclosure proposes a computer program product, including a computer program, which implements the method described in any implementation manner in the first aspect when executed by a processor.
[0010] The intra-frame prediction coding method provided by the embodiments of the present disclosure selects an intra-frame prediction mode based on the SATD cost and the RDO cost, wherein both the SATD cost and the RDO cost are related to objective quality and can improve the objective experience.
[0011] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Other features, objects, and advantages of the present disclosure will become more apparent upon reading the detailed description of the non-limiting embodiments made with reference to the following drawings. The drawings are provided for a better understanding of the present disclosure and do not constitute a limitation of the present disclosure. Among them:
[0013] Figure 1 is a flowchart of an embodiment of an intra-frame prediction encoding method according to the present disclosure;
[0014] Figure 2 is a flowchart of another embodiment of the intra-frame prediction encoding method according to the present disclosure;
[0015] Figure 3 is a flowchart of another embodiment of the intra-frame prediction encoding method according to the present disclosure;
[0016] Figure 4 1 is a schematic structural diagram of an embodiment of an intra-frame prediction encoding device according to the present disclosure;
[0017] Figure 5 It is a block diagram of an electronic device for implementing the intra-frame prediction encoding method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0019] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0020] Figure 1 A process 100 of an embodiment of an intra-frame prediction encoding method according to the present disclosure is shown. The intra-frame prediction encoding method includes the following steps:
[0021] Step 101 : For a current image block, SATD costs are calculated for each original intra prediction mode in an original intra prediction mode set.
[0022] In this embodiment, for the current image block, the execution entity of the intra-frame prediction encoding method may calculate the SATD (Sum of Absolute Transformed Difference) cost for each original intra-frame prediction mode in the original intra-frame prediction mode set. SATD is a measure of the magnitude of a video residual signal, and the SATD cost may be a corresponding cost calculated using the SATD metric.
[0023] Typically, during video encoding, a video frame is divided into multiple image blocks. Each image block can be encoded using either intra-frame prediction or inter-frame prediction. Intra-frame prediction primarily uses information about the neighboring pixels of the current image block to predict the current image block, while inter-frame prediction primarily uses encoded temporal information to predict the current image block.
[0024] In practice, video coding supports 35 intra-frame prediction modes, including planar, direct current, and angular. Intra-frame prediction mode 0 is planar intra-frame prediction, intra-frame prediction mode 1 is direct current prediction, and intra-frame prediction modes 2 to 34 are angular prediction modes. The original intra-frame prediction mode set can include all intra-frame prediction modes. In this case, the SATD cost needs to be calculated for all intra-frame prediction modes. To reduce the amount of calculation, the original intra-frame prediction mode can also only include intra-frame prediction modes obtained by sampling all intra-frame prediction modes at intervals. In this way, the SATD cost is only calculated for some intra-frame prediction modes.
[0025] Step 102: Select a candidate intra prediction mode set from the original intra prediction mode set based on the SATD cost.
[0026] In this embodiment, the execution entity may select a candidate intra-frame prediction mode set from the original intra-frame prediction mode set based on the SATD cost. For example, original intra-frame prediction modes having SATD costs less than a preset threshold may be selected from the original intra-frame prediction mode set to generate the candidate intra-frame prediction mode set. In another example, the original intra-frame prediction modes in the original intra-frame prediction mode set may be sorted according to their SATD costs, and a predetermined number of original intra-frame prediction modes may be selected starting from the set with the lowest SATD cost to generate the candidate intra-frame prediction mode set.
[0027] Step 103 : Calculate the RDO costs of the candidate intra prediction modes in the candidate intra prediction mode set respectively.
[0028] In this embodiment, for a candidate intra prediction mode in the candidate intra prediction mode set, the execution entity may calculate the RDO cost of the candidate intra prediction mode. The core concept of the RDO cost is to consider both the bitrate and distortion constraints when calculating the cost function, thereby ensuring both low distortion and bitrate.
[0029] Generally, the RDO cost model can be used to calculate the RDO cost of the candidate intra prediction mode in the candidate intra prediction mode set. Specifically, the RDO cost model can calculate the video distortion under the condition of limited bit rate. The formula of the RDO cost model is as follows:
[0030] J=D+λ MODE ×R;
[0031] Where D represents distortion, λ MODE R is the Lagrange coefficient, and R represents the bit rate, which is the number of bits encoded per unit time, usually expressed in kbps. The larger the value, the higher the accuracy, and the closer the compressed file is to the original file.
[0032] Step 104 : Select a target intra prediction mode from the candidate intra prediction mode set based on the RDO cost.
[0033] In this embodiment, the execution entity may select a target intra-frame prediction mode from the set of candidate intra-frame prediction modes based on the RDO cost. For example, a candidate intra-frame prediction mode having an RDO cost less than a preset threshold may be selected from the set of candidate intra-frame prediction modes as the target intra-frame prediction mode. For another example, a candidate intra-frame prediction mode having the smallest RDO cost may be selected from the set of candidate intra-frame prediction modes as the target intra-frame prediction mode.
[0034] Generally, RDO costs are related to objective quality and can improve the objective experience. The objective experience mainly relies on a mathematical model to indirectly reflect the subjective perception of the human eye and provide a result based on digital calculations.
[0035] Step 105: Encode the current image block using the target intra-frame prediction mode.
[0036] In this embodiment, the execution entity may encode the current image block using the target intra-frame prediction mode.
[0037] The intra-frame prediction coding method provided by the embodiments of the present disclosure selects an intra-frame prediction mode based on the SATD cost and the RDO cost, wherein both the SATD cost and the RDO cost are related to objective quality and can improve the objective experience.
[0038] Continue to refer Figure 2 , which shows a process 200 of another embodiment of the intra-frame prediction encoding method according to the present disclosure. The intra-frame prediction encoding method includes the following steps:
[0039] Step 201 : For a current image block, SATD costs are calculated for each original intra prediction mode in an original intra prediction mode set.
[0040] In this embodiment, the specific operation of step 201 has been Figure 1 In the embodiment shown, step 101 is described in detail and will not be repeated here.
[0041] Step 202 : Determine whether the current image block is a flat pixel block based on the SATD cost and the pixel variance of the current image block.
[0042] In this embodiment, the execution subject of the intra-frame prediction encoding method may determine whether the current image block is a flat pixel block based on the SATD cost and the pixel variance of the current image block.
[0043] For example, if the minimum SATD cost of the original intra-frame prediction mode set and the pixel variance of the previous image block are both less than their respective corresponding preset thresholds, it is determined that the current image block is a flat pixel block, and step 203 is executed; if the minimum SATD cost of the original intra-frame prediction mode set and / or the pixel variance of the current image block are not less than their respective corresponding preset thresholds, it is determined that the current image block is not a flat pixel block, and step 204 is executed.
[0044] Step 203 : Select a plurality of adjacent original intra-frame prediction modes of the original intra-frame prediction mode in a preset direction to generate a candidate intra-frame prediction mode set.
[0045] In this embodiment, if the current image block is determined to be a flat pixel block based on the SATD cost and the pixel variance of the current image block, the execution entity may select multiple adjacent original intra-frame prediction modes of the original intra-frame prediction mode in a preset direction to generate a candidate intra-frame prediction mode set. Intra-frame prediction modes 2 to 34 are angular prediction modes and are arranged sequentially. The original intra-frame prediction mode in the preset direction may include at least one angular prediction mode, and multiple adjacent original intra-frame prediction modes may be selected upward or downward starting from the original intra-frame prediction mode in the preset direction.
[0046] Step 204 , sorting the original intra prediction modes in the original intra prediction mode set according to the SATD cost, selecting multiple original intra prediction modes starting from the side with the smaller SATD cost, and generating a candidate intra prediction mode set.
[0047] In this embodiment, if it is determined that the current image block is not a flat pixel block based on the SATD cost and the pixel variance of the current image block, the above-mentioned execution entity can sort the original intra-frame prediction modes in the original intra-frame prediction mode set according to the size of the SATD cost, and select multiple original intra-frame prediction modes starting from the side with the smaller SATD cost to generate a candidate intra-frame prediction mode set.
[0048] Step 205 : Calculate the RDO costs of the candidate intra prediction modes in the candidate intra prediction mode set respectively.
[0049] In this embodiment, the specific operation of step 205 has been Figure 1 In the embodiment shown, step 103 is described in detail and will not be repeated here.
[0050] Step 206 : Select the candidate intra prediction mode corresponding to the minimum RDO cost as the target intra prediction mode.
[0051] In this embodiment, the execution entity may select a candidate intra prediction mode with the minimum RDO cost from the candidate intra prediction mode set as the target intra prediction mode.
[0052] Generally, RDO costs are related to objective quality and can improve the objective experience. The objective experience mainly relies on a mathematical model to indirectly reflect the subjective perception of the human eye and provide a result based on digital calculations.
[0053] Step 207: Encode the current image block using the target intra-frame prediction mode.
[0054] In this embodiment, the specific operation of step 207 has been Figure 1 In the illustrated embodiment, step 105 is described in detail and will not be repeated here.
[0055] from Figure 2 It can be seen that Figure 1 Compared to the corresponding embodiment, the intra-frame prediction encoding method process 200 in this embodiment highlights the candidate intra-frame prediction mode selection step. Therefore, the solution described in this embodiment adjusts the intra-frame prediction mode for flat pixel blocks prone to mosaic, avoiding mosaic phenomenon and improving the subjective quality of the video.
[0056] Further references Figure 3 , which shows a process 300 of another embodiment of the intra-frame prediction encoding method according to the present disclosure. The intra-frame prediction encoding method includes the following steps:
[0057] Step 301 : For a current image block, SATD costs are calculated for each original intra prediction mode in an original intra prediction mode set.
[0058] In this embodiment, for the current image block, the execution subject of the intra-frame prediction encoding method can calculate the SATD cost satdCost for each original intra-frame prediction mode in the original intra-frame prediction mode set. mode_i (0≤i≤34).
[0059] Step 302 : Determine whether the SATD cost of the original intra prediction mode in the oblique 45 degree direction and the oblique 135 degree direction is less than the product of a first preset threshold and the minimum SATD cost of the original intra prediction mode set.
[0060] In this embodiment, the execution subject can compare the minimum SATD cost satdCost of the original intra prediction mode set. min The SATD cost satdCost of the original intra prediction mode in the oblique 45-degree direction and the oblique 135-degree direction is the same as the value of the SATD cost satdCost of the original intra prediction mode. If the equation (1) is satisfied, it is determined that the current image block belongs to a flat area and step 303 is executed; if the equation (1) is not satisfied, step 307 is executed.
[0061] Min(satdCost2,satdCost 34 ) <Threshold1×satdCost min (1)
[0062] Among them, satdCost2 is the SATD cost of the original intra prediction mode in the oblique 45-degree direction, satdCost 34 is the SATD cost of the original intra prediction mode in the oblique 135-degree direction, satdCost min is the minimum SATD cost of the original intra prediction mode set, Threshold1 is the first preset threshold, and its value is greater than 1, usually between 1 and 2.
[0063] Step 303: Determine whether the pixel variance of the current pixel block is less than a second preset threshold.
[0064] In this embodiment, the execution entity may compare the pixel variance Var of the current pixel block with the value of Threshold 2. If the equation (2) is satisfied, step 304 is executed; if the equation (2) is not satisfied, step 307 is executed.
[0065] Var <Threshold2 (2)
[0066] Among them, the value of Threshold2 is less than 10, usually around 8.
[0067] Step 304: Determine whether the minimum SATD cost of the original intra prediction mode set is less than a third preset threshold.
[0068] In this embodiment, the execution subject can compare the minimum SATD cost satdCost of the original intra prediction mode set. min and the third preset threshold Threshold3. If formula (3) is satisfied, it is determined that the current image block is a flat pixel block and is prone to mosaic phenomenon, and step 305 is executed; if formula (3) is not satisfied, step 307 is executed.
[0069] satdCost min <Threshold3 (3)
[0070] The value range of Threshold3 is generally related to CUsize. For example, for a 16x16 CU, Threshold3 is usually 256.
[0071] Step 305: Determine whether the current image block is a flat pixel block.
[0072] In this embodiment, if formula (1), formula (2), and formula (3) are satisfied at the same time, the execution subject may determine that the current image block is a flat pixel block and execute step 306 .
[0073] Step 306 , searching upwards for multiple adjacent original intra prediction modes starting from the original intra prediction mode at an oblique 45-degree direction, and searching downwards for multiple adjacent original intra prediction modes starting from the original intra prediction mode at an oblique 135-degree direction, to generate a candidate intra prediction mode set.
[0074] In this embodiment, the above-mentioned execution entity can search for multiple adjacent original intra-frame prediction modes upward from the original intra-frame prediction mode in the oblique 45-degree direction, and search for multiple adjacent original intra-frame prediction modes downward from the original intra-frame prediction mode in the oblique 135-degree direction to generate a set of candidate intra-frame prediction modes.
[0075] The original intra-frame prediction mode at a 45-degree angle is mode 2, and its search range is [2, 2+N]. That is, N adjacent modes are searched upward from mode 2. The original intra-frame prediction mode at a 135-degree angle is mode 34, and its search range is [34-N, 34]. That is, N adjacent modes are searched downward from mode 34.
[0076] Step 307: Determine whether the current image block is a flat pixel block.
[0077] In this embodiment, if one of formula (1), formula (2) and formula (3) is not satisfied, the execution entity may determine that the current image block is not a flat pixel block and execute step 307 .
[0078] Step 308 : Sort the original intra prediction modes in the original intra prediction mode set according to the SATD cost, select multiple original intra prediction modes starting from the side with the smaller SATD cost, and generate a candidate intra prediction mode set.
[0079] Step 309 : Calculate the RDO costs of the candidate intra prediction modes in the candidate intra prediction mode set respectively.
[0080] Step 310 : Select the candidate intra prediction mode corresponding to the minimum RDO cost as the target intra prediction mode.
[0081] Step 311: Encode the current image block using the target intra-frame prediction mode.
[0082] In this embodiment, the specific operations of steps 308-311 are already described in Figure 2 In the illustrated embodiment, steps 204-207 are described in detail and will not be repeated here.
[0083] from Figure 3 It can be seen that Figure 2 Compared to the corresponding embodiment, the intra-frame prediction encoding method process 300 in this embodiment highlights the candidate intra-frame prediction mode selection step. Therefore, the solution described in this embodiment takes advantage of the human eye's insensitivity to diagonal boundaries. This characteristic is used to adjust the intra-frame prediction mode in areas prone to mosaics, selecting a mode close to a 45-degree or 135-degree diagonal direction, thereby avoiding subjective mosaics and improving subjective quality.
[0084] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an intra-frame prediction encoding device. Figure 1Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0085] like Figure 4 As shown, the intra-frame prediction encoding apparatus 400 of this embodiment may include: a first calculation module 401, a first selection module 402, a second calculation module 403, a second selection module 404, and an encoding module 405. The first calculation module 401 is configured to calculate, for a current image block, SATD costs for each of the original intra-frame prediction modes in the original intra-frame prediction mode set; the first selection module 402 is configured to select a set of candidate intra-frame prediction modes from the original intra-frame prediction mode set based on the SATD costs; the second calculation module 403 is configured to calculate RDO costs for each of the candidate intra-frame prediction modes in the candidate intra-frame prediction mode set; the second selection module 404 is configured to select a target intra-frame prediction mode from the candidate intra-frame prediction mode set based on the RDO costs; and the encoding module 405 is configured to encode the current image block using the target intra-frame prediction mode.
[0086] In this embodiment, in the intra-frame prediction coding device 400, the specific processing of the first calculation module 401, the first selection module 402, the second calculation module 403, the second selection module 404 and the coding module 405 and the technical effects thereof can be referred to in the respective Figure 1 The relevant descriptions of steps 101-105 in the corresponding embodiment are not repeated here.
[0087] In some optional implementations of this embodiment, the first selection module 402 includes: a first selection submodule, which is configured to select multiple adjacent original intra-frame prediction modes of the original intra-frame prediction mode in a preset direction to generate a set of candidate intra-frame prediction modes if it is determined that the current image block is a flat pixel block based on the SATD cost and the pixel variance of the current image block.
[0088] In some optional implementations of this embodiment, the first selection module 403 also includes: a second selection sub-module, which is configured to, if it is determined based on the SATD cost and the pixel variance of the current image block that the current image block is not a flat pixel block, sort the original intra-frame prediction modes in the original intra-frame prediction mode set according to the size of the SATD cost, select multiple original intra-frame prediction modes starting from the side with the smaller SATD cost, and generate a candidate intra-frame prediction mode set.
[0089] In some optional implementations of this embodiment, the first selection submodule includes: a first determination unit, configured to determine that the current image block is a flat pixel block if the SATD cost of the original intra-frame prediction mode in a preset direction is less than the product of a first preset threshold and the minimum SATD cost of the original intra-frame prediction mode set, the pixel variance of the current pixel block is less than a second preset threshold, and the minimum SATD cost of the original intra-frame prediction mode set is less than a third preset threshold.
[0090] In some optional implementations of this embodiment, the second selection submodule includes: a second determination unit, configured to determine that the current image block is not a flat pixel block if the SATD cost of the original intra-frame prediction mode in a preset direction is not less than the product of the first preset threshold and the minimum SATD cost of the original intra-frame prediction mode set, or the pixel variance of the current pixel block is not less than the second preset threshold, or the minimum SATD cost of the original intra-frame prediction mode set is not less than the third preset threshold.
[0091] In some optional implementations of this embodiment, the original intra-frame prediction mode in the preset direction includes the original intra-frame prediction mode in the oblique 45-degree direction and the original intra-frame prediction mode in the oblique 135-degree direction; and the first selection submodule includes: a search unit, configured to search for multiple adjacent original intra-frame prediction modes upward from the original intra-frame prediction mode in the oblique 45-degree direction, and to search for multiple adjacent original intra-frame prediction modes downward from the original intra-frame prediction mode in the oblique 135-degree direction, to generate a set of candidate intra-frame prediction modes.
[0092] In some optional implementations of this embodiment, the second selection module 404 is further configured to: select the candidate intra-frame prediction mode corresponding to the minimum RDO cost as the target intra-frame prediction mode.
[0093] In some optional implementations of this embodiment, the original intra-frame prediction mode set includes all intra-frame prediction modes or intra-frame prediction modes obtained by sampling all intra-frame prediction modes at intervals.
[0094] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0095] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0096] Figure 5A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0097] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0098] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0099] The computing unit 501 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the intra-frame prediction coding method. For example, in some embodiments, the intra-frame prediction coding method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the intra-frame prediction coding method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the intra-frame prediction coding method by any other appropriate means (e.g., by means of firmware).
[0100] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0102] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0105] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0106] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions provided by this disclosure can be achieved. This is not limited herein.
[0107] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. An intra-frame prediction encoding method, comprising: For the current image block, the absolute value and SATD cost of the coefficients after Hadamard transform of the residual are calculated for the original intra prediction modes in the original intra prediction mode set; Selecting a candidate intra prediction mode set from the original intra prediction mode set based on the SATD cost; Calculating rate-distortion optimization (RDO) costs of candidate intra prediction modes in the candidate intra prediction mode set respectively; Selecting a target intra prediction mode from the candidate intra prediction mode set based on the RDO cost; Encoding the current image block using the target intra-frame prediction mode; The step of selecting a candidate intra prediction mode set from the original intra prediction mode set based on the SATD cost includes: If the SATD cost of the original intra-frame prediction mode in the preset direction is less than the product of the first preset threshold and the minimum SATD cost of the original intra-frame prediction mode set, the pixel variance of the current image block is less than the second preset threshold, and the minimum SATD cost of the original intra-frame prediction mode set is less than the third preset threshold, it is determined that the current image block is a flat pixel block, and multiple adjacent original intra-frame prediction modes of the original intra-frame prediction mode in the preset direction are selected to generate the candidate intra-frame prediction mode set.
2. The method according to claim 1, wherein The selecting, based on the SATD cost, a candidate intra prediction mode set from the original intra prediction mode set further includes: If the SATD cost of the original intra-frame prediction mode in the preset direction is not less than the product of the first preset threshold and the minimum SATD cost of the original intra-frame prediction mode set, or the pixel variance of the current image block is not less than the second preset threshold, or the minimum SATD cost of the original intra-frame prediction mode set is not less than the third preset threshold, it is determined that the current image block is not a flat pixel block, and the original intra-frame prediction modes in the original intra-frame prediction mode set are sorted according to the size of the SATD cost, and multiple original intra-frame prediction modes are selected starting from the side with the smaller SATD cost to generate the candidate intra-frame prediction mode set.
3. The method according to claim 1, wherein The original intra-frame prediction mode of the preset direction includes the original intra-frame prediction mode of the oblique 45-degree direction and the original intra-frame prediction mode of the oblique 135-degree direction; as well as The selecting a plurality of adjacent original intra-frame prediction modes of the original intra-frame prediction mode in the preset direction to generate the candidate intra-frame prediction mode set includes: A plurality of adjacent original intra-frame prediction modes are searched upward from the original intra-frame prediction mode in the oblique 45-degree direction, and a plurality of adjacent original intra-frame prediction modes are searched downward from the original intra-frame prediction mode in the oblique 135-degree direction to generate the candidate intra-frame prediction mode set.
4. The method according to any one of claims 1 to 3, wherein The selecting a target intra prediction mode from the candidate intra prediction mode set based on the RDO cost includes: The candidate intra prediction mode corresponding to the minimum RDO cost is selected as the target intra prediction mode.
5. The method according to any one of claims 1 to 3, wherein The original intra prediction mode set includes all intra prediction modes or intra prediction modes obtained by sampling all intra prediction modes at intervals.
6. An intra-frame prediction encoding apparatus, comprising: The first calculation module is configured to calculate, for the current image block, the absolute value and SATD cost of the coefficients after Hadamard transform of the residual for the original intra prediction modes in the original intra prediction mode set; A first selection module is configured to select a candidate intra prediction mode set from the original intra prediction mode set based on a SATD cost; A second calculation module is configured to respectively calculate the RDO costs of the candidate intra prediction modes in the candidate intra prediction mode set; A second selection module is configured to select a target intra prediction mode from the candidate intra prediction mode set based on the RDO cost; an encoding module, configured to encode the current image block using the target intra-frame prediction mode; Wherein, the first selection module includes: The first selection submodule is configured to determine that the current image block is a flat pixel block if the SATD cost of the original intra-frame prediction mode in a preset direction is less than the product of a first preset threshold and the minimum SATD cost of the original intra-frame prediction mode set, the pixel variance of the current image block is less than a second preset threshold, and the minimum SATD cost of the original intra-frame prediction mode set is less than a third preset threshold, select multiple adjacent original intra-frame prediction modes of the original intra-frame prediction mode in the preset direction, and generate the candidate intra-frame prediction mode set.
7. The device according to claim 6, wherein The first selection module further includes: The second selection submodule is configured to determine that the current image block is not a flat pixel block if the SATD cost of the original intra-frame prediction mode in the preset direction is not less than the product of the first preset threshold and the minimum SATD cost of the original intra-frame prediction mode set, or the pixel variance of the current image block is not less than the second preset threshold, or the minimum SATD cost of the original intra-frame prediction mode set is not less than the third preset threshold, sort the original intra-frame prediction modes in the original intra-frame prediction mode set according to the size of the SATD cost, select multiple original intra-frame prediction modes starting from the side with the smaller SATD cost, and generate the candidate intra-frame prediction mode set.
8. The device according to claim 6, wherein The original intra-frame prediction mode of the preset direction includes the original intra-frame prediction mode of the oblique 45-degree direction and the original intra-frame prediction mode of the oblique 135-degree direction; as well as The first selection submodule includes: The search unit is configured to search for multiple adjacent original intra-frame prediction modes upward from the original intra-frame prediction mode in the oblique 45-degree direction, and to search for multiple adjacent original intra-frame prediction modes downward from the original intra-frame prediction mode in the oblique 135-degree direction, to generate the candidate intra-frame prediction mode set.
9. The device according to any one of claims 6 to 8, wherein: The second selection module is further configured to: The candidate intra prediction mode corresponding to the minimum RDO cost is selected as the target intra prediction mode.
10. The device according to any one of claims 6 to 8, wherein: The original intra prediction mode set includes all intra prediction modes or intra prediction modes obtained by sampling all intra prediction modes at intervals.
11. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
13. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
HEVC intra-frame prediction mode fast selection method
CN105208387A
Intra-frame prediction mode selection method in combination with texture spatial correlation
CN109982079A