A video processing method and related device

By determining the tone type of video frame to be processed in the tone mapping process and calculating the corresponding tone mapping curve, the problem of large calculation amount and low efficiency of tone mapping processing in the prior art is solved, and more efficient video processing is achieved.

CN115278188BActive Publication Date: 2025-06-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210901068.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-28
Publication Date
2025-06-24
Estimated Expiration
2042-07-28

AI Technical Summary

Technical Problem

In the prior art, tone mapping processing requires a large amount of calculation, resulting in high energy consumption, long processing time, low computing efficiency, and affecting the video display effect.

Method used

By determining the tone type of the video frame to be processed before the tone mapping process, and calculating the tone mapping curves of the multiple video frames to be processed according to the tone type, the repeated calculations are reduced and the processing efficiency is improved.

Benefits of technology

It greatly improves the efficiency of tone mapping processing, reduces calculation amount and energy consumption, reduces processing time, and improves the video display effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115278188B_ABST
    Figure CN115278188B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a video processing method and related devices. Before tone mapping processing, tone types corresponding to multiple video frames to be processed are determined respectively. When performing tone mapping processing, the video to be processed can be tone-mapped according to the tone mapping curve corresponding to the tone type to generate a tone-mapped video corresponding to the video to be processed. Since the tone mapping curve corresponds to the tone type, and the number of tone types is less than the number of video frames to be processed included in the video to be processed, it is not necessary to calculate the tone mapping curve for each video frame to be processed. Multiple video frames to be processed belonging to the same tone type only need to perform the tone mapping curve calculation once, that is, it is not necessary to perform repeated tone mapping curve calculations for multiple video frames that are similar in tone characteristics. While ensuring the tone mapping effect, the computational amount required for tone mapping processing is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of video processing, and particularly to a video processing method and related devices. Background Art

[0002] With the development of hardware display devices and the increasing requirements of consumers for video content, the types of video tones are becoming more and more abundant, and various video formats with different brightness ranges have emerged. When a video is converted between video formats with different brightness ranges, tone mapping processing is required. Through tone mapping processing, the picture can be adapted to the display screen to obtain the best display effect.

[0003] In the related art, for tone mapping processing, it is necessary to first calculate the corresponding color point mapping curve according to the gray feature parameters corresponding to each video image frame, and then determine the gray feature parameters corresponding to the frame of the video image in the video format after tone mapping based on the tone mapping curve. The complete video after tone mapping is generated through the calculated gray feature parameters corresponding to each frame of the video image.

[0004] However, tone mapping in the related art requires a large amount of calculation, which will bring large energy consumption and long processing time, and the calculation efficiency is low, which is likely to affect the display effect and is not conducive to bringing users a comfortable video viewing experience. Summary of the Invention

[0005] To solve the above technical problems, the present application provides a video processing method, which greatly improves the efficiency of tone mapping processing.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In a first aspect, the embodiments of the present application disclose a video processing method, and the method includes:

[0008] Obtain a video to be processed, where the video to be processed includes a plurality of video frames to be processed, each video frame to be processed has a corresponding tone type, and the number of tone types corresponding to the video to be processed is less than the number of the plurality of video frames to be processed;

[0009] Determine the tone mapping curves respectively corresponding to the plurality of video frames to be processed according to the tone type, where the tone mapping curve is calculated based on the gray feature parameters corresponding to the tone type, and there is at most one calculation of the tone mapping curve for the same tone type;

[0010] Perform tone mapping on the video to be processed according to the tone mapping curves respectively corresponding to the plurality of video frames to be processed, and generate a tone mapping video corresponding to the video to be processed.

[0011] In a second aspect, embodiments of the present application disclose a video processing device, the device including an acquisition unit, a first determination unit, and a mapping unit:

[0012] The acquisition unit is configured to acquire a video to be processed, the video to be processed including a plurality of video frames to be processed, each video frame to be processed having a corresponding hue type, and the number of hue types corresponding to the video to be processed being less than the number of the plurality of video frames to be processed;

[0013] The first determination unit is configured to determine, according to the hue type, hue mapping curves respectively corresponding to the plurality of video frames to be processed, the hue mapping curves being calculated based on gray feature parameters corresponding to the hue type, and there being at most one calculation of a hue mapping curve for the same hue type;

[0014] The mapping unit is configured to perform hue mapping on the video to be processed according to the hue mapping curves respectively corresponding to the plurality of video frames to be processed, and generate a hue mapping video corresponding to the video to be processed.

[0015] In a possible implementation manner, among the plurality of video frames to be processed, there is a target video frame, the target video frame corresponding to a target hue type, and the first determination unit is specifically configured to:

[0016] In response to the existence of a target hue mapping curve corresponding to the target hue type in the cached hue mapping curves, determine the target hue mapping curve as the hue mapping curve corresponding to the target video frame;

[0017] In response to the non-existence of a hue mapping curve corresponding to the target hue type in the cached hue mapping curves, acquire target gray feature parameters corresponding to the target hue type, the target gray feature parameters being used to identify the hue feature of the target hue type;

[0018] Calculate a target hue mapping curve corresponding to the target hue type according to the target gray feature parameters;

[0019] Determine the target hue mapping curve as the hue mapping curve corresponding to the target video frame, and cache the target hue mapping curve.

[0020] In a possible implementation manner, for the target video frame, the mapping unit is specifically configured to:

[0021] In response to the target hue mapping curve having a corresponding cached parameter correspondence, determine, based on the parameter correspondence, target mapped gray feature parameters corresponding to the target gray feature parameters;

[0022] Generate a mapped video frame corresponding to the target video frame based on the target mapped grayscale feature parameters;

[0023] Generate a tone mapped video corresponding to the video to be processed according to the mapped video frames respectively corresponding to the multiple video frames to be processed.

[0024] In a possible implementation, the apparatus further includes a first calculation unit, a first generation unit, and a cache unit:

[0025] The first calculation unit is configured to, in response to the fact that the target tone mapping curve does not have a corresponding cached parameter correspondence, calculate the target mapped grayscale feature parameters corresponding to the target video frame according to the target tone mapping curve and the target grayscale feature parameters;

[0026] The first generation unit is configured to generate the parameter correspondence according to the target mapped grayscale feature parameters and the target grayscale feature parameters;

[0027] The cache unit is configured to cache the parameter correspondence.

[0028] In a possible implementation, the apparatus further includes a second calculation unit, a second generation unit, a third generation unit, a clustering unit, and a second determination unit:

[0029] The second calculation unit is configured to calculate the grayscale feature parameters respectively corresponding to the multiple video frames to be processed, and the grayscale feature parameters are used to identify the tone features corresponding to the video frames to be processed;

[0030] The second generation unit is configured to generate the tone mapping parameters respectively corresponding to the multiple video frames to be processed based on the grayscale feature parameters respectively corresponding to the multiple video frames to be processed;

[0031] The third generation unit is configured to generate the mapped grayscale feature parameters respectively corresponding to the multiple video frames to be processed based on the grayscale feature parameters and the tone mapping parameters respectively corresponding to the multiple video frames to be processed, and the mapped grayscale feature parameters are used to identify the tone features of the video frames to be processed after tone mapping;

[0032] The clustering unit is configured to cluster the mapped grayscale feature parameters respectively corresponding to the multiple video frames to be processed,

[0033] The second determination unit is configured to determine the video frames to be processed whose corresponding mapped grayscale feature parameters belong to the same clustering node as the video frames to be processed corresponding to the same tone type, and obtain the tone types respectively corresponding to the multiple video frames to be processed, and the grayscale feature parameters corresponding to the tone type are the grayscale feature parameters corresponding to the center point of the corresponding clustering node.

[0034] In a possible implementation, the device further includes a compression unit:

[0035] The compression unit is configured to compress the mapped gray-scale feature parameters respectively corresponding to the multiple video frames to be processed, and the pixel dimension corresponding to the compressed mapped gray-scale feature parameters is smaller than that of the mapped gray-scale feature parameters before compression;

[0036] The clustering unit is specifically configured to:

[0037] Cluster the compressed mapped gray-scale feature parameters respectively corresponding to the multiple videos to be processed.

[0038] In a third aspect, an embodiment of the present application discloses a computer device, which includes a processor and a memory:

[0039] The memory is used to store program code and transmit the program code to the processor;

[0040] The processor is configured to execute the video processing method according to any one of the first aspects based on the instructions in the program code.

[0041] In a fourth aspect, an embodiment of the present application discloses a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the video processing method according to any one of the first aspects.

[0042] In a fifth aspect, an embodiment of the present application discloses a computer program product including instructions, which, when running on a computer, causes the computer to execute the video processing method according to any one of the first aspects.

[0043] As can be seen from the above technical solutions, in the present application, before tone mapping processing, the tone types corresponding to multiple video frames to be processed included in the video to be processed are determined, and the number of tone types corresponding to the video to be processed is less than the number of multiple video frames to be processed included. When performing tone mapping processing, the tone mapping curves corresponding to multiple video frames to be processed can be determined according to the tone types, and then the video to be processed is tone-mapped according to the tone mapping curves corresponding to multiple video frames to be processed, generating a tone-mapped video corresponding to the video to be processed. Since the tone mapping curve corresponds to the tone type, and the number of tone types is less than the number of video frames to be processed included in the video to be processed, it is not necessary to calculate the tone mapping curve for each video frame to be processed. Multiple video frames belonging to the same tone type only need to perform the tone mapping curve calculation once, that is, it is not necessary to perform repeated tone mapping curve calculations for multiple video frames that are similar in tone characteristics. While ensuring the tone mapping effect, the calculation amount required for tone mapping processing is reduced, the tone mapping processing efficiency is improved, and at the same time, the hardware requirements for the video playback device are also reduced. Description of the Drawings

[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0045] Figure 1 Schematic diagram of a video processing method in an actual application scenario provided by an embodiment of the present application;

[0046] Figure 2 Flowchart of a video processing method provided by an embodiment of the present application;

[0047] Figure 3 Schematic diagram of a tone mapping curve provided by an embodiment of the present application;

[0048] Figure 4 Flowchart of a video processing method in an actual application scenario provided by an embodiment of the present application;

[0049] Figure 5 Schematic diagram of a video processing method in an actual application scenario provided by an embodiment of the present application;

[0050] Figure 6 Block diagram of the structure of a video processing device provided by an embodiment of the present application;

[0051] Figure 7The structural diagram of a terminal provided by an embodiment of the present application;

[0052] Figure 8 The structural diagram of a server provided by an embodiment of the present application. Detailed implementation manners

[0053] Next, embodiments of the present application will be described with reference to the accompanying drawings.

[0054] In the related art, tone mapping processing needs to calculate a corresponding tone mapping curve for each video frame in the video to be processed according to the required brightness range, and map the gray feature parameters of each video frame through the tone mapping curve, so as to obtain the video to be processed after tone mapping. This will bring a large amount of data calculation to the video processing device, resulting in low video processing efficiency.

[0055] To solve the above technical problems, an embodiment of the present application provides a video processing method. The processing device can determine a tone mapping curve for tone mapping based on the tone types corresponding to the respective video frames in the video to be processed, so that only one tone mapping curve calculation needs to be performed for multiple video frames with relatively consistent tone characteristics, reducing the calculation amount required for tone mapping and improving the tone mapping processing efficiency.

[0056] It can be understood that this method can be applied to a processing device, which is a processing device capable of performing video processing. For example, it can be a terminal device or a server with video processing functions. This method can be independently executed by a terminal device or a server, or can be applied to a network scenario where a terminal device and a server communicate, and is executed in cooperation with a terminal device and a server. Among them, the terminal device can be a device such as a computer or a mobile phone. The server can be understood as an application server or a Web server. In actual deployment, the server can be an independent server or a cluster server.

[0057] To facilitate understanding of the technical solution provided by the embodiment of the present application, next, a video processing method provided by the embodiment of the present application will be introduced in combination with an actual application scenario.

[0058] See Figure 1 , Figure 1 is a schematic diagram of a video processing method in an actual application scenario provided by an embodiment of the present application. In this actual application scenario, the processing device is a server 101 with video processing functions.

