Video processing method and device, electronic equipment and readable storage medium

By dynamically adjusting the pixel value of the HDR video stream, the problem that the display effect of HDR video on different screens and environmental conditions is solved, and the best viewing experience of the video stream under various conditions is achieved.

CN119520918APending Publication Date: 2025-02-25VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411599685.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Due to uncertainty in the screen and viewing environment, the display effect of the HDR video presented to the user is much different from the expected effect, resulting in the problem of low quality of HDR video.

Method used

A video processing method is provided, by obtaining video streams and detecting changes in screen brightness and ambient brightness, and using reference tone mapping information and parameter adjustments, the pixel values ​​of frame images are dynamically adjusted to adapt to different screen and environmental conditions.

Benefits of technology

Under different screen brightness and ambient brightness, it is automatically adapted to different viewing environments and equipment conditions, making the color and brightness of the video stream more natural and realistic, ensuring that the video stream can provide users with the best viewing experience under different conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520918A_ABST
    Figure CN119520918A_ABST
Patent Text Reader

Abstract

The invention discloses a video processing method and device, electronic equipment and a readable storage medium, and belongs to the technical field of image processing. The video processing method comprises the following steps: acquiring a video stream, wherein the video stream comprises at least one frame image; according to at least one of the first adjustment strategy and the second adjustment strategy, adjusting the pixel value of the frame image to obtain an adjusted pixel value; and outputting the adjusted video stream according to the adjusted pixel value. Wherein the first adjustment strategy comprises the following steps: when the screen brightness corresponding to the video stream is detected to change, adjusting the pixel value of the frame image according to reference tone mapping information corresponding to the current screen brightness of the video stream; the second adjustment strategy comprises the step of adjusting the pixel value of the frame image according to a first parameter corresponding to the current ambient brightness of the video stream when it is detected that the ambient brightness corresponding to the video stream changes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and specifically relates to a video processing method, device, electronic device and readable storage medium. Background Art

[0002] At present, there are more and more high dynamic range (HDR) videos. In order to ensure that high-quality HDR videos are presented to users, video producers need to adjust HDR videos based on HDR monitors and ideal viewing environments so that the display effect of the adjusted HDR videos can achieve the expected effect. For example, the red image content in the HDR video is bright enough.

[0003] In actual display scenarios, the screen that plays the video is limited, such as the screen's brightness range and brightness peak are not as good as an HDR monitor. In addition, the user's viewing scenarios are complex and changeable, and are not limited to an ideal viewing environment. As a result, when the user is watching HDR video, the display effect originally debugged cannot be presented to the user.

[0004] It can be seen that, limited by the uncertainties of the screen and viewing environment, the display effect of the HDR video presented to the user is quite different from the expected effect, resulting in the problem of low HDR video quality. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a video processing method, device, electronic device and readable storage medium, which can solve the problem that the display effect of the HDR video presented to the user is significantly different from the expected effect due to the uncertain factors of the screen and the viewing environment, resulting in low HDR video quality.

[0006] In a first aspect, an embodiment of the present application provides a video processing method, the method comprising:

[0007] Acquire a video stream, where the video stream includes at least one frame image;

[0008] According to at least one of the first adjustment strategy and the second adjustment strategy, the pixel value of the frame image is adjusted to obtain an adjusted pixel value;

[0009] Outputting an adjusted video stream according to the adjusted pixel value;

[0010] The first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0011] The second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream.

[0012] In a second aspect, an embodiment of the present application provides a video processing device, the device comprising:

[0013] An acquisition module, used for acquiring a video stream, where the video stream includes at least one frame image;

[0014] An adjustment module, configured to adjust the pixel value of the frame image according to at least one of the first adjustment strategy and the second adjustment strategy to obtain an adjusted pixel value;

[0015] An output module, used for outputting an adjusted video stream according to the adjusted pixel value;

[0016] The first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0017] The second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps described in the first aspect are implemented.

[0019] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0020] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0021] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0022] In an embodiment of the present application, a video stream is obtained, and the video stream includes at least one frame image; according to at least one of a first adjustment strategy and a second adjustment strategy, the pixel value of the frame image is adjusted to obtain an adjusted pixel value; wherein the first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the current screen brightness of the video stream; the second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the first parameter corresponding to the current ambient brightness of the video stream. Thus, under different screen brightness and ambient brightness, the pixel value is dynamically adjusted through tone mapping and parameter adjustment without manual adjustment by the user, so that the video stream can automatically adapt to different viewing environments and equipment conditions, so that the color and brightness of the video stream are more natural and realistic. According to the adjusted pixel value, the adjusted video stream is output to ensure that the video stream can provide the best viewing experience for the user under different screen brightness and ambient brightness. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is one of the flow charts of the video processing method of some embodiments of the present application;

[0024] Figure 2 This is the second flowchart of the video processing method of some embodiments of the present application;

[0025] Figure 3 is a block diagram of a video processing device according to some embodiments of the present application;

[0026] Figure 4 Schematic diagram of the hardware structure of the electronic device of some embodiments of the present application;

[0027] Figure 5 It is a schematic diagram of the hardware structure of an electronic device of some embodiments of the present application. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings of the embodiments of the present application to clearly describe the technical solutions of the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present application belong to the scope of protection of this application.

[0029] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally a class, and the number of objects is not limited. For example, the target object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated before and after are in an "or" relationship.

[0030] The video processing method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0031] like Figure 1 FIG. 1 is a flowchart of a video processing method according to an embodiment of the present application. The method is applied to an electronic device as an example. The method includes:

[0032] Step 110, obtaining a video stream, where the video stream includes at least one frame image;

[0033] Video stream: A video stream is a video data stream consisting of a series of continuous frame images. Each frame is a static image. When these images are played continuously at a fast enough speed, a dynamic video effect will be produced.

[0034] The application scenario of this embodiment can be used for processing HDR video, and correspondingly, the video stream is an HDR video stream. Optionally, the format of the video stream is HDR10, HLG, or HDR10+.

[0035] like Figure 2 As shown, in the video stream processing flow, after the HDR video stream is converted from YUV format to RGB format, electro-optical conversion (Electro-Optical Transfer Function, EOTF) is performed to convert it from the nonlinear coding domain to the linear domain, and then tone mapping and color gamut mapping are performed, and finally the linear domain data is subjected to optoelectronic conversion (Opto-Electronic Transfer Function, OETF) to convert it to the coding domain.

[0036] In this step, the video stream obtained is a video stream that has been processed by electro-optical conversion. The purpose of the electro-optical conversion process is to convert electrical signals into optical signals so as to perform high-speed, long-distance, and low-loss data transmission through optical transmission media such as optical fibers.

