[Theora-dev] FPGA implementation

Andrey Filippov theora at elphel.com
Tue Jan 25 13:17:13 PST 2005

> Andrey Filippov wrote:
>> Two more bugs fixed - one (in DC prediction) was that the last operation
>> -
>> comparing with 3 neighbours and replacing predicted value with one of
>> them
>> was terminated after 2, not 3 cycles. The other one - shifting color
>> components by 128 before forward DCT and after inverse DCT. Still there
>> are some (at least 3 what I can see):
>> 1 - DCT prediction on the right border;
>> 2 - Y starts from >128 , not from nearly zero
>> 3 - color artifacts near the where there is sharp intensity change.
>> http://www.elphel.com/downloads/twelfth.ogg
>> http://www.elphel.com/downloads/twelfth.png

> Getting closer! As for 2, Y is also shifted by 128 (as per Section
> 7.9.1, "The Intra Predictor"). Make sure you're subtracting that before
> encoding.

Fixed that, but still had a bug - I should try use neighbour as a
predictor if there (P[0], P[1], P[2]) were non-zeros, didn't need to look
at P[3] as below:
 - that was easy to find and fix, even as such procedures are more
difficult to implement in FPGA than in a program - instead of fragment.c

But now these colored blocks:

Error in filling quantization/dequantization tables in FPGA (room is up to
8 that can be used without additional data transfger to FPGA), so color
components used the same as for luma. Fixed that - but got something new
(it was not there before):

This was really stupid - the last byte (or probably even 1 bit - as it was
0x80) was lost while converting output file to ogg and it took me a while
to find the problem - from my previous experience with the accidentally
truncated  frame I thought Theora could handle it on it's own :-)


and with maximal quality


Still something wrong with colors. On the edge it's OK - I feed the
pattern as if from the sensor (Bayer coded RG/GB pixels) and there are
color artifacts on the edges. I now use 3x3 pixel interpolation as in the
older 313 camera, but memory is already setup to process 5x5 (internal
FPGA buffers receive 20x20 Bayer data macroblocks to calculate 16x16 YCbCr
4:2:0 macroblock for compression).

More information about the Theora-dev mailing list