private int decodePce(MPEG4AudioConfig m4ac,int[][] layoutMap){
  br.skip(2);
  int samplingIndex=br.read(4);
  if (m4ac.samplingIndex != samplingIndex) {
    log.warn(String.format("Sample rate index in program config element does not match the sample rate index configured by the container"));
  }
  int numFront=br.read(4);
  int numSide=br.read(4);
  int numBack=br.read(4);
  int numLfe=br.read(2);
  int numAssocData=br.read(3);
  int numCc=br.read(4);
  if (br.readBool()) {
    br.skip(4);
  }
  if (br.readBool()) {
    br.skip(4);
  }
  if (br.readBool()) {
    br.skip(3);
  }
  if (br.getBitsLeft() < 4 * (numFront + numSide + numBack+ numLfe+ numAssocData+ numCc)) {
    log.error(String.format("decode_pce: overread error"));
    return AAC_ERROR;
  }
  decodeChannelMap(layoutMap,0,AAC_CHANNEL_FRONT,numFront);
  int tags=numFront;
  decodeChannelMap(layoutMap,tags,AAC_CHANNEL_SIDE,numSide);
  tags+=numSide;
  decodeChannelMap(layoutMap,tags,AAC_CHANNEL_BACK,numBack);
  tags+=numBack;
  decodeChannelMap(layoutMap,tags,AAC_CHANNEL_LFE,numLfe);
  tags+=numLfe;
  br.skip(4 * numAssocData);
  decodeChannelMap(layoutMap,tags,AAC_CHANNEL_CC,numCc);
  tags+=numCc;
  br.byteAlign();
  int commentLen=br.read(8) * 8;
  if (br.getBitsLeft() < commentLen) {
    log.error(String.format("decode_pce: overread error"));
    return AAC_ERROR;
  }
  br.skip(commentLen);
  return tags;
}

private int decodePce ( MPEG4AudioConfig m4ac , int [ ] [ ] layoutMap ) { br . skip ( 2 ) ; int samplingIndex = br . read ( 4 ) ; if ( m4ac . samplingIndex != samplingIndex ) { log . warn ( String . format ( "Sample rate index in program config element does not match the sample rate index configured by the container" ) ) ; } int numFront = br . read ( 4 ) ; int numSide = br . read ( 4 ) ; int numBack = br . read ( 4 ) ; int numLfe = br . read ( 2 ) ; int numAssocData = br . read ( 3 ) ; int numCc = br . read ( 4 ) ; if ( br . readBool ( ) ) { br . skip ( 4 ) ; } if ( br . readBool ( ) ) { br . skip ( 4 ) ; } if ( br . readBool ( ) ) { br . skip ( 3 ) ; } if ( br . getBitsLeft ( ) < 4 * ( numFront + numSide + numBack + numLfe + numAssocData + numCc ) ) { log . error ( String . format ( "decode_pce: overread error" ) ) ; return AAC_ERROR ; } decodeChannelMap ( layoutMap , 0 , AAC_CHANNEL_FRONT , numFront ) ; int tags = numFront ; decodeChannelMap ( layoutMap , tags , AAC_CHANNEL_SIDE , numSide ) ; tags += numSide ; decodeChannelMap ( layoutMap , tags , AAC_CHANNEL_BACK , numBack ) ; tags += numBack ; decodeChannelMap ( layoutMap , tags , AAC_CHANNEL_LFE , numLfe ) ; tags += numLfe ; br . skip ( 4 * numAssocData ) ; decodeChannelMap ( layoutMap , tags , AAC_CHANNEL_CC , numCc ) ; tags += numCc ; br . byteAlign ( ) ; int commentLen = br . read ( 8 ) * 8 ; if ( br . getBitsLeft ( ) < commentLen ) { log . error ( String . format ( "decode_pce: overread error" ) ) ; return AAC_ERROR ; } br . skip ( commentLen ) ; return tags ; }
decode program configuration element ; reference : table 4 . 2 .
