Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/media/libvpx/libvpx/vp9/common/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 35 kB image not shown  

Quelle  vp9_entropy.c

  Sprache: C
 

/*
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */


#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_entropymode.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx/vpx_integer.h"

// Unconstrained Node Tree
/* clang-format off */
const vpx_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
  26,                                // 0 = LOW_VAL
  -TWO_TOKEN, 4,                       // 1 = TWO
  -THREE_TOKEN, -FOUR_TOKEN,           // 2 = THREE
  810,                               // 3 = HIGH_LOW
  -CATEGORY1_TOKEN, -CATEGORY2_TOKEN,  // 4 = CAT_ONE
  1214,                              // 5 = CAT_THREEFOUR
  -CATEGORY3_TOKEN, -CATEGORY4_TOKEN,  // 6 = CAT_THREE
  -CATEGORY5_TOKEN, -CATEGORY6_TOKEN   // 7 = CAT_FIVE
};
/* clang-format on */

const vpx_prob vp9_cat1_prob[] = { 159 };
const vpx_prob vp9_cat2_prob[] = { 165145 };
const vpx_prob vp9_cat3_prob[] = { 173148140 };
const vpx_prob vp9_cat4_prob[] = { 176155140135 };
const vpx_prob vp9_cat5_prob[] = { 180157141134130 };
const vpx_prob vp9_cat6_prob[] = { 254254254252249243230,
                                   196177153140133130129 };
#if CONFIG_VP9_HIGHBITDEPTH
const vpx_prob vp9_cat6_prob_high12[] = { 255255255255254254,
                                          254252249243230196,
                                          177153140133130129 };
#endif

/* clang-format off */
const uint8_t vp9_coefband_trans_8x8plus[1024] = {
  0112223333444444444445,
  // beyond MAXBAND_INDEX+1 all values are filled as 5
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555555555555555,
  55555555555555,
};
/* clang-format on */

const uint8_t vp9_coefband_trans_4x4[16] = {
  0112223333444555,
};

const uint8_t vp9_pt_energy_class[ENTROPY_TOKENS] = { 012334,
                                                      455555 };

// Model obtained from a 2-sided zero-centerd distribuition derived
// from a Pareto distribution. The cdf of the distribution is:
// cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta]
//
// For a given beta and a given probablity of the 1-node, the alpha
// is first solved, and then the {alpha, beta} pair is used to generate
// the probabilities for the rest of the nodes.

// beta = 8

