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
1f8eb690
Commit
1f8eb690
authored
Nov 30, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo: move encoding-only initialization from common_init() to encode_init()
parent
bedf952b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
31 deletions
+26
-31
mpegvideo.c
libavcodec/mpegvideo.c
+0
-31
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+26
-0
No files found.
libavcodec/mpegvideo.c
View file @
1f8eb690
...
...
@@ -1037,37 +1037,6 @@ av_cold int ff_MPV_common_init(MpegEncContext *s)
s
->
stream_codec_tag
=
avpriv_toupper4
(
s
->
avctx
->
stream_codec_tag
);
if
(
s
->
width
&&
s
->
height
)
{
s
->
avctx
->
coded_frame
=
&
s
->
current_picture
.
f
;
if
(
s
->
encoding
)
{
if
(
s
->
msmpeg4_version
)
{
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
ac_stats
,
2
*
2
*
(
MAX_LEVEL
+
1
)
*
(
MAX_RUN
+
1
)
*
2
*
sizeof
(
int
),
fail
);
}
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
avctx
->
stats_out
,
256
,
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_intra_matrix
,
64
*
32
*
sizeof
(
int
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_inter_matrix
,
64
*
32
*
sizeof
(
int
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_intra_matrix16
,
64
*
32
*
2
*
sizeof
(
uint16_t
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_inter_matrix16
,
64
*
32
*
2
*
sizeof
(
uint16_t
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
input_picture
,
MAX_PICTURE_COUNT
*
sizeof
(
Picture
*
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
reordered_input_picture
,
MAX_PICTURE_COUNT
*
sizeof
(
Picture
*
),
fail
);
if
(
s
->
avctx
->
noise_reduction
)
{
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
dct_offset
,
2
*
64
*
sizeof
(
uint16_t
),
fail
);
}
}
}
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
picture
,
MAX_PICTURE_COUNT
*
sizeof
(
Picture
),
fail
);
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
{
...
...
libavcodec/mpegvideo_enc.c
View file @
1f8eb690
...
...
@@ -716,6 +716,29 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
if
(
ARCH_X86
)
ff_MPV_encode_init_x86
(
s
);
s
->
avctx
->
coded_frame
=
&
s
->
current_picture
.
f
;
if
(
s
->
msmpeg4_version
)
{
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
ac_stats
,
2
*
2
*
(
MAX_LEVEL
+
1
)
*
(
MAX_RUN
+
1
)
*
2
*
sizeof
(
int
),
fail
);
}
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
avctx
->
stats_out
,
256
,
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_intra_matrix
,
64
*
32
*
sizeof
(
int
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_inter_matrix
,
64
*
32
*
sizeof
(
int
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_intra_matrix16
,
64
*
32
*
2
*
sizeof
(
uint16_t
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
q_inter_matrix16
,
64
*
32
*
2
*
sizeof
(
uint16_t
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
input_picture
,
MAX_PICTURE_COUNT
*
sizeof
(
Picture
*
),
fail
);
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
reordered_input_picture
,
MAX_PICTURE_COUNT
*
sizeof
(
Picture
*
),
fail
);
if
(
s
->
avctx
->
noise_reduction
)
{
FF_ALLOCZ_OR_GOTO
(
s
->
avctx
,
s
->
dct_offset
,
2
*
64
*
sizeof
(
uint16_t
),
fail
);
}
ff_h263dsp_init
(
&
s
->
h263dsp
);
if
(
!
s
->
dct_quantize
)
s
->
dct_quantize
=
ff_dct_quantize_c
;
...
...
@@ -802,6 +825,9 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
}
return
0
;
fail:
ff_MPV_encode_end
(
avctx
);
return
AVERROR_UNKNOWN
;
}
av_cold
int
ff_MPV_encode_end
(
AVCodecContext
*
avctx
)
...
...
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