/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
int aom_rb_read_bit(struct aom_read_bit_buffer *rb) { const uint32_t off = rb->bit_offset; const uint32_t p = off >> 3; constint q = 7 - (int)(off & 0x7); if (rb->bit_buffer + p < rb->bit_buffer_end) { constint bit = (rb->bit_buffer[p] >> q) & 1;
rb->bit_offset = off + 1; return bit;
} else { if (rb->error_handler) rb->error_handler(rb->error_handler_data); return 0;
}
}
int aom_rb_read_literal(struct aom_read_bit_buffer *rb, int bits) {
assert(bits <= 31); int value = 0, bit; for (bit = bits - 1; bit >= 0; bit--) value |= aom_rb_read_bit(rb) << bit; return value;
}
#if CONFIG_AV1_DECODER
uint32_t aom_rb_read_unsigned_literal(struct aom_read_bit_buffer *rb, int bits) {
assert(bits <= 32);
uint32_t value = 0; int bit; for (bit = bits - 1; bit >= 0; bit--)
value |= (uint32_t)aom_rb_read_bit(rb) << bit; return value;
}
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.