head	1.5;
access;
symbols
	file-4_20:1.5
	rpm-4_4_8-release:1.2.2.2
	rpm-4_4_7-release:1.2.2.2
	rpm-4_4_6-release:1.2.2.2
	rpm-4_4_5-release:1.2.2.2
	rpm-4_4_4-release:1.2.2.2
	rpm-4_4_3-release:1.2.2.2
	file-4_16:1.4
	jbj_before_tklcpatches:1.2.2.2
	rpm-4_4_2-release:1.2.2.2
	file-4_14:1.4
	pjones-sparse-experiment:1.3.0.2
	rpm-4_4_1-release:1.2.2.1
	file-4_12:1.3
	rpm-4_4-release:1.2
	rpm-4_4:1.2.0.2
	file-4_10:1.2
	file-4_09:1.2
	rpm-file-before:1.1
	rpm42-file-before:1.1
	rpm43-file-before:1.1
	rpm-4_3_1-start:1.1
	rpm-4_3:1.1.0.4
	rpm-4_2:1.1.0.2;
locks; strict;
comment	@# @;


1.5
date	2007.05.09.19.38.34;	author jbj;	state Exp;
branches;
next	1.4;

1.4
date	2005.07.16.21.06.32;	author jbj;	state Exp;
branches;
next	1.3;

1.3
date	2005.01.02.21.27.19;	author jbj;	state Exp;
branches;
next	1.2;

1.2
date	2004.08.03.20.16.18;	author jbj;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2003.04.15.16.58.35;	author jbj;	state Exp;
branches
	1.1.2.1
	1.1.4.1;
next	;

1.2.2.1
date	2005.01.03.02.02.55;	author jbj;	state Exp;
branches;
next	1.2.2.2;

1.2.2.2
date	2005.07.17.14.55.57;	author jbj;	state Exp;
branches;
next	1.2.2.3;

1.2.2.3
date	2007.05.10.17.39.22;	author jbj;	state Exp;
branches;
next	;

1.1.2.1
date	2003.12.01.21.20.02;	author jbj;	state Exp;
branches;
next	;

1.1.4.1
date	2004.12.07.00.57.38;	author jbj;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Virgin file-4.20.
@
text
@
#------------------------------------------------------------------------------
# animation:  file(1) magic for animation/movie formats
#
# animation formats
# MPEG, FLI, DL originally from vax@@ccwf.cc.utexas.edu (VaX#n8)
# FLC, SGI, Apple originally from Daniel Quinlan (quinlan@@yggdrasil.com)

# SGI and Apple formats
0	string		MOVI		Silicon Graphics movie file
4       string          moov            Apple QuickTime
>12     string          mvhd            \b movie (fast start)
>12     string          mdra            \b URL
>12     string          cmov            \b movie (fast start, compressed header)
>12     string          rmra            \b multiple URLs
4       string          mdat            Apple QuickTime movie (unoptimized)
4       string          wide            Apple QuickTime movie (unoptimized)
4       string          skip            Apple QuickTime movie (modified)
4       string          free            Apple QuickTime movie (modified)
4       string          idsc            Apple QuickTime image (fast start)
4       string          idat            Apple QuickTime image (unoptimized)
4       string          pckg            Apple QuickTime compressed archive
4	string/B	jP		JPEG 2000 image
4	string		ftyp		ISO Media
>8	string		isom		\b, MPEG v4 system, version 1
>8	string		iso2		\b, MPEG v4 system, part 12 revision
>8	string		mp41		\b, MPEG v4 system, version 1
>8	string		mp42		\b, MPEG v4 system, version 2
>8	string		mp7t		\b, MPEG v4 system, MPEG v7 XML
>8	string		mp7b		\b, MPEG v4 system, MPEG v7 binary XML
>8	string/B	jp2		\b, JPEG 2000
>8	string		3gp		\b, MPEG v4 system, 3GPP
>>11	byte		4		\b v4 (H.263/AMR GSM 6.10)
>>11	byte		5		\b v5 (H.263/AMR GSM 6.10)
>>11	byte		6		\b v6 (ITU H.264/AMR GSM 6.10)
>8	string		mmp4		\b, MPEG v4 system, 3GPP Mobile
>8	string		avc1		\b, MPEG v4 system, 3GPP JVT AVC
>8	string/B	M4A		\b, MPEG v4 system, iTunes AAC-LC
>8	string/B	M4P		\b, MPEG v4 system, iTunes AES encrypted
>8	string/B	M4B		\b, MPEG v4 system, iTunes bookmarked
>8	string/B	qt		\b, Apple QuickTime movie

# MPEG sequences
# Scans for all common MPEG header start codes
0        belong             0x00000001     JVT NAL sequence
>4       byte&0x1F          0x07           \b, H.264 video
>>5      byte               66             \b, baseline
>>5      byte               77             \b, main
>>5      byte               88             \b, extended
>>7      byte               x              \b @@ L %u
0        belong&0xFFFFFF00  0x00000100     MPEG sequence
>3       byte               0xBA
>>4      byte               &0x40          \b, v2, program multiplex
>>4      byte               ^0x40          \b, v1, system multiplex
>3       byte               0xBB           \b, v1/2, multiplex (missing pack header)
>3       byte&0x1F          0x07           \b, H.264 video
>>4      byte               66             \b, baseline
>>4      byte               77             \b, main
>>4      byte               88             \b, extended
>>6      byte               x              \b @@ L %u
>3       byte               0xB0           \b, v4
>>5      belong             0x000001B5
>>>9     byte               &0x80
>>>>10   byte&0xF0          16             \b, video
>>>>10   byte&0xF0          32             \b, still texture
>>>>10   byte&0xF0          48             \b, mesh
>>>>10   byte&0xF0          64             \b, face
>>>9     byte&0xF8          8              \b, video
>>>9     byte&0xF8          16             \b, still texture
>>>9     byte&0xF8          24             \b, mesh
>>>9     byte&0xF8          32             \b, face
>>4      byte               1              \b, simple @@ L1
>>4      byte               2              \b, simple @@ L2
>>4      byte               3              \b, simple @@ L3
>>4      byte               4              \b, simple @@ L0
>>4      byte               17             \b, simple scalable @@ L1
>>4      byte               18             \b, simple scalable @@ L2
>>4      byte               33             \b, core @@ L1
>>4      byte               34             \b, core @@ L2
>>4      byte               50             \b, main @@ L2
>>4      byte               51             \b, main @@ L3
>>4      byte               53             \b, main @@ L4
>>4      byte               66             \b, n-bit @@ L2
>>4      byte               81             \b, scalable texture @@ L1
>>4      byte               97             \b, simple face animation @@ L1
>>4      byte               98             \b, simple face animation @@ L2
>>4      byte               99             \b, simple face basic animation @@ L1
>>4      byte               100            \b, simple face basic animation @@ L2
>>4      byte               113            \b, basic animation text @@ L1
>>4      byte               114            \b, basic animation text @@ L2
>>4      byte               129            \b, hybrid @@ L1
>>4      byte               130            \b, hybrid @@ L2
>>4      byte               145            \b, advanced RT simple @@ L!
>>4      byte               146            \b, advanced RT simple @@ L2
>>4      byte               147            \b, advanced RT simple @@ L3
>>4      byte               148            \b, advanced RT simple @@ L4
>>4      byte               161            \b, core scalable @@ L1
>>4      byte               162            \b, core scalable @@ L2
>>4      byte               163            \b, core scalable @@ L3
>>4      byte               177            \b, advanced coding efficiency @@ L1
>>4      byte               178            \b, advanced coding efficiency @@ L2
>>4      byte               179            \b, advanced coding efficiency @@ L3
>>4      byte               180            \b, advanced coding efficiency @@ L4
>>4      byte               193            \b, advanced core @@ L1
>>4      byte               194            \b, advanced core @@ L2
>>4      byte               209            \b, advanced scalable texture @@ L1
>>4      byte               210            \b, advanced scalable texture @@ L2
>>4      byte               211            \b, advanced scalable texture @@ L3
>>4      byte               225            \b, simple studio @@ L1
>>4      byte               226            \b, simple studio @@ L2
>>4      byte               227            \b, simple studio @@ L3
>>4      byte               228            \b, simple studio @@ L4
>>4      byte               229            \b, core studio @@ L1
>>4      byte               230            \b, core studio @@ L2
>>4      byte               231            \b, core studio @@ L3
>>4      byte               232            \b, core studio @@ L4
>>4      byte               240            \b, advanced simple @@ L0
>>4      byte               241            \b, advanced simple @@ L1
>>4      byte               242            \b, advanced simple @@ L2
>>4      byte               243            \b, advanced simple @@ L3
>>4      byte               244            \b, advanced simple @@ L4
>>4      byte               245            \b, advanced simple @@ L5
>>4      byte               247            \b, advanced simple @@ L3b
>>4      byte               248            \b, FGS @@ L0
>>4      byte               249            \b, FGS @@ L1
>>4      byte               250            \b, FGS @@ L2
>>4      byte               251            \b, FGS @@ L3
>>4      byte               252            \b, FGS @@ L4
>>4      byte               253            \b, FGS @@ L5
>3       byte               0xB5           \b, v4
>>4      byte               &0x80
>>>5     byte&0xF0          16             \b, video (missing profile header)
>>>5     byte&0xF0          32             \b, still texture (missing profile header)
>>>5     byte&0xF0          48             \b, mesh (missing profile header)
>>>5     byte&0xF0          64             \b, face (missing profile header)
>>4      byte&0xF8          8              \b, video (missing profile header)
>>4      byte&0xF8          16             \b, still texture (missing profile header)
>>4      byte&0xF8          24             \b, mesh (missing profile header)
>>4      byte&0xF8          32             \b, face (missing profile header)
>3       byte               0xB3
>>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>12     belong             0x000001B5     \b, v2,
>>>16    byte&0x0F          1              \b HP
>>>16    byte&0x0F          2              \b Spt
>>>16    byte&0x0F          3              \b SNR
>>>16    byte&0x0F          4              \b MP
>>>16    byte&0x0F          5              \b SP
>>>17    byte&0xF0          64             \b@@HL
>>>17    byte&0xF0          96             \b@@H-14
>>>17    byte&0xF0          128            \b@@ML
>>>17    byte&0xF0          160            \b@@LL
>>>17    byte               &0x08          \b progressive
>>>17    byte               ^0x08          \b interlaced
>>>17    byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>17    byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>17    byte&0x06          6              \b Y'CbCr 4:4:4 video
>>11     byte               &0x02
>>>75    byte               &0x01
>>>>140  belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>>>140  belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>>>140  belong             0x000001B5     \b, v2,
>>>>>144 byte&0x0F          1              \b HP
>>>>>144 byte&0x0F          2              \b Spt
>>>>>144 byte&0x0F          3              \b SNR
>>>>>144 byte&0x0F          4              \b MP
>>>>>144 byte&0x0F          5              \b SP
>>>>>145 byte&0xF0          64             \b@@HL
>>>>>145 byte&0xF0          96             \b@@H-14
>>>>>145 byte&0xF0          128            \b@@ML
>>>>>145 byte&0xF0          160            \b@@LL
>>>>>145 byte               &0x08          \b progressive
>>>>>145 byte               ^0x08          \b interlaced
>>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>76    belong             0x000001B5     \b, v2,
>>>80   byte&0x0F          1              \b HP
>>>80   byte&0x0F          2              \b Spt
>>>80   byte&0x0F          3              \b SNR
>>>80   byte&0x0F          4              \b MP
>>>80   byte&0x0F          5              \b SP
>>>81   byte&0xF0          64             \b@@HL
>>>81   byte&0xF0          96             \b@@H-14
>>>81   byte&0xF0          128            \b@@ML
>>>81   byte&0xF0          160            \b@@LL
>>>81   byte               &0x08          \b progressive
>>>81   byte               ^0x08          \b interlaced
>>>81   byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>81   byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>81   byte&0x06          6              \b Y'CbCr 4:4:4 video
>>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
>>>7     byte&0xF0          0x10           \b, 16:9
>>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
>>>7     byte&0xF0          0x10           \b, 16:9
>>4      belong&0xFFFFFF00  0x30024000     \b, PAL Capture
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      beshort&0xFFF0     0x2C00         \b, 4CIF
>>>5     beshort&0x0FFF     0x01E0         \b NTSC
>>>5     beshort&0x0FFF     0x0240         \b PAL
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>>7     byte&0xF0          0x80           \b, PAL 4:3
>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
>>4      belong&0xFFFFFF00  0x2801E000     \b, LD-TV 640P
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      belong&0xFFFFFF00  0x1400F000     \b, 320x240
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      belong&0xFFFFFF00  0x0F00A000     \b, 240x160
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      belong&0xFFFFFF00  0x0A007800     \b, 160x120
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      beshort&0xFFF0     0x1600         \b, CIF
>>>5     beshort&0x0FFF     0x00F0         \b NTSC
>>>5     beshort&0x0FFF     0x0120         \b PAL
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>>7     byte&0xF0          0x80           \b, PAL 4:3
>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
>>>5     beshort&0x0FFF     0x0240         \b PAL 625
>>>>7    byte&0xF0          0x20           \b, 4:3
>>>>7    byte&0xF0          0x30           \b, 16:9
>>>>7    byte&0xF0          0x40           \b, 11:5
>>4      beshort&0xFFF0     0x2D00         \b, CCIR/ITU
>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
>>>5     beshort&0x0FFF     0x0240         \b PAL 625
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>4      beshort&0xFFF0     0x1E00         \b, SVCD
>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
>>>5     beshort&0x0FFF     0x0240         \b PAL 625
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>7      byte&0x0F          1              \b, 23.976 fps
>>7      byte&0x0F          2              \b, 24 fps
>>7      byte&0x0F          3              \b, 25 fps
>>7      byte&0x0F          4              \b, 29.97 fps
>>7      byte&0x0F          5              \b, 30 fps
>>7      byte&0x0F          6              \b, 50 fps
>>7      byte&0x0F          7              \b, 59.94 fps
>>7      byte&0x0F          8              \b, 60 fps
>>11     byte               &0x04          \b, Constrained

# MPEG ADTS Audio (*.mpx/mxa/aac)
# from dreesen@@math.fu-berlin.de
# modified to fully support MPEG ADTS

# MP3, M1A
0       beshort&0xFFFE  0xFFFA         MPEG ADTS, layer III, v1
# rates
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  40 kBits
>2      byte&0xF0       0x30           \b,  48 kBits
>2      byte&0xF0       0x40           \b,  56 kBits
>2      byte&0xF0       0x50           \b,  64 kBits
>2      byte&0xF0       0x60           \b,  80 kBits
>2      byte&0xF0       0x70           \b,  96 kBits
>2      byte&0xF0       0x80           \b, 112 kBits
>2      byte&0xF0       0x90           \b, 128 kBits
>2      byte&0xF0       0xA0           \b, 160 kBits
>2      byte&0xF0       0xB0           \b, 192 kBits
>2      byte&0xF0       0xC0           \b, 224 kBits
>2      byte&0xF0       0xD0           \b, 256 kBits
>2      byte&0xF0       0xE0           \b, 320 kBits
# timing
>2      byte&0x0C       0x00           \b, 44.1 kHz
>2      byte&0x0C       0x04           \b, 48 kHz
>2      byte&0x0C       0x08           \b, 32 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17

# MP2, M1A
0       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
# rates
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  48 kBits
>2      byte&0xF0       0x30           \b,  56 kBits
>2      byte&0xF0       0x40           \b,  64 kBits
>2      byte&0xF0       0x50           \b,  80 kBits
>2      byte&0xF0       0x60           \b,  96 kBits
>2      byte&0xF0       0x70           \b, 112 kBits
>2      byte&0xF0       0x80           \b, 128 kBits
>2      byte&0xF0       0x90           \b, 160 kBits
>2      byte&0xF0       0xA0           \b, 192 kBits
>2      byte&0xF0       0xB0           \b, 224 kBits
>2      byte&0xF0       0xC0           \b, 256 kBits
>2      byte&0xF0       0xD0           \b, 320 kBits
>2      byte&0xF0       0xE0           \b, 384 kBits
# timing
>2      byte&0x0C       0x00           \b, 44.1 kHz
>2      byte&0x0C       0x04           \b, 48 kHz
>2      byte&0x0C       0x08           \b, 32 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17

# MPA, M1A
# updated by Joerg Jenderek
# GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
0	beshort&0xFFFE		0xFFFE	
>2	ubyte&0xF0	>0x0F		
>>2	ubyte&0xF0	<0xE1		MPEG ADTS, layer I, v1
# rate
>>>2      byte&0xF0       0x10           \b,  32 kBits
>>>2      byte&0xF0       0x20           \b,  64 kBits
>>>2      byte&0xF0       0x30           \b,  96 kBits
>>>2      byte&0xF0       0x40           \b, 128 kBits
>>>2      byte&0xF0       0x50           \b, 160 kBits
>>>2      byte&0xF0       0x60           \b, 192 kBits
>>>2      byte&0xF0       0x70           \b, 224 kBits
>>>2      byte&0xF0       0x80           \b, 256 kBits
>>>2      byte&0xF0       0x90           \b, 288 kBits
>>>2      byte&0xF0       0xA0           \b, 320 kBits
>>>2      byte&0xF0       0xB0           \b, 352 kBits
>>>2      byte&0xF0       0xC0           \b, 384 kBits
>>>2      byte&0xF0       0xD0           \b, 416 kBits
>>>2      byte&0xF0       0xE0           \b, 448 kBits
# timing
>>>2      byte&0x0C       0x00           \b, 44.1 kHz
>>>2      byte&0x0C       0x04           \b, 48 kHz
>>>2      byte&0x0C       0x08           \b, 32 kHz
# channels/options
>>>3      byte&0xC0       0x00           \b, Stereo
>>>3      byte&0xC0       0x40           \b, JntStereo
>>>3      byte&0xC0       0x80           \b, 2x Monaural
>>>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17

# MP3, M2A
0       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
# rate
>2      byte&0xF0       0x10           \b,   8 kBits
>2      byte&0xF0       0x20           \b,  16 kBits
>2      byte&0xF0       0x30           \b,  24 kBits
>2      byte&0xF0       0x40           \b,  32 kBits
>2      byte&0xF0       0x50           \b,  40 kBits
>2      byte&0xF0       0x60           \b,  48 kBits
>2      byte&0xF0       0x70           \b,  56 kBits
>2      byte&0xF0       0x80           \b,  64 kBits
>2      byte&0xF0       0x90           \b,  80 kBits
>2      byte&0xF0       0xA0           \b,  96 kBits
>2      byte&0xF0       0xB0           \b, 112 kBits
>2      byte&0xF0       0xC0           \b, 128 kBits
>2      byte&0xF0       0xD0           \b, 144 kBits
>2      byte&0xF0       0xE0           \b, 160 kBits
# timing
>2      byte&0x0C       0x00           \b, 22.05 kHz
>2      byte&0x0C       0x04           \b, 24 kHz
>2      byte&0x0C       0x08           \b, 16 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17

