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
e692c967
Commit
e692c967
authored
May 31, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/asvenc: fix encoding dimensions %16 != 0
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
879aa062
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
asvenc.c
libavcodec/asvenc.c
+42
-0
No files found.
libavcodec/asvenc.c
View file @
e692c967
...
...
@@ -181,6 +181,48 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int
size
,
ret
;
int
mb_x
,
mb_y
;
if
(
pict
->
width
%
16
||
pict
->
height
%
16
)
{
AVFrame
*
clone
=
av_frame_alloc
();
int
i
;
if
(
!
clone
)
return
AVERROR
(
ENOMEM
);
clone
->
format
=
pict
->
format
;
clone
->
width
=
FFALIGN
(
pict
->
width
,
16
);
clone
->
height
=
FFALIGN
(
pict
->
height
,
16
);
ret
=
av_frame_get_buffer
(
clone
,
32
);
if
(
ret
<
0
)
{
av_frame_free
(
&
clone
);
return
ret
;
}
ret
=
av_frame_copy
(
clone
,
pict
);
if
(
ret
<
0
)
{
av_frame_free
(
&
clone
);
return
ret
;
}
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
x
,
y
;
int
w
=
FF_CEIL_RSHIFT
(
pict
->
width
,
!!
i
);
int
h
=
FF_CEIL_RSHIFT
(
pict
->
height
,
!!
i
);
int
w2
=
FF_CEIL_RSHIFT
(
clone
->
width
,
!!
i
);
int
h2
=
FF_CEIL_RSHIFT
(
clone
->
height
,
!!
i
);
for
(
y
=
0
;
y
<
h
;
y
++
)
for
(
x
=
w
;
x
<
w2
;
x
++
)
clone
->
data
[
i
][
x
+
y
*
clone
->
linesize
[
i
]]
=
clone
->
data
[
i
][
w
-
1
+
y
*
clone
->
linesize
[
i
]];
for
(
y
=
h
;
y
<
h2
;
y
++
)
for
(
x
=
0
;
x
<
w2
;
x
++
)
clone
->
data
[
i
][
x
+
y
*
clone
->
linesize
[
i
]]
=
clone
->
data
[
i
][
x
+
(
h
-
1
)
*
clone
->
linesize
[
i
]];
}
ret
=
encode_frame
(
avctx
,
pkt
,
clone
,
got_packet
);
av_frame_free
(
&
clone
);
return
ret
;
}
if
((
ret
=
ff_alloc_packet2
(
avctx
,
pkt
,
a
->
mb_height
*
a
->
mb_width
*
MAX_MB_SIZE
+
FF_MIN_BUFFER_SIZE
))
<
0
)
return
ret
;
...
...
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