0

I am trying to design a simple jpeg decoder in MATLAB. I take a .jpg image and then decoding the headers of that image. Then decode scan data after SOS header and create blocks of 64 pixels

(order of my decoding scan data: huffman decoding,Dequantization,De-zigzag,Inverse DCT,level shifting,Clamp and Convert from Ycbcr to RGB.)

I already think did above decoding process correct .I did it for every block with 64 pixels and also determine sub-sampling effect for block. now i have below structure for Y channels and also Cb and Cr channels:(suppose I have a sub sampling of factor 2 for Cb and Cr channels)

[16*16pixels] , [16*16pixels] , [16*16pixels] , [16*16pixels] , [16*16pixels] ,... ..., [16*16pixels] , [16*16pixels] .

length of above blocks array is imageWidth*imageLength/256 (suppose it divisible)

now my question is that: how i can recover whole image from above blocks,in others word, how i must sort and arrange above blocks to take a whole decoded image?

Bashid
  • 433
  • 5
  • 15
  • `16*16 = 256` in my maths book, whilst you state you extract blocks of 64 pixels? – Adriaan Oct 04 '18 at 08:09
  • Yes. After extracting 8*8 pixels of every block convert them with interpolation to 16*16 blocks, because of sampling factor of 2, for Cb and Cr channels . Y channel has no sub sampling factor therefore 4 blocks with size 8*8 make a 16 *16 block. – Bashid Oct 04 '18 at 08:13
  • Please provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) so the problem can be reproduced. – CAta.RAy Oct 04 '18 at 14:42
  • The complexity of JPEG is such that this cannot be answered in the scope of a post here. – user3344003 Oct 05 '18 at 02:53

0 Answers0