void AV1_K_MEANS_RENAME(av1_k_means, 1)(const int16_t *data, int16_t *centroids,
uint8_t *indices, int n, int k,
int max_itr); void AV1_K_MEANS_RENAME(av1_k_means, 2)(const int16_t *data, int16_t *centroids,
uint8_t *indices, int n, int k,
int max_itr); /*!\endcond */
/*!\brief Calculates the cluster to which each data point belong. * *\ingrouppalette_mode_search *\param[in]dataThedatapointswhoseclusterindicesare *tobecomputed.Thedatalayoutis *NUM_DATA_POINTSXDATA_DIM. *\param[in]centroidsPointertothecentroids.Thedatalayout *isNUM_CENTROIDSXDATA_DIM. *\param[in]indicesPointertostorethecomputedindices. *\param[in]nNumberofdatapoints. *\param[in]kNumberofclusters. *\param[in]dimDatadimension. * *\remarkReturnsnothing,butsaveseachdata'sclusterindexin\aindices.
*/ static inline void av1_calc_indices(const int16_t *data, const int16_t *centroids, uint8_t *indices,
int n, int k, int dim) {
assert(n > 0);
assert(k > 0);
if (dim == 1) {
av1_calc_indices_dim1(data, centroids, indices, /*total_dist=*/NULL, n, k);
} else if (dim == 2) {
av1_calc_indices_dim2(data, centroids, indices, /*total_dist=*/NULL, n, k);
} else {
assert(0 && "Untemplated k means dimension");
}
}
/*!\brief Performs k-means cluster on the data. * *\ingrouppalette_mode_search *\param[in]dataThedatapointstobeclustered.Thedata *layoutisNUM_DATA_POINTSXDATA_DIM. *\param[in]centroidsPointertostorethecomputedcentroids. *Thedatalayoutis *NUM_CENTROIDSXDATA_DIM. *\param[in]indicesPointertostorethecomputedindices.For *eachtrainingdata. *\param[in]nNumberofdatapoints. *\param[in]kNumberofclusters. *\param[in]dimDatadimension. *\param[in]max_itrMaximumnumberofiterationstorun. * *\remarkReturnsnothing,butsaveseachcluster'scentroidincentroidsand *eachdata'sclusterindexin\aindices. * *\attentionTheoutputcentroidsareroundedofftonearestintegers.
*/ static inline void av1_k_means(const int16_t *data, int16_t *centroids,
uint8_t *indices, int n, int k, int dim,
int max_itr) {
assert(n > 0);
assert(k > 0);
if (dim == 1) {
AV1_K_MEANS_RENAME(av1_k_means, 1)(data, centroids, indices, n, k, max_itr);
} else if (dim == 2) {
AV1_K_MEANS_RENAME(av1_k_means, 2)(data, centroids, indices, n, k, max_itr);
} else {
assert(0 && "Untemplated k means dimension");
}
}
/*!\brief Checks what colors are in the color cache. * *\ingrouppalette_mode_search *\param[in]color_cacheAcacheofcolors. *\param[in]n_cacheNumberofcolorsinthecache. *\param[in]colorsNewbasecolors. *\param[in]n_colorsNumberofnewcolors. *\param[in]cache_color_foundStoreswhatcachedcolorsarepresentedin *colors. *\param[in]out_cache_colorsStoreswhatcolorsarenotinthecache. * *\returnReturnsthenumberofcolorsthatarenotincache.Inaddition, *recordswhethereachcachecolorispresentedincolorsincache_color_found, *andstoresandstorestheoutofcachecolorsinout_cache_colors.
*/
int av1_index_color_cache(const uint16_t *color_cache, int n_cache, const uint16_t *colors, int n_colors,
uint8_t *cache_color_found, int *out_cache_colors);
/*!\brief Gets the rate cost for each delta-encoding v palette. * *\ingrouppalette_mode_search *\param[in]pmiStructthatstoresthepalettemodeinfo. *\param[in]bit_depthPixelbitdepthofthesequence. *\param[in]zero_countStoresthenumberofzerodeltas. *\param[in]min_bitsMinimumbitsforthedeltas.Setsto *bit_depth-4. * *\returnReturnsthenumberofbitsusedtotransmiteachvpalettecolor *deltaandassignszero_countwiththenumberofdeltasbeing0.
*/
int av1_get_palette_delta_bits_v(const PALETTE_MODE_INFO *const pmi,
int bit_depth, int *zero_count, int *min_bits);
/*!\brief Gets the rate cost for transmitting luma palette color values. * *\ingrouppalette_mode_search *\param[in]pmiStructthatstoresthepalettemodeinfo. *\param[in]color_cacheColorcachepresentedatthedecoder. *\param[in]n_cacheNumberofcolorsinthecache. *\param[in]bit_depthPixelbitdepthofthesequence. * *\returnReturnstherateneededtotransmitthepalette.Notethatthisdoes *notincludethecostoftransmittedthecolormap.
*/
int av1_palette_color_cost_y(const PALETTE_MODE_INFO *const pmi, const uint16_t *color_cache, int n_cache,
int bit_depth);
/*!\brief Gets the rate cost for transmitting luma palette chroma values. * *\ingrouppalette_mode_search *\param[in]pmiStructthatstoresthepalettemodeinfo. *\param[in]color_cacheColorcachepresentedatthedecoder. *\param[in]n_cacheNumberofcolorsinthecache. *\param[in]bit_depthPixelbitdepthofthesequence. * *\returnReturnstherateneededtotransmitthepalette.Notethatthisdoes *notincludethecostoftransmittedthecolormap.
*/
int av1_palette_color_cost_uv(const PALETTE_MODE_INFO *const pmi, const uint16_t *color_cache, int n_cache,
int bit_depth);
/*!\brief Search for the best palette in the luma plane. * *\ingrouppalette_mode_search *\callergraph *Thisfunctionisusedinbothinterandintraframecoding.
*/ void av1_rd_pick_palette_intra_sby( conststruct AV1_COMP *cpi, struct macroblock *x, BLOCK_SIZE bsize,
int dc_mode_cost, MB_MODE_INFO *best_mbmi, uint8_t *best_palette_color_map,
int64_t *best_rd, int *rate, int *rate_tokenonly, int64_t *distortion,
uint8_t *skippable, int *beat_best_rd, struct PICK_MODE_CONTEXT *ctx,
uint8_t *tx_type_map);
/*!\brief Search for the best palette in the chroma plane. * *\ingrouppalette_mode_search *\callergraph *Thisfunctionisusedinbothinterandintraframecoding.
*/ void av1_rd_pick_palette_intra_sbuv(conststruct AV1_COMP *cpi, struct macroblock *x, int dc_mode_cost,
uint8_t *best_palette_color_map,
MB_MODE_INFO *const best_mbmi,
int64_t *best_rd, int *rate,
int *rate_tokenonly, int64_t *distortion,
uint8_t *skippable);
/*!\brief Resets palette color map for chroma channels.
*/ void av1_restore_uv_color_map(conststruct AV1_COMP *cpi, struct macroblock *x);
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.