Shop OBEX P1 Docs P2 Docs Learn Events
jpeg decoding with picojpeg and FlexC+Spin2 - Page 2 — Parallax Forums

jpeg decoding with picojpeg and FlexC+Spin2

2»

Comments

  • I agree that block copies will speed it up significantly. Of course, that requires doing it all in assembly, which means that a second cog is required, but I already have a version that does that. The 8x8 block in hub RAM is stored in a word array. This needs to be changed to a long array so that it efficiently maps 1:1 with the cog/lut memory. I'll look into doing that.

    I found another IDCT algorithm that has fewer operations, but with more multiplies. Multiplies aren't a problem since the P2 has the hardware MULS instruction. This algorithm is actually quite simple. It takes advantage of the fact that half of the DCT vectors have even symmetry, and the other half have odd symmetry. Similar to the even and odd symmetry of the sines and cosines in a Fourier transform.

    Using the even/odd symmetry property allows the 8x8 transform matrix to be converted to two 4x4 matrices by just performing some simple add/subtract butterfly operations on the data. The even 4x4 matrix can be further reduced to two 2x2 matrices by applying the add/subtract butterfly operations on the even coefficients.

    I'll try implementing this algorithm when I have a chance.
  • I think the quickest way to end up with the best P2 jpeg decoder would be for someone to post a pure assembly code version, however inefficient, so that others could study it and suggest improvements.
Sign In or Register to comment.