Dynamic MaxPictureSize - 2025.1 English - PG252

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

Document ID
PG252
Release Date
2025-05-29
Version
2025.1 English

Dynamic MaxPictureSize is the ability to change the maximum picture size based on the target bitrate of individual different frame types.

Note: This feature is supported only at VCU encoder control software level. It is not supported at gstreamer and OMX level.

Example

To change the target bitrate and MaxPictureSize from 12 Mb/s to 6 Mb/s from 500th frame, and then 6 Mb/s to 2 Mb/s from 800th frame, you can use the following commands based on the configuration in control software application file:

  • 0: BR=12000
  • 0: MaxPictureSize.I=600
  • 0: MaxPictureSize.P=200
  • 500: BR=6000
  • 500: MaxPictureSize.I=300
  • 500: MaxPictureSize.P=100
  • 800: BR=2000
  • 800: MaxPictureSize.I=100
  • 800: MaxPictureSize.P=33

Similarly, to change the MaxPictureSize using control software API, use the following frame type based APIs:

  • AL_Encoder_SetMaxPictureSizePerFrameType(hEnc, iMaxPictureSize, AL_SLICE_I)
  • AL_Encoder_SetMaxPictureSizePerFrameType(hEnc, iMaxPictureSize, AL_SLICE_P)
  • AL_Encoder_SetMaxPictureSizePerFrameType(hEnc, iMaxPictureSize, AL_SLICE_B)

Use the folowing API to change the bitrate using control software API:

AL_Encoder_SetMaxBitRate(hEnc, iTargetBitRate, iMaxBitRate)

Guidelines for Dynamic MaxPictureSize

  • Initially, both the bitrate and MaxPictureSize should be set to the largest possible value allowed by the application to increase the video quality.
  • Dynamic parameters should not be changed frequently, as that can result in stability issues because the algorithm does not have time to settle. It is recommended that you wait for a time period of at least twice or thrice the GOP length when changing the dynamic parameters.
  • Dynamic MaxPictureSize and bitrate changes are considered immediately (can impact the QP of the next frames). However, the new average target bitrate can take some time depending on the content, bitrate delta, and so on. It can take up to ~1 GOP duration to converge.