Commit 2ee49d33 authored by Thomas Daede's avatar Thomas Daede

Make rawbits decodeable

Change-Id: I224fed8a78b4a30607b56a75fc9e165509dc4e45
parent d0cbdf38
......@@ -31,7 +31,8 @@ int vpx_reader_init(vpx_reader *r, const uint8_t *buffer, size_t size,
r->decrypt_cb = decrypt_cb;
r->decrypt_state = decrypt_state;
#if DAALA_ENTROPY_CODER
od_ec_dec_init(&r->ec, buffer, size);
// drop last byte because it's always zero
od_ec_dec_init(&r->ec, buffer, size - 1);
return 0;
#else
vpx_reader_fill(r);
......
......@@ -36,11 +36,14 @@ void vpx_stop_encode(vpx_writer *br) {
memcpy(br->buffer, daala_data, daala_bytes);
br->pos = daala_bytes;
od_ec_enc_clear(&br->ec);
// Ensure there's no ambigous collision with any index marker bytes
// this always wastes a byte which is not great
br->buffer[br->pos++] = 0;
#else
int i;
for (i = 0; i < 32; i++)
vpx_write_bit(br, 0);
#endif
// Ensure there's no ambigous collision with any index marker bytes
if ((br->buffer[br->pos - 1] & 0xe0) == 0xc0) br->buffer[br->pos++] = 0;
#endif
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment