Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathis Rosenhauer
libaec
Commits
e6138416
Commit
e6138416
authored
Feb 10, 2014
by
Mathis Rosenhauer
Browse files
Fix encoding long fs + check. Only relevant for j=64
parent
211fb21c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/encode.c
View file @
e6138416
...
...
@@ -137,11 +137,11 @@ static inline void emitblock_fs(struct aec_stream *strm, int k, int ref)
for
(
i
=
ref
;
i
<
strm
->
block_size
;
i
++
)
{
used
+=
(
state
->
block
[
i
]
>>
k
)
+
1
;
if
(
used
>
63
)
{
while
(
used
>
63
)
{
copy64
(
state
->
cds
,
acc
);
state
->
cds
+=
8
;
acc
=
0
;
used
&
=
0x3f
;
used
-
=
64
;
}
acc
|=
1ULL
<<
(
63
-
used
);
}
...
...
tests/check_long_fs.c
View file @
e6138416
...
...
@@ -5,24 +5,20 @@
#include "libaec.h"
#include "check_aec.h"
#define BUF_SIZE (
4 *
64 * 4)
#define BUF_SIZE (64 * 4)
int
check_long_fs
(
struct
test_state
*
state
)
{
int
status
,
size
;
unsigned
char
*
tmp
;
int
status
,
size
,
i
,
bs
;
size
=
state
->
bytes_per_sample
;
bs
=
state
->
strm
->
block_size
;
for
(
tmp
=
state
->
ubuf
;
tmp
<
state
->
ubuf
+
state
->
buf_len
;
tmp
+=
2
*
size
)
{
state
->
out
(
tmp
,
state
->
xmin
,
size
);
state
->
out
(
tmp
+
size
,
state
->
xmin
+
2
,
size
);
for
(
i
=
0
;
i
<
bs
/
2
;
i
++
)
{
state
->
out
(
state
->
ubuf
+
size
*
i
,
state
->
xmin
,
size
);
state
->
out
(
state
->
ubuf
+
bs
*
size
/
2
+
size
*
i
,
65000
,
size
);
}
state
->
out
(
state
->
ubuf
+
(
64
+
1
)
*
size
,
state
->
xmax
-
1
,
size
);
printf
(
"Checking long fs ... "
);
status
=
state
->
codec
(
state
);
...
...
@@ -53,9 +49,9 @@ int main (void)
strm
.
flags
=
AEC_DATA_PREPROCESS
;
state
.
strm
=
&
strm
;
strm
.
bits_per_sample
=
32
;
strm
.
bits_per_sample
=
16
;
strm
.
block_size
=
64
;
strm
.
rsi
=
64
;
strm
.
rsi
=
1
;
state
.
codec
=
encode_decode_large
;
update_state
(
&
state
);
...
...
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