[0037] Frame image: Each static image in a video stream is called a frame. Frame is the basic unit of video. The smoothness of the video depends on the frame rate, which is the number of frames displayed per second.

[0038] By acquiring continuous frame images through video acquisition equipment to form a video stream, the original video data can be obtained to provide input for subsequent image processing.

[0039] Step 120, adjusting the pixel value of the frame image according to at least one of the first adjustment strategy and the second adjustment strategy to obtain an adjusted pixel value;

[0040] The first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0041] The second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream;

[0042] Pixel value: Pixel is the smallest unit of an image. Each pixel has a numerical value, which indicates the color and brightness of the pixel. Pixel values ​​are usually expressed using the three primary colors RGB.

[0043] The first adjustment strategy involves:

[0044] Screen brightness: Screen brightness refers to the brightness level of the display device. It affects the display effect of the video on the screen.

[0045] Reference tone mapping information: Tone mapping is a technique used to convert a high dynamic range (HDR) image to a standard dynamic range (SDR) image. Reference tone mapping information refers to preset parameters used to adjust the image tone at a specific screen brightness. The reference tone mapping information can be a tone mapping curve.

[0046] like Figure 2 As shown, after the video stream is subjected to electro-optical conversion processing, the tone mapping module can use the dynamic metadata of the video stream to generate a dynamic tone mapping curve according to the standard.

[0047] In the tone mapping curve, the horizontal axis is used to represent the image brightness variation range of a certain frame in the video stream, and the vertical axis is used to represent the screen brightness value variation range. Therefore, when the frame is about to be displayed, the corresponding image brightness can be found in the tone mapping curve according to the current brightness value of the screen, so as to display the image content of the frame based on the image brightness.

[0048] In this step, if there is only one tone mapping curve, when the current brightness value of the screen is the maximum brightness value, the image brightness of the frame can be adjusted to achieve the expected display effect, but when the current brightness value of the screen is a smaller brightness value, the image brightness of the frame adjusted to this value cannot achieve the expected display effect.

[0049] For example, when the screen brightness value is large, the color of the sun in the video is bright; when the screen brightness value is small, the color of the sun in the video is not very bright.

[0050] like Figure 2 As shown, at least two tone mapping curves are obtained by combining the tone mapping module and the Opto-Optical Transfer Function (OOTF) 1 module, so as to ensure that the image brightness of a certain frame debugged based on the current brightness value can be as close to the expected display effect as possible based on the at least two tone mapping curves and the current brightness value of the screen.

[0051] The image brightness of the video frame is determined by the pixel value of the video frame. Therefore, the image brightness can be adjusted based on the adjustment of the pixel value of the video frame. It can be seen that the first adjustment strategy proposes to overcome the influence on the display effect caused by the change of the screen brightness value.

[0052] Involving the second adjustment strategy:

[0053] Ambient brightness: Ambient brightness refers to the intensity of the surrounding light when watching a video, which affects the viewer's visual experience.

[0054] First parameter: The first parameter refers to a preset parameter used to adjust the image pixel value under a specific ambient brightness.

[0055] The adjusted frame images are recombined according to the frame rate of the original video stream to form a new video stream, and the optimized video stream is output to ensure that the video can provide the best viewing experience under different screens and ambient brightness.

[0056] On the one hand, the viewing environment of the user may be a dark room, indoors, or outdoors. Therefore, the ambient light brightness value when displaying the video will affect the display effect of the video. On the other hand, the screen mode when displaying the video is different, which may be full-screen display or non-full-screen display. When non-full-screen display is used, the user interface (UI) on the screen will display other interface contents in addition to the video frame, such as displaying a black border or a white border around the video. The black border or the white border here refers to other interface contents. The brightness values ​​of these interfaces will also affect the display effect of the video. Among them, the brightness values ​​of other interfaces displayed while displaying the video frame are the interface brightness values ​​in this step.

[0057] like Figure 2 As shown, the OOTF2 module adjusts the pixel value of a frame of the video stream based on at least one of the ambient light brightness value and the interface brightness value, thereby overcoming the negative impact of at least one of the ambient light and interface content on the display effect, thereby making the video display effect as close to the expected effect as possible.

[0058] Next, the color gamut mapping is implemented by the color mapping module to convert the BT.2020 color gamut of the video source to the screen color gamut, such as the P3D65 color gamut. It can be converted through a 3*3 matrix or through a three-dimensional look-up table (3DLUT).

[0059] Therefore, the first adjustment strategy is: when the screen brightness changes, adjust the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness to optimize the display effect of the image at the current screen brightness. Ensure that the video can maintain good visual effects at different screen brightnesses and avoid the problem of too bright or too dark.

[0060] Second adjustment strategy: When a change in ambient brightness is detected, the pixel value of the frame image will be adjusted according to the first parameter corresponding to the current ambient brightness to adapt to the light conditions of the viewing environment. This ensures that the video can maintain a comfortable viewing experience under different ambient brightness and avoids the impact of ambient light on video viewing.

[0061] Step 130, outputting an adjusted video stream according to the adjusted pixel values;

[0062] By dynamically adjusting pixel values, the video stream can maintain the best visual effect under different screen brightness and ambient brightness, and can automatically adapt to different viewing environments and device conditions without the need for manual adjustment by the user. Through tone mapping and parameter adjustment, the color and brightness of the video stream are more natural and realistic.

[0063] In a possible embodiment, when it is detected that the screen brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the current screen brightness of the video stream, including:

[0064] Step 210, obtaining reference tone mapping information corresponding to each reference screen brightness according to N reference screen brightnesses; wherein N is a positive integer and N>1;

[0065] Step 220, when it is detected that the screen brightness corresponding to the video stream changes, the current screen brightness of the video stream is obtained;

[0066] Step 230, comparing the current screen brightness with N reference screen brightnesses to obtain a comparison result;

[0067] Step 240: adjusting the pixel values ​​of the frame image according to the comparison result.

[0068] Involving step 210: N reference screen brightnesses are predefined. For example, a series of brightness levels from the darkest to the brightest, and corresponding reference tone mapping information is preset for each reference screen brightness. These reference tone mapping information are pre-calculated and used to optimize the display effect of the image at a specific screen brightness.

[0069] Through the preset reference tone mapping information, the corresponding adjustment parameters can be quickly found when the screen brightness changes are detected, thereby improving the adjustment efficiency.

[0070] Wherein, step 210 may specifically include:

[0071] Sub-step A1: Determine at least two preset brightness values ​​within the range from the minimum brightness value to the maximum brightness value of the screen, and the reference screen brightness is the preset brightness value.

[0072] Sub-step A2: According to at least two preset brightness values, obtain at least two corresponding tone mapping curves, wherein the brightness value range of the screen corresponding to the tone mapping curve is from the minimum brightness value to the preset brightness value.

