2D packing in fixed dimensions rectangle
This is equivalent to finding the enclosing square of minimum area for rectangles of size $(w_i/W, h_i/H)$.

You seem to have found algorithms for this problem already. There are many heuristics (here or here) and exact models (here), available when searching for "2D packing algorithm". The ones linked handle the case with variable W and H as well.