Commit c36cb764 authored by Stefan Westerfeld's avatar Stefan Westerfeld

Add additional codes which can be used for small code with 16 and 20 bit.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent df746ca1
This diff is collapsed.
......@@ -33,5 +33,6 @@ std::vector<int> short_decode_soft (ConvBlockType block_type, const std::vector<
std::vector<int> short_encode_blk (const std::vector<int>& in_bits);
std::vector<int> short_decode_blk (const std::vector<int>& coded_bits);
void short_code_get_n_k (size_t& n, size_t& k);
#endif /* AUDIOWMARK_SHORT_CODE_HH */
......@@ -84,8 +84,9 @@ number_format (double d)
int
main (int argc, char **argv)
{
constexpr int K = 12;
constexpr int N = 56;
size_t N, K;
short_code_get_n_k (N, K);
printf ("using (%zd,%zd) code\n", N, K);
srand (time (NULL));
......@@ -131,7 +132,7 @@ main (int argc, char **argv)
{
map<vector<int>, vector<int>> table;
vector<int> weight (N + 1);
for (size_t i = 0; i < (1 << K); i++)
for (size_t i = 0; i < size_t (1 << K); i++)
{
vector<int> in;
for (size_t bit = 0; bit < K; bit++)
......@@ -181,7 +182,7 @@ main (int argc, char **argv)
if (argc == 2 && string (argv[1]) == "distance")
{
vector<vector<int>> cwords;
for (size_t i = 0; i < (1 << K); i++)
for (size_t i = 0; i < size_t (1 << K); i++)
{
vector<int> in;
for (size_t bit = 0; bit < K; bit++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment