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
e059ac59
Commit
e059ac59
authored
Jun 26, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/snow: ensure the buffers have allocated edges
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
932be89c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
snow.c
libavcodec/snow.c
+10
-1
snowenc.c
libavcodec/snowenc.c
+11
-1
No files found.
libavcodec/snow.c
View file @
e059ac59
...
...
@@ -661,9 +661,18 @@ int ff_snow_frame_start(SnowContext *s){
return
-
1
;
}
}
s
->
current_picture
->
width
=
s
->
avctx
->
width
+
2
*
EDGE_WIDTH
;
s
->
current_picture
->
height
=
s
->
avctx
->
height
+
2
*
EDGE_WIDTH
;
if
((
ret
=
ff_get_buffer
(
s
->
avctx
,
s
->
current_picture
,
AV_GET_BUFFER_FLAG_REF
))
<
0
)
return
ret
;
for
(
i
=
0
;
s
->
current_picture
->
data
[
i
];
i
++
)
{
int
offset
=
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_v_shift
:
0
))
*
s
->
current_picture
->
linesize
[
i
]
+
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_h_shift
:
0
));
s
->
current_picture
->
data
[
i
]
+=
offset
;
}
s
->
current_picture
->
width
=
s
->
avctx
->
width
;
s
->
current_picture
->
height
=
s
->
avctx
->
height
;
s
->
current_picture
->
key_frame
=
s
->
keyframe
;
...
...
libavcodec/snowenc.c
View file @
e059ac59
...
...
@@ -37,6 +37,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
{
SnowContext
*
s
=
avctx
->
priv_data
;
int
plane_index
,
ret
;
int
i
;
if
(
avctx
->
prediction_method
==
DWT_97
&&
(
avctx
->
flags
&
CODEC_FLAG_QSCALE
)
...
...
@@ -124,11 +125,20 @@ static av_cold int encode_init(AVCodecContext *avctx)
s
->
input_picture
=
av_frame_alloc
();
if
(
!
s
->
input_picture
)
return
AVERROR
(
ENOMEM
);
s
->
input_picture
->
width
=
s
->
avctx
->
width
+
2
*
EDGE_WIDTH
;
s
->
input_picture
->
height
=
s
->
avctx
->
height
+
2
*
EDGE_WIDTH
;
if
((
ret
=
ff_get_buffer
(
s
->
avctx
,
s
->
input_picture
,
AV_GET_BUFFER_FLAG_REF
))
<
0
)
return
ret
;
for
(
i
=
0
;
s
->
input_picture
->
data
[
i
];
i
++
)
{
int
offset
=
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_v_shift
:
0
))
*
s
->
input_picture
->
linesize
[
i
]
+
(
EDGE_WIDTH
>>
(
i
?
s
->
chroma_h_shift
:
0
));
s
->
input_picture
->
data
[
i
]
+=
offset
;
}
s
->
input_picture
->
width
=
s
->
avctx
->
width
;
s
->
input_picture
->
height
=
s
->
avctx
->
height
;
if
(
s
->
avctx
->
me_method
==
ME_ITER
){
int
i
;
int
size
=
s
->
b_width
*
s
->
b_height
<<
2
*
s
->
block_max_depth
;
for
(
i
=
0
;
i
<
s
->
max_ref_frames
;
i
++
){
s
->
ref_mvs
[
i
]
=
av_mallocz_array
(
size
,
sizeof
(
int16_t
[
2
]));
...
...
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