 So in simple terms the prediction is the median of the top, left, and gradient prediction methods.For improved performance and simplicity, the edges of the frame are assumed to be zero to avoid special cases.The prediction in encoding and decoding is managed using a ring buffer.