Package net.sourceforge.jaad.aac

Examples of net.sourceforge.jaad.aac.AACException


    //if(conf.isScalefactorResilienceUsed()) rvlc.decode(in, this, scaleFactors);
    /*else*/ decodeScaleFactors(in);

    pulseDataPresent = in.readBool();
    if(pulseDataPresent) {
      if(info.isEightShortFrame()) throw new AACException("pulse data not allowed for short frames");
      LOGGER.log(Level.FINE, "PULSE");
      decodePulseData(in);
    }

    tnsDataPresent = in.readBool();
View Full Code Here


    for(int g = 0; g<windowGroupCount; g++) {
      int k = 0;
      while(k<maxSFB) {
        end = k;
        cb = in.readBits(4);
        if(cb==12) throw new AACException("invalid huffman codebook: 12");
        while((incr = in.readBits(bits))==escVal) {
          end += incr;
        }
        end += incr;
        if(end>maxSFB) throw new AACException("too many bands: "+end+", allowed: "+maxSFB);
        for(; k<end; k++) {
          sfbCB[idx] = cb;
          sectEnd[idx++] = end;
        }
      }
View Full Code Here

  }

  private void decodePulseData(BitStream in) throws AACException {
    pulseCount = in.readBits(2)+1;
    pulseStartSWB = in.readBits(6);
    if(pulseStartSWB>=info.getSWBCount()) throw new AACException("pulse SWB out of range: "+pulseStartSWB+" > "+info.getSWBCount());

    if(pulseOffset==null||pulseCount!=pulseOffset.length) {
      //only reallocate if needed
      pulseOffset = new int[pulseCount];
      pulseAmp = new int[pulseCount];
    }

    pulseOffset[0] = info.getSWBOffsets()[pulseStartSWB];
    pulseOffset[0] += in.readBits(5);
    pulseAmp[0] = in.readBits(4);
    for(int i = 1; i<pulseCount; i++) {
      pulseOffset[i] = in.readBits(5)+pulseOffset[i-1];
      if(pulseOffset[i]>1023) throw new AACException("pulse offset out of range: "+pulseOffset[0]);
      pulseAmp[i] = in.readBits(4);
    }
  }
View Full Code Here

            }
            break;
          default:
            for(; sfb<end; sfb++, idx++) {
              offset[0] += Huffman.decodeScaleFactor(in)-SF_DELTA;
              if(offset[0]>255) throw new AACException("scalefactor out of range: "+offset[0]);
              scaleFactors[idx] = -SCALEFACTOR_TABLE[offset[0]-100+SF_OFFSET];
            }
            break;
        }
      }
View Full Code Here

  }

  /* ========== decoding ========== */
  public void decode(BitStream in, DecoderConfig conf, boolean commonWindow) throws AACException {
    final SampleFrequency sf = conf.getSampleFrequency();
    if(sf.equals(SampleFrequency.SAMPLE_FREQUENCY_NONE)) throw new AACException("invalid sample frequency");

    in.skipBit(); //reserved
    windowSequence = WindowSequence.forInt(in.readBits(2));
    windowShape[PREVIOUS] = windowShape[CURRENT];
    windowShape[CURRENT] = in.readBit();
View Full Code Here

            ltPredict1.decode(in, this, profile);
          }
        }
        break;
      default:
        throw new AACException("unexpected profile for LTP: "+profile);
    }
  }
View Full Code Here

        break;
      case 480:
        roots = FFT_TABLE_480;
        break;
      default:
        throw new AACException("unexpected FFT length: "+length);
    }

    //processing buffers
    rev = new float[length][2];
    a = new float[2];
View Full Code Here

        while(g<=Nq&&k>=fNoise[g]) {
          g++;
        }
        g--;

        if(g<0) throw new AACException("SBR: HFGenerator: no subband found for frequency "+k);

        //fill Xhigh[k] (4.6.18.6.3)
        square = bwArray[g]*bwArray[g];
        alpha[0] = alpha1[p][0]*square;
        alpha[1] = alpha1[p][1]*square;
 
View Full Code Here

        sincos = MDCT_TABLE_1920;
        break;
      case 240:
        sincos = MDCT_TABLE_240;
      default:
        throw new AACException("unsupported MDCT length: "+length);
    }
    fft = new FFT(N4);
    buf = new float[N4][2];
    tmp = new float[2];
  }
View Full Code Here

      //check for remaining bits (byte-align) and skip them
      final int len = in.getPosition()-pos;
      final int bitsLeft = count-len;
      if(bitsLeft>=8) Constants.LOGGER.log(Level.WARNING, "SBR: bits left: {0}", bitsLeft);
      else if(bitsLeft<0) throw new AACException("SBR data overread: "+bitsLeft);
      in.skipBits(bitsLeft);
    }
    else {
      final int left = count-pos+in.getPosition();
      in.skipBits(left);
View Full Code Here

TOP

Related Classes of net.sourceforge.jaad.aac.AACException

Copyright © 2018 www.massapicom. 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.