# MP2, M2A
0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
# rate 
>2      byte&0xF0       0x10           \b,   8 kBits
>2      byte&0xF0       0x20           \b,  16 kBits 
>2      byte&0xF0       0x30           \b,  24 kBits
>2      byte&0xF0       0x40           \b,  32 kBits
>2      byte&0xF0       0x50           \b,  40 kBits
>2      byte&0xF0       0x60           \b,  48 kBits
>2      byte&0xF0       0x70           \b,  56 kBits
>2      byte&0xF0       0x80           \b,  64 kBits
>2      byte&0xF0       0x90           \b,  80 kBits
>2      byte&0xF0       0xA0           \b,  96 kBits
>2      byte&0xF0       0xB0           \b, 112 kBits
>2      byte&0xF0       0xC0           \b, 128 kBits
>2      byte&0xF0       0xD0           \b, 144 kBits
>2      byte&0xF0       0xE0           \b, 160 kBits
# timing
>2      byte&0x0C       0x00           \b, 22.05 kHz
>2      byte&0x0C       0x04           \b, 24 kHz
>2      byte&0x0C       0x08           \b, 16 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17

# MPA, M2A
0       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
# rate
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  48 kBits
>2      byte&0xF0       0x30           \b,  56 kBits
>2      byte&0xF0       0x40           \b,  64 kBits
>2      byte&0xF0       0x50           \b,  80 kBits
>2      byte&0xF0       0x60           \b,  96 kBits
>2      byte&0xF0       0x70           \b, 112 kBits
>2      byte&0xF0       0x80           \b, 128 kBits
>2      byte&0xF0       0x90           \b, 144 kBits
>2      byte&0xF0       0xA0           \b, 160 kBits
>2      byte&0xF0       0xB0           \b, 176 kBits
>2      byte&0xF0       0xC0           \b, 192 kBits
>2      byte&0xF0       0xD0           \b, 224 kBits
>2      byte&0xF0       0xE0           \b, 256 kBits
# timing
>2      byte&0x0C       0x00           \b, 22.05 kHz
>2      byte&0x0C       0x04           \b, 24 kHz
>2      byte&0x0C       0x08           \b, 16 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17

# MP3, M25A
0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
# rate  
>2      byte&0xF0       0x10           \b,   8 kBits
>2      byte&0xF0       0x20           \b,  16 kBits
>2      byte&0xF0       0x30           \b,  24 kBits
>2      byte&0xF0       0x40           \b,  32 kBits
>2      byte&0xF0       0x50           \b,  40 kBits
>2      byte&0xF0       0x60           \b,  48 kBits
>2      byte&0xF0       0x70           \b,  56 kBits
>2      byte&0xF0       0x80           \b,  64 kBits
>2      byte&0xF0       0x90           \b,  80 kBits
>2      byte&0xF0       0xA0           \b,  96 kBits
>2      byte&0xF0       0xB0           \b, 112 kBits
>2      byte&0xF0       0xC0           \b, 128 kBits
>2      byte&0xF0       0xD0           \b, 144 kBits
>2      byte&0xF0       0xE0           \b, 160 kBits
# timing
>2      byte&0x0C       0x00           \b, 11.025 kHz
>2      byte&0x0C       0x04           \b, 12 kHz
>2      byte&0x0C       0x08           \b, 8 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17

# AAC (aka MPEG-2 NBC audio) and MPEG-4 audio

# Stored AAC streams (instead of the MP4 format)
0       string          ADIF           MPEG ADIF, AAC
>4      byte            &0x80
>>13    byte            &0x10          \b, VBR
>>13    byte            ^0x10          \b, CBR
>>16    byte&0x1E       0x02           \b, single stream
>>16    byte&0x1E       0x04           \b, 2 streams
>>16    byte&0x1E       0x06           \b, 3 streams
>>16    byte            &0x08          \b, 4 or more streams
>>16    byte            &0x10          \b, 8 or more streams
>>4    byte            &0x80          \b, Copyrighted
>>13   byte            &0x40          \b, Original Source
>>13   byte            &0x20          \b, Home Flag
>4      byte            ^0x80
>>4     byte            &0x10          \b, VBR
>>4     byte            ^0x10          \b, CBR
>>7     byte&0x1E       0x02           \b, single stream
>>7     byte&0x1E       0x04           \b, 2 streams
>>7     byte&0x1E       0x06           \b, 3 streams
>>7     byte            &0x08          \b, 4 or more streams
>>7     byte            &0x10          \b, 8 or more streams
>>4    byte            &0x40          \b, Original Stream(s)
>>4    byte            &0x20          \b, Home Source

# Live or stored single AAC stream (used with MPEG-2 systems)
0       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
>1      byte            &0x08          \b, v2
>1      byte            ^0x08          \b, v4
# profile
>>2     byte            &0xC0          \b LTP
>2      byte&0xc0       0x00           \b Main
>2      byte&0xc0       0x40           \b LC
>2      byte&0xc0       0x80           \b SSR
# timing
>2      byte&0x3c       0x00           \b, 96 kHz
>2      byte&0x3c       0x04           \b, 88.2 kHz
>2      byte&0x3c       0x08           \b, 64 kHz
>2      byte&0x3c       0x0c           \b, 48 kHz
>2      byte&0x3c       0x10           \b, 44.1 kHz
>2      byte&0x3c       0x14           \b, 32 kHz
>2      byte&0x3c       0x18           \b, 24 kHz
>2      byte&0x3c       0x1c           \b, 22.05 kHz
>2      byte&0x3c       0x20           \b, 16 kHz
>2      byte&0x3c       0x24           \b, 12 kHz
>2      byte&0x3c       0x28           \b, 11.025 kHz
>2      byte&0x3c       0x2c           \b, 8 kHz
# channels
>2      beshort&0x01c0  0x0040         \b, monaural
>2      beshort&0x01c0  0x0080         \b, stereo
>2      beshort&0x01c0  0x00c0         \b, stereo + center
>2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
>2      beshort&0x01c0  0x0140         \b, surround
>2      beshort&0x01c0  0x0180         \b, surround + LFE
>2      beshort         &0x01C0        \b, surround + side
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Custom Flag
#>3     byte            &0x20           \b, Original Stream
#>3     byte            &0x10           \b, Home Source
#>3     byte            &0x08           \b, Copyrighted

# Live MPEG-4 audio streams (instead of RTP FlexMux)
0       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
#>1     beshort&0x1FFF  x              \b, %u byte packet
>3      byte&0xE0       0x40
>>4     byte&0x3C       0x04           \b, single stream
>>4     byte&0x3C       0x08           \b, 2 streams
>>4     byte&0x3C       0x0C           \b, 3 streams
>>4     byte            &0x08          \b, 4 or more streams
>>4     byte            &0x20          \b, 8 or more streams
>3      byte&0xC0       0
>>4     byte&0x78       0x08           \b, single stream
>>4     byte&0x78       0x10           \b, 2 streams
>>4     byte&0x78       0x18           \b, 3 streams
>>4     byte            &0x20          \b, 4 or more streams
>>4     byte            &0x40          \b, 8 or more streams
0       beshort         0x4DE1         MPEG-4 LO-EP audio stream

# FLI animation format
4	leshort		0xAF11			FLI file
>6	leshort		x			- %d frames,
>8	leshort		x			width=%d pixels,
>10	leshort		x			height=%d pixels,
>12	leshort		x			depth=%d,
>16	leshort		x			ticks/frame=%d
# FLC animation format
4	leshort		0xAF12			FLC file
>6	leshort		x			- %d frames
>8	leshort		x			width=%d pixels,
>10	leshort		x			height=%d pixels,
>12	leshort		x			depth=%d,
>16	leshort		x			ticks/frame=%d

# DL animation format
# XXX - collision with most `mips' magic
#
# I couldn't find a real magic number for these, however, this
# -appears- to work.  Note that it might catch other files, too, so be
# careful!
#
# Note that title and author appear in the two 20-byte chunks
# at decimal offsets 2 and 22, respectively, but they are XOR'ed with
# 255 (hex FF)!  The DL format is really bad.
#
#0	byte	1	DL version 1, medium format (160x100, 4 images/screen)
#>42	byte	x	- %d screens,
#>43	byte	x	%d commands
#0	byte	2	DL version 2
#>1	byte	1	- large format (320x200,1 image/screen),
#>1	byte	2	- medium format (160x100,4 images/screen),
#>1	byte	>2	- unknown format,
#>42	byte	x	%d screens,
#>43	byte	x	%d commands
# Based on empirical evidence, DL version 3 have several nulls following the
# \003.  Most of them start with non-null values at hex offset 0x34 or so.
#0	string	\3\0\0\0\0\0\0\0\0\0\0\0	DL version 3

# iso 13818 transport stream
#
# from Oskar Schirmer <schirmer@@scara.com> Feb 3, 2001 (ISO 13818.1)
# (the following is a little bit restrictive and works fine for a stream
#  that starts with PAT properly. it won't work for stream data, that is
#  cut from an input device data right in the middle, but this shouldn't
#  disturb)
# syncbyte      8 bit	0x47
# error_ind     1 bit	-
# payload_start 1 bit	1
# priority      1 bit	-
# PID          13 bit	0x0000
# scrambling    2 bit	-
# adaptfld_ctrl 2 bit	1 or 3
# conti_count   4 bit	0
0	belong&0xFF5FFF1F	0x47400010	MPEG transport stream data
>188	byte			!0x47		CORRUPTED

# DIF digital video file format <mpruett@@sgi.com>
0	belong&0xffffff00	0x1f070000      DIF
>4	byte			&0x01		(DVCPRO) movie file
>4	byte			^0x01		(DV) movie file
>3	byte			&0x80		(PAL)
>3	byte			^0x80		(NTSC)

# Microsoft Advanced Streaming Format (ASF) <mpruett@@sgi.com>
0	belong			0x3026b275	Microsoft ASF

# MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
0	string			\x8aMNG		MNG video data,
>4	belong			!0x0d0a1a0a	CORRUPTED,
>4	belong			0x0d0a1a0a
>>16    belong	x				%ld x
>>20    belong	x				%ld

# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
0	string			\x8bJNG		JNG video data,
>4	belong			!0x0d0a1a0a	CORRUPTED,
>4	belong			0x0d0a1a0a
>>16    belong	x				%ld x
>>20    belong	x				%ld

# Vivo video (Wolfram Kleff)
3	string		\x0D\x0AVersion:Vivo	Vivo video data

# VRML (Virtual Reality Modelling Language)
0       string/b        #VRML\ V1.0\ ascii	VRML 1 file
0	string/b	#VRML\ V2.0\ utf8	ISO/IEC 14772 VRML 97 file

#---------------------------------------------------------------------------
# HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
# From Mark Sheppard <msheppard@@climax.co.uk>, 2002-10-03
#
0	string		HVQM4		%s
>6	string		>\0		v%s
>0	byte		x		GameCube movie,
>0x34	ubeshort	x		%d x
>0x36	ubeshort	x		%d,
>0x26	ubeshort	x		%dµs,
>0x42	ubeshort	0		no audio
>0x42	ubeshort	>0		%dHz audio

# From: "Stefan A. Haubenthal" <polluks@@web.de>
0	string		DVDVIDEO-VTS	Video title set,
>0x21	byte		x		v%x
0	string		DVDVIDEO-VMG	Video manager,
>0x21	byte		x		v%x
@


1.4
log
@Update to virgin file-4.14.
@
text
@d323 5
a327 1
0       beshort&0xFFFE  0xFFFE         MPEG ADTS, layer I, v1
d329 14
a342 14
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  64 kBits
>2      byte&0xF0       0x30           \b,  96 kBits
>2      byte&0xF0       0x40           \b, 128 kBits
>2      byte&0xF0       0x50           \b, 160 kBits
>2      byte&0xF0       0x60           \b, 192 kBits
>2      byte&0xF0       0x70           \b, 224 kBits
>2      byte&0xF0       0x80           \b, 256 kBits
>2      byte&0xF0       0x90           \b, 288 kBits
>2      byte&0xF0       0xA0           \b, 320 kBits
>2      byte&0xF0       0xB0           \b, 352 kBits
>2      byte&0xF0       0xC0           \b, 384 kBits
>2      byte&0xF0       0xD0           \b, 416 kBits
>2      byte&0xF0       0xE0           \b, 448 kBits
d344 3
a346 3
>2      byte&0x0C       0x00           \b, 44.1 kHz
>2      byte&0x0C       0x04           \b, 48 kHz
>2      byte&0x0C       0x08           \b, 32 kHz
d348 4
a351 4
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
@


1.3
log
@Upgrade to file-4.12.
@
text
@d9 34
d45 6
d56 5
d68 4
a71 5
>>>9     byte               ^0x80
>>>>9    byte&0xF8          8              \b, video
>>>>9    byte&0xF8          16             \b, still texture
>>>>9    byte&0xF8          24             \b, mesh
>>>>9    byte&0xF8          32             \b, face
d136 4
a139 5
>>4      byte               ^0x80
>>>4     byte&0xF8          8              \b, video (missing profile header)
>>>4     byte&0xF8          16             \b, still texture (missing profile header)
>>>4     byte&0xF8          24             \b, mesh (missing profile header)
>>>4     byte&0xF8          32             \b, face (missing profile header)
d177 17
a193 17
>>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>>76    belong             0x000001B5     \b, v2,
>>>80    byte&0x0F          1              \b HP
>>>80    byte&0x0F          2              \b Spt
>>>80    byte&0x0F          3              \b SNR
>>>80    byte&0x0F          4              \b MP
>>>80    byte&0x0F          5              \b SP
>>>81    byte&0xF0          64             \b@@HL
>>>81    byte&0xF0          96             \b@@H-14
>>>81    byte&0xF0          128            \b@@ML
>>>81    byte&0xF0          160            \b@@LL
>>>81    byte               &0x08          \b progressive
>>>81    byte               ^0x08          \b interlaced
>>>81    byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>81    byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>81    byte&0x06          6              \b Y'CbCr 4:4:4 video
d280 7
a286 7
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17
d314 7
a320 7
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17
d348 7
a354 7
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17
d382 7
a388 7
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17
d416 7
a422 7
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17
d450 7
a456 7
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17
d484 7
a490 7
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17
d520 2
a521 2
>1      byte            ^0x08          \b, v2
>1      byte            &0x08          \b, v4
d524 3
a526 3
>2      byte&0xc0       0x00           \b, Main
>2      byte&0xc0       0x40           \b, LC
>2      byte&0xc0       0x80           \b, SSR
d540 1
a540 1
# channels/options
a609 29
# SGI formats
0	string		MOVI		Silicon Graphics movie file

# Apple Quicktime and ISO types
4       string          moov            Apple QuickTime
>12     string          mvhd            \b movie (fast start)
>12     string          mdra            \b URL
>12     string          cmov            \b movie (fast start, compressed header)
>12     string          rmra            \b multiple URLs
4       string          mdat            Apple QuickTime movie (unoptimized)
4       string          wide            Apple QuickTime movie (unoptimized)
4       string          skip            Apple QuickTime movie (modified)
4       string          free            Apple QuickTime movie (modified)
4       string          idsc            Apple QuickTime image (fast start)
4       string          idat            Apple QuickTime image (unoptimized)
4       string          pckg            Apple QuickTime compressed archive
4       string/B        jP              JPEG 2000 image
4       string          ftyp            ISO Media
>8      string          isom            \b, MPEG v4 system
>8      string          mp41            \b, MPEG v4 system, version 1
>8      string          mp42            \b, MPEG v4 system, version 2
>8      string/B        jp2             \b, JPEG 2000 image
>8      string          3gp             \b, MPEG v4 system, 3GPP (H.263/AMR)
>8      string          mmp4            \b, MPEG v4 system, Mobile
>8      string/B        M4A             \b, MPEG v4 system, iTunes AAC-LC
>8      string/B        M4P             \b, MPEG v4 system, ISMA encrypted AAC-LC
>8      string/B        M4B             \b, MPEG v4 system, iTunes AAC-LC/AMR
>8      string/B        qt              \b, Apple QuickTime movie

d671 6
@


1.2
log
@Upgrade to file-4.09.
@
text
@d9 197
a205 5
# MPEG animation format
0	belong		0x000001b3		MPEG video stream data
#>4	beshort&0xfff0	x			(%d x
#>5	beshort&0x0fff  x			%d)
0	belong		0x000001ba		MPEG system stream data
d207 1
a207 1
# MPEG Audio (*.mpx)
d209 1
d211 316
a526 108
# MPEG 1.0 Layer 3
0       beshort&0xfffe  =0xfffa         \bMP3
>2      byte&0xf0       =0x10           \b,  32 kBits
>2      byte&0xf0       =0x20           \b,  40 kBits
>2      byte&0xf0       =0x30           \b,  48 kBits
>2      byte&0xf0       =0x40           \b,  56 kBits
>2      byte&0xf0       =0x50           \b,  64 kBits
>2      byte&0xf0       =0x60           \b,  80 kBits
>2      byte&0xf0       =0x70           \b,  96 kBits
>2      byte&0xf0       =0x80           \b, 112 kBits
>2      byte&0xf0       =0x90           \b, 128 kBits
>2      byte&0xf0       =0xA0           \b, 160 kBits
>2      byte&0xf0       =0xB0           \b, 192 kBits
>2      byte&0xf0       =0xC0           \b, 224 kBits
>2      byte&0xf0       =0xD0           \b, 256 kBits
>2      byte&0xf0       =0xE0           \b, 320 kBits
# freq
>2      byte&0x0C       =0x00           \b, 44.1 kHz
>2      byte&0x0C       =0x04           \b, 48 kHz
>2      byte&0x0C       =0x08           \b, 32 kHz
# misc
>3      byte&0xC0       =0x00           \b, Stereo
>3      byte&0xC0       =0x40           \b, JStereo
>3      byte&0xC0       =0x80           \b, Dual-Ch
>3      byte&0xC0       =0xC0           \b, Mono
#>1     byte&0x01       =0x00           \b, Error Protection
#>2     byte&0x02       =0x02           \b, Padding
#>2     byte&0x01       =0x01           \b, Private
#>3     byte&0x08       =0x08           \b, Copyright
#>3     byte&0x04       =0x04           \b, Original
#>3     byte&0x03       1               \b, Emphasis 5
#>3     byte&0x03       3               \b, Emphasis c

