Enable D-Star, Pulse Tweaks, NCurses Tweaks, Misc

Enable D-Star, Pulse Tweaks, NCurses Tweaks, Misc
This commit is contained in:
lwvmobile
2022-03-13 19:13:09 -04:00
committed by GitHub
parent 0fc9380b00
commit 184b8b6a39
10 changed files with 187 additions and 228 deletions

View File

@@ -70,7 +70,7 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
if (opts->errorbars == 1)
{
fprintf(stderr, "VOICE e:");
//fprintf(stderr, "VOICE e:");
}
/* First CCH (Control CHannel) - 72 bit */
@@ -131,7 +131,7 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
z++;
}
//processMbeFrame (opts, state, NULL, ambe_fr2, NULL); //HERE HERE
//processMbeFrame (opts, state, NULL, ambe_fr[j], NULL); //HERE HERE
#ifdef DPMR_DUMP
fprintf(stderr, " ");
@@ -225,7 +225,7 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
y++;
z++;
}
//processMbeFrame (opts, state, NULL, ambe_fr2, NULL);
//processMbeFrame (opts, state, NULL, ambe_fr[j], NULL);
#ifdef DPMR_DUMP
fprintf(stderr, " ");
@@ -523,7 +523,7 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
//fprintf(stderr, "| TG=%s", CalledID);
if(state->dPMRVoiceFS2Frame.CalledIDOk)
{
fprintf(stderr, "| TG=%s", CalledID);
fprintf(stderr, "\n| TG=%s", CalledID);
//strcpy (state->dpmr_target_id, CalledID); //HERE HERE
state->dpmr_target_id = CalledID;
//fprintf(stderr, " (CRC OK) ");
@@ -631,70 +631,25 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
if(VoiceFrameFlag)
{
/* There is 4 AMBE voice sample per voice frame (= 8 per superframe) */
//for(i = 0; i < (NB_OF_DPMR_VOICE_FRAME_TO_DECODE * 4); i++)
for(i = 0; i < (8); i++)
for(i = 0; i < (NB_OF_DPMR_VOICE_FRAME_TO_DECODE * 4); i++)
//for(i = 0; i < (8); i++)
{
/* Apply ECC 1 to the AMBE frames */
state->dPMRVoiceFS2Frame.errs1[i] = (unsigned int)mbe_eccAmbe3600x2450C0(ambe_fr[i]);
state->dPMRVoiceFS2Frame.errs2[i] = state->dPMRVoiceFS2Frame.errs1[i];
/* Demodulate the AMBE frames */
mbe_demodulateAmbe3600x2450Data(ambe_fr[i]);
//mbe_demodulateAmbe3600x2400Data(ambe_fr[i]);
//mbe_demodulateAmbe3600x2450Data(ambe_fr[i]);
mbe_demodulateAmbe3600x2400Data(ambe_fr[i]);
/* Apply ECC 2 to the AMBE frames and get the 49 bit of the voice sample */
state->dPMRVoiceFS2Frame.errs2[i] += (unsigned int)mbe_eccAmbe3600x2450Data(ambe_fr[i], (char *)state->dPMRVoiceFS2Frame.AmbeBit[i]);
//state->dPMRVoiceFS2Frame.errs2[i] += (unsigned int)mbe_eccAmbe3600x2450Data(ambe_fr[i], (char *)state->dPMRVoiceFS2Frame.AmbeBit[i]);
state->dPMRVoiceFS2Frame.errs2[i] += (unsigned int)mbe_eccAmbe3600x2400Data(ambe_fr[i], (char *)state->dPMRVoiceFS2Frame.AmbeBit[i]);
//processMbeFrame (opts, state, NULL, ambe_fr[i], NULL); //HERE HERE
//processMbeFrame (opts, state, NULL, state->dPMRVoiceFS2Frame.AmbeBit[i], NULL); //HERE HERE
}
} /* End if(VoiceFrameFlag && !AttachedDataFlag) */
//for 1 to 8 and then VoiceFrameFlag
/*
for(i = 0; i < (8); i++)
{
if(VoiceFrameFlag)
{
//processMbeFrame (opts, state, NULL, ambe_fr[i], NULL); //HERE HERE
//
errs = (uint32_t*)&(state->dPMRVoiceFS2Frame.errs1[i]);
errs2 = (uint32_t*)&(state->dPMRVoiceFS2Frame.errs2[i]);
state->errs = state->dPMRVoiceFS2Frame.errs1[i];
state->errs2 = state->dPMRVoiceFS2Frame.errs2[i];
//processMbeFrame (opts, state, NULL, (char *)state->dPMRVoiceFS2Frame.AmbeBit[i], NULL); //HERE HERE
mbe_processAmbe2450Dataf (state->audio_out_temp_buf, errs, errs2, state->err_str,
state->dPMRVoiceFS2Frame.AmbeBit[i],
state->cur_mp, state->prev_mp, state->prev_mp_enhanced, opts->uvquality);
if (opts->mbe_out_f != NULL)
{
//saveAmbe2450Data (opts, state, (char *)state->dPMRVoiceFS2Frame.AmbeBit[i]);
}
if (opts->errorbars == 1)
{
fprintf(stderr, "%s", state->err_str);
}
state->debug_audio_errors += *errs2;
processAudio(opts, state);
if (opts->wav_out_f != NULL)
{
writeSynthesizedVoice (opts, state);
}
if (opts->audio_out == 1)
{
//Play the AMBE Frames
playSynthesizedVoice (opts, state);
}
}
}
*/
//Check if the voice frame to play is encrypted
if(opts->dPMR_curr_frame_is_encrypted)
{
@@ -721,31 +676,29 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
for(i = 0; i < (NB_OF_DPMR_VOICE_FRAME_TO_DECODE * 4); i++) //is this backwards, shouldn't we run this first, and then voice frame after?
{
errs = (uint32_t*)&(state->dPMRVoiceFS2Frame.errs1[i]);
//errs = (uint32_t*)&(state->dPMRVoiceFS2Frame.errs1[i]);
errs2 = (uint32_t*)&(state->dPMRVoiceFS2Frame.errs2[i]);
errs = 0;
//errs2 = 0;
state->errs = state->dPMRVoiceFS2Frame.errs1[i];
state->errs2 = state->dPMRVoiceFS2Frame.errs2[i];
//
//processMbeFrame (opts, state, NULL, ambe_fr2, NULL);
//sounds like choppy shit, but .amb file playback is acceptable, so investigate why this doesn't work properly
mbe_processAmbe2450Dataf (state->audio_out_temp_buf, errs, errs2, state->err_str,
state->dPMRVoiceFS2Frame.AmbeBit[i],
//could be related to err states not properly done or something?
mbe_processAmbe2450Dataf (state->audio_out_temp_buf, (int *)errs, (int *)errs2, state->err_str,
(char *)state->dPMRVoiceFS2Frame.AmbeBit[i],
state->cur_mp, state->prev_mp, state->prev_mp_enhanced, opts->uvquality);
//mbe_processAmbe2450Dataf (state->audio_out_temp_buf_p, (int *)errs, (int *)errs2, state->err_str,
// (char *)state->dPMRVoiceFS2Frame.AmbeBit[i],
// state->cur_mp, state->prev_mp, state->prev_mp_enhanced, opts->uvquality);
if (opts->mbe_out_f != NULL)
{
saveAmbe2450Data (opts, state, (char *)state->dPMRVoiceFS2Frame.AmbeBit[i]);
}
if (opts->errorbars == 1)
{
fprintf(stderr, "%s", state->err_str);
//fprintf(stderr, "%s", state->err_str);
}
state->debug_audio_errors += *errs2;
//state->debug_audio_errors += *errs2;
processAudio(opts, state);
@@ -756,7 +709,7 @@ void processdPMRvoice (dsd_opts * opts, dsd_state * state)
if (opts->audio_out == 1)
{
//Play the AMBE Frames
//Play the AMBE Frames
playSynthesizedVoice (opts, state);
}
} //End for(i = 0; i < (NB_OF_DPMR_VOICE_FRAME_TO_DECODE * 4); i++)