pcm/Export: add CalcOutputSampleRate(), CalcInputSampleRate()
Prepare for DSD sample rate fixups.
This commit is contained in:
@@ -98,6 +98,18 @@ PcmExport::GetFrameSize(const AudioFormat &audio_format) const
|
||||
return audio_format.GetFrameSize();
|
||||
}
|
||||
|
||||
unsigned
|
||||
PcmExport::Params::CalcOutputSampleRate(unsigned sample_rate) const
|
||||
{
|
||||
return sample_rate;
|
||||
}
|
||||
|
||||
unsigned
|
||||
PcmExport::Params::CalcInputSampleRate(unsigned sample_rate) const
|
||||
{
|
||||
return sample_rate;
|
||||
}
|
||||
|
||||
ConstBuffer<void>
|
||||
PcmExport::Export(ConstBuffer<void> data)
|
||||
{
|
||||
|
@@ -41,6 +41,21 @@ struct PcmExport {
|
||||
bool shift8 = false;
|
||||
bool pack24 = false;
|
||||
bool reverse_endian = false;
|
||||
|
||||
/**
|
||||
* Calculate the output sample rate, given a specific input
|
||||
* sample rate. Usually, both are the same; however, with
|
||||
* DSD_U32, four input bytes (= 4 * 8 bits) are combined to
|
||||
* one output word (32 bits), dividing the sample rate by 4.
|
||||
*/
|
||||
gcc_pure
|
||||
unsigned CalcOutputSampleRate(unsigned input_sample_rate) const;
|
||||
|
||||
/**
|
||||
* The inverse of CalcOutputSampleRate().
|
||||
*/
|
||||
gcc_pure
|
||||
unsigned CalcInputSampleRate(unsigned output_sample_rate) const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user