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
4874230d
Commit
4874230d
authored
12 years ago
by
Mathis Rosenhauer
Committed by
Thomas Jahns
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
More portable sign extension
parent
24fd85af
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
+18
-19
18 additions, 19 deletions
src/encode.c
with
18 additions
and
19 deletions
src/encode.c
+
18
−
19
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
;
...
...
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