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
498c9df3
Commit
498c9df3
authored
12 years ago
by
Mathis Rosenhauer
Committed by
Thomas Jahns
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Same rsi copy function for each blocksize but unrolled 8 times.
parent
90461e49
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/encode.c
+8
-14
8 additions, 14 deletions
src/encode.c
src/encode.h
+1
-1
1 addition, 1 deletion
src/encode.h
src/encode_accessors.c
+329
-262
329 additions, 262 deletions
src/encode_accessors.c
src/encode_accessors.h
+7
-7
7 additions, 7 deletions
src/encode_accessors.h
with
345 additions
and
284 deletions
src/encode.c
+
8
−
14
View file @
498c9df3
...
...
@@ -210,7 +210,7 @@ static int m_get_block(struct aec_stream *strm)
state
->
block_p
=
state
->
block_buf
;
if
(
strm
->
avail_in
>=
state
->
block_len
*
strm
->
rsi
)
{
state
->
get_
block
(
strm
);
state
->
get_
rsi
(
strm
);
state
->
blocks_avail
=
strm
->
rsi
-
1
;
if
(
strm
->
flags
&
AEC_DATA_PREPROCESS
)
...
...
@@ -595,7 +595,6 @@ static int m_flush_block_cautious(struct aec_stream *strm)
int
aec_encode_init
(
struct
aec_stream
*
strm
)
{
int
bs
,
bsi
;
struct
internal_state
*
state
;
if
(
strm
->
bit_per_sample
>
32
||
strm
->
bit_per_sample
==
0
)
...
...
@@ -617,11 +616,6 @@ int aec_encode_init(struct aec_stream *strm)
memset
(
state
,
0
,
sizeof
(
struct
internal_state
));
strm
->
state
=
state
;
bs
=
strm
->
block_size
>>
3
;
bsi
=
0
;
while
(
bs
>>=
1
)
bsi
++
;
if
(
strm
->
bit_per_sample
>
16
)
{
/* 24/32 input bit settings */
state
->
id_len
=
5
;
...
...
@@ -631,19 +625,19 @@ int aec_encode_init(struct aec_stream *strm)
state
->
block_len
=
3
*
strm
->
block_size
;
if
(
strm
->
flags
&
AEC_DATA_MSB
)
{
state
->
get_sample
=
get_msb_24
;
state
->
get_
block
=
get_
block_funcs
_msb_24
[
bsi
]
;
state
->
get_
rsi
=
get_
rsi
_msb_24
;
}
else
{
state
->
get_sample
=
get_lsb_24
;
state
->
get_
block
=
get_
block_funcs
_lsb_24
[
bsi
]
;
state
->
get_
rsi
=
get_
rsi
_lsb_24
;
}
}
else
{
state
->
block_len
=
4
*
strm
->
block_size
;
if
(
strm
->
flags
&
AEC_DATA_MSB
)
{
state
->
get_sample
=
get_msb_32
;
state
->
get_
block
=
get_
block_funcs
_msb_32
[
bsi
]
;
state
->
get_
rsi
=
get_
rsi
_msb_32
;
}
else
{
state
->
get_sample
=
get_lsb_32
;
state
->
get_
block
=
get_
block_funcs
_lsb_32
[
bsi
]
;
state
->
get_
rsi
=
get_
rsi
_lsb_32
;
}
}
}
...
...
@@ -654,10 +648,10 @@ int aec_encode_init(struct aec_stream *strm)
if
(
strm
->
flags
&
AEC_DATA_MSB
)
{
state
->
get_sample
=
get_msb_16
;
state
->
get_
block
=
get_
block_funcs
_msb_16
[
bsi
]
;
state
->
get_
rsi
=
get_
rsi
_msb_16
;
}
else
{
state
->
get_sample
=
get_lsb_16
;
state
->
get_
block
=
get_
block_funcs
_lsb_16
[
bsi
]
;
state
->
get_
rsi
=
get_
rsi
_lsb_16
;
}
}
else
{
/* 8 bit settings */
...
...
@@ -665,7 +659,7 @@ int aec_encode_init(struct aec_stream *strm)
state
->
block_len
=
strm
->
block_size
;
state
->
get_sample
=
get_8
;
state
->
get_
block
=
get_
block_funcs_8
[
bsi
]
;
state
->
get_
rsi
=
get_
rsi_8
;
}
if
(
strm
->
flags
&
AEC_DATA_SIGNED
)
{
...
...
This diff is collapsed.
Click to expand it.
src/encode.h
+
1
−
1
View file @
498c9df3
...
...
@@ -14,8 +14,8 @@
struct
internal_state
{
int
(
*
mode
)(
struct
aec_stream
*
);
void
(
*
get_block
)(
struct
aec_stream
*
);
uint32_t
(
*
get_sample
)(
struct
aec_stream
*
);
void
(
*
get_rsi
)(
struct
aec_stream
*
);
void
(
*
preprocess
)(
struct
aec_stream
*
);
int
id_len
;
/* bit length of code option identification key */
...
...
This diff is collapsed.
Click to expand it.
src/encode_accessors.c
+
329
−
262
View file @
498c9df3
This diff is collapsed.
Click to expand it.
src/encode_accessors.h
+
7
−
7
View file @
498c9df3
...
...
@@ -17,12 +17,12 @@ uint32_t get_msb_24(struct aec_stream *strm);
uint32_t
get_lsb_24
(
struct
aec_stream
*
strm
);
uint32_t
get_msb_32
(
struct
aec_stream
*
strm
);
extern
void
(
*
get_
block_funcs_8
[
4
])
(
struct
aec_stream
*
);
extern
void
(
*
get_
block_funcs
_lsb_16
[
4
])
(
struct
aec_stream
*
);
extern
void
(
*
get_
block_funcs
_msb_16
[
4
])
(
struct
aec_stream
*
);
extern
void
(
*
get_
block_funcs
_lsb_24
[
4
])
(
struct
aec_stream
*
);
extern
void
(
*
get_
block_funcs
_msb_24
[
4
])
(
struct
aec_stream
*
);
extern
void
(
*
get_
block_funcs
_lsb_32
[
4
])
(
struct
aec_stream
*
);
extern
void
(
*
get_
block_funcs
_msb_32
[
4
])
(
struct
aec_stream
*
);
void
get_
rsi_8
(
struct
aec_stream
*
strm
);
void
get_
rsi
_lsb_16
(
struct
aec_stream
*
strm
);
void
get_
rsi
_msb_16
(
struct
aec_stream
*
strm
);
void
get_
rsi
_lsb_24
(
struct
aec_stream
*
strm
);
void
get_
rsi
_msb_24
(
struct
aec_stream
*
strm
);
void
get_
rsi
_lsb_32
(
struct
aec_stream
*
strm
);
void
get_
rsi
_msb_32
(
struct
aec_stream
*
strm
);
#endif
/* ENCODE_ACCESSORS_H */
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