HiSilicon SDK Learning (9) HiSilicon Media Processing Software Platform MMP (8) REGION Regional Management

Regional management REGION

1 Overview

Users generally need to superimpose OSD in the video to display some specific information (such as: channel number, time stamp, etc.), and fill color blocks if necessary. These OSD superimposed on the video and the color blocks blocked on the video are collectively called regions. The REGION module is used to manage these regional resources in a unified manner.
Area management can realize the creation of areas and superimpose them on the video or block the video. For example, in practical applications, the user creates an area and superimposes the area to a certain channel (such as VENC channel) through HI_MPI_RGN_AttachToChn. When the channel is scheduled, the OSD is superimposed on the video. An area supports multiple channels (such as: multiple VENC channels, multiple VI channels, or even multiple VENC and VI channels) by setting the channel display attribute interface, and supports the display attributes of each channel (such as position, layers, transparency, etc.) are different.

2. Important concepts

  • Area type
    − Overlay: Video overlay area, where the area supports functions such as bitmap loading and background color update.
    − OverlayEx: Extends the video overlay area. The function is similar to that of Overlay. It supports bitmap loading, background color update, etc.
    − Cover: video occlusion area, which supports solid color block occlusion.
    − CoverEx: Extends the video occlusion area. The function is similar to Cover, and supports solid color block occlusion.
    − OverlayEx/CoverEx are functionally similar to Overlay/Cover respectively, but will introduce additional system bandwidth. It is recommended to use it only when the Overlay/Cover does not support, or the quantity cannot meet the demand.
  • Area Hierarchy
    The area hierarchy indicates the overlay level of the area, and the larger the level value, the higher the display level of the area. When overlap occurs, the higher level value will cover the lower level value. If they are at the same level, according to the order of the area superimposition, the superimposed ones will be displayed on the upper layer. When multiple areas are superimposed on the same GROUP of VPSS, it is required that the level value of each area cannot be the same as that of other areas superimposed on the GROUP; otherwise, among multiple areas with the same area level value, only the last superimposed Zones are superimposed on the GROUP of the VPSS. When multiple areas with the same layer value are superimposed on the same VENC channel, there is no such limitation, and the superposition can be successful.
    Hierarchical Overlay Schematic
  • Bitmap filling (valid for Overlay and OverlayEx)
    Bitmap filling refers to filling the memory value of the bitmap into the area memory space, and the bitmap will start filling from the upper left corner of the area. When the bitmap is smaller than the area, only a part of the memory can be filled, and the remaining part remains the original value; when the size of the bitmap is equal to the area, it will be completely filled; when the bitmap is larger than the area, the bitmap can only fill itself with the same size as
    the area The memory information of is filled into the area. Bitmap filling supports two implementation methods: first, the user copies the bitmap
    data to the internal display canvas through the HI_MPI_RGN_SetBitMap interface; second, the user obtains the address of the internal backup display canvas through HI_MPI_RGN_GetCanvasInfo, directly updates the address data, and then calls The HI_MPI_RGN_UpdateCanvas interface updates the backup display canvas to the canvas to be displayed, achieving the purpose of updating bitmap data.
  • Area Public Attributes
    When users create an area, they need to set this attribute information, which contains public resource information. For example, Overlay contains pixel format, size and background color.
  • Channel Display Properties
    Channel display properties indicate the display characteristics of a zone on a channel. For example, the channel display properties of Overlay include display position, layer, foreground Alpha, background Alpha, and QP information used for encoding. When the area display (bShow) in the channel display attribute is TRUE, it means it is displayed in this channel; otherwise, it means it exists in this channel, but it is in a hidden state.
  • Inverted color of the area
    When the area is superimposed on the video, if the brightness and chromaticity of the video background and the superimposed area are similar, it is often difficult to distinguish the background from the area. The area inverse color function is aimed at this kind of scene, adapting to the change of the background, adjusting the brightness and chromaticity of the area, so that the area is clearly visible. The regional color inversion function is supported in the following ways: through the regional brightness and statistical functions provided by VPSS. The user can obtain the brightness statistics of the background of each area to be superimposed in the video sequence in real time, and then use the ROP function of TDE to manually reverse the color of the area, and finally superimpose the inverted area on the video through VPSS.
  • Area QP Protection
    When an area is superimposed on the video for compression encoding, in order to ensure that the clarity of the superimposed area will not become blurred due to data compression, the compression characteristics of the superimposed area can be set separately, that is, the parameters of the QP protection function can be set. The QP protection function is a unique function of Overlay, and it is only valid for the H.264/H.265 type coding channel, and it is invalid for other types.

Guess you like

Origin blog.csdn.net/bentao1997719/article/details/116202945