view libgsmefr/reorder.c @ 423:cf90077b753c

twamr-tseq-enc: treat dribble input as non-fatal 3GPP VAD2 test sequences dt22.inp and dt23.inp have incomplete frames at the end, hence we need to ignore that dribble in a non-fatal manner in order to pass all tests.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 07 May 2024 07:20:29 +0000
parents 0faf23a9286f
children
line wrap: on
line source

/*************************************************************************
 *
 *  FUNCTION:  Reorder_lsf()
 *
 *  PURPOSE: To make sure that the LSFs are properly ordered and to keep a
 *           certain minimum distance between adjacent LSFs.                               *
 *           The LSFs are in the frequency range 0-0.5 and represented in Q15
 *
 *************************************************************************/

#include "gsm_efr.h"
#include "typedef.h"
#include "namespace.h"
#include "basic_op.h"
#include "no_count.h"
#include "sig_proc.h"

void Reorder_lsf (
    Word16 *lsf,        /* (i/o)     : vector of LSFs   (range: 0<=val<=0.5) */
    Word16 min_dist,    /* (i)       : minimum required distance             */
    Word16 n            /* (i)       : LPC order                             */
)
{
    Word16 i;
    Word16 lsf_min;

    lsf_min = min_dist;         move16 (); 
    for (i = 0; i < n; i++)
    {
        test (); 
        if (lsf[i] < lsf_min)
        {
            lsf[i] = lsf_min;   move16 (); 
        }
        lsf_min = add (lsf[i], min_dist);
    }
}