Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
libaec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathis Rosenhauer
libaec
Commits
3ae7b421
Commit
3ae7b421
authored
12 years ago
by
Mathis Rosenhauer
Committed by
Thomas Jahns
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed two bugs introduced through refactoring
parent
5cea8bc4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/encode.c
+27
-33
27 additions, 33 deletions
src/encode.c
with
27 additions
and
33 deletions
src/encode.c
+
27
−
33
View file @
3ae7b421
...
...
@@ -223,44 +223,38 @@ static int m_get_block(struct aec_stream *strm)
return
M_CONTINUE
;
}
static
int
input_empty
(
struct
aec_stream
*
strm
)
static
int
m_get_block_cautious
(
struct
aec_stream
*
strm
)
{
int
j
;
struct
internal_state
*
state
=
strm
->
state
;
if
(
state
->
flush
==
AEC_FLUSH
)
{
if
(
state
->
i
>
0
)
{
for
(
j
=
state
->
i
;
j
<
strm
->
rsi
*
strm
->
block_size
;
j
++
)
state
->
block_buf
[
j
]
=
state
->
block_buf
[
state
->
i
-
1
];
state
->
i
=
strm
->
rsi
*
strm
->
block_size
;
do
{
if
(
strm
->
avail_in
>
0
)
{
state
->
block_buf
[
state
->
i
]
=
state
->
get_sample
(
strm
);
}
else
{
if
(
state
->
zero_blocks
)
{
state
->
mode
=
m_encode_zero
;
return
M_CONTINUE
;
if
(
state
->
flush
==
AEC_FLUSH
)
{
if
(
state
->
i
>
0
)
{
for
(
j
=
state
->
i
;
j
<
strm
->
rsi
*
strm
->
block_size
;
j
++
)
state
->
block_buf
[
j
]
=
state
->
block_buf
[
state
->
i
-
1
];
state
->
i
=
strm
->
rsi
*
strm
->
block_size
;
}
else
{
if
(
state
->
zero_blocks
)
{
state
->
mode
=
m_encode_zero
;
return
M_CONTINUE
;
}
emit
(
state
,
0
,
state
->
bit_p
);
if
(
state
->
direct_out
==
0
)
*
strm
->
next_out
++
=
*
state
->
cds_p
;
strm
->
avail_out
--
;
strm
->
total_out
++
;
return
M_EXIT
;
}
}
else
{
return
M_EXIT
;
}
emit
(
state
,
0
,
state
->
bit_p
);
if
(
state
->
direct_out
==
0
)
*
strm
->
next_out
++
=
*
state
->
cds_p
;
strm
->
avail_out
--
;
strm
->
total_out
++
;
return
M_EXIT
;
}
}
return
M_EXIT
;
}
static
int
m_get_block_cautious
(
struct
aec_stream
*
strm
)
{
struct
internal_state
*
state
=
strm
->
state
;
do
{
if
(
strm
->
avail_in
>
0
)
state
->
block_buf
[
state
->
i
]
=
state
->
get_sample
(
strm
);
else
return
input_empty
(
strm
);
}
while
(
++
state
->
i
<
strm
->
rsi
*
strm
->
block_size
);
state
->
blocks_avail
=
strm
->
rsi
-
1
;
...
...
@@ -366,7 +360,6 @@ static int count_splitting_option(struct aec_stream *strm)
larger binary part. So we know that the CDS for k+1 will be
larger than for k without actually computing the length. An
analogue check can be done for decreasing k.
*/
int
k
,
k_min
;
...
...
@@ -403,8 +396,9 @@ static int count_splitting_option(struct aec_stream *strm)
k
=
state
->
k
-
1
;
dir
=
0
;
no_turn
=
1
;
}
else
{
k
++
;
}
k
++
;
}
else
{
if
(
fs_len
>=
this_bs
||
k
==
0
)
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment