Image encoding method, apparatus, terminal device, and decoding method
Patent Information
- Application Number
- CN202411543670.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-10-31
AI Technical Summary
[0007]本申请提供了一种图像编码方法、装置、终端设备及解码方法,可以解决图像编码的编码效率低的问题
[0034] In the embodiments of this application, an image block to be encoded is obtained, then processed according to preset rules to obtain a target image block to be encoded, and then encoded to obtain a target encoding result. This method enables dynamic selection of different partitions based on the attribute information of the image block to be encoded, improving the effect and accuracy of encoding the image block. It eliminates the need for complex calculations to obtain the partitioning pattern of the image block, effectively reducing the computational complexity of image encoding, increasing the computational speed of image encoding, and further improving encoding efficiency.
Smart Images

Figure CN119420938B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image coding technology, and in particular to an image coding method, apparatus, terminal device and decoding method. Background Technology
[0002] Image segmentation, prediction, and transformation are commonly used in image and video coding schemes to remove spatial redundancy, temporal redundancy, and coding redundancy in the video.
[0003] Image pixels consist of luminance pixels and chrominance pixels. Prior to the H.266 / VVC video coding standard, compression techniques separated luminance and chrominance pixels together, meaning their partitioning structures were identical. Typically, in natural images, the distribution of luminance pixels is more complex, while the distribution of chrominance pixels is simpler. However, with advancements in technology and the increasing richness of artificial lighting colors, scenes with simple luminance pixel distributions and complex chrominance pixel distributions, such as large-scale nighttime performances and nighttime cities, are becoming more common. For complex pixel distributions, dividing the image into smaller blocks yields better compression results, while for simple pixel distributions, larger blocks are more suitable.
[0004] H.266 / VVC introduced a dual-tree partitioning method in intra-frame compression. In this method, the luminance and chrominance are completely independent, but the luminance and chrominance partitioning information is also encoded completely separately. This causes chrominance prediction delay, resulting in reduced image coding efficiency.
[0005] In the AVS3 video coding standard, a finer segmentation structure for luminance pixels is achieved by re-segmenting the luminance pixels that were previously divided into sub-blocks. However, this re-segmentation requires re-determining the prediction mode and calculating distortion and bit count for the resulting sub-blocks, significantly increasing computational complexity and extending image encoding processing time.
[0006] This shows that existing image coding methods suffer from low coding efficiency. Summary of the Invention
[0007] This application provides an image encoding method, apparatus, terminal device, and decoding method, which can solve the problem of low encoding efficiency in image encoding.
[0008] In a first aspect, embodiments of this application provide an image encoding method, which includes:
[0009] Obtain the image block to be encoded;
[0010] The target image block to be encoded is obtained by processing the image block to be encoded according to preset rules; the processing includes single-channel tree partitioning;
[0011] The target image block to be encoded is encoded to obtain the target encoding result.
[0012] Optionally, the preset rules include a first preset rule and a second preset rule;
[0013] The target image block to be encoded is obtained by processing the image block to be encoded according to preset rules, including:
[0014] According to the first preset rule, it is determined whether the image block to be encoded meets the division termination condition. If so, the image block to be encoded is taken as the first target image block to be encoded. Otherwise, the image block to be encoded is processed according to the second preset rule to obtain the second target image block to be encoded. The target image block to be encoded includes the first target image block to be encoded and / or the second target image block to be encoded.
[0015] Optionally, the second target image block to be encoded is obtained by processing the image block to be encoded according to the second preset rule, including:
[0016] According to the second preset rule, it is determined whether the image block to be encoded meets the single-channel tree partitioning condition. If so, the image partitioning type of the image block to be encoded is determined, and the image block to be encoded is partitioned according to the image partitioning type to obtain multiple partitioned sub-blocks. Among them, the image partitioning type includes brightness partitioning and chromaticity partitioning. The second target image block to be encoded is obtained according to the partitioned sub-blocks.
[0017] Optionally, a second target image block to be encoded is obtained based on the sub-block division, including:
[0018] The sub-blocks are processed according to the first preset rule and / or the second preset rule until the new sub-blocks meet the division termination condition, and the new sub-blocks are used as the second target image blocks to be encoded.
[0019] Optionally, the image block to be encoded is determined according to the second preset rule to determine whether it meets the non-single-channel tree partitioning condition. If so, all sub-image blocks of the image block to be encoded are partitioned according to the partitioning mode to obtain multiple partitioned sub-blocks. The third target image block to be encoded is obtained according to the partitioned sub-blocks. The target image block to be encoded includes the third target image block to be encoded.
[0020] Optionally, a third target image block to be encoded is obtained based on the sub-block division, including:
[0021] For each sub-block, determine whether the sub-block meets the division termination condition according to the first preset rule. If it does, the sub-block is used as the third target image block to be encoded. Otherwise, return to the step of processing the image block to be encoded according to the second preset rule to obtain the second target image block to be encoded, until the sub-block obtained by division meets the division termination condition, and the current sub-block is used as the third target image block to be encoded.
[0022] Secondly, embodiments of this application provide an image encoding apparatus, comprising:
[0023] The acquisition module is used to acquire the image block to be encoded;
[0024] The partitioning module is used to process the image block to be encoded according to preset rules to obtain the target image block to be encoded; the processing includes single-channel tree partitioning or non-single-channel tree partitioning;
[0025] The encoding module is used to encode the target image block to obtain the target encoding result.
[0026] Thirdly, embodiments of this application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the image encoding method described above.
[0027] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the image encoding method described above.
[0028] Fifthly, embodiments of this application provide an image decoding method, which includes:
[0029] Obtain the target encoding result;
[0030] The target encoding result is processed according to preset rules to obtain the target image block to be decoded. The processing includes single-channel tree partitioning.
[0031] The target image block to be decoded is decoded to obtain the target decoding result.
[0032] Optionally, the target encoding result includes partitioning information, and the preset rules are determined based on the partitioning information.
[0033] The above-mentioned solution in this application has the following beneficial effects:
[0034] In the embodiments of this application, an image block to be encoded is obtained, then processed according to preset rules to obtain a target image block to be encoded, and then encoded to obtain a target encoding result. This method enables dynamic selection of different partitions based on the attribute information of the image block to be encoded, improving the effect and accuracy of encoding the image block. It eliminates the need for complex calculations to obtain the partitioning pattern of the image block, effectively reducing the computational complexity of image encoding, increasing the computational speed of image encoding, and further improving encoding efficiency.
[0035] Other beneficial effects of this application will be described in detail in the following detailed description section. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating an image encoding method provided in an embodiment of this application;
[0038] Figure 2 A schematic diagram of an image block to be encoded provided in an embodiment of this application;
[0039] Figure 3 A schematic diagram of single-channel tree partitioning provided in an embodiment of this application;
[0040] Figure 4 A detailed flowchart of image encoding provided in one embodiment of this application;
[0041] Figure 5 A flowchart illustrating image encoding using single-channel tree partitioning, provided as an embodiment of this application;
[0042] Figure 6 This is a schematic diagram illustrating the specific process of dividing an image block to be encoded according to an embodiment of this application;
[0043] Figure 7 A detailed flowchart of image decoding provided in one embodiment of this application;
[0044] Figure 8 A flowchart illustrating image decoding using single-channel tree partitioning is provided as an embodiment of this application;
[0045] Figure 9 This is a schematic diagram of the structure of an image encoding device provided in an embodiment of this application;
[0046] Figure 10 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0047] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0048] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0049] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0050] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0051] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0052] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0053] To address the problem of low encoding efficiency in existing methods, this application provides an image encoding method. This method involves acquiring an image block to be encoded, processing it according to preset rules to obtain a target image block to be encoded, and then encoding the target image block to obtain the target encoding result. This method enables dynamic selection of different partitions based on the attribute information of the image block to be encoded, improving the effectiveness and accuracy of encoding. It eliminates the need for complex calculations to obtain the partitioning pattern of the image block, effectively reducing the computational complexity of image encoding, increasing the computational speed of image encoding, and further improving encoding efficiency.
[0054] The image encoding method provided in this application will be described exemplarily below.
[0055] like Figure 1 As shown, the image encoding method provided in this application includes the following steps:
[0056] Step 11: Obtain the image block to be encoded.
[0057] It should be noted that the aforementioned image blocks to be encoded can be image blocks that need to be encoded and have already been divided into multiple sub-image blocks, or they can be image blocks that have not yet been divided, and the image blocks to be encoded constitute the image to be encoded. At the same time, the bitstream of the image blocks to be encoded can be obtained. The bitstream is used to carry the encoding information of the brightness (such as the encoding method, coefficients, etc.) and the encoding information of the chrominance related to the image blocks to be encoded.
[0058] The following example illustrates the image block to be encoded in this application.
[0059] Image blocks to be encoded, such as Figure 2 As shown in the figure, the dotted lines represent the image boundaries of sub-image blocks containing only chroma pixels, the dotted lines represent the image boundaries of sub-image blocks containing only luminance pixels, and the solid lines represent the common boundaries of sub-image blocks containing both chroma pixels and luminance pixels. The image block is divided into 16 sub-image blocks, and the numbers in the figure are the sub-image block numbers.
[0060] Step 12: Process the image block to be encoded according to the preset rules to obtain the target image block to be encoded.
[0061] The above processing includes single-channel tree partitioning. Single-channel tree partitioning involves partitioning only the luma blocks within the image block to be encoded, or only the chroma blocks. Specifically, single-channel tree partitioning means that (the sub-image blocks corresponding to luma partitioning are luma blocks, and the sub-image blocks corresponding to chroma partitioning are chroma blocks) only performs a single-mode partitioning on the corresponding sub-image blocks of the image block to be encoded. The corresponding modes include luma partitioning and chroma partitioning. For example, partitioning according to the above partitioning mode yields partitioned sub-blocks. If subsequent sub-blocks need to be further partitioned, their sub-blocks can only choose single-channel tree partitioning or not partitioning according to preset rules. That is, partitioned sub-blocks on the luma branch can only choose luma partitioning or not partitioning, and partitioned sub-blocks on the chroma branch can only choose chroma partitioning or not partitioning. The preset rules include a first preset rule and a second preset rule. The first preset rule is used to determine whether the image block meets the partitioning termination condition. For example, the first preset rule can be based on the resolution of the image block (partitioned sub-block, image block to be encoded, etc.), the number of times it has been partitioned, etc., to determine whether the partitioning termination condition is met. The partitioning termination condition can be that the resolution of the image block is less than a preset resolution, or the number of partitioning is reached, etc. If the resolution of the image block to be encoded is 128×128, which is larger than the preset resolution size of 64×64, then the division termination condition is not met. The second preset rule is used to determine whether an image block meets the single-channel tree partitioning condition. For example, the second preset rule is that if the textures of the luminance blocks and chrominance blocks in an image block are consistent, the single-channel tree partitioning condition is not met; if the textures of the luminance blocks and chrominance blocks in an image block are inconsistent, the single-channel tree partitioning condition is met. Alternatively, it can be a rule based on the depth of the image block to be encoded being partitioned to determine whether the single-channel tree partitioning condition is met (or a rule based on the pixel value of the image block to be encoded to determine whether the single-channel tree partitioning condition is met; the deeper the partitioning depth or the more times the partitioning is performed, the higher the pixel value of the current image block; when the pixel value exceeds a certain threshold, the single-channel tree partitioning condition is met; otherwise, the single-channel tree partitioning condition is not met). It can also be a rule based on Rate-Distortion Optimization (RDO) technology to determine whether the single-channel tree partitioning condition is met (by calculating the balance point between the image quality and bit rate of the image block using RDO, and determining whether the image block meets this balance point to determine whether the single-channel tree partitioning condition is met).
[0062] Specifically, the first preset rule determines whether the image block to be encoded meets the division termination condition. If so, the image block to be encoded is taken as the first target image block to be encoded. Otherwise, the image block to be encoded is processed according to the second preset rule to obtain the second target image block to be encoded. The target image block to be encoded includes the first target image block to be encoded and / or the second target image block to be encoded.
[0063] Specifically, the first preset rule determines whether the image block to be encoded meets the partitioning termination condition. If so, the image block to be encoded is used as the first target image block to be encoded, and encoded to obtain the first encoding result, which is then used as the target encoding result. Otherwise, the image block to be encoded is processed according to the second preset rule to obtain the second target image block to be encoded (i.e., if the image block to be encoded can be further partitioned, it is further processed according to the second preset rule to obtain the second target image block to be encoded). The target image block to be encoded includes the first target image block to be encoded and / or the second target image block to be encoded. It should be noted that if the image block to be encoded meets the partitioning termination condition, the non-partitioning identifier is encoded into the bitstream. If the image block to be encoded does not meet the partitioning termination condition, the partitioning mode is encoded into the bitstream, and the image block to be encoded is processed according to the second preset rule (e.g., the second preset rule determines whether the image block to be encoded meets the single-channel tree partitioning condition, and the image block to be encoded is processed accordingly based on the determination result).
[0064] The above-mentioned processing of the image block to be encoded according to the second preset rule to obtain the second target image block to be encoded is specifically as follows:
[0065] According to the second preset rule, it is determined whether the image block to be encoded meets the single-channel tree partitioning condition. If so, the image partitioning type of the image block to be encoded is determined, and the image block to be encoded is partitioned according to the image partitioning type to obtain multiple partitioned sub-blocks. Among them, the image partitioning type includes brightness partitioning and chromaticity partitioning. The second target image block to be encoded is obtained according to the partitioned sub-blocks.
[0066] More specifically, based on the second preset rule, it is determined whether the image block to be encoded meets the single-channel tree partitioning condition. If so, the partitioning mode and image partitioning type of the image block to be encoded are determined. According to the partitioning mode, the sub-image blocks corresponding to the image partitioning type in the image block to be encoded are partitioned to obtain multiple partitioned sub-blocks. Among them, the image partitioning type is either luminance partitioning or chrominance partitioning. The sub-image block corresponding to luminance partitioning is a luminance block, and the sub-image block corresponding to chrominance partitioning is a chrominance block. The partitioned sub-blocks are used as the target image block to be encoded.
[0067] For example, if the single-channel tree partitioning condition is met, the partitioning mode and image partitioning type of the image block to be encoded are determined. The partitioning mode can be binary tree partitioning, ternary tree partitioning, quadtree partitioning, extended quadtree partitioning, etc., and the image partitioning type is luma partitioning or chroma partitioning. If the single-channel tree partitioning condition is not met, all sub-image blocks of the image block to be encoded are partitioned according to the non-single-channel tree partitioning method. The partitioning mode is the partitioning mode encoded into the bitstream when the partitioning termination condition is not met. At this time, the image partitioning type can be luma partitioning or chroma partitioning, or other image partitioning types (such as shape partitioning, spatial partitioning, etc.).
[0068] In some embodiments of this application, the step of processing the image block to be encoded according to the preset rules to obtain the target image block to be encoded further includes: determining whether the image block to be encoded meets the partitioning termination condition according to the first preset rule, encoding the partitioning mode into the bit stream according to the determination result, then selecting to encode a single-channel tree identifier or a non-single-channel tree identifier into the bit stream according to the second preset rule, and finally determining the image partitioning type of the image block to be encoded and encoding the image partitioning type into the bit stream.
[0069] The steps described above for obtaining the second target image block to be encoded based on the sub-blocks are as follows: the sub-blocks are processed according to the first preset rule and / or the second preset rule until the new sub-blocks meet the division termination condition, and the new sub-blocks are used as the second target image block to be encoded.
[0070] More specifically, for each sub-block, it is determined whether the sub-block meets the division termination condition according to the first preset rule. If it does, the sub-block is used as the second target image block to be encoded. Otherwise, the sub-block is used as the image block to be encoded and the process of processing the image block to be encoded according to the second preset rule to obtain the second target image block to be encoded is returned until the sub-block obtained by division meets the division termination condition. Then, the current sub-block is used as the second target image block to be encoded.
[0071] In some embodiments of this application, it is determined whether the image block to be encoded meets the non-single-channel tree partitioning condition according to the second preset rule. If so, all sub-image blocks of the image block to be encoded are partitioned according to the partitioning mode to obtain multiple partitioned sub-blocks. The third target image block to be encoded is obtained according to the partitioned sub-blocks. The target image block to be encoded includes the third target image block to be encoded.
[0072] The above-mentioned method for obtaining the third target image block to be encoded based on sub-block division includes:
[0073] For each sub-block, determine whether the sub-block meets the division termination condition according to the first preset rule. If it does, the sub-block is used as the third target image block to be encoded. Otherwise, return to the step of processing the image block to be encoded according to the second preset rule to obtain the second target image block to be encoded, until the sub-block obtained by division meets the division termination condition, and the current sub-block is used as the third target image block to be encoded.
[0074] It should be noted that, according to the first preset rule, it is determined whether the image block to be encoded meets the partitioning termination condition, and the partitioning mode is encoded into the bitstream according to the determination result (if the partitioning termination condition is met, the non-partitioning identifier is encoded into the bitstream). Then, according to the determination result of the second preset rule, it is selected to encode the single-channel tree identifier or the non-single-channel tree identifier into the bitstream. If the single-channel tree partitioning condition is not met, the non-single-channel tree identifier is encoded into the bitstream. Finally, the partitioning mode of the image block to be encoded is determined, the partitioning mode is encoded into the bitstream, and at the same time, all sub-image blocks of the image block to be encoded are partitioned according to the partitioning mode to obtain multiple partitioned sub-blocks (that is, both the luma block and the chroma block are partitioned according to the partitioning mode to obtain the corresponding partitioned sub-blocks).
[0075] Step 13: Encode the target image block to be encoded to obtain the target encoding result.
[0076] Specifically, the target image block to be encoded obtained in step 12 is encoded to obtain a first encoding result, and the first encoding result is used as the target encoding result. More specifically, it is determined whether the image block to be encoded meets the division termination condition according to the first preset rule. If so, the image block to be encoded is used as the target image block to be encoded, the target image block to be encoded is encoded to obtain a first encoding result, and the first encoding result is used as the target encoding result. If the image block to be encoded does not meet the partitioning termination condition according to the first preset rule: 1. Determine whether the image block to be encoded meets the single-channel tree partitioning condition according to the second preset rule. If yes, determine the image partitioning type of the image block to be encoded, partition the image block to be encoded according to the image partitioning type to obtain multiple partition sub-blocks, and for each partition sub-block, determine whether the partition sub-block meets the partitioning termination condition according to the first preset rule. If yes, use the partition sub-block as the second target image block to be encoded, and encode the partition sub-block to obtain the second encoding result. Otherwise, determine the second partitioning mode of the partition sub-block, and continue to partition the sub-image blocks corresponding to the image partitioning type in the partition sub-block according to the second partitioning mode to obtain target sub-blocks, until the target sub-block meets the partitioning termination condition. Then, use the target sub-block as the second target image block to be encoded, and encode the target sub-block to obtain the third encoding result. Use the second encoding result or each third encoding result as a target encoding result. Simultaneously, the undivided sub-image blocks in the above-mentioned image block to be encoded are encoded to obtain the fourth encoding result, which is used as a target encoding result; 2, according to the second preset rule, it is determined whether the image block to be encoded meets the non-single-channel tree partitioning condition. If so, all sub-image blocks of the image block to be encoded are partitioned according to the partitioning mode to obtain multiple partitioned sub-blocks. For each partitioned sub-block, it is determined whether the partitioned sub-block meets the partitioning termination condition according to the first preset rule. If so, the partitioned sub-block is used as the third target image block to be encoded, and the partitioned sub-block is encoded to obtain the fifth encoding result. Otherwise, the second partitioning mode of the partitioned sub-block is determined, and all sub-image blocks of the partitioned sub-block are partitioned according to the second partitioning mode to obtain the target sub-block. When the target sub-block meets the partitioning termination condition, the target sub-block is used as the third target image block to be encoded, and the third target image block to be encoded (i.e., the target sub-block) is encoded to obtain the sixth encoding result; the fifth encoding result or each sixth encoding result is used as a target encoding result.
[0077] For example, the above steps can be understood as follows: when the target image block to be encoded is an image block to be encoded, the image block to be encoded is encoded; when the target image block to be encoded corresponds to a sub-block, for each sub-block, it is determined whether the sub-block meets the sub-block termination condition according to the first preset rule. If it does, the sub-block is encoded; otherwise, the sub-block is processed according to the second preset rule until the sub-block obtained by the sub-block meets the sub-block termination condition and then the sub-block obtained by the sub-block is encoded.
[0078] It should be noted that image blocks (sub-blocks, image blocks to be encoded, etc.) can be encoded using techniques such as predictive coding and compression coding. After encoding the image blocks, the corresponding reconstruction information and partitioning mode need to be encoded into the bitstream. The reconstruction information is the information required for decoding, such as prediction information (information generated after encoding using predictive coding techniques to predict the pixel value of the current pixel based on the pixel values of surrounding pixels), quantization information, quantization parameters, etc.
[0079] The following example illustrates the single-channel tree partitioning described above.
[0080] like Figure 3 As shown, Figure 3 (a) shows the partitioning process of single-channel tree partitioning when the image partitioning type is luminance partitioning (Luma_QT). Figure 3 (b) is the process of single-channel tree partitioning when the image partitioning type is chroma partitioning (Chroma_QT).
[0081] The above steps will be illustrated with a specific example below.
[0082] like Figure 4 As shown, after starting, the image block to be encoded is acquired. It is determined whether it needs to be divided. If it does not need to be divided, the "no division" identifier is encoded, and the current image block (i.e., the image block to be encoded) is directly encoded. If it needs to be divided, the division mode information is encoded, and it is determined whether single-channel tree division is used. If not, the "no single-channel tree division" identifier is encoded, and the corresponding division operation is performed on the entire image block according to the division mode. Each sub-block after division is encoded. If the single-channel tree division condition is met, the single-channel tree division identifier is encoded into the bitstream. It is then determined whether the image division type is luminance division. If so, the luminance branch identifier is encoded, and the corresponding division operation is performed on the luminance block (i.e., the current luminance block is divided using the aforementioned division mode encoded into the bitstream). Each luminance sub-block after division and the undivided chroma block are encoded. If it is not luminance division, the chroma branch identifier is encoded, and the corresponding division operation is performed on the chroma block. Each chroma sub-block after division and the undivided luminance block are encoded, and the process ends.
[0083] Figure 4 The specific process of encoding using single-channel tree partitioning is as follows: Figure 5 As shown, after starting, the block to be encoded and the current branch information are obtained. It is determined whether it is a luma branch. If it is, it is determined whether to use luma partitioning. Otherwise, it is determined whether to use chroma partitioning. If luma partitioning is used, the partitioning mode is encoded and the corresponding partitioning operation is executed. Each luma sub-block after partitioning is encoded. If chroma partitioning is used, the partitioning mode is encoded, the corresponding partitioning operation is executed, and each chroma sub-block after partitioning is encoded. If neither luma nor chroma partitioning is used, the no partitioning identifier is encoded, and the prediction information, residual information, etc. of the current block are encoded into the bit stream.
[0084] For example, will Figure 2 The image block to be encoded shown is divided according to the method of this application, and the result is as follows: Figure 6 As shown, circles represent temporary nodes with variable image patch sizes. Empty dashed boxes indicate that the chroma patch size is fixed while the luma patch size is variable (the luma patch will be further subdivided). Empty long dashed boxes indicate that the luma patch size is fixed while the chroma patch size is variable (the chroma patch will be further subdivided). As can be seen, after the first subdivision, a sub-block 1 is obtained, and the other sub-blocks will be further subdivided. In the second branch obtained after the first subdivision, the sub-block 1... The adjacent sub-blocks on the right are further divided to obtain sub-blocks 2 and 7. The adjacent sub-blocks to the right of sub-block 2 are divided into luminance blocks 3 and luminance blocks 4. The adjacent sub-blocks below sub-block 2 are divided into chrominance blocks 5 and chrominance blocks 6. In the third branch, a binary tree luminance division is performed to obtain luminance block 8 and its adjacent sub-blocks. The adjacent sub-blocks below luminance block 8 are divided into luminance blocks 10 and luminance blocks 11. In the fourth branch, a chrominance division is performed to obtain chrominance blocks 12, chrominance blocks 13, chrominance blocks 14, chrominance blocks 15 and chrominance blocks 16.
[0085] It should be noted that, after performing the image encoding steps described above, embodiments of this application also provide an image decoding method, specifically including:
[0086] The first step is to obtain the target encoding result.
[0087] In some embodiments of this application, the target encoding result includes partitioning information, which can be obtained by accessing the bitstream corresponding to the target encoding result during encoding.
[0088] It should be noted that the above target encoding results are all target encoding results of the image block to be encoded obtained by the image encoding method of this application.
[0089] The second step is to process the target encoding result according to preset rules to obtain the target image block to be decoded. The processing includes single-channel tree partitioning.
[0090] The aforementioned preset rules are determined based on the partitioning information. These preset rules are used to obtain the target image block to be decoded based on the target encoding results, such as combining all target encoding results according to the corresponding positions of the target image block to be encoded in the image block to be encoded as described in the partitioning information.
[0091] The third step is to decode the target image block to be decoded to obtain the target decoding result.
[0092] Specifically, all target encoding results obtained in the above steps are combined according to their corresponding positions in the image block to be encoded to obtain the target image block to be decoded. At the same time, the partitioning mode and image partitioning type of each target encoding result can be obtained through bitstream. Then, the target image block to be decoded is partitioned sequentially according to all partitioning modes and image partitioning types to obtain partitioning results. Then, the partitioning results are decoded using a decoding technology corresponding to the encoding technology used during encoding (such as the inverse algorithm of predictive coding algorithm) to obtain the target decoding result.
[0093] It is worth mentioning that by obtaining decoding-related information from the bitstream, effective information management can be achieved without using other devices or equipment to obtain relevant information, thereby improving decoding efficiency.
[0094] The decoding process described above will be illustrated below with a specific example.
[0095] like Figure 7 As shown, after starting, the image block to be decoded (i.e., the target image block to be decoded) and the corresponding bitstream are acquired. The partitioning information is parsed from the bitstream to determine whether partitioning is required. If no partitioning is required, the current image block (i.e., the target image block to be decoded, which is the image block to be decoded at this time) is decoded based on the bitstream. If partitioning is required, it is determined whether it is a single-channel tree partition. If not, the corresponding partitioning operation is performed on the entire image block, and each sub-block after partitioning is decoded based on the bitstream. If it is a single-channel tree partition, the branch information is parsed from the bitstream to determine whether it is a luminance partition. If it is a luminance partition, the corresponding partitioning operation is performed on the luminance block of the image block to be decoded, and each luminance sub-block after partitioning and the unpartitioned chroma block are decoded based on the bitstream. If it is not a luminance partition, the corresponding partitioning operation is performed on the chroma block, and each chroma sub-block after partitioning and the unpartitioned luminance block are decoded based on the bitstream.
[0096] Figure 7 The specific process of using a single-channel tree partitioning and decoding is as follows: Figure 8As shown, after starting, the image block to be decoded, the corresponding bitstream, and the current branch information are obtained. Then, the partitioning information is parsed from the bitstream to determine whether to partition. If so, the partitioning operation is performed on the image block, and each sub-block is decoded based on the bitstream and branch information. Otherwise, no partitioning is performed, and each sub-block is decoded directly based on the bitstream and branch information.
[0097] The image encoding apparatus provided in this application will be described exemplarily below.
[0098] like Figure 9 As shown, this application embodiment provides an image encoding device, the image encoding device 900 including:
[0099] Acquisition module 901 is used to acquire the image block to be encoded;
[0100] The partitioning module 902 is used to process the image block to be encoded according to preset rules to obtain the target image block to be encoded; the processing includes single-channel tree partitioning or non-single-channel tree partitioning;
[0101] The encoding module 903 is used to encode the target image block to obtain the target encoding result.
[0102] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0103] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0104] like Figure 10 As shown, an embodiment of this application provides a terminal device, wherein the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 10The diagram shows only one processor, a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 executes the computer program D102 to implement the steps in any of the above method embodiments.
[0105] Specifically, when processor D100 executes computer program D102, it acquires the image block to be encoded, processes it according to preset rules to obtain the target image block to be encoded, and then encodes the target image block to obtain the target encoding result. This method can dynamically select different partitions based on the attribute information of the image block to be encoded, improving the effectiveness and accuracy of encoding the image block. It eliminates the need for complex calculations to obtain the partitioning pattern of the image block, effectively reducing the computational complexity of image encoding, increasing the computational speed of image encoding, and further improving encoding efficiency.
[0106] The processor D100 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0107] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may be an external storage device of the terminal device D10, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the terminal device D10. Furthermore, the memory D101 may include both internal and external storage units of the terminal device D10. The memory D101 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory D101 can also be used to temporarily store data that has been output or will be output.
[0108] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0109] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.
[0110] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to an image encoding method apparatus / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0111] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0112] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0113] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles described in this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image encoding method, characterized in that, include: Obtain the image block to be encoded; The image block to be encoded is processed according to preset rules to obtain the target image block to be encoded; the processing includes single-channel tree partitioning; The target image block to be encoded is encoded to obtain the target encoding result; The preset rules include a first preset rule and a second preset rule; single-channel tree partitioning means that only the corresponding sub-image blocks of the image block to be encoded are partitioned in a single mode, and the corresponding partitioning modes include luminance partitioning and chrominance partitioning; partitioning sub-blocks are obtained by partitioning according to the partitioning mode. If subsequent sub-blocks need to be further partitioned, the partitioning sub-blocks on the luminance branch can only choose luminance partitioning or no partitioning, and the partitioning sub-blocks on the chrominance branch can only choose chrominance partitioning or no partitioning. The step of processing the image block to be encoded according to a preset rule to obtain the target image block to be encoded includes: For each sub-block obtained by dividing the image block to be encoded, it is determined whether the sub-block meets the division termination condition according to the first preset rule. If it does, the sub-block is used as the second target image block to be encoded. Otherwise, the sub-block is used as the image block to be encoded and the process of processing the image block to be encoded according to the second preset rule to obtain the second target image block to be encoded is returned until the sub-block obtained meets the division termination condition. Then, the current sub-block is used as the second target image block to be encoded. The process of obtaining the second target image block to be encoded according to the second preset rule includes determining whether the image block to be encoded meets the single-channel tree partitioning condition according to the second preset rule. If so, the image partitioning type of the image block to be encoded is determined, and the image block to be encoded is partitioned according to the image partitioning type to obtain multiple partitioning sub-blocks. The image partitioning type includes luminance partitioning and chrominance partitioning. The second target image block to be encoded is obtained according to the partitioning sub-blocks. The target image block to be encoded includes the second target image block to be encoded.
2. The image encoding method according to claim 1, characterized in that, The step of processing the image block to be encoded according to the second preset rule to obtain the second target image block to be encoded includes: According to the second preset rule, it is determined whether the image block to be encoded meets the single-channel tree partitioning condition. If so, the image partitioning type of the image block to be encoded is determined, and the image block to be encoded is partitioned according to the image partitioning type to obtain multiple partitioned sub-blocks. The image partitioning type includes luminance partitioning and chrominance partitioning. The second target image block to be encoded is obtained according to the partitioned sub-blocks.
3. The image encoding method according to claim 2, characterized in that, The step of obtaining the second target image block to be encoded based on the sub-block division includes: The sub-blocks are processed according to the first preset rule and / or the second preset rule until the new sub-blocks meet the division termination condition, and the new sub-blocks are used as the second target image blocks to be encoded.
4. The image encoding method according to claim 1, characterized in that, According to the second preset rule, it is determined whether the image block to be encoded meets the non-single-channel tree partitioning condition. If so, all sub-image blocks of the image block to be encoded are partitioned according to the partitioning mode to obtain multiple partitioned sub-blocks. A third target image block to be encoded is obtained according to the partitioned sub-blocks. The target image block to be encoded includes the third target image block to be encoded.
5. The image encoding method according to claim 4, characterized in that, The step of obtaining the third target image block to be encoded based on the sub-block division includes: For each of the sub-blocks, determine whether the sub-block meets the division termination condition according to the first preset rule. If it does, the sub-block is used as the third target image block to be encoded. Otherwise, return to the step of processing the image block to be encoded according to the second preset rule to obtain the second target image block, until the sub-blocks obtained by division meet the division termination condition, and then use the current sub-block as the third target image block to be encoded.
6. An image encoding device, characterized in that, include: The acquisition module is used to acquire the image block to be encoded; The partitioning module is used to process the image block to be encoded according to preset rules to obtain the target image block to be encoded; the processing includes single-channel tree partitioning or non-single-channel tree partitioning; The encoding module is used to encode the target image block to be encoded to obtain the target encoding result; Specifically, the partitioning module is used to implement: The preset rules include a first preset rule and a second preset rule; single-channel tree partitioning means that only the corresponding sub-image blocks of the image block to be encoded are partitioned in a single mode, and the corresponding partitioning modes include luminance partitioning and chrominance partitioning; partitioning sub-blocks are obtained by partitioning according to the partitioning mode. If subsequent sub-blocks need to be further partitioned, the partitioning sub-blocks on the luminance branch can only choose luminance partitioning or not partitioning, and the partitioning sub-blocks on the chrominance branch can only choose chrominance partitioning or not partitioning. The step of processing the image block to be encoded according to a preset rule to obtain the target image block to be encoded includes: For each sub-block obtained by dividing the image block to be encoded, it is determined whether the sub-block meets the division termination condition according to the first preset rule. If it does, the sub-block is used as the second target image block to be encoded. Otherwise, the sub-block is used as the image block to be encoded and the process of processing the image block to be encoded according to the second preset rule to obtain the second target image block to be encoded is returned until the sub-block obtained meets the division termination condition. Then, the current sub-block is used as the second target image block to be encoded. The process of obtaining the second target image block to be encoded according to the second preset rule includes determining whether the image block to be encoded meets the single-channel tree partitioning condition according to the second preset rule. If so, the image partitioning type of the image block to be encoded is determined, and the image block to be encoded is partitioned according to the image partitioning type to obtain multiple partitioning sub-blocks. The image partitioning type includes luminance partitioning and chrominance partitioning. The second target image block to be encoded is obtained according to the partitioning sub-blocks. The target image block to be encoded includes the second target image block to be encoded.
7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the image encoding method as described in any one of claims 1 to 5.
8. An image decoding method, characterized in that, include: Obtain the target encoding result as described in any one of claims 1 to 5; The target encoding result is processed according to preset rules to obtain the target image block to be decoded. The processing includes single-channel tree partitioning. The target image block to be decoded is decoded to obtain the target decoding result. All target encoding results obtained in the above steps are combined according to the corresponding positions in the image block to be encoded to obtain the target image block to be decoded. At the same time, the partitioning mode and image partitioning type of each target encoding result can be obtained through bit stream. Then, the target image block to be decoded is partitioned in sequence according to all partitioning modes and image partitioning types to obtain the partitioning result. Then, the partitioning result is decoded using the decoding technology corresponding to the encoding technology used during encoding to obtain the target decoding result.
9. The decoding method according to claim 8, characterized in that, The target encoding result includes partitioning information, and the preset rule is determined based on the partitioning information.
Citation Information
Patent Citations
Method of video coding using separate coding tree for luma and chroma
CN107079160A
Transformation selection of small-size block
CN110944174A
Luma and chroma block partitioning
CN112385239A
Video data decoding apparatus, video data encoding apparatus and method
CN118694941A