Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
da9a6ac9
Commit
da9a6ac9
authored
11 years ago
by
James Zern
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "vp9_peek_si: add bitstream v1 support"
parents
8b810c7a
61673553
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
stable-vp9-decoder
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
v1.3.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/vp9_dx_iface.c
+49
-16
vp9/vp9_dx_iface.c
with
49 additions
and
16 deletions
vp9/vp9_dx_iface.c
+
49
−
16
View file @
da9a6ac9
...
...
@@ -15,8 +15,9 @@
#include
"vpx/vp8dx.h"
#include
"vpx/internal/vpx_codec_internal.h"
#include
"vpx_version.h"
#include
"decoder/vp9_onyxd.h"
#include
"decoder/vp9_onyxd_int.h"
#include
"vp9/decoder/vp9_onyxd.h"
#include
"vp9/decoder/vp9_onyxd_int.h"
#include
"vp9/decoder/vp9_read_bit_buffer.h"
#include
"vp9/vp9_iface_common.h"
#define VP9_CAP_POSTPROC (CONFIG_POSTPROC ? VPX_CODEC_CAP_POSTPROC : 0)
...
...
@@ -142,32 +143,64 @@ static vpx_codec_err_t vp9_destroy(vpx_codec_alg_priv_t *ctx) {
static
vpx_codec_err_t
vp9_peek_si
(
const
uint8_t
*
data
,
unsigned
int
data_sz
,
vpx_codec_stream_info_t
*
si
)
{
vpx_codec_err_t
res
=
VPX_CODEC_OK
;
if
(
data_sz
<=
8
)
return
VPX_CODEC_UNSUP_BITSTREAM
;
if
(
data
+
data_sz
<=
data
)
return
VPX_CODEC_INVALID_PARAM
;
if
(
data
+
data_sz
<=
data
)
{
res
=
VPX_CODEC_INVALID_PARAM
;
}
else
{
const
int
frame_marker
=
(
data
[
0
]
>>
6
)
&
0x3
;
const
int
version
=
(
data
[
0
]
>>
4
)
&
0x3
;
si
->
is_kf
=
0
;
si
->
w
=
si
->
h
=
0
;
{
struct
vp9_read_bit_buffer
rb
=
{
data
,
data
+
data_sz
,
0
,
NULL
,
NULL
};
const
int
frame_marker
=
vp9_rb_read_literal
(
&
rb
,
2
);
const
int
version
=
vp9_rb_read_bit
(
&
rb
)
|
(
vp9_rb_read_bit
(
&
rb
)
<<
1
);
if
(
frame_marker
!=
0x2
)
return
VPX_CODEC_UNSUP_BITSTREAM
;
#if CONFIG_NON420
if
(
version
>
1
)
return
VPX_CODEC_UNSUP_BITSTREAM
;
#else
if
(
version
!=
0
)
return
VPX_CODEC_UNSUP_BITSTREAM
;
#endif
if
(
vp9_rb_read_bit
(
&
rb
))
{
// show an existing frame
return
VPX_CODEC_OK
;
}
si
->
is_kf
=
!
((
data
[
0
]
>>
2
)
&
0x1
);
si
->
is_kf
=
!
vp9_rb_read_bit
(
&
rb
);
if
(
si
->
is_kf
)
{
const
uint8_t
*
c
=
data
+
1
;
const
int
sRGB
=
7
;
int
colorspace
;
if
(
c
[
0
]
!=
SYNC_CODE_0
||
c
[
1
]
!=
SYNC_CODE_1
||
c
[
2
]
!=
SYNC_CODE_2
)
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
)
{
return
VPX_CODEC_UNSUP_BITSTREAM
;
}
colorspace
=
vp9_rb_read_literal
(
&
rb
,
3
);
if
(
colorspace
!=
sRGB
)
{
rb
.
bit_offset
+=
1
;
// [16,235] (including xvycc) vs [0,255] range
if
(
version
==
1
)
{
rb
.
bit_offset
+=
2
;
// subsampling x/y
rb
.
bit_offset
+=
1
;
// has extra plane
}
}
else
{
if
(
version
==
1
)
{
rb
.
bit_offset
+=
1
;
// has extra plane
}
else
{
// RGB is only available in version 1
return
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
;
// TODO(jzern): these are available on non-keyframes in intra only mode.
si
->
w
=
vp9_rb_read_literal
(
&
rb
,
16
)
+
1
;
si
->
h
=
vp9_rb_read_literal
(
&
rb
,
16
)
+
1
;
}
}
return
res
;
return
VPX_CODEC_OK
;
}
static
vpx_codec_err_t
vp9_get_si
(
vpx_codec_alg_priv_t
*
ctx
,
...
...
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets