reset password
Author Message
eykang
Posts: 95
Posted 19:13 May 04, 2011 |

By hand, compute the compression ratio for the following image using the method given in the HW3.

A 80 x 80 PPM image whose all pixels are red.

Extra credit points will be given to whoever (CS451 students only) posts the correct answer first.

Post your answer for n=0, .., 5.

--Kang 

aaronyen
Posts: 29
Posted 19:47 May 04, 2011 |

Compression Ratio = S/D

S = 80 * 80 * 24bits (all red colored) = 153600bits

There are 6400 / 64 = 100 boxes

For n = 0, Y requires 9 - 0 = 9 bits + 30 bits = 39 bits; Cr = 38 bits; Cb = 38 bits

CR = 153600bits / (100*115bits) = 13.36

For n = 1, Y requires 9 - 1 = 8 bits  + 30 bits =38bits ; Cr = 8 - 1 = 7 bits  + 30 bits = 37bits; Cb = 7 bits  + 30 bits =37bits

CR = 13.71

For n = 2, Y requires 9 - 2 = 7 bits  + 30 bits = 37bits; Cr = 8 - 2 = 6 bits  + 30 bits = 36bits; Cb = 6 bits  + 30 bits =36bits

CR = 14.09

For n = 3, CR = 14.49

For n = 4, CR = 14.91

For n = 5, CR = 15.36

 

Chien-Heng Yen

Last edited by aaronyen at 16:08 May 07, 2011.
cbort
Posts: 95
Posted 20:14 May 06, 2011 |

Lol I work full time and am taking 18 units of classes, so right now is the first time I could even look at this... Your giving only one person extra credit?  :(

eykang
Posts: 95
Posted 21:14 May 06, 2011 |

Extra credit points will be given to whoever posts the CORRECT answer first.

Everybody still has a chance.

--Kang 

cbort
Posts: 95
Posted 12:00 May 07, 2011 |

See answer below...

Last edited by cbort at 13:48 May 10, 2011.
aaronyen
Posts: 29
Posted 15:56 May 07, 2011 |

My answer is corrected.  Please see 2nd post.


Chien-Heng Yen

Last edited by aaronyen at 15:56 May 07, 2011.
cbort
Posts: 95
Posted 16:06 May 07, 2011 |

See answer below...

Last edited by cbort at 13:48 May 10, 2011.
aaronyen
Posts: 29
Posted 16:10 May 07, 2011 |

lol we have a two minute difference.  Who's the winner or both of us are? ;)

cbort
Posts: 95
Posted 16:17 May 07, 2011 |

lol we have different answers... have you done the assignment yet? I dont understand what to do with the Cb//Cr once we sub sample it... do we assume the same size when using DCT on it and take 4 samples with the same value?

Last edited by cbort at 16:22 May 07, 2011.
eykang
Posts: 95
Posted 13:28 May 09, 2011 |

CBORT asked an important question to solve this problem.

Instead of 80x80, compute a compression ratio for a 64 x 64 PPM image whose all pixels are red.

I will clarify Cb and Cr sub-sampling issues in the class room.

--Kang

cbort
Posts: 95
Posted 13:56 May 09, 2011 |

Updated again lol

cbort
Posts: 95
Posted 13:48 May 10, 2011 |

Last time....

Compute the compression ratio for a 64x64 red image

1.) Convert the image into YCbCr from RGB (255,0,0)

  • Y = 0.2990*255 = 76.25 - 128 = -51.755
  • Cb = -0.1687*255 = -43.02 - 0.5 = -43.52
  • Cr = 0.500*255 = 127.5 - 0.5 = 127

2.) There is no need to average the Cb//Cr values since every pixel is identical so simply subsample

  • number of Y Boxes = 64/8*64/8  = 64
  • number of Cb Boxes = 64/2/8*64/2/8 = 16
  • number of Cr Boxes = 64/2/8*64/2/8 = 16

3.) Because the image is all one color there is only the DC followed by all 0s for the AC

  • y: 1DC + 1AC run length per box Y
  • cb: 1DC + 1AC run length per box Cb
  • cr: 1DC + 1AC run length per box Cr
     

4.) Calculate the total compressed cost and divide original cost by it

  • costY = number of boxes y * ((9-n)+(6+9-n))
  • costCb = number of boxes Cb * ((8-n)+(6+8-n))
  • costCr = number of boxes Cr * ((8-n)+(6+8-n))
  • D = Total cost = costY+costCb+costCr bytes
  • S = 64*64*24 = 98304 bytes
n costY costCb costCr TotalCost S/D
0 1536 352 352 2240 43.89
1 1408 320 320 2048 48.00
2 1280 288 288 1856 52.97
3 1152 256 256 1664 59.08
4 1024 224 224 1472 66.78
5 896 192 192 1280 78.80
Last edited by cbort at 19:19 May 10, 2011.
eykang
Posts: 95
Posted 20:46 May 16, 2011 |

CBORT will get extra credit points. 

One mistake, for n=5, S/D should be 76.80, not 78.80.

--Kang