Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the application, fall within the scope of protection of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the "first" and "second" distinguishing between objects generally are not limited in number to the extent that the first object may, for example, be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/" generally means a relationship in which the associated object is an "or" before and after.
The codec end corresponding to the mesh codec method in the embodiment of the present application may be a terminal, which may also be referred to as a terminal device or a User Equipment (UE), and the terminal may be a Mobile phone, a tablet pc (Tablet Personal Computer), a Laptop (Laptop Computer) or a terminal-side device called a notebook, a Personal digital assistant (Personal DIGITAL ASSISTANT, PDA), a palm Computer, a netbook, an ultra-Mobile Personal Computer, a UMPC, a Mobile internet device (Mobile INTERNET DEVICE, MID), a wearable device (Wearable Device) or a vehicle-mounted device (VUE), a pedestrian terminal (PUE), and the wearable device includes: smart watches, bracelets, headphones, eyeglasses, etc. It should be noted that, the embodiment of the present application is not limited to a specific type of terminal.
For ease of understanding, some of the following descriptions are directed to embodiments of the present application:
(1) Open source three-dimensional grid compression tool (Draco)
Draco respectively encoding and storing the connection information, the geometric information and the UV coordinates of the three-dimensional grid. The key module, namely the module for encoding the connection information, uses Edgebreaker algorithm. The geometric information and UV coordinates are encoded by conventional compression methods, namely quantization, predictive compression (parallelogram prediction) and entropy coding of the data. Since Draco adopts the coding method driven by the connection relation, the coding of the geometric information and the UV coordinates follows the coding sequence of the connection information. In this way, the vertex sequence of the connection relation code is implicit in the vertex sequence of the geometric information to avoid separately transmitting the vertex sequence of the connection relation code, thereby saving the bit overhead of the part.
(2)Edgebreaker(EB)
The Edgebreaker method is a three-dimensional grid connection relation coding method and has the advantages of good compression performance, convenient implementation, capability of giving an upper limit of a compression ratio and the like. The Edgebreaker method only describes a compression method of the three-dimensional grid connection information, and the compression of the three-dimensional grid can be realized through geometric information compression, entropy coding and the like.
The Edgebreaker encoding technique can achieve 2 bits per triangle or less of compression efficiency on triangle meshes that are co-embryo with spheres. The encoding algorithm accesses each triangle of the mesh in depth-first order using five different modes (referred to as C, L, E, R and S). And marking each triangle according to the mode of the triangle, and generating CLERS character strings to obtain compact representation of the grid connection relation.
Five modes of the Edgebreaker method are shown in figure 1. The Edgebreaker method separates the mesh into a traversed portion and a non-traversed portion, the boundary of the two portions being referred to as the active boundary. In the encoding process of Edgebreaker, the triangle to be traversed is accessed through the active edge on the active boundary, and which mode is used is selected according to the relation between the active edge and the triangle in which it is located. The other vertex in the triangle where the active edge is located is referred to as the third vertex. If the third vertex is not on the active boundary, then the current triangle is marked as C-mode. If the third vertex is on the active boundary and, in a counter-clockwise order, is next to the currently active edge vertex, then the current triangle is marked as R-mode. If the third vertex is on the active boundary and, in a counter-clockwise order, is the last of the currently active edge vertices, then the current triangle is marked as L-mode. If the third vertex is on the active boundary and in a counter-clockwise order is both the last vertex of the currently active edge vertex and the next vertex of the currently active edge, then the current triangle is marked as E-mode. If the third vertex is on the active boundary, but in a counter-clockwise order, neither the last vertex of the currently active edge vertex nor the next vertex of the currently active edge, then the current triangle is marked as S-mode.
After each marking of a triangle, the active boundary is updated and the next active edge is selected according to certain rules. After traversing all triangles, entropy coding is carried out on the obtained CLERS character strings, so that higher compression efficiency can be obtained.
Figure 2 gives a schematic representation of encoding a two-dimensional grid using EBs. The final entropy encoded mode codeword is CCRRSLCRSERRELCRRRCRRRE according to the EB encoding rules.
Since the five modes of the Edgebreaker method cannot handle non-manifold grids, the grid must be converted to a manifold grid before the Edgebreaker method can be used.
The grid coding method provided by the embodiment of the application is described in detail below through some embodiments and application scenes thereof with reference to the accompanying drawings.
Referring to fig. 2, an embodiment of the present application provides a trellis encoding method applied to an encoding end, as shown in fig. 2, the trellis encoding method includes:
Step 201, filtering out repeated points of a first grid to be coded to obtain repeated point information of a second grid and a first repeated point, wherein the first repeated point is a geometric vertex in the second grid, the first repeated point is obtained by combining at least two repeated points in the first grid, and the repeated point information comprises indexes of the repeated points and indexes of the surfaces where the repeated points are located;
In the embodiment of the present application, the first mesh may be understood as a three-dimensional mesh, and a correspondence between a geometric vertex index and a coordinate value in the first mesh may be established first; all vertices are then traversed, and at least two geometric vertices may be considered to be duplicate points (otherwise known as geometric duplicate points) when the coordinate values of the at least two geometric vertices are the same. In general, a large number of repetition points exist in the first grid, and coding efficiency can be improved and the size of a coded code stream can be reduced by filtering the repetition points.
Step 202, coding the second grid to obtain a first code stream;
optionally, in the embodiment of the present application, the second grid may be encoded based on the Edgebreaker method to obtain the first code stream.
Step 203, coding the repeated point information of the first repeated point based on the geometric coding sequence and the connection relation coding sequence to obtain a repeated point information code stream, wherein the repeated point information code stream carries a first identifier for representing that the coding end performs repeated point filtering, and the geometric coding sequence and the connection relation coding sequence are determined based on the coding process of the second grid;
It should be understood that encoding the repetition point information of the first repetition point based on the geometric encoding order and the connection relation encoding order to obtain the repetition point information code stream may be understood that encoding the geometric information and the connection relation information of the repetition point by the index of the repetition point and the index of the plane where the repetition point is located to obtain the repetition point information code stream.
And step 204, determining a target code stream of the first grid based on the repeated point information code stream and the first code stream.
In the embodiment of the application, the repeated point information code stream and the first code stream can be mixed to obtain the target code stream of the first grid. It should be noted that, in the video encoding process, the encoding process further includes a texture map, and the target code stream may further include a texture map code stream obtained based on the encoding process of the texture map. That is, the texture map code stream, the repetition point information code stream, and the first code stream may be mixed to obtain a code stream of the grid to be encoded.
Optionally, after the target code stream is obtained by the decoding end, the decoding end may decode the first code stream and the repetition point information code stream respectively, and perform repetition point recovery on the second grid obtained by decoding the first code stream by using the repetition point information of the first repetition point obtained by decoding the repetition point information code stream, so as to obtain the first grid.
The embodiment of the application obtains the repeated point information of a second grid and a first repeated point by filtering the repeated point of a first grid to be coded, wherein the first repeated point is a geometric vertex in the second grid, the first repeated point is obtained by merging at least two repeated points in the first grid, and the repeated point information comprises indexes of the repeated points and indexes of the surfaces where the repeated points are located; encoding the second grid to obtain a first code stream; encoding the repeated point information of the first repeated point based on a geometric encoding sequence and a connection relation encoding sequence to obtain a repeated point information code stream, wherein the repeated point information code stream carries a first identifier for representing that an encoding end performs repeated point filtering, and the geometric encoding sequence and the connection relation encoding sequence are determined based on the encoding process of the second grid; and determining a target code stream of the first grid based on the repeated point information code stream and the first code stream. In this way, the data encoding the repetition point is reduced, thereby reducing the size of the encoded code stream. Meanwhile, the encoding and decoding efficiency is improved.
Optionally, in some embodiments, filtering the repetition point of the first grid to be encoded to obtain the repetition point information of the second grid and the first repetition point includes:
Merging the N repetition points into the first repetition point in the case that the merging of the N repetition points in the first grid does not generate a new non-manifold structure;
Under the condition that N repeated points in the first grid are combined to generate a new non-manifold structure, canceling the combination of the N repeated points, or combining the N repeated points into the first repeated point, and generating first information, wherein the first information comprises a second identifier, vertex information of the manifold structure before combining the N repeated points into the first repeated point and connection relation information between the vertexes, and the first information is used for obtaining the same manifold structure before combining the N repeated points into the first repeated point when the non-manifold structure is split;
Wherein N is an integer greater than 1.
It should be noted that, the non-manifold structure existing in the first mesh before the repetition point combining may be referred to as an old non-manifold structure, and the new non-manifold structure refers to a non-manifold structure that is newly added due to the repetition point combining, that is, a non-manifold structure other than the old non-manifold structure.
In the embodiment of the application, the influence of the repeated points on the non-manifold structure needs to be considered in the process of filtering the repeated points, and two schemes can be mainly adopted:
Scheme 1, avoid producing the non-manifold structure in the course of merging the repetition point, namely under the situation that N repetition points in the first grid are merged to produce the new non-manifold structure, cancel the merging of said N repetition points; otherwise, the repetition point of the vertex is preserved. The generation of new non-manifold structures is avoided, so that the subsequent coding difficulty is reduced.
Scheme 2, allowing generating non-manifold structures in the process of merging repeated points, at this time, special processing such as marking (marking by a second mark) needs to be performed on the newly generated non-manifold structures, and vertex information of the manifold structures before merging repeated points and connection relation information between the vertices are recorded, so that a splitting non-manifold structure module can split the newly generated non-manifold structures into the same manifold structures before merging repeated points, and thus, a coding end can perform lossless coding.
Optionally, in some embodiments, encoding the second grid to obtain the first code stream includes:
Under the condition that the second grid has a non-manifold structure, splitting the non-manifold structure to obtain non-manifold information and manifold grids;
Encoding the manifold grid to obtain a first subcode stream;
Encoding non-manifold information based on the geometric encoding sequence and the attribute encoding sequence to obtain a second sub-code stream, wherein the second sub-code stream carries a third identifier for indicating that an encoding end performs the non-manifold structure splitting, and the attribute encoding sequence is determined based on the encoding process of the manifold grid;
wherein the first code stream includes the first sub-code stream and the second sub-code stream.
In the embodiment of the application, the non-manifold structure may include a non-manifold edge and a non-manifold point, where the non-manifold point may also be described as a non-manifold vertex, and two vertices forming the non-manifold edge may also be described as non-manifold vertices. The above-mentioned geometric coding order and connection relation coding order can be understood as being determined based on the coding process of the manifold mesh.
Optionally, the method for determining the non-manifold sides in the grid to be encoded may be that a data structure is established to store triangles where each side in the grid to be encoded is located, and the non-manifold sides are found out by querying the number of triangles corresponding to each side, where the number of triangles corresponding to the non-manifold sides is greater than or equal to 3; alternatively, the correspondence between corners and edges in the mesh may be established by constructing CornerTable, and the non-manifold edges may be found by the correspondence.
Optionally, the method for determining the non-manifold point in the mesh to be encoded may be that CornerTable is constructed, a correspondence between each vertex in the mesh to be encoded and a corner of the vertex is established, a target traversal operation is performed starting from a certain corner of the vertex, all corners adjacent to the corner and forming a sector are traversed in sequence, and the vertex and the traversed corner are marked as traversed. If there are vertices for which there are no traversing angles after the process is performed, the vertex is indicated as a non-manifold point.
Optionally, the non-manifold structure in the mesh to be encoded is split, which may be to create repeated vertices (i.e., newly added vertices) for the non-manifold vertices in the mesh to be encoded, so as to convert the non-manifold structure into a manifold structure, where the non-manifold vertices may include vertices that form non-manifold edges, and non-manifold points.
Alternatively, the non-manifold information may include index information of non-manifold vertices and index information of newly added vertices. When the first subcode stream is encoded, the correspondence between the newly added vertex and the non-manifold vertex can be maintained according to a certain rule. For example, the index information of the newly added vertex may be encoded interlaced with the index information of the non-manifold vertex; or the index information of the newly added vertex and the index information of the non-manifold vertex can be respectively encoded into two paths of code streams according to the same sequence, and the corresponding relation between the newly added vertex and the non-manifold vertex is kept through the encoding sequence.
Alternatively, the first subcode stream may include a geometric information code stream, an attribute information code stream, and a connection relationship information code stream. The geometric information of the manifold mesh can be encoded to obtain a geometric information code stream; the attribute information of the manifold grids can be encoded to obtain an attribute information code stream; and the connection relation information of the manifold grids can be encoded to obtain a connection relation information code stream.
It should be noted that, because the third identifier is carried in the second subcode stream, the decoding end may decode the non-manifold information in the second subcode stream based on the third identifier. Thus, the non-manifold information obtained by splitting the non-manifold structure is encoded, so that the non-manifold structure can be reconstructed through the non-manifold information during decoding, the quality loss of grid information after encoding and decoding can be reduced or even eliminated, and lossless encoding is realized.
In the embodiment of the application, under the condition that the second grid has a non-manifold structure, the non-manifold structure is split to obtain non-manifold information and manifold grids; encoding the manifold grid to obtain a first subcode stream; encoding the non-manifold information based on the geometric encoding sequence and the connection relation encoding sequence to obtain a second subcode stream, wherein the second subcode stream carries a third identifier for indicating that the encoding end performs the non-manifold structure splitting; wherein the first code stream includes the first sub-code stream and the second sub-code stream.
Note that, manifold (manifield) is a space having a local euclidean space property. The general manifold may be formed by bending and bonding a plurality of flat sheets. The manifold satisfies the following conditions: locally having euclidean spatial properties, rather than a manifold may mean that the condition of the manifold is not met. For a three-dimensional grid, the manifold sides satisfy the following conditions: the grid edges are shared (EDGE IS INCIDENT to only one or two faces) for one or two grid triangular patches; the manifold point satisfies the following conditions: a ring of adjacent triangular plates of the grid vertices form a closed or open sector (THE FACES INCIDENT to a vertex form a closed or an open fan). Non-manifold sides may refer to grid sides that do not satisfy the conditions of manifold sides, and non-manifold points may refer to grid vertices that do not satisfy the conditions of manifold points.
Optionally, in some embodiments, the second mesh includes a first manifold mesh and a first non-manifold mesh, the first manifold mesh and the first non-manifold mesh are connected by the non-manifold structure, the non-manifold structure includes a first vertex, and splitting the non-manifold structure to obtain non-manifold information and manifold mesh includes:
Establishing a second vertex, wherein the second vertex and the first vertex are repeated points, and the geometric index of the second vertex is different from that of the first vertex;
And splitting the non-manifold structure in the second grid based on the second vertex to obtain the non-manifold information and manifold grids, wherein the manifold grids comprise the first manifold grids and the second manifold grids converted by the first non-manifold grids, and the non-manifold information comprises index information of the first vertex and index information of the second vertex.
Alternatively, the first vertex is a non-manifold vertex, and the first vertex may be a vertex constituting a non-manifold edge, or may be a non-manifold point.
In the embodiment of the application, the non-manifold structure in the grid to be coded is split based on the second vertex so as to convert the first non-manifold grid into the second manifold grid. Therefore, the non-manifold structure in the grid to be encoded can be split by creating the repetition points, the non-manifold structure in the grid to be encoded is converted into the manifold structure, and index information of newly added vertexes is recorded, so that the non-manifold structure can be conveniently reconstructed during decoding.
Optionally, in some embodiments, the index information includes a geometric index and an attribute index. Wherein the geometric indexes of the first vertex and the second vertex are different, but the attribute indexes are the same. In this way, traversing the geometric index and the attribute index of the vertex may determine the first vertex and the second vertex as duplicate points.
Optionally, in some embodiments, the splitting the non-manifold structure in the second mesh based on the second vertex includes:
Updating the index of a first vertex in first connection relation information to the index of a second vertex, wherein the first connection relation information is used for representing the connection relation of the vertices of the first non-manifold mesh.
In the embodiment of the application, when the non-manifold point is split, an angle table (CornerTable) is firstly required to be constructed, and the corresponding relation between each vertex and the angle of the vertex is established. A two-step operation is performed for each vertex. In the first step, all angles adjacent to a certain angle of the vertex and forming a sector are sequentially traversed, and the vertex and the traversed angle are marked as traversed. If there are vertices for which there are no traversing angles after the process is performed, the vertex is indicated as a non-manifold point. And secondly, for each non-manifold point, creating a repeated point, modifying the connection relation, connecting the angles which are not traversed in the first step to the newly added repeated points, and splitting the non-manifold point into two manifold vertexes. This process is repeated until all vertices are converted to manifold points. And simultaneously, recording index information of newly added vertexes and index information of original non-manifold vertexes in the process.
If a new non-manifold structure is generated by adopting the scheme 2 in the process of filtering the repeated points, the non-manifold structure is split into the same manifold structure before filtering the repeated points according to the recorded connection relationship between the vertex information and the vertexes of the manifold structure before filtering the repeated points.
Optionally, in some embodiments, the encoding the manifold trellis includes:
Encoding the geometric information of the manifold grids to obtain a geometric information code stream;
encoding the attribute information of the manifold grids to obtain attribute information code streams;
encoding the second connection relation information of the manifold grids to obtain a connection relation information code stream;
The first subcode stream comprises the geometric information code stream, the attribute information code stream and the connection relation information code stream, and the second connection relation information is used for representing the connection relation of the vertexes of the manifold grid.
It should be understood that the second connection relationship information includes updated first connection relationship information. After each encoded code stream is obtained, the non-manifold information code stream, the geometric information code stream, the attribute information code stream, the connection relation information code stream, the texture map code stream and the repetition point information code stream can be mixed to obtain the target code stream.
For a better understanding of the present application, the following describes the codec process of the present application in detail by some embodiments.
In some embodiments, as shown in fig. 3, the encoding framework of the encoding end mainly includes a repeat point filtering module, a split non-manifold mesh module, a connection relation encoding module, a geometric information encoding module, an attribute information encoding module, a non-manifold information encoding module, a repeat point information encoding module, and the like. The coding framework can realize lossless compression of the three-dimensional grid, and the specific coding operation comprises the following steps:
1) And filtering out repeated points in the grid, wherein the repeated points refer to geometric vertexes with repeated three-dimensional coordinates, and the indexes of the repeated vertexes and the indexes of the surfaces of each repeated point are recorded in the process of filtering out the repeated vertexes.
2) If the non-manifold structure exists in the three-dimensional grid, the non-manifold structure is split, and the manifold grid is obtained. Meanwhile, vertex information newly added due to splitting of the non-manifold structure and original non-manifold vertex information are recorded.
3) Encoding connection information by Edgebreaker method to obtain pattern character string and entropy encoding; the geometric information of the encoded grid after the connection relation encoding is completed can be, for example, a parallelogram prediction encoding method can be used, and the encoding method of the geometric information is not limited here; if the grid has attribute information such as UV coordinates, it may be encoded using a method such as similar triangle predictive encoding, and the encoding method of the attribute information is not limited here.
4) If the non-manifold structure exists in the grid, the index information of the newly added vertex and the index information of the original non-manifold vertex are encoded according to the encoding sequence of the geometric information and the attribute information. Here, the indices of the geometry and properties of newly added vertices and corresponding non-manifold vertices may be directly entropy encoded, but are not limited to this encoding scheme.
5) If the repeat point information is required to be encoded, the index of the repeat point, the number of planes in which the repeat point is located, and the index of the planes in which the repeat point is located are encoded. Here, the index of the repetition point, the number of planes of the repetition point, and the index of the planes of the repetition point may be directly entropy-encoded, but not limited to this encoding method.
6) The texture map is encoded using a video encoder.
7) And mixing the code streams to obtain an encoded output code stream (namely a target code stream).
The processing procedure of each module in the encoding process is described in detail below.
1. And repeating the point filtering module. The input is a first grid, and the output comprises a second grid with geometric repeated points filtered, repeated point information identifiers (namely first identifiers), indexes of the first repeated points and indexes of the surfaces where the first repeated points are located.
Typically, there are a large number of geometric repeat points in a three-dimensional grid. Therefore, filtering out geometric repetition points can significantly improve the coding efficiency of geometric information. Optionally, the repeated point filtering module may first establish a correspondence between the geometric vertex index and the coordinate value. Traversing all the vertexes, and when coordinate values of a plurality of geometric vertexes are the same, indicating that the vertexes are geometric repeated points. And filtering the repeated points, namely merging the geometric repeated points into one vertex, and adjusting corresponding vertex indexes in the connection relation. In this process, the index of the vertex after merging each repetition point is recorded, and in the present application, the index of the vertex after merging may be referred to as a repetition point index, and the index of the face where each repetition point is located is recorded when the connection relationship is adjusted. And inputting the recorded index of the repeated point and the index of the surface of the recorded index of the repeated point as the information of the repeated point into the repeated point information coding module for coding.
In addition, in the process of filtering the repeated points, the influence of the repeated points on the non-manifold structure needs to be considered, and two schemes can be mainly adopted.
Scheme 1, avoid producing the non-manifold structure in the course of merging the repetition point, namely under the situation that N repetition points in the first grid are merged to produce the new non-manifold structure, cancel the merging of said N repetition points; otherwise, the repetition point of the vertex is preserved.
Scheme 2, allowing generating non-manifold structures in the process of merging repeated points, at this time, special processing such as marking (marking by a second mark) needs to be performed on the newly generated non-manifold structures, and vertex information of the manifold structures before merging repeated points and connection relation information between the vertices are recorded, so that a splitting non-manifold structure module can split the newly generated non-manifold structures into the same manifold structures before merging repeated points, and thus, a coding end can perform lossless coding.
2. The non-manifold mesh module is split. The input is a second mesh, and the output comprises a manifold mesh, original non-manifold vertices and vertices added by splitting (i.e. second vertices).
Optionally, the split non-manifold structure is divided mainly into two parts: splitting non-manifold sides and splitting non-manifold points.
The first step in splitting the non-manifold sides is to find the non-manifold sides. The non-manifold edge is judged if one edge exists in three or more triangles at the same time. The specific implementation method comprises the following steps: a data structure is established to store triangles where each edge is located, and non-manifold edges are found out by inquiring the number of the triangles corresponding to the edge; the correspondence between corners and edges in the mesh may also be established by constructing CornerTable to find non-manifold edges. Specifically, for a manifold grid, each edge is at most opposite two corners, the opposite two corners being referred to as diagonal. As shown in fig. 4, angle a is opposite to angle d from side bc, angle a being diagonal to angle d; while for non-manifold sides there may be three or more diagonals. Therefore, the non-manifold sides can be found out through the corresponding relation between the corners and the sides.
The second step in splitting the non-manifold edges is to add vertices and modify the connection relationships. After the non-manifold edge is found, repeated vertexes are respectively created for the two vertexes of the non-manifold edge, one triangle t where the non-manifold edge is located is selected, a new triangle t 'is formed by a third vertex in the triangle and the newly added two vertexes, the original triangle t is replaced by t', and the process is iterated until the non-manifold edge is converted into the manifold edge. And simultaneously, recording index information of newly added vertexes and index information of original non-manifold vertexes in the process.
Splitting non-manifold points first requires construction CornerTable, establishing a correspondence between each vertex and the corner of that vertex. A two-step operation is performed for each vertex. In the first step, all angles adjacent to a certain angle of the vertex and forming a sector are sequentially traversed, and the vertex and the traversed angle are marked as traversed. If there are vertices for which there are no traversing angles after the process is performed, the vertex is indicated as a non-manifold point. And secondly, for each non-manifold point, creating a repeated point, modifying the connection relation, connecting the angles which are not traversed in the first step to the newly added repeated points, and splitting the non-manifold point into two manifold vertexes. This process is repeated until all vertices are converted to manifold points. And simultaneously, recording index information of newly added vertexes and index information of original non-manifold vertexes in the process.
If a new non-manifold structure is generated by adopting the scheme 2 in the process of filtering the repeated points, the non-manifold structure is split into the same manifold structure before filtering the repeated points according to the recorded connection relationship between the vertex information and the vertexes of the manifold structure before filtering the repeated points.
3. And the connection relation coding module. The input is the connection relation of manifold grids, and the output comprises the coded connection relation information code stream and the vertex coding sequence (namely the connection relation coding sequence).
Optionally, the scheme encodes the connection relationship of the three-dimensional grid using Edgebreaker method, represents the connection relationship of the grid by establishing CornerTable, and traverses all triangles in the grid with CornerTable to generate the CLERS pattern string of Edgebreaker.
CornerTable are used to represent the relationship between corners and vertices in the mesh and triangles. The triangles need to be numbered first diagonally before CornerTable is built, traversing the triangles in the order of the triangle patches in the mesh, and for each triangle, the angles are numbered in a counter-clockwise order, if the mesh has f triangle patches, then the mesh will have 3f angles. The advantage of such numbering is that the triangle number where the current angle is located can be calculated by the number of the angle, as shown in formula 1; the sequence numbers of the previous angle c p and the next angle c n of the current angle c in the counterclockwise direction can also be calculated as shown in equations 2 and 3.
fi=c/3 (1)
Where c is the index of the current angle, f i is the sequence number of the triangle in which the current angle c is located, "/" is the integer division, and the result is rounded down.
cp=(fi*3)+(c-1)%3 (2)
Where c is the index of the current angle, f i is the sequence number of the triangle in which the current angle c is located, "/" is the integer division, and the result is rounded down.
CornerTable comprises four parts: the tables are V table, O table, U table and M table. Wherein, the V table stores the vertex index corresponding to each angle, the O table stores the diagonal index of each angle, the U table stores the mark whether each triangle is traversed in the traversing process, and the M table stores the mark whether each vertex is traversed in the traversing process.
Using CornerTable, a relationship as shown in fig. 5 can be constructed, where c represents the current angle, c.p represents the previous angle (in a counter-clockwise direction) of the current angle c, and c.n represents the next angle of the current angle c. c.o is the diagonal of the current angle c, which can be obtained by looking up an O table. And c.t is the sequence number of the triangle where c is located, and can be calculated by the formula 1. c.v denotes the vertex of the current angle, which can be found by looking up the V table. c.l denotes the angle to the left of the current angle c, obtained by looking up the diagonal angle of c.p in the O table; c.r denotes the angle to the right of the current angle c, obtained by looking up the diagonal angle of c.n in the O table.
After the relationships between the angles and the vertices and triangles are constructed using CornerTable, the mesh can be traversed in a spiral order to obtain a CLERS pattern string of Edgebreaker representing the mesh connection relationships. At this time, the judgment conditions and the traversal rules of the five modes are shown in fig. 6. The angle of current traversal is x, if the vertex x.v corresponding to x is not accessed, the current triangle is in C mode, and the triangle to be traversed next is the triangle where x.r is located; otherwise, if the triangle x.l is accessed, the current triangle is in L mode, and the next triangle to be traversed is the triangle x.r; if the triangle where x.r is located is accessed, the current triangle is in R mode, and the next triangle to be traversed is the triangle where x.l is located; if the vertex x.v is accessed but neither the triangle where x.l nor the triangle where x.r is located is accessed, then the current triangle is in S mode, and the traversal path generates two branches at this time, and the depth-first traversal principle is adopted, the traversed triangle is the triangle where x.r is located first, and the triangle where x.l is located is stored in the stack, and after the traversal of the branch where x.r is located is waited, the triangle where x.l is located is traversed again; if both x.l and x.r are accessed, then the current triangle mode is E, at which point the current traversal path branches to the end.
And compressing CLERS mode character strings by using entropy coding to obtain a final connection information code stream.
4. And the geometric information coding module. The input is geometric information and connection relation coding sequence of manifold grids, and the output is geometric information code stream and geometric coding sequence.
The geometric information encoding module may encode geometric information by using various methods, such as a difference predictive encoding algorithm, a parallelogram predictive encoding algorithm, a multi-parallelogram predictive encoding algorithm, etc., where specific encoding methods are not emphasized. Taking the parallelogram predictive coding algorithm as an example: there are a, b, c, d vertices that make up two adjacent triangles in the mesh as shown in fig. 7.
Wherein, the geometric information of the points a, b and c is encoded, the geometric information of the point d is to be encoded, and the formula 4 for calculating the predicted value d' of the geometric coordinates of the point d is as follows:
d′(x,y,z)=b(x,y,z)+c(x,y,z)-a(x,y,z) (4)
After d 'is obtained, calculating a difference delta d between the three-dimensional coordinates of d' and d point:
Δd(x,y,z)=d(x,y,z)-d'(x,y,z) (5)
and performing entropy coding on the delta d to obtain a geometric information code stream.
For triangles that cannot be predicted using parallelograms, such as triangles at the mesh boundaries, the difference coding method is used to encode the geometric information. I.e. using the coordinate values of neighboring coded vertices as predictors of the current vertex coordinates, a residual is calculated and predicted.
5. And the attribute information coding module. The input is attribute information and connection relation coding sequence of manifold grids, and the output is attribute information code stream and coding sequence of attribute information.
The attribute information of the three-dimensional grid generally includes UV coordinates, normal vectors, and the like, and the UV coordinates are taken as an example. There are a number of coding methods that may be employed for UV coordinates, including differential predictive coding, parallelogram predictive coding, and similar triangle predictive coding, and the like, and specific coding methods are not emphasized here. The similar triangle prediction algorithm is described below.
Firstly, selecting a triangle in a three-dimensional grid as an initial triangle, directly encoding UV coordinates without predicting three vertexes of the initial triangle, and storing edges of the initial triangle into an edge set, wherein the set can be a data structure meeting a certain access criterion. The edges τ in one set are then fetched, predicting the pair-vertex UV coordinates of τ in the next new triangle. And placing two sides of the new triangle other than τ into the collection. The point to be predicted is marked as a point C, two end points of the side tau are respectively N and P, the vertex of a triangle pair adjacent to the new triangle through tau is marked as O, and the projection point of C on tau is marked as X. As shown in fig. 8, since the UV coordinates of the three points N, P, and O are encoded before the C point, the UV coordinates of the C point can be predicted using the three points. The specific calculation flow is as follows:
Let C uv、Xuv、Nuv、Puv and O uv be the UV coordinates of each point, and C G、XG、NG、PG and O G be the geometric coordinates of each point.
The UV coordinates of point X are first calculated based on equations 6 and 7:
Calculating vectors Rotated () represents a 90 degree flip of the vector:
And finally calculating the C point predicted UV coordinate Pred C.
And after obtaining the predicted value of the UV coordinates, subtracting the predicted value from the original UV coordinates to obtain a residual value.
The encoding UV coordinates steps are as follows:
(41) And selecting an initial triangle from the connectivity relation, and directly encoding UV coordinates of three vertexes of the initial triangle without prediction. The initial triangle edge is stored in an edge set.
(42) And selecting the side tau from the set according to the access criterion, and encoding the UV coordinates of the new triangle formed by tau on the vertex. And calculating the predicted value of the point to be coded according to the UV coordinate predicted value calculation process by utilizing the three-dimensional to two-dimensional projection relation of the triangle. Subtracting the predicted value from the original value of the UV coordinates to obtain a residual error.
(43) Adding two sides of the new triangle into the side set, and removing the side tau at the top of the set. And (3) taking out the next edge from the set, continuing to encode the UV coordinates of the pair of vertexes of the adjacent triangle of the edge, and returning to the step (3) until the UV coordinates of all vertexes are encoded.
(44) Entropy-encoding the UV coordinate residual, and outputting a UV coordinate code stream (namely an attribute information code stream).
6. And a non-manifold information coding module. The input is index information of newly added vertexes, index information of original non-manifold vertexes, geometric coding sequence and attribute coding sequence, and the output is non-manifold information code stream.
Optionally, the non-manifold vertex index information includes two parts of newly added vertex index information and original non-manifold vertex index information.
Firstly, determining whether a non-manifold structure exists in the coding grid, for example, if the non-manifold structure does not exist in the coding grid, namely, the number of newly added vertexes is 0, setting the non-manifold mark to 0, and no newly added vertex information is needed to be coded; if the non-manifold structure exists in the coding grid, that is, the number of newly added vertexes is larger than 0, the non-manifold mark is set to 1 (that is, the third mark) and then the index information of the newly added vertexes and the index information of the corresponding original non-manifold vertexes are coded. During encoding, the corresponding relation between the newly added vertex and the original non-manifold vertex is required to be maintained according to a certain rule. For example, the index information of the newly added vertex may be encoded in a staggered manner with the index information of the original non-manifold vertex; the index information of the newly added vertex and the index information of the original non-manifold vertex can be respectively encoded into two paths of code streams according to the same sequence, and the corresponding relation between the newly added vertex and the original non-manifold vertex is kept through the encoding sequence. The embodiment is not limited to a specific implementation of maintaining the correspondence between the newly added vertex and the original non-manifold vertex.
Optionally, the non-manifold vertex index information includes two parts of geometric vertex index information and attribute vertex index information. Optionally, encoding non-manifold vertex index information is mainly divided into two steps: the first step is to record the position of the geometric vertex in the geometric coding sequence and the position of the attribute vertex in the attribute coding sequence; and the second step is to perform entropy coding on the geometric information position of the geometric vertex and the attribute information position of the attribute vertex to obtain a non-manifold information code stream. Here, in addition to directly entropy encoding index information of non-manifold vertices, when the newly added vertex corresponds to the original non-manifold vertex one by one, an identifier for indicating whether the vertex is the newly added vertex and an identifier for indicating whether the vertex is the original non-manifold vertex may be encoded to represent a correspondence between the newly added vertex index information and the non-manifold vertex index information. The present embodiment is not limited to a specific encoding scheme.
Optionally, the non-manifold information code stream may have a plurality of storage modes in the total code stream: one is to take the non-manifold information code stream as a single sub-code stream; the other is to store the code stream of the index information of the non-manifold geometric vertex into the geometric information code stream, and store the code stream of the index information of the non-manifold attribute vertex into the attribute information code stream; or the code stream of the index information of the non-manifold geometric vertex and the code stream of the index information of the non-manifold attribute vertex can be respectively stored in the total code stream as two paths of sub-code streams. The storage mode of the non-manifold information code stream in the total code stream is not limited in this embodiment.
7. And the repetition point information coding module. The input is the index of the repeated point, the index of the surface where the repeated point is located, the connection relation coding sequence and the geometric coding sequence, and the output is the repeated point information code stream.
First, whether or not the repetition point information flag is encoded, and in the case of lossless encoding, the flag is set to 1 (i.e., the first flag described above), indicating that the repetition point information is required to be encoded. If the repetition point information needs to be encoded, three items of information are encoded for each repetition point: the sequence number of the repeated points in the geometric coding sequence, the number of the planes of the repeated points, and the sequence number of the planes of each repeated point in the connection relation coding sequence are coded. And traversing all the repeated points to generate a repeated point information code stream.
And finally, mixing the code streams to form the grid code streams.
In some embodiments, as shown in fig. 9, the decoding framework of the decoding end mainly includes a connection relation decoding module, a geometric information decoding module, an attribute information decoding module, a non-manifold vertex information decoding module, a reconstruction manifold mesh module, a non-manifold structure recovery module, a repetition point information decoding module, a repetition point recovery module, and the like. The decoding framework can realize lossless compression of the three-dimensional grid, and the decoding operation specifically comprises the following steps:
1) The code stream is decomposed into a geometric information code stream, a connection relation code stream, an attribute information code stream and a texture map code stream, and then the sub-code streams are decoded respectively.
2) Entropy decoding the connection relation code stream to obtain the mode character string. And reconstructing the connection relationship.
3) The geometric information of the grid is decoded, and a decoding method corresponding to the encoding end is used.
4) The UV coordinates of the grid are decoded using a decoding method corresponding to the encoding side.
5) Decoding whether the mark of the non-manifold structure exists or not, if so, further decoding the obtained index of the newly added vertex and the index of the original non-manifold vertex corresponding to the newly added vertex. Combining the newly added vertex with the original non-manifold vertex, adjusting the connection relation, and recovering the non-manifold structure in the grid.
6) And decoding whether the identification of the repeated point information is encoded or not, if the identification exists, decoding the repeated point information, and restoring the connection relation between the repeated point and the repeated point.
7) And decoding the texture map code stream, and reconstructing a three-dimensional grid by using each path of decoding information.
The processing procedure of each module in the encoding process is described in detail below.
1. And the connection relation decoding module. The input is a connection relation code stream to be decoded, and the output is connection relation of manifold grids and the decoded vertex sequence (namely connection relation decoding sequence).
Optionally, the connection relation subcode stream is decoded to obtain the pattern character string. The pattern strings are traversed in a certain order (positive or negative) and the connection relationships are reconstructed from the corresponding patterns in the strings. In addition, the traversal order of the vertices (i.e., the connection relation decoding order) is output to the geometry information decoding module and the attribute information decoding module.
2. And a geometric information decoding module. The input is the geometric information code stream and the connection relation decoding sequence, and the output is the geometric information of manifold grids.
The decoding process of the grid geometry is the inverse of the encoding process: entropy decoding is carried out to obtain a coordinate prediction residual. And predicting the predicted coordinates of the point to be decoded according to the parallelogram rule according to the decoded triangle. And adding the residual error value obtained by entropy decoding to the predicted coordinate to obtain the position of the geometric coordinate to be decoded. The vertex traversal order (i.e., the geometric decoding order) is the same as the vertex order of the encoded geometric information. It should be understood that the geometric coordinates of the initial triangles are not coded using prediction, but rather their geometric coordinates are coded directly. And after the decoding end decodes the geometric coordinates of the triangle, the geometric coordinates of vertexes of other triangles are traversed and decoded as the initial triangle. In addition, other decoding methods may be used herein, and specific decoding methods are not emphasized as long as they correspond to the encoding end.
3. And the attribute information decoding module. The input is attribute information code stream and connection relation decoding sequence, and the attribute information reconstructed for manifold grid is output.
Taking UV coordinates as an example, the decoding method in which UV coordinates correspond to the encoding end, the specific decoding method is not emphasized here. The decoding process using the similar triangle prediction algorithm is described below.
The decoding UV coordinates steps are as follows:
(1) Entropy decoding the UV coordinate code stream.
(2) The UV coordinates of the three vertices of the initial triangle, which is directly encoded instead of the residual, are decoded, where no prediction value is calculated. The initial triangle edge is stored in an edge set.
(3) And selecting an edge tau from the set according to an access criterion, and decoding UV coordinates of a new triangle formed by tau on the vertex. Firstly, calculating the UV coordinate predicted value of the point to be decoded by using a three-dimensional to two-dimensional mapping relation of the triangle and a calculation mode consistent with the coding end. And adding the predicted value and the residual error decoded by the entropy to obtain the reconstructed UV coordinate.
(4) Adding two sides of the new triangle into the side set, and removing the side tau at the top of the set. And (3) taking out the next edge from the set, continuing to decode the UV coordinates of the pair of vertexes of the adjacent triangle of the edge, and returning to the step (3) until the decoding of the UV coordinates of all vertexes is completed.
4. And a non-manifold vertex information decoding module. The input is non-manifold vertex information code stream, geometric decoding sequence and attribute decoding sequence, and the output is non-manifold mark, newly added vertex index and original non-manifold vertex index.
Firstly, decoding to obtain an identification of whether a non-manifold structure exists in a grid, if the identification is 0, decoding non-manifold vertex index information is not needed, and skipping a module for recovering the non-manifold structure subsequently; if the flag is 1, the non-manifold vertex index information is decoded.
The non-manifold vertex index information is decoded by adopting a method corresponding to the encoding end, firstly entropy decoding is carried out to obtain the positions of the non-manifold vertices in the geometric decoding sequence and the attribute decoding sequence, and then the indexes of the non-manifold vertices at the decoding end are recorded. And outputting the newly added vertex index and the original non-manifold vertex index to a non-manifold restoration structure module.
5. Reconstructing the manifold mesh module. The input is the connection relation of manifold grids, the geometric information of manifold grids and the attribute information of manifold grids, and the output is manifold grids.
The manifold grid can be directly reconstructed by utilizing the connection relation, the geometric information and the attribute information of the manifold grid.
6. And recovering the non-manifold structural module. The input is manifold mesh, index of newly added vertex and original non-manifold vertex index, and output is reconstructed non-manifold mesh.
Wherein the non-manifold edge and the recovery process of the non-manifold point are the same. First, traversing the newly added vertex index information and the corresponding original non-manifold vertex index information, and updating the index value of the newly added vertex in the connection relation to the index value of the original non-manifold vertex. And deleting the newly added vertex from the vertices of the manifold mesh to obtain the reconstructed non-manifold mesh.
7. And the repeated point information decoding module. The input is repeated point information code stream, geometric decoding sequence and connection relation decoding sequence, and the output is repeated point index and index of the surface where the repeated point index is located.
Optionally, firstly decoding to obtain the identification of whether the repeated point information exists in the grid, if the identification is 0, the repeated point information does not need to be decoded, and a module for recovering the repeated points subsequently is skipped; if the flag is 1, the repetition point information is decoded.
The repeated point information is decoded by adopting a method corresponding to the encoding end. For each repetition point, firstly entropy decoding is carried out to obtain the position of the repetition point in the geometric decoding sequence, and then the index of the repetition point at the decoding end is recorded. Then, the number of the faces where the repeated points are located is decoded, the positions of each face sheet in the connection relation decoding sequence are decoded in sequence, and the index of each face sheet at the decoding end is recorded. And outputting the index of each repeated point and the index of the surface where the index is positioned to a repeated point recovery module.
8. And recovering the repeated point module. The input is reconstructed non-manifold grid, repeated point index and index of the surface where the repeated point index is located, and the output is reconstructed grid.
Optionally, in the reconstruction grid, a new vertex is created for each repetition point, the geometric coordinates of the new vertex being equal to the geometric coordinates of the vertex pointed to by the repetition point index. And then, adjusting the connection relation, searching the surface where the repeated point is located according to the index of the surface where the repeated point is located, and updating the repeated point index in the surfaces to the index of the new vertex. And traversing all the repeated points, and carrying out the same operation to finally obtain the reconstruction grid.
Referring to fig. 10, an embodiment of the present application provides a trellis decoding method applied to a decoding side, as shown in fig. 10, the trellis decoding method including:
step 1001, acquiring a first code stream and a repeated point information code stream of a first repeated point according to a target code stream of a first grid;
step 1002, decoding the first code stream to obtain a second grid, where the first repetition point is a geometric vertex in the second grid, and the first repetition point is obtained by combining at least two repetition points in the first grid, and the repetition point information includes an index of the repetition point and an index of a plane where the repetition point is located;
Step 1003, in the case that the repetition point information code stream includes a first identifier, decoding the repetition point information code stream based on a geometric decoding order and a connection relation decoding order to obtain repetition point information of the first repetition point, where the first identifier is used to represent a first identifier that the encoding end performs repetition point filtering, and the geometric decoding order and the connection relation decoding order are determined based on a decoding process of the second grid;
Step 1004, recovering the first repeated point in the second grid based on the repeated point information of the first repeated point to obtain the first grid.
Optionally, the recovering the first repetition point in the second grid based on the repetition point information of the first repetition point, and obtaining the first grid includes:
And adding the first repeated point into the second grid based on the index of the repeated point of the first repeated point and the index of the surface where the repeated point is located, and recovering the connection relation between the first repeated point and the geometric vertex in the second grid to obtain the first grid.
Optionally, the decoding the first code stream to obtain a second grid includes:
Determining a first sub-code stream and a second sub-code stream contained in the first code stream;
decoding the first subcode stream to obtain a manifold grid;
Decoding the second subcode stream based on the geometric decoding sequence and the connection relation decoding sequence to obtain non-manifold information under the condition that the second subcode stream comprises a third identifier, wherein the third identifier is used for indicating that the encoding end performs the non-manifold structure splitting;
And restoring the non-manifold structure in the manifold mesh by using the non-manifold information to obtain the second mesh.
Optionally, the manifold mesh includes a first manifold mesh and a second manifold mesh, the first manifold mesh includes a first vertex, the second manifold mesh includes a second vertex, the first vertex and the second vertex are repetition points, the non-manifold information includes index information of the first vertex and index information of the second vertex, and the restoring the non-manifold structure in the manifold mesh by using the non-manifold information includes:
And combining the first vertex and the second vertex based on the index information of the first vertex and the index information of the second vertex, and updating the connection relation information of the second manifold mesh to obtain the second mesh, wherein the second mesh comprises the first manifold mesh and a first non-manifold mesh converted by the second manifold mesh, and the first manifold mesh and the first non-manifold mesh are connected through the non-manifold structure.
Optionally, the index information includes a geometric index and an attribute index.
Optionally, the decoding the first subcode stream to obtain a manifold trellis includes:
decoding the first subcode stream to obtain geometric information, attribute information and second connection relation information;
Reconstructing the manifold mesh based on the geometric information, attribute information and second connection relationship information;
the first subcode stream comprises a geometric information code stream corresponding to the geometric information, an attribute information code stream corresponding to the attribute information and a relation information code stream corresponding to the second connection relation information, and the second connection relation information is used for representing the connection relation of the vertexes of the manifold grids.
It should be noted that, in the trellis encoding method provided in the embodiment of the present application, the execution subject may be a trellis encoding device, or a control module of the trellis encoding device for executing the trellis encoding method. In the embodiment of the present application, a method for executing the trellis encoding by the trellis encoding device is taken as an example, and the trellis encoding device provided by the embodiment of the present application is described.
Referring to fig. 11, fig. 11 is a block diagram of a trellis encoding device provided in an embodiment of the present application, and as shown in fig. 11, a trellis encoding device 1100 includes:
The filtering module 1101 is configured to perform repeated point filtering on a first mesh to be encoded to obtain repeated point information of a second mesh and a first repeated point, where the first repeated point is a geometric vertex in the second mesh, and the first repeated point is obtained by combining at least two repeated points in the first mesh, and the repeated point information includes an index of the repeated point and an index of a plane where the repeated point is located;
a first encoding module 1102, configured to encode the second grid to obtain a first code stream;
A second encoding module 1103, configured to encode the repetition point information of the first repetition point based on a geometric encoding sequence and a connection relation encoding sequence to obtain a repetition point information code stream, where the repetition point information code stream carries a first identifier for indicating that the encoding end performs repetition point filtering, and the geometric encoding sequence and the connection relation encoding sequence are determined based on an encoding process of the second grid;
a determining module 1104, configured to determine a target code stream of the first grid based on the repetition point information code stream and the first code stream.
Optionally, the filtering module is specifically configured to perform the following operations:
Merging the N repetition points into the first repetition point in the case that the merging of the N repetition points in the first grid does not generate a new non-manifold structure;
Under the condition that N repeated points in the first grid are combined to generate a new non-manifold structure, canceling the combination of the N repeated points, or combining the N repeated points into the first repeated point, and generating first information, wherein the first information comprises a second identifier, vertex information of the manifold structure before combining the N repeated points into the first repeated point and connection relation information between the vertexes, and the first information is used for obtaining the same manifold structure before combining the N repeated points into the first repeated point when the non-manifold structure is split;
Wherein N is an integer greater than 1.
Optionally, the first encoding module includes:
The splitting unit is used for splitting the non-manifold structure to obtain non-manifold information and manifold grids under the condition that the second grid has the non-manifold structure;
The first coding unit is used for coding the manifold grids to obtain a first subcode stream;
The second coding unit is used for coding the non-manifold information based on the geometric coding sequence and the attribute coding sequence to obtain a second subcode stream, wherein the second subcode stream carries a third identifier for indicating that the coding end performs the non-manifold structure splitting, and the attribute coding sequence is determined based on the coding process of the manifold grid;
wherein the first code stream includes the first sub-code stream and the second sub-code stream.
Optionally, the second mesh includes a first manifold mesh and a first non-manifold mesh, the first manifold mesh and the first non-manifold mesh are connected by the non-manifold structure, the non-manifold structure includes a first vertex, and the splitting unit is specifically configured to perform the following operations:
Establishing a second vertex, wherein the second vertex and the first vertex are repeated points, and the geometric index of the second vertex is different from that of the first vertex;
And splitting the non-manifold structure in the second grid based on the second vertex to obtain the non-manifold information and manifold grids, wherein the manifold grids comprise the first manifold grids and the second manifold grids converted by the first non-manifold grids, and the non-manifold information comprises index information of the first vertex and index information of the second vertex.
Optionally, the index information includes a geometric index and an attribute index.
Optionally, the splitting unit is specifically configured to update an index of a first vertex in first connection relationship information to an index of the second vertex, where the first connection relationship information is used to characterize a connection relationship of vertices of the first non-manifold mesh.
Optionally, the first encoding subunit is specifically configured to perform the following operations:
Encoding the geometric information of the manifold grids to obtain a geometric information code stream;
encoding the attribute information of the manifold grids to obtain attribute information code streams;
encoding the second connection relation information of the manifold grids to obtain a connection relation information code stream;
The first subcode stream comprises the geometric information code stream, the attribute information code stream and the connection relation information code stream, and the second connection relation information is used for representing the connection relation of the vertexes of the manifold grid.
Referring to fig. 12, fig. 12 is a block diagram of a trellis decoding device according to an embodiment of the present application, and as shown in fig. 12, a trellis decoding device 1200 includes:
An obtaining module 1201, configured to obtain a first code stream and a repetition point information code stream of a first repetition point according to a target code stream of a first grid;
A first decoding module 1202, configured to decode the first code stream to obtain a second mesh, where the first repetition point is a geometric vertex in the second mesh, and the first repetition point is obtained by combining at least two repetition points in the first mesh, and the repetition point information includes an index of the repetition point and an index of a plane where the repetition point is located;
a second decoding module 1203, configured to decode, when the repetition point information code stream includes a first identifier, the repetition point information code stream based on a geometric decoding order and a connection relation decoding order to obtain repetition point information of the first repetition point, where the first identifier is used to indicate a first identifier that the encoding end performs repetition point filtering, and the geometric decoding order and the connection relation decoding order are determined based on a decoding process of the second grid;
And a recovery module 1204, configured to recover the first repetition point in the second grid based on the repetition point information of the first repetition point, to obtain the first grid.
Optionally, the recovering the first repetition point in the second grid based on the repetition point information of the first repetition point, and obtaining the first grid includes:
And adding the first repeated point into the second grid based on the index of the repeated point of the first repeated point and the index of the surface where the repeated point is located, and recovering the connection relation between the first repeated point and the geometric vertex in the second grid to obtain the first grid.
Optionally, the first decoding module 1202 includes:
a determining unit, configured to determine a first sub-code stream and a second sub-code stream included in the first code stream;
a first decoding unit, configured to decode the first subcode stream to obtain a manifold mesh;
The second decoding unit is configured to decode the second sub-code stream based on the geometric decoding order and the connection relation decoding order to obtain non-manifold information when the second sub-code stream includes a third identifier, where the third identifier is used to indicate that the encoding end performs the non-manifold structure splitting;
and the recovery unit is used for recovering the non-manifold structure in the manifold grid by utilizing the non-manifold information to obtain the second grid.
Optionally, the manifold mesh includes a first manifold mesh and a second manifold mesh, the first manifold mesh includes a first vertex, the second manifold mesh includes a second vertex, the first vertex and the second vertex are repetition points, the non-manifold information includes index information of the first vertex and index information of the second vertex, and the recovery unit is specifically configured to perform the following operations:
And combining the first vertex and the second vertex based on the index information of the first vertex and the index information of the second vertex, and updating the connection relation information of the second manifold mesh to obtain the second mesh, wherein the second mesh comprises the first manifold mesh and a first non-manifold mesh converted by the second manifold mesh, and the first manifold mesh and the first non-manifold mesh are connected through the non-manifold structure.
Optionally, the index information includes a geometric index and an attribute index.
Optionally, the first decoding unit is specifically configured to perform the following operations:
decoding the first subcode stream to obtain geometric information, attribute information and second connection relation information;
Reconstructing the manifold mesh based on the geometric information, attribute information and second connection relationship information;
the first subcode stream comprises a geometric information code stream corresponding to the geometric information, an attribute information code stream corresponding to the attribute information and a relation information code stream corresponding to the second connection relation information, and the second connection relation information is used for representing the connection relation of the vertexes of the manifold grids.
The grid encoding device and the grid decoding device in the embodiments of the present application may be electronic devices, for example, electronic devices with an operating system, or may be components in electronic devices, for example, integrated circuits or chips. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the terminals may include, but are not limited to, the types of terminals 11 listed above, other devices may be servers, network attached storage (Network Attached Storage, NAS), etc., and embodiments of the present application are not limited in detail.
The trellis encoding device and the trellis decoding device provided by the embodiments of the present application can implement the processes implemented by the embodiments of the methods of fig. 2 to 10, and achieve the same technical effects, and for avoiding repetition, the description is omitted here.
Optionally, as shown in fig. 13, the embodiment of the present application further provides a communication device 1300, including a processor 1301 and a memory 1302, where the memory 1302 stores a program or instructions that can be executed on the processor 1301, for example, when the communication device 1300 is an encoding end device, the program or instructions implement the steps of the foregoing embodiment of the trellis encoding method when executed by the processor 1301, and achieve the same technical effect. When the communication device 1300 is a decoding end device, the program or the instruction, when executed by the processor 1301, implements the steps of the foregoing embodiment of the trellis decoding method, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here.
The embodiment of the application also provides a terminal, which comprises a processor and a communication interface,
When the terminal is a coding end, the processor is used for filtering out repeated points of a first grid to be coded to obtain repeated point information of a second grid and a first repeated point, wherein the first repeated point is a geometric vertex in the second grid, the first repeated point is obtained by combining at least two repeated points in the first grid, and the repeated point information comprises indexes of the repeated points and indexes of the surface where the repeated points are located; encoding the second grid to obtain a first code stream; encoding the repeated point information of the first repeated point based on a geometric encoding sequence and a connection relation encoding sequence to obtain a repeated point information code stream, wherein the repeated point information code stream carries a first identifier for representing that an encoding end performs repeated point filtering, and the geometric encoding sequence and the connection relation encoding sequence are determined based on the encoding process of the second grid; determining a target code stream of the first grid based on the repeated point information code stream and the first code stream;
Or when the terminal is a decoding end, the processor is used for acquiring a first code stream and a repeated point information code stream of a first repeated point according to the target code stream of the first grid; decoding the first code stream to obtain a second grid, wherein the first repeated points are geometric vertexes in the second grid, the first repeated points are obtained by combining at least two repeated points in the first grid, and the repeated point information comprises indexes of the repeated points and indexes of the surfaces where the repeated points are located; decoding the repeated point information code stream based on a geometric decoding sequence and a connection relation decoding sequence to obtain repeated point information of the first repeated point under the condition that the repeated point information code stream comprises a first identifier, wherein the first identifier is used for indicating that a coding end performs repeated point filtering, and the geometric decoding sequence and the connection relation decoding sequence are determined based on the decoding process of the second grid; and recovering the first repeated point in the second grid based on the repeated point information of the first repeated point to obtain the first grid.
The terminal embodiment corresponds to the terminal-side method embodiment, and each implementation process and implementation manner of the method embodiment can be applied to the terminal embodiment, and the same technical effects can be achieved. Specifically, fig. 14 is a schematic diagram of a hardware structure of a terminal for implementing an embodiment of the present application.
The terminal 1400 includes, but is not limited to: at least part of the components of the radio frequency unit 1401, the network module 1402, the audio output unit 1403, the input unit 1404, the sensor 1405, the display unit 1406, the user input unit 1407, the interface unit 1408, the memory 1409, the processor 1410, and the like.
Those skilled in the art will appreciate that terminal 1400 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to processor 1410 by a power management system so as to perform functions such as managing charging, discharging, and power consumption by the power management system. The terminal structure shown in fig. 14 does not constitute a limitation of the terminal, and the terminal may include more or less components than shown, or may combine certain components, or may be arranged in different components, which will not be described in detail herein.
It should be appreciated that in embodiments of the present application, the input unit 1404 may include a graphics processing unit (Graphics Processing Unit, GPU) 14041 and a microphone 14042, with the graphics processor 14041 processing image data of still pictures or video obtained by an image capture device (e.g., a camera) in a video capture mode or an image capture mode. The display unit 1406 may include a display panel 14061, and the display panel 14061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1407 includes at least one of a touch panel 14071 and other input devices 14072. The touch panel 14071 is also referred to as a touch screen. The touch panel 14071 may include two parts, a touch detection device and a touch controller. Other input devices 14072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
In the embodiment of the present application, after receiving downlink data from a network side device, the radio frequency unit 1401 may transmit the downlink data to the processor 1410 for processing; in addition, the radio frequency unit 1401 may send uplink data to the network-side device. In general, the radio frequency unit 1401 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
Memory 1409 may be used to store software programs or instructions and various data. The memory 1409 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 1409 may include volatile memory or nonvolatile memory, or the memory 1409 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static random access memory (STATIC RAM, SRAM), dynamic random access memory (DYNAMIC RAM, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate Synchronous dynamic random access memory (Double DATA RATE SDRAM, DDRSDRAM), enhanced Synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCH LINK DRAM, SLDRAM), and Direct random access memory (DRRAM). Memory 1409 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
Processor 1410 may include one or more processing units; optionally, the processor 1410 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 1410.
When the terminal is a coding end, the processor 1410 is configured to filter out a repetition point of a first mesh to be coded to obtain repetition point information of a second mesh and a first repetition point, where the first repetition point is a geometric vertex in the second mesh, and the first repetition point is obtained by combining at least two repetition points in the first mesh, and the repetition point information includes an index of the repetition point and an index of a plane where the repetition point is located; encoding the second grid to obtain a first code stream; encoding the repeated point information of the first repeated point based on a geometric encoding sequence and a connection relation encoding sequence to obtain a repeated point information code stream, wherein the repeated point information code stream carries a first identifier for representing that an encoding end performs repeated point filtering, and the geometric encoding sequence and the connection relation encoding sequence are determined based on the encoding process of the second grid; determining a target code stream of the first grid based on the repeated point information code stream and the first code stream;
Or when the terminal is a decoding end, the processor 1410 is configured to obtain a first code stream and a repetition point information code stream of a first repetition point according to a target code stream of a first grid; decoding the first code stream to obtain a second grid, wherein the first repeated points are geometric vertexes in the second grid, the first repeated points are obtained by combining at least two repeated points in the first grid, and the repeated point information comprises indexes of the repeated points and indexes of the surfaces where the repeated points are located; decoding the repeated point information code stream based on a geometric decoding sequence and a connection relation decoding sequence to obtain repeated point information of the first repeated point under the condition that the repeated point information code stream comprises a first identifier, wherein the first identifier is used for indicating that a coding end performs repeated point filtering, and the geometric decoding sequence and the connection relation decoding sequence are determined based on the decoding process of the second grid; and recovering the first repeated point in the second grid based on the repeated point information of the first repeated point to obtain the first grid.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, where the program or the instruction implements each process of the foregoing trellis encoding method embodiment when executed by a processor, or where the program or the instruction implements each process of the foregoing trellis decoding method embodiment when executed by a processor, and the program or the instruction can achieve the same technical effect, and for avoiding repetition, a detailed description is omitted herein.
Wherein the processor is a processor in the terminal described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running a program or instructions, the processes of the above embodiment of the grid coding method or the grid decoding method can be realized, the same technical effects can be achieved, and the repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, or the like.
The embodiments of the present application further provide a computer program/program product, where the computer program/program product is stored in a storage medium, and the computer program/program product is executed by at least one processor to implement each process of the above-mentioned embodiment of the trellis encoding method or the trellis decoding method, and achieve the same technical effect, and for avoiding repetition, a detailed description is omitted herein.
The embodiment of the application also provides a video coding and decoding system, which comprises: the encoding end device is configured to perform the processes of the method embodiments of the encoding end device shown in fig. 2 and described above, and the decoding end device is configured to perform the processes of the method embodiments of the encoding end device shown in fig. 10 and described above, so that the same technical effects can be achieved, and for avoiding repetition, a detailed description is omitted.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.