[0073] Optionally, one of the preset brightness values ​​is a maximum brightness value of the screen.

[0074] like Figure 2 As shown, the tone mapping module generates a tone mapping curve according to the minimum and maximum values ​​of the screen brightness. The brightness value range of the screen corresponding to the tone mapping curve is from the minimum brightness value to the maximum brightness value.

[0075] For example, the minimum value of the screen brightness is 2 nit, and the maximum value of the screen brightness is 1000 nit. Based on 2 nit to 1000 nit, a tone mapping curve is generated.

[0076] Furthermore, at least one value between the minimum and maximum values ​​of the screen brightness is taken as other preset brightness values. For example, a preset brightness value is 500nit, corresponding to a tone mapping curve, the screen brightness value corresponding to the tone mapping curve ranges from 2nit to 500nit, and after manual debugging, the image brightness of a frame when the screen brightness value is 500nit is the same as the image brightness of the frame when the screen brightness value in the first tone mapping curve is 1000nit. In this way, when the screen brightness value is 500nit and the screen brightness value is 1000nit, the image brightness of the video content is the same, so the display effect is the same, and the poor display effect caused by the change in screen brightness can be overcome.

[0077] Based on this, by taking multiple values ​​between the minimum and maximum values ​​of the screen brightness, multiple tone mapping curves can be obtained. The more tone mapping curves obtained, the more scenes of screen brightness changes are used, so that the image brightness of the video frame can be adjusted in more scenes of screen brightness changes, so that the video display effect achieves the expected debugging effect.

[0078] To facilitate the distinction, Figure 2 As shown in the figure, the tone mapping curve generated in the tone mapping module is the initial tone mapping curve. In OOTF1, more tone mapping curves are obtained according to the initial tone mapping curve, which can be defined as OOTF curves. That is, the maximum value of the brightness value range of the screen corresponding to the initial tone mapping curve is the maximum value of the screen brightness, such as 1000nit; the maximum value of the brightness value range of the screen corresponding to the OOTF curve is the preset brightness value other than the maximum value of the screen brightness, such as 500nit, 800nit.

[0079] Involving step 220: Real-time detection of the current screen brightness level through a sensor or software algorithm. When a change in screen brightness is detected, the current screen brightness value is recorded. The current screen brightness can be obtained in real time to provide accurate input data for subsequent pixel value adjustment.

[0080] Involving step 230: comparing the currently detected screen brightness with the preset N reference screen brightnesses, and determining the reference screen brightness that is closest to the current screen brightness. The comparison result may be the difference value between the current screen brightness and the reference screen brightness or the closest reference screen brightness index. By comparison, the reference tone mapping information corresponding to the current screen brightness can be determined, providing a basis for subsequent pixel value adjustment.

[0081] Involving step 240: According to the comparison result of step 230, select the reference tone mapping information corresponding to the closest reference screen brightness, and use this information to adjust the pixel value of the frame image. The adjustment process may involve adjustments in brightness, contrast, color saturation, etc. By adjusting the pixel value, it is ensured that the video can provide the best visual effect at the current screen brightness, avoid the problem of too bright or too dark, and improve the viewing experience.

[0082] As a result, it is possible to detect changes in screen brightness in real time and quickly adjust the video display effect according to the current screen brightness to ensure the consistency of the viewing experience. Through the preset reference tone mapping information, the color and brightness performance of the video can be optimized at different screen brightnesses to improve image quality. Through the preset reference screen brightness and the corresponding tone mapping information, it is possible to quickly find the appropriate adjustment parameters and improve processing efficiency. Through the preset reference screen brightness and the corresponding tone mapping information, dynamic adjustment of the pixel value of the video stream is achieved to ensure that the video can provide the best visual effect at different screen brightnesses.

[0083] In a possible embodiment, step 240 includes:

[0084] In the case that the current screen brightness is not equal to any reference screen brightness among the N reference screen brightnesses, determining, among the N reference screen brightnesses, a minimum second reference screen brightness greater than the current screen brightness and a maximum third reference screen brightness less than the current screen brightness;

[0085] Calculating a first weight according to the current screen brightness and the second reference screen brightness; and calculating a second weight according to the current screen brightness and the third reference screen brightness;

[0086] Acquire reference tone mapping information corresponding to the current screen brightness according to the reference tone mapping information corresponding to the second reference screen brightness and the first weight, and the reference tone mapping information corresponding to the third reference screen brightness and the second weight;

[0087] The pixel values ​​of the frame image are adjusted according to the reference tone mapping information corresponding to the current screen brightness.

[0088] When the current screen brightness is not equal to any of the N reference screen brightnesses, a minimum second reference screen brightness greater than the current screen brightness and a maximum third reference screen brightness less than the current screen brightness will be determined among the N reference screen brightnesses. These two reference screen brightnesses will be used for subsequent interpolation calculations.

[0089] By determining the second reference screen brightness and the third reference screen brightness, two reference points closest to the current screen brightness can be found, providing a basis for interpolation calculation.

[0090] The first weight is calculated according to the current screen brightness and the second reference screen brightness, and the second weight is calculated according to the current screen brightness and the third reference screen brightness. The weight calculation generally uses a linear interpolation method, that is, the weight is calculated according to the relative position of the current screen brightness between the second reference screen brightness and the third reference screen brightness.

[0091] By calculating the weights, the relative position of the current screen brightness between the second reference screen brightness and the third reference screen brightness can be determined, providing an accurate weight value for the interpolation calculation.

[0092] The reference tone mapping information corresponding to the current screen brightness is calculated by an interpolation method according to the reference tone mapping information corresponding to the second reference screen brightness and the first weight, and the reference tone mapping information corresponding to the third reference screen brightness and the second weight. The interpolation method may be linear interpolation, bilinear interpolation, etc.

[0093] Through interpolation calculation, the reference tone mapping information corresponding to the current screen brightness can be obtained, ensuring that accurate adjustment parameters can be provided even under non-reference screen brightness.

[0094] The pixel values ​​of the frame image are adjusted using the calculated reference tone mapping information corresponding to the current screen brightness. The adjustment process may involve adjustments in brightness, contrast, color saturation, etc.

[0095] By adjusting the pixel value, we can ensure that the video can provide the best visual effect under the current screen brightness, avoid the problem of too bright or too dark, and improve the viewing experience.

[0096] Through the interpolation method, the reference tone mapping information corresponding to the current screen brightness can be accurately calculated under non-reference screen brightness to ensure the accuracy of the adjustment. It can flexibly adapt to various screen brightness changes and provide optimized visual effects even under non-reference screen brightness. By dynamically adjusting the pixel value, it ensures that the video can provide the best visual effects under different screen brightness to enhance the viewing experience.

