protected int decompress(ShortBuffer compressedData,int npix){
  int llfirt;
  int lllen;
  if (!(compressedData.get(2) > 0)) {
    lllen=(compressedData.get(HEADER_SIZE_FIELD2) << SHIFT_15_BITS) + compressedData.get(HEADER_SIZE_FIELD1);
    llfirt=compressedData.get(1);
  }
 else {
    lllen=compressedData.get(MINI_HEADER_SIZE_FIELD);
    llfirt=MINI_HEADER_SIZE;
  }
  final int xe=npix;
  int op=0;
  int x1=1;
  int pv=1;
  for (int ip=llfirt; ip <= lllen; ++ip) {
    final int opcode=compressedData.get(ip) / FIRST_VALUE_WITH_13_BIT;
    final int data=compressedData.get(ip) & LAST_VALUE_FITTING_IN_12_BIT;
    final int sw0001=opcode + 1;
    if (sw0001 == OPCODE_1 || sw0001 == OPCODE_5 || sw0001 == OPCODE_6) {
      final int x2=x1 + data - 1;
      final int i2=Math.min(x2,xe);
      final int np=i2 - Math.max(x1,0) + 1;
      if (np > 0) {
        final int otop=op + np - 1;
        if (!(opcode == OPCODE_4)) {
          for (int index=op; index <= otop; ++index) {
            put(index,0);
          }
          if (opcode == OPCODE_5 && i2 == x2) {
            put(otop,pv);
          }
        }
 else {
          for (int index=op; index <= otop; ++index) {
            put(index,pv);
          }
        }
        op=otop + 1;
      }
      x1=x2 + 1;
    }
 else     if (sw0001 == OPCODE_2) {
      pv=(compressedData.get(ip + 1) << SHIFT_12_BITS) + data;
      ++ip;
    }
 else     if (sw0001 == OPCODE_3) {
      pv+=data;
    }
 else     if (sw0001 == OPCODE_4) {
      pv-=data;
    }
 else     if (sw0001 == OPCODE_7) {
      pv+=data;
      if (x1 >= 0 && x1 <= xe) {
        put(op,pv);
        ++op;
      }
      ++x1;
    }
 else     if (sw0001 == OPCODE_8) {
      pv-=data;
      if (x1 >= 0 && x1 <= xe) {
        put(op,pv);
        ++op;
      }
      ++x1;
    }
    if (x1 > xe) {
      break;
    }
  }
  for (int index=op; index < npix; ++index) {
    put(index,0);
  }
  return npix;
}

protected int decompress ( ShortBuffer compressedData , int npix ) { int llfirt ; int lllen ; if ( ! ( compressedData . get ( 2 ) > 0 ) ) { lllen = ( compressedData . get ( HEADER_SIZE_FIELD2 ) << SHIFT_15_BITS ) + compressedData . get ( HEADER_SIZE_FIELD1 ) ; llfirt = compressedData . get ( 1 ) ; } else { lllen = compressedData . get ( MINI_HEADER_SIZE_FIELD ) ; llfirt = MINI_HEADER_SIZE ; } final int xe = npix ; int op = 0 ; int x1 = 1 ; int pv = 1 ; for ( int ip = llfirt ; ip <= lllen ; ++ ip ) { final int opcode = compressedData . get ( ip ) / FIRST_VALUE_WITH_13_BIT ; final int data = compressedData . get ( ip ) & LAST_VALUE_FITTING_IN_12_BIT ; final int sw0001 = opcode + 1 ; if ( sw0001 == OPCODE_1 || sw0001 == OPCODE_5 || sw0001 == OPCODE_6 ) { final int x2 = x1 + data - 1 ; final int i2 = Math . min ( x2 , xe ) ; final int np = i2 - Math . max ( x1 , 0 ) + 1 ; if ( np > 0 ) { final int otop = op + np - 1 ; if ( ! ( opcode == OPCODE_4 ) ) { for ( int index = op ; index <= otop ; ++ index ) { put ( index , 0 ) ; } if ( opcode == OPCODE_5 && i2 == x2 ) { put ( otop , pv ) ; } } else { for ( int index = op ; index <= otop ; ++ index ) { put ( index , pv ) ; } } op = otop + 1 ; } x1 = x2 + 1 ; } else if ( sw0001 == OPCODE_2 ) { pv = ( compressedData . get ( ip + 1 ) << SHIFT_12_BITS ) + data ; ++ ip ; } else if ( sw0001 == OPCODE_3 ) { pv += data ; } else if ( sw0001 == OPCODE_4 ) { pv -= data ; } else if ( sw0001 == OPCODE_7 ) { pv += data ; if ( x1 >= 0 && x1 <= xe ) { put ( op , pv ) ; ++ op ; } ++ x1 ; } else if ( sw0001 == OPCODE_8 ) { pv -= data ; if ( x1 >= 0 && x1 <= xe ) { put ( op , pv ) ; ++ op ; } ++ x1 ; } if ( x1 > xe ) { break ; } } for ( int index = op ; index < npix ; ++ index ) { put ( index , 0 ) ; } return npix ; }
pl_l2pi - - translate a plio line list into an integer pixel tiledimageoperation . the number of pixels output ( always npix ) is returned as the function value .