// Every odd line in this table can be generated from the even lines
// by averaging :
// vp9_pareto8_full[l][node] = (vp9_pareto8_full[l-1][node] +
//                              vp9_pareto8_full[l+1][node] ) >> 1;
const vpx_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
  { 386128686238829 },
  { 6861281187429152 },
  { 9861291788619476 },
  { 12861292288779793 },
  { 1587129288993100110 },
  { 17871293390105103123 },
  { 20881303891118106136 },
  { 23881304391128108146 },
  { 26891314892139111156 },
  { 28891315393147114163 },
  { 31901315894156117171 },
  { 34901316294163119177 },
  { 37901326695171122184 },
  { 39901327096177124189 },
  { 42911327597183127194 },
  { 44911327997188129198 },
  { 47921338398193132202 },
  { 49921338699197134205 },
  { 529313390100201137208 },
  { 549313394100204139211 },
  { 579413498101208142214 },
  { 5994134101102211144216 },
  { 6294135105103214146218 },
  { 6494135108103216148220 },
  { 6695135111104219151222 },
  { 6895135114105221153223 },
  { 7196136117106224155225 },
  { 7396136120106225157226 },
  { 7697136123107227159228 },
  { 7897136126108229160229 },
  { 8098137129109231162231 },
  { 8298137131109232164232 },
  { 8498138134110234166233 },
  { 8698138137111235168234 },
  { 8999138140112236170235 },
  { 9199138142112237171235 },
  { 93100139145113238173236 },
  { 95100139147114239174237 },
  { 97101140149115240176238 },
  { 99101140151115241177238 },
  { 101102140154116242179239 },
  { 103102140156117242180239 },
  { 105103141158118243182240 },
  { 107103141160118243183240 },
  { 109104141162119244185241 },
  { 111104141164119244186241 },
  { 113104142166120245187242 },
  { 114104142168121245188242 },
  { 116105143170122246190243 },
  { 118105143171122246191243 },
  { 120106143173123247192244 },
  { 121106143175124247193244 },
  { 123107144177125248195244 },
  { 125107144178125248196244 },
  { 127108145180126249197245 },
  { 128108145181127249198245 },
  { 130109145183128249199245 },
  { 132109145184128249200245 },
  { 134110146186129250201246 },
  { 135110146187130250202246 },
  { 137111147189131251203246 },
  { 138111147190131251204246 },
  { 140112147192132251205247 },
  { 141112147193132251206247 },
  { 143113148194133251207247 },
  { 144113148195134251207247 },
  { 146114149197135252208248 },
  { 147114149198135252209248 },
  { 149115149199136252210248 },
  { 150115149200137252210248 },
  { 152115150201138252211248 },
  { 153115150202138252212248 },
  { 155116151204139253213249 },
  { 156116151205139253213249 },
  { 158117151206140253214249 },
  { 159117151207141253215249 },
  { 161118152208142253216249 },
  { 162118152209142253216249 },
  { 163119153210143253217249 },
  { 164119153211143253217249 },
  { 166120153212144254218250 },
  { 167120153212145254219250 },
  { 168121154213146254220250 },
  { 169121154214146254220250 },
  { 171122155215147254221250 },
  { 172122155216147254221250 },
  { 173123155217148254222250 },
  { 174123155217149254222250 },
  { 176124156218150254223250 },
  { 177124156219150254223250 },
  { 178125157220151254224251 },
  { 179125157220151254224251 },
  { 180126157221152254225251 },
  { 181126157221152254225251 },
  { 183127158222153254226251 },
  { 184127158223154254226251 },
  { 185128159224155255227251 },
  { 186128159224155255227251 },
  { 187129160225156255228251 },
  { 188130160225156255228251 },
  { 189131160226157255228251 },
  { 190131160226158255228251 },
  { 191132161227159255229251 },
  { 192132161227159255229251 },
  { 193133162228160255230252 },
  { 194133162229160255230252 },
  { 195134163230161255231252 },
  { 196134163230161255231252 },
  { 197135163231162255231252 },
  { 198135163231162255231252 },
  { 199136164232163255232252 },
  { 200136164232164255232252 },
  { 201137165233165255233252 },
  { 201137165233165255233252 },
  { 202138166233166255233252 },
  { 203138166233166255233252 },
  { 204139166234167255234252 },
  { 205139166234167255234252 },
  { 206140167235168255235252 },
  { 206140167235168255235252 },
  { 207141168236169255235252 },
  { 208141168236170255235252 },
  { 209142169237171255236252 },
  { 209143169237171255236252 },
  { 210144169237172255236252 },
  { 211144169237172255236252 },
  { 212145170238173255237252 },
  { 213145170238173255237252 },
  { 214146171239174255237253 },
  { 214146171239174255237253 },
  { 215147172240175255238253 },
  { 215147172240175255238253 },
  { 216148173240176255238253 },
  { 217148173240176255238253 },
  { 218149173241177255239253 },
  { 218149173241178255239253 },
  { 219150174241179255239253 },
  { 219151174241179255239253 },
  { 220152175242180255240253 },
  { 221152175242180255240253 },
  { 222153176242181255240253 },
  { 222153176242181255240253 },
  { 223154177243182255240253 },
  { 223154177243182255240253 },
  { 224155178244183255241253 },
  { 224155178244183255241253 },
  { 225156178244184255241253 },
  { 225157178244184255241253 },
  { 226158179244185255242253 },
  { 227158179244185255242253 },
  { 228159180245186255242253 },
  { 228159180245186255242253 },
  { 229160181245187255242253 },
  { 229160181245187255242253 },
  { 230161182246188255243253 },
  { 230162182246188255243253 },
  { 231163183246189255243253 },
  { 231163183246189255243253 },
  { 232164184247190255243253 },
  { 232164184247190255243253 },
  { 233165185247191255244253 },
  { 233165185247191255244253 },
  { 234166185247192255244253 },
  { 234167185247192255244253 },
  { 235168186248193255244253 },
  { 235168186248193255244253 },
  { 236169187248194255244253 },
  { 236169187248194255244253 },
  { 236170188248195255245253 },
  { 236170188248195255245253 },
  { 237171189249196255245254 },
  { 237172189249196255245254 },
  { 238173190249197255245254 },
  { 238173190249197255245254 },
  { 239174191249198255245254 },
  { 239174191249198255245254 },
  { 240175192249199255246254 },
  { 240176192249199255246254 },
  { 240177193250200255246254 },
  { 240177193250200255246254 },
  { 241178194250201255246254 },
  { 241178194250201255246254 },
  { 242179195250202255246254 },
  { 242180195250202255246254 },
  { 242181196250203255247254 },
  { 242181196250203255247254 },
  { 243182197251204255247254 },
  { 243183197251204255247254 },
  { 244184198251205255247254 },
  { 244184198251205255247254 },
  { 244185199251206255247254 },
  { 244185199251206255247254 },
  { 245186200251207255247254 },
  { 245187200251207255247254 },
  { 246188201252207255248254 },
  { 246188201252207255248254 },
  { 246189202252208255248254 },
  { 246190202252208255248254 },
  { 247191203252209255248254 },
  { 247191203252209255248254 },
  { 247192204252210255248254 },
  { 247193204252210255248254 },
  { 248194205252211255248254 },
  { 248194205252211255248254 },
  { 248195206252212255249254 },
  { 248196206252212255249254 },
  { 249197207253213255249254 },
  { 249197207253213255249254 },
  { 249198208253214255249254 },
  { 249199209253214255249254 },
  { 250200210253215255249254 },
  { 250200210253215255249254 },
  { 250201211253215255249254 },
  { 250202211253215255249254 },
  { 250203212253216255249254 },
  { 250203212253216255249254 },
  { 251204213253217255250254 },
  { 251205213253217255250254 },
  { 251206214254218255250254 },
  { 251206215254218255250254 },
  { 252207216254219255250254 },
  { 252208216254219255250254 },
  { 252209217254220255250254 },
  { 252210217254220255250254 },
  { 252211218254221255250254 },
  { 252212218254221255250254 },
  { 253213219254222255250254 },
  { 253213220254222255250254 },
  { 253214221254223255250254 },
  { 253215221254223255250254 },
  { 253216222254224255251254 },
  { 253217223254224255251254 },
  { 253218224254225255251254 },
  { 253219224254225255251254 },
  { 254220225254225255251254 },
  { 254221226254225255251254 },
  { 254222227255226255251254 },
  { 254223227255226255251254 },
  { 254224228255227255251254 },
  { 254225229255227255251254 },
  { 254226230255228255251254 },
  { 254227230255229255251254 },
  { 255228231255230255251254 },
  { 255229232255230255251254 },
  { 255230233255231255252254 },
  { 255231234255231255252254 },
  { 255232235255232255252254 },
  { 255233236255232255252254 },
  { 255235237255233255252254 },
  { 255236238255234255252254 },
  { 255238240255235255252255 },
  { 255239241255235255252254 },
  { 255241243255236255252254 },
  { 255243245255237255252254 },
  { 255246247255239255253255 },
};

