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
1f9aea9b
Commit
1f9aea9b
authored
Apr 01, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing msmpeg4v2 encoding
Originally committed as revision 1723 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
30952237
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
11 deletions
+13
-11
mpegvideo.c
libavcodec/mpegvideo.c
+5
-2
msmpeg4.c
libavcodec/msmpeg4.c
+3
-5
wmv2.c
libavcodec/wmv2.c
+3
-2
ffmpeg.regression.ref
tests/ffmpeg.regression.ref
+2
-2
No files found.
libavcodec/mpegvideo.c
View file @
1f9aea9b
...
...
@@ -648,6 +648,7 @@ int MPV_encode_init(AVCodecContext *avctx)
s
->
h263_pred
=
1
;
s
->
unrestricted_mv
=
1
;
s
->
msmpeg4_version
=
3
;
s
->
flipflop_rounding
=
1
;
avctx
->
delay
=
0
;
s
->
low_delay
=
1
;
break
;
...
...
@@ -657,6 +658,7 @@ int MPV_encode_init(AVCodecContext *avctx)
s
->
h263_pred
=
1
;
s
->
unrestricted_mv
=
1
;
s
->
msmpeg4_version
=
4
;
s
->
flipflop_rounding
=
1
;
avctx
->
delay
=
0
;
s
->
low_delay
=
1
;
break
;
...
...
@@ -666,6 +668,7 @@ int MPV_encode_init(AVCodecContext *avctx)
s
->
h263_pred
=
1
;
s
->
unrestricted_mv
=
1
;
s
->
msmpeg4_version
=
5
;
s
->
flipflop_rounding
=
1
;
avctx
->
delay
=
0
;
s
->
low_delay
=
1
;
break
;
...
...
@@ -2834,7 +2837,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
s
->
qscale
=
(
int
)(
s
->
frame_qscale
+
0
.
5
);
//FIXME qscale / ... stuff for ME ratedistoration
if
(
s
->
pict_type
==
I_TYPE
){
if
(
s
->
msmpeg4_version
)
s
->
no_rounding
=
1
;
if
(
s
->
msmpeg4_version
>=
3
)
s
->
no_rounding
=
1
;
else
s
->
no_rounding
=
0
;
}
else
if
(
s
->
pict_type
!=
B_TYPE
){
if
(
s
->
flipflop_rounding
||
s
->
codec_id
==
CODEC_ID_H263P
||
s
->
codec_id
==
CODEC_ID_MPEG4
)
...
...
libavcodec/msmpeg4.c
View file @
1f9aea9b
...
...
@@ -439,12 +439,10 @@ void msmpeg4_encode_ext_header(MpegEncContext * s)
put_bits
(
&
s
->
pb
,
11
,
FFMIN
(
s
->
bit_rate
/
1024
,
2047
));
if
(
s
->
msmpeg4_version
<
3
)
s
->
flipflop_rounding
=
0
;
else
{
s
->
flipflop_rounding
=
1
;
if
(
s
->
msmpeg4_version
>=
3
)
put_bits
(
&
s
->
pb
,
1
,
s
->
flipflop_rounding
);
}
else
assert
(
s
->
flipflop_rounding
==
0
);
}
#endif //CONFIG_ENCODERS
...
...
libavcodec/wmv2.c
View file @
1f9aea9b
...
...
@@ -131,7 +131,10 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
w
->
abt_type
=
0
;
w
->
j_type
=
0
;
assert
(
s
->
flipflop_rounding
);
if
(
s
->
pict_type
==
I_TYPE
)
{
assert
(
s
->
no_rounding
==
1
);
if
(
w
->
j_type_bit
)
put_bits
(
&
s
->
pb
,
1
,
w
->
j_type
);
if
(
w
->
per_mb_rl_bit
)
put_bits
(
&
s
->
pb
,
1
,
s
->
per_mb_rl_table
);
...
...
@@ -144,7 +147,6 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
put_bits
(
&
s
->
pb
,
1
,
s
->
dc_table_index
);
s
->
inter_intra_pred
=
0
;
s
->
no_rounding
=
1
;
}
else
{
int
cbp_index
;
...
...
@@ -181,7 +183,6 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
put_bits
(
&
s
->
pb
,
1
,
s
->
mv_table_index
);
s
->
inter_intra_pred
=
(
s
->
width
*
s
->
height
<
320
*
240
&&
s
->
bit_rate
<=
II_BITRATE
);
s
->
no_rounding
^=
1
;
}
s
->
esc3_level_length
=
0
;
s
->
esc3_run_length
=
0
;
...
...
tests/ffmpeg.regression.ref
View file @
1f9aea9b
ffmpeg regression test
dda0ba041aef50a5101884291c06d4d9 *./data/a-mpeg1.mpg
6713259d72260740bbddaea30631ea18 *./data/out.yuv
8
730846cd73f07689bfab061eac3e800
*./data/a-msmpeg4v2.avi
2cfc9307a2fd9651cf9c8e42dea1a80e
*./data/out.yuv
8
836c5e38c7891f04e8e75836e48551e
*./data/a-msmpeg4v2.avi
712aa6c959d1d90a78fe98657cbff19c
*./data/out.yuv
8b2a7f5e105784d65426989e4fce6e94 *./data/a-msmpeg4.avi
8786aa956838234fe3e48d0ef8cbd46c *./data/out.yuv
a0bec32a81f9a4cd174557a49cd26430 *./data/a-wmv1.avi
...
...
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