         };
 
 
-        /** Get Avcc header from AVC stream. **/
+        /** Get Avcc header from AVC stream 
+        See ISO 14496-15, 5.2.4.1 for the description of AVCDecoderConfigurationRecord
+        **/
         public static function getAVCC(nalu:ByteArray,position:Number=0):ByteArray {
             // Find SPS and PPS units in AVC stream.
             var units:Array = AVC.getNALU(nalu,position,false);

                window = nalu.readUnsignedInt();
                // Match four-byte startcodes
                if((window & 0xFFFFFFFF) == 0x01) {
                    if(unit_start) {
                        units.push({
                            length: nalu.position - 4 - unit_start,
                            start: unit_start,


        /** H264 NAL unit names. **/
        public static const NAMES:Array = [
            'Unspecified',                  // 0
            'NDR',                          // 1
            'Partition A',                  // 2
            'Partition B',                  // 3
            'Partition C',                  // 4
            'IDR',                          // 5
            'SEI',                          // 6
            'SPS',                          // 7
            'PPS',                          // 8
            'AUD',                          // 9
            'End of Sequence',              // 10
            'End of Stream',                // 11
            'Filler Data'                   // 12
        ];
        /** H264 profiles. **/
        public static const PROFILES:Object = {