static const vp9_coeff_probs_model default_coef_probs_4x4[PLANE_TYPES] = {
  {     // Y plane
    {   // Intra
      { // Band 0
        { 19529183 },
        { 8449136 },
        { 84271 } },
      { // Band 1
        { 31107169 },
        { 3599159 },
        { 1782140 },
        { 866114 },
        { 24476 },
        { 11932 } },
      { // Band 2
        { 40132201 },
        { 29114187 },
        { 1391157 },
        { 775127 },
        { 35895 },
        { 12847 } },
      { // Band 3
        { 69142221 },
        { 42122201 },
        { 1591159 },
        { 667121 },
        { 14277 },
        { 11731 } },
      { // Band 4
        { 102148228 },
        { 67117204 },
        { 1782154 },
        { 659114 },
        { 23975 },
        { 11529 } },
      { // Band 5
        { 15657233 },
        { 11957212 },
        { 5848163 },
        { 2940124 },
        { 123081 },
        { 31231 } } },
    {   // Inter
      { // Band 0
        { 191107226 },
        { 124117204 },
        { 2599155 } },
      { // Band 1
        { 29148210 },
        { 37126194 },
        { 893157 },
        { 268118 },
        { 13969 },
        { 11733 } },
      { // Band 2
        { 41151213 },
        { 27123193 },
        { 382144 },
        { 158105 },
        { 13260 },
        { 11326 } },
      { // Band 3
        { 59159220 },
        { 23126198 },
        { 488151 },
        { 166114 },
        { 13871 },
        { 11834 } },
      { // Band 4
        { 114136232 },
        { 51114207 },
        { 1183155 },
        { 356105 },
        { 13365 },
        { 11734 } },
      { // Band 5
        { 14965234 },
        { 12157215 },
        { 6149166 },
        { 2836114 },
        { 122576 },
        { 31642 } } } },
  {     // UV plane
    {   // Intra
      { // Band 0
        { 21449220 },
        { 13263188 },
        { 4265137 } },
      { // Band 1
        { 85137221 },
        { 104131216 },
        { 49111192 },
        { 2187155 },
        { 24987 },
        { 11628 } },
      { // Band 2
        { 89163230 },
        { 90137220 },
        { 29100183 },
        { 1070135 },
        { 24281 },
        { 11733 } },
      { // Band 3
        { 108167237 },
        { 55133222 },
        { 1597179 },
        { 472135 },
        { 14585 },
        { 11938 } },
      { // Band 4
        { 124146240 },
        { 66124224 },
        { 1788175 },
        { 458122 },
        { 13675 },
        { 11837 } },
      { //  Band 5
        { 14179241 },
        { 12670227 },
        { 6658182 },
        { 3044136 },
        { 123496 },
        { 22047 } } },
    {   // Inter
      { // Band 0
        { 22999249 },
        { 143111235 },
        { 46109192 } },
      { // Band 1
        { 82158236 },
        { 94146224 },
        { 25117191 },
        { 987149 },
        { 35699 },
        { 13357 } },
      { // Band 2
        { 83167237 },
        { 68145222 },
        { 10103177 },
        { 272131 },
        { 14179 },
        { 12039 } },
      { // Band 3
        { 99167239 },
        { 47141224 },
        { 10104178 },
        { 273133 },
        { 14485 },
        { 12247 } },
      { // Band 4
        { 127145243 },
        { 71129228 },
        { 1793177 },
        { 361124 },
        { 14184 },
        { 12152 } },
      { // Band 5
        { 15778244 },
        { 14072231 },
        { 6958184 },
        { 3144137 },
        { 1438105 },
        { 82361 } } } }
};

