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
1e6b5700
Commit
1e6b5700
authored
May 29, 2007
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix assertion failure
Originally committed as revision 9152 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3dba31aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
rangecoder.h
libavcodec/rangecoder.h
+7
-0
snow.c
libavcodec/snow.c
+4
-9
No files found.
libavcodec/rangecoder.h
View file @
1e6b5700
...
...
@@ -66,6 +66,13 @@ static inline void renorm_encoder(RangeCoder *c){
}
}
static
inline
int
get_rac_count
(
RangeCoder
*
c
){
int
x
=
c
->
bytestream
-
c
->
bytestream_start
+
c
->
outstanding_count
;
if
(
c
->
outstanding_byte
>=
0
)
x
++
;
return
8
*
x
-
av_log2
(
c
->
range
);
}
static
inline
void
put_rac
(
RangeCoder
*
c
,
uint8_t
*
const
state
,
int
bit
){
int
range1
=
(
c
->
range
*
(
*
state
))
>>
8
;
...
...
libavcodec/snow.c
View file @
1e6b5700
...
...
@@ -1989,7 +1989,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
RangeCoder
pc
,
ic
;
uint8_t
*
pbbak
=
s
->
c
.
bytestream
;
uint8_t
*
pbbak_start
=
s
->
c
.
bytestream_start
;
int
score
,
score2
,
iscore
,
i_len
,
p_len
,
block_s
,
sum
;
int
score
,
score2
,
iscore
,
i_len
,
p_len
,
block_s
,
sum
,
base_bits
;
const
int
w
=
s
->
b_width
<<
s
->
block_max_depth
;
const
int
h
=
s
->
b_height
<<
s
->
block_max_depth
;
const
int
rem_depth
=
s
->
block_max_depth
-
level
;
...
...
@@ -2115,6 +2115,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
//FIXME if mb_cmp != SSE then intra cant be compared currently and mb_penalty vs. lambda2
// subpel search
base_bits
=
get_rac_count
(
&
s
->
c
)
-
(
s
->
c
.
bytestream
-
s
->
c
.
bytestream_start
);
pc
=
s
->
c
;
pc
.
bytestream_start
=
pc
.
bytestream
=
p_buffer
;
//FIXME end/start? and at the other stoo
...
...
@@ -2129,10 +2130,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
put_symbol
(
&
pc
,
&
p_state
[
128
+
32
*
(
mx_context
+
16
*!!
best_ref
)],
mx
-
pmx
,
1
);
put_symbol
(
&
pc
,
&
p_state
[
128
+
32
*
(
my_context
+
16
*!!
best_ref
)],
my
-
pmy
,
1
);
p_len
=
pc
.
bytestream
-
pc
.
bytestream_start
;
score
+=
(
s
->
lambda2
*
(
p_len
*
8
+
(
pc
.
outstanding_count
-
s
->
c
.
outstanding_count
)
*
8
+
(
-
av_log2
(
pc
.
range
)
+
av_log2
(
s
->
c
.
range
))
))
>>
FF_LAMBDA_SHIFT
;
score
+=
(
s
->
lambda2
*
(
get_rac_count
(
&
pc
)
-
base_bits
))
>>
FF_LAMBDA_SHIFT
;
block_s
=
block_w
*
block_w
;
sum
=
pix_sum
(
current_data
[
0
],
stride
,
block_w
);
...
...
@@ -2158,10 +2156,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
put_symbol
(
&
ic
,
&
i_state
[
64
],
cb
-
pcb
,
1
);
put_symbol
(
&
ic
,
&
i_state
[
96
],
cr
-
pcr
,
1
);
i_len
=
ic
.
bytestream
-
ic
.
bytestream_start
;
iscore
+=
(
s
->
lambda2
*
(
i_len
*
8
+
(
ic
.
outstanding_count
-
s
->
c
.
outstanding_count
)
*
8
+
(
-
av_log2
(
ic
.
range
)
+
av_log2
(
s
->
c
.
range
))
))
>>
FF_LAMBDA_SHIFT
;
iscore
+=
(
s
->
lambda2
*
(
get_rac_count
(
&
ic
)
-
base_bits
))
>>
FF_LAMBDA_SHIFT
;
// assert(score==256*256*256*64-1);
assert
(
iscore
<
255
*
255
*
256
+
s
->
lambda2
*
10
);
...
...
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