public void invDctInPlaceNxN(double[][] coeffs){
  int u=0;
  int v=0;
  double two_over_sqrtncolsnrows=2.0 / Math.sqrt((double)this.N * this.M);
  for (u=0; u <= this.M - 1; u++) {
    invFctNoScale(coeffs[u]);
  }
  for (v=0; v <= this.N - 1; v++) {
    for (u=0; u <= this.M - 1; u++) {
      this.nxnTmp[u]=coeffs[u][v];
    }
    invFctNoScale(this.nxnTmp);
    for (u=0; u <= this.M - 1; u++) {
      coeffs[u][v]=this.nxnTmp[u] * two_over_sqrtncolsnrows;
    }
  }
}

public void invDctInPlaceNxN ( double [ ] [ ] coeffs ) { int u = 0 ; int v = 0 ; double two_over_sqrtncolsnrows = 2.0 / Math . sqrt ( ( double ) this . N * this . M ) ; for ( u = 0 ; u <= this . M - 1 ; u ++ ) { invFctNoScale ( coeffs [ u ] ) ; } for ( v = 0 ; v <= this . N - 1 ; v ++ ) { for ( u = 0 ; u <= this . M - 1 ; u ++ ) { this . nxnTmp [ u ] = coeffs [ u ] [ v ] ; } invFctNoScale ( this . nxnTmp ) ; for ( u = 0 ; u <= this . M - 1 ; u ++ ) { coeffs [ u ] [ v ] = this . nxnTmp [ u ] * two_over_sqrtncolsnrows ; } } }
perform inverse dct in place for n x n matrix