static const vp9_coeff_probs_model default_coef_probs_8x8[PLANE_TYPES] = {
  {     // Y plane
    {   // Intra
      { // Band 0
        { 12534187 },
        { 5241133 },
        { 63156 } },
      { // Band 1
        { 37109153 },
        { 51102147 },
        { 2387128 },
        { 867101 },
        { 14163 },
        { 11929 } },
      { // Band 2
        { 31154185 },
        { 17127175 },
        { 696145 },
        { 273114 },
        { 15182 },
        { 12845 } },
      { // Band 3
        { 23163200 },
        { 10131185 },
        { 293148 },
        { 167111 },
        { 14169 },
        { 11424 } },
      { // Band 4
        { 29176217 },
        { 12145201 },
        { 3101156 },
        { 169111 },
        { 13963 },
        { 11423 } },
      { // Band 5
        { 57192233 },
        { 25154215 },
        { 6109167 },
        { 378118 },
        { 14869 },
        { 12129 } } },
    {   // Inter
      { // Band 0
        { 202105245 },
        { 108106216 },
        { 1890144 } },
      { // Band 1
        { 33172219 },
        { 64149206 },
        { 14117177 },
        { 590141 },
        { 26195 },
        { 13757 } },
      { // Band 2
        { 33179220 },
        { 11140198 },
        { 189148 },
        { 160104 },
        { 13357 },
        { 11221 } },
      { // Band 3
        { 30181221 },
        { 8141198 },
        { 187145 },
        { 158100 },
        { 13155 },
        { 11220 } },
      { // Band 4
        { 32186224 },
        { 7142198 },
        { 186143 },
        { 158100 },
        { 13155 },
        { 11222 } },
      { // Band 5
        { 57192227 },
        { 20143204 },
        { 396154 },
        { 168112 },
        { 14269 },
        { 11932 } } } },
  {     // UV plane
    {   // Intra
      { // Band 0
        { 21235215 },
        { 11347169 },
        { 2948105 } },
      { // Band 1
        { 74129203 },
        { 106120203 },
        { 49107178 },
        { 1984144 },
        { 45084 },
        { 11525 } },
      { // Band 2
        { 71172217 },
        { 44141209 },
        { 15102173 },
        { 676133 },
        { 25189 },
        { 12442 } },
      { // Band 3
        { 64185231 },
        { 31148216 },
        { 8103175 },
        { 374131 },
        { 14681 },
        { 11830 } },
      { // Band 4
        { 65196235 },
        { 25157221 },
        { 5105174 },
        { 167120 },
        { 13869 },
        { 11530 } },
      { // Band 5
        { 65204238 },
        { 30156224 },
        { 7107177 },
        { 270124 },
        { 14273 },
        { 11834 } } },
    {   // Inter
      { // Band 0
        { 22586251 },
        { 144104235 },
        { 4299181 } },
      { // Band 1
        { 85175239 },
        { 112165229 },
        { 29136200 },
        { 12103162 },
        { 677123 },
        { 25384 } },
      { // Band 2
        { 75183239 },
        { 30155221 },
        { 3106171 },
        { 174128 },
        { 14476 },
        { 11728 } },
      { // Band 3
        { 73185240 },
        { 27159222 },
        { 2107172 },
        { 175127 },
        { 14273 },
        { 11729 } },
      { // Band 4
        { 62190238 },
        { 21159222 },
        { 2107172 },
        { 172122 },
        { 14071 },
        { 11832 } },
      { // Band 5
        { 61199240 },
        { 27161226 },
        { 4113180 },
        { 176129 },
        { 14680 },
        { 12341 } } } }
};

