longo92
Posts: 42
Joined: Mon Sep 03, 2018 3:45 pm
Contact: Website Skype

MMAL_PARAMETER_RATECONTROL

Mon Oct 29, 2018 11:35 am

What is MMAL_PARAMETER_RATECONTROL?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: MMAL_PARAMETER_RATECONTROL

Tue Oct 30, 2018 10:23 am

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
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Graphics programming”