Difference between revisions of "Indeo 5"

From MultimediaWiki
Jump to navigation Jump to search
m (Reverted edit of 67.15.179.13, changed back to last version by Multimedia Mike)
(")
Line 2: Line 2:
 
* Company: [[Intel]], then [[Ligos]]
 
* Company: [[Intel]], then [[Ligos]]
 
* Samples: [http://www.mplayerhq.hu/MPlayer/samples/V-codecs/IV50/ http://www.mplayerhq.hu/MPlayer/samples/V-codecs/IV50/]
 
* Samples: [http://www.mplayerhq.hu/MPlayer/samples/V-codecs/IV50/ http://www.mplayerhq.hu/MPlayer/samples/V-codecs/IV50/]
 +
 +
== General description ==
 +
 +
=== Frame layout ===
 +
 +
The general indeo5 frames layout is composed of one global header, followed by the content of the three YUV plans.
 +
 +
In this document, the global header is split into 3 parts:
 +
* [[#Frame_header|Frame header]]: describe the kind of frame (I/P/B)
 +
* [[#GOP_header|GOP header]]: some data which is true for all the frame in this GOP (present only in the first (I) frame of the GOP)
 +
* [[#More_header|More header]]: some more data which is true only for this single frame
 +
 +
Each YUV plan begin with a [[#Plan_header|Plan header]], containing values which are valid only for this single plan.
 +
 +
=== Encoding ===
 +
 +
This codec is based on the slant transform. Other used standard techniques are huffman coding and motion compensation.
 +
 +
=== Conventions ===
 +
 +
Headers are described in some tables. Each row of those tables describes a value which may be read from the frame. Those tables and rows are presented in the order of appearance in the frame.
 +
 +
Here are the meaning of each columns:
 +
* '''size''': The size of this value in bits. Bits are counted in MSB to LSB order. As an example, with the byte 01110000b, reading 3 bits then 5 bits will return 011b then 10000b.
 +
* '''name''': Kind of variable name, used to reference the value. When a value is named valueX, it generally means we don't know it's purpose. Lines named alignmentX means that bits reader need to skip bits until next byte boundary.
 +
* '''condition''': The value is present in the frame only if this condition is matched. No condition means that the value is always present.
 +
* '''nb times''': How many times the value is repeated.
 +
* '''comments''': Some details about the content of the value. It may also explain that a value is repeated until a certain condition is reached.
 +
 +
 +
== Headers ==
 +
 +
=== Frame header ===
 +
 +
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
 +
|- bgcolor="#f0f0f0" |
 +
! size !! name !! condition !! nb times !! comments
 +
|-
 +
| 3  || frame_flags || || ||
 +
* frame_flags & 0x01 => backward predictive
 +
* frame_flags & 0x02 => forward predictive
 +
* frame_flags & 0x04 => null frame
 +
common values:
 +
* 0 => I frame
 +
* 1 => P frame
 +
* 3 => B frame
 +
|-
 +
| 5 || const1 || || || = 0x1F always
 +
|-
 +
| 8 || id_in_gop || || || frame number in GOP (0 for I frame)
 +
|}
 +
 +
null frames don't contain anything else than this header.
 +
 +
=== GOP header ===
 +
 +
This header is present in I frames only. The values in this header are valid during the whole GOP starting at this frame.
 +
 +
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
 +
|- bgcolor="#f0f0f0" |
 +
! size !! name !! condition !! nb times !! comments
 +
|-
 +
| align="right" |  8 || <span id="gh_flags">gh_flags</span> || || || [[#gh_flags|gh_flags]] & 0x02 => YV12 (default YVU9)
 +
|-
 +
| align="right" | 16 || <span id="value1">value1</span> || [[#gh_flags|gh_flags]] & 0x01 || ||
 +
|-
 +
| align="right" | 32 || <span id="value2">value2</span> || [[#gh_flags|gh_flags]] & 0x20 || ||
 +
|-
 +
| align="right" |  2 || <span id="value3">value3</span> || [[#gh_flags|gh_flags]] & 0x40 || ||
 +
|-
 +
| align="right" |  3 || <span id="value4">value4</span> || || ||
 +
|-
 +
| align="right" |  4 || <span id="res_id">res_id</span> || || || see [[#Resolution_table|Resolution table]]
 +
|-
 +
| align="right" | 13 || <span id="height">height</span> || rowspan="2" | [[#res_id|res_id]] == 15 || || frame height
 +
|-
 +
| align="right" | 13 || <span id="width">width</span> || || frame width
 +
|-
 +
| align="right" |  6 || <span id="value5">value5</span> || || rowspan="2" | 2*n (n == 1 always?) ||
 +
|-
 +
| align="right" |  2 || <span id="value6">value6</span> || [[#value5|value5]] >> 3 || need to be = 0
 +
|-
 +
| align="right" |  4 || <span id="value7">value7</span> || rowspan="2" | [[#gh_flags|gh_flags]] & 0x08 || ||
 +
|-
 +
| align="right" | 24 || <span id="value8">value8</span> || ||
 +
|-
 +
| align="right" | ?? || <span id="alignment1">alignment1</span> || || || align bits reader on next byte
 +
|-
 +
| align="right" | 24 || <span id="value9">value9</span> || || ||
 +
|-
 +
| align="right" | 16 || <span id="value10">value10</span> || [[#value9|value9]] & 0x800000 || || loops while value10 & 0x8000 (probably some kind of VLC ?)
 +
|}
 +
 +
=== More header ===
 +
 +
This header is present in all kinds of frame except null.
 +
 +
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
 +
|- bgcolor="#f0f0f0" |
 +
! size !! name !! condition !! nb times !! comments
 +
|-
 +
| align="right" |  8 || <span id="mh_flags">mh_flags</span> || || ||
 +
|-
 +
| align="right" | 24 || <span id="frame_size">frame_size</span> || [[#mh_flags|mh_flags]] & 0x01 || || tolal size of frame data
 +
|-
 +
| align="right" | 16 || <span id="value11">value11</span> || [[#mh_flags|mh_flags]] & 0x10 || ||
 +
|-
 +
| align="right" |  8 || <span id="counter1">counter1</span> || rowspan="2" | [[#mh_flags|mh_flags]] & 0x20 || || rowspan="2" | this whole block loops while [[#counter1|counter1]] != 0
 +
|-
 +
| align="right" |  8 || <span id="value12">value12</span> || [[#counter1|counter1]]
 +
|-
 +
| align="right" |  3 || <span id="value13">value13</span> || [[#mh_flags|mh_flags]] & 0x40 || ||
 +
|-
 +
| align="right" |  4 || <span id="counter2">counter2</span> || rowspan="2" | [[#value13|value13]] == 7 || ||
 +
|-
 +
| align="right" |  4 || <span id="value14">value14</span> || [[#counter2|counter2]] ||
 +
|-
 +
| align="right" |  3 || <span id="value15">value15</span> || || ||
 +
|-
 +
| align="right" | ?? || <span id="alignment2">alignment2</span> || || || align bits reader on next byte
 +
|}
 +
 +
=== Plan header ===
 +
 +
This header is present at the beginning of every plan.
 +
 +
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
 +
|- bgcolor="#f0f0f0" |
 +
! size !! name !! condition !! nb times !! comments
 +
|-
 +
| align="right" |  8 || <span id="ph_flags">ph_flags</span> || || ||
 +
|-
 +
| align="right" | 24 || <span id="plan_size">plan_size</span> || [[#mh_flags|mh_flags]] & 0x80 || || tolal size of plan data
 +
|-
 +
| align="right" |  8 || <span id="counter3">counter3</span> || rowspan="3" | [[#ph_flags|ph_flags]] & 0x10 || || must be < 0x3E
 +
|-
 +
| align="right" |  8 || <span id="value16">value16</span> || rowspan="2" | [[#counter3|counter3]] ||
 +
|-
 +
| align="right" |  8 || <span id="value17">value17</span> ||
 +
|-
 +
| align="right" |  3 || <span id="value18">value18</span> || [[#ph_flags|ph_flags]] & 0x40 || ||
 +
|-
 +
| align="right" |  3 || <span id="table1_id">table1_id</span> || [[#ph_flags|ph_flags]] & 0x80 || || see [[#Table_1|Table 1]]
 +
|-
 +
| align="right" |  4 || <span id="counter4">counter4</span> || rowspan="2" | [[#table1_id|table1_id]] == 7 || || rowspan="2" | used instead of [[#Table1|Table1]]
 +
|-
 +
| align="right" |  4 || <span id="value19">value19</span> || [[#counter4|counter4]]
 +
|-
 +
| align="right" |  1 || <span id="value20">value20</span> || || ||
 +
|-
 +
| align="right" | 16 || <span id="value21">value21</span> || [[#value20|value20]] || ||
 +
|-
 +
| align="right" |  5 || <span id="value22">value22</span> || || ||
 +
|-
 +
| align="right" | ?? || <span id="alignment3">alignment3</span> || || || align bits reader on next byte
 +
|-
 +
| align="right" |  8 || <span id="counter5">counter5</span> || rowspan="4" | [[#ph_flags|ph_flags]] & 0x20 || || rowspan="3" | all of this is repeated as long as [[#value23|value23]] is true
 +
|-
 +
| align="right" |  8 || <span id="skip1">skip1</span> || [[#counter5|counter5]]
 +
|-
 +
| align="right" |  1 || <span id="value23">value23</span> ||
 +
|-
 +
| align="right" | ?? || <span id="alignment4">alignment4</span> || || align bits reader on next byte
 +
|}
 +
 +
 +
== Plan data ==
 +
 +
This is where the actual data is, but this still need to be reverse engineered :-(
 +
 +
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
 +
|- bgcolor="#f0f0f0" |
 +
! size !! name !! condition !! nb times !! comments
 +
|-
 +
| align="right" |  1 || <span id="value24">value24</span> || || ||
 +
|-
 +
| align="right" |  1 || <span id="value25">value25</span> || ! [[#value24|value24]] || || plan_data_size = value25
 +
|-
 +
| align="right" |  8 || <span id="value26">value26</span> || [[#value25|value25]] == 1 || || plan_data_size = value26
 +
|-
 +
| align="right" | 24 || <span id="value27">value27</span> || [[#value26|value26]] == 0xFF || || plan_data_size = value27
 +
|-
 +
| align="right" | ?? || ... || || || more data to analyze
 +
|}
 +
 +
 +
== Annexes ==
 +
 +
=== Resolution table ===
 +
 +
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
 +
! bgcolor="#f0f0f0" | res_id
 +
| 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11
 +
|-
 +
! bgcolor="#f0f0f0" | width
 +
| 640 || 320 || 160 || 704 || 352 || 352 || 176 || 240 || 640 || 704 || 80 || 88
 +
|-
 +
! bgcolor="#f0f0f0" | height
 +
| 480 || 240 || 120 || 224 || 240 || 288 || 144 || 180 || 240 || 240 || 60 || 72
 +
|}
 +
 +
=== Table 1 ===
 +
 +
{| border="1" cellpadding="5" style="border-collapse: collapse; border-style: dashed; border-color: #2f6fab;"
 +
! bgcolor="#f0f0f0" | table1_id
 +
| 0 || 1 || 2 || 3 || 4 || 5 || 6 || default
 +
|-
 +
! bgcolor="#f0f0f0" | counter4
 +
| 10 || 11 || 12 || 13 || 11 || 13 || 13 || 9
 +
|-
 +
! valign="top" bgcolor="#f0f0f0" | value19
 +
| valign="top" |
 +
{| border="0"
 +
| 1
 +
|-
 +
| 2
 +
|-
 +
| 3
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 7
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 4
 +
|-
 +
| 1
 +
|}
 +
| valign="top" |
 +
{| border="0"
 +
| 2
 +
|-
 +
| 3
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 7
 +
|-
 +
| 5
 +
|-
 +
| 4
 +
|-
 +
| 3
 +
|-
 +
| 3
 +
|-
 +
| 2
 +
|}
 +
| valign="top" |
 +
{| border="0"
 +
| 2
 +
|-
 +
| 4
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 6
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 3
 +
|-
 +
| 1
 +
|-
 +
| 1
 +
|}
 +
| valign="top" |
 +
{| border="0"
 +
| 3
 +
|-
 +
| 3
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 5
 +
|-
 +
| 6
 +
|-
 +
| 6
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 3
 +
|-
 +
| 2
 +
|-
 +
| 1
 +
|-
 +
| 1
 +
|}
 +
| valign="top" |
 +
{| border="0"
 +
| 3
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 6
 +
|-
 +
| 5
 +
|-
 +
| 4
 +
|-
 +
| 2
 +
|-
 +
| 2
 +
|}
 +
| valign="top" |
 +
{| border="0"
 +
| 3
 +
|-
 +
| 4
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 6
 +
|-
 +
| 4
 +
|-
 +
| 3
 +
|-
 +
| 3
 +
|-
 +
| 2
 +
|-
 +
| 1
 +
|-
 +
| 1
 +
|}
 +
| valign="top" |
 +
{| border="0"
 +
| 3
 +
|-
 +
| 4
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 6
 +
|-
 +
| 5
 +
|-
 +
| 4
 +
|-
 +
| 3
 +
|-
 +
| 3
 +
|-
 +
| 2
 +
|-
 +
| 1
 +
|-
 +
| 1
 +
|}
 +
| valign="top" |
 +
{| border="0"
 +
| 3
 +
|-
 +
| 4
 +
|-
 +
| 4
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|-
 +
| 6
 +
|-
 +
| 5
 +
|-
 +
| 5
 +
|}
 +
|}
 +
 +
default is used when !([[#ph_flags|ph_flags]] & 0x80)
 +
 +
 +
[[Category:Undiscovered Video Codecs]]
 +
[[Category:Video Codecs]]
 +
 +
 +
<div id="nolabel" style="overflow:auto;height:1px;">
 +
Pharmacy themes
 +
This very nice Pharmacy:
 +
Order tramadol, Search over 500,000 pharmacy Archive [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware
 +
[http://xanax-on-line.umaxnet.com/ xanax on line]
 +
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events in this-wait [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around
 +
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax]
 +
[http://buy-xanax-online.umaxnet.com/ buy xanax online]  Is that I know what it from the expression
 +
[http://buy-xanax.umaxnet.com/ buy xanax]
 +
</div>
  
 
== General description ==
 
== General description ==

Revision as of 20:59, 23 March 2006

General description

Frame layout

The general indeo5 frames layout is composed of one global header, followed by the content of the three YUV plans.

In this document, the global header is split into 3 parts:

  • Frame header: describe the kind of frame (I/P/B)
  • GOP header: some data which is true for all the frame in this GOP (present only in the first (I) frame of the GOP)
  • More header: some more data which is true only for this single frame

Each YUV plan begin with a Plan header, containing values which are valid only for this single plan.

Encoding

This codec is based on the slant transform. Other used standard techniques are huffman coding and motion compensation.

Conventions

Headers are described in some tables. Each row of those tables describes a value which may be read from the frame. Those tables and rows are presented in the order of appearance in the frame.

Here are the meaning of each columns:

  • size: The size of this value in bits. Bits are counted in MSB to LSB order. As an example, with the byte 01110000b, reading 3 bits then 5 bits will return 011b then 10000b.
  • name: Kind of variable name, used to reference the value. When a value is named valueX, it generally means we don't know it's purpose. Lines named alignmentX means that bits reader need to skip bits until next byte boundary.
  • condition: The value is present in the frame only if this condition is matched. No condition means that the value is always present.
  • nb times: How many times the value is repeated.
  • comments: Some details about the content of the value. It may also explain that a value is repeated until a certain condition is reached.


Headers

Frame header

size name condition nb times comments
3 frame_flags
  • frame_flags & 0x01 => backward predictive
  • frame_flags & 0x02 => forward predictive
  • frame_flags & 0x04 => null frame

common values:

  • 0 => I frame
  • 1 => P frame
  • 3 => B frame
5 const1 = 0x1F always
8 id_in_gop frame number in GOP (0 for I frame)

null frames don't contain anything else than this header.

GOP header

This header is present in I frames only. The values in this header are valid during the whole GOP starting at this frame.

size name condition nb times comments
8 <span id="gh_flags">gh_flags</span> gh_flags & 0x02 => YV12 (default YVU9)
16 <span id="value1">value1</span> gh_flags & 0x01
32 <span id="value2">value2</span> gh_flags & 0x20
2 <span id="value3">value3</span> gh_flags & 0x40
3 <span id="value4">value4</span>
4 <span id="res_id">res_id</span> see Resolution table
13 <span id="height">height</span> res_id == 15 frame height
13 <span id="width">width</span> frame width
6 <span id="value5">value5</span> 2*n (n == 1 always?)
2 <span id="value6">value6</span> value5 >> 3 need to be = 0
4 <span id="value7">value7</span> gh_flags & 0x08
24 <span id="value8">value8</span>
?? <span id="alignment1">alignment1</span> align bits reader on next byte
24 <span id="value9">value9</span>
16 <span id="value10">value10</span> value9 & 0x800000 loops while value10 & 0x8000 (probably some kind of VLC ?)

More header

This header is present in all kinds of frame except null.

size name condition nb times comments
8 <span id="mh_flags">mh_flags</span>
24 <span id="frame_size">frame_size</span> mh_flags & 0x01 tolal size of frame data
16 <span id="value11">value11</span> mh_flags & 0x10
8 <span id="counter1">counter1</span> mh_flags & 0x20 this whole block loops while counter1 != 0
8 <span id="value12">value12</span> counter1
3 <span id="value13">value13</span> mh_flags & 0x40
4 <span id="counter2">counter2</span> value13 == 7
4 <span id="value14">value14</span> counter2
3 <span id="value15">value15</span>
?? <span id="alignment2">alignment2</span> align bits reader on next byte

Plan header

This header is present at the beginning of every plan.

size name condition nb times comments
8 <span id="ph_flags">ph_flags</span>
24 <span id="plan_size">plan_size</span> mh_flags & 0x80 tolal size of plan data
8 <span id="counter3">counter3</span> ph_flags & 0x10 must be < 0x3E
8 <span id="value16">value16</span> counter3
8 <span id="value17">value17</span>
3 <span id="value18">value18</span> ph_flags & 0x40
3 <span id="table1_id">table1_id</span> ph_flags & 0x80 see Table 1
4 <span id="counter4">counter4</span> table1_id == 7 used instead of Table1
4 <span id="value19">value19</span> counter4
1 <span id="value20">value20</span>
16 <span id="value21">value21</span> value20
5 <span id="value22">value22</span>
?? <span id="alignment3">alignment3</span> align bits reader on next byte
8 <span id="counter5">counter5</span> ph_flags & 0x20 all of this is repeated as long as value23 is true
8 <span id="skip1">skip1</span> counter5
1 <span id="value23">value23</span>
?? <span id="alignment4">alignment4</span> align bits reader on next byte


Plan data

This is where the actual data is, but this still need to be reverse engineered :-(

size name condition nb times comments
1 <span id="value24">value24</span>
1 <span id="value25">value25</span> ! value24 plan_data_size = value25
8 <span id="value26">value26</span> value25 == 1 plan_data_size = value26
24 <span id="value27">value27</span> value26 == 0xFF plan_data_size = value27
?? ... more data to analyze


Annexes

Resolution table

res_id 0 1 2 3 4 5 6 7 8 9 10 11
width 640 320 160 704 352 352 176 240 640 704 80 88
height 480 240 120 224 240 288 144 180 240 240 60 72

Table 1

table1_id 0 1 2 3 4 5 6 default
counter4 10 11 12 13 11 13 13 9
value19
1
2
3
4
4
7
5
5
4
1
2
3
4
4
4
7
5
4
3
3
2
2
4
5
5
5
5
6
4
4
3
1
1
3
3
4
4
5
6
6
4
4
3
2
1
1
3
4
4
5
5
5
6
5
4
2
2
3
4
5
5
5
5
6
4
3
3
2
1
1
3
4
5
5
5
6
5
4
3
3
2
1
1
3
4
4
5
5
5
6
5
5

default is used when !(ph_flags & 0x80)


Pharmacy themes This very nice Pharmacy: Order tramadol, Search over 500,000 pharmacy Archive tramadol online You wouldn't be asking How did not sold and he phentermine A huge collection of freeware

xanax on line 

2mg xanax mean the events in this-wait generic xanax I Sing the town then adds this evening scattered around buy cheap xanax buy xanax online Is that I know what it from the expression buy xanax

General description

Frame layout

The general indeo5 frames layout is composed of one global header, followed by the content of the three YUV plans.

In this document, the global header is split into 3 parts:

  • Frame header: describe the kind of frame (I/P/B)
  • GOP header: some data which is true for all the frame in this GOP (present only in the first (I) frame of the GOP)
  • More header: some more data which is true only for this single frame

Each YUV plan begin with a Plan header, containing values which are valid only for this single plan.

Encoding

This codec is based on the slant transform. Other used standard techniques are huffman coding and motion compensation.

Conventions

Headers are described in some tables. Each row of those tables describes a value which may be read from the frame. Those tables and rows are presented in the order of appearance in the frame.

Here are the meaning of each columns:

  • size: The size of this value in bits. Bits are counted in MSB to LSB order. As an example, with the byte 01110000b, reading 3 bits then 5 bits will return 011b then 10000b.
  • name: Kind of variable name, used to reference the value. When a value is named valueX, it generally means we don't know it's purpose. Lines named alignmentX means that bits reader need to skip bits until next byte boundary.
  • condition: The value is present in the frame only if this condition is matched. No condition means that the value is always present.
  • nb times: How many times the value is repeated.
  • comments: Some details about the content of the value. It may also explain that a value is repeated until a certain condition is reached.


Headers

Frame header

size name condition nb times comments
3 frame_flags
  • frame_flags & 0x01 => backward predictive
  • frame_flags & 0x02 => forward predictive
  • frame_flags & 0x04 => null frame

common values:

  • 0 => I frame
  • 1 => P frame
  • 3 => B frame
5 const1 = 0x1F always
8 id_in_gop frame number in GOP (0 for I frame)

null frames don't contain anything else than this header.

GOP header

This header is present in I frames only. The values in this header are valid during the whole GOP starting at this frame.

size name condition nb times comments
8 gh_flags gh_flags & 0x02 => YV12 (default YVU9)
16 value1 gh_flags & 0x01
32 value2 gh_flags & 0x20
2 value3 gh_flags & 0x40
3 value4
4 res_id see Resolution table
13 height res_id == 15 frame height
13 width frame width
6 value5 2*n (n == 1 always?)
2 value6 value5 >> 3 need to be = 0
4 value7 gh_flags & 0x08
24 value8
?? alignment1 align bits reader on next byte
24 value9
16 value10 value9 & 0x800000 loops while value10 & 0x8000 (probably some kind of VLC ?)

More header

This header is present in all kinds of frame except null.

size name condition nb times comments
8 mh_flags
24 frame_size mh_flags & 0x01 tolal size of frame data
16 value11 mh_flags & 0x10
8 counter1 mh_flags & 0x20 this whole block loops while counter1 != 0
8 value12 counter1
3 value13 mh_flags & 0x40
4 counter2 value13 == 7
4 value14 counter2
3 value15
?? alignment2 align bits reader on next byte

Plan header

This header is present at the beginning of every plan.

size name condition nb times comments
8 ph_flags
24 plan_size mh_flags & 0x80 tolal size of plan data
8 counter3 ph_flags & 0x10 must be < 0x3E
8 value16 counter3
8 value17
3 value18 ph_flags & 0x40
3 table1_id ph_flags & 0x80 see Table 1
4 counter4 table1_id == 7 used instead of Table1
4 value19 counter4
1 value20
16 value21 value20
5 value22
?? alignment3 align bits reader on next byte
8 counter5 ph_flags & 0x20 all of this is repeated as long as value23 is true
8 skip1 counter5
1 value23
?? alignment4 align bits reader on next byte


Plan data

This is where the actual data is, but this still need to be reverse engineered :-(

size name condition nb times comments
1 value24
1 value25 ! value24 plan_data_size = value25
8 value26 value25 == 1 plan_data_size = value26
24 value27 value26 == 0xFF plan_data_size = value27
?? ... more data to analyze


Annexes

Resolution table

res_id 0 1 2 3 4 5 6 7 8 9 10 11
width 640 320 160 704 352 352 176 240 640 704 80 88
height 480 240 120 224 240 288 144 180 240 240 60 72

Table 1

table1_id 0 1 2 3 4 5 6 default
counter4 10 11 12 13 11 13 13 9
value19
1
2
3
4
4
7
5
5
4
1
2
3
4
4
4
7
5
4
3
3
2
2
4
5
5
5
5
6
4
4
3
1
1
3
3
4
4
5
6
6
4
4
3
2
1
1
3
4
4
5
5
5
6
5
4
2
2
3
4
5
5
5
5
6
4
3
3
2
1
1
3
4
5
5
5
6
5
4
3
3
2
1
1
3
4
4
5
5
5
6
5
5

default is used when !(ph_flags & 0x80)