Main implementation methods and types of OSD

Source: Internet
Author: User

There are currently two main OSD Implementation Methods: overlay and synthesis between external OSD generators and video processors; inside the Video Processor

Supports OSD and overwrites OSD information directly in the video cache.

The principle of superposition and synthesis between the external OSD generator and the video processor is that a built-in character generator and display cache of MCU can use fast-Blank) the signal switches between the TV screen and OSD display content, so that the OSD characters and other content are superimposed on the final display screen. During the OSD and display screen overlay process, by adjusting the ratio between the two, you can achieve the semi-transparent (blending) effect of OSD. At the same time, the red, green, and Blue signals in the OSD signal are re-encoded to obtain different OSD color effects.

Another method is to enable the video processor to support OSD and directly overlay the OSD information in the video cache. This type of video processing usually has an external memory or a small amount of internal row cache, and An OSD generator. The synthesis and control of OSD are directly completed in the video cache, it also has the translucent and color control functions described above.

OSD has two types: memory type (font-based) and bitmap type (bit-map.

Balanced OSD: Memory OSD generators are used in early and low-cost solutions to save the display cache, the principle is to split the content displayed in OSD into blocks according to the specific format (12 × 18, 12 × 16, etc, for example, the numbers 0-9, letters A-Z, commonly used brightness, contrast symbols, and so on, and the content is solidified in ROM or flash, only the corresponding index number is stored in the display cache. Such a "Dictionary" structure can greatly reduce the need to display the cache. At the same time, in order to provide control over the color and other attributes of each character, it usually has an attribute cache of the same size as the display cache, its attributes (foreground color, background color, flashing, etc) valid for each pixel of the entire character. To make up for the disadvantage that this method cannot specify a color for each pixel, The OSD generator designer provides a solution that combines multiple display caches to present multi-color characters. The principle is that each display cache determines a color scheme. When two or more display caches are merged, you can "piece together" the multi-color characters in more than two colors.

The advantage of balanced OSD is that it can use a small number of internal display caches of OSD, And the MCU only needs to specify the index of the displayed content to display the corresponding OSD information, which can be achieved on a relatively low-speed MCU. However, the above display information and color encoding method are not intuitive enough, which may cause some trouble for Firmware Development of the fuse-type OSD. This type of OSD is usually used on LCD monitors, low-cost flat-panel TVs, and conventional CRT TVs, and is still dominant in the market.

Compared with balanced OSD, the processing principle of Bitmap OSD is more intuitive and simple: By changing each pixel in a specific area of the final display content, the OSD information is directly superimposed on the final display screen, the pixel-based control method ensures multi-color and sufficient performance. The bitmap OSD generator is usually built in the video processor and shared with its primary display cache. There are also professional OSD bitmap generators independent of video processors, such as Maxim's max4455. Generally, this type of chip requires external SDRAM as the display cache.

In theory, the display effect of Bitmap OSD can be very perfect. It can provide a variety of objects with a three-dimensional sense like Windows, such as shadow buttons, color-Rich graphics and text, its disadvantage is that it must have sufficient OSD display cache and the MCU speed requirements for pixel-based processing. This type of OSD is usually used on large-sized high-end flat panel TVs and professional displays. With the continuous development of technology and the ever-decreasing cost of storage, the future OSD should be Bitmap-type.

Basic UI elements and definitions of OSD

The purpose of displaying OSD is to express information to users. What information needs to be expressed? It usually includes prompts, warning information, and numerical display of control parameters. Although whatever the display shape, it is essentially a combination of characters or pixels, the classification and attribute definition of the information helps firmware developers to process the unified encoding and code. This article attempts to classify and analyze these elements and provides a unified solution for firmware processing.

1. Basic concepts of OSD

UI Language: The Language type used by the text part of the OSD content.

Ui mode: it refers to the environment in which OSD content is applicable, for example, the pattern changes caused by different signal sources (TVs, DVDs, and PCs). Its role is to differentiate the different performance of OSD in different environments.

Ui scenario: a specific page applicable to OSD in a specific language mode and when there are many information pages.

UI events: the operation commands provided by the user to the UI system by entering the device.

Ui action table: indicates the index table for UI input commands in a specific UI scenario.

OSD canvas: it refers to the entire OSD area, usually a rectangular area.

OSD position: usually refers to the relative position of the origin point in the upper left corner of the OSD canvas.

OSD object: a pixel combination that is displayed on the canvas and expresses specific information and has specific attributes.

2. Basic elements contained by OSD

OSD information mainly includes the following basic elements (this article may not be accurate, and readers may want to understand it ): area, label, icon, text, progress bar, animation, number, optional icon, navigation information, etc. The definitions, functions, attributes, and response events of these elements are given below.

A. Region

Definition: a rectangle or an area of any shape indicated by a specific attribute (color, blinking, size, etc.) in the OSD canvas.

Purpose: classify or mark OSD content, such as the title area and content area.

Attribute: location, color, and flicker.

RESPONSE event: as a fixed information content, it usually does not respond to the control of UI input.

B. Label)

Definition: fixed text information, which can be one or more lines.

Purpose: provide necessary text descriptions for OSD content.

Attributes: location, color, flicker, language type, Case sensitivity, alignment, etc.

RESPONSE event: as a fixed information content, it usually does not respond to the control of UI input.

C. icon)

