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
ccaafeea
Commit
ccaafeea
authored
10 years ago
by
Dmitry Kovalev
Browse files
Options
Download
Patches
Plain Diff
Simplifying decoder_decode() function.
Change-Id: I97293605b430ad9dda0b58c0694fea569e7024a5
parent
bc811075
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
nextgen
nextgenv2
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
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
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
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/vp9_dx_iface.c
+43
-55
vp9/vp9_dx_iface.c
with
43 additions
and
55 deletions
vp9/vp9_dx_iface.c
+
43
−
55
View file @
ccaafeea
...
...
@@ -375,80 +375,68 @@ static void parse_superframe_index(const uint8_t *data, size_t data_sz,
}
}
static
vpx_codec_err_t
decode_one_iter
(
vpx_codec_alg_priv_t
*
ctx
,
const
uint8_t
**
data_start_ptr
,
const
uint8_t
*
data_end
,
uint32_t
frame_size
,
void
*
user_priv
,
long
deadline
)
{
const
vpx_codec_err_t
res
=
decode_one
(
ctx
,
data_start_ptr
,
frame_size
,
user_priv
,
deadline
);
if
(
res
!=
VPX_CODEC_OK
)
return
res
;
// Account for suboptimal termination by the encoder.
while
(
*
data_start_ptr
<
data_end
)
{
const
uint8_t
marker
=
read_marker
(
ctx
->
decrypt_cb
,
ctx
->
decrypt_state
,
*
data_start_ptr
);
if
(
marker
)
break
;
(
*
data_start_ptr
)
++
;
}
return
VPX_CODEC_OK
;
}
static
vpx_codec_err_t
decoder_decode
(
vpx_codec_alg_priv_t
*
ctx
,
const
uint8_t
*
data
,
unsigned
int
data_sz
,
void
*
user_priv
,
long
deadline
)
{
const
uint8_t
*
data_start
=
data
;
const
uint8_t
*
data_end
=
data
+
data_sz
;
vpx_codec_err_t
res
=
VPX_CODEC_OK
;
uint32_t
sizes
[
8
];
int
frames_this_pts
,
frame_count
=
0
;
const
uint8_t
*
const
data_end
=
data
+
data_sz
;
vpx_codec_err_t
res
;
uint32_t
frame_
sizes
[
8
];
int
frame_count
;
if
(
data
==
NULL
||
data_sz
==
0
)
return
VPX_CODEC_INVALID_PARAM
;
parse_superframe_index
(
data
,
data_sz
,
sizes
,
&
frame
s_this_pts
,
parse_superframe_index
(
data
,
data_sz
,
frame_
sizes
,
&
frame
_count
,
ctx
->
decrypt_cb
,
ctx
->
decrypt_state
);
do
{
if
(
data_sz
)
{
uint8_t
marker
=
read_marker
(
ctx
->
decrypt_cb
,
ctx
->
decrypt_state
,
data_start
);
// Skip over the superframe index, if present
if
((
marker
&
0xe0
)
==
0xc0
)
{
const
uint32_t
frames
=
(
marker
&
0x7
)
+
1
;
const
uint32_t
mag
=
((
marker
>>
3
)
&
0x3
)
+
1
;
const
uint32_t
index_sz
=
2
+
mag
*
frames
;
if
(
data_sz
>=
index_sz
)
{
uint8_t
marker2
=
read_marker
(
ctx
->
decrypt_cb
,
ctx
->
decrypt_state
,
data_start
+
index_sz
-
1
);
if
(
marker2
==
marker
)
{
data_start
+=
index_sz
;
data_sz
-=
index_sz
;
if
(
data_start
<
data_end
)
continue
;
else
break
;
}
}
}
}
// Use the correct size for this frame, if an index is present.
if
(
frames_this_pts
)
{
uint32_t
this_sz
=
sizes
[
frame_count
];
if
(
frame_count
>
0
)
{
int
i
;
if
(
data_sz
<
this_sz
)
{
for
(
i
=
0
;
i
<
frame_count
;
++
i
)
{
const
uint32_t
frame_size
=
frame_sizes
[
i
];
if
(
data_start
<
data
||
data_start
+
frame_size
>=
data_end
)
{
ctx
->
base
.
err_detail
=
"Invalid frame size in index"
;
return
VPX_CODEC_CORRUPT_FRAME
;
}
data_sz
=
this_sz
;
frame_count
++
;
res
=
decode_one_iter
(
ctx
,
&
data_start
,
data_end
,
frame_size
,
user_priv
,
deadline
);
if
(
res
!=
VPX_CODEC_OK
)
return
res
;
}
res
=
decode_one
(
ctx
,
&
data_start
,
data_sz
,
user_priv
,
deadline
);
assert
(
data_start
>=
data
);
assert
(
data_start
<=
data_end
);
// Early exit if there was a decode error
if
(
res
)
break
;
// Account for suboptimal termination by the encoder.
}
else
{
while
(
data_start
<
data_end
)
{
uint8_t
marker3
=
read_marker
(
ctx
->
decrypt_cb
,
ctx
->
decrypt_state
,
data_start
);
if
(
marker3
)
break
;
data_start
++
;
res
=
decode_one_iter
(
ctx
,
&
data_start
,
data_end
,
data_end
-
data_start
,
user_priv
,
deadline
);
if
(
res
!=
VPX_CODEC_OK
)
return
res
;
}
}
data_sz
=
(
unsigned
int
)(
data_end
-
data_start
);
}
while
(
data_start
<
data_end
);
return
res
;
return
VPX_CODEC_OK
;
}
static
vpx_image_t
*
decoder_get_frame
(
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