본문 바로가기
Research/Broadcast

How to calculate MPEG-2 PCR value

by sunnyan 2009. 1. 30.
728x90
출처: http://blog.jongov.com/?p=3

How to calculate MPEG-2 PCR value

Lets say that we have to calculate PCR for time 10:01:47.66.
10 hours + 1 minute + 47.66 seconds equals 36107.66 seconds.

In MPEG-2 specification it is said:

PCR_base(i) =((system_clock_ frequency * t(i)) DIV 300) % pow(2, 33)
PCR_ext(i) =((system_clock_ frequency * t(i)) DIV 1) % 300,

where PCR_base is 33 bits and PCR_ext is 9 bits.

So

PCR_base(i) =((system_clock_ frequency * t(i)) DIV 300) % pow(2, 33)
PCR_base =((27000000 *36107.669773 ) DIV 300) % pow(2, 33)
PCR_base =( 974907083871 DIV 300) % pow(2, 33)
PCR_base = 3249690279 % pow(2, 33)
PCR_base = 3249690279

PCR_ext(i) =((system_clock_ frequency * t(i)) DIV 1) % 300
PCR_ext(i) =((27000000 * 36107.669773 ) DIV 1) % 300
PCR_ext(i) =(974907083871 DIV 1) % 300
PCR_ext(i) =171

728x90