Internet DRAFT - draft-atarius-cmf
draft-atarius-cmf
Internet Draft: Compact Media Format R. Atarius, Editor
Document: draft-atarius-cmf-00.txt Qualcomm
Expires: January 2005 July 2004
The Compact Media Format (CMF) Presentation (Syntax)
Status of this Memo
By submitting this Internet-Draft, I certify that any applicable
patent or other IPR claims of which I am aware have been disclosed
and any of which I become aware will be disclosed, in accordance
with RFC 3668 (BCP 79).
By submitting this Internet-Draft, I accept the provisions of
Section 3 of RFC 3667 (BCP 78).
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six
months and may be updated, replaced, or obsoleted by other documents
at any time. It is inappropriate to use Internet-Drafts as
reference material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt The list of
Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.
Copyright Notice
Copyright (C) The Internet Society (2004). All Rights Reserved.
Abstract
This document specifies a binary format container for multimedia
elements with embedded time synchronization information. This
syntax is called Compact Media Format (CMF) and can be employed to
create a multimedia presentation with sound, music, picture,
animation, etc. in messaging and other applications.
CMF is optimized for small size and efficient use in 3G wireless
networks and is currently deployed in cdma2000(r) networks.
Atarius, Editor Expires January 2005 [Page 1]
Internet Draft Compact Media Format (CMF) July 2004
CMF media may be received, generated, or stored by
Internet-connected devices such as cellphones, laptops, PDAs,
desktops, servers, etc. for various applications.
Typical applications of CMF include
* Audio postcard messages with speech and images
* Animated cartoons with MIDI, text and speech
* Advertisements with graphics, text and audio
* Karaoke with graphics
* Multimedia ringers with graphics, text, MIDI and speech
1. Conventions Used in this Document . . . . . . . . . . . . . 2
2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
3 Description of CMF Content . . . . . . . . . . . . . . . . . 3
4 Formal Syntax of CMF Content . . . . . . . . . . . . . . . . 4
5 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1 TimeBase . . . . . . . . . . . . . . . . . . . . . . . . 22
5.2 Pitch Bend . . . . . . . . . . . . . . . . . . . . . . . 22
5.3 Fine Pitch Bend . . . . . . . . . . . . . . . . . . . . 23
6 CMF Profiles . . . . . . . . . . . . . . . . . . . . . . . . 24
6.1 Talking Picture Messaging . . . . . . . . . . . . . . . 24
6.2 Audio-only Profile . . . . . . . . . . . . . . . . . . . 24
6.3 Picture Ringers . . . . . . . . . . . . . . . . . . . . 24
7 CMF Conformance Requirements . . . . . . . . . . . . . . . . 24
7.1 Subchunk Requirements . . . . . . . . . . . . . . . . . 24
7.2 MIDI Requirements . . . . . . . . . . . . . . . . . . . . 25
7.3 Wave Packet Requirements . . . . . . . . . . . . . . . . 25
7.4 Cue- and Jump-points . . . . . . . . . . . . . . . . . . 25
7.4.1 Cuepoints . . . . . . . . . . . . . . . . . . . . . 25
7.4.2 Jump Points . . . . . . . . . . . . . . . . . . . . . 26
7.5 Recycle Requirements . . . . . . . . . . . . . . . . . . 26
7.5.1 Store Command . . . . . . . . . . . . . . . . . . . . 26
7.5.2 Set Command . . . . . . . . . . . . . . . . . . . . 26
7.5.3 Recycle Command . . . . . . . . . . . . . . . . . . . 26
7.6 Requirements for Default Values . . . . . . . . . . . . 26
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . 27
8.1. Registration of application/cmf . . . . . . . . . . . . 28
9. Security Considerations . . . . . . . . . . . . . . . . . . 28
10. Normative References . . . . . . . . . . . . . . . . . . . . 29
11 Informative References . . . . . . . . . . . . . . . . . . . 29
12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . 29
13 Editor's Address . . . . . . . . . . . . . . . . . . . . . . 30
Intellectual Property Statement . . . . . . . . . . . . . . . 30
Intellectual Property Statement . . . . . . . . . . . . . . . 31
Full Copyright Statement . . . . . . . . . . . . . . . . . . . 31
Disclaimer . . . . . . . . . . . . . . . . . . . . . . . . . -1
Atarius, Editor Expires January 2005 [Page 2]
Internet Draft Compact Media Format (CMF) July 2004
1. Conventions Used in this Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in "Keywords for use in
RFCs to Indicate Requirement Levels" [KEYWORDS].
2 Introduction
This document specifies the Compact Media Format (CMF).
CMF is a media format combining voice, music, text, pictures slide
shows, and animation.
CMF files consist of header information and track chunks. The
header contains metadata such as title, author, and copyright as
well as global parameters used to interpret the track chunks. Each
track chunk contains a particular media element along with its
timing information.
CMF uses the application/cmf media type and the .cmf file extension
as specified in section 8.
3 Description of CMF Content
A CMF file is composed of file ID, file length, header information,
and one or more track chunks which contain the media content.
The file ID and length identify the CMF file and its length.
The header sets up necessary global parameters for interpreting the
content track chunks. It contains the number of tracks, content
type, and detailed information for each track chunk. Content type
shows whether the media is text, melody, picture, animations,
vibration, or LED. Content type also specifies the format of the
media such as character set in case of text and so on.
In addition, the CMF header contains metadata such as title,
copyright, date, source, etc.
The track chunks contain events which specify the media elements and
how they should be temporally synchronized in relation to each
other. The events also contain information on how the media should
be played back. For instance, how a picture, text, or animation
should be positioned on the display, and how a melody should be
played.
Atarius, Editor Expires January 2005 [Page 3]
Internet Draft Compact Media Format (CMF) July 2004
Normally, MIDI is divided apart such that MIDI Channels 1-4 are
described in track chunk 1, MIDI Channels 5-8 are described in track
chunk 2, MIDI Channels 9-12 are described in track chunk 3, and MIDI
Channels 13-16 are described in track chunk 4. Any MIDI event that
is not channel specific (e.g., master-volume, master-tune) MUST be
in the first track. Any MIDI event that is channel specific (e.g.,
bank-change, program-change) MUST be located in the same track as
the other events of the same channel. All non-MIDI events MUST be
in track 1 except for NOP and end-of-track which can occur in all
tracks.
4 Formal Syntax of CMF Content
This section describes CMF using [ABNF].
CMF-file = cmid file-length CMF-header track-chunk
file-length = 4OCTET
OCTET = %x00-FF
cmid = %x63 %x6d %x69 %x64
CMF-header = header-length content-type nTracks *sub-chunk
header-length = 2OCTET
content-type = (melody (complete / part) )
/ (song instruments)
melody = %x01
; used for ringers
complete = %x01
; all of the melody
part = %x02
; part of the melody
song = %x02
; used for pictures + audio
instruments = OCTET
; bit field
; The octet contains bits set with meanings
; as follows
; %x01: contains musical event
; %x02: contains wave data
Atarius, Editor Expires January 2005 [Page 4]
Internet Draft Compact Media Format (CMF) July 2004
; %x04: contains text data
; %x08: contains picture data
; %x10: contains female vocal parts
; %x20: contains male vocal parts
; %x40: contains other vocal parts
; %x80: Reserved (SHOULD not be set; SHOULD
; be ignored if encountered.
nTracks = %x01-04
; number of track chunks. Note that all non-MIDI
; content (e.g., PNG, animation) must be in track
; chunk 1. Four MIDI channels can go in each track chunk,
; so MIDI channels 1-4 are in track chunk 1, MIDI
; channels 5-8 are in track chunk 2, etc.
sub-chunk = 1*(required-chunk / optional-chunk / expansion-chunk)
; if more than one sub-chunk of the same type is
; present, the player MUST ignore all except the last
; such sub-chunk. The player MUST ignore unrecognized
; sub-chunks (expansion-chunk). expansion-chunk MUST
; NOT be created. Sub-chunks MAY appear in any order.
; All required sub-chunks MUST be present
; (required-chunk).
required-chunk = vers-chunk
/ note-chunk
/ cnts-chunk
; exactly one of each of these required sub-chunks MUST
; be present.
expansion-chunk = exp-id length2 exp-data
; for compatibility with future versions of the
; specification.
exp-id = 4OCTET
; MUST NOT be an existing sub-chunk.
exp-data = *OCTET
; number of octets specified in length2 field of
; expansion-chunk.
optional-chunk = code-chunk
/ titl-chunk
/ date-chunk
/ sorc-chunk
/ copy-chunk
/ exsn-chunk
/ exsa-chunk
Atarius, Editor Expires January 2005 [Page 5]
Internet Draft Compact Media Format (CMF) July 2004
/ exsb-chunk
/ exsc-chunk
/ cuep-chunk
/ pcpi-chunk
/ prot-chunk
/ wave-chunk
vers-chunk = vers %x0004 "0500"
vers = %x76 %x65 %x72 %x73
; The value "0500" refers to CMF.
; All players that are compliant to this document MUST
; accept vers-chunk values of %d0200-0599, as these
; are backward compatible.
code-chunk = code %x0001 code-value
code = %x63 %x6F %x64 %x65
titl-chunk = titl length2 title
titl = %x74 %x69 %x74 %x6C
title = *OCTET
; number of octets specified in length2
; field of titl-chunk
date-chunk = date length2 date-data
date = %x64 %x61 %x74 %x65
date-data = *OCTET
; number of octets specified in length2
; field of date-chunk
copy-chunk = copy length2 copyright-notice
; Content provider's copyright notice.
copy = %x63 %x6F %x70 %x79
copyright-notice = *OCTET
; number of octets specified in length2
; field of copy-chunk
sorc-chunk = sorc %x0001 source-info
sorc = %x73 %x6F %x72 %x63
note-chunk = note %x0002 note-msg-config
Atarius, Editor Expires January 2005 [Page 6]
Internet Draft Compact Media Format (CMF) July 2004
note = %x6E %x6F %x74 %x65
note-msg-config = [%x0000 / %x0001]
; %x0000 : Note message is of length 3 octet
; %x0001 : Note message is of length 4 octet
; In the second case, the extra (fourth) octet
; is used to include velocity and Octave Shift
; information.
exsn-chunk = exsn %x0002 2data
; exsn-chunk specifies the length of normal
; extension status-A message
exsn = %x65 %x78 %x73 %x6E
exsa-chunk = exsa %x0002 2data
; exsa-chunk specifies the length of extension
; status-A, class A message
exsa = %x65 %x78 %x73 %x61
exsb-chunk = exsb %x0002 2data
; exsb-chunk specifies the length of extension
; status-A, class B message
exsb = %x65 %x78 %x73 %x62
exsc-chunk = exsc %x0002 2data
; exsc-chunk specifies the length of extension
; status-A, class C message
exsc = %x65 %x78 %x73 %x63
cuep-chunk = cuep 4nTracks *OCTET
; cuep-chunk specifies the location of the cue
; point start point, which is the starting
; position of the main theme music in the track.
; The length of cuep-chunk MUST be equal to
; number of tracks multiplied by 4 octets. Every
; 4 octets consists of the location of the cue
; point start point in the corresponding track
; chunk.
; Each cue point start point is defined to be an
; offset from the start of the track chunk to
; the octet which is the beginning of the theme
; music event in that track chunk. If the cue
; point start point offset for any track chunk
; is FFFFFFFF, then that track chunk is inactive
Atarius, Editor Expires January 2005 [Page 7]
Internet Draft Compact Media Format (CMF) July 2004
; during cue point playback.
cuep = %x63 %x75 %x65 %x70
pcpi-chunk = pcpi %x0001 axis-offset
pcpi = %x70 %x63 %x70 %x69
axis-offset = %x00-01
; pcpi-chunk describes the picture packet information.
; %0x00 : XY offsets in pcpi are in percent
; %0x01 : XY offsets in pcpi are in pixels
cnts-chunk = cnts length2 multi-media-type
cnts = %x63 %x6E %x74 %x73
multi-media-type = media-type *(";" media-type)
; cnts-chunk describes the various media contents
; that are present in the file.
; Multiple media are separated by ";" in
; cnts-chunk.
; Examples: SONG;WAVE;TEXT;PICT
; length2 specifies the length of multi-media-type
; in cnts-chunk.
prot-chunk = prot length2 *OCTET
; length2 specifies the length of the data in
; prot-chunk.
; This string can be used to identify the Content
; Provider.
prot = %x70 %x72 %x6F %x74
wave-chunk = wave %x0001 data
; the data value is used to determine whether
; wav-data in track-chunk is ADPCM or QCELP. The
; values are defined according to the following:
; %x00 : wav-data MUST be ADPCM
; %x01 : wav-data MUST be QCELP
; %x02-FF: reserved
; If the format of wav-data (ADPCM or QCELP) in
; the CMF file is not the same as the data
; present in wave-chunk, the wav-data MUST be
; ignored.
wave = %x77 %x61 %x76 %x65
code-value = %b00000000-10000101
Atarius, Editor Expires January 2005 [Page 8]
Internet Draft Compact Media Format (CMF) July 2004
; %b00000000 : ANSI CHARSET
; %b00000001 : ISO8859-1
; %b00000010 : ISO8859-2
; %b00000011 : ISO8859-3
; %b00000100 : ISO8859-4
; %b00000101 : ISO8859-5
; %b00000110 : ISO8859-6
; %b00000111 : ISO8859-7
; %b00001000 : ISO8859-8
; %b00001001 : ISO8859-9
; %b00001010 : ISO8859-10
; %b10000001 : HANGUL CHARSET
; %b10000010 : Chinese Simplified
; %b10000011 : Chinese Traditional
; %b10000100 : Hindi
; %b10000101 : Thai
source-info = no-copyright / copyright-DL /copyright-MO / copyright-DT
no-copyright = %b00
; No copyright, downloaded (from the net)
copyright-DL = %b01
; Copyrighted, downloaded (from the net)
copyright-MO = %b11
; Copyrighted, mobile originated
copyright-DT = %b101
; Copyrighted, from desktop
data = OCTET
media-type = "SONG" ; Contains MIDI
/"WAVE" ; Contains Wave sounds
/"TEXT" ; Contains text data
/"PICT" ; Contains still image data
/"ANIM" ; Contains animation data
/"LED" ; Contains LED data
/"VIB" ; Contains VIB data
track-chunk = (track-chunk-1 3*midi-track-chunk) / exp-track-chunk
; The player MUST ignore unrecognized track-chunks
; (exp-track-chunk). exp-track-chunk MUST NOT be created.
track-chunk-1 = trac length4 *event
Atarius, Editor Expires January 2005 [Page 9]
Internet Draft Compact Media Format (CMF) July 2004
trac = %x74 %x72 %x61 %x63
midi-track-chunk = trac length4 *midi-event
midi-event = delta-time midi-event-message
exp-track-chunk = exp-track length4 *OCTET
exp-track = 4OCTET
; exp-track MUST NOT be the same as trac.
event = delta-time event-message
delta-time = OCTET
; delta time is described as the elapsed time from
; a previous event. The delta-time of each event is
; determined by the relative time from the previous event
; using an adjustable unit of time called a tick. The
; timebase and tempo MIDI event (timebase-tempo) enable
; the CMF content author to adjust this unit of time. By
; default, the timebase is 48 and the tempo is 125. By
; plugging the default timebase and tempo values into
; following formula:
; milliseconds per tick = 60000 / (tempo * timebase).
; the default value for each tick which is calculated to
; be 10ms.
; If a delta-time value of more than 255 is required, NOP
; events should be used to correctly time the event.
; The values for timebase are shown in the table in
; section 5.1.
event-message = note-message
/ ext-A-message
/ ext-B-message
/ ext-info-message
midi-event-message = note-message
/ ext-A-message
/ midi-ext-B-message
note-message = note-status gate-time
/ note-status gate-time vel-oct-shift
; If note-msg-config is %x0000, note-message is
; (note-status gate-time). If note-msg-config is %x0001,
; note-message is (note-status gate-time vel-oct-shift).
note-status = channel-index key-number
; One octet containing channel index and key
Atarius, Editor Expires January 2005 [Page 10]
Internet Draft Compact Media Format (CMF) July 2004
; number
key-number = %b000000-111110
; key-number is 0 to 62.
; key-number 63 is prohibited.
; key-number 15 is middle C of keyboard
gate-time = OCTET
; continuation time from note-on to note-off.
; The values of gate-time is calculated
; in the same way as the values of delta-time.
; If a gate-time value of more than 255 is
; required multiple note-messages are used.
vel-oct-shift = velocity octave-shift
; octet containing velocity (6 bits) and
; octave-shift (2 bits)
velocity = %b000000-111111
; velocity is 0 to 63.
octave-shift = %b00-11
; %b00 : No change
; %b01 : Increase one octave
; %b10 : decrease two octaves
; %b11 : decrease one octave
ext-A-message = %xFF A-command-data
ext-B-message = %xFF B-command-data
midi-ext-B-message = %xFF midi-B-command-data
ext-info-message = %xFF ( ( %b11110001 wav-data-length wav-data )
/ ( %b11110010 text-data-length text-data )
/ ( %b11110011 pict-data-length picture-data )
/ ( %b11110100 anim-data-length animation-data ) )
wav-data-length = length2
text-data-length = length2
pict-data-length = length2
anim-data-length = length2
length2 = 2OCTET
A-command-data = assigned-channel fine-pitch-bend
Atarius, Editor Expires January 2005 [Page 11]
Internet Draft Compact Media Format (CMF) July 2004
; two octets containing assigned-channel and
; fine-pitch-bend.
assigned-channel = %b000-011
; Assigned channel index (0..3)
fine-pitch-bend = %b0000000000000-1111111111111
; range : %x0000 to %x1fff (see table in
; section 5.3)
; Fine pitchbend message sets the change value
; of the pitch specified in the note message.
B-command-data = master-volume
/ master-tune
/ part-configuration
/ pause
/ stop
/ reset
/ timebase-tempo
/ cuepoint
/ jump
/ NOP
/ end-of-track
/ bank-change
/ program-change
/ volume
/ panpot
/ pitchbend
/ channel-assign
/ pitchbend-range
/ wave-channel-volume
/ wave-channel-panpot
/ text-control
/ picture-control
/ vib-control
/ LED-control
midi-B-command-data = NOP
/ end-of-track
/ bank-change
/ program-change
/ volume
/ panpot
/ pitchbend
/ pitchbend-range
master-volume = %b10110000 %x00-7F
; specifies the volume adjustment
; for all audio events. The
Atarius, Editor Expires January 2005 [Page 12]
Internet Draft Compact Media Format (CMF) July 2004
; default value is 100 (0 dB).
; Range is from 0 to 127.
master-tune = %b10110011 %x34-4C
; Master Tune for music synthesizer
; %x34 : -(12 x 100 ) [cents]
; ...
; %x3E : -( 2 x 100 ) [cents]
; %x3F : -( 1 x 100 ) [cents]
; %x40 : 0 [cents]
; %x41 : ( 1 x 100 ) [cents]
; %x42 : ( 2 x 100 ) [cents]
; ...
; %x4C : (12 x 100 ) [cents]
; A cent is a change in frequency
; by 2^(1/1200). So frequencies f1
; and f2 are one cent apart if
; f2 = f1 x 2^(1/1200), and three
; cents apart if
; f2 = f1 x 2^(3/1200).
part-configuration = %b10111001 %x00
; reserved
pause = %b10111101 %x00
; pause player
stop = %b10111110 %x00
; all notes off
reset = %b10111111 %x00
; reset controllers
timebase-tempo = timebase tempo
timebase = %b1100000-11001111
; timebase - the lower nibble (%b0000-1111)is index
; into table in section 5.1.
tempo = %x14-FF
; number of quarter notes in one minute.
cuepoint = %b11010000 cuep-start-end
cuep-start-end = cuep-startpoint / cuep-endpoint
cuep-startpoint = %x00
; cuepoint startpoint
Atarius, Editor Expires January 2005 [Page 13]
Internet Draft Compact Media Format (CMF) July 2004
cuep-endpoint = %x01
; cuepoint endpoint
jump = %b11010001 jump-data
jump-data = destination jump-id no-of-jumps
; one octet with following three fields
destination = dest / jump
dest = %b00
; destination point
jump = %b01
; jump point
jump-id = %b00-11
; jump ID (0 to 3)
no-of-jumps = %b0000-1111
; (15 is infinity)
NOP = %b11011110 NOP-data
NOP-data = %x00
end-of-track = %b11011111 %x00
; end of track
bank-change = %b11100001 bank-change-attr
bank-change-attr = channel-index bank-change-value
;one octet containing 2 fields
bank-change-value = %b000000-111111
; bank change value
; %b000010: General CMF Instrument bank with
; programs from the first 64 patches of the
; General MIDI Instrument Patch Map.
; %b000011: General CMF Instrument bank with
; programs from the second 64 patches of the
; General MIDI Instrument Patch Map.
; %b111111: Drum Bank with identical keys as
; the General MIDI Percussion Key Map.
program-change = %b11100000 prog-data
prog-data = channel-index prog-change
; one octet containing 2 fields
Atarius, Editor Expires January 2005 [Page 14]
Internet Draft Compact Media Format (CMF) July 2004
prog-change = %b000000-111111
; program change value
; prog-change SHALL be ignored if the bank is
; a drum bank.
volume = %b11100010 volume-attr
volume-attr = channel-index volume-change
;one octet containing 2 fields
volume-change = %b000000-111111
; volume change value
panpot = %b11100011 panpot-attr
panpot-attr = channel-index panpot-change
; one octet containing two fields
panpot-change = %b000000-111111
; panpot change value
; %b000000 : Far Left
; %b100000 : Center
; %b111111 : Far Right
pitchbend = %b11100100 pitchbend-attr
pitchbend-attr = channel-index pitchbend-change
; one octet containing two fields
pitchbend-change = %b000000-111111
; pitchbend change value (see table in
; section 5.2)
channel-assign = %b11100101 channel-data
channel-data = channel-index channel-value
; one octet containing two fields
channel-value = %b000000-001111
pitchbend-range = %b11100111 pitchrange-data
pitchrange-data = channel-index pitch-range
; one octet containing two fields
pitch-range = %b000000-001100
; pitch bend range
Atarius, Editor Expires January 2005 [Page 15]
Internet Draft Compact Media Format (CMF) July 2004
wave-channel-volume = %b11101000 wave-vol
wave-vol = channel-index volume-change
; one octet containing two fields
volume-change = %b000000-111111
; volume change value
wave-channel-panpot = %b11101001 wave-panpot
wave-panpot = channel-index panpot-change
; one octet containing two fields
panpot-change = %b000000-111111
; wave panpot change value
; %b000000 : Far Left
; %b100000 : Center
; %b111111 : Far Right
text-control = %b11101011 tex-cont
tex-cont = %x00-05
; %x00 : Text Enable
; %x01 : Text Disable
; %x02 : Clear text
; %x03 : reserved
; %x04 : Increase cursor position by 1 byte
; %x05 : Increase cursor position by 2 bytes
picture-control = %b11101100 pict-cont
pict-cont = pict-enable / pict-disable / clear-pict
pict-enable = %x00
; picture enable
pict-disable = %x01
; picture disable
clear-pict = %x02
; clear picture
vib-control = %b11101110 vib-data
vib-data = %b0 off-on vib-pattern
; one octet containing one zero bit and two
; fields
off-on = %b0-1
Atarius, Editor Expires January 2005 [Page 16]
Internet Draft Compact Media Format (CMF) July 2004
; enable is %b1 and disable is %b0
vib-pattern = %b000000-000111
; vibrator pattern
LED-control = %b11101101 led-data
led-data = %b0 off-on color-pattern
; one octet containing one zero bit and two
; fields
off-on = %b0-1
; enable is %b1 and disable is %b0
color-pattern = %b000000-001111
; color pattern
wav-data = wav-atrb1 wav-atrb2
wav-atrb1 = channel-index channel-id
; one octet containing two fields
channel-index = %b00-11
; assigned channel index, defined
; with respect to the channel reference index.
channel-id = %b000000-111111
wav-atrb2 = wav-p-mode wav-str
; one octet containing two fields
wav-p-mode = wav-store / wav-set / wav-recycle
wav-store = %b00
; store mode, see section 7.5.1
wav-set = %b01
; set mode, see section 7.5.2
wav-recycle = %b10
; recycle mode, see section 7.5.3
wav-str = wav-other / wav-ima
wav-other = wav-format packet-offset prev-flag *OCTET
wav-format = wav-qcp / wav-ext
wav-qcp = %b000100
Atarius, Editor Expires January 2005 [Page 17]
Internet Draft Compact Media Format (CMF) July 2004
; QCP 13k
wav-ext = %b000000-000011 / %b000110-111111
; reserved
wav-ima = %b000101 packet-offset prev-flag wav-adpcm-info
*OCTET
; IMA ADPCM
packet-offset = length4
; specifies offset in bytes to next wave packet
prev-flag = prev-flag-en / prev-flag-dis
prev-flag-en = %x01
prev-flag-dis = %x00
; specifies if current wave packet is continued
; from previous (for those formats with frame
; history). Implementations SHOULD ignore the
; seven most significant bits
; If wav-format is wav-qcp then wav-data-cnts is
; *OCTET. If wav-format is wav-adpcm then
; wav-data-cnts is wav-adpcm-info *OCTET.
wav-adpcm-info = wav-adpcm-samp-rate %b00 wav-adpcm-block-size
wav-adpcm-samp-rate = %b00-11
; it defines the sampling rate of ADPCM.
; %b00 : 8 KHz
; %b01 : 16 KHz
; %b10 : 32 KHz
; %b11 : Reserved
wav-adpcm-block-size= %b000000000000-111111111111
; it defines the size of ADPCM block in bytes.
; Typical block size for sampling rate 8 and 16 KHz
; is 256 Bytes. While typical block size for
; sampling rate 32 KHz is 512 Bytes.
text-data = text-atrb *OCTET
text-atrb = %b0 set-append x-align y-align
; set/append and XY alignment
; one octet containing a zero bit followed by
; three fields
set-append = set-string / append-string
Atarius, Editor Expires January 2005 [Page 18]
Internet Draft Compact Media Format (CMF) July 2004
set-string = %b0
; set a string
append-string = %b1
; append a string
x-align = txt-x-left / txt-x-center / txt-x-right
txt-x-left = %b000
; left x-alignment
txt-x-center = %b001
; center x-alignment
txt-x-right = %b010
; right x- alignment
y-align = txt-y-bottom / txt-y-center / txt-y-top
txt-y-bottom = %b000
; bottom y-alignment
txt-y-center = %b001
; center y-alignment
txt-y-top = %b010
; top y-alignment
picture-data = pict-atrb1 pict-atrb2 pict-atrb3 pict-x-off
pict-y-off *OCTET
pict-atrb1 = reserved id
reserved = %b00-11
; sHOULD set to %b00 on creation
; SHOULD ignore value when reading
id = %b000000-111111
; picture packet ID (0-63)
pict-atrb2 = pic-p-mode pic-format
pic-p-mode = pict-store / pict-set / pict-recycle
pict-store = %b00
; store mode, see section 7.5.1
pict-set = %b01
; set mode, see section 7.5.2
Atarius, Editor Expires January 2005 [Page 19]
Internet Draft Compact Media Format (CMF) July 2004
pict-recycle = %b10
; recycle mode, see section 7.5.3
pic-format = BMP-format / JPEG-format / PNG-format
BMP-format = %b000001
JPEG-format = %b000010
PNG-format = %b000011
pict-atrb3 = %x00
; draw mode : normal
pict-x-off = OCTET
; if subchunk for picture packet = 0
; %b00000000 : X-offset 0%
; %b00000001 : X-offset 1%
; ...
; %b01100100 : X-offset 100%
; %b01100101 : Left
; %b01100110 : Center
; %b01100111 : Right
; if subchunk for picture packet = 1
; pict-x-off = pixel offset from left (0..255)
pict-y-off = OCTET
; if subchunk for picture packet = 0
; %b00000000 : Y-offset 0%
; %b00000001 : Y-offset 1%
; ...
; %b01100100 : Y-offset 100%
; %b01100101 : Top
; %b01100110 : Center
; %b01100111 : Bottom
; if subchunk for picture packet = 1
; pict-y-off = pixel offset from top (0...255)
animation-data = anim-atrb0 anim-atrb1 anim-atrb2 anim-x-off
anim-y-off *OCTET
anim-atrb0 = length4
length4 = 4OCTET
; four bytes to indicate the length of the
; animation if length2 in ext-info-message is
; set to zero.
Atarius, Editor Expires January 2005 [Page 20]
Internet Draft Compact Media Format (CMF) July 2004
anim-atrb1 = anim-p-mode anim-id
; one octet containing two fields
; note both fields contain fixed (reserved)
; values
anim-p-mode = %b01
; Animation packet mode
; %b01 : reserved
anim-id = %b000000
; Animation packet ID
; %b000000 : reserved
anim-atrb2 = anim-p-format anim-code
; one octet containing two fields
anim-p-format = %b000
; reserved
anim-code = imag-obj-data / frame-id / frame-cmd
imag-obj-data = %b00000
; image object data
frame-id = %b00001
; frame ID
frame-cmd = %b00010
; frame command
anim-x-off = OCTET
; if subchunk for animation packet = 0
; %b00000000 : X-offset 0%
; %b00000001 : X-offset 1%
; ...
; %b01100100 : X-offset 100%
; %b01100101 : Left
; %b01100110 : Center
; %b01100111 : Right
; if subchunk for animation packet = 1
; anim-x-off = pixel offset from left (0..255)
anim-y-off = OCTET
; if subchunk for animation packet = 0
; %b00000000 : Y-offset 0%
; %b00000001 : Y-offset 1%
; ...
; %b01100100 : Y-offset 100%
; %b01100101 : Top
Atarius, Editor Expires January 2005 [Page 21]
Internet Draft Compact Media Format (CMF) July 2004
; %b01100110 : Center
; %b01100111 : Bottom
; if subchunk for animation packet = 1
; anim-y-off = pixel offset from top (0..255)
5 Tables
5.1 TimeBase
TimeBase is expressed by the lower 4-bits of the status byte. The
default value is 48.
+-------------------+---------------------------------+
| %b----0000 | TimeBase = 6 |
+-------------------+---------------------------------+
| %b----0001 | TimeBase = 12 |
+-------------------+---------------------------------+
| %b----0010 | TimeBase = 24 |
+-------------------+---------------------------------+
| %b----0011 | TimeBase = 48 |
+-------------------+---------------------------------+
| %b----0100 | TimeBase = 96 |
+-------------------+---------------------------------+
| %b----0101 | TimeBase = 192 |
+-------------------+---------------------------------+
| %b----0110 | TimeBase = 384 |
+-------------------+---------------------------------+
| %b----0111 | Reserved |
+-------------------+---------------------------------+
| %b----1000 | TimeBase = 15 |
+-------------------+---------------------------------+
| %b----1001 | TimeBase = 30 |
+-------------------+---------------------------------+
| %b----1010 | TimeBase = 60 |
+-------------------+---------------------------------+
| %b----1011 | TimeBase = 120 |
+-------------------+---------------------------------+
| %b----1100 | TimeBase = 240 |
+-------------------+---------------------------------+
| %b----1101 | TimeBase = 480 |
+-------------------+---------------------------------+
| %b----1110 | TimeBase = 960 |
+-------------------+---------------------------------+
| %b----1111 | Reserved |
+-------------------+---------------------------------+
Atarius, Editor Expires January 2005 [Page 22]
Internet Draft Compact Media Format (CMF) July 2004
5.2 Pitch Bend
The following table contains a description of the pitch bend value
when the pitch bend range is assigned RangeValue. The default value
for RangeValue is 2.
+------------------+-----------------------------------------+
| %b000000 | -( 32 x RangeValue x 100 / 32 ) [cents] |
+------------------+-----------------------------------------+
| ... | ... |
+------------------+-----------------------------------------+
| %b011110 | -( 2 x RangeValue x 100 / 32 ) [cents] |
+------------------+-----------------------------------------+
| %b011111 | -( 1 x RangeValue x 100 / 32 ) [cents] |
+------------------+-----------------------------------------+
| %b100000 | 0 [cent] |
+------------------+-----------------------------------------+
| %b100001 | ( 1 x RangeValue x 100 / 32 ) [cents] |
+------------------+-----------------------------------------+
| %b100010 | ( 2 x RangeValue x 100 / 32 ) [cents] |
+------------------+-----------------------------------------+
| ... | ... |
+------------------+-----------------------------------------+
| %b111111 | ( 31 x RangeValue x 100 / 32 ) [cents] |
+------------------+-----------------------------------------+
5.3 Fine Pitch Bend
The following table contains a description of the fine pitch bend
value.
+--------------------+-----------------------------------------------+
| %b0000000000000 | -( 4096 x RangeValue x 100 / 4096 ) [cents] |
+--------------------+-----------------------------------------------+
| ... | ... |
+--------------------+-----------------------------------------------+
| %b0111111111110 | -( 2 x RangeValue x 100 / 4096) [cents] |
+--------------------+-----------------------------------------------+
| %b0111111111111 | -( 1 x RangeValue x 100 / 4096) [cents] |
+--------------------+-----------------------------------------------+
| %b1000000000000 | 0 [cent] |
+--------------------+-----------------------------------------------+
| %b1000000000001 | ( 1 x RangeValue x 100 / 4096) [cents] |
+--------------------+-----------------------------------------------+
| %b1000000000010 | ( 2 x RangeValue x 100 / 4096) [cents] |
+--------------------+-----------------------------------------------+
Atarius, Editor Expires January 2005 [Page 23]
Internet Draft Compact Media Format (CMF) July 2004
| ... | ... |
+--------------------+-----------------------------------------------+
| %b1111111111111 | ( 4095 x RangeValue x 100 / 4096) [cents] |
+--------------------+-----------------------------------------------+
6 CMF Profiles
A CMF profile identifies a set of media combinations.
Players MUST be capable of rendering at least the profiles listed in
section 6. For maximum interoperability, content generators MAY be
restricted to the profiles listed in section 6. Note that
additional profiles MAY be defined in the future.
6.1 Talking Picture Messaging
cnts = WAV;PICT
This profile is primarily used for messaging applications. PICT can
either be JPEG or PNG for graphics/image data.
6.2 Audio-only Profile
cnts = SONG;WAV
This profile is primarily used for ringers and other audio only
applications such as the audio portion of a game application. SONG
is used for MIDI and WAV is used to provide QCP or ADPCM sound
effects.
6.3 Picture Ringers
cnts = SONG;WAV;PICT
This profile is an enhancement on 6.2 that adds graphics capability
for picture or audio postcards. PICT can be either PNG or JPEG
format.
7 CMF Conformance Requirements
In order to interoperate with existing deployments, the requirements
in this section MUST be followed.
Atarius, Editor Expires January 2005 [Page 24]
Internet Draft Compact Media Format (CMF) July 2004
7.1 Subchunk Requirements
There are 3 required subchunks: note, vers, and cnts. All encoders
are REQUIRED to include these subchunks and all decoders are
REQUIRED to verify the existence of these subchunks before playing
the content.
7.2 MIDI Requirements
All MIDI related parameters SHOULD be interpreted according to
General MIDI Level 2 requirements, [MMASpec1] and [MMASpec2]. In
those instances where parameters have different precisions than the
equivalent General MIDI Level 2 parameters, those parameters SHOULD
be mapped to the equivalent dynamic range.
7.3 Wave Packet Requirements
CMF encoders SHOULD break wave packets into subchunks with
reasonable durations. These subchunks represent events and are time
stamped by delta-time which is the elapsed time from one event to
the previous one. The recommendation for subchunking allows CMF
players to implement effective fast-forward and rewind operations
without affecting the ability to properly handle wave packets. A
typical implementation breaks wave packets into 0.5 second. Using
0.5 second chunks allows a typical CMF player to achieve 0.5 second
resolution in forward and rewind increments. The subchunks also
contains prev-flag parameter so that CMF player is able to correctly
implement a continuous bit-stream interface to the wave decoder when
wave packets are provided with prev-flag set to %x01. When
prev-flag is %x00, the CMF player SHOULD reset the wave decoder.
The information in prev-flag is to ensure continuous decoding of
audio packets.
7.4 Cue- and Jump-points
7.4.1 Cuepoints
Cuepoints are used to provide an alternative play mode for CMF
files. When in cue-point play mode, the decoder SHOULD jump to the
cue start point when starting playback. All rules for setup that
are observed for normal playback at the beginning of the file SHOULD
be observed. For example, an encoder is required to insert all
configuration events in between cuepoint boundaries even if those
events are redundant with configuration events outside cue-point
boundaries.
Atarius, Editor Expires January 2005 [Page 25]
Internet Draft Compact Media Format (CMF) July 2004
7.4.2 Jump Points
Jump points are used to reuse portions of the playback using loops
to reduce file size. The decoder is required to parse a jump
destination point and save a pointer to the file. Up to 4 JUMP IDs
can be saved for later reference. When a jump command is received
for a given destination ID, the decoder SHOULD continue playback
from the destination point. The loop number specifies the number of
times the jump SHOULD be taken. After the final jump, decoding
SHOULD continue as normal ignoring the final jump command.
7.5 Recycle Requirements
Recycling is supported in Picture, Wave, and Animation packets. The
use of recycle is RECOMMENDED to optimize file sizes for data
transmission. Each packet group allows for up to 64 individual IDs
to be used for recycle.
7.5.1 Store Command
The "store" operation specifies that the decoder SHOULD not display
the data, but instead cache the data for displaying in the future.
7.5.2 Set Command
The "set" operation specifies that the decoder SHOULD both cache the
data and display it.
7.5.3 Recycle Command
The "recycle" operation specifies that the decoder SHOULD redisplay
image data previously cached by a "store" or "set" operation that
used the same packet ID value specified in the "Attributes 1" field.
7.6 Requirements for Default Values
Following table shows the default values of the events if the events
are omitted in CMF file.
+----------------------+------------------------------+
| Event: | Field and Default Value: |
+----------------------+------------------------------+
| Timebase-tempo | 48 (Timebase) and 125 (Tempo)|
+----------------------+------------------------------+
Atarius, Editor Expires January 2005 [Page 26]
Internet Draft Compact Media Format (CMF) July 2004
| Master-Volume | 100 |
+----------------------+------------------------------+
| Master-tune | 128 |
+----------------------+------------------------------+
| Program-change | 0 |
+----------------------+------------------------------+
| Bank-change | 0 |
+----------------------+------------------------------+
| Volume | 50 |
+----------------------+------------------------------+
| Panpot | 32 |
+----------------------+------------------------------+
| Pitchbend | 32 |
+----------------------+------------------------------+
| Wave-channel-volume | 50 |
+----------------------+------------------------------+
| Wave-channel-panpot | 32 |
+----------------------+------------------------------+
8. IANA Considerations
IANA is requested to register the application/cmf media type as
specified here.
8.1. Registration of application/cmf
Media Type Name:
application
Media Subtype Name:
CMF
Required Parameter:
"codecs". Values of the codecs parameters as specified in
[mp4-reg] per [Codecs]. If present it MUST contain a value for
each media element which exists in the CMF file. It MUST NOT
contain values for any media element which does not exist in the
CMF file.
Optional parameters:
Atarius, Editor Expires January 2005 [Page 27]
Internet Draft Compact Media Format (CMF) July 2004
None
Encoding considerations:
As a binary format, CMF requires suitable content transfer
encoding when transported over non-8-bit-clean protocols. For
example, base64 encoding SHOULD be used over unextended SMTP.
Security considerations:
See Section 9, "Security Considerations", of this document.
Public specification:
This document
Additional information:
None
Magic number:
First four octets; cmid
File extensions:
cmf, CMF
Macintosh file type code:
CMFf
Object identifier or OID:
None
Intended usage:
COMMON. This file format is already in wide use in multimedia
authoring, playing software, and cdma2000 handsets.
Person & email address to contact for further information:
Roozbeh Atarius, ratarius@qualcomm.com
Change controller:
Roozbeh Atarius
9. Security Considerations
This document specifies a file format only, not a streaming protocol
payload format nor a transfer method. As such, it introduces no
security risks aside from those associated with any codec or media file
format (for example, denial of service by transmitting a file larger
than the receiver can handle). Note that those security concerns SHOULD
be understood before using the file format specified here.
Atarius, Editor Expires January 2005 [Page 28]
Internet Draft Compact Media Format (CMF) July 2004
10. Normative References
[ABNF] Crocker, Overell, "Augmented BNF for Syntax Specifications:
ABNF", RFC 2234, Internet Mail Consortium, Demon Internet Ltd., November
1997.
[KEYWORDS] Bradner, "Key words for use in RFCs to Indicate Requirement
Levels", RFC 2119, Harvard University, March 1997.
[MMASpec1] "Complete MIDI 1.0 Detailed Specification", v96.1 (second
edition), MIDI Manufacturers Association (MMA), 2001.
[MMASpec2] "General MIDI 2 Specification", v1.1, MIDI Manufacturer
Association (MMA), Septemner 2003.
[mp4-reg] The MPEG-4 Registration Authority, <url:http://www.mp4ra.org>.
[Codecs] "The Codecs Parameter for 'Bucket' Media Types",
draft-gellens-mime-bucket, work in progress.
11 Informative References
12. Acknowledgments
The CMF presentation file format was originally created by Faith Inc.
and others at QUALCOMM. The editor would like to thank them for their
contributions.
This draft could not be completed without the contributions of Randall
Gellens, Harinath Garudardi, Samir Gupta, Viktor Nikolic, and Sun Tam.
These individuals contributed with detailed text, ideas, technical
advices, and ABNF syntax to complete this draft. Hence, this draft is a
product of their valuable contributions. The editor would like to thank
them for their contributions and advices.
13 Editor's Address
Roozbeh Atarius
ratarius@qualcomm.com
QUALCOMM Incorporated
Atarius, Editor Expires January 2005 [Page 29]
Internet Draft Compact Media Format (CMF) July 2004
5775 Morehouse Drive
San Diego, CA 92121
USA
Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights might or
might not be available; neither does it represent that it has made any
effort to identify any such rights. Information on the IETF's
procedures with respect to rights in standards-track and
standards-related documentation can be found in BCP-11. Copies of
claims of rights made available for publication and any assurances of
licenses to be made available, or the result of an attempt made to
obtain a general license or permission for the use of such proprietary
rights by implementors or users of this specification can be obtained
from the IETF Secretariat.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary rights
which may cover technology that may be required to practice this
standard. Please address the information to the IETF Executive
Director.
Intellectual Property Statement
The IETF takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to pertain
to the implementation or use of the technology described in this
document or the extent to which any license under such rights might or
might not be available; neither does it represent that it has made any
effort to identify any such rights. Information on the IETF's
procedures with respect to rights in standards-track and
standards-related documentation can be found in BCP-11. Copies of
claims of rights made available for publication and any assurances of
licenses to be made available, or the result of an attempt made to
obtain a general license or permission for the use of such proprietary
rights by implementors or users of this specification can be obtained
from the IETF Secretariat.
Atarius, Editor Expires January 2005 [Page 30]
Internet Draft Compact Media Format (CMF) July 2004
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary rights
which may cover technology that may be required to practice this
standard. Please address the information to the IETF Executive
Director.
Full Copyright Statement
Copyright (C) The Internet Society (2004).
This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors retain
all their rights.
Disclaimer
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR
IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Atarius, Editor Expires January 2005 [Page 31]