turns out I was using the wrong formula for jpeg rgb -> ycbcr. That is now fixed and some more tests have been added.