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
5ee638fd
Commit
5ee638fd
authored
Jun 07, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
svq1enc: use av_assert
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
25e87fc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
svq1enc.c
libavcodec/svq1enc.c
+12
-13
No files found.
libavcodec/svq1enc.c
View file @
5ee638fd
...
...
@@ -32,12 +32,11 @@
#include "mpegvideo.h"
#include "h263.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "svq1.h"
#include "svq1enc_cb.h"
#undef NDEBUG
#include <assert.h>
typedef
struct
SVQ1Context
{
...
...
@@ -176,7 +175,7 @@ static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, uint8_t *dec
score
=
sqr
-
((
diff
*
(
int64_t
)
diff
)
>>
(
level
+
3
));
//FIXME 64bit slooow
if
(
score
<
best_vector_score
){
int
mean
=
(
diff
+
(
size
>>
1
))
>>
(
level
+
3
);
a
ssert
(
mean
>-
300
&&
mean
<
300
);
a
v_assert2
(
mean
>-
300
&&
mean
<
300
);
mean
=
av_clip
(
mean
,
intra
?
0
:-
256
,
255
);
best_vector_score
=
score
;
best_vector
[
stage
]
=
i
;
...
...
@@ -184,7 +183,7 @@ static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, uint8_t *dec
best_vector_mean
=
mean
;
}
}
a
ssert
(
best_vector_mean
!=
-
999
);
a
v_assert0
(
best_vector_mean
!=
-
999
);
vector
=
codebook
+
stage
*
size
*
16
+
best_vector
[
stage
]
*
size
;
for
(
j
=
0
;
j
<
size
;
j
++
){
block
[
stage
+
1
][
j
]
=
block
[
stage
][
j
]
-
vector
[
j
];
...
...
@@ -229,10 +228,10 @@ static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, uint8_t *dec
put_bits
(
&
s
->
reorder_pb
[
level
],
1
,
split
);
if
(
!
split
){
a
ssert
((
best_mean
>=
0
&&
best_mean
<
256
)
||
!
intra
);
a
ssert
(
best_mean
>=
-
256
&&
best_mean
<
256
);
a
ssert
(
best_count
>=
0
&&
best_count
<
7
);
a
ssert
(
level
<
4
||
best_count
==
0
);
a
v_assert1
((
best_mean
>=
0
&&
best_mean
<
256
)
||
!
intra
);
a
v_assert1
(
best_mean
>=
-
256
&&
best_mean
<
256
);
a
v_assert1
(
best_count
>=
0
&&
best_count
<
7
);
a
v_assert1
(
level
<
4
||
best_count
==
0
);
/* output the encoding */
put_bits
(
&
s
->
reorder_pb
[
level
],
...
...
@@ -242,7 +241,7 @@ static int encode_block(SVQ1Context *s, uint8_t *src, uint8_t *ref, uint8_t *dec
mean_vlc
[
best_mean
][
0
]);
for
(
i
=
0
;
i
<
best_count
;
i
++
){
a
ssert
(
best_vector
[
i
]
>=
0
&&
best_vector
[
i
]
<
16
);
a
v_assert2
(
best_vector
[
i
]
>=
0
&&
best_vector
[
i
]
<
16
);
put_bits
(
&
s
->
reorder_pb
[
level
],
4
,
best_vector
[
i
]);
}
...
...
@@ -412,10 +411,10 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane
s
->
m
.
pb
=
s
->
reorder_pb
[
5
];
mx
=
motion_ptr
[
0
];
my
=
motion_ptr
[
1
];
a
ssert
(
mx
>=-
32
&&
mx
<=
31
);
a
ssert
(
my
>=-
32
&&
my
<=
31
);
a
ssert
(
pred_x
>=-
32
&&
pred_x
<=
31
);
a
ssert
(
pred_y
>=-
32
&&
pred_y
<=
31
);
a
v_assert1
(
mx
>=-
32
&&
mx
<=
31
);
a
v_assert1
(
my
>=-
32
&&
my
<=
31
);
a
v_assert1
(
pred_x
>=-
32
&&
pred_x
<=
31
);
a
v_assert1
(
pred_y
>=-
32
&&
pred_y
<=
31
);
ff_h263_encode_motion
(
&
s
->
m
,
mx
-
pred_x
,
1
);
ff_h263_encode_motion
(
&
s
->
m
,
my
-
pred_y
,
1
);
s
->
reorder_pb
[
5
]
=
s
->
m
.
pb
;
...
...
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