Coding wavelets the easy way

Color Approximation



We now approximate the chrominance matrices. We still assume that the matrices are 512x512, but as we said, this can be adapted. We use the Daub2 filters, i.e. we works in the Haar basis, to keep close to the JPEG case. The difference with the JPEG case is that we do no limit the scale to 4 (e.g. to work on 4x4 pixel blocks) but use the scale 9 which is the maximum for this image.
You will write
function [wb,wr] = colorCompress(Cb,Cr,ratio)
which, from the chrominance channels Cb and Cr, performs a nonlinear approximation with ratio ratio of details using the Daub2 filters. The output wb and wr are the approximate chrominance channels which must be of type uint8.