Examples of ICSInfo


Examples of net.sourceforge.jaad.aac.syntax.ICSInfo

  private IS() {
  }

  public static void process(CPE cpe, float[] specL, float[] specR) {
    final ICStream ics = cpe.getRightChannel();
    final ICSInfo info = ics.getInfo();
    final int[] offsets = info.getSWBOffsets();
    final int windowGroups = info.getWindowGroupCount();
    final int maxSFB = info.getMaxSFB();
    final int[] sfbCB = ics.getSfbCB();
    final int[] sectEnd = ics.getSectEnd();
    final float[] scaleFactors = ics.getScaleFactors();

    int w, i, j, c, end, off;
    int idx = 0, groupOff = 0;
    float scale;
    for(int g = 0; g<windowGroups; g++) {
      for(i = 0; i<maxSFB;) {
        if(sfbCB[idx]==INTENSITY_HCB||sfbCB[idx]==INTENSITY_HCB2) {
          end = sectEnd[idx];
          for(; i<end; i++, idx++) {
            c = sfbCB[idx]==INTENSITY_HCB ? 1 : -1;
            if(cpe.isMSMaskPresent())
              c *= cpe.isMSUsed(idx) ? -1 : 1;
            scale = c*scaleFactors[idx];
            for(w = 0; w<info.getWindowGroupLength(g); w++) {
              off = groupOff+w*128+offsets[i];
              for(j = 0; j<offsets[i+1]-offsets[i]; j++) {
                specR[off+j] = specL[off+j]*scale;
              }
            }
          }
        }
        else {
          end = sectEnd[idx];
          idx += end-i;
          i = end;
        }
      }
      groupOff += info.getWindowGroupLength(g)*128;
    }
  }
 
View Full Code Here

