ROI File Format - 2023.1 English

H.264/H.265 Video Codec Unit v1.2 Solutions LogiCORE IP Product Guide (PG252)

Document ID
Release Date
2023.1 English

The region of interest definition starts with a line specifying the frame identifier, the background quality and an ROI order for overlapping regions, followed by one or more lines each defining a ROI for this frame and the following frames until the next ROI definition.


frame <index>: [BkgQuality=<quality>, Order=<order>]

<posX> :<posY>, <width>x<height>, <quality>

Quality Description Delta QP used
HIGH_QUALITY Higher quality than the rate-control given value -5
MEDIUM_QUALITY Same quality than the rate-control given value 0
LOW_QUALITY Lower quality than the rate-control given value +5
NO_QUALITY Worse possible quality for region without interest +31 1
  1. Maximum delta QP value.

Where <posX>, <posY>, <width>, and <height> are in pixel unit. They are then automatically rounded to the bounding LCU units (16×16 in AVC and 32×32 in HEVC). The <quality> is one of the following:

The <order> is one of the following value:

Table 1. Order Descriptions
Order Description
QUALITY_ORDER Use quality of the region having the best quality
INCOMING_ORDER Use quality of the earliest defined region
Note: Keywords such as KF are case sensitive.

Here is an example Region of Interest file.

frame 0: BkgQuality= MEDIUM _QUALITY, Order=INCOMING_ORDER 
6:4, 8x4, LOW_QUALITY 
11:9, 5x5, HIGH_QUALITY
20:15, 5x7, MEDIUM_QUALITY
frame 13:
12:8, 7x5, HIGH_QUALITY
14:8, 5x5, NO_QUALITY

HDR10 File Format

The VCU encoder supports HDR10 encoding at the control software level. You need to set the following configuration:

HDRFile = HDRSEIs.txt

TransferCharac = TRANSFER_BT_2100_PQ
ColourMatrix = COLOUR_MAT_BT_2100_YCBCR
ColourDescription = COLOUR_DESC_BT_2020

You can define the HDR10 metadata to be inserted through the HDRFile option. The HDR file needs to be in the following format:

mastering_display_colour_volume: <display_primaries_GX> <display_primaries_GY> <display_primaries_BX> <display_primaries_BY> <display_primaries_RX> <display_primaries_RY> <white_point_x> <white_point_y> <max_display_mastering_luminance> <min_display_mastering_luminance>
content_light_level_info: <max_content_light_level> <max_pic_average_light_level>

Control Software

  • Encoder application command to insert the HDR10 metadata:

    ctrlsw_encoder -cfg HDR-XilinxExample.cfg
  • Decoder application command to extract the HDR10 metadata:

    ctrlsw_decoder -hevc -in bitstream.hevc -out decoded.yuv --hdr-file HDRSEIs_output.txt
    ctrlsw_decoder -avc -in bitstream.avc -out decoded.yuv --hdr-file HDRSEIs_output.txt