CN114697597A - Frame rate switching control method and device, terminal equipment and readable storage medium - Google Patents

Frame rate switching control method and device, terminal equipment and readable storage medium Download PDF

Info

Publication number
CN114697597A
CN114697597A CN202011604787.4A CN202011604787A CN114697597A CN 114697597 A CN114697597 A CN 114697597A CN 202011604787 A CN202011604787 A CN 202011604787A CN 114697597 A CN114697597 A CN 114697597A
Authority
CN
China
Prior art keywords
sampling
frame rate
rate switching
image
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011604787.4A
Other languages
Chinese (zh)
Inventor
黄南燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oneplus Technology Shenzhen Co Ltd
Original Assignee
Oneplus Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oneplus Technology Shenzhen Co Ltd filed Critical Oneplus Technology Shenzhen Co Ltd
Priority to CN202011604787.4A priority Critical patent/CN114697597A/en
Priority to PCT/CN2021/128955 priority patent/WO2022142732A1/en
Publication of CN114697597A publication Critical patent/CN114697597A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
    • H04N7/0127Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level by changing the field or frame frequency of the incoming video signal, e.g. frame rate converter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/14Picture signal circuitry for video frequency region
    • H04N5/20Circuitry for controlling amplitude response
    • H04N5/202Gamma control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/01Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Control Of Indicators Other Than Cathode Ray Tubes (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

本申请实施例提供一种帧率切换控制方法、装置、终端设备和可读存储介质,该帧率切换控制方法,包括:响应帧率切换指令,获取终端设备当前显示的图像;按照预设采样规则对所述图像进行像素采样并计算采样像素的灰阶;当该图像的采样像素的灰阶判断满足预设帧率切换条件时,控制进行帧率切换。本申请的技术方案通过截图及像素采样来计算当前显示图像的灰阶,并将计算得到的灰阶作为帧率切换的判定条件,不仅有效地解决了帧率切换时出现的闪烁问题,还可对图像灰阶计算时的精度与耗时达到较好的平衡等。

Figure 202011604787

Embodiments of the present application provide a frame rate switching control method, apparatus, terminal device, and readable storage medium. The frame rate switching control method includes: responding to a frame rate switching instruction, acquiring an image currently displayed by the terminal device; sampling according to a preset The rule performs pixel sampling on the image and calculates the gray scale of the sampled pixels; when the gray scale judgment of the sampled pixels of the image satisfies the preset frame rate switching condition, the frame rate switching is controlled. The technical solution of the present application calculates the gray level of the currently displayed image through screenshots and pixel sampling, and uses the calculated gray level as the judgment condition for frame rate switching, which not only effectively solves the flickering problem during frame rate switching, but also It achieves a good balance between the accuracy and time-consuming of image grayscale calculation.

Figure 202011604787

Description

帧率切换控制方法、装置、终端设备和可读存储介质Frame rate switching control method, apparatus, terminal device and readable storage medium

技术领域technical field

本申请涉及图像处理技术领域,尤其涉及一种帧率切换控制方法、装置、终端设备和可读存储介质。The present application relates to the technical field of image processing, and in particular, to a frame rate switching control method, apparatus, terminal device and readable storage medium.

背景技术Background technique

随着手机、平板等终端的显示帧率的可切换范围越来越大,对于采用如OLED(OrganicLight-Emitting Diode,有机发光二极管)等显示屏的终端,在进行不同的屏幕帧率切换时,容易出现屏幕闪烁的问题,从而降低了用户体验等。As the switchable range of display frame rates of terminals such as mobile phones and tablets becomes larger and larger, for terminals using displays such as OLED (Organic Light-Emitting Diode), when switching between different screen frame rates, It is prone to the problem of screen flickering, which reduces the user experience, etc.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请的目的是为了克服现有技术中的不足,提供一种帧率切换控制方法、装置、终端设备和可读存储介质。In view of this, the purpose of the present application is to provide a frame rate switching control method, apparatus, terminal device and readable storage medium in order to overcome the deficiencies in the prior art.

本申请的实施例提供一种帧率切换控制方法,包括:Embodiments of the present application provide a frame rate switching control method, including:

响应帧率切换指令,获取终端设备当前显示的图像;In response to the frame rate switching command, obtain the image currently displayed by the terminal device;

按照预设采样规则对所述图像进行像素采样并计算采样像素的灰阶;Perform pixel sampling on the image according to the preset sampling rule and calculate the gray scale of the sampled pixels;

当所述图像的采样像素的灰阶满足预设帧率切换条件时,控制进行帧率切换。When the gray scale of the sampling pixels of the image satisfies the preset frame rate switching condition, the frame rate switching is controlled.

在一种实施例中,所述获取终端设备当前显示的图像,包括:In an embodiment, the acquiring an image currently displayed by the terminal device includes:

调用系统截屏服务接口对所述终端设备当前显示的内容进行屏幕截图。The system screenshot service interface is invoked to take a screenshot of the content currently displayed by the terminal device.

在一种实施例中,所述预设采样规则包括预先设置的采样步长和采样矩阵大小,其中,所述采样步长包括第一方向采样步长和第二方向采样步长,所述按照预设采样规则对所述图像进行像素采样并计算采样像素的灰阶,包括:In an embodiment, the preset sampling rule includes a preset sampling step and a sampling matrix size, wherein the sampling step includes a first-direction sampling step and a second-direction sampling step, and the sampling step according to The preset sampling rule performs pixel sampling on the image and calculates the grayscale of the sampled pixels, including:

根据预设选取规则在所述图像中选取像素采样的起始点;Select the starting point of pixel sampling in the image according to a preset selection rule;

从所述起始点开始,按照预设采样路线以所述采样矩阵大小进行间隔采样,其中,所述采样矩阵在所述图像的第一方向上按照所述第一方向采样步长进行采样,及在所述图像的第二方向上按照所述第二方向采样步长进行采样;Starting from the starting point, interval sampling is performed according to a preset sampling route with the size of the sampling matrix, wherein the sampling matrix is sampled according to the first direction sampling step in the first direction of the image, and sampling according to the second direction sampling step in the second direction of the image;

根据像素灰阶转换算法计算每个所述采样矩阵中每个采样像素的灰阶。The grayscale of each sampled pixel in each of the sampling matrices is calculated according to a pixel grayscale conversion algorithm.

在一种实施例中,所述根据所述图像的采样像素的灰阶判断是否满足预设帧率切换条件,包括:In an embodiment, the judging whether a preset frame rate switching condition is met according to the grayscale of the sampled pixels of the image includes:

统计所有采样矩阵中像素的灰阶低于预设灰阶阈值的像素个数;Count the number of pixels whose grayscales in all sampling matrices are lower than the preset grayscale threshold;

判断所述像素个数与所述采样像素总数的比值是否高于预设占比阈值;Determine whether the ratio of the number of pixels to the total number of sampled pixels is higher than a preset proportion threshold;

若高于,则判断不满足预设帧率切换条件,否则判断满足预设帧率切换条件。If it is higher, it is judged that the preset frame rate switching condition is not met, otherwise it is judged that the preset frame rate switching condition is met.

在一种实施例中,所述采样矩阵按照蛇型路线、逐行或逐列路线进行采样。In one embodiment, the sampling matrix is sampled in a serpentine route, row-by-row or column-by-column route.

在一种实施例中,每一所述采样步长大于所述采样矩阵的宽和高,所述第一方向采样步长和所述第二方向采样步长分别选取为所述终端设备的第一方向像素总数和第二方向像素总数的3%~10%。In an embodiment, each of the sampling steps is greater than the width and height of the sampling matrix, and the sampling step in the first direction and the sampling step in the second direction are respectively selected as the first sampling step of the terminal device. 3% to 10% of the total number of pixels in one direction and the total number of pixels in the second direction.

在一种实施例中,所述采样矩阵的宽和高各自的取值范围为3~10个像素。In an embodiment, the respective value ranges of the width and height of the sampling matrix are 3 to 10 pixels.

在一种实施例中,在所述图像中选取像素采样的起始点时,所述预设选取规则包括:In one embodiment, when selecting the starting point of pixel sampling in the image, the preset selection rule includes:

根据所述图像中状态栏的像素高度确定所述起始点在沿所述状态栏的高度方向上的坐标位置,所述坐标位置的取值大于或等于所述状态栏的像素高度。The coordinate position of the starting point along the height direction of the status bar is determined according to the pixel height of the status bar in the image, and the value of the coordinate position is greater than or equal to the pixel height of the status bar.

在一种实施例中,所述像素灰阶转换算法为单色分量算法、平均值算法、移位算法、整形取值算法、浮点取值算法或Gamma校准算法。In an embodiment, the pixel grayscale conversion algorithm is a monochromatic component algorithm, an average value algorithm, a shift algorithm, an integer value algorithm, a floating point value algorithm, or a Gamma calibration algorithm.

优选地,像素灰阶转换算法采用Gamma校准算法。其中,所述Gamma校准算法为:Preferably, the pixel grayscale conversion algorithm adopts a Gamma calibration algorithm. Wherein, the Gamma calibration algorithm is:

Figure BDA0002871645650000031
Figure BDA0002871645650000031

其中,R、G和B依次为单个采样像素的红色、绿色和蓝色分量;g为预设校准值;Gray为该采样像素的灰阶。Wherein, R, G and B are the red, green and blue components of a single sampling pixel in turn; g is a preset calibration value; Gray is the gray scale of the sampling pixel.

本申请的实施例还提供一种帧率切换控制装置,包括:Embodiments of the present application also provide a frame rate switching control device, including:

获取模块,用于响应帧率切换指令,获取终端设备当前显示的图像;The acquisition module is used to respond to the frame rate switching instruction and acquire the image currently displayed by the terminal device;

灰阶计算模块,用于按照预设采样规则对所述图像进行像素采样并计算采样像素的灰阶;a grayscale calculation module, configured to perform pixel sampling on the image according to a preset sampling rule and calculate the grayscale of the sampled pixels;

判断模块,用于根据所述图像的采样像素的灰阶判断是否满足预设帧率切换条件;a judgment module for judging whether a preset frame rate switching condition is met according to the grayscale of the sampled pixels of the image;

控制模块,用于当所述图像的采样像素的灰阶满足所述预设帧率切换条件时,控制进行帧率切换。The control module is configured to control the frame rate switching when the gray scale of the sampling pixels of the image satisfies the preset frame rate switching condition.

本申请的实施例还提供一种终端设备,所述终端设备包括显示屏、处理器和存储器,所述显示屏用于显示图像,所述存储器存储有计算机程序,所述处理器用于执行所述计算机程序以实施上述的帧率切换控制方法。An embodiment of the present application further provides a terminal device, the terminal device includes a display screen, a processor and a memory, the display screen is used for displaying an image, the memory stores a computer program, and the processor is used for executing the A computer program to implement the frame rate switching control method described above.

本申请的实施例还提供一种可读存储介质,其存储有计算机程序,所述计算机程序被执行时,实施上述的帧率切换控制方法。Embodiments of the present application further provide a readable storage medium, which stores a computer program, and when the computer program is executed, implements the above frame rate switching control method.

本申请的实施例具有如下有益效果:The embodiments of the present application have the following beneficial effects:

本申请实施例的帧率切换控制方法通过系统截图来获取当前显示的内容并利用预设的像素采样规则来计算得到当前图像的灰阶,然后将计算得到的灰阶作为帧率切换的判定条件,可有效地解决帧率切换时出现的闪烁问题,同时,还可在计算图像灰阶时达到精度与耗时之间的较好平衡,从而提高了用户体验等。The frame rate switching control method of the embodiment of the present application acquires the currently displayed content by taking a screenshot of the system, uses a preset pixel sampling rule to calculate the gray scale of the current image, and then uses the calculated gray scale as a judgment condition for frame rate switching , which can effectively solve the problem of flickering when the frame rate is switched, and at the same time, it can also achieve a better balance between accuracy and time-consuming when calculating the grayscale of the image, thereby improving the user experience.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following drawings will briefly introduce the drawings that need to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore do not It should be regarded as a limitation of the scope, and for those of ordinary skill in the art, other related drawings can also be obtained according to these drawings without any creative effort.

图1示出了本申请实施例提供的终端的结构示意图;FIG. 1 shows a schematic structural diagram of a terminal provided by an embodiment of the present application;

图2示出了本申请实施例帧率切换控制方法的第一流程示意图;FIG. 2 shows a first schematic flowchart of a frame rate switching control method according to an embodiment of the present application;

图3示出了本申请实施例帧率切换控制方法的一种像素采样示意图;FIG. 3 shows a schematic diagram of pixel sampling of a frame rate switching control method according to an embodiment of the present application;

图4示出了本申请实施例帧率切换控制方法的第二流程示意图;FIG. 4 shows a second schematic flowchart of a frame rate switching control method according to an embodiment of the present application;

图5示出了本申请实施例帧率切换控制方法的起始点选取应用示意图;5 shows a schematic diagram of an application of starting point selection of a frame rate switching control method according to an embodiment of the present application;

图6a、图6b和图6c示出了本申请实施例帧率切换控制方法的几种采样路线示意图;6a, 6b and 6c show schematic diagrams of several sampling routes of the frame rate switching control method according to the embodiment of the present application;

图7示出了本申请实施例帧率切换控制方法的第三流程示意图;FIG. 7 shows a third schematic flowchart of a frame rate switching control method according to an embodiment of the present application;

图8示出了本申请实施例帧率切换控制装置的结构示意图。FIG. 8 shows a schematic structural diagram of a frame rate switching control apparatus according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments.

通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Thus, the following detailed description of the embodiments of the application provided in the accompanying drawings is not intended to limit the scope of the application as claimed, but is merely representative of selected embodiments of the application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

下述各实施例均可应用于如图1所示的终端设备中,如手机、平板等。图1示出了一种手机终端的结构框图,该手机100包括:RF(Radio Frequency,射频)电路110、存储器120、输入单元130、显示单元140、拍摄单元150、音频电路160、WiFi(wireless fidelity,无线保真)模块170、处理器180、以及电源190等部件。其中,RF电路110可用于接收和发送无线信号等;存储器120可用于存储该手机100运行所需的应用程序及用户的相关文件信息等。输入单元130可包括按键、触摸面板,也可以包括其他输入设备等,以用于接收来自用户输入的信息等;显示单元140主要包括显示屏,可用于显示图像、文字等信息;拍摄单元150主要包括前后置摄像头等,主要用于拍摄图片、视频等;音频电路160连接听筒、扬声器等声音输出设备以及麦克风等声音输入设备,可用于录入或播放语音等;WiFi模块170可用于收发wifi信号以实现信息传输等。处理器180作为手机100的控制中心,主要用于使其他各单元或模块执行相应功能等;而电源190主要包括电池设备,用于为手机100中的各模块或单元提供所需的工作电压等。Each of the following embodiments can be applied to the terminal device shown in FIG. 1 , such as a mobile phone, a tablet, and the like. FIG. 1 shows a structural block diagram of a mobile phone terminal. The mobile phone 100 includes: an RF (Radio Frequency, radio frequency) circuit 110, a memory 120, an input unit 130, a display unit 140, a photographing unit 150, an audio circuit 160, a WiFi (wireless) fidelity, wireless fidelity) module 170, processor 180, and power supply 190 and other components. The RF circuit 110 can be used to receive and send wireless signals, etc.; the memory 120 can be used to store application programs required for the operation of the mobile phone 100 and relevant file information of the user. The input unit 130 may include buttons, touch panels, and other input devices, etc., for receiving information input from the user, etc.; the display unit 140 mainly includes a display screen, which may be used to display information such as images and texts; the photographing unit 150 mainly includes Including front and rear cameras, etc., mainly used for taking pictures, videos, etc.; the audio circuit 160 is connected to sound output devices such as earpieces, speakers, and sound input devices such as microphones, which can be used for recording or playing voice, etc.; WiFi module 170 can be used to send and receive WiFi signals to Realize information transmission, etc. As the control center of the mobile phone 100, the processor 180 is mainly used to make other units or modules perform corresponding functions, etc.; and the power supply 190 mainly includes a battery device, which is used to provide the required working voltage for each module or unit in the mobile phone 100, etc. .

