Update aom to v1.0.0

Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0.
This commit is contained in:
trav90 2018-10-19 21:52:15 -05:00 • committed by Roy Tam
commit 48f6d2e034
1087 changed files with 154333 additions and 265310 deletions

View file

@ -89,61 +89,6 @@ int aom_count_primitive_quniform(uint16_t n, uint16_t v) {
return v < m ? l - 1 : l;
}
// Encodes a value v in [0, n-1] based on a reference ref also in [0, n-1]
// The closest p values of v from ref are coded using a p-ary quasi-unoform
// short code while the remaining n-p values are coded with a longer code.
void aom_write_primitive_refbilevel(aom_writer *w, uint16_t n, uint16_t p,
uint16_t ref, uint16_t v) {
if (n <= 1) return;
assert(p > 0 && p <= n);
assert(ref < n);
int lolimit = ref - p / 2;
int hilimit = lolimit + p - 1;
if (lolimit < 0) {
lolimit = 0;
hilimit = p - 1;
} else if (hilimit >= n) {
hilimit = n - 1;
lolimit = n - p;
}
if (v >= lolimit && v <= hilimit) {
aom_write_bit(w, 1);
v = v - lolimit;
aom_write_primitive_quniform(w, p, v);
} else {
aom_write_bit(w, 0);
if (v > hilimit) v -= p;
aom_write_primitive_quniform(w, n - p, v);
}
}
int aom_count_primitive_refbilevel(uint16_t n, uint16_t p, uint16_t ref,
uint16_t v) {
if (n <= 1) return 0;
assert(p > 0 && p <= n);
assert(ref < n);
int lolimit = ref - p / 2;
int hilimit = lolimit + p - 1;
if (lolimit < 0) {
lolimit = 0;
hilimit = p - 1;
} else if (hilimit >= n) {
hilimit = n - 1;
lolimit = n - p;
}
int count = 0;
if (v >= lolimit && v <= hilimit) {
count++;
v = v - lolimit;
count += aom_count_primitive_quniform(p, v);
} else {
count++;
if (v > hilimit) v -= p;
count += aom_count_primitive_quniform(n - p, v);
}
return count;
}
// Finite subexponential code that codes a symbol v in [0, n-1] with parameter k
void aom_write_primitive_subexpfin(aom_writer *w, uint16_t n, uint16_t k,
uint16_t v) {
@ -263,3 +208,15 @@ int aom_count_signed_primitive_refsubexpfin(uint16_t n, uint16_t k, int16_t ref,
const uint16_t scaled_n = (n << 1) - 1;
return aom_count_primitive_refsubexpfin(scaled_n, k, ref, v);
}
void aom_wb_write_uvlc(struct aom_write_bit_buffer *wb, uint32_t v) {
int64_t shift_val = ++v;
int leading_zeroes = 1;
assert(shift_val > 0);
while (shift_val >>= 1) leading_zeroes += 2;
aom_wb_write_literal(wb, 0, leading_zeroes >> 1);
aom_wb_write_unsigned_literal(wb, v, (leading_zeroes + 1) >> 1);
}