diff options
author | Ronald S. Bultje <rbultje@google.com> | 2013-06-07 14:45:49 -0700 |
---|---|---|
committer | Ronald S. Bultje <rbultje@google.com> | 2013-06-07 14:45:49 -0700 |
commit | 36f02bf3c15691e426b0a8e80d1fa0f2ae5afbb2 (patch) | |
tree | aa141b0e74ff416cdbc1845735e88d1fa6626859 /vp9/decoder | |
parent | 6533ac73525b14dd1d20b87dbede2d6dcd408c35 (diff) | |
download | libvpx-36f02bf3c15691e426b0a8e80d1fa0f2ae5afbb2.tar libvpx-36f02bf3c15691e426b0a8e80d1fa0f2ae5afbb2.tar.gz libvpx-36f02bf3c15691e426b0a8e80d1fa0f2ae5afbb2.tar.bz2 libvpx-36f02bf3c15691e426b0a8e80d1fa0f2ae5afbb2.zip |
Add slightly more colorspace variations.
Change-Id: Ib44541fbbdcf71ec881814bd6715ea1c6bd82cf4
Diffstat (limited to 'vp9/decoder')
-rw-r--r-- | vp9/decoder/vp9_decodframe.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index 1e2c7534a..deb39561d 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -959,6 +959,8 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi, cm->error_resilient_mode = vp9_rb_read_bit(rb); if (cm->frame_type == KEY_FRAME) { + int csp; + 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) { @@ -966,13 +968,24 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi, "Invalid frame sync code"); } - vp9_rb_read_literal(rb, 3); // colorspace - if (cm->version == 1) { - cm->subsampling_x = vp9_rb_read_bit(rb); - cm->subsampling_y = vp9_rb_read_bit(rb); - vp9_rb_read_bit(rb); // has extra plane + csp = vp9_rb_read_literal(rb, 3); // colorspace + if (csp != 7) { // != sRGB + vp9_rb_read_bit(rb); // [16,235] (including xvycc) vs [0,255] range + if (cm->version == 1) { + cm->subsampling_x = vp9_rb_read_bit(rb); + cm->subsampling_y = vp9_rb_read_bit(rb); + vp9_rb_read_bit(rb); // has extra plane + } else { + cm->subsampling_y = cm->subsampling_x = 1; + } } else { - cm->subsampling_y = cm->subsampling_x = 1; + if (cm->version == 1) { + 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"); + } } vp9_setup_past_independence(cm, xd); |