def jpeg.idct.components

gralha-jpeg-decode@0.1.0.1 · jpeg.bend:657

import gralha-jpeg-decode@0.1.0.1/jpeg.bend as Jpeg
import Base
import gralha-bytes@0.1.0.1/bytes.bend as Bin

657def jpeg.idct.components(xs: List<&2, JPEGComponent>, +quants: List<&2, JPEGQuant>) -> List<&2, JPEGComponent>:
658  match xs:
659    case Nil{}: Nil{}
660    case Con{JPEGComponent{id, h, v, quant, dc, ac, predictor, bw, bh, coefficients, samples}, rest}:
661      +cs = coefficients
662      +qq = quant
663      +ww = bw
664      +hh = bh
665      Con{JPEGComponent{id, h, v, qq, dc, ac, predictor, ww, hh, cs, jpeg.idct.blocks(U32.to_nat((ww * hh : U32)), 0, ww, cs, jpeg.quant.find(quants, qq), Bin.bytes.zero((ww * hh * 64 : U32)))}, jpeg.idct.components(rest, quants)}

Uses (9)

Used by (1)