View Single Post
Dorian Gray
Veteran Member
 
Join Date: May 2005
Location: Paris, France
 
2009-03-21, 09:45

Well, let's see: 720 x 480 pixels per frame (more in PAL regions), 24 frames per second (25 for PAL), 1.5 hours = about 45 billion pixels in a typical DVD movie. That gives you an idea of the volume of raw data we're dealing with.

For each of the ~130,000 frames in the movie, the encoder (x.264 in your case) must divide it into a series of blocks (typically 8 x 8 or 16 x 16 pixels, but H.264 goes down to 4 x 4 if you want). So we're talking thousands of blocks per frame. Then the encoder must compare each block against thousands of previous and/or future blocks for similarities in content (a process known as motion estimation).

If there's a good match the encoder can reference the other block to avoid storing the same data twice; if the match is poor, the encoder instead stores a series of instructions for arriving at an approximation of the block's texture based on a starting point of surrounding blocks.

This a crude explanation and many other computationally intensive tasks are performed to improve quality or compression, but that's the basic idea. Then when you've got a nice encode, the whole thing is losslessly compressed further with CABAC, which is again very time-consuming to encode.

And you ask why your monstrously powerful computer can't do this much faster than realtime? A few years ago it would have taken a week!
  quote