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
6b33e918
Commit
6b33e918
authored
Sep 25, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo: factorize ff_dct_encode_init()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
71d6eb22
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
+19
-12
mpegvideo.h
libavcodec/mpegvideo.h
+2
-1
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+16
-10
mpegvideoenc.c
libavcodec/x86/mpegvideoenc.c
+1
-1
No files found.
libavcodec/mpegvideo.h
View file @
6b33e918
...
...
@@ -772,7 +772,7 @@ int ff_MPV_encode_init(AVCodecContext *avctx);
int
ff_MPV_encode_end
(
AVCodecContext
*
avctx
);
int
ff_MPV_encode_picture
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
AVFrame
*
frame
,
int
*
got_packet
);
void
ff_
MPV
_encode_init_x86
(
MpegEncContext
*
s
);
void
ff_
dct
_encode_init_x86
(
MpegEncContext
*
s
);
void
ff_MPV_common_init_x86
(
MpegEncContext
*
s
);
void
ff_MPV_common_init_axp
(
MpegEncContext
*
s
);
void
ff_MPV_common_init_mmi
(
MpegEncContext
*
s
);
...
...
@@ -799,6 +799,7 @@ void ff_er_frame_end(MpegEncContext *s);
void
ff_er_add_slice
(
MpegEncContext
*
s
,
int
startx
,
int
starty
,
int
endx
,
int
endy
,
int
status
);
int
ff_dct_common_init
(
MpegEncContext
*
s
);
int
ff_dct_encode_init
(
MpegEncContext
*
s
);
void
ff_convert_matrix
(
DSPContext
*
dsp
,
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
,
DCTELEM
*
block
,
int
n
,
int
qscale
,
int
*
overflow
);
...
...
libavcodec/mpegvideo_enc.c
View file @
6b33e918
...
...
@@ -267,6 +267,21 @@ static void MPV_encode_defaults(MpegEncContext *s)
s
->
fcode_tab
=
default_fcode_tab
;
}
av_cold
int
ff_dct_encode_init
(
MpegEncContext
*
s
)
{
if
(
ARCH_X86
)
ff_dct_encode_init_x86
(
s
);
if
(
!
s
->
dct_quantize
)
s
->
dct_quantize
=
ff_dct_quantize_c
;
if
(
!
s
->
denoise_dct
)
s
->
denoise_dct
=
denoise_dct_c
;
s
->
fast_dct_quantize
=
s
->
dct_quantize
;
if
(
s
->
avctx
->
trellis
)
s
->
dct_quantize
=
dct_quantize_trellis_c
;
return
0
;
}
/* init video encoder */
av_cold
int
ff_MPV_encode_init
(
AVCodecContext
*
avctx
)
{
...
...
@@ -832,16 +847,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
if
(
ff_MPV_common_init
(
s
)
<
0
)
return
-
1
;
if
(
ARCH_X86
)
ff_MPV_encode_init_x86
(
s
);
if
(
!
s
->
dct_quantize
)
s
->
dct_quantize
=
ff_dct_quantize_c
;
if
(
!
s
->
denoise_dct
)
s
->
denoise_dct
=
denoise_dct_c
;
s
->
fast_dct_quantize
=
s
->
dct_quantize
;
if
(
avctx
->
trellis
)
s
->
dct_quantize
=
dct_quantize_trellis_c
;
ff_dct_encode_init
(
s
);
if
((
CONFIG_H263P_ENCODER
||
CONFIG_RV20_ENCODER
)
&&
s
->
modified_quant
)
s
->
chroma_qscale_table
=
ff_h263_chroma_qscale_table
;
...
...
libavcodec/x86/mpegvideoenc.c
View file @
6b33e918
...
...
@@ -80,7 +80,7 @@ extern uint16_t ff_inv_zigzag_direct16[64];
#include "mpegvideoenc_template.c"
#endif
/* HAVE_SSSE3_INLINE */
void
ff_
MPV
_encode_init_x86
(
MpegEncContext
*
s
)
void
ff_
dct
_encode_init_x86
(
MpegEncContext
*
s
)
{
int
mm_flags
=
av_get_cpu_flags
();
const
int
dct_algo
=
s
->
avctx
->
dct_algo
;
...
...
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