Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
9647b2cb
Commit
9647b2cb
authored
Jan 14, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Dsd2Pcm: move code to ApplySample()
For some reason, this speeds up the library by 2%.
parent
2d5bf532
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
Dsd2Pcm.cxx
src/pcm/Dsd2Pcm.cxx
+10
-3
Dsd2Pcm.hxx
src/pcm/Dsd2Pcm.hxx
+1
-0
No files found.
src/pcm/Dsd2Pcm.cxx
View file @
9647b2cb
...
...
@@ -163,6 +163,14 @@ Dsd2Pcm::Reset() noexcept
*/
}
inline
void
Dsd2Pcm
::
ApplySample
(
size_t
ffp
,
uint8_t
src
)
noexcept
{
fifo
[
ffp
]
=
src
;
uint8_t
*
p
=
fifo
+
((
ffp
-
CTABLES
)
&
FIFOMASK
);
*
p
=
bit_reverse
(
*
p
);
}
inline
float
Dsd2Pcm
::
CalcOutputSample
(
size_t
ffp
)
const
noexcept
{
...
...
@@ -184,10 +192,9 @@ Dsd2Pcm::Translate(size_t samples,
size_t
ffp
=
fifopos
;
while
(
samples
--
>
0
)
{
unsigned
bite1
=
*
src
&
0xFFu
;
src
+=
src_stride
;
if
(
lsbf
)
bite1
=
bit_reverse
(
bite1
);
fifo
[
ffp
]
=
bite1
;
src
+=
src_stride
;
uint8_t
*
p
=
fifo
+
((
ffp
-
CTABLES
)
&
FIFOMASK
);
*
p
=
bit_reverse
(
*
p
);
ApplySample
(
ffp
,
bite1
);
*
dst
=
CalcOutputSample
(
ffp
);
dst
+=
dst_stride
;
ffp
=
(
ffp
+
1
)
&
FIFOMASK
;
...
...
src/pcm/Dsd2Pcm.hxx
View file @
9647b2cb
...
...
@@ -76,6 +76,7 @@ public:
float
*
dst
,
ptrdiff_t
dst_stride
)
noexcept
;
private
:
void
ApplySample
(
size_t
ffp
,
uint8_t
src
)
noexcept
;
float
CalcOutputSample
(
size_t
ffp
)
const
noexcept
;
};
...
...
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