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
0117ba55
Commit
0117ba55
authored
Jan 18, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpegvideo_enc: fix custom matrixes with jpeg
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4d55fe72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+11
-3
No files found.
libavcodec/mpegvideo_enc.c
View file @
0117ba55
...
...
@@ -3384,7 +3384,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
update_qscale
(
s
);
}
if
(
s
->
codec_id
!=
AV_CODEC_ID_AMV
){
if
(
s
->
codec_id
!=
AV_CODEC_ID_AMV
&&
s
->
codec_id
!=
AV_CODEC_ID_MJPEG
){
if
(
s
->
q_chroma_intra_matrix
!=
s
->
q_intra_matrix
)
av_freep
(
&
s
->
q_chroma_intra_matrix
);
if
(
s
->
q_chroma_intra_matrix16
!=
s
->
q_intra_matrix16
)
av_freep
(
&
s
->
q_chroma_intra_matrix16
);
s
->
q_chroma_intra_matrix
=
s
->
q_intra_matrix
;
...
...
@@ -3500,12 +3500,20 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s
->
qscale
=
3
;
//reduce clipping problems
if
(
s
->
out_format
==
FMT_MJPEG
)
{
const
uint16_t
*
luma_matrix
=
ff_mpeg1_default_intra_matrix
;
const
uint16_t
*
chroma_matrix
=
ff_mpeg1_default_intra_matrix
;
if
(
s
->
avctx
->
intra_matrix
)
{
chroma_matrix
=
luma_matrix
=
s
->
avctx
->
intra_matrix
;
}
/* for mjpeg, we do include qscale in the matrix */
for
(
i
=
1
;
i
<
64
;
i
++
){
int
j
=
s
->
dsp
.
idct_permutation
[
i
];
s
->
chroma_intra_matrix
[
j
]
=
s
->
intra_matrix
[
j
]
=
av_clip_uint8
((
ff_mpeg1_default_intr
a_matrix
[
i
]
*
s
->
qscale
)
>>
3
);
s
->
chroma_intra_matrix
[
j
]
=
av_clip_uint8
((
chroma_matrix
[
i
]
*
s
->
qscale
)
>>
3
);
s
->
intra_matrix
[
j
]
=
av_clip_uint8
((
lum
a_matrix
[
i
]
*
s
->
qscale
)
>>
3
);
}
s
->
y_dc_scale_table
=
s
->
c_dc_scale_table
=
ff_mpeg2_dc_scale_table
[
s
->
intra_dc_precision
];
...
...
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