Encoding and decoding method, encoder, decoder and storage medium
Patent Information
- Application Number
- CN202280096828.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2042-06-17
AI Technical Summary
In the attribute encoding process of existing point cloud compression technology, it is necessary to encode/decode continuous 0 coefficients, which leads to an increase in the complexity of the encoding and decoding process and a decrease in efficiency.
The coefficient identification information is introduced, and the coefficients to be encoded/decoded are grouped through the grouping step parameter to determine the coefficient identification information. If the coefficients in the group are all 0, the identification information is used for indication, saving code words.
The encoding and decoding performance of point cloud attributes is improved, the encoding and decoding process is simplified, and the efficiency is improved.
Smart Images

Figure CN119318147A_ABST
Abstract
Description
Coding and decoding method, encoder, decoder and storage medium Technical Field
[0001] The embodiments of the present application relate to the field of point cloud compression technology, and in particular to a coding and decoding method, an encoder, a decoder, and a storage medium. Background Art
[0002] In the Audio Video Standard-Point Cloud Compression (AVS-PCC) codec framework based on the Audio Video Coding Standard, the geometric and attribute information of a point cloud are encoded separately. After geometric encoding, the geometric information is reconstructed, and the encoding of the attribute information relies on the reconstructed geometric information. Attribute encoding primarily encodes color information, converting it into a YUV color space that better matches human visual characteristics. Attribute encoding is then performed on the preprocessed attribute information, ultimately generating a binary attribute bitstream.
[0003] Currently, the Point Cloud Compression Reference Model (PCRM) needs to encode and decode the number of consecutive zero coefficients during attribute encoding. However, after prediction, transformation, and quantization, the coefficients are relatively small. Statistics show that there are usually consecutive zero coefficients. This increases the complexity of the encoding and decoding process to a certain extent and reduces encoding and decoding efficiency.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a coding and decoding method, an encoder, a decoder, and a storage medium, which can improve the coding and decoding efficiency of point cloud attributes.
[0006] The technical solution of the embodiment of the present application can be implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:
[0008] Determine the grouping step size parameter;
[0009] Grouping the plurality of coefficients to be decoded according to the grouping step size parameter to determine at least one coefficient group to be decoded;
[0010] Determining coefficient identification information of a current group in the at least one to-be-decoded coefficient group; wherein the coefficient identification information is used to indicate whether all the to-be-decoded coefficients in the current group are 0;
[0011] If the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0, the decoding process of the coefficients to be decoded in the current group is completed, and the coefficient identification information of the next coefficient group to be decoded in the at least one coefficient group to be decoded is continued to be determined.
[0012] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:
[0013] Determine the grouping step size parameter;
[0014] Grouping the plurality of coefficients to be coded according to the grouping step size parameter to determine at least one coefficient group to be coded;
[0015] If a current coefficient in a current group of the at least one to-be-encoded coefficient group is not 0, determining coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the to-be-decoded coefficients in the current group are 0;
[0016] If the value of the coefficient identification information is the second value, writing the coefficient identification information into the bitstream and setting the value of the coefficient identification information to the first value; after writing the zero run value into the bitstream, encoding the current coefficient and setting the zero run value to 0;
[0017] If the value of the coefficient identification information is the first value, after writing the zero-run value into the bitstream, encoding the current coefficient and setting the zero-run value to 0;
[0018] Continue to encode the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value.
[0019] In the above scheme, when the current coefficient is the last coefficient to be encoded in the current group, if the value of the coefficient identification information is the second value, it is determined that the coefficients to be encoded in the current group are all 0, then the coefficient identification information is encoded as the first value and written into the bitstream; otherwise, the zero run value is written into the bitstream.
[0020] In the above scheme, when the current coefficient is the last coefficient to be encoded in the current group, if the zero-run value is the same as the number of points in the current group, it is determined that the coefficients to be encoded in the current group are all 0, and the coefficient identification information is encoded as the first value and written into the bitstream; otherwise, the zero-run value is written into the bitstream.
[0021] In a third aspect, an embodiment of the present application provides an encoder, comprising a first determining unit, a setting unit, and an encoding unit; wherein,
[0022] The first determining unit is configured to determine a grouping step size parameter; group a plurality of coefficients to be encoded according to the grouping step size parameter to determine at least one group of coefficients to be encoded; and if a current coefficient in a current group in the at least one group of coefficients to be encoded is not zero, determine coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all coefficients to be decoded in the current group are zero;
[0023] The encoding unit is configured to write the coefficient identification information into the bitstream if the value of the coefficient identification information is the second value;
[0024] The setting unit is configured to set the value of the coefficient identification information to the first value if the value of the coefficient identification information is the second value;
[0025] The encoding unit is further configured to encode the current coefficient after writing the zero-run value into the bitstream;
[0026] The setting unit is further configured to set the zero-run value to 0;
[0027] The encoding unit is further configured to, if the value of the coefficient identification information is the first value, encode the current coefficient after writing the zero run value into the bitstream;
[0028] The setting unit is further configured to set the zero-run value to 0;
[0029] The encoding unit is further configured to continue encoding the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value.
[0030] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor; wherein,
[0031] The first memory is used to store a computer program that can be run on the first processor;
[0032] The first processor is configured to execute the encoding method described above when running the computer program.
[0033] In a fifth aspect, an embodiment of the present application provides a decoder, the decoder comprising a second determining unit; wherein,
[0034] The second determination unit is configured to determine a grouping step parameter; group multiple coefficients to be decoded according to the grouping step parameter to determine at least one coefficient group to be decoded; determine coefficient identification information of a current group in the at least one coefficient group to be decoded; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0; if the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0, then the decoding process of the coefficients to be decoded in the current group is completed, and the identification information of the next coefficient group to be decoded in the at least one coefficient group to be decoded is continued to be determined.
[0035] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second memory and a second processor; wherein:
[0036] The second memory is used to store a computer program that can be run on the second processor;
[0037] The second processor is configured to execute the above-mentioned decoding method when running the computer program.
[0038] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, it implements the decoding method described above, or implements the encoding method described above.
[0039] An embodiment of the present application provides a coding and decoding method, an encoder, a decoder, and a storage medium. At the encoding end, a grouping step parameter is determined; a plurality of coefficients to be coded are grouped according to the grouping step parameter to determine at least one coefficient group to be coded; if a current coefficient in a current group in at least one coefficient group to be coded is not 0, coefficient identification information of the current group is determined; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0; if the value of the coefficient identification information is a second value, the coefficient identification information is written into a bitstream, and the value of the coefficient identification information is set to a first value; after writing a zero-run value into the bitstream, the current coefficient is encoded, and the zero-run value is set to 0; if the value of the coefficient identification information is the first value, after writing the zero-run value into the bitstream, the current coefficient is encoded, and the zero-run value is set to 0; and the next coefficient to be coded in the current group is continuously encoded according to the coefficient identification information and the zero-run value. At the decoding end, a grouping step parameter is determined; multiple coefficients to be decoded are grouped according to the grouping step parameter to determine at least one coefficient group to be decoded; coefficient identification information of the current group in at least one coefficient group to be decoded is determined; wherein the coefficient identification information is used to indicate whether the coefficients to be decoded in the current group are all 0; if the coefficient identification information indicates that the coefficients to be decoded in the current group are all 0, the decoding process of the coefficients to be decoded in the current group is completed, and the coefficient identification information of the next coefficient group to be decoded in at least one coefficient group to be decoded is continued to be determined. It can be seen that in the embodiment of the present application, when encoding and decoding attribute information, due to the introduction of coefficient identification information, multiple coefficients can be grouped and processed, so that when the coefficients in a coefficient group are all 0, one coefficient identification information can be used to indicate the value of multiple coefficients in the group, which greatly saves codewords and improves the encoding and decoding performance of point cloud attributes. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] FIG1A is a schematic diagram of a three-dimensional point cloud image provided in an embodiment of the present application;
[0041] FIG1B is a partially enlarged schematic diagram of a three-dimensional point cloud image provided in an embodiment of the present application;
[0042] FIG2A is a schematic diagram of a point cloud image at different viewing angles provided by an embodiment of the present application;
[0043] FIG2B is a schematic diagram of a data storage format corresponding to FIG2A provided in an embodiment of the present application;
[0044] FIG3 is a schematic diagram of a network architecture of point cloud encoding and decoding provided by an embodiment of the present application;
[0045] FIG4 is a schematic diagram of the structure of a point cloud encoder provided in an embodiment of the present application;
[0046] FIG5 is a schematic diagram of the structure of a point cloud decoder provided in an embodiment of the present application;
[0047] FIG6 is a schematic diagram of an implementation flow of a decoding method proposed in an embodiment of the present application;
[0048] FIG7 is a schematic diagram of an implementation flow of the encoding method proposed in an embodiment of the present application;
[0049] FIG8 is a schematic diagram of the structure of the encoder;
[0050] FIG9 is a second schematic diagram of the structure of the encoder;
[0051] FIG10 is a schematic diagram of the structure of the decoder;
[0052] FIG11 is a second schematic diagram of the structure of the decoder. DETAILED DESCRIPTION
[0053] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0055] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0056] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0057] Point cloud is a three-dimensional representation of the surface of an object. Point cloud (data) of the surface of an object can be collected through acquisition equipment such as photoelectric radar, lidar, laser scanner, and multi-view camera.
[0058] A point cloud is a set of irregularly distributed discrete points in space that express the spatial structure and surface properties of a three-dimensional object or scene. Figure 1A shows a three-dimensional point cloud image and Figure 1B shows a partially enlarged view of the three-dimensional point cloud image. It can be seen that the point cloud surface is composed of densely distributed points.
[0059] In a two-dimensional image, each pixel contains information and is distributed regularly, so there's no need to record its location. However, the distribution of points in a point cloud in three-dimensional space is random and irregular, so recording the location of each point in space is necessary to fully represent the point cloud. Similar to a two-dimensional image, each location in the acquisition process has corresponding attribute information, typically an RGB color value, which reflects the object's color. For a point cloud, in addition to color information, each point's corresponding attribute information often includes a reflectance value, which reflects the surface texture of the object. Therefore, a point in a point cloud can include both its location information and its attribute information. For example, the location information of a point can be its three-dimensional coordinates (x, y, z). The location information of a point can also be referred to as its geometric information. For example, the attribute information of a point can include color information (three-dimensional color information) and / or reflectance (one-dimensional reflectance information r). For example, the color information can be information in any color space. For example, the color information can be RGB information, where R represents red (Red), G represents green (Green), and B represents blue (Blue). For another example, the color information may be luminance and chrominance (YCbCr, YUV) information, where Y represents brightness (Luma), Cb (U) represents blue color difference, and Cr (V) represents red color difference.
[0060] For example, a point cloud generated using laser measurement principles can include both its 3D coordinate information and its reflectivity. For another example, a point cloud generated using photogrammetry principles can include both its 3D coordinate information and its 3D color information. For another example, a point cloud generated using a combination of laser measurement and photogrammetry principles can include both its 3D coordinate information, its reflectivity value, and its 3D color information.
[0061] Figures 2A and 2B show a point cloud image and its corresponding data storage format. Figure 2A provides six viewing angles of the point cloud image, while Figure 2B consists of a file header and data. The header includes the data format, data representation type, the total number of points in the point cloud, and the content represented by the point cloud. For example, the point cloud is in ".ply" format, represented by ASCII code, with a total of 207,242 points. Each point has 3D coordinate information (x, y, z) and 3D color information (r, g, b).
[0062] Point clouds can be divided into the following categories according to the acquisition method:
[0063] Static point cloud: the object is stationary and the device that acquires the point cloud is also stationary;
[0064] Dynamic point cloud: The object is moving, but the device that obtains the point cloud is stationary;
[0065] Dynamic point cloud acquisition: The device used to acquire the point cloud is in motion.
[0066] For example, point clouds can be divided into two categories according to their usage:
[0067] Category 1: Machine perception point cloud, which can be used in scenarios such as autonomous navigation systems, real-time inspection systems, geographic information systems, visual sorting robots, and disaster relief robots;
[0068] Category 2: Human eye perception point cloud, which can be used in point cloud application scenarios such as digital cultural heritage, free viewpoint broadcasting, 3D immersive communication, and 3D immersive interaction.
[0069] Point clouds can flexibly and conveniently express the spatial structure and surface properties of three-dimensional objects or scenes. Moreover, since point clouds are obtained by directly sampling real objects, they can provide a strong sense of reality while ensuring accuracy. Therefore, they are widely used, including virtual reality games, computer-aided design, geographic information systems, automatic navigation systems, digital cultural heritage, free viewpoint broadcasting, three-dimensional immersive remote presentation, and three-dimensional reconstruction of biological tissues and organs.
[0070] Point clouds are primarily collected through computer generation, 3D laser scanning, and 3D photogrammetry. Computers can generate point clouds of virtual 3D objects and scenes; 3D laser scanning can obtain point clouds of static real-world 3D objects or scenes, generating millions of point clouds per second; and 3D photogrammetry can obtain point clouds of dynamic real-world 3D objects or scenes, generating tens of millions of point clouds per second. These technologies reduce the cost and time required to acquire point cloud data while improving data accuracy. While changes in point cloud data acquisition methods have made it possible to acquire large amounts of point cloud data, the processing of this massive amount of 3D point cloud data is facing bottlenecks due to storage space and transmission bandwidth constraints, as application demands grow.
[0071] For example, taking a point cloud video with a frame rate of 30 frames per second (fps), each frame contains 700,000 points, and each point has coordinate information (xyz, float) and color information (RGB, uchar). The data volume of a 10-second point cloud video is approximately 0.7 million × (4 bytes × 3 + 1 byte × 3) × 30 fps × 10 seconds = 3.15 GB. A 1280 × 720 2D video with a frame rate of 24 fps has a data volume of approximately 1280 × 720 × 12 bits × 24 fps × 10 seconds = 0.33 GB. A 10-second two-view 3D video has a data volume of approximately 0.33 × 2 = 0.66 GB. This shows that the data volume of a point cloud video far exceeds that of 2D and 3D videos of the same length. Therefore, in order to better realize data management, save server storage space, and reduce the transmission traffic and transmission time between the server and the client, point cloud compression has become a key issue in promoting the development of the point cloud industry.
[0072] That is to say, since the point cloud is a collection of massive points, storing the point cloud not only consumes a lot of memory, but is also not conducive to transmission. There is also not enough bandwidth to support direct transmission of the point cloud at the network layer without compression. Therefore, the point cloud needs to be compressed.
[0073] Currently, the point cloud coding framework that can compress point clouds can be the geometry-based Point Cloud Compression (G-PCC) codec framework or the video-based Point Cloud Compression (V-PCC) codec framework provided by the Moving Picture Experts Group (MPEG), or the AVS-PCC codec framework provided by AVS. The G-PCC codec framework can be used to compress the first type of static point clouds and the third type of dynamically acquired point clouds, and the V-PCC codec framework can be used to compress the second type of dynamic point clouds. The G-PCC codec framework is also called the point cloud codec TMC13, and the V-PCC codec framework is also called the point cloud codec TMC2.
[0074] An embodiment of the present application provides a network architecture of a point cloud encoding and decoding system including a decoding method and an encoding method. FIG3 is a schematic diagram of a network architecture of a point cloud encoding and decoding system provided by an embodiment of the present application. As shown in FIG3 , the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01. During the implementation process, the electronic device can be various types of devices with point cloud encoding and decoding functions. For example, the electronic device can include a mobile phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensor device, a server, etc., which is not limited by the embodiment of the present application. Among them, the decoder or encoder in the embodiment of the present application can be the above-mentioned electronic device.
[0075] Among them, the electronic device in the embodiment of the present application has a point cloud encoding and decoding function, generally including a point cloud encoder (ie, encoder) and a point cloud decoder (ie, decoder).
[0076] The following uses the AVS-PCC codec framework as an example to illustrate point cloud compression technology.
[0077] As you can understand, point cloud compression generally uses a method that compresses point cloud geometry and attribute information separately. On the encoding side, the point cloud geometry is first encoded in the geometry encoder, and the reconstructed geometry is then input as additional information into the attribute encoder to assist in compressing the point cloud attributes. On the decoding side, the point cloud geometry is first decoded in the geometry decoder, and the decoded geometry is then input as additional information into the attribute decoder to assist in compressing the point cloud attributes. The entire codec consists of pre-processing / post-processing, geometry encoding / decoding, and attribute encoding / decoding.
[0078] The present embodiment provides a point cloud encoder. As shown in FIG4 , which is the framework of the point cloud compression reference platform PCRM provided by AVS, the point cloud encoder 11 includes a geometry encoder: a coordinate translation unit 111, a coordinate quantization unit 112, an octree construction unit 113, a geometry entropy encoder 114, and a geometry reconstruction unit 115. An attribute encoder: an attribute recoloring unit 116, a color space conversion unit 117, a first attribute prediction unit 118, a quantization unit 119, and an attribute entropy encoder 1110.
[0079] For PCRM, in the geometric coding part of the encoding end, the original geometric information is first preprocessed, and the geometric origin is normalized to the minimum position in the point cloud space through the coordinate translation unit 111. The geometric information is converted from floating point numbers to integers through the coordinate quantization unit 112 to facilitate subsequent regularization processing; then the regularized geometric information is geometrically encoded, and the octree structure is used in the octree construction unit 113 to recursively divide the point cloud space, each time dividing the current node into eight sub-blocks of the same size, and judging the occupancy codeword of each sub-block. When the sub-block does not contain a point, it is recorded as empty, otherwise it is recorded as non-empty. The occupancy codeword information of all blocks is recorded in the last layer of the recursive division, and geometric encoding is performed; the geometric information expressed by the octree structure is input into the geometric entropy encoder 114 to form a geometric code stream, and on the other hand, geometric reconstruction processing is performed in the geometric reconstruction unit 115. The reconstructed geometric information is input into the attribute encoder as additional information.
[0080] In the attribute encoding part, the original attribute information is first preprocessed. Since the geometric information changes after geometric encoding, the attribute value is reassigned to each point after geometric encoding through the attribute recoloring unit 116 to achieve attribute recoloring. In addition, if the processed attribute information is color information, the original color information needs to be transformed into a YUV color space that is more in line with the visual characteristics of the human eye through the color space conversion unit 117; then, the preprocessed attribute information is attribute encoded through the first attribute prediction unit 118. Attribute encoding first requires reordering the point cloud. The reordering method is Morton code, so the traversal order of attribute encoding is Morton order. The attribute prediction method in PCRM is a single-point prediction based on the Morton order, that is, the attribute prediction method is performed from the current point to be encoded (current node) back one point in the Morton order, and the node found is the prediction reference point of the current point to be encoded. Then, the attribute reconstruction value of the prediction reference point is used as the attribute prediction value, and the attribute residual value is the difference between the attribute original value and the attribute prediction value of the current point to be encoded; finally, the attribute residual value is quantized by the quantization unit 119, and the quantized residual information is input into the attribute entropy encoder 1110 to form an attribute code stream.
[0081] The present application also provides a point cloud decoder. FIG5 shows the framework of the point cloud compression reference platform PCRM provided by AVS. The point cloud decoder 12 includes a geometric decoder: a geometric entropy decoder 121, an octree reconstruction unit 122, a coordinate inverse quantization unit 123, and a coordinate inverse translation unit 124. An attribute decoder: an attribute entropy decoder 125, an inverse quantization unit 126, a second attribute prediction unit 127, and a color space inverse transformation unit 128.
[0082] On the decoding side, the same method of separate geometry and attribute decoding is used. In the geometry decoding part, the geometry bitstream is first entropy decoded by the geometry entropy decoder 121 to obtain the geometric information of each node. Then, the octree structure is constructed by the octree reconstruction unit 122 in the same manner as the geometry encoding. Combined with the decoded geometry, the coordinate-transformed geometric information expressed by the octree structure is reconstructed. On the one hand, this information is dequantized by the coordinate dequantization unit 123 and detranslated by the coordinate detranslation unit 124 to obtain the decoded geometric information. On the other hand, it is input into the attribute decoder as additional information. In the attribute decoding part, the Morton order is constructed in the same way as the encoding end. The attribute code stream is first entropy decoded by the attribute entropy decoder 125 to obtain the quantized residual information; then, it is dequantized by the dequantization unit 126 to obtain the attribute residual value; similarly, in the same way as the attribute encoding, the attribute prediction value of the current point to be decoded is obtained by the second attribute prediction unit 127, and then the attribute prediction value is added to the attribute residual value to restore the attribute reconstruction value of the current point to be decoded (for example, the YUV attribute value); finally, the decoded attribute information is obtained by color space inverse transformation by the color space inverse transformation unit 128.
[0083] It can also be understood that for the AVS-PCC codec framework, the general test conditions are as follows:
[0084] There are 4 test conditions:
[0085] Condition 1: The geometric position is limited and the attributes are lost;
[0086] Condition 2: Geometric position lossless, attribute lossy;
[0087] Condition 3: Geometric position lossless, attribute loss limited;
[0088] Condition 4: Geometric position and attributes are lossless.
[0089] The general test sequences include Cat1A, Cat1B, Cat1C, Cat2-frame, and Cat3. Cat1A and Cat2-frame point clouds only contain reflectance attribute information, Cat1B and Cat3 point clouds only contain color attribute information, and Cat1C point clouds contain both color and reflectance attribute information.
[0090] There are four implementation methods, which are differentiated by the algorithm used for attribute compression.
[0091] Implementation 1: Prediction branch, attribute compression adopts prediction-based method;
[0092] At the encoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, the Morton order, the Hilbert order, etc.). First, the prediction algorithm is used to obtain the attribute prediction value. The attribute residual is obtained based on the attribute value and the attribute prediction value. Then, the attribute residual is quantized to generate the quantized residual. Finally, the quantized residual is encoded.
[0093] At the decoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the prediction algorithm is used to obtain the attribute prediction value, then the decoding is performed to obtain the quantized residual, and then the quantized residual is dequantized. Finally, the attribute reconstruction value is obtained based on the attribute prediction value and the dequantized residual.
[0094] Implementation 2: Prediction Transform Branch - Resources are limited. Attribute compression uses a method based on intra-frame prediction and k-ary discrete cosine transform (DCT). When encoding the quantized transform coefficients, there is a maximum point number X (e.g., 4096). That is, at most every X points can be encoded as a group:
[0095] At the encoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). These small groups are then combined into several large groups (the number of points in each large group does not exceed X, such as 4096). Then, a prediction algorithm is used to obtain attribute prediction values. Based on the attribute values and attribute prediction values, attribute residuals are obtained. The attribute residuals are transformed by DCT in small groups to generate transform coefficients. The transform coefficients are then quantized to generate quantized transform coefficients. Finally, the quantized transform coefficients are encoded in large groups.
[0096] At the decoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). Then these small groups are combined into several large groups (the number of points in each large group does not exceed X, such as 4096). The quantized transform coefficients are decoded in large groups, and then the prediction algorithm is used to obtain the attribute prediction value. The quantized transform coefficients are then dequantized and inversely transformed in small groups. Finally, the attribute reconstruction value is obtained based on the attribute prediction value and the dequantized and inversely transformed coefficients.
[0097] Implementation 3: Prediction Transform Branch—Resources are not limited. Attribute compression uses a method based on intra-frame prediction and DCT transform. When encoding quantized transform coefficients, there is no maximum point number X limit, that is, all coefficients are encoded together:
[0098] At the encoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). Then, a prediction algorithm is used to obtain attribute prediction values. Based on the attribute values and attribute prediction values, attribute residuals are obtained. The attribute residuals are transformed by DCT in groups to generate transformation coefficients. The transformation coefficients are then quantized to generate quantized transformation coefficients. Finally, the quantized transformation coefficients of the entire point cloud are encoded.
[0099] At the decoding end, the points in the point cloud are processed in a certain order (the original acquisition order of the point cloud, Morton order, Hilbert order, etc.). First, the entire point cloud is divided into several small groups with a maximum length of Y (such as 2). The quantized transformation coefficients of the entire point cloud are obtained by decoding, and then the prediction algorithm is used to obtain the attribute prediction value. The quantized transformation coefficients are then dequantized and inversely transformed in groups. Finally, the attribute reconstruction value is obtained based on the attribute prediction value and the dequantized and inversely transformed coefficients.
[0100] Implementation 4: Multi-layer transform branch, attribute compression uses a method based on multi-layer wavelet transform:
[0101] At the encoding end, the entire point cloud is subjected to multi-layer wavelet transform to generate transform coefficients, which are then quantized to generate quantized transform coefficients. Finally, the quantized transform coefficients of the entire point cloud are encoded.
[0102] At the decoding end, decoding obtains the quantized transform coefficients of the entire point cloud, and then dequantizes and inversely transforms the quantized transform coefficients to obtain attribute reconstruction values.
[0103] In implementation mode 1, the coefficients may be quantized residuals, and in the above-mentioned embodiments 2, 3, and 4, the coefficients may be quantized transform coefficients. The specific implementation steps for encoding and decoding the coefficients using the AVS-PCC encoding and decoding framework are as follows:
[0104] For color attributes, the codec uses the same order (point cloud original acquisition order, Morton order, Hilbert order, transformation order, etc.) to encode / decode the coefficients of each point (containing three coefficients, namely the three color components RGB or YUV) in turn. run_length is used to count whether the coefficients of each point are all 0, which is called the zero run value, and its initial value is set to 0.
[0105] For each point's coefficient, at the encoding end, if the coefficients of that point are all zero, ++run_length is added, and then the coefficient of the next point is processed. If any one-dimensional coefficient of the three color components is non-zero, the zero run value (run_length) is first encoded, then run_length is reset to 0, the specific three coefficient values are encoded, and then the coefficient of the next point is processed. For the coefficients of the last point, if they are all 0, ++run_length is added and the run_length value is encoded. Otherwise, the zero run value (run_length) is first encoded, then run_length is reset to 0, the specific three coefficient values are encoded, and finally the run_length value is encoded again.
[0106] At the decoding end, the zero run value (run_length) is decoded first. If run_length>0, it means that the three coefficients of the current three-component color are all zero, then the --run_length operation is performed, and then the coefficient of the next point is processed; if run_length==0, it means that at least one dimension of the coefficient of the current three-component color is not zero, then the coefficient of the point is decoded first, then the zero run value (run_length) is decoded and updated, and then the coefficient of the next point is processed.
[0107] For the reflectivity attribute, the codec uses the same order (point cloud original acquisition order, Morton order, Hilbert order, transform order, etc.) to encode / decode each coefficient in turn. The run_length is used to count whether the coefficient is 0, which is called the zero run value, and its initial value is set to 0.
[0108] For each coefficient, at the encoding end, if the coefficient is zero, ++run_length is added, and then the next coefficient is processed; otherwise, the zero run value (run_length) is first encoded, then run_length is reset to 0, the specific coefficient value is encoded, and then the next coefficient is processed. For the last coefficient, if it is 0, ++run_length is added and the run_length value is encoded; otherwise, the zero run value (run_length) is first encoded, then run_length is reset to 0, the specific coefficient value is encoded, and finally the run_length value is encoded again.
[0109] At the decoding end, the zero run value (run_length) is decoded first. If run_length>0, it means that the current coefficient is zero, then the --run_length operation is performed, and then the next coefficient is processed; if run_length==0, it means that the current coefficient is not zero, then the coefficient is decoded first, then the zero run value (run_length) is decoded and updated, and then the next coefficient is processed.
[0110] In this case, the current PCRM needs to encode / decode the number of coefficients that are consecutively 0. However, after prediction, transformation, and quantization, the coefficients are small. Statistics show that there are usually consecutive coefficients that are 0, which increases the complexity of the encoding and decoding process to a certain extent and reduces the encoding and decoding efficiency.
[0111] In order to solve the above problems, an embodiment of the present application provides a coding and decoding method, which determines a grouping step parameter at the encoding end; groups multiple coefficients to be encoded according to the grouping step parameter to determine at least one coefficient group to be encoded; if the current coefficient in the current group in at least one coefficient group to be encoded is not 0, determines the coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0; if the value of the coefficient identification information is a second value, writes the coefficient identification information into the bitstream, and sets the value of the coefficient identification information to the first value; after writing the zero run value into the bitstream, encodes the current coefficient and sets the zero run value to 0; if the value of the coefficient identification information is the first value, after writing the zero run value into the bitstream, encodes the current coefficient and sets the zero run value to 0; and continues to encode the next coefficient to be encoded in the current group according to the coefficient identification information and the zero run value. At the decoding end, a grouping step parameter is determined; multiple coefficients to be decoded are grouped according to the grouping step parameter to determine at least one coefficient group to be decoded; coefficient identification information of the current group in at least one coefficient group to be decoded is determined; wherein the coefficient identification information is used to indicate whether the coefficients to be decoded in the current group are all 0; if the coefficient identification information indicates that the coefficients to be decoded in the current group are all 0, the decoding process of the coefficients to be decoded in the current group is completed, and the coefficient identification information of the next coefficient group to be decoded in at least one coefficient group to be decoded is continued to be determined. It can be seen that in the embodiment of the present application, when encoding and decoding attribute information, due to the introduction of coefficient identification information, multiple coefficients can be grouped and processed, so that when the coefficients in a coefficient group are all 0, one coefficient identification information can be used to indicate the value of multiple coefficients in the group, which greatly saves codewords and improves the encoding and decoding performance of point cloud attributes.
[0112] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0113] An embodiment of the present application proposes a decoding method. FIG6 is a schematic diagram of an implementation flow of the decoding method proposed in the embodiment of the present application. As shown in FIG6 , decoding a point cloud may include the following steps:
[0114] Step 101: Determine the grouping step size parameter.
[0115] It should be noted that the decoding method of the embodiment of the present application specifically refers to a point cloud decoding method, which can be applied to a point cloud decoder (also referred to as a "decoder").
[0116] It should also be noted that in the embodiments of the present application, the point cloud to be processed includes at least one node. When decoding a node in the point cloud to be processed, it can be considered a node to be decoded in the point cloud to be processed, and there are multiple decoded nodes around the node. Here, the current node is the node to be decoded that currently needs to be decoded among the at least one node.
[0117] Furthermore, in an embodiment of the present application, for each node in the point cloud to be processed, it corresponds to a geometric information and an attribute information; wherein the geometric information represents the spatial relationship of the point, and the attribute information represents the attribute information of the point.
[0118] Here, the attribute information may be a color component, or reflectivity, or other attribute, which is not specifically limited in the embodiments of the present application. Specifically, when the attribute information is a color component, it may be color information in any color space. For example, the attribute information may be color information in an RGB space, a YUV space, a YCbCr space, or the like, which is not specifically limited in the embodiments of the present application.
[0119] It should also be noted that in this embodiment of the present application, the decoder can arrange the at least one node according to a preset decoding order to determine the index number corresponding to each node. In this way, based on the index number corresponding to each node, the decoder can process each node in the point cloud to be processed according to the preset decoding order.
[0120] In some embodiments, the preset decoding order may be one of the following: original point cloud order, Morton order, Hilbert order, etc., which is not specifically limited in the embodiments of the present application.
[0121] In an embodiment of the present application, the bitstream is decoded to determine group identification information, wherein the group identification information can be used to determine whether to use a group processing method to decode multiple coefficients to be decoded.
[0122] It should be noted that in the embodiments of the present application, the group identification information can be understood as a flag indicating whether to group multiple coefficients to be decoded in the point cloud. Specifically, when decoding the bitstream, the decoder can determine a variable that serves as the group identification information, and thus the group identification information can be determined by the value of this variable.
[0123] That is to say, in the embodiments of the present application, the values of the group identification information are different, and the processing methods of the multiple coefficients to be decoded in the decoded point cloud are also different.
[0124] It can be understood that in the embodiments of the present application, based on the value of the group identification information, when decoding multiple coefficients to be decoded, you can choose to use grouping processing for the multiple coefficients to be decoded, or you can choose not to group the multiple coefficients to be decoded.
[0125] Exemplarily, in an embodiment of the present application, if the value of the group identification information is 1, then the multiple coefficients to be decoded can be selected for group processing; if the value of the group identification information is 0, then the multiple coefficients to be decoded can be selected not to be grouped.
[0126] It should be noted that, in the embodiments of the present application, the value of the group identification information may also be set to other values or parameters, and the present application does not impose any limitation thereto.
[0127] Furthermore, in an embodiment of the present application, a flag bit subBlock may be used to represent group identification information.
[0128] For example, in an embodiment of the present application, if the value of subBlock is 1, it may indicate that a plurality of coefficients to be decoded are grouped; if the value of subBlock is 0, it may indicate that a plurality of coefficients to be decoded are not grouped.
[0129] It is understood that in the embodiments of the present application, the quantized residual or quantized transform coefficient of the attribute information of a point in the point cloud can be used as the coefficient to be decoded of the point. In other words, the coefficient to be decoded can be the quantized residual or the quantized transform coefficient.
[0130] Furthermore, in an embodiment of the present application, when decoding color attributes, the coefficients to be decoded for each point in the point cloud may include the coefficients of all color components. For example, a coefficient to be decoded may include the coefficients of the R component, the G component, and the B component; or a coefficient to be decoded may include the coefficients of the Y component, the U component, and the V component.
[0131] Furthermore, in an embodiment of the present application, when decoding the reflectivity attribute, the coefficient to be decoded of each point in the point cloud may be a reflectivity coefficient.
[0132] It will be appreciated that in the embodiments of the present application, after determining the group identification information in the decoded bitstream, if the group identification information indicates that the multiple coefficients to be decoded are to be grouped, then the grouping step size parameter may be further determined. That is, after determining that the group identification information indicates that the multiple coefficients to be decoded are to be grouped, the coefficient identification information determination process is then executed.
[0133] Of course, the coefficient identification information determination process may be directly executed without determining the identification information. In other words, the coefficient identification information determination may depend on the value of the group identification information, or may be independently executed without depending on the value of the group identification information.
[0134] It should be noted that, in the embodiments of the present application, the grouping step parameter can be used to group multiple coefficients to be decoded. After determining the grouping step parameter, the grouping step parameter can be directly set as the grouping step, and then the multiple coefficients to be decoded can be grouped according to the grouping step; or, after determining the grouping step parameter, the grouping step can be first determined according to the grouping step parameter, and then the multiple coefficients to be decoded can be grouped according to the grouping step.
[0135] Furthermore, in an embodiment of the present application, the grouping step parameter may be an integer greater than or equal to 0.
[0136] It is understandable that, in the embodiments of the present application, when determining the grouping step size parameter, the grouping step size parameter may be obtained by decoding the code stream; or, a preset grouping step size parameter may be directly obtained.
[0137] That is to say, in the embodiment of the present application, the grouping step parameter can be obtained by parsing the code stream or directly determined by the decoding end.
[0138] Illustratively, in an embodiment of the present application, the grouping step parameter may be predefined in the attribute header information aps, and the grouping step parameter may be encoded and decoded before encoding and decoding the attribute coefficient.
[0139] Step 102: Group multiple coefficients to be decoded according to the grouping step size parameter to determine at least one coefficient group to be decoded.
[0140] In an embodiment of the present application, if the group identification information indicates that a plurality of coefficients to be decoded are to be grouped, then after determining the grouping step parameter, the plurality of coefficients to be decoded may be further grouped according to the grouping step parameter, thereby determining at least one coefficient group to be decoded.
[0141] It is understood that in the embodiments of the present application, when grouping multiple coefficients to be decoded, the grouping step parameter can be directly set as the grouping step, and then the multiple coefficients to be decoded can be grouped according to the grouping step; or the grouping step can be first determined according to the grouping step parameter, and then the multiple coefficients to be decoded can be grouped according to the grouping step. The grouping step parameter can be an integer greater than or equal to 0.
[0142] That is, in the embodiment of the present application, if the determined grouping step parameter is K, then the grouping step can be set to K; or, the grouping step can be determined to be 2. K ; Wherein, K is an integer greater than or equal to 0.
[0143] It should be noted that, in the embodiments of the present application, when the grouping step size is determined according to the grouping step size parameter, the grouping step size may also be set to any function value of the grouping step size parameter, and the present application does not specifically limit this.
[0144] For example, in the embodiment of the present application, assuming that the determined grouping step parameter is K=10, the grouping step parameter K can be used to determine the grouping step to be 2. K =1024, and then group the multiple coefficients to be decoded according to the grouping step size.
[0145] For example, in the embodiment of the present application, assuming that the determined grouping step size parameter is K=512, the grouping step size can be directly set to 512 according to the grouping step size parameter K, and then the multiple coefficients to be decoded are grouped according to the grouping step size. Of course, the value of the grouping step size parameter can also be any integer greater than or equal to 0, such as 1024, 2048, 4096, and the present application does not impose any limitation.
[0146] It should be noted that, in the embodiment of the present application, before grouping multiple coefficients to be decoded based on the grouping step parameter, the length of the coefficients to be decoded may be set first, wherein the length of one coefficient to be decoded may be set to one length unit.
[0147] It can be understood that in an embodiment of the present application, for color attributes, a coefficient to be decoded includes the coefficients of all color components, then the sum of the lengths of the coefficients of all color components of a point can be set to one length unit; for reflectivity attributes, a coefficient to be decoded includes the coefficient of reflectivity, then the coefficient of the reflectivity of a point can be set to one length unit.
[0148] That is, in the embodiment of the present application, the length of the coefficient to be decoded of a point can be set to 1. Since the coefficient to be decoded of each point can include the coefficients of all color components, the sum of the lengths of the coefficients of all color components of a point can be set to 1. For example, the sum of the lengths of the coefficients of the three color components R, G, and B of a point is set to 1, or the sum of the lengths of the coefficients of the three color components Y, U, and V of a point is set to 1.
[0149] It can be seen that in the embodiment of the present application, the length of N coefficients to be decoded at N points can be N, that is, the length of the coefficients to be decoded is the same as the number of points, or in other words, the length of the coefficients to be decoded is the same as the number of coefficients to be decoded.
[0150] For example, in an embodiment of the present application, if the grouping step size determined based on the grouping step size parameter is K and the length of the plurality of coefficients to be decoded is N, then after the plurality of coefficients to be encoded are grouped according to the grouping step size K, (G+1) groups of coefficients to be encoded can be determined. Wherein, after performing a division operation using N as the dividend and K as the divisor, the quotient obtained is G and the remainder is K', i.e., N / K=G...K'. In this case, it can be determined that after grouping, (G+1) groups of coefficients to be decoded are obtained, the number of coefficients to be decoded in the first G groups of coefficients to be decoded is K, and the number of coefficients to be decoded in the last group of coefficients to be decoded is K'.
[0151] It is understandable that, in the embodiment of the present application, K' is an integer less than or equal to K, that is, the number of coefficients to be decoded in the last coefficient group to be decoded is less than or equal to the number of coefficients to be decoded in the first G coefficient groups to be decoded.
[0152] Step 103: Determine coefficient identification information of a current group in at least one coefficient group to be decoded; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0.
[0153] In an embodiment of the present application, after a plurality of coefficients to be decoded are grouped according to a grouping step parameter to determine at least one coefficient group to be decoded, for a current group in at least one group to be decoded, coefficient identification information of the current group can be further determined, wherein the coefficient identification information can be used to indicate whether all the coefficients to be decoded in the current group are 0.
[0154] It should be noted that, in the embodiments of the present application, the coefficient identification information can be understood as a flag indicating whether all the coefficients to be decoded in the coefficient group to be decoded are 0. Specifically, when the decoder decodes the bitstream, it can determine a variable serving as the coefficient identification information, thereby determining whether all the coefficients in the corresponding coefficient group to be decoded are 0 by taking the value of the variable.
[0155] That is to say, in the embodiments of the present application, the values of the coefficient identification information are different, and the indication information of the values of the coefficients to be decoded in the corresponding coefficient group to be decoded is also different.
[0156] Furthermore, in an embodiment of the present application, if the value of the coefficient identification information is a first value, it is determined that the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0; if the value of the coefficient identification information is a second value, it is determined that the coefficient identification information indicates that not all the coefficients to be decoded in the current group are 0; wherein the first value and the second value are not equal. For example, the first value may be 1 and the second value may be 0.
[0157] Exemplarily, in an embodiment of the present application, if the value of the coefficient identification information is a first value, for example, a value of 1, then it can be considered that the coefficient identification information indicates that all the coefficients to be decoded in the corresponding coefficient group to be decoded are 0; if the value of the coefficient identification information is a second value, for example, 0, then it can be considered that the coefficient identification information indicates that all the coefficients to be decoded in the corresponding coefficient group to be decoded are not all 0.
[0158] It should be noted that in the embodiments of the present application, the value of the coefficient identification information can also be set to other numerical values or parameters, that is, as long as the first value and the second value are not equal, the specific values of the first value and the second value can also be other numerical values, and this application does not impose any restrictions.
[0159] Furthermore, in an embodiment of the present application, the flag longZero may be used to represent coefficient identification information.
[0160] For example, in an embodiment of the present application, if the value of longZero is a first value, such as a value of 1, then it can be indicated that the coefficients to be decoded in the current group are all 0; if the value of longZero is a second value, such as a value of 0, then it can be indicated that not all the coefficients to be decoded in the current group are 0.
[0161] Step 104: If the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0, then the decoding process of the coefficients to be decoded in the current group is completed, and the coefficient identification information of the next coefficient group to be decoded in the at least one coefficient group to be decoded is continued to be determined.
[0162] In an embodiment of the present application, after determining the coefficient identification information of the current group in at least one coefficient group to be decoded, if the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0, then it is possible to choose to complete the decoding processing of the coefficients to be decoded in the current group, and continue to determine the coefficient identification information of the next coefficient group to be decoded in at least one coefficient group to be decoded, so as to decode the next coefficient group to be decoded according to the coefficient identification information of the next coefficient group to be decoded.
[0163] It can be understood that in an embodiment of the present application, if the value of the coefficient identification information longZero obtained by decoding is the first value, for example, the value is 1, then it can be determined that the coefficients to be decoded in the current group are all 0, and it can be considered that there is no need to decode the coefficients to be decoded in the current group.
[0164] Furthermore, in an embodiment of the present application, if the decoding processing of the coefficients to be decoded in the current group is completed based on the coefficient identification information of the current group, then the decoding code stream can continue to be determined to determine the coefficient identification information of the next coefficient group to be decoded in at least one coefficient group to be decoded, and then the next coefficient group to be decoded can be decoded according to the coefficient identification information of the next coefficient group to be decoded.
[0165] That is to say, in an embodiment of the present application, for the next coefficient group to be decoded, it is still necessary to decode the code stream to determine the corresponding coefficient identification information, and then determine whether the coefficients to be decoded in the next coefficient group to be decoded are all 0 based on the value of the coefficient identification information. If the coefficients to be decoded in the next coefficient group to be decoded are all 0, then the decoding process of the coefficients to be decoded in the next coefficient group to be decoded is also completed, and the other coefficient groups to be decoded in at least one coefficient group to be decoded are continued to be traversed according to the above method.
[0166] Furthermore, in an embodiment of the present application, after determining the coefficient identification information of the current group in at least one coefficient group to be decoded, that is, after step 103, the method for decoding the point cloud may further include the following steps:
[0167] Step 105: If the coefficient identification information indicates that the coefficients to be decoded in the current group are not all zero, decode the code stream, determine the zero run value, and determine the current coefficient in the current group according to the zero run value.
[0168] In an embodiment of the present application, after determining the coefficient identification information of the current group in at least one coefficient group to be decoded, if the coefficient identification information indicates that the coefficients to be decoded in the current group are not all zero, then the decoding of the code stream can continue, the zero run value can be determined, and the decoding processing of the current coefficient in the current group can be further performed based on the zero run value.
[0169] It can be understood that in an embodiment of the present application, if the value of the coefficient identification information longZero obtained by decoding is a second value, for example, a value of 0, then it can be determined that the coefficients to be decoded in the current group are not all 0, and then the coefficients to be decoded in the current group need to be decoded. Therefore, it is necessary to decode the code stream, continue to determine the zero run value, and then determine the current coefficient in the current group based on the zero run value.
[0170] Furthermore, in an embodiment of the present application, the current coefficient may be a coefficient of all color components of the current point, or the current coefficient may be a coefficient of the reflectivity of the current point.
[0171] It should be noted that, in the embodiment of the present application, the zero-run value run_length can be used to count whether the coefficient to be decoded is 0. Specifically, for the color attribute, if the zero-run value run_length is not 0 (or greater than 0), it can be determined that the coefficients of all color components of the current point are all 0; if the zero-run value run_length is 0, it can be determined that the coefficients of all color components of the current point are not all 0. For the reflectivity attribute, if the zero-run value run_length is not 0, it can be determined that the reflectivity coefficient of the current point is 0; if the zero-run value run_length is 0, it can be determined that the reflectivity coefficient of the current point is not 0.
[0172] Further, in an embodiment of the present application, if the current coefficient is the coefficient of all color components of the current point, then if the zero-run value indicates that the coefficients of all color components of the current point are all 0, then after the zero-run value is decremented by 1, the next coefficient to be decoded in the current group is determined according to the zero-run value; if the zero-run value indicates that the coefficients of all color components of the current point are not all 0, the code stream is decoded to determine the coefficients of all color components of the current point and the new zero-run value, and the next coefficient to be decoded in the current group is determined according to the new zero-run value.
[0173] It is understood that in the embodiment of the present application, for color attributes, if the zero-run value run_length indicates that the coefficients of all color components of the current point are all 0, then there is no need to further decode the current coefficient. Instead, the zero-run value can be decremented by 1 to update the zero-run value, and then the next coefficient to be decoded in the current group can be determined based on the zero-run value. For the next coefficient to be decoded, the zero-run value run_length is further used to determine whether the coefficients of all color components are all 0 to determine whether decoding of the coefficients of all color components is required.
[0174] For example, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 3, which is greater than 0, then it can be determined that the coefficients of all color components of the current point are all 0, so there is no need to decode the current coefficient. You can choose to first decrement the zero-run value by 1, that is, perform the --run_length operation, and then determine the next coefficient to be decoded in the current group based on the zero-run value. For the next coefficient to be decoded, the corresponding zero-run value run_length is 2, which is greater than 0, then it can be determined that the coefficients of all color components of the point are all 0, so there is no need to decode the coefficients of all color components of the point, and continue to decrement the zero-run value by 1, that is, perform the --run_length operation, and then determine other coefficients to be decoded in the current group based on the zero-run value.
[0175] It is understood that in the embodiment of the present application, for color attributes, if the zero-run value run_length is 0, that is, the zero-run value indicates that the coefficients of all color components of the current point are not all 0, then it is necessary to decode the code stream, further determine the coefficients of all color components of the current point and the new zero-run value, and then determine the next coefficient to be decoded in the current group based on the new zero-run value. For the next coefficient to be decoded, it is further determined based on the new zero-run value run_length whether the coefficients of all color components are all 0 to determine whether decoding processing is required for the coefficients of all color components.
[0176] Exemplarily, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 0, then it can be determined that the coefficients of all color components of the current point are not all 0, so it is necessary to decode the current coefficient, that is, determine all color components of the current point by decoding the code stream, and at the same time, determine a new zero-run value by decoding the code stream, and then determine the next coefficient to be decoded in the current group based on the new zero-run value obtained by decoding. For the next coefficient to be decoded, if the corresponding zero-run value run_length is 3, which is greater than 0, then it can be determined that the coefficients of all color components of the point are all 0, so it is not necessary to decode the coefficients of all color components of the point, and then the zero-run value is decremented by 1, that is, the --run_length operation is performed. If the corresponding zero-run value run_length is 0, then it can be determined that the coefficients of all color components of the point are not all 0, so it is necessary to decode the coefficients of all color components of the point.
[0177] Further, in an embodiment of the present application, if the current coefficient is the coefficient of the reflectivity of the current point, then if the zero-run value indicates that the coefficient of the reflectivity of the current point is 0, then after the zero-run value is decremented by 1, the next coefficient to be decoded in the current group is determined according to the zero-run value; if the zero-run value indicates that the coefficient of the reflectivity of the current point is not 0, the code stream is decoded to determine the coefficient of the reflectivity of the current point and the new zero-run value, and the next coefficient to be decoded in the current group is determined according to the new zero-run value.
[0178] It is understood that in the embodiment of the present application, for the reflectivity attribute, if the zero-run value run_length indicates that the reflectivity coefficient of the current point is 0, then there is no need to further decode the current coefficient. Instead, the zero-run value can be decremented by 1 to update the zero-run value, and then the next coefficient to be decoded in the current group can be determined based on the zero-run value. For the next coefficient to be decoded, the reflectivity coefficient is further determined based on the zero-run value run_length to determine whether it is 0, so as to determine whether the reflectivity coefficient needs to be decoded.
[0179] For example, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 3, which is greater than 0, then the reflectivity coefficient of the current point can be determined to be 0, and therefore the current coefficient does not need to be decoded. The zero-run value can be decremented by 1 first, that is, the --run_length operation is performed, and then the next coefficient to be decoded in the current group is determined based on the zero-run value. For the next coefficient to be decoded, the corresponding zero-run value run_length is 2, which is greater than 0, then the reflectivity coefficient of the point can be determined to be 0, and therefore the reflectivity coefficient of the point does not need to be decoded. The zero-run value can be decremented by 1 again, that is, the --run_length operation is performed, and then the other coefficients to be decoded in the current group are determined based on the zero-run value.
[0180] It is understood that in the embodiment of the present application, for the reflectivity attribute, if the zero-run value run_length is 0, that is, the zero-run value indicates that the reflectivity coefficient of the current point is not 0, then it is necessary to decode the bitstream, further determine the reflectivity coefficient of the current point and the new zero-run value, and then determine the next coefficient to be decoded in the current group based on the new zero-run value. For the next coefficient to be decoded, the reflectivity coefficient is further determined based on the new zero-run value run_length to determine whether it is 0, so as to determine whether the reflectivity coefficient needs to be decoded.
[0181] Exemplarily, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 0, then it can be determined that the coefficient of the reflectivity of the current point is not 0, so it is necessary to decode the current coefficient, that is, determine the reflectivity of the current point by decoding the code stream, and at the same time, determine a new zero-run value by decoding the code stream, and then determine the next coefficient to be decoded in the current group based on the new zero-run value obtained by decoding. For the next coefficient to be decoded, if the corresponding zero-run value run_length is 3, which is greater than 0, then it can be determined that the coefficient of the reflectivity of the point is 0, so there is no need to decode the coefficient of the reflectivity of the point, and then the zero-run value is subtracted by 1, that is, the --run_length operation is performed. If the corresponding zero-run value run_length is 0, then it can be determined that the coefficient of the reflectivity of the point is not 0, so it is necessary to decode the coefficient of the reflectivity of the point.
[0182] Furthermore, in an embodiment of the present application, after decoding the code stream and determining the group identification information, the method for decoding the point cloud may further include the following steps:
[0183] Step 106: If the grouping identification information indicates that the multiple coefficients to be decoded are not to be grouped, the code stream is decoded, a zero-run value is determined, and the current coefficient is determined according to the zero-run value.
[0184] In an embodiment of the present application, after the group identification information is determined by decoding the code stream, if the group identification information indicates that the multiple coefficients to be decoded are not to be grouped, then it is necessary to decode the code stream, determine the zero run value, and then determine the current coefficient based on the zero run value.
[0185] It can be understood that in the embodiment of the present application, based on the group identification information obtained by decoding, if it is determined that multiple coefficients to be decoded are not to be grouped, it is necessary to encode the coefficients to be decoded in sequence according to a preset order. Therefore, the decoding of the code stream can continue, the zero run value can be determined, and then the current coefficient among the multiple coefficients to be decoded can be decoded based on the zero run value.
[0186] Furthermore, in an embodiment of the present application, the current coefficient may be a coefficient of all color components of the current point, or the current coefficient may be a coefficient of the reflectivity of the current point.
[0187] It should be noted that, in the embodiment of the present application, the zero-run value run_length can be used to count whether the coefficient to be decoded is 0. Specifically, for the color attribute, if the zero-run value run_length is not 0 (or greater than 0), it can be determined that the coefficients of all color components of the current point are all 0; if the zero-run value run_length is 0, it can be determined that the coefficients of all color components of the current point are not all 0. For the reflectivity attribute, if the zero-run value run_length is not 0, it can be determined that the reflectivity coefficient of the current point is 0; if the zero-run value run_length is 0, it can be determined that the reflectivity coefficient of the current point is not 0.
[0188] Further, in an embodiment of the present application, if the current coefficient is the coefficient of all color components of the current point, then if the zero-run value indicates that the coefficients of all color components of the current point are all 0, then after the zero-run value is decremented by 1, the next coefficient to be decoded is determined based on the zero-run value; if the zero-run value indicates that the coefficients of all color components of the current point are not all 0, the code stream is decoded to determine the coefficients of all color components of the current point and the new zero-run value, and the next coefficient to be decoded is determined based on the new zero-run value.
[0189] It is understood that in the embodiment of the present application, for color attributes, if the zero-run value run_length indicates that the coefficients of all color components of the current point are all 0, then there is no need to further decode the current coefficient. Instead, the zero-run value can be decremented by 1 to update the zero-run value, and then the next coefficient to be decoded is determined based on the zero-run value. For the next coefficient to be decoded, the zero-run value run_length is further used to determine whether the coefficients of all color components are all 0 to determine whether decoding of the coefficients of all color components is required.
[0190] For example, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 3, which is greater than 0, then it can be determined that the coefficients of all color components of the current point are all 0, so there is no need to decode the current coefficient. You can choose to first decrement the zero-run value by 1, that is, perform the --run_length operation, and then determine the next coefficient to be decoded based on the zero-run value. For the next coefficient to be decoded, the corresponding zero-run value run_length is 2, which is greater than 0, then it can be determined that the coefficients of all color components of the point are all 0, so there is no need to decode the coefficients of all color components of the point, and continue to decrement the zero-run value by 1, that is, perform the --run_length operation, and then determine other coefficients to be decoded based on the zero-run value.
[0191] It is understood that in the embodiment of the present application, for color attributes, if the zero-run value run_length is 0, that is, the zero-run value indicates that the coefficients of all color components of the current point are not all 0, then it is necessary to decode the code stream, further determine the coefficients of all color components of the current point and the new zero-run value, and then determine the next coefficient to be decoded based on the new zero-run value. For the next coefficient to be decoded, it is further determined based on the new zero-run value run_length whether the coefficients of all color components are all 0 to determine whether decoding processing is required for the coefficients of all color components.
[0192] Exemplarily, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 0, then it can be determined that the coefficients of all color components of the current point are not all 0, so it is necessary to decode the current coefficient, that is, determine all color components of the current point by decoding the code stream, and at the same time, determine a new zero-run value by decoding the code stream, and then determine the next coefficient to be decoded based on the new zero-run value obtained by decoding. For the next coefficient to be decoded, if the corresponding zero-run value run_length is 3, which is greater than 0, then it can be determined that the coefficients of all color components of the point are all 0, so it is not necessary to decode the coefficients of all color components of the point, and then the zero-run value is decremented by 1, that is, the --run_length operation is performed. If the corresponding zero-run value run_length is 0, then it can be determined that the coefficients of all color components of the point are not all 0, so it is necessary to decode the coefficients of all color components of the point.
[0193] Further, in an embodiment of the present application, if the current coefficient is the coefficient of the reflectivity of the current point, then if the zero-run value indicates that the coefficient of the reflectivity of the current point is 0, then after the zero-run value is decremented by 1, the next coefficient to be decoded is determined based on the zero-run value; if the zero-run value indicates that the coefficient of the reflectivity of the current point is not 0, the code stream is decoded to determine the coefficient of the reflectivity of the current point and the new zero-run value, and the next coefficient to be decoded is determined based on the new zero-run value.
[0194] It is understood that in the embodiment of the present application, for the reflectivity attribute, if the zero-run value run_length indicates that the reflectivity coefficient of the current point is 0, then there is no need to further decode the current coefficient. Instead, the zero-run value can be decremented by 1 to update the zero-run value, and then the next coefficient to be decoded is determined based on the zero-run value. For the next coefficient to be decoded, the reflectivity coefficient is further determined based on the zero-run value run_length to determine whether it is 0, so as to determine whether the reflectivity coefficient needs to be decoded.
[0195] For example, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 3, which is greater than 0, then the reflectivity coefficient of the current point can be determined to be 0, and therefore there is no need to decode the current coefficient. The zero-run value can be decremented by 1 first, i.e., the --run_length operation is executed, and then the next coefficient to be decoded is determined based on the zero-run value. For the next coefficient to be decoded, the corresponding zero-run value run_length is 2, which is greater than 0, then the reflectivity coefficient of the point can be determined to be 0, and therefore there is no need to decode the reflectivity coefficient of the point. The zero-run value can be decremented by 1 again, i.e., the --run_length operation is executed, and then other coefficients to be decoded are determined based on the zero-run value.
[0196] It is understood that in the embodiment of the present application, for the reflectivity attribute, if the zero-run value run_length is 0, that is, the zero-run value indicates that the reflectivity coefficient of the current point is not 0, then it is necessary to decode the bitstream, further determine the reflectivity coefficient of the current point and the new zero-run value, and then determine the next coefficient to be decoded based on the new zero-run value. For the next coefficient to be decoded, the reflectivity coefficient is further determined based on the new zero-run value run_length to determine whether it is 0, so as to determine whether the reflectivity coefficient needs to be decoded.
[0197] Exemplarily, in an embodiment of the present application, if the zero-run value run_length of the current coefficient determined by the decoded code stream is 0, then it can be determined that the coefficient of the reflectivity of the current point is not 0, so it is necessary to decode the current coefficient, that is, determine the reflectivity of the current point by decoding the code stream, and at the same time, determine a new zero-run value by decoding the code stream, and then determine the next coefficient to be decoded based on the new zero-run value obtained by decoding. For the next coefficient to be decoded, if the corresponding zero-run value run_length is 3, which is greater than 0, then it can be determined that the coefficient of the reflectivity of the point is 0, so there is no need to decode the coefficient of the reflectivity of the point, then the zero-run value is subtracted by 1, that is, the --run_length operation is performed. If the corresponding zero-run value run_length is 0, then it can be determined that the coefficient of the reflectivity of the point is not 0, so it is necessary to decode the coefficient of the reflectivity of the point.
[0198] To sum up, the decoding method proposed in the embodiment of the present application can group all coefficients based on the indication of the group identification information when decoding coefficients. At the same time, coefficient identification information is introduced, such as a flag bit longZero. The flag bit longZero can be used to indicate whether the coefficients in each group are all 0. Therefore, when all coefficients in a group are 0, only a 1-bit flag bit is needed to indicate, which can save a part of the codewords, thereby improving the coding efficiency and compression performance.
[0199] For example, in an embodiment of the present application, Table 1 below shows the effect of the decoding method proposed in an embodiment of the present application on color attributes under a multi-layer transformation branch, where the value of the grouping step parameter can be set to a fixed value of 1024.
[0200] Table 1
[0201]
[0202] The embodiment of the present application provides a decoding method, which determines a grouping step parameter at the decoding end; groups multiple coefficients to be decoded according to the grouping step parameter to determine at least one coefficient group to be decoded; determines coefficient identification information of the current group in at least one coefficient group to be decoded; wherein the coefficient identification information is used to indicate whether the coefficients to be decoded in the current group are all 0; if the coefficient identification information indicates that the coefficients to be decoded in the current group are all 0, then the decoding process of the coefficients to be decoded in the current group is completed, and the coefficient identification information of the next coefficient group to be decoded in at least one coefficient group to be decoded is continued to be determined. It can be seen that in the embodiment of the present application, when encoding and decoding attribute information, due to the introduction of coefficient identification information, multiple coefficients can be grouped and processed, so that when the coefficients in a coefficient group are all 0, one coefficient identification information can be used to indicate the value of multiple coefficients in the group, which greatly saves codewords and improves the encoding and decoding performance of point cloud attributes.
[0203] An embodiment of the present application proposes an encoding method. FIG7 is a schematic diagram of an implementation flow of the encoding method proposed in the embodiment of the present application. As shown in FIG7 , encoding processing of a point cloud may include the following steps:
[0204] Step 201: Determine the grouping step size parameter.
[0205] It should be noted that the encoding method of the embodiment of the present application specifically refers to a point cloud encoding method, which can be applied to a point cloud encoder (also referred to as "encoder" for short).
[0206] It should also be noted that in the embodiment of the present application, the point cloud to be processed includes at least one node. When encoding a node in the point cloud to be processed, it can be considered as a node to be encoded in the point cloud to be processed, and there are multiple encoded nodes around the node. Here, the current node is the node to be encoded that currently needs to be encoded among the at least one node.
[0207] Furthermore, in this embodiment of the present application, each node in the point cloud to be processed corresponds to a pair of geometric information and attribute information. The geometric information represents the spatial relationship of the point, and the attribute information represents the attribute information of the point. Here, the attribute information can be a color component, reflectivity, or other attribute, which is not specifically limited in this embodiment of the present application.
[0208] It should also be noted that, in the embodiment of the present application, the encoder may arrange the at least one node according to a preset coding order to determine the index number corresponding to each node. In this way, based on the index number corresponding to each node, the encoder can process each node in the point cloud to be processed according to the preset coding order.
[0209] In some embodiments, the preset encoding order may be one of the following: original point cloud order, Morton order, Hilbert order, etc., which is not specifically limited in the embodiments of the present application.
[0210] In an embodiment of the present application, group identification information may be determined first, wherein the group identification information may be used to determine whether to use a group processing method to encode multiple coefficients to be encoded.
[0211] It should be noted that in the embodiments of the present application, the group identification information can be understood as a flag indicating whether to group multiple coefficients to be encoded in the point cloud. Specifically, a variable serving as the group identification information can be first determined, and the group identification information can be determined by the value of the variable.
[0212] That is to say, in the embodiments of the present application, the values of the group identification information are different, and the processing methods of the multiple coefficients to be encoded in the encoded point cloud are also different.
[0213] It can be understood that in the embodiments of the present application, based on the value of the group identification information, when encoding multiple coefficients to be encoded, you can choose to use grouping processing for the multiple coefficients to be encoded, or you can choose not to group the multiple coefficients to be encoded.
[0214] For example, in an embodiment of the present application, if the value of the group identification information is 1, then the multiple coefficients to be encoded can be selected for group processing; if the value of the group identification information is 0, then the multiple coefficients to be encoded can be selected not to be grouped.
[0215] It should be noted that, in the embodiments of the present application, the value of the group identification information may also be set to other values or parameters, and the present application does not impose any limitation thereto.
[0216] Furthermore, in an embodiment of the present application, a flag bit subBlock may be used to represent group identification information.
[0217] For example, in an embodiment of the present application, if the value of subBlock is 1, it may indicate that a plurality of coefficients to be coded are grouped and processed; if the value of subBlock is 0, it may indicate that a plurality of coefficients to be coded are not grouped and processed.
[0218] It is understood that in the embodiments of the present application, the quantized residual or quantized transform coefficient of the attribute information of a point in the point cloud can be used as the coefficient to be encoded of the point. In other words, the coefficient to be encoded can be the quantized residual or the quantized transform coefficient.
[0219] Furthermore, in an embodiment of the present application, when encoding color attributes, the coefficients to be encoded for each point in the point cloud may include the coefficients of all color components. For example, a coefficient to be encoded may include the coefficients of the R component, the G component, and the B component; or a coefficient to be encoded may include the coefficients of the Y component, the U component, and the V component.
[0220] Furthermore, in an embodiment of the present application, when encoding the reflectivity attribute, the coefficient to be encoded of each point in the point cloud may be a reflectivity coefficient.
[0221] It is understood that in the embodiments of the present application, after determining the group identification information, if the group identification information indicates that the plurality of coefficients to be encoded should be grouped, then the grouping step size parameter can be further determined. That is, after determining that the group identification information indicates that the plurality of coefficients to be decoded should be grouped, the coefficient identification information determination process is then executed.
[0222] Of course, the coefficient identification information determination process may be directly executed without determining the identification information. In other words, the coefficient identification information determination may depend on the value of the group identification information, or may be independently executed without depending on the value of the group identification information.
[0223] It should be noted that, in the embodiments of the present application, the grouping step parameter can be used to group multiple coefficients to be encoded. After determining the grouping step parameter, the grouping step parameter can be directly set as the grouping step, and then the multiple coefficients to be decoded can be grouped according to the grouping step. Alternatively, after determining the grouping step parameter, the grouping step can be first determined according to the grouping step parameter, and then the multiple coefficients to be decoded can be grouped according to the grouping step.
[0224] Furthermore, in an embodiment of the present application, the grouping step parameter may be an integer greater than or equal to 0.
[0225] It is understandable that, in the embodiments of the present application, when determining the grouping step parameter, the grouping step parameter may be determined directly; or, a preset grouping step parameter may be directly obtained.
[0226] That is to say, in the embodiment of the present application, the grouping step parameter can be directly determined by the encoding end or pre-set by the encoding end.
[0227] Illustratively, in an embodiment of the present application, the grouping step parameter may be predefined in the attribute header information aps, and the grouping step parameter may be encoded and decoded before encoding and decoding the attribute coefficient.
[0228] Step 202: Group multiple coefficients to be coded according to the grouping step size parameter to determine at least one coefficient group to be coded.
[0229] In an embodiment of the present application, if the group identification information indicates that a plurality of coefficients to be coded are to be grouped, then after determining the grouping step parameter, the plurality of coefficients to be coded may be further grouped according to the grouping step parameter, thereby determining at least one group of coefficients to be coded.
[0230] It is understood that in the embodiments of the present application, when grouping multiple coefficients to be coded, the grouping step parameter can be directly set as the grouping step, and then the multiple coefficients to be coded can be grouped according to the grouping step; or the grouping step can be first determined according to the grouping step parameter, and then the multiple coefficients to be coded can be grouped according to the grouping step. The grouping step parameter can be an integer greater than or equal to 0.
[0231] That is, in the embodiment of the present application, if the determined grouping step parameter is K, then the grouping step can be set to K; or, the grouping step can be determined to be 2. K ; Wherein, K is an integer greater than or equal to 0.
[0232] It should be noted that, in the embodiments of the present application, when the grouping step size is determined according to the grouping step size parameter, the grouping step size may also be set to any function value of the grouping step size parameter, and the present application does not specifically limit this.
[0233] For example, in the embodiment of the present application, assuming that the determined grouping step parameter is K=10, the grouping step parameter K can be used to determine the grouping step to be 2. K =1024, and then group the multiple coefficients to be encoded according to the grouping step size.
[0234] For example, in the embodiment of the present application, assuming that the determined grouping step size parameter is K=512, the grouping step size can be directly set to 512 based on the grouping step size parameter K, and then the multiple coefficients to be encoded are grouped according to the grouping step size. Of course, the value of the grouping step size parameter can also be any integer greater than or equal to 0, such as 1024, 2048, 4096, and this application does not impose any limitation.
[0235] It should be noted that, in the embodiment of the present application, before grouping multiple coefficients to be coded based on the grouping step parameter, the length of the coefficients to be coded may be set first, wherein the length of one coefficient to be coded may be set to one length unit.
[0236] It can be understood that in an embodiment of the present application, for color attributes, a coefficient to be encoded includes the coefficients of all color components, then the sum of the lengths of the coefficients of all color components of a point can be set to one length unit; for reflectivity attributes, a coefficient to be encoded includes the coefficient of reflectivity, then the coefficient of the reflectivity of a point can be set to one length unit.
[0237] That is, in the embodiment of the present application, the length of the coefficient to be encoded of a point can be set to 1. Since the coefficient to be encoded of each point can include the coefficients of all color components, the sum of the lengths of the coefficients of all color components of a point can be set to 1. For example, the sum of the lengths of the coefficients of the three color components R, G, and B of a point is set to 1, or the sum of the lengths of the coefficients of the three color components Y, U, and V of a point is set to 1.
[0238] It can be seen that in the embodiment of the present application, the length of the N coefficients to be encoded of N points can be N, that is, the length of the coefficients to be encoded is the same as the number of points, or in other words, the length of the coefficients to be encoded is the same as the number of coefficients to be encoded.
[0239] For example, in an embodiment of the present application, if the grouping step size determined based on the grouping step size parameter K is K, and the length of the plurality of coefficients to be coded is N, then after the plurality of coefficients to be coded are grouped according to the grouping step size K, (G+1) groups of coefficients to be coded can be determined. Wherein, after performing a division operation using N as the dividend and K as the divisor, the quotient obtained is G and the remainder is K', i.e., N / K=G...K'. In this case, it can be determined that after grouping, (G+1) groups of coefficients to be coded are obtained, the number of coefficients to be coded in the first G groups of coefficients to be coded is K, and the number of coefficients to be coded in the last group of coefficients to be coded is K'.
[0240] It can be understood that, in the embodiment of the present application, K' is an integer less than or equal to K, that is, the number of coefficients to be encoded in the last coefficient group to be encoded is less than or equal to the number of coefficients to be encoded in the first G coefficient groups to be encoded.
[0241] Step 203: If the current coefficient in the current group of at least one to-be-encoded coefficient group is not 0, determine the coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the to-be-encoded coefficients in the current group are 0.
[0242] In an embodiment of the present application, after a plurality of coefficients to be encoded are grouped according to a grouping step parameter to determine at least one group of coefficients to be encoded, for a current group in at least one group to be encoded, if a current coefficient in the coefficients to be encoded in the current group is not 0, then the coefficient identification information of the current group can be further determined, wherein the coefficient identification information can be used to indicate whether all the coefficients to be encoded in the current group are 0.
[0243] It should be noted that, in the embodiments of the present application, the coefficient identification information can be understood as a flag indicating whether all the coefficients to be encoded in the coefficient group to be encoded are 0. Specifically, the encoder can determine a variable as the coefficient identification information, so that the value of the variable can be used to determine whether the coefficients in the corresponding coefficient group to be encoded are all 0.
[0244] That is to say, in the embodiments of the present application, the values of the coefficient identification information are different, and the indication information of the values of the coefficients to be encoded in the corresponding coefficient group to be encoded is also different.
[0245] Furthermore, in an embodiment of the present application, if the value of the coefficient identification information is a first value, it is determined that the coefficient identification information indicates that all the coefficients to be encoded in the current group are 0; if the value of the coefficient identification information is a second value, it is determined that the coefficient identification information indicates that not all the coefficients to be encoded in the current group are 0; wherein the first value and the second value are not equal. For example, the first value may be 1 and the second value may be 0.
[0246] Exemplarily, in an embodiment of the present application, if the value of the coefficient identification information is a first value, for example, a value of 1, then it can be considered that the coefficient identification information indicates that all the coefficients to be encoded in the corresponding coefficient group to be encoded are 0; if the value of the coefficient identification information is a second value, for example, 0, then it can be considered that the coefficient identification information indicates that all the coefficients to be encoded in the corresponding coefficient group to be encoded are not all 0.
[0247] It should be noted that in the embodiments of the present application, the value of the coefficient identification information can also be set to other numerical values or parameters, that is, as long as the first value and the second value are not equal, the specific values of the first value and the second value can also be other numerical values, and this application does not impose any restrictions.
[0248] Furthermore, in an embodiment of the present application, the flag longZero may be used to represent coefficient identification information.
[0249] For example, in an embodiment of the present application, if the value of longZero is a first value, such as a value of 1, then it can be indicated that the coefficients to be encoded in the current group are all 0; if the value of longZero is a second value, such as a value of 0, then it can be indicated that not all the coefficients to be encoded in the current group are 0.
[0250] It should be noted that, in the embodiment of the present application, before encoding the current group, the value of the coefficient identification information may be initialized to the second value.
[0251] It is understood that in the embodiments of the present application, after grouping the plurality of coefficients to be encoded according to the grouping step parameter to obtain at least one coefficient group to be encoded, and before encoding the current group in the at least one coefficient group to be encoded, the value of the coefficient identification information of the current group may be initialized in advance, and the value of the coefficient identification information of the current group may be initialized to a second value. For example, the coefficient identification information longZero may be initialized to 0.
[0252] It should be noted that in an embodiment of the present application, by initializing the value of the coefficient identification information of the current group to the second value, the value of the coefficient identification information can be referenced in the subsequent encoding process. Once the current coefficient in the current group is not 0, it can be determined whether the coefficient identification information code stream needs to be encoded based on the value of the coefficient identification information, thereby ensuring that the coefficient identification information is not repeatedly encoded and saving codewords.
[0253] Furthermore, in an embodiment of the present application, when the coefficients in the current group are encoded according to a preset order, if the current coefficient is not 0, then it is necessary to first determine the coefficient identification information of the current group, and then refer to the value of the coefficient identification information of the current group to determine whether to encode the coefficient identification information, and determine whether to reset the value of the encoded coefficient identification information.
[0254] That is to say, in an embodiment of the present application, once it is determined that the current coefficient is not 0, the decoder will not directly write the coefficient identification information into the bitstream. Instead, it needs to determine the coefficient identification information and then choose whether to encode the coefficient representation information based on the value of the coefficient identification information. In this way, the coefficient representation information can be encoded only once, effectively improving the coding efficiency.
[0255] It can be understood that in the embodiments of the present application, for color attributes, a coefficient to be decoded includes the coefficients of all color components. Therefore, if it is determined that the current coefficient is not 0, then it can be determined that the coefficients of all corresponding color components are not all 0. If the current coefficient is determined to be 0, then it can be determined that the coefficients of all corresponding color components are all 0. For reflectivity attributes, a coefficient to be decoded includes the coefficient of reflectivity. Therefore, if it is determined that the current coefficient is not 0, then it can be determined that the corresponding coefficient of reflectivity is not 0. If the current coefficient is determined to be 0, then it can be determined that the corresponding coefficient of reflectivity is 0.
[0256] Step 204: If the value of the coefficient identification information is the second value, write the coefficient identification information into the bitstream and set the value of the coefficient identification information to the first value; after writing the zero run value into the bitstream, encode the current coefficient and set the zero run value to 0.
[0257] In an embodiment of the present application, if a current coefficient in a current group in at least one of the coefficient groups to be encoded is not 0, then after determining the coefficient identification information of the current group, if the value of the coefficient identification information is the second value, the coefficient identification information can be first written into the bitstream, and then the value of the coefficient identification information can be set to the first value; then, after writing the zero-run value into the bitstream, the current coefficient can be encoded, and then the zero-run value can be set to 0.
[0258] Furthermore, in an embodiment of the present application, when encoding coefficients in a current group according to a preset order, if the current coefficient is not zero, it is necessary to first determine whether the value of the coefficient identification information of the current group is a second value. If the value of the coefficient identification information is the second value, the coefficient identification information must first be written into the bitstream. When the value of the coefficient identification information is the second value, the coefficient identification information may indicate that the coefficients to be encoded in the current group are not all zero.
[0259] It should be noted that, in an embodiment of the present application, since the coefficient identification information of the current group is initialized to the second value (for example, 0) in advance, if the current coefficient is not 0, and the value of the coefficient identification information of the current group is the second value, it can be said that the coefficients to be encoded in the current group are not all 0, and the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 has not been encoded. Therefore, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 can be written into the code stream first.
[0260] Next, the value of the coefficient identification information can be reset to the first value, so that when encoding non-zero coefficients of the current group the next time, the value of the coefficient identification information can be referenced, and the coefficient identification information of the current group is not repeated. For example, when it is again determined that a coefficient to be encoded in the current group is non-zero, and the value of the coefficient identification information of the current group is the first value, it can be determined that although the coefficients to be encoded in the current group are not all zero, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all zero has already been encoded, and therefore, there is no need to repeat the encoding of the coefficient identification information of the current group. This can save codewords and improve encoding efficiency.
[0261] It can be understood that in an embodiment of the present application, after the coefficient identification information is written into the code stream and the value of the coefficient identification information is set to the first value, the zero run value can also be written into the code stream, and then the current coefficient is encoded, and then the zero run value is set to 0.
[0262] Furthermore, in an embodiment of the present application, the current coefficient may be a coefficient of all color components of the current point, or the current coefficient may be a coefficient of the reflectivity of the current point.
[0263] It should be noted that, in the embodiment of the present application, the zero-run value run_length can be used to count whether the coefficient to be encoded is 0. Specifically, for the color attribute, if the zero-run value run_length is not 0 (or greater than 0), it can be determined that the coefficients of all color components of the current point are all 0; if the zero-run value run_length is 0, it can be determined that the coefficients of all color components of the current point are not all 0. For the reflectivity attribute, if the zero-run value run_length is not 0, it can be determined that the reflectivity coefficient of the current point is 0; if the zero-run value run_length is 0, it can be determined that the reflectivity coefficient of the current point is not 0.
[0264] Exemplarily, in an embodiment of the present application, when the coefficients in the current group are encoded in a preset order, if the current coefficient is not 0, that is, the coefficients of the three color components of the current point are not all 0, that is, there is at least one color component whose coefficient is not 0 among the three color components of the current point, then it is necessary to first determine whether the value of longZero (coefficient identification information) is 0 (second value). If the value of longZero is 0, then the value of longZero needs to be written into the bitstream as 0, that is, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 is written into the bitstream, and then the value of longZero is set to non-0, for example, the value of longZero is set to 1 (first value). Then, the zero run value (run_length) can be encoded, and then the current coefficient is encoded, that is, the coefficients of the specific three color components are encoded, and finally run_length is reset to 0.
[0265] Exemplarily, in an embodiment of the present application, when the coefficients in the current group are encoded in a preset order, if the current coefficient is not 0, that is, the reflectivity coefficient of the current point is not 0, then it is necessary to first determine whether the value of longZero (coefficient identification information) is 0 (second value). If the value of longZero is 0, then the value of longZero needs to be written into the bitstream as 0, that is, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 is written into the bitstream, and then the value of longZero is set to non-0, for example, the value of longZero is set to 1 (first value). Then, the zero run value (run_length) can be encoded, and then the current coefficient is encoded, that is, the specific reflectivity coefficient is encoded, and finally run_length is reset to 0.
[0266] Step 205: If the value of the coefficient identification information is the first value, after writing the zero-run value into the bitstream, encode the current coefficient and set the zero-run value to 0.
[0267] In an embodiment of the present application, if the current coefficient in the current group of at least one coefficient group to be encoded is not 0, then after determining the coefficient identification information of the current group, if the value of the coefficient identification information is the first value, then after writing the zero run value into the bitstream, the current coefficient can be encoded and then the zero run value can be set to 0.
[0268] Furthermore, in an embodiment of the present application, when encoding the coefficients in the current group according to a preset order, if the current coefficient is not 0, it is necessary to first determine whether the value of the coefficient identification information of the current group is the second value. If the value of the coefficient identification information is not the second value but the first value (e.g., 1), it can be determined that although the coefficients to be encoded in the current group are not all 0, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 has already been encoded, and therefore, there is no need to repeatedly encode the coefficient identification information of the current group. This can save codewords and improve coding efficiency.
[0269] It can be understood that in the embodiment of the present application, after the coefficient identification information takes the first value, the zero run value can be written into the code stream first, and then the current coefficient is encoded, and then the zero run value is set to 0.
[0270] Furthermore, in an embodiment of the present application, the current coefficient may be a coefficient of all color components of the current point, or the current coefficient may be a coefficient of the reflectivity of the current point.
[0271] It should be noted that, in the embodiment of the present application, the zero-run value run_length can be used to count whether the coefficient to be encoded is 0. Specifically, for the color attribute, if the zero-run value run_length is not 0 (or greater than 0), it can be determined that the coefficients of all color components of the current point are all 0; if the zero-run value run_length is 0, it can be determined that the coefficients of all color components of the current point are not all 0. For the reflectivity attribute, if the zero-run value run_length is not 0, it can be determined that the reflectivity coefficient of the current point is 0; if the zero-run value run_length is 0, it can be determined that the reflectivity coefficient of the current point is not 0.
[0272] Exemplarily, in an embodiment of the present application, when the coefficients in the current group are encoded in a preset order, if the current coefficient is not 0, that is, the coefficients of the three color components of the current point are not all 0, that is, there is at least one color component whose coefficient is not 0 among the three color components of the current point, then it is necessary to first determine whether the value of longZero (coefficient identification information) is 0 (second value). If the value of longZero is not 0, but the first value (such as 1), it means that the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 has been written into the bitstream, then longZero will no longer be encoded, and then the zero run value (run_length) can be encoded, and then the current coefficient is encoded, that is, the coefficients of the specific three color components are encoded, and finally run_length is reset to 0.
[0273] For example, in an embodiment of the present application, when the coefficients in the current group are encoded in a preset order, if the current coefficient is not 0, that is, the reflectivity coefficient of the current point is not 0, then it is necessary to first determine whether the value of longZero (coefficient identification information) is 0 (second value). If the value of longZero is not 0, but the first value (such as 1), it means that the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 has been written into the code stream, then longZero will no longer be encoded, and then the zero run value (run_length) can be encoded, and then the current coefficient is encoded, that is, the specific reflectivity coefficient is encoded, and finally run_length is reset to 0.
[0274] Step 206: Continue encoding the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value.
[0275] In an embodiment of the present application, the next coefficient to be coded in the current group may be continuously coded according to the coefficient identification information and the zero-run value until the last coefficient to be coded in the current group.
[0276] It can be understood that in an embodiment of the present application, for the last coefficient to be encoded in the current group, if the last coefficient to be encoded is 0, then it can be further determined whether the coefficients to be encoded in the current group are all 0 based on the coefficient identification information or the zero-run value. If it is determined that the coefficients to be encoded in the current group are all 0, then the coefficient identification information can be set to a first value (for example, 1), that is, the value of the coefficient identification information is set to indicate that the coefficients to be encoded in the current group are all 0, and then the coefficient identification information is written into the code stream; if it is determined that the coefficients to be encoded in the current group are not all 0, then the zero-run value can be written into the code stream.
[0277] That is to say, in an embodiment of the present application, if the current coefficient is the last coefficient to be encoded in the current group, then after determining that the current coefficient is 0, it can be determined based on the coefficient identification information whether all the coefficients to be encoded in the current group are 0, or it can be determined based on the zero run value whether all the coefficients to be encoded in the current group are 0.
[0278] It should be noted that, in an embodiment of the present application, when the current coefficient is the last coefficient to be encoded in the current group, if the value of the coefficient identification information is the second value, it is determined that the coefficients to be encoded in the current group are all 0, then the coefficient identification information is encoded as the first value and written into the bitstream; otherwise, the zero run value is written into the bitstream.
[0279] That is to say, in an embodiment of the present application, for the last coefficient to be encoded in the current group, if the last coefficient to be encoded is 0, and the value of the coefficient identification information is the second value (for example, 0), then it can be determined that the coefficients to be encoded in the current group are all 0, and then the coefficient identification information can be encoded as the first value (for example, 1) and then written into the bitstream; if the last coefficient to be encoded is 0, and the value of the coefficient identification information is the first value (for example, 1), then it can be determined that the coefficients to be encoded in the current group are not all 0, and then the zero run value can be written into the bitstream.
[0280] It should be noted that, in an embodiment of the present application, when the current coefficient is the last coefficient to be encoded in the current group, if the zero-run value is the same as the number of points in the current group, it is determined that the coefficients to be encoded in the current group are all 0, and the coefficient identification information is encoded as the first value and written into the code stream. If the zero-run value is the same as the number of points in the current group, otherwise the zero-run value is written into the code stream.
[0281] That is to say, in an embodiment of the present application, for the last coefficient to be encoded in the current group, if the last coefficient to be encoded is 0, and the zero-run value is the same as the number of points in the current group, then it can be determined that the coefficients to be encoded in the current group are all 0, and then the coefficient identification information can be encoded as a first value (for example, 1) and then written into the code stream; if the last coefficient to be encoded is 0, and the zero-run value is less than the number of points in the current group, then it can be determined that the coefficients to be encoded in the current group are not all 0, and then the zero-run value can be written into the code stream.
[0282] Furthermore, in an embodiment of the present application, after the plurality of coefficients to be encoded are grouped according to the grouping step size parameter and at least one coefficient group to be encoded is determined, that is, after step 202, encoding processing of the point cloud may include the following steps:
[0283] Step 207: If the current coefficient in the current group of at least one of the to-be-encoded coefficient groups is 0, then after adding 1 to the zero-run value, continue encoding the next to-be-encoded coefficient in the current group.
[0284] In an embodiment of the present application, after a plurality of coefficients to be encoded are grouped according to a grouping step parameter to determine at least one group of coefficients to be encoded, for a current group in at least one group to be encoded, if a current coefficient in the coefficients to be encoded in the current group is 0, then the next coefficient to be encoded in the current group can be encoded after the zero run value is self-incremented by 1.
[0285] It should be noted that, in the embodiment of the present application, before encoding the current group, the zero run value may be initialized to 0.
[0286] It is understood that in the embodiments of the present application, after grouping the plurality of coefficients to be coded according to the grouping step parameter to obtain at least one group of coefficients to be coded, and before encoding the current group of the at least one group of coefficients to be coded, the zero-run value may be initialized in advance. For example, the zero-run value run_length may be initialized to 0.
[0287] Furthermore, in an embodiment of the present application, if the current coefficient is the coefficient of all color components of the current point, then if the coefficients of all color components of the current point in the current group are all 0, then after the zero-run value is self-added by 1, the next coefficient to be encoded in the current group is determined.
[0288] It is understood that in the embodiment of the present application, for color attributes, if the coefficients of all color components of the current point are all 0, then there is no need to further encode the current coefficient. Instead, the zero-run value can be incremented by 1 to update the zero-run value before determining the next coefficient to be encoded in the current group. For the next coefficient to be encoded, it is further determined whether the coefficients of all color components are all 0 to determine whether encoding is required for all color component coefficients, and whether the zero-run value needs to be incremented by 1.
[0289] For example, in an embodiment of the present application, if it is determined that the coefficients of all color components of the current point are all 0, then the current coefficient does not need to be encoded, and the zero-run value can be incremented by 1, i.e., a ++run_length operation is performed, before the next coefficient to be encoded in the current group is determined. For the next coefficient to be encoded, if it is determined that the coefficients of all color components of the point are all 0, then the coefficients of all color components of the point do not need to be encoded, and the zero-run value can be incremented by 1, i.e., a ++run_length operation is performed.
[0290] Furthermore, in an embodiment of the present application, if the current coefficient is the coefficient of the reflectivity of the current point, then if the coefficient of the reflectivity of the current point in the current group is 0, after the zero-run value is self-added by 1, the next coefficient to be encoded in the current group is determined.
[0291] It is understood that in the embodiment of the present application, for the reflectivity attribute, if the reflectivity coefficient of the current point is 0, then there is no need to further encode the current coefficient. Instead, the zero-run value can be incremented by 1 to update the zero-run value before determining the next coefficient to be encoded in the current group. For the next coefficient to be encoded, it is further determined whether the reflectivity coefficient is 0 to determine whether encoding is required for the reflectivity coefficient, and whether the zero-run value needs to be incremented by 1.
[0292] For example, in an embodiment of the present application, if the reflectivity coefficient of the current point is determined to be 0, there is no need to encode the current coefficient. Instead, the zero-run value can be incremented by 1, i.e., a ++run_length operation is performed, before the next coefficient to be encoded in the current group is determined. For the next coefficient to be encoded, if the reflectivity coefficient of the point is determined to be 0, there is also no need to encode the reflectivity coefficient of the point. The zero-run value can be incremented by 1, i.e., a ++run_length operation is performed.
[0293] Furthermore, in an embodiment of the present application, after determining the group identification information, encoding the point cloud may include the following steps:
[0294] Step 208: If the grouping identification information indicates that the multiple coefficients to be decoded are not to be grouped, determine whether the current coefficient is 0.
[0295] In an embodiment of the present application, after determining the group identification information, if the group identification information indicates that the plurality of coefficients to be encoded are not to be grouped, it may be further determined whether the current coefficient is 0.
[0296] Furthermore, in an embodiment of the present application, the current coefficient may be a coefficient of all color components of the current point, or the current coefficient may be a coefficient of the reflectivity of the current point.
[0297] It can be understood that in an embodiment of the present application, based on the group identification information, if it is determined that multiple coefficients to be encoded are not to be grouped, the coefficients to be encoded need to be encoded in sequence according to a preset order, so it is possible to continue to determine whether the current coefficient among the multiple coefficients to be encoded is 0.
[0298] Step 209: If the current coefficient is 0, after adding 1 to the zero-run value, continue encoding the next coefficient to be encoded among the multiple coefficients to be decoded.
[0299] Step 210: If the current coefficient is not 0, after writing the zero-run value into the bitstream, encode the current coefficient, set the zero-run value to 0, and continue encoding the next coefficient to be encoded among the multiple coefficients to be decoded.
[0300] In an embodiment of the present application, if the current coefficient is 0, the next coefficient to be encoded among the multiple coefficients to be decoded can be encoded after the zero-run value is self-added by 1; if the current coefficient is not 0, the current coefficient can be encoded after the zero-run value is written into the bit stream, the zero-run value can be set to 0, and the next coefficient to be encoded among the multiple coefficients to be decoded can be encoded.
[0301] It is understandable that, in the embodiment of the present application, before encoding a plurality of coefficients to be encoded, the zero run value may be initialized in advance. For example, the zero run value run_length may be initialized to 0.
[0302] Furthermore, in an embodiment of the present application, if the current coefficient is the coefficient of all color components of the current point, then if the coefficients of all color components of the current point are all 0, the next coefficient to be encoded is determined after the zero-run value is self-added by 1.
[0303] It is understood that in the embodiment of the present application, for color attributes, if the coefficients of all color components of the current point are all 0, then there is no need to further encode the current coefficient. Instead, the zero-run value can be incremented by 1 to update the zero-run value before determining the next coefficient to be encoded. For the next coefficient to be encoded, it is further determined whether the coefficients of all color components are all 0 to determine whether encoding is required for all color component coefficients, and whether the zero-run value needs to be incremented by 1.
[0304] For example, in an embodiment of the present application, if it is determined that the coefficients of all color components of the current point are all 0, there is no need to encode the current coefficient. Instead, the zero-run value can be incremented by 1, i.e., a ++run_length operation is performed, before the next coefficient to be encoded is determined. For the next coefficient to be encoded, if it is determined that the coefficients of all color components of the point are all 0, there is also no need to encode the coefficients of all color components of the point. The zero-run value can be incremented by 1, i.e., a ++run_length operation is performed.
[0305] Furthermore, in an embodiment of the present application, if the current coefficient is the reflectivity coefficient of the current point, then if the reflectivity coefficient of the current point is 0, the next coefficient to be encoded is determined after the zero-run value is self-added by 1.
[0306] It is understood that in the embodiment of the present application, for the reflectivity attribute, if the reflectivity coefficient of the current point is 0, then there is no need to further encode the current coefficient. Instead, the zero-run value can be incremented by 1 to update the zero-run value before determining the next coefficient to be encoded. For the next coefficient to be encoded, it is further determined whether the reflectivity coefficient is 0 to determine whether encoding is required for the reflectivity coefficient, and whether the zero-run value needs to be incremented by 1.
[0307] For example, in an embodiment of the present application, if the reflectivity coefficient of the current point is determined to be 0, there is no need to encode the current coefficient. Instead, the zero-run value can be incremented by 1, i.e., a ++run_length operation is performed, before the next coefficient to be encoded is determined. For the next coefficient to be encoded, if the reflectivity coefficient of the point is determined to be 0, there is also no need to encode the reflectivity coefficient of the point. The zero-run value can be incremented by 1, i.e., a ++run_length operation is performed.
[0308] To sum up, the encoding method proposed in the embodiment of the present application can group all coefficients based on the indication of the group identification information when encoding coefficients. At the same time, coefficient identification information is introduced, such as a flag bit longZero. The flag bit longZero can be used to indicate whether the coefficients in each group are all 0. Therefore, when all coefficients in a group are 0, only a 1-bit flag bit is needed to indicate, which can save a part of the codewords, thereby improving the encoding efficiency and compression performance.
[0309] An embodiment of the present application provides a coding and decoding method, which includes determining a grouping step parameter at an encoding end; grouping multiple coefficients to be encoded according to the grouping step parameter to determine at least one coefficient group to be encoded; if a current coefficient in a current group in at least one coefficient group to be encoded is not 0, determining coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0; if the value of the coefficient identification information is a second value, writing the coefficient identification information into a bitstream, and setting the value of the coefficient identification information to a first value; after writing a zero-run value into the bitstream, encoding the current coefficient, and setting the zero-run value to 0; if the value of the coefficient identification information is the first value, after writing the zero-run value into the bitstream, encoding the current coefficient, and setting the zero-run value to 0; and continuing to encode the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value. It can be seen that in the embodiments of the present application, when encoding and decoding attribute information, due to the introduction of coefficient identification information, multiple coefficients can be grouped and processed. Therefore, when the coefficients in a coefficient group are all 0, one coefficient identification information can be used to indicate the values of the multiple coefficients in the group, which greatly saves codewords and improves the encoding and decoding performance of point cloud attributes.
[0310] Based on the above embodiments, in another embodiment of the present application, when encoding the quantized residuals or quantized transform coefficients, the quantized residuals or quantized transform coefficients of the attribute information of all points in the point cloud can be grouped first, and then a flag longZero (coefficient identification information) is introduced for each group. The flag longZero can be used to indicate whether the quantized residuals or quantized transform coefficients of the attribute information of the points in each group are all 0.
[0311] It is understood that in the embodiments of the present application, the quantized residual or quantized transform coefficient of the attribute information of a point in the point cloud can be used as the coefficient to be encoded of the point. In other words, the coefficient to be encoded can be the quantized residual or the quantized transform coefficient.
[0312] Furthermore, in an embodiment of the present application, when encoding color attributes, the coefficients to be encoded for each point in the point cloud may include the coefficients of all color components. For example, a coefficient to be encoded may include the coefficients of the R component, the G component, and the B component; or a coefficient to be encoded may include the coefficients of the Y component, the U component, and the V component.
[0313] It is understood that in the embodiments of the present application, when encoding the attribute information of the point cloud, the longZero flag (identification information) and the zero run value run_length can be used. The longZero flag can indicate whether the coefficients to be encoded in each group are all 0, and the zero run value run_length is used to count whether the coefficients of all color components of each point are all 0.
[0314] Furthermore, in an embodiment of the present application, at the encoding end, the coefficients to be encoded of all points may be grouped according to a grouping step parameter, thereby determining at least one group of coefficients to be encoded. The grouping step parameter may be a fixed length K, where K is an integer greater than or equal to 0, and the grouping step parameter may be any value pre-set for the point cloud.
[0315] Illustratively, in an embodiment of the present application, the grouping step parameter may be predefined in the attribute header information aps, and the grouping step parameter may be encoded and decoded before encoding and decoding the attribute coefficient.
[0316] It can be understood that in the embodiments of the present application, after determining the grouping step parameter, the grouping step parameter can be directly set to the grouping step, and then the multiple coefficients to be encoded can be grouped according to the grouping step; or, after determining the grouping step parameter, the grouping step can be first determined according to the grouping step parameter, and then the multiple coefficients to be encoded can be grouped according to the grouping step.
[0317] It should be noted that, in the embodiments of the present application, the length of the coefficient to be encoded of a point can be set to 1. Since the coefficient to be encoded of each point can include the coefficients of all color components, the sum of the lengths of the coefficients of all color components of a point can be set to 1. For example, the sum of the lengths of the coefficients of the three color components R, G, and B of a point is set to 1, or the sum of the lengths of the coefficients of the three color components Y, U, and V of a point is set to 1.
[0318] That is to say, in an embodiment of the present application, the length of the N coefficients to be encoded of N points can be N, that is, the length of the coefficients to be encoded is the same as the number of points, or in other words, the length of the coefficients to be encoded is the same as the number of coefficients to be encoded.
[0319] For example, in an embodiment of the present application, if the grouping step size determined based on the grouping step size parameter is K and the length of the plurality of coefficients to be decoded is N, then after the plurality of coefficients to be encoded are grouped according to the grouping step size K, (G+1) groups of coefficients to be encoded can be determined. Wherein, after performing a division operation using N as the dividend and K as the divisor, the quotient obtained is G and the remainder is K', i.e., N / K=G...K'. In this case, it can be determined that after grouping, (G+1) groups of coefficients to be decoded are obtained, the number of coefficients to be decoded in the first G groups of coefficients to be decoded is K, and the number of coefficients to be decoded in the last group of coefficients to be decoded is K'.
[0320] Furthermore, in an embodiment of the present application, before encoding each coefficient group to be encoded in turn, longZero and run_length can be initialized for the current group in the coefficient group to be encoded. For example, longZero of the current group can be initialized to 0 (the second value), and run_length can also be initialized to 0.
[0321] It can be understood that in an embodiment of the present application, when the coefficients in the current group are encoded according to a preset order, if the current coefficient is 0, that is, the coefficients of all color components of the current point are 0, then the run_length is self-added, that is, ++run_length, and then the next coefficient of the current group is processed, that is, the coefficients of the next all color components are processed.
[0322] It can be understood that in an embodiment of the present application, when the coefficients in the current group are encoded in a preset order, if the current coefficient is not 0, that is, the coefficients of the three color components of the current point are not all 0, that is, there is at least one color component among the three color components of the current point whose coefficient is not 0, then it is necessary to first determine whether the value of longZero (coefficient identification information) is 0 (second value). If the value of longZero is 0, then the value of longZero needs to be written into the bitstream as 0, that is, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 is written into the bitstream, and then the value of longZero is set to non-0, for example, the value of longZero is set to 1 (first value). Then, the zero run value (run_length) can be encoded, and then the current coefficient can be encoded, that is, the coefficients of the specific three color components are encoded, and finally run_length can be reset to 0.
[0323] It should be noted that, in an embodiment of the present application, since the coefficient identification information of the current group is initialized to the second value (for example, 0) in advance, if the current coefficient is not 0, and the value of the coefficient identification information of the current group is the second value, it can be said that the coefficients to be encoded in the current group are not all 0, and the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 has not been encoded. Therefore, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 can be written into the code stream first.
[0324] Next, the value of the coefficient identification information can be reset to the first value, so that when encoding non-zero coefficients of the current group the next time, the value of the coefficient identification information can be referenced, and the coefficient identification information of the current group is not repeated. For example, when it is again determined that a coefficient to be encoded in the current group is non-zero, and the value of the coefficient identification information of the current group is the first value, it can be determined that although the coefficients to be encoded in the current group are not all zero, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all zero has already been encoded, and therefore, there is no need to repeat the encoding of the coefficient identification information of the current group. This can save codewords and improve encoding efficiency.
[0325] Furthermore, in an embodiment of the present application, each coefficient to be coded in the current group is traversed according to the above method until the last coefficient to be coded in the current group. By using the value of longZero or the value of run_length, it can be determined whether all the coefficients to be coded in the current group are 0. For example, after traversing all the coefficients to be coded in the current group, if the value of longZero is 0, it can be determined that all the coefficients to be coded in the current group are 0; if the value of longZero is not 0, it can be determined that not all the coefficients to be coded in the current group are 0. Alternatively, after traversing all the coefficients to be coded in the current group, if the value of run_length is the same as the number of points in the current group, it can be determined that all the coefficients to be coded in the current group are 0; if the value of run_length is less than the number of points in the current group, it can be determined that not all the coefficients to be coded in the current group are 0.
[0326] For example, in an embodiment of the present application, if the current coefficient is the last coefficient to be encoded in the current group, that is, the current coefficient is the coefficient of all color components of the last point in the current group, then after completing the encoding processing of the current coefficient according to the above method, if it is determined that all the coefficients to be encoded in the current group are 0 (if the value of longZero is 0, it means that all the coefficients to be encoded in the current group are 0, or if the value of run_length is equal to the number of points in the current group, it means that all the coefficients to be encoded in the current group are 0), then the value of longZero can be set to 1 and written into the bitstream; if it is determined that all the coefficients to be encoded in the current group are not all 0 (if the value of longZero is not 0, it means that all the coefficients to be encoded in the current group are not all 0, or if the value of run_length is less than the number of points in the current group, it means that all the coefficients to be encoded in the current group are 0), then run_length is written into the bitstream.
[0327] Furthermore, in an embodiment of the present application, when encoding the reflectivity attribute, the coefficient to be encoded of each point in the point cloud may be a reflectivity coefficient.
[0328] It is understood that in the embodiments of the present application, when encoding the attribute information of the point cloud, the longZero flag (identification information) and the zero run value run_length can be used. The longZero flag can indicate whether the coefficients to be encoded in each group are all 0, and the zero run value run_length is used to count whether the reflectivity coefficients of each point are all 0.
[0329] Furthermore, in an embodiment of the present application, at the encoding end, the coefficients to be encoded of all points may be grouped according to a grouping step parameter, thereby determining at least one group of coefficients to be encoded. The grouping step parameter may be a fixed length K, where K is an integer greater than or equal to 0, and the grouping step parameter may be any value pre-set for the point cloud.
[0330] Illustratively, in an embodiment of the present application, the grouping step parameter may be predefined in the attribute header information aps, and the grouping step parameter may be encoded and decoded before encoding and decoding the attribute coefficient.
[0331] It can be understood that in the embodiments of the present application, after determining the grouping step parameter, the grouping step parameter can be directly set to the grouping step, and then the multiple coefficients to be decoded can be grouped according to the grouping step; or, after determining the grouping step parameter, the grouping step can be first determined according to the grouping step parameter, and then the multiple coefficients to be decoded can be grouped according to the grouping step.
[0332] It should be noted that, in the embodiment of the present application, the length of the coefficient to be encoded of a point can be set to 1, that is, the length of the coefficient of the reflectivity of a point can be set to 1.
[0333] That is to say, in the embodiment of the present application, the length of the coefficients to be encoded of N points may be N, that is, the length of the coefficients to be encoded is the same as the number of points.
[0334] For example, in an embodiment of the present application, if the grouping step parameter is K and the length of the coefficients to be coded is N, then after the coefficients to be coded are grouped according to the grouping step parameter K, (G+1) groups of coefficients to be coded can be determined. After performing a division operation using N as the dividend and K as the divisor, the quotient obtained is G and the remainder is K', i.e., N / K=G...K'. In this case, it can be determined that after grouping, (G+1) groups of coefficients to be coded are obtained, the number of points in the first G groups of coefficients to be coded is K, i.e., the number of coefficients in the first G groups of coefficients to be coded is K, and the number of points in the last group of coefficients to be coded is K', i.e., the number of coefficients in the last group of coefficients to be coded is K'. K' is greater than 0 and less than or equal to K.
[0335] Furthermore, in an embodiment of the present application, before encoding each coefficient group to be encoded in turn, longZero and run_length can be initialized for the current group in the coefficient group to be encoded. For example, longZero of the current group can be initialized to 0 (the second value), and run_length can also be initialized to 0.
[0336] It can be understood that in an embodiment of the present application, when the coefficients in the current group are encoded according to a preset order, if the coefficient of the current point is 0, that is, the reflectivity coefficients of the current point are all 0, then the run_length is self-added, that is, ++run_length, and then the next coefficient of the current group is processed, that is, the next reflectivity coefficient is processed.
[0337] It can be understood that in the embodiment of the present application, when the coefficients in the current group are encoded in a preset order, if the coefficient of the current point is not 0, that is, the coefficient of the reflectivity of the current point is not 0, then it is necessary to first determine whether the value of longZero is 0. If the value of longZero is 0, then the value of longZero needs to be set to non-0, for example, the value of longZero is set to 1, so that the value of longZero indicates that the coefficients to be encoded in the current group are not all 0; if the value of longZero is not 0, then it can be considered that the value of longZero has already indicated that the coefficients to be encoded in the current group are not all 0, so there is no need to reset the value of longZero. Then, the zero run value (run_length) can be encoded, and then the coefficient of the current point can be encoded, that is, the coefficient of the reflectivity of the specific current point is encoded, and finally run_length can be reset to 0.
[0338] It should be noted that, in an embodiment of the present application, since the coefficient identification information of the current group is initialized to the second value (for example, 0) in advance, if the current coefficient is not 0, and the value of the coefficient identification information of the current group is the second value, it can be said that the coefficients to be encoded in the current group are not all 0, and the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 has not been encoded. Therefore, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all 0 can be written into the code stream first.
[0339] Next, the value of the coefficient identification information can be reset to the first value, so that when encoding non-zero coefficients of the current group the next time, the value of the coefficient identification information can be referenced, and the coefficient identification information of the current group is not repeated. For example, when it is again determined that a coefficient to be encoded in the current group is non-zero, and the value of the coefficient identification information of the current group is the first value, it can be determined that although the coefficients to be encoded in the current group are not all zero, the coefficient identification information indicating that the coefficients to be encoded in the current group are not all zero has already been encoded, and therefore, there is no need to repeat the encoding of the coefficient identification information of the current group. This can save codewords and improve encoding efficiency.
[0340] Furthermore, in an embodiment of the present application, after traversing each coefficient to be coded in the current group according to the above method, until the last coefficient to be coded in the current group, it is possible to determine whether all the coefficients to be coded in the current group are 0 by using the value of longZero or the value of run_length. For example, after traversing all the coefficients to be coded in the current group, if the value of longZero is 0, it can be determined that all the coefficients to be coded in the current group are 0; if the value of longZero is not 0, it can be determined that not all the coefficients to be coded in the current group are 0. Alternatively, after traversing all the coefficients to be coded in the current group, if the value of run_length is the same as the number of points in the current group, it can be determined that all the coefficients to be coded in the current group are 0; if the value of run_length is less than the number of points in the current group, it can be determined that not all the coefficients to be coded in the current group are 0.
[0341] For example, in an embodiment of the present application, if the current coefficient is the last coefficient to be coded in the current group, that is, the current coefficient is the reflectivity coefficient of the last point in the current group, then after completing the coding processing of the current coefficient according to the above method, if it is determined that all the coefficients to be coded in the current group are 0 (if the value of longZero is 0, it means that all the coefficients to be coded in the current group are 0, or if the value of run_length is equal to the number of points in the current group, it means that all the coefficients to be coded in the current group are 0), then the value of longZero can be set to 1 and written into the bitstream; if it is determined that all the coefficients to be coded in the current group are not all 0 (if the value of longZero is not 0, it means that all the coefficients to be coded in the current group are not all 0, or if the value of run_length is less than the number of points in the current group, it means that all the coefficients to be coded in the current group are 0), then run_length is written into the bitstream.
[0342] The preset order used by the encoding end may include the original acquisition order of the point cloud, Morton order, Hilbert order, transformation order, etc.
[0343] Furthermore, in an embodiment of the present application, when decoding the quantized residuals or quantized transform coefficients, the quantized residuals or quantized transform coefficients of the attribute information of all points in the point cloud can be grouped first, and then a flag longZero (coefficient identification information) is introduced for each group. The flag longZero can be used to indicate whether the quantized residuals or quantized transform coefficients of the attribute information of the points in each group are all 0.
[0344] It is understood that in the embodiments of the present application, the quantized residual or quantized transform coefficient of the attribute information of a point in the point cloud can be used as the coefficient to be decoded of the point. In other words, the coefficient to be decoded can be the quantized residual or the quantized transform coefficient.
[0345] Furthermore, in an embodiment of the present application, when decoding color attributes, the coefficients to be decoded for each point in the point cloud may include the coefficients of all color components. For example, a coefficient to be decoded may include the coefficients of the R component, the G component, and the B component; or a coefficient to be decoded may include the coefficients of the Y component, the U component, and the V component.
[0346] It is understood that in the embodiments of the present application, when decoding the attribute information of the point cloud, the longZero flag (identification information) and the zero run value run_length can be used. The longZero flag can indicate whether the coefficients to be decoded in each group are all 0, and the zero run value run_length is used to count whether the coefficients of all color components of each point are all 0.
[0347] Furthermore, in an embodiment of the present application, at the decoding end, the coefficients to be decoded of all points may be grouped according to a grouping step parameter, thereby determining at least one group of coefficients to be decoded. The grouping step parameter may be a fixed length K, where K is an integer greater than or equal to 0, and the grouping step parameter may be any value pre-set for the point cloud.
[0348] Illustratively, in an embodiment of the present application, the grouping step parameter may be predefined in the attribute header information aps, and the grouping step parameter may be encoded and decoded before encoding and decoding the attribute coefficient.
[0349] It can be understood that in the embodiments of the present application, after determining the grouping step parameter, the grouping step parameter can be directly set to the grouping step, and then the multiple coefficients to be decoded can be grouped according to the grouping step; or, after determining the grouping step parameter, the grouping step can be first determined according to the grouping step parameter, and then the multiple coefficients to be decoded can be grouped according to the grouping step.
[0350] It should be noted that, in the embodiments of the present application, the length of the coefficient to be encoded of a point can be set to 1. Since the coefficient to be encoded of each point can include the coefficients of all color components, the sum of the lengths of the coefficients of all color components of a point can be set to 1. For example, the sum of the lengths of the coefficients of the three color components R, G, and B of a point is set to 1, or the sum of the lengths of the coefficients of the three color components Y, U, and V of a point is set to 1.
[0351] That is to say, in an embodiment of the present application, the length of the N coefficients to be encoded of N points can be N, that is, the length of the coefficients to be encoded is the same as the number of points, or in other words, the length of the coefficients to be encoded is the same as the number of coefficients to be encoded.
[0352] For example, in an embodiment of the present application, if the grouping step size determined based on the grouping step size parameter is K and the length of the plurality of coefficients to be decoded is N, then after the plurality of coefficients to be decoded are grouped according to the grouping step size K, (G+1) groups of coefficients to be decoded can be determined. Wherein, after performing a division operation using N as the dividend and K as the divisor, the quotient obtained is G and the remainder is K', i.e., N / K=G...K'. In this case, it can be determined that after grouping, (G+1) groups of coefficients to be decoded are obtained, the number of coefficients to be decoded in the first G groups of coefficients to be decoded is K, and the number of coefficients to be decoded in the last group of coefficients to be decoded is K'.
[0353] It is understandable that, in the embodiments of the present application, when determining the grouping step size parameter, the grouping step size parameter may be obtained by decoding the code stream; or, a preset grouping step size parameter may be directly obtained.
[0354] It can be understood that in an embodiment of the present application, if the value of the coefficient identification information longZero obtained by decoding is the first value, for example, the value is 1, then it can be determined that the coefficients to be decoded in the current group are all 0, and it can be considered that there is no need to decode the coefficients to be decoded in the current group.
[0355] Exemplarily, in an embodiment of the present application, for color attributes, the longZero flag is decoded. If the value of longZero is 1, it means that all coefficients of the current group are 0, and then the next group of coefficients to be decoded is decoded. If the value of longZero is 0, it means that all coefficients of the current group are not all 0, and then the coefficients to be decoded in the current group need to be decoded. Therefore, it is necessary to decode the code stream, continue to determine the zero run value (run_length), and then determine the current coefficient in the current group based on the zero run value. If run_length>0, it means that the coefficients of all current color components are all 0, then the --run_length operation is performed, and then the coefficients of the next group of all color components are processed; if run_length==0, it means that at least one dimension of the coefficients of the current color component is not 0, then the coefficients of the current color component are decoded, and then the zero run value (run_length) is decoded and updated, and then the coefficients of the next group of all color components are processed.
[0356] Exemplarily, in an embodiment of the present application, for the reflectivity attribute, the longZero flag is decoded. If the value of longZero is 1, it means that all coefficients of the current group are 0, then the next coefficient group to be decoded is decoded; if the value of longZero is 0, it means that all coefficients of the current group are not all 0, and then the coefficients to be decoded in the current group need to be decoded, so it is necessary to decode the code stream, continue to determine the zero run value (run_length), and then determine the current coefficient in the current group based on the zero run value. Among them, if run_length>0, it means that the current reflectivity coefficient is 0, then the --run_length operation is performed, and then the next reflectivity coefficient is processed; if run_length==0, it means that the current reflectivity coefficient is not 0, then the current reflectivity coefficient is decoded, then decoded and updated with the zero run value (run_length), and then the next reflectivity coefficient is processed.
[0357] The preset order used by the decoding end may include the original acquisition order of the point cloud, Morton order, Hilbert order, transformation order, etc.
[0358] To sum up, the encoding and decoding method proposed in the embodiment of the present application can group all coefficients based on the indication of the group identification information when encoding and decoding coefficients. At the same time, coefficient identification information is introduced, such as a flag bit longZero. The flag bit longZero can be used to indicate whether the coefficients in each group are all 0. Therefore, when all coefficients in a group are 0, only a 1-bit flag bit is needed to indicate, which can save a part of the codewords, thereby improving the encoding efficiency and compression performance.
[0359] This embodiment provides a coding and decoding method. When encoding and decoding attribute information, due to the introduction of coefficient identification information, multiple coefficients can be grouped and processed. Therefore, when the coefficients in a coefficient group are all 0, one coefficient identification information can be used to indicate the values of the multiple coefficients in the group, which greatly saves codewords and improves the coding and decoding performance of point cloud attributes.
[0360] Based on the above embodiment, in another embodiment of the present application, based on the same inventive concept as the above embodiment, FIG8 is a schematic diagram of the composition structure of the encoder. As shown in FIG8 , the encoder 120 may include: a first determining unit 121, a setting unit 122 and an encoding unit 123; wherein,
[0361] The first determining unit 121 is configured to determine a grouping step size parameter; group the plurality of coefficients to be encoded according to the grouping step size parameter to determine at least one group of coefficients to be encoded; if a current coefficient in a current group in the at least one group of coefficients to be encoded is not zero, determine coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are zero;
[0362] The encoding unit 123 is configured to write the coefficient identification information into the bitstream if the value of the coefficient identification information is the second value;
[0363] The setting unit 122 is configured to set the value of the coefficient identification information to the first value if the value of the coefficient identification information is the second value;
[0364] The encoding unit 123 is further configured to encode the current coefficient after writing the zero run value into the bitstream;
[0365] The setting unit 122 is further configured to set the zero-run value to 0;
[0366] The encoding unit 123 is further configured to, if the value of the coefficient identification information is the first value, encode the current coefficient after writing the zero run value into the bitstream;
[0367] The setting unit 122 is further configured to set the zero-run value to 0;
[0368] The encoding unit 123 is further configured to continue encoding the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value.
[0369] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.
[0370] If the integrated unit is implemented as a software functional module and is not 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 this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing 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 the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0371] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 120. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.
[0372] Based on the composition of the above-mentioned encoder 120 and the computer-readable storage medium, Figure 9 is a second schematic diagram of the composition structure of the encoder. As shown in Figure 9, the encoder 120 may include: a first memory 124 and a first processor 125, a first communication interface 126 and a first bus system 127. The first memory 124, the first processor 125, and the first communication interface 126 are coupled together through the first bus system 127. It can be understood that the first bus system 127 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 127 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 127 in Figure 9. Among them,
[0373] The first communication interface 126 is used to receive and send signals during the process of sending and receiving information between other external network elements;
[0374] The first memory 124 is configured to store a computer program that can be run on the first processor;
[0375] The first processor 125 is configured to, when running the computer program, determine a grouping step parameter; group multiple coefficients to be encoded according to the grouping step parameter to determine at least one group of coefficients to be encoded; if a current coefficient in a current group in at least one group of coefficients to be encoded is not zero, determine coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are zero; if the value of the coefficient identification information is a second value, write the coefficient identification information into a bitstream and set the value of the coefficient identification information to the first value; after writing the zero-run value into the bitstream, encode the current coefficient and set the zero-run value to 0; if the value of the coefficient identification information is the first value, after writing the zero-run value into the bitstream, encode the current coefficient and set the zero-run value to 0; and continue to encode the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value.
[0376] It is understood that the first memory 124 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 124 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0377] The first processor 125 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 125. The above-mentioned first processor 125 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 124 , and the first processor 125 reads the information in the first memory 124 and completes the steps of the above method in combination with its hardware.
[0378] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0379] Optionally, as another embodiment, the first processor 125 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.
[0380] FIG10 is a schematic diagram of a first structure of a decoder. As shown in FIG10 , the decoder 130 may include: a second determining unit 131; wherein,
[0381] The second determination unit 131 is configured to determine a grouping step parameter; group multiple coefficients to be decoded according to the grouping step parameter to determine at least one coefficient group to be decoded; determine coefficient identification information of a current group in the at least one coefficient group to be decoded; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0; if the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0, then the decoding process of the coefficients to be decoded in the current group is completed, and the identification information of the next coefficient group to be decoded in the at least one coefficient group to be decoded is continued to be determined.
[0382] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.
[0383] If the integrated unit is implemented as a software functional module and not 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 this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0384] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the decoder 130. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements any one of the methods in the aforementioned embodiments.
[0385] Based on the composition of the above-mentioned decoder 130 and the computer-readable storage medium, Figure 11 is a second schematic diagram of the composition structure of the decoder. As shown in Figure 11, the decoder 130 may include: a second memory 132 and a second processor 133, a second communication interface 134 and a second bus system 135. The second memory 132 and the second processor 133, and the second communication interface 134 are coupled together through the second bus system 135. It can be understood that the second bus system 135 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 135 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 135 in Figure 11. Among them,
[0386] The second communication interface 134 is used to receive and send signals during the process of sending and receiving information with other external network elements;
[0387] The second memory 132 is used to store computer programs that can be run on the second processor;
[0388] The second processor 133 is used to determine a grouping step parameter when running the computer program; group multiple coefficients to be decoded according to the grouping step parameter to determine at least one coefficient group to be decoded; determine coefficient identification information of a current group in at least one coefficient group to be decoded; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0; if the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0, then complete the decoding process of the coefficients to be decoded in the current group, and continue to determine the coefficient identification information of the next coefficient group to be decoded in at least one coefficient group to be decoded.
[0389] It is understood that the second memory 132 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The second memory 132 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0390] The second processor 133 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the second processor 133. The above-mentioned second processor 133 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the second memory 132 , and the second processor 133 reads the information in the second memory 132 and completes the steps of the above method in combination with its hardware.
[0391] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0392] An embodiment of the present application provides an encoder and a decoder. When encoding and decoding attribute information, due to the introduction of coefficient identification information, multiple coefficients can be grouped and processed. Therefore, when the coefficients in a coefficient group are all 0, one coefficient identification information can be used to indicate the values of the multiple coefficients in the group, which greatly saves codewords and improves the encoding and decoding performance of point cloud attributes.
[0393] It should be noted that, in the embodiments of the present application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0394] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0395] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0396] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0397] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0398] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability
[0399] An embodiment of the present application provides a coding and decoding method, an encoder, a decoder, and a storage medium. At the encoding end, a grouping step parameter is determined; a plurality of coefficients to be coded are grouped according to the grouping step parameter to determine at least one coefficient group to be coded; if a current coefficient in a current group in at least one coefficient group to be coded is not 0, coefficient identification information of the current group is determined; wherein the coefficient identification information is used to indicate whether all the coefficients to be decoded in the current group are 0; if the value of the coefficient identification information is a second value, the coefficient identification information is written into a bitstream, and the value of the coefficient identification information is set to a first value; after writing a zero-run value into the bitstream, the current coefficient is encoded, and the zero-run value is set to 0; if the value of the coefficient identification information is the first value, after writing the zero-run value into the bitstream, the current coefficient is encoded, and the zero-run value is set to 0; and the next coefficient to be coded in the current group is continuously encoded according to the coefficient identification information and the zero-run value. At the decoding end, a grouping step parameter is determined; multiple coefficients to be decoded are grouped according to the grouping step parameter to determine at least one coefficient group to be decoded; coefficient identification information of the current group in at least one coefficient group to be decoded is determined; wherein the coefficient identification information is used to indicate whether the coefficients to be decoded in the current group are all 0; if the coefficient identification information indicates that the coefficients to be decoded in the current group are all 0, the decoding process of the coefficients to be decoded in the current group is completed, and the coefficient identification information of the next coefficient group to be decoded in at least one coefficient group to be decoded is continued to be determined. It can be seen that in the embodiment of the present application, when encoding and decoding attribute information, due to the introduction of coefficient identification information, multiple coefficients can be grouped and processed, so that when the coefficients in a coefficient group are all 0, one coefficient identification information can be used to indicate the value of multiple coefficients in the group, which greatly saves codewords and improves the encoding and decoding performance of point cloud attributes.
Claims
1. A decoding method, applied to a decoder, comprising: Determine the grouping step size parameter; Grouping the plurality of coefficients to be decoded according to the grouping step size parameter to determine at least one coefficient group to be decoded; Determining coefficient identification information of a current group in the at least one to-be-decoded coefficient group; wherein the coefficient identification information is used to indicate whether all the to-be-decoded coefficients in the current group are 0; If the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0, the decoding process of the coefficients to be decoded in the current group is completed, and the coefficient identification information of the next coefficient group to be decoded in the at least one coefficient group to be decoded is continued to be determined.
2. The method according to claim 1, wherein The method further comprises: If the coefficient identification information indicates that the coefficients to be decoded in the current group are not all zero, the code stream is decoded, a zero-run value is determined, and a current coefficient in the current group is determined according to the zero-run value.
3. The method according to claim 2, wherein: The method further comprises: The current coefficients are the coefficients of all color components of the current point.
4. The method according to claim 3, wherein: The method further comprises: If the zero-run value indicates that the coefficients of all color components of the current point are 0, then after decrementing the zero-run value by 1, determining the next coefficient to be decoded in the current group according to the zero-run value; If the zero-run value indicates that the coefficients of all color components of the current point are not all zero, the code stream is decoded to determine the coefficients of all color components of the current point and a new zero-run value, and the next coefficient to be decoded in the current group is determined based on the new zero-run value.
5. The method according to claim 2, wherein: The method further comprises: The current coefficient is the reflectivity coefficient of the current point.
6. The method according to claim 5, wherein: The method further comprises: If the zero-run value indicates that the reflectivity coefficient of the current point is 0, then after decrementing the zero-run value by 1, determining the next coefficient to be decoded in the current group according to the zero-run value; If the zero-run value indicates that the reflectivity coefficient of the current point is not 0, the code stream is decoded to determine the reflectivity coefficient of the current point and a new zero-run value, and the next coefficient to be decoded in the current group is determined according to the new zero-run value.
7. The method according to claim 4 or 6, wherein: The method further comprises: If the zero-run value is greater than 0, determining that the zero-run value indicates that the current coefficient is 0; If the zero-run value is equal to 0, it is determined that the zero-run value indicates that the current coefficient is not zero.
8. The method according to claim 1, wherein The method further comprises: If the value of the coefficient identification information is the first value, determining that the coefficient identification information indicates that all the coefficients to be decoded in the current group are 0; If the value of the coefficient identification information is the second value, it is determined that the coefficient identification information indicates that the coefficients to be decoded in the current group are not all zero; wherein the first value and the second value are not equal.
9. The method according to any one of claims 1 to 6, 8, wherein: The coefficient to be decoded is a quantized residual of attribute information; or The coefficients to be decoded are quantized transformation coefficients of the attribute information.
10. The method according to claim 9, wherein: The method further comprises: Decoding the code stream to determine the grouping step size parameter; or, Obtain the preset grouping step parameter.
11. The method according to claim 1, wherein The method further comprises: Decode the code stream and determine the group identification information; If the group identification information indicates that the plurality of coefficients to be decoded are to be grouped, the process of determining the grouping step size parameter is executed.
12. The method according to claim 11, wherein The method further comprises: If the grouping identification information indicates that the plurality of coefficients to be decoded are not to be grouped, the code stream is decoded, a zero-run value is determined, and a current coefficient is determined according to the zero-run value.
13. The method according to claim 10, wherein: The method further comprises: The grouping step parameter is set to the grouping step, and a plurality of coefficients to be decoded are grouped according to the grouping step; or, A grouping step size is determined according to the grouping step size parameter, and a plurality of coefficients to be decoded are grouped according to the grouping step size.
14. The method according to claim 13, wherein The method further comprises: If the grouping step size parameter is K, then the grouping step size is set to K; or, If the grouping step parameter is K, then the grouping step is determined to be 2 K ; Wherein, K is an integer greater than or equal to 0. Decode the code stream and determine the group identification information; If the group identification information indicates that a plurality of coefficients to be decoded are to be grouped, determining a grouping step size parameter; 15. A coding method, applied to an encoder, comprising: Determine the grouping step size parameter; Grouping the plurality of coefficients to be coded according to the grouping step size parameter to determine at least one coefficient group to be coded; If a current coefficient in a current group of the at least one to-be-encoded coefficient group is not 0, determining coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the to-be-decoded coefficients in the current group are 0; If the value of the coefficient identification information is the second value, writing the coefficient identification information into the bitstream and setting the value of the coefficient identification information to the first value; after writing the zero run value into the bitstream, encoding the current coefficient and setting the zero run value to 0; If the value of the coefficient identification information is the first value, after writing the zero-run value into the bitstream, encoding the current coefficient and setting the zero-run value to 0; Continue to encode the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value.
16. The method according to claim 15, wherein The method further comprises: If the current coefficient in the current group of the at least one to-be-encoded coefficient group is 0, then after performing a self-incrementing process on the zero-run value, the next to-be-encoded coefficient in the current group is continuously encoded.
17. The method according to claim 16, wherein The method further comprises: Before encoding the current group, the value of the coefficient identification information is initialized to the second value, and the zero run value is initialized to 0.
18. The method according to claim 16, wherein The method further comprises: When the current coefficient is the last coefficient to be encoded in the current group, if the value of the coefficient identification information is the second value, it is determined that all the coefficients to be encoded in the current group are 0, the coefficient identification information is encoded as the first value and written into the bitstream; otherwise, the zero run value is written into the bitstream.
19. The method according to claim 16, wherein The method further comprises: When the current coefficient is the last coefficient to be encoded in the current group, if the zero-run value is the same as the number of points in the current group, it is determined that all the coefficients to be encoded in the current group are 0, and the coefficient identification information is encoded as a first value and written into the bitstream; otherwise, the zero-run value is written into the bitstream.
20. The method according to claim 15, wherein The method further comprises: Determining group identification information; If the group identification information indicates that the plurality of coefficients to be decoded are to be grouped, the process of determining the grouping step size parameter is executed.
21. The method according to claim 20, wherein The method further comprises: If the group identification information indicates that the plurality of coefficients to be decoded are not to be grouped, determining whether the current coefficient is 0; If the current coefficient is 0, then after adding 1 to the zero run value, continue encoding the next coefficient to be encoded among the multiple coefficients to be decoded; If the current coefficient is not 0, after writing the zero-run value into the bitstream, the current coefficient is encoded, the zero-run value is set to 0, and the next coefficient to be encoded among the multiple coefficients to be decoded is continuously encoded.
22. The method according to claim 21, wherein The method further comprises: The current coefficients are the coefficients of all color components of the current point; or, The current coefficient is the reflectivity coefficient of the current point.
23. The method according to claim 16, wherein The method further comprises: If the zero-run value is greater than 0, determining that the zero-run value indicates that the current coefficient is 0; If the zero-run value is equal to 0, it is determined that the zero-run value indicates that the current coefficient is not zero.
24. The method according to any one of claims 15 to 23, wherein: The coefficient to be encoded is a quantized residual of attribute information; or The coefficients to be encoded are quantized transformation coefficients of attribute information.
25. The method according to any one of claims 15 to 23, wherein: The grouping step size parameter is written into the code stream.
26. The method according to claim 25, wherein The method further comprises: Setting the grouping step parameter to a grouping step, and grouping the plurality of coefficients to be encoded according to the grouping step; or A grouping step size is determined according to the grouping step size parameter, and the multiple coefficients to be encoded are grouped according to the grouping step size.
27. The method according to claim 26, wherein The method further comprises: If the grouping step size parameter is K, then the grouping step size is set to K; or, If the grouping step parameter is K, then the grouping step is determined to be 2 K ; Wherein, K is an integer greater than or equal to 0.
28. An encoder comprising a first determining unit, a setting unit and an encoding unit; wherein, The first determining unit is configured to determine a grouping step size parameter; group the plurality of coefficients to be coded according to the grouping step size parameter to determine at least one group of coefficients to be coded; If a current coefficient in a current group of the at least one to-be-encoded coefficient group is not 0, determining coefficient identification information of the current group; wherein the coefficient identification information is used to indicate whether all the to-be-decoded coefficients in the current group are 0; The encoding unit is configured to write the coefficient identification information into the bitstream if the value of the coefficient identification information is the second value; The setting unit is configured to set the value of the coefficient identification information to the first value if the value of the coefficient identification information is the second value; The encoding unit is further configured to encode the current coefficient after writing the zero-run value into the bitstream; The setting unit is further configured to set the zero-run value to 0; The encoding unit is further configured to, if the value of the coefficient identification information is the first value, encode the current coefficient after writing the zero run value into the bitstream; The setting unit is further configured to set the zero-run value to 0; The encoding unit is further configured to continue encoding the next coefficient to be encoded in the current group according to the coefficient identification information and the zero-run value.
29. An encoder comprising a first memory and a first processor; wherein: The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 15 to 27 when running the computer program.
30. A decoder, comprising a second determining unit; wherein: The second determining unit is configured to determine a grouping step size parameter; Grouping the plurality of coefficients to be decoded according to the grouping step size parameter to determine at least one coefficient group to be decoded; Determine coefficient identification information of a current group in the at least one coefficient group to be decoded; wherein the coefficient identification information is used to indicate whether the coefficients to be decoded in the current group are all 0; if the coefficient identification information indicates that the coefficients to be decoded in the current group are all 0, complete the decoding process of the coefficients to be decoded in the current group, and continue to determine the identification information of the next coefficient group to be decoded in the at least one coefficient group to be decoded.
31. A decoder comprising a second memory and a second processor; wherein: The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 14 when running the computer program.
32. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 14 is implemented, or the method according to any one of claims 15 to 27 is implemented.
Citation Information
Patent Citations
Coefficient encoding method, coefficient decoding method, electronic equipment and medium
CN110545437A
Encoding method, decoding method, corresponding device, electronic equipment and storage medium
CN112449186A
Decoding method, encoding method, corresponding devices, electronic equipment and storage medium
CN112449201A
Method for encoding block of coefficient
CN1917645A
Techniques and apparatus for alphabet-partition coding of transform coefficients for point cloud compression
US20210217136A1