Data compression method and device, storage medium and electronic equipment
Through multiple rounds of pre-compression and dynamic adjustment of compression parameters, the problem of poor results of existing texture data compression technology is solved, and more efficient texture data compression and improved user experience is achieved.
Patent Information
- Application Number
- CN202411433455.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The compression effect of existing texture data compression technology is poor, resulting in a reduced user experience.
By receiving the client's texture data acquisition request, the texture data to be compressed is determined, and multiple rounds of pre-compression are performed based on the preset initial compression parameters, dynamically adjust the compression parameters to determine the target compression parameters, and finally compress the compressed texture data.
It effectively improves the compression effect of texture data and improves the user experience.
Smart Images

Figure CN119450051A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a data compression method, device, storage medium and electronic device. Background Art
[0002] At present, texture management and loading system is an important part of computer graphics, mainly used to manage and optimize the use of texture data in graphics applications (for example: according to the client's request, compress the texture data required by the client into a texture data compression package, and then send the texture data compression package to the client, so that the client can load and render the texture data compression package, and display the rendered image to the user). Among them, texture data is an image applied to the surface of a three-dimensional model, which can be used to simulate the appearance and texture of the material (for example: the appearance and texture of wood, the appearance and texture of cloth, etc.), thereby enhancing the realism of the scene. Therefore, texture management and loading systems are widely used in game development and other high-performance graphics application fields.
[0003] However, since the compression effect of texture data after being compressed by existing texture data compression technology is often poor, the user experience is reduced.
[0004] Therefore, how to improve the compression effect of texture data is a problem that needs to be solved urgently. Summary of the invention
[0005] This specification provides a data compression method, device, storage medium and electronic device to partially solve the above problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides a data compression method, comprising:
[0008] Receive a texture data acquisition request sent by a client;
[0009] Determining the texture data to be compressed according to the texture data acquisition request;
[0010] Based on the preset initial compression parameters, at least one round of pre-compression is performed on the texture data to be compressed to determine the target compression parameters, wherein for each round of pre-compression, the basic compression parameters in the round of pre-compression are determined, and the texture data to be compressed is pre-compressed according to the basic compression parameters to obtain a compressed file after the round of pre-compression and determine the compression quality evaluation parameters corresponding to the compressed file, if it is determined that the compression quality evaluation parameters do not meet the preset conditions, the basic compression parameters are adjusted according to the preset parameter adjustment strategy to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression, the basic compression parameters in the round of pre-compression are obtained by iterating the initial compression parameters to the previous round of pre-compression, and the compression quality evaluation parameters are used to reflect the compression efficiency of the compressed file during the compression process, the compression degree of the compressed file, and the image quality of the image loaded according to the compressed file;
[0011] The texture data to be compressed is compressed according to the target compression parameter.
[0012] Optionally, adjusting the basic compression parameter according to a preset parameter adjustment strategy to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression specifically includes:
[0013] Identifying the texture data to be compressed to determine an image area obtained by rendering by the client according to the texture data to be compressed;
[0014] According to the importance of the image area in the interface displayed by the client, the basic compression parameter is adjusted to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression.
[0015] Optionally, adjusting the basic compression parameter according to a preset parameter adjustment strategy to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression specifically includes:
[0016] Decompressing and loading the compressed file after the round of pre-compression to determine the image quality assessment parameter of the image area obtained by the client based on the compressed file after the round of pre-compression;
[0017] The basic compression parameters are adjusted according to the image quality assessment parameters to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
[0018] Optionally, adjusting the basic compression parameter according to a preset parameter adjustment strategy to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression specifically includes:
[0019] Acquire a status parameter of the client, where the status parameter is used to reflect a network environment status used by the client and a performance status of a hardware resource used by the client;
[0020] The basic compression parameter is adjusted according to the state parameter to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression.
[0021] Optionally, compressing the texture data to be compressed according to the target compression parameter specifically includes:
[0022] The target compression parameters and the texture data to be compressed are input into a pre-trained compression model to determine the feature representation corresponding to the texture data to be compressed through the feature extraction layer of the compression model, and an output layer matching the type of the texture data to be compressed is determined from each output layer as the target output layer. The texture data to be compressed is compressed through the target output layer to obtain a compressed file corresponding to the texture data to be compressed.
[0023] Optionally, training the compression model specifically includes:
[0024] Obtaining initial compression model and different types of sample texture data;
[0025] For each type of sample texture data, the sample texture data of the type and the initial compression parameters are input into the initial compression model, so that the feature extraction layer of the compression model determines the feature representation corresponding to the texture data to be compressed, and determines an output layer matching the type of the texture data to be compressed from each output layer as a sample target output layer, and compresses the texture data to be compressed through the sample target output layer to obtain a sample compressed file corresponding to the texture data to be compressed;
[0026] The sample compressed file is decompressed and loaded to obtain a sample image area, and a target loss value is determined based on a deviation between the sample image area and a preset standard image area corresponding to the sample texture data of this type. The initial compression model is trained based on the target loss value to obtain a compression model, and the deviation between the sample image area and the preset standard image area corresponding to the sample texture data of this type is positively correlated with the target loss value.
[0027] Optionally, compressing the texture data to be compressed according to the target compression parameter specifically includes:
[0028] Generating various supplementary texture data to be compressed according to the texture data to be compressed, wherein different supplementary texture data to be compressed have different resolutions;
[0029] According to the target compression parameter, compressing the texture data to be compressed and the supplementary texture data to be compressed to obtain compressed files corresponding to the texture data to be compressed and the supplementary texture data to be compressed;
[0030] The texture data to be compressed and the compressed files corresponding to the supplementary texture data to be compressed are sent to the client, so that the client determines the target texture data from the texture data to be compressed and the supplementary texture data to be compressed according to the viewing distance parameters of the interface currently displayed to the user and the operations performed by the user on the interface, and decompresses and loads the image area corresponding to the target texture data from the compressed files corresponding to the texture data to be compressed and the supplementary texture data to be compressed.
[0031] This specification provides a data compression device, comprising:
[0032] A receiving module, used for receiving a texture data acquisition request sent by a client;
[0033] A determination module, used for determining the texture data to be compressed according to the texture data acquisition request;
[0034] An adjustment module, configured to perform at least one round of pre-compression on the texture data to be compressed based on a preset initial compression parameter to determine a target compression parameter, wherein for each round of pre-compression, a basic compression parameter in the round of pre-compression is determined, and the texture data to be compressed is pre-compressed according to the basic compression parameter to obtain a compressed file after the round of pre-compression and determine a compression quality evaluation parameter corresponding to the compressed file; if it is determined that the compression quality evaluation parameter does not meet a preset condition, the basic compression parameter is adjusted according to a preset parameter adjustment strategy to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression, wherein the basic compression parameter in the round of pre-compression is obtained by iterating the initial compression parameter to the previous round of pre-compression, and the compression quality evaluation parameter is used to reflect the compression efficiency of the compressed file during the compression process, the compression degree of the compressed file, and the image quality of the image loaded from the compressed file;
[0035] A compression module is used to compress the texture data to be compressed according to the target compression parameter.
[0036] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0037] In the data compression method provided in the present specification, a texture data acquisition request sent by a client is received, and according to the texture data acquisition request, the texture data to be compressed is determined, and based on the preset initial compression parameters, at least one round of pre-compression is performed on the texture data to be compressed to determine the target compression parameters, wherein for each round of pre-compression, the basic compression parameters in the round of pre-compression are determined, and the texture data to be compressed is pre-compressed according to the basic compression parameters, a compressed file after the round of pre-compression is obtained and a compression quality evaluation parameter corresponding to the compressed file is determined, if it is determined that the compression quality evaluation parameter does not meet the preset conditions, the basic compression parameter is adjusted according to the preset parameter adjustment strategy, and the adjusted compression parameter is obtained as the basic compression parameter for the next round of pre-compression, and the basic compression parameter in the round of pre-compression is obtained by iterating the initial compression parameter to the previous round of pre-compression, wherein the compression quality evaluation parameter is used to reflect the compression efficiency in the compression process of the compressed file, the compression degree of the compressed file, and the image quality of the image loaded according to the compressed file, and finally the texture data to be compressed can be compressed according to the target compression parameter.
[0038] It can be seen from the above method that the server can perform multiple rounds of pre-compression on the texture data to be compressed required by the client, so that the compression parameters can be dynamically adjusted according to the effects of multiple rounds of pre-compression to determine the target compression parameters that are most suitable for the current scene, and then the data to be compressed can be compressed according to the target compression parameters, thereby effectively improving the compression effect of the data to be compressed. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0040] Figure 1 A flowchart of a data compression method provided in this specification;
[0041] Figure 2 A schematic diagram of a data compression device provided in this specification;
[0042] Figure 3 A method corresponding to the Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0044] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0045] S101: receiving a texture data acquisition request sent by a client.
[0046] In this specification, when the client provided by the business platform provides business services to users, in order to provide users with high-quality visual effects, it is usually necessary to load and update texture data for display to users based on the operations performed by users in the client. At this time, the client can send a texture data acquisition request to the business platform, so that the business platform receives the texture data acquisition request sent by the client, and determines the texture data required by the client in response to the acquired texture data acquisition request, and then compresses the texture data required by the client and sends it to the client. After receiving the compressed texture data sent by the business platform, the client can decompress and load the received compressed texture data to render an interface for display to the user based on the received texture data.
[0047] For example, in massively multiplayer online role-playing games, the game client provided by the business platform usually needs to load a large amount of texture data to achieve high-quality game graphics and thus provide users with a better gaming experience.
[0048] Among them, the above-mentioned texture data can refer to images used for the surface of a three-dimensional model to simulate the appearance and texture of a material (for example, image data for the appearance and texture of wood, the appearance and texture of cloth, etc.) or to simulate details (for example, parameter data such as ambient lighting), thereby enhancing the realism of the scene and characters. In other words, the above-mentioned texture data can be understood as image data corresponding to one or more layers of maps applied to the surface of a 3D model, which is used to simulate the appearance, texture and details of the material.
[0049] In this specification, the execution entity used to implement the data compression method may refer to a designated device such as a server set up on a business platform, or may refer to a terminal device such as a desktop computer or a laptop computer. For the sake of ease of description, the data compression method provided in this specification is described below using the server as an example of the execution entity.
[0050] S102: Determine texture data to be compressed according to the texture data acquisition request.
[0051] In this specification, after receiving the texture data acquisition request sent by the client, the server can determine the texture data to be compressed according to the request parameters included in the received texture data acquisition request.
[0052] The above request parameters may be used to indicate what kind of texture data the server client needs, for example: unique identification information of the texture data required by the client, version number of the texture data required by the client, file name of the texture data required by the client, etc.
[0053] In addition, after receiving the texture data acquisition request sent by the client, the server can also determine the texture data to be compressed according to the user behavior data included in the received texture data acquisition request.
[0054] In the above content, user behavior data can be the operation records of users in the client.
[0055] In the above content, there are multiple methods for the server to determine the texture data to be compressed according to the user behavior data included in the received texture data acquisition request.
[0056] For example: the server can determine the position information of the interface currently displayed to the user by the client in the entire game scene based on the user behavior data, and determine the direction of the perspective change of the interface currently displayed to the user by the client. Then, the server can determine the texture data to be compressed based on the position information of the interface currently displayed to the user by the client in the entire game scene, and the direction of the perspective change of the interface currently displayed to the user by the client.
[0057] For another example: the server can input the user behavior data into a preset behavior prediction model, so as to predict the behavior sequence of the user within a specified time period in the future based on the user's behavior data through the preset behavior prediction model, and then determine the texture data to be compressed based on the behavior sequence of the user within the specified time period in the future.
[0058] S103: Based on preset initial compression parameters, the texture data to be compressed is pre-compressed for at least one round to determine target compression parameters, wherein for each round of pre-compression, the basic compression parameters in the round of pre-compression are determined, and the texture data to be compressed is pre-compressed according to the basic compression parameters to obtain a compressed file after the round of pre-compression and determine the compression quality evaluation parameters corresponding to the compressed file; if it is determined according to the compression quality evaluation parameters corresponding to the compressed file that the basic compression parameters are not the target compression parameters, the basic compression parameters are adjusted according to the preset parameter adjustment strategy to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression, and the compression quality evaluation parameters are used to reflect the compression efficiency of the compressed file during the compression process, the compression degree of the compressed file, and the quality of the image loaded from the compressed file.
[0059] In this specification, after determining the texture data to be compressed, the server may perform at least one round of pre-compression on the texture data to be compressed based on preset initial compression parameters to determine target compression parameters.
[0060] Among them, for each round of pre-compression, the basic compression parameters in this round of pre-compression are determined, and the texture data to be compressed is pre-compressed according to the basic compression parameters, a compressed file after this round of pre-compression is obtained and the compression quality evaluation parameters corresponding to the compressed file are determined; if the compression quality evaluation parameters corresponding to the compressed file determine that the basic compression parameters do not meet the preset conditions, the basic compression parameters are adjusted according to the preset parameter adjustment strategy, and the adjusted compression parameters are obtained as the basic compression parameters for the next round of pre-compression.
[0061] In the above content, the compression parameters may include: compression rate (the higher the compression rate here, the more image loss in the process of compressing the compressed texture data, and the smaller the size of the compressed file), quantization level (the lower the quantization level here, the fewer color values used in compressing the compressed texture data, the lower the compression complexity, the smaller the size of the compressed file, and the more obvious the artifacts), color space (that is, the color space used in the compression process, and the visual effects of the images obtained by compressing the compressed files based on different color spaces are different, such as: AdobeRGB color space has a larger color gamut on cyan and green, so that the image using AdobeRGB color space has a better display effect for green and cyan image areas, and the color value in Linear RGB color space is proportional to the physical light intensity, so that the image using Linear RGB color space has a better display effect on lighting), block size (the smaller the block size used, the more details retained in the compression process of the compressed texture data, and the larger the block size used, the smaller the size of the file after compressing the compressed texture data), etc.
[0062] In the above content, the compression quality evaluation parameters can be used to reflect the compression efficiency in the compression process of the compressed file, the compression degree of the compressed file, and the parameters of the image quality of the image loaded from the compressed file. For example: the Peak Signal-to-Noise Ratio (PSNR) between the image corresponding to the texture data to be compressed and the image decompressed from the compressed file, the Structural Similarity Index (SSIM) between the image corresponding to the texture data to be compressed and the image decompressed from the compressed file, the Mean Squared Error (MSE) between the pixel values of the image corresponding to the texture data to be compressed and the pixel values of the image decompressed from the compressed file, the bit rate (Bitrate) in the compression process of the compressed file, the compression ratio (Compression Ratio) of the compressed file, etc.
[0063] The larger the peak signal-to-noise ratio is, the better the image quality of the image loaded from the compressed file is.
[0064] The larger the above structural similarity index is, the more similar the image corresponding to the texture data to be compressed is to the image decompressed from the compressed file.
[0065] The smaller the structural mean square error is, the more similar the image corresponding to the texture data to be compressed is to the image decompressed from the compressed file.
[0066] The larger the above bit rate is, the higher the compression efficiency is during the compression process of the compressed file.
[0067] The larger the above compression ratio is, that is, the higher the ratio between the size of the texture data to be compressed and the size of the compressed file is, the higher the compression efficiency is in the compression process of the compressed file.
[0068] It should be noted that the above-mentioned preset conditions can be determined according to actual needs. For example, for each of the above-mentioned compression quality evaluation parameters, if the compression quality evaluation parameter is not within the preset threshold corresponding to the compression quality evaluation parameter, the compression quality evaluation parameter is determined to be an unqualified compression quality evaluation parameter. If the number of unqualified compression quality evaluation parameters among the compression quality evaluation parameters exceeds the preset quantity threshold, it can be considered that the above-mentioned preset conditions are not met.
[0069] Another example: obtain the parameter weight corresponding to each compression quality evaluation parameter set in advance according to actual needs, and then according to the parameter weight corresponding to each compression quality evaluation parameter, merge the compression quality evaluation parameters to obtain a comprehensive compression quality evaluation parameter. If the comprehensive compression quality evaluation parameter is lower than the preset parameter threshold of the comprehensive compression quality evaluation parameter, it can be considered that the above-mentioned preset conditions are not met.
[0070] In addition, in actual application scenarios, there may be three parameter adjustment strategies mentioned above, and the following describes these three parameter adjustment strategies in detail respectively.
[0071] The first parameter adjustment strategy mentioned above can be to identify the texture data to be compressed to determine the image area obtained after the client renders the texture data to be compressed, and then adjust the basic compression parameters according to the importance of the image area in the interface displayed by the client, and obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
[0072] Among them, the importance of the image area obtained according to the texture data to be compressed in the interface displayed by the client can be determined according to the position distribution of the image area in the interface displayed by the client, wherein the closer the position of the image area in the interface displayed by the client is to the center point of the interface displayed by the client, the higher the importance of the image area in the interface displayed by the client.
[0073] Of course, the importance of the image area obtained according to the texture data to be compressed in the interface displayed by the client can also be determined according to the image content corresponding to the texture data to be compressed. For example, if the image area is the image area corresponding to the main body in the interface displayed by the client (for example, image areas with rich details such as human characters, controllable objects (such as vehicles, aircraft, etc.)), then the image area has a higher importance in the interface displayed by the client; if the image area is the image area corresponding to the background in the interface displayed by the client (for example, environmental elements such as flowers, plants, trees, etc.), then the image area has a lower importance in the interface displayed by the client.
[0074] Furthermore, according to the importance of the image area in the interface displayed by the client, the basic compression parameters can be adjusted according to different basic compression parameter settings. For example, for texture data to be compressed with a higher importance, the compression rate in the basic compression parameters can be adjusted to a lower compression rate, so that the image loss of the texture data to be compressed during the compression process is smaller, and the image quality obtained by the client is higher, while the texture data to be compressed with a lower importance can adjust the compression rate in the basic compression parameters to a higher compression rate, so that the size of the compressed file obtained after compressing the texture data to be compressed is smaller, thereby improving the transmission rate and loading rate of the compressed file.
[0075] For another example: for texture data to be compressed with a higher degree of importance, the quantization level in the basic compression parameters can be adjusted to a higher level, so that there are fewer artifacts in the image obtained based on the compressed file, while for texture data to be compressed with a lower degree of importance, the quantization level in the basic compression parameters can be adjusted to a lower level, so that the compression efficiency of the texture data to be compressed is higher.
[0076] The second parameter adjustment strategy mentioned above can be to decompress and load the compressed file after this round of pre-compression to determine the image quality assessment parameters of the image area obtained by the client based on the compressed file after this round of pre-compression, and then adjust the basic compression parameters according to the determined image quality assessment parameters to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
[0077] The above-mentioned image quality assessment parameters may be parameters such as peak signal-to-noise ratio RSNR, structural similarity index SSIM, etc.
[0078] The third parameter adjustment strategy mentioned above may be to obtain the state parameters of the client, adjust the basic compression parameters according to the obtained state parameters, and obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
[0079] In the above content, the status parameters are used to reflect the network environment status used by the client and the performance status of the hardware resources used by the client. For example: network delay, packet loss rate, bandwidth, data transmission reception time, CPU usage, memory usage list, disk remaining space, CPU usage, system crash times, system restart times, etc.
[0080] In the above content, the method for obtaining the status parameters of the client can be to obtain the status parameters of the client through a preset interface in the client. Of course, the client can also upload the status parameters of the client to the server for storage after every specified time period, so that when the server needs to obtain the status parameters of the client, it can determine the status parameters of the client from the pre-saved status parameters.
[0081] It should be noted that the above-mentioned three parameter adjustment strategies can be used separately according to actual needs. For example, when the users of the business platform are more concerned about the image quality of the main content of the image displayed to the user, the above-mentioned first parameter adjustment strategy can be determined to perform parameter adjustment. When the users of the business platform are more concerned about the overall image quality of the image displayed to the user, the above-mentioned second parameter adjustment strategy can be determined to perform parameter adjustment. When the users of the business platform are more concerned about the performance of the terminal device installed with the client used by the user and the network environment of the terminal device, the above-mentioned third parameter adjustment strategy can be determined to perform parameter adjustment.
[0082] Of course, the above three parameter adjustment strategies can also be used in combination of two or all three at the same time.
[0083] Specifically, when more than one parameter adjustment strategy is used, the compression parameters adjusted by each parameter adjustment strategy may be fused according to the preset weight of each parameter adjustment strategy used to obtain fused compression parameters as the final adjusted compression parameters.
[0084] Of course, the server may also input the compression parameters adjusted by each parameter adjustment strategy into a preset fusion model, so as to determine and output the final adjusted compression parameters according to the compression parameters adjusted by each parameter adjustment strategy through the preset fusion model.
[0085] S104: compressing the texture data to be compressed according to the target compression parameter.
[0086] Furthermore, after determining the target compression parameters, the server can input the target compression parameters and the texture data to be compressed into a pre-trained compression model to determine the feature representation corresponding to the texture data to be compressed through the feature extraction layer of the compression model, and determine an output layer that matches the type of the texture data to be compressed from each output layer as the target output layer. Through the target output layer, the texture data to be compressed is compressed to obtain a compressed file corresponding to the texture data to be compressed.
[0087] Among them, the training method of the above-mentioned compression model can be to obtain an initial compression model and different types of sample texture data. For each type of sample texture data, the sample texture data of this type and the initial compression parameters are input into the initial compression model, so that the feature extraction layer of the compression model determines the feature representation corresponding to the texture data to be compressed, and determines the output layer matching the type of the texture data to be compressed from each output layer as the sample target output layer. The texture data to be compressed is compressed through the sample target output layer to obtain a sample compressed file corresponding to the texture data to be compressed. The sample compressed file can then be decompressed and loaded to obtain a sample image area, and the target loss value is determined based on the deviation between the sample image area and the preset standard image area corresponding to the sample texture data of this type. According to the target loss value, the initial compression model is trained to obtain the compression model.
[0088] In the above content, the initial compression model can be selected from preset pre-trained models according to preset model screening conditions. Therefore, in the process of training the initial compression model, only the parameters of the initial compression model need to be fine-tuned to obtain the compression model, thereby reducing the number of sample texture data required for training the initial compression model. The model screening conditions here can be set according to actual needs, such as: model performance indicators (such as: a compression ratio of 10:1, on a mid-range GPU, the compression time of 1080p texture data does not exceed 50ms, etc.), model scale indicators (such as: the number of model parameters does not exceed 100 million, the memory usage of the model does not exceed 4GB, etc.), etc.
[0089] In the above content, the types of texture data to be compressed can be, for example: standard texture (i.e., texture data used to simulate the color and details of the surface), normal map texture (i.e., texture data used to simulate tiny concave and convex details of the surface, which does not change the color but can produce a sense of concave and convex through lighting calculation), reflection map texture (i.e., texture data used to simulate the reflection effect of the surface of an object), transparency map texture (i.e., texture data used to store transparency information, usually used as a grayscale image), etc.
[0090] In the above content, the deviation between the sample image area and the preset standard image area corresponding to the sample texture data of this type is positively correlated with the target loss value.
[0091] From the above content, it can be seen that a feature extraction layer and multiple output layers are set in the compression model, wherein different output layers are used to compress different types of texture data to be compressed, thereby improving the compression effect of compressing each type of texture data to be compressed.
[0092] In addition, since each output layer shares the same feature extraction layer, the feature extraction layer of the compression model can learn complementary features for compressing different types of texture data to be compressed, thereby further improving the compression effect of each type of texture data to be compressed.
[0093] Among them, the above-mentioned complementary features can be information that can be used together in the compression process of different types of texture data. In other words, it can be features learned by the compression model in the process of compressing one type of texture data that can be used to enhance the compression effect of the compression model on another type of texture data.
[0094] For example, the edge detection method learned by the compression model from standard texture data can be applied to the compression of normal map texture data, thereby better preserving the edge details of the normal map texture data.
[0095] For another example: the color space conversion method learned by the compression model from normal map texture data can be applied to the compression of standard texture data, thereby reducing artifacts that may exist in the standard texture data.
[0096] In addition, in actual application scenarios, there may be multiple compression models, where different compression models have different compression effects on the same type of texture data to be compressed. At this time, for each preset compression model, the server may input the target compression parameters and the texture data to be compressed into the compression model after determining the target compression parameters, so as to compress the texture data to be compressed through the compression model to obtain a compressed file output by the compression model, and then merge the compressed files output by each compression model to obtain a compressed file corresponding to the texture data to be compressed.
[0097] It should be noted that in order to further improve the compression effect of the texture data to be compressed, the server may perform at least one preprocessing operation on the compressed data before compressing the texture data to be compressed according to the target compression parameters to obtain the preprocessed data to be compressed, and then compress the preprocessed texture data to be compressed according to the target compression parameters. The preprocessing operation here includes: at least one of a standardization operation, a denoising operation, and a texture enhancement operation.
[0098] The above-mentioned standardization processing operation is used to convert the format of the texture data to be compressed into a standard format, and adjust the resolution of the texture data to be compressed to the standard resolution, so as to ensure that all the texture data to be compressed have the same standard.
[0099] For example: the format of the texture data to be compressed is uniformly adjusted to JPEG XR, and the resolution is adjusted to 1024*1024, etc.
[0100] The above-mentioned denoising operation is used to remove noise data in the texture data to be compressed, thereby improving the quality of the texture data to be compressed. The method of removing noise data here can be inputting the texture data to be compressed into a preset deep learning model to remove the noise data in the texture data to be compressed through the preset deep learning model.
[0101] The above-mentioned texture enhancement operation is used to perform sharpening enhancement and contrast enhancement processing on the compressed texture data, thereby improving the quality of the compressed texture data. The method for performing texture enhancement operation on the compressed texture data here can be inputting the compressed texture data into a preset enhancement model to remove noise data in the compressed texture data through the preset enhancement model. The enhancement model here can be a generative adversarial network model.
[0102] Furthermore, in order to improve the compatibility of the above data compression method, the server may also compress the texture data to be compressed according to the target compression parameter and the preset specified texture data compression format.
[0103] The above-mentioned specified texture data compression format may be a Crunch texture compression toolkit format CrunchCompression.
[0104] It should be noted that, since Crunch Compression is a built-in texture compression format of the Unity engine, the compressed file compressed using the above-mentioned specified texture data compression format can be loaded on different platforms, thereby improving the compatibility of the above-mentioned data compression method.
[0105] In addition, the server can also generate supplementary texture data to be compressed with different resolutions based on the texture data to be compressed, so that the texture data to be compressed and the supplementary texture data to be compressed can be compressed according to the target compression parameters to obtain the compressed files corresponding to the texture data to be compressed and the supplementary texture data to be compressed, and then the compressed files corresponding to the texture data to be compressed and the supplementary texture data to be compressed can be sent to the client, so that the client can determine the target texture data from the texture data to be compressed and the supplementary texture data to be compressed according to the viewing distance parameters of the interface currently displayed to the user and the operations performed by the user on the interface, and decompress and load the image area corresponding to the target texture data from the compressed files corresponding to the texture data to be compressed and the supplementary texture data to be compressed.
[0106] Among them, the above-mentioned viewing distance parameter may refer to the maximum distance of an object in the virtual scene presented in the interface currently displayed to the user by the client. It can be understood that in the game scene, the distance that the game character operated by the player can see the farthest object in the virtual world.
[0107] Specifically, when an object with a longer viewing distance existing in a virtual scene is determined based on the above-mentioned viewing distance parameters, it can be determined based on the operations performed by the user on the interface that the viewing distance parameter corresponding to the object will not decrease within a period of time in the future, and the supplementary texture data to be compressed with a lower resolution can be used for loading, thereby reducing the memory consumption of loading texture data.
[0108] Furthermore, when an object with a longer viewing distance existing in the virtual scene is determined based on the above-mentioned viewing distance parameters, and when it is determined based on the operations performed by the user on the interface that the viewing distance parameter corresponding to the object will gradually decrease in the future, the loading can be started from the supplementary texture data to be compressed with a low resolution, and based on the operations performed by the user on the interface, the supplementary texture data to be compressed with a high resolution can be gradually loaded to update the previously loaded supplementary texture to be compressed with a low resolution.
[0109] For example, when the client displays to the user the game interface of a large open world game, which contains a large number of environmental textures, when the character operated by the user approaches an object, the client will automatically switch to a higher resolution texture on the object to provide more details. When the character operated by the user moves away from the object, the client will automatically switch to a lower resolution texture, thereby reducing the computing resources required for rendering.
[0110] It should be noted that in this specification, the client uses at least two threads to decompress the compressed files sent by the server in parallel, so as to improve the decompression efficiency of the compressed files. The decompression method here can be to use decompression algorithms such as: LZ4 decompression algorithm (LZ4 Compression Algorithm, LZ4), Zstandard decompression algorithm (Zstandard Compression Algorithm, Zstandard) for decompression.
[0111] In addition, the client can also obtain the user's behavior data (such as: operation records of clicks, dragging, text input, etc. performed by the user in the interface, the user's exit rate during the loading process, etc.) during the process of decompressing and loading texture data, so as to analyze the user's behavior data to determine the user's satisfaction with the loading process of different types of texture data and send it to the server, so that the server can adjust the above-mentioned target compression parameters according to the user's satisfaction with the loading process of different types of texture data.
[0112] In addition, the server can also divide each user into at least two user sets, wherein the server adopts different parameter adjustment strategies for different user sets to adjust the compression parameters, and then for each user set, according to the satisfaction of each user included in the user set with the parameter adjustment strategy adopted by the user set, the confidence of the parameter adjustment strategy adopted by the user set can be determined; if the confidence of the parameter adjustment strategy adopted by the user set is lower than a preset confidence threshold, the server can replace the parameter adjustment strategy adopted by the user set with the corresponding parameter adjustment strategy with the highest confidence.
[0113] In actual application scenarios, the client may send texture data to the server. For example, when a user creates a custom texture or skin in the client, the client may upload the custom texture or skin created by the user to the server for storage.
[0114] For another example, in a multiplayer cooperative game, the user needs to send the texture data edited or created by the user to the server in real time through the client, so that the server can synchronize the texture data edited or created by the user to other users.
[0115] At this time, the client can use the texture data that needs to be sent to the server as interactive texture data, and then perform preliminary compression on the interactive texture data that needs to be compressed, upload the interactive texture data after preliminary compression to the cloud device, and enable the cloud device to deeply compress the interactive texture data after preliminary compression and return it to the client, and then the interactive texture data after deep compression by the cloud device can be sent to the server.
[0116] From the above content, it can be seen that the client can cooperate with the cloud device for compression through the local device, thereby effectively improving the compression and transmission efficiency of the interactive texture data while improving the compression effect of the interactive texture data.
[0117] From the above content, it can be seen that the server can perform multiple rounds of pre-compression on the texture data to be compressed required by the client, so that the compression parameters can be dynamically adjusted according to the effects of multiple rounds of pre-compression to determine the target compression parameters that are most suitable for the current scene, and then the data to be compressed can be compressed according to the target compression parameters, thereby effectively improving the compression effect of the data to be compressed.
[0118] The above are one or more data compression methods implemented in this specification. Based on the same idea, this specification also provides a corresponding data compression device, such as Figure 2 shown.
[0119] Figure 2 A schematic diagram of a data compression device provided in this specification includes:
[0120] The receiving module 201 is used to receive a texture data acquisition request sent by a client;
[0121] A determination module 202, configured to determine the texture data to be compressed according to the texture data acquisition request;
[0122] The adjustment module 203 is used to perform at least one round of pre-compression on the texture data to be compressed based on the preset initial compression parameters to determine the target compression parameters, wherein for each round of pre-compression, the basic compression parameters in the round of pre-compression are determined, and the texture data to be compressed is pre-compressed according to the basic compression parameters to obtain a compressed file after the round of pre-compression and determine the compression quality evaluation parameters corresponding to the compressed file; if it is determined that the compression quality evaluation parameters do not meet the preset conditions, the basic compression parameters are adjusted according to the preset parameter adjustment strategy to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression, the basic compression parameters in the round of pre-compression are obtained by iterating the initial compression parameters to the previous round of pre-compression, and the compression quality evaluation parameters are used to reflect the compression efficiency of the compressed file during the compression process, the compression degree of the compressed file, and the image quality of the image loaded from the compressed file;
[0123] The compression module 204 is used to compress the texture data to be compressed according to the target compression parameter.
[0124] Optionally, the adjustment module 203 is specifically used to identify the texture data to be compressed to determine the image area obtained after the client renders the texture data to be compressed; according to the importance of the image area in the interface displayed by the client, the basic compression parameters are adjusted to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
[0125] Optionally, the adjustment module 203 is specifically used to decompress and load the compressed file after this round of pre-compression to determine the image quality assessment parameters of the image area obtained by the client based on the compressed file after this round of pre-compression; according to the image quality assessment parameters, the basic compression parameters are adjusted to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
[0126] Optionally, the adjustment module 203 is specifically used to obtain status parameters of the client, where the status parameters are used to reflect the network environment status used by the client and the performance status of hardware resources used by the client; according to the status parameters, the basic compression parameters are adjusted to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
[0127] Optionally, the compression module 204 is specifically used to input the target compression parameters and the texture data to be compressed into a pre-trained compression model, so as to determine the feature representation corresponding to the texture data to be compressed through the feature extraction layer of the compression model, and determine an output layer that matches the type of the texture data to be compressed from each output layer as the target output layer, and compress the texture data to be compressed through the target output layer to obtain a compressed file corresponding to the texture data to be compressed.
[0128] Optionally, the device further comprises: a training module 205;
[0129] The training module 205 is specifically used to obtain an initial compression model and different types of sample texture data; for each type of sample texture data, the sample texture data of this type and the initial compression parameters are input into the initial compression model, so that the feature extraction layer of the compression model determines the feature representation corresponding to the texture data to be compressed, and determines an output layer matching the type of the texture data to be compressed from each output layer as a sample target output layer, and compresses the texture data to be compressed through the sample target output layer to obtain a sample compressed file corresponding to the texture data to be compressed; decompresses and loads the sample compressed file to obtain a sample image area, and determines a target loss value based on the deviation between the sample image area and a preset standard image area corresponding to the sample texture data of this type; and trains the initial compression model based on the target loss value to obtain a compression model, wherein the deviation between the sample image area and the preset standard image area corresponding to the sample texture data of this type is positively correlated with the target loss value.
[0130] Optionally, the compression module 204 is specifically used to generate various supplementary texture data to be compressed according to the texture data to be compressed, wherein different supplementary texture data to be compressed have different resolutions; compress the texture data to be compressed and the various supplementary texture data to be compressed according to the target compression parameter to obtain compressed files corresponding to the texture data to be compressed and the various supplementary texture data to be compressed; send the compressed files corresponding to the texture data to be compressed and the various supplementary texture data to be compressed to the client, so that the client determines the target texture data from the texture data to be compressed and the various supplementary texture data to be compressed according to the viewing distance parameter of the interface currently displayed to the user and the operation performed by the user on the interface, and decompresses and loads the image area corresponding to the target texture data from the compressed files corresponding to the texture data to be compressed and the various supplementary texture data to be compressed.
[0131] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A data compression method is provided.
[0132] This manual also provides Figure 3 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 3 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0133] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0134] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0135] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0136] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0137] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0138] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0141] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0142] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0143] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0144] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0145] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0146] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0148] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A data compression method, characterized in that: include: Receive a texture data acquisition request sent by a client; Determining the texture data to be compressed according to the texture data acquisition request; Based on the preset initial compression parameters, at least one round of pre-compression is performed on the texture data to be compressed to determine the target compression parameters, wherein for each round of pre-compression, the basic compression parameters in the round of pre-compression are determined, and the texture data to be compressed is pre-compressed according to the basic compression parameters to obtain a compressed file after the round of pre-compression and determine the compression quality evaluation parameters corresponding to the compressed file, if it is determined that the compression quality evaluation parameters do not meet the preset conditions, the basic compression parameters are adjusted according to the preset parameter adjustment strategy to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression, the basic compression parameters in the round of pre-compression are obtained by iterating the initial compression parameters to the previous round of pre-compression, and the compression quality evaluation parameters are used to reflect the compression efficiency of the compressed file during the compression process, the compression degree of the compressed file, and the image quality of the image loaded according to the compressed file; The texture data to be compressed is compressed according to the target compression parameter.
2. The method according to claim 1, characterized in that According to the preset parameter adjustment strategy, the basic compression parameter is adjusted to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression, specifically including: Identifying the texture data to be compressed to determine an image area obtained by rendering by the client according to the texture data to be compressed; According to the importance of the image area in the interface displayed by the client, the basic compression parameter is adjusted to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression.
3. The method according to claim 1, characterized in that According to the preset parameter adjustment strategy, the basic compression parameter is adjusted to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression, specifically including: Decompressing and loading the compressed file after the round of pre-compression to determine the image quality assessment parameter of the image area obtained by the client based on the compressed file after the round of pre-compression; The basic compression parameters are adjusted according to the image quality assessment parameters to obtain the adjusted compression parameters as the basic compression parameters for the next round of pre-compression.
4. The method according to claim 1, characterized in that According to the preset parameter adjustment strategy, the basic compression parameter is adjusted to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression, specifically including: Acquire a status parameter of the client, where the status parameter is used to reflect a network environment status used by the client and a performance status of a hardware resource used by the client; The basic compression parameter is adjusted according to the state parameter to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression.
5. The method according to claim 1, characterized in that Compressing the texture data to be compressed according to the target compression parameter specifically includes: The target compression parameters and the texture data to be compressed are input into a pre-trained compression model to determine the feature representation corresponding to the texture data to be compressed through the feature extraction layer of the compression model, and an output layer matching the type of the texture data to be compressed is determined from each output layer as the target output layer. The texture data to be compressed is compressed through the target output layer to obtain a compressed file corresponding to the texture data to be compressed.
6. The method according to claim 5, characterized in that Training the compression model specifically includes: Obtaining initial compression model and different types of sample texture data; For each type of sample texture data, the sample texture data of the type and the initial compression parameters are input into the initial compression model, so that the feature extraction layer of the compression model determines the feature representation corresponding to the texture data to be compressed, and determines an output layer matching the type of the texture data to be compressed from each output layer as a sample target output layer, and compresses the texture data to be compressed through the sample target output layer to obtain a sample compressed file corresponding to the texture data to be compressed; The sample compressed file is decompressed and loaded to obtain a sample image area, and a target loss value is determined based on a deviation between the sample image area and a preset standard image area corresponding to the sample texture data of this type. The initial compression model is trained based on the target loss value to obtain a compression model, and the deviation between the sample image area and the preset standard image area corresponding to the sample texture data of this type is positively correlated with the target loss value.
7. The method according to claim 1, characterized in that Compressing the texture data to be compressed according to the target compression parameter specifically includes: Generating various supplementary texture data to be compressed according to the texture data to be compressed, wherein different supplementary texture data to be compressed have different resolutions; According to the target compression parameter, compressing the texture data to be compressed and the supplementary texture data to be compressed to obtain compressed files corresponding to the texture data to be compressed and the supplementary texture data to be compressed; The texture data to be compressed and the compressed files corresponding to the supplementary texture data to be compressed are sent to the client, so that the client determines the target texture data from the texture data to be compressed and the supplementary texture data to be compressed according to the viewing distance parameters of the interface currently displayed to the user and the operations performed by the user on the interface, and decompresses and loads the image area corresponding to the target texture data from the compressed files corresponding to the texture data to be compressed and the supplementary texture data to be compressed.
8. A data compression device, characterized in that: include: A receiving module, used for receiving a texture data acquisition request sent by a client; A determination module, used for determining the texture data to be compressed according to the texture data acquisition request; An adjustment module, configured to perform at least one round of pre-compression on the texture data to be compressed based on a preset initial compression parameter to determine a target compression parameter, wherein for each round of pre-compression, a basic compression parameter in the round of pre-compression is determined, and the texture data to be compressed is pre-compressed according to the basic compression parameter to obtain a compressed file after the round of pre-compression and determine a compression quality evaluation parameter corresponding to the compressed file; if it is determined that the compression quality evaluation parameter does not meet a preset condition, the basic compression parameter is adjusted according to a preset parameter adjustment strategy to obtain the adjusted compression parameter as the basic compression parameter for the next round of pre-compression, wherein the basic compression parameter in the round of pre-compression is obtained by iterating the initial compression parameter to the previous round of pre-compression, and the compression quality evaluation parameter is used to reflect the compression efficiency of the compressed file during the compression process, the compression degree of the compressed file, and the image quality of the image loaded from the compressed file; A compression module is used to compress the texture data to be compressed according to the target compression parameter.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Map compression method and device, computer readable storage medium and electronic device
CN117379780A
Mapping resource compression method and device, storage medium and electronic equipment
CN117671042A
Application texture rendering method, related device and medium
CN118096926A
Image encoder, image decoder, image encoding method, and image decoding method
US20070160298A1