/*!\brief Current ABI version number * *\internal *IfthisfileisalteredinanywaythatchangestheABI,thisvalue *mustbebumped.Examplesinclude,butarenotlimitedto,changing *types,removingorreassigningenums,adding/removing/rearranging *fieldstostructures.
*/ #define AOM_EXT_PART_ABI_VERSION 8
#ifdef __cplusplus
extern "C" { #endif
/*!\brief Abstract external partition model handler
*/ typedefvoid *aom_ext_part_model_t;
/*!\brief Number of features to determine whether to skip partition none and *dopartitionsplitdirectly.Thesameas"FEATURE_SIZE_SMS_SPLIT".
*/ #define AOM_EXT_PART_SIZE_DIRECT_SPLIT 17
/*!\brief Number of features to use simple motion search to prune out *rectangularpartitioninsomedirection.Thesameas *"FEATURE_SIZE_SMS_PRUNE_PART".
*/ #define AOM_EXT_PART_SIZE_PRUNE_PART 25
/*!\brief Number of features to prune split and rectangular partition *afterPARTITION_NONE.
*/ #define AOM_EXT_PART_SIZE_PRUNE_NONE 4
/*!\brief Number of features to terminates partition after partition none using *simple_motion_searchfeaturesandtherate,distortion,andrdcostof *PARTITION_NONE.Thesameas"FEATURE_SIZE_SMS_TERM_NONE".
*/ #define AOM_EXT_PART_SIZE_TERM_NONE 28
/*!\brief Number of features to terminates partition after partition split.
*/ #define AOM_EXT_PART_SIZE_TERM_SPLIT 31
/*!\brief Number of features to prune rectangular partition using stats *collectedafterpartitionsplit.
*/ #define AOM_EXT_PART_SIZE_PRUNE_RECT 9
/*!\brief Number of features to prune AB partition using stats *collectedafterrectangularpartition..
*/ #define AOM_EXT_PART_SIZE_PRUNE_AB 10
/*!\brief Number of features to prune 4-way partition using stats *collectedafterABpartition.
*/ #define AOM_EXT_PART_SIZE_PRUNE_4_WAY 18
/*!\brief Config information sent to the external partition model. * *Forexample,themaximumsuperblocksizedeterminedbythesequenceheader.
*/ typedefstruct aom_ext_part_config {
int superblock_size; ///< super block size (either 64x64 or 128x128)
} aom_ext_part_config_t;
/*!\brief Features pass to the external model to make partition decisions. *Specifically,featurescollectedbeforeNONEpartition. *Features"f"areusedtodetermine: *partition_none_allowed,partition_horz_allowed,partition_vert_allowed, *do_rectangular_split,do_square_split *Features"f_part2"areusedtodetermine: *prune_horz,prune_vert.
*/ typedefstruct aom_partition_features_before_none { /*! features to determine whether skip partition none and do split directly */
float f[AOM_EXT_PART_SIZE_DIRECT_SPLIT]; /*! features to determine whether to prune rectangular partition */
float f_part2[AOM_EXT_PART_SIZE_PRUNE_PART];
} aom_partition_features_before_none_t;
/*!\brief Features pass to the external model to make partition decisions. *Specifically,featurescollectedafterNONEpartition.
*/ typedefstruct aom_partition_features_none { /*! features to prune split and rectangular partition */
float f[AOM_EXT_PART_SIZE_PRUNE_NONE]; /*! features to determine termination of partition */
float f_terminate[AOM_EXT_PART_SIZE_TERM_NONE];
} aom_partition_features_none_t;
/*!\brief Features pass to the external model to make partition decisions. *Specifically,featurescollectedafterSPLITpartition.
*/ typedefstruct aom_partition_features_split { /*! features to determine termination of partition */
float f_terminate[AOM_EXT_PART_SIZE_TERM_SPLIT]; /*! features to determine pruning rect partition */
float f_prune_rect[AOM_EXT_PART_SIZE_PRUNE_RECT];
} aom_partition_features_split_t;
/*!\brief Features pass to the external model to make partition decisions. *Specifically,featurescollectedafterRECTANGULARpartition.
*/ typedefstruct aom_partition_features_rect { /*! features to determine pruning AB partition */
float f[AOM_EXT_PART_SIZE_PRUNE_AB];
} aom_partition_features_rect_t;
/*!\brief Features pass to the external model to make partition decisions. *Specifically,featurescollectedafterABpartition:HORZ_A,HORZ_B,VERT_A, *VERT_B.
*/ typedefstruct aom_partition_features_ab { /*! features to determine pruning 4-way partition */
float f[AOM_EXT_PART_SIZE_PRUNE_4_WAY];
} aom_partition_features_ab_t;
/*!\brief Feature id to tell the external model the current stage in partition *pruningandwhatfeaturestousetomakedecisionsaccordingly.
*/ typedef enum {
AOM_EXT_PART_FEATURE_BEFORE_NONE,
AOM_EXT_PART_FEATURE_BEFORE_NONE_PART2,
AOM_EXT_PART_FEATURE_AFTER_NONE,
AOM_EXT_PART_FEATURE_AFTER_NONE_PART2,
AOM_EXT_PART_FEATURE_AFTER_SPLIT,
AOM_EXT_PART_FEATURE_AFTER_SPLIT_PART2,
AOM_EXT_PART_FEATURE_AFTER_RECT,
AOM_EXT_PART_FEATURE_AFTER_AB
} AOM_EXT_PART_FEATURE_ID;
/*!\brief Features collected from the tpl process. * *Thetplprocesscollectsinformationthathelpmeasuretheinter-frame *dependency. *Thetplprocessiscomputedintheunitoftpl_bsize_1d(16x16). *Therefore,themaxnumberofunitsinsideasuperblockis *128x128/(16x16)=64.Changeitifthetplprocesschanges.
*/ typedefstruct aom_sb_tpl_features {
int available; ///< If tpl stats are available
int tpl_unit_length; ///< The block length of tpl process
int num_units; ///< The number of units inside the current superblock
int64_t intra_cost[64]; ///< The intra cost of each unit
int64_t inter_cost[64]; ///< The inter cost of each unit
int64_t mc_dep_cost[64]; ///< The motion compensated dependency cost
} aom_sb_tpl_features_t;
/*!\brief Features collected from the simple motion process. * *Thesimplemotionprocesscollectsinformationbyapplyingmotioncompensated *predictiononeachblock. *Theblocksizeis16x16,whichcouldbechanged.Ifitischanged,update *commentsandthearraysizehere.
*/ typedefstruct aom_sb_simple_motion_features {
int unit_length; ///< The block length of the simple motion process
int num_units; ///< The number of units inside the current superblock
int block_sse[64]; ///< Sum of squared error of each unit
int block_var[64]; ///< Variance of each unit
} aom_sb_simple_motion_features_t;
/*!\brief Features of each super block. * *Featurescollectedforeachsuperblockbeforepartitionsearch.
*/ typedefstruct aom_sb_features { /*! Features from motion search */
aom_sb_simple_motion_features_t motion_features; /*! Features from tpl process */
aom_sb_tpl_features_t tpl_features;
} aom_sb_features_t;
/*!\brief Features pass to the external model to make partition decisions. * *Theencodersendsthesefeaturestotheexternalmodelthrough *"func()"definedin..... * *NOTE:newmembervariablesmaybeaddedtothisstructureinthefuture. *Oncenewfeaturesarefinalized,bumpthemajorversionoflibaom.
*/ typedefstruct aom_partition_features { // Features for the current supervised multi-stage ML model. /*! Feature ID to indicate active features */
AOM_EXT_PART_FEATURE_ID id; /*! Features collected before NONE partition */
aom_partition_features_before_none_t before_part_none; /*! Features collected after NONE partition */
aom_partition_features_none_t after_part_none; /*! Features collected after SPLIT partition */
aom_partition_features_split_t after_part_split; /*! Features collected after RECTANGULAR partition */
aom_partition_features_rect_t after_part_rect; /*! Features collected after AB partition */
aom_partition_features_ab_t after_part_ab;
// Features for a new ML model.
aom_sb_features_t sb_features; ///< Features collected for the super block
int mi_row; ///< Mi_row position of the block
int mi_col; ///< Mi_col position of the block
int frame_width; ///< Frame width
int frame_height; ///< Frame height
int block_size; ///< As "BLOCK_SIZE" in av1/common/enums.h /*! *Validpartitiontypes.Abitmaskisused."1"representsthe *correspondingtypeisvalid.Thebitmaskfollowstheenumorderfor *PARTITION_TYPEin"enums.h"torepresentonepartitiontypeatabit. *Forexample,0x01standsforonlyPARTITION_NONEisvalid, *0x09(00...001001)standsforPARTITION_NONEandPARTITION_SPLITarevalid.
*/
int valid_partition_types;
int update_type; ///< Frame update type, defined in ratectrl.h
int qindex; ///< Quantization index, range: [0, 255]
int rdmult; ///< Rate-distortion multiplier
int pyramid_level; ///< The level of this frame in the hierarchical structure
int has_above_block; ///< Has above neighbor block
int above_block_width; ///< Width of the above block, -1 if not exist
int above_block_height; ///< Height of the above block, -1 if not exist
int has_left_block; ///< Has left neighbor block
int left_block_width; ///< Width of the left block, -1 if not exist
int left_block_height; ///< Height of the left block, -1 if not exist /*! *Thefollowingparametersarecollectedfromapplyingsimplemotionsearch. *Sumofsquarederror(SSE)andvarianceofmotioncompensatedresidual *aregoodindicatorsofblockpartitioning. *Ifablockisasquare,wealsoapplymotionsearchforits4subblocks. *Ifnotasquare,theirvaluesare-1. *Ifablockisabletosplithorizontally,weapplymotionsearchandget *statsforhorizontalblocks.Ifnot,theirvaluesare-1. *Ifablockisabletosplitvertically,weapplymotionsearchandget *statsforverticalblocks.Ifnot,theirvaluesare-1.
*/ unsigned int block_sse; ///< SSE of motion compensated residual unsigned int block_var; ///< Variance of motion compensated residual unsigned int sub_block_sse[4]; ///< SSE of sub blocks. unsigned int sub_block_var[4]; ///< Variance of sub blocks. unsigned int horz_block_sse[2]; ///< SSE of horz sub blocks unsigned int horz_block_var[2]; ///< Variance of horz sub blocks unsigned int vert_block_sse[2]; ///< SSE of vert sub blocks unsigned int vert_block_var[2]; ///< Variance of vert sub blocks /*! *Thefollowingparametersarecalculatedfromtplmodel. *Iftplmodelisnotavailable,theirvaluesare-1.
*/
int64_t tpl_intra_cost; ///< Intra cost, ref to "TplDepStats" in tpl_model.h
int64_t tpl_inter_cost; ///< Inter cost in tpl model
int64_t tpl_mc_dep_cost; ///< Motion compensated dependency cost in tpl model
} aom_partition_features_t;
/*!\brief Partition decisions received from the external model. * *Theencoderreceivespartitiondecisionsandencodesthesuperblock *withthegivenpartitiontype. *Theencoderreceivesitfrom"func()"definein.... * *NOTE:newmembervariablesmaybeaddedtothisstructureinthefuture. *Oncenewfeaturesarefinalized,bumpthemajorversionoflibaom.
*/ typedefstruct aom_partition_decision { // Decisions for directly set partition types
int is_final_decision; ///< The flag whether it's the final decision
int num_nodes; ///< The number of leaf nodes
int partition_decision[2048]; ///< Partition decisions
int current_decision; ///< Partition decision for the current block
// Decisions for partition type pruning
int terminate_partition_search; ///< Terminate further partition search
int partition_none_allowed; ///< Allow partition none type
int partition_rect_allowed[2]; ///< Allow rectangular partitions
int do_rectangular_split; ///< Try rectangular split partition
int do_square_split; ///< Try square split partition
int prune_rect_part[2]; ///< Prune rectangular partition
int horza_partition_allowed; ///< Allow HORZ_A partition
int horzb_partition_allowed; ///< Allow HORZ_B partition
int verta_partition_allowed; ///< Allow VERT_A partition
int vertb_partition_allowed; ///< Allow VERT_B partition
int partition_horz4_allowed; ///< Allow HORZ4 partition
int partition_vert4_allowed; ///< Allow VERT4 partition
} aom_partition_decision_t;
/*!\brief Encoding stats for the given partition decision. * *Theencodingstatscollectedbyencodingthesuperblockwiththe *givenpartitiontypes. *Theencodersendsthestatstotheexternalmodelfortraining *orinferencethrough"func()"definedin....
*/ typedefstruct aom_partition_stats {
int rate; ///< Rate cost of the block
int64_t dist; ///< Distortion of the block
int64_t rdcost; ///< Rate-distortion cost of the block
} aom_partition_stats_t;
/*!\brief Enum for return status.
*/ typedef enum aom_ext_part_status {
AOM_EXT_PART_OK = 0, ///< Status of success
AOM_EXT_PART_ERROR = 1, ///< Status of failure
AOM_EXT_PART_TEST = 2, ///< Status used for tests
} aom_ext_part_status_t;
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.