static const vp9_coeff_probs_model default_coef_probs_16x16[PLANE_TYPES] = {
  {     // Y plane
    {   // Intra
      { // Band 0
        { 727153 },
        { 53095 },
        { 11630 } },
      { // Band 1
        { 5075127 },
        { 5775124 },
        { 2767108 },
        { 105486 },
        { 13352 },
        { 11218 } },
      { // Band 2
        { 43125151 },
        { 26108148 },
        { 783122 },
        { 25989 },
        { 13860 },
        { 11727 } },
      { // Band 3
        { 23144163 },
        { 13112154 },
        { 275117 },
        { 15081 },
        { 13151 },
        { 11423 } },
      { // Band 4
        { 18162185 },
        { 6123171 },
        { 178125 },
        { 15186 },
        { 13154 },
        { 11423 } },
      { // Band 5
        { 15199227 },
        { 3150204 },
        { 191146 },
        { 15595 },
        { 13053 },
        { 11120 } } },
    {   // Inter
      { // Band 0
        { 1955240 },
        { 1959196 },
        { 352105 } },
      { // Band 1
        { 41166207 },
        { 104153199 },
        { 31123181 },
        { 14101152 },
        { 572106 },
        { 13652 } },
      { // Band 2
        { 35176211 },
        { 12131190 },
        { 288144 },
        { 160101 },
        { 13660 },
        { 11628 } },
      { // Band 3
        { 28183213 },
        { 8134191 },
        { 186142 },
        { 15696 },
        { 13053 },
        { 11220 } },
      { // Band 4
        { 20190215 },
        { 4135192 },
        { 184139 },
        { 15391 },
        { 12849 },
        { 11120 } },
      { // Band 5
        { 13196216 },
        { 2137192 },
        { 186143 },
        { 15799 },
        { 13256 },
        { 11324 } } } },
  {     // UV plane
    {   // Intra
      { // Band 0
        { 21129217 },
        { 9647156 },
        { 224387 } },
      { // Band 1
        { 78120193 },
        { 111116186 },
        { 46102164 },
        { 1580128 },
        { 24976 },
        { 11828 } },
      { // Band 2
        { 71161203 },
        { 42132192 },
        { 1098150 },
        { 369109 },
        { 14470 },
        { 11829 } },
      { // Band 3
        { 57186211 },
        { 30140196 },
        { 493146 },
        { 162102 },
        { 13865 },
        { 11627 } },
      { // Band 4
        { 47199217 },
        { 14145196 },
        { 188142 },
        { 15798 },
        { 13662 },
        { 11526 } },
      { // Band 5
        { 26219229 },
        { 5155207 },
        { 194151 },
        { 160104 },
        { 13662 },
        { 11628 } } },
    {   // Inter
      { // Band 0
        { 23329248 },
        { 14647220 },
        { 4352140 } },
      { // Band 1
        { 100163232 },
        { 179161222 },
        { 63142204 },
        { 37113174 },
        { 2689137 },
        { 186897 } },
      { // Band 2
        { 85181230 },
        { 32146209 },
        { 7100164 },
        { 371121 },
        { 14577 },
        { 11830 } },
      { // Band 3
        { 65187230 },
        { 20148207 },
        { 297159 },
        { 168116 },
        { 14070 },
        { 11429 } },
      { // Band 4
        { 40194227 },
        { 8147204 },
        { 194155 },
        { 165112 },
        { 13966 },
        { 11426 } },
      { // Band 5
        { 16208228 },
        { 3151207 },
        { 198160 },
        { 167117 },
        { 14174 },
        { 11731 } } } }
};

