Add new reference pixel buffer management to encoding loop.

- This is necessary because after we add in-loop filters to be done per LCU,
  the reconstruction buffer will have the deblocked pixels. We only need the
  edge-pixels for intra prediction though so we just save those.

- Right now it only copies the pixels and passes them on to search, where
  the copied pixels are asserted to be the same ones we copy from
  reconstruction buffer.

- New yuv_t struct added for arrays of dynamic length. We might want to change
  other buffers to use it or something like it in the future.
Add special handling for bottom right LCU pixel.

I didn't take into account that the reference pixel on the top-left of the
LCU gets over written if we just replace the top reference pixels for
current LCU with the bottom reference pixels after doing the search.
To handle this I copy the pixel that gets overwritten to the vertical
reference pixels.
Replace old LCU reference pixels initialization with new ones.

In the future we might even have just a const pointer to reference pixels.
Modify deblocking to be done per-LCU in the encoding loop.

- Intra works. There is still something wrong in inter.

- Avoid horizontal deblocking of the rightmost 4 pixels in the LCU.
  This is because vertical deblocking must be done for all pixels
  before horizontal, but vertical deblocking can't be done for those
  pixels before the next LCU is finished.

- Add separate deblocking of the rightmost pixels of the last LCU
  after the LCU edge has been deblocked.

- This is a pretty ugly hack but will have to do for now.
Fix deblocking of transform boundaries.

This fixes issues with inter. Deblocking works now.
Clean up deblocking code a bit.

- Change guards to use the same method of checking for coordinate alignment.

- Move variables to reduce their scope.
Move deblocking code to filter module.
Move rest of LCU encoding inside the LCU loop.

- Move SAO search inside the LCU loop.

- Move CU coding inside the LCU loop.

- Move SAO frame reconstruction loop to sao module.
Merge branch 'lcu-encoding'