Search

US-12627802-B2 - Data encoding and decoding method and related device

US12627802B2US 12627802 B2US12627802 B2US 12627802B2US-12627802-B2

Abstract

This application provides a data encoding and decoding method and a related device. In the encoding method, side information feature extraction is performed on a first feature map of current data, and quantization processing is performed, to obtain a first quantized feature map. Entropy encoding is performed based on the first quantized feature map, to obtain a first bitstream of the current data. A scaling coefficient is obtained based on the first quantized feature map, scaling processing is performed on a second feature map based on the scaling coefficient, and quantization processing is performed, to obtain a second quantized feature map. Scaling processing is performed on a first probability distribution parameter based on the scaling coefficient, to obtain a second probability distribution parameter, and entropy encoding is performed on the second quantized feature map based on the second probability distribution parameter, to obtain a second bitstream of the current data.

Inventors

  • Yihui FENG
  • Tiansheng Guo
  • Yibo Shi
  • Jing Wang

Assignees

  • HUAWEI TECHNOLOGIES CO., LTD.

Dates

Publication Date
20260512
Application Date
20250107
Priority Date
20220708

Claims (20)

  1. 1 . A data encoding method, comprising: obtaining a side information feature map by performing side information feature extraction on a first feature map of current data; obtaining a first quantized feature map by performing quantization processing on the side information feature map; obtaining a first bitstream of the current data by performing entropy encoding on the first quantized feature map; obtaining a scaled feature map by performing scaling processing on a second feature map based on a scaling coefficient, wherein the scaling coefficient is obtained based on the first quantized feature map; obtaining a second quantized feature map by performing quantization processing on the scaled feature map; obtaining a second probability distribution parameter by performing scaling processing on a first probability distribution parameter based on the scaling coefficient; and obtaining a second bitstream of the current data by performing entropy encoding on the second quantized feature map based on the second probability distribution parameter.
  2. 2 . The method according to claim 1 , wherein the second feature map is a residual feature map of the current data and obtained based on a third feature map of the current data and the first probability distribution parameter, and the third feature map is obtained by performing feature extraction on the current data.
  3. 3 . The method according to claim 2 , wherein the first feature map is same as the third feature map.
  4. 4 . The method according to claim 1 , wherein the second feature map is obtained by performing feature extraction on the current data.
  5. 5 . The method according to claim 4 , wherein the first feature map is same as the second feature map.
  6. 6 . The method according to claim 1 , wherein the first probability distribution parameter includes a mean and/or a variance.
  7. 7 . The method according to claim 1 , further comprising: sending the first bitstream and the second bitstream.
  8. 8 . The method according to claim 1 , wherein the data comprises at least one of: image data, video data, motion vector data of the video data, audio data, point cloud data, or text data.
  9. 9 . A data decoding method, comprising: obtaining a third feature map by performing entropy decoding based on a first bitstream of current data; obtaining a scaling coefficient based on the third feature map; obtaining a second probability distribution parameter by performing scaling processing on a first probability distribution parameter based on the scaling coefficient; obtaining a fourth feature map by performing entropy decoding on a second bitstream of the current data based on the second probability distribution parameter; obtaining a fifth feature map by performing scaling processing on the fourth feature map based on the scaling coefficient; and obtaining reconstructed data of the current data based on the fifth feature map.
  10. 10 . The method according to claim 9 , wherein the fourth feature map is a residual feature map, the fifth feature map is a scaled residual feature map, and obtaining the reconstructed data of the current data based on the fifth feature map comprises: obtaining a sixth feature map by adding the first probability distribution parameter to the fifth feature map; and obtaining the reconstructed data of the current data based on the sixth feature map.
  11. 11 . The method according to claim 9 , wherein the first probability distribution parameter includes a mean and/or a variance.
  12. 12 . The method according to claim 9 , wherein the data comprises at least one of: image data, video data, motion vector data of the video data, audio data, point cloud data, or text data.
  13. 13 . The method according to claim 9 , further comprising: receiving the first bitstream and the second bitstream of the current data.
  14. 14 . A data decoder, comprising: one or more processors; and a memory operatively coupled to the one or more processors and storing a program that, when executed by the one or more processors, causes the data decoder to: obtain a side information feature map by performing side information feature extraction on a first feature map of current data; obtain a first quantized feature map by performing quantization processing on the side information feature map; obtain a first bitstream of the current data by performing entropy encoding on the first quantized feature map; obtain a scaled feature map by performing scaling processing on a second feature map based on a scaling coefficient, wherein the scaling coefficient is obtained based on the first quantized feature map; obtain a second quantized feature map by performing quantization processing on the scaled feature map; obtain a second probability distribution parameter by performing scaling processing on a first probability distribution parameter based on the scaling coefficient; and obtain a second bitstream of the current data by performing entropy encoding on the second quantized feature map based on the second probability distribution parameter.
  15. 15 . The decoder of claim 14 , wherein the second feature map is a residual feature map of the current data and obtained based on a third feature map of the current data and the first probability distribution parameter, and the third feature map is obtained by performing feature extraction on the current data.
  16. 16 . The decoder of claim 15 , wherein the first feature map is same as the third feature map.
  17. 17 . The decoder of claim 14 , wherein the second feature map is obtained by performing feature extraction on the current data.
  18. 18 . The decoder of claim 17 , wherein the first feature map is same as the second feature map.
  19. 19 . The decoder of claim 14 , wherein the first probability distribution parameter includes a mean and/or a variance.
  20. 20 . The decoder of claim 14 , wherein the data comprises at least one of: image data, video data, motion vector data of the video data, audio data, point cloud data, or text data.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2023/099648, filed on Jun. 12, 2023, which claims priority to Chinese Patent Application No. 202210801030.7, filed on Jul. 8, 2022. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD Embodiments of this application relate to the data processing field, and in particular, to a data encoding and decoding method and a related device. BACKGROUND An objective of a data compression technology is to reduce redundant information in data, so that data can be stored and transmitted in a more efficient format. In other words, data compression is lossy or lossless representation of original data in fewer bits. The data can be compressed because there is redundancy in the data. An objective of the data compression is to reduce a quantity of bits required to represent the data by removing the data redundancy. How to improve compression performance of a data compression algorithm is an important topic being studied by persons skilled in the art. SUMMARY This application provides a data encoding and decoding method and a related device, to improve data compression performance. According to a first aspect, a data encoding method is provided, and the method is performed by a data encoding apparatus. The method includes the following steps. Side information feature extraction is performed on a first feature map of current data, to obtain a side information feature map. Then, quantization processing is performed on the side information feature map, to obtain a first quantized feature map. Entropy encoding is performed on the first quantized feature map, to obtain a first bitstream of the current data. Scaling processing is performed on a second feature map based on a scaling coefficient, to obtain a scaled feature map. Quantization processing is performed on the scaled feature map, to obtain a second quantized feature map. The scaling coefficient is obtained based on the first quantized feature map. Scaling processing is performed on a first probability distribution parameter based on the scaling coefficient, to obtain a second probability distribution parameter. Entropy encoding is performed on the second quantized feature map based on the second probability distribution parameter, to obtain a second bitstream of the current data. The data includes at least one of the following: image data, video data, motion vector data of the video data, audio data, point cloud data, or text data. In this embodiment, the first feature map is a feature map obtained by performing feature extraction on the complete current data, and the second feature map is a feature map obtained based on the current data. Side information means that existing information Y is used to assist in encoding information X, so that an encoded length of the information X can be shorter. In other words, redundancy in the information X is reduced. The information Y is the side information. In this embodiment of this application, the side information is information that is extracted from the first feature map and that is used to assist in encoding and decoding the first feature map. In addition, a bitstream is a bitstream generated after encoding processing. In this solution, the entropy encoding is performed based on the first quantized feature map, to obtain the first bitstream of the current data. The first bitstream is a bitstream obtained after the entropy encoding is performed on the first quantized feature map. In addition, the scaling coefficient may be obtained through estimation based on the first quantized feature map. In this way, the scaling processing may be performed on the second feature map based on the scaling coefficient, to obtain the scaled feature map. Then, the quantization processing is performed on the scaled feature map, to obtain the second quantized feature map. The scaling processing is performed on the first probability distribution parameter based on the scaling coefficient, to obtain the second probability distribution parameter. Finally, the entropy encoding is performed on the second quantized feature map based on the second probability distribution parameter, to obtain the second bitstream of the current data. The second bitstream is a bitstream obtained after the entropy encoding is performed on the second quantized feature map. The first bitstream and the second bitstream are used together as a total bitstream of the current data. A data encoding method in a conventional technology includes only a step of performing scaling processing on a feature map. In this solution, the second feature map and the first probability distribution parameter are scaled by using the same scaling coefficient, so that a matching degree between the second probability distribution parameter and the second quantized feature map is higher, thereby improving encoding accuracy