int ff_irms(DSPContext *dsp, const int16_t *data)
{
    unsigned int sum = dsp->scalarproduct_int16(data, data, BLOCKSIZE);

    if (sum == 0)
        return 0; /* OOPS - division by zero */

    return 0x20000000 / (ff_t_sqrt(sum) >> 8);
}