Adding VP9_FRAME_MARKER constant.

Also renaming SYNC_CODE_* to VP9_SYNC_CODE_*.

Change-Id: I9ff504c6ebce6cd6673d7df2085d597b818f5960
This commit is contained in:
Dmitry Kovalev 2013-10-23 17:24:17 -07:00
parent dea22b4bda
commit a53075f7c5
4 changed files with 16 additions and 15 deletions

View File

@ -84,9 +84,11 @@ static int get_unsigned_bits(unsigned int num_values) {
} while (0)
#endif
#define SYNC_CODE_0 0x49
#define SYNC_CODE_1 0x83
#define SYNC_CODE_2 0x42
#define VP9_SYNC_CODE_0 0x49
#define VP9_SYNC_CODE_1 0x83
#define VP9_SYNC_CODE_2 0x42
#define VP9_FRAME_MARKER 0x2
#endif // VP9_COMMON_VP9_COMMON_H_

View File

@ -821,9 +821,9 @@ static const uint8_t *decode_tiles(VP9D_COMP *pbi, const uint8_t *data) {
}
static void check_sync_code(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
if (vp9_rb_read_literal(rb, 8) != SYNC_CODE_0 ||
vp9_rb_read_literal(rb, 8) != SYNC_CODE_1 ||
vp9_rb_read_literal(rb, 8) != SYNC_CODE_2) {
if (vp9_rb_read_literal(rb, 8) != VP9_SYNC_CODE_0 ||
vp9_rb_read_literal(rb, 8) != VP9_SYNC_CODE_1 ||
vp9_rb_read_literal(rb, 8) != VP9_SYNC_CODE_2) {
vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
"Invalid frame sync code");
}
@ -875,7 +875,7 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
cm->last_frame_type = cm->frame_type;
if (vp9_rb_read_literal(rb, 2) != 0x2)
if (vp9_rb_read_literal(rb, 2) != VP9_FRAME_MARKER)
vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
"Invalid frame marker");

View File

@ -1295,17 +1295,16 @@ static void write_frame_size_with_refs(VP9_COMP *cpi,
}
static void write_sync_code(struct vp9_write_bit_buffer *wb) {
vp9_wb_write_literal(wb, SYNC_CODE_0, 8);
vp9_wb_write_literal(wb, SYNC_CODE_1, 8);
vp9_wb_write_literal(wb, SYNC_CODE_2, 8);
vp9_wb_write_literal(wb, VP9_SYNC_CODE_0, 8);
vp9_wb_write_literal(wb, VP9_SYNC_CODE_1, 8);
vp9_wb_write_literal(wb, VP9_SYNC_CODE_2, 8);
}
static void write_uncompressed_header(VP9_COMP *cpi,
struct vp9_write_bit_buffer *wb) {
VP9_COMMON *const cm = &cpi->common;
// frame marker bits
vp9_wb_write_literal(wb, 0x2, 2);
vp9_wb_write_literal(wb, VP9_FRAME_MARKER, 2);
// bitstream version.
// 00 - profile 0. 4:2:0 only

View File

@ -172,9 +172,9 @@ static vpx_codec_err_t vp9_peek_si(const uint8_t *data,
rb.bit_offset += 1; // show frame
rb.bit_offset += 1; // error resilient
if (vp9_rb_read_literal(&rb, 8) != SYNC_CODE_0 ||
vp9_rb_read_literal(&rb, 8) != SYNC_CODE_1 ||
vp9_rb_read_literal(&rb, 8) != SYNC_CODE_2) {
if (vp9_rb_read_literal(&rb, 8) != VP9_SYNC_CODE_0 ||
vp9_rb_read_literal(&rb, 8) != VP9_SYNC_CODE_1 ||
vp9_rb_read_literal(&rb, 8) != VP9_SYNC_CODE_2) {
return VPX_CODEC_UNSUP_BITSTREAM;
}