Background
In the prior art, on-screen display (OSD) technology, i.e. an on-screen menu type adjustment method, is often required for devices such as televisions and Personal Computers (PCs). A rectangular menu related to various adjusting function information of the display is popped up on a screen of a television or a PC through triggering a corresponding key, and various working indexes of the display, including color, mode and the like, are adjusted through the menu, so that the optimal use state is achieved.
For example, when a user performs operations such as changing channels and adjusting volume or image quality on a television, the OSD technology can display information on the operation status of the user on the screen in real time, and the displayed information is generally referred to as OSD information. According to different actual settings, the OSD information can be displayed at any position on the screen.
The following describes a specific implementation of the OSD technique with reference to the structure of the image display system.
Fig. 1 is a schematic structural diagram of a conventional image display system. As shown in fig. 1, the system mainly includes an interface unit, an OSD editor, an OSD buffer, an image input device, an image mixer, an image display, and the like.
The user can make a series of settings through the interface unit, including: setting the size of an image input by the image input device, setting the display position and size of OSD information on a screen, setting the color of OSD information display, setting whether OSD is available, setting the size of an OSD buffer, and the like.
The image input device is used for inputting image data to be displayed, and usually, the image data is input in units of frames, and the image data may be dynamic data input from a Sensor (Sensor) or static data stored in a memory.
The OSD buffer is used for storing OSD data, and the size of the occupied space can be determined according to actual needs, for example, the width is 320 bits (Bit), the height is 16 bits, and each Bit corresponds to one pixel point. The values of the pixel points are different according to the difference of the OSD information to be displayed. For example, assuming that the user adjusts the volume of the television, the OSD information displayed on the screen is as shown in fig. 2, where a rectangle 1 represents the screen size, a rectangle 2 represents the display position and size of the OSD information on the screen, a slash area in the rectangle 2 represents the volume size, and the larger the proportion of the slash area in the rectangle 2 is, the larger the volume is; then, in the OSD buffer, the value of the pixel point corresponding to the oblique line region in the rectangle 2 and the border of the whole rectangle 2 may be set to 1, and for other pixel points, the value may be set to 0. When the image display displays the OSD information, the OSD information may be correspondingly displayed in different colors according to the difference of the values of the pixels, specifically, the pixel with the value of 1 is displayed as the preset display color of the OSD information, and the pixel with the value of 0 is displayed as the color on the black or transparent display screen.
In practical applications, data may be written into the OSD buffer by the OSD editor, and 1 column is written each time, and 320 columns are written sequentially in the order from left to right, i.e. from the 1 st column to the 320 th column. The OSD editor can obtain OSD data through the interface unit.
The image mixer is used for inquiring whether the OSD set in the interface unit is available, if so, merging the image data output by the image input device and the OSD data output by the OSD buffer, and outputting the merged data to the image display, and if not, only outputting the image data output by the image input device to the image display. Then, the image display performs image display according to the received data.
However, the above processing method has a problem in practical applications, for example, when the user adjusts the volume of the television, the OSD information displayed on the screen changes in real time, that is, the OSD data stored in the OSD buffer also changes in real time. As can be seen from the foregoing description, the OSD data is written by the OSD editor, whereas the conventional OSD editor writes the OSD data by default, i.e., each time 320 columns of data are rewritten in order from left to right. However, as can be seen from fig. 2, in many cases, the OSD data in a part of the columns (e.g., columns 250 to 300) may be changed, for example, if the user turns the volume of the television set to be large, the diagonal area is only partially increased on the original basis in fig. 2, and the original diagonal area is not changed, that is, the OSD data in the columns corresponding to the area is not changed.
Therefore, the conventional OSD editor does not need to rewrite all OSD data, and the editing speed of the OSD buffer is reduced, so that the processing speed of the whole image display system is reduced.
Detailed Description
Aiming at the problems in the prior art, the invention provides an improved OSD buffer editing scheme, namely when the OSD buffer needs to be edited, firstly, the obtained OSD data required by editing the OSD buffer is compared with the stored OSD data required by editing the OSD buffer at the previous moment, and a changed column is determined; and then re-writes OSD data only to the column where the change occurred. Compared with the prior art, the scheme of the invention does not need to rewrite all the columns in the OSD buffer, thereby improving the editing speed of the OSD buffer.
In addition, in the prior art, when writing OSD data into the OSD buffer, the OSD data is usually written into each column sequentially according to the order from left to right, but in the scheme of the present invention, the writing direction of the OSD data can be set arbitrarily, that is, from left to right, or from right to left, so as to facilitate the use of the user.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings by way of examples.
FIG. 3 is a schematic diagram illustrating a composition structure of an OSD buffer editing apparatus according to an embodiment of the invention. As shown in fig. 3, includes: a comparison unit 31 and an editing unit 32.
The comparison unit 31 is configured to acquire OSD data required for editing the OSD buffer, compare the acquired OSD data with the saved OSD data required for editing the OSD buffer at the previous time, determine a column that changes, and notify the editing unit 32 of the column;
and an editing unit 32 for rewriting OSD data only into the column in which the change has occurred.
In this embodiment, the comparison unit 31 needs to always store the OSD data (all 320 columns of OSD data) required when the OSD buffer is last edited, so that when the OSD buffer needs to be edited again, it can be found out through comparison which columns need to be rewritten with the OSD data. After the OSD buffer is edited every time, the OSD data required by the editing is used for replacing the OSD data stored before.
The editing unit 32 may further include a setting subunit 321 and a writing subunit 322.
The device shown in fig. 3 can be operated in the following ways according to actual requirements:
1) in a first mode
The comparing unit 31 obtains OSD data required for editing the OSD buffer, compares the obtained OSD data with the saved OSD data required for editing the OSD buffer at the previous time, determines a column in which a change occurs, and notifies the setting subunit 321.
The setting subunit 321, after receiving the notification from the comparing unit 31, sets an OSD edit indication bit set in advance to identify that the OSD buffer needs to be edited, for example, 1 is used to identify that the OSD buffer needs to be edited, and 0 is used to identify that the OSD buffer does not need to be edited; and simultaneously, setting a preset editing position indication bit as a column identifier of a certain column in the columns which are changed, setting the editing position indication bit as a column identifier of another column which is changed after the OSD editor re-writes OSD data into the column identified by the column identifier until all the columns which are changed are re-written with the OSD data, and setting the OSD editing indication bit as the position which does not need to be edited in the OSD buffer.
In this embodiment, the column identifiers set on the edit position indication bits can be sequentially updated in the order of the smaller number to the larger number.
The write subunit 322 reads the OSD edit indication bit, determines that the OSD buffer needs to be edited, reads the edit position indication bit, determines that the column of the OSD data needs to be rewritten, and reads the OSD edit indication bit again after the writing is completed, if it is determined that the OSD buffer needs to be continuously edited, the edit position indication bit is read again, and if the OSD buffer does not need to be edited, the processing is ended.
2) Mode two
The comparing unit 31 obtains OSD data required for editing the OSD buffer, compares the obtained OSD data with the saved OSD data required for editing the OSD buffer at the previous time, determines a column in which a change occurs, and notifies the setting subunit 321.
The setting subunit 321, after receiving the notification from the comparing unit 31, sets the preset OSD edit indication bits to identify that the OSD buffer needs to be edited, sets the preset edit position indication bits as the column identification of the column with the smallest number in the changed columns, and sets the preset column number change indication bits as the total number of the changed columns.
The write subunit 322 reads the OSD edit indicator, determines that the OSD buffer needs to be edited, reads the edit position indicator and the column number change indicator, and sequentially rewrites OSD data into N consecutive columns in the order from left to right starting from the column identified by the read column identifier, where the value of N is equal to the total number of columns that have changed.
3) Mode III
The comparing unit 31 obtains OSD data required for editing the OSD buffer, compares the obtained OSD data with the saved OSD data required for editing the OSD buffer at the previous time, determines a column in which a change occurs, and notifies the setting subunit 321.
The setting subunit 321, after receiving the notification from the comparing unit 31, sets the preset OSD edit indication bits to identify that the OSD buffer needs to be edited, sets the preset edit position indication bits as the column identification of the designated column, sets the preset column number change indication bits as the total column number that changes, and sets the direction indication bits as the designated writing direction.
The write subunit 322 reads the OSD edit indicator, determines that the OSD buffer needs to be edited, reads the edit position indicator, the column number change indicator and the direction indicator, and sequentially rewrites OSD data into N consecutive columns in accordance with the specified write direction from the column identified by the read column identifier, where the value of N is equal to the total number of columns that have changed.
Wherein the specified writing direction is a writing direction from left to right or a writing direction from right to left; when the writing direction is from left to right, the specified column is the column with the minimum number in the changed columns; and when the writing direction is from right to left, the specified column is the column with the largest number in the changed columns.
It can be seen that the above three ways are the same in nature, that is, the setup subunit 321 indicates which columns of the write subunit 322 have changed, and then the write subunit 322 rewrites OSD data into these columns, but the specific indication ways are different.
In the first method, the column identifiers of the changed columns are sequentially indicated to the write subunit 322, and the write subunit 322 sequentially rewrites OSD data in the indicated columns. For example, if the column that changes is columns 250 to 255, it first indicates that column 250 has changed, and the write subunit 322 rewrites OSD data into column 250, and then indicates that column 251 has changed, and the write subunit 322 rewrites OSD data into column 251, and so on.
In the second method, the column identifier of the column with the smallest number and the total number of columns with changes are indicated to the writing subunit 322, and then the writing subunit 322 rewrites OSD data into the columns with changes in sequence from left to right starting from the column with the smallest number. For example, if the changed columns are columns 250 to 255, the column id of column 250 and the total number of columns 6 that have changed are indicated to the write subunit 322, and then the write subunit 322 rewrites the OSD data into column 250, column 251, column 252, column 253, column 254, and column 255 in sequence starting from column 250.
In the second method, the write subunit 322 rewrites OSD data into the columns that change sequentially from left to right by default.
And the third mode is based on the second mode, and a flexible processing mode is further added, namely writing can be performed according to the sequence from left to right, and writing can also be performed according to the sequence from right to left.
In practical applications, one of the three manners may be selected as required to achieve better processing effect, for example, if the changed columns are consecutive in number, the second manner or the third manner may be preferred, and if the changed columns are discontinuous in number, the third manner may be preferred.
In addition, in the above embodiments, how the write subunit 322 obtains the OSD data is the prior art, and is not described again.
Based on the above-mentioned apparatus, fig. 4 is a flowchart of an editing method of the OSD buffer according to an embodiment of the present invention. As shown in fig. 4, the method comprises the following steps:
step 41: and acquiring OSD data required by editing the OSD buffer, comparing the acquired OSD data with the stored OSD data required by editing the OSD buffer at the previous moment, and determining the changed columns.
Step 42: the OSD data is rewritten only to the column in which the change occurred.
In this step, the method of rewriting OSD data into the changed column may be:
setting a preset OSD editing indicating bit to identify that the OSD buffer needs to be edited, simultaneously setting the preset editing position indicating bit as a column identifier of one of the columns which are changed, setting the editing position indicating bit as a column identifier of another column which is changed after the OSD data is rewritten in the column identified by the column identifier until the OSD data is rewritten in all the columns which are changed, and setting the OSD editing indicating bit as not needing to edit the OSD buffer; reading the OSD editing indicating bit, determining that the OSD buffer needs to be edited, reading the editing position indicating bit, determining that the column of the OSD data needs to be rewritten, reading the OSD editing indicating bit again after the writing is finished, reading the editing position indicating bit again if the OSD buffer needs to be edited, and ending the processing if the OSD buffer does not need to be edited.
Or, setting a preset OSD editing indicating bit to identify that the OSD buffer needs to be edited, simultaneously setting a preset editing position indicating bit as a column identification of a column with the minimum number in the changed columns, and setting a preset column number change indicating bit as the total number of the changed columns; reading OSD editing indicating bits, determining that the OSD buffer needs to be edited, reading editing position indicating bits and column number change indicating bits, and sequentially rewriting OSD data into continuous N columns from the read columns identified by the column identifications in a left-to-right sequence, wherein the value of N is equal to the total number of the changed columns.
Then or, the preset OSD editing indicating bit is set to mark that the OSD buffer is required to be edited, meanwhile, the preset editing position indicating bit is set as the column mark of the appointed column, the preset column number change indicating bit is set as the total column number which is changed, and the direction indicating bit is set as the appointed writing direction; reading OSD editing indicating bits, determining that an OSD buffer needs to be edited, reading editing position indicating bits, column number change indicating bits and direction indicating bits, and sequentially rewriting OSD data into continuous N columns from the read columns identified by the column identifications according to the specified writing direction, wherein the value of N is equal to the total number of the changed columns.
The specified writing direction is a writing direction from left to right or a writing direction from right to left;
when the writing direction is from left to right, the specified column is the column with the minimum number in the changed columns; and when the writing direction is from right to left, the specified column is the column with the largest number in the changed columns.
The specific workflow of the method embodiment shown in fig. 4 refers to the corresponding description in the apparatus embodiment shown in fig. 3, and is not repeated here.
In a word, the technical scheme of the invention improves the editing speed of the OSD buffer. Moreover, when the OSD buffer is edited, a more flexible writing mode is provided, namely data can be written into the changed columns according to the sequence from left to right, and data can be written into the changed columns according to the sequence from right to left, so that the use by a user is facilitated.
In summary, the above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.