void doIStereo()

in pedalboard/juce_overrides/juce_PatchedMP3AudioFormat.cpp [1202:1320]


    void doIStereo(float xrBuffer[2][32][18], const int *scaleFactors,
                   int sampleRate, bool msStereo, int lsf) const noexcept {
      float(*xr)[32 * 18] = (float(*)[32 * 18]) xrBuffer;
      auto &bi = bandInfo[sampleRate];
      const float *tabl1, *tabl2;

      if (lsf != 0) {
        auto p = scaleFactorCompression & 1;

        if (msStereo) {
          tabl1 = constants.pow1_2[p];
          tabl2 = constants.pow2_2[p];
        } else {
          tabl1 = constants.pow1_1[p];
          tabl2 = constants.pow2_1[p];
        }
      } else {
        if (msStereo) {
          tabl1 = constants.tan1_2;
          tabl2 = constants.tan2_2;
        } else {
          tabl1 = constants.tan1_1;
          tabl2 = constants.tan2_1;
        }
      }

      if (blockType == 2) {
        bool doL = mixedBlockFlag != 0;

        for (uint32 lwin = 0; lwin < 3; ++lwin) {
          uint32 sfb = maxBand[lwin];
          doL = doL && (sfb <= 3);

          for (; sfb < 12; ++sfb) {
            auto p = scaleFactors[sfb * 3 + lwin - mixedBlockFlag];

            if (p != 7) {
              auto t1 = tabl1[p];
              auto t2 = tabl2[p];
              int sb = bi.shortDiff[sfb];
              auto index = (uint32)sb + lwin;

              for (; sb > 0; --sb, index += 3) {
                float v = xr[0][index];
                xr[0][index] = v * t1;
                xr[1][index] = v * t2;
              }
            }
          }

          auto p = scaleFactors[11 * 3 + lwin - mixedBlockFlag];

          if (p != 7) {
            auto t1 = tabl1[p];
            auto t2 = tabl2[p];
            int sb = bi.shortDiff[12];
            auto index = (uint32)sb + lwin;

            for (; sb > 0; --sb, index += 3) {
              float v = xr[0][index];
              xr[0][index] = v * t1;
              xr[1][index] = v * t2;
            }
          }
        }

        if (doL) {
          int index = bi.longIndex[maxBandl];

          for (uint32 sfb = maxBandl; sfb < 8; ++sfb) {
            int sb = bi.longDiff[sfb];
            auto p = scaleFactors[sfb];

            if (p != 7) {
              auto t1 = tabl1[p];
              auto t2 = tabl2[p];

              for (; sb > 0; --sb, ++index) {
                float v = xr[0][index];
                xr[0][index] = v * t1;
                xr[1][index] = v * t2;
              }
            } else
              index += sb;
          }
        }
      } else {
        int index = bi.longIndex[maxBandl];

        for (uint32 sfb = maxBandl; sfb < 21; ++sfb) {
          int sb = bi.longDiff[sfb];
          auto p = scaleFactors[sfb];

          if (p != 7) {
            auto t1 = tabl1[p];
            auto t2 = tabl2[p];

            for (; sb > 0; --sb, ++index) {
              const float v = xr[0][index];
              xr[0][index] = v * t1;
              xr[1][index] = v * t2;
            }
          } else
            index += sb;
        }

        auto p = scaleFactors[20];

        if (p != 7) {
          auto t1 = tabl1[p], t2 = tabl2[p];

          for (int sb = bi.longDiff[21]; sb > 0; --sb, ++index) {
            const float v = xr[0][index];
            xr[0][index] = v * t1;
            xr[1][index] = v * t2;
          }
        }
      }
    }