diff options
author | Deb Mukherjee <debargha@google.com> | 2014-07-18 03:23:51 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2014-07-18 03:23:51 -0700 |
commit | 727f3840851b33213967c3f1e61e08d74c2fde09 (patch) | |
tree | 997a55e15dba9439f4de726e2da1755c2a6d8a13 /vp9/decoder/vp9_decodeframe.c | |
parent | 4109b8e5357ccfe95841fde1b8f8c36d1e402114 (diff) | |
parent | c447a50aea7afe54bb7f7f71650bbd71a96bf66a (diff) | |
download | libvpx-727f3840851b33213967c3f1e61e08d74c2fde09.tar libvpx-727f3840851b33213967c3f1e61e08d74c2fde09.tar.gz libvpx-727f3840851b33213967c3f1e61e08d74c2fde09.tar.bz2 libvpx-727f3840851b33213967c3f1e61e08d74c2fde09.zip |
Merge "Separates profile 2 into 2 profiles 2 and 3"
Diffstat (limited to 'vp9/decoder/vp9_decodeframe.c')
-rw-r--r-- | vp9/decoder/vp9_decodeframe.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c index 5c4d74f46..03b4df5a4 100644 --- a/vp9/decoder/vp9_decodeframe.c +++ b/vp9/decoder/vp9_decodeframe.c @@ -1071,9 +1071,11 @@ int vp9_read_sync_code(struct vp9_read_bit_buffer *const rb) { vp9_rb_read_literal(rb, 8) == VP9_SYNC_CODE_2; } -static BITSTREAM_PROFILE read_profile(struct vp9_read_bit_buffer *rb) { +BITSTREAM_PROFILE vp9_read_profile(struct vp9_read_bit_buffer *rb) { int profile = vp9_rb_read_bit(rb); profile |= vp9_rb_read_bit(rb) << 1; + if (profile > 2) + profile += vp9_rb_read_bit(rb); return (BITSTREAM_PROFILE) profile; } @@ -1089,7 +1091,7 @@ static size_t read_uncompressed_header(VP9Decoder *pbi, vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, "Invalid frame marker"); - cm->profile = read_profile(rb); + cm->profile = vp9_read_profile(rb); if (cm->profile >= MAX_PROFILES) vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, "Unsupported bitstream profile"); @@ -1124,7 +1126,7 @@ static size_t read_uncompressed_header(VP9Decoder *pbi, cm->color_space = (COLOR_SPACE)vp9_rb_read_literal(rb, 3); if (cm->color_space != SRGB) { vp9_rb_read_bit(rb); // [16,235] (including xvycc) vs [0,255] range - if (cm->profile >= PROFILE_1) { + if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { cm->subsampling_x = vp9_rb_read_bit(rb); cm->subsampling_y = vp9_rb_read_bit(rb); vp9_rb_read_bit(rb); // has extra plane @@ -1132,12 +1134,12 @@ static size_t read_uncompressed_header(VP9Decoder *pbi, cm->subsampling_y = cm->subsampling_x = 1; } } else { - if (cm->profile >= PROFILE_1) { + if (cm->profile == PROFILE_1 || cm->profile == PROFILE_3) { cm->subsampling_y = cm->subsampling_x = 0; vp9_rb_read_bit(rb); // has extra plane } else { vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "RGB not supported in profile 0"); + "4:4:4 color not supported in profile 0"); } } |