[0059] In this actual application scenario, the video to be processed includes four video frames to be processed, namely video frame 1 to video frame 4 to be processed. Among them, video frame 1 to video frame 3 to be processed correspond to hue type 1, that is, these three video frames to be processed have relatively similar hue characteristics; video frame 4 to be processed corresponds to hue type 2.

[0060] Since the hue mapping curves corresponding to the video frames to be processed with similar hue characteristics are also relatively similar, the influence degree of hue mapping on video frame 1 to video frame 3 to be processed by the same hue mapping curve is relatively low. Based on this, the processing device can determine the hue mapping curves respectively corresponding to multiple video frames to be processed according to the hue type. The hue mapping curve is calculated based on the gray feature parameters corresponding to the hue type, and there is at most one calculation of the hue mapping curve for the same hue type. For example, in this actual application scenario, it is only necessary to calculate the hue mapping curve 1 corresponding to hue type 1 once and calculate the hue mapping curve 2 corresponding to hue type 2 once at most, so as to obtain the hue mapping curves respectively corresponding to each video frame to be processed. Server 101 can perform hue mapping on the video to be processed based on the hue mapping curve to generate the corresponding hue mapping video.

[0061] Since this application only needs to calculate the hue mapping curve at most once for each hue type, rather than calculating the hue mapping curve once for each video frame to be processed, the calculation amount required for hue mapping is greatly reduced, and the hue mapping processing efficiency is improved while ensuring the hue mapping effect.

[0062] Next, in combination with the accompanying drawings, a video processing method provided by an embodiment of this application will be introduced.

[0063] See Figure 2 , Figure 2 which is a flowchart of a video processing method provided by an embodiment of this application. The method includes:

[0064] S201: Obtain the video to be processed.

[0065] Among them, the video to be processed can be any video that needs to be subjected to hue mapping processing. The video to be processed includes multiple video frames to be processed, and each video frame to be processed has a corresponding hue type, which is determined based on the hue characteristics corresponding to the video frame. In the embodiment of this application, the number of hue types corresponding to the video to be processed is less than the number of multiple video frames to be processed, that is, multiple video frames to be processed with a relatively high degree of similarity in hue characteristics will be classified into the same hue type.

[0066] S202: Determine the hue mapping curves respectively corresponding to multiple video frames to be processed according to the hue type.

[0067] Among them, the tone mapping curve is calculated based on the gray-scale feature parameters corresponding to the tone type, and the gray-scale feature parameters are used to identify the tone features corresponding to the video frame to be processed under this tone type. It can be understood that although there may be some differences in the tone features of each video frame to be processed, when the tone feature similarity is relatively high, the corresponding tone mapping curves are also very similar, and it is difficult for users watching the video to feel the influence of the slight curve difference on the video tone. Therefore, in the embodiments of the present application, the same tone mapping curve can be used for tone mapping of video frames to be processed belonging to the same tone type. Therefore, there is at most one calculation of the tone mapping curve for the same tone type, which reduces the calculation amount required for tone mapping processing while ensuring the tone mapping effect.

[0068] According to the tone type corresponding to the video frame to be processed, the processing device can determine the tone mapping curve corresponding to this tone type as the tone mapping curve corresponding to the video frame to be processed, so that the tone mapping curve corresponding to each video frame to be processed can be determined by calculating the tone mapping curve at most once for each tone type. Since the number of tone types is less than the number of multiple video frames to be processed, the calculation amount required to determine the tone mapping curve in this way is much smaller than the calculation amount required to calculate the tone mapping curve for the gray-scale feature parameters of each video frame to be processed.

[0069] S203: Perform tone mapping on the video to be processed according to the tone mapping curves respectively corresponding to multiple video frames to be processed, and generate a tone-mapped video corresponding to the video to be processed.

[0070] Through the tone mapping curve corresponding to each video frame to be processed, the processing device can map the gray-scale feature parameters corresponding to the video frame to be processed into the gray-scale feature parameters corresponding to the required video format, so as to adjust the brightness range of the entire video to be processed to the brightness range corresponding to the required video format, complete the tone mapping process, and generate a tone-mapped video corresponding to the video to be processed. The tone-mapped video is the video to be processed after tone mapping.

[0071] As can be seen from the above technical solution, in the present application, before tone mapping processing, the tone types corresponding to multiple video frames to be processed included in the video to be processed are determined, and the number of tone types corresponding to the video to be processed is less than the number of multiple video frames to be processed included. When performing tone mapping processing, the tone mapping curves corresponding to the multiple video frames to be processed can be determined according to the tone types, and then the video to be processed is tone mapped according to the tone mapping curves corresponding to the multiple video frames to be processed, and a tone mapped video corresponding to the video to be processed is generated. Since the tone mapping curve corresponds to the tone type, and the number of tone types is less than the number of video frames to be processed included in the video to be processed, it is not necessary to calculate the tone mapping curve for each video frame to be processed. Multiple video frames belonging to the same tone type only need to be calculated for the tone mapping curve once, that is, it is not necessary to perform repeated calculation of the tone mapping curve for multiple video frames that are similar in tone characteristics. While ensuring the tone mapping effect, the amount of calculation required for tone mapping processing is reduced, the efficiency of tone mapping processing is improved, and at the same time, the hardware requirements for the video playback device are also reduced.

[0072] Specifically, in a possible implementation manner, the multiple video frames to be processed include a target video frame, and the target video frame can be any one of the multiple video frames to be processed. The target video frame corresponds to a target tone type. Taking this target video frame as an example, when determining the corresponding tone mapping curve, the processing device can first analyze whether there is a target tone mapping curve corresponding to the target tone type in the cached tone mapping curves. The cached tone mapping curves refer to the tone mapping curves that have been generated and do not need to be obtained through calculation, and the processing device can directly obtain and use them.

[0073] In response to the existence of a target tone mapping curve corresponding to the target tone type in the cached tone mapping curves, the processing device can directly determine the target tone mapping curve as the tone mapping curve corresponding to the target video frame without calculating the target tone mapping curve.

[0074] In response to the non-existence of a tone mapping curve corresponding to the target tone type in the cached tone mapping curves, the processing device can obtain the target gray-scale feature parameter corresponding to the target tone type. The target gray-scale feature parameter is used to identify the tone feature of the target tone type, that is, the tone feature possessed by the video frames to be processed under the target tone type.

