nabaztag_hack_kit 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.travis.yml +3 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +4 -0
- data/README.md +119 -0
- data/Rakefile +21 -0
- data/bin/mtl_comp +41 -0
- data/bin/mtl_merge +22 -0
- data/bin/mtl_simu +40 -0
- data/bytecode/lib/buffer.mtl +109 -0
- data/bytecode/lib/button.mtl +27 -0
- data/bytecode/lib/data_helper.mtl +88 -0
- data/bytecode/lib/ear.mtl +90 -0
- data/bytecode/lib/led.mtl +33 -0
- data/bytecode/lib/rfid.mtl +50 -0
- data/bytecode/main.mtl +129 -0
- data/config.ru +6 -0
- data/ext/bytecode/Commands.md +172 -0
- data/ext/bytecode/Docs.md +488 -0
- data/ext/bytecode/README.md +5 -0
- data/ext/bytecode/lib/arp.mtl +159 -0
- data/ext/bytecode/lib/cfg.mtl +74 -0
- data/ext/bytecode/lib/choreos.mtl +1487 -0
- data/ext/bytecode/lib/dhcp.mtl +152 -0
- data/ext/bytecode/lib/dns.mtl +89 -0
- data/ext/bytecode/lib/http.mtl +84 -0
- data/ext/bytecode/lib/tcp.mtl +340 -0
- data/ext/bytecode/lib/udp.mtl +49 -0
- data/ext/bytecode/lib/util.mtl +74 -0
- data/ext/bytecode/lib/var.mtl +15 -0
- data/ext/bytecode/lib/wifi.mtl +243 -0
- data/ext/bytecode/nominal-ping.mtl +5828 -0
- data/ext/mtl/Makefile +42 -0
- data/ext/mtl/README.md +13 -0
- data/ext/mtl/bc.cpp +1891 -0
- data/ext/mtl/conf.bin.sans_password +0 -0
- data/ext/mtl/config.txt +5 -0
- data/ext/mtl/dumpbc.c +2566 -0
- data/ext/mtl/extconf.rb +1 -0
- data/ext/mtl/linux_simu.c +271 -0
- data/ext/mtl/linux_simuaudio.c +16 -0
- data/ext/mtl/linux_simuaudio.h +18 -0
- data/ext/mtl/linux_simunet.c +620 -0
- data/ext/mtl/linux_simunet.h +7 -0
- data/ext/mtl/log.c +297 -0
- data/ext/mtl/log.h +20 -0
- data/ext/mtl/main_compiler.cpp +104 -0
- data/ext/mtl/main_simu.cpp +221 -0
- data/ext/mtl/mp3/GTKANAL.H +97 -0
- data/ext/mtl/mp3/LAYER3.C +2090 -0
- data/ext/mtl/mp3/TABINIT.C +82 -0
- data/ext/mtl/mp3/common.c +265 -0
- data/ext/mtl/mp3/dct64_i386.c +316 -0
- data/ext/mtl/mp3/decode_i386.c +155 -0
- data/ext/mtl/mp3/huffman.h +332 -0
- data/ext/mtl/mp3/interface.c +258 -0
- data/ext/mtl/mp3/mpg123.h +182 -0
- data/ext/mtl/mp3/mpglib.h +44 -0
- data/ext/mtl/properties.c +293 -0
- data/ext/mtl/properties.h +10 -0
- data/ext/mtl/simu.c +750 -0
- data/ext/mtl/simuaudio.c +662 -0
- data/ext/mtl/simuaudio.h +74 -0
- data/ext/mtl/simunet.c +400 -0
- data/ext/mtl/simunet.h +30 -0
- data/ext/mtl/utils/correct_const.sh +34 -0
- data/ext/mtl/vaudio.c +677 -0
- data/ext/mtl/vaudio.h +46 -0
- data/ext/mtl/vbc.h +160 -0
- data/ext/mtl/vbc_str.h +166 -0
- data/ext/mtl/vcomp/Makefile +29 -0
- data/ext/mtl/vcomp/bootstrap.cpp +89 -0
- data/ext/mtl/vcomp/compiler.cpp +470 -0
- data/ext/mtl/vcomp/compiler.h +200 -0
- data/ext/mtl/vcomp/compiler_file.cpp +929 -0
- data/ext/mtl/vcomp/compiler_prog.cpp +250 -0
- data/ext/mtl/vcomp/compiler_term.cpp +1053 -0
- data/ext/mtl/vcomp/compiler_type.cpp +872 -0
- data/ext/mtl/vcomp/compiler_var.cpp +289 -0
- data/ext/mtl/vcomp/file.cpp +79 -0
- data/ext/mtl/vcomp/file.h +39 -0
- data/ext/mtl/vcomp/filesystem.h +14 -0
- data/ext/mtl/vcomp/interpreter.cpp +85 -0
- data/ext/mtl/vcomp/interpreter.h +121 -0
- data/ext/mtl/vcomp/memory.cpp +241 -0
- data/ext/mtl/vcomp/memory.h +326 -0
- data/ext/mtl/vcomp/param.h +95 -0
- data/ext/mtl/vcomp/parser.cpp +427 -0
- data/ext/mtl/vcomp/parser.h +97 -0
- data/ext/mtl/vcomp/parser_xml.cpp +124 -0
- data/ext/mtl/vcomp/prodbuffer.cpp +125 -0
- data/ext/mtl/vcomp/prodbuffer.h +42 -0
- data/ext/mtl/vcomp/resource.h +17 -0
- data/ext/mtl/vcomp/stdlib_core.cpp +122 -0
- data/ext/mtl/vcomp/terminal.cpp +73 -0
- data/ext/mtl/vcomp/terminal.h +30 -0
- data/ext/mtl/vcomp/util.cpp +48 -0
- data/ext/mtl/vcomp/util.h +31 -0
- data/ext/mtl/vinterp.c +1349 -0
- data/ext/mtl/vinterp.h +11 -0
- data/ext/mtl/vloader.c +127 -0
- data/ext/mtl/vloader.h +31 -0
- data/ext/mtl/vlog.c +589 -0
- data/ext/mtl/vlog.h +69 -0
- data/ext/mtl/vmem.c +424 -0
- data/ext/mtl/vmem.h +107 -0
- data/ext/mtl/vnet.c +255 -0
- data/ext/mtl/vnet.h +19 -0
- data/lib/nabaztag_hack_kit/message/api.rb +39 -0
- data/lib/nabaztag_hack_kit/message/helper.rb +39 -0
- data/lib/nabaztag_hack_kit/message.rb +36 -0
- data/lib/nabaztag_hack_kit/server.rb +50 -0
- data/lib/nabaztag_hack_kit/version.rb +3 -0
- data/lib/nabaztag_hack_kit.rb +4 -0
- data/nabaztag_hack_kit.gemspec +29 -0
- data/public/bytecode.bin +0 -0
- data/test/bytecode/helper.mtl +60 -0
- data/test/bytecode/native.mtl +28 -0
- data/test/bytecode/test.mtl +221 -0
- data/test/spec_helper.rb +5 -0
- data/test/unit/message_spec.rb +56 -0
- metadata +209 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
/*
|
2
|
+
layerIII enc->dec delay: 1056 (observed)
|
3
|
+
layerII enc->dec dealy: 480 (observed)
|
4
|
+
|
5
|
+
|
6
|
+
polyphase 256-16 (dec or enc)
|
7
|
+
mdct 256+32 (9*32) (dec or enc)
|
8
|
+
total: 512+16
|
9
|
+
|
10
|
+
|
11
|
+
SYNC_FLUSH calculation:
|
12
|
+
layerIII enc delay: 528
|
13
|
+
extra bits to display full fft window: 224
|
14
|
+
total: 752
|
15
|
+
|
16
|
+
layerII sync_flush: should be 464
|
17
|
+
layerIII sync_flush: should be 752
|
18
|
+
|
19
|
+
|
20
|
+
Also we would like to remove mpg123 decoder delay with
|
21
|
+
DECDELAY of -528 (not possible)
|
22
|
+
so delay by a enough to make the total delay 1 whole frame (1152-528)
|
23
|
+
*/
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
#define ENCDELAY 528
|
28
|
+
#define DECDELAY (1152-528)
|
29
|
+
|
30
|
+
/* use this delay if you want to also include the data from the FFT window */
|
31
|
+
#define WINDELAY (224 + ENCDELAY)
|
32
|
+
|
33
|
+
|
34
|
+
#ifdef HAVEGTK
|
35
|
+
|
36
|
+
/* mpg123 ouput is delayed by 1 frame
|
37
|
+
* HOWEVER, sometimes mpg123 doesn't produce a frame until we send the
|
38
|
+
* next frame. Everytime this happens, bump up MPGLAG.
|
39
|
+
*/
|
40
|
+
#define READ_AHEAD 10 /* number of frames to read ahead */
|
41
|
+
#define MAXMPGLAG READ_AHEAD /* if the mpg123 lag becomes bigger than this we have to stop */
|
42
|
+
#define NUMBACK 6 /* number of frames we can back up */
|
43
|
+
#define NUMPINFO (NUMBACK+READ_AHEAD+1)
|
44
|
+
|
45
|
+
#define BLKSIZE 1024
|
46
|
+
#define HBLKSIZE 513
|
47
|
+
#define SBMAX_l 21
|
48
|
+
#define SBMAX_s 12
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
typedef struct {
|
53
|
+
int frameNum; /* current frame number */
|
54
|
+
int num_samples; /* number of pcm samples read for this frame */
|
55
|
+
double frametime; /* starting time of frame, in seconds */
|
56
|
+
double pcmdata[2][1152+WINDELAY];
|
57
|
+
double pcmdata2[2][1152+DECDELAY];
|
58
|
+
double energy[2][4][BLKSIZE];
|
59
|
+
double xr[2][2][576];
|
60
|
+
double mpg123xr[2][2][576];
|
61
|
+
double pe[2][4];
|
62
|
+
double ms_ratio[2];
|
63
|
+
|
64
|
+
double thr[2][4][SBMAX_l];
|
65
|
+
double en[2][4][SBMAX_l];
|
66
|
+
double thr_s[2][4][3*SBMAX_s];
|
67
|
+
double en_s[2][4][3*SBMAX_s];
|
68
|
+
double ers[2][4];
|
69
|
+
|
70
|
+
double xfsf[2][2][SBMAX_l];
|
71
|
+
double xfsf_s[2][2][3*SBMAX_s];
|
72
|
+
|
73
|
+
int mpglag;
|
74
|
+
int qss[2][2];
|
75
|
+
int sub_gain[2][2][3];
|
76
|
+
int over[2][2];
|
77
|
+
double noise[2][2];
|
78
|
+
int blocktype[2][2];
|
79
|
+
int scalefac_scale[2][2];
|
80
|
+
int mpg123blocktype[2][2];
|
81
|
+
int mixed[2][2];
|
82
|
+
int mainbits[2][2];
|
83
|
+
int LAMEmainbits[2][2];
|
84
|
+
int stereo,js,ms_stereo,i_stereo,emph,bitrate,sampfreq,maindata;
|
85
|
+
int scfsi,mean_bits,resvsize;
|
86
|
+
int totbits;
|
87
|
+
} plotting_data;
|
88
|
+
|
89
|
+
|
90
|
+
int gtkcontrol();
|
91
|
+
|
92
|
+
extern int gtkflag;
|
93
|
+
//extern plotting_data *pinfo;
|
94
|
+
int decode1file(int fd,short pcm[][1152],int *stereo);
|
95
|
+
int decode1(char *buf,int len,short pcm[][1152],int stereo);
|
96
|
+
|
97
|
+
#endif
|