フィルターのクリア

Calculating the approximate average compression ratio

1 回表示 (過去 30 日間)
Daniel_DG
Daniel_DG 2015 年 6 月 5 日
コメント済み: Image Analyst 2017 年 1 月 20 日
I have a frame sequence of this sort ABBCBCCAACBBBAA... The compression ratios are as follows for A=0.3, B=0.2, C=0.7. However, the video sequence is much longer than 13 frames. How can I calculate the approximate average compression ratio for a video encoded using the MPEG-1 video coding standard using Mathlab?
  3 件のコメント
Ellis Wu Lim
Ellis Wu Lim 2017 年 1 月 20 日

To calculate the average compression ratio:

1. Count the number of each frame type. 
2. Multiple the compression ratio for each frame type by the number of each frame type.
3. Sum these numbers up and divide by the total number of frames:

For the sequence above:

Number of A frames = 2
Number of B frames = 8
Number of C frames = 3

Multiple the compression ratio for each frame type by the number of each frame type:

A frame = 2 * 0.3 =  0.6
B frame = 3 * 0.05 = 0.15
C frame = 8 * 0.7  = 5.6 

Average compression = (0.6+ 0.15 + 5.6)/13 = 0.488462

However, if the number of frames is much longer than 13 frames, and you want to estimate the average compression ratio, you might just take the first 12 frames assuming there is a pattern to the frames:

   *A BBC BBC BBC B* A

The pattern ends at frame 12, which is frame type B, because it is assumed that A is an I frame (since it is the first frame in the sequence). If the pattern was to end at A, then there will be two I frames next to each other - remember that I frames can be decoded independently, so it is unlikely that two I frames follow one another. So... if you have extremely long frames you might assume that the frames have this kind of pattern:

 *A BBC BBC BBC BB* *A BBC BBC BBC BB* *A BBC BBC BBC BB*

In which case, you only need to calculate the average of the first 12 frames:

A frame = 1 * 0.3 =  0.3
B frame = 3 * 0.05 = 0.15
C frame = 8 * 0.7  = 5.6 

So, the average is now 0.504167

Image Analyst
Image Analyst 2017 年 1 月 20 日
If this is your answer, move it to the Answers section below.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by