Commit a425e2cc authored by John Koleszar's avatar John Koleszar

Add marker bit to bool-coded partition start

Adds a marker bit to allow distinguishing the frame header from its residual
data.

Change-Id: Id75d47acc9e5a97007e4690c4f8748a4ce63e641
parent 472669be
......@@ -68,6 +68,9 @@ TEST(VP9, TestBitIO) {
vp9_stop_encode(&bw);
// First bit should be zero
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
vp9_reader br;
vp9_reader_init(&br, bw_buffer, buffer_size);
bit_rnd.Reset(random_seed);
......
......@@ -14,6 +14,8 @@
#include "vp9/decoder/vp9_dboolhuff.h"
int vp9_reader_init(vp9_reader *r, const uint8_t *buffer, size_t size) {
int marker_bit;
r->buffer_end = buffer + size;
r->buffer = buffer;
r->value = 0;
......@@ -24,7 +26,8 @@ int vp9_reader_init(vp9_reader *r, const uint8_t *buffer, size_t size) {
return 1;
vp9_reader_fill(r);
return 0;
marker_bit = vp9_read_bit(r);
return marker_bit != 0;
}
void vp9_reader_fill(vp9_reader *r) {
......
......@@ -47,6 +47,7 @@ void vp9_start_encode(vp9_writer *br, uint8_t *source) {
br->count = -24;
br->buffer = source;
br->pos = 0;
vp9_write_bit(br, 0);
}
void vp9_stop_encode(vp9_writer *br) {
......
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