# MPEG 1.0 Layer 2
0       beshort&0xfffe  =0xfffc         \bMP2
>2      byte&0xf0       =0x10           \b,  32 kBits
>2      byte&0xf0       =0x20           \b,  48 kBits
>2      byte&0xf0       =0x30           \b,  56 kBits
>2      byte&0xf0       =0x40           \b,  64 kBits
>2      byte&0xf0       =0x50           \b,  80 kBits
>2      byte&0xf0       =0x60           \b,  96 kBits
>2      byte&0xf0       =0x70           \b, 112 kBits
>2      byte&0xf0       =0x80           \b, 128 kBits
>2      byte&0xf0       =0x90           \b, 160 kBits
>2      byte&0xf0       =0xA0           \b, 192 kBits
>2      byte&0xf0       =0xB0           \b, 224 kBits
>2      byte&0xf0       =0xC0           \b, 256 kBits
>2      byte&0xf0       =0xD0           \b, 320 kBits
>2      byte&0xf0       =0xE0           \b, 384 kBits
# freq
>2      byte&0x0C       =0x00           \b, 44.1 kHz
>2      byte&0x0C       =0x04           \b, 48 kHz
>2      byte&0x0C       =0x08           \b, 32 kHz
# misc
>3      byte&0xC0       =0x00           \b, Stereo
>3      byte&0xC0       =0x40           \b, JStereo
>3      byte&0xC0       =0x80           \b, Dual-Ch
>3      byte&0xC0       =0xC0           \b, Mono
#>1     byte&0x01       =0x00           \b, Error Protection
#>2     byte&0x02       =0x02           \b, Padding
#>2     byte&0x01       =0x01           \b, Private
#>3     byte&0x08       =0x08           \b, Copyright
#>3     byte&0x04       =0x04           \b, Original
#>3     byte&0x03       1               \b, Emphasis 5
#>3     byte&0x03       3               \b, Emphasis c

# MPEG 2.0
0       beshort&0xfff8  =0xfff0         MP
# Layer 3
>1      byte            &0x02           \b3
# Layer 2
>1      byte            &0x04           \b2
>2      byte&0xf0       =0x10           \b,   8 kBits
>2      byte&0xf0       =0x20           \b,  16 kBits
>2      byte&0xf0       =0x30           \b,  24 kBits
>2      byte&0xf0       =0x40           \b,  32 kBits
>2      byte&0xf0       =0x50           \b,  40 kBits
>2      byte&0xf0       =0x60           \b,  48 kBits
>2      byte&0xf0       =0x70           \b,  56 kBits
>2      byte&0xf0       =0x80           \b,  64 kBits
>2      byte&0xf0       =0x90           \b,  80 kBits
>2      byte&0xf0       =0xA0           \b,  96 kBits
>2      byte&0xf0       =0xB0           \b, 112 kBits
>2      byte&0xf0       =0xC0           \b, 128 kBits
>2      byte&0xf0       =0xD0           \b, 144 kBits
>2      byte&0xf0       =0xE0           \b, 160 kBits
# freq
>2      byte&0x0C       =0x00           \b, 22.05 kHz
>2      byte&0x0C       =0x04           \b, 24 kHz
>2      byte&0x0C       =0x08           \b, 16 kHz
# misc
>3      byte&0xC0       =0x00           \b, Stereo
>3      byte&0xC0       =0x40           \b, JStereo
>3      byte&0xC0       =0x80           \b, Dual-Ch
>3      byte&0xC0       =0xC0           \b, Mono
#>1     byte&0x01       =0x00           \b, Error Protection
#>2     byte&0x02       =0x02           \b, Padding
#>2     byte&0x01       =0x01           \b, Private
#>3     byte&0x08       =0x08           \b, Copyright
#>3     byte&0x04       =0x04           \b, Original
#>3     byte&0x03       1               \b, Emphasis 5
#>3     byte&0x03       3               \b, Emphasis c

#From: Johan Gade <jgade@@diku.dk>

# MPEG-4 Advanced Audio Coding (AAC) file (perhaps also MPEG-2 ACC?)
16	string		M4A		MPEG-4 Advanced Audio Coding file (AAC)

d570 25
a594 10
# Apple Quicktime: Scan for all known top-level QT atom markers
4	string		moov		Apple QuickTime movie file (moov)
4	string		mdat		Apple QuickTime movie file (mdat)
4	string		ftyp		Apple QuickTime movie file (ftyp)
4	string		free		Apple QuickTime movie file (free)
4	string		junk		Apple QuickTime movie file (junk)
4	string		pnot		Apple QuickTime movie file (pnot)
4	string		skip		Apple QuickTime movie file (skip)
4	string		wide		Apple QuickTime movie file (wide)
4	string		pict		Apple QuickTime movie file (pict)
@


