Monday, May 16, 2011

Mobile video 102: lossless and lossy compression

Mobile video as a technology and market segment can at times be a little complicated.
Here is simple syllabus, in no particular order of what you need to know to be conversant in mobile video. It is not intended to be exhaustive or to be very detailed, but rather to provide a knowledge base for those interested in understanding more the market dynamics I address in other posts.

Compression (lossless) and optimization (lossy)
  • Compression is the action of reducing the size of the representation of a media object without loosing data. It is lossless when, after decompression, a compressed media is absolutely equal to the original. Compression methods are based on statistical analysis, to represent recurrent data items within a file. PNG, GIF, Zip, gzip and deflate are lossless compression formats. Throttling, just-in-time delivery and caching are lossless delivery methods.
  • Optimization is a form of compression called lossy in the sense that it discards data elements to achieve reduced size. The optimized version is not identical to the original. Transcoding, transrating are lossy methods.
Lossy optimization methods:
  • Frame per second (fps)A video is composed of  a number of still frames (pictures). The illusion of movement is achieved after 15 frame per second. TV is 24 to 30 fps (depending on the standard and whether it is progressive or interlaced). Many lossy optimization method will reduce the frame per second ratio in order to reduce the size of a file.
    • key frame: Not all frames contain the same amount of data in video optimization. The main way to reduce the quantity of information in a video is to use statistical analysis to predict motion. In other words, analyse differences between one frame to the following. Most optimization method will model only the difference between a frame and the next one, therefore not coding all the information. Key frames or Intra frames are the frames used as reference. When lossy optimization is performed using fps reduction, one has to be careful not to remove the key frames or the user experience will be garbled with many artifacts.
  • Bit rates: Bit rate is the rate at which a video is encoded (quality) or transmitted. 
    • Encoding bit rate:The encoding bit rate represent the amount of information that is captured in each frame. It is measured in kbps or (kilobit per second) Mbps (Megabit per second). HD video is encoded at 20Mbps, SD at 10 Mbps, internet video usually around 1Mbps and video transmitted on wireless between 200 and 700 kbps.
      • Variable bit rate (VBR) or transrating is a lossy optimization method that will vary the encoding bit rate throughout the video to take into account lossy network conditions.
      • Constant bit rate is used for broadcast, fixed line connection and generally lossless transmissions.
    • Delivery bit rate: When a video is transmitted over a wireless network, the connection capacity dictates the user experience. The bit rate of delivery should always exceed the bit rate of encoding of the video for smooth viewing. If the delivery bit rate goes below the encoding bit rate, buffering, stop and go is experienced. Lossy optimization techniques such as VBR allow to reduce the encoding bit rate in real time, as the delivery bit rate varies.
  • Transcoding is the action of decoding a video file and recoding it under a different format. This lossy method is effective to reduce a video file from a definition, format that are not suitable for mobile transmission (HD, 3D...). Additionally, a lot of size saving can be operated by changing the aspect ratio (4:3 or 16:9 from TV) or changing the picture size (HD 1080 is 1920 x 1080 pixels, while most smartphones WVGA are 800 x 480 pixels). You can reduce drastically a video file size by changing the picture size.
  • Transprotocol is the action to change the protocol used for video transmission. For instance, many legacy phones that do not support progressive download cannot access internet video unless they are transprotocoled to RTSP.

No comments: