This disclosure relates to the field of computer technologies, and specifically, to a point cloud encoding and decoding technology.
With the continuous development of science and technology, a large quantity of high-precision point clouds may be obtained at low costs and in a short time period. The point cloud may include a plurality of points, and each point in the point cloud has geometric information and attribute information, which is referred to as point cloud related information. Before the point cloud is transmitted, encoding processing is usually required to be performed on the point cloud related information, to improve efficiency of transmitting the point cloud. Specifically, an encoder side may transmit encoded information to a decoder side after encoding the point cloud related information, and the decoder side may decode the encoded information to reconstruct the point cloud related information. However, in actual applications, efficiency of encoding and decoding the point cloud is usually not so high because of a large data volume of the point cloud related information.
Embodiments of this disclosure provide a point cloud processing method and apparatus, a computer device, and a storage medium, to improve efficiency of encoding and decoding a point cloud.
According to an aspect, an embodiment of this disclosure provides a point cloud processing method, performed by a computer device. The point cloud processing method includes:
In this embodiment of this disclosure, after the encoded data of the point cloud is obtained, the encoded data is analyzed to obtain the shift data. The shift data is obtained by performing shift processing on the target encoding information of the point cloud in the encoding process of the point cloud. Shift reconstruction is performed on the shift data to obtain the reconstructed encoding information of the target encoding information. According to this embodiment of this disclosure, shift processing is performed on the target encoding information, so that a data volume required to be decoded in a decoding phase of the point cloud can be reduced, and efficiency of decoding the point cloud can be improved.
According to another aspect, an embodiment of this disclosure provides a point cloud processing method, performed by a computer device. The point cloud processing method includes:
In this embodiment of this disclosure, after the target encoding information of the point cloud is obtained, shift processing may be performed on the target encoding information to obtain the shift data of the target encoding information, and then the shift data may be encoded. According to this embodiment of this disclosure, shift processing is performed on the target encoding information, so that a data volume required to be encoded in an encoding phase of the point cloud can be reduced, and efficiency of encoding the point cloud can be improved.
Correspondingly, an embodiment of this disclosure provides a point cloud processing apparatus. The point cloud processing apparatus includes:
The following clearly and completely describes the technical solutions in the embodiments of this disclosure with reference to the accompanying drawings in the embodiments of this disclosure. It is clear that the described embodiments are merely some but not all of the embodiments of this disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of this disclosure without creative efforts shall fall within the protection scope of this disclosure.
Basic concepts involved in the embodiments of this disclosure are first described herein, to more clearly understand the technical solutions provided in the embodiments of this disclosure.
(1) Point cloud: The point cloud is a set of discrete points which are irregularly distributed in space and express a spatial structure and a surface attribute of a three-dimensional (3D) object or a three-dimensional scene. The point cloud may be classified into different categories according to different classification standards. For example, the point cloud may be classified as a dense point cloud or a sparse point cloud based on a manner for obtaining the point cloud. For another example, the point cloud may be classified as a static point cloud or a dynamic point cloud based on a timing type of the point cloud.
(2) Point cloud data: Geometric information and attribute information of each point in the point cloud form the point cloud data. The geometric information may also be referred to as 3D location information. Geometric information of a specific point in the point cloud is spatial coordinates (x, y, z) of the point, and may include coordinate values of the point in respective coordinate axis directions of a 3D coordinate system, for example, a coordinate value x in an X-axis direction, a coordinate value y in a Y-axis direction, and a coordinate value z in a Z-axis direction. Attribute information of a specific point in the point cloud may include at least one of the following: color information, material information, and laser reflection intensity information (also referred to as a reflectivity). Generally, each point in the point cloud has a same amount and type of attribute information. For example, each point in the point cloud may have two pieces of attribute information: the color information and a laser reflection intensity. For another example, each point in the point cloud may have three pieces of attribute information: the color information, the material information, and the laser reflection intensity information.
(3) Point cloud encoding (Point Cloud Compression, PCC): Point cloud encoding is a process of encoding the geometric information and the attribute information of each point in the point cloud to obtain a compressed bitstream. Point cloud encoding may include two main processes: geometric information encoding and attribute information encoding. At present, a mainstream point cloud encoding technology may be classified as geometry-based point cloud encoding and projection-based point cloud encoding based on different types of the point cloud. Geometry-based point cloud compression (G-PCC) in moving picture expert group (MPEG) (an international video and audio encoding and decoding standard) and a point cloud encoding standard AVS-PCC in audio video encoding standard (AVS) (a China national video encoding and decoding standard) are used herein as an example for description.
Encoding frameworks of G-PCC and AVS-PCC are substantially the same.
For main operations and processing in the geometric information encoding process, refer to the following descriptions.
First, pre-processing: pre-processing may include coordinate transformation (Transform coordinates) and voxelization (Voxelize). The point cloud data in 3D space is converted into an integral form through scaling and translation operations, and a minimum geometric location is moved to an origin of coordinates.
Second, geometry encoding: Geometry encoding may include two modes: octree-based geometry encoding (Octree) and triangular-representation-based geometry encoding (Trisoup). The two encoding modes may be used under different conditions.
Octree-based geometry encoding: An octree is a tree data structure. In division in the 3D space, a preset bounding box is divided evenly, and each node has eight child nodes. Whether each child node of the octree is occupied is indicated by “1” and “0” to obtain occupancy code information (Occupancy Code) as a bitstream of the geometric information of the point cloud.
Triangular-representation-based geometry encoding: The point cloud is divided into blocks of a specific size, intersections of surfaces of the point cloud at edges of the blocks are located, and a triangle is constructed. The intersections are encoded to implement compression of the geometric information.
Third, geometry quantification: Fineness of quantization is usually determined by a quantization parameter (QP). A larger value of the QP indicates that coefficients in a larger value range is to be quantized into a same output, which usually brings a greater distortion and a lower bit rate. On the contrary, a smaller value of the QP indicates that coefficients in a small value range are to be quantized into a same output, which usually brings a small distortion and a high code rate.
Fourth, geometry entropy encoding: Statistical compression encoding is performed for the occupancy code information of the octree, to finally output a binary (0 or 1) compressed bitstream. Statistical encoding is a lossless encoding mode capable of effectively reducing a bit rate required for expressing a same signal. A common statistical encoding mode includes content adaptive binary arithmetic encoding (CABAC).
For main operations and processing in the attribute information encoding process, refer to the following descriptions.
First, attribute recoloring: In a case of lossy encoding, after the geometric information is encoded, an encoder side is required to decode and reconstruct the geometric information, that is, recover the geometric information of each point in the point cloud. Search is performed in the original point cloud for attribute information of one or more neighbor points corresponding to a specific reconstructed point in the recovered point cloud to obtain attribute information of the reconstructed point.
Second, attribute transform encoding (Transform): Attribute transform encoding may include three modes: predicting transform encoding (Predicting Transform), lifting transform encoding (Lifting Transform), and region adaptive hierarchical transform (RAHT) encoding. The three encoding modes may be used under different conditions.
Predicting transform encoding: A sub-point set is selected based on a distance, and the point cloud is divided into a plurality of different levels (Level of Detail, LoD), to implement realize a rough to fine point cloud representation. Bottom-up prediction may be implemented between adjacent levels, that is, attribute information of a point introduced at a fine level is predicted by a neighbor point at a rough level, to obtain a corresponding residual signal. A point at a lowest level is used as reference information for encoding.
Lifting transform encoding: A neighborhood-point-based weight updating policy is introduced based on adjacent LoD prediction, a predicted attribute value of each point is finally obtained, and a corresponding residual signal is obtained.
RAHT encoding: RAHT is performed on the attribute information to convert the signal into a transform domain, to obtain a transform coefficient.
Third, attribute information quantization (Attribute Quantification): Fineness of quantization is usually determined by a QP. Entropy encoding is performed on a quantized residual value in predicting transform encoding and lifting transform encoding. Entropy encoding is performed on a quantized transform coefficient in RAHT.
Fourth, attribute entropy encoding: A quantized attribute residual signal or transform coefficient is generally finally compressed through run-length encoding and arithmetic code. For a corresponding encoding mode, information such as the QP is also encoded through an entropy encoder.
(4) Point cloud decoding: Point cloud decoding is a process of decoding the compressed bitstream obtained through point cloud encoding, to reconstruct the point cloud. In detail, point cloud decoding is a process of reconstructing the geometric information and the attribute information of each point in the point cloud based on the geometric bitstream and the attribute bitstream in the compressed bitstream. After a decoder side obtains the compressed bitstream, for the geometric bitstream, entropy decoding is first performed to obtain quantized geometric information of each point in the point cloud, and then inverse quantization is performed to reconstruct the geometric information of each point in the point cloud. For the attribute bitstream, entropy decoding is first performed to obtain quantized prediction residual information or a quantized transform coefficient of each point in the point cloud. Then, inverse quantization is performed on the quantized prediction residual information to obtain reconstructed residual information, and inverse quantization is performed on the quantized transform coefficient to obtain a reconstructed transform coefficient. Inverse transform is performed on the reconstructed transform coefficient to obtain reconstructed residual information. The attribute information of each point in the point cloud may be reconstructed based on the reconstructed residual information of each point in the point cloud. Reconstructed attribute information of each point in the point cloud corresponds to the reconstructed geometric information one to one in order, to reconstruct the point cloud.
The above content describes the basic concepts involved in the embodiments of this disclosure. The following describes basic technologies involved in the embodiments of this disclosure.
Floating-point type coordinates of each point in an input point cloud are represented as (xm, ym, zm), where m=0, . . . , M−1, and M is a quantity of points in the point cloud. A coordinate point (xmin, ymin, zmin) and a coordinate point (xmax, ymax, zmax) are represented as follows:
A function min(s0, s1, . . . , sM-1) represents taking a minimum value of the current input, max (s0, s1, . . . , sM-1) represents taking a maximum value of the current input.
As shown in
Sizes of the bounding box in x, y, and z directions may be calculated as follows:
Herein, int(s) is a rounding function, and a floor(s) function returns a maximum integral value less than or equal to s.
Octree is a tree data structure. At present, a point cloud is mainly divided with an octree structure in G-PCC or AVS-PCC. For point cloud data in 3D space, octree division evenly divides a preset bounding box level by level, and each node has eight child nodes. Whether each child node of the octree is occupied is indicated by “1” and “0”, as shown in
The octree is constructed based on a Morton order, that is, a Morton order table is queried to convert 3D coordinate information of the point cloud data into corresponding Morton code. A corresponding point at each level of the octree is obtained based on sorting of each piece of Morton code. At present, a mainstream point cloud encoding technology represents the point cloud data with octree division, and uses different processing processes for geometric information and attribute information.
A concept similar to an encoding block in video encoding is introduced into a block structure encoding method. The 3D space is divided into several non-overlapping encoding macroblocks of a size of (2d
Each node is encoded based on the encoding macroblock (LCU). As shown in
In current implementation, breadth first traversal is used inside each encoding macroblock. This block structure encoding method is highly flexible. In each encoding macroblock, different geometry encoding methods may be used based on a characteristic of the encoding macroblock, or attribute encoding may be performed after geometry encoding of a macroblock is completed. In this way, attribute encoding may be performed even if geometry encoding of the entire point cloud is not ended.
All points in the point cloud are connected into a single predictive tree, and each point is predicted based on a signal value of a previous point. As an option of point cloud signal prediction, this method may be set to act on the entire original point cloud data, or may act on the child node of the octree or a subset of point cloud data obtained in another manner.
In addition, in an existing predictive encoding technology in G-PCC, search is performed based on a distance between points to establish a predictive tree.
1. Prediction is not performed.
2. Prediction is performed with a parent node (a first-generation parent node), that is, a previous point. For example, for a point 401 in
3. Prediction is performed with a parent node (a first-generation parent node) and a grandparent node (a second-generation parent node). For example, for a point 401 in
4. Prediction is performed with a parent node (a first-generation parent node), a grandparent node (a second-generation parent node), and a grand-grandparent node (a third-generation parent node). For example, for a point 401 in
The entropy encoding technology is configured for binarizing and processing a quantized (lossy) signed attribute prediction residual or transform coefficient.
1. Variable length encoding: Codewords with different lengths are configured for representing residuals or coefficients to be encoded. A code length is required to be designed based on a probability of occurrence of a sign. Exponential-Golomb encoding (Exp-Golomb) and arithmetic encoding are commonly used.
Exponential-Golomb encoding is a lossless data compression method, and obtains a variable length prefix code. An encoding principle of a Kth-order (K is a nonnegative integer) exponential-Golomb encoding mode is as follows: writing a digit in a binary form, removing the lowest K bits, and then adding 1; calculating a quantity of bits left, and subtracting 1 from the quantity of bits left to obtain a quantity of leading zeros required to be added; and recovering the lowest K bits removed in the first operation to a tail of a bit string. For example, second-order exponential-Golomb encoding is performed on a digit “5” through the following process: writing the digit “5” as “101” in the binary form, removing the lowest two bits “10”, with the high bit “1” left, and adding 1 to the high bit “1” to obtain “10”, where a quantity of bits left is 2; subtracting 1 from the quantity of bits left to obtain a quantity of leading zeros required to be added, where one leading zero is required to be added; and recovering the lowest two bits removed in the first operation to a tail of a bit string, to obtain second-order exponential-Golomb code “01001” corresponding to the digit “5”. A decoding process of the Kth-order exponential-Golomb encoding mode is an inverse process of an encoding process of the Kth-order exponential-Golomb encoding mode.
2. CABAC: CABAC may include the following several operations.
First, binarization: CABAC uses binary arithmetic encoding, which means that only two digits (1 or 0) are encoded. A non-binary numerical sign, for example, a transform coefficient or a motion vector, is first binarized or converted into a binary codeword before arithmetic encoding. This process is similar to converting a value into a variable length codeword, but the binary codeword is further encoded by an arithmetic encoder before transmission.
Second, context model selection: A context model is a probabilistic model, which is a model selected based on statistics of a latest encoded data symbol. This model stores a probability that each “bin” is 1 or 0.
Third, arithmetic encoding: The arithmetic encoder encoding on each “bin” based on the selected probabilistic model.
Fourth, probability update: The selected context model may be updated based on an actual encoded value. For example, if a value of “bin” is 1, a frequency count of 1 increases.
3. Run-length encoding
A signal value such as the quantized (lossy) signed attribute prediction residual or transform coefficient is encoded. A quantity of continuous points that are 0 in statistical data is denoted as a run-length. A residual value Res is used as an example. If Res is not zero, entropy encoding is first performed on a value of the run-length, then entropy encoding is performed on the non-zero attribute prediction residual, and the value of the run-length is set to 0 for recounting.
A shift principle is translating a digit based on the binary form. Translation may include shift to left (<<) and shift to right (>>). Shift to left means shifting a binary digit to left based on a specified shift bit count, where shifted-out bits are discarded, and empty bits on the right formed through shift are filled with 0. Shift to right means shifting a binary digit to left based on a specified shift bit count, where shifted-out bits are discarded, and empty bits on the left formed through shift are filled with 0. A shift quotient and a shift remainder may be obtained after shift processing is performed on a binary digit. The binary digit may be reconstructed through shift based on the shift quotient and the shift remainder. The shift quotient is a result obtained by shifting the binary digit to right by a target bit count. The shift remainder is a binary difference between the binary digit and a result obtained by performing the shift quotient to left by a target bit count. For example, A=A1<<s+A2 indicates that a shift quotient A1 and a shift remainder A2 may be obtained by performing shift processing on A, and A may be reconstructed by adding the shift remainder A2 after the shift quotient A1 is shifted to left by a target bit count s.
Based on the foregoing related descriptions of the basic concepts and the basic technologies, the embodiments of this disclosure provide a point cloud processing solution, to improve efficiency of encoding and decoding a point cloud. In the point cloud processing solution, in an encoding phase of a point cloud, for target encoding information to be encoded in the point cloud, shift processing is performed on the target encoding information, and data obtained by shifting the target encoding information is encoded. In this way, a data volume required to be encoded in the encoding phase of the point cloud can be reduced, so that efficiency of encoding the point cloud can be improved. Correspondingly, in the point cloud processing solution, in a decoding phase of the point cloud, after the data obtained by shifting the target encoding information is obtained through decoding, shift reconstruction may be performed on the data obtained by shifting the target encoding information, to obtain reconstructed encoding information of the target encoding information. In this way, a data volume required to be decoded in the decoding phase of the point cloud can be reduced, so that efficiency of decoding the point cloud can be improved.
The point cloud processing solution provided in the embodiments of this disclosure may be combined with technologies of cloud computing, cloud storage, and the like in a cloud technology. Cloud computing is a computing mode. Cloud computing distributes computing tasks on a resource pool including a plenty of computers, such that various application systems can obtain computing power, storage space, and information services as required. Cloud computing may provide strong computing support for the encoding phase of the point cloud and the decoding phase of the point cloud. In this way, the efficiency of encoding the point cloud and efficiency of decoding the point cloud can be greatly improved. Cloud storage is a new concept extending and developing from the concept of cloud computing. A distributed cloud storage system (referred to as a storage system) is a storage system that integrates, by using functions of a cluster application, a grid technology, a distributed storage file system, and the like, various types of storage devices (the storage device is also referred to as a storage node) in a network through application software or application interfaces to work collaboratively to externally provide data storage and service accesses function. Cloud storage may provide strong storage support for the encoding phase of the point cloud and the decoding phase of the point cloud. In this way, the efficiency of encoding the point cloud and efficiency of decoding the point cloud can be further improved.
The following describes, with reference to
The encoding device 601 may obtain point cloud data (that is, geometric information and attribute information of each point in a point cloud). The point cloud data may be obtained through scene capture or generation by the device. Obtaining the point cloud data through scene capture means collecting a visual scene of a real world through a capture device associated with the encoding device 601, to obtain the point cloud data. The capture device is configured to provide a point cloud data obtaining service for the encoding device 601. The capture device may include but is not limited to any one of the following: a photographic device, a sensing device, and a scanning device. The photographic device may include an ordinary camera, a stereoscopic camera, a light field camera, and the like. The sensing device may include a laser device, a radar device, and the like. The scanning device may include a 3D laser scanning device and the like. The capture device associated with the encoding device 601 may be a hardware component arranged in the encoding device 601. For example, the capture device is a camera, a sensor, or the like of the terminal. Alternatively, the capture device associated with the encoding device 601 may be a hardware apparatus connected to the encoding device 601, for example, a camera connected to the server. Obtaining the point cloud data through generation by the device means that the encoding device 601 generates the point cloud data based on a virtual object (for example, a virtual 3D object and a virtual 3D scene that are obtained through 3D modeling).
The encoding device 601 may perform encoding processing on the geometric information of each point in the point cloud to obtain a geometric bitstream, and perform encoding processing on the attribute information of each point in the point cloud to obtain an attribute bitstream. The encoding device 601 may transmit both the geometric bitstream and the attribute bitstream that are obtained through encoding to the decoding device 602. In a geometry encoding or attribute encoding process, for target encoding information to be encoded in the point cloud (which may be, for example, attribute information, attribute residual information, geometric information, geometric residual information, or run-length information, involved in the encoding process, of a to-be-encoded point in the point cloud), the encoding device 601 may perform shift processing on the target encoding information, and code a value obtained through shifting. In this way, a data volume required to be encoded in an encoding phase of the point cloud can be greatly reduced, so that efficiency of encoding the point cloud can be improved.
After receiving a compressed bitstream (that is, the attribute bitstream and the geometric bitstream) transmitted by the encoding device 601, the decoding device 602 may perform decoding processing on the geometric bitstream to reconstruct the geometric information of each point in the point cloud, and perform decoding processing on the attribute bitstream to reconstruct the attribute information of each point in the point cloud. In a geometry decoding or attribute decoding process, the decoding device 602 may perform shift reconstruction on data obtained through analysis to obtain reconstructed encoding information of the target encoding information. In this way, a data volume required to be decoded in a decoding phase of the point cloud can be greatly reduced, so that efficiency of decoding the point cloud can be improved.
In the embodiments of this disclosure, the encoding device may perform shift processing on to-be-encoded information to reduce the data volume required to be encoded by the encoding device in the encoding phase of the point cloud, so that efficiency of the encoding device in encoding the point cloud can be improved. The decoding device may perform shift reconstruction on information obtained through analysis to reduce the data volume required to be decoded by the decoding point in the decoding phase of the point cloud, so that efficiency of the decoding device in decoding the point cloud can be improved. The point cloud processing system described in the embodiments of this disclosure is intended to more clearly describe the technical solutions in the embodiments of this disclosure, and does not constitute a limitation on the technical solutions provided in the embodiments of this disclosure. A person of ordinary skill in the art may know that, with evolution of a system architecture and emergence of a new service scenario, the technical solutions provided in the embodiments of this disclosure are also applicable to a similar technical problem.
The following describes the point cloud processing solution provided in the embodiments of this disclosure in more details with reference to the accompanying drawings.
An embodiment of this disclosure provides a point cloud processing method. In the point cloud processing method, a decoding process of target encoding information at a decoder side is mainly described. The point cloud processing method may be performed by a computer device. The computer device may be the decoding device 602 in the foregoing point cloud processing system. As shown in
S701: Obtain encoded data of a point cloud.
S702: Analyze the encoded data to obtain shift data, the shift data being obtained by performing shift processing on target encoding information of the point cloud in an encoding process of the point cloud.
In operation S701 and operation S702, in a decoding phase of the point cloud, the encoded data of the point cloud may be obtained, and the encoded data may be analyzed to obtain the shift data. In other words, the encoded data may be obtained by encoding the shift data. The shift data may be obtained by performing shift processing on the target encoding information of the point cloud in the encoding process of the point cloud.
The target encoding information may be any point cloud related information required to be encoded in the encoding process of the point cloud. For example, in a geometry encoding process, if geometry predictive encoding is used, the target encoding information may be any residual information of any point in the point cloud (which may specifically be, for example, geometric residual information of any point in a specific direction); if geometry transform encoding is used, the target encoding information may be a transform coefficient of geometric information of any point in the point cloud (which may specifically be, for example, a transform coefficient of geometric information of any point in a specific direction); or if geometry predicting transform encoding is used, the target encoding information may be any a transform coefficient of geometric residual information of any point in the point cloud (which may specifically be, for example, a transform coefficient of geometric residual information of any point in a specific direction). For another example, in an attribute encoding process, if attribute predictive encoding is used, the target encoding information may be attribute residual information of any point in the point cloud; if attribute transform encoding is used, the target encoding information may be a transform coefficient of attribute information of any point in the point cloud; or if attribute predicting transform encoding is used, the target encoding information may be a transform coefficient of attribute residual information of any point in the point cloud. If run-length encoding is used in the attribute encoding process or the geometry encoding process, the target encoding information may be run-length information. The run-length information may be, for example, a zero-run-length value. The zero-run-length value may be a quantity of continuous points whose residual information or transform coefficients are 0 in the point cloud.
The encoded data may be generated based on an encoding mode. Analysis processes of the encoded data in different encoding modes are different. In other words, the encoding mode is obtained, and the encoded data is analyzed based on the encoding mode to obtain the shift data. For a determining process of the encoding mode, refer to the following descriptions. The encoding mode may be set by default by an encoder side and a decoder side. Alternatively, the encoding mode may be determined based on an encoding mode obtained by analyzing an encoding parameter set or an encoded bitstream of the point cloud. Alternatively, an encoder side and a decoder side may determine the encoding mode by using a default threshold parameter through mode determining information (which may be, for example, the target encoding information, an occupancy bit of the target encoding information, a QP of the target encoding information, or bounding box information) and the threshold parameter. Alternatively, an encoding parameter set or an encoded bitstream is analyzed to obtain a threshold parameter, and the encoding mode is determined based on mode determining information and the threshold parameter obtained through analysis.
For an application scope of the encoding mode in the point cloud, refer to the following descriptions. The encoding mode may be applied to the entire point cloud, that is, a same encoding mode is configured for each point in the point cloud. Alternatively, the encoding mode may be applied to a single point cloud slice, that is, a same encoding mode is configured for each point in a same point cloud slice, where the point cloud slice may include one or more macroblocks. Alternatively, the encoding mode may be applied to an entire macroblock, that is, a same encoding mode is configured for each point in a same macroblock. Alternatively, the encoding mode may be applied to an entire prediction tree, that is, a same encoding mode is configured for each point in a same prediction tree. Alternatively, the encoding mode may be applied to a single point in the point cloud. Alternatively, the encoding mode may be applied to a specific direction (corresponding to the geometry encoding process) of a single point.
The following mainly describes the analysis processes of the encoded data in different encoding modes.
(1) The encoding mode may include a first encoding mode. In the first encoding mode, whether the target encoding information is a specific value may be first determined. If the target encoding information is not the specific value, it may indicate that shift processing is performed on the target encoding information in the encoding process, and correspondingly, the shift data of the target encoding information may be analyzed. The shift data may include an encoding shift quotient and an encoding shift remainder of the target encoding information. In addition, before the encoding shift quotient of the target encoding information is analyzed, whether the encoding shift quotient of the target encoding information is a specific value may be first determined. If the encoding shift quotient is not the specific value, the encoding shift quotient of the target encoding information may be analyzed.
In an actual analysis process of the encoded data, whether the target encoding information is the specific value may be identified by an encoding information flag field. In other words, the encoded data may include the encoding information flag field, the encoding information flag field may be analyzed, and whether an analytic value of the encoding information flag field satisfies a shift analysis condition is determined, that is, whether the target encoding information is the specific value is determined If the analytic value of the encoding information flag field satisfies the shift analysis condition, it may indicate that the target encoding information is not the specific value. In this case, the encoded data may further include a shift quotient flag field. The shift quotient flag field may be configured for identifying whether the encoding shift quotient of the target encoding information is the specific value. The shift quotient flag field may be analyzed, and whether an analytic value of the shift quotient flag field satisfies an indirect analysis condition is determined, that is, whether the encoding shift quotient of the target encoding information is the specific value is determined. If the analytic value of the shift quotient flag field satisfies the indirect analysis condition, it may indicate that the encoding shift quotient of the target encoding information is not the specific value. In this case, the encoded data may further include an encoding result of the encoding shift quotient and an encoding result of the encoding shift remainder. The encoding result of the encoding shift quotient may be analyzed to obtain the encoding shift quotient. The encoding result of the encoding shift remainder may be analyzed to obtain the encoding shift remainder.
(2) The encoding mode may include a second encoding mode. In the second encoding mode, whether the target encoding information is a specific value may be first determined. If the target encoding information is not the specific value, it may indicate that shift processing is performed on the target encoding information in the encoding process. In this case, the shift data of the target encoding information may be analyzed. The shift data may include an encoding shift quotient and an encoding shift remainder of the target encoding information.
In an actual analysis process of the encoded data, whether the target encoding information is the specific value may be identified by an encoding information flag field. In other words, the encoded data may include the encoding information flag field, the encoding information flag field may be analyzed, and whether an analytic value of the encoding information flag field satisfies a shift analysis condition is determined, that is, whether the target encoding information is the specific value is determined If the analytic value of the encoding information flag field satisfies the shift analysis condition, it may indicate that the target encoding information is not the specific value. In this case, the encoded data may further include an encoding result of the encoding shift quotient and an encoding result of the encoding shift remainder. The encoding result of the encoding shift quotient may be analyzed to obtain the encoding shift quotient. The encoding result of the encoding shift remainder may be analyzed to obtain the encoding shift remainder.
(3) The encoding mode may include a third encoding mode. In the third encoding mode, the shift data of the target encoding information may be analyzed. The shift data of the target encoding information may include an encoding shift quotient and an encoding shift remainder of the target encoding information. Before the encoding shift quotient of the target encoding information is analyzed, whether the encoding shift quotient of the target encoding information is a specific value may be first determined. If the encoding shift quotient is not the specific value, the encoding shift quotient of the target encoding information is analyzed.
In an actual analysis process of the encoded data, whether the encoding shift quotient of the target encoding information is the specific value may be identified by a shift quotient flag field. In other words, the encoded data may include the shift quotient flag field, the shift quotient flag field may be analyzed, and whether an analytic value of the shift quotient flag field satisfies an indirect analysis condition is determined, that is, whether the encoding shift quotient of the target encoding information is the specific value is determined. If the analytic value of the shift quotient flag field satisfies the indirect analysis condition, it may indicate that the encoding shift quotient of the target encoding information is not the specific value. In this case, the encoded data may further include an encoding result of the encoding shift quotient and an encoding result of the encoding shift remainder. The encoding result of the encoding shift quotient may be analyzed to obtain the encoding shift quotient. The encoding result of the encoding shift remainder may be analyzed to obtain the encoding shift remainder.
(4) The encoding mode may include a fourth encoding mode. In the fourth encoding mode, whether the target encoding information is a specific value is not required to be determined, whether an encoding shift quotient of the target encoding information is a specific value is also not required to be determined, and the encoding shift quotient and an encoding shift remainder of the target encoding information may be directly analyzed. In other words, the encoded data may include an encoding result of the encoding shift quotient and an encoding result of the encoding shift remainder. The encoding result of the encoding shift quotient may be analyzed to obtain the encoding shift quotient. The encoding result of the encoding shift remainder may be analyzed to obtain the encoding shift remainder.
In both the first encoding mode and the second encoding mode, it is necessary to analyze the encoding information flag field and determine whether the analytic value of the encoding information flag field satisfies the shift analysis condition, that is, determine whether the target encoding information is the specific value. If the analytic value of the encoding information flag field satisfies the shift analysis condition, it may indicate that the target encoding information is not the specific value, and the encoding shift quotient and the encoding shift remainder of the target encoding information are required to be analyzed to reconstruct the target encoding information; or if the analytic value of the encoding information flag field does not satisfy the shift analysis condition, it may indicate that the target encoding information is the specific value, the encoding shift quotient and the encoding shift remainder of the target encoding information are not required to be analyzed, and reconstructed encoding information of the target encoding information may be directly determined to be the specific value. For details of analyzing the encoding information flag field and determining whether the analytic value of the encoding information flag field satisfies the shift analysis condition, refer to the following content.
A quantity of encoding information flag fields may be m1, each encoding information flag field corresponds to a different specific value, and m1 is a positive integer. An ith encoding information flag field in the m1 encoding information flag fields may be analyzed, i being a positive integer less than m1. If an analytic value of the it encoding information flag field is a first value (which may be, for example, 0), it may indicate that the target encoding information is not an it specific value, and an (i+1)th encoding information flag field may continue to be analyzed; or if an analytic value of the ith encoding information flag field is a second value (which may be, for example, 1), it may indicate that the target encoding information is an ith specific value corresponding to the ith encoding information flag field, the encoding information flag field does not satisfy the shift analysis condition, the encoding shift quotient and the encoding shift remainder of the target encoding information are not required to be analyzed, a subsequent encoding information flag field of the ith encoding information flag field may be stopped to be analyzed, and the reconstructed encoding information of the target encoding information may be directly determined to be the ith specific value.
When an m1th encoding information flag field is analyzed, if an analytic value of the m1th encoding information flag field is the first value, it may indicate that the target encoding information is not an m1th specific value corresponding to the m1th encoding information flag field, that is, it may be determined that the analytic value of the encoding information flag field satisfies the shift analysis condition, and the encoding shift quotient and the encoding shift remainder of the target encoding information are required to be analyzed; or if an analytic value of the m1th encoding information flag field is the second value, it may indicate that the target encoding information is an m1th specific value, the encoding information flag field does not satisfy the shift analysis condition, the encoding shift quotient and the encoding shift remainder of the target encoding information are not required to be analyzed, and the reconstructed encoding information of the target encoding information may be directly determined to be the m1th specific value. The ith specific value may be i−1, that is, the m1th specific value may be m1-1.
For example, when the quantity of encoding information flag fields is 1, if the analytic value of the encoding information flag field is 0, it may be determined that the target encoding information is not a specific value 0, the analytic value of the encoding information flag field satisfies the shift analysis condition, and the encoding shift quotient and the encoding shift remainder of the target encoding information are required to be analyzed; or if the analytic value of the encoding information flag field is 1, it may be determined that the target encoding information is a specific value 0, the analytic value of the encoding information flag field does not satisfy the shift analysis condition, the encoding shift quotient and the encoding shift remainder of the target encoding information are not required to be analyzed, and the reconstructed encoding information of the target encoding information may be directly determined to be the specific value 0.
For another example, when a quantity of encoding information flag fields is 3, if an analytic value of a first encoding information flag field is 0, it may be determined that the target encoding information is not a specific value 0, and a second encoding information flag field may continue to be analyzed; or if an analytic value of a first encoding information flag field is 1, it may be determined that the target encoding information is a specific value 0, the analytic value of the encoding information flag field does not satisfy the shift analysis condition, the encoding shift quotient and the encoding shift remainder of the target encoding information are not required to be analyzed, and the reconstructed encoding information of the target encoding information may be directly determined to be the specific value 0. If an analytic value of the second encoding information flag field is 0, it may be determined that the target encoding information is not a specific value 1, and a third encoding information flag field may continue to be analyzed; or if an analytic value of the second encoding information flag field is 1, it may be determined that the target encoding information is a specific value 1, the analytic value of the encoding information flag field does not satisfy the shift analysis condition, the encoding shift quotient and the encoding shift remainder of the target encoding information are not required to be analyzed, and the reconstructed encoding information of the target encoding information may be directly determined to be the specific value 1. If an analytic value of the third encoding information flag field is 0, it may be determined that the target encoding information is not a specific value 2, the analytic value of the encoding information flag field satisfies the shift analysis condition, and the encoding shift quotient and the encoding shift remainder of the target encoding information are required to be analyzed; or if an analytic value of the third encoding information flag field is 1, it may be determined that the target encoding information is a specific value 2, the analytic value of the encoding information flag field does not satisfy the shift analysis condition, the encoding shift quotient and the encoding shift remainder of the target encoding information are not required to be analyzed, and the reconstructed encoding information of the target encoding information may be directly determined to be the specific value 2.
In both the first encoding mode and the third encoding mode, it is necessary to analyze the shift quotient flag field and determine whether the analytic value of the shift quotient flag field satisfies the indirect analysis condition, that is, determine whether the encoding shift quotient of the target encoding information is the specific value. If the analytic value of the shift quotient flag field satisfies the indirect analysis condition, it may indicate that the encoding shift quotient is not the specific value, and the encoding shift quotient of the target encoding information is required to be analyzed; or if the analytic value of the shift quotient flag field does not satisfy the indirect analysis condition, it may indicate that the encoding shift quotient is the specific value, the encoding shift quotient of the target encoding information is not required to be analyzed, and the encoding shift quotient may be directly determined to be the specific value. Similar to determining of the shift analysis condition, for details of analyzing the shift quotient flag field to determine whether the analytic value of the shift quotient flag field satisfies the indirect analysis condition, refer to the following content.
A quantity of shift quotient flag fields may be m2, each shift quotient flag field corresponds to a different specific value, and m2 is a positive integer. A jth shift quotient flag field in the m2 shift quotient flag fields may be analyzed, j being a positive integer less than m2. If an analytic value of the jth shift quotient flag field is a first value (which may be, for example, 0), it may indicate that the encoding shift quotient is not a jth specific value corresponding to the jth shift quotient flag field, and a (j+1)th shift quotient flag field may continue to be analyzed; or if an analytic value of the jth shift quotient flag field is a second value (which may be, for example, 1), it may indicate that the encoding shift quotient is a jth specific value corresponding to the jth shift quotient flag field, the shift quotient flag field does not satisfy the indirect analysis condition, the encoding shift quotient of the target encoding information is not required to be analyzed, a subsequent shift quotient flag field of the jth shift quotient flag field may be stopped to be analyzed, and the encoding shift quotient may be directly determined to be the jth specific value.
When an m2th shift quotient flag field is analyzed, if an analytic value of the m2th shift quotient flag field is the first value, it may indicate that the encoding shift quotient is not an m2th specific value corresponding to the m2th shift quotient flag field, that is, it may be determined that the analytic value of the encoding information flag field satisfies the indirect analysis condition, and the encoding shift quotient of the target encoding information is required to be analyzed; or if an analytic value of the m2th shift quotient flag field is the second value, it may indicate that the encoding shift quotient is an m2th specific value corresponding to the m2th shift quotient flag field, the shift quotient flag field does not satisfy the indirect analysis condition, the encoding shift quotient of the target encoding information is not required to be analyzed, and the encoding shift quotient may be directly determined to be the m2th specific value. The jth specific value may be j−1, that is, the m2th specific value may be m2-1.
For example, when the quantity of shift quotient flag fields is 1, if the analytic value of the shift quotient flag field is 0, it may be determined that the encoding shift quotient is not a specific value 0, the analytic value of the shift quotient flag field satisfies the indirect analysis condition, and the encoding shift quotient of the target encoding information is required to be analyzed; or if the analytic value of the shift quotient flag field is 1, it may be determined that the encoding shift quotient is a specific value 0, the analytic value of the encoding information flag field does not satisfy the indirect analysis condition, the encoding shift quotient of the target encoding information is not required to be analyzed, and the encoding shift quotient may be directly determined to be the specific value 0.
For another example, when a quantity of shift quotient flag fields is 3, if an analytic value of a first shift quotient flag field is 0, it may be determined that the encoding shift quotient is not a specific value 0, and a second shift quotient flag field may continue to be analyzed; or if an analytic value of a first shift quotient flag field is 1, it may be determined that the encoding shift quotient is a specific value 0, the analytic value of the shift quotient flag field does not satisfy the indirect analysis condition, the encoding shift quotient of the target encoding information is not required to be analyzed, and the encoding shift quotient may be directly determined to be the specific value 0. If an analytic value of the second shift quotient flag field is 0, it may be determined that the encoding shift quotient is not a specific value 1, and a third shift quotient flag field may continue to be analyzed; or if an analytic value of the second shift quotient flag field is 1, it may be determined that the encoding shift quotient is a specific value 1, the analytic value of the shift quotient flag field does not satisfy the indirect analysis condition, the encoding shift quotient of the target encoding information is not required to be analyzed, and the encoding shift quotient may be directly determined to be the specific value 1. If an analytic value of the third shift quotient flag field is 0, it may be determined that the encoding shift quotient is not a specific value 2, the analytic value of the shift quotient flag field satisfies the indirect analysis condition, and the encoding shift quotient of the target encoding information is required to be analyzed; or if an analytic value of the third shift quotient flag field is 1, it may be determined that the encoding shift quotient is a specific value 2, the analytic value of the shift quotient flag field does not satisfy the indirect analysis condition, the encoding shift quotient of the target encoding information is not required to be analyzed, and the encoding shift quotient may be directly determined to be the specific value 2.
In this case, after the encoding shift quotient of the target encoding information is obtained through analysis, the encoding shift quotient may be updated with a target value associated with the m2th specific value. Update herein may specifically mean that an updated encoding shift quotient is equal to the encoding shift quotient before update plus the target value. The target value may specifically be the m2th specific value plus 1. For example, when the quantity of shift quotient flag fields is 1, the shift quotient flag field is configured for determining whether the encoding shift quotient is the specific value 0, and if the analytic value of the shift quotient flag field satisfies the indirect analysis condition, that is, the encoding shift quotient is not the specific value 0, the encoding shift quotient may be updated with the encoding shift quotient obtained through analysis plus 1 (0+1).
In the first encoding mode to the fourth encoding mode, the encoding shift quotient of the target encoding information may be analyzed mainly in any one of the following two modes. In a first mode, the encoding result of the encoding shift quotient may be analyzed based on an exponential-Golomb encoding mode to obtain the encoding shift quotient. An order for the exponential-Golomb encoding mode herein may be a K1th order, K1 being a nonnegative integer. In a second mode, the encoding result of the encoding shift quotient may be analyzed based on a bit encoding mode to obtain the encoding shift quotient.
For the second mode (that is, the bit encoding mode) for analyzing the encoding shift quotient, the encoding result of the encoding shift quotient may include an encoding result of an occupancy bit of the encoding shift quotient and a code of each bit occupied by the encoding shift quotient. A process of analyzing the encoding result of the encoding shift quotient based on the bit encoding mode to obtain the encoding shift quotient may include: analyzing the encoding result of the occupancy bit of the encoding shift quotient to obtain the occupancy bit of the encoding shift quotient; analyzing the code of each bit occupied by the encoding shift quotient to obtain a value of the code of each bit occupied by the encoding shift quotient; and reconstructing the encoding shift quotient based on the value of the code of each bit occupied by the encoding shift quotient.
The occupancy bit of the encoding shift quotient may be obtained through analysis in any one of the following modes.
First, the bit encoding mode: The encoding result of the occupancy bit may be analyzed based on the bit encoding mode to obtain the occupancy bit. Specifically, the encoding result of the occupancy bit may include a code of each bit occupied by the occupancy bit, and the code of each bit occupied by the occupancy bit may be analyzed bit by bit to reconstruct the occupancy bit. Second, the exponential-Golomb encoding mode: The encoding result of the occupancy bit may be analyzed based on the exponential-Golomb encoding mode to obtain the occupancy bit of the encoding shift quotient. The order for the exponential-Golomb encoding mode herein may be a K3th order, K3 being a nonnegative integer. Third, a shift encoding mode: the encoding result of the occupancy bit may be analyzed based on the shift encoding mode to obtain the occupancy bit of the encoding shift quotient. Specifically, the encoding result of the occupancy bit may include an encoding result of an occupancy shift quotient of the occupancy bit and an encoding result of an occupancy shift remainder, and the occupancy shift quotient and the occupancy shift remainder may be obtained by performing shift processing on the occupancy bit. Analyzing the encoding result of the occupancy bit based on the shift encoding mode to obtain the occupancy bit of the encoding shift quotient may specifically include: analyzing the encoding result of the occupancy shift quotient to obtain the occupancy shift quotient; analyzing the encoding result of the occupancy shift remainder to obtain the occupancy shift remainder; and performing shift reconstruction processing on the occupancy shift quotient and the occupancy shift remainder to obtain the occupancy bit of the encoding shift quotient.
The occupancy shift quotient and the occupancy shift remainder may be obtained through analysis in the bit encoding mode or the exponential-Golomb encoding mode. Specifically, for the occupancy shift quotient, the encoding result of the occupancy shift quotient may be analyzed based on the bit encoding mode, the encoding result of the occupancy shift quotient may include a code of each bit occupied by the occupancy shift quotient, and the code of each bit occupied by the occupancy shift quotient may be analyzed bit by bit to reconstruct the occupancy shift quotient; or the encoding result of the occupancy shift quotient may be analyzed based on the exponential-Golomb encoding mode to obtain the occupancy shift quotient, where the order for the exponential-Golomb encoding mode herein may be a K4th order, K4 being a nonnegative integer. For the occupancy shift remainder, the encoding result of the occupancy shift remainder may be analyzed based on the bit encoding mode, the encoding result of the occupancy shift remainder may include a code of each bit occupied by the occupancy shift remainder, and the code of each bit occupied by the occupancy shift remainder may be analyzed bit by bit to reconstruct the occupancy shift remainder; or the encoding result of the occupancy shift remainder may be analyzed based on the exponential-Golomb encoding mode to obtain the occupancy shift remainder, where the order for the exponential-Golomb encoding mode herein may be a K5th order, K5 being a nonnegative integer.
A process of performing shift reconstruction processing on the occupancy shift quotient and the occupancy shift remainder to obtain the occupancy bit of the encoding shift quotient may be performed based on a shift bit count (the shift bit count herein may be a first shift bit count). In other words, shift processing (which may specifically be shift to left) may be performed on the occupancy shift quotient based on the shift bit count to obtain a shifted occupancy shift quotient, and then the shifted occupancy shift quotient and the occupancy shift remainder may be added to obtain a reconstructed occupancy bit.
In the first encoding mode to the fourth encoding mode, the encoding shift remainder of the target encoding information may be analyzed mainly in any one of the following two modes. First, the bit encoding mode: The encoding result of the encoding shift remainder may be analyzed based on the bit encoding mode, the encoding result of the encoding shift remainder may include a code of each bit occupied by the encoding shift remainder, and the code of each bit occupied by the encoding shift remainder may be analyzed bit by bit to reconstruct the encoding shift remainder. Second, the exponential-Golomb encoding mode: The coding result of the coding shift remainder may be analyzed based on the exponential-Golomb coding mode to obtain the coding shift remainder, where the order for the exponential-Golomb encoding mode herein may be a K2th order, K2 being a nonnegative integer.
S703: Perform shift reconstruction on the shift data to obtain the reconstructed encoding information of the target encoding information.
After the shift data is obtained through analysis, shift reconstruction may be performed on the shift data to obtain the reconstructed encoding information of the target encoding information. Specifically, the shift data may include the encoding shift quotient and the encoding shift remainder. The shift bit count (the shift bit count herein may be a second shift bit count) may be obtained. Shift processing (which may specifically be shift to left) may be performed on the encoding shift quotient based on the shift bit count to obtain a shifted encoding shift quotient. Then, the shifted encoding shift quotient and the encoding shift remainder are added to obtain the reconstructed encoding information of the target encoding information.
The shift bit count (which may be the foregoing first shift bit count or the foregoing second shift bit count) may be set by default by the encoder side and the decoder side. Alternatively, the shift bit count may be obtained by analyzing the encoding parameter set or the encoded bitstream of the point cloud. Alternatively, the shift bit count may be determined based on a shift bit count threshold parameter. Specifically, the shift bit count may be determined based on a magnitude relationship between shift bit count determining information and a shift bit count threshold. When the shift bit count determining information is less than or equal to the shift bit count threshold, it may be determined that the shift bit count is the first shift bit count (which may be, for example, two bits); or when the shift bit count determining information is greater than the shift bit count threshold, it may be determined that the shift bit count is the second shift bit count (which may be, for example, one bit). The shift bit count determining information may be the order for the exponential-Golomb encoding mode. For example, in an attribute decoding process, the shift bit count determining information may be an order used when a reflectivity attribute is analyzed based on the exponential-Golomb encoding mode, or may be an order used when a color attribute is analyzed based on the exponential-Golomb encoding mode. The shift bit count threshold may be set by default by the encoder side and the decoder side, or may be obtained by analyzing the encoding parameter set or the encoded bitstream of the point cloud.
For the first encoding mode and the second encoding mode, shift reconstruction may be performed on the shift data to obtain initial reconstructed information of the target encoding information, and the initial reconstructed information may be updated with a reference value associated with the m1th specific value, to obtain the reconstructed encoding information of the target encoding information. Update herein may specifically mean that the reconstructed encoding information of the target encoding information is equal to the initial reconstructed information of the target encoding information plus the reference value. The reference value may specifically be the m1th specific value plus 1. For example, when the quantity of encoding information flag fields is 1, the encoding information flag field is configured for determining whether the target encoding information is the specific value 0, and if the analytic value of the encoding information flag field satisfies the shift analysis condition, that is, the target encoding information is not the specific value 0, the initial reconstructed information of the target encoding information obtained through analysis may be added with 1 (0+1) to obtain the reconstructed encoding information of the target encoding information.
The analysis process of the encoded data relates to an exponential-Golomb encoding mode-based analysis process. Therefore, the order for the exponential-Golomb encoding mode is required to be confirmed. The order for the exponential-Golomb encoding mode may be determined in any one of the following manners: The encoder side and the decoder side may set by default the order for the exponential-Golomb encoding mode, the encoded bitstream or the encoding parameter set of the point cloud may be analyzed to obtain the order for the exponential-Golomb encoding mode, or the order for the exponential-Golomb encoding mode may be determined based on a data feature of the target encoding information.
The manner of determining the order for the exponential-Golomb encoding mode based on the data feature of the target encoding information may specifically include any one of the following.
(1) The order for the exponential-Golomb encoding mode is queried based on dynamic range information of the point cloud.
The data feature of the target encoding information may include dynamic range information of a point cloud that the target encoding information belongs to. The point cloud that the target encoding information belongs to may be the entire point cloud, a point cloud slice, a current macroblock, a current prediction tree, or the like. The dynamic range information may be determined based on precision information of the point cloud. The precision information is a quantity of bits to which information in the point cloud may be accurate. A dynamic range parameter may be obtained by performing an exponent operation on the precision information. For example, the precision information of the information in the point cloud is 10 bits, and the dynamic range parameter may be 2{circumflex over ( )}10.
After the dynamic range information of the point cloud that the target encoding information belongs to is obtained, a query index value may be calculated based on the dynamic range information, and then the order for the exponential-Golomb encoding mode may be queried in a query table based on the query index value. The query table may be written by experience. A length of the query table is correlated with the precision information of the point cloud. The query table includes a plurality of index values and orders corresponding to the index values. Therefore, an order corresponding to the query index value may be quickly found from the query table based on the query index value as the order for the exponential-Golomb encoding mode.
A calculation process of the query index value may further be correlated with a quantization step of the point cloud. The dynamic range parameter may be calculated based on the dynamic range information and the quantization step, and then the query index value may be calculated based on the dynamic range parameter. For details, refer to the following formula:
Index represents the query index value. B′ represents the dynamic range parameter.
(2) The order for the exponential-Golomb encoding mode is adaptively determined.
Adaptively determining the order for the exponential-Golomb encoding mode may specifically mean determining an initial order, and adjusting the initial order or a current order based on the data feature of the target encoding information to obtain the order for the exponential-Golomb encoding mode. The data feature of the target encoding information may include decoding information of a previous decoded point of a to-be-decoded point that the target encoding information belongs to. The previous decoded point may be a decoded point sorted before the to-be-decoded point in decoding. The decoding information of the previous decoded point may be information that is obtained through analysis and that is correlated with the previous decoded point, for example, geometric residual information and attribute residual information of the previous decoded point.
First, the initial order golombNum may be obtained, and an order adjustment threshold is determined based on the initial order. The order adjustment threshold may include an order adjustment upper limit golombNumUp and an order adjustment lower limit golombNumLow. For a first determining manner for the order adjustment upper limit golombNumUp and the order adjustment lower limit golombNumLow, refer to the following formulas:
For a second determining manner for the order adjustment upper limit golombNumUp and the order adjustment lower limit golombNumLow, refer to the following formulas:
Second, the initial order or the current order may be adjusted based on a magnitude relationship between the decoding information of the previous decoded point and the order adjustment threshold, to obtain the order for the exponential-Golomb encoding mode. Specifically, a statistical eigenvalue of the decoding information of the previous decoded point may be determined. The previous decoded point may be a previous decoded point adjacent to the to-be-decoded point, and a statistical eigenvalue A′ may be decoding information of the adjacent previous decoded point. Alternatively, the order for the exponential-Golomb encoding mode is adaptively adjusted at an interval of L points, and a statistical eigenvalue A′ may be an average value of decoding information of L previous decoded points. Alternatively, the order for the exponential-Golomb encoding mode is adaptively adjusted at an interval of L points, and a statistical eigenvalue A′ may be an average value of non-zero decoding information in decoding information of L previous decoded points. This is not limited in this embodiment of this disclosure.
Then, the initial order or the current order may be adjusted based on a magnitude relationship between the statistical eigenvalue and the order adjustment threshold to obtain the order for the exponential-Golomb encoding mode. The current order may be an order determined last time for the exponential-Golomb encoding mode. Adjusting the initial order based on the magnitude relationship between the statistical eigenvalue and the order adjustment threshold to obtain the order for the exponential-Golomb encoding mode may include: if the statistical eigenvalue is greater than the order adjustment upper limit, the order for the exponential-Golomb encoding mode is equal to the initial order minus an update value (which may be, for example, 1); or if the statistical eigenvalue is less than the order adjustment lower limit, the order for the exponential-Golomb encoding mode is equal to the initial order plus an update value (which may be, for example, 1). For details, refer to the following formulas:
A′ represents the statistical eigenvalue. golombNumLow represents the order adjustment lower limit. golombNumUp represents the order adjustment upper limit. golombNum represents the initial order. K represents the order for the exponential-Golomb encoding mode.
Adjusting the current order based on the magnitude relationship between the statistical eigenvalue and the order adjustment threshold to obtain the order for the exponential-Golomb encoding mode may include: if the statistical eigenvalue is greater than the order adjustment upper limit, the order for the exponential-Golomb encoding mode is equal to the initial order minus an update value (which may be, for example, 1); or if the statistical eigenvalue is less than the order adjustment lower limit, the order for the exponential-Golomb encoding mode is equal to the initial order plus an update value (which may be, for example, 1). For details, refer to the following formulas:
A′ represents the statistical eigenvalue. golombNumLow represents the order adjustment lower limit. golombNumUp represents the order adjustment upper limit. golombNum represents the current order. K represents the order for the exponential-Golomb encoding mode.
Third, after the order for the exponential-Golomb encoding mode is determined, an order resetting threshold may be further obtained. If it is determined based on the order resetting threshold that the order for the exponential-Golomb encoding mode satisfies an order resetting condition, the order for the exponential-Golomb encoding mode is required to be reset; or if it is determined based on the order resetting threshold that the order for the exponential-Golomb encoding mode does not satisfy an order resetting condition, the order for the exponential-Golomb encoding mode may remain unchanged. The order resetting threshold may include a first order resetting threshold t1 or a second order resetting threshold t2. That the order for the exponential-Golomb encoding mode satisfies the order resetting condition may mean: the order for the exponential-Golomb encoding mode is less than (less than or equal to) the first order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may be reset to a first reference order t3; or the order for the exponential-Golomb encoding mode is greater than (greater than or equal to) the second order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may be reset to a second reference order t4. Both the first reference order t3 and the second reference order t4 may be set to corresponding initial orders. For details, refer to the following formulas:
That the order for the exponential-Golomb encoding mode does not satisfy the order resetting condition may mean: the order for the exponential-Golomb encoding mode is greater than or equal to (greater than) the first order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may remain unchanged; or the order for the exponential-Golomb encoding mode is less than or equal to (greater than) the second order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may remain unchanged.
In addition, if the analysis process of the encoded data relates to a plurality of exponential-Golomb encoding mode-based analysis processes, orders for respective exponential-Golomb encoding modes are independent of or associated with each other. Association with each other may include any one of the following cases: The orders for the respective exponential-Golomb encoding modes are the same; or the orders for the respective exponential-Golomb encoding modes are associated through an offset parameter (offset). For example, the foregoing five orders K1, K2, K3, K4, and K5 for the exponential-Golomb encoding mode may be associated through the offset parameter (offset): K2=K1-offset, K3=K1-offset, K4=K1-offset, and K5=K1-offset. For another example, K2=K1-offset, K3=K2-offset, K4=K3-offset, K5=K4-offset.
In this embodiment of this disclosure, after the encoded data of the point cloud is obtained, the encoded data is analyzed to obtain the shift data. The shift data is obtained by performing shift processing on the target encoding information of the point cloud in the encoding process of the point cloud. Shift reconstruction is performed on the shift data to obtain the reconstructed encoding information of the target encoding information. According to this embodiment of this disclosure, shift processing is performed on the target encoding information, so that a data volume required to be decoded in a decoding phase of the point cloud can be reduced, and efficiency of decoding the point cloud can be improved.
The following describes, with reference to a syntax table, an application of the point cloud processing solution provided in the embodiments of this disclosure to an actual point cloud decoding process.
Parameters involved in the syntax table 1 are first explained herein.
nodeIdx: It indicates a current point in the point cloud.
k: It indicates a kth direction of the current point.
ptn_residual_abs_eq0_flag (encoding information flag field): It indicates whether the target encoding information is 0. When this field is set to 1, it indicates that the target encoding information is 0. When this field is set to 0, it indicates that the target encoding information is not 0 (and greater than 0).
ptn_residual_abs_remainingptn: It indicates the encoding shift remainder obtained by performing shift processing on the target encoding information.
ptn_residual_abs_half_eq0_flag (shift quotient flag field): It indicates whether the encoding shift quotient obtained by performing shift processing on the target encoding information is 0. When this field is set to 1, it indicates that the encoding shift quotient is 0. When this field is set to 0, it indicates that the encoding shift quotient is not 0 (and greater than 0).
ptn_residual_abs_numbits (occupancy bit field): It indicates a bit occupied by a current to-be-encoded value.
ptn_numbits_remaining (occupancy remainder field): It indicates an occupancy shift remainder obtained by performing shift processing on the occupancy bit.
ptn_residual_abs_value_per (bit value field): It indicates a value of each bit in the occupancy bit.
It may be learned that the syntax table 1 describes an analysis process (corresponding to the first encoding mode) of the target encoding information of the point cloud with an example in which the target encoding information is a residual value of the current point in the point cloud in the kth direction. For details, refer to the following descriptions.
(1) Whether ptn_residual_abs_eq0_flag[k] is 0 is analyzed. If ptn_residual_abs_eq0_flag[k] is 0, analysis is continued; or if ptn_residual_abs_eq0_flag[k] is not 0, it may be determined that the residual value A[k] of the current point in the kth direction is 0.
(2) If ptn_residual_abs_eq0_flag[k] is 0, ptn_residual_abs_remaining[k] is analyzed to obtain an encoding shift remainder A2[k] of the residual value of the current point in the kth direction.
(3) Whether ptn_residual_abs_half_eq0_flag[k] is 0 is analyzed. If ptn_residual_abs_half_eq0_flag[k] is 0, analysis is continued; or if ptn_residual_abs_half_eq0_flag[k] is not 0, it may be determined that an encoding shift quotient A1[k] of the residual value of the current point in the kth direction is 0.
(4) If ptn_residual_abs_half_eq0_flag[k] is 0, the encoding shift quotient A1[k] of the residual value of the current point in the kth direction may be analyzed based on the bit encoding mode, that is, ptn_residual_abs_numbits[k] and ptn_residual_abs_value_per[k][j] are analyzed to obtain the encoding shift quotient A1[k] of the residual value of the current point in the kth direction.
(5) The residual value A[k] of the current point in the kth direction is reconstructed through the encoding shift quotient A1[k] and the encoding shift remainder A2[k]:A[k]=A1[k]<<s1+A2[k].
It may be learned that the syntax table 2 describes an analysis process (corresponding to the second encoding mode) of the target encoding information of the point cloud with an example in which the target encoding information is a residual value of the current point in the point cloud in the kth direction. For details, refer to the following descriptions.
(1) Whether ptn_residual_abs_eq0_flag[k] is 0 is analyzed. If ptn_residual_abs_eq0_flag[k] is 0, analysis is continued; or if ptn_residual_abs_eq0_flag[k] is not 0, it may be determined that the residual value A[k] of the current point in the kth direction is 0.
(2) If ptn_residual_abs_eq0_flag[k] is 0, ptn_residual_abs_remaining[k] is analyzed to obtain an encoding shift remainder A2[k] of the residual value of the current point in the kth direction.
(3) An encoding shift quotient A1[k] of the residual value of the current point in the kth direction is analyzed based on the bit encoding mode, that is, ptn_residual_abs_numbits[k] and ptn_residual_abs_value_per[k][j] are analyzed to obtain the encoding shift quotient A1[k] of the residual value of the current point in the kth direction.
(4) The residual value A[k] of the current point in the kth direction is reconstructed through the encoding shift quotient A1[k] and the encoding shift remainder A2[k]:A[k]=A1[k]<<s1+A2[k].
It may be learned that the syntax table 3 describes an analysis process (corresponding to the third encoding mode) of the target encoding information of the point cloud with an example in which the target encoding information is a residual value of the current point in the point cloud in the kth direction. For details, refer to the following descriptions.
(1) ptn_residual_abs_remaining[k] is analyzed to obtain an encoding shift remainder A2[k] of the residual value of the current point in the kth direction.
(2) Whether ptn_residual_abs_half_eq0_flag[k] is 0 is analyzed. If ptn_residual_abs_half_eq0_flag[k] is 0, analysis is continued; or if ptn_residual_abs_half_eq0_flag[k] is not 0, it may be determined that an encoding shift quotient A1[k] of the residual value of the current point in the kth direction is 0.
(3) If ptn_residual_abs_half_eq0_flag[k] is 0, the encoding shift quotient A1[k] of the residual value of the current point in the kth direction may be analyzed based on the bit encoding mode, that is, ptn_residual_abs_numbits[k] and ptn_residual_abs_value_per[k][j] are analyzed to obtain the encoding shift quotient A1[k] of the residual value of the current point in the kth direction.
(4) The residual value A[k] of the current point in the kth direction is reconstructed through the encoding shift quotient A1[k] and the encoding shift remainder A2[k]:A[k]=A1[k]<<s1+A2[k].
It may be learned that the syntax table 4 describes an analysis process (corresponding to the fourth encoding mode) of the target encoding information of the point cloud with an example in which the target encoding information is a residual value of the current point in the point cloud in the kth direction. For details, refer to the following descriptions.
(1) ptn_residual_abs_remaining[k] is analyzed to obtain an encoding shift remainder A2[k] of the residual value of the current point in the kth direction.
(2) An encoding shift quotient A1[k] of the residual value of the current point in the kth direction is analyzed based on the bit encoding mode, that is, ptn_residual_abs_numbits[k] and ptn_residual_abs_value_per[k][j] are analyzed to obtain the encoding shift quotient A1[k] of the residual value of the current point in the kth direction.
(3) The residual value A[k] of the current point in the kth direction is reconstructed through the encoding shift quotient A1[k] and the encoding shift remainder A2[k]:A[k]=A1[k]<<s1+A2[k].
Parameters involved in the syntax table 5 are first explained herein.
zero_run_length_equal_zero (a flag that a zero-mun-length value is 0, which may be used as an encoding information flag field):
It is a binary variable. A value “1” indicates that the zero-run-length value is 0. A value “0” indicates that the zero-run-length value is not 0. When this syntactic element is not in the bitstream, a value of the syntactic element defaults to 0.
zero_run_length_equal_one (a flag that the zero-run-length value is 1, which may be used as an encoding information flag field):
It is a binary variable. A value “1” indicates that the zero-run-length value is 1. A value “0” indicates that the zero-run-length value is not 1. When this syntactic element is not in the bitstream, a value of the syntactic element defaults to 0.
zero_run_length_equal_two (a flag that the zero-run-length value is 2, which may be used as an encoding information flag field):
It is a binary variable. A value “1” indicates that the zero-run-length value is 2. A value “0” indicates that the zero-run-length value is not 2. When this syntactic element is not in the bitstream, a value of the syntactic element defaults to 0.
zero_run_length_minus3_parity (a flag indicating parity of the zero-run-length value minus 3):
It is a binary variable. A value “0” indicates that the zero-run-length value minus 3 is even. A value “1” indicates that the zero-run-length value minus 3 is odd.
zero_run_length_minus3_parityH (a flag indicating high-bit parity of the zero-run-length value minus 3):
It is a binary variable. A value “0” indicates that the zero-run-length value minus 3 divided by 2 is even. A value “1” indicates that the zero-run-length value minus 3 divided by 2 is odd.
zero_run_length_minus3_div2 (the zero-run-length value minus 3 divided by 2):
It is an unsigned integer. It represents the zero-run-length value minus 3 divided by 2 (that is, shifting to left by one bit). When this syntactic element is not in the bitstream, a value of the syntactic element defaults to 0.
zero_run_length_minus3_div4 (the zero-run-length minus 3 divided by 4):
It is an unsigned integer. It represents the zero-run-length value minus 3 divided by 4 (that is, shifting to right by two bits). When this syntactic element is not in the bitstream, a value of the syntactic element defaults to 0.
It may be learned that the syntax table 5 describes an analysis process of the target encoding information of the point cloud with an example in which the target encoding information is the zero-run-length value. For details, refer to the following descriptions.
(1) zero_run_length_equal_zero is analyzed. If zero_run_length_equal_zero=0, zero_run_length_equal_one continues to be analyzed; or if zero_run_length_equal_zero=1, it indicates that the zero-run-length value is 0.
(2) zero_run_length_equal_one is analyzed. If zero_run_length_equal_one=0, zero_run_length_equal_two continues to be analyzed; or if zero_run_length_equal_one=1, it indicates that the zero-run-length value is 1.
(3) zero_run_length_equal_two is analyzed. If zero_run_length_equal_two=0, zero_run_length_minus3_parity continues to be analyzed; or if zero_run_length_equal_two=1, it indicates that the zero-run-length value is 2.
(4) Whether useGolomb is true or false is determined.
(5) If useGolomb=true, it indicates that the zero-run-length value is shifted to right by two bits, zero_run_length_minus3_parity is analyzed as a low-bit value of the encoding shift remainder of the zero-run-length value, zero_run_length_minus3_parityH is analyzed as a high-bit value of the encoding shift remainder of the zero-run-length value, and zero_run_length_minus3_div4 is analyzed as an encoding shift quotient of the zero-run-length value. The zero-run-length value zero_run_length may be reconstructed through the encoding shift quotient of the zero-run-length value, the high-bit value of the encoding shift remainder, and the low-bit value of the encoding shift remainder:
zero_run_length=zero_run_length_minus3_div4<<2+zero_run_length_minus3_parityH+zero_run_length_minus3_parity.
(6) If useGolomb=false, it indicates that the zero-run-length value is shifted to right by one bit, zero_run_length_minus3_parity is analyzed as an encoding shift remainder of the zero-run-length value, and zero_run_length_minus3_div2 is analyzed as an encoding shift quotient of the zero-run-length value. The zero-run-length value zero_run_length may be reconstructed through the encoding shift quotient and the encoding shift remainder of the zero-run-length value: zero_run_length=zero_run_length_minus3_div2<<1+zero_run_length_minus3_parity.
Different parameters from those in the syntax table 5 in the syntax table 6 are first explained herein.
zero_run_length_minus3_mod 4 (a flag of the zero-run-length value minus 3 mod 4):
It is an unsigned integer, and represents a value of the zero-run-length value minus 3 mod 4, that is, an encoding shift remainder obtained by shifting the zero-run-length value minus 3 to right by two bits (a two-bit binary variable may alternatively be configured for representing a high bit and a low bit).
zero_run_length_minus3_mod 2 (a flag of the zero-run-length value minus 3 mod 4):
It is an unsigned integer, and represents a value of the zero-run-length value minus 3 mod 2, that is, an encoding shift remainder obtained by shifting the zero-run-length value minus 3 to right by one bit.
It may be learned that the syntax table 6 describes an analysis process of the target encoding information of the point cloud with an example in which the target encoding information is the zero-run-length value. For details, refer to the following descriptions.
(1) zero_run_length_equal_zero is analyzed. If zero_run_length_equal_zero=0, zero_run_length_equal_one continues to be analyzed; or if zero_run_length_equal_zero=1, it indicates that the zero-run-length value is 0.
(2) zero_run_length_equal_one is analyzed. If zero_run_length_equal_one=0, zero_run_length_equal_two continues to be analyzed; or if zero_run_length_equal_one=1, it indicates that the zero-run-length value is 1.
(3) zero_run_length_equal_two is analyzed. If zero_run_length_equal_two=0, whether useGolomb is true or false is determined; or if zero_run_length_equal_two=1, it indicates that the zero-run-length value is 2.
(4) If useGolomb=true, it indicates that the zero-run-length value is shifted to right by two bits, zero_run_length_minus3_mod 4 is analyzed as an encoding shift remainder of the zero-run-length value, and zero_run_length_minus3_div4 is analyzed as an encoding shift quotient of the zero-run-length value. The zero-run-length value zero_run_length may be reconstructed through the encoding shift quotient and the encoding shift remainder of the zero-run-length value: zero_run_length=zero_run_length_minus3_div4<<2+zero_run_length_minus3_mod 4.
(5) If useGolomb=false, it indicates that the zero-run-length value is shifted to right by one bit, zero_run_length_minus3_mod 2 is analyzed as an encoding shift remainder of the zero-run-length value, and zero_run_length_minus3_div2 is analyzed as an encoding shift quotient of the zero-run-length value. The zero-run-length value zero_run_length may be reconstructed through the encoding shift quotient and the encoding shift remainder of the zero-run-length value: zero_run_length=zero_run_length_minus3_div2<<1+zero_run_length_minus3_mod 2.
In the syntax table 5 and the syntax table 6, whether useGolomb is true or false is required to be determined. Whether useGolomb is true or false is correlated with a shift bit count of the zero-run-length value. When useGolomb is true, the shift bit count of the zero-run-length value may be the first shift bit count (which may be, for example, two bits); or when useGolomb is false, the shift bit count of the zero-run-length value may be the second shift bit count (which may be, for example, one bit). For details of determining whether useGolomb is true or false in the attribute decoding process, refer to the following descriptions.
RefGolombNum represents the order used when the reflectivity attribute is encoded based on the exponential-Golomb encoding mode. RefGolombNum may be used as the shift bit count determining information. A bit count threshold thval may be used as the shift bit count threshold. If RefGolombNum≤the shift bit count threshold thval, useGolomb=true, and the shift bit count of the zero-run-length value is the first shift bit count; or if RefGolombNum>the shift bit count threshold thval, useGolomb=false, and the shift bit count of the zero-run-length value is the second shift bit count. The shift bit count threshold thval may be correlated with a specific attribute encoding mode for attribute decoding. For example, when the attribute encoding mode for attribute decoding is predicting transform encoding, a value of the shift bit count threshold thval may be 1; or when the attribute encoding mode for attribute decoding is transform encoding, a value of the shift bit count threshold thval may be 2.
Similarly, ColorGolombNum represents the order used when the color attribute is encoded based on the exponential-Golomb encoding mode. ColorGolombNum may be used as the shift bit count determining information. A bit count threshold thval may be used as the shift bit count threshold. If ColorGolombNum≤the shift bit count threshold thval, useGolomb=true, and the shift bit count of the zero-run-length value is the first shift bit count; or if ColorGolombNum>the shift bit count threshold thval, useGolomb=false, and the shift bit count of the zero-run-length value is the first shift bit count. The shift bit count threshold thval may be correlated with a specific attribute encoding mode for attribute decoding. For example, when the attribute encoding mode for attribute decoding is predicting transform encoding, a value of the shift bit count threshold thval may be 1; or when the attribute encoding mode for attribute decoding is transform encoding, a value of the shift bit count threshold thval may be 2.
It may be learned that the syntax table 7 describes an analysis process of the target encoding information of the point cloud with an example in which the target encoding information is the zero-run-length value. For details, refer to the following descriptions.
(1) zero_run_length_equal_zero is analyzed. If zero_run_length_equal_zero=0, zero_run_length_equal_one continues to be analyzed; or if zero_run_length_equal_zero=1, it indicates that the zero-run-length value is 0.
(2) zero_run_length_equal_one is analyzed. If zero_run_length_equal_one=0, zero_run_length_equal_two continues to be analyzed; or if zero_run_length_equal_one=1, it indicates that the zero-run-length value is 1.
(3) zero_run_length_equal_two is analyzed. If zero_run_length_equal_two=1, it indicates that the zero-run-length value is 2.
(4) If zero_run_length_equal_two=0, zero_run_length_minus3_mod 2 is analyzed as an encoding shift remainder of the zero-run-length value, and zero_run_length_minus3_div2 is analyzed as an encoding shift quotient of the zero-run-length value. The zero-run-length value zero_run_length may be reconstructed through the encoding shift quotient and the encoding shift remainder of the zero-run-length value:
An embodiment of this disclosure provides a point cloud processing method. In the point cloud processing method, an encoding process of target encoding information at an encoder side is mainly described. The point cloud processing method may be performed by a computer device. The computer device may be the encoding device 601 in the foregoing point cloud processing system. As shown in
S801: Obtain target encoding information of a point cloud.
The target encoding information may be any point cloud related information required to be encoded in an encoding process of the point cloud. For example, in a geometry encoding process, if geometry predictive encoding is used, the target encoding information may be any residual information of any point in the point cloud (which may specifically be, for example, geometric residual information of any point in a specific direction); if geometry transform encoding is used, the target encoding information may be a transform coefficient of geometric information of any point in the point cloud (which may specifically be, for example, a transform coefficient of geometric information of any point in a specific direction); or if geometry predicting transform encoding is used, the target encoding information may be any a transform coefficient of geometric residual information of any point in the point cloud (which may specifically be, for example, a transform coefficient of geometric residual information of any point in a specific direction). For another example, in an attribute encoding process, if attribute predictive encoding is used, the target encoding information may be attribute residual information of any point in the point cloud; if attribute transform encoding is used, the target encoding information may be a transform coefficient of attribute information of any point in the point cloud; or if attribute predicting transform encoding is used, the target encoding information may be a transform coefficient of attribute residual information of any point in the point cloud. If run-length encoding is used in the attribute encoding process or the geometry encoding process, the target encoding information may be run-length information. The run-length information may be, for example, a zero-run-length value. The zero-run-length value may be a quantity of continuous points whose residual information or transform coefficients are 0 in the point cloud.
S802: Perform shift processing on the target encoding information to obtain shift data of the target encoding information.
After the target encoding information of the point cloud is obtained, shift processing may be performed on the target encoding information to obtain the shift data of the target encoding information. Shift processing may be performed on the target encoding information based on an encoding mode. Shift processing processes of the target encoding information in different encoding modes are different. In other words, the encoding mode may be obtained, and shift processing is performed on the target encoding information based on the encoding mode to obtain the shift data of the target encoding information.
For a determining process of the encoding mode, refer to the following descriptions. The encoding mode may be set by default by an encoder side and a decoder side. Alternatively, the encoding mode may be determined based on encoding mode information set by an encoder side, where the encoding mode information is written into an encoding parameter set or an encoded bitstream of the point cloud by the encoder side. Alternatively, an encoder side and a decoder side set a threshold parameter by default, and the encoding mode may be determined through mode determining information (which may be, for example, the target encoding information, an occupancy bit of the target encoding information, a QP of the target encoding information, or bounding box information) and the threshold parameter. Alternatively, an encoder side and a decoder side set a threshold parameter, the encoding mode may be determined through mode determining information and the threshold parameter, and the determined encoding mode is written into an encoding parameter set or an encoded bitstream of the point cloud in a form of encoding mode information. Alternatively, an encoder side may set a threshold parameter, the encoding mode may be determined through mode determining information and the threshold parameter, and the set threshold parameter is written into an encoding parameter set or an encoded bitstream of the point cloud.
For an application scope of the encoding mode in the point cloud, refer to the following descriptions. The encoding mode may be applied to the entire point cloud, that is, a same encoding mode is configured for each point in the point cloud. Alternatively, the encoding mode may be applied to an entire point cloud slice, that is, a same encoding mode is configured for each point in a same point cloud slice, where the point cloud slice may include one or more macroblocks. Alternatively, the encoding mode may be applied to an entire macroblock, that is, a same encoding mode is configured for each point in a same macroblock. Alternatively, the encoding mode may be applied to an entire prediction tree, that is, a same encoding mode is configured for each point in a same prediction tree. Alternatively, the encoding mode may be applied to a single point in the point cloud. Alternatively, the encoding mode may be applied to a specific direction (corresponding to the geometry encoding process) of a single point, and in this case, a same encoding mode may be configured for the single point in the point cloud in each direction, or different encoding modes may be configured for the single point in the point cloud in each direction.
The following mainly describes shift processing processes of the target encoding information in different encoding modes.
(1) The encoding mode may include a first encoding mode. In the first encoding mode, whether the target encoding information is a specific value may be first determined. If the target encoding information is not the specific value, shift processing may be performed on the target encoding information to obtain the shift data of the target encoding information. The shift data may include an encoding shift quotient and an encoding shift remainder of the target encoding information. Then, whether the encoding shift quotient of the target encoding information is a specific value may be determined. If the encoding shift quotient of the target encoding information is not the specific value, it may be determined that indirect encoding processing is required to be performed on the encoding shift quotient of the target encoding information.
Specifically, whether the target encoding information satisfies a shift encoding condition may be determined, that is, whether the target encoding information is the specific value is determined. If the target encoding information satisfies the shift encoding condition, it may indicate that the target encoding information is not the specific value, and shift processing is required to be performed on the target encoding information to obtain the encoding shift quotient and the encoding shift remainder of the target encoding information. Then, whether the encoding shift quotient satisfies an indirect encoding condition may be determined, that is, whether the encoding shift quotient is the specific value is determined. If the encoding shift quotient satisfies the indirect encoding condition, it may indicate that the encoding shift quotient is not the specific value, and it may be determined that indirect encoding processing is required to be performed on the encoding shift quotient.
(2) The encoding mode may include a second encoding mode. In the second encoding mode, whether the target encoding information is a specific value may be first determined. If the target encoding information is not the specific value, shift processing may be performed on the target encoding information to obtain the shift data of the target encoding information. The shift data may include an encoding shift quotient and an encoding shift remainder of the target encoding information.
Specifically, whether the target encoding information satisfies a shift encoding condition may be determined, that is, whether the target encoding information is the specific value is determined. If the target encoding information satisfies the shift encoding condition, it may indicate that the target encoding information is not the specific value, and shift processing is required to be performed on the target encoding information to obtain the encoding shift quotient and the encoding shift remainder of the target encoding information. In this case, indirect encoding processing is required to be performed on the encoding shift quotient of the target encoding information.
(3) The encoding mode may include a third encoding mode. In the third encoding mode, shift processing may be performed on the target encoding information to obtain the shift data of the target encoding information. The shift data may include an encoding shift quotient and an encoding shift remainder of the target encoding information. Then, whether the encoding shift quotient of the target encoding information is a specific value may be determined. If the encoding shift quotient of the target encoding information is not the specific value, it may be determined that indirect encoding processing is required to be performed on the encoding shift quotient of the target encoding information.
Specifically, shift processing is performed on the target encoding information to obtain the encoding shift quotient and the encoding shift remainder of the target encoding information. Then, whether the encoding shift quotient satisfies an indirect encoding condition may be determined, that is, whether the encoding shift quotient is the specific value is determined. If the encoding shift quotient satisfies the indirect encoding condition, it may indicate that the encoding shift quotient is not the specific value, and it may be determined that indirect encoding processing is required to be performed on the encoding shift quotient.
(4) The encoding mode may include a fourth encoding mode. In the fourth encoding mode, whether the target encoding information is a specific value is not required to be determined, and whether an encoding shift quotient of the target encoding information is a specific value is also not required to be determined. In other words, shift processing may be directly performed on the target encoding information to obtain the encoding shift quotient of the target encoding information and an encoding shift remainder of the target encoding information. In this case, indirect encoding processing is required to be performed on the encoding shift quotient of the target encoding information.
In both the first encoding mode and the second encoding mode, it is necessary to determine whether the target encoding information satisfies the shift encoding condition, that is, determine whether the target encoding information is the specific value. If the target encoding information satisfies the shift encoding condition, it may be determined that the target encoding information is not the specific value, and it is necessary to perform shift processing on the target encoding information and perform encoding processing on the shift data obtained through shift processing; or if the target encoding information does not satisfy the shift encoding condition, it may be determined that the target encoding information is the specific value, and encoding processing may be directly performed on the target encoding information. For details of discrimination of the target encoding information with respect to the shift encoding condition, refer to the following content.
Matching check is required to be performed on the target encoding information and m1 specific values during discrimination of the target encoding information with respect to the shift encoding condition. The m1 specific values correspond to different encoding information flag fields respectively, and m1 is a positive integer. Matching check may be performed on the target encoding information and an ith specific value in the m1 specific values, i being a positive integer less than m1. If the target encoding information is not matched with (that is, not equal to) the ith specific value, it may indicate that the target encoding information is not the ith specific value, and an ith encoding information flag field corresponding to the ith specific value may be set to a first value (which may be, for example, 0) for encoding, and matching check may be performed on the target encoding information and an (i+1)th specific value in the m1 specific values; or if the target encoding information is matched with (that is, equal to) the ith specific value, it may indicate that the target encoding information is the ith specific value, and the target encoding information may be directly encoded, where directly encoding the target encoding information may mean setting an ith encoding information flag field to a second value (which may be, for example, 1) for encoding. When matching check is performed on an m1th specific value, if the target encoding information is not matched with the m1th specific value, it may indicate that the target encoding information is not the m1th specific value, an m1th encoding information flag field corresponding to the m1th specific value may be set to the first value for encoding, and it may be determined that the target encoding information satisfies the shift encoding condition; or if the target encoding information is matched with the m1th specific value, it may be determined that the target encoding information does not satisfy the shift encoding condition, and the target encoding information may be directly encoded. Directly encoding the target encoding information may specifically mean setting an m1th encoding information flag field to a second value for encoding. The ith specific value may be i−1, that is, the m1th specific value may be m1-1.
For example, when matching check is performed on the target encoding information and one specific value (the specific value may be 0), if the target encoding information is matched with the specific value 0, the target encoding information may be directly encoded, that is, an encoding information flag field may be set to 1 for encoding; or if the target encoding information is not matched with the specific value 0, the encoding information flag field may be set to 0 for encoding, and it may be determined that shift processing is required to be performed on the target encoding information.
For another example, when matching check is performed on the target encoding information and three specific values (which may be a first specific value 0, a second specific value 1, and a third specific value 2), if the target encoding information is matched with the first specific value 0, the target encoding information may be directly encoded, that is, a first encoding information flag field may be set to 1 for encoding; or if the target encoding information is not matched with the first specific value 0, an encoding information flag field may be set to 0 for encoding, and matching is performed on the target encoding information and the second specific value 1. If the target encoding information is matched with the second specific value 1, the target encoding information may be directly encoded, that is, a second encoding information flag field may be set to 1 for encoding; or if the target encoding information is not matched with the second specific value 1, a second encoding information flag field may be set to 0 for encoding, and matching is performed on the target encoding information and the third specific value 2. If the target encoding information is matched with the third specific value 2, the target encoding information may be directly encoded, that is, a third encoding information flag field may be set to 1 for encoding; or if the target encoding information is not matched with the third specific value 2, a third encoding information flag field may be set to 0 for encoding, and it may be determined that shift processing is required to be performed on the target encoding information.
Furthermore, if the target encoding information satisfies the shift encoding condition, the target encoding information may be updated with a reference value associated with the m1th specific value, and then shift processing may be performed on updated target encoding information to obtain the encoding shift quotient and the encoding shift remainder of the target encoding information. Update herein may specifically mean that the updated target encoding information is equal to the target encoding information before update minus the reference value. The reference value may specifically be the m1th specific value plus 1. For example, when matching check is performed on the target encoding information and one specific value (the specific value may be 0), if the target encoding information satisfies the shift encoding condition, that is, the target encoding information is not the specific value 0, 1 may be subtracted from the target encoding information (the specific value 0+1), and shift processing is performed on target encoding information obtained after 1 is subtracted. Herein, a purpose of subtracting the reference value from the target encoding information (that is, the m1th specific value+1) is that when the target encoding information is not matched with the m1th specific value, it indicates that the target encoding information is a value greater than the m1th specific value, and subtracting the reference value (that is, the m1th specific value+1) can reduce a data volume for encoding, so that efficiency of encoding the point cloud can be improved to some extent.
In both the first encoding mode and the third encoding mode, it is necessary to determine whether the encoding shift quotient satisfies the indirect encoding condition, that is, determine whether the encoding shift quotient is the specific value. If the encoding shift quotient satisfies the indirect encoding condition, it may be determined that the encoding shift quotient is not the specific value, and indirect encoding processing is required to be performed on the encoding shift quotient; or if the encoding shift quotient does not satisfy the indirect encoding condition, it may be determined that the encoding shift quotient is the specific value, and encoding processing may be directly performed on the encoding shift quotient. For details of discrimination of the encoding shift quotient with respect to the indirect encoding condition, refer to the following content.
Matching check is required to be performed on the encoding shift quotient and m2 specific values during discrimination of the encoding shift quotient with respect to the indirect encoding condition. The m2 specific values correspond to different shift quotient flag fields respectively, and m2 is a positive integer. Matching check may be performed on the encoding shift quotient and a jth specific value in the m2 specific values, j being a positive integer less than m2. If the encoding shift quotient is not matched with (that is, not equal to) the jth specific value, it may indicate that the encoding shift quotient is not the j+ specific value, a jth shift quotient flag field corresponding to the jth specific value may be set to a first value (which may be, for example, 0) for encoding, and matching check may be performed on the encoding shift quotient and a (j+1)th specific value in the m2 specific values; or if the encoding shift quotient is matched with (that is, equal to) the jth specific value, it may indicate that the encoding shift quotient is the jth specific value, and the encoding shift quotient may be directly encoded, where directly encoding the encoding shift quotient may mean setting a jth shift quotient flag field to a second value (which may be, for example, 1) for encoding. When matching check is performed on an m2th specific value, if the encoding shift quotient is not matched with the m2th specific value, it may indicate that the encoding shift quotient is not the m2th specific value, an m2th shift quotient flag field corresponding to the m2th specific value may be set to the first value for encoding, and it may be determined that the encoding shift quotient satisfies the indirect encoding condition; or if the encoding shift quotient is matched with the m2th specific value, it may be determined that the encoding shift quotient does not satisfy the indirect encoding condition, and the encoding shift quotient may be directly encoded, where directly encoding the encoding shift quotient may specifically mean setting an m2th shift quotient flag field to the second value for encoding. The jth specific value may be j−1, that is, the m2th specific value may be m2-1.
For example, when matching check is performed on the encoding shift quotient and one specific value (the specific value may be 0), if the encoding shift quotient is matched with the specific value 0, the encoding shift quotient may be directly encoded, that is, a shift quotient flag field may be set to 1 for encoding; or if the encoding shift quotient is not matched with the specific value 0, a shift quotient flag field may be set to 0 for encoding, and it may be determined that the encoding shift quotient satisfies the indirect encoding condition and indirect encoding process is required to be performed on the encoding shift quotient.
For another example, when matching check is performed on the encoding shift quotient and three specific values (which may be a first specific value 0, a second specific value 1, and a third specific value 2), if the encoding shift quotient is matched with the first specific value 0, the encoding shift quotient may be directly encoded, that is, a first shift quotient flag field may be set to 1 for encoding; or if the encoding shift quotient is not matched with the first specific value 0, a shift quotient flag field may be set to 0 for encoding, and matching is performed on the encoding shift quotient and the second specific value 1. If the encoding shift quotient is matched with the second specific value 1, the encoding shift quotient may be directly encoded, that is, a second shift quotient flag field may be set to 1 for encoding; or if the encoding shift quotient is not matched with the second specific value 1, a second shift quotient flag field may be set to 0 for encoding, and matching is performed on the encoding shift quotient and the third specific value 2. If the encoding shift quotient is matched with the third specific value 2, the encoding shift quotient may be directly encoded, that is, a third shift quotient flag field may be set to 1 for encoding; or if the encoding shift quotient is not matched with the third specific value 2, a third shift quotient flag field may be set to 0 for encoding, and it may be determined that the encoding shift quotient satisfies the indirect encoding condition and indirect encoding process is required to be performed on the encoding shift quotient.
Furthermore, if the encoding shift quotient satisfies the indirect encoding condition, the encoding shift quotient may be updated with a target value associated with the m2th specific value, and then it may be determined that indirect encoding processing is required to be performed on an updated encoding shift quotient. Update herein may specifically mean that the updated encoding shift quotient is equal to the encoding shift quotient before update minus the target value. The target value may specifically be the m2th specific value plus 1. For example, when matching check is performed on the encoding shift quotient and one specific value (the specific value may be 0), if the encoding shift quotient satisfies the indirect encoding condition, that is, the encoding shift quotient is not the specific value 0, 1 may be subtracted from the encoding shift quotient (the specific value 0+1), and it is determined that indirect encoding processing is performed on an encoding shift quotient obtained after 1 is subtracted. Herein, a purpose of subtracting the target value from the encoding shift quotient (that is, the m2th specific value+1) is that when the encoding shift quotient is not matched with the m2th specific value, it indicates that the encoding shift quotient is a value greater than the m2th specific value, and subtracting the target value (that is, the m2th specific value+1) can reduce a data volume for encoding, so that efficiency of encoding the point cloud can be improved to some extent.
In the first encoding mode to the fourth encoding mode, shift processing is performed on the target encoding information (or the updated target encoding information) based on a shift bit count (the shift bit count herein may be a second shift bit count). The shift bit count may be fixed. The shift bit count may be obtained through determining. Alternatively, the shift bit count may be variable.
First, if the shift bit count is fixed, the shift bit count may be obtained, and shift processing may be performed on the target encoding information based on the shift bit count to obtain an encoding shift quotient and an encoding shift remainder of the target encoding information. If the shift bit count is fixed, the shift bit count may be set by default by the encoder side and the decoder side, or the shift bit count may be set by the encoder side. The shift bit count is written into the encoding parameter set or the encoded bitstream of the point cloud.
Second, if the shift bit count is obtained through determining, shift bit count determining information and a shift bit count threshold may be obtained, and the shift bit count is determined based on a magnitude relationship between the shift bit count determining information and the shift bit count threshold. Specifically, when the shift bit count determining information is less than or equal to the shift bit count threshold, it may be determined that the shift bit count is a first shift bit count (which may be, for example, two bits); or when the shift bit count determining information is greater than the shift bit count threshold, it may be determined that the shift bit count is the second shift bit count (which may be, for example, one bit). Then, shift processing may be performed on the target encoding information based on the shift bit count to obtain the encoding shift quotient and the encoding shift remainder of the target encoding information. The shift bit count determining information may be an order for an exponential-Golomb encoding mode. For example, in an attribute decoding process, the shift bit count determining information may be an order used when a reflectivity attribute is encoded based on the exponential-Golomb encoding mode, or may be an order used when a color attribute is encoded based on the exponential-Golomb encoding mode. If the shift bit count is obtained through determining, the shift bit count threshold may be set by default by the encoder side and the decoder side, or the shift bit count threshold may be set by the encoder side. The shift bit count threshold is written into the encoding parameter set or the encoded bitstream of the point cloud. The shift bit count obtained through determining may be written into the encoding parameter set or the encoded bitstream of the point cloud.
Third, if the shift bit count is variable, an initial shift bit count may be obtained, and shift processing is performed on the target encoding information based on the initial shift bit count to obtain a reference shift quotient and a reference shift remainder of the target encoding information. If the reference shift quotient is less than a shift quotient threshold, the reference shift quotient is determined as the encoding shift quotient, and the reference shift remainder is determined as the encoding shift remainder; or if the reference shift quotient is greater than or equal to a shift quotient threshold, the initial shift bit count is updated (specifically, the initial shift bit count may be increased), and shift processing is performed on the target encoding information based on an updated shift bit count until a reference shift quotient less than the reference quotient threshold is obtained through shift processing. If the shift bit count is variable, a shift bit count that makes the reference shift quotient obtained through shift processing less than the shift quotient threshold may be written into the encoding parameter set of the point cloud or the encoded bitstream of the point cloud.
S803: Code the shift data.
In the first encoding mode to the fourth encoding mode, after shift processing is performed on the target encoding information (or the updated target encoding information) to obtain the shift data, the shift data may be encoded. The shift data may include the encoding shift quotient and the encoding shift remainder of the target encoding information. Encoding the shift data means encoding the encoding shift quotient (performing indirect encoding processing on the encoding shift quotient) and encoding the encoding shift remainder.
Performing encoding processing on the encoding shift quotient, that is, performing indirect encoding processing on the encoding shift quotient, may include any one of the following two modes. In a first mode, the encoding shift quotient may be encoded based on the exponential-Golomb encoding mode. An order for the exponential-Golomb encoding mode herein is a K1th order, K1 being a nonnegative integer. In a second mode, the encoding shift quotient may be encoded based on a bit encoding mode.
In the second mode for encoding the encoding shift quotient (that is, the bit encoding mode), an occupancy bit of the encoding shift quotient may be calculated, the occupancy bit is encoded, and then a value of each bit occupied by the encoding shift quotient may be encoded.
The occupancy bit may be encoded in any one of the following modes. First, the bit encoding mode: The occupancy bit may specifically be encoded based on the bit encoding mode, that is, a value of each bit occupied by the occupancy bit may be encoded bit by bit. Second, the exponential-Golomb encoding mode: The occupancy bit may be encoded based on the exponential-Golomb encoding mode, where an order for the exponential-Golomb encoding mode is a K3th order, K3 being a nonnegative integer. Third, a shift encoding mode: The occupancy bit may be encoded based on the shift encoding mode. Specifically, shift processing may be performed on the occupancy bit to obtain an occupancy shift quotient and an occupancy shift remainder of the occupancy bit, then the occupancy shift quotient may be encoded, and the occupancy shift remainder may be encoded. For the shift encoding mode:
The occupancy shift quotient and the occupancy shift remainder may be encoded in the bit encoding mode or the exponential-Golomb encoding mode. Specifically, for the occupancy shift quotient, the occupancy shift quotient may be encoded based on the bit encoding mode, that is, a value of each bit occupied by the occupancy shift quotient may be encoded bit by bit; or the occupancy shift quotient may be encoded based on the exponential-Golomb encoding mode, where the order for the exponential-Golomb encoding mode herein is a K4th order, K4 being a nonnegative integer. For the occupancy shift remainder, the occupancy shift remainder may be encoded based on the bit encoding mode, that is, a value of each bit occupied by the occupancy shift remainder may be encoded bit by bit; or the occupancy shift remainder may be encoded based on the exponential-Golomb encoding mode, where the order for the exponential-Golomb encoding mode herein is a K5th order, K5 being a nonnegative integer.
A process of performing shift processing on the occupancy bit to obtain the occupancy shift quotient and the occupancy shift remainder of the occupancy bit may be performed based on the shift bit count (the shift bit count herein may be the second shift bit count), that is, shift processing may be performed on the occupancy bit based on the shift bit count to obtain the occupancy shift quotient and the occupancy shift remainder of the occupancy bit. A determining process of the second shift bit count herein is similar to that of the first shift bit count, and details are not described herein again.
Performing encoding processing on the encoding shift remainder may include any one of the following two modes. In a first mode, the encoding shift remainder may be encoded based on the exponential-Golomb encoding mode. The order for the exponential-Golomb encoding mode herein is a K2th order, K2 being a nonnegative integer. In a second mode, the encoding shift remainder may be encoded based on the bit encoding mode, that is, a value of each bit occupied by the encoding shift remainder may be encoded bit by bit.
If an encoding process of the target encoding information relates to an exponential-Golomb encoding mode-based encoding process, the order for the exponential-Golomb encoding mode is required to be confirmed. The order for the exponential-Golomb encoding mode may be determined in any one of the following manners: the encoder side and the decoder side may set by default the order for the exponential-Golomb encoding mode, or the order for the exponential-Golomb encoding mode may be determined based on a data feature of the target encoding information. The order for the exponential-Golomb encoding mode is written into the encoded bitstream or the encoding parameter set of the point cloud.
The manner of determining the order for the exponential-Golomb encoding mode based on the data feature of the target encoding information may specifically include any one of the following.
(1) The order for the exponential-Golomb encoding mode is queried based on dynamic range information of the point cloud.
The data feature of the target encoding information may include dynamic range information of a point cloud that the target encoding information belongs to. The point cloud that the target encoding information belongs to may be the entire point cloud, a point cloud slice, a current macroblock, a current prediction tree, or the like. The dynamic range information may be determined based on precision information of the point cloud. The precision information is a quantity of bits to which information in the point cloud may be accurate. A dynamic range parameter may be obtained by performing an exponent operation on the precision information. For example, the precision information of the information in the point cloud is 10 bits, and the dynamic range parameter may be 2{circumflex over ( )}10. Alternatively, the dynamic range information may be a difference between maximum encoding information and minimum encoding information in the point cloud. For example, the dynamic range information may be a difference between a maximum residual value and a minimum residual value in the point cloud.
After the dynamic range information of the point cloud that the target encoding information belongs to is obtained, a query index value may be calculated based on the dynamic range information, and then the order for the exponential-Golomb encoding mode may be queried in a query table based on the query index value. The query table may be written by experience. A length of the query table is correlated with the precision information of the point cloud. The query table includes a plurality of index values and orders corresponding to the index values. Therefore, an order corresponding to the query index value may be quickly found from the query table based on the query index value as the order for the exponential-Golomb encoding mode.
A calculation process of the query index value may further be correlated with a quantization step of the point cloud. The dynamic range parameter may be calculated based on the dynamic range information and the quantization step, and then the query index value may be calculated based on the dynamic range parameter. For details, refer to the following formula:
Index represents the query index value. B′ represents the dynamic range parameter.
(2) The order for the exponential-Golomb encoding mode is adaptively determined.
Adaptively determining the order for the exponential-Golomb encoding mode may specifically mean determining an initial order, and adjusting the initial order or a current order based on the data feature of the target encoding information to obtain the order for the exponential-Golomb encoding mode. The data feature of the target encoding information may include encoding information of a previous encoded point of a to-be-encoded point that the target encoding information belongs to. The previous encoded point may be an encoded point sorted before the to-be-encoded point in encoding. The encoding information of the previous encoded point may be information that is obtained through analysis and that is correlated with the previous encoded point, for example, geometric residual information and attribute residual information of the previous encoded point.
First, the initial order golombNum may be obtained, and an order adjustment threshold is determined based on the initial order. The order adjustment threshold may include an order adjustment upper limit golombNumUp and an order adjustment lower limit golombNumLow. For a first determining manner for the order adjustment upper limit golombNumUp and the order adjustment lower limit golombNumLow, refer to the following formulas:
For a second determining manner for the order adjustment upper limit golombNumUp and the order adjustment lower limit golombNumLow, refer to the following formulas:
Second, the initial order or the current order may be adjusted based on a magnitude relationship between the encoding information of the previous encoded point and the order adjustment threshold, to obtain the order for the exponential-Golomb encoding mode. Specifically, a statistical eigenvalue of the encoding information of the previous encoded point may be determined. The previous encoded point may be a previous encoded point adjacent to the to-be-encoded point, and a statistical eigenvalue A′ may be encoding information of the adjacent previous encoded point. Alternatively, the order for the exponential-Golomb encoding mode is adaptively adjusted at an interval of L points, and a statistical eigenvalue A′ may be an average value of encoding information of L previous encoded points. Alternatively, the order for the exponential-Golomb encoding mode is adaptively adjusted at an interval of L points, and a statistical eigenvalue A′ may be an average value of non-zero encoding information in encoding information of L previous encoded points. This is not limited in this embodiment of this disclosure.
Then, the initial order or the current order may be adjusted based on a magnitude relationship between the statistical eigenvalue and the order adjustment threshold to obtain the order for the exponential-Golomb encoding mode. The current order may be an order determined last time for the exponential-Golomb encoding mode. Adjusting the initial order based on the magnitude relationship between the statistical eigenvalue and the order adjustment threshold to obtain the order for the exponential-Golomb encoding mode may include: if the statistical eigenvalue is greater than the order adjustment upper limit, the order for the exponential-Golomb encoding mode is equal to the initial order minus an update value (which may be, for example, 1); or if the statistical eigenvalue is less than the order adjustment lower limit, the order for the exponential-Golomb encoding mode is equal to the initial order plus an update value (which may be, for example, 1). For details, refer to the following formulas:
A′ represents the statistical eigenvalue. golombNumLow represents the order adjustment lower limit. golombNumUp represents the order adjustment upper limit. golombNum represents the initial order. K represents the order for the exponential-Golomb encoding mode.
Adjusting the current order based on the magnitude relationship between the statistical eigenvalue and the order adjustment threshold to obtain the order for the exponential-Golomb encoding mode may include: if the statistical eigenvalue is greater than the order adjustment upper limit, the order for the exponential-Golomb encoding mode is equal to the initial order minus an update value (which may be, for example, 1); or if the statistical eigenvalue is less than the order adjustment lower limit, the order for the exponential-Golomb encoding mode is equal to the initial order plus an update value (which may be, for example, 1). For details, refer to the following formulas:
A′ represents the statistical eigenvalue. golombNumLow represents the order adjustment lower limit. golombNumUp represents the order adjustment upper limit. golombNum represents the current order. K represents the order for the exponential-Golomb encoding mode.
Third, after the order for the exponential-Golomb encoding mode is determined, an order resetting threshold may be further obtained. If it is determined based on the order resetting threshold that the order for the exponential-Golomb encoding mode satisfies an order resetting condition, the order for the exponential-Golomb encoding mode is required to be reset; or if it is determined based on the order resetting threshold that the order for the exponential-Golomb encoding mode does not satisfy an order resetting condition, the order for the exponential-Golomb encoding mode may remain unchanged. The order resetting threshold may include a first order resetting threshold t1 or a second order resetting threshold t2. That the order for the exponential-Golomb encoding mode satisfies the order resetting condition may mean: the order for the exponential-Golomb encoding mode is less than (less than or equal to) the first order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may be reset to a first reference order t3; or the order for the exponential-Golomb encoding mode is greater than (greater than or equal to) the second order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may be reset to a second reference order t4. Both the first reference order t3 and the second reference order t4 may be set to corresponding initial orders. For details, refer to the following formulas:
That the order for the exponential-Golomb encoding mode does not satisfy the order resetting condition may mean: the order for the exponential-Golomb encoding mode is greater than or equal to (less than) the first order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may remain unchanged; or the order for the exponential-Golomb encoding mode is less than or equal to (greater than) the second order resetting threshold, and in this case, the order for the exponential-Golomb encoding mode may remain unchanged.
In addition, if the encoding process of the target encoding information relates to a plurality of exponential-Golomb encoding mode-based encoding processes, orders for respective exponential-Golomb encoding modes are independent of or associated with each other. Association with each other may include any one of the following cases: The orders for the respective exponential-Golomb encoding modes are the same; or the orders for the respective exponential-Golomb encoding modes are associated through an offset parameter (offset). For example, the foregoing five orders K1, K2, K3, K4, and K5 for the exponential-Golomb encoding mode may be associated through the offset parameter (offset): K2=K1-offset, K3=K1-offset, K4=K1-offset, and K5=K1-offset. For another example, K2=K1-offset, K3=K2-offset, K4=K3-offset, K5=K4-offset.
In this embodiment of this disclosure, after the target encoding information of the point cloud is obtained, shift processing may be performed on the target encoding information to obtain the shift data of the target encoding information, and then the shift data may be encoded. According to this embodiment of this disclosure, shift processing is performed on the target encoding information, so that a data volume required to be encoded in an encoding phase of the point cloud can be reduced, and efficiency of encoding the point cloud can be improved.
The foregoing describes the method in the embodiments of this disclosure in detail. For ease of implementing the foregoing solution of the embodiments of this disclosure better, correspondingly, the following provides an apparatus in the embodiments of this disclosure.
Refer to
The processing unit 902 is further configured to perform shift reconstruction on the shift data to obtain reconstructed encoding information of the target encoding information.
In an implementation, when configured to analyze the encoded data to obtain the shift data, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding mode includes a first encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder of the target encoding information. The encoded data includes an encoding information flag field. When configured to analyze the encoded data based on the encoding mode to obtain the shift data, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding mode is a second encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder of the target encoding information. The encoded data includes an encoding information flag field. When configured to analyze the encoded data based on the encoding mode to obtain the shift data, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding mode is a third encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder. The encoded data includes a shift quotient flag field. When configured to analyze the encoded data based on the encoding mode to obtain the shift data, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding mode is a fourth encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder. The encoded data includes an encoding result of the encoding shift quotient and an encoding result of the encoding shift remainder. When configured to analyze the encoded data based on the encoding mode to obtain the shift data, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, a quantity of encoding information flag fields is m1, each encoding information flag field corresponds to a different specific value, and m1 is a positive integer. When configured to analyze the encoding information flag field and determine whether the analytic value of the encoding information flag field satisfies the shift analysis condition, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, when configured to perform shift reconstruction on the shift data to obtain the reconstructed encoding information of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, a quantity of shift quotient flag fields is m2, each shift quotient flag field corresponds to a different specific value, and m2 is a positive integer. When configured to analyze the shift quotient flag field and perform discrimination on the analytic value of the shift quotient flag field with respect to the indirect analysis condition, the processing unit 902 is specifically configured to perform the following operations:
After configured to analyze the encoding result of the encoding shift quotient to obtain the encoding shift quotient, the processing unit 902 is further configured to perform the following operation:
In an implementation, when configured to analyze the encoding result of the encoding shift quotient to obtain the encoding shift quotient, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, when configured to analyze the encoding result of the encoding shift remainder to obtain the encoding shift remainder, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding result of the encoding shift quotient includes an encoding result of an occupancy bit of the encoding shift quotient and a code of each bit occupied by the encoding shift quotient. When configured to analyze the encoding result of the encoding shift remainder based on the bit encoding mode to obtain the encoding shift remainder, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, when configured to analyze the encoding result of the occupancy bit of the encoding shift quotient to obtain the occupancy bit of the encoding shift quotient, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding result of the occupancy bit includes an encoding result of an occupancy shift quotient of the occupancy bit and an encoding result of an occupancy shift remainder, and the occupancy shift quotient and the occupancy shift remainder are obtained by performing shift processing on the occupancy bit. When configured to analyze the encoding result of the occupancy bit based on the shift encoding mode to obtain the occupancy bit of the encoding shift quotient, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, when configured to analyze the encoding result of the occupancy shift quotient to obtain the occupancy shift quotient, the processing unit 902 is specifically configured to perform the following operations:
When configured to analyze the encoding result of the occupancy shift remainder to obtain the occupancy shift remainder, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the shift data includes an encoding shift quotient and an encoding shift remainder. When configured to perform shift reconstruction processing on the shift data to obtain the reconstructed encoding information of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, when configured to determine the shift bit count, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the processing unit 902 is further configured to perform the following operation:
In an implementation, when configured to determine the order for the exponential-Golomb encoding mode, the processing unit 902 is specifically configured to perform any one of the following operations:
In an implementation, when configured to determine the order for the exponential-Golomb encoding mode based on the data feature of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, if the analysis process of the encoded data relates to a plurality of exponential-Golomb encoding mode-based analysis processes, orders for respective exponential-Golomb encoding modes are associated with or independent of each other. That the orders for the respective exponential-Golomb encoding modes are associated with each other includes:
According to another embodiment of this disclosure, each unit in the point cloud processing apparatuses shown in
According to another embodiment of this disclosure, a computer program (including program code) capable of performing each operation involved in a part or all of the method shown in
In this embodiment of this disclosure, after the encoded data of the point cloud is obtained, the encoded data is analyzed to obtain the shift data. The shift data is obtained by performing shift processing on the target encoding information of the point cloud in the encoding process of the point cloud. Shift reconstruction is performed on the shift data to obtain the reconstructed encoding information of the target encoding information. According to this embodiment of this disclosure, shift processing is performed on the target encoding information, so that a data volume required to be decoded in a decoding phase of the point cloud can be reduced, and efficiency of decoding the point cloud can be improved.
Refer to
The processing unit 902 is further configured to code the shift data.
In an implementation, the encoding mode includes a first encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder of the target encoding information. When configured to perform shift processing on the target encoding information based on the encoding mode to obtain the shift data of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding mode includes a second encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder of the target encoding information. When configured to perform shift processing on the target encoding information based on the encoding mode to obtain the shift data of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding mode includes a third encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder of the target encoding information. When configured to perform shift processing on the target encoding information based on the encoding mode to obtain the shift data of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, the encoding mode includes a fourth encoding mode. The shift data includes an encoding shift quotient and an encoding shift remainder of the target encoding information. When configured to perform shift processing on the target encoding information based on the encoding mode to obtain the shift data of the target encoding information, the processing unit 902 is specifically configured to perform the following operation:
In an implementation, matching check is required to be performed on the target encoding information and m1 specific values when whether the target encoding information satisfies the shift encoding condition is determined. The m1 specific values correspond to different encoding information flag fields respectively, and m1 is a positive integer. When configured to determine whether the target encoding information satisfies the shift encoding condition, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, matching check is required to be performed on the encoding shift quotient and m2 specific values when whether the encoding shift quotient satisfies the indirect encoding condition is determined. The m2 specific values correspond to different shift quotient flag fields respectively, and m2 is a positive integer. When configured to determine whether the encoding shift quotient satisfies the indirect encoding condition, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, when configured to perform shift processing on the target encoding information to obtain the encoding shift quotient and the encoding shift remainder of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
In an implementation, when configured to perform shift processing on the target encoding information to obtain the encoding shift quotient and the encoding shift remainder of the target encoding information, the processing unit 902 is specifically configured to perform the following operations:
According to another embodiment of this disclosure, each unit in the point cloud processing apparatuses shown in
According to another embodiment of this disclosure, a computer program (including program code) capable of performing each operation involved in a part or all of the method shown in
In this embodiment of this disclosure, after the target encoding information of the point cloud is obtained, shift processing may be performed on the target encoding information to obtain the shift data of the target encoding information, and then the shift data may be encoded. According to this embodiment of this disclosure, shift processing is performed on the target encoding information, so that a data volume encoded in an encoding phase of the point cloud can be reduced, and efficiency of encoding the point cloud can be improved.
Based on the method and apparatus embodiments, an embodiment of this disclosure provides a computer device. The computer device may be the decoding device described above. Refer to
The computer-readable storage medium 1004 may be stored in a memory of the computer device. The computer-readable storage medium 1004 is configured to store a computer program. The computer program includes computer instructions. The processor 1001 is configured to execute the program instructions stored in the computer-readable storage medium 1004. As a computing core and a control core of the computer device, the processor 1001 (or referred to as a CPU) is configured to implement one or more computer instructions, specifically configured to load and execute the one or more computer instructions, thereby implementing corresponding method processes or corresponding functions.
An embodiment of this disclosure further provides a computer-readable storage medium (memory). As a memory device in a computer device, the computer-readable storage medium is configured to store a program and data. The computer-readable storage medium herein may include a built-in storage medium of the computer device, or may definitely include an extended storage medium supported by the computer device. The computer-readable storage medium provides storage space storing an operating system of the computer device. Furthermore, one or more instructions suitable for a processor to load and execute are also stored in the storage space, and the computer instructions may be one or more computer programs (including program code). The computer-readable storage medium herein may be a high-speed RAM, or a non-transitory memory, for example, at least one disk memory. In some embodiments, the computer-readable storage medium may be at least one computer-readable storage medium far away from the processor.
In some embodiments, the processor 1001 loads and executes the one or more computer instructions stored in the computer-readable storage medium 1004, to implement the corresponding operations of the point cloud processing method shown in
According to an aspect of this disclosure, a computer program product or computer program is provided. The computer program product or computer program includes computer instructions. The computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium. The processor executes the computer instructions to enable the computer device to perform the point cloud processing method provided in various optional modes described above.
The foregoing descriptions are merely specific implementations of this disclosure, but are not intended to limit the protection scope of this disclosure. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this disclosure shall fall within the protection scope of this disclosure. Therefore, the protection scope of this disclosure shall be subject to the protection scope of the claims.
Number | Date | Country | Kind |
---|---|---|---|
202211001666X | Aug 2022 | CN | national |
This application is a continuation application of PCT Patent Application No. PCT/CN2023/096242, filed on May 25, 2023, which claims priority to Chinese Patent Application No. 202211001666X, entitled “POINT CLOUD PROCESSING METHOD AND APPARATUS, COMPUTER DEVICE, AND STORAGE MEDIUM” filed with the China National Intellectual Property Administration on Aug. 19, 2022, wherein the content of the above-referenced applications is incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2023/096242 | May 2023 | WO |
Child | 18937433 | US |