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
1458f064
Commit
1458f064
authored
Dec 17, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/libopenjpegenc: drop dependancy on sizeof(AVFrame)
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5b3f4b3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
libopenjpegenc.c
libavcodec/libopenjpegenc.c
+12
-10
No files found.
libavcodec/libopenjpegenc.c
View file @
1458f064
...
...
@@ -480,7 +480,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
opj_cio_t
*
stream
=
ctx
->
stream
;
int
cpyresult
=
0
;
int
ret
,
len
;
AVFrame
gbrframe
;
AVFrame
*
gbrframe
;
switch
(
avctx
->
pix_fmt
)
{
case
AV_PIX_FMT_RGB24
:
...
...
@@ -501,18 +501,20 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
case
AV_PIX_FMT_GBRP12
:
case
AV_PIX_FMT_GBRP14
:
case
AV_PIX_FMT_GBRP16
:
gbrframe
=
*
frame
;
gbrframe
.
data
[
0
]
=
frame
->
data
[
2
];
// swap to be rgb
gbrframe
.
data
[
1
]
=
frame
->
data
[
0
];
gbrframe
.
data
[
2
]
=
frame
->
data
[
1
];
gbrframe
.
linesize
[
0
]
=
frame
->
linesize
[
2
];
gbrframe
.
linesize
[
1
]
=
frame
->
linesize
[
0
];
gbrframe
.
linesize
[
2
]
=
frame
->
linesize
[
1
];
gbrframe
=
av_frame_alloc
();
av_frame_ref
(
gbrframe
,
frame
);
gbrframe
->
data
[
0
]
=
frame
->
data
[
2
];
// swap to be rgb
gbrframe
->
data
[
1
]
=
frame
->
data
[
0
];
gbrframe
->
data
[
2
]
=
frame
->
data
[
1
];
gbrframe
->
linesize
[
0
]
=
frame
->
linesize
[
2
];
gbrframe
->
linesize
[
1
]
=
frame
->
linesize
[
0
];
gbrframe
->
linesize
[
2
]
=
frame
->
linesize
[
1
];
if
(
avctx
->
pix_fmt
==
AV_PIX_FMT_GBR24P
)
{
cpyresult
=
libopenjpeg_copy_unpacked8
(
avctx
,
&
gbrframe
,
image
);
cpyresult
=
libopenjpeg_copy_unpacked8
(
avctx
,
gbrframe
,
image
);
}
else
{
cpyresult
=
libopenjpeg_copy_unpacked16
(
avctx
,
&
gbrframe
,
image
);
cpyresult
=
libopenjpeg_copy_unpacked16
(
avctx
,
gbrframe
,
image
);
}
av_frame_free
(
&
gbrframe
);
break
;
case
AV_PIX_FMT_GRAY8
:
case
AV_PIX_FMT_YUV410P
:
...
...
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