[0075] The processing device can calculate the target tone mapping curve corresponding to the target tone type according to the target gray feature parameter. The target tone mapping curve is used to reflect the correlation between the gray feature parameter before mapping and the gray feature parameter after mapping during tone mapping. Thus, the processing device can perform tone mapping on the video frame to be processed under the target tone type based on the target tone mapping curve. The processing device can determine the target tone mapping curve as the tone mapping curve corresponding to the target video frame and cache the target tone mapping curve. Thus, when there is a subsequent video frame to be processed of the target tone type that needs to be tone-mapped, the processing device can directly obtain the target tone mapping curve from the cached tone mapping curves without having to perform repeated calculations.

[0076] In a possible implementation, for the target video frame, when generating a tone-mapped video through tone mapping, in order to further improve the efficiency of tone mapping processing, the processing device can directly cache the parameter correspondence during the tone mapping process, that is, cache the correspondence between the gray feature parameter before tone mapping and the gray feature parameter after tone mapping. Thus, when calculating the gray feature parameters of subsequent video frames to be processed corresponding to the same tone mapping curve, it only needs to find the parameter corresponding to the gray feature parameter from the correspondence, without having to calculate through the tone mapping parameters.

[0077] In response to the target tone mapping curve having a corresponding cached parameter correspondence, the processing device determines the target mapped gray feature parameter corresponding to the target gray feature parameter based on the parameter correspondence, without having to perform parameter calculations based on the target tone mapping curve. The target mapped gray feature parameter is the feature parameter obtained by calculating the target gray feature parameter based on the target tone mapping curve.

[0078] The processing device can generate a mapped video frame corresponding to the target video frame based on the target mapped gray feature parameter. The mapped video frame is a video frame corresponding to the target mapped gray feature parameter, that is, a video frame that meets the brightness range required after the tone mapping range. After obtaining the mapped video frames corresponding to each video frame to be processed respectively based on the above method, the processing device can generate a tone-mapped video corresponding to the video to be processed according to the mapped video frames corresponding to the multiple video frames to be processed respectively.

[0079] Since the tone mapping curve is usually a piecewise function, such as Figure 3 shown, Figure 3A schematic diagram of a tone mapping curve provided by an embodiment of the present application. In a graphics processing unit (GPU), different branches are required for different functions during calculation. Therefore, when calculating parameters based on tone mapping parameters, multiple branches of the GPU are occupied, resulting in a waste of a large amount of GPU computing power. In the embodiment of the present application, for a video frame to be processed under the same tone type, the GPU only needs to find the corresponding parameters based on the corresponding relationship, without performing calculations of multiple functions. Therefore, each branch can independently process the parameter determination of a video frame to be processed, and multiple branches can perform parallel processing for multiple video frames to be processed, greatly improving the tone mapping processing efficiency while saving computing power.

[0080] In a possible implementation manner, in response to the target tone mapping curve not having a corresponding cached parameter correspondence relationship, the processing device may calculate the target mapped gray feature parameter corresponding to the target video frame according to the target tone mapping curve and the target gray feature parameter. Then, the processing device may generate the parameter correspondence relationship according to the target mapped gray feature parameter and the target gray feature parameter, and cache the parameter correspondence relationship, so that when performing tone mapping on a video frame to be processed of the same tone type, the corresponding gray feature parameter can be directly determined according to the parameter correspondence relationship, without performing repeated calculations based on the tone mapping curve.

[0081] In a possible implementation manner, the processing device may determine the tone types corresponding to the video frames to be processed in the following way. The processing device may first calculate the gray feature parameters corresponding to multiple video frames to be processed, and the gray feature parameter is used to identify the tone feature corresponding to the video frame to be processed. For example, the gray feature parameter may include the number of pixel points of each gray level in the video frame to be processed, as follows:

[0082] G i ={(0, S0), (1, S1), …, (255, S 255 )}

[0083] That is, the gray feature data is a 256-dimensional gray vector, where G i is the gray feature parameter of the i-th video frame to be processed, 0 to 255 are 256 gray levels, and S0 to S 255 are the number of pixel points corresponding to the 256 gray levels respectively.

[0084] The processing device can generate tone mapping parameters corresponding to multiple video frames to be processed respectively based on the grayscale feature parameters corresponding to the multiple video frames to be processed, and then generate mapped grayscale feature parameters corresponding to the multiple video frames to be processed respectively based on the grayscale feature parameters and tone mapping parameters corresponding to the multiple video frames to be processed respectively. The mapped grayscale feature parameters are used to identify the tone characteristics of the video frames to be processed after tone mapping. Since in the tone mapping process, what the user actually sees is the video after tone mapping, the processing device can judge which video frames belong to the same tone type based on the grayscale feature parameters after tone mapping processing.

[0085] For example, the function corresponding to the tone mapping curve can be shown as the following formula:

[0086]

[0087] where l is the input brightness and tm is the brightness after mapping.

[0088] Substitute the above grayscale feature parameter formula into the tone mapping curve, that is:

[0089]

[0090] where i′ is the grayscale value after tone mapping, and the mapped grayscale feature parameter G′ after tone mapping is obtained i :

[0091] G′ i ={(i′,s i )}

[0092] The processing device can cluster the mapped grayscale feature parameters corresponding to multiple video frames to be processed respectively to obtain multiple clustering nodes. The mapped grayscale feature parameters of the video frames to be processed in the same clustering node are relatively similar, that is, they are relatively similar in the grayscale characteristics of the video frames obtained after mapping. Therefore, the processing device can determine the video frames to be processed whose corresponding mapped grayscale feature parameters belong to the same clustering node as the video frames to be processed corresponding to the same tone type, and obtain the tone types corresponding to the multiple video frames to be processed respectively. The grayscale feature parameters corresponding to the tone type are the grayscale feature parameters corresponding to the center point of the corresponding clustering node. Thus, the processing device can classify the video frames to be processed with relatively similar grayscale characteristics into the same tone type.

