Borrar filtros
Borrar filtros

Calculating the approximate average compression ratio

1 visualización (últimos 30 días)
Daniel_DG
Daniel_DG el 5 de Jun. de 2015
Comentada: Image Analyst el 20 de En. de 2017
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 comentarios
Ellis Wu Lim
Ellis Wu Lim el 20 de En. de 2017

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 el 20 de En. de 2017
If this is your answer, move it to the Answers section below.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Text Data Preparation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by