Intra prediction mode determination method and apparatus, device, and storage medium
By determining the cell category of the prediction unit and directly determining the intra-frame prediction mode in video coding, the problem of high computational cost in existing technologies is solved, thereby improving video coding efficiency and resource utilization.
Patent Information
- Application Number
- CN202310587690.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-05-23
AI Technical Summary
Existing technologies involve large computational loads and low efficiency in determining intra-frame prediction modes in video coding, resulting in lower overall efficiency of video coding.
By determining the distribution information of prediction units in the image block where the current prediction unit to be encoded is located, the unit categories are divided, and the intra-frame prediction mode is directly determined based on the unit category, thus avoiding traversing all intra-frame prediction modes.
It effectively reduces the proportion of intra-frame predictive coding in the complexity of video coding, saves computing resources, and improves video coding efficiency.
Smart Images

Figure CN116527890B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a method and device for determining intra prediction mode, equipment and storage medium. BACKGROUND
[0002] With the rapid development of Internet technology, video has been widely used and gradually replaced by text as an important way to obtain knowledge and information. In the process of video transmission, due to the large amount of video data, video coding technology is usually used to encode video data into video bitstream for transmission. Before encoding the video data, each video frame is divided into multiple coding units (CU), and then the coding units are encoded. An important step in encoding the coding units is to determine the intra prediction mode of each prediction unit (PU) in the coding unit, so as to encode the prediction unit according to the corresponding intra prediction mode.
[0003] The prior art usually traverses all intra prediction modes for each prediction unit to determine the optimal intra prediction mode and then encodes the corresponding prediction unit by intra prediction. However, this method has a large amount of calculation, low efficiency in determining the intra prediction mode, and low overall video coding efficiency. SUMMARY
[0004] The embodiments of the present application provide a method and device for determining intra prediction mode, equipment and storage medium, which can quickly determine the intra prediction mode of the prediction unit, thereby improving the video coding efficiency and having high applicability.
[0005] In one aspect, the embodiments of the present application provide a method, which comprises:
[0006] determining the prediction unit distribution information of the image block where the current to-be-encoded prediction unit is located;
[0007] determining the unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block;
[0008] determining the intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit.
[0009] In another aspect, the embodiments of the present application provide a device for determining intra prediction mode, which comprises:
[0010] an information determining module configured to determine the prediction unit distribution information of the image block where the current to-be-encoded prediction unit is located;
[0011] a category determining module configured to determine the unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block.
[0012] determine an intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit.
[0013] In another aspect, an electronic device is provided, including a processor and a memory, which are connected to each other;
[0014] The memory is configured to store a computer program.
[0015] The processor is configured to, when the computer program is invoked, execute the intra prediction mode determination method provided in the embodiments of the present application.
[0016] In another aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the intra prediction mode determination method provided in the embodiments of the present application.
[0017] In another aspect, a computer program product is provided, which includes a computer program, and the computer program is executed by a processor to implement the intra prediction mode determination method provided in the embodiments of the present application.
[0018] In the embodiments of the present application, after the unit category of the to-be-encoded prediction unit is determined according to the prediction unit distribution information of the image block in which the to-be-encoded prediction unit is located, the intra prediction mode of the to-be-encoded prediction unit can be directly determined according to the unit category of the to-be-encoded prediction unit, thereby effectively reducing the proportion of intra prediction encoding in the video encoding complexity, improving the video encoding efficiency, saving the computing resources, and having high applicability. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0020] Figure 1 is an architecture schematic diagram of a video encoding system provided in the embodiments of the present application;
[0021] Figure 2 is a flow schematic diagram of an intra prediction mode determination method provided in the embodiments of the present application;
[0022] Figure 3a is one of schematic diagrams of preset relative positions provided in the embodiments of the present application;
[0023] Figure 3b is a schematic diagram of a preset relative position provided by an embodiment of the present application;
[0024] Figure 3c is a schematic diagram of a preset relative position provided by an embodiment of the present application;
[0025] Figure 4a is a schematic diagram of a prediction unit distribution provided by an embodiment of the present application;
[0026] Figure 4b is a schematic diagram of a prediction unit distribution provided by an embodiment of the present application;
[0027] Figure 5 is a schematic diagram of a direction prediction mode distribution provided by an embodiment of the present application;
[0028] Figure 6 is a schematic diagram of a flow framework for determining a unit category provided by an embodiment of the present application;
[0029] Figure 7 is a schematic diagram of a flow framework for determining an intra prediction mode provided by an embodiment of the present application;
[0030] Figure 8 is a schematic diagram of an intra prediction mode determination apparatus provided by an embodiment of the present application;
[0031] Figure 9 is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0033] Referring to Figure 1 , Figure 1 is a schematic diagram of a video coding system provided by an embodiment of the present application. As shown in Figure 1As shown, the video coding system can include a terminal device 100, a terminal device 200 and a server 300. The terminal device 100 and the terminal device 200 can communicate with the server 300 through a wired network or a wireless network. The terminal device 200 or the terminal device 100 can determine the intra prediction mode of each prediction unit based on the intra prediction mode determination method provided in the embodiments of the present application, and encode the corresponding intra prediction according to the determined intra prediction mode, and then transmit the finally obtained encoded data stream to the server 300 so as to transmit the encoded data stream to the corresponding other terminal device.
[0034] It can be understood that, Figure 1 The architecture shown is only an example and does not constitute a limitation on the embodiments of the present application. In actual applications, a number of terminal devices and servers different from Figure 1
[0035] The terminal device 100 and the terminal device 200 can be a personal computer, a notebook computer, a smart phone, a tablet computer, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal and a smart wearable device, but are not limited thereto. The server 300 can be a standalone physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc. basic cloud computing services.
[0036] It can be understood that the intra prediction mode determination method provided in the embodiments of the present application can be executed by the terminal device 100 or the terminal device 200, and can also be executed by any terminal device in cooperation with the server 202, and the embodiments of the present application do not limit this.
[0037] It should be noted that the intra prediction mode determination method provided in the embodiments of the present application can be applied to the versatile video coding (VVC) / H.266, high efficiency video coding (HEVC) / H.265, or the next generation video coding standard, and the embodiments of the present application do not limit this.
[0038] HEVC standard, also known as H.265 coding standard, can be used to extend H.264 / AVC coding standard, and the H.265 coding standard specifies the coding process and related syntax of the corresponding code stream data. The VVC standard is also known as the H.266 coding standard, which specifies the coding process and related syntax of the corresponding code stream data of H.266.
[0039] The above standards incorporate many key technologies to improve performance, such as quad-tree partitioning coding units, finer prediction direction intra prediction technology, inter prediction technology using motion merging technology and advanced motion vector prediction mode, high-precision motion compensation technology, deblocking filtering and pixel adaptive compensation technology for improving the quality of reconstructed images, etc.
[0040] The coding unit refers to the basic unit of video frame encoding. In the encoding process, the coding unit can refer to the entire video frame (in the case of not dividing the video frame), or it can refer to a part of the region in the video frame (in the case of dividing the video frame).
[0041] The intra prediction encoding refers to the encoding of the coding unit without referring to the information of other video frames except the video frame to which the coding unit belongs.
[0042] The prediction unit PU specifies all prediction modes of the coding unit, and all prediction-related information is defined in the prediction unit part.
[0043] Referring to Figure 2 , Figure 2 is a flowchart of the intra prediction mode determination method provided by the embodiments of the present application. As shown in Figure 2 , the intra prediction mode provided by the embodiments of the present application can specifically include the following steps:
[0044] Step S21, determine the prediction unit distribution information of the image block where the current to-be-encoded prediction unit is located.
[0045] The video frame can be divided into at least one coding block, and each coding block is an image block. Each image block can be divided into a plurality of non-overlapping coding units (CUs) by different division methods, and each coding unit can be divided into one or more prediction units. The division method of the coding unit includes but is not limited to horizontal binary tree division (horizontal binary division for short), vertical binary tree division (vertical binary division for short), quad-tree division (quad-tree division for short), horizontal ternary tree division (horizontal ternary division for short), vertical ternary tree division (vertical ternary division for short), etc. The division method of the prediction unit can be any one of the division methods in the prior art, which is not limited here.
[0046] In the embodiments of the present application, the current to-be-encoded prediction unit is a prediction unit in a current image block that needs to be encoded by using intra prediction.
[0047] The prediction unit distribution information in the image block in which the current to-be-encoded prediction unit is located, i.e., information used to represent the division manner and distribution of each prediction unit in the image block in which the current to-be-encoded prediction unit is located.
[0048] In step S22, the unit category of the to-be-encoded prediction unit is determined according to the prediction unit distribution information of the image block.
[0049] In some possible embodiments, the prediction units of different unit categories correspond to different intra prediction mode determination manners, and therefore, before the intra prediction mode of the to-be-encoded prediction unit is determined, the prediction unit distribution information of the image block in which the to-be-encoded prediction unit is located needs to be determined first, and the unit category of the to-be-encoded prediction unit needs to be determined.
[0050] In some possible embodiments, when the unit category of the to-be-encoded prediction unit is determined according to the prediction unit distribution information of the image block in which the to-be-encoded prediction unit is located, the to-be-encoded prediction unit can be determined according to the prediction unit distribution information of the image block in which the to-be-encoded prediction unit is located, whether there is a prediction unit in each preset relative position of the to-be-encoded prediction unit in the image block.
[0051] For the to-be-encoded prediction unit, the prediction unit in each preset relative position of the to-be-encoded prediction unit in the image block can be referred to as a neighborhood prediction unit of the to-be-encoded prediction unit.
[0052] The preset relative position can be any one or more positions adjacent to the to-be-encoded prediction unit and having been encoded by using intra prediction according to the "Z" type encoding order specified in the encoding standard, and the specific position can be determined based on actual application scenarios, which is not limited herein. That is, the prediction unit in each preset relative position in the image block is encoded by using intra prediction before the to-be-encoded prediction unit and is adjacent to the to-be-encoded prediction unit.
[0053] As an example, if the to-be-encoded prediction unit is E, the preset relative positions corresponding to the to-be-encoded prediction unit E can be the positions shown in FIG. 1A, FIG. 1B, FIG. 1C and FIG. 1D. Figures 3a-3c It should be particularly noted that, Figures 3a-3c The preset relative positions shown in FIG. 1A, FIG. 1B, FIG. 1C and FIG. 1D are only examples, which are not limited in the embodiments of the present application.
[0054] In the above implementation, since the division manners of the prediction units of different coding units can be different, and the position of the to-be-encoded prediction unit in the image block can also be located at an edge position, for each preset relative position of the to-be-encoded prediction unit, there can exist or not exist a neighboring prediction unit of the to-be-encoded prediction unit in the image block at the preset relative position. And for multiple preset relative positions of the to-be-encoded prediction unit, the multiple preset relative positions of the to-be-encoded prediction unit in the image can correspond to the same neighboring prediction unit.
[0055] As an example, if the position of the to-be-encoded prediction unit (prediction unit Q) in the image block is as shown in FIG. 6A, and the preset relative position corresponding to the to-be-encoded prediction unit is as shown in FIG. 6B, there does not exist a neighboring prediction unit of the to-be-encoded prediction unit in the image block as shown in FIG. 6C. Figure 4a Figure 3a As an example, if the position of the to-be-encoded prediction unit (prediction unit Q) in the image block is as shown in FIG. 6A, and the preset relative position corresponding to the to-be-encoded prediction unit is as shown in FIG. 6B, there does not exist a neighboring prediction unit of the to-be-encoded prediction unit in the image block as shown in FIG. 6C. Figure 4a
[0056] As an example, if the position of the to-be-encoded prediction unit (prediction unit Q) in the image block is as shown in FIG. 6A, and the preset relative position corresponding to the to-be-encoded prediction unit is as shown in FIG. 6B, there does not exist a neighboring prediction unit of the to-be-encoded prediction unit in the image block as shown in FIG. 6C. Figure 4b Figure 3a As an example, if the position of the to-be-encoded prediction unit (prediction unit Q) in the image block is as shown in FIG. 6A, and the preset relative position corresponding to the to-be-encoded prediction unit is as shown in FIG. 6B, there does not exist a neighboring prediction unit of the to-be-encoded prediction unit in the image block as shown in FIG. 6C. Figure 4b
[0057] Based on the above implementation, whether there exists a neighboring prediction unit of the to-be-encoded prediction unit in the image block at each preset relative position of the to-be-encoded prediction unit can be determined according to the prediction unit distribution information of the image block.
[0058] In some possible implementation, when it is determined according to the prediction unit distribution information of the image block that there exists a neighboring prediction unit in the image block at each preset relative position of the to-be-encoded prediction unit, since each neighboring prediction unit has been encoded by intra prediction, the unit category of the to-be-encoded prediction unit can be determined according to the encoding information of each neighboring prediction unit.
[0059] In this case, when it is determined according to the prediction unit distribution information of the image block that there does not exist a neighboring prediction unit in the image block at at least one preset relative position of the to-be-encoded prediction unit, the unit category of the to-be-encoded prediction unit can be determined as the third category.
[0060] As an example, if the to-be-encoded prediction unit is Figure 4a The prediction unit Q in the image block is the first prediction unit in the image block to be intra-predictively encoded, and thus it can be determined that there is no neighboring prediction unit of the prediction unit Q in the image block, and further, the unit category of the prediction unit Q can be determined as the third category.
[0061] As an example, if the to-be-encoded prediction unit is the prediction unit Q in the image block, and it is determined according to the prediction unit distribution information of the image block that there is no neighboring prediction unit of the prediction unit Q in the image block, the unit category of the prediction unit Q can be determined as the third category. Figure 4b The prediction unit Q in the image block is the first prediction unit in the image block to be intra-predictively encoded, and thus it can be determined that there is no neighboring prediction unit of the prediction unit Q in the image block, and further, the unit category of the prediction unit Q can be determined as the third category. Figure 4b All the neighboring prediction units of the prediction unit Q, i.e., the prediction unit L1, the prediction unit L2 and the prediction unit L3. Thus, the unit category of the to-be-encoded prediction unit can be determined based on the encoding information of the prediction unit L1, the prediction unit L2 and the prediction unit L3.
[0062] Alternatively, when it is determined according to the prediction unit distribution information of the image block that there is a neighboring prediction unit in the image block at at least one preset relative position compared with the to-be-encoded prediction unit, the unit category of the to-be-encoded prediction unit can be determined according to the encoding information of each neighboring prediction unit.
[0063] Based on this, when it is determined according to the prediction unit distribution information of the image block that there is no neighboring prediction unit in the image block at each preset relative position compared with the to-be-encoded prediction unit, the unit category of the to-be-encoded prediction unit can be determined as the third category.
[0064] In some possible implementation manners, when the unit category of the to-be-encoded prediction unit is determined according to the encoding information of each neighboring prediction unit, the intra-prediction mode of each neighboring prediction unit can be determined according to the encoding information of the corresponding neighboring prediction unit.
[0065] Each intra-prediction mode of each neighboring prediction unit can be one of a direct current (DC) mode, a planar mode or a directional mode.
[0066] The directional mode in the VVC / H.266 standard includes 65 intra-prediction modes, and each intra-prediction mode corresponds to a direction (angle). The directional mode in the HEVC / H.265 standard includes 33 intra-prediction modes, and each intra-prediction mode also corresponds to a direction (angle).
[0067] Each intra-prediction mode in any standard corresponds to a unique mode identifier, which includes a direction identifier and a mode sequence number identifier.
[0068] For example, the directional mode in the HEVC / H.265 standard can be as shown in FIG. 1. Figure 5 Figure 5 33 kinds of intra prediction modes are shown, and in the mode identification of each intra prediction mode, V represents horizontal, H represents vertical, V or H plus or minus a number represents a direction offset, and the numbered numbers 2-34 represent mode numbers. The direction angle of each direction prediction mode gradually changes with the increase of the number, and the distribution is more intensive in the horizontal and vertical directions.
[0069] Further, for the to-be-encoded prediction unit, if it is determined according to the encoding information of each neighboring prediction unit that the intra prediction mode of the corresponding neighboring prediction unit is the DC prediction mode or the planar prediction mode, it is determined that the unit category of the to-be-encoded prediction unit is the first category.
[0070] That is, if the intra prediction mode of each neighboring prediction unit of the to-be-encoded prediction unit is the DC prediction mode or the planar prediction mode, it can be determined that the unit category of the to-be-encoded prediction unit is the first category.
[0071] Further, for the to-be-encoded prediction unit, if it is determined according to the encoding information of each neighboring prediction unit that the intra prediction mode of all the neighboring prediction units is the direction prediction mode, and the difference between the maximum mode number and the minimum mode number in the direction prediction modes of all the neighboring prediction units is less than or equal to a first threshold, it is determined that the unit category of the to-be-encoded prediction unit is the second category.
[0072] The mode number of the direction prediction mode is the number in the aforementioned mode identification.
[0073] On the other hand, for the to-be-encoded prediction unit, if it is determined according to the encoding information of each neighboring prediction unit that the intra prediction mode of all the neighboring prediction units includes at least two kinds of intra prediction modes in the DC prediction mode, the direction prediction mode and the direction prediction mode, it is determined that the unit category of the to-be-encoded prediction unit is the third category.
[0074] For example, for the to-be-encoded prediction unit, if it is determined according to the encoding information of its neighboring prediction units that the intra prediction mode of all the neighboring prediction units includes the DC prediction mode and the direction prediction mode, it is determined that the unit category of the to-be-encoded prediction unit is the third category.
[0075] For example, for the to-be-encoded prediction unit, if it is determined according to the encoding information of its neighboring prediction units that the intra prediction mode of all the neighboring prediction units includes the planar prediction mode and the direction prediction mode, it is determined that the unit category of the to-be-encoded prediction unit is the third category.
[0076] For example, for the to-be-encoded prediction unit, if it is determined according to the encoding information of its neighboring prediction units that the intra prediction mode of all the neighboring prediction units includes the DC prediction mode, the planar prediction mode and the direction prediction mode, it is determined that the unit category of the to-be-encoded prediction unit is the third category.
[0077] Optionally, for the to-be-encoded prediction unit, if it is determined according to the encoding information of each neighboring prediction unit that the intra prediction modes of all the neighboring prediction units are direction prediction modes, and the difference between the maximum mode sequence number and the minimum mode sequence number in the direction prediction modes corresponding to all the neighboring prediction units is greater than a first threshold, it is determined that the unit category of the to-be-encoded prediction unit is a third category.
[0078] As an example, the following describes the determination of the unit category of the to-be-encoded prediction unit in combination with the following Figure 6 The determination of the unit category of the to-be-encoded prediction unit is exemplarily described. Figure 6 is a schematic diagram of the flow framework for determining the unit category provided by the embodiments of the present application. As shown in Figure 6 For the to-be-encoded prediction unit, the following steps are performed:
[0079] Step 1: First, the prediction unit distribution information of the image block in which the to-be-encoded prediction unit is located is determined, and then it is determined according to the prediction unit distribution information of the image block whether there is a neighboring prediction unit in the image block at each preset relative position compared with the to-be-encoded prediction unit.
[0080] Step 1-1: If there is no neighboring prediction unit in the image block at at least one preset relative position compared with the to-be-encoded prediction unit, it is determined that the unit category of the to-be-encoded prediction unit is a third category.
[0081] Step 1-2: If there is a neighboring prediction unit in the image block at each preset position compared with the to-be-encoded prediction unit, step 2 is performed.
[0082] Step 2: According to the encoding information of each neighboring prediction unit, it is determined whether the intra prediction mode of the corresponding neighboring prediction unit is a direct current prediction mode (DC mode) or a planar prediction mode.
[0083] Step 2-1: If it is determined according to the encoding information of each neighboring prediction unit that the intra prediction mode of the corresponding neighboring prediction unit is a direct current prediction mode or a planar prediction mode, it is determined that the unit category of the to-be-encoded prediction unit is a first category.
[0084] Step 2-2: If it is determined according to the encoding information of each neighboring prediction unit that the intra prediction modes of all the neighboring prediction units include direction prediction modes, step 3 is performed.
[0085] Step 3: It is determined whether the intra prediction modes of all the neighboring prediction units are direction prediction modes.
[0086] Step 3-1: If it is determined that at least one of the intra prediction modes of the neighboring prediction units includes the DC prediction mode and the directional prediction mode, or at least one of the intra prediction modes of the neighboring prediction units includes the planar prediction mode and the directional prediction mode, it is determined that the unit category of the to-be-encoded prediction unit is the third category.
[0087] Step 3-2: If it is determined that all the intra prediction modes of the neighboring prediction units are the directional prediction mode, step 4 is entered.
[0088] Step 4: The difference between the maximum mode sequence number and the minimum mode sequence number in the directional prediction modes of all the neighboring prediction units is determined, and it is determined whether the difference is greater than 3 (the first threshold value).
[0089] Step 4-1: If the difference between the maximum mode sequence number and the minimum mode sequence number in the directional prediction modes of all the neighboring prediction units is greater than 3, it is determined that the unit category of the to-be-encoded prediction unit is the third category.
[0090] Step 4-2: If it is determined that the difference between the maximum mode sequence number and the minimum mode sequence number in the directional prediction modes of all the neighboring prediction units is less than or equal to 3, it is determined that the unit category of the to-be-encoded prediction unit is the second category.
[0091] In the embodiments of the present application, for the to-be-encoded prediction unit, if the unit category of the to-be-encoded prediction unit is the first category, it indicates that the texture of the region where the neighboring prediction units of the to-be-encoded prediction unit are located does not have obvious directionality, and it can be further indicated that the texture of the region where the to-be-encoded prediction unit is located does not have obvious directionality.
[0092] If the unit category of the to-be-encoded prediction unit is the second category, it indicates that the texture of the region where the neighboring prediction units of the to-be-encoded prediction unit are located has obvious and relatively consistent directionality, and it can be further indicated that the texture of the region where the to-be-encoded prediction unit is located has similar directionality to the region where the neighboring prediction units are located.
[0093] If the unit category of the to-be-encoded prediction unit is the third category, it indicates that it cannot be determined whether the to-be-encoded prediction unit has obvious directionality.
[0094] Step S23: The intra prediction mode of the to-be-encoded prediction unit is determined according to the unit category of the to-be-encoded prediction unit.
[0095] After the unit category of the to-be-encoded prediction unit is determined, the intra prediction mode of the to-be-encoded prediction unit can be determined according to the corresponding intra prediction mode determination manner corresponding to the unit category.
[0096] In some possible embodiments, if the unit type of the to-be-encoded prediction unit is the first type, it is indicated that the texture of the region where the neighboring prediction units of the to-be-encoded prediction unit are located does not have obvious directionality, and thus the texture of the region where the to-be-encoded prediction unit is located has a relatively high possibility of not having obvious directionality. In this case, the rate-distortion cost of the to-be-encoded prediction unit in the direct current prediction mode and the planar prediction mode can be determined.
[0097] When the rate-distortion cost of the to-be-encoded prediction unit in the direct current prediction mode is less than the rate-distortion cost in the planar prediction mode, the direct current prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit. When the rate-distortion cost of the to-be-encoded prediction unit in the planar prediction mode is less than the rate-distortion cost in the direct current prediction mode, the planar prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit. When the rate-distortion cost of the to-be-encoded prediction unit in the direct current prediction mode is the same as the rate-distortion cost in the planar prediction mode, the direct current prediction mode or the planar prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0098] Optionally, if the unit type of the to-be-encoded prediction unit is the first type, the rate-distortion cost of the to-be-encoded prediction unit in the direct current prediction mode, the planar prediction mode, the direction prediction mode with the first mode sequence number, and the direction prediction mode with the second mode sequence number is determined.
[0099] When the intra prediction mode with the minimum rate-distortion cost among the direct current prediction mode, the planar prediction mode, the direction prediction mode with the first mode sequence number, and the direction prediction mode with the second mode sequence number is the direct current prediction mode or the planar prediction mode, the intra prediction mode with the minimum rate-distortion cost is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0100] For example, when the intra prediction mode with the minimum rate-distortion cost among the direct current prediction mode, the planar prediction mode, the direction prediction mode with the first mode sequence number, and the direction prediction mode with the second mode sequence number is the direct current prediction mode, the direct current prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0101] For example, when the intra prediction mode with the minimum rate-distortion cost among the direct current prediction mode, the planar prediction mode, the direction prediction mode with the first mode sequence number, and the direction prediction mode with the second mode sequence number is the planar prediction mode, the planar prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0102] When the rate-distortion cost of the intra prediction mode is the smallest among the DC prediction mode, the planar prediction mode, the direction prediction mode with the first mode number, and the direction prediction mode with the second mode number, and the intra prediction mode with the smallest rate-distortion cost is the direction prediction mode (the direction prediction mode with the first mode number or the direction prediction mode with the second mode number), the rate-distortion cost of the to-be-encoded prediction unit in the direction prediction mode with other mode numbers is determined, and the first prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0103] The first prediction mode is the direction prediction mode with the smallest rate-distortion cost among the direction prediction modes with all mode numbers.
[0104] The direction prediction mode with the first mode number can be a horizontal direction prediction mode among all direction prediction modes, and the direction prediction mode with the second mode number can be a vertical direction prediction mode among all direction prediction modes.
[0105] For example, in the HEVC / H.265 standard, the direction prediction mode with the first mode number can be the H0 prediction mode numbered 10, and the first mode number is 10; and the direction prediction mode with the second mode number can be the V0 prediction mode numbered 26, and the second mode number is 26.
[0106] In some possible embodiments, if the unit category of the to-be-encoded prediction unit is the second category, it indicates that the texture of the region where the to-be-encoded prediction unit is located has obvious and relatively consistent directionality, and thus it is more likely that the texture of the region where the to-be-encoded prediction unit is located has a similar directionality to the region where the neighboring prediction unit is located. In this case, the rate-distortion cost of the to-be-encoded prediction unit in the direction prediction mode corresponding to each neighboring prediction unit is determined, and the intra prediction mode with the smallest rate-distortion cost among the direction prediction modes corresponding to each neighboring prediction unit is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0107] Alternatively, if the unit category of the to-be-encoded prediction unit is the second category, the to-be-encoded prediction unit still has a certain possibility of not having obvious directionality, and in this case, the rate-distortion cost of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, and the direction prediction mode corresponding to each neighboring prediction unit is determined.
[0108] When the intra prediction mode with the smallest rate-distortion cost is the direction prediction mode among the DC prediction mode, the planar prediction mode, and the direction prediction mode corresponding to each neighboring prediction unit, the second prediction mode is determined as the direction prediction mode with the smallest rate-distortion cost among the direction prediction modes corresponding to all neighboring prediction units.
[0109] The second prediction mode is a direction prediction mode corresponding to each neighboring prediction unit, and the rate-distortion cost of the second prediction mode is the minimum among the rate-distortion costs of the direction prediction modes.
[0110] When the rate-distortion cost of the DC prediction mode, the rate-distortion cost of the planar prediction mode, and the rate-distortion cost of the direction prediction mode corresponding to each neighboring prediction unit are compared, the intra prediction mode with the minimum rate-distortion cost is the DC prediction mode or the planar prediction mode, which indicates that the texture of the region where the to-be-encoded prediction unit is located is possibly inconsistent with the texture of the region where the neighboring to-be-encoded prediction units are located. Therefore, the rate-distortion costs of the direction prediction modes with other mode numbers of the to-be-encoded prediction unit can be determined. Thus, the third prediction mode can be determined as the intra prediction mode of the to-be-encoded prediction unit.
[0111] The third prediction mode is an intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and all direction prediction modes except the direction prediction modes corresponding to all neighboring prediction units.
[0112] In some possible implementation manners, if the unit category of the to-be-encoded prediction unit is the third category, it is unable to determine whether the to-be-encoded prediction unit has obvious directionality. In this case, the rate-distortion costs of the DC prediction mode, the planar prediction mode, and all direction prediction modes of the to-be-encoded prediction unit can be determined.
[0113] Further, the fourth prediction mode can be determined as the intra prediction mode of the to-be-encoded prediction unit. The fourth prediction mode is an intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and all direction prediction modes.
[0114] As an example, the following describes the determination of the intra prediction mode of the to-be-encoded prediction unit with reference to the accompanying drawings. Figure 7 The determination of the intra prediction mode of the to-be-encoded prediction unit is exemplarily described. Figure 7 FIG. 1 is a schematic diagram of a flow framework for determining an intra prediction mode according to an embodiment of the present application. As shown in FIG. 1, for a to-be-encoded prediction unit: Figure 7
[0115] Step 1: First, prediction unit distribution information of an image block where the to-be-encoded prediction unit is located is determined, and then the unit category of the to-be-encoded prediction unit is determined according to the prediction unit distribution information of the image block.
[0116] Step 2: After the unit category of the to-be-encoded prediction unit is determined, it is judged whether the unit category of the to-be-encoded prediction unit is the first category. If the unit category of the to-be-encoded prediction unit is the first category, step 3 is entered, otherwise step 4 is entered.
[0117] Step 3: determine the rate-distortion cost of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, the horizontal directional prediction mode, and the vertical directional prediction mode.
[0118] If the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, the horizontal directional prediction mode, and the vertical directional prediction mode is the DC prediction mode or the planar prediction mode, the intra prediction mode with the minimum rate-distortion cost is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0119] If the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, the horizontal directional prediction mode, and the vertical directional prediction mode is a directional prediction mode, the rate-distortion cost of the intra prediction mode in all other directional prediction modes is determined, and the directional prediction mode with the minimum rate-distortion cost among all the directional prediction modes is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0120] Step 4: if the unit category of the to-be-encoded prediction unit is not the first category, determine whether the unit category of the to-be-encoded prediction unit is the second category. If the unit category of the to-be-encoded prediction unit is the second category, proceed to Step 5, otherwise proceed to Step 6.
[0121] Step 5: determine the rate-distortion cost of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, and the directional prediction mode corresponding to each neighboring prediction unit.
[0122] If the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and the directional prediction mode corresponding to each neighboring prediction unit is a directional prediction mode, the directional prediction mode with the minimum rate-distortion cost among the directional prediction modes corresponding to all the neighboring prediction units is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0123] If the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and the directional prediction mode corresponding to each neighboring prediction unit is the DC prediction mode or the planar prediction mode, the rate-distortion cost of the to-be-encoded prediction unit in all other directional prediction modes except the directional prediction modes corresponding to all the neighboring prediction units is determined, and the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and all other directional prediction modes except the directional prediction modes corresponding to all the neighboring prediction units is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0124] Step 6: if the unit category of the to-be-encoded prediction unit is the third category, determine the rate-distortion cost of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, and all the directional prediction modes.
[0125] Further, the intra prediction mode with the minimum rate-distortion cost among the direct current prediction mode, the planar prediction mode and all direction prediction modes is determined as the intra prediction mode of the to-be-encoded prediction unit.
[0126] In the embodiments of the present application, for each to-be-encoded prediction unit, after the unit category of the to-be-encoded prediction unit is determined by the prediction unit distribution information of the image block in which the to-be-encoded prediction unit is located, the intra prediction mode of the to-be-encoded prediction unit can be directly determined according to the unit category of the to-be-encoded prediction unit, without the need to traverse all the intra prediction modes for the to-be-encoded prediction unit to determine the optimal intra prediction mode. Moreover, based on the unit category of the to-be-encoded prediction unit, different intra prediction mode determination methods can be effectively adopted according to the texture difference between the region in which the to-be-encoded prediction unit is located and the region in which the neighboring prediction unit is located, so as to reduce the proportion of intra prediction encoding in the complexity of video encoding, reduce the encoding complexity and save the computing resources, thereby improving the video encoding efficiency and having high applicability.
[0127] In some feasible embodiments, for a video frame, the intra prediction mode of each prediction unit in the video frame can be determined based on the above-mentioned manner, and then the intra prediction encoding is performed based on the intra prediction mode of each prediction unit, so as to further realize the encoding of the video data based on the above-mentioned implementation manner.
[0128] Specifically, the video frame can be divided into non-overlapping coding units, and each coding unit is divided into non-overlapping prediction units. Further, the spatial correlation and the temporal correlation between the video frames are utilized, and the inter prediction and the intra prediction mode are respectively adopted to perform the intra prediction to remove the spatial and temporal redundancy information, so as to obtain a prediction image block. Further, the prediction image block is subtracted from the original image block to obtain a prediction residual block, and then the prediction residual is subjected to discrete cosine transform (DCT) and quantization to obtain quantized DCT coefficients. Finally, the quantized DCT coefficients are subjected to entropy encoding to obtain a compressed code stream, that is, the encoded video data.
[0129] For the encoded video data, the encoded video data can be sent to a corresponding streaming media device to enable the streaming media to perform video playing based on the encoded video data, or the encoded video data can be stored in a specified storage space to directly obtain the encoded video data from the specified storage space when the video data needs to be encoded.
[0130] The specified storage space includes but is not limited to cloud storage, a database, a blockchain and a storage space of a device performing a model training task, and the like, and the specific implementation can be determined based on the actual application scene requirements, which is not limited herein.
[0131] The database can be briefly regarded as an electronic file cabinet, i.e., a place for storing electronic files, which can be a relational database (SQL database) or a non-relational database (NoSQL database), and is not limited herein. In the present application, the coded video data and the rate-distortion cost of each prediction unit in the intra-frame prediction mode in each frame can be stored. The blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. The blockchain is essentially a decentralized database, which is a series of data blocks associated by using cryptographic methods. In the embodiments of the present application, each data block in the blockchain can store the coded video data and the rate-distortion cost of each prediction unit in the intra-frame prediction mode in each frame. The cloud storage is a new concept extended and developed on the basis of the cloud computing concept, which refers to the collection of a large number of various types of storage devices (storage nodes) in the network through the functions of cluster application, grid technology, and distributed storage file system, and the coordinated work of the storage devices through application software or application interface to store the coded video data and the rate-distortion cost of each prediction unit in the intra-frame prediction mode in each frame.
[0132] In the embodiments of the present application, the rate-distortion cost calculation and the determination of the neighboring prediction units can be realized based on the cloud computing technology in the field of cloud technology to improve the calculation efficiency.
[0133] The cloud technology refers to a hosting technology for unifying a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. The cloud technology is a general term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies applied based on the cloud computing business model, which can form a resource pool and be used on demand in a flexible and convenient manner. The cloud computing technology will become an important support. The background service of a technical network system requires a large amount of calculation and storage resources, such as video websites, picture websites, and more portals. With the high development and application of the Internet industry, in the future, each item is likely to have its own identification mark and needs to be transmitted to the background system for logical processing. Different levels of data will be processed separately, and the data of various industries all need strong system support, which can only be realized through cloud computing.
[0134] Cloud computing is a computing mode, which is the product of the development and integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage, virtualization, load balancing, etc. Cloud computing distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network providing resources is called "cloud", and the resources in the "cloud" can be infinitely expanded and can be obtained at any time, used on demand, expanded at any time, and paid according to use.
[0135] Referring to FIG. 4, FIG. 4 is a structural schematic diagram of an intra prediction mode determination apparatus provided by an embodiment of the present application. The intra prediction mode determination apparatus provided by an embodiment of the present application comprises:
[0136] an information determination module configured to determine prediction unit distribution information of an image block in which a current to-be-encoded prediction unit is located;
[0137] a category determination module configured to determine a unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block;
[0138] a mode determination module configured to determine an intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit.
[0139] In some possible implementation manners, when determining the unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block, the category determination module is configured to:
[0140] in response to determining that there is a neighbor prediction unit in each preset relative position compared with the to-be-encoded prediction unit in the image block according to the prediction unit distribution information of the image block, determining the unit category of the to-be-encoded prediction unit according to encoding information of each neighbor prediction unit.
[0141] In some possible implementation manners, when determining the unit category of the to-be-encoded prediction unit according to the encoding information of each neighbor prediction unit, the category determination module is configured to:
[0142] in response to determining that an intra prediction mode of a corresponding neighbor prediction unit is a direct current prediction mode or a planar prediction mode according to the encoding information of each neighbor prediction unit, determining that the unit category of the to-be-encoded prediction unit is a first category;
[0143] in response to determining, according to the coding information of each neighboring prediction unit, that the intra prediction modes of all the neighboring prediction units are direction prediction modes and that a difference between a maximum mode index and a minimum mode index among the direction prediction modes of all the neighboring prediction units is less than or equal to a first threshold, determining that the unit category of the to-be-coded prediction unit is a second category.
[0144] In some possible implementation manners, the category determining module is further configured to:
[0145] in response to determining, according to the coding information of each neighboring prediction unit, that the intra prediction modes of all the neighboring prediction units include at least a direct current prediction mode and a direction prediction mode, or include at least a planar prediction mode and a direction prediction mode, determining that the unit category of the to-be-coded prediction unit is a third category;
[0146] in response to determining, according to the coding information of each neighboring prediction unit, that the intra prediction modes of all the neighboring prediction units are direction prediction modes and that a difference between a maximum mode index and a minimum mode index among the direction prediction modes of all the neighboring prediction units is greater than the first threshold, determining that the unit category of the to-be-coded prediction unit is the third category.
[0147] In some possible implementation manners, the category determining module is further configured to:
[0148] in response to determining, according to the prediction unit distribution information of the image block, that there is no neighboring prediction unit in at least one preset relative position of the to-be-coded prediction unit in the image block, determining that the unit category of the to-be-coded prediction unit is the third category.
[0149] In some possible implementation manners, the unit category of the to-be-coded prediction unit is the first category.
[0150] The mode determining module is configured to:
[0151] determine rate-distortion costs of the to-be-coded prediction unit in a direct current prediction mode, a planar prediction mode, a direction prediction mode with a first mode index, and a direction prediction mode with a second mode index;
[0152] in response to the rate-distortion cost of the direct current prediction mode, the planar prediction mode, the direction prediction mode with the first mode index, and the direction prediction mode with the second mode index being the smallest in the direct current prediction mode, the planar prediction mode, the direction prediction mode with the first mode index, and the direction prediction mode with the second mode index, determining that the rate-distortion cost of the smallest intra prediction mode as the intra prediction mode of the to-be-coded prediction unit;
[0153] In response to the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, the directional prediction mode with the first mode index, and the directional prediction mode with the second mode index being the directional prediction mode, the first prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, and the first prediction mode is the directional prediction mode with the minimum rate-distortion cost among the directional prediction modes with all mode indexes.
[0154] In some possible implementation manners, the unit category of the to-be-encoded prediction unit is the second category.
[0155] When determining the intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit, the mode determination module is configured to:
[0156] determine the rate-distortion costs of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, and the directional prediction mode corresponding to each neighboring prediction unit;
[0157] In response to the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and the directional prediction mode corresponding to each neighboring prediction unit being the directional prediction mode, the second prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, and the second prediction mode is the directional prediction mode with the minimum rate-distortion cost among the directional prediction modes corresponding to all neighboring prediction units.
[0158] In response to the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and the directional prediction mode corresponding to each neighboring prediction unit being the DC prediction mode or the planar prediction mode, the third prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, and the third prediction mode is the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and all directional prediction modes except the directional prediction modes corresponding to all neighboring prediction units.
[0159] In some possible implementation manners, the unit category of the to-be-encoded prediction unit is the third category.
[0160] When determining the intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit, the mode determination module is configured to:
[0161] determine the rate-distortion costs of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, and all directional prediction modes;
[0162] determine the fourth prediction mode as the intra prediction mode of the to-be-encoded prediction unit, and the fourth prediction mode is the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and all directional prediction modes.
[0163] In specific implementations, the apparatus can perform the implementation manners provided by the above steps through various functional modules built therein. For details, refer to the implementation manners provided by the above steps, which will not be repeated here. Figure 2
[0164] Referring to Figure 9 , Figure 9 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 9 , the electronic device 900 in the embodiment can include a processor 901, a network interface 904, and a memory 905. In addition, the electronic device 900 can further include an object interface 903 and at least one communication bus 902. The communication bus 902 is used to realize the connection and communication between the components. The object interface 903 can include a display, a keyboard, and can further include a standard wired interface and a wireless interface. The network interface 904 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 905 can be a high-speed RAM memory or a non-volatile memory (NVM), such as at least one disk memory. The memory 905 can also be at least one storage device located away from the processor 901. As shown in Figure 9 , the memory 905 as a computer readable storage medium can include an operating system, a network communication module, an object interface module, and a device control application program.
[0165] In the electronic device 900 shown in Figure 9 , the network interface 904 can provide network communication functions; the object interface 903 is mainly used to provide an input interface for the object; and the processor 901 can be used to call the device control application program stored in the memory 905 to realize:
[0166] determining prediction unit distribution information of an image block in which a current to-be-encoded prediction unit is located;
[0167] determining a unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block;
[0168] determining an intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit.
[0169] In some possible implementations, when the processor 901 determines the unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block, the processor 901 is configured to:
[0170] determining, in response to the prediction unit distribution information of the image block, that there is a neighboring prediction unit in each preset relative position compared with the to-be-encoded prediction unit in the image block, and determining the unit category of the to-be-encoded prediction unit according to the encoding information of each neighboring prediction unit.
[0171] In some possible implementation manners, when the processor 901 determines the unit category of the to-be-encoded prediction unit according to the encoding information of each neighboring prediction unit, the processor 901 is configured to:
[0172] determining that the unit category of the to-be-encoded prediction unit is a first category, in response to determining, according to the encoding information of each neighboring prediction unit, that the intra prediction mode of the corresponding neighboring prediction unit is a direct current (DC) prediction mode or a planar prediction mode.
[0173] determining that the unit category of the to-be-encoded prediction unit is a second category, in response to determining, according to the encoding information of each neighboring prediction unit, that the intra prediction mode of all the neighboring prediction units is a direction prediction mode, and that the difference between the maximum mode sequence number and the minimum mode sequence number in the direction prediction modes of all the neighboring prediction units is less than or equal to a first threshold.
[0174] In some possible implementation manners, the processor 901 is further configured to:
[0175] determining that the unit category of the to-be-encoded prediction unit is a third category, in response to determining, according to the encoding information of each neighboring prediction unit, that the intra prediction mode of all the neighboring prediction units at least includes a DC prediction mode and a direction prediction mode, or at least includes a planar prediction mode and a direction prediction mode.
[0176] determining that the unit category of the to-be-encoded prediction unit is the third category, in response to determining, according to the encoding information of each neighboring prediction unit, that the intra prediction mode of all the neighboring prediction units is a direction prediction mode, and that the difference between the maximum mode sequence number and the minimum mode sequence number in the direction prediction modes of all the neighboring prediction units is greater than the first threshold.
[0177] In some possible implementation manners, the processor 901 is further configured to:
[0178] determining that the unit category of the to-be-encoded prediction unit is the third category, in response to determining, according to the prediction unit distribution information of the image block, that there is no neighboring prediction unit in at least one preset relative position compared with the to-be-encoded prediction unit in the image block.
[0179] In some possible implementation manners, the unit category of the to-be-encoded prediction unit is the first category.
[0180] The processor 901 is configured to determine the intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit, and is configured to:
[0181] determine rate-distortion costs of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, the direction prediction mode with the first mode number, and the direction prediction mode with the second mode number;
[0182] in response to the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, the direction prediction mode with the first mode number, and the direction prediction mode with the second mode number being the DC prediction mode or the planar prediction mode, determine the intra prediction mode of the to-be-encoded prediction unit as the intra prediction mode with the minimum rate-distortion cost;
[0183] in response to the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, the direction prediction mode with the first mode number, and the direction prediction mode with the second mode number being the direction prediction mode, determine the first prediction mode as the intra prediction mode of the to-be-encoded prediction unit, the first prediction mode being the direction prediction mode with the minimum rate-distortion cost among the direction prediction modes with all mode numbers.
[0184] In some possible implementation manners, the unit category of the to-be-encoded prediction unit is the second category.
[0185] The processor 901 is configured to determine the intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit, and is configured to:
[0186] determine rate-distortion costs of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, and the direction prediction mode corresponding to each neighboring prediction unit;
[0187] in response to the intra prediction mode with the minimum rate-distortion cost among the DC prediction mode, the planar prediction mode, and the direction prediction mode corresponding to each neighboring prediction unit being the direction prediction mode, determine the second prediction mode as the intra prediction mode of the to-be-encoded prediction unit, the second prediction mode being the direction prediction mode with the minimum rate-distortion cost among the direction prediction modes corresponding to all neighboring prediction units;
[0188] In response to the rate-distortion cost of the DC prediction mode, the planar prediction mode, and the direction prediction mode corresponding to each neighboring prediction unit being the smallest, the third prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, and the third prediction mode is the intra prediction mode with the smallest rate-distortion cost among the DC prediction mode, the planar prediction mode, and all other direction prediction modes except the direction prediction mode corresponding to each neighboring prediction unit.
[0189] In some possible implementation manners, the unit category of the to-be-encoded prediction unit is the third category.
[0190] When the processor 901 determines the intra prediction mode of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit, the processor 901 is configured to:
[0191] determine the rate-distortion cost of the to-be-encoded prediction unit in the DC prediction mode, the planar prediction mode, and all direction prediction modes.
[0192] The fourth prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, and the fourth prediction mode is the intra prediction mode with the smallest rate-distortion cost among the DC prediction mode, the planar prediction mode, and all direction prediction modes.
[0193] It should be understood that, in some possible implementation manners, the processor 901 can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor and the like. The memory can include a read-only memory and a random access memory, and provide instructions and data for the processor. A portion of the memory can also include a nonvolatile random access memory. For example, the memory can also store device type information.
[0194] In specific implementations, the electronic device 900 can perform the implementation manners provided in each of the steps of the method 1000 by using various function modules in the electronic device 900. For details, refer to the implementation manners provided in each of the steps of the method 1000, which will not be described here again. Figure 2 In specific implementations, the electronic device 900 can perform the implementation manners provided in each of the steps of the method 1000 by using various function modules in the electronic device 900. For details, refer to the implementation manners provided in each of the steps of the method 1000, which will not be described here again.
[0195] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method provided by the embodiment of the present application Figure 2 The method provided by each step in the embodiment of the present application can refer to the implementation manner of each step provided above, and details are not described herein.
[0196] The computer readable storage medium can be an internal storage unit of the intra prediction mode determination apparatus or the electronic device provided by any one of the preceding embodiments, for example, a hard disk or a memory of the electronic device. The computer readable storage medium can also be an external storage device of the electronic device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. The computer readable storage medium can further include a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), and the like. Further, the computer readable storage medium can include both the internal storage unit and the external storage device of the electronic device. The computer readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer readable storage medium can also be used to temporarily store data that has been output or will be output.
[0197] The embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement the method provided by each step in the embodiment of the present application. Figure 2 The method provided by each step in the embodiment of the present application.
[0198] The terms "first", "second", and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. Except when otherwise noted, the terms "comprise", "comprises", "comprising" and the like are to be construed in an open, non- limiting fashion. For example, a process, method, system, product, or apparatus that comprises several elements is not necessarily limited to those elements, but can include other elements not expressly listed or inherent to such process, method, system, product, or apparatus. Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase "in an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily all directed to the same embodiment, or to one or more of the same embodiments. Those of ordinary skill in the art will recognize that the embodiments described herein can readily be combined, combined and / or rearranged, dependent on the application, without necessarily departing from the scope of the application. The term "and / or" used in the application means any combination of the associated listed items, as well as all possible combinations of the items, and includes these combinations.
[0199] Those of ordinary skill in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality, without referring to a specific sequence of operations for implementing the function, unless specifically described as such. Dependency of the described features on a specific
[0200] The foregoing is merely illustrative of the principles of this application and various modifications can be made by those skilled in the art without departing from the scope of the application. The above-described embodiments are merely meant to be illustrative of the principles of this application and are not meant to limit the scope of the application.
Claims
1. A method for intra prediction mode determination, the method comprising: The method comprises: determining prediction unit distribution information of a current image block in which a to-be-encoded prediction unit is located; determining a unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block; determining a range of intra prediction modes for calculating a rate-distortion cost of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit, determining an intra prediction mode with a minimum rate-distortion cost in the range, and determining an intra prediction mode of the to-be-encoded prediction unit based on the intra prediction mode with the minimum rate-distortion cost; the determining of the unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block comprises: determining whether there are neighboring prediction units in each preset relative position of the to-be-encoded prediction unit in the image block based on the prediction unit distribution information; when there are neighboring prediction units in each preset relative position, determining an intra prediction mode of each neighboring prediction unit according to encoding information of the neighboring prediction unit, and determining the unit category of the to-be-encoded prediction unit based on the intra prediction modes of the neighboring prediction units; when the intra prediction modes of the neighboring prediction units are all DC prediction modes or planar prediction modes, determining that the unit category of the to-be-encoded prediction unit is a first category; when the intra prediction modes of the neighboring prediction units are all direction prediction modes, and a difference between a maximum mode number and a minimum mode number in the direction prediction modes of all the neighboring prediction units is less than or equal to a first threshold, determining that the unit category of the to-be-encoded prediction unit is a second category; otherwise, determining that the unit category of the to-be-encoded prediction unit is a third category; when there are no neighboring prediction units in at least one preset relative position of the to-be-encoded prediction unit, determining that the unit category of the to-be-encoded prediction unit is the third category.
2. The method of claim 1, wherein, the unit category of the to-be-encoded prediction unit is the first category; the determining of the range of intra prediction modes for calculating the rate-distortion cost of the to-be-encoded prediction unit according to the unit category of the to-be-encoded prediction unit, the determining of the intra prediction mode with the minimum rate-distortion cost in the range, and the determining of the intra prediction mode of the to-be-encoded prediction unit based on the intra prediction mode with the minimum rate-distortion cost comprise: the range of intra prediction modes for calculating the rate-distortion cost of the to-be-encoded prediction unit comprises a DC prediction mode, a planar prediction mode, a direction prediction mode with a first mode number, and a direction prediction mode with a second mode number; the intra prediction mode with the minimum rate-distortion cost is determined in the range; if the intra prediction mode with the minimum rate-distortion cost is the DC prediction mode or the planar prediction mode, the intra prediction mode with the minimum rate-distortion cost is determined as the intra prediction mode of the to-be-encoded prediction unit; if the intra prediction mode with the minimum rate-distortion cost is the direction prediction mode, a first prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, the first prediction mode being a direction prediction mode with the minimum rate-distortion cost among all the direction prediction modes.
3. The method of claim 2, wherein, The direction prediction mode with the first mode sequence number is a horizontal direction prediction mode among all direction prediction modes, and the direction prediction mode with the second mode sequence number is a vertical direction prediction mode among all direction prediction modes.
4. The method of claim 1, wherein, The unit category of the to-be-encoded prediction unit is a second category; The method comprises the following steps: The range of the intra prediction mode for calculating the rate-distortion cost of the to-be-encoded prediction unit comprises a direct current prediction mode, a planar prediction mode, and a direction prediction mode corresponding to each neighboring prediction unit; and the intra prediction mode with the minimum rate-distortion cost is determined in the range. If the intra prediction mode with the minimum rate-distortion cost is a direction prediction mode, a second prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, the second prediction mode being a direction prediction mode with the minimum rate-distortion cost among all direction prediction modes corresponding to all neighboring prediction units. If the intra prediction mode with the minimum rate-distortion cost is a direct current prediction mode or a planar prediction mode, a third prediction mode is determined as the intra prediction mode of the to-be-encoded prediction unit, the third prediction mode being an intra prediction mode with the minimum rate-distortion cost among a direct current prediction mode, a planar prediction mode, and all other direction prediction modes except the direction prediction modes corresponding to all neighboring prediction units.
5. The method of claim 1, wherein, The unit category of the to-be-encoded prediction unit is a third category; The method comprises the following steps: The range of the intra prediction mode for calculating the rate-distortion cost of the to-be-encoded prediction unit comprises a direct current prediction mode, a planar prediction mode, and all direction prediction modes; and the intra prediction mode with the minimum rate-distortion cost is determined in the range. The intra prediction mode with the minimum rate-distortion cost is determined as the intra prediction mode of the to-be-encoded prediction unit.
6. The method according to any one of claims 1 to 5, characterized in that, The first threshold value is 3.
7. An intra-frame prediction mode determination apparatus, characterized in that, The apparatus comprises: An information determination module configured to determine prediction unit distribution information of an image block in which a current to-be-encoded prediction unit is located; A category determination module configured to determine a unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block; A mode determination module configured to determine, according to the unit category of the to-be-encoded prediction unit, a range of intra prediction modes for calculating a rate-distortion cost of the to-be-encoded prediction unit, determine an intra prediction mode with a minimum rate-distortion cost in the range, and determine an intra prediction mode of the to-be-encoded prediction unit based on the intra prediction mode with the minimum rate-distortion cost. The category determining module is configured to determine the unit category of the to-be-encoded prediction unit according to the prediction unit distribution information of the image block, and specifically configured to: determine whether there is a neighbor prediction unit at each preset relative position of the to-be-encoded prediction unit based on the prediction unit distribution information; when there is a neighbor prediction unit at each preset relative position, determine the intra prediction mode of each neighbor prediction unit according to the encoding information of each neighbor prediction unit, and determine the unit category of the to-be-encoded prediction unit based on the intra prediction mode of each neighbor prediction unit; when the intra prediction mode of each neighbor prediction unit is a direct current prediction mode or a planar prediction mode, determine that the unit category of the to-be-encoded prediction unit is a first category; when the intra prediction mode of each neighbor prediction unit is a direction prediction mode, and the difference between the maximum mode number and the minimum mode number in the direction prediction mode of all neighbor prediction units is less than or equal to a first threshold, determine that the unit category of the to-be-encoded prediction unit is a second category; otherwise, determine that the unit category of the to-be-encoded prediction unit is a third category; when at least one preset relative position of the to-be-encoded prediction unit does not have a neighbor prediction unit, determine that the unit category of the to-be-encoded prediction unit is the third category.
8. The apparatus for determining intra prediction mode according to claim 7, wherein, The unit category of the to-be-encoded prediction unit is the first category. The mode determining module is specifically configured to: determine that the range of intra prediction modes for calculating the rate-distortion cost of the to-be-encoded prediction unit includes a direct current prediction mode, a planar prediction mode, a direction prediction mode with a first mode number, and a direction prediction mode with a second mode number; and determine the intra prediction mode with the minimum rate-distortion cost in the range; if the intra prediction mode with the minimum rate-distortion cost is the direct current prediction mode or the planar prediction mode, determine the intra prediction mode with the minimum rate-distortion cost as the intra prediction mode of the to-be-encoded prediction unit; if the intra prediction mode with the minimum rate-distortion cost is the direction prediction mode, determine a first prediction mode as the intra prediction mode of the to-be-encoded prediction unit, the first prediction mode being the direction prediction mode with the minimum rate-distortion cost among all direction prediction modes.
9. The apparatus for determining intra prediction mode according to claim 8, wherein, The direction prediction mode with the first mode number is a horizontal direction prediction mode among all direction prediction modes, and the direction prediction mode with the second mode number is a vertical direction prediction mode among all direction prediction modes.
10. The apparatus for determining intra prediction mode according to claim 7, wherein, The unit category of the to-be-encoded prediction unit is the second category. The mode determining module is specifically configured to: determine that the range of intra prediction modes for calculating the rate-distortion cost of the to-be-encoded prediction unit includes a direct current prediction mode, a planar prediction mode, and a direction prediction mode corresponding to each neighbor prediction unit; and determine the intra prediction mode with the minimum rate-distortion cost in the range. if the intra prediction mode with the minimum rate-distortion cost is a directional prediction mode, determining a second prediction mode as the intra prediction mode of the to-be-encoded prediction unit, the second prediction mode being a directional prediction mode with the minimum rate-distortion cost among directional prediction modes corresponding to all neighboring prediction units; if the intra prediction mode with the minimum rate-distortion cost is a DC prediction mode or a planar prediction mode, determining a third prediction mode as the intra prediction mode of the to-be-encoded prediction unit, the third prediction mode being an intra prediction mode with the minimum rate-distortion cost among a DC prediction mode, a planar prediction mode, and all directional prediction modes except directional prediction modes corresponding to all neighboring prediction units.
11. The apparatus for determining intra prediction mode according to claim 7, wherein, the unit category of the to-be-encoded prediction unit is a third category; the mode determining module is specifically configured to: determine a range of intra prediction modes for calculating the rate-distortion cost of the to-be-encoded prediction unit, the range including a DC prediction mode, a planar prediction mode, and all directional prediction modes; and determine an intra prediction mode with the minimum rate-distortion cost in the range. determine the intra prediction mode with the minimum rate-distortion cost as the intra prediction mode of the to-be-encoded prediction unit.
12. The apparatus for determining an intra prediction mode according to any of claims 7-11, wherein, the first threshold is 3.
13. An electronic device, comprising: a processor and a memory, which are connected to each other; the memory is configured to store a computer program; the processor is configured to execute the computer program to implement the method in any one of claims 1 to 6 when the computer program is invoked.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method in any one of claims 1 to 6.
15. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is executed by a processor to implement the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for pridicting sortable complex in frame
CN1615020A