[0093] In a possible implementation, to improve the efficiency of clustering processing, the processing device may perform compression and dimensionality reduction on the grayscale feature parameters before clustering. The processing device may compress the mapped grayscale feature parameters corresponding to multiple video frames to be processed, and the pixel dimension corresponding to the compressed mapped grayscale feature parameters is smaller than that of the mapped grayscale feature parameters before compression. For example, the mapped grayscale parameter before compression may be a 256-dimensional feature from 0 to 255, and the mapped grayscale feature parameter after compression is 36-dimensional. The processing device may cluster the compressed mapped grayscale feature parameters corresponding to multiple videos to be processed respectively, obtain multiple clustering nodes, reduce the data processing pressure during clustering processing, and improve the clustering efficiency.

[0094] In addition, after the clustering is completed through compression processing, the processing device may restore the compressed mapped grayscale feature parameters corresponding to multiple videos to be processed respectively, and obtain the mapped grayscale feature parameters with the dimension before compression again.

[0095] For example, the processing device may compress G′ through the Principal Component Analysis (PCA) technique i to obtain the compressed data G″ with 36 dimensions i . In the use of the clustering algorithm, the processing device may use the traditional K-means algorithm to cluster the mapped grayscale feature parameters. The number of clusters is K, which can generally be set to 50. After clustering, 50 groups of categories are obtained, and the center point of each category is used as the feature point of the current category. Therefore, the compressed mapped grayscale feature data corresponding to 50 hue types are obtained, denoted as:

[0096] G″′ i , i = 1…50

[0097] The processing device may use PCA to restore the compressed data and restore it to the grayscale feature parameters s″′ corresponding to each hue type i .

[0098] It should be emphasized that the determination process of the above hue type is a preprocessing process, that is, it can be processed before the tone mapping is required. Therefore, it does not affect the efficiency of the tone mapping process of the video during video playback.

[0099] To facilitate the understanding of the technical solution provided by the embodiments of the present application, next, a video processing method provided by the embodiments of the present application will be introduced in combination with an actual application scenario.

[0100] See Figure 4 , Figure 4 which is a flowchart of a video processing method in an actual application scenario provided by the embodiments of the present application. The method includes:

[0101] S401: Feature extraction.

[0102] The processing device first extracts features from each video frame in the video to be processed, and obtains the grayscale feature parameters corresponding to each video frame to be processed.

[0103] S402: Dimension conversion.

[0104] The processing device converts the grayscale feature parameters into mapped grayscale feature parameters through the tone mapping parameters.

[0105] S403: Dimension compression.

[0106] The processing device can compress the 256-dimensional grayscale feature parameters into 36 dimensions through the PCA algorithm.

[0107] S404: Clustering.

[0108] S405: Feature restoration.

[0109] The processing device can restore the compressed mapped grayscale feature parameters to the corresponding grayscale feature parameters.

[0110] S406: Write into the bitstream.

[0111] In the original algorithm, there is a set of metadata in each frame. Through the above steps, we have classified each set of metadata, that is, the corresponding tone type is included in the metadata, and the grayscale feature parameters corresponding to the tone type are marked. Therefore, the following steps can be simply executed to replace the metadata corresponding to each video frame to be processed.

[0112] 1. Parse the original metadata.

[0113] 2. Query its corresponding tone type.

[0114] 3. Replace the grayscale feature data in the original metadata with the grayscale feature data corresponding to the tone type.

[0115] 4. Encode.

[0116] The information stored in the final encoding is shown in the following table:

[0117]

[0118] See Figure 5 , Figure 5 which is a schematic diagram of a video processing method in an actual application scenario provided by an embodiment of the present application. Each video frame to be processed in the video to be processed has corresponding metadata, and the metadata includes the tone type and grayscale feature parameters corresponding to the video frame to be processed.

[0119] After the processing device reads the metadata of each video frame of the video to be processed, it first determines that the corresponding hue type is the i-th type, and then determines whether the i-th hue type hits the cache, that is, the hue mapping curve and parameter correspondence in the cache. If the cache is hit, directly read the hue mapping curve or parameter correspondence in the cache for hue mapping; if the cache is not hit, calculate the hue mapping curve based on the gray feature parameters in the metadata and write the hue mapping curve into the cache. After performing hue mapping based on the hue mapping curve, the processing device can also cache the correspondence between the gray feature parameters before mapping and the gray feature parameters after mapping, so that there is no need for repeated calculation when performing hue mapping on subsequent video frames of the same hue type.

[0120] The processing device can cache the above-mentioned cached parameters in the GPU, reducing repeated calculations and facilitating terminal acceleration processing. Specifically, the implementation steps are as follows:

[0121] Step1. Establish a cache: The cache format is as follows:

[0122] cache={KEY:i,Value:metadata_lut}

[0123] They respectively correspond to the index and metadata stored in the previous subsection.

[0124] Step2. Cache table establishment and acceleration strategy.

[0125] 1. Parse the current frame parameters: Obtain

[0126] a. Index: i

[0127] b. Metadata: metadata

[0128] 2. Cache lookup: According to the index, check whether it is in the cache. If it is not in the cache, jump to step 3; if it is in the cache, jump to step 4.

[0129] 3. Cache establishment.

[0130] a. Use the metadata metadata to generate a function corresponding to the current hue mapping curve;

[0131]

[0132] b. For the brightness range of the current video, substitute it into the hue mapping function to generate a lookup table, which records the correspondence between the gray feature parameters before and after mapping;

[0133] {l,tm l},l={1,…,max}

[0134] c. Generate GPU texture;

[0135] d. Write to cache.

[0136] 4. Cache usage.

[0137] a. Search cache lut;

[0138] b. Upload cache GPU texture;

[0139] c. The device performs tone mapping.

[0140] The solution proposed in this application utilizes the advantages of small data to accelerate terminal computing. In the traditional computing process, due to the piecewise characteristics of the tone mapping function, there are often multiple-branch computations in the GPU, which has a certain impact on the parallel acceleration of the GPU. The strategy of lookup table plus cache can greatly reduce the occurrence of this situation, thereby improving the computing efficiency.

[0141] Based on the video processing method provided in the above embodiments, the embodiments of this application also provide a video processing device. Refer to Figure 6 , Figure 6 which is the structural block diagram of a video processing device 600 provided by the embodiments of this application. The device includes an acquisition unit 601, a first determination unit 602, and a mapping unit 603:

