Page 1 of 1

MMAL_PARAMETER_RATECONTROL

Posted: Mon Oct 29, 2018 11:35 am
by longo92
What is MMAL_PARAMETER_RATECONTROL?

Re: MMAL_PARAMETER_RATECONTROL

Posted: Tue Oct 30, 2018 10:23 am
by 6by9
It's a MMAL parameter for the video encoder that takes an enum from MMAL_VIDEO_RATECONTROL_T

Code: Select all

typedef enum MMAL_VIDEO_RATECONTROL_T {
    MMAL_VIDEO_RATECONTROL_DEFAULT,
    MMAL_VIDEO_RATECONTROL_VARIABLE,
    MMAL_VIDEO_RATECONTROL_CONSTANT,
    MMAL_VIDEO_RATECONTROL_VARIABLE_SKIP_FRAMES,
    MMAL_VIDEO_RATECONTROL_CONSTANT_SKIP_FRAMES,
    MMAL_VIDEO_RATECONTROL_DUMMY = 0x7fffffff
} MMAL_VIDEO_RATECONTROL_T;
It maps to OpenMax IL enum OMX_VIDEO_CONTROLRATETYPE

Code: Select all

typedef enum OMX_VIDEO_CONTROLRATETYPE {
    OMX_Video_ControlRateDisable,
    OMX_Video_ControlRateVariable,
    OMX_Video_ControlRateConstant,
    OMX_Video_ControlRateVariableSkipFrames,
    OMX_Video_ControlRateConstantSkipFrames,
    OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ 
    OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
    OMX_Video_ControlRateMax = 0x7FFFFFFF
} OMX_VIDEO_CONTROLRATETYPE;
The IL spec includes the descriptions for each of the modes (p240 of the 1.1.2 spec)

Code: Select all

OMX_Video_ControlRateDisable Disable – in this mode the encoder will ignore nTargetBitrate setting and use the appropriate Qp (nQpI, nQpP, nQpB) values for encoding
OMX_Video_ControlRateVariable Variable bit rate
OMX_Video_ControlRateConstant Constant bit rate – the encoder can modify the Qp values to meet the nTargetBitrate target
OMX_Video_ControlRateVariableSkipFrames Variable bit rate with frame skipping
OMX_Video_ControlRateConstantSkipFrames Constant bit rate with frame skipping – the encoder cannot modify the Qp values to meet the nTargetBitrate target. Instead, the encoder can drop frames to achieve nTargetBitrate