本领域技术人员可以理解,图1中示出的手机100结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。下面以一终端设备为例说明本申请的技术方案,其中,该终端设备并不限于应用于手机,也可以应用于平板、笔记本电脑等。下面以具体的实施例介绍本申请,当然,本申请并不限于这些具体的实施例。Those skilled in the art can understand that the structure of the mobile phone 100 shown in FIG. 1 does not constitute a limitation on the mobile phone, and may include more or less components than the one shown, or combine some components, or arrange different components. The technical solution of the present application is described below by taking a terminal device as an example, wherein the terminal device is not limited to be applied to a mobile phone, but can also be applied to a tablet, a notebook computer, and the like. The present application will be described below with specific embodiments. Of course, the present application is not limited to these specific embodiments.

本申请的终端设备包括显示屏等,例如,可采用OLED显示屏等,其中,OLED按照驱动方式又可分为有源的AMOLED(Active matrix OLED,)和无源的PMOLED(Passive matrixOLED)等。随着终端设备所支持的屏幕显示帧率越来越高,为了提供给用户更好地观看体验,可允许用户进行显示帧率的手动切换。然而,对于通过TFT驱动电路驱动的OLED等显示屏,在切换帧率时,容易导致出现屏幕闪烁的问题,大大降低了用户体验。The terminal device of the present application includes a display screen and the like, for example, an OLED display screen and the like can be used, wherein the OLED can be further divided into active AMOLED (Active matrix OLED) and passive PMOLED (Passive matrix OLED) according to the driving method. As the screen display frame rate supported by the terminal device becomes higher and higher, in order to provide the user with a better viewing experience, the user may be allowed to manually switch the display frame rate. However, for display screens such as OLEDs driven by TFT drive circuits, when switching frame rates, it is easy to cause screen flickering, which greatly reduces user experience.

