article

資源交換檔案標準(Resource Interchange File Format) (RIFF) 是一種把資料儲存在被標記的區塊(tagged chunks)中的檔案格式(meta-format). 它是在1991年時, 由 MicrosoftIBM]提出. 它是Electronic Arts在1985提出的 Interchange File Format的翻版. 這兩種標準的唯一不同處是在多位元整數的儲存方式. RIFF使用的是 little-endian , 這是 IBM PC 使用的處理器80x86 所使用的格式, 而IFF儲存整數的方式是使用 big-endian , 這是 AmigaApple Macintosh 電腦使用的處理器, 68k ,可處理的整數型態.

MicrosoftAVIWAV這兩種著名的檔案格式中, 都使用RIFF的格式當成它們的基礎.

RIFF檔案由一個簡單的表頭(header)跟隨著多個 "chunks"所組. 其格式完全跟IFF一樣, 除整數的儲存方式不一樣以外.

  • 表頭(Header)
    • 4 位元組(bytes): 固定為"RIFF".
    • 4 位元組: little-endian 32-bit 正整數, 整個檔案的大小, 扣掉辨識字元和長度, 共8個位元組.
    • 4 位元組: 這個檔案的型態字元, 例如: "AVI " 或 "WAVE".
  • Chunks follow from here on. Each chunk consists of
    • 4 bytes: An ASCII identifier for this chunk, e.g. "fmt " or "data"
    • 4 bytes: an unsigned, little-endian 32-bit integer with the length of this chunk (except this field itself and the chunk identifier).
    • Variable-sized field: the chunk data itself, of the size given in the previous field.
    • A pad byte, if the chunk's length is not even.

More information about the format can be found in the Interchange File Format article.

See also


External links


文件类型

Resource Interchange File Format | RIFF | Resource File Interchange Format | RIFF

 

This article is licensed under the GNU Free Documentation License. It uses material from the "RIFF".

Home Pageartsbusinesscomputersgameshealthhospitalshomekids & teensnewsphysiciansrecreationreferenceregionalscienceshoppingsocietysportsworld