/* * 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.
*/
/* for const-casting */ typedefconst uint8_t (*ProbaArray)[NUM_CTX][NUM_PROBAS];
// With corrupt / fuzzed streams the calculation of br->value may overflow. See // b/148271109. static VPX_NO_UNSIGNED_OVERFLOW_CHECK int GetSigned(BOOL_DECODER *br, int value_to_sign) { int split = (br->range + 1) >> 1;
VP8_BD_VALUE bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8); int v;
return v;
} /* Returns the position of the last non-zero coeff plus one (and 0 if there's no coeff at all)
*/ staticint GetCoeffs(BOOL_DECODER *br, ProbaArray prob, int ctx, int n,
int16_t *out) { const uint8_t *p = prob[n][ctx]; if (!VP8GetBit(br, p[0])) { /* first EOB is more a 'CBP' bit. */ return 0;
} while (1) {
++n; if (!VP8GetBit(br, p[1])) {
p = prob[kBands[n]][0];
} else { /* non zero coeff */ int v, j; if (!VP8GetBit(br, p[2])) {
p = prob[kBands[n]][1];
v = 1;
} else { if (!VP8GetBit(br, p[3])) { if (!VP8GetBit(br, p[4])) {
v = 2;
} else {
v = 3 + VP8GetBit(br, p[5]);
}
} else { if (!VP8GetBit(br, p[6])) { if (!VP8GetBit(br, p[7])) {
v = 5 + VP8GetBit(br, 159);
} else {
v = 7 + 2 * VP8GetBit(br, 165);
v += VP8GetBit(br, 145);
}
} else { const uint8_t *tab; constint bit1 = VP8GetBit(br, p[8]); constint bit0 = VP8GetBit(br, p[9 + bit1]); constint cat = 2 * bit1 + bit0;
v = 0; for (tab = kCat3456[cat]; *tab; ++tab) {
v += v + VP8GetBit(br, *tab);
}
v += 3 + (8 << cat);
}
}
p = prob[kBands[n]][2];
}
j = kZigzag[n - 1];
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.