code: private static int calculateNumberOfRows(int m, int k, int c) {
      int r = ((m + 1 + k) / c) + 1;
      if (c * r >= (m + 1 + k + c)) {
        r--;
      }
      return r;
    }
docs: Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).
  
  @param m the number of source codewords prior to the additional of the Symbol Length
  Descriptor and any pad codewords
  @param k the number of error correction codewords
  @param c the number of columns in the symbol in the data region (excluding start, stop and
  row indicator codewords)
  @return the number of rows in the symbol (r)