Examples of net.sourceforge.jaad.aac.syntax.ICSInfo

  public void setPredictionUnused(int sfb) {
    predictionUsed[sfb] = false;
  }

  public void process(ICStream ics, float[] data, SampleFrequency sf) {
    final ICSInfo info = ics.getInfo();

    if(info.isEightShortFrame()) resetAllPredictors();
    else {
      final int len = Math.min(sf.getMaximalPredictionSFB(), info.getMaxSFB());
      final int[] swbOffsets = info.getSWBOffsets();
      int k;
      for(int sfb = 0; sfb<len; sfb++) {
        for(k = swbOffsets[sfb]; k<swbOffsets[sfb+1]; k++) {
          predict(data, k, predictionUsed[sfb]);
        }
View Full Code Here

Examples of net.sourceforge.jaad.aac.syntax.ICSInfo

    return b;
  }

  //sectionDataResilience = hDecoder->aacSectionDataResilienceFlag
  public static void decodeReorderedSpectralData(ICStream ics, BitStream in, short[] spectralData, boolean sectionDataResilience) throws AACException {
    final ICSInfo info = ics.getInfo();
    final int windowGroupCount = info.getWindowGroupCount();
    final int maxSFB = info.getMaxSFB();
    final int[] swbOffsets = info.getSWBOffsets();
    final int swbOffsetMax = info.getSWBOffsetMax();
    //TODO:
    //final SectionData sectData = ics.getSectionData();
    final int[][] sectStart = null; //sectData.getSectStart();
    final int[][] sectEnd = null; //sectData.getSectEnd();
    final int[] numSec = null; //sectData.getNumSec();
    final int[][] sectCB = null; //sectData.getSectCB();
    final int[][] sectSFBOffsets = null; //info.getSectSFBOffsets();

    //check parameter
    final int spDataLen = ics.getReorderedSpectralDataLength();
    if(spDataLen==0) return;

    final int longestLen = ics.getLongestCodewordLength();
    if(longestLen==0||longestLen>=spDataLen) throw new AACException("length of longest HCR codeword out of range");

    //create spOffsets
    final int[] spOffsets = new int[8];
    final int shortFrameLen = spectralData.length/8;
    spOffsets[0] = 0;
    int g;
    for(g = 1; g<windowGroupCount; g++) {
      spOffsets[g] = spOffsets[g-1]+shortFrameLen*info.getWindowGroupLength(g-1);
    }

    final Codeword[] codeword = new Codeword[512];
    final BitsBuffer[] segment = new BitsBuffer[512];

    int lastCB;
    int[] preSortCB;
    if(sectionDataResilience) {
      preSortCB = PRE_SORT_CB_ER;
      lastCB = NUM_CB_ER;
    }
    else {
      preSortCB = PRE_SORT_CB_STD;
      lastCB = NUM_CB;
    }

    int PCWs_done = 0;
    int segmentsCount = 0;
    int numberOfCodewords = 0;
    int bitsread = 0;

    int sfb, w_idx, i, thisCB, thisSectCB, cws;
    //step 1: decode PCW's (set 0), and stuff data in easier-to-use format
    for(int sortloop = 0; sortloop<lastCB; sortloop++) {
      //select codebook to process this pass
      thisCB = preSortCB[sortloop];

      for(sfb = 0; sfb<maxSFB; sfb++) {
        for(w_idx = 0; 4*w_idx<(Math.min(swbOffsets[sfb+1], swbOffsetMax)-swbOffsets[sfb]); w_idx++) {
          for(g = 0; g<windowGroupCount; g++) {
            for(i = 0; i<numSec[g]; i++) {
              if((sectStart[g][i]<=sfb)&&(sectEnd[g][i]>sfb)) {
                /* check whether codebook used here is the one we want to process */
                thisSectCB = sectCB[g][i];

                if(isGoodCB(thisCB, thisSectCB)) {
                  //precalculation
                  int sect_sfb_size = sectSFBOffsets[g][sfb+1]-sectSFBOffsets[g][sfb];
                  int inc = (thisSectCB<HCB.FIRST_PAIR_HCB) ? 4 : 2;
                  int group_cws_count = (4*info.getWindowGroupLength(g))/inc;
                  int segwidth = Math.min(MAX_CW_LEN[thisSectCB], longestLen);

                  //read codewords until end of sfb or end of window group
                  for(cws = 0; (cws<group_cws_count)&&((cws+w_idx*group_cws_count)<sect_sfb_size); cws++) {
                    int sp = spOffsets[g]+sectSFBOffsets[g][sfb]+inc*(cws+w_idx*group_cws_count);
 
View Full Code Here

Examples of net.sourceforge.jaad.aac.syntax.ICSInfo

    final int bits = (ics.getInfo().isEightShortFrame()) ? 11 : 9;
    final boolean sfConcealment = in.readBool();
    final int revGlobalGain = in.readBits(8);
    final int rvlcSFLen = in.readBits(bits);

    final ICSInfo info = ics.getInfo();
    final int windowGroupCount = info.getWindowGroupCount();
    final int maxSFB = info.getMaxSFB();
    final int[][] sfbCB = null; //ics.getSectionData().getSfbCB();

    int sf = ics.getGlobalGain();
    int intensityPosition = 0;
    int noiseEnergy = sf-90-256;
View Full Code Here

Examples of net.sourceforge.jaad.aac.syntax.ICSInfo

    noiseUsed = false;
    if(in.readBool()) decodeEscapes(in, ics, scaleFactors);
  }

  private void decodeEscapes(BitStream in, ICStream ics, int[][] scaleFactors) throws AACException {
    final ICSInfo info = ics.getInfo();
    final int windowGroupCount = info.getWindowGroupCount();
    final int maxSFB = info.getMaxSFB();
    final int[][] sfbCB = null; //ics.getSectionData().getSfbCB();

    final int escapesLen = in.readBits(8);

    boolean noiseUsed = false;
View Full Code Here

Examples of net.sourceforge.jaad.aac.syntax.ICSInfo

  public void setPredictionUnused(int sfb) {
    if(longUsed!=null) longUsed[sfb] = false;
  }

  public void process(ICStream ics, float[] data, FilterBank filterBank, SampleFrequency sf) {
    final ICSInfo info = ics.getInfo();

    if(!info.isEightShortFrame()) {
      final int samples = frameLength<<1;
      final float[] in = new float[2048];
      final float[] out = new float[2048];

      for(int i = 0; i<samples; i++) {
        in[i] = states[samples+i-lag]*CODEBOOK[coef];
      }

      filterBank.processLTP(info.getWindowSequence(), info.getWindowShape(ICSInfo.CURRENT),
          info.getWindowShape(ICSInfo.PREVIOUS), in, out);

      if(ics.isTNSDataPresent()) ics.getTNS().process(ics, out, sf, true);

      final int[] swbOffsets = info.getSWBOffsets();
      final int swbOffsetMax = info.getSWBOffsetMax();
      int low, high, bin;
      for(int sfb = 0; sfb<lastBand; sfb++) {
        if(longUsed[sfb]) {
          low = swbOffsets[sfb];
          high = Math.min(swbOffsets[sfb+1], swbOffsetMax);
View Full Code Here

Examples of net.sourceforge.jaad.aac.syntax.ICSInfo

  private MS() {
  }

  public static void process(CPE cpe, float[] specL, float[] specR) {
    final ICStream ics = cpe.getLeftChannel();
    final ICSInfo info = ics.getInfo();
    final int[] offsets = info.getSWBOffsets();
    final int windowGroups = info.getWindowGroupCount();
    final int maxSFB = info.getMaxSFB();
    final int[] sfbCBl = ics.getSfbCB();
    final int[] sfbCBr = cpe.getRightChannel().getSfbCB();
    int groupOff = 0;
    int g, i, w, j, idx = 0;

    for(g = 0; g<windowGroups; g++) {
      for(i = 0; i<maxSFB; i++, idx++) {
        if(cpe.isMSUsed(idx)&&sfbCBl[idx]<NOISE_HCB&&sfbCBr[idx]<NOISE_HCB) {
          for(w = 0; w<info.getWindowGroupLength(g); w++) {
            final int off = groupOff+w*128+offsets[i];
            for(j = 0; j<offsets[i+1]-offsets[i]; j++) {
              float t = specL[off+j]-specR[off+j];
              specL[off+j] += specR[off+j];
              specR[off+j] = t;
            }
          }
        }
      }
      groupOff += info.getWindowGroupLength(g)*128;
    }
  }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.