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
5b3f4b3e
Commit
5b3f4b3e
authored
Dec 17, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mjpegenc: drop dependancy on sizeof(AVFrame)
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c8123465
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
mjpegenc.c
libavcodec/mjpegenc.c
+9
-5
No files found.
libavcodec/mjpegenc.c
View file @
5b3f4b3e
...
...
@@ -537,8 +537,8 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
{
MpegEncContext
*
s
=
avctx
->
priv_data
;
AVFrame
pic
=
*
pic_arg
;
int
i
;
AVFrame
*
pic
;
int
i
,
ret
;
int
chroma_h_shift
,
chroma_v_shift
;
av_pix_fmt_get_chroma_sub_sample
(
avctx
->
pix_fmt
,
&
chroma_h_shift
,
&
chroma_v_shift
);
...
...
@@ -547,13 +547,17 @@ static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
if
(
s
->
avctx
->
flags
&
CODEC_FLAG_EMU_EDGE
)
return
-
1
;
pic
=
av_frame_alloc
();
av_frame_ref
(
pic
,
pic_arg
);
//picture should be flipped upside-down
for
(
i
=
0
;
i
<
3
;
i
++
)
{
int
vsample
=
i
?
2
>>
chroma_v_shift
:
2
;
pic
.
data
[
i
]
+=
(
pic
.
linesize
[
i
]
*
(
vsample
*
(
8
*
s
->
mb_height
-
((
s
->
height
/
V_MAX
)
&
7
))
-
1
));
pic
.
linesize
[
i
]
*=
-
1
;
pic
->
data
[
i
]
+=
(
pic
->
linesize
[
i
]
*
(
vsample
*
(
8
*
s
->
mb_height
-
((
s
->
height
/
V_MAX
)
&
7
))
-
1
));
pic
->
linesize
[
i
]
*=
-
1
;
}
return
ff_MPV_encode_picture
(
avctx
,
pkt
,
&
pic
,
got_packet
);
ret
=
ff_MPV_encode_picture
(
avctx
,
pkt
,
pic
,
got_packet
);
av_frame_free
(
&
pic
);
return
ret
;
}
#if CONFIG_MJPEG_ENCODER
...
...
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