[0142] The acquisition unit 601 is used to acquire a video to be processed. The video to be processed includes multiple video frames to be processed, and each video frame to be processed has a corresponding tone type. The number of tone types corresponding to the video to be processed is less than the number of the multiple video frames to be processed;

[0143] The first determination unit 602 is used to determine the tone mapping curves respectively corresponding to the multiple video frames to be processed according to the tone types. The tone mapping curves are calculated based on the gray feature parameters corresponding to the tone types, and there is at most one calculation of the tone mapping curve for the same tone type;

[0144] The mapping unit 603 is used to perform tone mapping on the video to be processed according to the tone mapping curves respectively corresponding to the multiple video frames to be processed, and generate a tone mapping video corresponding to the video to be processed.

[0145] In a possible implementation manner, among the multiple video frames to be processed, there is a target video frame, and the target video frame corresponds to a target tone type. The first determination unit 602 is specifically used for:

[0146] In response to the existence of a target tone mapping curve corresponding to the target tone type in the cached tone mapping curve, determining the target tone mapping curve as the tone mapping curve corresponding to the target video frame;

[0147] In response to the non-existence of a tone mapping curve corresponding to the target tone type in the cached tone mapping curve, obtaining target gray-scale characteristic parameters corresponding to the target tone type, where the target gray-scale characteristic parameters are used to identify the tone characteristics of the target tone type;

[0148] Calculating a target tone mapping curve corresponding to the target tone type according to the target gray-scale characteristic parameters;

[0149] Determining the target tone mapping curve as the tone mapping curve corresponding to the target video frame, and caching the target tone mapping curve.

[0150] In a possible implementation manner, for the target video frame, the mapping unit 603 is specifically configured to:

[0151] In response to the target tone mapping curve having a corresponding cached parameter correspondence relationship, determining, based on the parameter correspondence relationship, target mapped gray-scale characteristic parameters corresponding to the target gray-scale characteristic parameters;

[0152] Generating a mapped video frame corresponding to the target video frame based on the target mapped gray-scale characteristic parameters;

[0153] Generating a tone mapping video corresponding to the video to be processed according to the mapped video frames respectively corresponding to the multiple video frames to be processed.

[0154] In a possible implementation manner, the apparatus further includes a first calculation unit, a first generation unit, and a caching unit:

[0155] The first calculation unit is configured to, in response to the target tone mapping curve not having a corresponding cached parameter correspondence relationship, calculate target mapped gray-scale characteristic parameters corresponding to the target video frame according to the target tone mapping curve and the target gray-scale characteristic parameters;

[0156] The first generation unit is configured to generate the parameter correspondence relationship according to the target mapped gray-scale characteristic parameters and the target gray-scale characteristic parameters;

[0157] The caching unit is configured to cache the parameter correspondence relationship.

[0158] In a possible implementation manner, the apparatus further includes a second calculation unit, a second generation unit, a third generation unit, a clustering unit, and a second determination unit:

[0159] The second calculation unit is configured to calculate grayscale feature parameters respectively corresponding to the multiple video frames to be processed, where the grayscale feature parameters are used to identify the hue features corresponding to the video frames to be processed;

[0160] The second generation unit is configured to generate hue mapping parameters respectively corresponding to the multiple video frames to be processed based on the grayscale feature parameters respectively corresponding to the multiple video frames to be processed;

[0161] The third generation unit is configured to generate mapped grayscale feature parameters respectively corresponding to the multiple video frames to be processed based on the grayscale feature parameters and the hue mapping parameters respectively corresponding to the multiple video frames to be processed, where the mapped grayscale feature parameters are used to identify the hue features of the video frames to be processed after hue mapping;

[0162] The clustering unit is configured to cluster the mapped grayscale feature parameters respectively corresponding to the multiple video frames to be processed,

[0163] The second determination unit is configured to determine the video frames to be processed whose corresponding mapped grayscale feature parameters belong to the same clustering node as the video frames to be processed corresponding to the same hue type, and obtain the hue types respectively corresponding to the multiple video frames to be processed, where the grayscale feature parameters corresponding to the hue type are the grayscale feature parameters corresponding to the center point of the corresponding clustering node.

[0164] In a possible implementation manner, the apparatus further includes a compression unit:

[0165] The compression unit is configured to compress the mapped grayscale feature parameters respectively corresponding to the multiple video frames to be processed, and the pixel dimension of the compressed mapped grayscale feature parameters is smaller than that of the mapped grayscale feature parameters before compression;

[0166] The clustering unit is specifically configured to:

[0167] Cluster the compressed mapped grayscale feature parameters respectively corresponding to the multiple videos to be processed.

[0168] An embodiment of the present application further provides a computer device, which will be introduced below with reference to the accompanying drawings. Please refer to Figure 7 As shown, an embodiment of the present application provides a device, and the device may also be a terminal device. The terminal device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (Personal Digital Assistant, abbreviated as PDA), a point of sales (Point of Sales, abbreviated as POS), a vehicle-mounted computer, etc. Taking the terminal device as a mobile phone as an example:

[0169] Figure 7Shown is a block diagram of a partial structure of a mobile phone related to the terminal device provided in the embodiments of the present application. Refer to Figure 7 , the mobile phone includes: a Radio Frequency (RF) circuit 710, a memory 720, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a Wireless Fidelity (WiFi) module 770, a processor 780, and a power supply 790 and other components. Those skilled in the art can understand that Figure 7 the mobile phone structure shown in

[0170] does not limit the mobile phone, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Figure 7 The following specifically introduces each component of the mobile phone:

[0171] The RF circuit 710 can be used for receiving and transmitting signals during information reception or call processes. Specifically, after receiving the downlink information from the base station, it is given to the processor 780 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 710 includes but is not limited to antennas, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. In addition, the RF circuit 710 can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0172] The memory 720 can be used to store software programs and modules. The processor 780 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 720. The memory 720 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, the image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 720 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0173] The input unit 730 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the mobile phone. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732. The touch panel 731, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 731), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 731 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 780, and can receive and execute the commands sent by the processor 780. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel 731. In addition to the touch panel 731, the input unit 730 may further include other input devices 732. Specifically, the other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0174] The display unit 740 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 740 may include a display panel 741. Optionally, the display panel 741 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 731 can cover the display panel 741. When the touch panel 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event. Subsequently, the processor 780 provides a corresponding visual output on the display panel 741 according to the type of touch event. Although in Figure 7 the touch panel 731 and the display panel 741 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 731 and the display panel 741 can be integrated to realize the input and output functions of the mobile phone.

