diff --git a/wolf3d/base/iphone/0.5551 b/wolf3d/base/iphone/0.5551
new file mode 100644
index 0000000..6b1f269
Binary files /dev/null and b/wolf3d/base/iphone/0.5551 differ
diff --git a/wolf3d/base/iphone/1.5551 b/wolf3d/base/iphone/1.5551
new file mode 100644
index 0000000..08c580f
Binary files /dev/null and b/wolf3d/base/iphone/1.5551 differ
diff --git a/wolf3d/base/iphone/2.5551 b/wolf3d/base/iphone/2.5551
new file mode 100644
index 0000000..8ae03ab
Binary files /dev/null and b/wolf3d/base/iphone/2.5551 differ
diff --git a/wolf3d/base/iphone/3.5551 b/wolf3d/base/iphone/3.5551
new file mode 100644
index 0000000..d745e4d
Binary files /dev/null and b/wolf3d/base/iphone/3.5551 differ
diff --git a/wolf3d/base/iphone/4.5551 b/wolf3d/base/iphone/4.5551
new file mode 100644
index 0000000..0df08a9
Binary files /dev/null and b/wolf3d/base/iphone/4.5551 differ
diff --git a/wolf3d/base/iphone/5.5551 b/wolf3d/base/iphone/5.5551
new file mode 100644
index 0000000..4ed6bc5
Binary files /dev/null and b/wolf3d/base/iphone/5.5551 differ
diff --git a/wolf3d/base/iphone/6.5551 b/wolf3d/base/iphone/6.5551
new file mode 100644
index 0000000..a8594bb
Binary files /dev/null and b/wolf3d/base/iphone/6.5551 differ
diff --git a/wolf3d/base/iphone/7.5551 b/wolf3d/base/iphone/7.5551
new file mode 100644
index 0000000..66ff538
Binary files /dev/null and b/wolf3d/base/iphone/7.5551 differ
diff --git a/wolf3d/base/iphone/8.5551 b/wolf3d/base/iphone/8.5551
new file mode 100644
index 0000000..daeb3c6
Binary files /dev/null and b/wolf3d/base/iphone/8.5551 differ
diff --git a/wolf3d/base/iphone/9.5551 b/wolf3d/base/iphone/9.5551
new file mode 100644
index 0000000..81bf8e7
Binary files /dev/null and b/wolf3d/base/iphone/9.5551 differ
diff --git a/wolf3d/base/iphone/FACE1APIC.5551 b/wolf3d/base/iphone/FACE1APIC.5551
new file mode 100644
index 0000000..013200d
Binary files /dev/null and b/wolf3d/base/iphone/FACE1APIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE1BPIC.5551 b/wolf3d/base/iphone/FACE1BPIC.5551
new file mode 100644
index 0000000..af998f2
Binary files /dev/null and b/wolf3d/base/iphone/FACE1BPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE1CPIC.5551 b/wolf3d/base/iphone/FACE1CPIC.5551
new file mode 100644
index 0000000..5aa5f6e
Binary files /dev/null and b/wolf3d/base/iphone/FACE1CPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE2APIC.5551 b/wolf3d/base/iphone/FACE2APIC.5551
new file mode 100644
index 0000000..d301d2a
Binary files /dev/null and b/wolf3d/base/iphone/FACE2APIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE2BPIC.5551 b/wolf3d/base/iphone/FACE2BPIC.5551
new file mode 100644
index 0000000..c5c3d26
Binary files /dev/null and b/wolf3d/base/iphone/FACE2BPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE2CPIC.5551 b/wolf3d/base/iphone/FACE2CPIC.5551
new file mode 100644
index 0000000..a8294a1
Binary files /dev/null and b/wolf3d/base/iphone/FACE2CPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE3APIC.5551 b/wolf3d/base/iphone/FACE3APIC.5551
new file mode 100644
index 0000000..0f4e5eb
Binary files /dev/null and b/wolf3d/base/iphone/FACE3APIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE3BPIC.5551 b/wolf3d/base/iphone/FACE3BPIC.5551
new file mode 100644
index 0000000..8b59d3e
Binary files /dev/null and b/wolf3d/base/iphone/FACE3BPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE3CPIC.5551 b/wolf3d/base/iphone/FACE3CPIC.5551
new file mode 100644
index 0000000..5cbfd2d
Binary files /dev/null and b/wolf3d/base/iphone/FACE3CPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE4APIC.5551 b/wolf3d/base/iphone/FACE4APIC.5551
new file mode 100644
index 0000000..244a004
Binary files /dev/null and b/wolf3d/base/iphone/FACE4APIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE4BPIC.5551 b/wolf3d/base/iphone/FACE4BPIC.5551
new file mode 100644
index 0000000..72c74ef
Binary files /dev/null and b/wolf3d/base/iphone/FACE4BPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE4CPIC.5551 b/wolf3d/base/iphone/FACE4CPIC.5551
new file mode 100644
index 0000000..df38e16
Binary files /dev/null and b/wolf3d/base/iphone/FACE4CPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE5APIC.5551 b/wolf3d/base/iphone/FACE5APIC.5551
new file mode 100644
index 0000000..337c9d1
Binary files /dev/null and b/wolf3d/base/iphone/FACE5APIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE5BPIC.5551 b/wolf3d/base/iphone/FACE5BPIC.5551
new file mode 100644
index 0000000..377a02c
Binary files /dev/null and b/wolf3d/base/iphone/FACE5BPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE5CPIC.5551 b/wolf3d/base/iphone/FACE5CPIC.5551
new file mode 100644
index 0000000..b394099
Binary files /dev/null and b/wolf3d/base/iphone/FACE5CPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE6APIC.5551 b/wolf3d/base/iphone/FACE6APIC.5551
new file mode 100644
index 0000000..b51e3f0
Binary files /dev/null and b/wolf3d/base/iphone/FACE6APIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE6BPIC.5551 b/wolf3d/base/iphone/FACE6BPIC.5551
new file mode 100644
index 0000000..61f8c19
Binary files /dev/null and b/wolf3d/base/iphone/FACE6BPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE6CPIC.5551 b/wolf3d/base/iphone/FACE6CPIC.5551
new file mode 100644
index 0000000..ce63b12
Binary files /dev/null and b/wolf3d/base/iphone/FACE6CPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE7APIC.5551 b/wolf3d/base/iphone/FACE7APIC.5551
new file mode 100644
index 0000000..257f22a
Binary files /dev/null and b/wolf3d/base/iphone/FACE7APIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE7BPIC.5551 b/wolf3d/base/iphone/FACE7BPIC.5551
new file mode 100644
index 0000000..80c4c37
Binary files /dev/null and b/wolf3d/base/iphone/FACE7BPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE7CPIC.5551 b/wolf3d/base/iphone/FACE7CPIC.5551
new file mode 100644
index 0000000..9a290c8
Binary files /dev/null and b/wolf3d/base/iphone/FACE7CPIC.5551 differ
diff --git a/wolf3d/base/iphone/FACE8APIC.5551 b/wolf3d/base/iphone/FACE8APIC.5551
new file mode 100644
index 0000000..08993cc
Binary files /dev/null and b/wolf3d/base/iphone/FACE8APIC.5551 differ
diff --git a/wolf3d/base/iphone/GOTGATLINGPIC.5551 b/wolf3d/base/iphone/GOTGATLINGPIC.5551
new file mode 100644
index 0000000..245219f
Binary files /dev/null and b/wolf3d/base/iphone/GOTGATLINGPIC.5551 differ
diff --git a/wolf3d/base/iphone/L_damage.5551 b/wolf3d/base/iphone/L_damage.5551
new file mode 100644
index 0000000..288ab43
Binary files /dev/null and b/wolf3d/base/iphone/L_damage.5551 differ
diff --git a/wolf3d/base/iphone/R_damage.5551 b/wolf3d/base/iphone/R_damage.5551
new file mode 100644
index 0000000..f6223c0
Binary files /dev/null and b/wolf3d/base/iphone/R_damage.5551 differ
diff --git a/wolf3d/base/iphone/advanced_button.5551 b/wolf3d/base/iphone/advanced_button.5551
new file mode 100644
index 0000000..50785e1
Binary files /dev/null and b/wolf3d/base/iphone/advanced_button.5551 differ
diff --git a/wolf3d/base/iphone/background_1.5551 b/wolf3d/base/iphone/background_1.5551
new file mode 100644
index 0000000..6d893b7
Binary files /dev/null and b/wolf3d/base/iphone/background_1.5551 differ
diff --git a/wolf3d/base/iphone/button_back.5551 b/wolf3d/base/iphone/button_back.5551
new file mode 100644
index 0000000..87d2cf5
Binary files /dev/null and b/wolf3d/base/iphone/button_back.5551 differ
diff --git a/wolf3d/base/iphone/button_control.5551 b/wolf3d/base/iphone/button_control.5551
new file mode 100644
index 0000000..db82c75
Binary files /dev/null and b/wolf3d/base/iphone/button_control.5551 differ
diff --git a/wolf3d/base/iphone/button_ep1.5551 b/wolf3d/base/iphone/button_ep1.5551
new file mode 100644
index 0000000..d7bb11e
Binary files /dev/null and b/wolf3d/base/iphone/button_ep1.5551 differ
diff --git a/wolf3d/base/iphone/button_ep2.5551 b/wolf3d/base/iphone/button_ep2.5551
new file mode 100644
index 0000000..0f5a4bd
Binary files /dev/null and b/wolf3d/base/iphone/button_ep2.5551 differ
diff --git a/wolf3d/base/iphone/button_ep3.5551 b/wolf3d/base/iphone/button_ep3.5551
new file mode 100644
index 0000000..106001d
Binary files /dev/null and b/wolf3d/base/iphone/button_ep3.5551 differ
diff --git a/wolf3d/base/iphone/button_ep4.5551 b/wolf3d/base/iphone/button_ep4.5551
new file mode 100644
index 0000000..4393d73
Binary files /dev/null and b/wolf3d/base/iphone/button_ep4.5551 differ
diff --git a/wolf3d/base/iphone/button_ep5.5551 b/wolf3d/base/iphone/button_ep5.5551
new file mode 100644
index 0000000..496649a
Binary files /dev/null and b/wolf3d/base/iphone/button_ep5.5551 differ
diff --git a/wolf3d/base/iphone/button_ep6.5551 b/wolf3d/base/iphone/button_ep6.5551
new file mode 100644
index 0000000..1c4081a
Binary files /dev/null and b/wolf3d/base/iphone/button_ep6.5551 differ
diff --git a/wolf3d/base/iphone/button_levels.5551 b/wolf3d/base/iphone/button_levels.5551
new file mode 100644
index 0000000..f6b2d46
Binary files /dev/null and b/wolf3d/base/iphone/button_levels.5551 differ
diff --git a/wolf3d/base/iphone/button_new.5551 b/wolf3d/base/iphone/button_new.5551
new file mode 100644
index 0000000..f97224c
Binary files /dev/null and b/wolf3d/base/iphone/button_new.5551 differ
diff --git a/wolf3d/base/iphone/button_resume.5551 b/wolf3d/base/iphone/button_resume.5551
new file mode 100644
index 0000000..e03ed44
Binary files /dev/null and b/wolf3d/base/iphone/button_resume.5551 differ
diff --git a/wolf3d/base/iphone/button_skill1.5551 b/wolf3d/base/iphone/button_skill1.5551
new file mode 100644
index 0000000..6382e3d
Binary files /dev/null and b/wolf3d/base/iphone/button_skill1.5551 differ
diff --git a/wolf3d/base/iphone/button_skill2.5551 b/wolf3d/base/iphone/button_skill2.5551
new file mode 100644
index 0000000..62c1b6d
Binary files /dev/null and b/wolf3d/base/iphone/button_skill2.5551 differ
diff --git a/wolf3d/base/iphone/button_skill3.5551 b/wolf3d/base/iphone/button_skill3.5551
new file mode 100644
index 0000000..97d999f
Binary files /dev/null and b/wolf3d/base/iphone/button_skill3.5551 differ
diff --git a/wolf3d/base/iphone/button_skill4.5551 b/wolf3d/base/iphone/button_skill4.5551
new file mode 100644
index 0000000..79ffd0b
Binary files /dev/null and b/wolf3d/base/iphone/button_skill4.5551 differ
diff --git a/wolf3d/base/iphone/button_web.5551 b/wolf3d/base/iphone/button_web.5551
new file mode 100644
index 0000000..fa549fd
Binary files /dev/null and b/wolf3d/base/iphone/button_web.5551 differ
diff --git a/wolf3d/base/iphone/diractional_01.5551 b/wolf3d/base/iphone/diractional_01.5551
new file mode 100644
index 0000000..c6ebd44
Binary files /dev/null and b/wolf3d/base/iphone/diractional_01.5551 differ
diff --git a/wolf3d/base/iphone/diractional_02.5551 b/wolf3d/base/iphone/diractional_02.5551
new file mode 100644
index 0000000..0035e66
Binary files /dev/null and b/wolf3d/base/iphone/diractional_02.5551 differ
diff --git a/wolf3d/base/iphone/diractional_03.5551 b/wolf3d/base/iphone/diractional_03.5551
new file mode 100644
index 0000000..b453eb2
Binary files /dev/null and b/wolf3d/base/iphone/diractional_03.5551 differ
diff --git a/wolf3d/base/iphone/ep_1.5551 b/wolf3d/base/iphone/ep_1.5551
new file mode 100644
index 0000000..89314db
Binary files /dev/null and b/wolf3d/base/iphone/ep_1.5551 differ
diff --git a/wolf3d/base/iphone/ep_1_6.5551 b/wolf3d/base/iphone/ep_1_6.5551
new file mode 100644
index 0000000..4617230
Binary files /dev/null and b/wolf3d/base/iphone/ep_1_6.5551 differ
diff --git a/wolf3d/base/iphone/font1.5551 b/wolf3d/base/iphone/font1.5551
new file mode 100644
index 0000000..6e5cd3c
Binary files /dev/null and b/wolf3d/base/iphone/font1.5551 differ
diff --git a/wolf3d/base/iphone/gold_key.5551 b/wolf3d/base/iphone/gold_key.5551
new file mode 100644
index 0000000..0e3e478
Binary files /dev/null and b/wolf3d/base/iphone/gold_key.5551 differ
diff --git a/wolf3d/base/iphone/intermission_256.5551 b/wolf3d/base/iphone/intermission_256.5551
new file mode 100644
index 0000000..127a447
Binary files /dev/null and b/wolf3d/base/iphone/intermission_256.5551 differ
diff --git a/wolf3d/base/iphone/kills.5551 b/wolf3d/base/iphone/kills.5551
new file mode 100644
index 0000000..188af71
Binary files /dev/null and b/wolf3d/base/iphone/kills.5551 differ
diff --git a/wolf3d/base/iphone/layout_1.5551 b/wolf3d/base/iphone/layout_1.5551
new file mode 100644
index 0000000..42a72a0
Binary files /dev/null and b/wolf3d/base/iphone/layout_1.5551 differ
diff --git a/wolf3d/base/iphone/layout_2.5551 b/wolf3d/base/iphone/layout_2.5551
new file mode 100644
index 0000000..56077bd
Binary files /dev/null and b/wolf3d/base/iphone/layout_2.5551 differ
diff --git a/wolf3d/base/iphone/layout_3.5551 b/wolf3d/base/iphone/layout_3.5551
new file mode 100644
index 0000000..8191ade
Binary files /dev/null and b/wolf3d/base/iphone/layout_3.5551 differ
diff --git a/wolf3d/base/iphone/layout_4.5551 b/wolf3d/base/iphone/layout_4.5551
new file mode 100644
index 0000000..88ac110
Binary files /dev/null and b/wolf3d/base/iphone/layout_4.5551 differ
diff --git a/wolf3d/base/iphone/map.5551 b/wolf3d/base/iphone/map.5551
new file mode 100644
index 0000000..d77cde1
Binary files /dev/null and b/wolf3d/base/iphone/map.5551 differ
diff --git a/wolf3d/base/iphone/menu.5551 b/wolf3d/base/iphone/menu.5551
new file mode 100644
index 0000000..26caaa3
Binary files /dev/null and b/wolf3d/base/iphone/menu.5551 differ
diff --git a/wolf3d/base/iphone/music_off.5551 b/wolf3d/base/iphone/music_off.5551
new file mode 100644
index 0000000..4af6c76
Binary files /dev/null and b/wolf3d/base/iphone/music_off.5551 differ
diff --git a/wolf3d/base/iphone/music_on.5551 b/wolf3d/base/iphone/music_on.5551
new file mode 100644
index 0000000..ad24ed8
Binary files /dev/null and b/wolf3d/base/iphone/music_on.5551 differ
diff --git a/wolf3d/base/iphone/partime.5551 b/wolf3d/base/iphone/partime.5551
new file mode 100644
index 0000000..e4678e8
Binary files /dev/null and b/wolf3d/base/iphone/partime.5551 differ
diff --git a/wolf3d/base/iphone/secrets.5551 b/wolf3d/base/iphone/secrets.5551
new file mode 100644
index 0000000..dda390f
Binary files /dev/null and b/wolf3d/base/iphone/secrets.5551 differ
diff --git a/wolf3d/base/iphone/shoot.5551 b/wolf3d/base/iphone/shoot.5551
new file mode 100644
index 0000000..d72e141
Binary files /dev/null and b/wolf3d/base/iphone/shoot.5551 differ
diff --git a/wolf3d/base/iphone/side_2_side.5551 b/wolf3d/base/iphone/side_2_side.5551
new file mode 100644
index 0000000..2a9b817
Binary files /dev/null and b/wolf3d/base/iphone/side_2_side.5551 differ
diff --git a/wolf3d/base/iphone/silver_key.5551 b/wolf3d/base/iphone/silver_key.5551
new file mode 100644
index 0000000..00766fd
Binary files /dev/null and b/wolf3d/base/iphone/silver_key.5551 differ
diff --git a/wolf3d/base/iphone/stat_bar_1.5551 b/wolf3d/base/iphone/stat_bar_1.5551
new file mode 100644
index 0000000..55f991d
Binary files /dev/null and b/wolf3d/base/iphone/stat_bar_1.5551 differ
diff --git a/wolf3d/base/iphone/stat_bar_2.5551 b/wolf3d/base/iphone/stat_bar_2.5551
new file mode 100644
index 0000000..bf4bb9d
Binary files /dev/null and b/wolf3d/base/iphone/stat_bar_2.5551 differ
diff --git a/wolf3d/base/iphone/stats.5551 b/wolf3d/base/iphone/stats.5551
new file mode 100644
index 0000000..31975fb
Binary files /dev/null and b/wolf3d/base/iphone/stats.5551 differ
diff --git a/wolf3d/base/iphone/status_hud.5551 b/wolf3d/base/iphone/status_hud.5551
new file mode 100644
index 0000000..3377f0c
Binary files /dev/null and b/wolf3d/base/iphone/status_hud.5551 differ
diff --git a/wolf3d/base/iphone/treasure.5551 b/wolf3d/base/iphone/treasure.5551
new file mode 100644
index 0000000..2b6f561
Binary files /dev/null and b/wolf3d/base/iphone/treasure.5551 differ
diff --git a/wolf3d/base/iphone/up_down.5551 b/wolf3d/base/iphone/up_down.5551
new file mode 100644
index 0000000..4c6f04c
Binary files /dev/null and b/wolf3d/base/iphone/up_down.5551 differ
diff --git a/wolf3d/base/iphone/victory_256.5551 b/wolf3d/base/iphone/victory_256.5551
new file mode 100644
index 0000000..c17bdc4
Binary files /dev/null and b/wolf3d/base/iphone/victory_256.5551 differ
diff --git a/wolf3d/base/iphone/wolf_logo.5551 b/wolf3d/base/iphone/wolf_logo.5551
new file mode 100644
index 0000000..cbcb7cd
Binary files /dev/null and b/wolf3d/base/iphone/wolf_logo.5551 differ
diff --git a/wolf3d/base/sprites/002.5551 b/wolf3d/base/sprites/002.5551
index dd36835..25f3320 100644
Binary files a/wolf3d/base/sprites/002.5551 and b/wolf3d/base/sprites/002.5551 differ
diff --git a/wolf3d/base/sprites/003.5551 b/wolf3d/base/sprites/003.5551
index 222dc5b..16184bf 100644
Binary files a/wolf3d/base/sprites/003.5551 and b/wolf3d/base/sprites/003.5551 differ
diff --git a/wolf3d/base/sprites/005.5551 b/wolf3d/base/sprites/005.5551
index 97db7c3..7438a75 100644
Binary files a/wolf3d/base/sprites/005.5551 and b/wolf3d/base/sprites/005.5551 differ
diff --git a/wolf3d/base/sprites/006.5551 b/wolf3d/base/sprites/006.5551
index fe4e549..1caad60 100644
Binary files a/wolf3d/base/sprites/006.5551 and b/wolf3d/base/sprites/006.5551 differ
diff --git a/wolf3d/base/sprites/008.5551 b/wolf3d/base/sprites/008.5551
index b616457..49fc932 100644
Binary files a/wolf3d/base/sprites/008.5551 and b/wolf3d/base/sprites/008.5551 differ
diff --git a/wolf3d/base/sprites/009.5551 b/wolf3d/base/sprites/009.5551
index 578bcba..e90672a 100644
Binary files a/wolf3d/base/sprites/009.5551 and b/wolf3d/base/sprites/009.5551 differ
diff --git a/wolf3d/base/sprites/010.5551 b/wolf3d/base/sprites/010.5551
index a6524dd..1802f0b 100644
Binary files a/wolf3d/base/sprites/010.5551 and b/wolf3d/base/sprites/010.5551 differ
diff --git a/wolf3d/base/sprites/013.5551 b/wolf3d/base/sprites/013.5551
index 153091d..ad643fa 100644
Binary files a/wolf3d/base/sprites/013.5551 and b/wolf3d/base/sprites/013.5551 differ
diff --git a/wolf3d/base/sprites/014.5551 b/wolf3d/base/sprites/014.5551
index fa9e356..6c6fc6b 100644
Binary files a/wolf3d/base/sprites/014.5551 and b/wolf3d/base/sprites/014.5551 differ
diff --git a/wolf3d/base/sprites/015.5551 b/wolf3d/base/sprites/015.5551
index c1eddb8..f67cba3 100644
Binary files a/wolf3d/base/sprites/015.5551 and b/wolf3d/base/sprites/015.5551 differ
diff --git a/wolf3d/base/sprites/016.5551 b/wolf3d/base/sprites/016.5551
index 6d568b7..404b094 100644
Binary files a/wolf3d/base/sprites/016.5551 and b/wolf3d/base/sprites/016.5551 differ
diff --git a/wolf3d/base/sprites/018.5551 b/wolf3d/base/sprites/018.5551
index e6a25a4..390084a 100644
Binary files a/wolf3d/base/sprites/018.5551 and b/wolf3d/base/sprites/018.5551 differ
diff --git a/wolf3d/base/sprites/019.5551 b/wolf3d/base/sprites/019.5551
index a1977d0..ad2127e 100644
Binary files a/wolf3d/base/sprites/019.5551 and b/wolf3d/base/sprites/019.5551 differ
diff --git a/wolf3d/base/sprites/021.5551 b/wolf3d/base/sprites/021.5551
index 245544a..62a4dc5 100644
Binary files a/wolf3d/base/sprites/021.5551 and b/wolf3d/base/sprites/021.5551 differ
diff --git a/wolf3d/base/sprites/022.5551 b/wolf3d/base/sprites/022.5551
index 5b7b15d..f4c1abe 100644
Binary files a/wolf3d/base/sprites/022.5551 and b/wolf3d/base/sprites/022.5551 differ
diff --git a/wolf3d/base/sprites/023.5551 b/wolf3d/base/sprites/023.5551
index cfc475d..ef3bd00 100644
Binary files a/wolf3d/base/sprites/023.5551 and b/wolf3d/base/sprites/023.5551 differ
diff --git a/wolf3d/base/sprites/025.5551 b/wolf3d/base/sprites/025.5551
index 8ebad7c..9efbbf9 100644
Binary files a/wolf3d/base/sprites/025.5551 and b/wolf3d/base/sprites/025.5551 differ
diff --git a/wolf3d/base/sprites/026.5551 b/wolf3d/base/sprites/026.5551
index 6b45aea..cfd2648 100644
Binary files a/wolf3d/base/sprites/026.5551 and b/wolf3d/base/sprites/026.5551 differ
diff --git a/wolf3d/base/sprites/028.5551 b/wolf3d/base/sprites/028.5551
index a32bd00..56fbe98 100644
Binary files a/wolf3d/base/sprites/028.5551 and b/wolf3d/base/sprites/028.5551 differ
diff --git a/wolf3d/base/sprites/029.5551 b/wolf3d/base/sprites/029.5551
index f3b4428..2b67499 100644
Binary files a/wolf3d/base/sprites/029.5551 and b/wolf3d/base/sprites/029.5551 differ
diff --git a/wolf3d/base/sprites/030.5551 b/wolf3d/base/sprites/030.5551
index 216853b..77f2688 100644
Binary files a/wolf3d/base/sprites/030.5551 and b/wolf3d/base/sprites/030.5551 differ
diff --git a/wolf3d/base/sprites/031.5551 b/wolf3d/base/sprites/031.5551
index bd6272b..0c49f82 100644
Binary files a/wolf3d/base/sprites/031.5551 and b/wolf3d/base/sprites/031.5551 differ
diff --git a/wolf3d/base/sprites/032.5551 b/wolf3d/base/sprites/032.5551
index 240d76c..05b2ecd 100644
Binary files a/wolf3d/base/sprites/032.5551 and b/wolf3d/base/sprites/032.5551 differ
diff --git a/wolf3d/base/sprites/033.5551 b/wolf3d/base/sprites/033.5551
index a5c9ef9..0e27060 100644
Binary files a/wolf3d/base/sprites/033.5551 and b/wolf3d/base/sprites/033.5551 differ
diff --git a/wolf3d/base/sprites/034.5551 b/wolf3d/base/sprites/034.5551
index b7fa952..8cf6f4e 100644
Binary files a/wolf3d/base/sprites/034.5551 and b/wolf3d/base/sprites/034.5551 differ
diff --git a/wolf3d/base/sprites/035.5551 b/wolf3d/base/sprites/035.5551
index a2e0993..9201164 100644
Binary files a/wolf3d/base/sprites/035.5551 and b/wolf3d/base/sprites/035.5551 differ
diff --git a/wolf3d/base/sprites/037.5551 b/wolf3d/base/sprites/037.5551
index 19f2360..62ca9d7 100644
Binary files a/wolf3d/base/sprites/037.5551 and b/wolf3d/base/sprites/037.5551 differ
diff --git a/wolf3d/base/sprites/038.5551 b/wolf3d/base/sprites/038.5551
index 3e44f54..a56389b 100644
Binary files a/wolf3d/base/sprites/038.5551 and b/wolf3d/base/sprites/038.5551 differ
diff --git a/wolf3d/base/sprites/041.5551 b/wolf3d/base/sprites/041.5551
index 0cc89da..79d6e39 100644
Binary files a/wolf3d/base/sprites/041.5551 and b/wolf3d/base/sprites/041.5551 differ
diff --git a/wolf3d/base/sprites/514.5551 b/wolf3d/base/sprites/514.5551
index ebdd1e6..89e5e44 100644
Binary files a/wolf3d/base/sprites/514.5551 and b/wolf3d/base/sprites/514.5551 differ
diff --git a/wolf3d/base/sprites/515.5551 b/wolf3d/base/sprites/515.5551
index 4b821d2..64ba9f0 100644
Binary files a/wolf3d/base/sprites/515.5551 and b/wolf3d/base/sprites/515.5551 differ
diff --git a/wolf3d/base/sprites/516.5551 b/wolf3d/base/sprites/516.5551
index e25bc7f..8d88128 100644
Binary files a/wolf3d/base/sprites/516.5551 and b/wolf3d/base/sprites/516.5551 differ
diff --git a/wolf3d/base/sprites/517.5551 b/wolf3d/base/sprites/517.5551
index 8803a41..45d13be 100644
Binary files a/wolf3d/base/sprites/517.5551 and b/wolf3d/base/sprites/517.5551 differ
diff --git a/wolf3d/base/sprites/518.5551 b/wolf3d/base/sprites/518.5551
index e25bc7f..2f3265d 100644
Binary files a/wolf3d/base/sprites/518.5551 and b/wolf3d/base/sprites/518.5551 differ
diff --git a/wolf3d/base/sprites/519.5551 b/wolf3d/base/sprites/519.5551
index 5a6a622..9e2bce7 100644
Binary files a/wolf3d/base/sprites/519.5551 and b/wolf3d/base/sprites/519.5551 differ
diff --git a/wolf3d/base/sprites/520.5551 b/wolf3d/base/sprites/520.5551
index d02a938..5af76a8 100644
Binary files a/wolf3d/base/sprites/520.5551 and b/wolf3d/base/sprites/520.5551 differ
diff --git a/wolf3d/base/sprites/521.5551 b/wolf3d/base/sprites/521.5551
index e98265e..5a075d0 100644
Binary files a/wolf3d/base/sprites/521.5551 and b/wolf3d/base/sprites/521.5551 differ
diff --git a/wolf3d/base/sprites/522.5551 b/wolf3d/base/sprites/522.5551
index 6752b7c..c5e3574 100644
Binary files a/wolf3d/base/sprites/522.5551 and b/wolf3d/base/sprites/522.5551 differ
diff --git a/wolf3d/base/sprites/523.5551 b/wolf3d/base/sprites/523.5551
index 568aa78..08a6db3 100644
Binary files a/wolf3d/base/sprites/523.5551 and b/wolf3d/base/sprites/523.5551 differ
diff --git a/wolf3d/base/sprites/524.5551 b/wolf3d/base/sprites/524.5551
index b6cbe6e..36c27f6 100644
Binary files a/wolf3d/base/sprites/524.5551 and b/wolf3d/base/sprites/524.5551 differ
diff --git a/wolf3d/base/sprites/525.5551 b/wolf3d/base/sprites/525.5551
index ab5efd5..be30ec4 100644
Binary files a/wolf3d/base/sprites/525.5551 and b/wolf3d/base/sprites/525.5551 differ
diff --git a/wolf3d/base/sprites/526.5551 b/wolf3d/base/sprites/526.5551
index 6571777..33a4200 100644
Binary files a/wolf3d/base/sprites/526.5551 and b/wolf3d/base/sprites/526.5551 differ
diff --git a/wolf3d/base/sprites/527.5551 b/wolf3d/base/sprites/527.5551
index 7941a37..1a1851b 100644
Binary files a/wolf3d/base/sprites/527.5551 and b/wolf3d/base/sprites/527.5551 differ
diff --git a/wolf3d/base/sprites/528.5551 b/wolf3d/base/sprites/528.5551
index ab5efd5..3aed254 100644
Binary files a/wolf3d/base/sprites/528.5551 and b/wolf3d/base/sprites/528.5551 differ
diff --git a/wolf3d/base/sprites/529.5551 b/wolf3d/base/sprites/529.5551
index 02baa20..61ea34b 100644
Binary files a/wolf3d/base/sprites/529.5551 and b/wolf3d/base/sprites/529.5551 differ
diff --git a/wolf3d/base/walls/000.5551 b/wolf3d/base/walls/000.5551
index 62b96d4..a70f7ac 100644
Binary files a/wolf3d/base/walls/000.5551 and b/wolf3d/base/walls/000.5551 differ
diff --git a/wolf3d/base/walls/002.5551 b/wolf3d/base/walls/002.5551
index 41e5972..c690010 100644
Binary files a/wolf3d/base/walls/002.5551 and b/wolf3d/base/walls/002.5551 differ
diff --git a/wolf3d/base/walls/004.5551 b/wolf3d/base/walls/004.5551
index 6d9d727..b157ac1 100644
Binary files a/wolf3d/base/walls/004.5551 and b/wolf3d/base/walls/004.5551 differ
diff --git a/wolf3d/base/walls/006.5551 b/wolf3d/base/walls/006.5551
index 435b101..fa10efd 100644
Binary files a/wolf3d/base/walls/006.5551 and b/wolf3d/base/walls/006.5551 differ
diff --git a/wolf3d/base/walls/008.5551 b/wolf3d/base/walls/008.5551
index 1442da0..ea735c3 100644
Binary files a/wolf3d/base/walls/008.5551 and b/wolf3d/base/walls/008.5551 differ
diff --git a/wolf3d/base/walls/010.5551 b/wolf3d/base/walls/010.5551
index 50bffc0..ab69668 100644
Binary files a/wolf3d/base/walls/010.5551 and b/wolf3d/base/walls/010.5551 differ
diff --git a/wolf3d/base/walls/012.5551 b/wolf3d/base/walls/012.5551
index 26544ed..fa336c9 100644
Binary files a/wolf3d/base/walls/012.5551 and b/wolf3d/base/walls/012.5551 differ
diff --git a/wolf3d/base/walls/014.5551 b/wolf3d/base/walls/014.5551
index 038af7d..9ceb06b 100644
Binary files a/wolf3d/base/walls/014.5551 and b/wolf3d/base/walls/014.5551 differ
diff --git a/wolf3d/base/walls/016.5551 b/wolf3d/base/walls/016.5551
index f56c40d..cf3b3ed 100644
Binary files a/wolf3d/base/walls/016.5551 and b/wolf3d/base/walls/016.5551 differ
diff --git a/wolf3d/base/walls/018.5551 b/wolf3d/base/walls/018.5551
index 5bde9d8..4db76c0 100644
Binary files a/wolf3d/base/walls/018.5551 and b/wolf3d/base/walls/018.5551 differ
diff --git a/wolf3d/base/walls/020.5551 b/wolf3d/base/walls/020.5551
index 170a3ac..2758eb7 100644
Binary files a/wolf3d/base/walls/020.5551 and b/wolf3d/base/walls/020.5551 differ
diff --git a/wolf3d/base/walls/022.5551 b/wolf3d/base/walls/022.5551
index 4c79225..dac0573 100644
Binary files a/wolf3d/base/walls/022.5551 and b/wolf3d/base/walls/022.5551 differ
diff --git a/wolf3d/base/walls/024.5551 b/wolf3d/base/walls/024.5551
index ce3bc78..dda2ada 100644
Binary files a/wolf3d/base/walls/024.5551 and b/wolf3d/base/walls/024.5551 differ
diff --git a/wolf3d/base/walls/026.5551 b/wolf3d/base/walls/026.5551
index bd2e4d2..ae5310e 100644
Binary files a/wolf3d/base/walls/026.5551 and b/wolf3d/base/walls/026.5551 differ
diff --git a/wolf3d/base/walls/028.5551 b/wolf3d/base/walls/028.5551
index 8964b65..efa796c 100644
Binary files a/wolf3d/base/walls/028.5551 and b/wolf3d/base/walls/028.5551 differ
diff --git a/wolf3d/base/walls/030.5551 b/wolf3d/base/walls/030.5551
index da313f3..d6f4885 100644
Binary files a/wolf3d/base/walls/030.5551 and b/wolf3d/base/walls/030.5551 differ
diff --git a/wolf3d/base/walls/031.5551 b/wolf3d/base/walls/031.5551
index 8193564..412ceb4 100644
Binary files a/wolf3d/base/walls/031.5551 and b/wolf3d/base/walls/031.5551 differ
diff --git a/wolf3d/base/walls/032.5551 b/wolf3d/base/walls/032.5551
index 4424733..d9faaf3 100644
Binary files a/wolf3d/base/walls/032.5551 and b/wolf3d/base/walls/032.5551 differ
diff --git a/wolf3d/base/walls/034.5551 b/wolf3d/base/walls/034.5551
index 4f1f51e..b5eb813 100644
Binary files a/wolf3d/base/walls/034.5551 and b/wolf3d/base/walls/034.5551 differ
diff --git a/wolf3d/base/walls/036.5551 b/wolf3d/base/walls/036.5551
index 6d9aed4..a095fc5 100644
Binary files a/wolf3d/base/walls/036.5551 and b/wolf3d/base/walls/036.5551 differ
diff --git a/wolf3d/base/walls/038.5551 b/wolf3d/base/walls/038.5551
index b88bae4..14d2ec2 100644
Binary files a/wolf3d/base/walls/038.5551 and b/wolf3d/base/walls/038.5551 differ
diff --git a/wolf3d/base/walls/040.5551 b/wolf3d/base/walls/040.5551
index aa9be49..3082d35 100644
Binary files a/wolf3d/base/walls/040.5551 and b/wolf3d/base/walls/040.5551 differ
diff --git a/wolf3d/base/walls/041.5551 b/wolf3d/base/walls/041.5551
index 57fc25d..f731ba1 100644
Binary files a/wolf3d/base/walls/041.5551 and b/wolf3d/base/walls/041.5551 differ
diff --git a/wolf3d/base/walls/042.5551 b/wolf3d/base/walls/042.5551
index cca4154..bc9bd39 100644
Binary files a/wolf3d/base/walls/042.5551 and b/wolf3d/base/walls/042.5551 differ
diff --git a/wolf3d/base/walls/043.5551 b/wolf3d/base/walls/043.5551
index e89953e..37fc0cb 100644
Binary files a/wolf3d/base/walls/043.5551 and b/wolf3d/base/walls/043.5551 differ
diff --git a/wolf3d/base/walls/044.5551 b/wolf3d/base/walls/044.5551
index 60cf937..d537a13 100644
Binary files a/wolf3d/base/walls/044.5551 and b/wolf3d/base/walls/044.5551 differ
diff --git a/wolf3d/base/walls/046.5551 b/wolf3d/base/walls/046.5551
index 540301b..f3ff60a 100644
Binary files a/wolf3d/base/walls/046.5551 and b/wolf3d/base/walls/046.5551 differ
diff --git a/wolf3d/base/walls/048.5551 b/wolf3d/base/walls/048.5551
index 03103c9..1cd9a2e 100644
Binary files a/wolf3d/base/walls/048.5551 and b/wolf3d/base/walls/048.5551 differ
diff --git a/wolf3d/base/walls/050.5551 b/wolf3d/base/walls/050.5551
index 4f2fb05..4e98e25 100644
Binary files a/wolf3d/base/walls/050.5551 and b/wolf3d/base/walls/050.5551 differ
diff --git a/wolf3d/base/walls/052.5551 b/wolf3d/base/walls/052.5551
index fde40e7..68aa6de 100644
Binary files a/wolf3d/base/walls/052.5551 and b/wolf3d/base/walls/052.5551 differ
diff --git a/wolf3d/base/walls/054.5551 b/wolf3d/base/walls/054.5551
index cb82f09..e24a10e 100644
Binary files a/wolf3d/base/walls/054.5551 and b/wolf3d/base/walls/054.5551 differ
diff --git a/wolf3d/base/walls/056.5551 b/wolf3d/base/walls/056.5551
index 972917b..fc84ff9 100644
Binary files a/wolf3d/base/walls/056.5551 and b/wolf3d/base/walls/056.5551 differ
diff --git a/wolf3d/base/walls/058.5551 b/wolf3d/base/walls/058.5551
index 4ba7c7c..a5a4c26 100644
Binary files a/wolf3d/base/walls/058.5551 and b/wolf3d/base/walls/058.5551 differ
diff --git a/wolf3d/base/walls/060.5551 b/wolf3d/base/walls/060.5551
index a00b617..abfd2fe 100644
Binary files a/wolf3d/base/walls/060.5551 and b/wolf3d/base/walls/060.5551 differ
diff --git a/wolf3d/base/walls/062.5551 b/wolf3d/base/walls/062.5551
index 96567b2..1be16f0 100644
Binary files a/wolf3d/base/walls/062.5551 and b/wolf3d/base/walls/062.5551 differ
diff --git a/wolf3d/base/walls/064.5551 b/wolf3d/base/walls/064.5551
index 4e26f6b..d365459 100644
Binary files a/wolf3d/base/walls/064.5551 and b/wolf3d/base/walls/064.5551 differ
diff --git a/wolf3d/base/walls/066.5551 b/wolf3d/base/walls/066.5551
index be710d1..0255f32 100644
Binary files a/wolf3d/base/walls/066.5551 and b/wolf3d/base/walls/066.5551 differ
diff --git a/wolf3d/base/walls/068.5551 b/wolf3d/base/walls/068.5551
index 21dda5a..714fbad 100644
Binary files a/wolf3d/base/walls/068.5551 and b/wolf3d/base/walls/068.5551 differ
diff --git a/wolf3d/base/walls/070.5551 b/wolf3d/base/walls/070.5551
index 56a6759..eee6a2c 100644
Binary files a/wolf3d/base/walls/070.5551 and b/wolf3d/base/walls/070.5551 differ
diff --git a/wolf3d/base/walls/072.5551 b/wolf3d/base/walls/072.5551
index 4c61738..87c5a44 100644
Binary files a/wolf3d/base/walls/072.5551 and b/wolf3d/base/walls/072.5551 differ
diff --git a/wolf3d/base/walls/074.5551 b/wolf3d/base/walls/074.5551
index 5998878..6b7b046 100644
Binary files a/wolf3d/base/walls/074.5551 and b/wolf3d/base/walls/074.5551 differ
diff --git a/wolf3d/base/walls/076.5551 b/wolf3d/base/walls/076.5551
index a95f330..c43179b 100644
Binary files a/wolf3d/base/walls/076.5551 and b/wolf3d/base/walls/076.5551 differ
diff --git a/wolf3d/base/walls/078.5551 b/wolf3d/base/walls/078.5551
index 69a7498..3141c87 100644
Binary files a/wolf3d/base/walls/078.5551 and b/wolf3d/base/walls/078.5551 differ
diff --git a/wolf3d/base/walls/080.5551 b/wolf3d/base/walls/080.5551
index b1b244b..4a03f44 100644
Binary files a/wolf3d/base/walls/080.5551 and b/wolf3d/base/walls/080.5551 differ
diff --git a/wolf3d/base/walls/082.5551 b/wolf3d/base/walls/082.5551
index 53ee845..cd082ee 100644
Binary files a/wolf3d/base/walls/082.5551 and b/wolf3d/base/walls/082.5551 differ
diff --git a/wolf3d/base/walls/084.5551 b/wolf3d/base/walls/084.5551
index 1075f70..ed410c7 100644
Binary files a/wolf3d/base/walls/084.5551 and b/wolf3d/base/walls/084.5551 differ
diff --git a/wolf3d/base/walls/086.5551 b/wolf3d/base/walls/086.5551
index 50e7dfa..4b36205 100644
Binary files a/wolf3d/base/walls/086.5551 and b/wolf3d/base/walls/086.5551 differ
diff --git a/wolf3d/base/walls/088.5551 b/wolf3d/base/walls/088.5551
index e5c01ba..b91f15b 100644
Binary files a/wolf3d/base/walls/088.5551 and b/wolf3d/base/walls/088.5551 differ
diff --git a/wolf3d/base/walls/090.5551 b/wolf3d/base/walls/090.5551
index 17394b1..e2486d6 100644
Binary files a/wolf3d/base/walls/090.5551 and b/wolf3d/base/walls/090.5551 differ
diff --git a/wolf3d/base/walls/092.5551 b/wolf3d/base/walls/092.5551
index da9aa14..46f7e02 100644
Binary files a/wolf3d/base/walls/092.5551 and b/wolf3d/base/walls/092.5551 differ
diff --git a/wolf3d/base/walls/094.5551 b/wolf3d/base/walls/094.5551
index 83e067d..b62b90e 100644
Binary files a/wolf3d/base/walls/094.5551 and b/wolf3d/base/walls/094.5551 differ
diff --git a/wolf3d/base/walls/096.5551 b/wolf3d/base/walls/096.5551
index 073eb1f..c1bbd2b 100644
Binary files a/wolf3d/base/walls/096.5551 and b/wolf3d/base/walls/096.5551 differ
diff --git a/wolf3d/base/walls/126.5551 b/wolf3d/base/walls/126.5551
index dcac03e..45ee06a 100644
Binary files a/wolf3d/base/walls/126.5551 and b/wolf3d/base/walls/126.5551 differ
diff --git a/wolf3d/base/walls/128.5551 b/wolf3d/base/walls/128.5551
index 97b56a5..b91a558 100644
Binary files a/wolf3d/base/walls/128.5551 and b/wolf3d/base/walls/128.5551 differ
diff --git a/wolf3d/base/walls/130.5551 b/wolf3d/base/walls/130.5551
index a8ec8cf..a90c20d 100644
Binary files a/wolf3d/base/walls/130.5551 and b/wolf3d/base/walls/130.5551 differ
diff --git a/wolf3d/base/walls/132.5551 b/wolf3d/base/walls/132.5551
index 8259cad..2208d64 100644
Binary files a/wolf3d/base/walls/132.5551 and b/wolf3d/base/walls/132.5551 differ
diff --git a/wolf3d/base/walls/133.5551 b/wolf3d/base/walls/133.5551
index ae74781..136aa12 100644
Binary files a/wolf3d/base/walls/133.5551 and b/wolf3d/base/walls/133.5551 differ
diff --git a/wolf3d/code/.DS_Store b/wolf3d/code/.DS_Store
new file mode 100644
index 0000000..390aed0
Binary files /dev/null and b/wolf3d/code/.DS_Store differ
diff --git a/wolf3d/code/Tremor/CHANGELOG b/wolf3d/code/Tremor/CHANGELOG
new file mode 100644
index 0000000..53f2335
--- /dev/null
+++ b/wolf3d/code/Tremor/CHANGELOG
@@ -0,0 +1,19 @@
+*** 20020517: 1.0.2 ***
+
+ Playback bugfix to floor1; mode mistakenly used for sizing instead
+ of blockflag
+
+*** 20020515: 1.0.1 ***
+
+ Added complete API documentation to source tarball. No code
+ changes.
+
+*** 20020412: 1.0.1 ***
+
+ Fixed a clipping bug that affected ARM processors; negative
+ overflows were being properly clipped, but then clobbered to
+ positive by the positive overflow chec (asm_arm.h:CLIP_TO_15)
+
+*** 20020403: 1.0.0 ***
+
+ Initial version
\ No newline at end of file
diff --git a/wolf3d/code/Tremor/COPYING b/wolf3d/code/Tremor/COPYING
new file mode 100644
index 0000000..6111c6c
--- /dev/null
+++ b/wolf3d/code/Tremor/COPYING
@@ -0,0 +1,28 @@
+Copyright (c) 2002, Xiph.org Foundation
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+- Neither the name of the Xiph.org Foundation nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/wolf3d/code/Tremor/Makefile.am b/wolf3d/code/Tremor/Makefile.am
new file mode 100644
index 0000000..d14081f
--- /dev/null
+++ b/wolf3d/code/Tremor/Makefile.am
@@ -0,0 +1,38 @@
+AUTOMAKE_OPTIONS = foreign
+
+INCLUDES = -I./
+
+lib_LTLIBRARIES = libvorbisidec.la
+
+libvorbisidec_la_SOURCES = mdct.c block.c window.c \
+ synthesis.c info.c \
+ floor1.c floor0.c vorbisfile.c \
+ res012.c mapping0.c registry.c codebook.c \
+ sharedbook.c framing.c bitwise.c \
+ codebook.h misc.h mdct_lookup.h\
+ os.h mdct.h block.h ivorbisfile.h lsp_lookup.h\
+ registry.h window.h window_lookup.h\
+ codec_internal.h backends.h ogg.h \
+ asm_arm.h ivorbiscodec.h
+libvorbisidec_la_LDFLAGS = -version-info @V_LIB_CURRENT@:@V_LIB_REVISION@:@V_LIB_AGE@
+
+EXTRA_PROGRAMS = ivorbisfile_example
+CLEANFILES = $(EXTRA_PROGRAMS) $(lib_LTLIBRARIES)
+
+ivorbisfile_example_SOURCES = ivorbisfile_example.c
+ivorbisfile_example_LDFLAGS = -static
+ivorbisfile_example_LDADD = libvorbisidec.la
+
+includedir = $(prefix)/include/tremor
+
+include_HEADERS = ivorbiscodec.h ivorbisfile.h ogg.h os_types.h config_types.h
+
+example:
+ -ln -fs . vorbis
+ $(MAKE) ivorbisfile_example
+
+debug:
+ $(MAKE) all CFLAGS="@DEBUG@"
+
+profile:
+ $(MAKE) all CFLAGS="@PROFILE@"
diff --git a/wolf3d/code/Tremor/README b/wolf3d/code/Tremor/README
new file mode 100644
index 0000000..1321175
--- /dev/null
+++ b/wolf3d/code/Tremor/README
@@ -0,0 +1,46 @@
+This README covers the Ogg Vorbis 'Tremor' integer playback codec
+source as of date 2002 09 02, version 1.0.0.
+
+ ******
+
+The C source in this package will build on any ANSI C compiler and
+function completely and properly on any platform. The included build
+system assumes GNU build system and make tools (m4, automake,
+autoconf, libtool and gmake). GCC is not required, although GCC is
+the most tested compiler. To build using GNU tools, type in the
+source directory:
+
+./autogen.sh
+make
+
+Currently, the source implements playback in pure C on all platforms
+except ARM, where a [currently] small amount of assembly (see
+asm_arm.h) is used to implement 64 bit math operations and fast LSP
+computation. If building on ARM without the benefit of GNU build
+system tools, be sure that '_ARM_ASSEM_' is #defined by the build
+system if this assembly is desired, else the resulting library will
+use whatever 64 bit math builtins the compiler implements.
+
+No math library is required by this source. No floating point
+operations are used at any point in either setup or decode. This
+decoder library will properly decode any past, current or future
+Vorbis I file or stream.
+
+ ********
+
+The build system produces a static and [when supported by the OS]
+dynamic library named 'libvorbisidec'. This library exposes an API
+nearly identical to the BSD reference library's 'libvorbisfile',
+including all the features familiar to users of vorbisfile. This API
+is similar enough that the proper header file to include is named
+'ivorbisfile.h' [included in the source build directory]. Lower level
+libvorbis-style headers and structures are in 'ivorbiscodec.h'
+[included in the source build directory]. A simple example program,
+ivorbisfile_example.c, can be built with 'make example'.
+
+ ********
+
+Detailed Tremor API Documentation begins at doc/index.html
+
+Monty
+xiph.org
diff --git a/wolf3d/code/Tremor/Version_script.in b/wolf3d/code/Tremor/Version_script.in
new file mode 100644
index 0000000..c0dfde9
--- /dev/null
+++ b/wolf3d/code/Tremor/Version_script.in
@@ -0,0 +1,49 @@
+#
+# Export file for libvorbisidec
+#
+# Only the symbols listed in the global section will be callable from
+# applications linking to libvorbisidec.
+#
+
+@PACKAGE@.so.1
+{
+ global:
+ ov_clear;
+ ov_open;
+ ov_open_callbacks;
+ ov_test;
+ ov_test_callbacks;
+ ov_test_open;
+ ov_bitrate;
+ ov_bitrate_instant;
+ ov_streams;
+ ov_seekable;
+ ov_serialnumber;
+ ov_raw_total;
+ ov_pcm_total;
+ ov_time_total;
+ ov_raw_seek;
+ ov_pcm_seek;
+ ov_pcm_seek_page;
+ ov_time_seek;
+ ov_time_seek_page;
+ ov_raw_tell;
+ ov_pcm_tell;
+ ov_time_tell;
+ ov_info;
+ ov_comment;
+ ov_read;
+
+ vorbis_info_init;
+ vorbis_info_clear;
+ vorbis_info_blocksize;
+ vorbis_comment_init;
+ vorbis_comment_add;
+ vorbis_comment_add_tag;
+ vorbis_comment_query;
+ vorbis_comment_query_count;
+ vorbis_comment_clear;
+
+ local:
+ *;
+};
diff --git a/wolf3d/code/Tremor/asm_arm.h b/wolf3d/code/Tremor/asm_arm.h
new file mode 100644
index 0000000..3a3716d
--- /dev/null
+++ b/wolf3d/code/Tremor/asm_arm.h
@@ -0,0 +1,243 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: arm7 and later wide math functions
+
+ ********************************************************************/
+
+#ifdef _ARM_ASSEM_
+
+#if !defined(_V_WIDE_MATH) && !defined(_LOW_ACCURACY_)
+#define _V_WIDE_MATH
+
+static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
+ int lo,hi;
+ asm volatile("smull\t%0, %1, %2, %3"
+ : "=&r"(lo),"=&r"(hi)
+ : "%r"(x),"r"(y)
+ : "cc");
+ return(hi);
+}
+
+static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
+ return MULT32(x,y)<<1;
+}
+
+static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
+ int lo,hi;
+ asm volatile("smull %0, %1, %2, %3\n\t"
+ "movs %0, %0, lsr #15\n\t"
+ "adc %1, %0, %1, lsl #17\n\t"
+ : "=&r"(lo),"=&r"(hi)
+ : "%r"(x),"r"(y)
+ : "cc");
+ return(hi);
+}
+
+#define MB() asm volatile ("" : : : "memory")
+
+static inline void XPROD32(ogg_int32_t a, ogg_int32_t b,
+ ogg_int32_t t, ogg_int32_t v,
+ ogg_int32_t *x, ogg_int32_t *y)
+{
+ int x1, y1, l;
+ asm( "smull %0, %1, %4, %6\n\t"
+ "smlal %0, %1, %5, %7\n\t"
+ "rsb %3, %4, #0\n\t"
+ "smull %0, %2, %5, %6\n\t"
+ "smlal %0, %2, %3, %7"
+ : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a)
+ : "3" (a), "r" (b), "r" (t), "r" (v)
+ : "cc" );
+ *x = x1;
+ MB();
+ *y = y1;
+}
+
+static inline void XPROD31(ogg_int32_t a, ogg_int32_t b,
+ ogg_int32_t t, ogg_int32_t v,
+ ogg_int32_t *x, ogg_int32_t *y)
+{
+ int x1, y1, l;
+ asm( "smull %0, %1, %4, %6\n\t"
+ "smlal %0, %1, %5, %7\n\t"
+ "rsb %3, %4, #0\n\t"
+ "smull %0, %2, %5, %6\n\t"
+ "smlal %0, %2, %3, %7"
+ : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a)
+ : "3" (a), "r" (b), "r" (t), "r" (v)
+ : "cc" );
+ *x = x1 << 1;
+ MB();
+ *y = y1 << 1;
+}
+
+static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b,
+ ogg_int32_t t, ogg_int32_t v,
+ ogg_int32_t *x, ogg_int32_t *y)
+{
+ int x1, y1, l;
+ asm( "rsb %2, %4, #0\n\t"
+ "smull %0, %1, %3, %5\n\t"
+ "smlal %0, %1, %2, %6\n\t"
+ "smull %0, %2, %4, %5\n\t"
+ "smlal %0, %2, %3, %6"
+ : "=&r" (l), "=&r" (x1), "=&r" (y1)
+ : "r" (a), "r" (b), "r" (t), "r" (v)
+ : "cc" );
+ *x = x1 << 1;
+ MB();
+ *y = y1 << 1;
+}
+
+#endif
+
+#ifndef _V_CLIP_MATH
+#define _V_CLIP_MATH
+
+static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
+ int tmp;
+ asm volatile("subs %1, %0, #32768\n\t"
+ "movpl %0, #0x7f00\n\t"
+ "orrpl %0, %0, #0xff\n"
+ "adds %1, %0, #32768\n\t"
+ "movmi %0, #0x8000"
+ : "+r"(x),"=r"(tmp)
+ :
+ : "cc");
+ return(x);
+}
+
+#endif
+
+#ifndef _V_LSP_MATH_ASM
+#define _V_LSP_MATH_ASM
+
+static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+ ogg_int32_t *qexpp,
+ ogg_int32_t *ilsp,ogg_int32_t wi,
+ ogg_int32_t m){
+
+ ogg_uint32_t qi=*qip,pi=*pip;
+ ogg_int32_t qexp=*qexpp;
+
+ asm("mov r0,%3;"
+ "mov r1,%5,asr#1;"
+ "add r0,r0,r1,lsl#3;"
+ "1:"
+
+ "ldmdb r0!,{r1,r3};"
+ "subs r1,r1,%4;" //ilsp[j]-wi
+ "rsbmi r1,r1,#0;" //labs(ilsp[j]-wi)
+ "umull %0,r2,r1,%0;" //qi*=labs(ilsp[j]-wi)
+
+ "subs r1,r3,%4;" //ilsp[j+1]-wi
+ "rsbmi r1,r1,#0;" //labs(ilsp[j+1]-wi)
+ "umull %1,r3,r1,%1;" //pi*=labs(ilsp[j+1]-wi)
+
+ "cmn r2,r3;" // shift down 16?
+ "beq 0f;"
+ "add %2,%2,#16;"
+ "mov %0,%0,lsr #16;"
+ "orr %0,%0,r2,lsl #16;"
+ "mov %1,%1,lsr #16;"
+ "orr %1,%1,r3,lsl #16;"
+ "0:"
+ "cmp r0,%3;\n"
+ "bhi 1b;\n"
+
+ // odd filter assymetry
+ "ands r0,%5,#1;\n"
+ "beq 2f;\n"
+ "add r0,%3,%5,lsl#2;\n"
+
+ "ldr r1,[r0,#-4];\n"
+ "mov r0,#0x4000;\n"
+
+ "subs r1,r1,%4;\n" //ilsp[j]-wi
+ "rsbmi r1,r1,#0;\n" //labs(ilsp[j]-wi)
+ "umull %0,r2,r1,%0;\n" //qi*=labs(ilsp[j]-wi)
+ "umull %1,r3,r0,%1;\n" //pi*=labs(ilsp[j+1]-wi)
+
+ "cmn r2,r3;\n" // shift down 16?
+ "beq 2f;\n"
+ "add %2,%2,#16;\n"
+ "mov %0,%0,lsr #16;\n"
+ "orr %0,%0,r2,lsl #16;\n"
+ "mov %1,%1,lsr #16;\n"
+ "orr %1,%1,r3,lsl #16;\n"
+
+ //qi=(pi>>shift)*labs(ilsp[j]-wi);
+ //pi=(qi>>shift)*labs(ilsp[j+1]-wi);
+ //qexp+=shift;
+
+ //}
+
+ /* normalize to max 16 sig figs */
+ "2:"
+ "mov r2,#0;"
+ "orr r1,%0,%1;"
+ "tst r1,#0xff000000;"
+ "addne r2,r2,#8;"
+ "movne r1,r1,lsr #8;"
+ "tst r1,#0x00f00000;"
+ "addne r2,r2,#4;"
+ "movne r1,r1,lsr #4;"
+ "tst r1,#0x000c0000;"
+ "addne r2,r2,#2;"
+ "movne r1,r1,lsr #2;"
+ "tst r1,#0x00020000;"
+ "addne r2,r2,#1;"
+ "movne r1,r1,lsr #1;"
+ "tst r1,#0x00010000;"
+ "addne r2,r2,#1;"
+ "mov %0,%0,lsr r2;"
+ "mov %1,%1,lsr r2;"
+ "add %2,%2,r2;"
+
+ : "+r"(qi),"+r"(pi),"+r"(qexp)
+ : "r"(ilsp),"r"(wi),"r"(m)
+ : "r0","r1","r2","r3","cc");
+
+ *qip=qi;
+ *pip=pi;
+ *qexpp=qexp;
+}
+
+static inline void lsp_norm_asm(ogg_uint32_t *qip,ogg_int32_t *qexpp){
+
+ ogg_uint32_t qi=*qip;
+ ogg_int32_t qexp=*qexpp;
+
+ asm("tst %0,#0x0000ff00;"
+ "moveq %0,%0,lsl #8;"
+ "subeq %1,%1,#8;"
+ "tst %0,#0x0000f000;"
+ "moveq %0,%0,lsl #4;"
+ "subeq %1,%1,#4;"
+ "tst %0,#0x0000c000;"
+ "moveq %0,%0,lsl #2;"
+ "subeq %1,%1,#2;"
+ "tst %0,#0x00008000;"
+ "moveq %0,%0,lsl #1;"
+ "subeq %1,%1,#1;"
+ : "+r"(qi),"+r"(qexp)
+ :
+ : "cc");
+ *qip=qi;
+ *qexpp=qexp;
+}
+
+#endif
+#endif
+
diff --git a/wolf3d/code/Tremor/autogen.sh b/wolf3d/code/Tremor/autogen.sh
new file mode 100644
index 0000000..73c8fca
--- /dev/null
+++ b/wolf3d/code/Tremor/autogen.sh
@@ -0,0 +1,120 @@
+#!/bin/sh
+# Run this to set up the build system: configure, makefiles, etc.
+# (based on the version in enlightenment's cvs)
+
+package="vorbisdec"
+
+olddir=`pwd`
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+cd "$srcdir"
+DIE=0
+
+echo "checking for autoconf... "
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile $package."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
+VERSIONMKINT="sed -e s/[^0-9]//"
+
+# do we need automake?
+if test -r Makefile.am; then
+ AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
+ AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
+ if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then
+ AM_NEEDED=""
+ fi
+ if test -z $AM_NEEDED; then
+ echo -n "checking for automake... "
+ AUTOMAKE=automake
+ ACLOCAL=aclocal
+ if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
+ echo "yes"
+ else
+ echo "no"
+ AUTOMAKE=
+ fi
+ else
+ echo -n "checking for automake $AM_NEEDED or later... "
+ for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
+ ($am --version < /dev/null > /dev/null 2>&1) || continue
+ ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
+ verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
+ if test $ver -ge $verneeded; then
+ AUTOMAKE=$am
+ echo $AUTOMAKE
+ break
+ fi
+ done
+ test -z $AUTOMAKE && echo "no"
+ echo -n "checking for aclocal $AM_NEEDED or later... "
+ for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
+ ($ac --version < /dev/null > /dev/null 2>&1) || continue
+ ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
+ verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
+ if test $ver -ge $verneeded; then
+ ACLOCAL=$ac
+ echo $ACLOCAL
+ break
+ fi
+ done
+ test -z $ACLOCAL && echo "no"
+ fi
+ test -z $AUTOMAKE || test -z $ACLOCAL && {
+ echo
+ echo "You must have automake installed to compile $package."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ exit 1
+ }
+fi
+
+echo -n "checking for libtool... "
+for LIBTOOLIZE in libtoolize glibtoolize nope; do
+ ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
+done
+if test x$LIBTOOLIZE = xnope; then
+ echo "nope."
+ LIBTOOLIZE=libtoolize
+else
+ echo $LIBTOOLIZE
+fi
+($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have libtool installed to compile $package."
+ echo "Download the appropriate package for your system,"
+ echo "or get the source from one of the GNU ftp sites"
+ echo "listed in http://www.gnu.org/order/ftp.html"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "I am going to run ./configure with no arguments - if you wish "
+ echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+echo "Generating configuration files for $package, please wait...."
+
+echo " $ACLOCAL $ACLOCAL_FLAGS"
+$ACLOCAL $ACLOCAL_FLAGS || exit 1
+echo " $LIBTOOLIZE --automake"
+$LIBTOOLIZE --automake || exit 1
+echo " autoheader"
+autoheader || exit 1
+echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
+$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
+echo " autoconf"
+autoconf || exit 1
+
+cd $olddir
+$srcdir/configure --enable-maintainer-mode "$@" && echo
diff --git a/wolf3d/code/Tremor/backends.h b/wolf3d/code/Tremor/backends.h
new file mode 100644
index 0000000..50c1c45
--- /dev/null
+++ b/wolf3d/code/Tremor/backends.h
@@ -0,0 +1,130 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: backend and mapping structures
+
+ ********************************************************************/
+
+/* this is exposed up here because we need it for static modes.
+ Lookups for each backend aren't exposed because there's no reason
+ to do so */
+
+#ifndef _vorbis_backend_h_
+#define _vorbis_backend_h_
+
+#include "codec_internal.h"
+
+/* this would all be simpler/shorter with templates, but.... */
+/* Transform backend generic *************************************/
+
+/* only mdct right now. Flesh it out more if we ever transcend mdct
+ in the transform domain */
+
+/* Floor backend generic *****************************************/
+typedef struct{
+ vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *);
+ vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_mode *,
+ vorbis_info_floor *);
+ void (*free_info) (vorbis_info_floor *);
+ void (*free_look) (vorbis_look_floor *);
+ void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *);
+ int (*inverse2) (struct vorbis_block *,vorbis_look_floor *,
+ void *buffer,ogg_int32_t *);
+} vorbis_func_floor;
+
+typedef struct{
+ int order;
+ long rate;
+ long barkmap;
+
+ int ampbits;
+ int ampdB;
+
+ int numbooks; /* <= 16 */
+ int books[16];
+
+} vorbis_info_floor0;
+
+#define VIF_POSIT 63
+#define VIF_CLASS 16
+#define VIF_PARTS 31
+typedef struct{
+ int partitions; /* 0 to 31 */
+ int partitionclass[VIF_PARTS]; /* 0 to 15 */
+
+ int class_dim[VIF_CLASS]; /* 1 to 8 */
+ int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<
+#include
+#include "ogg.h"
+
+static unsigned long mask[]=
+{0x00000000,0x00000001,0x00000003,0x00000007,0x0000000f,
+ 0x0000001f,0x0000003f,0x0000007f,0x000000ff,0x000001ff,
+ 0x000003ff,0x000007ff,0x00000fff,0x00001fff,0x00003fff,
+ 0x00007fff,0x0000ffff,0x0001ffff,0x0003ffff,0x0007ffff,
+ 0x000fffff,0x001fffff,0x003fffff,0x007fffff,0x00ffffff,
+ 0x01ffffff,0x03ffffff,0x07ffffff,0x0fffffff,0x1fffffff,
+ 0x3fffffff,0x7fffffff,0xffffffff };
+
+/* mark read process as having run off the end */
+static void _adv_halt(oggpack_buffer *b){
+ b->headptr=b->head->buffer->data+b->head->begin+b->head->length;
+ b->headend=-1;
+ b->headbit=0;
+}
+
+/* spans forward, skipping as many bytes as headend is negative; if
+ headend is zero, simply finds next byte. If we're up to the end
+ of the buffer, leaves headend at zero. If we've read past the end,
+ halt the decode process. */
+static void _span(oggpack_buffer *b){
+ while(b->headend<1){
+ if(b->head->next){
+ b->count+=b->head->length;
+ b->head=b->head->next;
+ b->headptr=b->head->buffer->data+b->head->begin-b->headend;
+ b->headend+=b->head->length;
+ }else{
+ /* we've either met the end of decode, or gone past it. halt
+ only if we're past */
+ if(b->headend<0 || b->headbit)
+ /* read has fallen off the end */
+ _adv_halt(b);
+
+ break;
+ }
+ }
+}
+
+void oggpack_readinit(oggpack_buffer *b,ogg_reference *r){
+ memset(b,0,sizeof(*b));
+
+ b->tail=b->head=r;
+ b->count=0;
+ b->headptr=b->head->buffer->data+b->head->begin;
+ b->headend=b->head->length;
+ _span(b);
+}
+
+#define _lookspan() while(!end){\
+ head=head->next;\
+ if(!head) return -1;\
+ ptr=head->buffer->data + head->begin;\
+ end=head->length;\
+ }
+
+/* Read in bits without advancing the bitptr; bits <= 32 */
+long oggpack_look(oggpack_buffer *b,int bits){
+ unsigned long m=mask[bits];
+ unsigned long ret=-1;
+
+ bits+=b->headbit;
+
+ if(bits >= b->headend<<3){
+ int end=b->headend;
+ unsigned char *ptr=b->headptr;
+ ogg_reference *head=b->head;
+
+ if(end<0)return -1;
+
+ if(bits){
+ _lookspan();
+ ret=*ptr++>>b->headbit;
+ if(bits>8){
+ --end;
+ _lookspan();
+ ret|=*ptr++<<(8-b->headbit);
+ if(bits>16){
+ --end;
+ _lookspan();
+ ret|=*ptr++<<(16-b->headbit);
+ if(bits>24){
+ --end;
+ _lookspan();
+ ret|=*ptr++<<(24-b->headbit);
+ if(bits>32 && b->headbit){
+ --end;
+ _lookspan();
+ ret|=*ptr<<(32-b->headbit);
+ }
+ }
+ }
+ }
+ }
+
+ }else{
+
+ /* make this a switch jump-table */
+ ret=b->headptr[0]>>b->headbit;
+ if(bits>8){
+ ret|=b->headptr[1]<<(8-b->headbit);
+ if(bits>16){
+ ret|=b->headptr[2]<<(16-b->headbit);
+ if(bits>24){
+ ret|=b->headptr[3]<<(24-b->headbit);
+ if(bits>32 && b->headbit)
+ ret|=b->headptr[4]<<(32-b->headbit);
+ }
+ }
+ }
+ }
+
+ ret&=m;
+ return ret;
+}
+
+/* limited to 32 at a time */
+void oggpack_adv(oggpack_buffer *b,int bits){
+ bits+=b->headbit;
+ b->headbit=bits&7;
+ b->headptr+=bits/8;
+ if((b->headend-=bits/8)<1)_span(b);
+}
+
+/* spans forward and finds next byte. Never halts */
+static void _span_one(oggpack_buffer *b){
+ while(b->headend<1){
+ if(b->head->next){
+ b->count+=b->head->length;
+ b->head=b->head->next;
+ b->headptr=b->head->buffer->data+b->head->begin;
+ b->headend=b->head->length;
+ }else
+ break;
+ }
+}
+
+static int _halt_one(oggpack_buffer *b){
+ if(b->headend<1){
+ _adv_halt(b);
+ return -1;
+ }
+ return 0;
+}
+
+int oggpack_eop(oggpack_buffer *b){
+ if(b->headend<0)return -1;
+ return 0;
+}
+
+/* bits <= 32 */
+long oggpack_read(oggpack_buffer *b,int bits){
+ unsigned long m=mask[bits];
+ ogg_uint32_t ret=-1;
+
+ bits+=b->headbit;
+
+ if(bits >= b->headend<<3){
+
+ if(b->headend<0)return -1;
+
+ if(bits){
+ if (_halt_one(b)) return -1;
+ ret=*b->headptr>>b->headbit;
+
+ if(bits>=8){
+ ++b->headptr;
+ --b->headend;
+ _span_one(b);
+ if(bits>8){
+ if (_halt_one(b)) return -1;
+ ret|=*b->headptr<<(8-b->headbit);
+
+ if(bits>=16){
+ ++b->headptr;
+ --b->headend;
+ _span_one(b);
+ if(bits>16){
+ if (_halt_one(b)) return -1;
+ ret|=*b->headptr<<(16-b->headbit);
+
+ if(bits>=24){
+ ++b->headptr;
+ --b->headend;
+ _span_one(b);
+ if(bits>24){
+ if (_halt_one(b)) return -1;
+ ret|=*b->headptr<<(24-b->headbit);
+
+ if(bits>=32){
+ ++b->headptr;
+ --b->headend;
+ _span_one(b);
+ if(bits>32){
+ if (_halt_one(b)) return -1;
+ if(b->headbit)ret|=*b->headptr<<(32-b->headbit);
+
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }else{
+
+ ret=b->headptr[0]>>b->headbit;
+ if(bits>8){
+ ret|=b->headptr[1]<<(8-b->headbit);
+ if(bits>16){
+ ret|=b->headptr[2]<<(16-b->headbit);
+ if(bits>24){
+ ret|=b->headptr[3]<<(24-b->headbit);
+ if(bits>32 && b->headbit){
+ ret|=b->headptr[4]<<(32-b->headbit);
+ }
+ }
+ }
+ }
+
+ b->headptr+=bits/8;
+ b->headend-=bits/8;
+ }
+
+ ret&=m;
+ b->headbit=bits&7;
+ return ret;
+}
+
+long oggpack_bytes(oggpack_buffer *b){
+ return(b->count+b->headptr-b->head->buffer->data-b->head->begin+
+ (b->headbit+7)/8);
+}
+
+long oggpack_bits(oggpack_buffer *b){
+ return((b->count+b->headptr-b->head->buffer->data-b->head->begin)*8+
+ b->headbit);
+}
+
diff --git a/wolf3d/code/Tremor/block.c b/wolf3d/code/Tremor/block.c
new file mode 100644
index 0000000..8949253
--- /dev/null
+++ b/wolf3d/code/Tremor/block.c
@@ -0,0 +1,453 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: PCM data vector blocking, windowing and dis/reassembly
+
+ ********************************************************************/
+
+#include
+#include
+#include
+#include "ogg.h"
+#include "ivorbiscodec.h"
+#include "codec_internal.h"
+
+#include "window.h"
+#include "registry.h"
+#include "misc.h"
+
+static int ilog(unsigned int v){
+ int ret=0;
+ if(v)--v;
+ while(v){
+ ret++;
+ v>>=1;
+ }
+ return(ret);
+}
+
+/* pcm accumulator examples (not exhaustive):
+
+ <-------------- lW ---------------->
+ <--------------- W ---------------->
+: .....|..... _______________ |
+: .''' | '''_--- | |\ |
+:.....''' |_____--- '''......| | \_______|
+:.................|__________________|_______|__|______|
+ |<------ Sl ------>| > Sr < |endW
+ |beginSl |endSl | |endSr
+ |beginW |endlW |beginSr
+
+
+ |< lW >|
+ <--------------- W ---------------->
+ | | .. ______________ |
+ | | ' `/ | ---_ |
+ |___.'___/`. | ---_____|
+ |_______|__|_______|_________________|
+ | >|Sl|< |<------ Sr ----->|endW
+ | | |endSl |beginSr |endSr
+ |beginW | |endlW
+ mult[0] |beginSl mult[n]
+
+ <-------------- lW ----------------->
+ |<--W-->|
+: .............. ___ | |
+: .''' |`/ \ | |
+:.....''' |/`....\|...|
+:.........................|___|___|___|
+ |Sl |Sr |endW
+ | | |endSr
+ | |beginSr
+ | |endSl
+ |beginSl
+ |beginW
+*/
+
+/* block abstraction setup *********************************************/
+
+#ifndef WORD_ALIGN
+#define WORD_ALIGN 8
+#endif
+
+int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){
+ memset(vb,0,sizeof(*vb));
+ vb->vd=v;
+ vb->localalloc=0;
+ vb->localstore=NULL;
+
+ return(0);
+}
+
+void *_vorbis_block_alloc(vorbis_block *vb,long bytes){
+ bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1);
+ if(bytes+vb->localtop>vb->localalloc){
+ /* can't just _ogg_realloc... there are outstanding pointers */
+ if(vb->localstore){
+ struct alloc_chain *link=(struct alloc_chain *)_ogg_malloc(sizeof(*link));
+ vb->totaluse+=vb->localtop;
+ link->next=vb->reap;
+ link->ptr=vb->localstore;
+ vb->reap=link;
+ }
+ /* highly conservative */
+ vb->localalloc=bytes;
+ vb->localstore=_ogg_malloc(vb->localalloc);
+ vb->localtop=0;
+ }
+ {
+ void *ret=(void *)(((char *)vb->localstore)+vb->localtop);
+ vb->localtop+=bytes;
+ return ret;
+ }
+}
+
+/* reap the chain, pull the ripcord */
+void _vorbis_block_ripcord(vorbis_block *vb){
+ /* reap the chain */
+ struct alloc_chain *reap=vb->reap;
+ while(reap){
+ struct alloc_chain *next=reap->next;
+ _ogg_free(reap->ptr);
+ memset(reap,0,sizeof(*reap));
+ _ogg_free(reap);
+ reap=next;
+ }
+ /* consolidate storage */
+ if(vb->totaluse){
+ vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc);
+ vb->localalloc+=vb->totaluse;
+ vb->totaluse=0;
+ }
+
+ /* pull the ripcord */
+ vb->localtop=0;
+ vb->reap=NULL;
+}
+
+int vorbis_block_clear(vorbis_block *vb){
+ _vorbis_block_ripcord(vb);
+ if(vb->localstore)_ogg_free(vb->localstore);
+
+ memset(vb,0,sizeof(*vb));
+ return(0);
+}
+
+static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){
+ int i;
+ codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
+ private_state *b=NULL;
+
+ memset(v,0,sizeof(*v));
+ b=(private_state *)(v->backend_state=_ogg_calloc(1,sizeof(*b)));
+
+ v->vi=vi;
+ b->modebits=ilog(ci->modes);
+
+ /* Vorbis I uses only window type 0 */
+ b->window[0]=_vorbis_window(0,ci->blocksizes[0]/2);
+ b->window[1]=_vorbis_window(0,ci->blocksizes[1]/2);
+
+ /* finish the codebooks */
+ if(!ci->fullbooks){
+ ci->fullbooks=(codebook *)_ogg_calloc(ci->books,sizeof(*ci->fullbooks));
+ for(i=0;ibooks;i++){
+ vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i]);
+ /* decode codebooks are now standalone after init */
+ vorbis_staticbook_destroy(ci->book_param[i]);
+ ci->book_param[i]=NULL;
+ }
+ }
+
+ v->pcm_storage=ci->blocksizes[1];
+ v->pcm=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->pcm));
+ v->pcmret=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->pcmret));
+ for(i=0;ichannels;i++)
+ v->pcm[i]=(ogg_int32_t *)_ogg_calloc(v->pcm_storage,sizeof(*v->pcm[i]));
+
+ /* all 1 (large block) or 0 (small block) */
+ /* explicitly set for the sake of clarity */
+ v->lW=0; /* previous window size */
+ v->W=0; /* current window size */
+
+ /* initialize all the mapping/backend lookups */
+ b->mode=(vorbis_look_mapping **)_ogg_calloc(ci->modes,sizeof(*b->mode));
+ for(i=0;imodes;i++){
+ int mapnum=ci->mode_param[i]->mapping;
+ int maptype=ci->map_type[mapnum];
+ b->mode[i]=_mapping_P[maptype]->look(v,ci->mode_param[i],
+ ci->map_param[mapnum]);
+ }
+ return(0);
+}
+
+int vorbis_synthesis_restart(vorbis_dsp_state *v){
+ vorbis_info *vi=v->vi;
+ codec_setup_info *ci;
+
+ if(!v->backend_state)return -1;
+ if(!vi)return -1;
+ ci=vi->codec_setup;
+ if(!ci)return -1;
+
+ v->centerW=ci->blocksizes[1]/2;
+ v->pcm_current=v->centerW;
+
+ v->pcm_returned=-1;
+ v->granulepos=-1;
+ v->sequence=-1;
+ ((private_state *)(v->backend_state))->sample_count=-1;
+
+ return(0);
+}
+
+int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi){
+ _vds_init(v,vi);
+ vorbis_synthesis_restart(v);
+
+ return(0);
+}
+
+void vorbis_dsp_clear(vorbis_dsp_state *v){
+ int i;
+ if(v){
+ vorbis_info *vi=v->vi;
+ codec_setup_info *ci=(codec_setup_info *)(vi?vi->codec_setup:NULL);
+ private_state *b=(private_state *)v->backend_state;
+
+ if(v->pcm){
+ for(i=0;ichannels;i++)
+ if(v->pcm[i])_ogg_free(v->pcm[i]);
+ _ogg_free(v->pcm);
+ if(v->pcmret)_ogg_free(v->pcmret);
+ }
+
+ /* free mode lookups; these are actually vorbis_look_mapping structs */
+ if(ci){
+ for(i=0;imodes;i++){
+ int mapnum=ci->mode_param[i]->mapping;
+ int maptype=ci->map_type[mapnum];
+ if(b && b->mode)_mapping_P[maptype]->free_look(b->mode[i]);
+ }
+ }
+
+ if(b){
+ if(b->mode)_ogg_free(b->mode);
+ _ogg_free(b);
+ }
+
+ memset(v,0,sizeof(*v));
+ }
+}
+
+/* Unlike in analysis, the window is only partially applied for each
+ block. The time domain envelope is not yet handled at the point of
+ calling (as it relies on the previous block). */
+
+int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){
+ vorbis_info *vi=v->vi;
+ codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
+ private_state *b=v->backend_state;
+ int i,j;
+
+ if(v->pcm_current>v->pcm_returned && v->pcm_returned!=-1)return(OV_EINVAL);
+
+ v->lW=v->W;
+ v->W=vb->W;
+ v->nW=-1;
+
+ if((v->sequence==-1)||
+ (v->sequence+1 != vb->sequence)){
+ v->granulepos=-1; /* out of sequence; lose count */
+ b->sample_count=-1;
+ }
+
+ v->sequence=vb->sequence;
+
+ if(vb->pcm){ /* no pcm to process if vorbis_synthesis_trackonly
+ was called on block */
+ int n=ci->blocksizes[v->W]/2;
+ int n0=ci->blocksizes[0]/2;
+ int n1=ci->blocksizes[1]/2;
+
+ int thisCenter;
+ int prevCenter;
+
+ if(v->centerW){
+ thisCenter=n1;
+ prevCenter=0;
+ }else{
+ thisCenter=0;
+ prevCenter=n1;
+ }
+
+ /* v->pcm is now used like a two-stage double buffer. We don't want
+ to have to constantly shift *or* adjust memory usage. Don't
+ accept a new block until the old is shifted out */
+
+ /* overlap/add PCM */
+
+ for(j=0;jchannels;j++){
+ /* the overlap/add section */
+ if(v->lW){
+ if(v->W){
+ /* large/large */
+ ogg_int32_t *pcm=v->pcm[j]+prevCenter;
+ ogg_int32_t *p=vb->pcm[j];
+ for(i=0;ipcm[j]+prevCenter+n1/2-n0/2;
+ ogg_int32_t *p=vb->pcm[j];
+ for(i=0;iW){
+ /* small/large */
+ ogg_int32_t *pcm=v->pcm[j]+prevCenter;
+ ogg_int32_t *p=vb->pcm[j]+n1/2-n0/2;
+ for(i=0;ipcm[j]+prevCenter;
+ ogg_int32_t *p=vb->pcm[j];
+ for(i=0;ipcm[j]+thisCenter;
+ ogg_int32_t *p=vb->pcm[j]+n;
+ for(i=0;icenterW)
+ v->centerW=0;
+ else
+ v->centerW=n1;
+
+ /* deal with initial packet state; we do this using the explicit
+ pcm_returned==-1 flag otherwise we're sensitive to first block
+ being short or long */
+
+ if(v->pcm_returned==-1){
+ v->pcm_returned=thisCenter;
+ v->pcm_current=thisCenter;
+ }else{
+ v->pcm_returned=prevCenter;
+ v->pcm_current=prevCenter+
+ ci->blocksizes[v->lW]/4+
+ ci->blocksizes[v->W]/4;
+ }
+
+ }
+
+ /* track the frame number... This is for convenience, but also
+ making sure our last packet doesn't end with added padding. If
+ the last packet is partial, the number of samples we'll have to
+ return will be past the vb->granulepos.
+
+ This is not foolproof! It will be confused if we begin
+ decoding at the last page after a seek or hole. In that case,
+ we don't have a starting point to judge where the last frame
+ is. For this reason, vorbisfile will always try to make sure
+ it reads the last two marked pages in proper sequence */
+
+ if(b->sample_count==-1){
+ b->sample_count=0;
+ }else{
+ b->sample_count+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4;
+ }
+
+ if(v->granulepos==-1){
+ if(vb->granulepos!=-1){ /* only set if we have a position to set to */
+
+ v->granulepos=vb->granulepos;
+
+ /* is this a short page? */
+ if(b->sample_count>v->granulepos){
+ /* corner case; if this is both the first and last audio page,
+ then spec says the end is cut, not beginning */
+ if(vb->eofflag){
+ /* trim the end */
+ /* no preceeding granulepos; assume we started at zero (we'd
+ have to in a short single-page stream) */
+ /* granulepos could be -1 due to a seek, but that would result
+ in a long coun`t, not short count */
+
+ v->pcm_current-=(b->sample_count-v->granulepos);
+ }else{
+ /* trim the beginning */
+ v->pcm_returned+=(b->sample_count-v->granulepos);
+ if(v->pcm_returned>v->pcm_current)
+ v->pcm_returned=v->pcm_current;
+ }
+
+ }
+
+ }
+ }else{
+ v->granulepos+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4;
+ if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){
+
+ if(v->granulepos>vb->granulepos){
+ long extra=v->granulepos-vb->granulepos;
+
+ if(extra)
+ if(vb->eofflag){
+ /* partial last frame. Strip the extra samples off */
+ v->pcm_current-=extra;
+ } /* else {Shouldn't happen *unless* the bitstream is out of
+ spec. Either way, believe the bitstream } */
+ } /* else {Shouldn't happen *unless* the bitstream is out of
+ spec. Either way, believe the bitstream } */
+ v->granulepos=vb->granulepos;
+ }
+ }
+
+ /* Update, cleanup */
+
+ if(vb->eofflag)v->eofflag=1;
+ return(0);
+}
+
+/* pcm==NULL indicates we just want the pending samples, no more */
+int vorbis_synthesis_pcmout(vorbis_dsp_state *v,ogg_int32_t ***pcm){
+ vorbis_info *vi=v->vi;
+ if(v->pcm_returned>-1 && v->pcm_returnedpcm_current){
+ if(pcm){
+ int i;
+ for(i=0;ichannels;i++)
+ v->pcmret[i]=v->pcm[i]+v->pcm_returned;
+ *pcm=v->pcmret;
+ }
+ return(v->pcm_current-v->pcm_returned);
+ }
+ return(0);
+}
+
+int vorbis_synthesis_read(vorbis_dsp_state *v,int bytes){
+ if(bytes && v->pcm_returned+bytes>v->pcm_current)return(OV_EINVAL);
+ v->pcm_returned+=bytes;
+ return(0);
+}
+
diff --git a/wolf3d/code/Tremor/block.h b/wolf3d/code/Tremor/block.h
new file mode 100644
index 0000000..5e19354
--- /dev/null
+++ b/wolf3d/code/Tremor/block.h
@@ -0,0 +1,24 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2008 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: shared block functions
+
+ ********************************************************************/
+
+#ifndef _V_BLOCK_
+#define _V_BLOCK_
+
+extern void _vorbis_block_ripcord(vorbis_block *vb);
+extern void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
+
+#endif
diff --git a/wolf3d/code/Tremor/codebook.c b/wolf3d/code/Tremor/codebook.c
new file mode 100644
index 0000000..d055870
--- /dev/null
+++ b/wolf3d/code/Tremor/codebook.c
@@ -0,0 +1,371 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: basic codebook pack/unpack/code/decode operations
+
+ ********************************************************************/
+
+#include
+#include
+#include
+#include "ogg.h"
+#include "ivorbiscodec.h"
+#include "codebook.h"
+#include "misc.h"
+
+/* unpacks a codebook from the packet buffer into the codebook struct,
+ readies the codebook auxiliary structures for decode *************/
+int vorbis_staticbook_unpack(oggpack_buffer *opb,static_codebook *s){
+ long i,j;
+ memset(s,0,sizeof(*s));
+
+ /* make sure alignment is correct */
+ if(oggpack_read(opb,24)!=0x564342)goto _eofout;
+
+ /* first the basic parameters */
+ s->dim=oggpack_read(opb,16);
+ s->entries=oggpack_read(opb,24);
+ if(s->entries==-1)goto _eofout;
+
+ /* codeword ordering.... length ordered or unordered? */
+ switch((int)oggpack_read(opb,1)){
+ case 0:
+ /* unordered */
+ s->lengthlist=(long *)_ogg_malloc(sizeof(*s->lengthlist)*s->entries);
+
+ /* allocated but unused entries? */
+ if(oggpack_read(opb,1)){
+ /* yes, unused entries */
+
+ for(i=0;ientries;i++){
+ if(oggpack_read(opb,1)){
+ long num=oggpack_read(opb,5);
+ if(num==-1)goto _eofout;
+ s->lengthlist[i]=num+1;
+ }else
+ s->lengthlist[i]=0;
+ }
+ }else{
+ /* all entries used; no tagging */
+ for(i=0;ientries;i++){
+ long num=oggpack_read(opb,5);
+ if(num==-1)goto _eofout;
+ s->lengthlist[i]=num+1;
+ }
+ }
+
+ break;
+ case 1:
+ /* ordered */
+ {
+ long length=oggpack_read(opb,5)+1;
+ s->lengthlist=(long *)_ogg_malloc(sizeof(*s->lengthlist)*s->entries);
+
+ for(i=0;ientries;){
+ long num=oggpack_read(opb,_ilog(s->entries-i));
+ if(num==-1)goto _eofout;
+ for(j=0;jentries;j++,i++)
+ s->lengthlist[i]=length;
+ length++;
+ }
+ }
+ break;
+ default:
+ /* EOF */
+ return(-1);
+ }
+
+ /* Do we have a mapping to unpack? */
+ switch((s->maptype=oggpack_read(opb,4))){
+ case 0:
+ /* no mapping */
+ break;
+ case 1: case 2:
+ /* implicitly populated value mapping */
+ /* explicitly populated value mapping */
+
+ s->q_min=oggpack_read(opb,32);
+ s->q_delta=oggpack_read(opb,32);
+ s->q_quant=oggpack_read(opb,4)+1;
+ s->q_sequencep=oggpack_read(opb,1);
+
+ {
+ int quantvals=0;
+ switch(s->maptype){
+ case 1:
+ quantvals=_book_maptype1_quantvals(s);
+ break;
+ case 2:
+ quantvals=s->entries*s->dim;
+ break;
+ }
+
+ /* quantized values */
+ s->quantlist=(long *)_ogg_malloc(sizeof(*s->quantlist)*quantvals);
+ for(i=0;iquantlist[i]=oggpack_read(opb,s->q_quant);
+
+ if(quantvals&&s->quantlist[quantvals-1]==-1)goto _eofout;
+ }
+ break;
+ default:
+ goto _errout;
+ }
+
+ /* all set */
+ return(0);
+
+ _errout:
+ _eofout:
+ vorbis_staticbook_clear(s);
+ return(-1);
+}
+
+/* the 'eliminate the decode tree' optimization actually requires the
+ codewords to be MSb first, not LSb. This is an annoying inelegancy
+ (and one of the first places where carefully thought out design
+ turned out to be wrong; Vorbis II and future Ogg codecs should go
+ to an MSb bitpacker), but not actually the huge hit it appears to
+ be. The first-stage decode table catches most words so that
+ bitreverse is not in the main execution path. */
+
+static ogg_uint32_t bitreverse(ogg_uint32_t x){
+ x= ((x>>16)&0x0000ffff) | ((x<<16)&0xffff0000);
+ x= ((x>> 8)&0x00ff00ff) | ((x<< 8)&0xff00ff00);
+ x= ((x>> 4)&0x0f0f0f0f) | ((x<< 4)&0xf0f0f0f0);
+ x= ((x>> 2)&0x33333333) | ((x<< 2)&0xcccccccc);
+ return((x>> 1)&0x55555555) | ((x<< 1)&0xaaaaaaaa);
+}
+
+STIN long decode_packed_entry_number(codebook *book,
+ oggpack_buffer *b){
+ int read=book->dec_maxlength;
+ long lo,hi;
+ long lok = oggpack_look(b,book->dec_firsttablen);
+
+ if (lok >= 0) {
+ long entry = book->dec_firsttable[lok];
+ if(entry&0x80000000UL){
+ lo=(entry>>15)&0x7fff;
+ hi=book->used_entries-(entry&0x7fff);
+ }else{
+ oggpack_adv(b, book->dec_codelengths[entry-1]);
+ return(entry-1);
+ }
+ }else{
+ lo=0;
+ hi=book->used_entries;
+ }
+
+ lok = oggpack_look(b, read);
+
+ while(lok<0 && read>1)
+ lok = oggpack_look(b, --read);
+
+ if(lok<0){
+ oggpack_adv(b,1); /* force eop */
+ return -1;
+ }
+
+ /* bisect search for the codeword in the ordered list */
+ {
+ ogg_uint32_t testword=bitreverse((ogg_uint32_t)lok);
+
+ while(hi-lo>1){
+ long p=(hi-lo)>>1;
+ long test=book->codelist[lo+p]>testword;
+ lo+=p&(test-1);
+ hi-=p&(-test);
+ }
+
+ if(book->dec_codelengths[lo]<=read){
+ oggpack_adv(b, book->dec_codelengths[lo]);
+ return(lo);
+ }
+ }
+
+ oggpack_adv(b, read+1);
+ return(-1);
+}
+
+/* Decode side is specced and easier, because we don't need to find
+ matches using different criteria; we simply read and map. There are
+ two things we need to do 'depending':
+
+ We may need to support interleave. We don't really, but it's
+ convenient to do it here rather than rebuild the vector later.
+
+ Cascades may be additive or multiplicitive; this is not inherent in
+ the codebook, but set in the code using the codebook. Like
+ interleaving, it's easiest to do it here.
+ addmul==0 -> declarative (set the value)
+ addmul==1 -> additive
+ addmul==2 -> multiplicitive */
+
+/* returns the [original, not compacted] entry number or -1 on eof *********/
+long vorbis_book_decode(codebook *book, oggpack_buffer *b){
+ if(book->used_entries>0){
+ long packed_entry=decode_packed_entry_number(book,b);
+ if(packed_entry>=0)
+ return(book->dec_index[packed_entry]);
+ }
+
+ /* if there's no dec_index, the codebook unpacking isn't collapsed */
+ return(-1);
+}
+
+/* returns 0 on OK or -1 on eof *************************************/
+long vorbis_book_decodevs_add(codebook *book,ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point){
+ if(book->used_entries>0){
+ int step=n/book->dim;
+ long *entry = (long *)alloca(sizeof(*entry)*step);
+ ogg_int32_t **t = (ogg_int32_t **)alloca(sizeof(*t)*step);
+ int i,j,o;
+ int shift=point-book->binarypoint;
+
+ if(shift>=0){
+ for (i = 0; i < step; i++) {
+ entry[i]=decode_packed_entry_number(book,b);
+ if(entry[i]==-1)return(-1);
+ t[i] = book->valuelist+entry[i]*book->dim;
+ }
+ for(i=0,o=0;idim;i++,o+=step)
+ for (j=0;j>shift;
+ }else{
+ for (i = 0; i < step; i++) {
+ entry[i]=decode_packed_entry_number(book,b);
+ if(entry[i]==-1)return(-1);
+ t[i] = book->valuelist+entry[i]*book->dim;
+ }
+ for(i=0,o=0;idim;i++,o+=step)
+ for (j=0;jused_entries>0){
+ int i,j,entry;
+ ogg_int32_t *t;
+ int shift=point-book->binarypoint;
+
+ if(shift>=0){
+ for(i=0;ivaluelist+entry*book->dim;
+ for (j=0;jdim;)
+ a[i++]+=t[j++]>>shift;
+ }
+ }else{
+ for(i=0;ivaluelist+entry*book->dim;
+ for (j=0;jdim;)
+ a[i++]+=t[j++]<<-shift;
+ }
+ }
+ }
+ return(0);
+}
+
+long vorbis_book_decodev_set(codebook *book,ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point){
+ if(book->used_entries>0){
+ int i,j,entry;
+ ogg_int32_t *t;
+ int shift=point-book->binarypoint;
+
+ if(shift>=0){
+
+ for(i=0;ivaluelist+entry*book->dim;
+ for (j=0;jdim;){
+ a[i++]=t[j++]>>shift;
+ }
+ }
+ }else{
+
+ for(i=0;ivaluelist+entry*book->dim;
+ for (j=0;jdim;){
+ a[i++]=t[j++]<<-shift;
+ }
+ }
+ }
+ }else{
+
+ int i,j;
+ for(i=0;idim;){
+ a[i++]=0;
+ }
+ }
+ }
+ return(0);
+}
+
+long vorbis_book_decodevv_add(codebook *book,ogg_int32_t **a,\
+ long offset,int ch,
+ oggpack_buffer *b,int n,int point){
+ if(book->used_entries>0){
+ long i,j,entry;
+ int chptr=0;
+ int shift=point-book->binarypoint;
+
+ if(shift>=0){
+
+ for(i=offset;ivaluelist+entry*book->dim;
+ for (j=0;jdim;j++){
+ a[chptr++][i]+=t[j]>>shift;
+ if(chptr==ch){
+ chptr=0;
+ i++;
+ }
+ }
+ }
+ }
+ }else{
+
+ for(i=offset;ivaluelist+entry*book->dim;
+ for (j=0;jdim;j++){
+ a[chptr++][i]+=t[j]<<-shift;
+ if(chptr==ch){
+ chptr=0;
+ i++;
+ }
+ }
+ }
+ }
+ }
+ }
+ return(0);
+}
diff --git a/wolf3d/code/Tremor/codebook.h b/wolf3d/code/Tremor/codebook.h
new file mode 100644
index 0000000..14f6538
--- /dev/null
+++ b/wolf3d/code/Tremor/codebook.h
@@ -0,0 +1,102 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: basic shared codebook operations
+
+ ********************************************************************/
+
+#ifndef _V_CODEBOOK_H_
+#define _V_CODEBOOK_H_
+
+#include "ogg.h"
+
+/* This structure encapsulates huffman and VQ style encoding books; it
+ doesn't do anything specific to either.
+
+ valuelist/quantlist are nonNULL (and q_* significant) only if
+ there's entry->value mapping to be done.
+
+ If encode-side mapping must be done (and thus the entry needs to be
+ hunted), the auxiliary encode pointer will point to a decision
+ tree. This is true of both VQ and huffman, but is mostly useful
+ with VQ.
+
+*/
+
+typedef struct static_codebook{
+ long dim; /* codebook dimensions (elements per vector) */
+ long entries; /* codebook entries */
+ long *lengthlist; /* codeword lengths in bits */
+
+ /* mapping ***************************************************************/
+ int maptype; /* 0=none
+ 1=implicitly populated values from map column
+ 2=listed arbitrary values */
+
+ /* The below does a linear, single monotonic sequence mapping. */
+ long q_min; /* packed 32 bit float; quant value 0 maps to minval */
+ long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */
+ int q_quant; /* bits: 0 < quant <= 16 */
+ int q_sequencep; /* bitflag */
+
+ long *quantlist; /* map == 1: (int)(entries^(1/dim)) element column map
+ map == 2: list of dim*entries quantized entry vals
+ */
+} static_codebook;
+
+typedef struct codebook{
+ long dim; /* codebook dimensions (elements per vector) */
+ long entries; /* codebook entries */
+ long used_entries; /* populated codebook entries */
+
+ /* the below are ordered by bitreversed codeword and only used
+ entries are populated */
+ int binarypoint;
+ ogg_int32_t *valuelist; /* list of dim*entries actual entry values */
+ ogg_uint32_t *codelist; /* list of bitstream codewords for each entry */
+
+ int *dec_index;
+ char *dec_codelengths;
+ ogg_uint32_t *dec_firsttable;
+ int dec_firsttablen;
+ int dec_maxlength;
+
+ long q_min; /* packed 32 bit float; quant value 0 maps to minval */
+ long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */
+
+} codebook;
+
+extern void vorbis_staticbook_clear(static_codebook *b);
+extern void vorbis_staticbook_destroy(static_codebook *b);
+extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source);
+
+extern void vorbis_book_clear(codebook *b);
+extern long _book_maptype1_quantvals(const static_codebook *b);
+
+extern int vorbis_staticbook_unpack(oggpack_buffer *b,static_codebook *c);
+
+extern long vorbis_book_decode(codebook *book, oggpack_buffer *b);
+extern long vorbis_book_decodevs_add(codebook *book, ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point);
+extern long vorbis_book_decodev_set(codebook *book, ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point);
+extern long vorbis_book_decodev_add(codebook *book, ogg_int32_t *a,
+ oggpack_buffer *b,int n,int point);
+extern long vorbis_book_decodevv_add(codebook *book, ogg_int32_t **a,
+ long off,int ch,
+ oggpack_buffer *b,int n,int point);
+
+extern int _ilog(unsigned int v);
+
+
+#endif
diff --git a/wolf3d/code/Tremor/codec_internal.h b/wolf3d/code/Tremor/codec_internal.h
new file mode 100644
index 0000000..3ca7f54
--- /dev/null
+++ b/wolf3d/code/Tremor/codec_internal.h
@@ -0,0 +1,92 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: libvorbis codec headers
+
+ ********************************************************************/
+
+#ifndef _V_CODECI_H_
+#define _V_CODECI_H_
+
+#include "codebook.h"
+
+typedef void vorbis_look_mapping;
+typedef void vorbis_look_floor;
+typedef void vorbis_look_residue;
+typedef void vorbis_look_transform;
+
+/* mode ************************************************************/
+typedef struct {
+ int blockflag;
+ int windowtype;
+ int transformtype;
+ int mapping;
+} vorbis_info_mode;
+
+typedef void vorbis_info_floor;
+typedef void vorbis_info_residue;
+typedef void vorbis_info_mapping;
+
+typedef struct private_state {
+ /* local lookup storage */
+ const void *window[2];
+
+ /* backend lookups are tied to the mode, not the backend or naked mapping */
+ int modebits;
+ vorbis_look_mapping **mode;
+
+ ogg_int64_t sample_count;
+
+} private_state;
+
+/* codec_setup_info contains all the setup information specific to the
+ specific compression/decompression mode in progress (eg,
+ psychoacoustic settings, channel setup, options, codebook
+ etc).
+*********************************************************************/
+
+typedef struct codec_setup_info {
+
+ /* Vorbis supports only short and long blocks, but allows the
+ encoder to choose the sizes */
+
+ long blocksizes[2];
+
+ /* modes are the primary means of supporting on-the-fly different
+ blocksizes, different channel mappings (LR or M/A),
+ different residue backends, etc. Each mode consists of a
+ blocksize flag and a mapping (along with the mapping setup */
+
+ int modes;
+ int maps;
+ int times;
+ int floors;
+ int residues;
+ int books;
+
+ vorbis_info_mode *mode_param[64];
+ int map_type[64];
+ vorbis_info_mapping *map_param[64];
+ int time_type[64];
+ int floor_type[64];
+ vorbis_info_floor *floor_param[64];
+ int residue_type[64];
+ vorbis_info_residue *residue_param[64];
+ static_codebook *book_param[256];
+ codebook *fullbooks;
+
+ int passlimit[32]; /* iteration limit per couple/quant pass */
+ int coupling_passes;
+} codec_setup_info;
+
+#endif
diff --git a/wolf3d/code/Tremor/config_types.h b/wolf3d/code/Tremor/config_types.h
new file mode 100644
index 0000000..1fdcb27
--- /dev/null
+++ b/wolf3d/code/Tremor/config_types.h
@@ -0,0 +1,25 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
+ * *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
+ * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
+ * *
+ ********************************************************************
+
+ function: #ifdef jail to whip a few platforms into the UNIX ideal.
+
+ ********************************************************************/
+#ifndef _OS_CVTYPES_H
+#define _OS_CVTYPES_H
+
+typedef long long ogg_int64_t;
+typedef int ogg_int32_t;
+typedef unsigned int ogg_uint32_t;
+typedef short ogg_int16_t;
+
+#endif
diff --git a/wolf3d/code/Tremor/configure.in b/wolf3d/code/Tremor/configure.in
new file mode 100644
index 0000000..2b44ee4
--- /dev/null
+++ b/wolf3d/code/Tremor/configure.in
@@ -0,0 +1,131 @@
+dnl Process this file with autoconf to produce a configure script
+
+dnl ------------------------------------------------
+dnl Initialization and Versioning
+dnl ------------------------------------------------
+
+AC_INIT(mdct.c)
+
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+AM_CONFIG_HEADER([config.h])
+
+AM_INIT_AUTOMAKE(libvorbisidec,1.2.0)
+
+dnl Library versioning
+
+V_LIB_CURRENT=1
+V_LIB_REVISION=2
+V_LIB_AGE=0
+AC_SUBST(V_LIB_CURRENT)
+AC_SUBST(V_LIB_REVISION)
+AC_SUBST(V_LIB_AGE)
+
+dnl --------------------------------------------------
+dnl Check for programs
+dnl --------------------------------------------------
+
+dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
+dnl if $CFLAGS is blank
+cflags_save="$CFLAGS"
+AC_PROG_CC
+AC_PROG_CPP
+CFLAGS="$cflags_save"
+
+AM_PROG_LIBTOOL
+
+dnl --------------------------------------------------
+dnl Set build flags based on environment
+dnl --------------------------------------------------
+
+dnl Set some target options
+
+cflags_save="$CFLAGS"
+ldflags_save="$LDFLAGS"
+if test -z "$GCC"; then
+ case $host in
+ arm-*-*)
+ DEBUG="-g -D_ARM_ASSEM_"
+ CFLAGS="-O -D_ARM_ASSEM_"
+ PROFILE="-p -g -O -D_ARM_ASSEM_" ;;
+ *)
+ DEBUG="-g"
+ CFLAGS="-O"
+ PROFILE="-g -p" ;;
+ esac
+else
+
+ case $host in
+ arm-*-*)
+ DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -D_ARM_ASSEM_"
+ CFLAGS="-O2 -D_ARM_ASSEM_ -fsigned-char"
+ PROFILE="-W -pg -g -O2 -D_ARM_ASSEM_ -fsigned-char -fno-inline-functions";;
+
+ *)
+ DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
+ CFLAGS="-O2 -Wall -fsigned-char"
+ PROFILE="-Wall -pg -g -O2 -fsigned-char -fno-inline-functions";;
+ esac
+fi
+CFLAGS="$CFLAGS $cflags_save -D_REENTRANT"
+LDFLAGS="$LDFLAGS $ldflags_save"
+
+
+# Test whenever ld supports -version-script
+AC_PROG_LD
+AC_PROG_LD_GNU
+if test "x$lt_cv_prog_gnu_ld" = "xyes"; then
+ SHLIB_VERSION_ARG="Wl,--version-script=Version_script"
+
+ dnl Set extra linker options
+ case "$target_os" in
+ linux* | solaris* )
+ SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
+ ;;
+ *)
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS $SHLIB_VERSION_ARG"
+fi
+
+dnl --------------------------------------------------
+dnl Options
+dnl --------------------------------------------------
+
+AC_ARG_ENABLE(
+ low-accuracy,
+ [ --enable-low-accuracy enable 32 bit only multiply operations],
+ CFLAGS="$CFLAGS -D_LOW_ACCURACY_"
+)
+
+dnl --------------------------------------------------
+dnl Check for headers
+dnl --------------------------------------------------
+
+AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
+
+dnl --------------------------------------------------
+dnl Check for typedefs, structures, etc
+dnl --------------------------------------------------
+
+dnl none
+
+dnl --------------------------------------------------
+dnl Check for library functions
+dnl --------------------------------------------------
+
+AC_FUNC_ALLOCA
+AC_FUNC_MEMCMP
+
+dnl --------------------------------------------------
+dnl Do substitutions
+dnl --------------------------------------------------
+
+LIBS="$LIBS"
+
+AC_SUBST(LIBS)
+AC_SUBST(DEBUG)
+AC_SUBST(PROFILE)
+
+AC_OUTPUT(Makefile Version_script)
diff --git a/wolf3d/code/Tremor/debian/Makefile.am b/wolf3d/code/Tremor/debian/Makefile.am
new file mode 100644
index 0000000..45a0f01
--- /dev/null
+++ b/wolf3d/code/Tremor/debian/Makefile.am
@@ -0,0 +1,6 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+
+EXTRA_DIST = changelog control copyright libvorbisidec1.install\
+ libvorbisidec-dev.install rules
diff --git a/wolf3d/code/Tremor/debian/changelog b/wolf3d/code/Tremor/debian/changelog
new file mode 100644
index 0000000..0cb4935
--- /dev/null
+++ b/wolf3d/code/Tremor/debian/changelog
@@ -0,0 +1,9 @@
+libvorbisidec (1.2.0-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Christopher L Cheney Wed, 09 Oct 2002 22:00:00 -0500
+
+Local variables:
+mode: debian-changelog
+End:
diff --git a/wolf3d/code/Tremor/debian/control b/wolf3d/code/Tremor/debian/control
new file mode 100644
index 0000000..f286e91
--- /dev/null
+++ b/wolf3d/code/Tremor/debian/control
@@ -0,0 +1,22 @@
+Source: libvorbisidec
+Section: libs
+Priority: optional
+Maintainer: Christopher L Cheney
+Build-Depends: autotools-dev, debhelper (>> 4.0.18), devscripts, gawk
+Standards-Version: 3.5.7.0
+
+Package: libvorbisidec1
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}
+Description: Ogg Bitstream Library
+ Libogg is a library for manipulating ogg bitstreams. It handles
+ both making ogg bitstreams and getting packets from ogg bitstreams.
+
+Package: libvorbisidec-dev
+Architecture: any
+Section: devel
+Depends: libvorbisidec1 (= ${Source-Version}), libc6-dev
+Description: Ogg Bitstream Library Development
+ The libogg-dev package contains the header files and documentation
+ needed to develop applications with libogg.
diff --git a/wolf3d/code/Tremor/debian/copyright b/wolf3d/code/Tremor/debian/copyright
new file mode 100644
index 0000000..ef98ddd
--- /dev/null
+++ b/wolf3d/code/Tremor/debian/copyright
@@ -0,0 +1,37 @@
+This package was debianized by Christopher L Cheney on
+Wed, 09 Oct 2002 22:00:00 -0500.
+
+It was downloaded from cvs.
+
+Upstream Author(s): Monty
+
+Copyright:
+Copyright (c) 2002, Xiph.org Foundation
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+- Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+- Neither the name of the Xiph.Org Foundation nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/wolf3d/code/Tremor/debian/libvorbisidec-dev.install b/wolf3d/code/Tremor/debian/libvorbisidec-dev.install
new file mode 100644
index 0000000..5c3ccf9
--- /dev/null
+++ b/wolf3d/code/Tremor/debian/libvorbisidec-dev.install
@@ -0,0 +1,8 @@
+debian/tmp/usr/include/tremor/config_types.h
+debian/tmp/usr/include/tremor/ivorbiscodec.h
+debian/tmp/usr/include/tremor/ivorbisfile.h
+debian/tmp/usr/include/tremor/ogg.h
+debian/tmp/usr/include/tremor/os_types.h
+debian/tmp/usr/lib/libvorbisidec.a
+debian/tmp/usr/lib/libvorbisidec.la
+debian/tmp/usr/lib/libvorbisidec.so
diff --git a/wolf3d/code/Tremor/debian/libvorbisidec1.install b/wolf3d/code/Tremor/debian/libvorbisidec1.install
new file mode 100644
index 0000000..b824d1e
--- /dev/null
+++ b/wolf3d/code/Tremor/debian/libvorbisidec1.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/libvorbisidec.so.*
diff --git a/wolf3d/code/Tremor/debian/rules b/wolf3d/code/Tremor/debian/rules
new file mode 100644
index 0000000..c684884
--- /dev/null
+++ b/wolf3d/code/Tremor/debian/rules
@@ -0,0 +1,151 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=4
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+ INSTALL_PROGRAM += -s
+endif
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+
+ # make build directory
+ mkdir $(objdir)
+
+ # run configure with build tree $(objdir)
+ # change ../configure to ../autogen.sh for CVS build
+ cd $(objdir) && \
+ ../configure --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
+ --prefix=/usr
+
+ touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+ dh_testdir
+
+ cd $(objdir) && \
+ $(MAKE)
+
+ touch build-stamp
+
+autotools:
+ OLDDATESUB=`./config.sub -t | tr -d -` ;\
+ OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
+ NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
+ NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
+ if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
+ $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
+ dch -a -p "GNU config automated update: config.sub\
+ ($$OLDDATESUB to $$NEWDATESUB), config.guess\
+ ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
+ cp -f /usr/share/misc/config.sub config.sub ;\
+ cp -f /usr/share/misc/config.guess config.guess ;\
+ echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
+ fi
+
+debian-clean:
+ dh_testdir
+ dh_testroot
+
+ dh_clean
+
+clean: autotools
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Remove build tree
+ rm -rf $(objdir)
+
+ # if Makefile exists run distclean
+ if test -f Makefile; then \
+ $(MAKE) distclean; \
+ fi
+
+ #if test -d CVS; then \
+ $(MAKE) cvs-clean ;\
+ fi
+
+ dh_clean
+
+install: DH_OPTIONS=
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ cd $(objdir) && \
+ $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+
+ dh_install --list-missing
+
+# This single target is used to build all the packages, all at once, or
+# one at a time. So keep in mind: any options passed to commands here will
+# affect _all_ packages. Anything you want to only affect one package
+# should be put in another target, such as the install target.
+binary-common:
+ dh_testdir
+ dh_testroot
+# dh_installxfonts
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+# dh_undocumented
+ dh_installman
+ dh_strip
+ dh_link
+ dh_compress
+ dh_fixperms
+ dh_makeshlibs -V
+ dh_installdeb
+# dh_perl
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture independant packages using the common target.
+binary-indep: build install
+# $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+# Build architecture dependant packages using the common target.
+binary-arch: build install
+ $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+
+# Any other binary targets build just one binary package at a time.
+binary-%: build install
+ $(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/wolf3d/code/Tremor/doc/OggVorbis_File.html b/wolf3d/code/Tremor/doc/OggVorbis_File.html
new file mode 100644
index 0000000..9201d18
--- /dev/null
+++ b/wolf3d/code/Tremor/doc/OggVorbis_File.html
@@ -0,0 +1,132 @@
+
+
+
+Tremor - datatype - OggVorbis_File
+
+
+
+
+
+
+
Tremor documentation
+
Tremor version 1.0 - 20020403
+
+
+
+
OggVorbis_File
+
+
declared in "ivorbisfile.h"
+
+
+The OggVorbis_File structure defines an Ogg Vorbis file.
+
+
+This structure is used in all libvorbisidec routines. Before it can be used,
+it must be initialized by ov_open() or ov_open_callbacks().
+
+
+After use, the OggVorbis_File structure must be deallocated with a
+call to ov_clear().
+
+
+Once a file or data source is opened successfully by libvorbisidec
+(using ov_open() or ov_open_callbacks()), it is owned by
+libvorbisidec. The file should not be used by any other applications or
+functions outside of the libvorbisidec API. The file must not be closed
+directly by the application at any time after a successful open;
+libvorbisidec expects to close the file within ov_clear().
+
+If the call to ov_open() or ov_open_callbacks()fails,
+libvorbisidec does not assume ownership of the file and the
+application is expected to close it if necessary.
+
+
+
+
+
+
typedef struct {
+ void *datasource; /* Pointer to a FILE *, etc. */
+ int seekable;
+ ogg_int64_t offset;
+ ogg_int64_t end;
+ ogg_sync_state oy;
+
+ /* If the FILE handle isn't seekable (eg, a pipe), only the current
+ stream appears */
+ int links;
+ ogg_int64_t *offsets;
+ ogg_int64_t *dataoffsets;
+ long *serialnos;
+ ogg_int64_t *pcmlengths;
+ vorbis_info *vi;
+ vorbis_comment *vc;
+
+ /* Decoding working state local storage */
+ ogg_int64_t pcm_offset;
+ int ready_state;
+ long current_serialno;
+ int current_link;
+
+ ogg_int64_t bittrack;
+ ogg_int64_t samptrack;
+
+ ogg_stream_state os; /* take physical pages, weld into a logical
+ stream of packets */
+ vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
+ vorbis_block vb; /* local working space for packet->PCM decode */
+
+ ov_callbacks callbacks;
+
+} OggVorbis_File;
+
+
+
+
+
Relevant Struct Members
+
+
datasource
+
+
Pointer to file or other ogg source. When using stdio based
+file/stream access, this field contains a FILE pointer. When using
+custom IO via callbacks, libvorbisidec treats this void pointer as a
+black box only to be passed to the callback routines provided by the
+application.
+
+
seekable
+
Read-only int indicating whether file is seekable. E.g., a physical file is seekable, a pipe isn't.
+
links
+
Read-only int indicating the number of logical bitstreams within the physical bitstream.
+
ov_callbacks
+
Collection of file manipulation routines to be used on this data source. When using stdio/FILE access via ov_open(), the callbacks will be filled in with stdio calls or wrappers to stdio calls.
+
+
+
Notes
+
+
Tremor requires a native 64 bit integer type to compile and
+function; The GNU build system will locate and typedef
+ogg_int64_t to the appropriate native type. If not using the
+GNU build tools, you will need to define ogg_int64_t as a
+64-bit type inside your system's project file/Makefile, etc. On win32,
+for example, this should be defined as __int64.
+
+
+The C source in the Tremor package will build on any ANSI C compiler
+and function completely and properly on any platform. The included
+build system assumes GNU build system and make tools (m4, automake,
+autoconf, libtool and gmake). GCC is not required, although GCC is
+the most tested compiler. To build using GNU tools, type in the
+source directory:
+
+
+
+./autogen.sh
+gmake
+
+
+or if GNU make is the standard make on the build system:
+
+./autogen.sh
+make
+
+
+
+Currently, the source implements playback in pure C on all platforms
+except ARM, where a [currently] small amount of assembly (see the file
+asm_arm.h) is used to implement 64 bit math operations and
+fast LSP computation. If building on ARM without the benefit of GNU
+build system tools, be sure that _ARM_ASSEM_ is #defined by
+the build system if this assembly is desired, else the resulting
+library will use whatever 64 bit math builtins the compiler
+implements.
+
+
+No math library is required by this source. No floating point
+operations are used at any point in either setup or decode. This
+decoder library will properly decode any past, current or future
+Vorbis I file or stream.
+
+
+The GNU build system produces static and, when supported by the OS,
+dynamic libraries named 'libvorbisidec'. This library exposes an API
+nearly identical to the BSD reference library's 'libvorbisfile',
+including all the features familiar to users of vorbisfile. This API
+is similar enough that the proper header file to include is named
+'ivorbisfile.h', included in the source build directory.
+Lower level libvorbis-style headers and structures are
+in 'ivorbiscodec.h', also included in the source build directory. A
+simple example program, ivorbisfile_example.c, can be built with 'make
+ivorbisfile_example'.
+
Tremor requires a native 64 bit integer type to compile and
+function; The GNU build system will locate and typedef
+ogg_int64_t to the appropriate native type. If not using the
+GNU build tools, you will need to define ogg_int64_t as a
+64-bit type inside your system's project file/Makefile, etc. On win32,
+for example, this should be defined as __int64.
+
+
+Although stdio is convenient and nearly universally implemented as per
+ANSI C, it is not suited to all or even most potential uses of Vorbis.
+For additional flexibility, embedded applications may provide their
+own I/O functions for use with Tremor when stdio is unavailable or not
+suitable. One common example is decoding a Vorbis stream from a
+memory buffer.
+
+The read-like function provided in the read_func field is
+used to fetch the requested amount of data. It expects the fetch
+operation to function similar to file-access, that is, a multiple read
+operations will retrieve contiguous sequential pieces of data,
+advancing a position cursor after each read.
+
+The following behaviors are also expected:
+
+
a return of '0' indicates end-of-data (if the by-thread errno is unset)
+
short reads mean nothing special (short reads are not treated as error conditions)
+
a return of zero with the by-thread errno set to nonzero indicates a read error
+
+
+
+
Seek function
+
+The seek-like function provided in the seek_func field is
+used to request non-sequential data access by libvorbisidec, moving
+the access cursor to the requested position.
+
+libvorbisidec expects the following behavior:
+
+
The seek function must always return -1 (failure) if the given
+data abstraction is not seekable. It may choose to always return -1
+if the application desires libvorbisidec to treat the Vorbis data
+strictly as a stream (which makes for a less expensive open
+operation).
+
+
If the seek function initially indicates seekability, it must
+always succeed upon being given a valid seek request.
+
+
The seek function must implement all of SEEK_SET, SEEK_CUR and
+SEEK_END. The implementation of SEEK_END should set the access cursor
+one past the last byte of accessible data, as would stdio
+fseek()
+
+
+
Close function
+
+The close function should deallocate any access state used by the
+passed in instance of the data access abstraction and invalidate the
+instance handle. The close function is assumed to succeed.
+
+One common use of callbacks and the close function is to change the
+behavior of libvorbisidec with respect to file closure for applications
+that mustfclose data files themselves. By passing
+the normal stdio calls as callback functions, but passing a
+close_func that does nothing, an application may call ov_clear() and then fclose() the
+file originally passed to libvorbisidec.
+
+
Tell function
+
+The tell function is intended to mimic the
+behavior of ftell() and must return the byte position of the
+next data byte that would be read. If the data access cursor is at
+the end of the 'file' (pointing to one past the last byte of data, as
+it would be after calling fseek(file,SEEK_END,0)), the tell
+function must return the data position (and thus the total file size),
+not an error.
+
+The tell function need not be provided if the data IO abstraction is
+not seekable.
+
+
+
+
diff --git a/wolf3d/code/Tremor/doc/datastructures.html b/wolf3d/code/Tremor/doc/datastructures.html
new file mode 100644
index 0000000..2b3da07
--- /dev/null
+++ b/wolf3d/code/Tremor/doc/datastructures.html
@@ -0,0 +1,61 @@
+
+
+
+Tremor - Base Data Structures
+
+
+
+
+
+
+
Tremor documentation
+
Tremor version 1.0 - 20020403
+
+
+
+
Base Data Structures
+
There are several data structures used to hold file and bitstream information during libvorbisidec decoding. These structures are declared in "ivorbisfile.h" and "ivorbiscodec.h".
+
+
When using libvorbisidec, it's not necessary to know about most of the contents of these data structures, but it may be helpful to understand what they contain.
+
This structure represents the basic file information. It contains
+ a pointer to the physical file or bitstream and various information about that bitstream.
This structure contains the file comments. It contains
+ a pointer to unlimited user comments, information about the number of comments, and a vendor description.
+All libivorbisdec decoding routines are declared in "ivorbisfile.h".
+
+
+After initialization, decoding audio
+is as simple as calling ov_read(). This
+function works similarly to reading from a normal file using
+read().
+
+However, a few differences are worth noting:
+
+
multiple stream links
+
+A Vorbis stream may consist of multiple sections (called links) that
+encode differing numbers of channels or sample rates. It is vitally
+important to pay attention to the link numbers returned by ov_read and handle audio changes that may
+occur at link boundaries. Such multi-section files do exist in the
+wild and are not merely a specification curiosity.
+
+
returned data amount
+
+ov_read does not attempt to completely fill
+a large, passed in data buffer; it merely guarantees that the passed
+back data does not overflow the passed in buffer size. Large buffers
+may be filled by iteratively looping over calls to ov_read (incrementing the buffer pointer)
+until the original buffer is filled.
+
+
file cursor position
+
+Vorbis files do not necessarily start at a sample number or time offset
+of zero. Do not be surprised if a file begins at a positive offset of
+several minutes or hours, such as would happen if a large stream (such
+as a concert recording) is chopped into multiple seperate files.
+
+
This function makes up the main chunk of a decode loop. It takes an
+OggVorbis_File structure, which must have been initialized by a previous
+call to ov_open().
+
+The Tremor libvorbisidec library exposes an API intended to be as
+similar as possible to the familiar 'vorbisfile' library included with
+the open source Vorbis reference libraries distributed for free by
+Xiph.org. Differences are summarized below.
+
+
OggVorbis_File structure
+
+The bittrack and samptrack fields in the OggVorbis_File structure are changed to
+64 bit integers in Tremor, from doubles in vorbisfile.
+
+
Time-related seek and tell function calls
+
+The ov_time_total() and ov_time_tell() functions return milliseconds as
+64 bit integers in Tremor. In vorbisfile, these functions returned
+seconds as doubles.
+
+In Tremor, the ov_time_seek() and ov_time_seek_page() calls take
+seeking positions in milliseconds as 64 bit integers, rather than in
+seconds as doubles as in Vorbisfile.
+
+
Reading decoded data
+
+Tremor ov_read() always returns data as
+signed 16 bit interleaved PCM in host byte order. As such, it does not
+take arguments to request specific signedness, byte order or bit depth
+as in Vorbisfile.
+The following is a run-through of the decoding example program supplied
+with libvorbisidec, ivorbisfile_example.c.
+This program takes a vorbis bitstream from stdin and writes raw pcm to stdout.
+
+
+First, relevant headers, including vorbis-specific "ivorbiscodec.h" and "ivorbisfile.h" have to be included.
+
+
+We also have to make a concession to Windows users here. If we are using windows for decoding, we must declare these libraries so that we can set stdin/stdout to binary.
+
+Next, a buffer for the pcm audio output is declared.
+
+
+
+
+
+
+char pcmout[4096];
+
+
+
+
+
+
Inside main(), we declare our primary OggVorbis_File structure. We also declare a few other helpful variables to track out progress within the file.
+Also, we make our final concession to Windows users by setting the stdin and stdout to binary mode.
+
ov_open() must be
+called to initialize the OggVorbis_File structure with default values.
+ov_open() also checks to ensure that we're reading Vorbis format and not something else.
+
+
+
+
+
+
+ if(ov_open(stdin, &vf, NULL, 0) < 0) {
+ fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
+ exit(1);
+ }
+
+
+
+
+
+
+
+We're going to pull the channel and bitrate info from the file using ov_info() and show them to the user.
+We also want to pull out and show the user a comment attached to the file using ov_comment().
+
+
+
+ while(!eof){
+ long ret=ov_read(&vf,pcmout,sizeof(pcmout),¤t_section);
+ if (ret == 0) {
+ /* EOF */
+ eof=1;
+ } else if (ret < 0) {
+ /* error in the stream. Not a problem, just reporting it in
+ case we (the app) cares. In this case, we don't. */
+ } else {
+ /* we don't bother dealing with sample rate changes, etc, but
+ you'll have to*/
+ fwrite(pcmout,1,ret,stdout);
+ }
+ }
+
+
+
+
+
+
+
+
+The code is reading blocks of data using ov_read().
+Based on the value returned, we know if we're at the end of the file or have invalid data. If we have valid data, we write it to the pcm output.
+
+
+Now that we've finished playing, we can pack up and go home. It's important to call ov_clear() when we're finished.
+
+
+
+The Tremor Vorbis I stream and file decoder provides an embeddable,
+integer-only library [libvorbisidec] intended for decoding all current
+and future Vorbis I compliant streams. The Tremor libvorbisidec
+library exposes an API intended to be as similar as possible to the
+familiar 'vorbisfile' library included with the open source Vorbis
+reference libraries distributed for free by Xiph.org.
+
+Tremor can be used along with any ANSI compliant stdio implementation
+for file/stream access, or use custom stream i/o routines provided by
+the embedded environment. Both uses are described in detail in this
+documentation.
+
+
In order to decode audio using
+libvorbisidec, a bitstream containing Vorbis audio must be properly
+initialized before decoding and cleared when decoding is finished.
+The simplest possible case is to use fopen() to open a Vorbis
+file and then pass the FILE * to an ov_open() call. A successful return code from ov_open() indicates the file is ready for use.
+Once the file is no longer needed, ov_clear() is used to close the file and
+deallocate decoding resources. Do not call fclose() on the
+file; libvorbisidec does this in the ov_clear() call.
+
+
+All libvorbisidec initialization and deallocation routines are declared in "ivorbisfile.h".
+
Initializes the Ogg Vorbis bitstream with a pointer to a bitstream and default values. This must be called before other functions in the library may be
+ used.
Initializes the Ogg Vorbis bitstream with a pointer to a bitstream, default values, and custom file/bitstream manipulation routines. Used instead of ov_open() when working with other than stdio based I/O.
Partially opens a file just far enough to determine if the file
+is an Ogg Vorbis file or not. A successful return indicates that the
+file appears to be an Ogg Vorbis file, but the OggVorbis_File struct is not yet fully
+initialized for actual decoding. After a successful return, the file
+may be closed using ov_clear() or fully
+opened for decoding using ov_test_open().
This call is intended to
+be used as a less expensive file open test than a full ov_open().
+Note that libvorbisidec owns the passed in file resource is it returns success; do not fclose() files owned by libvorbisidec.
Closes the
+ bitstream and cleans up loose ends. Must be called when
+ finished with the bitstream. After return, the OggVorbis_File struct is
+ invalid and may not be used before being initialized again
+ before begin reinitialized.
+
+
This function returns the average bitrate for the specified logical bitstream. This may be different from the ov_info->nominal_bitrate value, as it is based on the actual average for this bitstream if the file is seekable.
+
Nonseekable files will return the nominal bitrate setting or the average of the upper and lower bounds, if any of these values are set.
+
+
+
+
+
+
+
+long ov_bitrate(OggVorbis_File *vf,int i);
+
+
+
+
+
+
Parameters
+
+
vf
+
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions.
+
i
+
Link to the desired logical bitstream. For nonseekable files, this argument is ignored. To retrieve the bitrate for the entire bitstream, this parameter should be set to -1.
+
+
+
+
Return Values
+
+
OV_EINVAL indicates that an invalid argument value was submitted or that the stream represented by vf is not open.
+
OV_FALSE means the call returned a 'false' status, which in this case most likely indicates that the file is nonseekable and the upper, lower, and nominal bitrates were unset.
+
n indicates the bitrate for the given logical bitstream or the entire
+ physical bitstream. If the file is open for random (seekable) access, it will
+ find the *actual* average bitrate. If the file is streaming (nonseekable), it
+ returns the nominal bitrate (if set) or else the average of the
+ upper/lower bounds (if set).
+The ov_callbacks structure contains file manipulation function prototypes necessary for opening, closing, seeking, and location.
+
+
+The ov_callbacks structure does not need to be user-defined if you are
+working with stdio-based file manipulation; the ov_open() call provides default callbacks for
+stdio. ov_callbacks are defined and passed to ov_open_callbacks() when
+implementing non-stdio based stream manipulation (such as playback
+from a memory buffer).
+
+
+
+
+
+
typedef struct {
+ size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
+ int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
+ int (*close_func) (void *datasource);
+ long (*tell_func) (void *datasource);
+} ov_callbacks;
+
+
+
+
+
Relevant Struct Members
+
+
read_func
+
Pointer to custom data reading function.
+
seek_func
+
Pointer to custom data seeking function. If the data source is not seekable (or the application wants the data source to be treated as unseekable at all times), the provided seek callback should always return -1 (failure).
After a bitstream has been opened using ov_open()/ov_open_callbacks() and decoding is complete, the application must call ov_clear() to clear
+the decoder's buffers and close the file.
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions. After ov_clear has been called, the structure is deallocated and can no longer be used.
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions.
+
i
+
Link to the desired logical bitstream. For nonseekable files, this argument is ignored. To retrieve the vorbis_comment struct for the current bitstream, this parameter should be set to -1.
+
+
+
+
Return Values
+
+
Returns the vorbis_comment struct for the specified bitstream.
+
NULL if the specified bitstream does not exist or the file has been initialized improperly.
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions.
+
i
+
Link to the desired logical bitstream. For nonseekable files, this argument is ignored. To retrieve the vorbis_info struct for the current bitstream, this parameter should be set to -1.
+
+
+
+
Return Values
+
+
Returns the vorbis_info struct for the specified bitstream. Returns vorbis_info for current bitstream if the file is nonseekable or i=-1.
+
NULL if the specified bitstream does not exist or the file has been initialized improperly.
This is the main function used to open and initialize an OggVorbis_File
+structure. It sets up all the related decoding structure.
+
The first argument must be a file pointer to an already opened file
+or pipe (it need not be seekable--though this obviously restricts what
+can be done with the bitstream). vf should be a pointer to the
+OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions. Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
Also, you should be aware that ov_open(), once successful, takes complete possession of the file resource. After you have opened a file using ov_open(), you MUST close it using ov_clear(), not fclose() or any other function.
+
+It is often useful to call ov_open()
+simply to determine whether a given file is a vorbis bitstream. If the
+ov_open()
+call fails, then the file is not recognizable as such.
+When you use ov_open()
+for
+this, you should fclose() the file pointer if, and only if, the
+ov_open()
+call fails. If it succeeds, you must call ov_clear() to clear
+the decoder's buffers and close the file for you.
+
+(Note that ov_test() provides a less expensive way to test a file for Vorbisness.)
File pointer to an already opened file
+or pipe (it need not be seekable--though this obviously restricts what
+can be done with the bitstream).
+
vf
+
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions. Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
initial
+
Typically set to NULL. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. It is used in conjunction with ibytes. In this case, initial
+should be a pointer to a buffer containing the data read.
+
ibytes
+
Typically set to 0. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. In this case, ibytes
+should contain the length (in bytes) of the buffer. Used together with initial
+
+
+
+
Return Values
+
+
0 indicates success
+
+
less than zero for failure:
+
+
OV_EREAD - A read from media returned an error.
+
OV_ENOTVORBIS - Bitstream is not Vorbis data.
+
OV_EVERSION - Vorbis version mismatch.
+
OV_EBADHEADER - Invalid Vorbis bitstream header.
+
OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.
+
+
+
+
+
Notes
+
If your decoder is threaded, it is recommended that you NOT call
+ov_open()
+in the main control thread--instead, call ov_open() IN your decode/playback
+thread. This is important because ov_open() may be a fairly time-consuming
+call, given that the full structure of the file is determined at this point,
+which may require reading large parts of the file under certain circumstances
+(determining all the logical bitstreams in one physical bitstream, for
+example). See Thread Safety for other information on using libvorbisidec with threads.
+
+
+
This is an alternative function used to open and initialize an OggVorbis_File
+structure when using a data source other than a file. It allows you to specify custom file manipulation routines and sets up all the related decoding structure.
+
Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
+It is often useful to call ov_open_callbacks()
+simply to determine whether a given file is a vorbis bitstream. If the
+ov_open_callbacks()
+call fails, then the file is not recognizable as such. When you use ov_open_callbacks()
+for
+this, you should fclose() the file pointer if, and only if, the
+ov_open_callbacks()
+call fails. If it succeeds, you must call ov_clear() to clear
+the decoder's buffers and close the file for you.
+
+See also Callbacks and Non-stdio I/O for information on designing and specifying the required callback functions.
File pointer to an already opened file
+or pipe (it need not be seekable--though this obviously restricts what
+can be done with the bitstream).
+
vf
+
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions. Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
initial
+
Typically set to NULL. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. It is used in conjunction with ibytes. In this case, initial
+should be a pointer to a buffer containing the data read.
+
ibytes
+
Typically set to 0. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. In this case, ibytes
+should contain the length (in bytes) of the buffer. Used together with initial.
+
callbacks
+
Pointer to a completed ov_callbacks struct which indicates desired custom file manipulation routines.
+
+
+
+
Return Values
+
+
0 for success
+
less than zero for failure:
+
+
OV_EREAD - A read from media returned an error.
+
OV_ENOTVORBIS - Bitstream is not Vorbis data.
+
OV_EVERSION - Vorbis version mismatch.
+
OV_EBADHEADER - Invalid Vorbis bitstream header.
+
OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.
+
+
+
+
+
Notes
+
If your decoder is threaded, it is recommended that you NOT call
+ov_open_callbacks()
+in the main control thread--instead, call ov_open_callbacks() IN your decode/playback
+thread. This is important because ov_open_callbacks() may be a fairly time-consuming
+call, given that the full structure of the file is determined at this point,
+which may require reading large parts of the file under certain circumstances
+(determining all the logical bitstreams in one physical bitstream, for
+example).
+See Thread Safety for other information on using libvorbisidec with threads.
+
+
Seeks to the closest page preceding the specified location (in pcm samples) within the physical bitstream. This function only works for seekable streams.
+
This function is faster than ov_pcm_seek because the function can begin decoding at a page boundary rather than seeking through any remaining samples before the specified location. However, it is less accurate.
+
This also updates everything needed within the
+decoder, so you can immediately call ov_read() and get data from
+the newly seeked to position.
+
+ This is the main function used to decode a Vorbis file within a
+ loop. It returns up to the specified number of bytes of decoded audio
+ in host-endian, signed 16 bit PCM format. If the audio is
+ multichannel, the channels are interleaved in the output buffer.
+ If the passed in buffer is large, ov_read() will not fill
+ it; the passed in buffer size is treated as a limit and
+ not a request.
+
+
+Note that up to this point, the Tremor API could more or less hide the
+ multiple logical bitstream nature of chaining from the toplevel
+ application if the toplevel application didn't particularly care.
+ However, when reading audio back, the application must be aware
+ that multiple bitstream sections do not necessarily use the same
+ number of channels or sampling rate.
ov_read() passes
+ back the index of the sequential logical bitstream currently being
+ decoded (in *bitstream) along with the PCM data in order
+ that the toplevel application can handle channel and/or sample
+ rate changes. This number will be incremented at chaining
+ boundaries even for non-seekable streams. For seekable streams, it
+ represents the actual chaining index within the physical bitstream.
+
+
+
+
+
+
+
+long ov_read(OggVorbis_File *vf, char *buffer, int length, int *bitstream);
+
+
+
+
+
+
Parameters
+
+
vf
+
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions.
+
buffer
+
A pointer to an output buffer. The decoded output is inserted into this buffer.
+
length
+
Number of bytes to be read into the buffer. Should be the same size as the buffer. A typical value is 4096.
+
bitstream
+
A pointer to the number of the current logical bitstream.
+
+
+
+
Return Values
+
+
+
OV_HOLE
+
indicates there was an interruption in the data.
+ (one of: garbage between pages, loss of sync followed by
+ recapture, or a corrupt page)
+
OV_EBADLINK
+
indicates that an invalid stream section was supplied to
+ libvorbisidec, or the requested link is corrupt.
+
0
+
indicates EOF
+
n
+
indicates actual number of bytes read. ov_read() will
+ decode at most one vorbis packet per invocation, so the value
+ returned will generally be less than length.
+
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions.
+
i
+
Link to the desired logical bitstream. For nonseekable files, this argument is ignored. To retrieve the serial number of the current bitstream, this parameter should be set to -1.
+
+
+
+
Return Values
+
+
+-1 if the specified logical bitstream i does not exist.
+
+
Returns the serial number of the logical bitstream i or the serial number of the current bitstream if the file is nonseekable.
+This partially opens a vorbis file to test for Vorbis-ness. It loads
+the headers for the first chain, and tests for seekability (but does not seek).
+Use ov_test_open() to finish opening the file
+or ov_clear to close/free it.
+
File pointer to an already opened file
+or pipe (it need not be seekable--though this obviously restricts what
+can be done with the bitstream).
+
vf
+
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions. Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
initial
+
Typically set to NULL. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. It is used in conjunction with ibytes. In this case, initial
+should be a pointer to a buffer containing the data read.
+
ibytes
+
Typically set to 0. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. In this case, ibytes
+should contain the length (in bytes) of the buffer. Used together with initial
+
+
+
+
Return Values
+
+
0 for success
+
+
less than zero for failure:
+
+
OV_EREAD - A read from media returned an error.
+
OV_ENOTVORBIS - Bitstream is not Vorbis data.
+
OV_EVERSION - Vorbis version mismatch.
+
OV_EBADHEADER - Invalid Vorbis bitstream header.
+
OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.
This is an alternative function used to open and test an OggVorbis_File
+structure when using a data source other than a file. It allows you to specify custom file manipulation routines and sets up all the related decoding structures.
+
Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
File pointer to an already opened file
+or pipe (it need not be seekable--though this obviously restricts what
+can be done with the bitstream).
+
vf
+
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions. Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
initial
+
Typically set to NULL. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. It is used in conjunction with ibytes. In this case, initial
+should be a pointer to a buffer containing the data read.
+
ibytes
+
Typically set to 0. This parameter is useful if some data has already been
+read from the file and the stream is not seekable. In this case, ibytes
+should contain the length (in bytes) of the buffer. Used together with initial.
+
callbacks
+
Pointer to a completed ov_callbacks struct which indicates desired custom file manipulation routines.
+
+
+
+
Return Values
+
+
0 for success
+
less than zero for failure:
+
+
OV_EREAD - A read from media returned an error.
+
OV_ENOTVORBIS - Bitstream is not Vorbis data.
+
OV_EVERSION - Vorbis version mismatch.
+
OV_EBADHEADER - Invalid Vorbis bitstream header.
+
OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.
A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisidec
+functions. Once this has been called, the same OggVorbis_File
+struct should be passed to all the libvorbisidec functions.
+
+
+
+
Return Values
+
+
+0 for success
+
+
less than zero for failure:
+
+
OV_EREAD - A read from media returned an error.
+
OV_ENOTVORBIS - Bitstream is not Vorbis data.
+
OV_EVERSION - Vorbis version mismatch.
+
OV_EBADHEADER - Invalid Vorbis bitstream header.
+
OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.
For seekable
+streams, this seeks to the given time. For implementing seeking in a player,
+this is the only function generally needed. This also updates everything needed within the
+decoder, so you can immediately call ov_read() and get data from
+the newly seeked to position. This function does not work for unseekable streams.
+
+
For seekable
+streams, this seeks to closest full page preceding the given time. This function is faster than ov_time_seek because it doesn't seek through the last few samples to reach an exact time, but it is also less accurate. This should be used when speed is important.
+
This function also updates everything needed within the
+decoder, so you can immediately call ov_read() and get data from
+the newly seeked to position.
+
This function does not work for unseekable streams.
+
+
The makeup of the Tremor libvorbisidec library API is relatively
+simple. It revolves around a single file resource. This file resource is
+passed to libvorbisidec, where it is opened, manipulated, and closed,
+in the form of an OggVorbis_File
+struct.
+
+The Tremor API consists of the following functional categories:
+
+
+The following return codes are #defined in "ivorbiscodec.h"
+may be returned by libvorbisidec. Descriptions of a code relevant to
+a specific function are found in the reference description of that
+function.
+
+
+
+
OV_FALSE
+
Not true, or no data available
+
+
OV_HOLE
+
Tremor encoutered missing or corrupt data in the bitstream. Recovery
+is normally automatic and this return code is for informational purposes only.
+
+
OV_EREAD
+
Read error while fetching compressed data for decode
+
+
OV_EFAULT
+
Internal inconsistency in decode state. Continuing is likely not possible.
+
+
OV_EIMPL
+
Feature not implemented
+
+
OV_EINVAL
+
Either an invalid argument, or incompletely initialized argument passed to libvorbisidec call
+
+
OV_ENOTVORBIS
+
The given file/data was not recognized as Ogg Vorbis data.
+
+
OV_EBADHEADER
+
The file/data is apparently an Ogg Vorbis stream, but contains a corrupted or undecipherable header.
+
+
OV_EVERSION
+
The bitstream format revision of the given stream is not supported.
+
+
OV_EBADLINK
+
The given link exists in the Vorbis data stream, but is not decipherable due to garbacge or corruption.
Seeking functions allow you to specify a specific point in the stream to begin or continue decoding.
+
+All libvorbisidec seeking routines are declared in "ivorbisfile.h".
+
+
Certain seeking functions are best suited to different situations.
+When speed is important and exact positioning isn't required,
+page-level seeking should be used. Note also that Vorbis files do not
+necessarily start at a sample number or time offset of zero. Do not
+be surprised if a file begins at a positive offset of several minutes
+or hours, such as would happen if a large stream (such as a concert
+recording) is chopped into multiple separate files. Requesting to
+seek to a position before the beginning of such a file will seek to
+the position where audio begins.
This function seeks to the specific time location in the bitstream, specified in integer milliseconds. Note that this differs from the reference vorbisfile implementation, which takes seconds as a float.
+
+Tremor's libvorbisidec may be used safely in a threading environment
+so long as thread access to individual OggVorbis_File instances is serialized.
+
+
+
Only one thread at a time may enter a function that takes a given OggVorbis_File instance, even if the
+functions involved appear to be read-only.
+
+
Multiple threads may enter
+libvorbisidec at a given time, so long as each thread's function calls
+are using different OggVorbis_File
+instances.
+
+
Any one OggVorbis_File instance may be used safely from multiple threads so long as only one thread at a time is making calls using that instance.
+The vorbis_comment structure defines an Ogg Vorbis comment.
+
+Only the fields the program needs must be defined. If a field isn't
+defined by the application, it will either be blank (if it's a string value)
+or set to some reasonable default (usually 0).
+
+
+
+
+
+
typedef struct vorbis_comment{
+ /* unlimited user comment fields. */
+ char **user_comments;
+ int *comment_lengths;
+ int comments;
+ char *vendor;
+
+} vorbis_comment;
+
+
+
+
+
Parameters
+
+
user_comments
+
Unlimited user comment array. The individual strings in the array are 8 bit clean, by the Vorbis specification, and as such the comment_lengths array should be consulted to determine string length. For convenience, each string is also NULL-terminated by the decode library (although Vorbis comments are not NULL terminated within the bitstream itself).
+
comment_lengths
+
An int array that stores the length of each comment string
+
comments
+
Int signifying number of user comments in user_comments field.
+
vendor
+
Information about the creator of the file. Stored in a standard C 0-terminated string.
+The vorbis_info structure contains basic information about the audio in a vorbis bitstream.
+
+
+
+
+
+
typedef struct vorbis_info{
+ int version;
+ int channels;
+ long rate;
+
+ long bitrate_upper;
+ long bitrate_nominal;
+ long bitrate_lower;
+ long bitrate_window;
+
+ void *codec_setup;
+
+} vorbis_info;
+
+
+
+
+
Relevant Struct Members
+
+
version
+
Vorbis encoder version used to create this bitstream.
+
channels
+
Int signifying number of channels in bitstream.
+
rate
+
Sampling rate of the bitstream.
+
bitrate_upper
+
Specifies the upper limit in a VBR bitstream. If the value matches the bitrate_nominal and bitrate_lower parameters, the stream is fixed bitrate. May be unset if no limit exists.
+
bitrate_nominal
+
Specifies the average bitrate for a VBR bitstream. May be unset. If the bitrate_upper and bitrate_lower parameters match, the stream is fixed bitrate.
+
bitrate_lower
+
Specifies the lower limit in a VBR bitstream. If the value matches the bitrate_nominal and bitrate_upper parameters, the stream is fixed bitrate. May be unset if no limit exists.
+
bitrate_window
+
Currently unset.
+
+
codec_setup
+
Internal structure that contains the detailed/unpacked configuration for decoding the current Vorbis bitstream.