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
34c63378
Commit
34c63378
authored
Jun 26, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Export: add GetInputBlockSize(), GetOutputBlockSize()
parent
2093e536
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
107 additions
and
0 deletions
+107
-0
Dop.hxx
src/pcm/Dop.hxx
+14
-0
Dsd16.hxx
src/pcm/Dsd16.hxx
+14
-0
Dsd32.hxx
src/pcm/Dsd32.hxx
+14
-0
Export.cxx
src/pcm/Export.cxx
+46
-0
Export.hxx
src/pcm/Export.hxx
+12
-0
RestBuffer.hxx
src/pcm/RestBuffer.hxx
+7
-0
No files found.
src/pcm/Dop.hxx
View file @
34c63378
...
...
@@ -46,6 +46,20 @@ public:
rest_buffer
.
Reset
();
}
/**
* @return the size of one input block in bytes
*/
size_t
GetInputBlockSize
()
const
noexcept
{
return
rest_buffer
.
GetInputBlockSize
();
}
/**
* @return the size of one output block in bytes
*/
size_t
GetOutputBlockSize
()
const
noexcept
{
return
2
*
GetInputBlockSize
();
}
ConstBuffer
<
uint32_t
>
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
;
};
...
...
src/pcm/Dsd16.hxx
View file @
34c63378
...
...
@@ -44,6 +44,20 @@ public:
rest_buffer
.
Reset
();
}
/**
* @return the size of one input block in bytes
*/
size_t
GetInputBlockSize
()
const
noexcept
{
return
rest_buffer
.
GetInputBlockSize
();
}
/**
* @return the size of one output block in bytes
*/
size_t
GetOutputBlockSize
()
const
noexcept
{
return
GetInputBlockSize
();
}
ConstBuffer
<
uint16_t
>
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
;
};
...
...
src/pcm/Dsd32.hxx
View file @
34c63378
...
...
@@ -44,6 +44,20 @@ public:
rest_buffer
.
Reset
();
}
/**
* @return the size of one input block in bytes
*/
size_t
GetInputBlockSize
()
const
noexcept
{
return
rest_buffer
.
GetInputBlockSize
();
}
/**
* @return the size of one output block in bytes
*/
size_t
GetOutputBlockSize
()
const
noexcept
{
return
GetInputBlockSize
();
}
ConstBuffer
<
uint32_t
>
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
;
};
...
...
src/pcm/Export.cxx
View file @
34c63378
...
...
@@ -144,6 +144,52 @@ PcmExport::GetOutputFrameSize() const noexcept
return
GetInputFrameSize
();
}
size_t
PcmExport
::
GetInputBlockSize
()
const
noexcept
{
#ifdef ENABLE_DSD
switch
(
dsd_mode
)
{
case
DsdMode
:
:
NONE
:
break
;
case
DsdMode
:
:
U16
:
return
dsd16_converter
.
GetInputBlockSize
();
case
DsdMode
:
:
U32
:
return
dsd32_converter
.
GetInputBlockSize
();
break
;
case
DsdMode
:
:
DOP
:
return
dop_converter
.
GetInputBlockSize
();
}
#endif
return
GetInputFrameSize
();
}
size_t
PcmExport
::
GetOutputBlockSize
()
const
noexcept
{
#ifdef ENABLE_DSD
switch
(
dsd_mode
)
{
case
DsdMode
:
:
NONE
:
break
;
case
DsdMode
:
:
U16
:
return
dsd16_converter
.
GetOutputBlockSize
();
case
DsdMode
:
:
U32
:
return
dsd32_converter
.
GetOutputBlockSize
();
break
;
case
DsdMode
:
:
DOP
:
return
dop_converter
.
GetOutputBlockSize
();
}
#endif
return
GetOutputFrameSize
();
}
unsigned
PcmExport
::
Params
::
CalcOutputSampleRate
(
unsigned
sample_rate
)
const
noexcept
{
...
...
src/pcm/Export.hxx
View file @
34c63378
...
...
@@ -199,6 +199,18 @@ public:
size_t
GetOutputFrameSize
()
const
noexcept
;
/**
* @return the size of one input block in bytes
*/
gcc_pure
size_t
GetInputBlockSize
()
const
noexcept
;
/**
* @return the size of one output block in bytes
*/
gcc_pure
size_t
GetOutputBlockSize
()
const
noexcept
;
/**
* Export a PCM buffer.
*
* @param src the source PCM buffer
...
...
src/pcm/RestBuffer.hxx
View file @
34c63378
...
...
@@ -48,6 +48,13 @@ public:
size
=
0
;
}
/**
* @return the size of one input block in #T samples
*/
size_t
GetInputBlockSize
()
const
noexcept
{
return
capacity
;
}
unsigned
GetChannelCount
()
const
noexcept
{
return
capacity
/
n_frames
;
}
...
...
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