[0175] The mobile phone may further include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 741 and / or the backlight when the mobile phone is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors that the mobile phone can also be configured with, they will not be elaborated here.

[0176] The audio circuit 760, the speaker 761, and the microphone 762 can provide an audio interface between the user and the mobile phone. The audio circuit 760 can transmit the electrical signal converted from the received audio data to the speaker 761, and the speaker 761 converts it into a sound signal for output; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is received by the audio circuit 760 and then converted into audio data. After the audio data is output to the processor 780 for processing, it is sent to another mobile phone, for example, through the RF circuit 710, or the audio data is output to the memory 720 for further processing.

[0177] WiFi belongs to short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse the web, and access streaming media through the WiFi module 770. It provides users with wireless broadband Internet access. Although Figure 7The WiFi module 770 is shown, but it can be understood that it does not belong to the essential components of the mobile phone and can be completely omitted within the scope of not changing the essence of the invention as needed.

[0178] The processor 780 is the control center of the mobile phone, connecting various parts of the entire mobile phone through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 720, and by calling the data stored in the memory 720, it executes various functions of the mobile phone and processes data, thereby performing an overall detection of the mobile phone. Optionally, the processor 780 may include one or more processing units; preferably, the processor 780 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 780 either.

[0179] The mobile phone also includes a power supply 790 (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the processor 780 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system.

[0180] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be elaborated here.

[0181] In this embodiment, the processor 780 included in the terminal device further has the following functions:

[0182] Obtain a video to be processed, the video to be processed includes a plurality of video frames to be processed, each video frame to be processed has a corresponding hue type, and the number of hue types corresponding to the video to be processed is less than the number of the plurality of video frames to be processed;

[0183] According to the hue type, determine the hue mapping curves respectively corresponding to the plurality of video frames to be processed, the hue mapping curve is calculated based on the gray-scale characteristic parameters corresponding to the hue type, and there is at most one calculation of the hue mapping curve for the same hue type;

[0184] Perform hue mapping on the video to be processed according to the hue mapping curves respectively corresponding to the plurality of video frames to be processed, and generate a hue mapping video corresponding to the video to be processed.

[0185] The embodiment of the present application also provides a server, please refer to Figure 8 as shown Figure 8The structural diagram of server 800 provided by the embodiments of the present application. Server 800 may vary significantly due to configuration or performance differences, and may include one or more central processing units (CPUs) 822 (for example, one or more processors) and a memory 832, and one or more storage media 830 (for example, one or more mass storage devices) that store application programs 842 or data 844. Among them, the memory 832 and the storage media 830 may be transient storage or persistent storage. The programs stored in the storage media 830 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Further, the central processing unit 822 may be configured to communicate with the storage media 830 and execute a series of instruction operations in the storage media 830 on the server 800.

[0186] Server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input / output interfaces 858, and / or one or more operating systems 841, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.

[0187] The steps performed by the server in the above embodiments may be based on Figure 8 the server structure shown.

[0188] The embodiments of the present application also provide a computer-readable storage medium for storing a computer program, and the computer program is used to execute any one of the video processing methods described in the foregoing embodiments.

[0189] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium, and when the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium may be at least one of the following media: read-only memory (abbreviation: ROM), RAM, magnetic disk, or optical disc, etc., which can store program codes.

[0190] It should be noted that the various embodiments in this specification are described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, they are described relatively simply, and for the relevant parts, reference can be made to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.

[0191] As described above, this is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A video processing method, characterized in that, The method includes: Obtain a video to be processed, where the video to be processed includes multiple video frames to be processed, each video frame to be processed has a corresponding hue type, the number of hue types corresponding to the video to be processed is less than the number of the multiple video frames to be processed, and the multiple video frames to be processed include a target video frame, and the target video frame corresponds to a target hue type; In response to the existence of a target hue mapping curve corresponding to the target hue type in the cached hue mapping curves, determine the target hue mapping curve as the hue mapping curve corresponding to the target video frame. The hue mapping curve is calculated based on the gray-scale feature parameters corresponding to the hue type, and there is at most one calculation of the hue mapping curve for the same hue type. The gray-scale feature parameters are used to identify the hue characteristics corresponding to the video to be processed under the hue type; In response to the non-existence of a hue mapping curve corresponding to the target hue type in the cached hue mapping curves, obtain the target gray-scale feature parameters corresponding to the target hue type, where the target gray-scale feature parameters are used to identify the hue characteristics of the target hue type; Calculate the target hue mapping curve corresponding to the target hue type according to the target gray-scale feature parameters; Determine the target hue mapping curve as the hue mapping curve corresponding to the target video frame, and cache the target hue mapping curve; Perform hue mapping on the video to be processed according to the hue mapping curves corresponding to the multiple video frames to be processed respectively, and generate a hue mapping video corresponding to the video to be processed.

2. The method according to claim 1, characterized in that, For the target video frame, the performing hue mapping on the video to be processed according to the hue mapping curves corresponding to the multiple video frames to be processed respectively, and generating a hue mapping video corresponding to the video to be processed includes: In response to the target hue mapping curve having a corresponding cached parameter correspondence relationship, based on the parameter correspondence relationship, determine the target mapped gray-scale feature parameter corresponding to the target gray-scale feature parameter; Generate a mapped video frame corresponding to the target video frame based on the target mapped gray-scale feature parameter; Generate a hue mapping video corresponding to the video to be processed according to the mapped video frames corresponding to the multiple video frames to be processed respectively.

3. The method according to claim 2, wherein The method further includes: In response to the target hue mapping curve not having a corresponding cached parameter correspondence relationship, calculate the target mapped gray-scale feature parameter corresponding to the target video frame according to the target hue mapping curve and the target gray-scale feature parameters; Generate the parameter correspondence relationship according to the target mapped gray-scale feature parameter and the target gray-scale feature parameters; Cache the parameter correspondence relationship.

4. The method according to claim 1, wherein The method further includes: Calculate the gray-scale feature parameters corresponding to the multiple video frames to be processed respectively, where the gray-scale feature parameters are used to identify the hue characteristics corresponding to the video frames to be processed; Generate the hue mapping parameters corresponding to the multiple video frames to be processed respectively based on the gray-scale feature parameters corresponding to the multiple video frames to be processed respectively; Generate mapped grayscale feature parameters corresponding to the multiple video frames to be processed respectively based on the grayscale feature parameters and tone mapping parameters corresponding to the multiple video frames to be processed respectively, where the mapped grayscale feature parameters are used to identify the tone features of the video frames to be processed after tone mapping; Cluster the mapped grayscale feature parameters corresponding to the multiple video frames to be processed respectively; Determine the video frames to be processed corresponding to the same clustering node of the mapped grayscale feature parameters as the video frames to be processed corresponding to the same tone type, and obtain the tone types corresponding to the multiple video frames to be processed respectively. The grayscale feature parameters corresponding to the tone type are the grayscale feature parameters corresponding to the center point of the corresponding clustering node.

5. The method according to claim 4, wherein The method further includes: Compress the mapped grayscale feature parameters corresponding to the multiple video frames to be processed respectively, where the pixel dimension corresponding to the compressed mapped grayscale feature parameters is smaller than that of the mapped grayscale feature parameters before compression; The clustering of the mapped grayscale feature parameters corresponding to the multiple video frames to be processed respectively includes: Cluster the compressed mapped grayscale feature parameters corresponding to the multiple videos to be processed respectively.

6. A video processing device, characterized in that, The apparatus includes an acquisition unit, a first determination unit, and a mapping unit: The acquisition unit is configured to acquire a video to be processed, where the video to be processed includes multiple video frames to be processed, each of the video frames to be processed has a corresponding tone type, and the number of tone types corresponding to the video to be processed is less than the number of the multiple video frames to be processed; The first determination unit is configured to determine the tone mapping curves corresponding to the multiple video frames to be processed respectively according to the tone type. The tone mapping curve is calculated based on the grayscale feature parameters corresponding to the tone type, and there is at most one calculation of the tone mapping curve for the same tone type. The grayscale feature parameters are used to identify the tone features corresponding to the video to be processed under the tone type; The mapping unit is configured to perform tone mapping on the video to be processed according to the tone mapping curves corresponding to the multiple video frames to be processed respectively, and generate a tone-mapped video corresponding to the video to be processed; Among the multiple video frames to be processed, there is a target video frame corresponding to a target tone type. Specifically, the first determination unit is configured to: In response to the existence of a target tone mapping curve corresponding to the target tone type in the cached tone mapping curves, determine the target tone mapping curve as the tone mapping curve corresponding to the target video frame; In response to the non-existence of a tone mapping curve corresponding to the target tone type in the cached tone mapping curves, obtain the target grayscale feature parameters corresponding to the target tone type, where the target grayscale feature parameters are used to identify the tone features of the target tone type; Calculate the target tone mapping curve corresponding to the target tone type according to the target grayscale feature parameters; Determine the target tone mapping curve as the tone mapping curve corresponding to the target video frame, and cache the target tone mapping curve.

7. The device according to claim 6, wherein For the target video frame, specifically, the mapping unit is configured to: In response to the target tone mapping curve having a corresponding cached parameter correspondence relationship, based on the parameter correspondence relationship, determine the target mapped gray feature parameter corresponding to the target gray feature parameter; Generate a mapped video frame corresponding to the target video frame based on the target mapped gray feature parameter; Generate a tone mapping video corresponding to the video to be processed according to the mapped video frames respectively corresponding to the multiple video frames to be processed.

8. The device according to claim 7, characterized in that, The device further includes a first calculation unit, a first generation unit, and a cache unit: The first calculation unit is configured to, in response to the target tone mapping curve not having a corresponding cached parameter correspondence relationship, calculate the target mapped gray feature parameter corresponding to the target video frame according to the target tone mapping curve and the target gray feature parameter; The first generation unit is configured to generate the parameter correspondence relationship according to the target mapped gray feature parameter and the target gray feature parameter; The cache unit is configured to cache the parameter correspondence relationship.

9. The device according to claim 6, characterized in that, The device further includes a second calculation unit, a second generation unit, a third generation unit, a clustering unit, and a second determination unit: The second calculation unit is configured to calculate the gray feature parameters respectively corresponding to the multiple video frames to be processed, where the gray feature parameters are used to identify the tone features corresponding to the video frames to be processed; The second generation unit is configured to generate tone mapping parameters respectively corresponding to the multiple video frames to be processed based on the gray feature parameters respectively corresponding to the multiple video frames to be processed; The third generation unit is configured to generate mapped gray feature parameters respectively corresponding to the multiple video frames to be processed based on the gray feature parameters and tone mapping parameters respectively corresponding to the multiple video frames to be processed, where the mapped gray feature parameters are used to identify the tone features of the video frames to be processed after tone mapping; The clustering unit is configured to cluster the mapped gray feature parameters respectively corresponding to the multiple video frames to be processed, The second determination unit is configured to determine the video frames to be processed whose corresponding mapped gray feature parameters belong to the same clustering node as the video frames to be processed corresponding to the same tone type, and obtain the tone types respectively corresponding to the multiple video frames to be processed, where the gray feature parameter corresponding to the tone type is the gray feature parameter corresponding to the center point of the corresponding clustering node.

10. The device according to claim 9, characterized in that, The device further includes a compression unit: The compression unit is configured to compress the mapped gray feature parameters respectively corresponding to the multiple video frames to be processed, and the pixel dimension corresponding to the compressed mapped gray feature parameter is smaller than that of the mapped gray feature parameter before compression; The clustering unit is specifically configured to: Cluster the compressed mapped gray feature parameters respectively corresponding to the multiple videos to be processed.

11. A computer device, characterized in that, The device includes a processor and a memory: The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the video processing method according to any one of claims 1-5 according to the instructions in the program code.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the video processing method described in any one of claims 1-5.

13. A computer program product including instructions, which, when running on a computer, causes the computer to execute the video processing method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Image tone mapping method and device

    CN109785275A