Definition: A combination of specific characters or pixels to form identifiable information.

Purpose: perform image prompts on OSD content, such as playing or disabling specific symbols.

Attribute: location, color, and flicker.

RESPONSE event: as a fixed information content, it usually does not respond to the control of UI input.

D. Text)

Definition: Compared with labels, it is also text information, but can be changed with user operations.

Purpose: Provide text prompts about user selection based on the selected text content.

Attributes: location, color, language type, Case sensitivity, alignment, etc.

RESPONSE event: the user's choice, usually the previous or next one.

E. Progress bar)

Definition: an object in a rectangular bar changes its related characteristics as its values are different. In the future, there may be such objects in other shapes,

Such as the oil gauge, but they all have the same attributes.

Purpose: Give A Graphical description of a specific value on the graphic interface.

Attributes: location, color, upper and lower limits, current value, type, size, and whether to display values.

RESPONSE event: Numeric value change.

F. animation (movie)

Definition: A combination of icons that change over time.

Purpose: use activity graphs to make the OSD interface more vivid and improve the information expression effect.

Attribute: location, color, number of icons, change speed, etc.

RESPONSE event: as a fixed information content, it usually does not respond to the control of UI input.

G. Number

Definition: A combination of numbers that change with the relevant parameters or user selection. It can be in decimal or other hexadecimal notation, or in percent or other numerical form.

Purpose: intuitively give the numeric indicator about a parameter. It is usually used in conjunction with the progress bar to achieve both intuitive and visual effects.

Attributes: location, color, upper and lower limits, current value, and base selection.

RESPONSE event: changes the value of the corresponding parameter.

H. Option)

Definition: A combination of icons that change with the relevant parameters or user selection.

Purpose: graphical representation of user selection, such as selection, unselected, enabled, and disabled.

Attribute: location, color, blinking, and number of options.

RESPONSE event: changes the selection of corresponding parameters.

I. Navigation Information

Definition: displays the information prompted for user operations in the current UI scenario on the OSD canvas.

Purpose: Instruct the user to perform operations on related buttons and OSD content. Generally, there are indications of available buttons and necessary text instructions, which are usually used as a measure to improve the OSD prompt information and make the man-machine interface friendly.

Attribute: location, color, and flickering.

RESPONSE event: Ui scenario, button changes.

Use an object-based method to process OSD UI

The traditional processing method is to "Draw" OSD objects in specific scenarios one by one using the code. When a specific UI event occurs, use a bunch of if Else To identify specific scenarios and operation objects, and perform corresponding OSD processing. When OSD is relatively simple, it is a feasible method. However, when there are many OSD scenarios and modes, the IF else structure will become very large, and more importantly, it is easy to make mistakes and increase maintenance costs. As OSD becomes more complex and code workload increases, people realize that we need to spend too much time on these "superficial articles, the development time of the really important application layer and device driver layer will be affected, thus affecting the development progress of new products. Firmware engineers are also reluctant to repeatedly write the same code to meet the specific OSD needs of customers. I encountered the same troubles in the early days. In the face of the inefficiency of engineers in the department, I felt the importance of developing a unified OSD UI platform. Now, the analysis of the above osd ui allows us to develop an independent and unified development tool independent of the hardware environment of a specific Digital Video Processor platform and OSD mechanism. In fact, important providers of flat display chip solutions, such as genesis and pixelworks, have provided Windows-based Firmware Development Tools with such features to accelerate the development and application of their products. This article attempts to explore the operating principles of this type of tool. Perhaps readers can develop the tools they need based on this article. Of course, its application is more representative.

