An OSD display method, device, equipment and medium
Patent Information
- Application Number
- CN202310800192.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-06-30
AI Technical Summary
[0005]为了消除闪烁的现象,另一类显示方式是在OSD引擎内部增加双缓冲器(buffer),需要增加OSD引擎内部的RAM的大小,造成成本的增加
[0032]在本申请实施例中,若接收到调整指令,根据调整指令中携带的场景信息,确定场景信息对应的OSD图层的第一属性信息和第二属性信息,将第一属性信息保存到系统存储器,并将第二属性信息保存到OSD引擎的寄存器;从而预先准备好绘制待显示的OSD图层所需的第一属性信息和第二属性信息,并且将内容较多的第一属性信息保存到系统存储器大大节省了OSD引擎的SRAM资源;当检测到vsync信号时,将系统存储器中保存的第一属性信息同步到OSD引擎的SRAM,并将OSD引擎的寄存器的配置信息更新为第二属性信息,以使OSD引擎根据SRAM中保存的第一属性信息和寄存器中更新后的配置信息,绘制并显示OSD图层,从而消除了OSD图层在显示时出现闪烁的现象,也不会使用户感知到绘制过程。
Smart Images

Figure CN117014564B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of embedded interface display, and in particular to a method, apparatus, device and medium for displaying on-screen menu adjustment (OSD). Background Technology
[0002] Character-based OSDs are typically used on monitors to generate special characters or graphics on the monitor screen.
[0003] There are two common types of character OSD display methods in existing technologies:
[0004] To conserve OSD engine resources in static random-access memory (SRAM), one display method involves meshing the OSD layer during OSD rendering, dividing the OSD layer into a predetermined number of uniformly sized OSD grids. Upon receiving an adjustment command, the system identifies the differences in attribute information between the OSD layer corresponding to the command and the currently displayed OSD layer—that is, the updated attribute information of the OSD grid that needs updating. This updated attribute information is directly saved to the OSD engine's SRAM and registers. The OSD engine then renders and displays the updated OSD grid based on the updated attribute information in the SRAM and registers, thus obtaining the OSD layer corresponding to the adjustment command. Because this method saves the updated attribute information directly to the OSD engine's SRAM and registers in real-time, and the OSD engine renders based on the attribute information stored in the SRAM and registers in real-time, this method is highly efficient. For example, when adjusting Chinese to English, a large number of OSD grids need to be updated, resulting in a large amount of updated attribute information. The process of determining and saving this updated attribute information to SRAM and registers takes time. This causes SRAM and registers to simultaneously contain the attribute information of the currently displayed OSD layer and some updated attribute information. Since the OSD engine draws in real-time based on the attribute information stored in SRAM and registers, display confusion occurs. To avoid this, the portion of the currently displayed OSD layer corresponding to the updated OSD grid can be cleared first. This means clearing the portion of the attribute information of the currently displayed OSD layer stored in SRAM and registers that corresponds to the updated attribute information. For example, if the adjustment command is to change Chinese to English, only the attribute information corresponding to the text portion of the OSD layer is cleared; the graphical parts of the OSD layer, such as the display window, can remain cleared. This allows the OSD engine to draw multiple updated OSD grids based on the updated attribute information in SRAM and registers, thus obtaining the OSD layer corresponding to the adjustment command. Because clearing the content of the currently displayed OSD layer produces a flickering effect, the drawing process is visually perceptible to the user.
[0005] To eliminate flickering, another display method is to add a double buffer inside the OSD engine. This requires increasing the size of the RAM inside the OSD engine, which increases the cost.
[0006] Therefore, how to provide an OSD display method to eliminate flickering in character OSDs and save OSD engine resources is a technical problem that urgently needs to be solved. Summary of the Invention
[0007] This application provides an OSD display method, apparatus, device, and medium for eliminating flickering in character-type OSDs and saving OSD engine resources.
[0008] In a first aspect, this application provides an OSD display method, the method comprising:
[0009] If an adjustment instruction is received, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined according to the scene information carried in the adjustment instruction. The first attribute information is saved to the system memory, and the second attribute information is saved to the register of the OSD engine.
[0010] When a vertical synchronization (vsync) signal is detected, the first attribute information stored in the system memory is synchronized to the SRAM of the OSD engine, and the configuration information of the register is updated to the second attribute information.
[0011] The OSD layer is drawn and displayed based on the first attribute information stored in the SRAM and the updated configuration information in the register.
[0012] In one possible implementation, before synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the registers to the second attribute information when the vsync signal is detected, the method further includes:
[0013] Determine whether the system memory stores first attribute information and whether the register stores second attribute information; if both determinations are yes, proceed to the next step of synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the register to the second attribute information.
[0014] In one possible implementation, after determining the first attribute information and the second attribute information of the OSD layer corresponding to the scene information, and before saving the first attribute information to the system memory and the second attribute information to the OSD engine register, the method further includes:
[0015] Determine whether the attribute information stored in the SRAM is the third attribute information corresponding to the previous adjustment instruction, and whether the configuration information of the register is the fourth attribute information corresponding to the previous adjustment instruction; if so, proceed to the subsequent steps of saving the first attribute information to the system memory and saving the second attribute information to the register of the OSD engine.
[0016] In one possible implementation, saving the first attribute information to system memory and saving the second attribute information to the OSD engine register includes:
[0017] Based on the first attribute information and the third attribute information, first update attribute information is determined and saved to the system memory; based on the second attribute information and the fourth attribute information, second update attribute information is determined and saved to the OSD engine register.
[0018] In one possible implementation, saving the first attribute information stored in the system memory to the OSD engine's SRAM includes:
[0019] The first attribute information stored in the system memory is moved to the OSD engine's SRAM via Direct Memory Access (DMA).
[0020] In one possible implementation, the storage space of the system memory is not less than the storage space of the SRAM.
[0021] Secondly, this application provides an OSD display device, the device comprising:
[0022] The storage module is used to, upon receiving an adjustment instruction, determine the first attribute information and the second attribute information of the OSD layer corresponding to the scene information based on the scene information carried in the adjustment instruction, save the first attribute information to the system memory, and save the second attribute information to the register of the OSD engine.
[0023] The synchronization module is used to synchronize the first attribute information stored in the system memory to the SRAM of the OSD engine when the field synchronization vsync signal is detected, and to update the configuration information of the register to the second attribute information.
[0024] The display module is used to draw and display the OSD layer based on the first attribute information stored in the SRAM and the updated configuration information in the register.
[0025] In one possible implementation, the storage module is further configured to save the first attribute information to the system memory and the second attribute information to the OSD engine register, and then generate an attribute information synchronization flag.
[0026] The synchronization module is specifically used to synchronize the first attribute information stored in the system memory to the SRAM of the OSD engine when the attribute information to be synchronized flag and the vsync signal are detected, and to update the configuration information of the register to the second attribute information.
[0027] In one possible implementation, the saving module is further configured to determine whether there is an attribute information synchronization flag generated after the third attribute information corresponding to the previous adjustment instruction is saved to the system memory and the fourth attribute information corresponding to the previous adjustment instruction is saved to the OSD engine register; if not, then proceed with the subsequent steps of saving the first attribute information to the system memory and the second attribute information to the OSD engine register.
[0028] In one possible implementation, the storage module is specifically configured to determine first updated attribute information based on the first attribute information and the third attribute information, and save the first updated attribute information to the system memory; and determine second updated attribute information based on the second attribute information and the fourth attribute information, and save the second updated attribute information to the register of the OSD engine.
[0029] In one possible implementation, the storage module is specifically used to move the first attribute information stored in the system memory to the OSD engine's SRAM via direct memory access (DMA).
[0030] Thirdly, this application also provides an electronic device, which includes at least a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the steps of any of the methods described above.
[0031] Fourthly, this application also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of any of the methods described above.
[0032] In this embodiment, if an adjustment instruction is received, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined according to the scene information carried in the adjustment instruction. The first attribute information is saved to the system memory, and the second attribute information is saved to the OSD engine register. This prepares the first and second attribute information required to draw the OSD layer to be displayed in advance, and saving the more extensive first attribute information to the system memory greatly saves the OSD engine's SRAM resources. When the vsync signal is detected, the first attribute information saved in the system memory is synchronized to the OSD engine's SRAM, and the configuration information of the OSD engine's registers is updated to the second attribute information. This allows the OSD engine to draw and display the OSD layer according to the first attribute information saved in the SRAM and the updated configuration information in the registers, thereby eliminating the flickering phenomenon of the OSD layer during display and preventing the user from perceiving the drawing process. Attached Figure Description
[0033] To more clearly illustrate the implementation methods in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0034] Figure 1 A schematic diagram of an OSD display process is provided for some embodiments of this application;
[0035] Figure 2 A schematic diagram of the hardware structure of an OSD display provided for some embodiments of this application;
[0036] Figure 3 Another schematic diagram of an OSD display process provided for some embodiments of this application;
[0037] Figure 4 A schematic diagram of the structure of an OSD display device is provided for some embodiments of this application;
[0038] Figure 5 This is a schematic diagram of the structure of an electronic device provided for some embodiments of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, a further detailed description of this application will be provided below with reference to the accompanying drawings. Obviously, the embodiments described in this application are merely some embodiments, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0040] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0041] The terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar or related objects or entities, and do not necessarily imply a specific order or sequence, unless otherwise specified. It should be understood that such terms are interchangeable where appropriate.
[0042] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0043] The term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0044] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0045] This application provides an OSD display method, apparatus, device, and medium. In this OSD display method, upon receiving an adjustment command, based on scene information carried in the adjustment command, first attribute information and second attribute information of the OSD layer corresponding to the scene information are determined, and the first attribute information is saved to the system memory. When a vsync signal is detected, the first attribute information saved in the system memory is synchronized to the SRAM of the OSD engine, and the configuration information of the OSD engine registers is updated to the second attribute information. Based on the first attribute information saved in the SRAM and the updated configuration information in the registers, the OSD layer is drawn and displayed.
[0046] To eliminate flickering in character-based OSD displays and conserve SRAM resources of the OSD engine, this application provides an OSD display method, apparatus, device, and medium.
[0047] In some embodiments, Figure 1 A schematic diagram of the OSD display process provided for some embodiments of this application, such as... Figure 1 As shown, the process includes the following steps:
[0048] S101: If an adjustment instruction is received, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined according to the scene information carried in the adjustment instruction. The first attribute information is saved to the system memory, and the second attribute information is saved to the register of the OSD engine.
[0049] The OSD engine drawing method provided in this application embodiment is applied to electronic devices with displays, such as televisions.
[0050] There are two common methods for displaying character-based OSDs in existing technologies: To save SRAM resources in the OSD engine, one method involves meshing the OSD layer during the OSD drawing process, that is, dividing the OSD layer into a preset number of uniformly sized OSD grids. Upon receiving an adjustment command, the system determines the attribute information that differs between the OSD layer corresponding to the adjustment command and the currently displayed OSD layer—that is, the updated attribute information of the OSD grid that needs to be updated. This updated attribute information is directly saved to the OSD engine's SRAM and registers. The OSD engine then draws and displays the updated OSD grid based on the updated attribute information in the SRAM and registers, thus obtaining the OSD layer corresponding to the adjustment command. Because this method saves the updated attribute information directly to the OSD engine's SRAM and registers in real time, and the OSD engine draws in real time based on the attribute information stored in the SRAM and registers, this method is highly efficient. For example, when adjusting Chinese to English, a large number of OSD grids need to be updated, resulting in a large amount of updated attribute information. The process of determining and saving this updated attribute information to SRAM and registers takes time. This causes SRAM and registers to simultaneously contain the attribute information of the currently displayed OSD layer and some updated attribute information. Since the OSD engine draws in real-time based on this information, display confusion occurs. To avoid this, the content corresponding to the updated OSD grid in the currently displayed OSD layer needs to be cleared first. This means clearing the portion of the attribute information of the currently displayed OSD layer stored in SRAM and registers that corresponds to the updated attribute information. This allows the OSD engine to draw multiple updated OSD grids based on the updated attribute information in SRAM and registers, thus obtaining the OSD layer corresponding to the adjustment instruction. Because clearing the content of the currently displayed OSD layer produces a flickering effect, the drawing process is visually perceptible to the user. To eliminate flickering, another display method is to add a double buffer inside the OSD engine, which requires increasing the size of the RAM inside the OSD engine, thus increasing costs.
[0051] Based on this, in order to eliminate flickering during OSD display and conserve OSD engine resources, this application provides an OSD display method. In the application (APP) corresponding to the OSD engine of the electronic device, the user can select adjustment instructions for the scene to be drawn. These adjustment instructions carry scene information. The scene information includes, but is not limited to, adjusting volume, adjusting image quality, and modifying menu language. For each scene, first and second attribute information of the OSD layer are pre-stored. The first attribute information includes, but is not limited to, pallet information, index information, and resource information of the OSD layer. The second attribute information includes, but is not limited to, information such as the display position, graphic shape, and graphic size of each area of the OSD layer.
[0052] In this embodiment, a buffer area with a storage space no smaller than the SRAM of the OSD engine can be prepared in the system memory of the electronic device to store the first attribute information of the OSD layer. The system memory can be Double Data Rate SDRAM (DDR). By storing the first attribute information of the OSD layer in the system memory first, the SRAM resources of the OSD engine are saved.
[0053] To eliminate OSD flickering during display, in this embodiment, if an adjustment command is received, the first and second attribute information of the OSD layer corresponding to the scene information carried in the adjustment command are determined. To conserve SRAM resources of the OSD engine, in this embodiment, the memory-intensive first attribute information is first saved to system memory, for example, in a pre-defined DDR buffer area. Since the second attribute information occupies less memory, it can be directly saved to the OSD engine's registers. Furthermore, because the OSD engine locks the registers during the drawing and display of the OSD layer corresponding to the previous adjustment command, the second attribute information saved in the registers is not actually effective at this time and will not affect the currently displayed OSD layer.
[0054] S102: When the vsync signal is detected, the first attribute information stored in the system memory is synchronized to the SRAM of the OSD engine, and the configuration information of the OSD engine registers is updated to the second attribute information.
[0055] Since vsync is applied between two frames, it indicates the end of the previous frame and the beginning of the new frame. vsync is a relatively long pulse, possibly lasting for one or several lines of scan time, but during this period, no pixel signals appear; this period is called the field blanking period. Therefore, when the vsync signal is detected, the first attribute information stored in the system memory can be synchronously synchronized to the SRAM of the OSD engine, and the configuration information of the OSD engine registers can be updated to the second attribute information. This allows the OSD engine to directly draw and display the OSD layer corresponding to the scene information based on the first attribute information stored in the SRAM and the updated configuration information of the registers. In this embodiment, there is no need to clear the attribute information of the OSD layer corresponding to the previous adjustment instruction stored in the SRAM and registers. Furthermore, the process of synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the OSD engine registers to the second attribute information is extremely short and is completed during the field blanking period, ensuring flicker-free OSD display, and the user will not perceive the OSD layer drawing process.
[0056] Specifically, for example, direct memory access (DMA) can be used to move the first attribute information stored in the system memory to the SRAM of the OSD engine. The second attribute information is then updated to the register configuration information, that is, the register configuration information is modified to reflect the second attribute information.
[0057] S103: Draw and display the OSD layer based on the first attribute information stored in the SRAM and the updated configuration information in the register.
[0058] The OSD engine of an electronic device can directly draw and display the OSD layer corresponding to the scene information based on the first attribute information stored in SRAM and the updated configuration information in the register.
[0059] In this embodiment, the first and second attribute information required for drawing the OSD layer are prepared in advance. The first attribute information is cached using the shared system memory resources of the electronic device, while the second attribute information is stored in the OSD engine's registers. When the vsnyc signal arrives, the first attribute information cached in the system memory is quickly synchronized to the OSD engine's SRAM during the field blanking period. Simultaneously, the configuration information of the OSD engine's registers is updated to the second attribute information, ensuring flicker-free drawing and display of the OSD layer in each frame. This approach ensures flicker-free character OSD updates while maximizing the conservation of OSD engine SRAM resources, eliminating OSD display flicker through shared system memory resources and a synchronization mechanism.
[0060] In this embodiment, if an adjustment instruction is received, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined according to the scene information carried in the adjustment instruction. The first attribute information is saved to the system memory, and the second attribute information is saved to the register of the OSD engine. This prepares the first and second attribute information required to draw the OSD layer to be displayed in advance, and saving the first attribute information to the system memory first saves the SRAM resources of the OSD engine. When the vsync signal is detected, the first attribute information saved in the system memory is synchronously synchronized to the SRAM of the OSD engine, and the configuration information of the OSD engine register is updated to the second attribute information. This allows the OSD engine to draw and display the OSD layer directly according to the first attribute information saved in the SRAM and the updated configuration information in the register. This saves the SRAM resources of the OSD engine and eliminates the flickering phenomenon of the OSD layer during display.
[0061] To further eliminate the flickering phenomenon of OSD layers during display, based on the above embodiments, in this embodiment, before synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the register to the second attribute information when the vsync signal is detected, the method further includes:
[0062] Determine whether the system memory stores first attribute information and whether the register stores second attribute information; if both determination results are yes, then proceed to the following steps: synchronize the first attribute information stored in the system memory to the SRAM of the OSD engine, and update the configuration information of the register to the second attribute information.
[0063] To further eliminate flickering of OSD layers during display and avoid display confusion, before synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the register configuration information to the second attribute information, it can be determined whether the first attribute information is stored in the system memory and whether the second attribute information is stored in the register.
[0064] If all judgment results are "yes," it means that the attribute information required to draw the OSD layer to be displayed, including the first attribute information and the second attribute information, is ready. The subsequent steps involve synchronizing the first attribute information stored in the system memory to the OSD engine's SRAM and updating the register configuration information to the second attribute information. If any judgment result is "no," it means that the attribute information required to draw the OSD layer to be displayed is not ready, and the subsequent steps are not performed.
[0065] Specifically, for example, after saving the first attribute information to system memory and the second attribute information to the OSD engine's registers, the electronic device's software can set attribute information synchronization flags, such as the reg_en synchronization flag. Before synchronizing attribute information, if the electronic device's hardware determines that the reg_en synchronization flag exists, it means that the first attribute information is already stored in system memory and the second attribute information is already stored in the registers. Then, the subsequent steps of synchronizing the first attribute information stored in system memory to the OSD engine's SRAM and updating the register configuration information to the second attribute information can proceed.
[0066] Specifically, when the hardware of the electronic device determines that the reg_en synchronization flag is effective, it will detect the vsync signal. Upon detecting the vsync signal, the hardware will start to quickly synchronize the first attribute information to the corresponding area of the SRAM of the OSD engine via DMA. This operation is actually completed during the field blanking period. At the same time, the configuration information of the register is updated to the second attribute information. That is, the hardware makes the updated second attribute information of the register effective. In this way, the first attribute information and the updated configuration information of the register stored in the SRAM of the OSD engine are both attribute information of the OSD layer corresponding to the adjustment instruction, ensuring that the OSD display is flicker-free.
[0067] The hardware structure of the OSD display in this application embodiment will be further illustrated below with a specific example.
[0068] On the hardware side of the OSD engine, at least two types of drawing modules can be provided, including a character (font) module and an element (element) module. The function of the drawing module is determined according to the specific configuration of each drawing component, and the drawing module is driven to complete the drawing.
[0069] Figure 2 This is a schematic diagram of a hardware structure for an OSD display provided for some embodiments of this application. Specifically, as shown... Figure 2As shown in this embodiment, the OSD display hardware includes two types of drawing module groups: the OSD element module group (Osdelement Group) and the OSD character module group (Osd font Group). The Osd element Group is used to draw element layers in the OSD layer that contain rectangles, lines, and grids. The element module Osd_element_(xN)Group_0 of the Osd element Group can be equipped with multiple sets of registers (regs), for example, x sets, to store second attribute information for different regions. Taking Osd_font_reg_0 as an example, when the reg_en synchronization flag (reg_en sync) and vsync signal are detected, the configuration information of Osd_font_reg_0 can be updated to the second attribute information, so that the generation component Osd_element_gen_0 draws each region in the element layer sequentially according to the updated configuration information of Osd_element_reg_0, thereby obtaining the element layer and outputting the argb data of that layer. The Osd font Group is used to draw character layers in the OSD layer that contain characters and bitmaps. The Osd font group can also be equipped with multiple sets of regs to store second attribute information for different regions, and at least one SRAM to store first attribute information for different regions. Taking Osd_font_reg_0 as an example, when the reg_en sync and vsync signals are detected, the first attribute information stored in the system memory DDR is transferred to the OSD engine's SRAM via DMA through read / write (wr) operations. The configuration information of Osd_font_reg_0 is updated with the second attribute information, so that the generation component Osd_font_gen_0 can draw the character layer according to the first attribute information of the characters to be displayed stored in the SRAM and the updated configuration information of Osd_font_reg_0, and output the ARB data of the layer. The first attribute information in the SRAM includes, but is not limited to, pallet information, index information, and resource information.
[0070] To avoid OSD display clutter, in some embodiments, based on the above embodiments, and in this application embodiment, after determining the first attribute information and the second attribute information of the OSD layer corresponding to the scene information, and before saving the first attribute information to the system memory and the second attribute information to the OSD engine register, the method further includes:
[0071] Determine whether the attribute information stored in the SRAM is the third attribute information corresponding to the previous adjustment instruction, and whether the configuration information of the register is the fourth attribute information corresponding to the previous adjustment instruction; if so, proceed to the subsequent steps of saving the first attribute information to the system memory and saving the second attribute information to the register of the OSD engine.
[0072] To avoid OSD display confusion, after determining the first and second attribute information of the OSD layer corresponding to the scene information, before saving the first attribute information to the system memory and synchronizing the second attribute information to the OSD engine register, it can be determined whether the attribute information saved in SRAM is the third attribute information corresponding to the previous adjustment instruction, and whether the register configuration information is the fourth attribute information corresponding to the previous adjustment instruction.
[0073] If both judgments are true, it means the OSD layer corresponding to the previous adjustment instruction is being drawn and displayed, and the subsequent steps of saving the first attribute information to system memory and the second attribute information to the OSD engine register are performed. If either judgment is false, it means the OSD layer corresponding to the previous adjustment instruction is not being drawn and displayed correctly, and the subsequent steps are not performed.
[0074] Specifically, for example, after the electronic device's software saves the third attribute information to the system memory and the fourth attribute information to the OSD engine's registers, the software sets a synchronization flag for the attribute information, namely the reg_en synchronization flag. If the electronic device's hardware confirms the existence of the reg_en synchronization flag, it means that the third attribute information has been saved in the hardware system memory and the fourth attribute information has been saved in the registers. Then, the subsequent steps of synchronizing the third attribute information saved in the system memory to the OSD engine's SRAM and updating the register configuration information to the fourth attribute information can proceed. When the reg_en synchronization flag is active, the hardware detects the vsync signal. Upon detecting the vsync signal, it first clears the reg_en synchronization flag, notifying the software that the hardware settings have now taken effect. Before the software of the electronic device saves the attribute information, if it is determined that the reg_en synchronization flag set according to the previous adjustment instruction does not exist, it means that the hardware OSD engine is drawing and displaying the OSD layer corresponding to the previous adjustment instruction based on the third attribute information saved in SRAM and the configuration information updated by the register according to the fourth attribute information. Then, the subsequent steps of saving the first attribute information to the system memory and saving the second attribute information to the OSD engine register can be performed.
[0075] In this embodiment of the application, before saving the first attribute information and the second attribute information, it is first determined that the SRAM contains the third attribute information corresponding to the previous adjustment instruction, and the register configuration information is the fourth attribute information corresponding to the previous adjustment instruction, and then the information is saved, thereby avoiding OSD display confusion.
[0076] The following example further illustrates the process of setting and canceling the attribute information synchronization flag in this embodiment of the application.
[0077] Figure 3 This diagram illustrates a process for setting and canceling an attribute information synchronization flag, as provided in some embodiments of this application. Specifically, as shown... Figure 3 As shown, the process includes the following steps:
[0078] S301: If the software of the electronic device receives an adjustment instruction and determines that there is no reg_en sync set according to the previous adjustment instruction, it determines the first attribute information and the second attribute information of the OSD layer corresponding to the scene information according to the scene information carried in the adjustment instruction, saves the first attribute information to the system memory, and saves the second attribute information to the register of the OSD engine.
[0079] S302: Software settings for electronic devices: reg_en sync.
[0080] S303: When the hardware of the electronic device detects reg_en sync and vsync, it synchronizes the first attribute information stored in the system memory to the SRAM of the OSD engine and updates the configuration information of the registers to the second attribute information.
[0081] S304: Hardware clearing of electronic devices reg_en sync.
[0082] When the electronic device's software receives the next adjustment command and determines that there is no `reg_en sync` set according to the current adjustment command, it can determine the first and second attribute information of the OSD layer corresponding to the scene information based on the scene information carried in the next adjustment command. The first attribute information is saved to system memory, and the second attribute information is saved to the OSD engine's registers. Each rendering can be completed within one frame. This cycle eliminates OSD display flickering or desynchronization issues.
[0083] To improve the efficiency of OSD layer drawing and display, based on the above embodiments, in this embodiment, saving the first attribute information to the system memory and saving the second attribute information to the OSD engine register includes:
[0084] Based on the first attribute information and the third attribute information, first update attribute information is determined and saved to the system memory; based on the second attribute information and the fourth attribute information, second update attribute information is determined and saved to the OSD engine register.
[0085] To improve the efficiency of OSD engine rendering and display, after determining the attribute information corresponding to the currently received adjustment command, but before saving the attribute information, the updated attribute information can be determined based on the attribute information corresponding to the currently received adjustment command and the attribute information corresponding to the previous adjustment command, and then the updated attribute information can be saved.
[0086] For example, by comparing the attribute information corresponding to the currently received adjustment instruction with that corresponding to the attribute information of the previous adjustment instruction, it can be determined whether there is any identical sub-attribute information. If no identical sub-attribute information exists, the attribute information corresponding to the currently received adjustment instruction can be directly identified as the updated attribute information. If identical sub-attribute information exists, then all attribute information except for that sub-attribute information can be identified as the updated attribute information; that is, only the attribute information that needs to be changed is identified as the updated attribute information. This allows the SRAM and registers of the OSD engine to only synchronously update attribute information, improving the efficiency of the OSD engine's drawing and display.
[0087] Specifically, based on the first attribute information corresponding to the currently received adjustment instruction and the third attribute information corresponding to the previous adjustment instruction, it can be determined whether there is a first sub-attribute information in the first attribute information that is the same as the third attribute information. If it exists, the first attribute information other than the first sub-attribute information is determined as the first updated attribute information; if it does not exist, the first attribute information is directly determined as the first updated attribute information, and the first updated attribute information is saved to the system memory. Based on the second attribute information corresponding to the currently received adjustment instruction and the fourth attribute information corresponding to the previous adjustment instruction, it can be determined whether there is a second sub-attribute information in the second attribute information that is the same as the fourth attribute information. If it exists, the second attribute information other than the second sub-attribute information is determined as the second updated attribute information; if it does not exist, the second attribute information is directly determined as the second updated attribute information, and the second updated attribute information is saved to the OSD engine register.
[0088] In this embodiment, before saving the attribute information corresponding to the currently received adjustment instruction, the updated attribute information that needs to be changed is determined based on the attribute information and the attribute information corresponding to the previous adjustment instruction. Only the updated attribute information is saved, so that the SRAM and registers of the OSD engine will only synchronize the updated attribute information that needs to be changed, thereby improving the drawing and display efficiency of the OSD engine.
[0089] To eliminate OSD display flicker and improve OSD display efficiency, based on the above embodiments, in this application embodiment, synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine includes:
[0090] The first attribute information stored in the system memory is moved to the SRAM of the OSD engine through direct memory access (DMA).
[0091] DMA can quickly move primary attribute information stored in system memory to the SRAM of the OSD engine. DMA can also support specifying multiple groups of data to be moved sequentially at once. The DMA can be configured by grouping the primary attribute information according to its starting position and length, and then determining the moving order. This saves bandwidth, provides greater flexibility, and prevents issues related to non-contiguous data addresses.
[0092] In one possible implementation, after determining the first attribute information and the second attribute information corresponding to the current adjustment instruction, saving the first attribute information to the system memory, and saving the second attribute information to the OSD engine register, the first update attribute information can be determined based on the first attribute information and the third attribute information corresponding to the previous adjustment instruction, and the first update attribute information can be synchronized to the OSD engine's SRAM; and the second update attribute information can be determined based on the second attribute information and the fourth attribute information corresponding to the previous adjustment instruction, and the configuration information of the OSD engine register can be updated based on the second update attribute information.
[0093] Specifically, synchronizing the first updated attribute information to the OSD engine's SRAM includes: grouping the data according to the starting position and length of the first updated attribute information and determining the transfer order, so that the DMA can transfer the data according to the grouping and the transfer order.
[0094] To ensure that the OSD layer can be displayed normally while eliminating OSD flickering, based on the above embodiments, in this embodiment, the storage space of the system memory is not less than the storage space of the SRAM.
[0095] In this embodiment, a buffer area with a size no smaller than the SRAM storage space of the OSD engine can be prepared in the system memory of the electronic device to store the first attribute information of the OSD layer.
[0096] Specifically, for example, the storage space of this buffer area can be equal to the SRAM space of the OSD engine. In this way, the buffer area can just store the first attribute information of the OSD layer corresponding to an adjustment command, so that storage space is sufficient and will not be wasted.
[0097] Based on the same technical concept, and building upon the above embodiments, some embodiments provide an OSD display device. Figure 4 A schematic diagram of the structure of an OSD display device is provided for some embodiments of this application, such as... Figure 4 As shown, the device includes:
[0098] The storage module 401 is used to, if an adjustment instruction is received, determine the first attribute information and the second attribute information of the OSD layer corresponding to the scene information according to the scene information carried in the adjustment instruction, save the first attribute information to the system memory, and save the second attribute information to the register of the OSD engine.
[0099] Synchronization module 402 is used to synchronize the first attribute information stored in the system memory to the SRAM of the OSD engine when a field synchronization vsync signal is detected, and to update the configuration information of the register to the second attribute information.
[0100] Display module 403 is used to draw and display OSD layers based on the first attribute information stored in the SRAM and the updated configuration information in the register.
[0101] In one possible implementation, the storage module 401 is further configured to save the first attribute information to the system memory and the second attribute information to the OSD engine register, and then generate an attribute information synchronization flag.
[0102] The synchronization module 402 is specifically used to synchronize the first attribute information stored in the system memory to the SRAM of the OSD engine when the attribute information to be synchronized flag and the vsync signal are detected, and to update the configuration information of the register to the second attribute information.
[0103] In one possible implementation, the storage module 401 is further configured to determine whether there is an attribute information synchronization flag generated after the third attribute information corresponding to the previous adjustment instruction is saved to the system memory and the fourth attribute information corresponding to the previous adjustment instruction is saved to the OSD engine register; if not, then the subsequent steps of saving the first attribute information to the system memory and saving the second attribute information to the OSD engine register are performed.
[0104] In one possible implementation, the storage module 401 is specifically configured to determine first updated attribute information based on the first attribute information and the third attribute information, and save the first updated attribute information to the system memory; and determine second updated attribute information based on the second attribute information and the fourth attribute information, and save the second updated attribute information to the register of the OSD engine.
[0105] In one possible implementation, the storage module 401 is specifically used to transfer the first attribute information stored in the system memory to the SRAM of the OSD engine via direct memory access (DMA).
[0106] The OSD display device can be deployed on electronic devices that include a display screen.
[0107] Based on the same technical concept, and building upon the above embodiments, an electronic device is provided in some embodiments.
[0108] Figure 5 This is a schematic diagram of the structure of an electronic device provided for some embodiments of this application. For example... Figure 5 As shown, the electronic device includes: processor 501, communication interface 502, memory 503 and communication bus 504, wherein the processor 501, communication interface 502 and memory 503 communicate with each other through communication bus 504.
[0109] The memory 503 stores a computer program, which, when executed by the processor 501, causes the processor 501 to perform the following steps:
[0110] If an adjustment instruction is received, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined according to the scene information carried in the adjustment instruction. The first attribute information is saved to the system memory, and the second attribute information is saved to the register of the OSD engine.
[0111] When a vertical synchronization (vsync) signal is detected, the first attribute information stored in the system memory is synchronized to the SRAM of the OSD engine, and the configuration information of the register is updated to the second attribute information.
[0112] The OSD layer is drawn and displayed based on the first attribute information stored in the SRAM and the updated configuration information in the register.
[0113] In one possible implementation, the processor 501 is further configured to:
[0114] Determine whether the system memory stores first attribute information and whether the register stores second attribute information; if both determinations are yes, proceed to the next step of synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the register to the second attribute information.
[0115] In one possible implementation, the processor 501 is further configured to:
[0116] Determine whether the attribute information stored in the SRAM is the third attribute information corresponding to the previous adjustment instruction, and whether the configuration information of the register is the fourth attribute information corresponding to the previous adjustment instruction; if so, proceed to the subsequent steps of saving the first attribute information to the system memory and saving the second attribute information to the register of the OSD engine.
[0117] In one possible implementation, the processor 501 is further configured to:
[0118] Based on the first attribute information and the third attribute information, first update attribute information is determined and saved to the system memory; based on the second attribute information and the fourth attribute information, second update attribute information is determined and saved to the OSD engine register.
[0119] In one possible implementation, the processor 501 is further configured to:
[0120] The first attribute information stored in the system memory is moved to the OSD engine's SRAM via Direct Memory Access (DMA).
[0121] Since the principle of the above-mentioned electronic device in solving the problem is similar to that of the OSD display method, the implementation of the above-mentioned electronic device can be referred to the implementation of the method, and the repeated parts will not be described again.
[0122] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0123] Communication interface 502 is used for communication between the above-mentioned electronic device and other devices.
[0124] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0125] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0126] Based on the same technical concept, and building upon the above embodiments, in some embodiments, a computer-readable storage medium is provided, which stores a computer program executable by an electronic device. When the program is run on the electronic device, the electronic device performs the following steps:
[0127] If an adjustment instruction is received, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined according to the scene information carried in the adjustment instruction. The first attribute information is saved to the system memory, and the second attribute information is saved to the register of the OSD engine.
[0128] When a vertical synchronization (vsync) signal is detected, the first attribute information stored in the system memory is synchronized to the SRAM of the OSD engine, and the configuration information of the register is updated to the second attribute information.
[0129] The OSD layer is drawn and displayed based on the first attribute information stored in the SRAM and the updated configuration information in the register.
[0130] In one possible implementation, before synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the registers to the second attribute information when the vsync signal is detected, the method further includes:
[0131] Determine whether the system memory stores first attribute information and whether the register stores second attribute information; if both determinations are yes, proceed to the next step of synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the register to the second attribute information.
[0132] In one possible implementation, after determining the first attribute information and the second attribute information of the OSD layer corresponding to the scene information, and before saving the first attribute information to the system memory and the second attribute information to the OSD engine register, the method further includes:
[0133] Determine whether the attribute information stored in the SRAM is the third attribute information corresponding to the previous adjustment instruction, and whether the configuration information of the register is the fourth attribute information corresponding to the previous adjustment instruction; if so, proceed to the subsequent steps of saving the first attribute information to the system memory and saving the second attribute information to the register of the OSD engine.
[0134] In one possible implementation, saving the first attribute information to system memory and saving the second attribute information to the OSD engine register includes:
[0135] Based on the first attribute information and the third attribute information, first update attribute information is determined and saved to the system memory; based on the second attribute information and the fourth attribute information, second update attribute information is determined and saved to the OSD engine register.
[0136] In one possible implementation, saving the first attribute information stored in the system memory to the OSD engine's SRAM includes:
[0137] The first attribute information stored in the system memory is moved to the OSD engine's SRAM via Direct Memory Access (DMA).
[0138] The aforementioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in an electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs), etc.
[0139] In this embodiment, if an adjustment instruction is received, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined according to the scene information carried in the adjustment instruction. The first attribute information is saved to the system memory, and the second attribute information is saved to the OSD engine register. This prepares the first and second attribute information required to draw the OSD layer to be displayed in advance, and saving the more extensive first attribute information to the system memory greatly saves the OSD engine's SRAM resources. When the vsync signal is detected, the first attribute information saved in the system memory is synchronized to the OSD engine's SRAM, and the configuration information of the OSD engine's registers is updated to the second attribute information. This allows the OSD engine to draw and display the OSD layer according to the first attribute information saved in the SRAM and the updated configuration information in the registers, thereby eliminating the flickering phenomenon of the OSD layer during display and preventing the user from perceiving the drawing process.
[0140] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0141] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0142] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0143] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0144] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. An OSD display method for adjusting screen menus, characterized in that, The method includes: If an adjustment instruction is received, based on the scene information carried in the adjustment instruction, the first attribute information and the second attribute information of the OSD layer corresponding to the scene information are determined. The first attribute information is saved to the system memory, and the second attribute information is saved to the register of the OSD engine. The first attribute information includes the pallet information, index information, and resource information of the OSD layer; the second attribute information includes the display position, graphic shape, and graphic size of each area of the OSD layer. When the field synchronization (vsync) signal is detected, the first attribute information stored in the system memory is synchronized to the OSD engine's SRAM, and the configuration information of the register is updated to the second attribute information so that the register configuration takes effect. The OSD layer is drawn and displayed based on the first attribute information stored in the SRAM and the updated configuration information in the register.
2. The method according to claim 1, characterized in that, Before synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the registers to the second attribute information when the vsync signal is detected, the method further includes: Determine whether the system memory stores first attribute information and whether the register stores second attribute information; if both determinations are yes, proceed to the next step of synchronizing the first attribute information stored in the system memory to the SRAM of the OSD engine and updating the configuration information of the register to the second attribute information.
3. The method according to claim 1, characterized in that, After determining the first attribute information and the second attribute information of the OSD layer corresponding to the scene information, and before saving the first attribute information to the system memory and the second attribute information to the OSD engine register, the method further includes: Determine whether the attribute information stored in the SRAM is the third attribute information corresponding to the previous adjustment instruction, and whether the configuration information of the register is the fourth attribute information corresponding to the previous adjustment instruction, wherein the third attribute information is the first attribute information corresponding to the previous adjustment instruction, and the fourth attribute information is the second attribute information corresponding to the previous adjustment instruction; if so, proceed to the subsequent steps of saving the first attribute information to the system memory and saving the second attribute information to the register of the OSD engine. If not, it is determined that the OSD layer corresponding to the previous adjustment command is not being drawn and displayed correctly, and subsequent steps will not be performed.
4. The method according to claim 3, characterized in that, Saving the first attribute information to the system memory and the second attribute information to the OSD engine register includes: Based on the first attribute information and the third attribute information, first update attribute information is determined and saved to the system memory; based on the second attribute information and the fourth attribute information, second update attribute information is determined and saved to the OSD engine register.
5. The method according to any one of claims 1-4, characterized in that, The step of saving the first attribute information stored in the system memory to the OSD engine's SRAM includes: The first attribute information stored in the system memory is moved to the OSD engine's SRAM via Direct Memory Access (DMA).
6. The method according to any one of claims 1-4, characterized in that, The storage space of the system memory is not less than the storage space of the SRAM.
7. An OSD display device, characterized in that, The device includes: The storage module is used to, upon receiving an adjustment instruction, determine the first attribute information and the second attribute information of the OSD layer corresponding to the scene information based on the scene information carried in the adjustment instruction, save the first attribute information to the system memory, and save the second attribute information to the register of the OSD engine. The first attribute information includes the pallet information, index information, and resource information of the OSD layer; the second attribute information includes the display position, graphic shape, and graphic size of each area of the OSD layer. The synchronization module is used to synchronize the first attribute information stored in the system memory to the SRAM of the OSD engine when the field synchronization vsync signal is detected, and to update the configuration information of the register to the second attribute information so that the configuration of the register takes effect. The display module is used to draw and display the OSD layer based on the first attribute information stored in the SRAM and the updated configuration information in the register.
8. The apparatus according to claim 7, characterized in that, The storage module is further configured to save the first attribute information to the system memory and the second attribute information to the OSD engine register, and then generate an attribute information synchronization flag. The synchronization module is specifically used to synchronize the first attribute information stored in the system memory to the SRAM of the OSD engine when the attribute information to be synchronized flag and the vsync signal are detected, update the configuration information of the register to the second attribute information, and clear the attribute information to be synchronized flag.
9. An electronic device, characterized in that, The electronic device includes at least a processor and a memory, the processor being configured to implement the steps of the method as described in any one of claims 1-6 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Hidden subtitle display method, intelligent terminal and storage medium
CN112752164A
Virtual Memory Device (VMD) Application / Driver with Dual-Level Interception for Data-Type Splitting, Meta-Page Grouping, and Diversion of Temp Files to Ramdisks for Enhanced Flash Endurance
US20130145085A1