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
84d902fb
Commit
84d902fb
authored
Jul 10, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpeg4videoenc: use av_assert
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
43c60937
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
mpeg4videoenc.c
libavcodec/mpeg4videoenc.c
+11
-11
No files found.
libavcodec/mpeg4videoenc.c
View file @
84d902fb
...
@@ -494,9 +494,9 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
...
@@ -494,9 +494,9 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
}
}
}
}
a
ssert
(
s
->
dquant
>=-
2
&&
s
->
dquant
<=
2
);
a
v_assert2
(
s
->
dquant
>=-
2
&&
s
->
dquant
<=
2
);
a
ssert
((
s
->
dquant
&
1
)
==
0
);
a
v_assert2
((
s
->
dquant
&
1
)
==
0
);
a
ssert
(
mb_type
>=
0
);
a
v_assert2
(
mb_type
>=
0
);
/* nothing to do if this MB was skipped in the next P Frame */
/* nothing to do if this MB was skipped in the next P Frame */
if
(
s
->
next_picture
.
f
.
mbskip_table
[
s
->
mb_y
*
s
->
mb_stride
+
s
->
mb_x
])
{
//FIXME avoid DCT & ...
if
(
s
->
next_picture
.
f
.
mbskip_table
[
s
->
mb_y
*
s
->
mb_stride
+
s
->
mb_x
])
{
//FIXME avoid DCT & ...
...
@@ -516,7 +516,7 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
...
@@ -516,7 +516,7 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
if
((
cbp
|
motion_x
|
motion_y
|
mb_type
)
==
0
)
{
if
((
cbp
|
motion_x
|
motion_y
|
mb_type
)
==
0
)
{
/* direct MB with MV={0,0} */
/* direct MB with MV={0,0} */
a
ssert
(
s
->
dquant
==
0
);
a
v_assert2
(
s
->
dquant
==
0
);
put_bits
(
&
s
->
pb
,
1
,
1
);
/* mb not coded modb1=1 */
put_bits
(
&
s
->
pb
,
1
,
1
);
/* mb not coded modb1=1 */
...
@@ -553,12 +553,12 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
...
@@ -553,12 +553,12 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
}
}
if
(
mb_type
==
0
){
if
(
mb_type
==
0
){
a
ssert
(
s
->
mv_dir
&
MV_DIRECT
);
a
v_assert2
(
s
->
mv_dir
&
MV_DIRECT
);
ff_h263_encode_motion_vector
(
s
,
motion_x
,
motion_y
,
1
);
ff_h263_encode_motion_vector
(
s
,
motion_x
,
motion_y
,
1
);
s
->
b_count
++
;
s
->
b_count
++
;
s
->
f_count
++
;
s
->
f_count
++
;
}
else
{
}
else
{
a
ssert
(
mb_type
>
0
&&
mb_type
<
4
);
a
v_assert2
(
mb_type
>
0
&&
mb_type
<
4
);
if
(
s
->
mv_type
!=
MV_TYPE_FIELD
){
if
(
s
->
mv_type
!=
MV_TYPE_FIELD
){
if
(
s
->
mv_dir
&
MV_DIR_FORWARD
){
if
(
s
->
mv_dir
&
MV_DIR_FORWARD
){
ff_h263_encode_motion_vector
(
s
,
s
->
mv
[
0
][
0
][
0
]
-
s
->
last_mv
[
0
][
0
][
0
],
ff_h263_encode_motion_vector
(
s
,
s
->
mv
[
0
][
0
][
0
]
-
s
->
last_mv
[
0
][
0
][
0
],
...
@@ -719,7 +719,7 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
...
@@ -719,7 +719,7 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
if
(
s
->
dquant
)
if
(
s
->
dquant
)
put_bits
(
pb2
,
2
,
dquant_code
[
s
->
dquant
+
2
]);
put_bits
(
pb2
,
2
,
dquant_code
[
s
->
dquant
+
2
]);
a
ssert
(
!
s
->
progressive_sequence
);
a
v_assert2
(
!
s
->
progressive_sequence
);
if
(
cbp
)
if
(
cbp
)
put_bits
(
pb2
,
1
,
s
->
interlaced_dct
);
put_bits
(
pb2
,
1
,
s
->
interlaced_dct
);
put_bits
(
pb2
,
1
,
1
);
put_bits
(
pb2
,
1
,
1
);
...
@@ -740,7 +740,7 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
...
@@ -740,7 +740,7 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
ff_h263_encode_motion_vector
(
s
,
s
->
mv
[
0
][
1
][
0
]
-
pred_x
,
ff_h263_encode_motion_vector
(
s
,
s
->
mv
[
0
][
1
][
0
]
-
pred_x
,
s
->
mv
[
0
][
1
][
1
]
-
pred_y
,
s
->
f_code
);
s
->
mv
[
0
][
1
][
1
]
-
pred_y
,
s
->
f_code
);
}
else
{
}
else
{
a
ssert
(
s
->
mv_type
==
MV_TYPE_8X8
);
a
v_assert2
(
s
->
mv_type
==
MV_TYPE_8X8
);
put_bits
(
&
s
->
pb
,
put_bits
(
&
s
->
pb
,
ff_h263_inter_MCBPC_bits
[
cbpc
+
16
],
ff_h263_inter_MCBPC_bits
[
cbpc
+
16
],
ff_h263_inter_MCBPC_code
[
cbpc
+
16
]);
ff_h263_inter_MCBPC_code
[
cbpc
+
16
]);
...
@@ -1063,7 +1063,7 @@ void ff_mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
...
@@ -1063,7 +1063,7 @@ void ff_mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
time_div
=
FFUDIV
(
s
->
time
,
s
->
avctx
->
time_base
.
den
);
time_div
=
FFUDIV
(
s
->
time
,
s
->
avctx
->
time_base
.
den
);
time_mod
=
FFUMOD
(
s
->
time
,
s
->
avctx
->
time_base
.
den
);
time_mod
=
FFUMOD
(
s
->
time
,
s
->
avctx
->
time_base
.
den
);
time_incr
=
time_div
-
s
->
last_time_base
;
time_incr
=
time_div
-
s
->
last_time_base
;
a
ssert
(
time_incr
>=
0
);
a
v_assert0
(
time_incr
>=
0
);
while
(
time_incr
--
)
while
(
time_incr
--
)
put_bits
(
&
s
->
pb
,
1
,
1
);
put_bits
(
&
s
->
pb
,
1
,
1
);
...
@@ -1148,8 +1148,8 @@ static void init_uni_dc_tab(void)
...
@@ -1148,8 +1148,8 @@ static void init_uni_dc_tab(void)
static
void
init_uni_mpeg4_rl_tab
(
RLTable
*
rl
,
uint32_t
*
bits_tab
,
uint8_t
*
len_tab
){
static
void
init_uni_mpeg4_rl_tab
(
RLTable
*
rl
,
uint32_t
*
bits_tab
,
uint8_t
*
len_tab
){
int
slevel
,
run
,
last
;
int
slevel
,
run
,
last
;
a
ssert
(
MAX_LEVEL
>=
64
);
a
v_assert0
(
MAX_LEVEL
>=
64
);
a
ssert
(
MAX_RUN
>=
63
);
a
v_assert0
(
MAX_RUN
>=
63
);
for
(
slevel
=-
64
;
slevel
<
64
;
slevel
++
){
for
(
slevel
=-
64
;
slevel
<
64
;
slevel
++
){
if
(
slevel
==
0
)
continue
;
if
(
slevel
==
0
)
continue
;
...
...
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