A demonstration of GPU-accelerated playback of Hap movies using the QuickTime codec.
Objective-C C GLSL
Permalink
Failed to load latest commit information.
HapQuickTimePlayback Fix minimum size of window Jan 22, 2016
.gitignore Update .gitignore Jan 7, 2013
LICENSE Changed to Free BSD license. Mar 13, 2013
README.md Changed to Free BSD license. Mar 13, 2013

README.md

Hap QuickTime Playback Demo

A demonstration of GPU-accelerated playback of Hap movies using the QuickTime codec.

Hap is a video codec for fast decompression on modern graphics hardware. For general information about Hap, see the Hap project.

Accelerated Playback

Accelerated playback of Hap involves passing S3TC frames to graphics hardware using OpenGL. The Hap codec will emit S3TC frames when an application indicates it can handle them. This is done using the usual QuickTime playback mechanisms and if you are already using QuickTime the code overhead to support Hap is fairly low.

The Hap QuickTime codec must be installed.

The steps are

  1. Open a movie and examine its video track to confirm it is Hap
  2. Create a QTPixelBufferContext for playback using a list of custom pixel-format type constants
  3. Play the movie
  4. When you receive a frame, perform compressed texture upload using OpenGL
  5. If the movie is encoded with Hap Q, use a shader when you draw the texture

This example includes reusable code to aid the process. Steps 1. and 2. utilise

HapSupport.h
HapSupport.c

Steps 4. and 5. utilise

HapPixelBufferTexture.h
HapPixelBufferTexture.m
ScaledCoCgYToRGBA.vert
ScaledCoCgYToRGBA.frag

Further Reading

Open-Source

This code is open-source, licensed under a Free BSD License, meaning you can use it in your commercial or non-commercial applications free of charge.

This project was originally written by Tom Butterworth and commissioned by VIDVOX, 2012.