The swosd implementation of the dm368ipnc rewrite Architecture

Source: Internet
Author: User

Appro's ipnc only implements the English OSD superposition, even a small ASCII code table is not completely covered, and the swosd architecture is often messy.

In fact, it is nothing more than two functions. One is to overlay text, but to overlay images. Considering video streams compatible with different resolutions, the processing branch is relatively proofread.

The overlapping of images is not implemented for the time being, and the most used is the superposition of Chinese characters. The method for overlapping Chinese OSD is also very simple, as shown below:

1. Understand the distribution of the Chinese font, and calculate the position of the Chinese character in the font based on the internal code of the Chinese character.

2. Learn about the distribution of ASCII character libraries. Use the ASCII value of a letter to calculate the position of the corresponding character in the font (this is relatively simple and it is not difficult to understand Chinese characters)

3. On the PC, convert the desired Chinese and English fonts to the dot matrix font data (or directly convert the data to the YUV format. I use the dot matrix data)

4. Understand the storage mode in YUV format (this is not difficult)

5. At last, the dot matrix data converted from a Chinese string is superimposed at the specified position of YUV to implement Chinese superposition. If the time is superimposed, the system time is obtained in real time, convert the time to a string, and then dynamically overlay the time to YUV.

Is the effect after superposition, is it OK.

Appro's ipnc only implements the English OSD superposition, even a small ASCII code table is not completely covered, and the swosd architecture is often messy.

In fact, it is nothing more than two functions. One is to overlay text, but to overlay images. Considering video streams compatible with different resolutions, the processing branch is relatively proofread.

The overlapping of images is not implemented for the time being, and the most used is the superposition of Chinese characters. The method for overlapping Chinese OSD is also very simple, as shown below:

1. Understand the distribution of the Chinese font, and calculate the position of the Chinese character in the font based on the internal code of the Chinese character.

2. Learn about the distribution of ASCII character libraries. Use the ASCII value of a letter to calculate the position of the corresponding character in the font (this is relatively simple and it is not difficult to understand Chinese characters)

3. On the PC, convert the desired Chinese and English fonts to the dot matrix font data (or directly convert the data to the YUV format. I use the dot matrix data)

4. Understand the storage mode in YUV format (this is not difficult)

5. At last, the dot matrix data converted from a Chinese string is superimposed at the specified position of YUV to implement Chinese superposition. If the time is superimposed, the system time is obtained in real time, convert the time to a string, and then dynamically overlay the time to YUV.

Is the effect after superposition, is it OK.

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.