Octave implementation of bd_rate.

Updated bjontegaard metric using 6 different interpolation types.
Currently only piecewise-linear and cubic-polyfit are enabled with
 default of piecewise-linear.
state: move common structs into state

Also avoid allocations every frame