Lossless encoding method, lossless decoding method, apparatus, and device
Patent Information
- Application Number
- CN202210772455.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-06-30
AI Technical Summary
[0004]本申请实施例提供一种无损编码方法、无损解码方法、装置及设备,能够解决现有方案中对每个重复点编码了多次,进而降低了编码效率的问题
[0026]第八方面,提供了一种计算机程序/程序产品,所述计算机程序/程序产品被存储在存储介质中,所述计算机程序/程序产品被至少一个处理器执行以实现如第一方面所述的方法的步骤,或者实现如第二方面所述的方法的步骤。
Smart Images

Figure CN117372648B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of encoding and decoding technology, specifically relating to a lossless encoding method, a lossless decoding method, an apparatus, and equipment. Background Technology
[0002] 3D meshes can be considered the most popular representation of 3D models over the years, playing a vital role in many applications. Their ease of representation has led to their widespread integration as hardware algorithms into the graphics processing units of computers, tablets, and smartphones, specifically for rendering 3D meshes.
[0003] In related technologies, when performing lossless encoding on a 3D mesh, there may be repeated points in the 3D mesh. This results in each repeated point being encoded multiple times during the encoding process, thereby reducing encoding efficiency. Summary of the Invention
[0004] This application provides a lossless encoding method, lossless decoding method, apparatus, and device that can solve the problem that existing solutions encode each repeating point multiple times, thereby reducing encoding efficiency.
[0005] Firstly, a lossless encoding method is provided, including:
[0006] The encoding end traverses the target mesh to obtain the geometric coordinates of each vertex in the target mesh;
[0007] The encoding end identifies vertices with the same geometric coordinates as duplicate vertices;
[0008] The encoding end merges the duplicate vertices in the target grid to obtain a first grid;
[0009] The encoding end performs lossless encoding on the first grid to generate the target bitstream.
[0010] Secondly, a lossless decoding method is provided, including:
[0011] The decoding end performs lossless decoding on the target bitstream to obtain the first grid.
[0012] The decoding end recovers the repeating vertices in the first grid to obtain the target grid;
[0013] The repeated vertices are vertices in the target mesh that have the same geometric coordinates.
[0014] Thirdly, a lossless encoding device is provided, comprising:
[0015] The acquisition module is used to traverse the target mesh and obtain the geometric coordinates of each vertex in the target mesh;
[0016] The determination module is used to identify vertices with the same geometric coordinates as duplicate vertices;
[0017] The merging module is used to merge the duplicate vertices in the target mesh to obtain a first mesh;
[0018] The encoding module is used to perform lossless encoding on the first grid to generate the target bitstream.
[0019] Fourthly, a lossless decoding device is provided, comprising:
[0020] The decoding module is used for lossless decoding of the target bitstream to obtain the first grid.
[0021] The recovery module is used to recover the duplicate vertices in the first mesh to obtain the target mesh;
[0022] The repeated vertices are vertices in the target mesh that have the same geometric coordinates.
[0023] Fifthly, a terminal is provided, the terminal including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method as described in the first aspect, or implementing the steps of the method as described in the second aspect.
[0024] In a sixth aspect, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect, or implement the steps of the method described in the second aspect.
[0025] In a seventh aspect, a chip is provided, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being configured to run programs or instructions to implement the method as described in the first aspect, or to implement the method as described in the second aspect.
[0026] Eighthly, a computer program / program product is provided, which is stored in a storage medium and is executed by at least one processor to implement the steps of the method as described in the first aspect, or to implement the steps of the method as described in the second aspect.
[0027] A ninth aspect provides a system comprising an encoding end and a decoding end, the encoding end performing the steps of the method described in the first aspect, and the decoding end performing the steps of the method described in the second aspect.
[0028] In this embodiment, the target mesh is traversed to obtain the geometric coordinates of each vertex in the target mesh; vertices with the same geometric coordinates are identified as duplicate vertices; the duplicate vertices in the target mesh are merged to obtain the first mesh, so that each duplicate vertex will not be encoded multiple times in the subsequent lossless encoding process of the first mesh, thereby improving the encoding efficiency. Attached Figure Description
[0029] Figure 1 This is a flowchart illustrating the lossless encoding method in the embodiments of this application;
[0030] Figure 2 This is a schematic diagram of the manifold mesh in the embodiments of this application;
[0031] Figure 3 This is a schematic diagram of CornerTable in the embodiments of this application;
[0032] Figure 4 This is a schematic diagram of the five operating modes defined in EB in the embodiments of this application;
[0033] Figure 5 This is a schematic diagram of the prediction of the geometric coordinate parallelogram in the embodiments of this application;
[0034] Figure 6 This is a schematic diagram of the prediction of similar triangles in texture coordinates in an embodiment of this application;
[0035] Figure 7 This is a flowchart illustrating the lossless decoding method in an embodiment of this application;
[0036] Figure 8 This is a structural diagram of the lossless encoding device provided in the embodiments of this application;
[0037] Figure 9 This is a structural diagram of the lossless decoding device provided in the embodiments of this application;
[0038] Figure 10 This is a structural diagram of the communication device provided in the embodiments of this application;
[0039] Figure 11 This is a schematic diagram of the hardware structure of the terminal provided in the embodiments of this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0041] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0042] It is worth noting that the technologies described in this application are not limited to Long Term Evolution (LTE) / LTE-Advanced (LTE-A) systems, but can also be used in other wireless communication systems, such as Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Frequency Division Multiple Access (FDMA), Orthogonal Frequency Division Multiple Access (OFDMA), Single-carrier Frequency Division Multiple Access (SC-FDMA), and other systems. The terms "system" and "network" in this application are often used interchangeably, and the described technologies can be used with the systems and radio technologies mentioned above, as well as with other systems and radio technologies. The following description describes New Radio (NR) systems for illustrative purposes, and NR terminology is used in most of the following description; however, these technologies can also be applied to applications beyond NR systems, such as 6th generation (6G) radio systems. th Generation 6G communication system.
[0043] The lossless encoding method provided in this application will be described in detail below with reference to the accompanying drawings, through some embodiments and application scenarios.
[0044] Please see Figure 1 , Figure 1 This is a flowchart of the lossless encoding method in this embodiment. The lossless encoding method provided in this embodiment includes the following steps:
[0045] S101, Traverse the target mesh and obtain the geometric coordinates of each vertex in the target mesh.
[0046] S102, vertices with the same geometric coordinates are identified as duplicate vertices.
[0047] The target mesh described above is a 3D mesh that includes repeating vertices. In the above steps, the target mesh is first traversed to establish a correspondence between the index of each geometric vertex in the target mesh and the geometric coordinates of that geometric vertex. When there are geometric vertex indices with the same corresponding geometric coordinates in the above correspondence, it indicates that the vertices corresponding to these geometric vertex indices are repeating vertices.
[0048] S103, merge the duplicate vertices in the target mesh to obtain the first mesh.
[0049] In this step, after identifying the duplicate vertices in the target mesh, these duplicate vertices are merged into a single vertex to obtain the first mesh. It should be understood that merging duplicate vertices refers to combining multiple vertices with the same corresponding geometric coordinates into one vertex. For a detailed implementation of merging duplicate vertices in the target mesh, please refer to subsequent embodiments.
[0050] One optional implementation is to merge some of the duplicate vertices in the target mesh to obtain a first mesh; another optional implementation is to merge all the duplicate vertices in the target mesh to obtain a first mesh that does not include duplicate vertices.
[0051] S104, perform lossless encoding on the first grid to generate the target bitstream.
[0052] In this step, after obtaining the first mesh, different lossless encoding methods are selected to perform lossless encoding on the first mesh based on whether the first mesh is a three-dimensional network including non-manifold structures, to generate the target bitstream.
[0053] In this embodiment, the target mesh is traversed to obtain the geometric coordinates of each vertex in the target mesh; vertices with the same geometric coordinates are identified as duplicate vertices; a first mesh is obtained, ensuring that the first mesh does not include duplicate vertices, thus avoiding multiple encodings of each duplicate vertex during subsequent lossless encoding of the first mesh, thereby improving encoding efficiency. Optionally, merging the duplicate vertices in the target mesh to obtain the first mesh includes:
[0054] When the geometric coordinates and texture coordinates of each vertex in the target mesh correspond one-to-one, duplicate vertices with the same geometric coordinates in the target mesh are merged into one vertex without changing the texture coordinates of the duplicate vertices, thus obtaining the first mesh.
[0055] In this embodiment, when there is a one-to-one correspondence between the geometric coordinates and texture coordinates of each vertex in the target mesh, duplicate vertices with the same geometric coordinates in the target mesh are merged into one vertex without changing the texture coordinates of the duplicate vertices; that is, the texture coordinates of the duplicate vertices are preserved. Furthermore, at the decoding end, the duplicate vertices are restored based on the preserved texture coordinates of the duplicate vertices.
[0056] Optionally, merging the duplicate vertices in the target mesh to obtain the first mesh includes:
[0057] Merge duplicate vertices with the same geometric coordinates in the target mesh into one vertex to obtain the first mesh;
[0058] The first identifier corresponding to each vertex in the first grid is encoded to generate an identifier bitstream, whereby the first identifier is used to represent the number of times the corresponding vertex is repeated.
[0059] In this embodiment, after merging duplicate vertices into one vertex, a first identifier is assigned to each vertex according to the number of times each vertex is repeated, and the first identifier corresponding to each vertex is encoded to generate an identifier code stream.
[0060] Optionally, the step of lossless encoding the first grid to generate the target bitstream includes:
[0061] In the case where the first grid is a three-dimensional network including a non-manifold structure, the first grid is split into a second grid;
[0062] The grid information corresponding to the second grid and the vertex information of the first vertex are encoded respectively to obtain the first bitstream corresponding to the grid information and the second bitstream corresponding to the vertex information of the first vertex.
[0063] The target bitstream is generated based on the first bitstream and the second bitstream.
[0064] The first mesh described above is a 3D network including non-manifold structures, and the second mesh is a 3D mesh including manifold structures. In this step, the process of splitting the first mesh into the second mesh can be divided into two parts: splitting non-manifold edges and splitting non-manifold points.
[0065] 1. Split non-manifold edges
[0066] The first step in splitting non-manifold edges is to find the non-manifold edges.
[0067] It should be understood that a non-manifold edge exists in at least three triangles simultaneously. One alternative implementation is to establish a data structure, such as a mapping table or hash table, to store the triangles containing each edge in the first grid, and to determine the non-manifold edge by querying the number of triangles containing each edge.
[0068] Another alternative implementation is to establish a correspondence between each edge and its diagonals by constructing a CornerTable, and to identify the edges that correspond to at least three diagonals as non-manifold edges.
[0069] To better understand the correspondence between sides and opposite angles, please refer to [link / reference]. Figure 2 ,like Figure 2 As stated, angle a is opposite to side bc, and angle b is also opposite to side bc. The angles opposite to side bc are angle a and angle d.
[0070] The second step in splitting non-manifold edges is to add new vertices and modify the connection relationships corresponding to the first mesh.
[0071] After finding a non-manifold edge, create duplicate vertices for each of the two vertices of the non-manifold edge. Select a triangle t containing the non-manifold edge, and form a new triangle t' with the third vertex (excluding the two vertices mentioned above) and the created duplicate vertices. Replace the original triangle t with the new tertiary triangle t'. Perform the above operation on all non-manifold edges to transform them into manifold edges. Record the indices of the duplicate vertices created during this process.
[0072] 2. Split non-manifold points
[0073] The first step in splitting non-manifold points is to find the non-manifold points.
[0074] Starting from any vertex in the first grid and corresponding to a corner, traverse all corners adjacent to that corner that form a sector, marking the vertex and the traversed corner as traversed. Continue until all vertices in the first grid have been traversed, and then determine the vertex corresponding to the corner marked as untraversed as a non-manifold point.
[0075] The second step in splitting non-manifold points is to split the non-manifold points.
[0076] For each non-manifold vertex, create a repeating vertex and connect it to the first mesh. Connect any corners not visited in the first step to the created repeating vertex, thus splitting the non-manifold vertex into two manifold vertices. Repeat this process until all vertices are transformed into manifold vertices.
[0077] After obtaining the second mesh, the mesh information corresponding to the second mesh is encoded to obtain the first bitstream. The mesh information includes, but is not limited to, connectivity, geometric information, and attribute information. The vertex information of the first vertex is encoded to obtain the second bitstream. The aforementioned first vertex refers to a newly added vertex in the second mesh relative to the first mesh. The first vertex includes vertices added after dividing the geometric coordinates of each vertex in the first mesh, and vertices added after dividing the texture coordinates of each vertex in the first mesh.
[0078] For details on how to obtain the first and second bitstreams, please refer to the following embodiments.
[0079] After obtaining the first and second bitstreams, the first and second bitstreams are mixed to generate the target bitstream.
[0080] Optionally, splitting the first grid into a second grid includes:
[0081] The non-manifold structure represented by the second identifier in the first grid is split to obtain the second grid.
[0082] It should be understood that if a non-manifold structure is generated by merging duplicate vertices, the newly generated non-manifold structure needs to be marked so that the encoding end can perform lossless encoding.
[0083] In this embodiment, during the process of merging duplicate vertices, a second identifier is assigned to the non-manifold structure resulting from the merging of duplicate vertices. It should be understood that this second identifier is used to characterize non-manifold points or non-manifold edges. During the process of splitting the first mesh into the second mesh, the non-manifold structure represented by the second identifier is split to obtain the second mesh.
[0084] Optionally, if merging a group of duplicate vertices may result in a non-manifold structure, then this group of duplicate vertices may not be merged.
[0085] Optionally, encoding the vertex information of the first vertex to obtain the second bitstream corresponding to the vertex information of the first vertex includes:
[0086] Generate a target identifier based on the non-manifold structure included in the first grid;
[0087] Entropy encoding is performed on the index corresponding to the first vertex to obtain the first sub-codestream;
[0088] A second bitstream is generated based on the target identifier and the first sub-bitstream.
[0089] The target identifier is used to characterize that the first grid includes a non-manifold structure. In this embodiment, the target identifier is generated when the first grid includes a non-manifold structure.
[0090] Optionally, an identifier is set that is associated with whether the first grid includes a non-manifold structure. If the first grid includes a non-manifold structure (i.e., the number of first vertices is greater than 0), the identifier is set to 1, and this identifier can be understood as the target identifier. If the first grid only includes a manifold structure (i.e., the number of first vertices is equal to 0), the identifier is set to 0.
[0091] The vertex information of the first vertex mentioned above includes the index corresponding to the first vertex in the first grid. Optionally, a preset threshold is set. If the number of first vertices is less than or equal to the preset threshold, it indicates that the number of first vertices is small. In this case, entropy encoding can be performed on the index corresponding to the first vertex to obtain the first sub-bitstream, thereby reducing the bitrate of the first sub-bitstream. Further, the target identifier and the first sub-bitstream are merged to generate the second bitstream.
[0092] Optionally, encoding the vertex information of the first vertex to obtain the second bitstream corresponding to the vertex information of the first vertex includes:
[0093] Generate a target identifier based on the non-manifold structure included in the first grid;
[0094] Entropy encoding is performed on the flag bits corresponding to each vertex in the second grid to obtain the second sub-code stream;
[0095] A second bitstream is generated based on the target identifier and the second sub-bitstream.
[0096] The target identifier is used to characterize that the first grid includes a non-manifold structure. In this embodiment, the target identifier is generated when the first grid includes a non-manifold structure.
[0097] The vertex information of the first vertex mentioned above can also be a flag bit corresponding to each vertex, which is used to indicate whether the corresponding vertex is the first vertex. For example, if a vertex is a first vertex added due to splitting the first grid, then the flag bit corresponding to that vertex is 1; if a vertex is not a first vertex added due to splitting the first grid, then the flag bit corresponding to that vertex is 0. In this embodiment, optionally, a preset threshold is set. If the number of first vertices is greater than the preset threshold, it indicates that the number of first vertices is large. In this case, entropy encoding is performed on the flag bit corresponding to each vertex to obtain the second sub-bitstream. Further, the above target identifier and the second sub-bitstream are merged to generate the second bitstream.
[0098] It should be understood that the second bitstream can be stored in the target bitstream in multiple ways. One possible implementation is to treat the second bitstream as a separate sub-bitstream. Another possible implementation is to store the bitstream corresponding to the newly added attribute vertices in the sub-bitstream corresponding to the attribute information, and to store the bitstream corresponding to the newly added geometric vertices in the sub-bitstream corresponding to the geometric information. Yet another possible implementation is to treat the bitstream corresponding to the newly added attribute vertices and the bitstream corresponding to the newly added geometric vertices as two separate sub-bitstreams.
[0099] Optionally, encoding the grid information corresponding to the second grid to obtain the first bitstream corresponding to the grid information includes:
[0100] Encode the connection relationships corresponding to the second grid to generate the third sub-stream;
[0101] Encode the geometric information corresponding to the second grid to generate the fourth sub-code stream;
[0102] The attribute information corresponding to the second grid is encoded to generate the fifth sub-code stream.
[0103] As described above, the mesh information includes connectivity, geometric information, and attribute information. In this embodiment, the first bitstream includes a third sub-bitstream corresponding to the connectivity, a fourth sub-bitstream corresponding to the geometric information, and a fifth sub-bitstream corresponding to the attribute information.
[0104] In this embodiment, the connection relationships corresponding to the second grid are encoded to generate a third sub-codestream; the geometric information corresponding to the second grid is geometrically encoded to generate a fourth sub-codestream; and the attribute information corresponding to the second grid is attribute encoded to generate a fifth sub-codestream. For details on how to generate the third, fourth, and fifth sub-codestreams, please refer to subsequent embodiments.
[0105] The following details how to encode the connection relationships corresponding to the second grid:
[0106] Optionally, encoding the connection relationship corresponding to the second grid to generate the third sub-stream includes:
[0107] Iterate through each grid in the second grid and generate the target string;
[0108] The target string is entropy encoded to generate the third sub-code stream.
[0109] In this embodiment, compression coding technology can be used to encode the connection relationship of the second grid, wherein the compression coding technology can be the Edgebreaker (EB) algorithm.
[0110] The specific implementation method is as follows: Number each corner of each triangular facet in the second grid in counter-clockwise order to obtain the index of each corner. If the second grid includes f triangular facets, then the second grid includes 3f corners.
[0111] Alternatively, the number of the triangle containing the current angle can be calculated using Formula 1.
[0112] Formula 1: f i =c / 3
[0113] Where c is the index of the current angle, f i This is the index of the triangle containing the current angle.
[0114] Alternatively, the index of the previous angle can be calculated using Formula 2.
[0115] Formula 2: c p =(f i *3)+(c-1)%3
[0116] Where c is the index of the current angle, f i c is the index of the triangle containing the current angle. p It is the index of the previous angle of the current angle, and the % symbol represents the modulo operation.
[0117] Alternatively, the index of the next angle after the current angle can be calculated using Formula 3.
[0118] Formula 3: c p =(f i *3)+(c+1)%3
[0119] Where c is the index of the current angle, f i c is the index of the triangle containing the current angle. p It is the index of the next angle after the current angle, and the % symbol represents the modulo operation.
[0120] After numbering each corner and determining the sequence number of each triangle, a CornerTable can be created, which includes tables V, O, U, and M. Table V stores the index of the vertex corresponding to each corner, table O stores the index of the opposite corner corresponding to each corner, table U stores an indicator indicating whether each triangle has been traversed, and table M stores an indicator indicating whether each vertex has been traversed.
[0121] To better understand how to use CornerTable, please refer to [link / reference]. Figure 3 , Figure 3 In this table, 'c' represents the current angle, 'cp' represents the angle preceding 'c', and 'cn' represents the angle following 'c'. 'co' is the opposite angle of 'c', which can be obtained by looking up the O table. 'ct' is the index of the triangle containing 'c', which can be calculated using the union's algorithm. 'cv' represents the vertex of the current angle, which can be obtained by looking up the V table. 'cl' represents the angle to the left of 'c', obtained by looking up the opposite angle of 'cp' in the O table. 'cr' represents the angle to the right of 'c', obtained by looking up the opposite angle of 'cn' in the O table.
[0122] After establishing the CornerTable, an initial triangle can be randomly selected in the second grid. The triangles in the second grid are traversed according to the five operation modes defined in EB, and a target string is generated. This target string is the CLERS pattern string. When the traversal path ends, but there are still untraversed triangles in the second grid, an untraversed triangle is randomly selected, and the next traversal begins, until all triangles in the grid have been traversed. Furthermore, entropy encoding is used to compress the CLERS pattern string, generating a third sub-stream.
[0123] For a better understanding of the five operating modes defined in EB, please refer to [link / reference]. Figure 4 .
[0124] The current traversed angle is x. If the vertex v corresponding to x has not been traversed, the current triangle is determined to be in mode C, and the next triangle to be traversed is the triangle containing r. If the vertex v corresponding to x has not been traversed, and the triangle containing l has been traversed, the current triangle is determined to be in mode L, and the next triangle to be traversed is the triangle containing r. If the vertex v corresponding to x has not been traversed, and the triangle containing r has been traversed, the current triangle is determined to be in mode R, and the next triangle to be traversed is the triangle containing l.
[0125] If vertex v corresponding to x has been traversed, and neither the triangle containing l nor the triangle containing r has been traversed, the current triangle is determined to be in S mode. In S mode, the traversal path will generate two branches. First, the triangle containing r is traversed, and the triangle containing l is stored on a stack. After the triangle containing r is traversed, the triangle containing l is traversed again. If vertex v corresponding to x has been traversed, and both the triangle containing l and the triangle containing r have been traversed, the current triangle is determined to be in E mode. At this point, the traversal has reached the end point of the current traversal path branch.
[0126] The following section details how to encode the geometric information corresponding to the second grid:
[0127] Optionally, encoding the geometric information corresponding to the second grid to generate the fourth sub-stream includes:
[0128] For each vertex in the second grid, geometric prediction coding is used to obtain the predicted geometric coordinates corresponding to each vertex;
[0129] Based on the predicted geometric coordinates and the actual geometric coordinates of each vertex, the geometric prediction residual for each vertex is obtained.
[0130] The geometric prediction residual corresponding to each vertex is entropy encoded to generate the fourth sub-code stream.
[0131] In this embodiment, the parallelogram predictive coding algorithm is used to perform geometric coding on the second grid. It should be understood that in other embodiments, the difference predictive coding algorithm, the multi-parallelogram predictive coding algorithm, etc. can also be used for geometric coding, and no specific limitation is made here.
[0132] For easier understanding, please refer to Figure 5 ,like Figure 5 As shown, the second grid includes four vertices a, b, c, and d, which together form the following structure: Figure 5 The two triangles shown.
[0133] The geometric information of points a, b, and c has been encoded, while the geometric information of point d is yet to be encoded. Therefore, the predicted geometric coordinates of point d can be calculated using Formula 4.
[0134] Formula 4: d′(x,y,z)=b(x,y,z)+c(x,y,z)-a(x,y,z)
[0135] Where d′(x,y,z) is the predicted geometric coordinates of point d, a(x,y,z) is the true geometric coordinates of point a, b(x,y,z) is the true geometric coordinates of point b, and c(x,y,z) is the true geometric coordinates of point c.
[0136] Furthermore, the geometric information of point d is encoded to obtain the true geometric coordinates of point d, and the geometric prediction residual corresponding to point d is calculated using Formula 5.
[0137] Formula 5: Δd(x,y,z)=d(x,y,z)-d′(x,y,z)
[0138] Where Δd(x,y,z) is the geometric prediction residual corresponding to point d, d′(x,y,z) is the predicted geometric coordinates corresponding to point d, and d(x,y,z) is the true geometric coordinates of point d.
[0139] Thus, after obtaining the geometric prediction residual corresponding to each vertex, entropy encoding is performed on the geometric prediction residual corresponding to each vertex to generate the fourth sub-code stream.
[0140] The following details how to encode the attribute information corresponding to the second grid:
[0141] Optionally, encoding the attribute information corresponding to the second grid to generate the fifth sub-stream includes:
[0142] Entropy encoding is performed on the attribute prediction residual corresponding to each vertex in the second grid to generate the first target sub-code stream; the attribute prediction residual corresponding to each vertex is determined based on the attribute prediction encoding performed on each vertex.
[0143] The texture map of the second mesh is encoded to generate the second target sub-stream.
[0144] In this embodiment, the attribute information includes texture coordinates and a texture map. The fifth sub-bitstream includes a first target sub-bitstream corresponding to the texture coordinates and a second target sub-bitstream corresponding to the texture map. In this embodiment, based on attribute prediction encoding of each vertex in the second mesh, the attribute prediction residual corresponding to each vertex is determined, and entropy encoding is performed on the attribute prediction residual corresponding to each vertex to generate the first target sub-bitstream. For details on how to generate the first target sub-bitstream, please refer to subsequent embodiments.
[0145] In this embodiment, the texture map of the second grid is encoded to generate the second target sub-code stream.
[0146] Optionally, the first target sub-stream and the second target sub-stream are mixed to obtain the fifth sub-stream.
[0147] One possible scenario is that the attribute information does not include the texture map. In this case, the fifth sub-stream can be generated simply by entropy encoding the attribute prediction residual corresponding to each vertex.
[0148] Optionally, encoding the attribute information corresponding to the second grid to generate the first target sub-stream includes:
[0149] For each vertex in the second grid, attribute prediction encoding is used to obtain the predicted texture coordinates corresponding to each vertex;
[0150] Based on the predicted texture coordinates and the actual texture coordinates of each vertex, the attribute prediction residual for each vertex is obtained.
[0151] Entropy encoding is performed on the attribute prediction residual corresponding to each vertex to generate the first target sub-codestream.
[0152] The following section details how to perform attribute prediction encoding for each vertex:
[0153] First, obtain the initial edge set. Specifically, the initial edge set is obtained as follows:
[0154] Based on the reconstructed geometric information and connection relationships, an initial triangle is selected, the texture coordinates of the three vertices of the initial triangle are encoded, and the three sides of the initial triangle are stored in the edge set.
[0155] It should be noted that, for the initial triangle, the vertices are not predicted in this embodiment of the application. Instead, the texture coordinates are directly encoded. After encoding the texture coordinates of each vertex of the initial triangle, each edge of the initial triangle is stored as an edge set to form an initial edge set. Then, the subsequent vertices are predicted based on the initial edge set.
[0156] The residual between the actual texture coordinates of the vertex to be encoded and the predicted texture coordinates of the vertices of the target triangle.
[0157] It should be noted that after obtaining the predicted texture coordinates of the vertex to be encoded, the residual of the vertex to be encoded can be obtained based on the predicted texture coordinates and the real texture coordinates. The vertex to be encoded can be encoded by encoding the residual, thereby reducing the number of bits for texture coordinate encoding.
[0158] It should be noted that the residual can be the difference between the actual texture coordinates of the vertex to be encoded and the predicted texture coordinates of the opposite vertex of the target triangle. It can be obtained by subtracting the predicted texture coordinates of the opposite vertex of the target triangle from the actual texture coordinates of the vertex to be encoded, or by subtracting the actual texture coordinates of the vertex to be encoded from the predicted texture coordinates of the opposite vertex of the target triangle.
[0159] Optionally, in one embodiment of this application, the method for obtaining the predicted texture coordinates of the vertices of the target triangle corresponding to the first side can be:
[0160] The encoding end obtains the texture coordinates of the projection points of the vertices onto the first side based on the geometric coordinates of each vertex of the target triangle;
[0161] It should be noted that, as Figure 6 As shown, edge NP is an edge selected from the edge set, which can be considered as the first edge mentioned above. Vertices N and P are the two vertices of the first edge, and vertex C is the vertex to be encoded. Vertices N, P, and C form the target triangle mentioned above. Point X is the projection of vertex C onto edge NP, and vertex O is the encoded point. The triangle formed by vertices O, N, and P shares NP edges with the triangle formed by vertices N, P, and C. Based on the above... Figure 6 Optionally, the specific method for obtaining the texture coordinates of the projection point of the vertex on the first side in the embodiments of this application is as follows:
[0162] According to Formula Six: Get the texture coordinates of the projection point of the vertex onto the first side;
[0163] Among them, X uv Let N be the texture coordinates of the projection point of the vertex onto the first side. uv Let N be the texture coordinates of the vertex N on the first side of the target triangle. The vector is the texture coordinates from vertex N on the first side of the target triangle to the projection point X of the vertex on the first side. in, Let N be a vector of the geometric coordinates of vertices N and P on the first edge; It is a vector from vertex N on the first edge to the geometric coordinates of the opposite vertex; It is a vector of texture coordinates from vertex N to vertex P on the first edge.
[0164] The encoder obtains the predicted texture coordinates of the vertices based on the texture coordinates of the projected points;
[0165] According to Formula 7: Get the texture coordinates of the vertex;
[0166] Among them, Pred C For the predicted texture coordinates of the vertices, For the first type of vector value, O is the vector corresponding to the texture coordinates of the first vertex O on the first edge. uv The texture coordinates of the first vertex corresponding to the first side of the target triangle are given. The first vertex O is the opposite vertex of the first side of the first triangle. The first triangle and the target triangle share a common first side. It is a vector from the projection point X of the vertex onto the first side to the texture coordinates of the vertex; This is the second vector value for the vector corresponding to the texture coordinates of the first vertex O on the first edge.
[0167] It should be noted that, based on the above process, the predicted texture coordinates of the point to be encoded are obtained, and the encoding of the point to be encoded can be realized based on the predicted texture coordinates; Optionally, after encoding the point to be encoded based on one edge in the edge set, the encoding end stores the second edge of the target triangle into the edge set and deletes the first edge from the edge set, where the second edge is an edge of the target triangle that is not included in the edge set, thereby realizing the update of the edge set.
[0168] It should be noted that, in the embodiments of this application, the residuals of the vertices to be encoded can be obtained and encoded simultaneously, or all residuals can be obtained first and then encoded uniformly.
[0169] In summary, the specific implementation process of texture coordinate (hereinafter referred to as UV coordinate) encoding in this embodiment is as follows:
[0170] Step S1: Select an initial triangle from the reconstructed connection relationships, directly encode the UV coordinates of the three vertices of the initial triangle without prediction, and then store the edges of the initial triangle into the edge set.
[0171] Step S2: Select edge τ from the edge set according to the access criteria, encode the UV coordinates of the vertices of the new triangle formed by τ, and calculate the predicted UV coordinates of the point to be encoded in the manner described above using the projection relationship of the triangle from three-dimensional to two-dimensional. Subtract the predicted UV coordinates from the original value (i.e. the true UV coordinates) of the UV coordinates of the point to be encoded to obtain the residual.
[0172] Step S3: Add the two sides of the new triangle to the edge set, remove the top edge τ from the edge set; then take the next edge from the edge set, continue to encode the predicted UV coordinates of the vertices of the triangle adjacent to this edge, obtain the residual, return to step S3, and repeat step S3 until the residuals of all vertices are obtained.
[0173] Step S4: Entropy-encode the UV coordinate residuals and output the UV coordinate bitstream.
[0174] Optionally, the step of lossless encoding the first grid to generate the target bitstream includes:
[0175] When the first grid is a three-dimensional network including a manifold structure, the connection relationship corresponding to the first grid is encoded to generate a third bitstream;
[0176] Encode the geometric information corresponding to the first grid to generate a fourth bitstream;
[0177] Encode the attribute information corresponding to the first grid to generate the fifth bitstream;
[0178] The target bitstream is generated based on the third bitstream, the fourth bitstream, and the fifth bitstream.
[0179] In this embodiment, when the first grid is a 3D network including a manifold structure, it means that there is no need to split the first grid. In this case, the connection relationship corresponding to the first grid can be directly encoded to generate the third bitstream; the geometric information corresponding to the first grid can be encoded to generate the fourth bitstream; the attribute information corresponding to the first grid can be encoded to generate the fifth bitstream; the third, fourth, and fifth bitstreams are mixed to generate the target bitstream.
[0180] Please see Figure 7 , Figure 7 This is a flowchart of the lossless decoding method in this embodiment. The lossless decoding method provided in this embodiment includes the following steps:
[0181] S701 performs lossless decoding on the target bitstream to obtain the first grid.
[0182] In this step, the decoding end performs lossless decoding on the target bitstream to obtain the first grid. For the specific lossless decoding method, please refer to the subsequent embodiments.
[0183] S702, Recover the duplicate vertices in the first mesh to obtain the target mesh;
[0184] It should be noted that the aforementioned repeated vertices are vertices with the same corresponding geometric coordinates in the target mesh. After obtaining the first mesh, the repeated vertices in the first mesh are restored to obtain the target mesh. For a detailed implementation method for restoring repeated vertices, please refer to the following embodiments.
[0185] Optionally, recovering duplicate vertices in the first mesh to obtain the target mesh includes:
[0186] While decoding the attribute information of the first mesh, the first mesh is traversed, and the geometric vertices corresponding to multiple texture coordinate vertices are determined as target vertices;
[0187] Create a duplicate vertex with the same geometric coordinates as the target vertex, and update the connection relationship corresponding to the first mesh according to the connection relationship corresponding to the texture coordinates of the duplicate vertex to obtain the target mesh.
[0188] In this embodiment, when decoding the attribute information of the first grid, the texture coordinates of each vertex in the first grid can be obtained. In this case, the encoder traverses the first grid to determine the correspondence between texture coordinate vertices and geometric vertices. If there are geometric vertices corresponding to multiple texture coordinate vertices, the aforementioned geometric vertices are determined as target vertices.
[0189] Create duplicate vertices with the same geometric coordinates as the target vertex, and update the connection relationship of the first mesh according to the connection relationship corresponding to the texture coordinates of the duplicate vertices, so that the geometric vertices and texture coordinate vertices correspond one-to-one, thus obtaining the target mesh.
[0190] Optionally, recovering duplicate vertices in the first mesh to obtain the target mesh includes:
[0191] Decode the identifier stream to obtain the first identifier corresponding to each vertex in the first grid;
[0192] Based on the first identifier corresponding to each vertex, repeating vertices are created to obtain the target mesh.
[0193] In this embodiment, when the target bitstream includes an identifier bitstream, the identifier bitstream is decoded to obtain a first identifier corresponding to each vertex in the first grid, wherein the first identifier is used to characterize the number of times the corresponding vertex is repeated. Further, based on the first identifier corresponding to each vertex, repeating vertices corresponding to that vertex are created to obtain the target grid.
[0194] For example, if the first identifier corresponding to a vertex indicates that the vertex is repeated 0 times, then no duplicate vertex corresponding to that vertex will be created; if the first identifier corresponding to a vertex indicates that the vertex is repeated 1 times, then a vertex with the same geometric coordinates as that vertex will be created.
[0195] Optionally, the lossless decoding of the target bitstream to obtain the first grid includes:
[0196] The target bitstream is decomposed to obtain the sixth bitstream and the seventh bitstream;
[0197] Decode the sixth bitstream and the seventh bitstream respectively to obtain the grid information corresponding to the sixth bitstream and the vertex information of the second vertex corresponding to the seventh bitstream;
[0198] Based on the grid information, reconstruct the second grid;
[0199] Based on the vertex information of the second vertex, the second vertices in the second grid are merged to obtain the first grid.
[0200] After obtaining the target bitstream, the decoding end decomposes the target bitstream to obtain the sixth and seventh bitstreams.
[0201] The sixth bitstream is decoded to obtain the mesh information; the seventh bitstream is decoded to obtain the vertex information of the second vertex. The second vertex is obtained by splitting the first mesh into a second mesh. The second vertex is a newly added vertex in the second mesh relative to the first mesh. The second vertex includes vertices added after dividing the geometric coordinates of each vertex of the first mesh, and vertices added after dividing the texture coordinates of each vertex of the first mesh.
[0202] As mentioned above, mesh information includes connectivity, geometric information, and attribute information. Using the connectivity, geometric, and attribute information of the second mesh, the second mesh can be directly reconstructed.
[0203] Optionally, decoding the seventh bitstream to obtain the vertex information of the second vertex corresponding to the seventh bitstream includes:
[0204] When the target identifier is used to characterize the first mesh as a three-dimensional mesh including a non-manifold structure, the sixth sub-stream is decoded to obtain the vertex information of the second vertex.
[0205] It should be understood that the seventh code stream includes a target identifier and a sixth sub-code stream. When the target identifier is used to characterize the first grid as a three-dimensional grid including a non-manifold structure, the sixth sub-code stream is decoded to obtain the vertex information of the second vertex.
[0206] Optionally, if the target identifier is 1, it indicates that the first grid is a three-dimensional grid including non-manifold structures. In this case, the sixth sub-stream is decoded. If the target identifier is 0, it indicates that the first grid is a three-dimensional grid including only manifold structures. In this case, the sixth sub-stream does not need to be decoded.
[0207] Optionally, the step of merging the second vertices in the second grid according to the vertex information of the second vertex to obtain the first grid includes:
[0208] Analyze the vertex information of the second vertex to determine the second vertex in the second grid;
[0209] The target vertex is obtained by querying the geometric coordinates of the second vertex in the mapping table.
[0210] Update the index corresponding to the second vertex to the index corresponding to the target vertex;
[0211] Based on the index of each vertex in the second grid, the connection relationship of the second grid is updated to obtain the first grid.
[0212] In this embodiment, firstly, the vertex information of the second vertex is parsed to determine the second vertex. The second vertex can be understood as a newly added vertex obtained by splitting the first grid into a second grid. It should be understood that vertices in the second grid other than the second vertex can be referred to as non-newly added vertices.
[0213] It should be understood that after decoding the sixth and seventh bitstreams, a mapping table can be obtained based on the decoding results. This mapping table stores the mapping relationship between the geometric coordinates of each vertex and the index of each vertex. Optionally, this mapping table can be a hash table.
[0214] If the current vertex is a newly added second vertex, the geometric coordinates of the second vertex are queried in the mapping table to obtain the target vertex, where the geometric coordinates of the target vertex are the same as those of the second vertex; and the index of the second vertex is updated to the index of the target vertex. If multiple vertices with the same geometric coordinates as the second vertex are found by querying the mapping table, one vertex can be randomly selected as the target vertex from these multiple vertices. In this embodiment, the merging of the second vertices is achieved by updating the index of the second vertex.
[0215] If the current vertex is not the newly added second vertex, then the index corresponding to the current vertex is not updated.
[0216] Furthermore, after traversing each vertex in the second mesh, the connection relationships corresponding to the second mesh are updated, and the geometric information list and texture coordinate list are updated to obtain the first mesh.
[0217] Optionally, decoding the sixth bitstream to obtain the grid information corresponding to the sixth bitstream includes:
[0218] Decode the seventh sub-stream to obtain the connection relationship corresponding to the second grid;
[0219] Decode the eighth sub-code stream to obtain the geometric information corresponding to the second grid;
[0220] Decode the ninth sub-code stream to obtain the attribute information corresponding to the second grid.
[0221] As mentioned above, the grid information includes connectivity, geometric information, and attribute information. The sixth code stream includes the seventh sub-code stream corresponding to connectivity, the eighth sub-code stream corresponding to geometric information, and the ninth sub-code stream corresponding to attribute information.
[0222] Decode the seventh sub-stream to obtain the connection relationship corresponding to the second grid; decode the eighth sub-stream to obtain the geometric information corresponding to the second grid; decode the ninth sub-stream to obtain the attribute information corresponding to the second grid.
[0223] Optionally, decoding the seventh sub-stream to obtain the connection relationship corresponding to the second grid includes:
[0224] Decode the seventh sub-stream to obtain the target string;
[0225] The target string is decoded to reconstruct the connection relationship corresponding to the second grid.
[0226] It should be understood that the target string mentioned above is used to characterize the connection relationship corresponding to the second grid.
[0227] The decoding end uses the same decoding method as the encoding end to decode the connection relationship to decode the seventh sub-stream and obtain the target string, which will not be repeated here.
[0228] Optionally, decoding the eighth sub-stream to obtain the geometric information corresponding to the second grid includes:
[0229] Entropy decoding is performed on the eighth sub-stream to obtain the geometric prediction residual corresponding to each vertex in the second grid;
[0230] For each vertex, geometric prediction decoding is performed to obtain the predicted geometric coordinates corresponding to each vertex;
[0231] Based on the geometric prediction residual and predicted geometric coordinates corresponding to each vertex, the true geometric coordinates corresponding to each vertex are obtained.
[0232] It should be understood that the actual geometric coordinates corresponding to each vertex are used to represent the geometric information corresponding to the second grid.
[0233] The decoding end uses the same decoding method as the encoding end to decode the geometric information to decode the eighth sub-code stream, thereby obtaining the geometric information corresponding to the second grid. This will not be repeated here.
[0234] Optionally, decoding the ninth sub-codestream to obtain the attribute information corresponding to the second grid includes:
[0235] Decompose the ninth sub-codestream to obtain the third target sub-codestream and the fourth target sub-codestream;
[0236] Based on the attribute prediction residual corresponding to each vertex in the second grid, the true texture coordinates corresponding to each vertex are obtained; the attribute prediction residual corresponding to each vertex is determined based on decoding the third target sub-bitstream;
[0237] Decode the fourth target sub-stream to obtain the texture map of the second mesh.
[0238] In this embodiment, the attribute information includes texture coordinates and texture map, and the ninth sub-code stream includes the third target sub-code stream corresponding to the texture coordinates and the fourth target sub-code stream corresponding to the texture map.
[0239] In this embodiment, the third target sub-stream is decoded to determine the attribute prediction residual corresponding to each vertex, and then the real texture coordinates corresponding to each vertex are obtained based on the attribute prediction residual corresponding to each vertex.
[0240] Decode the fourth target sub-stream to obtain the texture map of the second grid.
[0241] One possible scenario is that the ninth sub-stream does not include the fourth target sub-stream, meaning the attribute information does not include the texture map. In this case, the attribute information corresponding to the second mesh can be obtained simply by decoding the third target sub-stream.
[0242] Optionally, obtaining the true texture coordinates corresponding to each vertex based on the attribute prediction residual corresponding to each vertex in the second mesh includes:
[0243] Entropy decoding is performed on the third target sub-stream to obtain the attribute prediction residual corresponding to each vertex in the second grid;
[0244] For each vertex, attribute prediction decoding is performed to obtain the predicted texture coordinates corresponding to each vertex;
[0245] Based on the attribute prediction residual and predicted texture coordinates corresponding to each vertex, the actual texture coordinates corresponding to each vertex are obtained.
[0246] In this embodiment, the decoding end uses the decoding method corresponding to the encoding end's method of encoding texture information to decode the third target sub-code stream, and obtains the real texture coordinates corresponding to each vertex, which will not be repeated here.
[0247] Optionally, the lossless decoding of the target bitstream to obtain the first grid includes:
[0248] The decoding end decomposes the target bitstream to obtain the sixth bitstream, the seventh bitstream, and the eighth bitstream;
[0249] The decoding end decodes the sixth bitstream to obtain the connection relationship corresponding to the first grid;
[0250] The decoding end decodes the seventh bitstream to obtain the geometric information corresponding to the first grid.
[0251] The decoding end decodes the eighth bitstream to obtain the attribute information corresponding to the first grid.
[0252] The decoding end generates a first mesh based on the connection relationship, the geometric information, and the attribute information.
[0253] In this embodiment, when the first grid is a three-dimensional network including a manifold structure, the target bitstream can be directly decomposed to obtain the sixth, seventh, and eighth bitstreams. The sixth, seventh, and eighth bitstreams are then decoded to obtain the connection relationships, geometric information, and attribute information corresponding to the first grid. Based on the connection relationships, geometric information, and attribute information, the first grid is reconstructed and generated.
[0254] The lossless encoding method provided in this application can be executed by a lossless encoding device. This application uses a lossless encoding device to execute the encoding method as an example to illustrate the lossless encoding device provided in this application.
[0255] like Figure 8 As shown in the figure, this application embodiment also provides a lossless encoding device 800, including:
[0256] The acquisition module 801 is used to traverse the target mesh and acquire the geometric coordinates of each vertex in the target mesh;
[0257] Module 802 is used to identify vertices with the same geometric coordinates as duplicate vertices;
[0258] Merging module 803 is used to merge the duplicate vertices in the target mesh to obtain a first mesh;
[0259] The encoding module 804 is used to perform lossless encoding on the first grid to generate the target bitstream.
[0260] Optionally, the merging module 803 is specifically used for:
[0261] When the geometric coordinates and texture coordinates of each vertex in the target mesh correspond one-to-one, duplicate vertices with the same geometric coordinates in the target mesh are merged into one vertex without changing the texture coordinates of the duplicate vertices, thus obtaining the first mesh.
[0262] Optionally, the merging module 803 is further specifically used for:
[0263] Merge duplicate vertices with the same geometric coordinates in the target mesh into one vertex to obtain the first mesh;
[0264] The first identifier corresponding to each vertex in the first grid is encoded to generate an identifier bitstream, whereby the first identifier is used to represent the number of times the corresponding vertex is repeated.
[0265] Optionally, the encoding module 804 is specifically used for:
[0266] In the case where the first grid is a three-dimensional network including a non-manifold structure, the first grid is split into a second grid;
[0267] The grid information corresponding to the second grid and the vertex information of the first vertex are encoded respectively to obtain the first bitstream corresponding to the grid information and the second bitstream corresponding to the vertex information of the first vertex.
[0268] A target bitstream is generated based on the first bitstream and the second bitstream.
[0269] Optionally, the encoding module 804 is specifically used for:
[0270] The non-manifold structure represented by the second identifier in the first grid is split to obtain the second grid.
[0271] Optionally, the encoding module 802 is specifically used for:
[0272] Generate a target identifier based on the non-manifold structure included in the first grid;
[0273] Entropy encoding is performed on the index corresponding to the first vertex to obtain the first sub-codestream;
[0274] A second bitstream is generated based on the target identifier and the first sub-bitstream.
[0275] Optionally, the encoding module 802 is further specifically used for:
[0276] Generate a target identifier based on the non-manifold structure included in the first grid;
[0277] Entropy encoding is performed on the flag bits corresponding to each vertex in the second grid to obtain the second sub-code stream;
[0278] A second bitstream is generated based on the target identifier and the second sub-bitstream.
[0279] Optionally, the encoding module 802 is further specifically used for:
[0280] Encode the connection relationships corresponding to the second grid to generate the third sub-stream;
[0281] Encode the geometric information corresponding to the second grid to generate the fourth sub-code stream;
[0282] The attribute information corresponding to the second grid is encoded to generate the fifth sub-code stream.
[0283] Optionally, the encoding module 802 is further specifically used for:
[0284] When the first grid is a three-dimensional network including a manifold structure, the connection relationship corresponding to the first grid is encoded to generate a third bitstream;
[0285] The encoding end encodes the geometric information corresponding to the first grid to generate a fourth bitstream;
[0286] The encoding end encodes the attribute information corresponding to the first grid to generate a fifth bitstream;
[0287] The encoding end generates the target bitstream based on the third bitstream, the fourth bitstream, and the fifth bitstream.
[0288] In this embodiment, the target mesh is traversed to obtain the geometric coordinates of each vertex in the target mesh; vertices with the same geometric coordinates are identified as duplicate vertices; the duplicate vertices in the target mesh are merged to obtain the first mesh, so that each duplicate vertex will not be encoded multiple times in the subsequent lossless encoding process of the first mesh, thereby improving the encoding efficiency.
[0289] This device embodiment is the same as the one described above. Figure 1 The lossless encoding method embodiment shown above can be applied to the device embodiment in terms of the implementation process and implementation method of the encoding end, and can achieve the same technical effect.
[0290] The lossless decoding method provided in this application can be executed by a lossless decoding device. This application uses an example of a lossless decoding device executing the lossless decoding method to illustrate the lossless decoding device provided in this application.
[0291] like Figure 9 As shown, this application embodiment also provides a lossless decoding device 900, including:
[0292] Decoding module 901 is used to perform lossless decoding of the target bitstream to obtain the first grid.
[0293] Recovery module 902 is used to recover duplicate vertices in the first mesh to obtain the target mesh.
[0294] Optionally, the recovery module 902 is specifically used for:
[0295] While decoding the attribute information of the first mesh, the first mesh is traversed, and the geometric vertices corresponding to multiple texture coordinate vertices are determined as target vertices;
[0296] Create a duplicate vertex with the same geometric coordinates as the target vertex, and update the connection relationship corresponding to the first mesh according to the connection relationship corresponding to the texture coordinates of the duplicate vertex to obtain the target mesh.
[0297] Optionally, the recovery module 902 is further specifically used for:
[0298] Decode the identifier stream to obtain the first identifier corresponding to each vertex in the first grid;
[0299] Based on the first identifier corresponding to each vertex, repeating vertices are created to obtain the target mesh.
[0300] Optionally, the decoding module 901 is specifically used for:
[0301] The target bitstream is decomposed to obtain the sixth bitstream and the seventh bitstream;
[0302] Decode the sixth bitstream and the seventh bitstream respectively to obtain the grid information corresponding to the sixth bitstream and the vertex information of the second vertex corresponding to the seventh bitstream;
[0303] Based on the grid information, reconstruct the second grid;
[0304] Based on the vertex information of the second vertex, the second vertices in the second grid are merged to obtain the first grid.
[0305] Optionally, the decoding module 901 is further specifically used for:
[0306] When the target identifier is used to characterize the first mesh as a three-dimensional mesh including a non-manifold structure, the sixth sub-stream is decoded to obtain the vertex information of the second vertex.
[0307] Optionally, the decoding module 901 is specifically used for:
[0308] Analyze the vertex information of the second vertex to determine the second vertex in the second grid;
[0309] The target vertex is obtained by querying the geometric coordinates of the second vertex in the mapping table.
[0310] Update the index corresponding to the second vertex to the index corresponding to the target vertex;
[0311] Based on the index of each vertex in the second grid, the connection relationship of the second grid is updated to obtain the first grid.
[0312] Optionally, the third code stream includes a seventh sub-code stream, an eighth sub-code stream, and a ninth sub-code stream;
[0313] The decoding module 901 is also specifically used for:
[0314] Decode the seventh sub-stream to obtain the connection relationship corresponding to the second grid;
[0315] Decode the eighth sub-code stream to obtain the geometric information corresponding to the second grid;
[0316] Decode the ninth sub-code stream to obtain the attribute information corresponding to the second grid.
[0317] Optionally, the decoding module 901 is further specifically used for:
[0318] The target bitstream is decomposed to obtain the sixth bitstream, the seventh bitstream, and the eighth bitstream;
[0319] Decode the sixth bitstream to obtain the connection relationship corresponding to the first grid;
[0320] Decode the seventh bitstream to obtain the geometric information corresponding to the first grid;
[0321] Decode the eighth bitstream to obtain the attribute information corresponding to the first grid;
[0322] A first mesh is generated based on the connection relationships, the geometric information, and the attribute information.
[0323] The lossless encoding device and lossless decoding device in the embodiments of this application can be electronic devices, such as electronic devices with an operating system, or components in electronic devices, such as integrated circuits or chips. The electronic device can be a terminal or other devices besides a terminal. For example, the terminal can include, but is not limited to, the types of terminals listed above, and other devices can be servers, network attached storage (NAS), etc. The embodiments of this application do not specifically limit the types of devices.
[0324] The lossless decoding device provided in this application embodiment can achieve Figure 7 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0325] Optionally, such as Figure 10 As shown, this application embodiment also provides a communication device 1000, including a processor 1001 and a memory 1002. The memory 1002 stores a program or instructions that can run on the processor 1001. For example, when the communication device 1000 is a terminal, when the program or instructions are executed by the processor 1001, they implement the various steps of the above-described lossless encoding method embodiment and achieve the same technical effect, or implement the various steps of the above-described lossless decoding method embodiment and achieve the same technical effect.
[0326] This application embodiment also provides a terminal, including a processor 1001 and a communication interface, wherein the processor 1001 is used to perform the following operations:
[0327] Traverse the target mesh and obtain the geometric coordinates of each vertex in the target mesh;
[0328] Vertices with the same geometric coordinates are identified as repeating vertices;
[0329] Merge the duplicate vertices in the target mesh to obtain the first mesh;
[0330] The first grid is lossless encoded to generate the target bitstream.
[0331] Alternatively, processor 1001 is used to perform the following operations:
[0332] Lossless decoding of the target bitstream yields the first grid.
[0333] Restore the duplicate vertices in the first mesh to obtain the target mesh;
[0334] This terminal embodiment corresponds to the aforementioned terminal-side method embodiment. All implementation processes and methods of the aforementioned method embodiments can be applied to this terminal embodiment and achieve the same technical effect. Specifically, Figure 11A schematic diagram of the hardware structure of a terminal to implement an embodiment of this application.
[0335] The terminal 1100 includes, but is not limited to, the following components: radio frequency unit 1101, network module 1102, audio output unit 1103, input unit 1104, sensor 1105, display unit 1106, user input unit 1107, interface unit 1107, memory 1109, and processor 1110.
[0336] Those skilled in the art will understand that the terminal 1100 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1110 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 11 The terminal structure shown does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0337] It should be understood that, in this embodiment, the input unit 1104 may include a graphics processing unit (GPU) 11041 and a microphone 11042. The GPU 11041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1106 may include a display panel 11061, which may be configured as a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1107 includes at least one of a touch panel 11071 and other input devices 11072. The touch panel 11071 is also called a touch screen. The touch panel 11071 may include a touch detection device and a touch controller. Other input devices 11072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0338] In this embodiment, after receiving downlink data from the network-side device, the radio frequency unit 1101 can transmit it to the processor 1110 for processing; the radio frequency unit 1101 can also send uplink data to the network-side device. Typically, the radio frequency unit 1101 includes, but is not limited to, antennas, amplifiers, transceivers, couplers, low-noise amplifiers, and duplexers.
[0339] The memory 1109 can be used to store software programs or instructions and various data. The memory 1109 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback function, image playback function, etc.). Furthermore, the memory 1109 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1109 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0340] Processor 1110 may include one or more processing units; optionally, processor 1110 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1110.
[0341] The processor 1110 is used to perform the following operations:
[0342] Traverse the target mesh and obtain the geometric coordinates of each vertex in the target mesh;
[0343] Vertices with the same geometric coordinates are identified as repeating vertices;
[0344] Merge the duplicate vertices in the target mesh to obtain the first mesh;
[0345] The first grid is lossless encoded to generate the target bitstream.
[0346] Alternatively, processor 1110 is used to perform the following operations:
[0347] Lossless decoding of the target bitstream yields the first grid.
[0348] Restore the duplicate vertices in the first mesh to obtain the target mesh;
[0349] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described lossless encoding method embodiments or the various processes of the above-described lossless decoding method embodiments, and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0350] The processor is the processor in the terminal described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0351] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above lossless encoding method embodiment or the various processes of the above lossless decoding method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0352] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0353] This application also provides a computer program / program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the lossless encoding method embodiment described above, or to implement the various processes of the lossless decoding method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0354] This application also provides a system comprising an encoding end and a decoding end. The encoding end executes the various processes of the lossless encoding method embodiment described above, and the decoding end executes the various processes of the lossless decoding method embodiment described above, achieving the same technical effect. To avoid repetition, these will not be described again here.
[0355] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0356] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0357] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A lossless encoding method, characterized in that, include: The encoding end traverses the target mesh to obtain the geometric coordinates of each vertex in the target mesh; The encoding end identifies vertices with the same geometric coordinates as duplicate vertices; The encoding end merges the duplicate vertices in the target grid to obtain a first grid; The encoding end performs lossless encoding on the first grid to generate the target bitstream; Wherein, merging the duplicate vertices in the target mesh to obtain the first mesh includes: The encoding end merges duplicate vertices with the same geometric coordinates in the target mesh into one vertex to obtain the first mesh; The encoding end encodes the first identifier corresponding to each vertex in the first grid to generate an identifier code stream, whereby the first identifier is used to represent the number of times the corresponding vertex is repeated. The target bitstream includes the identifier bitstream.
2. The method according to claim 1, characterized in that, The process of merging the duplicate vertices in the target mesh to obtain the first mesh includes: When the geometric coordinates and texture coordinates of each vertex in the target mesh correspond one-to-one, the encoding end merges the duplicate vertices with the same geometric coordinates in the target mesh into one vertex without changing the texture coordinates of the duplicate vertices, thus obtaining the first mesh.
3. The method according to claim 1, characterized in that, The step of performing lossless encoding on the first grid to generate the target bitstream includes: When the first grid is a three-dimensional grid including a non-manifold structure, the encoding end splits the first grid into a second grid; the second grid is a three-dimensional grid including a manifold structure. The encoding end encodes the grid information corresponding to the second grid and the vertex information of the first vertex respectively to obtain the first bitstream corresponding to the grid information and the second bitstream corresponding to the vertex information of the first vertex, wherein the first vertex is a vertex added to the second grid relative to the first grid; The encoding end generates the target bitstream based on the first bitstream and the second bitstream.
4. The method according to claim 3, characterized in that, The step of splitting the first grid into a second grid includes: The encoding end splits the non-manifold structure represented by the second identifier in the first grid to obtain the second grid; The second identifier is used to characterize the non-manifold structure generated by merging the repeating vertices in the first mesh.
5. The method according to claim 3, characterized in that, Encoding the vertex information of the first vertex to obtain the second bitstream corresponding to the vertex information of the first vertex includes: The encoding end generates a target identifier based on the non-manifold structure included in the first grid; The encoding end performs entropy encoding on the index corresponding to the first vertex to obtain the first sub-code stream; The encoding end generates a second bitstream based on the target identifier and the first sub-bitstream.
6. The method according to claim 3, characterized in that, Encoding the vertex information of the first vertex to obtain the second bitstream corresponding to the vertex information of the first vertex includes: The encoding end generates a target identifier based on the non-manifold structure included in the first grid; The encoding end performs entropy encoding on the flag bit corresponding to each vertex in the second grid to obtain the second sub-code stream; the flag bit is used to indicate whether the corresponding vertex is the first vertex. The encoding end generates a second bitstream based on the target identifier and the second sub-bitstream.
7. The method according to claim 3, characterized in that, The first bitstream includes a third sub-bitstream, a fourth sub-bitstream, and a fifth sub-bitstream, and the grid information includes connectivity, geometric information, and attribute information; Encoding the grid information corresponding to the second grid to obtain the first bitstream corresponding to the grid information includes: The encoding end encodes the connection relationship corresponding to the second grid to generate the third sub-code stream; The encoding end encodes the geometric information corresponding to the second grid to generate the fourth sub-code stream; The encoding end encodes the attribute information corresponding to the second grid to generate the fifth sub-code stream.
8. The method according to claim 1, characterized in that, The step of performing lossless encoding on the first grid to generate the target bitstream includes: When the first grid is a three-dimensional grid including a manifold structure, the encoding end encodes the connection relationship corresponding to the first grid to generate a third bitstream. The encoding end encodes the geometric information corresponding to the first grid to generate a fourth bitstream; The encoding end encodes the attribute information corresponding to the first grid to generate a fifth bitstream; The encoding end generates the target bitstream based on the third bitstream, the fourth bitstream, and the fifth bitstream.
9. A lossless decoding method, characterized in that, include: The decoding end performs lossless decoding on the target bitstream to obtain the first grid. The decoding end recovers the repeating vertices in the first grid to obtain the target grid; Wherein, the repeating vertices are vertices in the target mesh that have the same corresponding geometric coordinates; Wherein, the target bitstream includes an identifier bitstream, and the step of recovering the repeating vertices in the first grid to obtain the target grid includes: The decoding end decodes the identifier bitstream to obtain a first identifier corresponding to each vertex in the first grid; the first identifier is used to represent the number of times the corresponding vertex is repeated; The decoding end creates repeating vertices based on the first identifier corresponding to each vertex to obtain the target mesh.
10. The method according to claim 9, characterized in that, The step of restoring duplicate vertices in the first mesh to obtain the target mesh includes: When decoding the attribute information of the first mesh, the decoding end traverses the first mesh and determines the geometric vertices corresponding to multiple texture coordinate vertices as target vertices. The decoding end creates a duplicate vertex with the same geometric coordinates as the target vertex, and updates the connection relationship corresponding to the first mesh according to the connection relationship corresponding to the texture coordinates of the duplicate vertex, thereby obtaining the target mesh.
11. The method according to claim 9, characterized in that, The lossless decoding of the target bitstream to obtain the first grid includes: The decoding end decomposes the target bitstream to obtain the sixth bitstream and the seventh bitstream; The decoding end decodes the sixth bitstream and the seventh bitstream respectively to obtain the grid information corresponding to the sixth bitstream and the vertex information of the second vertex corresponding to the seventh bitstream; The decoding end reconstructs the second grid based on the grid information; The decoding end merges the second vertices in the second grid according to the vertex information of the second vertex to obtain the first grid; Wherein, the first mesh is a three-dimensional mesh including a non-manifold structure, the second mesh is a three-dimensional mesh including a manifold structure, and the second vertex is obtained by splitting the first mesh into the second mesh.
12. The method according to claim 11, characterized in that, The seventh code stream includes a target identifier and a sixth sub-code stream; The decoding end decodes the seventh bitstream to obtain the vertex information of the second vertex corresponding to the seventh bitstream, including: When the target identifier is used to characterize the first mesh as a three-dimensional mesh including a non-manifold structure, the decoding end decodes the sixth sub-code stream to obtain the vertex information of the second vertex.
13. The method according to claim 11, characterized in that, The step of merging the second vertices in the second grid based on the vertex information of the second vertex to obtain the first grid includes: The decoding end parses the vertex information of the second vertex to determine the second vertex in the second grid; The decoding end queries the mapping table for the geometric coordinates of the second vertex to obtain the target vertex; the mapping table is obtained based on decoding the sixth and seventh bitstreams, and the mapping table stores the mapping relationship between the geometric coordinates of each vertex and the index of each vertex; the geometric coordinates of the target vertex are the same as the geometric coordinates of the second vertex. The decoding end updates the index corresponding to the second vertex to the index corresponding to the target vertex; The decoding end updates the connection relationship of the second grid based on the index of each vertex in the second grid to obtain the first grid.
14. The method according to claim 11, characterized in that, The sixth code stream includes a seventh sub-code stream, an eighth sub-code stream, and a ninth sub-code stream, and the grid information includes connection relationships, geometric information, and attribute information; Decoding the sixth bitstream to obtain the corresponding grid information includes: The decoding end decodes the seventh sub-stream to obtain the connection relationship corresponding to the second grid; The decoding end decodes the eighth sub-code stream to obtain the geometric information corresponding to the second grid. The decoding end decodes the ninth sub-code stream to obtain the attribute information corresponding to the second grid.
15. The method according to claim 9, characterized in that, The lossless decoding of the target bitstream to obtain the first grid includes: The decoding end decomposes the target bitstream to obtain the sixth bitstream, the seventh bitstream, and the eighth bitstream; The decoding end decodes the sixth bitstream to obtain the connection relationship corresponding to the first grid; The decoding end decodes the seventh bitstream to obtain the geometric information corresponding to the first grid. The decoding end decodes the eighth bitstream to obtain the attribute information corresponding to the first grid. The decoding end generates a first mesh based on the connection relationship, the geometric information, and the attribute information. The first mesh is a three-dimensional mesh including a manifold structure.
16. A lossless encoding device, characterized in that, include: The acquisition module is used to traverse the target mesh and obtain the geometric coordinates of each vertex in the target mesh; The determination module is used to identify vertices with the same geometric coordinates as duplicate vertices; The merging module is used to merge the duplicate vertices in the target mesh to obtain a first mesh; The encoding module is used to perform lossless encoding on the first grid to generate the target bitstream; Specifically, the merging module is used for: Merge duplicate vertices with the same geometric coordinates in the target mesh into one vertex to obtain the first mesh; Encode the first identifier corresponding to each vertex in the first grid to generate an identifier code stream. The first identifier is used to represent the number of times the corresponding vertex is repeated. The target bitstream includes the identifier bitstream.
17. A lossless decoding device, characterized in that, include: The decoding module is used for lossless decoding of the target bitstream to obtain the first grid. The recovery module is used to recover the duplicate vertices in the first mesh to obtain the target mesh; Wherein, the repeating vertices are vertices in the target mesh that have the same corresponding geometric coordinates; The target bitstream includes an identifier bitstream, and the recovery module is specifically used for: Decode the identifier stream to obtain the first identifier corresponding to each vertex in the first grid; the first identifier is used to represent the number of times the corresponding vertex is repeated; Based on the first identifier corresponding to each vertex, repeating vertices are created to obtain the target mesh.
18. A terminal, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the lossless encoding method as described in any one of claims 1-8, or to implement the steps of the lossless decoding method as described in any one of claims 9-15.
19. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the lossless encoding method as described in any one of claims 1-8, or the steps of the lossless decoding method as described in any one of claims 9-15.
20. A system, characterized in that, The system includes an encoding end and a decoding end, wherein the encoding end performs the steps of the lossless encoding method as described in any one of claims 1-8, and the decoding end performs the steps of the lossless decoding method as described in any one of claims 9-15.