static const vp9_coeff_probs_model default_coef_probs_32x32[PLANE_TYPES] = {
  {     // Y plane
    {   // Intra
      { // Band 0
        { 1738140 },
        { 73480 },
        { 11729 } },
      { // Band 1
        { 3775128 },
        { 4176128 },
        { 2666116 },
        { 125294 },
        { 23255 },
        { 11016 } },
      { // Band 2
        { 50127154 },
        { 37109152 },
        { 1682121 },
        { 55985 },
        { 13554 },
        { 11320 } },
      { // Band 3
        { 40142167 },
        { 17110157 },
        { 271112 },
        { 14472 },
        { 12745 },
        { 11117 } },
      { // Band 4
        { 30175188 },
        { 9124169 },
        { 174116 },
        { 14878 },
        { 13049 },
        { 11118 } },
      { // Band 5
        { 10222223 },
        { 2150194 },
        { 183128 },
        { 14879 },
        { 12745 },
        { 11117 } } },
    {   // Inter
      { // Band 0
        { 3641235 },
        { 2936193 },
        { 1027111 } },
      { // Band 1
        { 85165222 },
        { 177162215 },
        { 110135195 },
        { 57113168 },
        { 2383120 },
        { 104961 } },
      { // Band 2
        { 85190223 },
        { 36139200 },
        { 590146 },
        { 160103 },
        { 13865 },
        { 11830 } },
      { // Band 3
        { 72202223 },
        { 23141199 },
        { 286140 },
        { 15697 },
        { 13661 },
        { 11627 } },
      { // Band 4
        { 55218225 },
        { 13145200 },
        { 186141 },
        { 15799 },
        { 13561 },
        { 11322 } },
      { // Band 5
        { 15235212 },
        { 1132184 },
        { 184139 },
        { 15797 },
        { 13456 },
        { 11423 } } } },
  {     // UV plane
    {   // Intra
      { // Band 0
        { 18121201 },
        { 6137123 },
        { 103871 } },
      { // Band 1
        { 47106172 },
        { 95104173 },
        { 4293159 },
        { 1877131 },
        { 45081 },
        { 11723 } },
      { // Band 2
        { 62147199 },
        { 44130189 },
        { 28102154 },
        { 1875115 },
        { 24465 },
        { 11219 } },
      { // Band 3
        { 55153210 },
        { 24130194 },
        { 393146 },
        { 16197 },
        { 13150 },
        { 11016 } },
      { // Band 4
        { 49186223 },
        { 17148204 },
        { 196142 },
        { 15383 },
        { 12644 },
        { 11117 } },
      { // Band 5
        { 13217212 },
        { 2136180 },
        { 178124 },
        { 15083 },
        { 12949 },
        { 11423 } } },
    {   // Inter
      { // Band 0
        { 19713247 },
        { 8217222 },
        { 2517162 } },
      { // Band 1
        { 126186247 },
        { 234191243 },
        { 176177234 },
        { 104158220 },
        { 66128186 },
        { 5590137 } },
      { // Band 2
        { 111197242 },
        { 46158219 },
        { 9104171 },
        { 265125 },
        { 14480 },
        { 11791 } },
      { // Band 3
        { 104208245 },
        { 39168224 },
        { 3109162 },
        { 179124 },
        { 150102 },
        { 143102 } },
      { // Band 4
        { 84220246 },
        { 31177231 },
        { 2115180 },
        { 179134 },
        { 15577 },
        { 16079 } },
      { // Band 5
        { 43243240 },
        { 8180217 },
        { 1115166 },
        { 184121 },
        { 15167 },
        { 1166 } } } }
};

