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
4874230d
Commit
4874230d
authored
Oct 01, 2012
by
Mathis Rosenhauer
Committed by
Thomas Jahns
Feb 19, 2013
Browse files
More portable sign extension
parent
24fd85af
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/encode.c
View file @
4874230d
...
...
@@ -121,15 +121,14 @@ EMITBLOCK(1);
static
void
preprocess_unsigned
(
struct
aec_stream
*
strm
)
{
int64_t
prev
,
d
,
t
;
u
int
32
_t
*
buf
;
uint32_t
xmax
,
s
,
rsi
;
int64_t
d
;
int
64
_t
t
;
uint32_t
s
;
struct
internal_state
*
state
=
strm
->
state
;
buf
=
state
->
block_buf
;
prev
=
*
buf
++
;
xmax
=
state
->
xmax
;
rsi
=
strm
->
rsi
*
strm
->
block_size
-
1
;
uint32_t
*
buf
=
state
->
block_buf
;
int64_t
prev
=
*
buf
++
;
uint32_t
xmax
=
state
->
xmax
;
uint32_t
rsi
=
strm
->
rsi
*
strm
->
block_size
-
1
;
while
(
rsi
--
)
{
s
=
*
buf
<
prev
;
...
...
@@ -152,20 +151,20 @@ static void preprocess_unsigned(struct aec_stream *strm)
static
void
preprocess_signed
(
struct
aec_stream
*
strm
)
{
int64_t
prev
,
d
,
t
,
v
,
xmax
,
xmin
;
uint32_t
*
buf
;
uint32_t
s
,
rsi
,
m
;
int64_t
d
;
int64_t
t
;
int64_t
v
;
uint32_t
s
;
struct
internal_state
*
state
=
strm
->
state
;
buf
=
state
->
block_buf
;
m
=
64
-
strm
->
bit_per_sample
;
prev
=
(((
int64_t
)
*
buf
++
)
<<
m
)
>>
m
;
xmax
=
state
->
xmax
;
xmin
=
state
->
xmin
;
rsi
=
strm
->
rsi
*
strm
->
block_size
-
1
;
uint32_t
*
buf
=
state
->
block_buf
;
uint32_t
m
=
1ULL
<<
(
strm
->
bit_per_sample
-
1
);
int64_t
prev
=
(((
int64_t
)
*
buf
++
)
^
m
)
-
m
;
int64_t
xmax
=
state
->
xmax
;
int64_t
xmin
=
state
->
xmin
;
uint32_t
rsi
=
strm
->
rsi
*
strm
->
block_size
-
1
;
while
(
rsi
--
)
{
v
=
(((
int64_t
)
*
buf
)
<<
m
)
>>
m
;
v
=
(((
int64_t
)
*
buf
)
^
m
)
-
m
;
s
=
v
<
prev
;
if
(
s
)
{
d
=
prev
-
v
;
...
...
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