use bitman.hh

This commit is contained in:
Ahmet Inan 2021-06-10 08:31:19 +02:00
commit 361779211c
2 changed files with 4 additions and 4 deletions

View file

@ -15,6 +15,7 @@ namespace DSP { using std::abs; using std::min; using std::cos; using std::sin;
#include "blockdc.hh"
#include "hilbert.hh"
#include "phasor.hh"
#include "bitman.hh"
#include "delay.hh"
#include "sma.hh"
#include "wav.hh"
@ -334,9 +335,7 @@ struct Decoder
Mod::hard(tmp, fdom[bin(i+data_off)] / head[bin(i+data_off)]);
for (int k = 0; k < Mod::BITS; ++k) {
int l = Mod::BITS * (data_cols * j + i) + k;
if (l % 8 == 0)
out[l/8] = 0;
out[l/8] |= (tmp[k] < 0) << (l % 8);
CODE::set_le_bit(out, l, tmp[k] < 0);
}
}
}

View file

@ -9,6 +9,7 @@ Copyright 2021 Ahmet Inan <inan@aicodix.de>
#include <cmath>
#include "complex.hh"
#include "utils.hh"
#include "bitman.hh"
#include "decibel.hh"
#include "fft.hh"
#include "wav.hh"
@ -150,7 +151,7 @@ struct Encoder
value tmp[Mod::BITS];
for (int k = 0; k < Mod::BITS; ++k) {
int l = Mod::BITS * (data_cols * j + i) + k;
tmp[k] = 1 - 2 * ((inp[l/8] >> (l % 8)) & 1);
tmp[k] = 1 - 2 * CODE::get_le_bit(inp, l);
}
fdom[bin(i+data_off)] *= Mod::map(tmp);
}