Decoding method, encoding method, electronic device and computer-readable storage medium
By constructing a diverse transformation nuclear set and adaptive selection target transformation nucleus, the problem of low codec accuracy caused by the transformation of nuclear solidification in the existing technology has achieved higher coding accuracy and flexibility.
Patent Information
- Application Number
- CN202411452150.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-17
AI Technical Summary
In the existing video encoding and decoding technology, the transformation core is relatively solidified during the construction process and is difficult to adaptively match, resulting in low encoding and decoding accuracy.
By constructing a variety of types of transformations, including a variety of types of transformation cores that include horizontal transformation and vertical transformation, based on coding data and reconstruction template self -adaptive selection target transformation cores to improve coding accuracy.
Through diversified transformation kernel selection and adaptive matching, the accuracy of video encoding and decoding is improved, the syntax bit overhead is reduced, and the flexibility of the encoding and decoding process is enhanced.
Smart Images

Figure CN119011874B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video coding and decoding technology, and in particular to a decoding method, an encoding method, an electronic device and a computer-readable storage medium. Background Art
[0002] The amount of video image data is relatively large, and it is usually necessary to encode and decode the video image data. In the encoding process, it is necessary to select a transform core for transform processing in the transform link, and in the decoding process, it is necessary to select a transform core for inverse transform processing. However, in the prior art, the transform core is relatively fixed during the construction process and difficult to adaptively match, and the syntax bit overhead during the encoding and decoding process is high, resulting in low encoding and decoding accuracy. In view of this, how to improve the encoding and decoding accuracy has become an urgent problem to be solved. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a decoding method, an encoding method, an electronic device and a computer-readable storage medium, which can improve the encoding and decoding accuracy.
[0004] To solve the above technical problems, the first aspect of the present application provides a decoding method, comprising: obtaining the encoded data of a current block, and constructing a transform kernel set corresponding to the current block based on the encoded data; wherein the transform kernel set includes multiple types of transform kernels, and at least one of the horizontal transform and the vertical transform in different types of transform kernels is distinguished from each other; based on the encoded data and the transform kernel set, obtaining a reconstruction template corresponding to a partial area in the current block and determining a reference template corresponding to the reconstruction template; wherein the reference template is obtained from a decoded block; based on the reconstruction template and the reference template, obtaining a target transform kernel from the transform kernel set, and using the target transform kernel to determine a target reconstruction value corresponding to the current block.
[0005] To solve the above technical problems, the second aspect of the present application provides a decoding method, comprising: obtaining the encoding data of a current block, and constructing a transform core set corresponding to the current block based on the encoding data; wherein the transform core set includes multiple types of transform cores, and at least one of the horizontal transform and the vertical transform in different types of transform cores is distinguished from each other; based on the encoding data and the transform core set, obtaining a reconstruction template corresponding to a partial area in the current block and determining a reference template corresponding to the reconstruction template; wherein the reference template is obtained from a decoded block; based on the reconstruction template and the reference template, obtaining a target transform core from the transform core set, determining a coding syntax related to the target transform core, and generating a code stream corresponding to the current block based on the encoding data and the coding syntax.
[0006] To solve the above technical problems, the third aspect of the present application provides an electronic device, which includes: a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect or the second aspect.
[0007] In order to solve the above technical problems, the fourth aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0008] The above scheme obtains the coded data of the current block, and constructs a transform core set composed of multiple types of transform cores corresponding to the current block based on the coded data, wherein the transform core corresponds to horizontal transform and vertical transform, and at least one of the horizontal transform and the vertical transform in different types of transform cores is different from each other, thereby constructing a transform core set composed of diversified transform cores. Based on the coded data and each transform core in the transform core set, the reconstruction template corresponding to each transform core is obtained when the partial area in the current block matches, and the reference template corresponding to the reconstruction template is obtained from the decoded block. All transform cores in the transform core set are selected based on the reconstruction template and the reference template to obtain the target transform core, and the target reconstruction value corresponding to the reconstruction of the current block is determined by using the target transform core, wherein the decoder can obtain the decoded block, and no additional syntax overhead is required when obtaining the template and selecting based on the template. Therefore, by constructing a diversified transform core set, the selection of the transform core is more varied, and it can be adaptively selected based on the reconstruction template and the reference template, thereby improving the encoding and decoding accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0010] Figure 1 It is a flowchart of an implementation method of the decoding method of the present application;
[0011] Figure 2 It is a flowchart of another implementation method of the decoding method of the present application;
[0012] Figure 3 This is a schematic diagram of an application scenario of an implementation method of a spatial domain decoded block corresponding to a current block of the present application;
[0013] Figure 4 This is a schematic diagram of an application scenario of an implementation scheme of a reconstruction template and a reference template corresponding to a current block of the present application;
[0014] Figure 5 It is a schematic diagram of an application scenario of the current block of the present application and its corresponding reference template 1 implementation mode;
[0015] Figure 6 It is a flowchart of an implementation method of the present application;
[0016] Figure 7 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0017] Figure 8 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0019] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0020] The decoding method and encoding method provided in the present application are used to encode and decode video frames, and the corresponding execution subject is a terminal capable of processing video image data.
[0021] It should be noted that in video coding, the transformation link is an indispensable stage for realizing video data compression, which can make the energy of the signal more concentrated, and the transformation technology based on Discrete Cosine Transform (DCT) / Discrete Sine Transform (DST) has always been the mainstream transformation technology for video coding. DCT and DST are specifically divided into a variety of transformation kernels according to different basis functions, including but not limited to DCT2, DCT8 and DST7. In addition, the transformation technology can also include a transform skip mode (TS). This application no longer specifically limits the specific transformation technology used for horizontal transformation and vertical transformation.
[0022] See also Figure 1 , Figure 1 1 is a flowchart of an implementation method of the present invention, the method comprising:
[0023] S101: Obtaining encoding data of a current block, and constructing a transform kernel set corresponding to the current block based on the encoding data; wherein the transform kernel set includes multiple types of transform kernels, and at least one of horizontal transform and vertical transform in different types of transform kernels is distinguished from each other.
[0024] Specifically, the encoding data of the current block is obtained, and a transform core set consisting of multiple types of transform cores corresponding to the current block is constructed based on the encoding data, wherein the transform core corresponds to horizontal transform and vertical transform, and at least one of the horizontal transform and the vertical transform in different types of transform cores is distinguished from each other, thereby constructing a transform core set consisting of diversified transform cores.
[0025] In some implementation scenarios, the encoding data of the current block is obtained, multiple types of preset transformation cores matching the encoding data are obtained, and the multiple preset transformation cores are sequentially added to the transformation core set to obtain a constructed transformation core set.
[0026] Optionally, the encoding end and the decoding end are preset with a plurality of transformation cores arranged in sequence, and the starting point and the end point of selecting the transformation core are determined based on the encoded data.
[0027] In some implementation scenarios, the encoded data of the current block is obtained, the decoded block corresponding to the current block and the transform core used by the decoded block are determined, and based on the transform core used by the decoded block, a transform core set corresponding to the current block is constructed.
[0028] Optionally, the decoded blocks include at least one type of intra-frame decoded blocks and inter-frame decoded blocks of the current block, thereby obtaining multiple decoded blocks, and adaptively acquiring a transform kernel set corresponding to the current block based on the encoded data of the current block.
[0029] S102: Based on the coded data and the transformation kernel set, a reconstruction template corresponding to a partial area in the current block is obtained and a reference template corresponding to the reconstruction template is determined; wherein the reference template is obtained from the decoded block.
[0030] Specifically, based on the encoded data and each transform kernel in the transform kernel set, the reconstruction templates corresponding to the partial area in the current block when matching each transform kernel are obtained, and the reference template corresponding to the reconstruction template is obtained from the decoded block.
[0031] In some implementation scenarios, the transform kernels in the transform kernel set are traversed, and a partial area in the current block is reconstructed based on the encoded data and each transform kernel to obtain the reconstruction templates corresponding to each transform kernel when the current block matches the current block, and the area in the partial decoded block associated with the reconstruction template is obtained as a reference template.
[0032] In some implementation scenarios, the transform kernels in the transform kernel set are traversed, and the current block is reconstructed based on the encoded data and each transform kernel to obtain candidate reconstruction values corresponding to each transform kernel when the current block matches, and the candidate reconstruction values in a specified area of the current block are selected as a reconstruction template, and the area in the partially decoded block associated with the reconstruction template is obtained as a reference template.
[0033] Optionally, the area corresponding to the reconstructed template is located at the edge of the current block, and the reference template is adjacent to the reconstructed template.
[0034] It should be noted that the encoded data includes the quantization residual corresponding to the current block after quantization. The process of reconstructing the current block specifically includes dequantizing the quantization residual to obtain the transform residual, detransforming the transform residual using the transform kernel to obtain the prediction residual, obtaining the prediction value based on intra-frame / inter-frame prediction, and adding it to the prediction residual to obtain a candidate reconstruction value.
[0035] S103: Based on the reconstruction template and the reference template, a target transformation kernel is obtained from the transformation kernel set, and a target reconstruction value corresponding to the current block is determined using the target transformation kernel.
[0036] Specifically, all transform kernels in the transform kernel set are selected based on the reconstruction template and the reference template to obtain a target transform kernel, and the target transform kernel is used to determine a target reconstruction value corresponding to the current block after reconstruction, wherein the decoding end can obtain the decoded block without additional syntactic overhead when obtaining the template and selecting based on the template.
[0037] In some implementation scenarios, only the reconstruction template in the current block has been reconstructed. Based on the reconstruction template and the reference template, the reconstruction cost of the current block is determined, and the transform kernel with the lowest reconstruction cost in the transform kernel set is used as the target transform kernel. The target transform kernel is used to reconstruct other areas outside the reconstruction template in the current block, and the target transform kernel is fused with the reconstruction template corresponding to the target transform kernel to obtain the target reconstruction value corresponding to the reconstruction of the current block.
[0038] In some implementation scenarios, only the reconstruction template in the current block has been reconstructed. Based on the reconstruction template and the reference template, the reconstruction cost of the current block is determined, and the transform kernel with the lowest reconstruction cost in the transform kernel set is used as the target transform kernel. The current block is reconstructed using the target transform kernel to obtain the target reconstruction value corresponding to the reconstruction of the current block.
[0039] In some implementation scenarios, the current block has been reconstructed to obtain a candidate reconstruction value, and the reconstruction cost corresponding to the current block is determined based on the reconstruction template and the reference template, and the candidate reconstruction value with the lowest reconstruction cost is used as the target reconstruction value corresponding to the current block.
[0040] It should be noted that the calculation method of the reconstruction cost includes but is not limited to the absolute residual sum, the absolute transformed residual sum, the mean square error and the variance sum, and this application does not make any specific restrictions on this.
[0041] The above scheme obtains the coded data of the current block, and constructs a transform core set composed of multiple types of transform cores corresponding to the current block based on the coded data, wherein the transform core corresponds to horizontal transform and vertical transform, and at least one of the horizontal transform and the vertical transform in different types of transform cores is different from each other, thereby constructing a transform core set composed of diversified transform cores. Based on the coded data and each transform core in the transform core set, the reconstruction template corresponding to each transform core is obtained when the partial area in the current block matches, and the reference template corresponding to the reconstruction template is obtained from the decoded block. All transform cores in the transform core set are selected based on the reconstruction template and the reference template to obtain the target transform core, and the target reconstruction value corresponding to the reconstruction of the current block is determined by using the target transform core, wherein the decoder can obtain the decoded block, and no additional syntax overhead is required when obtaining the template and selecting based on the template. Therefore, by constructing a diversified transform core set, the selection of the transform core is more varied, and it can be adaptively selected based on the reconstruction template and the reference template, thereby improving the encoding and decoding accuracy.
[0042] See also Figure 2 , Figure 2 : is a flowchart of another implementation of the decoding method of the present application, the method comprising:
[0043] S201: Obtaining the encoding data of the current block, and determining a construction method of a transform kernel corresponding to the current block; wherein the construction method includes at least one of pre-specified and adaptively generated.
[0044] Specifically, the coded data of the current block is obtained, and the construction method adopted by the transform kernel corresponding to the current block is determined, wherein the construction method includes at least one specific construction method of pre-specified and adaptively generated.
[0045] S202: In response to the construction method including pre-specification, obtain the transformation cores configured according to the pre-specified order and add them to the transformation core set.
[0046] Specifically, when the construction method includes pre-specification, the transformation cores configured according to the pre-specified order are obtained, and the transformation cores are sequentially added to the transformation core set according to the order.
[0047] It can be understood that both the encoding end and the decoding end are configured with pre-specified transform cores, so that a transform core set consisting of multiple types of transform cores can be generated more efficiently by specifying the transform cores.
[0048] S203: In response to the construction method including adaptive generation, determine at least part of the transform cores in the transform core set based on the transform cores corresponding to the decoded blocks and the matched adaptive generation method.
[0049] Specifically, when the construction method includes adaptive generation, based on the transform kernel corresponding to the decoded block and the currently matched adaptive generation method, at least part of the transform kernels in the transform kernel set are determined in a manner matching the current block, thereby improving the accuracy of the corresponding transform kernel.
[0050] Optionally, the decoded blocks include at least one type of intra-frame decoded blocks and inter-frame decoded blocks of the current block, and multiple decoded blocks are obtained from different types of decoded blocks, thereby improving the adaptability of the adaptive generation method to the current block.
[0051] In some implementation scenarios, the adaptive generation method includes at least one of the following: obtaining a decoded block obtained in spatial order of position of the current block as a spatial reference block, and determining at least part of the transform cores in the transform core set based on the transform core corresponding to the spatial reference block; obtaining a decoded block before the current block in decoding order as a first historical reference block, and determining at least part of the transform cores in the transform core set based on the transform core corresponding to the first historical reference block; obtaining a decoded block before the current block in decoding order as a second historical reference block, and determining the number of adoptions matched by the transform core corresponding to the second historical reference block, and determining at least part of the transform cores in the transform core set based on the number of adoptions.
[0052] Specifically, the adaptive generation methods include generation based on spatial information, generation based on historical information, and generation based on frequency information, wherein any adaptive generation methods can be freely combined, and the above adaptive generation methods can also be combined with other generation methods. Therefore, using multiple adaptive generation methods can obtain a transformation kernel with higher accuracy and stronger robustness.
[0053] First, the method based on spatial information generation includes: obtaining a decoded block obtained in spatial order of the current block as a spatial reference block, wherein a transform core is obtained based on at least one spatially adjacent or non-adjacent decoded block, the spatial position order is preset, and when the spatial reference block is not obtained at the corresponding position, the corresponding position is skipped. The transform core corresponding to the spatial reference block is screened to determine at least part of the transform cores in the transform core set.
[0054] Secondly, the method based on historical information generation includes: obtaining a decoded block in a decoding order before the current one as a first historical reference block, screening the transformation cores corresponding to the first historical reference block, and determining at least part of the transformation cores in the transformation core set.
[0055] Optionally, the transformation core of the first historical reference block is added to the historical transformation core table, and the historical transformation core table is maintained based on a first-in-first-out manner, that is, when obtaining a transformation core from the historical transformation core table, priority is given to obtaining the transformation core that was first put into the historical transformation core table, and after the transformation cores in the historical transformation core table are checked for duplicates, only one transformation core of any type is retained.
[0056] Third, the method based on frequency information generation includes: obtaining a decoded block whose decoding order is before the current one as a second historical reference block, counting the number of adoptions matched by the transform core corresponding to the second historical reference block, wherein the number of adoptions is counted incrementally according to the transform core adopted by the decoded block, and a specific statistical period can be set. The transform core is screened based on the number of adoptions, and the transform core corresponding to the screened decoded block is used as at least part of the transform core in the transform core set.
[0057] Optionally, a transform kernel frequency statistics table is constructed. After each encoding and decoding of a block, the frequency of occurrence of the transform kernel is updated and arranged from high to low according to the frequency. When the transform kernel is obtained from the transform kernel frequency table, a high-frequency transform kernel is effectively obtained.
[0058] It is understandable that the entire transformation kernel set can be constructed entirely in a pre-specified manner, or entirely in an adaptively generated manner, or a portion of the transformation kernels can be constructed in a pre-specified manner and another portion of the transformation kernels can be constructed in an adaptively generated manner. When the construction method of the transformation kernel set includes adaptive generation, the adaptive generation method can be one or more of the above methods, and this application does not impose specific restrictions on this.
[0059] It should be noted that the transformation core set is configured with a preset number. When the construction method includes adaptive generation, each adaptive generation method corresponds to an upper limit on the number of transformation cores to be added. The transformation cores in the transformation core set are added in sequence according to the order of the multiple adaptive generation methods until the transformation cores in the transformation core set reach the preset number, thereby obtaining a constructed transformation core set, or traversing all adaptive generation methods.
[0060] Specifically, the transformation core set is pre-configured with a preset number, and the preset number corresponds to an upper limit value of the transformation core set, so as to control the stability of the number of transformation cores in the transformation core set.
[0061] Furthermore, when the construction method is adaptively generated, each adaptive generation method corresponds to an upper limit number of transform cores added to the transform core set, thereby controlling the number added by a single adaptive generation method, making the adaptive generation process more diversified, and multiple adaptive generation methods correspond to a sequence for sequentially utilizing different adaptive generation methods in sequence. This application does not specifically limit the sequence of the adaptive generation methods.
[0062] It can be understood that the transformation cores in the transformation core set are added in sequence according to the order of the multiple adaptive generation methods until the transformation cores in the transformation core set reach the preset number, that is, the transformation core set construction is completed after reaching the preset number. Alternatively, the preset number is still not reached after traversing all adaptive generation methods.
[0063] It should be noted that the transform core set is configured with a preset number. After determining at least part of the transform cores in the transform core set based on the transform cores corresponding to the decoded blocks and the matching adaptive generation method, it also includes: in response to the number of transform cores in the transform core set being less than the preset number, obtaining at least part of the candidate transform cores and their corresponding order of addition, and filling the transform core set to the preset number based on the candidate transform cores and their corresponding order of addition.
[0064] Specifically, when the preset number of transform cores is still not obtained after using all construction methods, a plurality of predefined candidate transform cores are obtained, and the order of adding each candidate transform core is determined, and the candidate transform cores are compared with the transform cores in the current transform core set in the order of adding, and the candidate transform cores that are different from all the transform cores in the transform core set are added to the transform core set in the order of adding until the number of transform cores in the transform core set reaches the preset number, thereby maintaining the stability of the transform core set during the encoding and decoding process.
[0065] To facilitate understanding and explanation, this application provides some specific embodiments based on the solutions in the above implementation scenarios to illustrate how to construct a transformation kernel set, but this application does not impose specific restrictions on the specific combination method.
[0066] In Example 1, a transformation core set is constructed based on a pre-specified construction method. The transformation core set includes 5 transformation cores, and each transformation core is specifically shown in Table 1.
[0067] Table 1: Transformation kernel set based on pre-specified construction method
[0068]
[0069] Among them, the use of the transformation kernel set corresponds to the transformation kernel restriction, which includes: when the current block width and height are both greater than 32 pixels, transformation kernel 2, transformation kernel 3, transformation kernel 4, and transformation kernel 5 cannot be used, and only transformation kernel 1 is used at this time.
[0070] In embodiment 2, the transformation core set is constructed based on the adaptive generation construction method. The preset number of transformation core set configurations is 3. The adaptive generation methods are used in the order of generation based on spatial information, generation based on historical information, and generation based on frequency information. The upper limit number added by each adaptive generation method is 2, 2, and 2, respectively.
[0071] In particular, during the transformation core addition process, a transformation core duplication check will be performed, and if the number of transformation cores of all adaptive generation methods is less than 3 after adding, they will be filled based on the preset method.
[0072] Specifically, see Figure 3 , Figure 3 : is a schematic diagram of an application scenario of an implementation method of a spatial decoded block corresponding to the current block of the present application, wherein the spatial adjacent decoded block is used as a spatial reference block, and a transform kernel of the spatial reference block is obtained. The position of the spatial reference block is as follows: Figure 3 As shown in the shaded blocks in , the acquisition order is as shown in the shaded blocks. Assuming that the transform kernels (horizontal transform + vertical transform) at positions 1, 2, and 3 are all DCT2+DCT2, then the transform kernel in the transform kernel set is {DCT2+DCT2}.
[0073] Further, assuming that three blocks have been decoded before decoding the current block in the decoding order, and the transform kernels in the decoding order are DCT2+DCT2, DST7+DST7, and DCT2+DCT2, respectively, then the transform kernels in the historical transform kernel table here are {DST7+DST7, DCT2+DCT2}. Therefore, after adding the history-based transform kernel, the transform kernels in the transform kernel set are {DCT2+DCT2, DST7+DST7}.
[0074] Further, assuming that three blocks have been decoded before decoding the current block in the decoding order, the transform kernels in the decoding order are DCT2+DCT2, DST7+DST7, and DCT2+DCT2, so the transform kernel in the frequency transform kernel table is {DCT2+DCT2, DST7+DST7}. Therefore, after adding the frequency-based transform kernel, the transform kernel in the transform kernel set is still {DCT2+DCT2, DST7+DST7}.
[0075] It can be understood that after adding the derived transform kernels, the number of transform sets is 2, which does not meet the preset number 3. Therefore, multiple candidate transform kernels {DCT2+DCT2, DST7+DST7, DST7+DCT8} are obtained, and the candidate transform kernel added to the transform kernel set is determined to be {DST7+DCT8} according to the corresponding adding order, and finally the transform kernels in the transform kernel set are {DCT2+DCT2, DST7+DST7, DST7+DCT8}.
[0076] S204: Based on the coded data and the transformation kernel set, a reconstruction template corresponding to a partial area in the current block is obtained and a reference template corresponding to the reconstruction template is determined; wherein the reference template is obtained from the decoded block.
[0077] Specifically, based on the encoded data and each transform kernel in the transform kernel set, the reconstruction templates corresponding to the partial area in the current block when matching each transform kernel are obtained, and the reference template corresponding to the reconstruction template is obtained from the decoded block.
[0078] In some implementation scenarios, the transform kernels in the transform kernel set are traversed, and the encoded data is reconstructed based on each transform kernel to obtain candidate reconstruction values corresponding to the current block when it matches each transform kernel; the template selection syntax of the current block in the bitstream corresponding to the encoded data is interpreted, and a reconstruction template is selected from the candidate reconstruction values based on the value of the template selection syntax, and a reference template corresponding to the reconstruction template is determined from the decoded block associated with the current block.
[0079] Specifically, the transform kernels in the transform kernel set are traversed, and the encoded data is reconstructed based on each transform kernel respectively, wherein the transform kernel can inversely transform the transform residual to obtain the prediction residual during the reconstruction process, thereby obtaining the candidate reconstruction values corresponding to each transform kernel when the current block matches.
[0080] Furthermore, the template selection syntax of the current block in the bitstream corresponding to the encoded data is interpreted to obtain the value of the template selection syntax, and based on the value of the template selection syntax, the reconstruction template selected from the candidate reconstruction values is determined, and based on the value of the template selection syntax, the reference template corresponding to the reconstruction template is determined from the decoded blocks associated with the current block, thereby ensuring the accuracy of the template selection.
[0081] It should be noted that the reconstruction template corresponds to a partial area in the current block, and reconstruction templates corresponding to different areas have different reference templates.
[0082] In some implementation scenarios, the template selection syntax of the current block in the bitstream corresponding to the encoded data is interpreted, and based on the value of the template selection syntax, a partial area is selected from the current block as the area to be reconstructed; the transform kernels in the transform kernel set are traversed, and the area to be reconstructed is reconstructed based on each transform kernel, and the reconstruction templates corresponding to each transform kernel are obtained when the current block matches each transform kernel, and a reference template corresponding to the reconstruction template is determined from the decoded block associated with the current block.
[0083] Specifically, the template selection syntax of the current block in the bitstream corresponding to the coded data is interpreted to obtain the value of the template selection syntax, and based on the value of the template selection syntax, the selected area in the current block is determined as the area to be reconstructed. The area to be reconstructed is smaller than the entire current block, thereby reducing the processing load of decoding.
[0084] The transform kernels in the transform kernel set are traversed, and the to-be-reconstructed area is reconstructed based on each transform kernel respectively, wherein the transform kernel can inversely transform the transform residual to obtain the prediction residual during the reconstruction process, thereby obtaining the reconstruction templates corresponding to each transform kernel when the current block matches each transform kernel respectively, and based on the position of the to-be-reconstructed area, a reference template corresponding to the reconstruction template is determined from the decoded blocks associated with the current block.
[0085] See also Figure 4 , Figure 4 is a schematic diagram of an application scenario of a reconstruction template and a reference template corresponding to the current block of the present application, such as Figure 4 The reconstruction template is a reconstruction value corresponding to a partial area in the current block, including but not limited to an upper reconstruction area of the current block, a left reconstruction area of the current block, and an L-shaped reconstruction area of the current block.
[0086] It can be understood that when the reconstruction template is an L-shaped reconstruction area, the upper left corner area (white filled area in the figure) in the L-shaped area can use the corresponding left reference template, or the corresponding upper reference template, or both the left reference template and the upper reference template, or the upper left corner reference template (grid-shaped area in the figure). If the L-shaped area uses both the left reference template and the upper reference template, the upper left corner area of the L is regarded as an overlapping area, and the template cost of the area is calculated once based on the left side and the upper side respectively.
[0087] S205: Based on the reconstruction template and the reference template, a target transformation kernel is obtained from the transformation kernel set, and a target reconstruction value corresponding to the current block is determined using the target transformation kernel.
[0088] Specifically, all transform kernels in the transform kernel set are selected based on the reconstruction template and the reference template to obtain a target transform kernel, and a target reconstruction value corresponding to the current block after reconstruction is determined using the target transform kernel.
[0089] In some implementation scenarios, a reconstruction cost corresponding to the current block is determined based on a reconstruction template and a reference template, and a transform kernel is selected from a transform kernel set as a target transform kernel using the reconstruction cost; a target reconstruction value corresponding to the current block is determined using the target transform kernel.
[0090] Specifically, based on the reconstruction template and the reference template, the reconstruction cost of the current block is calculated to obtain the reconstruction cost corresponding to each transformation kernel when reconstructing, and the transformation kernels in the transformation kernel set are screened based on the reconstruction cost to obtain the transformation kernel with the smallest reconstruction cost as the target transformation kernel corresponding to the current block, thereby using the target transformation kernel to determine the target reconstruction value corresponding to the current block, thereby improving the accuracy of the target reconstruction value.
[0091] In a specific implementation scenario, a reconstruction cost corresponding to the current block is determined based on a reconstruction template and a reference template, and a transform core is selected from a transform core set as a target transform core using the reconstruction cost, including: sorting the transform cores in the transform core set based on the reconstruction cost to obtain a sorted transform core set; interpreting the transform core index syntax of the current block in the bitstream corresponding to the coded data, obtaining the target transform core from the sorted transform core set based on the value of the transform core index syntax, and using the candidate reconstruction value corresponding to the target transform core as the target reconstruction value corresponding to the current block.
[0092] Specifically, the transform cores in the transform core set are sorted in order of reconstruction cost from low to high or from high to low to obtain a sorted transform core set, the transform core index syntax of the current block in the bitstream corresponding to the coded data is interpreted, the value of the transform core index syntax is obtained, and based on the value of the transform core index syntax, the transform core selected from the sorted transform core set is determined to obtain the target transform core. Therefore, the encoder and decoder sort the transform core set by reconstruction cost, and the transform core set corresponds to the same sorting method, thereby ensuring that the encoder and decoder can obtain a completely consistent transform core set, thereby improving the accuracy of target transform core selection.
[0093] To facilitate understanding and explanation, this application provides some specific embodiments based on the solutions in the above implementation scenarios to illustrate how to perform cost comparison, but this application does not impose specific restrictions on specific template selection and cost comparison methods.
[0094] Example 3, please refer to Figure 5 , Figure 5 1 is a schematic diagram of an application scenario of the current block and its corresponding reference template of the present application, assuming that the transformation kernel set adopts the preset transformation kernel set as in Example 1. Figure 5 As shown in , assuming that the current transform block is 4*4, the reconstruction template is an L-shaped region, and the region height or width is 1 pixel. The absolute residual sum of the pixels in the upper region of the L-shape (4 pixels) and the upper adjacent pixels, and the absolute residual sum of the pixels in the left region of the L-shape (4 pixels) and the left adjacent pixels are calculated.
[0095] It should be noted that the encoded data includes a switch syntax, and the first value of the switch syntax is used to indicate that the step of constructing a transform kernel set corresponding to the current block based on the encoded data is allowed to be executed in the decoding stage, and the second value of the switch syntax is used to indicate that the step of constructing a transform kernel set corresponding to the current block based on the encoded data is prohibited in the decoding stage.
[0096] Further, when the switch syntax adopts the first value, the encoded data also includes a first application mode syntax or a second application mode syntax, wherein the first value of the first application mode syntax is used to indicate that in the decoding stage, only the step of constructing a transform kernel set corresponding to the current block based on the encoded data is entered, or directly entering the step of obtaining a reconstruction template corresponding to a partial area in the current block and determining a reference template corresponding to the reconstruction template based on the encoded data and the transform kernel set is entered, and the second value of the first application mode syntax is used to indicate that no step is entered in the decoding stage; the first value of the second application mode syntax is used to indicate that in the decoding stage, the step of constructing a transform kernel set corresponding to the current block based on the encoded data is entered, and the second value of the second application mode syntax is used to indicate that no step is entered in the decoding stage.
[0097] It can be understood that the application of the scheme in any of the above embodiments includes but is not limited to: replacing the transform set in the prior art with the transform set construction method designed by the present application; replacing the transform core selection method of the prior art with the transform core selection method of the decoder end of the present application; adding a transform core selection method based on the decoder end on the basis of the prior art; replacing the prior art with the transform set construction method designed by the present application and the transform core selection method based on the decoder end; adding a transform technology based on the transform set construction method designed by the present application and the transform core selection method based on the decoder end on the basis of the prior art. The specific application scenarios of the above schemes include but are not limited to intra-frame prediction, inter-frame prediction and intra-frame block copy.
[0098] Furthermore, the switch syntax included in the coded data is used to indicate whether the ability to execute the scheme of the present application is available, thereby accurately controlling whether the scheme of the present application is allowed to be executed through the first value and the second value of the switch syntax. Wherein, when the switch syntax adopts the first value, that is, when the scheme of the present application is allowed to be executed, the coded data also includes the first application mode syntax or the second application mode syntax, wherein the first application mode syntax is used to indicate whether to determine to execute some steps in the present application, thereby replacing some schemes in the prior art, and the second application mode syntax is used to indicate whether to execute all steps of the present application, thereby replacing all schemes of the prior art or adding all schemes of the present application on the basis of the prior art. Therefore, the execution of different steps in the present application can be accurately controlled by different syntax values.
[0099] Optionally, when the encoded data includes a first application mode syntax and its value is a first value, if only the step of constructing a transform kernel set corresponding to the current block based on the encoded data is entered, the encoded data also includes a position index syntax, and the value of the position index syntax is used to indicate a transform kernel selected from the transform kernel set for reconstruction.
[0100] Specifically, when the encoded data includes the first application mode syntax and the value is the first value, if only the scheme of constructing the transform core set of the present application is adopted, the encoded data also includes the position index syntax, so as to select the target transform core in the decoding process from the transform core set through the value of the position index syntax, thereby completing the decoding reconstruction.
[0101] Optionally, the syntax coding includes syntax binarization and selection of matching syntax coding methods, the syntax binarization methods include single unary code, truncated unary code, truncated Rice code, signed fixed-length coding, unsigned fixed-length coding and exponential Golomb coding, and the syntax coding methods include but are not limited to advanced entropy coding and bypass coding. The motion vector adjustment switch syntax can be transmitted in syntax structures including but not limited to video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), picture header (PH), coding unit, etc.
[0102] To facilitate understanding and explanation, this application combines the contents of the above embodiments 1-3 and gives the following embodiments to specifically illustrate the syntax that matches the implementation scenario.
[0103] Example 4, a decoding-end transform kernel selection replacement scheme, replaces the transform kernel selection method of the IST transform technology in intra-frame, inter-frame, and IBC prediction modes. In the prior art, the transform kernel set is {DCT2+DCT2, DST7+DST7}. The same decoding-end-based transform kernel selection method of [Example 3] is used to replace the implicit transform kernel selection method of IST.
[0104] Furthermore, the switch syntax sps_dts_enable is used to mark whether to enable the decoding-side transform core selection replacement scheme and is transmitted in the SPS, as shown in Table 2 below.
[0105] Table 2: Example 4 Sequence Header Syntax
[0106]
[0107] When sps_dts_enable=0, it indicates that the decoding-side transform core selection replacement scheme is not enabled; when sps_dts_enable=1, it indicates that the decoding-side transform core selection replacement scheme is enabled.
[0108] Further, when the decoding side transform core selection alternative is enabled, the first application mode syntax dts_flag in the coding unit syntax structure is used to express whether to execute the decoding side transform core selection method. When dts_flag=0, it indicates that the decoding side transform core selection method is not executed, and when dts_flag=1, it indicates that the decoding side transform core selection method is executed. The specific syntax is shown in Table 3 below.
[0109] Table 3: Example 4 Coding Unit Syntax
[0110]
[0111] Embodiment 5, in the transformation process of intra-frame, inter-frame, and IBC prediction modes, a transformation technology based on the transformation set construction method designed in this application and the transformation core selection method based on the decoding end is added. It is assumed that the transformation set construction method based on the design of this proposal and the transformation core selection method based on the decoding end are the same as [Embodiment 3].
[0112] Specifically, the switch syntax sps_dets_enable is used to mark whether to enable the enhanced transform new scheme and transmit it in the SPS, as shown in the following table. When sps_dets_enable=0, it means that the enhanced transform new scheme is not enabled; when sps_dets_enable=1, it means that the enhanced transform new scheme is enabled, as shown in the following table 4.
[0113] Table 4: Example 5 Sequence Header Syntax
[0114]
[0115] Furthermore, when the enhanced transformation scheme is enabled, the second application mode syntax dets_flag in the coding unit syntax structure is used to express whether the enhanced transformation technology is executed. When dets_flag=0, it indicates that the enhanced transformation technology is not executed, and when dets_flag=1, it indicates that the enhanced transformation technology is executed.
[0116] It can be understood that when the decoding end is enabled to perform enhanced transformation technology, the decoding end transformation selection mode syntax dts_flag in the coding unit syntax structure is used to express whether the decoding end transformation core selection method is executed. When dts_flag=0, it indicates that the decoding end transformation core selection method is not executed, and when dts_flag=1, it indicates that the decoding end transformation core selection method is executed. When the decoding end transformation core selection method is executed, the transformation core index syntax tr_idx in the coding unit syntax structure is used to express the use of the tr_idx-th transformation core in the transformation core set. The specific syntax is shown in the following table.
[0117] Table 5: Example 5 Coding Unit Syntax
[0118]
[0119] In this embodiment, the construction method adopted by the transform core corresponding to the current block includes at least one specific construction method of pre-specified and adaptive generation. When the construction method includes adaptive generation, based on the transform core corresponding to the decoded block and the currently matched adaptive generation method, at least part of the transform cores in the transform core set are determined by matching the current block, thereby improving the accuracy of the corresponding transform core. The transform cores in the transform core set are traversed to determine the reconstruction templates corresponding to each transform core when the current block matches, and the reference template corresponding to the reconstruction template is determined from the decoded block associated with the current block, thereby ensuring the accuracy of template selection. Based on the reconstruction template and the reference template, the reconstruction cost of the current block is calculated to obtain the reconstruction cost corresponding to each transform core when reconstructing, and the transform cores in the transform core set are screened based on the reconstruction cost, so as to obtain the transform core with the smallest reconstruction cost as the target transform core corresponding to the current block, so as to determine the target reconstruction value corresponding to the current block using the target transform core, thereby improving the accuracy of the target reconstruction value.
[0120] See also Figure 6 , Figure 6 It is a flowchart of an implementation method of the present application, the method comprising:
[0121] S601: Obtain coding data of a current block, and construct a transform kernel set corresponding to the current block based on the coding data; wherein the transform kernel set includes multiple types of transform kernels, and at least one of horizontal transform and vertical transform in different types of transform kernels is distinguished from each other.
[0122] S602: Based on the coded data and the transformation kernel set, a reconstruction template corresponding to a partial area in the current block is obtained and a reference template corresponding to the reconstruction template is determined; wherein the reference template is obtained from the decoded block.
[0123] S603: Based on the reconstruction template and the reference template, obtain a target transform kernel from the transform kernel set, determine a coding syntax related to the target transform kernel, and generate a code stream corresponding to the current block based on the coding data and the coding syntax.
[0124] It should be noted that the encoding process in this implementation corresponds to the decoding process in any of the above embodiments. The forward encoding process at the encoding end includes predicting the current block to obtain a prediction value, subtracting it from the corresponding encoded input image value to obtain a prediction residual, transforming the prediction residual to obtain a transformed residual, quantizing the transformed residual to obtain a quantized residual to generate encoded data, and finally, using entropy coding to write the encoded data and the encoding syntax into the bitstream.
[0125] Furthermore, in order to verify the coding effect of each transform kernel in the transform kernel set and to verify the influence of template selection on coding accuracy, the encoding end also includes the same derivation process as the decoding end, that is, the content recorded in any of the above embodiments. The encoding end determines the coding syntax related to the transform kernel selection and template selection through the error after encoding and decoding, wherein the coding syntax includes at least all the syntaxes in the above embodiments, which will not be repeated in this application.
[0126] See also Figure 7 , Figure 7 It is a structural diagram of an embodiment of an electronic device of the present application, wherein the electronic device 70 includes a memory 701 and a processor 702 coupled to each other, wherein the memory 701 stores program data (not shown), and the processor 702 calls the program data to implement the method in any of the above embodiments. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0127] See also Figure 8 , Figure 8 It is a structural diagram of an implementation method of a computer-readable storage medium of the present application. The computer-readable storage medium 80 stores program data 800. When the program data 800 is executed by a processor, the method in any of the above embodiments is implemented. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0128] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0130] If the integrated unit is implemented in the form of 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, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0131] The above description is only an implementation method of the present application, and does not limit the protection scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the protection scope of the present application.
Claims
1. A decoding method, characterized in that: The method comprises: Obtaining encoding data of a current block, and constructing a transform core set corresponding to the current block based on the encoding data; wherein the transform core set includes multiple types of transform cores, and at least one of horizontal transform and vertical transform in different types of transform cores is different from each other; Based on the coded data and the transform kernel set, a reconstruction template corresponding to a partial area in the current block is obtained and a reference template corresponding to the reconstruction template is determined; wherein the reference template is obtained from a decoded block; Based on the reconstruction template and the reference template, a target transformation kernel is obtained from the transformation kernel set, and a target reconstruction value corresponding to the current block is determined using the target transformation kernel.
2. The decoding method according to claim 1, characterized in that: The obtaining the coded data of the current block and constructing a transform kernel set corresponding to the current block based on the coded data includes: Acquire the coded data of the current block, and determine a construction method of a transform kernel corresponding to the current block; wherein the construction method includes at least one of pre-specified and adaptively generated; In response to the construction method including pre-specification, obtaining transformation cores configured according to the pre-specified order and adding them to the transformation core set; In response to the construction method including adaptive generation, at least part of the transform cores in the transform core set are determined based on the transform cores corresponding to the decoded blocks and the matched adaptive generation method.
3. The decoding method according to claim 2, characterized in that: The adaptive generation method includes at least one of the following: Obtaining a decoded block of the current block obtained in spatial order in a spatial domain as a spatial reference block, and determining at least part of the transform cores in the transform core set based on the transform core corresponding to the spatial reference block; Acquire a decoded block before the current block in decoding order as a first historical reference block, and determine at least part of the transform cores in the transform core set based on the transform core corresponding to the first historical reference block; A decoded block whose decoding order is before the current block is obtained as a second historical reference block, and the number of adoptions matched by the transform core corresponding to the second historical reference block is determined, and based on the number of adoptions, at least part of the transform cores in the transform core set is determined.
4. The decoding method according to claim 3, characterized in that: The transformation core set is configured with a preset number. When the construction method includes adaptive generation, each adaptive generation method corresponds to an upper limit number of transformation cores to be added. The transformation cores in the transformation core set are added in sequence according to the order of the multiple adaptive generation methods until the transformation cores in the transformation core set reach the preset number, thereby obtaining the constructed transformation core set, or traversing all the adaptive generation methods.
5. The decoding method according to claim 2, characterized in that: The transform core set is configured with a preset number. After determining at least part of the transform cores in the transform core set based on the transform cores corresponding to the decoded blocks and the matching adaptive generation method, the method further includes: In response to the number of transform cores in the transform core set being less than the preset number, at least some candidate transform cores and their corresponding adding orders are obtained, and based on the candidate transform cores and their corresponding adding orders, the transform core set is filled to the preset number.
6. The decoding method according to claim 1, characterized in that: The obtaining, based on the coded data and the transform kernel set, a reconstruction template corresponding to a partial area in the current block and determining a reference template corresponding to the reconstruction template comprises: Traversing the transform cores in the transform core set, reconstructing the coded data based on each of the transform cores, and obtaining candidate reconstruction values corresponding to each transform core when the current block matches each of the transform cores; Interpret the template selection syntax of the current block in the code stream corresponding to the encoded data, select a reconstruction template from the candidate reconstruction values based on the value of the template selection syntax, and determine a reference template corresponding to the reconstruction template from the decoded blocks associated with the current block.
7. The decoding method according to claim 1, characterized in that: The obtaining, based on the coded data and the transform kernel set, a reconstruction template corresponding to a partial area in the current block and determining a reference template corresponding to the reconstruction template comprises: interpreting a template selection syntax of the current block in a bitstream corresponding to the coded data, and selecting a partial area from the current block as an area to be reconstructed based on a value of the template selection syntax; The transformation cores in the transformation core set are traversed, and the to-be-reconstructed area is reconstructed based on each of the transformation cores to obtain reconstruction templates corresponding to each transformation core when the current block matches each transformation core, and a reference template corresponding to the reconstruction template is determined from a decoded block associated with the current block.
8. The decoding method according to claim 6 or 7, characterized in that: The step of obtaining a target transformation kernel from the transformation kernel set based on the reconstruction template and the reference template, and determining a target reconstruction value corresponding to the current block by using the target transformation kernel includes: Determine a reconstruction cost corresponding to the current block based on the reconstruction template and the reference template, and select a transform kernel from the transform kernel set as a target transform kernel by using the reconstruction cost; The target transformation kernel is used to determine a target reconstruction value corresponding to the current block.
9. The decoding method according to claim 8, characterized in that: The step of determining a reconstruction cost corresponding to the current block based on the reconstruction template and the reference template, and selecting a transformation kernel from the transformation kernel set as a target transformation kernel by using the reconstruction cost, comprises: sorting the transformation cores in the transformation core set based on the reconstruction cost to obtain the sorted transformation core set; The transform core index syntax of the current block in the bitstream corresponding to the coded data is interpreted, and based on the value of the transform core index syntax, the target transform core is obtained from the sorted transform core set.
10. The decoding method according to claim 1, characterized in that: The coded data includes a switch syntax, wherein a first value of the switch syntax is used to indicate that the step of constructing a transform core set corresponding to the current block based on the coded data is allowed to be executed at a decoding stage, and a second value of the switch syntax is used to indicate that the step of constructing a transform core set corresponding to the current block based on the coded data is prohibited to be executed at a decoding stage; Among them, when the switch syntax adopts the first value, the encoded data also includes a first application mode syntax or a second application mode syntax, wherein the first value of the first application mode syntax is used to indicate that in the decoding stage, only the step of constructing the transform kernel set corresponding to the current block based on the encoded data is entered, or directly entering the step of obtaining a reconstruction template corresponding to a partial area in the current block and determining a reference template corresponding to the reconstruction template based on the encoded data and the transform kernel set is entered, and the second value of the first application mode syntax is used to indicate not entering any step in the decoding stage; the first value of the second application mode syntax is used to indicate entering the step of constructing the transform kernel set corresponding to the current block based on the encoded data in the decoding stage, and the second value of the second application mode syntax is used to indicate not entering any step in the decoding stage.
11. The decoding method according to claim 10, characterized in that: When the encoded data includes the first application mode syntax and its value is the first value, if only the step of constructing the transform kernel set corresponding to the current block based on the encoded data is entered, the encoded data also includes a position index syntax, and the value of the position index syntax is used to indicate the transform kernel selected from the transform kernel set for reconstruction.
12. A coding method, characterized in that: The method comprises: Obtaining encoding data of a current block, and constructing a transform core set corresponding to the current block based on the encoding data; wherein the transform core set includes multiple types of transform cores, and at least one of horizontal transform and vertical transform in different types of transform cores is different from each other; Based on the coded data and the transform kernel set, a reconstruction template corresponding to a partial area in the current block is obtained and a reference template corresponding to the reconstruction template is determined; wherein the reference template is obtained from a decoded block; Based on the reconstruction template and the reference template, a target transform kernel is obtained from the transform kernel set, a coding syntax related to the target transform kernel is determined, and a code stream corresponding to the current block is generated based on the coding data and the coding syntax.
13. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method according to any one of claims 1-11 or 12.
14. A computer-readable storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the method according to any one of claims 1 to 11 or 12 is implemented.
Citation Information
Patent Citations
Image encoding and decoding method, device and system and storage medium
CN109922340A
Image encoding / decoding method and apparatus, and recording medium storing bitstream
CN113545089A