[0097] Therefore, the reference tone mapping information corresponding to the current screen brightness is calculated through the interpolation method, which enables precise adjustment of the pixel values ​​of the video stream and ensures that the video can provide the best visual effect under various screen brightness.

[0098] In another possible embodiment, step 240 includes:

[0099] When the current screen brightness is equal to the first reference screen brightness among N reference screen brightnesses, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the first reference screen brightness, wherein the first reference screen brightness is any reference screen brightness among the N reference screen brightnesses.

[0100] When the current screen brightness is equal to any reference screen brightness among the N reference screen brightnesses, the current screen brightness is determined to be the first reference screen brightness. The first reference screen brightness may be any one of the N reference screen brightnesses.

[0101] By determining that the current screen brightness is equal to the first reference screen brightness, preset reference tone mapping information can be used directly without interpolation calculation, thereby improving processing efficiency.

[0102] The reference tone mapping information corresponding to the first reference screen brightness is directly used to adjust the pixel value of the frame image. The adjustment process may involve adjustments in brightness, contrast, color saturation, etc. By directly using the preset reference tone mapping information, the pixel value of the frame image can be adjusted quickly and accurately to ensure that the video can provide the best visual effect at the current screen brightness.

[0103] Since the current screen brightness is equal to the reference screen brightness, the preset reference tone mapping information can be used directly without interpolation calculation, which improves the processing speed. The preset reference tone mapping information is optimized for a specific screen brightness, so the adjustment result is more accurate and can provide the best visual effect.

[0104] By directly using the preset reference tone mapping information, the pixel values ​​of the video stream can be quickly and accurately adjusted to ensure that the video can provide the best visual effect at a specific screen brightness.

[0105] In yet another possible embodiment, step 240 includes:

[0106] When the current screen brightness is less than the minimum fourth reference screen brightness, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the fourth reference screen brightness;

[0107] Among them, the N reference screen brightnesses include a fourth reference screen brightness.

[0108] When the current screen brightness is less than the minimum reference screen brightness among the N reference screen brightnesses, it is determined that the current screen brightness is less than the minimum fourth reference screen brightness. The fourth reference screen brightness is the smallest one among the N reference screen brightnesses. By determining that the current screen brightness is less than the minimum fourth reference screen brightness, it is possible to identify that the current screen brightness is outside the lower limit of the preset reference screen brightness, thereby selecting a suitable adjustment strategy.

[0109] The reference tone mapping information corresponding to the fourth reference screen brightness is directly used to adjust the pixel value of the frame image. The adjustment process may involve adjustments in brightness, contrast, color saturation, etc. By directly using the preset reference tone mapping information, the pixel value of the frame image can be adjusted quickly and accurately to ensure that the video can provide the best visual effect at the current screen brightness.

[0110] When the current screen brightness is lower than the preset minimum reference screen brightness, the reference tone mapping information corresponding to the minimum reference screen brightness can be used to ensure that the video can still provide acceptable visual effects under extremely low brightness conditions. Since the current screen brightness is less than the minimum reference screen brightness, the preset reference tone mapping information can be used directly to improve processing speed.

[0111] For example, the reference screen brightnesses are 300 nit, 500 nit and 1000 nit, and the current screen brightness is 100 nit. The current screen brightness is less than the fourth smallest reference screen brightness. The reference tone mapping information corresponding to the reference screen brightness of 300 nit is used as a reference curve to adjust the pixel value of the frame image.

[0112] By directly using the reference tone mapping information corresponding to the preset minimum reference screen brightness, fast and accurate adjustment of the pixel values ​​of the video stream is achieved, ensuring that the video can still provide acceptable visual effects under extremely low brightness conditions.

[0113] In a possible embodiment, step 220 includes:

[0114] Calculate the brightness of the frame image according to the pixel value of the frame image;

[0115] Determine the screen brightness corresponding to the brightness of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0116] Step 240 includes:

[0117] Calculate the brightness ratio according to the screen brightness and the brightness of the frame image;

[0118] The pixel value of the frame image is adjusted according to the brightness ratio and the brightness of the frame image.

[0119] First, calculate the brightness of the frame image. The brightness calculation is usually achieved by averaging or weighted averaging the brightness values ​​of all pixels in the frame image. The brightness value can be calculated by the weighted sum of the RGB channels, for example, using the formula: brightness = 0.299*R+0.587*G+0.114*B.

[0120] By calculating the brightness of the frame image, the overall brightness level of the current frame can be understood, providing basic data for subsequent adjustments.

[0121] The screen brightness corresponding to the brightness of the frame image is determined according to the reference tone mapping information corresponding to the current screen brightness of the video stream. The reference tone mapping information is usually a mapping table or function that maps the brightness of the frame image to the screen brightness. Through mapping, the brightness of the frame image can be converted to the corresponding screen brightness, ensuring that the adjusted image can provide the best visual effect at the current screen brightness.

[0122] The brightness ratio is calculated based on the screen brightness and the frame image brightness. The brightness ratio is usually the ratio between the screen brightness and the frame image brightness, which is used to determine the adjustment range. For example, brightness ratio = screen brightness / frame image brightness.

[0123] By calculating the brightness ratio, the degree to which the brightness of the frame image needs to be adjusted can be determined, providing accurate parameters for subsequent pixel value adjustment.

[0124] According to the calculated brightness ratio, the pixel values ​​of the frame image are adjusted. The adjustment process usually multiplies the brightness value of each pixel by the brightness ratio to achieve the expected screen brightness. The adjusted pixel values ​​may also need to be normalized to ensure that the pixel values ​​are within a reasonable range.

[0125] By adjusting the pixel value, it is possible to ensure that the frame image can provide the best visual effect under the current screen brightness, avoid the problem of being too bright or too dark, and improve the viewing experience.

[0126] By calculating the brightness of the frame image, determining the corresponding screen brightness, calculating the brightness ratio, and adjusting the pixel value, the brightness of the frame image can be accurately adjusted to ensure the best visual effect at the current screen brightness. The pixel value can be dynamically adjusted according to different screen brightness and frame image brightness to ensure that the video can provide the best visual effect at various screen brightness.

[0127] By accurately calculating and adjusting the brightness of the frame image, accurate adjustment of the pixel value of the video stream is achieved, ensuring that the video can provide the best visual effect under various screen brightness.

[0128] In a possible embodiment, adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream includes:

[0129] Get the current ambient brightness collected by the ambient light sensor;

[0130] Determine a first parameter corresponding to the current ambient brightness according to the current ambient brightness;

[0131] Calculate a first input value according to the pixel value of the frame image;

[0132] Calculate a first output value according to a first input value and a first parameter;

