FourCC (フォーシーシー) とは、データフォーマットを一意に識別するための4バイトの並びである(four-character code の意)。 Mac OS の OSType
概要
4バイトの識別子は、人間が読んで理解できる文字を使うことができ、32ビットの整数を1つ格納するのと同じ領域しか要しない(ただし、エンディアン問題は存在する)。
1985年、エレクトロニック・アーツは Interchange File Format (IFF) というメタフォーマットを提案し、最初は Amiga 向けに利用した。IFFに基づいたファイルは、「チャンク」の並びで構成され、各チャンクには任意のデータが格納されており、各チャンクの先頭に4バイトのIDが付与されていた。IFF仕様には、FourCC の起源がアップルであることが明確に記述されている。
IFF は広く採用され、例えばAppleの AIFF やマイクロソフトの RIFF(AVI や WAV のベース)がある。アップルは、このようなコードを OSType
と呼んだ。マイクロソフトや Windows 開発者は FourCC と呼んだ。マイクロソフトは DirectX(特に DirectShow と Direct3D)で使うデータフォーマットの識別にも FourCC を利用した。よく知られている例として、AVIファイルでのビデオコーデックの識別子がある。例えば、CVID、IV32、DIVX、XVID、H264、AVC1、WMV3といった識別子がある。音声コーデックについては、AVIファイルやWAVファイルは2バイトの識別子を使っており、文字列ではなく16進数で表記される(例えば、MP3のIDは 0055)。QuickTimeファイルでは、その2バイト識別子の前に 'ms' という文字が付与され、FourCC の形式になっている。RealMediaファイルでもFourCCを使っているが、具体的な識別子は AVI や QuickTime とは異なる。
4バイトの識別子を使っている他の主なファイルフォーマットとしては、MIDI、PNG、3DS、ICCプロファイルフォーマット、Quake III Arena のマップフォーマットなどがある。
Windows bitmapやDirectDraw (DirectDraw Surface) ではYUV色空間をサポートする際の識別子としてFourCCが使われる[1][2]。
脚注^ BITMAPINFOHEADER (wingdi.h) 。Microsoft Docs
^ DirectDraw and Color Space Conversion - Windows drivers 。Microsoft Docs
関連項目
マジックナンバー (フォーマット識別子)
Matroska
外部リンク
⇒FourCC.org - ビデオコーデックとピクセルフォーマットに関するサイト
⇒List of registered FOURCC Codes[リンク切れ] - 2003年9月現在(マイクロソフト)
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation.cs-ja1 q,.mw-parser-output .citation.cs-ja2 q{quotes:"「""」""『""』"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free a,.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited a,.mw-parser-output .id-lock-registration a,.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription a,.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:#d33}.mw-parser-output .cs1-visible-error{color:#d33}.mw-parser-output .cs1-maint{display:none;color:#3a3;margin-left:0.3em}.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}RFC 2361 - WAVE and AVI Codec Registries
WAVE and AVI Codec Registries - Section B Video Codecs from the Microsoft AVI Registry
⇒Standard for Interchange Format Files