对此,发明人研究发现,若当前屏幕显示的内容的灰阶(也称灰度值)低于一定的阈值,会因为两种不同帧率下的Gamma值不同而显现一定程度的屏幕色差,进而发生屏幕闪烁。其中,该Gamma指显示器的伽马(Gamma)参数,是反应颜色在不同灰度下由亮度数据汇总得到的一条曲线,也称为Gamma曲线。因此,本申请提出一种帧率切换控制方法,即基于显示内容的灰阶来决定是否切换帧率,从而有效避免出现屏幕闪烁,不仅如此,在计算显示内容的灰阶时,还同时考虑显示图像的灰阶计算时长及准确性等,可实现高效快速且准确的计算,提升了处理效率,减少了用户等待时间等。下面结合具体的实施例来说明本申请的帧率切换控制方法。In this regard, the inventor found that if the grayscale (also called grayscale value) of the content currently displayed on the screen is lower than a certain threshold, a certain degree of screen color difference will appear due to the different Gamma values at two different frame rates. In turn, screen flickering occurs. The Gamma refers to a gamma (Gamma) parameter of the display, which is a curve obtained by summarizing luminance data in response to colors under different grayscales, and is also called a Gamma curve. Therefore, the present application proposes a frame rate switching control method, which determines whether to switch the frame rate based on the grayscale of the display content, so as to effectively avoid screen flickering. The grayscale calculation time and accuracy of the image can achieve efficient, fast and accurate calculation, improve processing efficiency, and reduce user waiting time. The frame rate switching control method of the present application is described below with reference to specific embodiments.

实施例1Example 1

请参照图2,本申请实施例提出一种帧率切换控制方法,可应用于各种具有显示屏幕的终端设备,如手机、平板、电脑等。下面对该帧率切换控制方法进行详细说明。Referring to FIG. 2 , an embodiment of the present application proposes a frame rate switching control method, which can be applied to various terminal devices with display screens, such as mobile phones, tablets, and computers. The frame rate switching control method will be described in detail below.

步骤S10,响应帧率切换指令,获取终端设备当前显示的图像。Step S10, in response to the frame rate switching instruction, acquire the image currently displayed by the terminal device.

例如,当终端设备接收到用户输入的帧率切换指令时,终端设备获取屏幕当前显示的图像,进而根据显示内容的图像灰阶来判断当前是否响应帧率切换。或者,该帧率切换指令也可以是由终端设备自身触发的,例如,当检测到待显示一些预设画面时,而这些预设画面通常预先设置有指定帧率。若需进行切换显示该特定画面的内容时,终端设备可自动触发帧率切换指令等,以实现最佳观看效果等。For example, when the terminal device receives the frame rate switching instruction input by the user, the terminal device obtains the image currently displayed on the screen, and then judges whether the frame rate switching is currently responding according to the image grayscale of the displayed content. Alternatively, the frame rate switching instruction may also be triggered by the terminal device itself, for example, when it is detected that some preset images are to be displayed, and these preset images are usually preset with a specified frame rate. When it is necessary to switch and display the content of the specific screen, the terminal device can automatically trigger frame rate switching instructions, etc., to achieve the best viewing effect.

在一种实施方式中,该终端设备将通过调用系统截屏服务接口对当前显示的内容进行屏幕截图,从而得到截屏图像。例如,以安卓系统的终端为例,可通过调用SurfaceFlinger的相关截屏服务API接口,如CaptureScreenCommon等进行截屏,从而直接获取到当前屏幕的显示图像。通常地,该显示图像是由三基色构成的RGB图像,通过系统原生接口截图得到的图像可直接获取到该RGB图像中各像素的R、G和B分量。In an implementation manner, the terminal device will take a screenshot of the currently displayed content by invoking a system screenshot service interface, thereby obtaining a screenshot image. For example, taking the terminal of the Android system as an example, you can directly obtain the display image of the current screen by calling the relevant screenshot service API interface of SurfaceFlinger, such as CaptureScreenCommon, etc. to take screenshots. Generally, the display image is an RGB image composed of three primary colors, and the R, G, and B components of each pixel in the RGB image can be directly obtained from the image captured by the native interface of the system.

在获取到图像后,将计算该图像的像素灰阶,以便判断是否切换帧率。After the image is acquired, the pixel grayscale of the image will be calculated to determine whether to switch the frame rate.

步骤S20,按照预设采样规则对该图像进行像素采样并计算采样像素的灰阶。Step S20: Perform pixel sampling on the image according to a preset sampling rule and calculate the gray scale of the sampled pixels.

通常地,计算图像灰阶的方法有很多,例如,常用的灰阶平均值计算方法等,所谓的平均值方法即计算图像各个像素的灰阶后,再求整个图像的灰阶平均值。然而,发明人发现这一计算方法存在计算不准确的问题,例如,当图像分成两个色块时,其中一块亮度虽然低,但灰度值大,若进行平均计算后,会将整体的灰阶拉高,若此时进行切换,则极可能产生闪烁问题。另一方面,随着显示屏幕越来越大,而设备的分辨率也越来越高,如手机等,目前主流的分辨率都在1080P及以上,其像素点也越来越多,相应地,像素灰阶计算也越来越耗时。为此,为了兼容图像灰阶的计算精度及计算速度等,本申请实施例提出了对图像进行像素采样,并以采样得到的像素来计算该图像的灰阶,从而高效、快速地计算得到更加准确的图像灰阶。Generally, there are many methods for calculating the gray level of an image, such as the commonly used gray level average calculation method. However, the inventor found that this calculation method has the problem of inaccurate calculation. For example, when the image is divided into two color blocks, although one block has low brightness, its gray value is large. The step is pulled high, and if the switch is performed at this time, it is very likely to cause a flickering problem. On the other hand, as the display screen becomes larger and larger, and the resolution of the device becomes higher and higher, such as mobile phones, the current mainstream resolution is 1080P and above, and its pixel points are also increasing, correspondingly , the pixel grayscale calculation is also more and more time-consuming. For this reason, in order to be compatible with the calculation accuracy and calculation speed of the gray scale of the image, the embodiment of the present application proposes to perform pixel sampling on the image, and use the sampled pixels to calculate the gray scale of the image, so as to obtain more efficient and fast calculation results. Accurate image grayscale.