[0133] Calculating a first ratio according to the first input value and the first output value;

[0134] The pixel values ​​of the frame image are adjusted according to the first ratio.

[0135] The ambient light sensor collects the current ambient light intensity in real time, that is, the current ambient brightness. Ambient light sensors are usually installed on devices and can sense changes in ambient light. The current ambient brightness is obtained in real time to provide accurate input data for subsequent adjustments.

[0136] The first parameter can be the Gamma value, which is a parameter used to describe the relationship between the output brightness of the display device and the input signal strength, reflecting how the device converts the input linear electrical signal into a nonlinear brightness output. The Gamma value is used to correct the brightness output of the display device to match the perceptual characteristics of human vision. The Gamma value affects the color performance of images and videos, ensuring consistent visual effects on different devices. In image processing and video encoding, the Gamma value is used to adjust the contrast and brightness of the image to optimize the visual effect.

[0137] An ideal display device should convert the intensity of the input signal into a linear brightness output. However, the brightness output of an actual display device is usually nonlinear. In order to compensate for the nonlinear characteristics of the display device, the input signal is gamma corrected before transmission, that is, the signal is nonlinearly transformed so that it presents linear brightness on the display device.

[0138] The first parameter corresponding to different ambient brightness is used to optimize the display effect of the image under a specific ambient brightness. According to the current ambient brightness, the corresponding first parameter is searched. By determining the first parameter corresponding to the current ambient brightness, an accurate adjustment parameter can be provided for subsequent pixel value adjustment.

[0139] According to the pixel value of the frame image, the first input value is calculated. The first input value can be the average brightness, maximum brightness or other statistics related to brightness of the frame image. By calculating the first input value, the overall brightness level of the current frame can be understood, providing basic data for subsequent adjustments.

[0140] The first output value is calculated according to the first input value and the first parameter. The calculation method may be a simple linear transformation. By calculating the first output value, the target brightness level of the frame image under the current environment brightness can be determined.

[0141] For example, the first output value=the first input value*the first parameter.

[0142] A first ratio is calculated based on the first input value and the first output value. The first ratio is usually the ratio between the first output value and the first input value, and is used to determine the amplitude of the adjustment. By calculating the first ratio, the amplitude of the frame image brightness that needs to be adjusted can be determined, providing accurate parameters for subsequent pixel value adjustment.

[0143] For example, the first ratio=first output value / first input value.

[0144] According to the calculated first ratio, the pixel value of the frame image is adjusted. The adjustment process is usually to multiply the brightness value of each pixel by the first ratio to achieve the expected target brightness. The adjusted pixel value may also need to be normalized to ensure that the pixel value is within a reasonable range. By adjusting the pixel value, it can be ensured that the frame image can provide the best visual effect under the current ambient brightness, avoid the problem of being too bright or too dark, and improve the viewing experience.

[0145] According to the current ambient brightness, a first parameter corresponding to the current ambient brightness is determined. In this step, according to a preset correspondence between ambient light brightness value and Gamma value, a Gamma value corresponding to the current ambient light brightness value is found as the first parameter.

[0146] In the step of calculating the first input value according to the pixel value of the frame image, reference may be made to formula (1):

[0147] Y_in=a*R+b*G+c*B+d*maxRGB(1)

[0148] Wherein, in formula (1), a, b, c, d are configurable coefficient values, R represents the red channel pixel value, G represents the green channel pixel value, B represents the blue channel pixel value, maxRGB represents the maximum of RGB, and Y_in represents the first input value.

[0149] In the step of calculating the first output value according to the first input value and the first parameter, reference may be made to formula (2):

[0150] Y_out = OOTF(Y_in) (2)

[0151] In formula (2), Y_out represents the first output value, Y_in represents the first input value, and the scope of OOTF is used to perform an N-th power algorithm on Y_in, where the value of N is the first Gamma value.

[0152] In the step of calculating the first ratio according to the first input value and the first output value, reference may be made to formula (3):

[0153] Gain = Y_out / Y_in (3)

[0154] In formula (3), Gain represents the first ratio, Y_out represents the first output value, and Y_in represents the first input value.

[0155] In the step of adjusting the pixel value of the frame image according to the first ratio, reference may be made to formula (4):

[0156]

[0157] In formula (4), Gain represents the first ratio, R_in, G_in, and B_in represent the pixel values ​​used when calculating Y_in, and R_out, G_out, and B_out represent the pixel values ​​obtained after adjustment.

[0158] In this embodiment, the pixel value of the video frame adapts to the ambient light to achieve the goal of adapting the image brightness of the video to the ambient light, so that the display effect of the video can be adaptively adjusted in different viewing environments such as a dark room, indoors, outdoors, etc., so that the display effect of the video can achieve the expected effect without being affected by the environment.

[0159] By obtaining the current ambient brightness in real time and dynamically adjusting the video display effect according to the current ambient brightness, the consistency of the viewing experience is ensured. Through the preset first parameter and dynamic adjustment, the color and brightness performance of the video can be optimized under different ambient brightness to improve the image quality. By obtaining the ambient brightness in real time, calculating the adjustment parameters and dynamically adjusting the pixel value, the pixel value of the video stream is accurately adjusted to ensure that the video can provide the best visual effect under various ambient brightness.

[0160] In a possible embodiment, adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream includes:

[0161] Get the current interface brightness of the frame image;

[0162] Determine a first parameter corresponding to the current interface brightness of the frame image;

[0163] Calculating a second input value according to the pixel value of the frame image;

[0164] Calculate a second output value according to the second input value and the first parameter;

[0165] Calculating a second ratio according to the second input value and the second output value;

[0166] The pixel values ​​of the frame image are adjusted according to the second ratio.

[0167] By analyzing the pixel values ​​of the frame image, the current interface brightness is calculated. The interface brightness can be the average brightness, maximum brightness, or other brightness-related statistics of the frame image. By calculating the current interface brightness, the overall brightness level of the current frame can be understood, providing basic data for subsequent adjustments.

[0168] The first parameter corresponding to different interface brightness is used to optimize the display effect of the image under a specific interface brightness. According to the current interface brightness, the corresponding first parameter is searched. By determining the first parameter corresponding to the current interface brightness, accurate adjustment parameters can be provided for subsequent pixel value adjustment.

[0169] The second input value is calculated based on the pixel value of the frame image. The second input value may be the average brightness, maximum brightness or other brightness-related statistics of the frame image. By calculating the second input value, the overall brightness level of the current frame can be understood, providing basic data for subsequent adjustments.

[0170] The second output value is calculated according to the second input value and the first parameter. The calculation method may be a simple linear transformation, and the target brightness level of the frame image under the current interface brightness can be determined by calculating the second output value.

