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
6bfbc5d3
Commit
6bfbc5d3
authored
Jan 14, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Dsd2Pcm: move code to CalcOutputSample()
parent
e7483bc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
Dsd2Pcm.cxx
src/pcm/Dsd2Pcm.cxx
+14
-7
Dsd2Pcm.hxx
src/pcm/Dsd2Pcm.hxx
+3
-0
No files found.
src/pcm/Dsd2Pcm.cxx
View file @
6bfbc5d3
...
...
@@ -161,6 +161,18 @@ Dsd2Pcm::Reset() noexcept
*/
}
inline
float
Dsd2Pcm
::
CalcOutputSample
(
unsigned
ffp
)
const
noexcept
{
double
acc
=
0
;
for
(
unsigned
i
=
0
;
i
<
CTABLES
;
++
i
)
{
unsigned
bite1
=
fifo
[(
ffp
-
i
)
&
FIFOMASK
]
&
0xFF
;
unsigned
bite2
=
fifo
[(
ffp
-
(
CTABLES
*
2
-
1
)
+
i
)
&
FIFOMASK
]
&
0xFF
;
acc
+=
ctables
[
i
][
bite1
]
+
ctables
[
i
][
bite2
];
}
return
acc
;
}
void
Dsd2Pcm
::
Translate
(
size_t
samples
,
const
unsigned
char
*
src
,
ptrdiff_t
src_stride
,
...
...
@@ -174,13 +186,8 @@ Dsd2Pcm::Translate(size_t samples,
fifo
[
ffp
]
=
bite1
;
src
+=
src_stride
;
unsigned
char
*
p
=
fifo
+
((
ffp
-
CTABLES
)
&
FIFOMASK
);
*
p
=
bit_reverse
(
*
p
);
double
acc
=
0
;
for
(
unsigned
i
=
0
;
i
<
CTABLES
;
++
i
)
{
bite1
=
fifo
[(
ffp
-
i
)
&
FIFOMASK
]
&
0xFF
;
unsigned
bite2
=
fifo
[(
ffp
-
(
CTABLES
*
2
-
1
)
+
i
)
&
FIFOMASK
]
&
0xFF
;
acc
+=
ctables
[
i
][
bite1
]
+
ctables
[
i
][
bite2
];
}
*
dst
=
(
float
)
acc
;
dst
+=
dst_stride
;
*
dst
=
CalcOutputSample
(
ffp
);
dst
+=
dst_stride
;
ffp
=
(
ffp
+
1
)
&
FIFOMASK
;
}
fifopos
=
ffp
;
...
...
src/pcm/Dsd2Pcm.hxx
View file @
6bfbc5d3
...
...
@@ -73,6 +73,9 @@ public:
const
unsigned
char
*
src
,
ptrdiff_t
src_stride
,
bool
lsbitfirst
,
float
*
dst
,
ptrdiff_t
dst_stride
)
noexcept
;
private
:
float
CalcOutputSample
(
unsigned
ffp
)
const
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