Streaming video with "TimeSlice" multicore-friendly processing eliminates dropped frames
The process creates a CBR-like stream, but with encoding based on VBR, video quality is better. There are no dropped frames, PSNR is higher, and less bandwidth is needed for a given quality.
Two-pass CBR (2PCBR)
With 2PCBR, the encoder goes through a video twice. On the first pass, the codec analyzes the video frame by frame and calculates all of the motion vectors. On the second pass, the video is encoded using the motion vector data from the first pass.
In theory, the two-pass approach produces higher video quality, because motion vector calculations for a frame can include information about previous, as well as subsequent frames. In practice, however, the quality improvement is negligible and encoding takes nearly twice as long. Also, this process cannot be performed in real time, so it is not an option for live streaming.
Two-pass VBR (2PVBR)
With 2PVBR encoding, an average bit rate is specified. Unlike 2PCBR, the 2PVBR mode does not use any of the data from the first pass during the second pass. Instead, the encoder encodes the video once and guesses at what the required Q value should be. If, after the first pass, the file size is larger than it would have been if it had been encoded using CBR at the specified bit rate, the encoder decreases the Q value accordingly; if the file size is smaller than it would have been, the encoder increases the Q value.
The file is then re-encoded with a new Q value during the second pass to match (as closely as possible) the file size of what a CBR encode would produce. The formula to calculate the file size is easy enough:
Filesize (bytes) = (Bitrate (bps) / 8 x Time (in sec))
If, after the first pass, the encoder guesses correctly and the size of a VBR file is the same as that of a file encoded with CBR, then the average bit rate is the same for the two files. However, you are still left with the problem that the VBR file cannot be streamed over a network.
Peak-constrained, two-pass VBR
This mode is an attempt to solve the peak bit rate problem of VBR. It is a hybrid of CBR and VBR: based on 2PVBR, but using a buffer like CBR. You specify an average bit rate, a peak bit rate, and a buffer size. During complex sequences, the codec increases the bit rate, as it would with VBR. When the bit rate reaches the peak rate, however, the codec begins to fill the buffer, as it would if it was encoding in CBR mode. As the buffer fills, the codec decreases video quality or drops frames to maintain the bit rate below the peak rate.
In practice, peak-constrained two-pass VBR does not work as well as one may think. Extensive field testing has shown that if the peak bit rate value is not at least three times higher than the average bit rate value, the codec will actually drop more frames than if CBR had been used. This means that, on average, this method uses only about one-third of the available bandwidth, because the peak bit rate cannot be higher than the available bandwidth, and the average bit rate must be one-third of that.
The peak-constrained, two-pass VBR mode may be used on fixed media, such as DVD. In these cases, a lower average bit rate is required in order to fit content on a disc, but the peak transfer rate of data from the disc is substantially higher, though limited. However, this mode is not suitable for streaming.
Next: An all new encoding mode: KulaByte