/*!\brief Current ABI version number * *\internal *IfthisfileisalteredinanywaythatchangestheABI,thisvalue *mustbebumped.Examplesinclude,butarenotlimitedto,changing *types,removingorreassigningenums,adding/removing/rearranging *fieldstostructures.
*/ #define AOM_EXT_RATECTRL_ABI_VERSION (2 + AOM_TPL_ABI_VERSION)
/*!\brief Corresponds to MAX_STATIC_GF_GROUP_LENGTH defined in ratectrl.h
*/ #define AOM_RC_MAX_STATIC_GF_GROUP_LENGTH 250
/*!\brief Max number of ref frames returned by the external RC. * *CorrespondstoREF_FRAMESdefinedinenums.h.
*/ #define AOM_RC_MAX_REF_FRAMES 8
/*!\brief Max layer depth. * *CorrespondstoMAX_ARF_LAYERSdefinedinratectrl.h.
*/ #define AOM_RC_MAX_ARF_LAYERS 6
/*!\brief Name for the ref frames returned by the external RC. * *Correspondstotherefframesdefinedinenums.h.
*/ typedefenum aom_rc_ref_name {
AOM_RC_INVALID_REF_FRAME = -1,
AOM_RC_INTRA_FRAME,
AOM_RC_LAST_FRAME,
AOM_RC_LAST2_FRAME,
AOM_RC_LAST3_FRAME,
AOM_RC_GOLDEN_FRAME,
AOM_RC_BWDREF_FRAME,
AOM_RC_ALTREF2_FRAME,
AOM_RC_ALTREF_FRAME,
} aom_rc_ref_name_t;
/*!\brief Abstract rate control model handler * *Theencoderwillreceivethemodelhandlerfrom *aom_rc_funcs_t::create_model().
*/ typedefvoid *aom_rc_model_t;
/*!\brief A reserved value for the q index. *Iftheexternalratecontrolmodelreturnsthisvalue, *theencoderwillusethedefaultqselectedbylibaom'sratecontrol *system.
*/ #define AOM_DEFAULT_Q -1
/*!\brief A reserved value for the rdmult. *Iftheexternalratecontrolmodelreturnsthisvalue, *theencoderwillusethedefaultrdmultselectedbylibaom'sratecontrol *system.
*/ #define AOM_DEFAULT_RDMULT -1
/*!\brief Superblock quantization parameters *Storethesuperblockquantizationparameters
*/ typedefstruct aom_sb_parameters { int q_index; /**< Quantizer step index [0..255]*/ int rdmult; /**< Superblock level Lagrangian multiplier*/
} aom_sb_params;
/*!\brief Encode frame decision made by the external rate control model * *Theencoderwillreceivethedecisionfromtheexternalratecontrolmodel *throughaom_rc_funcs_t::get_encodeframe_decision().
*/ typedefstruct aom_rc_encodeframe_decision { int q_index; /**< Required: Quantizer step index [0..255]*/ int rdmult; /**< Required: Frame level Lagrangian multiplier*/ // Whether per-superblock delta Q should be used. // The rate control model should set the value pointed to by this member // to 1 if per-superblock delta-Q is used for this frame, or 0 otherwise. // This is a pointer to the flag in cpi->ext_ratectrl. int *use_delta_q; /*! *Optional:Superblockquantizationparameters *Itiszeroinitializedbydefault.ItwillbesetforkeyandARFframes *butnotleafframes.
*/
aom_sb_params *sb_params_list;
} aom_rc_encodeframe_decision_t;
/*!\brief Information for the frame to be encoded. * *Theencoderwillsendtheinformationtoexternalratecontrolmodelthrough *aom_rc_funcs_t::get_encodeframe_decision(). *
*/ typedefstruct aom_rc_encodeframe_info { /*! *0:Keyframe *1:Interframe *2:Alternatereferenceframe *3:Overlayframe *4:Goldenframe
*/ int frame_type; int show_index; /**< display index, starts from zero*/ int coding_index; /**< coding index, starts from zero*/ /*! *indexofthecurrentframeinthisgroupofpicture,startsfromzero.
*/ int gop_index; int ref_frame_coding_indexes[AOM_RC_MAX_REF_FRAMES]; /**< reference frames'
coding indices*/ /*! *Thevalidityofthethreereferenceframes. *0:Invalid *1:Valid
*/ int ref_frame_valid_list[AOM_RC_MAX_REF_FRAMES]; /*! *ThelengthofthecurrentGOP.
*/ int gop_size; /*! *WhetherthecurrentGOPusesanaltref.
*/ int use_alt_ref;
} aom_rc_encodeframe_info_t;
/*!\brief Frame coding result * *Theencoderwillsendtheresulttotheexternalratecontrolmodelthrough *aom_rc_funcs_t::update_encodeframe_result().
*/ typedefstruct aom_rc_encodeframe_result {
int64_t bit_count; /**< number of bits spent on coding the frame*/ int actual_encoding_qindex; /**< the actual qindex used to encode the frame*/
} aom_rc_encodeframe_result_t;
/*!\brief Status returned by rate control callback functions.
*/ typedefenum aom_rc_status {
AOM_RC_OK = 0,
AOM_RC_ERROR = 1,
} aom_rc_status_t;
/*!\brief Collection of first pass frame stats
*/ typedefstruct aom_rc_firstpass_stats { /*! *Pointertofirstpassframestats. *Thepointedarrayofaom_rc_frame_stats_tshouldhavelengthequalto *numberofshowframesinthevideo.
*/
aom_rc_frame_stats_t *frame_stats; /*! *Numberofshowframesinthevideo.
*/ int num_frames;
} aom_rc_firstpass_stats_t;
/*!\brief Encode config sent to external rate control model
*/ typedefstruct aom_rc_config { int frame_width; /**< frame width */ int frame_height; /**< frame height */ int show_frame_count; /**< number of visible frames in the video */ int max_gf_interval; /**< max GOP size in number of show frames */ int min_gf_interval; /**< min GOP size in number of show frames */ /*! *Targetbitrateinkilobytespersecond
*/ int target_bitrate_kbps; int frame_rate_num; /**< numerator of frame rate */ int frame_rate_den; /**< denominator of frame rate */ /*! *Thefollowingfieldsareonlyforexternalratecontrolmodelsthatsupport *differentratecontrolmodes.
*/
aom_ext_rc_mode_t rc_mode; /**< Q mode or VBR mode */ int overshoot_percent; /**< for VBR mode only */ int undershoot_percent; /**< for VBR mode only */ int min_base_q_index; /**< for VBR mode only */ int max_base_q_index; /**< for VBR mode only */ int base_qp; /**< base QP for leaf frames, 0-255 */ int superblock_size; /**< 64 or 128 */
} aom_rc_config_t;
/*!\brief Control what ref frame to use and its index.
*/ typedefstruct aom_rc_ref_frame { /*! *Refframeindex.
*/ int index[AOM_RC_MAX_REF_FRAMES]; /*! *Refframename.
*/
aom_rc_ref_name_t name[AOM_RC_MAX_REF_FRAMES];
} aom_rc_ref_frame_t;
/*!\brief A single reference frame.
*/ typedefstruct aom_rc_single_ref_frame { int index; /**< Ref frame index. */
aom_rc_ref_name_t name; /**< Ref frame name. */
} aom_rc_single_ref_frame_t;
/*!\brief A single frame in the GOP.
*/ typedefstruct aom_rc_gop_frame { // Basic info int order_idx; /**< Index in display order within a GOP, starting at 0. */ int coding_idx; /**< Index in coding order within a GOP, starting at 0. */ int display_idx; /**< The number of displayed frames preceding this frame in a
GOP. */ int order_hint; /**< Index in display order since a key frame. */ int global_order_idx; /**< Index in display order in the whole video chunk. */ int global_coding_idx; /**< Index in coding order in the whole video chunk. */ int is_key_frame; /**< Whether this frame is a key frame. */
aom_rc_frame_update_type_t update_type; /**< The type of frame. */
// Reference frame info /** *Foranoverlayorshow_existingframe:indexofprimaryreferenceframe; *otherwise-1.
*/ int colocated_ref_idx; /** *Thereferenceindexthatthisframeshouldbeupdatedto.-1whenthis *framewillnotserveasareferenceframe.
*/ int update_ref_idx; /** *Additionalbitstosetinrefresh_frame_flags,toallowextraframestobe *evictedfromtheDPB.-1fornotset.
*/ int extra_refresh_frame_flags; /** *Candidatereferenceframeswhichmaybeusedforcodingthecurrentframe.
*/
aom_rc_ref_frame_t ref_frame_list; int layer_depth; /**< Layer depth in the GOP structure. */ /** *Primaryreferenceframe(usedtoupdatecurrentframe'sinitialprobability *model).
*/
aom_rc_single_ref_frame_t primary_ref_frame;
} aom_rc_gop_frame_t;
/*!\brief The decision made by the external rate control model to set the *groupofpicture.ThisstructrepresentsalistofGOPs.
*/ typedefstruct aom_rc_gop_decision { int show_frame_count; /**< Number of visible frames in this GOP. */ int order_hint_offset; /**< Order hint offset for this GOP. */ int global_order_idx_offset; /**< Global order index offset for this GOP. */ int global_coding_idx_offset; /**< Global coding index offset for this GOP. */ int is_scene_cut; /**< Whether this GOP starts with a scene cut. */ /** *Theadjustmentratio,basedonwhichthebaseQPindexofthisGOPwillbe *adjustedfromRateControlParam::base_q_index.
*/ double base_q_ratio;
aom_rc_gop_frame_t *gop_frame_list; /**< List of frames in this GOP. */ int gop_frame_count;
} aom_rc_gop_decision_t;
/*!\brief The decision made by the external rate control model to set the *keyframelocationandtheshowframecountinthekeyframegroup
*/ typedefstruct aom_rc_key_frame_decision { int key_frame_show_index; /**< This key frame's show index in the video */ int key_frame_group_size; /**< Show frame count of this key frame group */
} aom_rc_key_frame_decision_t;
/*!\brief Create an external rate control model callback prototype * *Thiscallbackisinvokedbytheencodertocreateanexternalratecontrol *model. * *\param[in]privCallback'sprivatedata *\param[in]ratectrl_configPointertoaom_rc_config_t *\param[out]rate_ctrl_model_ptrPointertoaom_rc_model_t
*/ typedef aom_rc_status_t (*aom_rc_create_model_cb_fn_t)( void *priv, const aom_rc_config_t *ratectrl_config,
aom_rc_model_t *rate_ctrl_model_ptr);
/*!\brief Send first pass stats to the external rate control model callback *prototype * *Thiscallbackisinvokedbytheencodertosendfirstpassstatstothe *externalratecontrolmodel. * *\param[in]rate_ctrl_modelratecontrolmodel *\param[in]first_pass_statsfirstpassstats
*/ typedef aom_rc_status_t (*aom_rc_send_firstpass_stats_cb_fn_t)(
aom_rc_model_t rate_ctrl_model, const aom_rc_firstpass_stats_t *first_pass_stats);
/*!\brief Send TPL stats for the current GOP to the external rate control model *callbackprototype * *ThiscallbackisinvokedbytheencodertosendTPLstatsfortheGOPtothe *externalratecontrolmodel. * *\param[in]rate_ctrl_modelratecontrolmodel *\param[in]tpl_gop_statsTPLstatsforcurrentGOP
*/ typedef aom_rc_status_t (*aom_rc_send_tpl_gop_stats_cb_fn_t)(
aom_rc_model_t rate_ctrl_model, const AomTplGopStats *extrc_tpl_gop_stats);
/*!\brief Get the key frame decision from the external rate control model. * *Thiscallbackisinvokedbytheencodertogetkeyframedecisionfrom *theexternalratecontrolmodel. * *\param[in]rate_ctrl_modelratecontrolmodel *\param[out]key_frame_decisionkeyframedecisionfromthemodel
*/ typedef aom_rc_status_t (*aom_rc_get_key_frame_decision_cb_fn_t)(
aom_rc_model_t rate_ctrl_model,
aom_rc_key_frame_decision_t *key_frame_decision);
/*!\brief Get the GOP structure from the external rate control model. * *ThiscallbackisinvokedbytheencodertogetGOPdecisionsfrom *theexternalratecontrolmodel. * *\param[in]rate_ctrl_modelratecontrolmodel *\param[out]gop_decisionGOPdecisionfromthemodel
*/ typedef aom_rc_status_t (*aom_rc_get_gop_decision_cb_fn_t)(
aom_rc_model_t rate_ctrl_model, aom_rc_gop_decision_t *gop_decision);
/*!\brief Get the frame rdmult from the external rate control model. * *Thiscallbackisinvokedbytheencodertogetrdmultfrom *theexternalratecontrolmodel. * *\param[in]rate_ctrl_modelratecontrolmodel *\param[in]frame_infoinformationcollectedfromtheencoder *\param[out]rdmultframerate-distortionmultiplierfromthemodel
*/ typedef aom_rc_status_t (*aom_rc_get_frame_rdmult_cb_fn_t)(
aom_rc_model_t rate_ctrl_model, const aom_rc_encodeframe_info_t *frame_info, int *rdmult);
/*!\brief Delete the external rate control model callback prototype * *Thiscallbackisinvokedbytheencodertodeletetheexternalratecontrol *model. * *\param[in]rate_ctrl_modelratecontrolmodel
*/ typedef aom_rc_status_t (*aom_rc_delete_model_cb_fn_t)(
aom_rc_model_t rate_ctrl_model);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.