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
7645c9ab
Commit
7645c9ab
authored
Jul 10, 2013
by
James Zern
Browse files
vp9: fix peek_si for version==0
Change-Id: I6bfec4fa50dfc1a953edb1a2aa8e97e6e896bed6
parent
46997bde
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/vp9_dx_iface.c
View file @
7645c9ab
...
...
@@ -212,26 +212,27 @@ static vpx_codec_err_t vp8_peek_si(const uint8_t *data,
vpx_codec_stream_info_t
*
si
)
{
vpx_codec_err_t
res
=
VPX_CODEC_OK
;
if
(
data
+
data_sz
<=
data
)
if
(
data_sz
<=
8
)
return
VPX_CODEC_UNSUP_BITSTREAM
;
if
(
data
+
data_sz
<=
data
)
{
res
=
VPX_CODEC_INVALID_PARAM
;
else
{
si
->
is_kf
=
0
;
}
else
{
const
int
frame_marker
=
(
data
[
0
]
>>
6
)
&
0x3
;
const
int
version
=
(
data
[
0
]
>>
4
)
&
0x3
;
if
(
frame_marker
!=
0x2
)
return
VPX_CODEC_UNSUP_BITSTREAM
;
if
(
version
!=
0
)
return
VPX_CODEC_UNSUP_BITSTREAM
;
if
(
data_sz
>=
8
&&
(
data
[
0
]
&
0xD8
)
==
0x80
)
{
/* I-Frame */
si
->
is_kf
=
!
((
data
[
0
]
>>
2
)
&
0x1
);
if
(
si
->
is_kf
)
{
const
uint8_t
*
c
=
data
+
1
;
si
->
is_kf
=
1
;
if
(
c
[
0
]
!=
SYNC_CODE_0
||
c
[
1
]
!=
SYNC_CODE_1
||
c
[
2
]
!=
SYNC_CODE_2
)
res
=
VPX_CODEC_UNSUP_BITSTREAM
;
si
->
w
=
(
c
[
3
]
<<
8
)
|
c
[
4
];
si
->
h
=
(
c
[
5
]
<<
8
)
|
c
[
6
];
return
VPX_CODEC_UNSUP_BITSTREAM
;
// printf("w=%d, h=%d\n", si->w, si->h);
if
(
!
(
si
->
h
|
si
->
w
))
res
=
VPX_CODEC_UNSUP_BITSTREAM
;
}
else
res
=
VPX_CODEC_UNSUP_BITSTREAM
;
c
+=
3
;
si
->
w
=
(((
c
[
0
]
&
0xf
)
<<
12
)
|
(
c
[
1
]
<<
4
)
|
((
c
[
2
]
>>
4
)
&
0xf
))
+
1
;
si
->
h
=
(((
c
[
2
]
&
0xf
)
<<
12
)
|
(
c
[
3
]
<<
4
)
|
((
c
[
4
]
>>
4
)
&
0xf
))
+
1
;
}
}
return
res
;
...
...
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