Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
36f02bf3
Commit
36f02bf3
authored
Jun 07, 2013
by
Ronald S. Bultje
Browse files
Add slightly more colorspace variations.
Change-Id: Ib44541fbbdcf71ec881814bd6715ea1c6bd82cf4
parent
6533ac73
Changes
2
Hide whitespace changes
Inline
Side-by-side
vp9/decoder/vp9_decodframe.c
View file @
36f02bf3
...
...
@@ -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
);
...
...
vp9/encoder/vp9_bitstream.c
View file @
36f02bf3
...
...
@@ -1361,12 +1361,21 @@ static void write_uncompressed_header(VP9_COMP *cpi,
// 000 - Unknown
// 001 - BT.601
// 010 - BT.709
// 011 - xvYCC
// 1xx - Reserved
// 011 - SMPTE-170
// 100 - SMPTE-240
// 101 - Reserved
// 110 - Reserved
// 111 - sRGB (RGB)
vp9_wb_write_literal
(
wb
,
0
,
3
);
if
(
cm
->
version
==
1
)
{
vp9_wb_write_bit
(
wb
,
cm
->
subsampling_x
);
vp9_wb_write_bit
(
wb
,
cm
->
subsampling_y
);
if
(
1
/* colorspace != sRGB */
)
{
vp9_wb_write_bit
(
wb
,
0
);
// 0: [16, 235] (i.e. xvYCC), 1: [0, 255]
if
(
cm
->
version
==
1
)
{
vp9_wb_write_bit
(
wb
,
cm
->
subsampling_x
);
vp9_wb_write_bit
(
wb
,
cm
->
subsampling_y
);
vp9_wb_write_bit
(
wb
,
0
);
// has extra plane
}
}
else
{
assert
(
cm
->
version
==
1
);
vp9_wb_write_bit
(
wb
,
0
);
// has extra plane
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment