Coding method and device, decoding method and device
By dividing multi-layer encoding unit and comparing parameters of image frames, determining the partitioning method that meets preset conditions is solved, and the major problem of code stream overhead caused by the need to write CLIF in the prior art is solved, and a more efficient encoding method is realized.
Patent Information
- Application Number
- CN202210050365.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-01-17
AI Technical Summary
In the prior art, the CLIF of each LCU needs to be written to the code stream, resulting in a large overhead of the code stream.
The current image frame is divided into encoding units with N layers, and by comparing the parameters of the upper layer encoding unit and the lower layer encoding unit, a division method that meets the preset conditions is determined, and the division method and filter information are written into the encoding information without introducing CLIF for each encoding unit.
Reduces code stream overhead, improves encoding efficiency, and reduces code rate consumption.
Smart Images

Figure CN114222120B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to an encoding method and device, and a decoding method and device. Background Art
[0002] In-loop filtering is a key module in video codecs. Its primary purpose is to ensure the objective and subjective quality of the reconstructed image after inverse transformation, further improving coding efficiency. With the development of new-generation video codec standards, an increasing number of frame-level, cross-component sample compensation filtering techniques are being adopted in the in-loop filtering module. Currently, most cross-component sample compensation filtering techniques use a frame-level rate-distortion optimization approach. Using the largest coding unit (LCU) as the filtering unit, M (1≤M≤MaxNum, where MaxNum is the maximum number of filters allowed to be derived) sets of filters are derived for the current image frame. Each LCU then adaptively selects the optimal set of filters for filtering. However, this approach requires the introduction of a syntax element (such as CCSAO_LCU_Indicated_Flag, abbreviated as CLIF) for each LCU to identify the selected filter set. This means that the CLIF for each LCU must be written into the bitstream and sent to the decoder, resulting in significant bitstream overhead. Summary of the Invention
[0003] The present disclosure provides an encoding method and apparatus, and a decoding method and apparatus, to at least solve the problem in the related art that a CLIF of each LCU needs to be written into a bitstream, resulting in a large bitstream overhead.
[0004] According to a first aspect of an embodiment of the present disclosure, a coding method is provided, comprising: dividing a current image frame into coding units having N layers, wherein each upper-layer coding unit is divided into multiple lower-layer coding units, and N is a positive integer; comparing parameters of the upper-layer coding unit with parameters of the multiple lower-layer coding units included in the upper-layer coding unit, and determining a division method in which the comparison result satisfies a preset condition; and writing the division method and information of filters of the coding units into which the current image frame is divided according to the division method into coding information.
[0005] Optionally, the parameters of the upper-layer coding unit and the parameters of the multiple lower-layer coding units included in the upper-layer coding unit are compared to determine a division method in which the comparison result satisfies a preset condition, including: starting from the N-1th layer as the current layer, and performing the following operations in order from the lower layer to the upper layer until the first layer: comparing the parameters of the coding unit of the current layer and the parameters of the multiple lower-layer coding units included in the coding unit; if the comparison result satisfies the preset condition, the coding unit of the current layer is not updated; if the comparison result does not meet the preset condition, the coding unit of the current layer is updated to the multiple lower-layer coding units included in the coding unit; based on the division method corresponding to the coding unit of the first layer after the loop is executed, the division method in which the comparison result satisfies the preset condition is used.
[0006] Optionally, when the parameter is rate-distortion cost, the preset condition is that the rate-distortion cost of the coding unit of the current layer is less than the sum of the rate-distortion costs of multiple lower-layer coding units included in the coding unit.
[0007] Optionally, based on the division method corresponding to the coding unit of the first layer after the loop is executed, after the comparison result satisfies the preset conditions, it also includes: using the filter information corresponding to the coding unit of the first layer after the loop is executed as the filter information of the coding unit divided by the division method in the current image frame.
[0008] Optionally, the division method and information about filters of coding units divided according to the division method are written into the coding information, including: writing the division method, information about filters of coding units divided according to the division method, and a filter switch identifier of the coding units divided according to the division method into the coding information, wherein the filter switch identifier is used to indicate whether the corresponding coding unit needs to be filtered.
[0009] According to a second aspect of an embodiment of the present disclosure, a decoding method is provided, comprising: receiving encoding information, wherein the encoding information includes a division method of a current image frame and filter information of coding units divided into the current image frame according to the division method, the division method being a division method in which a comparison result obtained by comparing parameters of an upper-layer coding unit with parameters of multiple lower-layer coding units included in the upper-layer coding unit meets preset conditions, and the current image frame is divided into coding units having N layers, where N is a positive integer; filtering the current image frame based on the division method and information of filters corresponding to coding units divided into the current image frame according to the division method.
[0010] Optionally, before filtering the current image frame based on the division method and the information of the filter corresponding to the coding unit divided by the current image frame according to the division method, it also includes: for each coding unit in the coding unit divided by the current image frame according to the division method, performing the following operations: based on the filter switch identifier corresponding to the current coding unit in the coding information, determining that the current coding unit needs to be filtered; based on the information of the filter corresponding to the current coding unit, filtering the current coding unit.
[0011] According to a third aspect of an embodiment of the present disclosure, there is provided an encoding device, including: a division unit, configured to divide a current image frame into encoding units having N layers, wherein each upper-layer encoding unit is divided into multiple lower-layer encoding units, and N is a positive integer; a determination unit, configured to compare parameters of the upper-layer encoding unit with parameters of the multiple lower-layer encoding units included in the upper-layer encoding unit, and determine a division method whose comparison result satisfies a preset condition; and a writing unit, configured to write information of the division method and filters of the encoding units divided by the current image frame according to the division method into the encoding information.
[0012] Optionally, the determination unit is further configured to perform the following operations in order from the lower layer to the upper layer, starting from the N-1th layer as the current layer, until the 1st layer: compare the parameters of the coding unit of the current layer with the parameters of the multiple lower-layer coding units included in the coding unit; if the comparison result meets the preset conditions, do not update the coding unit of the current layer; if the comparison result does not meet the preset conditions, update the coding unit of the current layer to the multiple lower-layer coding units included in the coding unit; based on the division method corresponding to the coding unit of the 1st layer after the loop is executed, use the division method whose comparison result meets the preset conditions.
[0013] Optionally, when the parameter is rate-distortion cost, the preset condition is that the rate-distortion cost of the coding unit of the current layer is less than the sum of the rate-distortion costs of multiple lower-layer coding units included in the coding unit.
[0014] Optionally, the determination unit is further configured to, after the division method corresponding to the coding unit of the first layer after the loop is executed is used as the division method whose comparison result satisfies the preset conditions, also include: using the information of the filter corresponding to the coding unit of the first layer after the loop is executed as the filter information of the coding unit divided according to the division method of the current image frame.
[0015] Optionally, the writing unit is further configured to write the division method, information about the filter of the coding unit divided according to the division method, and the filter switch identifier of the coding unit divided according to the division method into the coding information, wherein the filter switch identifier is used to indicate whether the corresponding coding unit needs to be filtered.
[0016] According to a fourth aspect of an embodiment of the present disclosure, a decoding device is provided, including: a receiving unit configured to receive encoding information, wherein the encoding information includes a division method of a current image frame and filter information of encoding units divided by the current image frame according to the division method, the division method is a division method in which a comparison result obtained by comparing parameters of an upper-layer encoding unit with parameters of multiple lower-layer encoding units included in the upper-layer encoding unit meets preset conditions, and the current image frame is divided into encoding units having N layers, where N is a positive integer; and a filtering unit configured to filter the current image frame based on the division method and information of filters corresponding to encoding units divided by the current image frame according to the division method.
[0017] Optionally, the filtering unit is further configured to, before filtering the current image frame based on the division method and the information of the filter corresponding to the coding unit divided by the current image frame according to the division method, perform the following operations for each coding unit in the coding units divided by the current image frame according to the division method: determine that the current coding unit needs to be filtered based on the filter switch identifier corresponding to the current coding unit in the coding information; and filter the current coding unit based on the information of the filter corresponding to the current coding unit.
[0018] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement the encoding method and / or decoding method according to the present disclosure.
[0019] According to the sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the encoding method and / or decoding method according to the present disclosure as described above.
[0020] According to a seventh aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which implement the encoding method and / or decoding method according to the present disclosure when executed by a processor.
[0021] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0022] According to the encoding method and device, and the decoding method and device disclosed in the present invention, the current image frame is divided multiple times, and then by comparing the parameters of the upper-layer coding unit and the parameters of the multiple lower-layer coding units included in the upper-layer coding unit, a division method in which the comparison result meets the preset conditions is determined, and then the division method and the filter information of the corresponding divided coding unit are sent to the decoding end. That is, the present invention sends the division method to the decoding end, and the decoding end can determine the coding unit of the current image frame based on the division method, thereby determining the filter information of each coding unit, so that there is no need to introduce CLIF for each coding unit, and there is no need to write the CLIF of each coding unit into the code stream and send it to the decoding end, thereby reducing the code stream overhead. Therefore, the present invention solves the problem in the related art that the CLIF of each LCU needs to be written into the code stream, resulting in large code stream overhead.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0025] Figure 1 is a schematic diagram illustrating an implementation scenario of a coding and decoding method according to an exemplary embodiment of the present disclosure;
[0026] Figure 2 is a flowchart of an encoding method according to an exemplary embodiment;
[0027] Figure 3 is a schematic diagram showing a partitioning method based on a quadtree partitioning method according to an exemplary embodiment;
[0028] Figure 4 is a schematic diagram showing a latest division result according to an exemplary embodiment;
[0029] Figure 5 is a flowchart showing a decoding method according to an exemplary embodiment;
[0030] Figure 6 is a block diagram of an encoding device according to an exemplary embodiment;
[0031] Figure 7 is a block diagram showing a decoding device according to an exemplary embodiment;
[0032] Figure 8 is a block diagram of an electronic device 800 according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0034] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0035] It should be noted that the phrase "at least one of the items" in this disclosure includes three types of parallel situations: "any one of the items", "a combination of any multiple items of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. For another example, "performing at least one of step 1 and step 2" includes the following three parallel situations: (1) performing step 1; (2) performing step 2; and (3) performing steps 1 and 2.
[0036] To address the above issues, the present disclosure provides a coding method that can reduce bit rate overhead, which is described below using a video transmission scenario as an example.
[0037] Figure 1 is a schematic diagram showing an implementation scenario of a coding and decoding method according to an exemplary embodiment of the present disclosure, such as Figure 1 The implementation scenario includes a server 100, a user terminal 110, and a user terminal 120, wherein the user terminals are not limited to two, and include but are not limited to mobile phones, personal computers, and other devices. The user terminal can be equipped with a camera for acquiring video. The server can be a single server, or a server cluster consisting of several servers, or a cloud computing platform or a virtualization center.
[0038] After the user terminal 110 obtains the video to be transmitted through the camera, the user terminal 110 performs the following operations for each image frame in the video: dividing the current image frame into coding units with N layers, wherein each upper-layer coding unit is divided into multiple lower-layer coding units, and N is a positive integer; comparing the parameters of the upper-layer coding unit with the parameters of the multiple lower-layer coding units included in the upper-layer coding unit, and determining a division method in which the comparison result meets the preset conditions; writing the division method and the information of the filter of the coding unit divided by the current image frame according to the division method into the coding information and sending it to the decoding end via the server 100.
[0039] After the user terminal 120 receives the received coding information sent by the user terminal 110 via the server 100, where the coding information includes the division method of the current image frame and the filter information of the coding unit divided by the current image frame according to the division method, the division method is a division method in which the comparison result obtained by comparing the parameters of the upper-layer coding unit and the parameters of the multiple lower-layer coding units included in the upper-layer coding unit meets the preset conditions, and the current image frame is divided into coding units with N layers, where N is a positive integer; the user terminal 120 filters the current image frame based on the division method and the filter information corresponding to the coding unit divided by the current image frame according to the division method.
[0040] Below, we will refer to Figures 2 to 7 An encoding method and apparatus, and a decoding method and apparatus according to exemplary embodiments of the present disclosure are described in detail.
[0041] Figure 2 is a flow chart showing an encoding method according to an exemplary embodiment. Figure 2 As shown, the encoding method includes the following steps:
[0042] In step S201, the current image frame is divided into coding units having N layers, where each upper-layer coding unit is divided into multiple lower-layer coding units, where N is a positive integer. For example, the current image frame can be divided into coding units having N layers using N multi-tree partitioning methods, which may include quadtree partitioning, ternary tree partitioning, and binary tree partitioning, but this disclosure does not limit this.
[0043] For example, take the multi-tree partitioning method as a quadtree partitioning method as an example to illustrate, Figure 3 FIG. 1 is a schematic diagram showing a partitioning method based on a quadtree partitioning method according to an exemplary embodiment. Figure 3As shown in the figure, considering that the texture contained in an image frame is relatively complex, the entire current image frame can be divided using a cubic quadtree partitioning method, thereby obtaining a three-layer partitioning result. Layer 0 represents the entire current image frame as a coding unit, which is used as a filtering unit and independently trains a set of filter parameters. Layer 1 represents the entire current image frame being divided into four coding units, which are used as four filtering units 1 to 4, and each filtering unit independently trains its own set of filter parameters. Layer 2 represents the entire current image frame being divided into 5 to 20 coding units, a total of 16 filtering units, and each filtering unit independently trains its own set of filter parameters. Assuming that each filtering unit is an LCU when divided into 16 filtering units, this means that the image frame can be divided into a maximum of 16 sets of filter parameters. It should be noted that Layer 2 can also be represented by further partitioning based on Layer 1: for example, filtering unit 1 is further divided into four filtering units 5 to 8; filtering unit 2 is further divided into filtering units 9 to 12, and so on. Each filtering unit independently trains its own filter parameters and independently decides whether to select filtering for each filtering unit.
[0044] return Figure 2 In step S202, the parameters of the upper-layer coding unit are compared with the parameters of the multiple lower-layer coding units included in the upper-layer coding unit, and a division method is determined in which the comparison result satisfies a preset condition. For example, when the above-mentioned parameter is a rate-distortion cost, the preset condition is that the rate-distortion cost of the coding unit of the current layer is less than the sum of the rate-distortion costs of the multiple lower-layer coding units included in the coding unit. However, this disclosure does not limit the parameters and the preset relationship.
[0045] According to an exemplary embodiment of the present disclosure, comparing parameters of an upper-layer coding unit with parameters of multiple lower-layer coding units included in the upper-layer coding unit, and determining a division method in which the comparison result satisfies a preset condition includes: starting from the N-1th layer as the current layer, sequentially performing the following operations until the first layer in order from the lower layer to the upper layer: comparing parameters of the coding unit of the current layer with parameters of multiple lower-layer coding units included in the coding unit; if the comparison result satisfies the preset condition, not updating the coding unit of the current layer; if the comparison result does not meet the preset condition, updating the coding unit of the current layer to the multiple lower-layer coding units included in the coding unit; and using the division method corresponding to the coding unit of the first layer after the loop is executed as the division method in which the comparison result satisfies the preset condition. According to this embodiment, a division method in which the comparison result satisfies the preset condition can be conveniently and quickly obtained.
[0046] According to an exemplary embodiment of the present disclosure, when the parameter is a rate-distortion cost, the preset condition is that the rate-distortion cost of the coding unit of the current layer is less than the sum of the rate-distortion costs of the multiple lower-layer coding units included in the coding unit. According to this embodiment, the division method of the current image frame is determined based on the rate-distortion costs of the coding units of each layer of the current image frame. Therefore, the determined division method is not necessarily the division method into LCUs, which reduces the number of coding units after division, that is, reduces the filter information to be transmitted, and further reduces the code stream overhead.
[0047] For example, Figure 3 As shown in the figure, the current image frame is quadtree-partitioned twice, and three-layer partitioning results are obtained: Layer 0, Layer 1, and Layer 2. First, the rate-distortion cost of the coding units at the same position in Layer 1 and Layer 2 is compared to determine the latest partitioning result. Then, the rate-distortion cost of the intermediate partitioning result is compared with the rate-distortion cost of the coding units at the same position in Layer 0 to determine the final latest partitioning result. Specifically, Figure 3 Taking the coding unit marked as 1 in the figure as an example, we first compare the rate-distortion cost of coding unit 1 with the sum of the rate-distortion costs of coding units 5, 6, 7, and 8. If the rate-distortion cost of coding unit 1 is greater than the sum of the rate-distortion costs of coding units 5, 6, 7, and 8, the final division result is the method of coding units 5, 6, 7, and 8 at the position of coding unit 1. If the rate-distortion cost of coding unit 1 is less than or equal to the sum of the rate-distortion costs of coding units 5, 6, 7, and 8, the final division result is the method of coding unit 1 at the position of coding unit 1. This is analogous to the final division result of coding units 2, 3, and 4. Figure 4 is a schematic diagram showing a latest division result according to an exemplary embodiment. Figure 4 As shown, in this case, the entire image frame is divided into the sum of the rate-distortion costs of four filtering sub-units The rate-distortion cost is lower than that without partitioning. smaller; at the same time, the rate-distortion cost obtained by continuing to divide the quadtree by the upper right and lower left filter sub-units is smaller than the rate-distortion cost without division.
[0048] According to an exemplary embodiment of the present disclosure, after the division method corresponding to the coding unit of the first layer after the loop is executed is used as the division method whose comparison result satisfies the preset conditions, it also includes: using the information of the filter corresponding to the coding unit of the first layer after the loop is executed as the filter information of the coding unit divided according to the division method of the current image frame.
[0049] For example, Figure 4As shown in the latest division result, at this time, the position of coding unit 1 adopts the information of the filter corresponding to coding unit 1, coding unit 9 adopts the information of the filter corresponding to coding unit 9, and so on. Coding unit 16 adopts the information of the filter corresponding to coding unit 16.
[0050] return Figure 2 In step S203, the division method and information of filters of coding units divided according to the division method of the current image frame are written into the coding information.
[0051] According to an exemplary embodiment of the present disclosure, writing information about the division method and filters for coding units divided according to the division method into coding information includes writing information about the division method, filters for coding units divided according to the division method into coding information, and filter switch flags for the coding units divided according to the division method into the coding information, wherein the filter switch flag is used to indicate whether filtering is required for the corresponding coding unit. According to this embodiment, each coding unit can independently decide whether to select filtering, without affecting each other.
[0052] For example, still Figure 4 As shown in the latest division result, each coding unit independently decides whether to select filtering for its own filtering unit. At this time, the position of coding unit 1 adopts the filtering switch identifier corresponding to coding unit 1, coding unit 9 adopts the filtering switch identifier corresponding to coding unit 9, and so on. Coding unit 16 adopts the filtering switch identifier corresponding to coding unit 16.
[0053] Figure 5 is a flowchart of a decoding method according to an exemplary embodiment. Figure 5 As shown, the decoding method includes the following steps:
[0054] In step S501, encoding information is received, wherein the encoding information includes a division method of the current image frame and filter information of the coding units into which the current image frame is divided according to the division method, the division method is a division method in which a comparison result obtained by comparing parameters of an upper-layer coding unit with parameters of multiple lower-layer coding units included in the upper-layer coding unit meets preset conditions, and the current image frame is divided into coding units having N layers, where N is a positive integer.
[0055] In step S502 , the current image frame is filtered based on the division mode and information of filters corresponding to coding units divided into the current image frame according to the division mode.
[0056] According to an exemplary embodiment of the present disclosure, before filtering the current image frame based on the division method and the information of the filter corresponding to the coding unit divided by the current image frame according to the division method, it also includes: for each coding unit in the coding unit divided by the current image frame according to the division method, performing the following operations: based on the filter switch identifier corresponding to the current coding unit in the coding information, determining that the current coding unit needs to be filtered; based on the information of the filter corresponding to the current coding unit, filtering the current coding unit.
[0057] In summary, the cross-component compensation filtering methods of the related art mostly adopt a frame-level filtering method. The shortcomings of this method are that, on the one hand, it is necessary to introduce syntax elements for each LCU to identify the filter information of each LCU, which will cause excessive bit rate consumption; on the other hand, this method does not effectively consider the impact of the texture information contained in a frame of image on the filtering performance. The present disclosure proposes a method for adaptive division of filtering units that effectively considers the texture information of the image, that is, the image frame is divided multiple times to obtain multi-layer coding units, and the optimal filtering unit division method of the image frame is determined by a rate-distortion optimization method. The above method takes into account the influence of image texture information, avoids the bit rate consumption at the LCU level, and effectively improves the coding performance.
[0058] Figure 6 FIG. 1 is a block diagram of an encoding device according to an exemplary embodiment. Figure 6 , the device includes a dividing unit 60, a determining unit 62 and a writing unit 64.
[0059] The division unit 60 is configured to divide the current image frame into N layers of coding units, wherein each upper-layer coding unit is divided into multiple lower-layer coding units, and N is a positive integer; the determination unit 62 is configured to compare the parameters of the upper-layer coding unit with the parameters of the multiple lower-layer coding units included in the upper-layer coding unit, and determine a division method whose comparison result meets the preset conditions; the writing unit 64 is configured to write the division method and the filter information of the coding unit divided by the current image frame according to the division method into the coding information.
[0060] According to an embodiment of the present disclosure, the determination unit 62 is further configured to perform the following operations in sequence, starting from the N-1th layer as the current layer, in order from the lower layer to the upper layer, until the 1st layer: compare the parameters of the coding unit of the current layer with the parameters of the multiple lower-layer coding units included in the coding unit; if the comparison result meets the preset conditions, do not update the coding unit of the current layer; if the comparison result does not meet the preset conditions, update the coding unit of the current layer to the multiple lower-layer coding units included in the coding unit; based on the division method corresponding to the coding unit of the 1st layer after the loop is executed, use the division method whose comparison result meets the preset conditions.
[0061] According to an embodiment of the present disclosure, when the parameter is rate-distortion cost, the preset condition is that the rate-distortion cost of the coding unit of the current layer is less than the sum of the rate-distortion costs of multiple lower-layer coding units included in the coding unit.
[0062] According to an embodiment of the present disclosure, the determination unit 62 is also configured to, after the division method corresponding to the coding unit of the first layer after the loop is executed is used as the division method whose comparison result satisfies the preset conditions, further include: using the information of the filter corresponding to the coding unit of the first layer after the loop is executed as the filter information of the coding unit divided according to the division method of the current image frame.
[0063] According to an embodiment of the present disclosure, the writing unit 64 is further configured to write the division method, information of the filter of the coding unit divided by the current image frame according to the division method, and the filter switch identifier of the coding unit divided according to the division method into the coding information, wherein the filter switch identifier is used to indicate whether the corresponding coding unit needs to be filtered.
[0064] Figure 7 FIG. 1 is a block diagram of a decoding device according to an exemplary embodiment. Figure 7 , the device includes a receiving unit 70 and a filtering unit 72.
[0065] The receiving unit 70 is configured to receive encoding information, wherein the encoding information includes a division method of the current image frame and filter information of the encoding units divided by the current image frame according to the division method, the division method is a division method in which a comparison result obtained by comparing parameters of an upper-layer encoding unit with parameters of multiple lower-layer encoding units included in the upper-layer encoding unit meets preset conditions, and the current image frame is divided into encoding units having N layers, where N is a positive integer; the filtering unit 72 is configured to filter the current image frame based on the division method and information of the filter corresponding to the encoding units divided by the current image frame according to the division method.
[0066] According to an embodiment of the present disclosure, the filtering unit 72 is further configured to, before filtering the current image frame based on the division method and the information of the filter corresponding to the coding unit divided by the current image frame according to the division method, perform the following operations for each coding unit in the coding unit divided by the current image frame according to the division method: determine that the current coding unit needs to be filtered based on the filter switch identifier corresponding to the current coding unit in the encoding information; and filter the current coding unit based on the information of the filter corresponding to the current coding unit.
[0067] According to an embodiment of the present disclosure, an electronic device may be provided. Figure 8It is a block diagram of an electronic device 800 according to an embodiment of the present disclosure, which includes at least one memory 801 and at least one processor 802. The at least one memory stores a set of computer-executable instructions. When the computer-executable instruction set is executed by the at least one processor, the encoding method and decoding method according to the embodiment of the present disclosure are executed.
[0068] As an example, the electronic device 800 can be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 1000 is not necessarily a single electronic device, but can also be any device or circuit that can execute the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 800 can also be part of an integrated control system or system manager, or can be configured as a portable electronic device that is interconnected with a local or remote (e.g., via wireless transmission) interface.
[0069] In electronic device 800, processor 802 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processor 802 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0070] The processor 802 can execute instructions or codes stored in the memory, wherein the memory 801 can also store data. Instructions and data can also be sent and received over the network via the network interface device, wherein the network interface device can use any known transmission protocol.
[0071] The memory 801 can be integrated with the processor 802, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. Furthermore, the memory 801 can include a separate device, such as an external disk drive, a storage array, or any other storage device usable by a database system. The memory 801 and the processor 802 can be operatively coupled or can communicate with each other, for example, via an I / O port, a network connection, or the like, such that the processor 802 can access files stored in the memory 801.
[0072] In addition, the electronic device 800 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device may be connected to each other via a bus and / or a network.
[0073] According to an embodiment of the present disclosure, a computer-readable storage medium may also be provided, wherein when the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to perform the encoding method and decoding method of the embodiment of the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or ultra-fast digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device configured to store the computer program and any associated data, data files and data structures in a non-transitory manner and provide the computer program and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0074] According to an embodiment of the present disclosure, a computer program product is provided, including computer instructions, which implement the encoding method and decoding method of the embodiment of the present disclosure when the computer instructions are executed by a processor.
[0075] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0076] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A coding method, characterized in that: include: Divide the current image frame into N-layer coding units, where each upper-layer coding unit is divided into multiple lower-layer coding units, N is a positive integer, and the N-th layer coding unit is the largest coding unit; comparing a parameter of an upper-layer coding unit with parameters of a plurality of lower-layer coding units included in the upper-layer coding unit, and determining a division mode in which a comparison result satisfies a preset condition; Writing the division method and information of filters of coding units divided according to the division method into coding information; The comparing the parameters of the upper-layer coding unit with the parameters of the plurality of lower-layer coding units included in the upper-layer coding unit, and determining a division mode in which the comparison result satisfies a preset condition, includes: Starting from the N-1th layer as the current layer, perform the following operations in order from the lowest layer to the highest layer until the first layer: Comparing parameters of a coding unit of a current layer with parameters of multiple lower-layer coding units included in the coding unit; if a comparison result meets a preset condition, not updating the coding unit of the current layer; if the comparison result does not meet the preset condition, updating the coding unit of the current layer to the multiple lower-layer coding units included in the coding unit; The division method corresponding to the coding unit of the first layer after the loop is executed is used as the division method whose comparison result satisfies the preset condition; Among them, after the division method corresponding to the coding unit of the first layer after the loop is executed is used as the division method whose comparison result meets the preset conditions, it also includes: using the filter information corresponding to the coding unit of the first layer after the loop is executed as the filter information of the coding unit divided by the current image frame according to the division method.
2. The encoding method according to claim 1, wherein In the case where the parameter is a rate-distortion cost, the preset condition is that the rate-distortion cost of the coding unit of the current layer is less than the sum of the rate-distortion costs of multiple lower-layer coding units included in the coding unit.
3. The encoding method according to claim 1, wherein Writing the division method and information of filters of coding units divided according to the division method into coding information includes: The division method, the filter information of the coding unit divided according to the division method of the current image frame, and the filter switch identifier of the coding unit divided according to the division method are written into the coding information, wherein the filter switch identifier is used to indicate whether the corresponding coding unit needs to be filtered.
4. A decoding method, characterized in that: include: receiving encoding information, wherein the encoding information includes a division method of a current image frame and information about filters of coding units divided by the current image frame according to the division method, wherein the division method is a division method in which a comparison result obtained by comparing parameters of an upper-layer coding unit with parameters of multiple lower-layer coding units included in the upper-layer coding unit satisfies a preset condition, and the current image frame is divided into coding units having N layers, where N is a positive integer, and the coding unit of the Nth layer is a maximum coding unit; filtering the current image frame based on the division method and information of filters corresponding to coding units into which the current image frame is divided according to the division method; The division method is determined as follows: starting from the N-1th layer as the current layer, the following operations are performed in order from the lower layer to the upper layer until the first layer: Comparing parameters of a coding unit of a current layer with parameters of multiple lower-layer coding units included in the coding unit; if a comparison result meets a preset condition, not updating the coding unit of the current layer; if the comparison result does not meet the preset condition, updating the coding unit of the current layer to the multiple lower-layer coding units included in the coding unit; The division method corresponding to the coding unit of the first layer after the loop is executed is used as the division method whose comparison result satisfies the preset condition; Among them, after the division method corresponding to the coding unit of the first layer after the loop is executed is used as the division method whose comparison result meets the preset conditions, it also includes: using the filter information corresponding to the coding unit of the first layer after the loop is executed as the filter information of the coding unit divided by the current image frame according to the division method.
5. The decoding method according to claim 4, wherein: Before filtering the current image frame based on the division method and information of filters corresponding to coding units into which the current image frame is divided according to the division method, the method further includes: For each coding unit of the current image frame divided according to the division method, perform the following operation: Determining, based on a filter switch identifier corresponding to the current coding unit in the coding information, that filtering is required for the current coding unit; The current coding unit is filtered based on information of a filter corresponding to the current coding unit.
6. A coding device, characterized in that include: a dividing unit configured to divide the current image frame into N-layer coding units, wherein each upper-layer coding unit is divided into a plurality of lower-layer coding units, N is a positive integer, and the coding unit of the Nth layer is a maximum coding unit; a determining unit configured to compare a parameter of an upper-layer coding unit with parameters of a plurality of lower-layer coding units included in the upper-layer coding unit, and determine a division mode in which a comparison result satisfies a preset condition; a writing unit configured to write the division method and information of filters of coding units divided according to the division method into coding information; The determining unit is further configured to, in order from the lower layer to the upper layer, start from the N-1th layer as the current layer, and sequentially perform the following operations until the first layer: compare the parameters of the coding unit of the current layer with the parameters of the multiple lower-layer coding units included in the coding unit; if the comparison result meets the preset conditions, do not update the coding unit of the current layer; if the comparison result does not meet the preset conditions, update the coding unit of the current layer to the multiple lower-layer coding units included in the coding unit; based on the division method corresponding to the coding unit of the first layer after the loop is executed, use it as the division method whose comparison result meets the preset conditions; The determination unit is further configured to use the filter information corresponding to the coding unit of the first layer after the loop is completed as the filter information of the coding unit divided according to the division method based on the division method corresponding to the coding unit of the first layer after the loop is executed, after the comparison result satisfies the preset conditions.
7. The encoding device according to claim 6, wherein In the case where the parameter is a rate-distortion cost, the preset condition is that the rate-distortion cost of the coding unit of the current layer is less than the sum of the rate-distortion costs of multiple lower-layer coding units included in the coding unit.
8. The encoding device according to claim 6, wherein The writing unit is also configured to write the division method, the filter information of the coding unit divided by the current image frame according to the division method, and the filter switch identifier of the coding unit divided according to the division method into the coding information, wherein the filter switch identifier is used to indicate whether the corresponding coding unit needs to be filtered.
9. A decoding device, characterized in that: include: a receiving unit configured to receive encoding information, wherein the encoding information includes a division method of a current image frame and information about filters of coding units divided by the current image frame according to the division method, the division method being a division method in which a comparison result obtained by comparing parameters of an upper-layer coding unit with parameters of multiple lower-layer coding units included in the upper-layer coding unit satisfies a preset condition, the current image frame being divided into coding units having N layers, where N is a positive integer, and the coding unit of the Nth layer is a maximum coding unit; a filtering unit configured to filter the current image frame based on the division method and information of filters corresponding to coding units into which the current image frame is divided according to the division method; The division method is determined as follows: starting from the N-1th layer as the current layer, the following operations are performed in order from the lower layer to the upper layer until the first layer: Comparing parameters of a coding unit of a current layer with parameters of multiple lower-layer coding units included in the coding unit; if a comparison result meets a preset condition, not updating the coding unit of the current layer; if the comparison result does not meet the preset condition, updating the coding unit of the current layer to the multiple lower-layer coding units included in the coding unit; The division mode corresponding to the coding unit of the first layer after the loop is executed is used as the division mode that satisfies the preset condition as a result of the comparison.
10. The decoding device according to claim 9, wherein The filtering unit is further configured to, before filtering the current image frame based on the division method and the information of the filter corresponding to the coding unit divided by the current image frame according to the division method, perform the following operations for each coding unit in the coding units divided by the current image frame according to the division method: determine that the current coding unit needs to be filtered based on the filter switch identifier corresponding to the current coding unit in the encoding information; and filter the current coding unit based on the information of the filter corresponding to the current coding unit.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the encoding method according to any one of claims 1 to 3 and / or the decoding method according to any one of claims 4 to 5.
12. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to perform the encoding method according to any one of claims 1 to 3 and / or the decoding method according to any one of claims 4 to 5.
13. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the encoding method according to any one of claims 1 to 3 and / or the decoding method according to any one of claims 4 to 5 are implemented.
Citation Information
Patent Citations
Intra-frame prediction coding method and device, equipment and readable storage medium
CN110572679A
Image encoding method, image decoding method, encoder, decoder and storage medium
CN110650349A
Video encoding method and device, electronic equipment and storage medium
CN111669593A