在一种实施方式中,该预设采样规则可包括,基于像素矩阵的形式进行间隔采样等,例如,可通过预先设置一矩阵大小,并以该设定的矩阵大小在该图像中进行间隔式移动采样,如图3所示,从而获取到该图像中各个区域的多个像素矩阵。In one embodiment, the preset sampling rule may include interval sampling based on the form of a pixel matrix. For example, a matrix size may be preset, and interval sampling may be performed in the image with the set matrix size. Move the sampling, as shown in Figure 3, to obtain multiple pixel matrices of each area in the image.

其中,间隔移动时的采样步长可以根据实际的屏幕宽度等来预先设置等。通常地,在间隔式采样时,该采样步长通常大于像素矩阵的宽和高,这样在移动采样时,可以避免出现像素的重复采样等。可以理解,对于该矩阵的宽和高,可根据实际需求来设定,例如,若该矩阵的长宽相同,则为采用方阵形式进行采样等。此外,也可以基于其他的指定图形的形式进行采样等,在此并不作限定。Wherein, the sampling step size during the interval movement may be preset according to the actual screen width and the like. Generally, in the case of interval sampling, the sampling step size is usually larger than the width and height of the pixel matrix, so that repeated sampling of pixels can be avoided when sampling is shifted. It can be understood that the width and height of the matrix can be set according to actual requirements. For example, if the length and width of the matrix are the same, sampling is performed in the form of a square matrix. In addition, it is also possible to perform sampling or the like based on the format of other designated patterns, which is not limited here.

进而,对采样得到的像素矩阵基于像素灰阶转换公式进行灰阶计算。示范性地,该像素灰阶转换公式可包括但不限于为,单色分量算法、平均值算法、移位算法、整形取值算法、浮点取值算法或Gamma校准算法等。其中,单色分量算法可为选取RGB图像中的蓝色分量进行计算。Furthermore, grayscale calculation is performed on the pixel matrix obtained by sampling based on the pixel grayscale conversion formula. Exemplarily, the pixel grayscale conversion formula may include, but is not limited to, a monochromatic component algorithm, an average value algorithm, a shift algorithm, an integer value algorithm, a floating point value algorithm, a Gamma calibration algorithm, and the like. Wherein, the monochromatic component algorithm may select the blue component in the RGB image for calculation.

步骤S30,根据该图像的采样像素的灰阶判断是否满足预设帧率切换条件。In step S30, it is determined whether the preset frame rate switching condition is satisfied according to the gray scale of the sampling pixels of the image.

例如,在一种实施方式中,该预设帧率切换条件可包括,超过预设灰阶阈值的像素个数在所有采样像素中的占比低于预设占比阈值等。其中,该预设灰阶阈值及预设占比阈值均可根据实际的测试结果来选取,例如,该预设占比阈值可设为整个采样像素总数的50%~55%等。For example, in one embodiment, the preset frame rate switching condition may include that the proportion of the number of pixels exceeding the preset grayscale threshold in all sampled pixels is lower than the preset proportion threshold, or the like. The preset grayscale threshold and the preset proportion threshold can be selected according to actual test results. For example, the preset proportion threshold can be set as 50% to 55% of the total number of sampling pixels.

对于这些采样到的像素矩阵,本实施例通过对这些像素矩阵中的符合特定灰阶条件的像素的个数进行统计,若统计的灰阶结果满足预设帧率切换条件,则进行帧率切换,否则不允许进行切换。可以理解,考虑到采用平均值计算方式可能会存在拉升了整体灰阶计算结果的问题,而通过利用上述的统计结果来估计该图像中整体像素的灰阶情况,这样可以保证计算得到的结果更符合人眼所观察到的显示结果,从而提高了灰阶计算精度等。For these sampled pixel matrices, this embodiment counts the number of pixels in these pixel matrices that meet specific gray-scale conditions, and if the statistical gray-scale results meet the preset frame rate switching conditions, the frame rate switching is performed , otherwise switching is not allowed. It can be understood that considering that the average calculation method may increase the overall grayscale calculation result, and by using the above statistical results to estimate the grayscale of the overall pixels in the image, the calculated results can be guaranteed. It is more in line with the display results observed by the human eye, thereby improving the grayscale calculation accuracy and so on.

步骤S40,若该图像的采样像素的灰阶满足预设帧率切换条件,则进行帧率切换。Step S40, if the gray scale of the sampling pixels of the image satisfies the preset frame rate switching condition, then perform frame rate switching.

若满足,则执行帧率切换操作。示范性地,终端设备可根据帧率切换指令得到目标帧率,并在判断出满足预设帧率切换条件时,控制将当前帧率切换到目标帧率。If it is satisfied, the frame rate switching operation is performed. Exemplarily, the terminal device may obtain the target frame rate according to the frame rate switching instruction, and control to switch the current frame rate to the target frame rate when it is determined that the preset frame rate switching condition is satisfied.

进一步可选地,若该图像的采样像素的灰阶不满足预设帧率切换条件,则不进行帧率切换。示范性地,在判断出不满足预设帧率切换条件时,则维持当前的帧率。可选地,终端设备将进行延迟切换,例如,可实时获取后续的图像帧,并在判断出显示的某帧图像满足了该预设帧率切换条件,则立即进行帧率切换。Further optionally, if the grayscale of the sampled pixels of the image does not meet the preset frame rate switching condition, the frame rate switching is not performed. Exemplarily, when it is determined that the preset frame rate switching condition is not met, the current frame rate is maintained. Optionally, the terminal device will perform delayed switching. For example, subsequent image frames may be acquired in real time, and the frame rate switching will be performed immediately when it is determined that a certain frame of displayed image satisfies the preset frame rate switching condition.

可以理解,本申请实施例的帧率切换控制方法在进行帧率切换前,通过对当前显示的图像灰阶进行像素采样,进而将获取到的这些采样像素作为灰阶计算基础来计算该图像的灰阶信息,通过统计像素灰阶满足预设灰阶条件的像素个数占比来判断是否满足切换条件,不仅可以提高图像灰阶计算的效率,还可以保证较高的灰阶计算精度等。It can be understood that, before performing frame rate switching, the frame rate switching control method according to the embodiment of the present application performs pixel sampling on the grayscale of the currently displayed image, and then uses the obtained sampled pixels as the grayscale calculation basis to calculate the value of the image. Grayscale information, by counting the proportion of pixels whose grayscale meets the preset grayscale condition to determine whether the switching condition is met, not only can improve the efficiency of image grayscale calculation, but also ensure high grayscale calculation accuracy.

应当明白的是,本实施例的图像灰阶计算方式不仅可以用于上述的帧率切换场景,还可以用于需要计算图像灰阶的其他场景,例如,对当前图像进行其他显示控制或参数调整等。此外,该图像灰阶计算方式不仅适用于OLED显示屏等显示的图像,还可以适用于不存在Gamma值差异的其他显示屏显示的图像,如LCD显示屏或其延伸子类显示屏等,例如,LTPS-LCD(低温多晶硅液晶显示器)、SLCD(拼接专用液晶屏)等。It should be understood that, the image grayscale calculation method in this embodiment can be used not only in the above-mentioned frame rate switching scenario, but also in other scenarios where image grayscale needs to be calculated, for example, other display control or parameter adjustment for the current image. Wait. In addition, this image grayscale calculation method is not only applicable to images displayed by OLED displays, etc., but also applicable to images displayed by other displays with no difference in Gamma value, such as LCD displays or their extended sub-type displays, etc., for example , LTPS-LCD (low temperature polysilicon liquid crystal display), SLCD (splicing special LCD screen) and so on.

