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
b8e899f4
Commit
b8e899f4
authored
Apr 12, 2016
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmaldec: Use imgutils.h for copying frames
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
798845ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
mmaldec.c
libavcodec/mmaldec.c
+8
-14
No files found.
libavcodec/mmaldec.c
View file @
b8e899f4
...
...
@@ -38,6 +38,7 @@
#include "libavutil/avassert.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/log.h"
...
...
@@ -589,24 +590,17 @@ static int ffmal_copy_frame(AVCodecContext *avctx, AVFrame *frame,
}
else
{
int
w
=
FFALIGN
(
avctx
->
width
,
32
);
int
h
=
FFALIGN
(
avctx
->
height
,
16
);
char
*
ptr
;
int
plane
;
int
i
;
uint8_t
*
src
[
4
];
int
linesize
[
4
];
if
((
ret
=
ff_get_buffer
(
avctx
,
frame
,
0
))
<
0
)
goto
done
;
ptr
=
buffer
->
data
+
buffer
->
type
->
video
.
offset
[
0
];
for
(
i
=
0
;
i
<
avctx
->
height
;
i
++
)
memcpy
(
frame
->
data
[
0
]
+
frame
->
linesize
[
0
]
*
i
,
ptr
+
w
*
i
,
avctx
->
width
);
ptr
+=
w
*
h
;
for
(
plane
=
1
;
plane
<
3
;
plane
++
)
{
for
(
i
=
0
;
i
<
avctx
->
height
/
2
;
i
++
)
memcpy
(
frame
->
data
[
plane
]
+
frame
->
linesize
[
plane
]
*
i
,
ptr
+
w
/
2
*
i
,
(
avctx
->
width
+
1
)
/
2
);
ptr
+=
w
/
2
*
h
/
2
;
}
av_image_fill_arrays
(
src
,
linesize
,
buffer
->
data
+
buffer
->
type
->
video
.
offset
[
0
],
avctx
->
pix_fmt
,
w
,
h
,
1
);
av_image_copy
(
frame
->
data
,
frame
->
linesize
,
src
,
linesize
,
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
);
}
frame
->
pkt_pts
=
buffer
->
pts
==
MMAL_TIME_UNKNOWN
?
AV_NOPTS_VALUE
:
buffer
->
pts
;
...
...
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