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
3565f0c8
Commit
3565f0c8
authored
Jan 14, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Dsd2Pcm: move code to TranslateSample()
10% speedup. Strange, huh?
parent
9647b2cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
Dsd2Pcm.cxx
src/pcm/Dsd2Pcm.cxx
+8
-2
Dsd2Pcm.hxx
src/pcm/Dsd2Pcm.hxx
+1
-0
No files found.
src/pcm/Dsd2Pcm.cxx
View file @
3565f0c8
...
...
@@ -183,6 +183,13 @@ Dsd2Pcm::CalcOutputSample(size_t ffp) const noexcept
return
acc
;
}
inline
float
Dsd2Pcm
::
TranslateSample
(
size_t
ffp
,
uint8_t
src
)
noexcept
{
ApplySample
(
ffp
,
src
);
return
CalcOutputSample
(
ffp
);
}
void
Dsd2Pcm
::
Translate
(
size_t
samples
,
const
uint8_t
*
src
,
ptrdiff_t
src_stride
,
...
...
@@ -194,8 +201,7 @@ Dsd2Pcm::Translate(size_t samples,
unsigned
bite1
=
*
src
&
0xFFu
;
src
+=
src_stride
;
if
(
lsbf
)
bite1
=
bit_reverse
(
bite1
);
ApplySample
(
ffp
,
bite1
);
*
dst
=
CalcOutputSample
(
ffp
);
*
dst
=
TranslateSample
(
ffp
,
bite1
);
dst
+=
dst_stride
;
ffp
=
(
ffp
+
1
)
&
FIFOMASK
;
}
...
...
src/pcm/Dsd2Pcm.hxx
View file @
3565f0c8
...
...
@@ -78,6 +78,7 @@ public:
private
:
void
ApplySample
(
size_t
ffp
,
uint8_t
src
)
noexcept
;
float
CalcOutputSample
(
size_t
ffp
)
const
noexcept
;
float
TranslateSample
(
size_t
ffp
,
uint8_t
src
)
noexcept
;
};
#endif
/* include guard DSD2PCM_H_INCLUDED */
...
...
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