Ejemplo n.º 1
0
 /** Picture:
  * @param b payload buffer
  * @param d decoder of the picture
  *
  * The b buffer should only point to the payload data section of
  * the picture (not the header). The only methods that would ever need
  * to be called are parse(), decode(), and getImage(). However,
  * one should check wether the error variable is set before and after
  * calling a method. One should not call them in any other order than that
  * just specified. Each can be called without arguments and should not be
  * called twice. */
 public Picture(Buffer b, Decoder d)
 {
     num = b.GetInt(13);
     code = b.GetByte(4);
     buf = b;
     dec = d;
     par = new Parameters(code);
     coeffs = new SubBand[3][];
     coeffs[0] = new SubBand[19];
     coeffs[1] = new SubBand[19];
     coeffs[2] = new SubBand[19];
     motion_buffers = new Buffer[9];
     status = Decoder.Status.NULL;
 }
Ejemplo n.º 2
0
 private void ParseTransformData(Unpack u)
 {
     int q,l;
     Buffer b;
     for(int c = 0; c < 3; c++) {
         for(int i = 0; i < 1+3*par.transformDepth; i++) {
         u.Align();
         l = u.DecodeUint();
         if( l != 0) {
             q = u.DecodeUint();
             b = u.GetSubBuffer(l);
         } else {
             q = 0;
             b = null;
         }
         coeffs[c][i] = new SubBand(b,q,par);
         coeffs[c][i].CalculateSizes(i, c == 0);
         }
     }
 }