I have used this structure in my recent LCD TV development case:

Typedef struct

{

Byte mode; // applicable mode of the UI scenario

Byte LAN; // UI Language

Byte scene; // UI scenario

Byte last; // The scenario on the UI

Byte next; // In the UI scenario

Byte sel; // The selection of objects in the current UI scenario

Byte sel_total; // The total number of items selected in the current UI scenario

Byte * Info; // The Object Pointer of the UI

Byte pos_v; // vertical position of the object

Byte pos_h; // position of the object in the horizontal direction

Byte col_f; // foreground color of the object

Byte col_ B; // background color of the object

Byte ATT; // other display attributes of the object

Act_struct (* Act) []; // response action table pointer of the object

Byte * Note; // navigation description

} Ui_struct;

This structure is used to describe the basic attributes of An OSD object and define its corresponding actions. Using this structure to clearly describe each object in the scenario, the OSD content of a specific UI scenario can be determined, at the same time, it is determined that there are all UI features such as the previous scenario, the next scenario, and the action response features. Such information forms an array, which is translated and described by a unified "Interpretation platform" to complete the UI construction. This is a bit similar to the Interpretation Language, and all we need to do is to write these "scripts ", the OSD "Drawing" of objects is done by the "interpretation" platform calling the driver code of the external OSD generator. When you need to change the OSD generator or the platform based on different plane display controllers, you only need to update a small amount of OSD driver code to implement the "platform-independent" UI system ". We need to construct the data structure of related objects so that the "interpretation" platform can identify object types and draw them correctly. For example

The following structure describes a language option (Text object:

Void ui_changelan ()

{

Ui_lan = val_lan;

Redraw ();

}

Code byte * str_lan_chn [] =

{

"Chinese ",

"English ",

"French ",

"Spanish ",

};

Code word txt_lan_chn [] =

{

// The total number of optional items of the variable corresponding to the text resource corresponding to the flag of the Text object

Res_txt, str_lan_chn, val_lan, sizeof (str_lan_chn)/sizeof (byte *), ui_changelan

};

The first data res_txt indicates to the "interpretation" platform that the object is a text with a text data structure. Based on this, the "interpretation" platform reads subsequent data according to the predefined structure. The second data indicates that the source of the text content is str_lan_chn, the third data indicates the variable to be used to determine the number of data items in the text resource. The fourth data indicates the number of optional text items in the object, the last data specifies what needs to be done when the object changes. In this way, the "interpretation" platform obtains enough information to "Draw" A language option, and can automatically execute the ui_changelan () function when a change occurs, help programmers complete the operations required for language changes. In fact, all these structures can be customized, as long as they are consistent with the "interpretation" platform. With such an OSD driver structure, once the "interpretation" platform is built, what OSD developers need to do will become the various object blocks supported by the platform, place and pile up to construct the OSD graphics, without having to rewrite the implementation code and focus on the driver code details related to specific hardware platforms. Furthermore, even with the placement and design of these building blocks, we can design an intuitive windows application to complete various shapes-> Character Component Generator, OSD graphical interface design, and generate the final resource file and UI data array, and connect and compile with the underlying "interpretation" platform to obtain the final MCU code. Such An OSD interface development environment will get rid of abstraction, boredom, and inefficiency, become intuitive and interesting, and even allow customers to design their own OSD interfaces, there is no need for programming experience or an understanding of the underlying OSD driver. It should be noted that, compared with the traditional if else, the structured osd ui processing mechanism will increase the size of the final program and slow the running speed, however, these disadvantages are negligible when the MCU program space is increasing and the supported clock frequency is increasing. Therefore, this solution may not be applicable if the processing speed and program memory of MCU are limited. Taking the LCD TV project developed by the author as an example, the total number of programs of the MCS51 multi-task system is smaller than 32 kb when it supports all TV functions, text, beauty, games, calendar, and other additional functions, however, the myson mtv230-based OSD + MCU processor runs very fast without any delay. The development environment that supports bitmap OSD usually uses x86 or faster arm processors and has a storage space larger than 2 MB.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.