[0171] For example, the second output value=the second input value*the first parameter.

[0172] The second ratio is calculated according to the second input value and the second output value. The second ratio is usually the ratio between the second output value and the second input value, and is used to determine the amplitude of the adjustment. By calculating the second ratio, the amplitude of the frame image brightness that needs to be adjusted can be determined, providing accurate parameters for subsequent pixel value adjustment.

[0173] For example, the second ratio=second output value / second input value.

[0174] According to the calculated second ratio, the pixel value of the frame image is adjusted. The adjustment process is usually to multiply the brightness value of each pixel by the second ratio to achieve the expected target brightness. The adjusted pixel value may also need to be normalized to ensure that the pixel value is within a reasonable range. By adjusting the pixel value, it can ensure that the frame image can provide the best visual effect under the current interface brightness, avoid the problem of too bright or too dark, and improve the viewing experience.

[0175] In the step of determining the first parameter corresponding to the current interface brightness of the frame image, a gamma value corresponding to the current interface brightness value is found according to a preset correspondence between the interface brightness value and the gamma value as the first parameter.

[0176] In the step of calculating the second input value according to the pixel value of the frame image, refer to formula (1):

[0177] Y_in=a*R+b*G+c*B+d*maxRGB(1)

[0178] Wherein, in formula (1), a, b, c, d are configurable coefficient values, R represents the red channel pixel value, G represents the green channel pixel value, B represents the blue channel pixel value, maxRGB represents the maximum of RGB, and Y_in represents the second input value.

[0179] Involving the step of calculating the second output value according to the second input value and the first parameter. Referring to formula (2):

[0180] Y_out = OOTF(Y_in) (2)

[0181] In formula (2), Y_out represents the second output value, Y_in represents the second input value, and the scope of OOTF is used to perform an N-th power algorithm on Y_in, where the value of N is the second Gamma value.

[0182] Involving the step of calculating a second ratio according to a second input value and a second output value. Referring to formula (3):

[0183] Gain = Y_out / Y_in (3)

[0184] In formula (3), Gain represents the second ratio, Y_out represents the second output value, and Y_in represents the second input value.

[0185] The method involves adjusting the pixel value of the frame image according to the second ratio. Referring to formula (4):

[0186]

[0187] In formula (4), Gain represents the second ratio, R_in, G_in, and B_in represent the pixel values ​​used in calculating Y_in, and R_out, G_out, and B_out represent the pixel values ​​obtained after adjustment.

[0188] In this embodiment, the pixel value of the video frame adapts to the screen interface to achieve the image brightness of the video adapting to the surrounding screen interface content, so that when a border is displayed around the video, the display effect of the video can be adaptively adjusted so that the display effect of the video can achieve the expected effect without being affected by the border.

[0189] In combination with the above two embodiments, the pixel value can be adjusted based on the ambient light brightness value first, and then on this basis, the pixel value can be adjusted based on the interface brightness value; or, the pixel value can be adjusted based on the interface brightness value first, and then on this basis, the pixel value can be adjusted based on the ambient light brightness value.

[0190] Furthermore, before performing these two adjustments, the pixel value is first adjusted according to the current brightness value of the screen.

[0191] By calculating the interface brightness of the frame image, determining the corresponding first parameter, calculating the second input value, the second output value and the second ratio, the brightness of the frame image can be accurately adjusted to ensure the best visual effect at the current interface brightness. The pixel value can be dynamically adjusted according to different interface brightness and frame image brightness to ensure that the video can provide the best visual effect at various interface brightness.

[0192] By accurately calculating and adjusting the interface brightness of the frame image, accurate adjustment of the pixel value of the video stream is achieved, ensuring that the video can provide the best visual effect under various interface brightness.

[0193] In summary, in order to truly restore the original video creator's intention in complex viewing scenarios, the present application can adapt the pixel value of the video when the viewing scene changes, such as changes in screen brightness, changes in ambient light, and changes in the interface content around the video, thereby achieving the purpose of adjusting the brightness of the video image to present the best display effect.

[0194] In an embodiment of the present application, a video stream is obtained, and the video stream includes at least one frame image; according to at least one of a first adjustment strategy and a second adjustment strategy, the pixel value of the frame image is adjusted to obtain an adjusted pixel value; wherein the first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the current screen brightness of the video stream; the second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the first parameter corresponding to the current ambient brightness of the video stream. Thus, under different screen brightness and ambient brightness, the pixel value is dynamically adjusted through tone mapping and parameter adjustment without manual adjustment by the user, so that the video stream can automatically adapt to different viewing environments and equipment conditions, so that the color and brightness of the video stream are more natural and realistic. According to the adjusted pixel value, the adjusted video stream is output to ensure that the video stream can provide the best viewing experience for the user under different screen brightness and ambient brightness.

[0195] The video processing method provided in the embodiment of the present application can be executed by a video processing device. In the embodiment of the present application, the video processing device provided in the embodiment of the present application is described by taking the video processing method executed by the video processing device as an example.

[0196] Figure 3 A block diagram of a video processing device according to an embodiment of the present application is shown, and the device 300 includes:

[0197] An acquisition module 310 is used to acquire a video stream, where the video stream includes at least one frame image;

[0198] An adjustment module 320, configured to adjust the pixel value of the frame image according to at least one of the first adjustment strategy and the second adjustment strategy to obtain an adjusted pixel value;

[0199] An output module 330, configured to output an adjusted video stream according to the adjusted pixel values;

[0200] The first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0201] The second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream.

[0202] In an embodiment of the present application, a video stream is obtained, and the video stream includes at least one frame image; according to at least one of a first adjustment strategy and a second adjustment strategy, the pixel value of the frame image is adjusted to obtain an adjusted pixel value; wherein the first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the current screen brightness of the video stream; the second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the first parameter corresponding to the current ambient brightness of the video stream. Thus, under different screen brightness and ambient brightness, the pixel value is dynamically adjusted through tone mapping and parameter adjustment without manual adjustment by the user, so that the video stream can automatically adapt to different viewing environments and equipment conditions, so that the color and brightness of the video stream are more natural and realistic. According to the adjusted pixel value, the adjusted video stream is output to ensure that the video stream can provide the best viewing experience for the user under different screen brightness and ambient brightness.

[0203] Optionally, the acquisition module 310 is further configured to acquire reference tone mapping information corresponding to each reference screen brightness according to N reference screen brightnesses; wherein N is a positive integer and N>1;

[0204] The acquisition module 310 is further used to acquire the current screen brightness of the video stream when it is detected that the screen brightness corresponding to the video stream changes;

[0205] The device 300 further includes:

[0206] A comparison module, used to compare the current screen brightness with N reference screen brightnesses to obtain a comparison result;

[0207] The adjustment module 320 is further used to adjust the pixel value of the frame image according to the comparison result.

[0208] Optionally, the adjustment module 320 is specifically configured to:

[0209] In the case that the current screen brightness is not equal to any reference screen brightness among the N reference screen brightnesses, determining, among the N reference screen brightnesses, a minimum second reference screen brightness greater than the current screen brightness and a maximum third reference screen brightness less than the current screen brightness;

[0210] Calculating a first weight according to the current screen brightness and the second reference screen brightness; and calculating a second weight according to the current screen brightness and the third reference screen brightness;

[0211] Acquire reference tone mapping information corresponding to the current screen brightness according to the reference tone mapping information corresponding to the second reference screen brightness and the first weight, and the reference tone mapping information corresponding to the third reference screen brightness and the second weight;

[0212] The pixel values ​​of the frame image are adjusted according to the reference tone mapping information corresponding to the current screen brightness.

[0213] Optionally, the adjustment module 320 is specifically configured to:

[0214] When the current screen brightness is equal to the first reference screen brightness among N reference screen brightnesses, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the first reference screen brightness, wherein the first reference screen brightness is any reference screen brightness among the N reference screen brightnesses.

[0215] Optionally, the adjustment module 320 is specifically configured to:

[0216] When the current screen brightness is less than the minimum fourth reference screen brightness, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the fourth reference screen brightness;

[0217] Among them, the N reference screen brightnesses include a fourth reference screen brightness.

[0218] Optionally, the adjustment module 320 is specifically configured to:

[0219] Calculate the brightness of the frame image according to the pixel value of the frame image;

[0220] Determine the screen brightness corresponding to the brightness of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0221] Calculate the brightness ratio according to the screen brightness and the brightness of the frame image;

[0222] The pixel value of the frame image is adjusted according to the brightness ratio and the brightness of the frame image.

[0223] Optionally, the adjustment module 320 is specifically configured to:

[0224] Get the current ambient brightness collected by the ambient light sensor;

[0225] Determine a first parameter corresponding to the current ambient brightness according to the current ambient brightness;

[0226] Calculate a first input value according to the pixel value of the frame image;

[0227] Calculate a first output value according to a first input value and a first parameter;

[0228] Calculating a first ratio according to the first input value and the first output value;

[0229] The pixel values ​​of the frame image are adjusted according to the first ratio.

[0230] Optionally, the adjustment module 320 is specifically configured to:

[0231] Get the current interface brightness of the frame image;

[0232] Determine a first parameter corresponding to the current interface brightness of the frame image;

[0233] Calculating a second input value according to the pixel value of the frame image;

[0234] Calculate a second output value according to the second input value and the first parameter;

[0235] Calculating a second ratio according to the second input value and the second output value;

[0236] The pixel values ​​of the frame image are adjusted according to the second ratio.

[0237] The device in the application embodiment can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the present application embodiment is not specifically limited.

[0238] The device of the embodiment of the present application may be a device having an action system. The action system may be an Android action system, an iOS action system, or other possible action systems, which are not specifically limited in the embodiment of the present application.

[0239] The device provided in the embodiment of the present application can implement each process implemented in the above method embodiment and achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0240] Alternatively, if Figure 4 As shown, an embodiment of the present application also provides an electronic device 100, including a processor 101, a memory 102, and a program or instruction stored in the memory 102 and executable on the processor 101. When the program or instruction is executed by the processor 101, each step of any of the above-mentioned video processing method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0241] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0242] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0243] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, a processor 1010, a camera 1011 and other components.

[0244] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0245] The processor 1010 is used to obtain a video stream, where the video stream includes at least one frame image;

[0246] The processor 1010 is further configured to adjust the pixel value of the frame image according to at least one of the first adjustment strategy and the second adjustment strategy to obtain an adjusted pixel value;

[0247] The processor 1010 is further configured to output an adjusted video stream according to the adjusted pixel value;

[0248] The first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0249] The second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream.

[0250] In an embodiment of the present application, a video stream is obtained, and the video stream includes at least one frame image; according to at least one of a first adjustment strategy and a second adjustment strategy, the pixel value of the frame image is adjusted to obtain an adjusted pixel value; wherein the first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the current screen brightness of the video stream; the second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, the pixel value of the frame image is adjusted according to the first parameter corresponding to the current ambient brightness of the video stream. Thus, under different screen brightness and ambient brightness, the pixel value is dynamically adjusted through tone mapping and parameter adjustment without manual adjustment by the user, so that the video stream can automatically adapt to different viewing environments and equipment conditions, so that the color and brightness of the video stream are more natural and realistic. According to the adjusted pixel value, the adjusted video stream is output to ensure that the video stream can provide the best viewing experience for the user under different screen brightness and ambient brightness.

[0251] Optionally, the processor 1010 is further configured to obtain reference tone mapping information corresponding to each reference screen brightness according to N reference screen brightnesses, wherein N is a positive integer and N>1;

[0252] The processor 1010 is further configured to obtain the current screen brightness of the video stream when detecting that the screen brightness corresponding to the video stream changes;

[0253] The processor 1010 is further configured to compare the current screen brightness with N reference screen brightnesses to obtain a comparison result;

[0254] The processor 1010 is further configured to adjust the pixel value of the frame image according to the comparison result.

[0255] Optionally, the processor 1010 is further configured to determine, in a case where the current screen brightness is not equal to any reference screen brightness among the N reference screen brightnesses, a minimum second reference screen brightness greater than the current screen brightness and a maximum third reference screen brightness less than the current screen brightness among the N reference screen brightnesses;

[0256] The processor 1010 is further configured to calculate a first weight according to the current screen brightness and the second reference screen brightness; and calculate a second weight according to the current screen brightness and the third reference screen brightness;

[0257] The processor 1010 is further configured to obtain reference tone mapping information corresponding to the current screen brightness according to the reference tone mapping information corresponding to the second reference screen brightness and the first weight, and the reference tone mapping information corresponding to the third reference screen brightness and the second weight;

[0258] The processor 1010 is further configured to adjust the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness.

[0259] Optionally, processor 1010 is also used to adjust the pixel value of the frame image according to reference tone mapping information corresponding to the first reference screen brightness when the current screen brightness is equal to the first reference screen brightness among N reference screen brightnesses, wherein the first reference screen brightness is any reference screen brightness among the N reference screen brightnesses.

[0260] Optionally, the processor 1010 is further configured to adjust the pixel value of the frame image according to the reference tone mapping information corresponding to the fourth reference screen brightness when the current screen brightness is less than the minimum fourth reference screen brightness;

[0261] Among them, the N reference screen brightnesses include a fourth reference screen brightness.

