These calculations are rounding up, as some formats cannot store arbitrary width data. It's important to round up, otherwise you'd lose pixels off the texture. You'll note that usually the add is 1 less than the number being divided by. Integer divides normally round down, so by adding 1 less than the divisor, any number other than an exact multiple will round to the next value.
For example, if you add 3 then divide by 4:
- 1 = 1
- 2 = 1
- 3 = 1
- 4 = 1
- 5 = 2
- 6 = 2
- etc.
The rest of the calculations account for the storage requirements of the respective format. For DXT compression, there are 4x4 blocks of pixels, which is why the size is in 4 pixel chunks, and then each block takes a fixed number of bytes, which is blockSize multiplier.
The second calculation is rounding to a multiple of 2 pixels, and then multiplying by 4. That suggests perhaps a 16-bit pixel format where pixels are 2 bytes wide and the line must be a multiple of 4 bytes (thus a multiple of two pixels)