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
f8dbbe54
Commit
f8dbbe54
authored
Aug 06, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo_enc: switch some assert to av_assert
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f72e0d9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+19
-19
No files found.
libavcodec/mpegvideo_enc.c
View file @
f8dbbe54
...
...
@@ -1130,7 +1130,7 @@ static int estimate_best_b_count(MpegEncContext *s)
int64_t
best_rd
=
INT64_MAX
;
int
best_b_count
=
-
1
;
a
ssert
(
scale
>=
0
&&
scale
<=
3
);
a
v_assert0
(
scale
>=
0
&&
scale
<=
3
);
//emms_c();
//s->next_picture_ptr->quality;
...
...
@@ -1614,7 +1614,7 @@ vbv_retry:
vbv_delay
=
FFMAX
(
vbv_delay
,
min_delay
);
a
ssert
(
vbv_delay
<
0xFFFF
);
a
v_assert0
(
vbv_delay
<
0xFFFF
);
s
->
vbv_delay_ptr
[
0
]
&=
0xF8
;
s
->
vbv_delay_ptr
[
0
]
|=
vbv_delay
>>
13
;
...
...
@@ -2021,7 +2021,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
}
/* DCT & quantize */
a
ssert
(
s
->
out_format
!=
FMT_MJPEG
||
s
->
qscale
==
8
);
a
v_assert2
(
s
->
out_format
!=
FMT_MJPEG
||
s
->
qscale
==
8
);
{
for
(
i
=
0
;
i
<
mb_block_count
;
i
++
)
{
if
(
!
skip_dct
[
i
])
{
...
...
@@ -2122,7 +2122,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
ff_mjpeg_encode_mb
(
s
,
s
->
block
);
break
;
default:
a
ssert
(
0
);
a
v_assert1
(
0
);
}
}
...
...
@@ -2266,7 +2266,7 @@ static int sse(MpegEncContext *s, uint8_t *src1, uint8_t *src2, int w, int h, in
}
}
a
ssert
(
acc
>=
0
);
a
v_assert2
(
acc
>=
0
);
return
acc
;
}
...
...
@@ -2560,7 +2560,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
}
}
a
ssert
((
put_bits_count
(
&
s
->
pb
)
&
7
)
==
0
);
a
v_assert2
((
put_bits_count
(
&
s
->
pb
)
&
7
)
==
0
);
current_packet_size
=
put_bits_ptr
(
&
s
->
pb
)
-
s
->
ptr_lastgob
;
if
(
s
->
avctx
->
error_rate
&&
s
->
resync_mb_x
+
s
->
resync_mb_y
>
0
){
...
...
@@ -2768,7 +2768,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
const
int
mvdir
=
(
best_s
.
mv_dir
&
MV_DIR_BACKWARD
)
?
1
:
0
;
static
const
int
dquant_tab
[
4
]
=
{
-
1
,
1
,
-
2
,
2
};
a
ssert
(
backup_s
.
dquant
==
0
);
a
v_assert2
(
backup_s
.
dquant
==
0
);
//FIXME intra
s
->
mv_dir
=
best_s
.
mv_dir
;
...
...
@@ -3384,7 +3384,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
case
FMT_H264
:
break
;
default
:
a
ssert
(
0
);
a
v_assert0
(
0
);
}
bits
=
put_bits_count
(
&
s
->
pb
);
s
->
header_bits
=
bits
-
s
->
last_bits
;
...
...
@@ -3521,7 +3521,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
// coeff[2][k]= -level+2;
}
coeff_count
[
i
]
=
FFMIN
(
level
,
2
);
a
ssert
(
coeff_count
[
i
]);
a
v_assert2
(
coeff_count
[
i
]);
max
|=
level
;
}
else
{
coeff
[
0
][
i
]
=
(
level
>>
31
)
|
1
;
...
...
@@ -3555,7 +3555,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
const
int
alevel
=
FFABS
(
level
);
int
unquant_coeff
;
a
ssert
(
level
);
a
v_assert2
(
level
);
if
(
s
->
out_format
==
FMT_H263
){
unquant_coeff
=
alevel
*
qmul
+
qadd
;
...
...
@@ -3704,7 +3704,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
}
i
=
last_i
;
a
ssert
(
last_level
);
a
v_assert2
(
last_level
);
block
[
perm_scantable
[
last_non_zero
]
]
=
last_level
;
i
-=
last_run
+
1
;
...
...
@@ -3820,8 +3820,8 @@ STOP_TIMER("memset rem[]")}
weight
[
i
]
=
w
;
// w=weight[i] = (63*qns + (w/2)) / w;
a
ssert
(
w
>
0
);
a
ssert
(
w
<
(
1
<<
6
));
a
v_assert2
(
w
>
0
);
a
v_assert2
(
w
<
(
1
<<
6
));
sum
+=
w
*
w
;
}
lambda
=
sum
*
(
uint64_t
)
s
->
lambda2
>>
(
FF_LAMBDA_SHIFT
-
6
+
6
+
6
+
6
);
...
...
@@ -3887,7 +3887,7 @@ STOP_TIMER("dct")}
const
int
level
=
block
[
0
];
int
change
,
old_coeff
;
a
ssert
(
s
->
mb_intra
);
a
v_assert2
(
s
->
mb_intra
);
old_coeff
=
q
*
level
;
...
...
@@ -3930,7 +3930,7 @@ STOP_TIMER("dct")}
}
else
{
old_coeff
=
0
;
run2
--
;
a
ssert
(
run2
>=
0
||
i
>=
last_non_zero
);
a
v_assert2
(
run2
>=
0
||
i
>=
last_non_zero
);
}
for
(
change
=-
1
;
change
<=
1
;
change
+=
2
){
...
...
@@ -3958,7 +3958,7 @@ STOP_TIMER("dct")}
-
last_length
[
UNI_AC_ENC_INDEX
(
run
,
level
+
64
)];
}
}
else
{
a
ssert
(
FFABS
(
new_level
)
==
1
);
a
v_assert2
(
FFABS
(
new_level
)
==
1
);
if
(
analyze_gradient
){
int
g
=
d1
[
scantable
[
i
]
];
...
...
@@ -3991,7 +3991,7 @@ STOP_TIMER("dct")}
}
}
else
{
new_coeff
=
0
;
a
ssert
(
FFABS
(
level
)
==
1
);
a
v_assert2
(
FFABS
(
level
)
==
1
);
if
(
i
<
last_non_zero
){
int
next_i
=
i
+
run2
+
1
;
...
...
@@ -4020,7 +4020,7 @@ STOP_TIMER("dct")}
score
*=
lambda
;
unquant_change
=
new_coeff
-
old_coeff
;
a
ssert
((
score
<
100
*
lambda
&&
score
>
-
100
*
lambda
)
||
lambda
==
0
);
a
v_assert2
((
score
<
100
*
lambda
&&
score
>
-
100
*
lambda
)
||
lambda
==
0
);
score
+=
s
->
dsp
.
try_8x8basis
(
rem
,
weight
,
basis
[
j
],
unquant_change
);
if
(
score
<
best_score
){
...
...
@@ -4051,7 +4051,7 @@ STOP_TIMER("iterative step")}
if
(
best_coeff
>
last_non_zero
){
last_non_zero
=
best_coeff
;
a
ssert
(
block
[
j
]);
a
v_assert2
(
block
[
j
]);
#ifdef REFINE_STATS
after_last
++
;
#endif
...
...
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