Three-dimensional model set compression method and device, equipment and storage medium
By allocating CPU and GPU processing tasks in the 3D model set, and using the pipeline method to compress the 3D model set, the problem of low compression efficiency of the 3D model set is solved, and efficient 3D content transmission and user experience improvement are achieved.
Patent Information
- Application Number
- CN202311692610.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2024-10-18
AI Technical Summary
When the existing technology compresses a three-dimensional model set, the compression efficiency is low, and the CPU or GPU has limited compression capabilities for the three-dimensional model set, resulting in low efficiency.
By determining at least one pipeline based on the number of three-dimensional model sets, allocating the connection relationship compression task to the CPU and the geometric information compression task to the GPU, using the characteristics of the CPU and GPU to construct the vertex spanning tree and the triangle spanning tree respectively, and Single instruction stream and multiple data stream processing improve compression efficiency.
The compression capability and compression efficiency of the 3D model set are improved, real-time transmission of 3D content is realized, and the end-user experience is improved.
Smart Images

Figure CN118796423A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a three-dimensional model set compression method, device, equipment and storage medium. Background Art
[0002] A 3D scene contains various 3D models, which can be regarded as a 3D model set. Compressing these models can reduce the bandwidth and space required for data transmission and storage, thereby improving rendering performance and loading speed.
[0003] At present, the compression of a single 3D model is generally based on meshing and transformation algorithms, vector quantization algorithms, compressed texture algorithms, etc. These algorithms are mainly optimized for the CPU (Central Processing Unit) and improve the efficiency of compression and decompression by utilizing the processing power and cache of the CPU. On the other hand, GPU (Graphics Processing Unit) can also be used to accelerate the compression and decompression process of 3D models. GPU has parallel computing capabilities and specialized graphics processing unit and other hardware resources, which can realize efficient data parallel computing.
[0004] However, there is still a lack of effective compression methods for compressing 3D model sets. If only the CPU or GPU is used to compress the 3D model set, the compression efficiency of the 3D model set will be low due to the limited compression capability of the CPU or GPU. Summary of the invention
[0005] The embodiments of the present application provide a 3D model set compression method, apparatus, device and storage medium to solve the problem of low compression efficiency of the 3D model set.
[0006] In a first aspect, an embodiment of the present application provides a method for compressing a three-dimensional model set, comprising:
[0007] Based on the number of 3D models in the 3D model set, determining at least one production line;
[0008] Assigning the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigning the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline;
[0009] Based on the CPU compressing the connection relationship of each three-dimensional model, and based on the GPU compressing the geometric information of each three-dimensional model, compression information of the three-dimensional model set is obtained.
[0010] Based on the above embodiment, the connection relationship compression task includes a vertex spanning tree construction task and a triangle spanning tree construction task; the CPU includes a first processing core and a second processing core;
[0011] The step of allocating the connection relationship compression task of each three-dimensional model to the central processing unit (CPU) of the pipeline includes:
[0012] The task of constructing the vertex spanning tree is assigned to the first processing core, and the task of constructing the triangle spanning tree is assigned to the second processing core.
[0013] Based on the above embodiment, the connection relationship of the three-dimensional models compressed by the CPU includes:
[0014] constructing the vertex spanning tree of each three-dimensional model based on the first processing core, and inputting the vertex spanning tree into the second processing core;
[0015] The polygons corresponding to the vertex spanning tree are determined based on the second processing core, so as to construct the triangle spanning tree of each three-dimensional model based on the polygons.
[0016] Based on the above embodiment, constructing the vertex spanning tree of each three-dimensional model based on the first processing core includes:
[0017] Based on the first processing core, selecting a root node of a vertex spanning tree to be constructed on a triangular mesh corresponding to the three-dimensional model;
[0018] Determine a weight of each edge in the triangular mesh based on the root node and the midpoint of each edge in the triangular mesh;
[0019] Based on the weight, traverse each edge in the triangular mesh to determine a set of segmentation edges;
[0020] The vertex spanning tree is generated based on the set of partitioned edges.
[0021] Based on the above embodiment, determining the polygons corresponding to the vertex spanning tree based on the second processing core to construct the triangle spanning tree of each three-dimensional model based on the polygons includes:
[0022] Based on the second processing core, cutting the triangular mesh corresponding to the three-dimensional model along the edge of the vertex spanning tree to obtain the polygon;
[0023] A boundary ring corresponding to the polygon is determined to construct the triangle spanning tree based on a dual graph of the boundary ring.
[0024] Based on the above embodiment, compressing the geometric information of each three-dimensional model based on the GPU includes:
[0025] Based on the GPU, determine vertex data of the vertex spanning tree;
[0026] The vertex data is processed using a single instruction stream multiple data stream to compress geometric information of each three-dimensional model.
[0027] Based on the above embodiment, after determining at least one production line based on the number of three-dimensional models in the three-dimensional model set, the method further includes:
[0028] Determine a first operating frequency of the first processing core, a second operating frequency of the second processing core, and a third operating frequency of the GPU based on the execution time and working energy consumption of the first processing core, the execution time and working energy consumption of the second processing core, the execution time and working energy consumption of the GPU, the execution time weight, and the working energy consumption weight;
[0029] adjusting an operating frequency of the first processing core in the pipeline based on the first operating frequency;
[0030] adjusting the operating frequency of the second processing core in the pipeline based on the second operating frequency;
[0031] The operating frequency of the GPU in the pipeline is adjusted based on the third operating frequency.
[0032] In a second aspect, an embodiment of the present application provides a three-dimensional model set compression device, comprising:
[0033] A pipeline determination module, used to determine at least one pipeline based on the number of three-dimensional models in the three-dimensional model set;
[0034] A compression task allocation module, used to allocate the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and to allocate the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline;
[0035] The compression module is used to compress the connection relationship of each three-dimensional model based on the CPU, and to compress the geometric information of each three-dimensional model based on the GPU to obtain the compression information of the three-dimensional model set.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein when the processor executes the program, the steps of the three-dimensional model set compression method described in the first aspect are implemented.
[0037] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the three-dimensional model set compression method described in the first aspect are implemented.
[0038] The 3D model set compression method, device, equipment and storage medium provided in the embodiments of the present application determine at least one pipeline based on the number of 3D models in the 3D model set; assign the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assign the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline; compress the connection relationship of each 3D model based on the CPU, and compress the geometric information of each 3D model based on the GPU, to obtain the compression information of the 3D model set. The present application uses a pipeline method to assign the connection relationship compression task of the 3D model to the CPU and the geometric information compression task to the GPU according to the affinity of the compression task and the kernel, thereby improving the compression capability and compression efficiency of the 3D model set, realizing real-time transmission of 3D content, and improving the terminal user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 It is a flowchart of a three-dimensional model set compression method provided in an embodiment of the present application;
[0041] Figure 2 It is a schematic diagram of the process of pipelined 3D model set compression provided by an embodiment of the present application;
[0042] Figure 3 It is a compressed schematic diagram of the connection relationship of the three-dimensional model provided in the embodiment of the present application;
[0043] Figure 4 It is a structural schematic diagram of a three-dimensional model set compression device provided in an embodiment of the present application;
[0044] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] Figure 1 3D model set compression method provided in the embodiment of the present application is shown in FIG. Figure 1 , the embodiment of the present application provides a three-dimensional model set compression method, which may include:
[0047] Step 100, determining at least one production line based on the number of three-dimensional models in the three-dimensional model set;
[0048] It should be noted that the pipeline is used to compress the three-dimensional model set, and one pipeline includes a central processing unit (CPU) and a graphics processing unit (GPU).
[0049] The three-dimensional model set includes multiple three-dimensional models, and each three-dimensional model is compressed using one pipeline, so the number of pipelines corresponds to the number of three-dimensional models.
[0050] Step 200, assigning the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigning the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline;
[0051] It should be noted that the compression of 3D models can be divided into two parts: connection relationship compression and geometric information compression.
[0052] The embodiment of the present application allocates the connection relationship compression task of the 3D model to the CPU and the geometry information compression task to the GPU according to the affinity between the compression task and the kernel. The affinity between the compression task and the kernel refers to the degree of match between the characteristics of the compression task and the characteristics of the processor. Different compression tasks have different requirements on the processor, which requires allocating processor resources according to the characteristics of the compression task to achieve optimal computing efficiency and processing speed.
[0053] In the process of compressing 3D models, the construction of connection relationships mainly involves serial operations of vertex spanning trees and triangle spanning trees, which requires processing of global information, so it is more suitable to be processed by CPU. However, geometric information compression involves parallel calculation of a large amount of data, and the processing of each vertex is relatively independent, so it can be processed by GPU's single instruction stream multiple data stream multiple mode to improve computing efficiency.
[0054] Furthermore, the connection relationship compression task includes the construction task of the vertex spanning tree and the construction task of the triangle spanning tree. Since the compression tasks are different, the construction task of the vertex spanning tree and the construction task of the triangle spanning tree need to be assigned to different processing cores in the CPU for compression processing. Specifically, the construction task of the vertex spanning tree is assigned to the first processing core, and the construction task of the triangle spanning tree is assigned to the second processing core. The CPU includes a first processing core and a second processing core, the first processing core refers to a large core, and the second processing core refers to a small core.
[0055] It is understandable that the construction task of the vertex spanning tree usually requires processing the topological structure of the three-dimensional model, which involves the connection relationship between vertices. This compression task has high requirements for the processor's cache and memory bandwidth because it needs to access and operate a large amount of vertex data. The large cores in the CPU usually have larger caches and higher memory bandwidth. Therefore, assigning the construction task of the vertex spanning tree to the large cores can better meet the needs of the vertex spanning tree task.
[0056] The construction task of the triangle spanning tree is usually a computationally intensive task that requires processing the geometric information of the triangle. The compression task can be divided into multiple independent subtasks, and these subtasks can be calculated in parallel. The small cores in the CPU usually have more physical cores and have better performance in parallel computing. Therefore, assigning the construction task of the triangle spanning tree to the small cores can make full use of their multi-threaded parallel computing capabilities and improve the execution efficiency of the task.
[0057] Step 300: Compressing the connection relationship of each three-dimensional model based on the CPU and compressing the geometric information of each three-dimensional model based on the GPU to obtain compression information of the three-dimensional model set.
[0058] The connection relationship of each 3D model is compressed by the CPU, and the geometric information of each 3D model is compressed based on the GPU to obtain the compressed information of the 3D model set. Among them, compressing the connection relationship of each 3D model refers to processing the topological structure in the 3D model, that is, the connection relationship between vertices, which involves the construction of vertex spanning trees and triangle spanning trees to maintain the shape and structure of the model during the compression process. The geometric information of each 3D model is compressed, including vertex coordinates, normals, texture coordinates, etc. The goal of geometric information compression is to reduce the storage space and transmission bandwidth of the model by reducing the amount of data or using a more efficient representation method.
[0059] refer to Figure 2 , Figure 2The system includes three pipelines, each of which processes a compression task for a 3D model, including vertex spanning tree construction, triangle spanning tree construction, and geometric information compression. The compression process is as follows: first, the vertex spanning tree of 3D model 1 is constructed using a large core, and then the vertex spanning tree is input into a small core, and the triangle spanning tree is constructed using the small core; at the same time, since the large core is idle after completing the vertex spanning tree construction, the vertex spanning tree of 3D model 2 is constructed by the large core. That is, while the small core is constructing the triangle spanning tree of 3D model 1, the large core is constructing the vertex spanning tree of 3D model 2. Based on this, while the GPU is compressing the geometric information of 3D model 1, the small core is constructing the triangle spanning tree of 3D model 2, and the large core is constructing the vertex spanning tree of 3D model 3. And so on, the compression of the 3D model set is completed.
[0060] The 3D model set compression method provided in the embodiment of the present application determines at least one pipeline based on the number of 3D models in the 3D model set; assigns the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigns the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline; compresses the connection relationship of each 3D model based on the CPU, and compresses the geometric information of each 3D model based on the GPU, to obtain the compression information of the 3D model set. The embodiment of the present application assigns the connection relationship compression task of the 3D model to the CPU and the geometric information compression task to the GPU in a pipeline manner according to the affinity of the compression task and the kernel, thereby improving the compression capability and compression efficiency of the 3D model set, realizing real-time transmission of 3D content, and improving the terminal user experience.
[0061] Based on the above embodiment, the connection relationship of the three-dimensional models compressed by the CPU includes:
[0062] Step 311, constructing the vertex spanning tree of each three-dimensional model based on the first processing core, and inputting the vertex spanning tree into the second processing core;
[0063] Step 312: determine the polygons corresponding to the vertex spanning tree based on the second processing core, so as to construct the triangle spanning tree of each three-dimensional model based on the polygons.
[0064] Based on the first processing core (i.e., the large core), the root node of the vertex spanning tree to be constructed is selected on the triangular mesh corresponding to the three-dimensional model; based on the root node and the midpoint of each edge in the triangular mesh, the weight of each edge in the triangular mesh is determined; based on the weight, each edge in the triangular mesh is traversed to determine the set of splitting edges; based on the set of splitting edges, a vertex spanning tree is generated.
[0065] For example, select a vertex v on the triangle mesh rAs the root node of the vertex spanning tree to be constructed, then for each edge e of the triangle mesh i , and assign certain weights according to the following formula:
[0066]
[0067] in, for e i The midpoint of . All edges are sorted in ascending order according to the weights and then traversed. For each edge, it is tested and placed into two structures according to the test results: one is the set of split edges E C ; The other is a forest E consisting of graphs generated by step edges F Specifically, if an edge connects two graphs in the forest or does not form a loop after adding the edge to the graph, then the edge is a step edge and needs to be added; otherwise, it is a split edge. The above process is iterated until a vertex spanning tree containing all the edges in is generated, such as Figure 3 (f) as shown.
[0068] Optionally, after completing the construction of the vertex spanning tree, a leaf node of the vertex spanning tree is selected as the root node, and a pre-order traversal is performed on the spanning tree, wherein the order of the child nodes of the branch node is consistent with the global orientation of the grid (clockwise or counterclockwise). Then, three pieces of information of each traversal of the vertex spanning tree are recorded: the traversal length, the branch symbol (indicating whether the next traversal of the current traversal is a continuation of the same branch node), and the leaf node symbol (indicating whether the traversal ends at a leaf node).
[0069] Based on the second processing core (ie, the small core), the triangular mesh corresponding to the three-dimensional model is cut along the edge of the vertex spanning tree to obtain polygons; the boundary ring corresponding to the polygon is determined, and a triangle spanning tree is constructed based on the dual graph of the boundary ring.
[0070] For example, a triangular mesh model ( Figure 3 (a)) The compression of connection relationships mainly includes vertex spanning trees ( Figure 3 (b)) and the triangle spanning tree ( Figure 3 (f)) construction and encoding, cutting the triangular mesh model along the edge of the vertex spanning tree can obtain simply connected polygons ( Figure 3 (c) and (d)), the boundary ring of the tree ( Figure 3 (e)) corresponds to the boundary of the polygon, and the dual graph of the boundary ring is the triangle spanning tree ( Figure 3 (f)). Specifically, the construction process of the triangle spanning tree is similar to the construction process of the vertex spanning tree. Similarly, the triangle tree structure table and the progress mode can be generated by traversing the triangle spanning tree, such as including the following steps:
[0071] Select a leaf node as the root triangle, ensure that the triangle contains two edges in the boundary loop, and the common vertex of these two edges becomes the root vertex of the triangle tree.
[0072] Starting from the root triangle, perform a traversal operation, record the relevant information of each triangle during the traversal, and determine the triangles adjacent to it.
[0073] During the traversal process, the adjacency relationship of each triangle is determined. At the same time, by checking the edges of adjacent triangles, the connection relationship between them can be determined.
[0074] According to the connection relationship of triangles, a triangle spanning tree is constructed. The triangle spanning tree is a tree structure formed by the connection relationship starting from the root triangle.
[0075] Optionally, after completing the construction of the triangle spanning tree, a pre-order traversal is performed on the triangle spanning tree, and a record containing two information: a traversal length and a leaf node symbol is generated for each triangle strip connecting two leaf triangles or branch triangles.
[0076] The embodiment of the present application assigns the compression task of the connection relationship of the three-dimensional model to the CPU according to the affinity between the compression task and the kernel, thereby improving the compression capability and compression efficiency of the three-dimensional model set, realizing real-time transmission of three-dimensional content, and improving the terminal user experience.
[0077] Based on the above embodiment, compressing the geometric information of each three-dimensional model based on the GPU includes:
[0078] Step 313, determining vertex data of the vertex spanning tree based on the GPU;
[0079] Step 314: Process the vertex data using SIMD to compress geometric information of each 3D model.
[0080] After the vertex spanning tree is generated, the vertex spanning tree is transferred to the GPU and converted into an image format suitable for the GPU, and then all vertices are processed in a single instruction stream multiple data stream manner to complete the compression of geometric information. For example, compressing geometric information includes the following steps:
[0081] Convert the vertex spanning tree to image data: Map the vertex coordinates of the vertex spanning tree to the image space, which can be represented by texture coordinates or pixel coordinates. Then, according to the required accuracy and resolution, map the vertex coordinates to the pixel value range of the image to generate the corresponding image data.
[0082] SIMD parallel processing: The vertex data corresponding to the image data is processed on the GPU using SIMD. SIMD allows the same instruction to be executed on multiple data at the same time, improving processing efficiency.
[0083] Compression of geometric information: Compression of geometric information of vertex data on the GPU, such as block-based compression algorithms (such as grid-based compression, curve-based compression, etc.) or point cloud compression algorithms (such as motion estimation-based compression, clustering-based compression, etc.). These algorithms can use the parallel computing power of the GPU to quickly process large amounts of vertex data.
[0084] The embodiment of the present application assigns the task of compressing the geometric information of the 3D model to the GPU according to the affinity between the compression task and the kernel, thereby improving the compression capability and efficiency of the 3D model set, realizing real-time transmission of 3D content, and improving the terminal user experience.
[0085] Based on the above embodiment, after determining at least one production line based on the number of three-dimensional models in the three-dimensional model set, the method further includes:
[0086] Step 111, determining a first operating frequency of the first processing core, a second operating frequency of the second processing core, and a third operating frequency of the GPU based on the execution time and working energy consumption of the first processing core, the execution time and working energy consumption of the second processing core, the execution time and working energy consumption of the GPU, the execution time weight, and the working energy consumption weight;
[0087] Step 112, adjusting the operating frequency of the first processing core in the pipeline based on the first operating frequency;
[0088] Step 113, adjusting the operating frequency of the second processing core in the pipeline based on the second operating frequency;
[0089] Step 114: adjust the operating frequency of the GPU in the pipeline based on the third operating frequency.
[0090] In a pipeline, the processing time of each stage is as consistent as possible to maximize the efficiency of the pipeline, that is, to achieve the ideal situation. For the MPSoC multi-core architecture, the processing efficiency of the core can be improved by adjusting the frequency, but it will also lead to increased energy consumption. Therefore, the embodiment of the present application obtains the optimal frequency of each core by optimizing the following objective function, that is, to make the processing time of each pipeline stage as consistent as possible and to maximize energy efficiency. Among them, the objective function is:
[0091]
[0092] Among them, wT and w E To control the weights of the two optimization sub-goals (consistent time of each stage of the pipeline and maximum overall energy efficiency), that is, w T is the execution time weight, w E is the working energy consumption weight, T B is the execution time of the large core, T S is the execution time of the small core, T G is the GPU execution time, E B is the working energy consumption of the large core, E S is the working energy consumption of the small core, E G is the GPU working energy consumption, f B is the first operating frequency of the large core, f S is the first operating frequency of the small core, f G The first operating frequency of the GPU.
[0093] Among them, the execution time T (including T B , T S , T G ) and working energy consumption E (including E B 、E S 、E G ) are all functions of the operating frequency f:
[0094]
[0095] E=P·T=(ACV 2 f+P i )·T;
[0096] Among them, α and β are constants, which are obtained by sampling and fitting the frequency during operation; P is power, P i is the standby power, A is the active factor, C is the capacitance, and V is the voltage.
[0097] The embodiment of the present application optimizes the objective function and finds the optimal frequency adjustment solution, which can reduce energy consumption and improve energy efficiency while ensuring the efficiency of the assembly line.
[0098] In order to further analyze and explain the three-dimensional model set compression method proposed in this application, refer to the following examples.
[0099] The embodiment of the present application specifically proposes a heterogeneous pipelined 3D model set compression algorithm, which fully utilizes the computing power of heterogeneous cores on mobile devices in a pipeline manner, greatly improves the compression capability of the 3D model set, realizes real-time transmission of 3D content, and improves the terminal user experience.
[0100] refer to Figure 2, organize the cores of the mobile terminal MPSoC into different pipeline stages according to the principle of similar clustering, and then divide the compression of the triangular mesh model into several subtasks according to the specific configuration of the MPSoC. At the same time, according to the different affinities of each task to the CPU and GPU, the connection relationship compression task is assigned to the CPU, and the geometric information compression task is assigned to the GPU. Finally, the pipeline is optimized through DVFS. The following is an analysis of the CPU pipeline organization of connection relationship compression, the mobile GPU implementation of geometric information compression, and the pipeline optimization based on DVFS.
[0101] (1)CPU pipeline organization with compressed connection relations.
[0102] In an extreme case, if all vertices of a triangular mesh model can be organized into a two-dimensional regular grid, the number of rows and columns of the two-dimensional regular grid is sufficient to fully define the triangular mesh model, where the triangular mesh model is a specific representation of a three-dimensional model, which is a surface model composed of many small triangles. At the other extreme, if each triangle needs to store three vertex indices, the redundancy of the connection relationship of the triangular mesh is the highest. The triangle strip used in OpenGL can be regarded as a compromise between the two. According to the classification theory of algebraic topology, all two-dimensional manifolds can be folded along the pair of associated edges by continuously selecting two associated edges from a simple connected plane triangular mesh, folding the triangular mesh so that the pair of associated edges overlap and are continuous in normal direction, that is, stitching the triangular mesh along the pair of associated edges. Based on this, for the three-dimensional model to be compressed, a suitable plane triangular mesh model and its associated edge pairs can be constructed, and then the plane triangular mesh can be compressed similarly to the triangle strip.
[0103] Furthermore, for a simple triangle mesh model (genus is zero), first construct a vertex spanning tree based on the triangle mesh, then cut the mesh along the edge of the vertex spanning tree to obtain a simple connected plane triangle mesh, and the dual graph of the plane triangle mesh is a triangle spanning tree. Finally, it is only necessary to encode the vertex spanning tree and the triangle spanning tree using the itinerary method.
[0104] Triangular mesh model ( Figure 3 (a)) The compression of connection relationships mainly includes vertex spanning trees ( Figure 3 (b)) and the triangle spanning tree ( Figure 3 (f)) construction and encoding, cutting the triangular mesh model along the edge of the vertex spanning tree can obtain simply connected polygons ( Figure 3 (c) and (d)), the boundary ring of the tree ( Figure 3 (e)) corresponds to the boundary of the polygon, and the dual graph of the deformation is the triangle spanning tree ( Figure 3 (f)).
[0105] First, select a vertex v on the triangle mesh. r As the root node of the vertex spanning tree to be constructed, then for each edge e of the triangle mesh i , and assign certain weights according to the following formula:
[0106]
[0107] in, for e i The midpoint of . All edges are sorted in ascending order according to the weights and then traversed. For each edge, it is tested and placed into two structures according to the test results: one is the set of split edges E C ; The other is a forest E consisting of graphs generated by step edges F . Specifically, if an edge connects two graphs in the forest or no loop is formed after adding the edge to the graph, then the edge is a step edge and needs to be added; otherwise, it is a split edge. The above process is iterated until a vertex spanning tree containing all the edges in is generated. After completing the construction of the vertex spanning tree, select a leaf node of the vertex spanning tree as the root node, and perform a pre-order traversal of the spanning tree, where the ordering of the child nodes of the branch node is consistent with the global orientation of the grid (clockwise or counterclockwise). Then, three information of each traversal of the vertex spanning tree is recorded: the traversal length, the branch symbol (indicating whether the next traversal of the current traversal is the continuation of the same branch node), and the leaf node symbol (indicating whether the traversal ends at a leaf node).
[0108] The construction process of the triangle spanning tree is similar to that of the vertex spanning tree. Similarly, the triangle tree structure table and the progress mode can be generated by traversing the triangle spanning tree. First, a leaf node of the triangle tree is selected as the root triangle, where the triangle must contain two edges on the boundary loop, and the common vertex of these two edges is the root vertex of the triangle tree. Then, the triangle spanning tree is traversed in preorder, and a record containing two pieces of information is generated for each triangle strip connecting two leaf triangles or branch triangles: the traversal length and the leaf node symbol.
[0109] (2) Mobile GPU implementation of geometric information compression.
[0110] The vertex spanning tree is transferred to the GPU and converted into an image format suitable for the GPU. Then all vertices are processed in a single instruction multiple data (SIMD) manner to complete the compression of geometric information. Among them, each vertex on the vertex spanning tree has a unique path through the root node. The depth of the vertex is the length of the path, and the depth of the root node is 0.
[0111] Let v n The result of quantizing the relative position of the vertex with a depth of n in the canonical bounding box to B bits is:
[0112] v n =∈(v n )+P(λ,v n-1 ,…,v n-K );
[0113] Among them, ∈(v n ) is the vertex position correction component corresponding to the vertex, P(·) is the vertex position prediction function, λ=(λ1…λ K ) is an integer vector, v n-1 ,…,v n-K For the K ancestors on the unique path from the vertex to the root of the vertex tree, P(·) is defined as a linear function, that is:
[0114]
[0115] The integer vector λ can be determined by optimizing the minimum quadratic error function as follows:
[0116] λ=∑ n≥K ‖∈ n ‖ 2 ;
[0117] That is, the sum of the correction components of all vertex positions with depth n ≥ K is minimized.
[0118] (3) Pipeline optimization based on DVFS.
[0119] Since the bottleneck of the pipeline comes from the slowest link, ideally, the time used in each stage is consistent, and the efficiency of the pipeline is the highest. For MPSoC, the processing efficiency of the core can be improved by adjusting the frequency, but it will also lead to increased energy consumption. Therefore, the optimal frequency of each core is obtained by optimizing the following objective function, that is, making the processing time of each pipeline stage as consistent as possible and making the energy efficiency the highest. Among them, the objective function is:
[0120]
[0121] Among them, wT and w E To control the weights of the two optimization sub-goals (consistent time of each stage of the pipeline and maximum overall energy efficiency), that is, w T is the execution time weight, w E is the working energy consumption weight, T B is the execution time of the large core, T S is the execution time of the small core, T G is the GPU execution time, E B is the working energy consumption of the large core, E S is the working energy consumption of the small core, E G is the GPU working energy consumption, f B is the first operating frequency of the large core, f S is the first operating frequency of the small core, f G The first operating frequency of the GPU.
[0122] Among them, the execution time T (including T B , T S , T G ) and working energy consumption E (including E B 、E S 、E G ) are all functions of the operating frequency f:
[0123]
[0124] E=P·T=(ACV 2 f+P i )·T;
[0125] Among them, α and β are constants, which are obtained by sampling and fitting the frequency during operation; P is the power, P i is the standby power, A is the active factor, C is the capacitance, and V is the voltage.
[0126] The embodiment of the present application assigns the connection relationship compression task to the CPU and the geometry information compression task to the GPU according to the affinity between the task and the kernel. The reason is that the construction of the vertex spanning tree and the triangle spanning tree involved in the connection relationship compression is mainly a serial operation, and the construction process and results involve global information, which is suitable for the CPU; while each vertex of the geometry information compression is relatively independent, and can be performed in a single instruction stream, multiple data streams, and multiple ways, which is suitable for the GPU. The connection relationship compression task is further assigned to the pipeline stage composed of different types of CPU cores. At the same time, the pipeline is optimized by DVFS, so that the execution time of each stage tends to be consistent. Based on this, the computing efficiency is improved, that is, on the one hand, the computing power of each kernel of MPSoC is fully utilized, and on the other hand, the idea of pipeline is adopted. At the same time, energy consumption is reduced, that is, the energy consumption of MPSoC is related to the operating frequency of the kernel, and the pipeline optimization design fully considers efficiency and energy consumption.
[0127] The following is a description of a three-dimensional model set compression device provided in an embodiment of the present application. The three-dimensional model set compression device described below and the three-dimensional model set compression method described above can be referenced to each other.
[0128] refer to Figure 4 , Figure 4 It is a structural diagram of a three-dimensional model set compression device provided in an embodiment of the present application. The three-dimensional model set compression device provided in an embodiment of the present application includes a pipeline determination module 401, a compression task allocation module 402 and a compression module 403.
[0129] The pipeline determination module 401 is used to determine at least one pipeline based on the number of three-dimensional models in the three-dimensional model set;
[0130] A compression task allocation module 402 is used to allocate the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and allocate the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline;
[0131] The compression module 403 is used to compress the connection relationship of each 3D model based on the CPU, and compress the geometric information of each 3D model based on the GPU to obtain compression information of the 3D model set.
[0132] The 3D model set compression device provided in the embodiment of the present application determines at least one pipeline based on the number of 3D models in the 3D model set; assigns the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigns the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline; compresses the connection relationship of each 3D model based on the CPU, and compresses the geometric information of each 3D model based on the GPU, to obtain the compression information of the 3D model set. The embodiment of the present application uses a pipeline method to assign the connection relationship compression task of the 3D model to the CPU and the geometric information compression task to the GPU according to the affinity of the compression task and the kernel, thereby improving the compression capability and compression efficiency of the 3D model set, realizing real-time transmission of 3D content, and improving the terminal user experience.
[0133] The connection relationship compression task includes a vertex spanning tree construction task and a triangle spanning tree construction task; the CPU includes a first processing core and a second processing core;
[0134] In one embodiment, the compression task allocation module 402 specifically includes:
[0135] The task of constructing the vertex spanning tree is assigned to the first processing core, and the task of constructing the triangle spanning tree is assigned to the second processing core.
[0136] In one embodiment, the compression module 403 specifically includes:
[0137] constructing the vertex spanning tree of each three-dimensional model based on the first processing core, and inputting the vertex spanning tree into the second processing core;
[0138] The polygons corresponding to the vertex spanning tree are determined based on the second processing core, so as to construct the triangle spanning tree of each three-dimensional model based on the polygons.
[0139] In one embodiment, the compression module 403 specifically includes:
[0140] Based on the first processing core, selecting a root node of a vertex spanning tree to be constructed on a triangular mesh corresponding to the three-dimensional model;
[0141] Determine a weight of each edge in the triangular mesh based on the root node and the midpoint of each edge in the triangular mesh;
[0142] Based on the weight, traverse each edge in the triangular mesh to determine a set of segmentation edges;
[0143] The vertex spanning tree is generated based on the set of partitioned edges.
[0144] In one embodiment, the compression module 403 specifically includes:
[0145] Based on the second processing core, cutting the triangular mesh corresponding to the three-dimensional model along the edge of the vertex spanning tree to obtain the polygon;
[0146] A boundary ring corresponding to the polygon is determined to construct the triangle spanning tree based on a dual graph of the boundary ring.
[0147] In one embodiment, the compression module 403 specifically includes:
[0148] Based on the GPU, determine vertex data of the vertex spanning tree;
[0149] The vertex data is processed using a single instruction stream multiple data stream to compress geometric information of each three-dimensional model.
[0150] In one embodiment, the pipeline determination module 401 further includes:
[0151] Determine a first operating frequency of the first processing core, a second operating frequency of the second processing core, and a third operating frequency of the GPU based on the execution time and working energy consumption of the first processing core, the execution time and working energy consumption of the second processing core, the execution time and working energy consumption of the GPU, the execution time weight, and the working energy consumption weight;
[0152] adjusting an operating frequency of the first processing core in the pipeline based on the first operating frequency;
[0153] adjusting the operating frequency of the second processing core in the pipeline based on the second operating frequency;
[0154] The operating frequency of the GPU in the pipeline is adjusted based on the third operating frequency.
[0155] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call a computer program in the memory 530 to execute the steps of the three-dimensional model set compression method, for example, including:
[0156] Based on the number of 3D models in the 3D model set, determining at least one production line;
[0157] Assigning the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigning the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline;
[0158] Based on the CPU compressing the connection relationship of each three-dimensional model, and based on the GPU compressing the geometric information of each three-dimensional model, compression information of the three-dimensional model set is obtained.
[0159] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0160] On the other hand, an embodiment of the present application further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the three-dimensional model set compression method provided in the above embodiments are implemented, for example, including:
[0161] Based on the number of 3D models in the 3D model set, determining at least one production line;
[0162] Assigning the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigning the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline;
[0163] Based on the CPU compressing the connection relationship of each three-dimensional model, and based on the GPU compressing the geometric information of each three-dimensional model, compression information of the three-dimensional model set is obtained.
[0164] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product comprising a computer program, the computer program may be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the three-dimensional model set compression method provided in the above embodiments, for example, including:
[0165] Based on the number of 3D models in the 3D model set, determining at least one production line;
[0166] Assigning the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigning the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline;
[0167] Based on the CPU compressing the connection relationship of each three-dimensional model, and based on the GPU compressing the geometric information of each three-dimensional model, compression information of the three-dimensional model set is obtained.
[0168] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A three-dimensional model set compression method, characterized in that: include: Based on the number of 3D models in the 3D model set, determining at least one production line; Assigning the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and assigning the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline; Based on the CPU compressing the connection relationship of each three-dimensional model, and based on the GPU compressing the geometric information of each three-dimensional model, compression information of the three-dimensional model set is obtained.
2. The three-dimensional model set compression method according to claim 1, characterized in that: The connection relationship compression task includes a vertex spanning tree construction task and a triangle spanning tree construction task; the CPU includes a first processing core and a second processing core; The step of allocating the connection relationship compression task of each three-dimensional model to the central processing unit (CPU) of the pipeline includes: The task of constructing the vertex spanning tree is assigned to the first processing core, and the task of constructing the triangle spanning tree is assigned to the second processing core.
3. The three-dimensional model set compression method according to claim 2, characterized in that: The connection relationship of the three-dimensional models compressed based on the CPU includes: constructing the vertex spanning tree of each three-dimensional model based on the first processing core, and inputting the vertex spanning tree into the second processing core; The polygons corresponding to the vertex spanning tree are determined based on the second processing core, so as to construct the triangle spanning tree of each three-dimensional model based on the polygons.
4. The three-dimensional model set compression method according to claim 3, characterized in that: The step of constructing the vertex spanning tree of each three-dimensional model based on the first processing core includes: Based on the first processing core, selecting a root node of a vertex spanning tree to be constructed on a triangular mesh corresponding to the three-dimensional model; Determine a weight of each edge in the triangular mesh based on the root node and the midpoint of each edge in the triangular mesh; Based on the weight, traverse each edge in the triangular mesh to determine a set of segmentation edges; The vertex spanning tree is generated based on the set of partitioned edges.
5. The three-dimensional model set compression method according to claim 3, characterized in that: The determining, based on the second processing core, the polygon corresponding to the vertex spanning tree, so as to construct the triangle spanning tree of each three-dimensional model based on the polygon, comprises: Based on the second processing core, cutting the triangular mesh corresponding to the three-dimensional model along the edge of the vertex spanning tree to obtain the polygon; A boundary ring corresponding to the polygon is determined to construct the triangle spanning tree based on a dual graph of the boundary ring.
6. The three-dimensional model set compression method according to claim 3, characterized in that: The compressing the geometric information of each three-dimensional model based on the GPU includes: Based on the GPU, determine vertex data of the vertex spanning tree; The vertex data is processed using a single instruction stream multiple data stream to compress geometric information of each three-dimensional model.
7. The three-dimensional model set compression method according to claim 2, characterized in that: After determining at least one production line based on the number of three-dimensional models in the three-dimensional model set, the method further includes: Determine a first operating frequency of the first processing core, a second operating frequency of the second processing core, and a third operating frequency of the GPU based on the execution time and working energy consumption of the first processing core, the execution time and working energy consumption of the second processing core, the execution time and working energy consumption of the GPU, the execution time weight, and the working energy consumption weight; adjusting an operating frequency of the first processing core in the pipeline based on the first operating frequency; adjusting the operating frequency of the second processing core in the pipeline based on the second operating frequency; The operating frequency of the GPU in the pipeline is adjusted based on the third operating frequency.
8. A three-dimensional model set compression device, characterized in that: include: A pipeline determination module, used to determine at least one pipeline based on the number of three-dimensional models in the three-dimensional model set; A compression task allocation module, used to allocate the connection relationship compression task of each 3D model to the central processing unit (CPU) of the pipeline, and to allocate the geometric information compression task of each 3D model to the graphics processing unit (GPU) of the pipeline; The compression module is used to compress the connection relationship of each three-dimensional model based on the CPU, and compress the geometric information of each three-dimensional model based on the GPU to obtain the compression information of the three-dimensional model set.
9. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the three-dimensional model set compression method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the three-dimensional model set compression method according to any one of claims 1 to 7 are implemented.
