tools: fix "unused-but-set" warning

Remove unused pad variable.
Efficient coding of the top-level block size (32x32 and first 16x16 block)
Efficient coding of the remaining block size information
Adds "safe" OD_COPY(), OD_MOVE() and OD_CLEAR() macros.

The only two non-binary-bitexact changes are in mcenc.c:

memcpy(est->refine_grid[0], state->mv_grid[0],
 sizeof(**state->mv_grid)*(nhmvbs + 1)*(nvmvbs + 1));
because of the order of the multiplications

memmove(mv->mvs + 1, mv->mvs + 0, sizeof(mv->mvs[0]) << 1);
because of the << 1 instead of *2.