mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
util/spkmodem-recv: tidy up handle_audio
frame handling, error checks, pulse decoding and character decoding are all jumbled up. this patch separates them a bit, making it clearer. should also help codegen. this tool is dealing with high bandwidth text, which on slower computers may be cumbersome. every optimisation counts. not really relevant on newer systems. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -123,22 +123,22 @@ handle_audio(struct decoder_state *st)
|
||||
if (st->sample_count > (3 * SAMPLES_PER_FRAME))
|
||||
reset_char(st);
|
||||
|
||||
if ((st->freq_separator <= FREQ_SEP_MIN) ||
|
||||
(st->freq_separator >= FREQ_SEP_MAX) ||
|
||||
(st->freq_data <= FREQ_DATA_MIN) ||
|
||||
(st->freq_data >= FREQ_DATA_MAX)) {
|
||||
if ((st->freq_separator > FREQ_SEP_MIN) &&
|
||||
(st->freq_separator < FREQ_SEP_MAX) &&
|
||||
(st->freq_data > FREQ_DATA_MIN) &&
|
||||
(st->freq_data < FREQ_DATA_MAX)) {
|
||||
|
||||
if (set_ascii_bit(st) < 0)
|
||||
print_char(st);
|
||||
|
||||
st->sample_count = 0;
|
||||
|
||||
for (sample = 0; sample < SAMPLES_PER_FRAME; sample++)
|
||||
decode_pulse(st);
|
||||
|
||||
} else {
|
||||
decode_pulse(st);
|
||||
return;
|
||||
}
|
||||
|
||||
if (set_ascii_bit(st) < 0)
|
||||
print_char(st);
|
||||
|
||||
st->sample_count = 0;
|
||||
|
||||
for (sample = 0; sample < SAMPLES_PER_FRAME; sample++)
|
||||
decode_pulse(st);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user