"\nWhere options are these flags:\n\n"
"--codec or -c\t\tSelect the voice codec.\n"
"--drivers or -d\t\tPrint a list of the available device drivers.\n"
+ "--framer or -f\t\tSelect the communications protocol framer.\n"
"--gui or -g\t\tSelect the graphical user interface.\n"
"--help or -h\t\tPrint this message.\n"
"--interface or -i\tSelect the user-interface (graphical or otherwise).\n"
/// The No-Op Codec, for testing and plain SSB voice.
#include "drivers.h"
+#include <string.h>
namespace FreeDV {
/// Codec "no-op", just copies its input to its output. For plain SSB voice, and for testing.
std::size_t
CodecNoOp::decode16(const std::uint8_t * i, std::int16_t * o, std::size_t * data_length, std::size_t sample_length)
{
- return sample_length;
+ const std::size_t length = std::min(*data_length / 2, sample_length);
+ memcpy(o, i, length * 2);
+ *data_length = length * 2;
+ return length;
}
std::size_t
CodecNoOp::encode16(const std::int16_t * i, std::uint8_t * o, std::size_t length)
{
+ memcpy(o, i, length);
return length;
}
int const
CodecNoOp::frame_duration() const
{
- return 0;
+ return 1;
}
std::size_t const
/// The no-op modem, for plain SSB voice and testing.
#include "drivers.h"
+#include <string.h>
namespace FreeDV {
/// Modem "no-op", just copies its input to its output.
std::size_t * sample_length,
std::size_t data_length)
{
- return data_length;
+ const std::size_t length = std::min(data_length / 2, *sample_length);
+ memcpy(o, i, length * 2);
+ *sample_length = length * 2;
+ return length;
}
std::size_t
ModemNoOp::modulate16(const std::uint8_t * i, std::int16_t * o, std::size_t length)
{
- return length;
+ length = length - (length % 2);
+
+ memcpy(o, i, length);
+ return length / 2;
}
int const