图4示出了本申请实施例的帧率切换控制方法的另一种流程示意图。其中,对于上述步骤S20,该帧率切换控制方法包括:FIG. 4 shows another schematic flowchart of a frame rate switching control method according to an embodiment of the present application. Wherein, for the above step S20, the frame rate switching control method includes:

步骤S210,根据预设选取规则在图像中选取像素采样的起始点。Step S210, selecting a starting point of pixel sampling in the image according to a preset selection rule.

通常地,终端设备会在图像中选取出一个起始点后才开始采样。例如,在一种实施方式中,该预设选取规则可包括:根据图像中状态栏的像素高度确定该起始点在沿状态栏的高度方向上的坐标位置,其中,该坐标位置大于或等于状态栏的像素高度。Usually, the terminal device will start sampling after selecting a starting point in the image. For example, in one embodiment, the preset selection rule may include: determining the coordinate position of the starting point along the height direction of the status bar according to the pixel height of the status bar in the image, wherein the coordinate position is greater than or equal to the state bar. The height of the bar in pixels.

以手机为例,如图5所示,手机显示屏上显示的状态栏的高度通常是固定的,在获取到截图图像后,以图像的左上角为坐标原点,若该状态栏在高度方向上所占用为300个像素单位,则该起始点在高度方向上的像素点位置可选取为大于或等于300。而该起始点的宽度方向上的像素点位置可随机设置,如图5所示的第100个像素等,于是可得到(100,300)的起始点。可选地,若以该起始点作为采样矩阵的一顶点,例如,以作为右上顶点进行像素矩阵采样,则可设置该起始点在屏幕宽度方向上的像素点位置为大于在宽度方向上的采样步长,这样可以保证在第一个像素到采样步长之间的像素能被采样到。Taking a mobile phone as an example, as shown in Figure 5, the height of the status bar displayed on the display screen of the mobile phone is usually fixed. After the screenshot image is obtained, the upper left corner of the image is taken as the coordinate origin. If it occupies 300 pixel units, the pixel position of the starting point in the height direction can be selected to be greater than or equal to 300. And the pixel position in the width direction of the starting point can be randomly set, such as the 100th pixel as shown in FIG. 5 , etc., so the starting point of (100, 300) can be obtained. Optionally, if the starting point is used as a vertex of the sampling matrix, for example, the pixel matrix is sampled as the upper right vertex, the pixel position of the starting point in the width direction of the screen can be set to be greater than the sampling in the width direction. Step size, which ensures that pixels between the first pixel and the sampling step size can be sampled.

步骤S220,从起始点开始,按照预设采样路线以设置的采样矩阵大小进行间隔采样,其中,采样矩阵在图像的第一方向上按照第一方向采样步长进行采样,及在图像的第二方向上按照第二方向采样步长进行采样。Step S220, starting from the starting point, perform interval sampling according to the preset sampling route with the set sampling matrix size, wherein the sampling matrix is sampled in the first direction of the image according to the sampling step size in the first direction, and in the second direction of the image. The direction is sampled according to the second direction sampling step size.

通常地,该第一方向与第二方向为垂直的方向,例如,该第一方向可为显示屏幕的横向方向,而该第二方向则为显示屏幕的纵向方向等。采样矩阵可从起始点开始时,按照预先设置的采样步长在图像中按照预设采样路线进行移动采样。Generally, the first direction and the second direction are vertical directions. For example, the first direction may be the horizontal direction of the display screen, and the second direction may be the vertical direction of the display screen. The sampling matrix can perform moving sampling in the image according to the preset sampling route according to the preset sampling step when starting from the starting point.

其中,上述预设采样路线可包括但不限于为蛇型路线、逐行或逐列路线等,即具体的采样路线并不作限定。而该第一方向采样步长和第二方向采样步长可根据实际需求来选取,例如,可根据终端设备的显示屏在第一方向和第二方向上的像素总数等进行选取。在一些实施方式中,第一方向采样步长和第二方向采样步长可选取为显示屏幕的第一方向像素总数和第二方向像素总数的3%~10%等。The above-mentioned preset sampling route may include, but is not limited to, a serpentine route, a row-by-row or column-by-column route, etc., that is, the specific sampling route is not limited. The sampling step size in the first direction and the sampling step size in the second direction may be selected according to actual requirements, for example, may be selected according to the total number of pixels of the display screen of the terminal device in the first direction and the second direction. In some embodiments, the sampling step in the first direction and the sampling step in the second direction may be selected as 3% to 10% of the total number of pixels in the first direction and the total number of pixels in the second direction of the display screen.

例如,若以一具有2K像素的显示屏的手机为例,若该采样矩阵的大小可设为5*5,即宽和高均为5个像素单位,若第一方向为横向方向且第一方向步长为100个像素,第二方向为纵向方向且第二方向步长为150个像素,于是,该采样矩阵可以按照如图6a所示的蛇型路线进行采样,或者按照如图6b所示的逐行路线进行采样,又或者按照如图6c所示的逐列路线进行采样等。For example, taking a mobile phone with a 2K pixel display screen as an example, if the size of the sampling matrix can be set to 5*5, that is, the width and height are both 5 pixel units, if the first direction is horizontal and the first The direction step size is 100 pixels, the second direction is the longitudinal direction and the second direction step size is 150 pixels, so the sampling matrix can be sampled according to the serpentine route as shown in Figure 6a, or as shown in Figure 6b. The sampling is performed according to the row-by-row route shown, or the sampling is performed according to the column-by-column route as shown in FIG. 6c.

步骤S230,根据像素灰阶转换算法计算每个采样矩阵中每个采样像素的灰阶。Step S230: Calculate the gray level of each sampling pixel in each sampling matrix according to the pixel gray level conversion algorithm.

在得到多个像素矩阵时,可根据像素灰阶转换算法进行计算。对于上述列举的诸多像素灰阶转换算法,本实施例中,将优先选取Gamma校准算法,其中,R、G和B依次为单个采样像素的红色、绿色和蓝色分量;g为预设校准值;Gray为该采样像素的灰阶。通常地,该预设校准值g可选取为2.2。于是,该Gamma校准算法的计算公式如下:When multiple pixel matrices are obtained, the calculation can be performed according to a pixel grayscale conversion algorithm. For many pixel grayscale conversion algorithms listed above, in this embodiment, the Gamma calibration algorithm will be preferentially selected, wherein R, G and B are the red, green and blue components of a single sampling pixel in turn; g is the preset calibration value ; Gray is the grayscale of the sampled pixel. Generally, the preset calibration value g can be selected as 2.2. Therefore, the calculation formula of the Gamma calibration algorithm is as follows:

Figure BDA0002871645650000121
Figure BDA0002871645650000121

其中,每个算法具有各自的特点。之所以选取该Gamma校准算法,这是由于在实际的大量测试过程中,发现取蓝色分量来计算的单色分量算法,其速度最快,平均值算法次之,移位算法和整形取值算法比较接近,浮点取值算法较慢,Gamma校准算法最慢。然而,从灰阶精度角度来说,Gamma校准算法最快,浮点取值算法次之,其余的类似,而单色分量算法最差。本实施例中,选取了以精度最优的Gamma校准算法,由于结合了上述的像素采样方式及上述的统计计算规则进行图像灰阶计算,可以实现灰阶计算速度与计算精度两者的较好兼容,保证了终端设备的整体性能等。Among them, each algorithm has its own characteristics. The reason why this Gamma calibration algorithm is selected is because in the actual large-scale testing process, it is found that the monochromatic component algorithm calculated by taking the blue component has the fastest speed, followed by the average algorithm, the shift algorithm and the shaping value. The algorithm is relatively close, the floating point value algorithm is slower, and the Gamma calibration algorithm is the slowest. However, from the perspective of grayscale accuracy, the Gamma calibration algorithm is the fastest, followed by the floating-point value algorithm, the rest are similar, and the monochromatic component algorithm is the worst. In this embodiment, the Gamma calibration algorithm with the best accuracy is selected. Since the above-mentioned pixel sampling method and the above-mentioned statistical calculation rules are combined to perform image gray-scale calculation, it can achieve better gray-scale calculation speed and calculation accuracy. Compatible to ensure the overall performance of the terminal equipment.