[0262] Optionally, the processor 1010 is further configured to calculate the brightness of the frame image according to the pixel values ​​of the frame image;

[0263] The processor 1010 is further configured to determine the screen brightness corresponding to the brightness of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream;

[0264] The processor 1010 is further configured to calculate a brightness ratio according to the screen brightness and the brightness of the frame image;

[0265] The processor 1010 is further configured to adjust the pixel value of the frame image according to the brightness ratio and the brightness of the frame image.

[0266] Optionally, the processor 1010 is further configured to obtain the current ambient brightness collected by the ambient light sensor;

[0267] The processor 1010 is further configured to determine a first parameter corresponding to the current ambient brightness according to the current ambient brightness;

[0268] The processor 1010 is further configured to calculate a first input value according to a pixel value of the frame image;

[0269] The processor 1010 is further configured to calculate a first output value according to the first input value and the first parameter;

[0270] The processor 1010 is further configured to calculate a first ratio according to the first input value and the first output value;

[0271] The processor 1010 is further configured to adjust the pixel value of the frame image according to the first ratio.

[0272] Optionally, the processor 1010 is further configured to obtain a current interface brightness of the frame image;

[0273] The processor 1010 is further configured to determine a first parameter corresponding to the current interface brightness of the frame image;

[0274] The processor 1010 is further configured to calculate a second input value according to the pixel value of the frame image;

[0275] The processor 1010 is further configured to calculate a second output value according to the second input value and the first parameter;

[0276] The processor 1010 is further configured to calculate a second ratio according to the second input value and the second output value;

[0277] The processor 1010 is further configured to adjust the pixel value of the frame image according to the second ratio.

[0278] In summary, in order to truly restore the original video creator's intention in complex viewing scenarios, the present application can adapt the pixel value of the video when the viewing scene changes, such as changes in screen brightness, changes in ambient light, and changes in the interface content around the video, thereby achieving the purpose of adjusting the brightness of the video image to present the best display effect.

[0279] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video image obtained by the image capture device (such as a camera) in the video image capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and an action rod, which will not be repeated here. The memory 1009 can be used to store software programs and various data, including but not limited to applications and action systems. The processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly processes the action system, user pages and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1010.

[0280] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0281] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.

[0282] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned video processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0283] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0284] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned video processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0285] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0286] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned video processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0287] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0288] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0289] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A video processing method, characterized in that: The method comprises: Acquire a video stream, wherein the video stream includes at least one frame image; According to at least one of the first adjustment strategy and the second adjustment strategy, the pixel value of the frame image is adjusted to obtain an adjusted pixel value; Outputting an adjusted video stream according to the adjusted pixel value; The first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream; The second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to a first parameter corresponding to the current ambient brightness of the video stream.

2. The method according to claim 1, characterized in that When it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream includes: According to N reference screen brightnesses, obtaining reference tone mapping information corresponding to each of the reference screen brightnesses; wherein N is a positive integer and N>1; When it is detected that the screen brightness corresponding to the video stream changes, obtaining the current screen brightness of the video stream; Compare the current screen brightness with the N reference screen brightnesses to obtain a comparison result; The pixel value of the frame image is adjusted according to the comparison result.

3. The method according to claim 2, characterized in that The step of adjusting the pixel value of the frame image according to the comparison result includes: In the case that the current screen brightness is not equal to any reference screen brightness among the N reference screen brightnesses, determining, among the N reference screen brightnesses, a minimum second reference screen brightness greater than the current screen brightness and a maximum third reference screen brightness less than the current screen brightness; Calculating a first weight according to the current screen brightness and the second reference screen brightness; and calculating a second weight according to the current screen brightness and the third reference screen brightness; Acquire reference tone mapping information corresponding to the current screen brightness according to the reference tone mapping information corresponding to the second reference screen brightness and the first weight, and the reference tone mapping information corresponding to the third reference screen brightness and the second weight; The pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the current screen brightness.

4. The method according to claim 2, characterized in that: The step of adjusting the pixel value of the frame image according to the comparison result includes: When the current screen brightness is equal to the first reference screen brightness among the N reference screen brightnesses, the pixel value of the frame image is adjusted according to the reference tone mapping information corresponding to the first reference screen brightness, wherein the first reference screen brightness is any reference screen brightness among the N reference screen brightnesses.

5. The method according to claim 2, characterized in that: The step of adjusting the pixel value of the frame image according to the comparison result includes: When the current screen brightness is less than the minimum fourth reference screen brightness, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the fourth reference screen brightness; Wherein, the N reference screen brightnesses include the fourth reference screen brightness.

6. The method according to claim 2, characterized in that When detecting that the screen brightness corresponding to the video stream changes, obtaining the current screen brightness of the video stream includes: Calculating the brightness of the frame image according to the pixel values ​​of the frame image; Determining the screen brightness corresponding to the brightness of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream; The step of adjusting the pixel value of the frame image according to the comparison result includes: Calculating a brightness ratio according to the screen brightness and the brightness of the frame image; The pixel value of the frame image is adjusted according to the brightness ratio and the brightness of the frame image.

7. The video processing method according to claim 1, characterized in that: The step of adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream includes: Get the current ambient brightness collected by the ambient light sensor; Determine, according to the current ambient brightness, a first parameter corresponding to the current ambient brightness; Calculating a first input value according to the pixel value of the frame image; Calculate a first output value according to the first input value and the first parameter; Calculating a first ratio according to the first input value and the first output value; The pixel value of the frame image is adjusted according to the first ratio.

8. The video processing method according to claim 1, characterized in that: The step of adjusting the pixel value of the frame image according to the first parameter corresponding to the current ambient brightness of the video stream includes: Obtaining the current interface brightness of the frame image; Determine a first parameter corresponding to the current interface brightness of the frame image; Calculating a second input value according to the pixel value of the frame image; Calculating a second output value according to the second input value and the first parameter; Calculating a second ratio according to the second input value and the second output value; The pixel value of the frame image is adjusted according to the second ratio.

9. A video processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a video stream, wherein the video stream includes at least one frame image; An adjustment module, configured to adjust the pixel value of the frame image according to at least one of the first adjustment strategy and the second adjustment strategy to obtain an adjusted pixel value; An output module, used for outputting an adjusted video stream according to the adjusted pixel value; The first adjustment strategy includes: when it is detected that the screen brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to the reference tone mapping information corresponding to the current screen brightness of the video stream; The second adjustment strategy includes: when it is detected that the ambient brightness corresponding to the video stream changes, adjusting the pixel value of the frame image according to a first parameter corresponding to the current ambient brightness of the video stream.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the video processing method according to any one of claims 1 to 8 are implemented.

11. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the video processing method according to any one of claims 1 to 8 are implemented.