1.2.2.1
log
@Upgrade to file-4.12 (with RH patches).
@
text
@d9 5
a13 197
# MPEG sequences
# Scans for all common MPEG header start codes
0        belong&0xFFFFFF00  0x00000100     MPEG sequence
>3       byte               0xBA
>>4      byte               &0x40          \b, v2, program multiplex
>>4      byte               ^0x40          \b, v1, system multiplex
>3       byte               0xBB           \b, v1/2, multiplex (missing pack header)
>3       byte               0xB0           \b, v4
>>5      belong             0x000001B5
>>>9     byte               &0x80
>>>>10   byte&0xF0          16             \b, video
>>>>10   byte&0xF0          32             \b, still texture
>>>>10   byte&0xF0          48             \b, mesh
>>>>10   byte&0xF0          64             \b, face
>>>9     byte               ^0x80
>>>>9    byte&0xF8          8              \b, video
>>>>9    byte&0xF8          16             \b, still texture
>>>>9    byte&0xF8          24             \b, mesh
>>>>9    byte&0xF8          32             \b, face
>>4      byte               1              \b, simple @@ L1
>>4      byte               2              \b, simple @@ L2
>>4      byte               3              \b, simple @@ L3
>>4      byte               4              \b, simple @@ L0
>>4      byte               17             \b, simple scalable @@ L1
>>4      byte               18             \b, simple scalable @@ L2
>>4      byte               33             \b, core @@ L1
>>4      byte               34             \b, core @@ L2
>>4      byte               50             \b, main @@ L2
>>4      byte               51             \b, main @@ L3
>>4      byte               53             \b, main @@ L4
>>4      byte               66             \b, n-bit @@ L2
>>4      byte               81             \b, scalable texture @@ L1
>>4      byte               97             \b, simple face animation @@ L1
>>4      byte               98             \b, simple face animation @@ L2
>>4      byte               99             \b, simple face basic animation @@ L1
>>4      byte               100            \b, simple face basic animation @@ L2
>>4      byte               113            \b, basic animation text @@ L1
>>4      byte               114            \b, basic animation text @@ L2
>>4      byte               129            \b, hybrid @@ L1
>>4      byte               130            \b, hybrid @@ L2
>>4      byte               145            \b, advanced RT simple @@ L!
>>4      byte               146            \b, advanced RT simple @@ L2
>>4      byte               147            \b, advanced RT simple @@ L3
>>4      byte               148            \b, advanced RT simple @@ L4
>>4      byte               161            \b, core scalable @@ L1
>>4      byte               162            \b, core scalable @@ L2
>>4      byte               163            \b, core scalable @@ L3
>>4      byte               177            \b, advanced coding efficiency @@ L1
>>4      byte               178            \b, advanced coding efficiency @@ L2
>>4      byte               179            \b, advanced coding efficiency @@ L3
>>4      byte               180            \b, advanced coding efficiency @@ L4
>>4      byte               193            \b, advanced core @@ L1
>>4      byte               194            \b, advanced core @@ L2
>>4      byte               209            \b, advanced scalable texture @@ L1
>>4      byte               210            \b, advanced scalable texture @@ L2
>>4      byte               211            \b, advanced scalable texture @@ L3
>>4      byte               225            \b, simple studio @@ L1
>>4      byte               226            \b, simple studio @@ L2
>>4      byte               227            \b, simple studio @@ L3
>>4      byte               228            \b, simple studio @@ L4
>>4      byte               229            \b, core studio @@ L1
>>4      byte               230            \b, core studio @@ L2
>>4      byte               231            \b, core studio @@ L3
>>4      byte               232            \b, core studio @@ L4
>>4      byte               240            \b, advanced simple @@ L0
>>4      byte               241            \b, advanced simple @@ L1
>>4      byte               242            \b, advanced simple @@ L2
>>4      byte               243            \b, advanced simple @@ L3
>>4      byte               244            \b, advanced simple @@ L4
>>4      byte               245            \b, advanced simple @@ L5
>>4      byte               247            \b, advanced simple @@ L3b
>>4      byte               248            \b, FGS @@ L0
>>4      byte               249            \b, FGS @@ L1
>>4      byte               250            \b, FGS @@ L2
>>4      byte               251            \b, FGS @@ L3
>>4      byte               252            \b, FGS @@ L4
>>4      byte               253            \b, FGS @@ L5
>3       byte               0xB5           \b, v4
>>4      byte               &0x80
>>>5     byte&0xF0          16             \b, video (missing profile header)
>>>5     byte&0xF0          32             \b, still texture (missing profile header)
>>>5     byte&0xF0          48             \b, mesh (missing profile header)
>>>5     byte&0xF0          64             \b, face (missing profile header)
>>4      byte               ^0x80
>>>4     byte&0xF8          8              \b, video (missing profile header)
>>>4     byte&0xF8          16             \b, still texture (missing profile header)
>>>4     byte&0xF8          24             \b, mesh (missing profile header)
>>>4     byte&0xF8          32             \b, face (missing profile header)
>3       byte               0xB3
>>12     belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>12     belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>12     belong             0x000001B5     \b, v2,
>>>16    byte&0x0F          1              \b HP
>>>16    byte&0x0F          2              \b Spt
>>>16    byte&0x0F          3              \b SNR
>>>16    byte&0x0F          4              \b MP
>>>16    byte&0x0F          5              \b SP
>>>17    byte&0xF0          64             \b@@HL
>>>17    byte&0xF0          96             \b@@H-14
>>>17    byte&0xF0          128            \b@@ML
>>>17    byte&0xF0          160            \b@@LL
>>>17    byte               &0x08          \b progressive
>>>17    byte               ^0x08          \b interlaced
>>>17    byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>17    byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>17    byte&0x06          6              \b Y'CbCr 4:4:4 video
>>11     byte               &0x02
>>>75    byte               &0x01
>>>>140  belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>>>140  belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>>>140  belong             0x000001B5     \b, v2,
>>>>>144 byte&0x0F          1              \b HP
>>>>>144 byte&0x0F          2              \b Spt
>>>>>144 byte&0x0F          3              \b SNR
>>>>>144 byte&0x0F          4              \b MP
>>>>>144 byte&0x0F          5              \b SP
>>>>>145 byte&0xF0          64             \b@@HL
>>>>>145 byte&0xF0          96             \b@@H-14
>>>>>145 byte&0xF0          128            \b@@ML
>>>>>145 byte&0xF0          160            \b@@LL
>>>>>145 byte               &0x08          \b progressive
>>>>>145 byte               ^0x08          \b interlaced
>>>>>145 byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>>>145 byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>>>145 byte&0x06          6              \b Y'CbCr 4:4:4 video
>>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>>76    belong             0x000001B5     \b, v2,
>>>80    byte&0x0F          1              \b HP
>>>80    byte&0x0F          2              \b Spt
>>>80    byte&0x0F          3              \b SNR
>>>80    byte&0x0F          4              \b MP
>>>80    byte&0x0F          5              \b SP
>>>81    byte&0xF0          64             \b@@HL
>>>81    byte&0xF0          96             \b@@H-14
>>>81    byte&0xF0          128            \b@@ML
>>>81    byte&0xF0          160            \b@@LL
>>>81    byte               &0x08          \b progressive
>>>81    byte               ^0x08          \b interlaced
>>>81    byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>81    byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>81    byte&0x06          6              \b Y'CbCr 4:4:4 video
>>4      belong&0xFFFFFF00  0x78043800     \b, HD-TV 1920P
>>>7     byte&0xF0          0x10           \b, 16:9
>>4      belong&0xFFFFFF00  0x50002D00     \b, SD-TV 1280I
>>>7     byte&0xF0          0x10           \b, 16:9
>>4      belong&0xFFFFFF00  0x30024000     \b, PAL Capture
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      beshort&0xFFF0     0x2C00         \b, 4CIF
>>>5     beshort&0x0FFF     0x01E0         \b NTSC
>>>5     beshort&0x0FFF     0x0240         \b PAL
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>>7     byte&0xF0          0x80           \b, PAL 4:3
>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
>>4      belong&0xFFFFFF00  0x2801E000     \b, LD-TV 640P
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      belong&0xFFFFFF00  0x1400F000     \b, 320x240
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      belong&0xFFFFFF00  0x0F00A000     \b, 240x160
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      belong&0xFFFFFF00  0x0A007800     \b, 160x120
>>>7     byte&0xF0          0x10           \b, 4:3
>>4      beshort&0xFFF0     0x1600         \b, CIF
>>>5     beshort&0x0FFF     0x00F0         \b NTSC
>>>5     beshort&0x0FFF     0x0120         \b PAL
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>>7     byte&0xF0          0x80           \b, PAL 4:3
>>>7     byte&0xF0          0xC0           \b, NTSC 4:3
>>>5     beshort&0x0FFF     0x0240         \b PAL 625
>>>>7    byte&0xF0          0x20           \b, 4:3
>>>>7    byte&0xF0          0x30           \b, 16:9
>>>>7    byte&0xF0          0x40           \b, 11:5
>>4      beshort&0xFFF0     0x2D00         \b, CCIR/ITU
>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
>>>5     beshort&0x0FFF     0x0240         \b PAL 625
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>4      beshort&0xFFF0     0x1E00         \b, SVCD
>>>5     beshort&0x0FFF     0x01E0         \b NTSC 525
>>>5     beshort&0x0FFF     0x0240         \b PAL 625
>>>7     byte&0xF0          0x20           \b, 4:3
>>>7     byte&0xF0          0x30           \b, 16:9
>>>7     byte&0xF0          0x40           \b, 11:5
>>7      byte&0x0F          1              \b, 23.976 fps
>>7      byte&0x0F          2              \b, 24 fps
>>7      byte&0x0F          3              \b, 25 fps
>>7      byte&0x0F          4              \b, 29.97 fps
>>7      byte&0x0F          5              \b, 30 fps
>>7      byte&0x0F          6              \b, 50 fps
>>7      byte&0x0F          7              \b, 59.94 fps
>>7      byte&0x0F          8              \b, 60 fps
>>11     byte               &0x04          \b, Constrained
d15 1
a15 1
# MPEG ADTS Audio (*.mpx/mxa/aac)
a16 1
# modified to fully support MPEG ADTS
d18 108
a125 316
# MP3, M1A
0       beshort&0xFFFE  0xFFFA         MPEG ADTS, layer III, v1
# rates
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  40 kBits
>2      byte&0xF0       0x30           \b,  48 kBits
>2      byte&0xF0       0x40           \b,  56 kBits
>2      byte&0xF0       0x50           \b,  64 kBits
>2      byte&0xF0       0x60           \b,  80 kBits
>2      byte&0xF0       0x70           \b,  96 kBits
>2      byte&0xF0       0x80           \b, 112 kBits
>2      byte&0xF0       0x90           \b, 128 kBits
>2      byte&0xF0       0xA0           \b, 160 kBits
>2      byte&0xF0       0xB0           \b, 192 kBits
>2      byte&0xF0       0xC0           \b, 224 kBits
>2      byte&0xF0       0xD0           \b, 256 kBits
>2      byte&0xF0       0xE0           \b, 320 kBits
# timing
>2      byte&0x0C       0x00           \b, 44.1 kHz
>2      byte&0x0C       0x04           \b, 48 kHz
>2      byte&0x0C       0x08           \b, 32 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17

# MP2, M1A
0       beshort&0xFFFE  0xFFFC         MPEG ADTS, layer II, v1
# rates
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  48 kBits
>2      byte&0xF0       0x30           \b,  56 kBits
>2      byte&0xF0       0x40           \b,  64 kBits
>2      byte&0xF0       0x50           \b,  80 kBits
>2      byte&0xF0       0x60           \b,  96 kBits
>2      byte&0xF0       0x70           \b, 112 kBits
>2      byte&0xF0       0x80           \b, 128 kBits
>2      byte&0xF0       0x90           \b, 160 kBits
>2      byte&0xF0       0xA0           \b, 192 kBits
>2      byte&0xF0       0xB0           \b, 224 kBits
>2      byte&0xF0       0xC0           \b, 256 kBits
>2      byte&0xF0       0xD0           \b, 320 kBits
>2      byte&0xF0       0xE0           \b, 384 kBits
# timing
>2      byte&0x0C       0x00           \b, 44.1 kHz
>2      byte&0x0C       0x04           \b, 48 kHz
>2      byte&0x0C       0x08           \b, 32 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17

# MPA, M1A
0       beshort&0xFFFE  0xFFFE         MPEG ADTS, layer I, v1
# rate
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  64 kBits
>2      byte&0xF0       0x30           \b,  96 kBits
>2      byte&0xF0       0x40           \b, 128 kBits
>2      byte&0xF0       0x50           \b, 160 kBits
>2      byte&0xF0       0x60           \b, 192 kBits
>2      byte&0xF0       0x70           \b, 224 kBits
>2      byte&0xF0       0x80           \b, 256 kBits
>2      byte&0xF0       0x90           \b, 288 kBits
>2      byte&0xF0       0xA0           \b, 320 kBits
>2      byte&0xF0       0xB0           \b, 352 kBits
>2      byte&0xF0       0xC0           \b, 384 kBits
>2      byte&0xF0       0xD0           \b, 416 kBits
>2      byte&0xF0       0xE0           \b, 448 kBits
# timing
>2      byte&0x0C       0x00           \b, 44.1 kHz
>2      byte&0x0C       0x04           \b, 48 kHz
>2      byte&0x0C       0x08           \b, 32 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17

# MP3, M2A
0       beshort&0xFFFE  0xFFF2         MPEG ADTS, layer III, v2
# rate
>2      byte&0xF0       0x10           \b,   8 kBits
>2      byte&0xF0       0x20           \b,  16 kBits
>2      byte&0xF0       0x30           \b,  24 kBits
>2      byte&0xF0       0x40           \b,  32 kBits
>2      byte&0xF0       0x50           \b,  40 kBits
>2      byte&0xF0       0x60           \b,  48 kBits
>2      byte&0xF0       0x70           \b,  56 kBits
>2      byte&0xF0       0x80           \b,  64 kBits
>2      byte&0xF0       0x90           \b,  80 kBits
>2      byte&0xF0       0xA0           \b,  96 kBits
>2      byte&0xF0       0xB0           \b, 112 kBits
>2      byte&0xF0       0xC0           \b, 128 kBits
>2      byte&0xF0       0xD0           \b, 144 kBits
>2      byte&0xF0       0xE0           \b, 160 kBits
# timing
>2      byte&0x0C       0x00           \b, 22.05 kHz
>2      byte&0x0C       0x04           \b, 24 kHz
>2      byte&0x0C       0x08           \b, 16 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17