例如,在某一终端设备的实际测试过程中,在采用上述的Gamma校准算法和像素矩阵采样方式后,其平均计算耗时可控制在5ms左右,与通过计算全部像素的灰阶再求灰阶平均值的方案相比,本实施例的计算速度得到提升,而且计算的灰阶偏差可控制在5%以内,足以满足性能需求等。For example, in the actual test process of a terminal device, after using the above-mentioned Gamma calibration algorithm and pixel matrix sampling method, the average calculation time can be controlled at about 5ms, which is different from calculating the grayscale of all pixels and then finding the grayscale. Compared with the solution of the average value, the calculation speed of this embodiment is improved, and the calculated grayscale deviation can be controlled within 5%, which is sufficient to meet performance requirements and the like.

在得到采样像素后,将基于这些采样像素来判断是否进行帧率切换。若该图像的采样像素的灰阶满足预设帧率切换条件,则进行帧率切换,即执行步骤S40,否则执行步骤S50,即不进行帧率切换。After sampling pixels are obtained, whether to perform frame rate switching will be determined based on these sampling pixels. If the grayscale of the sampling pixels of the image satisfies the preset frame rate switching condition, the frame rate switching is performed, that is, step S40 is performed; otherwise, step S50 is performed, that is, the frame rate switching is not performed.

其中,在一种实施方式中,对于上述步骤S30,如图7所示,可包括:Wherein, in an embodiment, for the above-mentioned step S30, as shown in FIG. 7, it may include:

步骤S310,统计所有采样矩阵中像素的灰阶低于预设灰阶阈值的像素个数。Step S310: Count the number of pixels whose gray levels are lower than a preset gray level threshold in all sampling matrices.

步骤S320,判断统计的上述像素个数与采样像素总数的比值是否高于预设占比阈值。若高于,则执行步骤S330,否则执行步骤S340。Step S320, judging whether the ratio of the counted number of pixels to the total number of sampling pixels is higher than a preset ratio threshold. If it is higher, go to step S330, otherwise go to step S340.

步骤S330,判断不满足预设帧率切换条件。Step S330, it is determined that the preset frame rate switching condition is not satisfied.

步骤S340,判断满足预设帧率切换条件。Step S340, it is determined that the preset frame rate switching condition is satisfied.

示范性地,若判断出灰阶低于预设灰阶阈值的像素个数的占比设于预设占比阈值,即此时图像的灰阶较高,说明该显示内容为灰色,故不允许切换帧率。反之,若低于或等于该预设占比阈值,则此时图像的灰阶较低,可允许帧率切换。Exemplarily, if it is determined that the proportion of the number of pixels whose gray level is lower than the preset gray level threshold is set at the preset proportion threshold, that is, the gray level of the image is higher at this time, indicating that the display content is gray, so it is not Allows to switch frame rate. Conversely, if it is lower than or equal to the preset ratio threshold, then the grayscale of the image is lower at this time, allowing frame rate switching.

其中,该预设灰阶阈值可根据实际测试或经验值得到。可以理解,通过统计特定的采样像素的灰阶占比来判断,可以有效地解决如采用平均值计算灰阶时存在不准确的问题,这样在保证计算时长满足要求的前提下,还保证较高的灰阶计算精度,进而提高了用户体验等。Wherein, the preset grayscale threshold can be obtained according to actual tests or empirical values. It can be understood that by judging the proportion of gray scales of specific sampling pixels, it can effectively solve the problem of inaccuracy in calculating gray scales by using the average value. The gray-scale calculation accuracy is improved, and the user experience is improved.

本实施例的帧率切换控制方法通过对当前显示的图像灰阶按照预设像素矩阵的形式进行采样,进而通过统计这些像素矩阵中的采样像素的灰阶大于预设灰阶阈值的占比来判断是否满足切换条件,不仅可以提高图像灰阶计算的效率,还可以保证较高的灰阶计算精度等。The frame rate switching control method in this embodiment samples the currently displayed image grayscale in the form of a preset pixel matrix, and then counts the proportion of the sampled pixels in these pixel matrices whose grayscales are greater than the preset grayscale threshold. Judging whether the switching condition is satisfied can not only improve the efficiency of image grayscale calculation, but also ensure higher grayscale calculation accuracy.

实施例2Example 2

请参照图8,基于上述实施例1的方法,本实施例提出一种帧率切换控制装置200,示范性地,该帧率切换控制装置200包括:Referring to FIG. 8 , based on the method of Embodiment 1 above, this embodiment provides a frame rate switching control apparatus 200 . Exemplarily, the frame rate switching control apparatus 200 includes:

获取模块210用于响应帧率切换指令,获取终端设备当前显示的图像。The acquiring module 210 is configured to acquire the image currently displayed by the terminal device in response to the frame rate switching instruction.

灰阶计算模块220用于按照预设采样规则对该图像进行像素采样并计算采样像素的灰阶。The grayscale calculation module 220 is configured to perform pixel sampling on the image according to a preset sampling rule and calculate the grayscale of the sampled pixels.

判断模块230用于根据该图像的采样像素的灰阶判断是否满足预设帧率切换条件。The judging module 230 is configured to judge whether the preset frame rate switching condition is satisfied according to the gray scale of the sampled pixels of the image.

控制模块240用于当所述图像的采样像素的灰阶满足预设帧率切换条件时,控制进行帧率切换。The control module 240 is configured to control the frame rate switching when the grayscale of the sampled pixels of the image satisfies the preset frame rate switching condition.

其中,该预设采样规则包括预先设置的采样步长和采样矩阵大小,其中,所述采样步长包括第一方向采样步长和第二方向采样步长。在一种实施例中,灰阶计算模块220包括选取子模块、矩阵采样子模块和灰阶转换子模块。The preset sampling rule includes a preset sampling step size and a sampling matrix size, wherein the sampling step size includes a first direction sampling step size and a second direction sampling step size. In one embodiment, the grayscale calculation module 220 includes a selection submodule, a matrix sampling submodule, and a grayscale conversion submodule.

其中,选取子模块用于根据预设选取规则在图像中选取像素采样的起始点;矩阵采样子模块用于从所述起始点开始,按照预设采样路线以所述采样矩阵大小进行间隔采样,其中,所述采样矩阵在所述图像的第一方向上按照所述第一方向采样步长进行采样,及在所述图像的第二方向上按照所述第二方向采样步长进行采样;灰阶转换子模块用于根据像素灰阶转换算法计算每个所述采样矩阵中每个采样像素的灰阶。Wherein, the selection sub-module is used to select the starting point of pixel sampling in the image according to the preset selection rule; the matrix sampling sub-module is used to start from the starting point and perform interval sampling with the size of the sampling matrix according to the preset sampling route, Wherein, the sampling matrix is sampled according to the first direction sampling step size in the first direction of the image, and is sampled according to the second direction sampling step size in the second direction of the image; gray The level conversion sub-module is configured to calculate the gray level of each sampled pixel in each of the sampling matrices according to the pixel gray level conversion algorithm.

在一种实施例中,判断模块230包括像素统计子模块、占比比较子模块和判断输出子模块,其中,像素统计子模块用于统计所有采样矩阵中像素的灰阶低于预设灰阶阈值的像素个数;占比比较子模块用于判断所述像素个数与所述采样像素总数的比值是否高于预设占比阈值;判断输出子模块用于若高于,则判断不满足预设帧率切换条件,否则判断满足预设帧率切换条件。In one embodiment, the judging module 230 includes a pixel statistics sub-module, a proportion comparison sub-module and a judgment output sub-module, wherein the pixel statistics sub-module is used to count the gray levels of the pixels in all sampling matrices below a preset gray level The number of pixels of the threshold; the ratio comparison sub-module is used to judge whether the ratio of the number of pixels to the total number of sampled pixels is higher than the preset ratio threshold; the output sub-module is used to judge if it is higher than that, then judge that the ratio is not satisfied The preset frame rate switching condition, otherwise it is judged that the preset frame rate switching condition is satisfied.

