GDR Intra Refresh - 2023.1 English

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

Document ID
PG252
Release Date
2023-05-16
Version
2023.1 English

Gradual Decoder Refresh (GDR) when GOPCtrlMode is set to LOW_DELAY_P, the GDRMode parameter used to specify whether GDR scheme should be used or not. When GDR is enabled (horizontal/vertical), the encoder inserts intra MBs row/column in the picture to refresh the decoder. The Gop.FreqIDR specifies the frequency at which the refresh pattern should happen. To allow full picture refreshing, Gop.FreqIDR parameter should be greater than the number of CTB/MB rows (GDR_HORIZONTAL) or columns (GDR_VERTICAL).

When the GDR is enabled, the encoder inserts SPS/PPS along with an SEI recovery message at the start of a refresh pattern, and the decoder can synchronize to the SEI recovery points in the bit-stream. The advantage of having the non-IDR decoder synchronization is that there is no longer any need to send IDR pictures in case of a packet loss scenario. Inserting periodic IDR pictures in video encoding generates a spike in bit consumption which is not recommended for video streaming. Vertical GDR mode has an MV (motion vector) limitation that can cause full picture reconstruction to take more than one refresh cycle. Refer below table for more details:

Table 1. GDR Limitation
  AVC/H.264 HEVC/H.265
GDR_VERTICAL: A vertical intra-column moving from left to right Exact match is supported. Deblocking filter is automatically disabled Exact match is NOT supported; it can take up to two refresh intervals to fully reconstruct the frame deblocking filter is automatically disabled
GDR_HORIZONTAL: A horizontal intra-row moving from top-to-bottom Exact match is supported deblocking filter is automatically disabled Exact match is supported deblocking filter is automatically disabled

A sample gstreamer pipeline is as follows. Use "gdr-mode=horizontal" & "periodicity-idr=<higher than Picture Height in Mbs>" in the encoder element.

gst-launch-1.0 filesrc location="/mnt/test_4Kp60_NV12.yuv"! rawvideoparse width=3840 height=2160 format=nv12 framerate=30/1! omxh264enc control-rate=constant target-bitrate=60000 gop-mode=low-delay-p gdr-mode=horizontal periodicity-idr=270! video/x-h264, profile=high! Filesink location="/run/test_output.avc"

At the control software level, add the following section and parameter (in the GOP section of the cfg file)

[GOP] #---------------------------------------------------
GopCtrlMode        = LOW_DELAY_P
Gop.GdrMode        = GDR_HORIZONTAL
Gop.FreqIDR        = 270
Note: SPS/PPS is inserted at the start of each GDR frame start. VCU decoder can synchronize onto any GDR start frame, no need to start with the IDR frame always. The GDR frequency can be set using GOP.FreqIDR at control software and periodicity-idr at gstreamer when GDR mode is enabled.