reset password
Author Message
yogesh
Posts: 24
Posted 18:52 May 11, 2011 |

Compression Ratio = S/D

S= 24*64  

and D 9 bit for Y 8 bit for Cr and Cb

and change value of n

so D =(9+8+8)*n

compression ratio for n=1  61.44

compression ratio  for n=2  : 30.72

Is it correct  ?

kknaur
Posts: 540
Posted 15:02 May 12, 2011 |

Did you compute the diagonal run length for all 8x8 blocks per Y Cb and Cr?  Because the number of (code, runlength) pairs per each block per Y Cb Cr must be taken into account when computing compression ratio..  The example she gave in part F5 of the homework is only for a SINGLE Y block, you must do the same for all blocks of Y Cb and Cr if i understand it correctly.  Anyone care to verify this?

Redalb
Posts: 22
Posted 16:41 May 13, 2011 |

I think that's right Kknaur.

Also, aren't the Cb Cr 'tiles' only 4 x 4 since we need to use 4:2:0 sub sampling on those?

Edit: The quantization table for Cr and Cb is 8x8 so I'm guessing you keep it the same size but assign the average value to the relevant neighbors.

Last edited by Redalb at 18:28 May 13, 2011.
kknaur
Posts: 540
Posted 20:09 May 13, 2011 |

Don't forget she said to Pad the Cb Cr values so they can be divided into 8x8 blocks.

Redalb
Posts: 22
Posted 20:14 May 13, 2011 |

If the image is already padded to be divided into 8x8 tiles then the Cb Cr would be divisible by 8. So you are saying we sub sample and get a 4x4 then pad the rest to have an 8x8 again?

Last edited by Redalb at 20:15 May 13, 2011.
kknaur
Posts: 540
Posted 20:16 May 13, 2011 |

Once you subsample Cb and Cr is possible you will get dimensions that are not divisible by 8 even after padding the image as a whole.  So before you can divide Cb and Cr into 8x8 blocks you must pad them so their dimensions are divisble by 8.  You always use 8x8 blocks never 4x4 blocks

Redalb
Posts: 22
Posted 22:09 May 13, 2011 |

I don't quite follow. When I don't do any sub sampling or super sampling of steps F2/I3 my results are 100% identical to the examples results.

 

If the whole image is padded to be a multiple of 8, I dont see how the Cr Cb tiles could ever be anything other than 8x8 and require additional padding. I think I must be missing something here, if you wouldn't mind explaining a little more in depth I would appreciate it.

kknaur
Posts: 540
Posted 22:16 May 13, 2011 |

Well for example.  The ducky image is 250 x 273 and after padding the image the dimensions come out to be 280 x 280 so each dimension is divisible by 8.  When you convert the image to YCbCr, each component is 280 x 280, but when you subsample Cb and Cr you divide each dimension by 2 which results in Cb and Cr being 140 x 140 (280 / 2  x 280 / 2).  140 is not divisible by 8 so its impossible to divide the subsampled Cb / Cr components into 8 x 8 blocks unless you pad Cb and Cr so they become 144 x 144 each for the Ducky image.  Y will remain 280 x 280.

Redalb
Posts: 22
Posted 22:38 May 13, 2011 |

So you end up with one 8x8 Cr (and one 8x8 Cb tile) tile that essentially correlates to two Y tiles for decoding since the Cr and Cb tiles will expand to twice the size during decoding?

kknaur
Posts: 540
Posted 22:42 May 13, 2011 |

You lost me.  Lol...when i convert to Y Cb and Cr i create three separate matricies of values to hold the respective values for each component.  When you subsample Cb and Cr you iterate through them and take 2 x 2 groups of pixels and average them together into a new matrix that will have each dimension be half the size.  At this point you have to pad Cb and Cr before you can split them into 8 x 8 blocks and perform DCT each block.  In the reverse direction you combine the 8x8 blocks for Y Cb and Cr back to three separate matricies but before you can do super sampling on Cb and Cr you have to unpad the extra rows.  After super sampling Cb and Cr will have the same dimensions as Y.

Redalb
Posts: 22
Posted 22:42 May 13, 2011 |

Got it. Thanks for the clarification. Originally I forgot to do the subsampling part and my results were identical to the examples she gave. I was going through all the steps one more time to make sure I didnt miss anything and saw the sampling requirement. Need to do some tweaking now, I wonder if my results will still be identical to the examples, I'm thinking not.

Last edited by Redalb at 22:48 May 13, 2011.