可以理解,本实施例的装置对应于上述实施例1的方法,上述实施例1中的可选项同样适用于本实施例,故在此不再重复描述。It can be understood that the apparatus of this embodiment corresponds to the method of the foregoing Embodiment 1, and the options in the foregoing Embodiment 1 are also applicable to this embodiment, so the description is not repeated here.

本申请还提供了一种终端设备,例如,该终端设备可以包括手机、平板、笔记本电脑等。该终端设备包括显示屏、存储器和处理器,其中,显示屏用于显示图像,存储器存储有计算机程序,处理器通过运行所述计算机程序,从而使移动终端执行上述帧率切换控制方法或者上述帧率切换控制装置中的各个模块的功能。The present application also provides a terminal device, for example, the terminal device may include a mobile phone, a tablet, a notebook computer, and the like. The terminal device includes a display screen, a memory, and a processor, wherein the display screen is used to display images, and the memory stores a computer program, and the processor runs the computer program, thereby enabling the mobile terminal to execute the frame rate switching control method or the frame rate. The function of each module in the rate switching control device.

存储器可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据移动终端的使用所创建的数据(比如图像数据、灰阶转换算法、预设采样规则等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; order conversion algorithm, preset sampling rules, etc.) and so on. Additionally, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

本申请还提供了一种计算机存储介质,用于储存上述终端设备中使用的所述计算机程序。The present application also provides a computer storage medium for storing the computer program used in the above-mentioned terminal device.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和结构图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,结构图和/或流程图中的每个方框、以及结构图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may also be implemented in other manners. The apparatus embodiments described above are only schematic. For example, the flowcharts and structural diagrams in the accompanying drawings show the possible implementation architectures and functions of the apparatuses, methods and computer program products according to various embodiments of the present application. and operation. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more functions for implementing the specified logical function(s) executable instructions. It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flow diagrams, and combinations of blocks in the block diagrams and/or flow diagrams, can be implemented using dedicated hardware-based systems that perform the specified functions or actions. be implemented, or may be implemented in a combination of special purpose hardware and computer instructions.

另外,在本申请各个实施例中的各功能模块或单元可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或更多个模块集成形成一个独立的部分。In addition, each functional module or unit in each embodiment of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.

所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是智能手机、个人计算机、服务器、或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application.

Claims (12)

1.一种帧率切换控制方法,其特征在于,包括:1. a frame rate switching control method, is characterized in that, comprises: 响应帧率切换指令,获取终端设备当前显示的图像;In response to the frame rate switching command, obtain the image currently displayed by the terminal device; 按照预设采样规则对所述图像进行像素采样并计算采样像素的灰阶;Perform pixel sampling on the image according to the preset sampling rule and calculate the gray scale of the sampled pixels; 当所述图像的采样像素的灰阶满足预设帧率切换条件时,控制进行帧率切换。When the gray scale of the sampling pixels of the image satisfies the preset frame rate switching condition, the frame rate switching is controlled. 2.根据权利要求1所述的帧率切换控制方法,其特征在于,所述获取终端设备当前显示的图像,包括:2. The frame rate switching control method according to claim 1, wherein the acquiring the image currently displayed by the terminal device comprises: 调用系统截屏服务接口对所述终端设备当前显示的内容进行屏幕截图。The system screenshot service interface is invoked to take a screenshot of the content currently displayed by the terminal device. 3.根据权利要求1或2所述的帧率切换控制方法,其特征在于,所述预设采样规则包括预先设置的采样步长和采样矩阵大小,其中,所述采样步长包括第一方向采样步长和第二方向采样步长,所述按照预设采样规则对所述图像进行像素采样并计算采样像素的灰阶,包括:3. The frame rate switching control method according to claim 1 or 2, wherein the preset sampling rule comprises a preset sampling step size and a sampling matrix size, wherein the sampling step size includes the first direction The sampling step size and the second direction sampling step size, the pixel sampling of the image according to the preset sampling rule and the calculation of the gray scale of the sampled pixels, including: 根据预设选取规则在所述图像中选取像素采样的起始点;Select the starting point of pixel sampling in the image according to a preset selection rule; 从所述起始点开始,按照预设采样路线以所述采样矩阵大小进行间隔采样,其中,所述采样矩阵在所述图像的第一方向上按照所述第一方向采样步长进行采样,及在所述图像的第二方向上按照所述第二方向采样步长进行采样;Starting from the starting point, interval sampling is performed according to a preset sampling route with the size of the sampling matrix, wherein the sampling matrix is sampled according to the first direction sampling step in the first direction of the image, and sampling according to the second direction sampling step in the second direction of the image; 根据像素灰阶转换算法计算每个所述采样矩阵中每个采样像素的灰阶。The grayscale of each sampled pixel in each of the sampling matrices is calculated according to a pixel grayscale conversion algorithm. 4.根据权利要求3所述的帧率切换控制方法,其特征在于,所述根据所述图像的采样像素的灰阶判断是否满足预设帧率切换条件,包括:4. The frame rate switching control method according to claim 3, wherein the judging whether a preset frame rate switching condition is satisfied according to the gray scale of the sampled pixels of the image comprises: 统计所有采样矩阵中像素的灰阶低于预设灰阶阈值的像素个数;Count the number of pixels whose grayscales in all sampling matrices are lower than the preset grayscale threshold; 判断所述像素个数与所述采样像素总数的比值是否高于预设占比阈值;Determine whether the ratio of the number of pixels to the total number of sampled pixels is higher than a preset proportion threshold; 若高于,则判断不满足预设帧率切换条件,否则判断满足预设帧率切换条件。If it is higher, it is judged that the preset frame rate switching condition is not met, otherwise it is judged that the preset frame rate switching condition is met. 5.根据权利要求3所述的帧率切换控制方法,其特征在于,所述采样矩阵按照蛇型路线、逐行或逐列路线进行采样。5 . The frame rate switching control method according to claim 3 , wherein the sampling matrix is sampled according to a serpentine route, a row-by-row or a column-by-column route. 6 . 6.根据权利要求3所述的帧率切换控制方法,其特征在于,每一所述采样步长大于所述采样矩阵的宽和高,所述第一方向采样步长和所述第二方向采样步长分别选取为所述终端设备的第一方向像素总数和第二方向像素总数的3%~10%;6 . The frame rate switching control method according to claim 3 , wherein each of the sampling steps is greater than the width and height of the sampling matrix, and the first direction sampling step and the second direction The sampling step size is respectively selected as 3% to 10% of the total number of pixels in the first direction and the total number of pixels in the second direction of the terminal device; 所述采样矩阵的宽和高各自的取值范围为3~10个像素。The respective value ranges of the width and height of the sampling matrix are 3 to 10 pixels. 7.根据权利要求3所述的帧率切换控制方法,其特征在于,在所述图像中选取像素采样的起始点时,所述预设选取规则包括:7. The frame rate switching control method according to claim 3, wherein, when selecting the starting point of pixel sampling in the image, the preset selection rule comprises: 根据所述图像中状态栏的像素高度确定所述起始点在沿所述状态栏的高度方向上的坐标位置,所述坐标位置的取值大于或等于所述状态栏的像素高度。The coordinate position of the starting point along the height direction of the status bar is determined according to the pixel height of the status bar in the image, and the value of the coordinate position is greater than or equal to the pixel height of the status bar. 8.根据权利要求3所述的帧率切换控制方法,其特征在于,所述像素灰阶转换算法为单色分量算法、平均值算法、移位算法、整形取值算法、浮点取值算法或Gamma校准算法。8. The frame rate switching control method according to claim 3, wherein the pixel grayscale conversion algorithm is a monochrome component algorithm, an average value algorithm, a shift algorithm, a shaping value algorithm, and a floating point value algorithm. or Gamma calibration algorithm. 9.根据权利要求8所述的帧率切换控制方法,其特征在于,所述Gamma校准算法为:9. The frame rate switching control method according to claim 8, wherein the Gamma calibration algorithm is:
Figure FDA0002871645640000021
Figure FDA0002871645640000021
其中,R、G和B依次为单个采样像素的红色、绿色和蓝色分量;g为预设校准值;Gray为该采样像素的灰阶。Wherein, R, G and B are the red, green and blue components of a single sampling pixel in turn; g is a preset calibration value; Gray is the gray scale of the sampling pixel.
10.一种帧率切换控制装置,其特征在于,包括:10. A frame rate switching control device, comprising: 获取模块,用于响应帧率切换指令,获取终端设备当前显示的图像;The acquisition module is used to respond to the frame rate switching instruction and acquire the image currently displayed by the terminal device; 灰阶计算模块,用于按照预设采样规则对所述图像进行像素采样并计算采样像素的灰阶;a grayscale calculation module, configured to perform pixel sampling on the image according to a preset sampling rule and calculate the grayscale of the sampled pixels; 判断模块,用于根据所述图像的采样像素的灰阶判断是否满足预设帧率切换条件;a judging module for judging whether a preset frame rate switching condition is met according to the grayscale of the sampled pixels of the image; 控制模块,用于当所述图像的采样像素的灰阶满足所述预设帧率切换条件时,控制进行帧率切换。The control module is configured to control the frame rate switching when the grayscale of the sampling pixels of the image satisfies the preset frame rate switching condition. 11.一种终端设备,其特征在于,所述终端设备包括显示屏、处理器和存储器,所述显示屏用于显示图像,所述存储器存储有计算机程序,所述处理器用于执行所述计算机程序以实施权利要求1-9中任一项所述的帧率切换控制方法。11. A terminal device, characterized in that the terminal device comprises a display screen, a processor and a memory, the display screen is used to display an image, the memory stores a computer program, and the processor is used to execute the computer The program is to implement the frame rate switching control method described in any one of claims 1-9. 12.一种可读存储介质,其特征在于,其存储有计算机程序,所述计算机程序被执行时,实施根据权利要求1-9中任一项所述的帧率切换控制方法。12. A readable storage medium, characterized in that it stores a computer program, and when the computer program is executed, implements the frame rate switching control method according to any one of claims 1-9.
CN202011604787.4A 2020-12-30 2020-12-30 Frame rate switching control method and device, terminal equipment and readable storage medium Pending CN114697597A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011604787.4A CN114697597A (en) 2020-12-30 2020-12-30 Frame rate switching control method and device, terminal equipment and readable storage medium
PCT/CN2021/128955 WO2022142732A1 (en) 2020-12-30 2021-11-05 Frame rate switching control method and apparatus, terminal device, and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011604787.4A CN114697597A (en) 2020-12-30 2020-12-30 Frame rate switching control method and device, terminal equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114697597A true CN114697597A (en) 2022-07-01

Family

ID=82131753

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011604787.4A Pending CN114697597A (en) 2020-12-30 2020-12-30 Frame rate switching control method and device, terminal equipment and readable storage medium

Country Status (2)

Country Link
CN (1) CN114697597A (en)
WO (1) WO2022142732A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115866338A (en) * 2022-11-30 2023-03-28 联想(北京)有限公司 Control method, device, electronic device and storage medium
CN116504202A (en) * 2023-05-05 2023-07-28 厦门思坦半导体有限公司 Driving method and device of display module and display device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116072073B (en) * 2023-01-31 2025-06-10 云谷(固安)科技有限公司 Method and device for compensating brightness of display panel and computer storage medium
CN117894270A (en) * 2024-03-14 2024-04-16 集创北方(珠海)科技有限公司 LED display driving method and device, chip and electronic equipment
CN119198799B (en) * 2024-09-18 2025-05-13 中国人民解放军总医院第一医学中心 A high-resolution imaging method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104813392A (en) * 2012-11-20 2015-07-29 夏普株式会社 Control device, display device, and display device control method
US20160093239A1 (en) * 2014-09-29 2016-03-31 Apple Inc. Content dependent display variable refresh rate
CN106710540A (en) * 2015-11-12 2017-05-24 小米科技有限责任公司 Liquid crystal display method and device
CN108811055A (en) * 2018-03-27 2018-11-13 广东欧珀移动通信有限公司 Frame per second method of adjustment, device, terminal device and storage medium
CN110751933A (en) * 2019-12-04 2020-02-04 京东方科技集团股份有限公司 Display method and device for refresh rate switching, computer equipment and medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102174236B1 (en) * 2014-02-11 2020-11-05 삼성디스플레이 주식회사 Method of driving display panel and display apparatus for performing the method
CN106710539B (en) * 2015-11-12 2020-06-02 小米科技有限责任公司 Liquid crystal display method and device
JP2017161680A (en) * 2016-03-09 2017-09-14 キヤノン株式会社 Liquid crystal display device
CN106373516B (en) * 2016-10-31 2019-08-13 北京集创北方科技股份有限公司 LED display and its driving method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104813392A (en) * 2012-11-20 2015-07-29 夏普株式会社 Control device, display device, and display device control method
US20160093239A1 (en) * 2014-09-29 2016-03-31 Apple Inc. Content dependent display variable refresh rate
CN106710540A (en) * 2015-11-12 2017-05-24 小米科技有限责任公司 Liquid crystal display method and device
CN108811055A (en) * 2018-03-27 2018-11-13 广东欧珀移动通信有限公司 Frame per second method of adjustment, device, terminal device and storage medium
CN110751933A (en) * 2019-12-04 2020-02-04 京东方科技集团股份有限公司 Display method and device for refresh rate switching, computer equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115866338A (en) * 2022-11-30 2023-03-28 联想(北京)有限公司 Control method, device, electronic device and storage medium
CN116504202A (en) * 2023-05-05 2023-07-28 厦门思坦半导体有限公司 Driving method and device of display module and display device

Also Published As

Publication number Publication date
WO2022142732A1 (en) 2022-07-07

Similar Documents

Publication Publication Date Title
CN114697597A (en) Frame rate switching control method and device, terminal equipment and readable storage medium
US11833424B2 (en) Image rendering method and apparatus, device and storage medium
US9773460B2 (en) System, method, and computer program product for combining low motion blur and variable refresh rate in a display
CN108053381B (en) Dynamic tone mapping method, mobile terminal and computer-readable storage medium
WO2019127718A1 (en) Method and apparatus for displaying image
CN105654903A (en) Display control method and device of terminal and intelligent terminal
US11735147B1 (en) Foveated display burn-in statistics and burn-in compensation systems and methods
US12094122B2 (en) Detection method and detection device for image segmentation manner, and display device
US9892524B2 (en) Image displaying methods, devices, and storage media
CN110688081A (en) Method for displaying data on screen and display control device
WO2023065807A1 (en) Screen control method and apparatus, electronic device, and storage medium
CN114093323B (en) Screen control method, device, electronic device and storage medium
US20160329014A1 (en) Display device
CN108924316A (en) Shield lower light sensation detection method, device, mobile terminal and computer storage medium
US20200192554A1 (en) Terminal device, display control method implemented by the terminal device, computer readable storage medium and computer program product
CN105788527A (en) Pixel call method and pixel call device
CN105788528B (en) A kind of pixel call method and device
WO2023240838A1 (en) Brightness compensation method and apparatus, and device and medium
US20240257710A1 (en) Foveated display burn-in statistics and burn-in compensation systems and methods
WO2024221677A1 (en) Gamma debugging method, display panel driving method, and readable storage medium
CN112992060B (en) Display method, device and electronic device for display screen of electronic equipment
EP2530640A1 (en) Image copying method and device
CN114841936A (en) Image detection method and device, driving chip and electronic equipment
CN107562395B (en) Mobile terminal, display data transmission processing method and storage medium
CN114650324B (en) Frame frequency switching method and device, terminal equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220701