Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
aa1d096d
Commit
aa1d096d
authored
Jul 16, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/snow: only allocate space for edges when encoding
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8156e036
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
snow.c
libavcodec/snow.c
+16
-9
No files found.
libavcodec/snow.c
View file @
aa1d096d
...
...
@@ -69,19 +69,26 @@ void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_
int
ff_snow_get_buffer
(
SnowContext
*
s
,
AVFrame
*
frame
)
{
int
ret
,
i
;
int
edges_needed
=
av_codec_is_encoder
(
s
->
avctx
->
codec
);
frame
->
width
=
s
->
avctx
->
width
+
2
*
EDGE_WIDTH
;
frame
->
height
=
s
->
avctx
->
height
+
2
*
EDGE_WIDTH
;
frame
->
width
=
s
->
avctx
->
width
;
frame
->
height
=
s
->
avctx
->
height
;
if
(
edges_needed
)
{
frame
->
width
+=
2
*
EDGE_WIDTH
;
frame
->
height
+=
2
*
EDGE_WIDTH
;
}
if
((
ret
=
ff_get_buffer
(
s
->
avctx
,
frame
,
AV_GET_BUFFER_FLAG_REF
))
<
0
)
return
ret
;
for
(
i
=
0
;
frame
->
data
[
i
];
i
++
)
{
int
offset
=
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_v_shift
:
0
))
*
frame
->
linesize
[
i
]
+
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_h_shift
:
0
));
frame
->
data
[
i
]
+=
offset
;
if
(
edges_needed
)
{
for
(
i
=
0
;
frame
->
data
[
i
];
i
++
)
{
int
offset
=
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_v_shift
:
0
))
*
frame
->
linesize
[
i
]
+
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_h_shift
:
0
));
frame
->
data
[
i
]
+=
offset
;
}
frame
->
width
=
s
->
avctx
->
width
;
frame
->
height
=
s
->
avctx
->
height
;
}
frame
->
width
=
s
->
avctx
->
width
;
frame
->
height
=
s
->
avctx
->
height
;
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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