Video display method and device, electronic equipment and computer program product
By detecting and performing clock following processing, combined with the read and write processing mode of frame-level delay, the smooth display problem caused by the mismatch between the display unit and the input source clock is solved, and stable image display is achieved in the case of mismatch.
Patent Information
- Application Number
- CN202411364991.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-09-27
AI Technical Summary
In the prior art, the display unit and the input source of the electronic device can achieve smooth picture display only under clock matching conditions. However, in practical applications, the clock matching conditions are often not met, resulting in abnormal display.
By detecting whether the display unit and input source meet the clock matching conditions, if not, clock following processing is performed, and a frame-level delay read and write processing mode is adopted during the clock following processing to ensure that the image data will not be read before the reading is completed. Overwritten by write, avoid display lookahead and write overwrite.
It achieves smooth picture display in the case of clock mismatch, avoids display abnormalities and write overwrites, and ensures the integrity and smooth display of image data.
Smart Images

Figure CN118870083A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image display technology, and in particular to a video display method, device, electronic equipment and computer program product. Background Art
[0002] Normally, the input source and the electronic device interact to display the video through the display unit of the electronic device. The input source can be any acquisition device with a clock frequency, a video input interface, etc. The display unit is integrated in the electronic device or externally connected to the electronic device, and the display unit also has a clock frequency. When the display unit and the input source meet the clock matching conditions, a smooth picture display effect can be achieved, wherein the clock matching conditions may include the same or close frequencies. However, in actual applications, there are cases where the display unit and the input source do not meet the clock matching conditions.
[0003] It can be seen that when the image data of the input source is displayed through the display unit of the electronic device, how to ensure a smooth picture display effect is a problem that needs to be solved urgently. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a video display method, device, electronic device and computer program product, so as to ensure a smooth picture display effect when displaying image data of an input source through a display unit of an electronic device. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a video display method, which is applied to an electronic device, and the method includes:
[0006] Detecting whether a display unit and an input source of the electronic device meet a clock matching condition;
[0007] In response to not satisfying the clock matching condition, performing clock following processing on the display unit; wherein the clock following processing is used to make the display unit and the input source satisfy the clock matching condition;
[0008] In the process of the clock following processing, based on the first processing mode, the image data to be displayed transmitted by the input source is subjected to read and write processing for the cache area; wherein the first processing mode is a mode in which the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading is completed;
[0009] In response to reading each frame of image data, the read image data is displayed using the display unit.
[0010] In a second aspect, an embodiment of the present application provides a video display device, which is applied to an electronic device, and the device includes:
[0011] A detection module, used to detect whether the display unit and the input source of the electronic device meet the clock matching condition;
[0012] A clock following processing module, configured to perform clock following processing on the display unit in response to not satisfying the clock matching condition; wherein the clock following processing is configured to make the display unit and the input source satisfy the clock matching condition;
[0013] A first read / write processing module is used to perform read / write processing on a cache area for the image data to be displayed transmitted by the input source based on a first processing mode during the clock following processing; wherein the first processing mode is a mode in which the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading is completed;
[0014] The display module is used for displaying the read image data by using the display unit in response to reading each frame of image data.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0016] Memory, used to store computer programs;
[0017] The processor is used to implement any of the above-mentioned video display methods when executing the program stored in the memory.
[0018] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any of the above-mentioned video display methods when executed by a processor.
[0019] Beneficial effects of the embodiments of the present application:
[0020] The video display method provided by the embodiment of the present application can detect whether the display unit and the input source of the electronic device meet the clock matching condition. In response to not meeting the clock matching condition, the display unit is subjected to clock following processing. In the process of clock following processing, based on the first processing mode, the image data to be displayed transmitted by the input source is subjected to read and write processing for the cache area. In response to reading each frame of image data, the read image data is displayed using the display unit. It can be seen that in the process of clock following processing, the clock frequency of the input source and the clock frequency of the display unit do not meet the clock matching condition. Since the first processing mode has a frame-level delay relative to writing for reading the same frame of image data, when the first processing mode is used to read and write the image data, any frame of image data will not be overwritten before being read, thereby avoiding the situation of overwriting in the process of clock following processing, and avoiding the situation of display advance, that is, the display unit has displayed the picture but the input source has not transmitted the image data, thereby ensuring that there will be no display abnormality in the process of clock following. Therefore, through this scheme, when the image data of the input source is displayed by the display unit of the electronic device, a smooth picture display effect can be ensured.
[0021] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0023] Figure 1 A schematic diagram of a flow chart of a video display method provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of the effect corresponding to the first processing mode provided in an embodiment of the present application;
[0025] Figure 3 A schematic diagram of the effect corresponding to the second processing mode provided in an embodiment of the present application;
[0026] Figure 4 A schematic diagram of a process for detecting whether a display unit and an input source meet a clock matching condition provided in an embodiment of the present application;
[0027] Figure 5 A schematic diagram of a time-following process provided in an embodiment of the present application;
[0028] Figure 6 A schematic diagram of a structure of a video display method provided in an embodiment of the present application;
[0029] Figure 7 A schematic diagram of the structure of a video display device provided in an embodiment of the present application;
[0030] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0032] First, some professional terms in the embodiments of the present application are briefly introduced:
[0033] PPM: Parts Per Million, a unit of measurement. Assuming the clock frequency is 27MHz and the error is plus or minus 100PPM, the actual frequency range is 27×10 6 ±2700Hz.
[0034] VS: Vertical Syncs Start, vertical synchronization start signal, also known as vertical synchronization pulse, the vertical synchronization signal defined in the DMT (Display Monitor Timing standard) standard of VESA (Video Electronics Standards Association), indicating the pulse signal of the vertical synchronization pulse for video display refresh.
[0035] Clock following: By adjusting the clock frequency of the display unit, the clock frequency of the display unit changes with the changes of the clock frequency of the input source.
[0036] HDMI: High Definition Multimedia Interface, is a fully digital video and sound transmission interface that can send uncompressed audio and video signals.
[0037] DP: DisplayPort, display interface, a digital video interface standard standardized by the Video Electronics Standards Association.
[0038] Also, in order to better understand the present application, before introducing the solution provided by the embodiment of the present application, the clock frequency of the display unit and the clock frequency of the input source in the prior art are briefly introduced:
[0039] When the clock frequency Fr of the display unit is greater than the clock frequency Fw of the input source, this situation can also be called display advance. At this time, the display unit has displayed the picture, but the input source has not transmitted the image data, which will cause display abnormalities and make it impossible to ensure a smooth picture display effect. When the clock frequency Fr of the display unit is less than the clock frequency Fw of the input source, this situation can also be called input advance. The content that the display unit needs to display has not yet been displayed, but is overwritten by the new image data transmitted by the input source, which will cause display abnormalities and make it impossible to ensure a smooth picture display effect. When the clock frequency Fr of the display unit matches the clock frequency Fw of the input source, that is, when the two are the same, it can be ensured that the display unit can correctly display the image data transmitted by the input source at the same frequency as the input source, and the delay between the displayed image data and the image data transmitted by the input source is less than the transmission time of 1 frame of image data. For example: the input source transmits image data in the order of image data a-image data b-image data c. Before the input source transmits image data b, the display unit can read the image data a that has been transmitted by the input source. That is, before the input source completes transmission of image data a, the display unit can start reading image data a; similarly, before the input source transmits image data c, the display unit can read the image data b transmitted by the input source.
[0040] It can be seen that in the related art, a smooth picture display effect can be guaranteed only when the clock frequency of the display unit matches the clock frequency of the input source.
[0041] Based on the problems existing in the related art, an embodiment of the present application provides a video display method to ensure a smooth picture display effect when displaying image data of an input source through a display unit of an electronic device.
[0042] A video display method provided in an embodiment of the present application is introduced below.
[0043] Among them, a video display method provided by the implementation of this application can be applied to electronic devices. In specific applications, the electronic device can be a display device with a display function, or a terminal device or server without a display function. The embodiment of this application does not specifically limit the specific form of the electronic device. It should be emphasized that when the electronic device is a display device, the display unit can be integrated into the electronic device. The electronic device can be a personal computer PC device or a user's mobile device. This application does not make specific limitations on this; and when the electronic device is a terminal device or server without a display function, the display unit can be externally connected to the electronic device. At this time, the display unit can be an image data interface or a display / display screen. This application does not make specific limitations on this.
[0044] It can be understood that, usually both the input source and the display unit have a clock frequency, so the application scenarios of the embodiments of the present application can be various video preview scenarios, for example: the application scenario can be a scene in which a camera captures image data in real time, and a remote personal computer PC device views the captured image data in real time; the embodiments of the present application do not specifically limit this application scenario.
[0045] Furthermore, the input source may be an acquisition device or a device having an HDMI / DP interface, and the present application does not make any specific limitation on this. Therefore, when the input source is an acquisition device, when the input source acquires image data, the acquired image data may be transmitted to the electronic device. When the input source is a device having an HDMI / DP interface, the device having an HDMI / DP interface may directly transmit image data to the electronic device, and the embodiments of the present application do not make any specific limitation on the form of the device having an HDMI / DP interface.
[0046] It should be emphasized that the video display method in the present application is only for the case of a single input source and does not consider the case of multiple input sources.
[0047] A video display method is applied to an electronic device, and the method comprises:
[0048] Detecting whether a display unit and an input source of the electronic device meet a clock matching condition;
[0049] In response to not satisfying the clock matching condition, performing clock following processing on the display unit; wherein the clock following processing is used to make the display unit and the input source satisfy the clock matching condition;
[0050] In the process of the clock following processing, based on the first processing mode, the image data to be displayed transmitted by the input source is subjected to read and write processing for the cache area; wherein the first processing mode is a mode in which the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading is completed;
[0051] In response to reading each frame of image data, the read image data is displayed using the display unit.
[0052] It can be seen that during the clock following process, the clock frequency of the input source and the clock frequency of the display unit do not meet the clock matching condition. Since the first processing mode has a frame-level delay for reading the same frame of image data relative to writing, when the first processing mode is used to read and write the image data, any frame of image data will not be overwritten before being read, avoiding the overwriting during the clock following process and the display advance situation, that is, the display unit has displayed the picture but the input source has not yet transmitted the image data, thereby ensuring that there will be no display abnormalities during the clock following process. Therefore, through this solution, when the image data of the input source is displayed through the display unit of the electronic device, a smooth picture display effect is guaranteed.
[0053] A video display method provided by an embodiment of the present application is described below in conjunction with the accompanying drawings.
[0054] like Figure 1 As shown, a video display method provided in an embodiment of the present application is applied to an electronic device, and the method may include the following steps:
[0055] S101, detecting whether a display unit and an input source of the electronic device meet a clock matching condition;
[0056] It can be understood that satisfying the clock matching condition can be considered that the clock frequency of the display unit of the electronic device is the same as or close to the clock frequency of the input source. Then, the difference between the clock frequency of the input source and the clock frequency of the display unit can be detected. If it is detected that the difference between the clock frequency of the input source and the clock frequency of the display unit is small, it is determined that the clock matching condition is satisfied. Of course, detecting whether the display unit and the input source of the electronic device satisfy the clock matching condition can also include: detecting whether the number of scan lines corresponding to the current vertical synchronization pulse of the input source is the same as or close to the number of scan lines corresponding to the current vertical synchronization pulse of the display unit. The specific content can be introduced in the subsequent embodiments, and no further elaboration will be made again.
[0057] In one implementation, the detecting whether the display unit and the input source meet a clock matching condition comprises step A1:
[0058] Step A1, when any one of the predetermined trigger conditions is met, detecting whether the display unit and the input source meet a clock matching condition;
[0059] The predetermined trigger conditions include: the resolution of the image data transmitted by the input source changes, and the input source is connected to the video source interface of the electronic device.
[0060] It is understandable that after the resolution of the image data transmitted by the input source changes, the clock frequency of the input source will also change, and it can be determined that the predetermined trigger condition is met. At this time, it can be detected whether the display unit and the input source meet the clock matching condition; when the input source is connected to the video source interface of the electronic device, the input source will transmit image data, and it can also be determined that the predetermined trigger condition is met. At this time, it can be detected whether the display unit and the input source meet the clock matching condition. Of course, the predetermined trigger condition is not limited to the above two situations. For example, if a change in the input source is detected, it can also be considered that the predetermined trigger condition is met; the embodiment of the present application does not specifically limit the predetermined trigger condition.
[0061] It can be seen that when any one of the predetermined trigger conditions is met, it can be triggered to detect whether the display unit and the input source meet the clock matching conditions, thereby facilitating the subsequent steps of video display. When the image data of the input source is displayed through the display unit of the electronic device, a smooth picture display effect is guaranteed.
[0062] S102, in response to not satisfying the clock matching condition, performing clock following processing on the display unit; wherein the clock following processing is used to make the display unit and the input source satisfy the clock matching condition;
[0063] It can be understood that if the difference between the clock frequency of the input source and the clock frequency of the display unit is large, it is determined that the clock matching condition is not met. At this time, step S102 can be executed; then, the display unit can be clock followed so that the clock frequency of the display unit follows the clock frequency of the input source. The clock frequency of the display unit after the clock following processing matches the clock frequency of the input source, that is, the clock matching condition is met.
[0064] For a clear layout, the specific process of clock following may be introduced in other embodiments and will not be described in detail here.
[0065] S103, in the process of the clock following processing, based on the first processing mode, performing read and write processing on the cache area for the image data to be displayed transmitted by the input source;
[0066] The first processing mode is a mode in which the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading of the frame of image data is completed;
[0067] It can be understood that in the process of clock following the clock frequency of the display unit, the difference between the clock frequency of the display unit and the clock frequency of the input source may be large. At this time, the image data to be displayed can be read and written to the cache area according to the first processing mode. In the first processing mode, the time for reading and writing the same frame of image data has a frame-level delay, wherein the frame-level delay indicates that the reading time is at least 1 frame apart from the writing time. The embodiment of the present application does not make specific limitations on this; illustratively, currently writing to image data 1, after an interval of 1 frame, image data 1 can be read, that is, after starting to write to image data 2, reading of image data 1 is started.
[0068] Furthermore, before any frame of image data is read, the frame of image data will not be overwritten. If read and write processing is performed on the same cache area, overwrite may occur. However, if the cache areas for reading image data and writing image data are different cache areas, overwrite will not occur. It can be understood that in the first processing mode, there are at least two cache areas. At the same time, the cache area for reading image data to be displayed is different from the cache area for writing image data. Exemplarily, at the same time, image data in cache area 1 can be read, and image data can be written to buffer area 2.
[0069] In addition, since reading the same frame of image data has a frame-level delay relative to writing, the first processing mode can also be called a frame mode, and the embodiments of the present application do not make specific limitations on this.
[0070] For the sake of clarity, the specific process of performing read and write processing on the cache area for the image data to be displayed transmitted by the input source based on the first processing mode can be introduced in other embodiments and will not be elaborated on here.
[0071] S104, in response to reading each frame of image data, using the display unit to display the read image data.
[0072] It is understandable that after reading each frame of image data, the read image data can be directly displayed using the display unit; illustratively, when the display unit is integrated into a PC device, the read image data can be directly displayed on the PC device.
[0073] It can be seen that in the process of clock following processing, the clock frequency of the input source and the clock frequency of the display unit do not meet the clock matching condition. At this time, the first processing mode can be used to read and write the image data to be displayed. Since the first processing mode has a frame-level delay for reading the same frame of image data relative to writing, when the first processing mode is used to read and write the image data, any frame of image data will not be overwritten before being read, thereby avoiding overwriting during the clock following processing and avoiding reading and writing abnormalities. This ensures a smooth picture display effect when the image data of the input source is displayed through the display unit of the electronic device.
[0074] In one implementation, based on the first processing mode, performing read and write processing on the cache area for the image data to be displayed transmitted by the input source includes steps B1-B2:
[0075] Step B1, based on a polling writing method for multiple first cache areas, write each frame of image data transmitted by the input source into the cache area currently to be written in the multiple first cache areas in sequence; wherein the first cache area is a cache area for storing single-frame image data;
[0076] The number of the first cache areas is at least two. Under normal circumstances, in order to take into account the effective use of the cache area and avoid display abnormalities, the number of the first cache areas can be three. Of course, in practical applications, the number of the first cache areas can also be selected as needed, and this application does not make specific restrictions on this.
[0077] It can be understood that in the first processing mode, each frame of image data transmitted by the input source can be written into the cache area currently to be written in sequence based on a polling write method for multiple first cache areas, that is, a frame of image data transmitted by the input source is written into the cache area currently to be written, and each cache area to be written can write a frame of image data; wherein, the polling write method is: a method of writing to multiple first cache areas in turn; and, when reading image data, each frame of image data transmitted by the input source is also read in sequence from the cache area currently to be read in the multiple first cache areas based on a polling write method for multiple first cache areas. Exemplarily, the plurality of first cache areas are cache area 1, cache area 2, and cache area 3. Then, the image data may be polled and written into the three cache areas in the order of cache area 1-cache area 2-cache area 3-cache area 1-cache area 2-cache area 3. The input source transmits image data a, image data b, image data c, image data d, image data e, and image data f in sequence. Then, image data a may be written into cache area 1, image data b may be written into cache area 2, image data c may be written into cache area 3, and image data d may be written into cache area 1 (overwriting image data a stored in cache area 1). ), image data e is written into cache area 2 (overwrites image data b stored in cache area 2), and image data f is written into cache area 3 (overwrites image data c stored in cache area 3); at the same time, when reading the image data, the image data is also read in the above order. The current cache area to be written is cache area 2, and the image data can be written to cache area 2. At this time, it can be determined that the first cache area to be read is cache area 1, and the first cache area to be written is cache area 3. At this time, it can be determined that the current cache area to be read is cache area 2, so that polling reading is performed on each first cache area.
[0078] Furthermore, each frame of image data transmitted by the input source is image data transmitted according to the current clock frequency of the input source, and each frame of image data can be written in sequence to the current cache area to be written in multiple first cache areas, wherein the cache area to be written is a cache area in multiple specified areas.
[0079] Step B2, in response to each time the display unit performs screen refresh according to its own clock frequency, determining a target cache area currently being written to in each first cache area, indicating a read pointer to a start position of a cache area before the target cache area, and reading image data from the previous cache area;
[0080] The previous cache area is a cache area before the target cache area in the polling sequence indicated by the polling write.
[0081] It can be understood that when the display unit refreshes the screen according to its own clock frequency, it can be considered that the display unit is to display the image data. At this time, the target cache area currently being written can be determined, that is, the location where the image data is written, so that the location where the image data is read can be determined, that is, the location indicated by the read pointer. The read pointer can be pointed to the starting position of the previous cache area of the target cache area, and the image data is read from the previous cache area, which can ensure that the cache areas targeted for data reading and writing belong to different cache areas; it should be emphasized that the target cache area is the cache area currently being written, and the previous cache area of the target cache area is the cache area currently filled with image data to be displayed. In addition, since the cache areas targeted for data reading and writing belong to different cache areas, the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading is completed. Exemplarily, the existing cache area 1, cache area 2 and cache area 3 can be polled and written with image data in the following writing order: cache area 1-cache area 2-cache area 3-cache area 1-cache area 2-cache area 3. If the cache area currently being written is cache area 2, then the read pointer can be pointed to the starting position of cache area 1 to read the image data from cache area 1.
[0082] In order to better understand the working principle of the first processing mode, a brief introduction will be given below in conjunction with the accompanying drawings. Figure 2 As shown:
[0083] The read pointer points to cache area M, and the write pointer points to cache area M+1. The cache areas pointed to by the read pointer and the write pointer belong to different cache areas. At this time, cache area M may be the previous cache area of cache area M+1.
[0084] The embodiment of the present application can write each frame of image data transmitted by the input source into the current cache area to be written based on the polling writing method of multiple first cache areas, and determine the target cache area currently being written, and point the read pointer to the starting position of the previous cache area of the target cache area, and read the image data of the previous cache area. It can be seen that in the first processing mode, the cache areas targeted by the read position and the write position belong to different cache areas, and any frame of image data will not be overwritten before being read, which can ensure that there will be no abnormal reading and writing during the clock following process, and the read pointer points to the starting position of the previous cache area of the target cache area, so that there will be no problem of advanced display, so as to achieve smooth screen display effect when the image data of the input source is displayed through the display unit of the electronic device.
[0085] In one implementation, the method further includes step C1:
[0086] Step C1, when it is detected that the clock following processing is completed, the image data to be displayed transmitted by the input source is read and written to the cache area based on the second processing mode; wherein the second processing mode is a mode in which the reading of the same frame of image data has a row-level delay relative to the writing.
[0087] It should be emphasized that if in step S101, it is detected that the input source and the display unit meet the clock processing matching condition, step C1 can be directly executed, that is, based on the second processing mode, the image data to be displayed transmitted by the input source is read and written to the cache area.
[0088] It can be understood that after detecting that the clock following processing is completed, it can be considered that the clock frequency of the display unit is the same as or close to the clock frequency of the input source. At this time, the image data to be displayed can be read and written to the cache area according to the second processing mode. In the second processing mode, the time for reading and writing the same frame of image data has a row-level delay; it should be emphasized that the image data can contain several rows of pixels, and the reading and writing of the image data in the cache area are performed row by row. Then, the row-level delay indicates that the read row position is at least 1 row apart from the written row position, that is, the read pixel row is relative to the written image row. There are at least one row of pixels between pixel rows, so that in the process of writing a frame of image data row by row, the frame of image data can be read, and the read row position and the written row position are kept separated by a predetermined number of rows, and the predetermined number of rows is less than the number of pixel rows of the image data itself; and the row-level delay in the second processing mode is smaller than the frame-level delay in the first processing mode; illustratively, for a frame of image data, the Nth row of the frame of image data is currently being written, then the Nxth row of the frame of image data can be read, and the difference of x rows between the read position and the write position is the at least 1 row mentioned above, and the x rows are the row-level delay.
[0089] And, when the second processing mode is for a single cache area, before any frame of image data is read, the frame of image data will be overwritten, but the second processing mode is used to detect the situation where the clock following processing has been completed, so the clock frequency of the display unit is the same or close to the clock frequency of the input source, and there will be no situation where the writing frequency is much greater than the reading frequency, or the reading frequency is much greater than the writing frequency. Then, even if overwriting occurs, the pixel rows covered are also pixel rows that have been read, so there will be no display abnormality, and a smooth screen display effect can be guaranteed; then, in the second processing mode, read and write processing can be performed on the same cache area. Of course, in the second processing mode, there can also be multiple cache areas, but at the same time, the cache area for reading the image data to be displayed belongs to the same cache area as the cache area for writing the image data. Exemplarily, at the same time, the image data in cache area 1 can be read, and the image data can also be written to buffer area 1. It can be understood that in order to effectively utilize cache resources, in specific applications, in the second processing mode, a second buffer area can be selected to ensure that the problem of display abnormality is avoided.
[0090] In addition, since there is a row-level delay in reading the same frame of image data relative to writing, the delay is greatly reduced compared to the above-mentioned frame mode, so the second processing mode can also be called a stream mode.
[0091] The step of performing read and write processing on the cache area for the image data to be displayed transmitted by the input source based on the second processing mode may include steps C11-C12:
[0092] Step C11, writing each frame of image data transmitted by the input source into the second cache area in sequence; wherein the second cache area is a cache area for storing single-frame image data;
[0093] Among them, the number of second cache areas can be 1, and of course the number of second cache areas can also be multiple, which is not specifically limited in the embodiment of the present application.
[0094] It is understandable that in the second processing mode, each frame of image data transmitted by the input source can be written into the second cache area in sequence, and the second cache area is a cache area for storing single-frame image data in the second processing mode. Exemplarily, when the second cache area is only cache area 1, each frame of image data transmitted by the input source can be written into cache area 1 in sequence, and when the next frame of image data is written into cache area 1, the previous frame of image data can be overwritten; it is understandable that, because in the second processing mode, it is a row-level delay, when the pixel row of image data is overwritten, the pixel row that needs to be overwritten has been read, so the overwriting will not affect the normal display.
[0095] Exemplarily, the number of the second cache area can also be multiple, for example: cache area 1, cache area 2 and cache area 3, and the image data transmitted by the input source can be written into cache area 1-cache area 2-cache area 3 in sequence. The specific writing order can refer to the above-mentioned polling writing method. In addition, each frame of image data transmitted by the input source is the image data transmitted according to the current clock frequency of the input source, and each frame of image data can be written into the second cache area.
[0096] Step C12, in response to each time the display unit refreshes the screen according to its own clock frequency, the read pointer is pointed to the starting position of the second cache area where the image data is currently being written to read the image data currently being written to the second cache area.
[0097] It is understandable that when the display unit refreshes the screen according to its own clock frequency, it can be considered that the display unit is displaying the image data. At this time, the position where the image data is read can be determined, that is, the position indicated by the read pointer. Specifically, each time the image data starts to be displayed, that is, when the screen is refreshed, the read pointer can be pointed to the starting position of the second cache area where the image data is currently being written, and the image data is read from the second cache area where the image data is currently being written. It should be emphasized that since the clock frequency of the display unit and the input source are close after the clock following is completed, the delay between reading and displaying can be set to a row-level delay. At this time, the read pointer is pointed to the starting position of the second cache area where the image data is currently being written to read the data, which can also ensure normal screen display.
[0098] In order to better understand the working principle of the second processing mode, a brief introduction will be given below in conjunction with the accompanying drawings. Figure 3 As shown:
[0099] There are existing cache area M and cache area M+1, the read pointer points to cache area M, and the write pointer also points to cache area M, the cache areas pointed to by the read pointer and the write pointer belong to the same cache area, wherein the cache area M may be the previous cache area of the cache area M+1.
[0100] Of course, it is also possible to set only one buffer area as the second cache area, for example, to use cache area M or cache area M+1 as the second cache area; and, in the clock following process, cache area M and cache area M+1 can be used as the first cache area respectively, thereby obtaining multiple first cache areas.
[0101] It can be seen that in the second processing mode, the cache area targeted by the read position and the write position belong to the same cache area. Compared with the frame-level delay of the first processing mode, the row-level delay of the second processing mode is smaller, which reduces the display delay. Since the clock following processing has been completed, there will be no reading and writing abnormalities, thereby achieving a smooth picture display effect when the image data of the input source is displayed through the display unit of the electronic device.
[0102] In addition, the present application realizes video display by combining the first processing mode and the second processing mode, taking into account the efficiency of image data display and ensuring the screen display effect of the process. That is to say, in the clock following process, avoiding read and write anomalies is a more concerned issue than cache occupancy. Therefore, the present application adopts the first processing mode to avoid read and write anomalies through frame-level delay (frame-level delay provides an implementation basis through multiple cache areas) to ensure smooth screen display effects; and after the clock following is completed, the first processing mode is switched to the second processing mode to perform level delay processing, and in the second processing mode, it can be achieved with the help of a single cache area, thereby ensuring the avoidance of read and write anomalies, as well as the effective use of the cache area and the display effect of row-level delay.
[0103] Alternatively, in another embodiment, Figure 4 As shown, the detecting whether the display unit and the input source meet the clock matching condition includes:
[0104] S401, obtaining a current clock frequency of an input source, a current clock frequency of a display unit, a number of scan lines corresponding to a current vertical synchronization pulse of the input source, and a number of scan lines corresponding to a current vertical synchronization pulse of the display unit;
[0105] It is understandable that all image data on the display unit is scanned line by line. Similarly, writing data can also be considered as writing line by line. The vertical synchronization pulse is added between two frames, indicating the end of the previous frame and the beginning of the new frame. The vertical synchronization pulse is a pulse with a relatively long duration, which may last for one or several lines of scanning time, but during this time, no pixel signal appears. The number of scan lines corresponding to the vertical synchronization pulse can be considered as the number of lines that can be scanned if scanning is performed within the duration of the vertical synchronization pulse.
[0106] It can be understood that the image data transmitted by any input source corresponds to a resolution, and the VESA DMT standard defines that each resolution of the input source corresponds to a standard clock frequency. The corresponding standard clock frequency is determined according to the resolution of the input source. The determined standard clock frequency can be considered as the current clock frequency of the input source. In actual use, there may be a deviation between the standard clock frequency and the current clock frequency, but the deviation is generally very small and can be ignored in the present application; and the current clock frequency of the display unit can be directly read by the electronic device, and the embodiments of the present application do not make specific limitations on this.
[0107] It can be understood that the VESA DMT standard defines the number of scanning lines corresponding to the vertical synchronization pulse corresponding to the input source of each resolution, and the number of scanning lines corresponding to the corresponding vertical synchronization pulse is determined according to the resolution of the input source. The determined number of scanning lines corresponding to the vertical synchronization pulse can be used as the number of scanning lines corresponding to the current vertical synchronization pulse of the input source, representing the number of lines scanned by the current vertical synchronization pulse of the input source during the duration, and the number of scanning lines corresponding to the current vertical synchronization pulse of the display unit can be directly read by the electronic device, and the embodiments of the present application do not make specific limitations on this.
[0108] S402, detecting whether an absolute value of a first difference between a current clock frequency of the input source and a current clock frequency of the display unit is not greater than a first predetermined threshold, and whether an absolute value of a second difference between a number of scanning lines corresponding to a current vertical synchronization pulse of the input source and a number of scanning lines corresponding to a current vertical synchronization pulse of the display unit is not greater than a second predetermined threshold;
[0109] Among them, the first predetermined threshold is: the maximum absolute value of the difference between the current clock frequency of the display unit of the electronic device that meets the clock matching condition and the current clock frequency of the input source; the second predetermined threshold is: the maximum absolute value of the difference between the number of scanning lines corresponding to the current vertical synchronization pulse of the display unit of the electronic device that meets the clock matching condition and the number of scanning lines corresponding to the current vertical synchronization pulse of the input source; and, under normal circumstances, the first predetermined threshold can be 100PPM, and the second predetermined threshold can be 10 lines.
[0110] It can be understood that the first absolute value of the difference between the current clock frequency of the input source and the current clock frequency of the display unit, and the second absolute value of the difference between the number of scan lines corresponding to the current vertical synchronization pulse of the input source and the number of scan lines corresponding to the current vertical synchronization pulse of the display unit can be calculated; and it is detected whether the absolute value of the first difference is not greater than the first predetermined threshold, and whether the absolute value of the second difference is not greater than the second predetermined threshold. Exemplarily, the first predetermined threshold is 100PPM, and the clock frequency of the input source is 20MHZ. Then, it can be determined that the clock frequency range of the display unit allowed by the first predetermined threshold is 20×10 6 ±2000Hz, if the absolute value of the first difference is 1000HZ, then it can be determined that the absolute value of the first difference is less than the first predetermined threshold; the second predetermined threshold is 10 lines, and the absolute value of the second difference is 6 lines. At this time, it can be determined that the absolute value of the second difference is less than the second predetermined threshold.
[0111] In order to better understand the contents of the first difference absolute value and the second difference absolute value, they are introduced in the form of formulas as follows:
[0112] Fdet = |Fw – Fr|;
[0113] VSdet = |VSw – VSr|;
[0114] Among them, Fdet is the absolute value of the first difference, Fw is the current clock frequency of the input source, Fr is the current clock frequency of the display unit, Vsdet is the absolute value of the second difference, VSw is the number of scanning lines corresponding to the current vertical synchronization pulse of the input source, and VSr is the number of scanning lines corresponding to the current vertical synchronization pulse of the display unit; and, subsequently, it can be detected whether the first difference absolute value Fdet is not greater than the first predetermined threshold, and it can also be detected whether the second difference absolute value Vsdet is not greater than the second predetermined threshold.
[0115] S403, when the absolute value of the first difference is not greater than a first predetermined threshold and the absolute value of the second difference is not greater than a second predetermined threshold, determine that the display unit and the input source meet the clock matching condition; otherwise, determine that the display unit and the input source do not meet the clock matching condition.
[0116] It can be understood that, when the absolute value of the first difference is not greater than the first predetermined threshold and the absolute value of the second difference is not greater than the second predetermined threshold, it can be determined that the display unit and the input source meet the clock matching condition, otherwise, it is determined that the display unit and the input source do not meet the clock matching condition. For example, the first predetermined threshold is 100PPM, and the clock frequency of input source 1 is 20MHZ. Then, it can be determined that the clock frequency range of the display unit allowed by the first predetermined threshold is 20×10 6 ±2000Hz, the absolute value of the first difference between the current clock frequency of input source 1 and the current clock frequency of display unit 1 is 3000HZ, and it can be determined that the absolute value of the first difference is greater than the first predetermined threshold. At this time, it can be determined that display unit 1 and input source 1 do not meet the clock matching condition; the second predetermined threshold is 10 lines, and the absolute value of the second difference between the current clock frequency of input source 2 and the current clock frequency of display unit 2 is 15 lines. It can be determined that the absolute value of the second difference is greater than the second predetermined threshold. At this time, it can be determined that display unit 2 and input source 2 do not meet the clock matching condition.
[0117] It can be seen that the embodiment of the present application determines whether the display unit and the input source meet the clock matching condition by calculating the absolute value of the first difference and the absolute value of the second difference. Considering the clock matching condition from two aspects is more accurate, and it can more accurately detect whether the display unit and the input source of the electronic device meet the clock matching condition.
[0118] In one implementation, performing clock following processing on the display unit may include step D1 or D2:
[0119] Step D1, if it is detected that the absolute value of the first difference is greater than a first predetermined threshold, firstly performing a first following process on the display unit, and then performing a second following process on the display unit, so as to perform a clock following process;
[0120] The first following process is used to adjust a period corresponding to a clock frequency of the display unit, and the second following process is used to adjust a phase of the clock frequency of the display unit.
[0121] It can be understood that if it is detected that the absolute value of the first difference is greater than the first predetermined threshold, that is, it is detected that the display unit and the input source do not meet the clock matching condition, the display unit is subjected to the first follow-up processing and the second follow-up processing to realize the clock following processing, wherein the first follow-up processing can be considered to be achieved by adjusting the period corresponding to the clock frequency of the display unit, thereby adjusting the clock frequency of the display unit, and the second follow-up processing can be considered to be achieved by adjusting the phase of the clock frequency of the display unit, thereby adjusting the number of scanning lines corresponding to the vertical synchronization pulse of the display unit.
[0122] Furthermore, the first following process may also be referred to as a coarse adjustment, and the second following process may also be referred to as a fine adjustment, which is not specifically limited in the embodiments of the present application. In addition, there is a situation where the absolute value of the first difference is greater than the first predetermined threshold value but the absolute value of the second difference is not greater than the second predetermined threshold value, but after the first following process is performed on the display unit, the second following process is also performed on the display unit again, thereby realizing the clock following process.
[0123] The following is an exemplary introduction to the first follow-up processing method and the second follow-up processing method:
[0124] In one implementation, the first follow-up processing includes a method E1:
[0125] Method E1, inputting the frequency difference between the current clock frequency of the display unit and the current clock frequency of the input source into the clock frequency modulation hardware of the display unit, so that the clock frequency modulation hardware responds to the frequency difference being a positive number, takes the numerical value of the frequency difference as the expected reduction amount, and reduces the frequency value of the clock frequency of the display unit by adjusting the period corresponding to the clock frequency of the display unit; and responds to the frequency difference being a negative number, takes the numerical value of the frequency difference as the expected increase amount, and increases the frequency value of the clock frequency of the display unit by adjusting the period corresponding to the clock frequency of the display unit, so as to obtain the clock frequency of the display unit after the first follow-up processing; wherein the absolute value of the difference between the clock frequency of the display unit after the first follow-up processing and the clock frequency of the input source is not greater than the first predetermined threshold.
[0126] The difference between the current clock frequency of the display unit and the current clock frequency relative to the input source may be a positive value or a negative value. Specifically, when the current clock frequency of the display unit is greater than the current clock frequency of the input source, the difference is a positive value, which indicates that the clock frequency of the display unit needs to be reduced; conversely, when the current clock frequency of the display unit is less than the current clock frequency of the input source, the difference is a negative value, which indicates that the clock frequency of the display unit needs to be increased. Exemplarily, when the difference between the current clock frequency of the display unit 1 and the current clock frequency relative to the input source 1 is 100HZ, the numerical value of the frequency difference can be used as the expected reduction amount to adjust the period corresponding to the clock frequency of the display unit and reduce the frequency value of the clock frequency of the display unit; when the difference between the current clock frequency of the display unit 2 and the current clock frequency relative to the input source 2 is -100HZ, the numerical value of the frequency difference can be used as the expected increase amount to adjust the period corresponding to the clock frequency of the display unit 2 and increase the frequency value of the clock frequency of the display unit.
[0127] It can be understood that the clock frequency modulation hardware of the display unit can adjust the period corresponding to the clock frequency of the display unit based on the difference between the current clock frequency of the display unit and the current clock frequency of the input source. Therefore, when performing the first follow-up processing, the clock frequency modulation hardware of the display unit can be directly called to adjust the period corresponding to the clock frequency of the display unit to obtain the clock frequency of the display unit after the first follow-up processing; and it is required that the absolute value of the difference between the clock frequency of the display unit after the first follow-up processing and the clock frequency of the input source is not greater than the first predetermined threshold, that is, the absolute value of the first difference obtained after the first follow-up processing is not greater than the first predetermined threshold. Exemplarily, the first predetermined threshold is 100PPM, and the clock frequency of the input source is 30MHZ. Then, it can be determined that the clock frequency range of the display unit allowed by the first predetermined threshold is 30×10 6 ±3000Hz, the absolute value of the difference between the clock frequency of the display unit after clock following processing and the clock frequency of the input source is 100Hz.
[0128] Of course, the processing method of the first follow-up processing introduced above is only an exemplary introduction, and the first follow-up processing can also be implemented in other ways, and the embodiments of the present application do not make specific limitations on this.
[0129] It can be seen that the embodiment of the present application can adjust the period corresponding to the clock frequency of the display unit through the clock frequency modulation hardware of the display unit, and obtain the clock frequency of the display unit after the first follow-up processing. There is no need for the electronic device to actively adjust the clock frequency of the display unit, which simplifies the processing process and improves the efficiency of the first follow-up processing.
[0130] In one implementation, the second follow-up processing includes a method F1:
[0131] Method F1, inputting the line number difference of the display unit relative to the input source into the clock frequency modulation hardware of the display unit, so that the clock frequency modulation hardware adjusts the phase of the clock frequency of the display unit by adjusting the phase corresponding to the clock frequency of the display unit in response to the line number difference being a positive number, taking the numerical value of the line number difference as the expected reduction amount, and adjusts the phase of the clock frequency of the display unit by adjusting the phase corresponding to the clock frequency of the display unit in response to the line number difference being a negative number, taking the numerical value of the line number difference as the expected increase amount, to obtain the clock frequency of the display unit after the second follow-up processing; wherein the line number difference is the difference between the number of scan lines corresponding to the current vertical synchronization pulse of the display unit and the number of scan lines corresponding to the current vertical synchronization pulse of the input source; wherein the absolute value of the difference between the number of scan lines corresponding to the vertical synchronization pulse of the display unit after the second follow-up processing and the number of scan lines corresponding to the vertical synchronization pulse of the input source is not greater than the second predetermined threshold.
[0132] The difference in the number of lines of the display unit relative to the input source may be a positive value or a negative value. Specifically, when the number of scan lines corresponding to the current vertical synchronization pulse of the display unit is greater than the number of scan lines corresponding to the current vertical synchronization pulse of the input source, the difference is a positive value, which indicates that the clock frequency of the display unit needs to be reduced; conversely, when the number of scan lines corresponding to the current vertical synchronization pulse of the display unit is less than the number of scan lines corresponding to the current vertical synchronization pulse of the input source, the difference is a negative value, which indicates that the clock frequency of the display unit needs to be increased. Exemplarily, when the difference in the number of lines of the display unit 1 relative to the input source 1 is 10 lines, the numerical value of the difference in the number of lines can be used as the expected reduction amount to adjust the phase corresponding to the clock frequency of the display unit 1 to obtain the clock frequency of the display unit after the second follow-up processing; when the difference in the number of lines of the display unit 2 relative to the input source 2 is -10 lines, the numerical value of the difference in the number of lines can be used as the expected increase amount to adjust the phase corresponding to the clock frequency of the display unit 2 to obtain the clock frequency of the display unit after the second follow-up processing.
[0133] It should be emphasized that by adjusting the phase corresponding to the clock frequency of the display unit, the number of scanning lines corresponding to the vertical synchronization pulse of the display unit can be adjusted.
[0134] It can be understood that the clock frequency modulation hardware of the display unit can adjust the phase corresponding to the clock frequency of the display unit based on the difference between the number of scan lines corresponding to the current vertical synchronization pulse of the display unit and the number of scan lines corresponding to the current vertical synchronization pulse of the input source. Therefore, when performing the second follow-up processing, the clock frequency modulation hardware of the display unit can be directly called to adjust the phase corresponding to the clock frequency of the display unit to obtain the clock frequency of the display unit after the second follow-up processing; and it is required that the absolute value of the difference between the number of scan lines corresponding to the vertical synchronization pulse of the display unit after the second follow-up processing and the number of scan lines corresponding to the vertical synchronization pulse of the input source is not greater than the second predetermined threshold, that is, the absolute value of the second difference obtained after the second follow-up processing is not greater than the second predetermined threshold. Exemplarily, the second predetermined threshold is 10 lines, the number of scan lines corresponding to the vertical synchronization pulse of the input source is the 3rd line, and the number of scan lines corresponding to the vertical synchronization pulse of the display unit after the clock follow-up processing is the 5th line. Then, it can be determined that the absolute value of the difference between the number of scan lines corresponding to the vertical synchronization pulse of the display unit after the clock follow-up processing and the number of scan lines corresponding to the vertical synchronization pulse of the input source is 2 lines, which is less than the second predetermined threshold.
[0135] Of course, the above-mentioned processing method of the second follow-up processing is only an exemplary introduction, and the second follow-up processing can also be implemented in other ways, and the embodiments of the present application do not make specific limitations on this.
[0136] In order to better understand the first difference absolute value and the second difference absolute value after the clock following process, the following is an introduction in the form of a formula:
[0137] Fdet'= |Fw – Fr'| ≤ first predetermined threshold
[0138] VSdet'= |VSw – VSr'| ≤ second predetermined threshold
[0139] Among them, Fr' is the current clock frequency of the display unit after clock following processing, Fdet' is the first difference absolute value after clock following processing, and Fdet' is required to be no greater than the first predetermined threshold value, VSr' is the number of scanning lines corresponding to the current vertical synchronization pulse of the display unit after clock following processing, VSdet' is the second difference absolute value after clock following processing, and VSdet' is required to be no greater than the second predetermined threshold value.
[0140] It can be seen that the embodiment of the present application can adjust the phase of the clock frequency of the display unit by calling the clock frequency adjustment interface for the display unit, and obtain the clock frequency of the display unit after the second follow-up processing. There is no need for the electronic device to actively adjust the clock frequency of the display unit, which simplifies the processing process and improves the efficiency of the second follow-up processing.
[0141] Step D2, if it is detected that the absolute value of the first difference is not greater than the first predetermined threshold but the absolute value of the second difference is greater than the second predetermined threshold, performing a second following process on the display unit to perform a clock following process;
[0142] It is understandable that when it is detected that the absolute value of the first difference is not greater than the first predetermined threshold, but the absolute value of the second difference is greater than the second predetermined threshold, the first follow-up processing may not be performed on the display unit, and only the second follow-up processing may be performed on the display unit, thereby realizing clock follow-up processing.
[0143] In order to better understand the content of detecting whether the display unit and the input source meet the clock matching condition and the clock following process, the following is a brief introduction with reference to the accompanying drawings. Figure 5 As shown:
[0144] start;
[0145] S501, real-time statistics of Fw and Fr, and calculation of the absolute value of the difference between the two Fdet;
[0146] It is understandable that the current clock frequency Fw of the input source and the current clock frequency Fr of the display unit can be counted in real time, and the absolute value of the difference Fdet between the two can be calculated. Fdet can be considered as the first absolute value of the difference introduced in the above embodiment.
[0147] S502, detecting whether Fdet is greater than a threshold T;
[0148] The threshold value T can be considered as the first predetermined threshold value introduced in the above embodiment, then, it can be detected whether the absolute value of the first difference is greater than the first predetermined threshold value; if so, step S503 can be executed, if not, step S504 can be executed.
[0149] S503, performing a rough adjustment process on Fr;
[0150] The coarse adjustment process may also be considered as the first follow-up process introduced in the above embodiment; therefore, the coarse adjustment process may be performed on Fr, and step S501 may be re-executed.
[0151] S504, calculating the synchronization start difference VSdet;
[0152] Among them, the synchronization start difference VSdet can also be considered as the second difference absolute value introduced in the above embodiment. The number of scanning lines corresponding to the vertical synchronization pulse of the input source and the number of scanning lines corresponding to the vertical synchronization pulse of the display unit can be counted, so as to calculate the absolute value of the difference between the two and obtain the synchronization start difference VSdet.
[0153] S505, detecting whether VSdet is greater than a threshold value N;
[0154] The threshold N may be considered as the second predetermined threshold introduced in the above embodiment. Then, it may be detected whether the second difference absolute value VSdet is greater than the second predetermined threshold. If so, step S506 may be executed, and if not, the process ends directly.
[0155] S506, fine-tuning VSdet;
[0156] The fine-tuning process may also be considered as the second follow-up process introduced in the above embodiment; therefore, VSdet may be fine-tuned and step S501 may be re-executed.
[0157] It can be seen that when the embodiment of the present application detects that the absolute value of the first difference is greater than the first predetermined threshold, the first follow-up processing and the second follow-up processing can be performed on the display unit. When it is detected that the absolute value of the first difference is not greater than the first predetermined threshold but the absolute value of the second difference is greater than the second predetermined threshold, only the second follow-up processing can be performed on the display unit. Through time following processing, the clock frequency of the display unit can be matched with the input source, so that a smooth picture display effect can be guaranteed when the image data is displayed subsequently.
[0158] Optionally, in another embodiment, the present application also provides another video display method, which is introduced in the form of a module, such as Figure 6 Shown:
[0159] The clock frequency detection module is used to count the number of scan lines VSw corresponding to the clock frequency Fw of the input source and the vertical synchronization pulse, and the number of scan lines VSr corresponding to the clock frequency Fr of the display unit and the vertical synchronization pulse; and when the signal resolution of the input source changes, the number of scan lines VSw' corresponding to the clock frequency Fw' of the changed input source and the vertical synchronization pulse can be counted, and when the clock frequency of the display unit changes, the number of scan lines VSr' corresponding to the clock frequency Fr' of the changed input source and the vertical synchronization pulse can be counted. In addition, the clock frequency detection module can also be called the input clock frequency detection module, and can also be considered to count the clock frequency Fw of the input source in real time within a fixed time, and output the counted clock video of the input source to the clock following control module.
[0160] The clock following control module is used to calculate the clock frequency difference Fdet and the scanning line number difference VSdet corresponding to the vertical synchronization pulse, that is, the first difference absolute value and the second difference absolute value, according to the clock frequency Fw of the input source and the scanning line number VSw corresponding to the vertical synchronization pulse, and the clock frequency Fr of the display unit and the scanning line number VSr corresponding to the vertical synchronization pulse. In addition, the clock following control module can also determine whether to initiate the work enable of the clock following module according to the clock frequency Fw of the input source.
[0161] The clock following module is used to perform time following processing when it is detected that the clock frequency difference is greater than the first predetermined threshold value, that is, when Fdet is greater than the threshold value T; wherein the time following processing may include coarse adjustment and fine adjustment, that is, the first following processing and the second following processing; when Fdet is greater than the threshold value T, the coarse adjustment is triggered first, and when Fdet is less than the threshold value T, the fine adjustment is triggered. In addition, the clock following module can also receive the clock frequency Fw of the input source output by the clock frequency detection module and the work enable output by the clock following control module to perform clock following processing. During the clock following processing, the clock frequency of the display unit can be made to follow the clock frequency of the input source, and a clock following completion flag is output to the clock following control module.
[0162] The frame mode working module is used to perform read and write processing on the cache area for the image data to be displayed transmitted by the input source based on the first processing mode during the clock following processing, so as to realize the display unit to display the image data.
[0163] The stream mode working module is used to detect that the clock following processing is completed, and then based on the second processing mode, perform read and write processing on the cache area for the image data to be displayed transmitted by the input source, so as to realize the display unit to display the image data.
[0164] It can be understood that since the clock frequency Fr of the display unit cannot immediately and accurately follow the clock frequency Fw of the input source during the clock following process, the frame mode can be used during the clock following process, and after the clock following process is completed, the stream mode can be used to achieve dynamic switching between modes.
[0165] It can be understood that all the above modules may be virtual modules, and this application does not make any specific limitation on this; and the functions of the above modules have been introduced in the above method embodiments, so they will not be repeated here.
[0166] It can be seen that the present application can realize the display of image data of the input source through the clock frequency detection module, the clock following control module, the clock following module, the frame mode working module and the stream mode working module, thereby achieving a smooth picture display effect when the image data of the input source is displayed through the display unit of the electronic device.
[0167] Based on the above method embodiment, Figure 7 As shown, the present application also provides a video display device, applied to an electronic device, the device comprising:
[0168] A detection module 710, configured to detect whether a display unit and an input source of the electronic device meet a clock matching condition;
[0169] A clock following processing module 720, configured to perform clock following processing on the display unit in response to not satisfying the clock matching condition; wherein the clock following processing is configured to make the display unit and the input source satisfy the clock matching condition;
[0170] The first read / write processing module 730 is used to perform read / write processing on the cache area for the image data to be displayed transmitted by the input source based on a first processing mode during the clock following processing; wherein the first processing mode is a mode in which the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading is completed;
[0171] The display module 740 is used for displaying the read image data by using the display unit in response to reading each frame of image data.
[0172] Optionally, the first read-write processing module is specifically configured to:
[0173] Based on a polling writing method for multiple first buffer areas, each frame of image data transmitted by the input source according to the current clock frequency is sequentially written into a current buffer area to be written in the multiple first buffer areas; wherein the first buffer area is a buffer area for storing a single frame of image data;
[0174] In response to each time the display unit performs screen refresh according to its own clock frequency, a target cache area currently being written to in each first cache area is determined, a read pointer is pointed to a start position of a cache area before the target cache area, and image data is read from the previous cache area;
[0175] The previous cache area is a cache area before the target cache area in the polling sequence indicated by the polling write.
[0176] Optionally, the device further comprises:
[0177] The second read-write processing module is used to detect that the clock following processing is completed, and then, based on the second processing mode, perform read-write processing on the cache area for the image data to be displayed transmitted by the input source; wherein the second processing mode is a mode in which the reading of the same frame of image data has a row-level delay relative to the writing.
[0178] Optionally, the second read-write processing module is specifically used to:
[0179] Writing each frame of image data transmitted by the input source according to its own clock frequency into the second buffer area in sequence; wherein the second buffer area is a buffer area for storing single-frame image data;
[0180] In response to each time the display unit performs screen refresh according to its own clock frequency, the read pointer is pointed to the starting position of the second buffer area where the image data is currently being written to perform data reading to read the image data currently being written to the second buffer area.
[0181] Optionally, the detection module is specifically used to:
[0182] Obtaining the current clock frequency of the input source, the current clock frequency of the display unit, the number of scan lines corresponding to the current vertical synchronization pulse of the input source, and the number of scan lines corresponding to the current vertical synchronization pulse of the display unit;
[0183] Detecting whether an absolute value of a first difference between a current clock frequency of the input source and a current clock frequency of the display unit is not greater than a first predetermined threshold, and whether an absolute value of a second difference between a number of scanning lines corresponding to a current vertical synchronization pulse of the input source and a number of scanning lines corresponding to a current vertical synchronization pulse of the display unit is not greater than a second predetermined threshold;
[0184] When the absolute value of the first difference is not greater than the first predetermined threshold and the absolute value of the second difference is not greater than the second predetermined threshold, it is determined that the display unit and the input source meet the clock matching condition; otherwise, it is determined that the display unit and the input source do not meet the clock matching condition.
[0185] Optionally, performing clock following processing on the display unit includes:
[0186] If it is detected that the absolute value of the first difference is greater than a first predetermined threshold, firstly performing a first following process on the display unit, and then performing a second following process on the display unit, so as to perform a clock following process;
[0187] or,
[0188] If it is detected that the absolute value of the first difference is not greater than the first predetermined threshold but the absolute value of the second difference is greater than the second predetermined threshold, performing a second following process on the display unit to perform a clock following process;
[0189] The first following process is used to adjust a period corresponding to a clock frequency of the display unit, and the second following process is used to adjust a phase of the clock frequency of the display unit.
[0190] Optionally, the first follow-up processing includes:
[0191] The frequency difference between the current clock frequency of the display unit and the current clock frequency of the input source is input to the clock frequency modulation hardware of the display unit, so that the clock frequency modulation hardware responds to the frequency difference being a positive number and uses the numerical value of the frequency difference as the expected reduction amount to reduce the frequency value of the clock frequency of the display unit by adjusting the period corresponding to the clock frequency of the display unit, and responds to the frequency difference being a negative number and uses the numerical value of the frequency difference as the expected increase amount to increase the frequency value of the clock frequency of the display unit by adjusting the period corresponding to the clock frequency of the display unit, so as to obtain the clock frequency of the display unit after the first follow-up processing; wherein the absolute value of the difference between the clock frequency of the display unit after the first follow-up processing and the clock frequency of the input source is not greater than the first predetermined threshold.
[0192] Optionally, the second follow-up processing includes:
[0193] The line number difference of the display unit relative to the input source is input to the clock frequency modulation hardware of the display unit, so that the clock frequency modulation hardware adjusts the phase of the clock frequency of the display unit by adjusting the phase corresponding to the clock frequency of the display unit in response to the line number difference being a positive number, taking the numerical value of the line number difference as the expected reduction amount, and adjusts the phase of the clock frequency of the display unit by adjusting the phase corresponding to the clock frequency of the display unit in response to the line number difference being a negative number, taking the numerical value of the line number difference as the expected increase amount, to obtain the clock frequency of the display unit after the second follow-up processing; wherein the line number difference is the difference between the number of scan lines corresponding to the current vertical synchronization pulse of the display unit and the number of scan lines corresponding to the current vertical synchronization pulse of the input source; wherein the absolute value of the difference between the number of scan lines corresponding to the vertical synchronization pulse of the display unit after the second follow-up processing and the number of scan lines corresponding to the vertical synchronization pulse of the input source is not greater than the second predetermined threshold.
[0194] Optionally, the detection module includes:
[0195] A detection submodule, configured to detect whether the display unit and the input source meet a clock matching condition when any one of the predetermined trigger conditions is met;
[0196] The predetermined trigger conditions include: the resolution of the image data transmitted by the input source changes, and the input source is connected to the video source interface of the electronic device.
[0197] In the technical solution of this application, the operations involved in obtaining, storing, using, processing, transmitting, providing and disclosing user personal information are all carried out with the user's authorization.
[0198] The present application also provides an electronic device, such as Figure 8 As shown, including:
[0199] Memory 801, used for storing computer programs;
[0200] The processor 802 is used to implement any of the above-mentioned video display methods when executing the program stored in the memory 801.
[0201] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 802, the communication interface, and the memory 801 communicate with each other via the communication bus.
[0202] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0203] The communication interface is used for communication between the above electronic device and other devices.
[0204] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0205] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0206] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned video display methods is implemented.
[0207] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the video display methods in the above embodiments.
[0208] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0209] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0210] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0211] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A video display method, It is characterized in that Applied to electronic equipment, the method comprises: Detecting whether a display unit and an input source of the electronic device meet a clock matching condition; In response to not satisfying the clock matching condition, performing clock following processing on the display unit; wherein the clock following processing is used to make the display unit and the input source satisfy the clock matching condition; In the process of the clock following processing, based on the first processing mode, the image data to be displayed transmitted by the input source is subjected to read and write processing for the cache area; wherein the first processing mode is a mode in which the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading is completed; In response to reading each frame of image data, the read image data is displayed using the display unit.
2. The method according to claim 1, It is characterized in that Based on the first processing mode, performing read and write processing on the cache area for the image data to be displayed transmitted by the input source, includes: Based on a polling writing method for multiple first cache areas, each frame of image data transmitted by the input source is sequentially written into a current cache area to be written in the multiple first cache areas; wherein the first cache area is a cache area for storing a single frame of image data; In response to each time the display unit performs screen refresh according to its own clock frequency, a target cache area currently being written to in each first cache area is determined, a read pointer is pointed to a start position of a cache area before the target cache area, and image data is read from the previous cache area; The previous cache area is a cache area before the target cache area in the polling sequence indicated by the polling write.
3. The method according to claim 1, It is characterized in that The method further comprises: When it is detected that the clock following processing is completed, the image data to be displayed transmitted by the input source is read and written to the cache area based on the second processing mode; wherein the second processing mode is a mode in which the reading of the same frame of image data has a row-level delay relative to the writing.
4. The method according to claim 3, It is characterized in that Based on the second processing mode, performing read and write processing on the cache area for the image data to be displayed transmitted by the input source, includes: Writing each frame of image data transmitted by the input source into the second buffer area in sequence; wherein the second buffer area is a buffer area for storing single-frame image data; In response to each time the display unit performs screen refresh according to its own clock frequency, the read pointer is pointed to the starting position of the second buffer area where the image data is currently being written to perform data reading to read the image data currently being written to the second buffer area.
5. The method according to any one of claims 1 to 4, It is characterized in that The detecting whether the display unit and the input source meet a clock matching condition comprises: Obtaining the current clock frequency of the input source, the current clock frequency of the display unit, the number of scan lines corresponding to the current vertical synchronization pulse of the input source, and the number of scan lines corresponding to the current vertical synchronization pulse of the display unit; Detecting whether an absolute value of a first difference between a current clock frequency of the input source and a current clock frequency of the display unit is not greater than a first predetermined threshold, and whether an absolute value of a second difference between a number of scanning lines corresponding to a current vertical synchronization pulse of the input source and a number of scanning lines corresponding to a current vertical synchronization pulse of the display unit is not greater than a second predetermined threshold; When the absolute value of the first difference is not greater than the first predetermined threshold and the absolute value of the second difference is not greater than the second predetermined threshold, it is determined that the display unit and the input source meet the clock matching condition; otherwise, it is determined that the display unit and the input source do not meet the clock matching condition.
6. The method according to claim 5, It is characterized in that The performing clock following processing on the display unit comprises: If it is detected that the absolute value of the first difference is greater than a first predetermined threshold, firstly performing a first following process on the display unit, and then performing a second following process on the display unit, so as to perform a clock following process; or, If it is detected that the absolute value of the first difference is not greater than the first predetermined threshold but the absolute value of the second difference is greater than the second predetermined threshold, performing a second following process on the display unit to perform a clock following process; The first following process is used to adjust a period corresponding to a clock frequency of the display unit, and the second following process is used to adjust a phase of the clock frequency of the display unit.
7. The method according to claim 6, It is characterized in that The first follow-up processing method includes: The frequency difference between the current clock frequency of the display unit and the current clock frequency of the input source is input to the clock frequency modulation hardware of the display unit, so that the clock frequency modulation hardware responds to the frequency difference being a positive number and uses the numerical value of the frequency difference as the expected reduction amount to reduce the frequency value of the clock frequency of the display unit by adjusting the period corresponding to the clock frequency of the display unit, and responds to the frequency difference being a negative number and uses the numerical value of the frequency difference as the expected increase amount to increase the frequency value of the clock frequency of the display unit by adjusting the period corresponding to the clock frequency of the display unit, so as to obtain the clock frequency of the display unit after the first follow-up processing; wherein the absolute value of the difference between the clock frequency of the display unit after the first follow-up processing and the clock frequency of the input source is not greater than the first predetermined threshold.
8. The method according to claim 6, It is characterized in that The processing method of the second follow-up processing includes: inputting the line number difference of the display unit relative to the input source to the clock frequency modulation hardware of the display unit, so that the clock frequency modulation hardware responds to the line number difference as a positive number, takes the numerical value of the line number difference as the expected reduction, and adjusts the phase of the clock frequency of the display unit by adjusting the phase corresponding to the clock frequency of the display unit; and responds to the line number difference as a negative number, takes the numerical value of the line number difference as the expected increase, and adjusts the phase of the clock frequency of the display unit by adjusting the phase corresponding to the clock frequency of the display unit, so as to obtain the clock frequency of the display unit after the second follow-up processing; wherein the line number difference is the difference between the number of scan lines corresponding to the current vertical synchronization pulse of the display unit and the number of scan lines corresponding to the current vertical synchronization pulse of the input source; wherein the absolute value of the difference between the number of scan lines corresponding to the vertical synchronization pulse of the display unit after the second follow-up processing and the number of scan lines corresponding to the vertical synchronization pulse of the input source is not greater than the second predetermined threshold.
9. The method according to any one of claims 1 to 4, It is characterized in that The detecting whether the display unit and the input source meet a clock matching condition comprises: In the case where any one of the predetermined trigger conditions is met, detecting whether the display unit and the input source meet a clock matching condition; The predetermined trigger conditions include: the resolution of the image data transmitted by the input source changes, and the input source is connected to the video source interface of the electronic device.
10. A video display device, It is characterized in that Applied to electronic equipment, the device comprises: A detection module, used to detect whether the display unit and the input source of the electronic device meet the clock matching condition; A clock following processing module, configured to perform clock following processing on the display unit in response to not satisfying the clock matching condition; wherein the clock following processing is configured to make the display unit and the input source satisfy the clock matching condition; A first read / write processing module is used to perform read / write processing on a cache area for the image data to be displayed transmitted by the input source based on a first processing mode during the clock following processing; wherein the first processing mode is a mode in which the reading of the same frame of image data has a frame-level delay relative to the writing, and any frame of image data will not be overwritten before the reading is completed; The display module is used for displaying the read image data by using the display unit in response to reading each frame of image data.
11. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-9 when executing a program stored in a memory.
12. A computer program product, It is characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 9 when being executed by a processor.
Citation Information
Patent Citations
Test method and device adaptive to different types of display screens and terminal equipment
CN110570793A
Distributed video synchronous display system, video synchronous display method and storage medium
CN113453053A
Data processing method and electronic equipment
CN115550709A
Video stitching synchronization control method and electronic equipment
CN115604505A
Image display method and device, electronic equipment and medium
CN117667000A
Cited By
Cross-screen synchronization method, device, equipment and system based on distributed computing
CN119697414A
