Skip to content

Commit

Permalink
Merge pull request #65 from pothosware/fix-cs12scale
Browse files Browse the repository at this point in the history
Fix the scale in CS12 - CF32 conversion
  • Loading branch information
guruofquality authored Mar 1, 2019
2 parents 0a7cb58 + bc5e2cc commit a859642
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/ClientStreamData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ void ClientStreamData::convertRecvBuffs(void * const *buffs, const size_t numEle
case CONVERT_CF32_CS12:
///////////////////////////
{
const float scale = float(1.0/scaleFactor);
// note that we correct the scale for the CS16 intermediate step
const float scale = float(1.0/16.0/scaleFactor);
for (size_t i = 0; i < recvBuffs.size(); i++)
{
auto in = (uint8_t *)recvBuffs[i];
Expand Down Expand Up @@ -193,7 +194,8 @@ void ClientStreamData::convertSendBuffs(const void * const *buffs, const size_t
case CONVERT_CF32_CS12:
///////////////////////////
{
const float scale = float(scaleFactor);
// note that we correct the scale for the CS16 intermediate step
const float scale = float(16.0*scaleFactor);
for (size_t i = 0; i < sendBuffs.size(); i++)
{
auto in = (float *)buffs[i];
Expand Down

0 comments on commit a859642

Please sign in to comment.