# MP2, M2A
0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
# rate 
>2      byte&0xF0       0x10           \b,   8 kBits
>2      byte&0xF0       0x20           \b,  16 kBits 
>2      byte&0xF0       0x30           \b,  24 kBits
>2      byte&0xF0       0x40           \b,  32 kBits
>2      byte&0xF0       0x50           \b,  40 kBits
>2      byte&0xF0       0x60           \b,  48 kBits
>2      byte&0xF0       0x70           \b,  56 kBits
>2      byte&0xF0       0x80           \b,  64 kBits
>2      byte&0xF0       0x90           \b,  80 kBits
>2      byte&0xF0       0xA0           \b,  96 kBits
>2      byte&0xF0       0xB0           \b, 112 kBits
>2      byte&0xF0       0xC0           \b, 128 kBits
>2      byte&0xF0       0xD0           \b, 144 kBits
>2      byte&0xF0       0xE0           \b, 160 kBits
# timing
>2      byte&0x0C       0x00           \b, 22.05 kHz
>2      byte&0x0C       0x04           \b, 24 kHz
>2      byte&0x0C       0x08           \b, 16 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17

# MPA, M2A
0       beshort&0xFFFE  0xFFF6         MPEG ADTS, layer I, v2
# rate
>2      byte&0xF0       0x10           \b,  32 kBits
>2      byte&0xF0       0x20           \b,  48 kBits
>2      byte&0xF0       0x30           \b,  56 kBits
>2      byte&0xF0       0x40           \b,  64 kBits
>2      byte&0xF0       0x50           \b,  80 kBits
>2      byte&0xF0       0x60           \b,  96 kBits
>2      byte&0xF0       0x70           \b, 112 kBits
>2      byte&0xF0       0x80           \b, 128 kBits
>2      byte&0xF0       0x90           \b, 144 kBits
>2      byte&0xF0       0xA0           \b, 160 kBits
>2      byte&0xF0       0xB0           \b, 176 kBits
>2      byte&0xF0       0xC0           \b, 192 kBits
>2      byte&0xF0       0xD0           \b, 224 kBits
>2      byte&0xF0       0xE0           \b, 256 kBits
# timing
>2      byte&0x0C       0x00           \b, 22.05 kHz
>2      byte&0x0C       0x04           \b, 24 kHz
>2      byte&0x0C       0x08           \b, 16 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17

# MP3, M25A
0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
# rate  
>2      byte&0xF0       0x10           \b,   8 kBits
>2      byte&0xF0       0x20           \b,  16 kBits
>2      byte&0xF0       0x30           \b,  24 kBits
>2      byte&0xF0       0x40           \b,  32 kBits
>2      byte&0xF0       0x50           \b,  40 kBits
>2      byte&0xF0       0x60           \b,  48 kBits
>2      byte&0xF0       0x70           \b,  56 kBits
>2      byte&0xF0       0x80           \b,  64 kBits
>2      byte&0xF0       0x90           \b,  80 kBits
>2      byte&0xF0       0xA0           \b,  96 kBits
>2      byte&0xF0       0xB0           \b, 112 kBits
>2      byte&0xF0       0xC0           \b, 128 kBits
>2      byte&0xF0       0xD0           \b, 144 kBits
>2      byte&0xF0       0xE0           \b, 160 kBits
# timing
>2      byte&0x0C       0x00           \b, 11.025 kHz
>2      byte&0x0C       0x04           \b, 12 kHz
>2      byte&0x0C       0x08           \b, 8 kHz
# channels/options
>3      byte&0xC0       0x00           \b, Stereo
>3      byte&0xC0       0x40           \b, JntStereo
>3      byte&0xC0       0x80           \b, 2x Monaural
>3      byte&0xC0       0xC0           \b, Monaural
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Packet Pad
#>2     byte            &0x01           \b, Custom Flag
#>3     byte            &0x08           \b, Copyrighted
#>3     byte            &0x04           \b, Original Source
#>3     byte&0x03       1               \b, NR: 50/15 ms
#>3     byte&0x03       3               \b, NR: CCIT J.17

# AAC (aka MPEG-2 NBC audio) and MPEG-4 audio

# Stored AAC streams (instead of the MP4 format)
0       string          ADIF           MPEG ADIF, AAC
>4      byte            &0x80
>>13    byte            &0x10          \b, VBR
>>13    byte            ^0x10          \b, CBR
>>16    byte&0x1E       0x02           \b, single stream
>>16    byte&0x1E       0x04           \b, 2 streams
>>16    byte&0x1E       0x06           \b, 3 streams
>>16    byte            &0x08          \b, 4 or more streams
>>16    byte            &0x10          \b, 8 or more streams
>>4    byte            &0x80          \b, Copyrighted
>>13   byte            &0x40          \b, Original Source
>>13   byte            &0x20          \b, Home Flag
>4      byte            ^0x80
>>4     byte            &0x10          \b, VBR
>>4     byte            ^0x10          \b, CBR
>>7     byte&0x1E       0x02           \b, single stream
>>7     byte&0x1E       0x04           \b, 2 streams
>>7     byte&0x1E       0x06           \b, 3 streams
>>7     byte            &0x08          \b, 4 or more streams
>>7     byte            &0x10          \b, 8 or more streams
>>4    byte            &0x40          \b, Original Stream(s)
>>4    byte            &0x20          \b, Home Source

# Live or stored single AAC stream (used with MPEG-2 systems)
0       beshort&0xFFF6  0xFFF0         MPEG ADTS, AAC
>1      byte            ^0x08          \b, v2
>1      byte            &0x08          \b, v4
# profile
>>2     byte            &0xC0          \b LTP
>2      byte&0xc0       0x00           \b, Main
>2      byte&0xc0       0x40           \b, LC
>2      byte&0xc0       0x80           \b, SSR
# timing
>2      byte&0x3c       0x00           \b, 96 kHz
>2      byte&0x3c       0x04           \b, 88.2 kHz
>2      byte&0x3c       0x08           \b, 64 kHz
>2      byte&0x3c       0x0c           \b, 48 kHz
>2      byte&0x3c       0x10           \b, 44.1 kHz
>2      byte&0x3c       0x14           \b, 32 kHz
>2      byte&0x3c       0x18           \b, 24 kHz
>2      byte&0x3c       0x1c           \b, 22.05 kHz
>2      byte&0x3c       0x20           \b, 16 kHz
>2      byte&0x3c       0x24           \b, 12 kHz
>2      byte&0x3c       0x28           \b, 11.025 kHz
>2      byte&0x3c       0x2c           \b, 8 kHz
# channels/options
>2      beshort&0x01c0  0x0040         \b, monaural
>2      beshort&0x01c0  0x0080         \b, stereo
>2      beshort&0x01c0  0x00c0         \b, stereo + center
>2      beshort&0x01c0  0x0100         \b, stereo+center+LFE
>2      beshort&0x01c0  0x0140         \b, surround
>2      beshort&0x01c0  0x0180         \b, surround + LFE
>2      beshort         &0x01C0        \b, surround + side
#>1     byte            ^0x01           \b, Data Verify
#>2     byte            &0x02           \b, Custom Flag
#>3     byte            &0x20           \b, Original Stream
#>3     byte            &0x10           \b, Home Source
#>3     byte            &0x08           \b, Copyrighted

# Live MPEG-4 audio streams (instead of RTP FlexMux)
0       beshort&0xFFE0  0x56E0         MPEG-4 LOAS
#>1     beshort&0x1FFF  x              \b, %u byte packet
>3      byte&0xE0       0x40
>>4     byte&0x3C       0x04           \b, single stream
>>4     byte&0x3C       0x08           \b, 2 streams
>>4     byte&0x3C       0x0C           \b, 3 streams
>>4     byte            &0x08          \b, 4 or more streams
>>4     byte            &0x20          \b, 8 or more streams
>3      byte&0xC0       0
>>4     byte&0x78       0x08           \b, single stream
>>4     byte&0x78       0x10           \b, 2 streams
>>4     byte&0x78       0x18           \b, 3 streams
>>4     byte            &0x20          \b, 4 or more streams
>>4     byte            &0x40          \b, 8 or more streams
0       beshort         0x4DE1         MPEG-4 LO-EP audio stream
d169 10
a178 25
# Apple Quicktime and ISO types
4       string          moov            Apple QuickTime
>12     string          mvhd            \b movie (fast start)
>12     string          mdra            \b URL
>12     string          cmov            \b movie (fast start, compressed header)
>12     string          rmra            \b multiple URLs
4       string          mdat            Apple QuickTime movie (unoptimized)
4       string          wide            Apple QuickTime movie (unoptimized)
4       string          skip            Apple QuickTime movie (modified)
4       string          free            Apple QuickTime movie (modified)
4       string          idsc            Apple QuickTime image (fast start)
4       string          idat            Apple QuickTime image (unoptimized)
4       string          pckg            Apple QuickTime compressed archive
4       string/B        jP              JPEG 2000 image
4       string          ftyp            ISO Media
>8      string          isom            \b, MPEG v4 system
>8      string          mp41            \b, MPEG v4 system, version 1
>8      string          mp42            \b, MPEG v4 system, version 2
>8      string/B        jp2             \b, JPEG 2000 image
>8      string          3gp             \b, MPEG v4 system, 3GPP (H.263/AMR)
>8      string          mmp4            \b, MPEG v4 system, Mobile
>8      string/B        M4A             \b, MPEG v4 system, iTunes AAC-LC
>8      string/B        M4P             \b, MPEG v4 system, ISMA encrypted AAC-LC
>8      string/B        M4B             \b, MPEG v4 system, iTunes AAC-LC/AMR
>8      string/B        qt              \b, Apple QuickTime movie
@


