[Libre-soc-dev] Inverse DCT

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Jul 29 23:32:31 BST 2021


On Thu, Jul 29, 2021 at 10:41 PM Luke Kenneth Casson Leighton
<lkcl at lkcl.net> wrote:

> the top-half-swapping is particularly obtuse and different, currently
> dealing with that.

got it.  wow, really obtuse.  a series of random "try this, no, try this, no,
try this, no..." for about 2 hours eventually got the right combination of
swapping and shuffling.

post-analysis - retrospectively it's quite "obvious" - shows things like this:

inverse-DCT:
                x = vec[ji[ri[jh]]]
                y = vec[ji[ri[jh+size]]]

DCT:
                t1 = vec[ri[ji[jl]]]
                t2 = vec[ri[ji[jh]]]

note *JI* (which is for byte-swapping) on outer and *RI* on inner
(for bit-reverse) on Inverse-DCT, but for DCT is is *JI* on inner
lookup and *RI* on outer.

also the butterfly schedules go 2 4 8 16 ... in DCT and
16 8 4 2 in i-DCT.  and you do the "iterative sum" first
in i-DCT and the cos-coefficient second, but for DCT
it is cos-coefficient first.

overall it *is* pretty much the inverse operations, i just wasn't
expecting the inversing to apply to the order of lookups of
byte-swapping and bit-reversing.

sigh, that's yet _another_ mode in the schedule code.

will deal with that tomorrow.

l.



More information about the Libre-soc-dev mailing list