static void extend_to_full_distribution(vpx_prob *probs, vpx_prob p) {
  assert(p != 0);
  memcpy(probs, vp9_pareto8_full[p - 1], MODEL_NODES * sizeof(vpx_prob));
}

void vp9_model_to_full_probs(const vpx_prob *model, vpx_prob *full) {
  if (full != model)
    memcpy(full, model, sizeof(vpx_prob) * UNCONSTRAINED_NODES);
  extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]);
}

void vp9_default_coef_probs(VP9_COMMON *cm) {
  vp9_copy(cm->fc->coef_probs[TX_4X4], default_coef_probs_4x4);
  vp9_copy(cm->fc->coef_probs[TX_8X8], default_coef_probs_8x8);
  vp9_copy(cm->fc->coef_probs[TX_16X16], default_coef_probs_16x16);
  vp9_copy(cm->fc->coef_probs[TX_32X32], default_coef_probs_32x32);
}

#define COEF_COUNT_SAT 24
#define COEF_MAX_UPDATE_FACTOR 112
#define COEF_COUNT_SAT_KEY 24
#define COEF_MAX_UPDATE_FACTOR_KEY 112
#define COEF_COUNT_SAT_AFTER_KEY 24
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128

static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size,
                             unsigned int count_sat,
                             unsigned int update_factor) {
  const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
  vp9_coeff_probs_model *const probs = cm->fc->coef_probs[tx_size];
  const vp9_coeff_probs_model *const pre_probs = pre_fc->coef_probs[tx_size];
  vp9_coeff_count_model *counts = cm->counts.coef[tx_size];
  unsigned int(*eob_counts)[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] =
      cm->counts.eob_branch[tx_size];
  int i, j, k, l, m;

  for (i = 0; i < PLANE_TYPES; ++i)
    for (j = 0; j < REF_TYPES; ++j)
      for (k = 0; k < COEF_BANDS; ++k)
        for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
          const int n0 = counts[i][j][k][l][ZERO_TOKEN];
          const int n1 = counts[i][j][k][l][ONE_TOKEN];
          const int n2 = counts[i][j][k][l][TWO_TOKEN];
          const int neob = counts[i][j][k][l][EOB_MODEL_TOKEN];
          const unsigned int branch_ct[UNCONSTRAINED_NODES][2] = {
            { neob, eob_counts[i][j][k][l] - neob }, { n0, n1 + n2 }, { n1, n2 }
          };
          for (m = 0; m < UNCONSTRAINED_NODES; ++m)
            probs[i][j][k][l][m] =
                merge_probs(pre_probs[i][j][k][l][m], branch_ct[m], count_sat,
                            update_factor);
        }
}

void vp9_adapt_coef_probs(VP9_COMMON *cm) {
  TX_SIZE t;
  unsigned int count_sat, update_factor;

  if (frame_is_intra_only(cm)) {
    update_factor = COEF_MAX_UPDATE_FACTOR_KEY;
    count_sat = COEF_COUNT_SAT_KEY;
  } else if (cm->last_frame_type == KEY_FRAME) {
    update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */
    count_sat = COEF_COUNT_SAT_AFTER_KEY;
  } else {
    update_factor = COEF_MAX_UPDATE_FACTOR;
    count_sat = COEF_COUNT_SAT;
  }
  for (t = TX_4X4; t <= TX_32X32; t++)
    adapt_coef_probs(cm, t, count_sat, update_factor);
}

Messung V0.5 in Prozent
C=93 H=92 G=92

¤ Dauer der Verarbeitung: 0.45 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.