1.2.2.2
log
@- upgrade to file-4.14 internal.
@
text
@a8 34
# SGI and Apple formats
0	string		MOVI		Silicon Graphics movie file
4       string          moov            Apple QuickTime
>12     string          mvhd            \b movie (fast start)
>12     string          mdra            \b URL
>12     string          cmov            \b movie (fast start, compressed header)
>12     string          rmra            \b multiple URLs
4       string          mdat            Apple QuickTime movie (unoptimized)
4       string          wide            Apple QuickTime movie (unoptimized)
4       string          skip            Apple QuickTime movie (modified)
4       string          free            Apple QuickTime movie (modified)
4       string          idsc            Apple QuickTime image (fast start)
4       string          idat            Apple QuickTime image (unoptimized)
4       string          pckg            Apple QuickTime compressed archive
4	string/B	jP		JPEG 2000 image
4	string		ftyp		ISO Media
>8	string		isom		\b, MPEG v4 system, version 1
>8	string		iso2		\b, MPEG v4 system, part 12 revision
>8	string		mp41		\b, MPEG v4 system, version 1
>8	string		mp42		\b, MPEG v4 system, version 2
>8	string		mp7t		\b, MPEG v4 system, MPEG v7 XML
>8	string		mp7b		\b, MPEG v4 system, MPEG v7 binary XML
>8	string/B	jp2		\b, JPEG 2000
>8	string		3gp		\b, MPEG v4 system, 3GPP
>>11	byte		4		\b v4 (H.263/AMR GSM 6.10)
>>11	byte		5		\b v5 (H.263/AMR GSM 6.10)
>>11	byte		6		\b v6 (ITU H.264/AMR GSM 6.10)
>8	string		mmp4		\b, MPEG v4 system, 3GPP Mobile
>8	string		avc1		\b, MPEG v4 system, 3GPP JVT AVC
>8	string/B	M4A		\b, MPEG v4 system, iTunes AAC-LC
>8	string/B	M4P		\b, MPEG v4 system, iTunes AES encrypted
>8	string/B	M4B		\b, MPEG v4 system, iTunes bookmarked
>8	string/B	qt		\b, Apple QuickTime movie

a10 6
0        belong             0x00000001     JVT NAL sequence
>4       byte&0x1F          0x07           \b, H.264 video
>>5      byte               66             \b, baseline
>>5      byte               77             \b, main
>>5      byte               88             \b, extended
>>7      byte               x              \b @@ L %u
a15 5
>3       byte&0x1F          0x07           \b, H.264 video
>>4      byte               66             \b, baseline
>>4      byte               77             \b, main
>>4      byte               88             \b, extended
>>6      byte               x              \b @@ L %u
d23 5
a27 4
>>>9     byte&0xF8          8              \b, video
>>>9     byte&0xF8          16             \b, still texture
>>>9     byte&0xF8          24             \b, mesh
>>>9     byte&0xF8          32             \b, face
d92 5
a96 4
>>4      byte&0xF8          8              \b, video (missing profile header)
>>4      byte&0xF8          16             \b, still texture (missing profile header)
>>4      byte&0xF8          24             \b, mesh (missing profile header)
>>4      byte&0xF8          32             \b, face (missing profile header)
d134 17
a150 17
>>76    belong             0x000001B8     \b, v1, progressive Y'CbCr 4:2:0 video
>>76    belong             0x000001B2     \b, v1, progressive Y'CbCr 4:2:0 video
>>76    belong             0x000001B5     \b, v2,
>>>80   byte&0x0F          1              \b HP
>>>80   byte&0x0F          2              \b Spt
>>>80   byte&0x0F          3              \b SNR
>>>80   byte&0x0F          4              \b MP
>>>80   byte&0x0F          5              \b SP
>>>81   byte&0xF0          64             \b@@HL
>>>81   byte&0xF0          96             \b@@H-14
>>>81   byte&0xF0          128            \b@@ML
>>>81   byte&0xF0          160            \b@@LL
>>>81   byte               &0x08          \b progressive
>>>81   byte               ^0x08          \b interlaced
>>>81   byte&0x06          2              \b Y'CbCr 4:2:0 video
>>>81   byte&0x06          4              \b Y'CbCr 4:2:2 video
>>>81   byte&0x06          6              \b Y'CbCr 4:4:4 video
d237 7
a243 7
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17
d271 7
a277 7
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17
d305 7
a311 7
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17
d339 7
a345 7
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17
d373 7
a379 7
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17
d407 7
a413 7
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17
d441 7
a447 7
#>1     byte            ^0x01          \b, Data Verify
#>2     byte            &0x02          \b, Packet Pad
#>2     byte            &0x01          \b, Custom Flag
#>3     byte            &0x08          \b, Copyrighted
#>3     byte            &0x04          \b, Original Source
#>3     byte&0x03       1              \b, NR: 50/15 ms
#>3     byte&0x03       3              \b, NR: CCIT J.17
d477 2
a478 2
>1      byte            &0x08          \b, v2
>1      byte            ^0x08          \b, v4
d481 3
a483 3
>2      byte&0xc0       0x00           \b Main
>2      byte&0xc0       0x40           \b LC
>2      byte&0xc0       0x80           \b SSR
d497 1
a497 1
# channels
d567 29
a656 6

# From: "Stefan A. Haubenthal" <polluks@@web.de>
0	string		DVDVIDEO-VTS	Video title set,
>0x21	byte		x		v%x
0	string		DVDVIDEO-VMG	Video manager,
>0x21	byte		x		v%x
@


1.2.2.3
log
@Upgrade to file-4.20 internal.
@
text
@d323 1
a323 5
# updated by Joerg Jenderek
# GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
0	beshort&0xFFFE		0xFFFE	
>2	ubyte&0xF0	>0x0F		
>>2	ubyte&0xF0	<0xE1		MPEG ADTS, layer I, v1
d325 14
a338 14
>>>2      byte&0xF0       0x10           \b,  32 kBits
>>>2      byte&0xF0       0x20           \b,  64 kBits
>>>2      byte&0xF0       0x30           \b,  96 kBits
>>>2      byte&0xF0       0x40           \b, 128 kBits
>>>2      byte&0xF0       0x50           \b, 160 kBits
>>>2      byte&0xF0       0x60           \b, 192 kBits
>>>2      byte&0xF0       0x70           \b, 224 kBits
>>>2      byte&0xF0       0x80           \b, 256 kBits
>>>2      byte&0xF0       0x90           \b, 288 kBits
>>>2      byte&0xF0       0xA0           \b, 320 kBits
>>>2      byte&0xF0       0xB0           \b, 352 kBits
>>>2      byte&0xF0       0xC0           \b, 384 kBits
>>>2      byte&0xF0       0xD0           \b, 416 kBits
>>>2      byte&0xF0       0xE0           \b, 448 kBits
d340 3
a342 3
>>>2      byte&0x0C       0x00           \b, 44.1 kHz
>>>2      byte&0x0C       0x04           \b, 48 kHz
>>>2      byte&0x0C       0x08           \b, 32 kHz
d344 4
a347 4
>>>3      byte&0xC0       0x00           \b, Stereo
>>>3      byte&0xC0       0x40           \b, JntStereo
>>>3      byte&0xC0       0x80           \b, 2x Monaural
>>>3      byte&0xC0       0xC0           \b, Monaural
@


1.1
log
@Move magic creation to sub-directory.
@
text
@d121 6
d166 1
a166 1
# SGI and Apple formats
d168 2
d172 7
d212 29
@


1.1.4.1
log
@- port to internal file-4.10 libmagic rather than libfmagic.
@
text
@a120 6
#From: Johan Gade <jgade@@diku.dk>

# MPEG-4 Advanced Audio Coding (AAC) file (perhaps also MPEG-2 ACC?)
16	string		M4A		MPEG-4 Advanced Audio Coding file (AAC)


d160 1
a160 1
# SGI formats
a161 2

# Apple Quicktime: Scan for all known top-level QT atom markers
a163 7
4	string		ftyp		Apple QuickTime movie file (ftyp)
4	string		free		Apple QuickTime movie file (free)
4	string		junk		Apple QuickTime movie file (junk)
4	string		pnot		Apple QuickTime movie file (pnot)
4	string		skip		Apple QuickTime movie file (skip)
4	string		wide		Apple QuickTime movie file (wide)
4	string		pict		Apple QuickTime movie file (pict)
a196 29
>>16    belong	x				%ld x
>>20    belong	x				%ld

# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
0	string			\x8bJNG		JNG video data,
>4	belong			!0x0d0a1a0a	CORRUPTED,
>4	belong			0x0d0a1a0a
>>16    belong	x				%ld x
>>20    belong	x				%ld

# Vivo video (Wolfram Kleff)
3	string		\x0D\x0AVersion:Vivo	Vivo video data

# VRML (Virtual Reality Modelling Language)
0       string/b        #VRML\ V1.0\ ascii	VRML 1 file
0	string/b	#VRML\ V2.0\ utf8	ISO/IEC 14772 VRML 97 file

#---------------------------------------------------------------------------
# HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
# From Mark Sheppard <msheppard@@climax.co.uk>, 2002-10-03
#
0	string		HVQM4		%s
>6	string		>\0		v%s
>0	byte		x		GameCube movie,
>0x34	ubeshort	x		%d x
>0x36	ubeshort	x		%d,
>0x26	ubeshort	x		%dµs,
>0x42	ubeshort	0		no audio
>0x42	ubeshort	>0		%dHz audio
@


1.1.2.1
log
@Merge from top-of-stack.
@
text
@@

