Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
5dd8c08f
Commit
5dd8c08f
authored
Feb 07, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg: Change ff_convert_matrix() to take an MpegEncContext parameter
This will come in handy during dsputil splitting.
parent
e63b818d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
dnxhdenc.c
libavcodec/dnxhdenc.c
+2
-2
mpegvideo.h
libavcodec/mpegvideo.h
+1
-1
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+5
-4
No files found.
libavcodec/dnxhdenc.c
View file @
5dd8c08f
...
...
@@ -203,14 +203,14 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias)
int
j
=
ctx
->
m
.
dsp
.
idct_permutation
[
ff_zigzag_direct
[
i
]];
weight_matrix
[
j
]
=
ctx
->
cid_table
->
luma_weight
[
i
];
}
ff_convert_matrix
(
&
ctx
->
m
.
dsp
,
ctx
->
qmatrix_l
,
ctx
->
qmatrix_l16
,
ff_convert_matrix
(
&
ctx
->
m
,
ctx
->
qmatrix_l
,
ctx
->
qmatrix_l16
,
weight_matrix
,
ctx
->
m
.
intra_quant_bias
,
1
,
ctx
->
m
.
avctx
->
qmax
,
1
);
for
(
i
=
1
;
i
<
64
;
i
++
)
{
int
j
=
ctx
->
m
.
dsp
.
idct_permutation
[
ff_zigzag_direct
[
i
]];
weight_matrix
[
j
]
=
ctx
->
cid_table
->
chroma_weight
[
i
];
}
ff_convert_matrix
(
&
ctx
->
m
.
dsp
,
ctx
->
qmatrix_c
,
ctx
->
qmatrix_c16
,
ff_convert_matrix
(
&
ctx
->
m
,
ctx
->
qmatrix_c
,
ctx
->
qmatrix_c16
,
weight_matrix
,
ctx
->
m
.
intra_quant_bias
,
1
,
ctx
->
m
.
avctx
->
qmax
,
1
);
...
...
libavcodec/mpegvideo.h
View file @
5dd8c08f
...
...
@@ -726,7 +726,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src
void
ff_set_qscale
(
MpegEncContext
*
s
,
int
qscale
);
int
ff_dct_common_init
(
MpegEncContext
*
s
);
void
ff_convert_matrix
(
DSPContext
*
dsp
,
int
(
*
qmat
)[
64
],
uint16_t
(
*
qmat16
)[
2
][
64
],
void
ff_convert_matrix
(
MpegEncContext
*
s
,
int
(
*
qmat
)[
64
],
uint16_t
(
*
qmat16
)[
2
][
64
],
const
uint16_t
*
quant_matrix
,
int
bias
,
int
qmin
,
int
qmax
,
int
intra
);
int
ff_dct_quantize_c
(
MpegEncContext
*
s
,
int16_t
*
block
,
int
n
,
int
qscale
,
int
*
overflow
);
...
...
libavcodec/mpegvideo_enc.c
View file @
5dd8c08f
...
...
@@ -70,11 +70,12 @@ const AVOption ff_mpv_generic_options[] = {
{
NULL
},
};
void
ff_convert_matrix
(
DSPContext
*
dsp
,
int
(
*
qmat
)[
64
],
void
ff_convert_matrix
(
MpegEncContext
*
s
,
int
(
*
qmat
)[
64
],
uint16_t
(
*
qmat16
)[
2
][
64
],
const
uint16_t
*
quant_matrix
,
int
bias
,
int
qmin
,
int
qmax
,
int
intra
)
{
DSPContext
*
dsp
=
&
s
->
dsp
;
int
qscale
;
int
shift
=
0
;
...
...
@@ -775,10 +776,10 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
/* precompute matrix */
/* for mjpeg, we do include qscale in the matrix */
if
(
s
->
out_format
!=
FMT_MJPEG
)
{
ff_convert_matrix
(
&
s
->
dsp
,
s
->
q_intra_matrix
,
s
->
q_intra_matrix16
,
ff_convert_matrix
(
s
,
s
->
q_intra_matrix
,
s
->
q_intra_matrix16
,
s
->
intra_matrix
,
s
->
intra_quant_bias
,
avctx
->
qmin
,
31
,
1
);
ff_convert_matrix
(
&
s
->
dsp
,
s
->
q_inter_matrix
,
s
->
q_inter_matrix16
,
ff_convert_matrix
(
s
,
s
->
q_inter_matrix
,
s
->
q_inter_matrix16
,
s
->
inter_matrix
,
s
->
inter_quant_bias
,
avctx
->
qmin
,
31
,
0
);
}
...
...
@@ -3365,7 +3366,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
s
->
y_dc_scale_table
=
s
->
c_dc_scale_table
=
ff_mpeg2_dc_scale_table
[
s
->
intra_dc_precision
];
s
->
intra_matrix
[
0
]
=
ff_mpeg2_dc_scale_table
[
s
->
intra_dc_precision
][
8
];
ff_convert_matrix
(
&
s
->
dsp
,
s
->
q_intra_matrix
,
s
->
q_intra_matrix16
,
ff_convert_matrix
(
s
,
s
->
q_intra_matrix
,
s
->
q_intra_matrix16
,
s
->
intra_matrix
,
s
->
intra_quant_bias
,
8
,
8
,
1
);
s
->
qscale
=
8
;
}
...
...
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