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
Xiph.Org
aom-rav1e
Commits
d6321c3e
Commit
d6321c3e
authored
Feb 28, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Feb 28, 2014
Browse files
Merge "Cleaning up vpx_codec_get_cx_data() function."
parents
fc179b3e
955b35d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
vpx/src/vpx_encoder.c
View file @
d6321c3e
...
...
@@ -255,8 +255,8 @@ vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
}
const
vpx_codec_cx_pkt_t
*
vpx_codec_get_cx_data
(
vpx_codec_ctx_t
*
ctx
,
vpx_codec_iter_t
*
iter
)
{
const
vpx_codec_cx_pkt_t
*
vpx_codec_get_cx_data
(
vpx_codec_ctx_t
*
ctx
,
vpx_codec_iter_t
*
iter
)
{
const
vpx_codec_cx_pkt_t
*
pkt
=
NULL
;
if
(
ctx
)
{
...
...
@@ -271,32 +271,30 @@ const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
}
if
(
pkt
&&
pkt
->
kind
==
VPX_CODEC_CX_FRAME_PKT
)
{
/* If the application has specified a destination area for the
* compressed data, and the codec has not placed the data there,
* and it fits, copy it.
*/
char
*
dst_buf
=
ctx
->
priv
->
enc
.
cx_data_dst_buf
.
buf
;
if
(
dst_buf
&&
pkt
->
data
.
raw
.
buf
!=
dst_buf
&&
pkt
->
data
.
raw
.
sz
+
ctx
->
priv
->
enc
.
cx_data_pad_before
+
ctx
->
priv
->
enc
.
cx_data_pad_after
<=
ctx
->
priv
->
enc
.
cx_data_dst_buf
.
sz
)
{
vpx_codec_cx_pkt_t
*
modified_pkt
=
&
ctx
->
priv
->
enc
.
cx_data_pkt
;
memcpy
(
dst_buf
+
ctx
->
priv
->
enc
.
cx_data_pad_before
,
pkt
->
data
.
raw
.
buf
,
pkt
->
data
.
raw
.
sz
);
// If the application has specified a destination area for the
// compressed data, and the codec has not placed the data there,
// and it fits, copy it.
vpx_codec_priv_t
*
const
priv
=
ctx
->
priv
;
char
*
const
dst_buf
=
(
char
*
)
priv
->
enc
.
cx_data_dst_buf
.
buf
;
if
(
dst_buf
&&
pkt
->
data
.
raw
.
buf
!=
dst_buf
&&
pkt
->
data
.
raw
.
sz
+
priv
->
enc
.
cx_data_pad_before
+
priv
->
enc
.
cx_data_pad_after
<=
priv
->
enc
.
cx_data_dst_buf
.
sz
)
{
vpx_codec_cx_pkt_t
*
modified_pkt
=
&
priv
->
enc
.
cx_data_pkt
;
memcpy
(
dst_buf
+
priv
->
enc
.
cx_data_pad_before
,
pkt
->
data
.
raw
.
buf
,
pkt
->
data
.
raw
.
sz
);
*
modified_pkt
=
*
pkt
;
modified_pkt
->
data
.
raw
.
buf
=
dst_buf
;
modified_pkt
->
data
.
raw
.
sz
+=
ctx
->
priv
->
enc
.
cx_data_pad_before
+
ctx
->
priv
->
enc
.
cx_data_pad_after
;
modified_pkt
->
data
.
raw
.
sz
+=
priv
->
enc
.
cx_data_pad_before
+
priv
->
enc
.
cx_data_pad_after
;
pkt
=
modified_pkt
;
}
if
(
dst_buf
==
pkt
->
data
.
raw
.
buf
)
{
ctx
->
priv
->
enc
.
cx_data_dst_buf
.
buf
=
dst_buf
+
pkt
->
data
.
raw
.
sz
;
ctx
->
priv
->
enc
.
cx_data_dst_buf
.
sz
-=
pkt
->
data
.
raw
.
sz
;
priv
->
enc
.
cx_data_dst_buf
.
buf
=
dst_buf
+
pkt
->
data
.
raw
.
sz
;
priv
->
enc
.
cx_data_dst_buf
.
sz
-=
pkt
->
data
.
raw
.
sz
;
}
}
...
...
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