Prediction tree-based point cloud geometry coding method and device, and prediction tree-based point cloud geometry decoding method and device
Patent Information
- Application Number
- GB2025010018
- Authority / Receiving Office
- GB · GB
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-12-13
- Filing Date
- 2023-12-13
- Publication Date
- 2025-08-06
AI Technical Summary
The residual encoding and decoding efficiency of point cloud data in the existing technology is not high, which affects the encoding and decoding performance of point cloud data, resulting in poor user experience.
Using a point cloud geometry coding method based on prediction trees, absolute value coding and direction coding are performed by obtaining the residuals from vertices to pre-order vertices, and XOR operations and context models are used to optimize the coding process, reduce redundant information, and improve encoding and decoding. efficiency.
By optimizing the residual encoding process, the encoding and decoding efficiency of point cloud data is significantly improved and the user experience is improved.
Abstract
Description
Point cloud geometry encoding and decoding method and device based on prediction tree Technical Field
[0001] The present invention relates to the technical field of point cloud encoding and decoding, and in particular to a point cloud geometry encoding and decoding method and device based on a prediction tree. Background Art
[0002] A point cloud is a representation of a 3D object or scene, consisting of a set of randomly distributed discrete points in space that express the spatial structure and surface properties of the object or scene. Each frame of point cloud data can contain millions of points, posing significant challenges to data storage, processing, transmission, and display. Therefore, encoding and compression of point cloud data is essential.
[0003] Point clouds contain a large number of unordered vertices. Current encoding standards use a prediction tree encoding scheme to encode the geometric positions of point cloud vertices. This scheme connects the vertices of the point cloud into a tree by adding directed edges between them, creating a sequential relationship between them. Each vertex's position is predicted using the geometric position of its predecessor. The residual between the predicted position and the preceding vertex's position is calculated and encoded to encode the point cloud's geometric information.
[0004] Currently, most research focuses on the encoding of point cloud structures, while there is less research on residual coding. In addition, in existing technologies, the encoding and decoding efficiency of residuals is not high, which affects the encoding and decoding performance of point cloud data and is not conducive to user experience.
[0005] Therefore, the existing technology needs to be improved and enhanced.
[0006] Summary of the Invention
[0007] The main purpose of the present invention is to provide a point cloud geometry encoding method, decoding method, encoding device, decoding device, intelligent terminal and storage medium based on a prediction tree, aiming to solve the current problem of low efficiency in residual encoding and decoding.
[0008] In order to achieve the above-mentioned object, the first aspect of the present invention provides a point cloud geometry encoding method based on a prediction tree, the method comprising:
[0009] Obtain a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded;
[0010] encoding the absolute value of the first residual;
[0011] Obtaining a second residual from the preceding vertex to the parent vertex of the preceding vertex;
[0012] Perform bitwise XOR on each possible residual direction and the direction of the second residual to obtain several relative residual directions;
[0013] Based on the relative residual direction, screening out feasible residual directions from all possible residual directions;
[0014] Renumbering all vertices corresponding to the feasible residual directions to obtain the maximum number value;
[0015] Based on the maximum number value, a residual direction of the first residual is encoded.
[0016] Corresponding to the encoding method, the second aspect of the present invention provides a point cloud geometry decoding method based on a prediction tree, the method comprising:
[0017] Decoding the point cloud code stream to obtain an absolute value of a first residual from a vertex to be decoded to a preceding vertex of the vertex to be decoded;
[0018] Obtaining a second residual from the preceding vertex to the parent vertex of the preceding vertex;
[0019] Perform bitwise XOR on each possible residual direction and the direction of the second residual to obtain several relative residual directions;
[0020] Based on the relative residual direction, screening out feasible residual directions from all possible residual directions;
[0021] Renumber all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0022] Decoding to obtain a residual direction of the first residual based on the maximum number value;
[0023] combining the absolute value of the first residual and the residual direction of the first residual to obtain a first residual;
[0024] The coordinates of the vertex to be decoded are obtained according to the coordinates of the previous vertex and the first residual.
[0025] As described above, by performing a bitwise XOR operation on each possible residual direction with the direction of the second residual, several relative residual directions are obtained, and feasible residual directions are then screened based on the relative residual directions. This allows for further removal of redundant information when encoding the residual direction between the vertex to be encoded and the previous vertex, rather than directly encoding the residual direction in the prior art, thereby optimizing residual coding.
[0026] A third aspect of the present invention provides a point cloud geometry encoding method based on a prediction tree, the method comprising:
[0027] Obtain a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded;
[0028] Obtaining a minimum number of coding bits based on the absolute value of the first residual;
[0029] Encoding the minimum number of coded bits bit by bit by constructing a context model that enhances linkage performance between coded bits and uncoded bits;
[0030] Encoding the absolute value of the first residual according to the minimum number of coding bits;
[0031] Screen out feasible residual directions from all possible residual directions;
[0032] Renumbering all vertices corresponding to the feasible residual directions to obtain the maximum number value;
[0033] Based on the maximum number value, a residual direction of the first residual is encoded.
[0034] Corresponding to the encoding method, the fourth aspect of the present invention provides a point cloud geometry decoding method based on a prediction tree, the method comprising:
[0035] Decode the point cloud code stream to obtain the minimum encoding bit number of the vertex to be decoded;
[0036] Based on the minimum number of coding bits, decoding obtains an absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded;
[0037] Screen out feasible residual directions from all possible residual directions;
[0038] Renumber all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0039] Decoding to obtain a residual direction of the first residual based on the maximum number value;
[0040] combining the absolute value of the first residual and the residual direction of the first residual to obtain a first residual;
[0041] The coordinates of the vertex to be decoded are obtained according to the coordinates of the previous vertex and the first residual.
[0042] As mentioned above, by encoding ResRemainder i The context of [k] is removed and the context of encoding b0 is added (based on BRemainder i [k]), which further optimizes the context scheme when encoding the absolute value of the residual and improves the computational efficiency of the residual coding.
[0043] A fifth aspect of the present invention provides a point cloud geometry encoding method based on a prediction tree, the method comprising:
[0044] Traverse the prediction tree and obtain the maximum value of the minimum number of coding bits in each dimension based on the absolute value of the residual between each two adjacent vertices in the prediction tree;
[0045] Obtaining a minimum number of coding bits according to the minimum number of bits of the maximum value;
[0046] Using a context model to bit-code the maximum value of all dimensions;
[0047] Obtaining a first residual from the vertex to be encoded to a preceding vertex of the vertex to be encoded;
[0048] Obtaining a minimum number of coding bits based on the absolute value of the first residual;
[0049] Encoding the minimum number of coding bits with the maximum value and the minimum number of coding bits as upper limits;
[0050] Encoding the absolute value of the first residual with reference to the minimum number of coding bits, the maximum value, and the minimum number of coding bits;
[0051] Screen out feasible residual directions from all possible residual directions;
[0052] Renumbering all vertices corresponding to the feasible residual directions to obtain the maximum number value;
[0053] Based on the maximum number value, a residual direction of the first residual is encoded.
[0054] Corresponding to the encoding method, a sixth aspect of the present invention provides a point cloud geometry decoding method based on a prediction tree, the method comprising:
[0055] Decode the point cloud code stream to obtain the maximum value of the minimum number of coding bits in each dimension of the prediction tree;
[0056] Obtaining a minimum number of coding bits according to the minimum number of bits of the maximum value;
[0057] Obtaining a minimum number of coding bits according to the minimum number of coding bits and the maximum value;
[0058] Decoding to obtain an absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded based on the minimum number of coding bits, the minimum number of coding bits, and the maximum value;
[0059] Screen out feasible residual directions from all possible residual directions;
[0060] Renumber all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0061] Decoding to obtain a residual direction of the first residual based on the maximum number value;
[0062] combining the absolute value of the first residual and the residual direction of the first residual to obtain a first residual;
[0063] The coordinates of the vertex to be decoded are obtained according to the coordinates of the previous vertex and the first residual.
[0064] As mentioned above, by precalculating the maximum value of the minimum number of coding bits in each dimension and using this maximum value as the upper limit to limit the encoding of the absolute value of the residual in each dimension, the amount of encoded data corresponding to the number of bits of the absolute value of the residual can be reduced, thereby improving the encoding efficiency.
[0065] A seventh aspect of the present invention provides a point cloud geometry encoding device based on a prediction tree, the device comprising:
[0066] A data acquisition module, configured to acquire a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded;
[0067] An absolute value encoding module is used to encode the absolute value of the first residual; or, based on the absolute value of the first residual, obtain a minimum number of coding bits; bit-by-bit encode the minimum number of coding bits by constructing a context model that enhances the linkage performance between coded bits and uncoded bits; encode the absolute value of the first residual according to the minimum number of coding bits; or, traverse the prediction tree and obtain the maximum value of the minimum number of coding bits in each dimension based on the absolute value of the residuals of each two adjacent vertices in the prediction tree; obtain the minimum number of coding bits based on the minimum number of bits of the maximum value; use the context model to bit-by-bit encode the maximum value of all dimensions; obtain the minimum number of coding bits based on the absolute value of the first residual; encode the minimum number of coding bits with the maximum value and the minimum number of coding bits as upper limits; encode the absolute value of the first residual with the minimum number of coding bits, the maximum value and the minimum number of coding bits as references;
[0068] A residual direction encoding module is used to obtain the second residual from the preceding vertex to the parent vertex of the preceding vertex; perform bitwise XOR on each possible residual direction with the direction of the second residual to obtain several relative residual directions; based on the relative residual direction, filter out feasible residual directions from all possible residual directions; renumber all vertices corresponding to the feasible residual directions to obtain a maximum number value; based on the maximum number value, encode the residual direction of the first residual; or, filter out a feasible residual direction from all possible residual directions; renumber all vertices corresponding to the feasible residual direction to obtain a maximum number value; based on the maximum number value, encode the residual direction of the first residual.
[0069] An eighth aspect of the present invention provides a point cloud geometry decoding device based on a prediction tree, the device comprising:
[0070] A residual absolute value decoding module is configured to decode a point cloud code stream to obtain the absolute value of a first residual from a vertex to be decoded to a preceding vertex of the vertex to be decoded; or, decode the point cloud code stream to obtain the minimum number of coding bits for the vertex to be decoded; based on the minimum number of coding bits, decode to obtain the absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded; or, decode the point cloud code stream to obtain the maximum value of the minimum number of coding bits in each dimension of the prediction tree; obtain the minimum number of coding bits based on the minimum number of bits of the maximum value; obtain the minimum number of coding bits based on the minimum number of coding bits and the maximum value; and decode to obtain the absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded based on the minimum number of coding bits, the minimum number of coding bits, and the maximum value;
[0071] A residual direction decoding module, configured to obtain a second residual from the preceding vertex to the parent vertex of the preceding vertex; perform bitwise exclusive OR operation on each possible residual direction with the direction of the second residual to obtain a plurality of relative residual directions; based on the relative residual directions, screen out feasible residual directions from all possible residual directions; renumber all vertices corresponding to the feasible residual directions to obtain a maximum number value; based on the maximum number value, decode to obtain the residual direction of the first residual; or, screen out feasible residual directions from all possible residual directions; renumber all vertices corresponding to the feasible residual directions to obtain a maximum number value; based on the maximum number value, decode to obtain the residual direction of the first residual;
[0072] A vertex coordinate module is used to combine the absolute value of the first residual and the residual direction of the first residual to obtain a first residual; and obtain the coordinates of the vertex to be decoded according to the coordinates of the previous vertex and the first residual.
[0073] The ninth aspect of the present invention provides an intelligent terminal, which includes a memory, a processor, and a prediction tree-based point cloud geometry decoding program or a prediction tree-based point cloud geometry encoding program stored in the memory and runnable on the processor. When the prediction tree-based point cloud geometry encoding program is executed by the processor, it implements any one of the steps of the prediction tree-based point cloud geometry encoding method; when the prediction tree-based point cloud geometry decoding program is executed by the processor, it implements any one of the steps of the prediction tree-based point cloud geometry decoding method.
[0074] The tenth aspect of the present invention provides a computer-readable storage medium, on which a prediction tree-based point cloud geometry decoding program or a prediction tree-based point cloud geometry encoding program is stored. When the prediction tree-based point cloud geometry encoding program is executed by the processor, the step of any one of the prediction tree-based point cloud geometry encoding methods is implemented; when the prediction tree-based point cloud geometry decoding program is executed by the processor, the step of any one of the prediction tree-based point cloud geometry decoding methods is implemented.
[0075] As can be seen from the above, by optimizing the context during residual coding, the amount of coding data for the absolute value of the residual during coding, and the residual direction coding, the coding and decoding efficiency of the residual is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0077] FIG1 is a flow chart of a first embodiment of a point cloud geometry encoding method based on a prediction tree provided by the present invention;
[0078] Figure 2 is a schematic diagram of residual direction feasibility judgment;
[0079] FIG3 is a flow chart of a second embodiment of a point cloud geometry encoding method based on a prediction tree provided by the present invention;
[0080] FIG4 is a schematic diagram of a flowchart of a third embodiment of a point cloud geometry encoding method based on a prediction tree provided by the present invention;
[0081] FIG5 is a block diagram of the internal structure of a smart terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0082] The following is a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0083] Point cloud encoding mainly involves the following steps: calculating the distance from the current vertex to its parent vertex; finding the vertex closest to the current vertex from the uncoded vertices as the vertex to be coded, and calculating the residual from the vertex to the current vertex; first encoding the absolute value of the residual; then encoding the direction of the residual based on the residual and the distance from the current vertex to its parent vertex. This completes the encoding of the residual. After the current vertex is encoded, the next vertex to be encoded is obtained, and the process continues until all uncoded vertices are encoded.
[0084] In order to solve the problem of low efficiency in residual encoding and decoding in the existing technology, the present invention proposes three point cloud geometry encoding and decoding methods based on prediction trees.
[0085] Encoding method embodiment 1
[0086] Currently, when encoding the residual direction, although the characteristic that the distance from the parent vertex to the previous vertex must be smaller than the distance from the parent vertex to the vertex to be encoded is used to reduce the total number of feasibility of the residual direction, three contexts are required to encode the order of the residual directions among all possibilities, and the correlation of these three contexts with respect to the residual directions has been destroyed when the "feasibility" is excluded. The three contexts are only used to store the order of the residual directions, and the residual direction information is not fully utilized to improve the efficiency of residual coding.
[0087] This embodiment encodes the residual direction of the vertex to be encoded by obtaining the relative direction of the residual direction from the previous vertex to the parent vertex of the previous vertex, thereby optimizing the residual direction encoding and improving the efficiency of residual encoding.
[0088] Specifically, as shown in FIG1 , the process includes the following steps:
[0089] Step A100: obtaining a first residual from the vertex to be encoded to the preceding vertex of the vertex to be encoded;
[0090] Specifically, for the prediction tree, the coordinates of each vertex are defined as P according to its traversal order. i[k], k = 0, 1, 2 represent the geometric position coordinates of the vertex in the three dimensions of X, Y, and Z respectively; i = 0, 1, 2, ..., N-1, N is the total number of vertices in the prediction tree. The vertex to be coded is obtained by finding the vertex closest to the current vertex from the uncoded vertices in the prediction tree. The current vertex is also called the predecessor vertex of the vertex to be coded. The coordinates of the vertex to be coded and the predecessor vertex in each dimension are subtracted to obtain the residual of the vertex to be coded. The residual is calculated by the absolute value of the residual (such as |Δx i |、|Δy i |,|Δz i |) and the residual sign bit (-, +), for example: (-|Δx i |,-|Δy i |,-|Δz i |)、(-|Δx i |,+|Δy i |,-|Δz i |).
[0091] To be encoded vertex to the previous vertex (P i-1 With P i The calculation formula of the first residual between ) in dimension k is:
[0092] Residual Res i The absolute value of [k] is represented as absRes i [k].
[0093] Step A200: Encode the absolute value of the first residual;
[0094] Specifically, first assume that dimension k = 0, that is, in the x dimension, determine the absolute value of the residual absRes of dimension k i [k] is zero. If it is zero, a flag is used to indicate it directly. If it is non-zero, the following encoding operation on dimension k is performed:
[0095] First, get ResHalf based on the absolute value of the residual i [k]、ResRemainder i The value of [k] is expressed as: ResHalf i [k]=absRes i [k]>>1, ResRemainder i [k]=absRes i [k]%2;
[0096] Compare ResHalf i [0]、ResHalf i [1] ResHalf i[2], the code ResHalf is calculated based on the maximum value of the three i The minimum number of coding bits required B i [k];
[0097] According to the minimum number of coding bits B i [k] Calculate BHalf i [k], BRemainder i [k], the specific expression is: BHalf i [k]=B i [k]>>1, BRemainder i [k]=B i [k]%2;
[0098] Create a partially related context model ctxNumBits[ctxIdx], and use the context model ctxNumBits[ctxIdx] to encode BHalf using bit encoding. i [k](b3b2b1b0), BRemainder i [k] and ResRemainder i [k] is encoded. The context model can be used to optimize the encoding of uncoded bits using coded bits (i.e., linkage). The linkage between coded and uncoded bits indicates a strong correlation between the coded and uncoded information. By building context, redundant information can be removed. The specific steps are:
[0099] When ctxIdx=0, code BHalf i b0 in [k];
[0100] When ctxIdx=1+b0, code BHalf i b1 in [k];
[0101] When ctxIdx=3+b0+2*b1, code BHalf i b2 in [k];
[0102] When ctxIdx=7, code BHalf i b3 in [k];
[0103] When ctxIdx=8, encoding BRemainder i [k];
[0104] When ctxIdx=9, code ResRemainder i [k].
[0105] Then use the minimum number of coding bits Bi[k] to encode ResHalf bit by bit i [k].
[0106] Update the dimension k to another dimension, and perform encoding operations on the updated dimension until the absolute values of the residuals in the three dimensions are encoded, and then the absolute value of the first residual is encoded.
[0107] Step A300: Obtain the second residual from the previous vertex to the parent vertex of the previous vertex;
[0108] Specifically, the vertex to be encoded is denoted as P i =(x i ,y i , z i ), the preceding vertex of the vertex to be encoded is recorded as P i-1 =(x i-1 ,y i-1 , z i-1 ). Vertex P i-1 The parent vertex is denoted as P i-2 =(x i-2 ,y i-2 , z i-2 ), then the second residual from the previous vertex to the parent vertex of the previous vertex is: Res i-1 =P i-1 -P i-2 =(Δx i-1 , Δy i-1 , Δz i-1 ).
[0109] Step A400: performing bitwise exclusive OR operation on each possible residual direction and the direction of the second residual to obtain a number of relative residual directions;
[0110] Specifically, the first residual Res i The absolute value of the residual is absRes i ,absRes i =(|Δx i |,|Δy i |,|Δz i |), there is also a positive and negative sign bit in each dimension, and the positive and negative sign bits of the three dimensions constitute the residual direction, recorded as signRes i =(sign(Δx i ), sign(Δy i ), sign(Δz i )), where the function:
[0111] Calculate the previous vertex P i-1 To parent vertex P i-2The distance (such as Euclidean distance, Huffman distance), denoted as C(P i-2 , P i-1 ).
[0112] According to the arrangement and combination of the positive and negative sign bits of the residual, there are at most 8 possible directions of the residual, namely S0 = (0, 0, 0), S1 = (0, 0, 1), S2 = (0, 1, 0), S3 = (0, 1, 1), S4 = (1, 0, 0), S5 = (1, 0, 1), S6 = (1, 1, 0) and S7 = (1, 1, 1). (It should be noted that when the absolute value of the residual of a certain dimension is 0, the total number of all possibilities may be reduced to 4, 2, and 1.) Without loss of generality, when all eight possibilities exist, all possible eight residuals are recorded as T0 = (-|Δx i |,-|Δy i |,-|Δz i |), T1=(-|Δx i |,-|Δy i |,+|Δz i |), T2=(-|Δx i |,+|Δy i |,-|Δz i |), T3=(-|Δx i |,+|Δy i |,+|Δz i |), T4=(+|Δx i |,-|Δy i |,-|Δz i |), T5=(+|Δx i |,-|Δy i |,+|Δz i |), T6=(+|Δx i |,+|Δy i |,-|Δz i |) and T7=(+|Δx i |,+|Δy i |,+|Δz i |).
[0113] According to the second residual Res i-1 The direction of the residual direction (i.e., the residual direction from the previous vertex to the parent vertex of the previous vertex) is reordered by using "bit-by-bit XOR" to obtain the relative residual direction (S'0, S'1, S'2, S'3, S'4, S'5, S'6, S'7). Specifically, assuming that the possible residual direction S i, i=0,...,7 is represented by binary as i=(i2,i1,i0), the second residual direction preS k , k=0,...,7, the binary representation of k is k=(k2,k1,k0), the relative residual direction S′ j , j=0,...,7, the binary representation of j is j=(j2,j1,j0). According to the known S i With preS k By performing a bitwise XOR operation:
[0114] Get the relative residual direction S′ j .
[0115] The results of bitwise XOR of all possible residual directions and the directions of various previous residuals are shown in Table 1:
[0116] Table 1: Bitwise XOR results of possible residual directions and previous residual directions
[0117] After obtaining the relative residual direction, S i Mapped to the relative residual direction S′ j (i and j may not be equal), then the newly obtained S′ is calculated based on j. j Rearrange in ascending order, the corresponding relative residual T′ j The relative residuals (T'0, T'1, T'2, T'3, T'4, T'5, T'6, T'7) are a combination of the relative residual direction and the absolute value of the first residual.
[0118] Step A500: Based on the relative residual direction, a feasible residual direction is screened out from all possible residual directions;
[0119] Specifically, it is known that the distance from the parent vertex to the previous vertex must be smaller than the distance from the parent vertex to the vertex to be encoded (such as Euclidean distance, Huffman distance). i-2 to P i-1 +T′ i The distance is recorded as C i , if C i <C(P i-2 , P i-1 ), then in this case, select the vertex with the parent P i-2 When the closest vertex is found, P should be given priority. i Rather than P i-1 Therefore, the relative residual T′ in this case is i is infeasible, and the residual direction corresponding to the relative residual is also infeasible. These infeasible residual directions are filtered out to obtain feasible residual directions.
[0120] Step A600: renumbering all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0121] Step A700: Encode the residual direction corresponding to the first residual based on the maximum number value.
[0122] Specifically, the feasibility of the residual direction is used as prior information to treat the sign of the residual value of the coded vertex as signRes i Perform arithmetic coding. Referring to Figure 2, without loss of generality, assume that there are 3 red points (T0, T1, T4) and 5 blue points (T2, T3, T5, T6, T7) among the eight possibilities. The 3 red points are impossible and can be directly excluded. The symbols corresponding to the 5 blue points are feasible. From Figure 2, we can see that the current residual (i.e., the first residual) Res i The sign bit is signRes i =(1, 1, 1), the previous residual (i.e., the second residual) Res i-1 The sign bit is signRes i-1 =(1, 1, 1). According to Table 1, we can know that the current residual Res i The relative residual direction is signRes′ i = (0, 0, 0), that is, T′7 = T7. The impossible residual directions that are eliminated are (0, 0, 0), (0, 0, 1), and (1, 0, 0). The renumbering results are shown in Table 2. The total number of all possible cases is 5, denoted as Possible = 5; the state number to be encoded after renumbering is 4, denoted as ord = 4.
[0123] Table 2: Relative residual T′ i Schematic table of renumbering results, X represents a symbol that cannot exist
[0124] The binary representation of ord is ord = (o2o1o0)2. Encode the binary bits of the vertex number corresponding to the residual value from high to low. When encoding the i-th bit, let the i-th bit be 1, and the remaining uncoded bits be 0, and record the value of the current decimal number as D. If D ≥ Possible = 5, then the value of this bit cannot be 1 and no encoding is required. Otherwise, perform context-based arithmetic coding on the i-th bit, and update the i-th bit of D (consistent with the i-th bit of ord). Take the case in Table 2 as an example: the number to be encoded is 4, and Possible = 5 is known. The encoding process is as follows: Convert the number to be encoded into binary representation: ord = 4 = 100, that is, o2 = 1, o1 = 0, o0 = 0. First, set D to zero. Next, when encoding the second bit o2, if that bit is 1, then D = 100 = 4, which is less than Possible. Context coding is performed on o2, and o2 is assigned to the second bit of D, updating D = 100 = 4. Next, when encoding the first bit o1, if that bit is 1, then D = 110 = 6, which is greater than Possible. Therefore, the first bit is definitely 0 and does not need to be encoded, nor does D need to be updated. Finally, when encoding the zeroth bit o0, if that bit is 1, then D = 101 = 5, which is equal to Possible. Therefore, the zeroth bit is definitely 0 and does not need to be encoded, nor does D need to be updated.
[0125] In summary, when encoding the residual direction between the vertex to be encoded and the previous vertex, this embodiment further removes redundant information by encoding the relative residual direction instead of directly encoding the residual direction in the prior art, thereby achieving optimization of residual coding.
[0126] Decoding method embodiment 1
[0127] With respect to the first embodiment of the encoding method, this embodiment provides an embodiment of a decoding method, which specifically includes the following steps:
[0128] Step D100: decoding the point cloud code stream to obtain the absolute value of the first residual from the vertex to be decoded to the preceding vertex of the vertex to be decoded;
[0129] Specifically, a point cloud code stream is received, the last decoded vertex is used as the vertex to be decoded, and the coordinates of the previous vertex of the vertex to be decoded and the coordinate values of the parent vertex of the previous vertex are obtained according to the decoded vertices.
[0130] Set dimension k = 0 and determine the absolute value of the residual absRes of the current dimension k i [k] is zero, if absRes i If [k] is non-zero, the following operation is performed to decode the absolute value of the first residual in dimension k:
[0131] According to the partially relevant context model ctxNumBits[ctxIdx] in the code stream, the bit number is parsed to obtain BHalf i [k](b3b2b1b0), BRemainder i [k] and ResRemainder i [k]. The specific steps are:
[0132] By ctxIdx=0, decode from ctxNumBits to obtain BHalf i b0 in [k];
[0133] By ctxIdx=1+b0, decode from ctxNumBits to obtain BHalf i b1 in [k];
[0134] By ctxIdx=3+b0+2*b1, decode from ctxNumBits to obtain BHalf i [k] in b2;
[0135] By ctxIdx=7, decode from ctxNumBits to obtain BHalf i [k] in b3;
[0136] By ctxIdx=8, decode from ctxNumBits to obtain BRemainder i [k];
[0137] By ctxIdx=9, decode from ctxNumBits to obtain ResRemainder i [k];
[0138] Then according to BHalf i [k] and BRemainder i [k] Calculate the minimum number of residual bits B i [k],B i [k]=(BHalf i [k]<<1)+BRemainder i [k];
[0139] According to the minimum residual bit number B i [k], decode bit by bit to get ResHalf i [k];
[0140] According to ResHalf i [k] and ResRemainder i [k] Calculate the absolute value of the first residual in dimension k absResi [k], absRes i [k]=(ResHalf i [k]<<1)+ResRemainder i [k].
[0141] Update the dimension k to another dimension until the absolute values of the residuals in three dimensions are decoded, and then the absolute value of the first residual is decoded.
[0142] Step D200: Obtain the second residual from the previous vertex to the parent vertex of the previous vertex;
[0143] Specifically, the second residual is obtained according to the decoded coordinates of the previous vertex and the coordinates of the parent vertex of the previous vertex; the previous vertex is recorded as P i-1 =(x i-1 ,y i-1 , z i-1 ). Vertex P i-1 The parent vertex is denoted as P i-2 =(x i-2 ,y i-2 , z i-2 ), then the second residual from the previous vertex to the parent vertex of the previous vertex is: Res i-1 =P i-1 -P i-2 =(Δx i-1 , Δy i-1 , Δz i-1 ). Calculate the preceding vertex P i-1 To parent vertex P i-2 The distance (such as Euclidean distance, Huffman distance), denoted as C(P i-2 , P i-1 ).
[0144] Step D300: performing bitwise XOR on each possible residual direction and the direction of the second residual to obtain several relative residual directions;
[0145] Specifically, please refer to the description in step A400 for details, which will not be repeated here.
[0146] Step D400: based on the relative residual direction, screening out feasible residual directions from all possible residual directions;
[0147] Specifically, calculate P i-2 to P i-1 +T′ i The distance is recorded as C i , if C i <C(P i-2 , P i-1 ), then in this case the corresponding relative residual T′i is infeasible. The residual direction corresponding to the relative residual is also infeasible. These infeasible residual directions are filtered out to obtain feasible residual directions.
[0148] Step D500: renumbering all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0149] Step D600: decoding to obtain the residual direction of the first residual based on the maximum number value;
[0150] Specifically, according to the relative residual direction S′ of the residual value j The feasibility of the decoded vertex is treated as prior information and the sign of the residual value signRes is treated as i Perform arithmetic decoding to obtain the residual direction of the first residual. For example, if the encoded number is 100, the corresponding encoded vertex number is 4, and then the relative sign bit signRes′ is obtained according to Table 2. i =(0, 0, 0), and then look up Table 1 based on the relative sign bit to obtain the sign bit of the first residual in one dimension. Repeat the same operation until the sign bits of three dimensions are obtained, and combine them into the residual direction of the first residual. Please refer to the description of step A700 for the arithmetic decoding method.
[0151] Step D700: combining the absolute value of the first residual and the residual direction of the first residual to obtain the first residual;
[0152] Step D800: Obtain the coordinates of the vertex to be decoded according to the coordinates of the previous vertex and the first residual.
[0153] Specifically, the sign bit signRes i =(sign(Δx i ), sign(Δy i ), sign(Δz i )) and the absolute value of the first residual absRes i =(|Δx i |,|Δy i |,|Δz i |) combination to obtain the first residual Res i , the coordinates of the point to be decoded are P i =P i-1 +Res i It is worth noting that the special case is P0=(0,0,0)+Res i .
[0154] Encoding method embodiment 2
[0155] In the prior art, when encoding the residual, the shift modulo operation is used for both the absolute value of the residual and the number of occupied bits. This has the following problems: 1. The lowest bit of the absolute value of the residual ResRemainder i [k] with its ResHalf i The remaining bits B in [k] i There is no substantial difference, ResRemainder i [k] Designing a separate context obviously wastes space and affects efficiency, so bit-by-bit encoding can be used. i [k](b3b2b1b0) and BRemainder i [k], considering BHalf i There is a correlation between adjacent bits in [k](b3b2b1b0), so a partially correlated context model ctxNumBits[ctxIdx] is designed to encode the number of bits, but BRemainder is ignored. i The correlation between [k] and b3, b2, b1, and b0.
[0156] This embodiment further optimizes the context scheme when encoding the absolute value of the residual generated by the geometric prediction tree, thereby improving the computational efficiency of the residual coding. As shown in Figure 3, it specifically includes the following steps:
[0157] Step B100: obtaining a first residual from the vertex to be encoded to the preceding vertex of the vertex to be encoded;
[0158] Specifically, please refer to the description in step A100, which will not be repeated here.
[0159] Step B200: Obtaining a minimum number of coding bits based on the absolute value of the first residual;
[0160] Step B300: encoding the minimum number of coded bits bit by bit by constructing a context model that enhances the linkage performance between coded bits and uncoded bits;
[0161] Step B400: Encode the absolute value of the first residual according to the minimum number of coding bits;
[0162] Specifically, first assume that dimension k = 0, that is, in the x dimension, determine the absolute value of the residual absRes of dimension k i [k] is zero. If it is zero, a flag is used to indicate it directly. If it is non-zero, the following encoding operation on dimension k is performed:
[0163] First get ResHalf i [k]、ResRemainder i[k] value, ResHalf i [k]=absRes i [k]>>1, ResRemainder i [k]=absRes i [k]%2;
[0164] Then compare ResHalf i [0]、ResHalf i [1] ResHalf i [2] value, calculate ResHalf i The minimum number of coding bits required B i [k];
[0165] Create a partially related context model ctxNumBits[ctxIdx], and use the context model ctxNumBits[ctxIdx] to encode B in bit number. i [k](b4b3b2b1b0) is encoded. The specific steps are:
[0166] When ctxIdx=0, code B i b0 in [k];
[0167] When ctxIdx=1+b0, code B i b1 in [k];
[0168] When ctxIdx=3+b1, code B i b2 in [k];
[0169] When ctxIdx=5+b2+b1*2, code B i b3 in [k];
[0170] When ctxIdx=9, code B i b4 in [k].
[0171] Then use the minimum number of coding bits B i [k] Bit-by-bit encoding ResRemainder i [k] and ResHalf i [k].
[0172] Update the dimension k to another dimension until the absolute values of the residuals in the three dimensions are encoded, and then the absolute value of the first residual is encoded.
[0173] After the above processing steps, the original code used to encode ResRemainder iThe context of [k] is removed and the context of encoding b0 is added (based on BRemainder i [k]), that is, adding a context to link the original BRemainder i [k] (now b0 bit) and the original b0 (now b1) use more coded information to assist in encoding uncoded information without changing the amount of context, thereby improving coding performance.
[0174] Step B500: Screening out feasible residual directions from all possible residual directions;
[0175] Specifically, the vertex to be encoded is denoted as P i =(x i ,y i , z i ), the preceding vertex of the vertex to be encoded is recorded as P i-1 =(x i-1 ,y i-1 , z i-1 ). Vertex P i-1 The parent vertex is denoted as P i-2 =(x i-2 ,y i-2 , z i-2 ).
[0176] The first residual Res i The absolute value of the residual is absRes i ,absRes i =(|Δx i |,|Δy i |,|Δz i |), there is also a positive and negative sign bit in each dimension, and the positive and negative sign bits of the three dimensions constitute the residual direction, recorded as signRes i =(sign(Δx i ), sign(Δy i ), sign(Δz i )), where the function:
[0177] Calculate the previous vertex P i-1 To parent vertex P i-2 The distance (such as Euclidean distance, Huffman distance), denoted as C(P i-2 , P i-1 ).
[0178] According to the permutations and combinations of the positive and negative sign bits of the residual, there are at most 8 possible residual directions, namely S0 = (0, 0, 0), S1 = (0, 0, 1), S2 = (0, 1, 0), S3 = (0, 1, 1), S4 = (1, 0, 0), S5 = (1, 0, 1), S6 = (1, 1, 0) and S7 = (1, 1, 1). (It is worth noting that when the absolute value of the residual of the corresponding dimension is 0, the total number of all possibilities may be reduced to 4, 2, and 1). Without loss of generality, when all eight possibilities exist, all possible eight residuals relative to the previous vertex are recorded as T0 = (-|Δx i |,-|Δy i |,-|Δz i |), T1=(-|Δx i |,-|Δy i |,+|Δz i |), T2= (-|Δx i |,+|Δy i |,-|Δz i |), T3=(-|Δx i |,+|Δy i |,+|Δz i |), T4=(+|Δx i |,-|Δy i |,-|Δz i |), T5=(+|Δx i |,-|Δy i |,+|Δz i |), T6=(+|Δx i |,+|Δy i |,-|Δz i |) and T7=(+|Δx i |,+|Δy i |,+|Δz i |).
[0179] It is known that the distance from the parent vertex to the previous vertex must be less than the distance from the parent vertex to the vertex to be encoded (such as Euclidean distance, Huffman distance). Calculate the parent vertex P i-2 to P i-1 +T i The distance is recorded as C i , if C i <C(P i-2 , P i-1 ), then in this case, select the vertex with the parent P i-2 When the closest vertex is found, P should be given priority. i Rather than P i-1, so the corresponding residual direction in this case is infeasible. These infeasible residual directions are filtered out to obtain feasible residual directions.
[0180] Taking the feasibility of the residual direction as prior information, the sign of the residual value of the encoded vertex is treated as signRes i Perform arithmetic coding. Referring to Figure 2, without loss of generality, assume that among the eight possibilities there are three red dots (T0, T1, T4) and five blue dots (T2, T3, T5, T6, T7). The three red dots are impossible and can be directly excluded. The symbol corresponding to the five blue dots is feasible.
[0181] Step B600: renumbering all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0182] Step B700: Encode the residual direction corresponding to the first residual based on the maximum number value.
[0183] Specifically, please refer to the description in step A600 and step A700, which will not be repeated here.
[0184] In summary, this embodiment takes into account that when encoding the absolute value of the residual, the original i The context of [k] is removed and the context of encoding b0 is added (based on BRemainder i [k]) to further improve encoding performance.
[0185] Decoding method embodiment 2
[0186] With respect to the second embodiment of the encoding method, this embodiment provides an embodiment of a decoding method, which specifically includes the following steps:
[0187] Step E100: Decode the point cloud code stream to obtain the minimum encoding bit number of the vertex to be decoded;
[0188] Step E200: decoding to obtain the absolute value of the first residual from the vertex to be decoded to the preceding vertex of the vertex to be decoded based on the minimum number of coding bits;
[0189] Specifically, a point cloud code stream is received, the last decoded vertex is used as the vertex to be decoded, and the coordinates of the previous vertex of the vertex to be decoded and the coordinate values of the parent vertex of the previous vertex are obtained according to the decoded vertices.
[0190] First determine the absolute value of the residual absRes of the current dimension k i [k] is zero, if absRes i If [k] is non-zero, the following operation is performed to decode the absolute value of the first residual in dimension k:
[0191] According to the partially relevant context model ctxNumBits[ctxIdx] in the code stream, the minimum number of coded bits B is obtained by bit number analysis. i [k](b4b3b2b1b0). The specific steps are:
[0192] By ctxIdx=0, decode from ctxNumBits to obtain B i b0 in [k];
[0193] By ctxIdx=1+b0, decode from ctxNumBits to obtain B i b1 in [k];
[0194] By ctxIdx=3+b1, decode from ctxNumBits to obtain B i b2 in [k];
[0195] By ctxIdx=5+b2+b1*2, decode from ctxNumBits to obtain B i b3 in [k];
[0196] By ctxIdx=9, decode from ctxNumBits to obtain B i b4 in [k];
[0197] Then according to the minimum number of coding bits B i [k], decode bit by bit to get ResRemainder i [k] and ResHalf i [k];
[0198] According to ResRemainder i [k] and ResHalf i [k], calculate the absolute value of the first residual in dimension k absRes i [k], absRes i [k]=(ResHalf i [k]<<1)+ResRemainder i [k].
[0199] Update the dimension k to another dimension until the absolute values of the residuals in three dimensions are decoded, and then the absolute value of the first residual is decoded.
[0200] Step E300: Screening out feasible residual directions from all possible residual directions;
[0201] Step E400: renumbering all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0202] Step E500: decoding to obtain a residual direction of the first residual based on the maximum number value;
[0203] Specifically, according to the permutations and combinations of the positive and negative sign bits of the residual, there are at most 8 possible residual directions, namely S0 = (0, 0, 0), S1 = (0, 0, 1), S2 = (0, 1, 0), S3 = (0, 1, 1), S4 = (1, 0, 0), S5 = (1, 0, 1), S6 = (1, 1, 0) and S7 = (1, 1, 1). (It is worth noting that when the absolute value of the residual of the corresponding dimension is 0, the total number of all possibilities may be reduced to 4, 2, and 1). Without loss of generality, when all eight possibilities exist, all possible eight residuals relative to the previous vertex are recorded as T0 = (-|Δx i |,-|Δy i |,-|Δz i |), T1=(-|Δx i |,-|Δy i |,+|Δz i |), T2=(-|Δx i |,+|Δy i |,-|Δz i |), T3=(-|Δx i |,+|Δy i |,+|Δz i |), T4=(+|Δx i |,-|Δy i |,-|Δz i |), T5=(+|Δx i |,-|Δy i |,+|Δz i |), T6=(+|Δx i |,+|Δy i |,-|Δz i |) and T7=(+|Δx i |,+|Δy i |,+|Δz i |).
[0204] Calculate P i-2 to P i-1 +T i The distance is recorded as C i , if C i <C(P i-2 , P i-1 ), then in this case the corresponding residual value direction T i It is not feasible, according to the direction of the residual value T iThe feasibility of the vertex is used as prior information, and the sign of the residual value of the vertex is signRes i Perform arithmetic decoding to obtain the residual direction of the first residual. For details on renumbering the vertices corresponding to the feasible residual direction and performing arithmetic decoding to obtain the residual direction, refer to the descriptions in steps D500 and D600. The only difference is that the relative residual direction is used in step D500, while the feasible residual direction is used in this embodiment.
[0205] Step E600: combining the absolute value of the first residual and the residual direction of the first residual to obtain the first residual;
[0206] Step E700: Obtain the coordinates of the vertex to be decoded according to the coordinates of the previous vertex and the first residual.
[0207] Specifically, the details of step E600 and step E700 can be found in the description of step D700 and step D800, which will not be repeated here.
[0208] Encoding method embodiment 3
[0209] Currently, when encoding the absolute value of the residual generated by the geometric prediction tree, the number of bits occupied by the residual absolute value is assumed to be 5 bits (i.e., 0-31). However, experiments have found that the number of bits corresponding to the maximum absolute value of the residual in each dimension of each prediction tree often does not reach 31, and even most residuals do not require 5 bits.
[0210] This embodiment further optimizes the bit number encoding of the absolute value of the residual generated by the geometric prediction tree, saving memory and improving coding efficiency. As shown in Figure 4, it specifically includes the following steps:
[0211] Step C100: traverse the prediction tree and obtain the maximum value of the minimum number of coding bits in each dimension based on the absolute value of the residual between every two adjacent vertices in the prediction tree;
[0212] Step C200: Obtaining a minimum number of coding bits according to the minimum number of bits of the maximum value;
[0213] Step C300: using a context model to perform bitwise encoding on the maximum values of all dimensions;
[0214] Specifically, traverse the residuals of every two adjacent vertices of the prediction tree once, and calculate the absolute value of all residuals absRes i [k] The minimum number of encoding bits B in each dimension i [k], get the maximum value of the minimum number of coded bits in each dimension. That is, maxNumBits[k]=max{B0[k],...,B N-1[k]}∈[0, 31], where B i [k] is the minimum number of coding bits for vertex i in dimension k. Then, the minimum number of coding bits in dimension k is calculated based on the maximum value of the minimum number of coding bits, maxNumBits[k], that is, maxNumofNumBits[k]∈[0,5].
[0215] Encode the maximum value maxNumBits[k] of the minimum number of encoding bits under dimension k. The specific steps are:
[0216] According to the maximum value maxNumBits[k] of the minimum number of coded bits, calculate maxBHalf[k]=maxNumBits[k]>>1, and maxBRemainder[k]=maxNumBits[k]%2.
[0217] Create a partially related context model ctxNumBits[ctxIdx], and use the context model ctxNumBits[ctxIdx] to encode maxBHalf(b3b2b1b0) and maxBRemainder[k] in bit encoding. The specific steps are as follows:
[0218] When ctxIdx=0, encode b0 in maxBHalf;
[0219] When ctxIdx=1+b0, encode b1 in maxBHalf;
[0220] When ctxIdx=3+b1+b0*2, encode b2 in maxBHalf;
[0221] When ctxIdx=7, encode b3 in maxBHalf;
[0222] When ctxIdx=8, maxBRemainder[k] is encoded.
[0223] Update dimension k to the next dimension, and encode the maximum value maxNumBits[k] of the minimum number of coded bits under the updated dimension k until the maximum value of the minimum number of coded bits under each dimension is encoded.
[0224] Step C400: obtaining a first residual from the vertex to be encoded to the preceding vertex of the vertex to be encoded;
[0225] Step C500: Obtaining a minimum number of coding bits based on the absolute value of the first residual;
[0226] Step C600: Encode the minimum number of encoding bits with the maximum and minimum number of encoding bits as upper limits;
[0227] Step C700: Encode the absolute value of the first residual with reference to the minimum number of coding bits, the maximum number of coding bits, and the minimum number of coding bits;
[0228] Specifically, first assume that dimension k = 0, that is, in the x dimension, determine the absolute value of the residual absRes of dimension k i [k] is zero. If it is zero, a flag is used to indicate it directly. If it is non-zero, the following encoding operation on dimension k is performed:
[0229] First get ResHalf i [k]、ResRemainder i [k] value, ResHalf i [k]=absRes i [k]>>1, ResRemainder i [k]=absRes i [k]%2;
[0230] Then compare ResHalf i [0]、ResHalf i [1] ResHalf i [2] value, calculate ResHalf i The minimum number of coding bits required B i [k];
[0231] According to the minimum number of coding bits B i [k] Calculate BHalf i [k], BRemainder i [k], the specific expression is: BHalf i [k]=B i [k]>>1, BRemainder i [k]=B i [k]%2;
[0232] Create a partially related context model ctxNumBits[ctxIdx], use the maximum value maxNumBits[k] and the minimum number of coded bits maxNumofNumBits[k] as the maximum upper limit, and use the context model ctxNumBits[ctxIdx] to encode BHalf using the bit encoding method. i [k](b3b2b1b0), BRemainder i [k], ResRemainder i [k] is encoded. The specific steps are:
[0233] Set sumofStatus1 to zero,
[0234] When maxNumofNumBits[k]≥1 and (sumofStatus1|1)≤maxNumBits[k], set ctxIdx=8 and encode BRemainder i [k], and update sumofStatus1, that is, sumofStatus1|=BRemainder i [k];
[0235] When maxNumofNumBits[k]≥2 and (sumofStatus1|2)≤maxNumBits[k], set ctxIdx=0, encode b0, and update sumofStatus1, that is, sumofStatus1|=b0<<1;
[0236] When maxNumofNumBits[k]≥3 and (sumofStatus1|4)≤maxNumBits[k], set ctxIdx=1+b0, encode b1, and update sumofStatus1, that is, sumofStatus1|=b1<<2;
[0237] When maxNumofNumBits[k]≥4 and (sumofStatus1|8)≤maxNumBits[k], set ctxIdx=3+b1+b0*2, encode b2, and update sumofStatus1, that is, sumofStatus1|=b2<<3;
[0238] When maxNumofNumBits[k]≥5 and (sumofStatus1|16)≤maxNumBits[k], set ctxIdx=7, encode b3, and update sumofStatus1, that is, sumofStatus1|=b3<<4;
[0239] Set ctxIdx = 9, code ResRemainder i [k].
[0240] Then use the minimum number of coding bits B i [k] Bit-by-bit encoding ResHalf i [k].
[0241] Update the dimension k to another dimension, and perform encoding operations on the updated dimension until the absolute values of the residuals in the three dimensions are encoded, and then the absolute value of the first residual is encoded.
[0242] Step C800: Screening out feasible residual directions from all possible residual directions;
[0243] Step C900: renumber all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0244] Step C1000: Encode the residual direction of the first residual based on the maximum number value.
[0245] Specifically, the contents of steps C800 to C1000 refer to the description of steps B600 to B800 and are not repeated here.
[0246] In summary, this embodiment encodes the number of bits corresponding to the maximum absolute value residual in each dimension of each prediction tree to reduce the amount of data encoded for the number of bits corresponding to the absolute values between any two nodes in the corresponding prediction tree.
[0247] Decoding method embodiment 3
[0248] Regarding the third embodiment of the encoding method, the decoding method embodiment provided in this embodiment specifically includes the following steps:
[0249] Step F100: decoding the point cloud code stream to obtain the maximum value of the minimum number of coding bits in each dimension of the prediction tree;
[0250] Step F200: Obtain the minimum number of coding bits according to the minimum number of bits of the maximum value;
[0251] Step F300: Obtain the minimum number of coding bits according to the minimum number of coding bits and the maximum value of the minimum number of coding bits;
[0252] Step F400: decoding to obtain the absolute value of the first residual from the vertex to be decoded to the preceding vertex of the vertex to be decoded based on the minimum number of coding bits, the minimum number of coding bits, and the maximum value of the minimum number of coding bits;
[0253] Specifically, the point cloud code stream is received, the last decoded vertex is used as the vertex to be decoded, and the context model ctxNumBits[ctxIdx] is decoded from the point cloud code stream; and the coordinates of the previous vertex of the vertex to be decoded and the coordinate values of the parent vertex of the previous vertex are obtained.
[0254] Parse the bit number of ctxNumBits[ctxIdx] to obtain maxBHalf(b3b2b1b0) and maxBRemainder[k]. The specific steps are:
[0255] When ctxIdx=0, decoding obtains b0 in maxBHalf;
[0256] When ctxIdx=1+b0, decoding obtains b1 in maxBHalf;
[0257] When ctxIdx=3+b1+b0*2, decoding obtains b2 in maxBHalf;
[0258] When ctxIdx=7, decoding obtains b3 in maxBHalf;
[0259] When ctxIdx=8, decoding obtains maxBRemainder[k];
[0260] According to maxBHalf[k] and maxBRemainder[k], the maximum value of the minimum number of coded bits in each dimension, maxNumBits[k], is calculated, where maxNumBits[k] = (maxBHalf[k] < < 1) + maxBRemainder[k].
[0261] According to the minimum number of bits of the maximum value maxNumBits[k] of the minimum number of coded bits, the minimum number of coded bits maxNumofNumBits[k]∈[0,5] is calculated.
[0262] Determine the absolute value of the residual absRes of the current dimension k i [k] is zero, if absRes i If [k] is non-zero, the following operation is performed to decode the absolute value of the first residual in dimension k:
[0263] According to the context model ctxNumBits[ctxIdx] in the code stream, the maximum value of the minimum number of coded bits maxNumBits[k] and the minimum number of coded bits maxNumofNumBits[k] are used as the upper limit of the maximum value to decode BHalf i [k](b3b2b1b0), BRemainder i [k] and ResRemainder i [k]. The specific steps are:
[0264] Set sumofStatus1 to zero,
[0265] When maxNumofNumBits[k]≥1 and (sumofStatus1|1)≤maxNumBits[k], set ctxIdx=8 and decode to obtain BRemainder i [k], and update sumofStatus1, that is, sumofStatus1|=BRemainder i[k];
[0266] When maxNumofNumBits[k]≥2 and (sumofStatus1|2)≤maxNumBits[k], set ctxIdx=0 and decode to obtain BHalf i b0 in [k] and update sumofStatus1, that is, sumofStatus1|=b0<<1:
[0267] When maxNumofNumBits[k]≥3 and (sumofStatus1|4)≤maxNumBits[k], set ctxIdx=1+b0 and decode to obtain BHalf i b1 in [k], and update sumofStatus1, that is, sumofStatus1|=b1<<2;
[0268] When maxNumofNumBits[k]≥4 and (sumofStatus1|8)≤maxNumBits[k], set ctxIdx=3+b1+b0*2, and decode to obtain BHalf i b2 in [k], and update sumofStatus1, that is, sumofStatus1|=b2<<3;
[0269] When maxNumofNumBits[k]≥5 and (sumofStatus1|16)≤maxNumBits[k], set ctxIdx=7 and decode to obtain BHalf i b3 in [k] and update sumofStatus1, that is, sumofStatus1|=b3<<4;
[0270] Set ctxIdx = 9, decode to get ResRemainder i [k].
[0271] According to sumofStatus1, the minimum number of coded bits under dimension k is obtained: Bi[k]=sumofStatus1;
[0272] According to the minimum number of coding bits B i [k], bit-by-bit encoding to obtain ResRemainder i [k] and ResHalf i [k];
[0273] According to ResRemainder i [k] and ResHalf i[k], calculate the absolute value of the first residual in dimension k absRes i [k]=(ResHalf i [k]<<1)+ResRemainder i [k].
[0274] Update the dimension k to another dimension until the absolute values of the residuals in three dimensions are decoded, and then the absolute value of the first residual is decoded.
[0275] Step F500: Screening out feasible residual directions from all possible residual directions;
[0276] Step F600: renumbering all vertices corresponding to feasible residual directions to obtain the maximum number value;
[0277] Step F700: decoding to obtain the residual direction of the first residual based on the maximum number value;
[0278] Step F800: combining the absolute value of the first residual and the residual direction of the first residual to obtain the first residual;
[0279] Step F900: Obtain the coordinates of the vertex to be decoded according to the coordinates of the previous vertex and the first residual.
[0280] Specifically, the details of steps F500 to F900 can be found in steps E300 to E700 and will not be repeated here.
[0281] In summary, this embodiment considers that when encoding the absolute value of the residual, the number of bits corresponding to the maximum absolute value of the residual in each dimension of each prediction tree often does not reach 31, and even most absolute values do not require 5 bits to be encoded. By pre-encoding the maximum absolute value of the residual in each dimension of each prediction tree, the amount of data used for residual encoding is reduced, thereby improving coding efficiency.
[0282] It should be noted that the above three encoding embodiments and decoding embodiments can be combined with each other to form various combined encoding and decoding methods.
[0283] Exemplary devices
[0284] Corresponding to the above-mentioned prediction tree-based point cloud geometry encoding method, an embodiment of the present invention further provides a prediction tree-based point cloud geometry encoding device, the device comprising:
[0285] A data acquisition module, configured to acquire a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded;
[0286] An absolute value encoding module is used to encode the absolute value of the first residual; or, based on the absolute value of the first residual, obtain a minimum number of coding bits; bit-by-bit encode the minimum number of coding bits by constructing a context model that enhances the linkage performance between coded bits and uncoded bits; encode the absolute value of the first residual according to the minimum number of coding bits; or, traverse the prediction tree and obtain the maximum value of the minimum number of coding bits in each dimension based on the absolute value of the residuals of each two adjacent vertices in the prediction tree; obtain the minimum number of coding bits based on the minimum number of bits of the maximum value; use the context model to bit-by-bit encode the maximum value of all dimensions; obtain the minimum number of coding bits based on the absolute value of the first residual; encode the minimum number of coding bits with the maximum value and the minimum number of coding bits as upper limits; encode the absolute value of the first residual with the minimum number of coding bits, the maximum value and the minimum number of coding bits as references;
[0287] A residual direction encoding module is used to obtain the second residual from the preceding vertex to the parent vertex of the preceding vertex; perform bitwise XOR on each possible residual direction with the direction of the second residual to obtain several relative residual directions; based on the relative residual directions, screen out feasible residual directions from all possible residual directions; renumber all vertices corresponding to feasible residual directions to obtain a maximum number value; based on the maximum number value, encode the residual direction of the first residual; or, screen out a feasible residual direction from all possible residual directions; renumber all vertices corresponding to feasible residual directions to obtain a maximum number value; based on the maximum number value, encode the residual direction of the first residual.
[0288] Corresponding to the above-mentioned prediction tree-based point cloud geometry decoding method, an embodiment of the present invention further provides a prediction tree-based point cloud geometry decoding device, the device comprising:
[0289] A residual absolute value decoding module is configured to decode a point cloud code stream to obtain the absolute value of a first residual from a vertex to be decoded to a preceding vertex of the vertex to be decoded; or, decode the point cloud code stream to obtain the minimum number of coding bits for the vertex to be decoded; based on the minimum number of coding bits, decode to obtain the absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded; or, decode the point cloud code stream to obtain the maximum value of the minimum number of coding bits in each dimension of the prediction tree; obtain the minimum number of coding bits based on the minimum number of bits of the maximum value; obtain the minimum number of coding bits based on the minimum number of coding bits and the maximum value; and decode to obtain the absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded based on the minimum number of coding bits, the minimum number of coding bits, and the maximum value;
[0290] A residual direction decoding module, configured to obtain a second residual from the preceding vertex to the parent vertex of the preceding vertex; perform bitwise exclusive OR operation on each possible residual direction with the direction of the second residual to obtain a plurality of relative residual directions; based on the relative residual directions, screen out feasible residual directions from all possible residual directions; renumber all vertices corresponding to the feasible residual directions to obtain a maximum number value; based on the maximum number value, decode to obtain the residual direction of the first residual; or, screen out feasible residual directions from all possible residual directions; renumber all vertices corresponding to the feasible residual directions to obtain a maximum number value; based on the maximum number value, decode to obtain the residual direction of the first residual;
[0291] The vertex coordinate module is used to combine the absolute value of the first residual and the residual direction of the first residual to obtain the first residual; and obtain the coordinates of the vertex to be decoded according to the coordinates of the previous vertex and the first residual.
[0292] Specifically, in this embodiment, the specific functions of each module of the above-mentioned prediction tree-based point cloud geometry encoding device and prediction tree-based point cloud geometry decoding device can refer to the corresponding descriptions in the above-mentioned prediction tree-based point cloud geometry encoding method and prediction tree-based point cloud geometry decoding method, and will not be repeated here.
[0293] Based on the above embodiments, the present invention also provides an intelligent terminal. As shown in Figure 5, the intelligent terminal includes a processor, a memory, a network interface, and a display screen connected via a system bus. The processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a prediction tree-based point cloud geometry decoding program or a prediction tree-based point cloud geometry encoding program. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. The internal memory provides an environment for the operation of the operating system and the prediction tree-based point cloud geometry decoding program or the prediction tree-based point cloud geometry encoding program in the non-volatile storage medium. When the prediction tree-based point cloud geometry encoding program is executed by the processor, the steps of the prediction tree-based point cloud geometry encoding method are implemented; when the prediction tree-based point cloud geometry decoding program is executed by the processor, the steps of the prediction tree-based point cloud geometry decoding method are implemented.
[0294] An embodiment of the present invention also provides a computer-readable storage medium, on which a prediction tree-based point cloud geometry decoding program or a prediction tree-based point cloud geometry encoding program is stored. When the prediction tree-based point cloud geometry encoding program is executed by a processor, the steps of any one of the prediction tree-based point cloud geometry encoding methods provided in the embodiment of the present invention are implemented; when the prediction tree-based point cloud geometry decoding program is executed by a processor, the steps of any one of the prediction tree-based point cloud geometry decoding methods provided in the embodiment of the present invention are implemented.
[0295] It should be understood that the sequence numbers of the steps in the above embodiments do not imply a specific order of execution; the order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Claims
1. A point cloud geometry coding method based on a prediction tree, characterized in that: The method comprises: Obtain a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded; encoding the absolute value of the first residual; Obtaining a second residual from the preceding vertex to the parent vertex of the preceding vertex; Perform bitwise XOR on each possible residual direction and the direction of the second residual to obtain several relative residual directions; Based on the relative residual direction, screening out feasible residual directions from all possible residual directions; Renumbering all vertices corresponding to the feasible residual directions to obtain the maximum number value; Based on the maximum number value, a residual direction of the first residual is encoded.
2. A point cloud geometry coding method based on a prediction tree, characterized in that: include: Obtain a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded; Obtaining a minimum number of coding bits based on the absolute value of the first residual; Encoding the minimum number of coded bits bit by bit by constructing a context model that enhances linkage performance between coded bits and uncoded bits; Encoding the absolute value of the first residual according to the minimum number of coding bits; Screen out feasible residual directions from all possible residual directions; Renumbering all vertices corresponding to the feasible residual directions to obtain the maximum number value; Based on the maximum number value, a residual direction of the first residual is encoded.
3. A point cloud geometry coding method based on a prediction tree, characterized in that: include: Traverse the prediction tree and obtain the maximum value of the minimum number of coding bits in each dimension based on the absolute value of the residual between each two adjacent vertices in the prediction tree; Obtaining a minimum number of coding bits according to the minimum number of bits of the maximum value; Using a context model to bit-code the maximum value of all dimensions; Obtain a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded; Obtaining a minimum number of coding bits based on the absolute value of the first residual; Encoding the minimum number of coding bits with the maximum value and the minimum number of coding bits as upper limits; Encoding the absolute value of the first residual with reference to the minimum number of coding bits, the maximum value, and the minimum number of coding bits; Screen out feasible residual directions from all possible residual directions; Renumbering all vertices corresponding to the feasible residual directions to obtain the maximum number value; Based on the maximum number value, a residual direction of the first residual is encoded.
4. A point cloud geometry decoding method based on a prediction tree, characterized in that: include: Decoding the point cloud code stream to obtain an absolute value of a first residual from a vertex to be decoded to a preceding vertex of the vertex to be decoded; Obtaining a second residual from the preceding vertex to the parent vertex of the preceding vertex; Perform bitwise XOR on each possible residual direction and the direction of the second residual to obtain several relative residual directions; Based on the relative residual direction, screening out feasible residual directions from all possible residual directions; Renumbering all vertices corresponding to feasible residual directions to obtain a maximum number value; decoding to obtain the residual direction of the first residual based on the maximum number value; combining the absolute value of the first residual and the residual direction of the first residual to obtain a first residual; The coordinates of the vertex to be decoded are obtained according to the coordinates of the previous vertex and the first residual.
5. A point cloud geometry decoding method based on a prediction tree, characterized in that: include: Decode the point cloud code stream to obtain the minimum encoding bit number of the vertex to be decoded; Based on the minimum number of coding bits, decoding obtains an absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded; Screen out feasible residual directions from all possible residual directions; Renumber all vertices corresponding to feasible residual directions to obtain the maximum number value; Decoding to obtain a residual direction of the first residual based on the maximum number value; combining the absolute value of the first residual and the residual direction of the first residual to obtain a first residual; The coordinates of the vertex to be decoded are obtained according to the coordinates of the previous vertex and the first residual.
6. A point cloud geometry decoding method based on a prediction tree, characterized in that: include: Decode the point cloud code stream to obtain the maximum value of the minimum number of coding bits in each dimension of the prediction tree; Obtaining a minimum number of coding bits according to the minimum number of bits of the maximum value; Decoding to obtain a minimum number of coding bits according to the minimum number of coding bits and the maximum value; Decoding to obtain an absolute value of a first residual from a vertex to be decoded to a preceding vertex of the vertex to be decoded based on the minimum number of coding bits, the minimum number of coding bits, and the maximum value; Screen out feasible residual directions from all possible residual directions; Renumber all vertices corresponding to feasible residual directions to obtain the maximum number value; Decoding to obtain a residual direction of the first residual based on the maximum number value; combining the absolute value of the first residual and the residual direction of the first residual to obtain a first residual; The coordinates of the vertex to be decoded are obtained according to the coordinates of the previous vertex and the first residual.
7. A point cloud geometry encoding device based on a prediction tree, characterized in that: include: A data acquisition module, configured to acquire a first residual from a vertex to be encoded to a preceding vertex of the vertex to be encoded; an absolute value encoding module, configured to encode the absolute value of the first residual; Or, based on the absolute value of the first residual, obtain the minimum number of coding bits; The minimum number of coded bits is encoded bit by bit by constructing a context model that enhances the linkage performance between coded bits and uncoded bits; the absolute value of the first residual is encoded according to the minimum number of coded bits; or, the prediction tree is traversed, and the maximum value of the minimum number of coded bits in each dimension is obtained according to the absolute value of the residuals of each two adjacent vertices in the prediction tree; the minimum number of coded bits is obtained according to the minimum number of bits of the maximum value; the maximum value of all dimensions is encoded bit by bit using the context model; the minimum number of coded bits is obtained based on the absolute value of the first residual; the minimum number of coded bits is encoded with the maximum value and the minimum number of coded bits as upper limits; the absolute value of the first residual is encoded with the minimum number of coded bits, the maximum value and the minimum number of coded bits as references; A residual direction encoding module is configured to obtain a second residual from the preceding vertex to the parent vertex of the preceding vertex; perform bitwise exclusive OR operation on each possible residual direction with the direction of the second residual to obtain a plurality of relative residual directions; based on the relative residual directions, select feasible residual directions from all possible residual directions; renumber all vertices corresponding to the feasible residual directions to obtain a maximum number value; and encode the residual direction of the first residual based on the maximum number value; Alternatively, a feasible residual direction is selected from all possible residual directions; all vertices corresponding to the feasible residual direction are renumbered to obtain a maximum number value; and the residual direction of the first residual is encoded based on the maximum number value.
8. A point cloud geometry decoding device based on a prediction tree, characterized in that: A residual absolute value decoding module is configured to decode a point cloud code stream to obtain the absolute value of a first residual from a vertex to be decoded to a preceding vertex of the vertex to be decoded; or, decode the point cloud code stream to obtain the minimum number of coding bits for the vertex to be decoded; based on the minimum number of coding bits, decode to obtain the absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded; or, decode the point cloud code stream to obtain the maximum value of the minimum number of coding bits in each dimension of the prediction tree; obtain the minimum number of coding bits based on the minimum number of bits of the maximum value; obtain the minimum number of coding bits based on the minimum number of coding bits and the maximum value; and decode to obtain the absolute value of a first residual from the vertex to be decoded to a preceding vertex of the vertex to be decoded based on the minimum number of coding bits, the minimum number of coding bits, and the maximum value; The residual direction decoding module is used to obtain the second residual from the previous vertex to the parent vertex of the previous vertex; possible residual directions are bitwise XORed with the direction of the second residual to obtain several relative residual directions; based on the relative residual directions, a feasible residual direction is screened out from all possible residual directions; all vertices corresponding to the feasible residual directions are renumbered to obtain a maximum number value; based on the maximum number value, the residual direction of the first residual is obtained by decoding; or, for screening out a feasible residual direction from all possible residual directions; all vertices corresponding to the feasible residual directions are renumbered to obtain a maximum number value; based on the maximum number value, the residual direction of the first residual is obtained by decoding; A vertex coordinate module is used to combine the absolute value of the first residual and the residual direction of the first residual to obtain a first residual; and obtain the coordinates of the vertex to be decoded according to the coordinates of the previous vertex and the first residual.
9. Intelligent terminal, characterized in that: The intelligent terminal includes a memory, a processor, and a prediction tree-based point cloud geometry decoding program or a prediction tree-based point cloud geometry encoding program stored in the memory and runnable on the processor. When the prediction tree-based point cloud geometry encoding program is executed by the processor, the steps of the prediction tree-based point cloud geometry encoding method as described in any one of claims 1 to 3 are implemented. When the prediction tree-based point cloud geometry decoding program is executed by the processor, the steps of the prediction tree-based point cloud geometry decoding method as described in any one of claims 4 to 6 are implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a prediction tree-based point cloud geometry decoding program or a prediction tree-based point cloud geometry encoding program. When the prediction tree-based point cloud geometry encoding program is executed by the processor, the steps of the prediction tree-based point cloud geometry encoding method as described in any one of claims 1 to 3 are implemented. When the prediction tree-based point cloud geometry decoding program is executed by the processor, the steps of the prediction tree-based point cloud geometry decoding method as described in any one of claims 4 to 6 are implemented.