Mercurial > mplayer.hg
annotate TOOLS/realcodecs/drv4.c @ 28193:200bf2cff54b
Fix confused references to DLL filenames.
author | diego |
---|---|
date | Thu, 01 Jan 2009 23:16:36 +0000 |
parents | 105de0884218 |
children | 3f3f00ce912e |
rev | line source |
---|---|
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
1 /* |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
2 GPL v2 blah blah |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
3 |
28193 | 4 This is a small dll that works as a wrapper for the actual realdrv4.so.6.0 |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
5 dll from real player 8.0. |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
6 */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
7 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
8 /* |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
9 Assuming that RACloseCodec is the last call. |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
10 */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
11 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
12 #include <stddef.h> |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
13 #include <stdio.h> |
24208
3b80b74b6813
Fix "incompatible implicit declaration of built-in function 'exit'" warnings.
diego
parents:
7110
diff
changeset
|
14 #include <stdlib.h> |
24210 | 15 #include <string.h> |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
16 #include <dlfcn.h> |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
17 #include <sys/time.h> |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
18 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
19 typedef unsigned long ulong; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
20 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
21 //000000000000a410 g DF .text 0000000000000043 G2 RV20toYUV420Free |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
22 //000000000000a6c0 g DF .text 0000000000000060 G2 RV20toYUV420CustomMessage |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
23 //000000000000a200 g DF .text 000000000000020c G2 RV20toYUV420Init |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
24 //000000000000a724 g DF .text 0000000000000132 G2 RV20toYUV420HiveMessage |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
25 //000000000000a458 g DF .text 0000000000000262 G2 RV20toYUV420Transform |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
26 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
27 ulong (*rvyuvCustomMessage)(ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
28 ulong (*rvyuvFree)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
29 ulong (*rvyuvHiveMessage)(ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
30 ulong (*rvyuvInit)(ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
31 ulong (*rvyuvTransform)(ulong,ulong,ulong,ulong,ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
32 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
33 //void (*setDLLAccessPath)(ulong); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
34 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
35 int b_dlOpened=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
36 void *handle=NULL; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
37 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
38 /* exits program when failure */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
39 void loadSyms() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
40 fputs("loadSyms()\n", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
41 if (!b_dlOpened) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
42 char *error; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
43 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
44 fputs("opening dll...\n",stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
45 handle = dlopen ("/usr/local/RealPlayer8/Codecs/realdrv4.so.6.0", RTLD_LAZY); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
46 if (!handle) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
47 fputs (dlerror(), stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
48 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
49 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
50 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
51 rvyuvCustomMessage = dlsym(handle, "RV20toYUV420CustomMessage"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
52 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
53 fprintf (stderr, "dlsym(rvyuvCustomMessage): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
54 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
55 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
56 fprintf(stderr, "RV20toYUV420CustomMessage()=0x%0x\n", rvyuvCustomMessage); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
57 rvyuvFree = dlsym(handle, "RV20toYUV420Free"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
58 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
59 fprintf (stderr, "dlsym(rvyuvFree): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
60 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
61 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
62 fprintf(stderr, "RV20toYUV420Free()=0x%0x\n", rvyuvFree); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
63 rvyuvHiveMessage = dlsym(handle, "RV20toYUV420HiveMessage"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
64 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
65 fprintf (stderr, "dlsym(rvyuvHiveMessage): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
66 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
67 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
68 fprintf(stderr, "RV20toYUV420HiveMessage()=0x%0x\n", rvyuvHiveMessage); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
69 rvyuvInit = dlsym(handle, "RV20toYUV420Init"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
70 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
71 fprintf (stderr, "dlsym(rvyuvInit): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
72 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
73 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
74 fprintf(stderr, "RV20toYUV420Init()=0x%0x\n", rvyuvInit); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
75 rvyuvTransform = dlsym(handle, "RV20toYUV420Transform"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
76 if ((error = dlerror()) != NULL) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
77 fprintf (stderr, "dlsym(rvyuvTransform): %s\n", error); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
78 exit(1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
79 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
80 fprintf(stderr, "RV20toYUV420Transform()=0x%0x\n", rvyuvTransform); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
81 b_dlOpened=1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
82 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
83 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
84 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
85 void closeDll() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
86 if (handle) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
87 b_dlOpened=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
88 dlclose(handle); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
89 handle=NULL; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
90 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
91 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
92 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
93 void _init(void) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
94 loadSyms(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
95 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
96 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
97 struct timezone tz; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
98 struct timeval tv1, tv2; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
99 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
100 void tic() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
101 gettimeofday(&tv1, &tz); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
102 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
103 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
104 void toc() { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
105 long secs, usecs; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
106 gettimeofday(&tv2, &tz); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
107 secs=tv2.tv_sec-tv1.tv_sec; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
108 usecs=tv2.tv_usec-tv1.tv_usec; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
109 if (usecs<0) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
110 usecs+=1000000; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
111 --secs; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
112 } |
26449
105de0884218
Remove pointless '0' flag from fprintf call, fixes the warning:
diego
parents:
25313
diff
changeset
|
113 // fprintf(stderr, "Duration: %ld.%.6lds\n", secs, usecs); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
114 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
115 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
116 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
117 static void hexdump(void *pos, int len) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
118 unsigned char *cpos=pos, *cpos1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
119 int lines=(len+15)>>4; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
120 while(lines--) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
121 int len1=len, i; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
122 fprintf(stderr, "#R# %0x ", (int)cpos-(int)pos); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
123 cpos1=cpos; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
124 for (i=0;i<16;i++) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
125 if (len1>0) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
126 fprintf(stderr, "%02x ", *(cpos++)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
127 } else { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
128 fprintf(stderr, " "); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
129 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
130 len1--; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
131 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
132 fputs(" ", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
133 cpos=cpos1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
134 for (i=0;i<16;i++) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
135 if (len>0) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
136 unsigned char ch=(*(cpos++)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
137 if ((ch<32)||(ch>127)) ch='.'; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
138 fputc(ch, stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
139 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
140 len--; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
141 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
142 fputs("\n", stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
143 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
144 fputc('\n', stderr); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
145 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
146 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
147 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
148 ulong RV20toYUV420CustomMessage(ulong* p1,ulong p2) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
149 ulong result; |
24219 | 150 // ulong *pp1=p1; |
151 // ulong temp[16]; | |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
152 fprintf(stderr, "#R# => RV20toYUV420CustomMessage(%p,%p) [%ld,%ld,%ld] \n", p1, p2, p1[0],p1[1],p1[2]); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
153 #if 0 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
154 if(p1[0]==0x24){ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
155 hexdump(p1[2],64); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
156 memset(temp,0x77,16*4); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
157 memcpy(temp,p1[2],16); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
158 p1[2]=temp; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
159 } else { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
160 return 0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
161 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
162 #endif |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
163 |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
164 // fprintf(stderr, "ulong p2=0x%0lx(%ld))\n", p2, p2); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
165 // hexdump((void*)p1, 12); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
166 // if (pp1[0]==0x24) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
167 // hexdump((void*)(pp1[2]),128); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
168 // } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
169 // tic(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
170 result=(*rvyuvCustomMessage)(p1,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
171 // toc(); |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
172 fprintf(stderr, "#R# <= RV20toYUV420CustomMessage --> 0x%0lx(%ld)\n", result, result); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
173 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
174 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
175 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
176 ulong RV20toYUV420Free(ulong p1) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
177 ulong result; |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
178 fprintf(stderr, "RV20toYUV420Free(ulong p1=0x%0lx(%ld))\n", p1, p1); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
179 // hexdump((void*)p1, 44); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
180 tic(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
181 result=(*rvyuvFree)(p1); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
182 toc(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
183 // hexdump((void*)p1, 44); |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
184 fprintf(stderr, "RV20toYUV420Free --> 0x%0lx(%ld)\n\n\n", result, result); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
185 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
186 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
187 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
188 char h_temp[32768]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
189 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
190 ulong RV20toYUV420HiveMessage(ulong *p1,ulong p2) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
191 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
192 fprintf(stderr, "#R# RV20toYUV420HiveMessage(%p,%p)\n", p1, p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
193 // p1->constant,p1->width,p1->height,p1->format1,p1->format2); |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
194 // fprintf(stderr, "ulong p2=0x%0lx(%ld))\n", p2, p2); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
195 // hexdump((void*)p1, sizeof(struct init_data)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
196 |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
197 fprintf(stderr,">HIVE %ld %p\n",p1[0],p1[1]); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
198 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
199 fprintf(stderr,"COPY INIT DATA!\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
200 memset(h_temp,0x77,1000); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
201 memcpy(h_temp,p1,4); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
202 fprintf(stderr,"COPY OK!\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
203 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
204 // tic(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
205 // result=(*rvyuvHiveMessage)(p1,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
206 result=(*rvyuvHiveMessage)(h_temp,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
207 // toc(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
208 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
209 fprintf(stderr,"COPY INIT DATA!\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
210 memcpy(p1,h_temp,8); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
211 fprintf(stderr,"COPY OK!\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
212 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
213 memset(h_temp,0x77,1000); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
214 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
215 // p1[0]=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
216 // p1[1]=0x20000000; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
217 |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
218 fprintf(stderr,"<HIVE %ld %p\n",p1[0],p1[1]); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
219 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
220 // hexdump((void*)p1, sizeof(struct init_data)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
221 // hexdump((void*)p1, 8); |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
222 fprintf(stderr, "#R# RV20toYUV420HiveMessage --> 0x%0lx(%ld)\n\n", result, result); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
223 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
224 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
225 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
226 struct init_data { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
227 short constant; //=0xb; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
228 short width, height; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
229 short x1,x2,x3; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
230 // 12 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
231 ulong format1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
232 long x4; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
233 ulong format2; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
234 // long unknown[32]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
235 }; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
236 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
237 static char i_temp[32768]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
238 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
239 ulong RV20toYUV420Init(ulong p1,ulong p2) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
240 ulong result; |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
241 fprintf(stderr, "#R# RV20toYUV420Init(ulong p1=0x%0lx(%ld), ", p1, p1); |
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
242 fprintf(stderr, "ulong p2=0x%0lx(%ld))\n", p2, p2); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
243 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
244 fprintf(stderr,"COPY INIT DATA!\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
245 memcpy(i_temp,p1,24); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
246 p1=i_temp; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
247 fprintf(stderr,"COPY OK!\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
248 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
249 hexdump((void*)p1, 24); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
250 tic(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
251 result=(*rvyuvInit)(p1,p2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
252 toc(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
253 hexdump((void*)p1, 24); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
254 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
255 memset(i_temp,0x77,1000); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
256 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
257 // hexdump(*((void**)p2), 512); |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
258 fprintf(stderr, "#R# RV20toYUV420Init --> 0x%0lx(%ld)\n\n\n", result, result); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
259 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
260 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
261 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
262 unsigned long build_crc(unsigned char *pch, unsigned long len) { |
24219 | 263 unsigned long crc=0, a; |
264 // unsigned long b; | |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
265 // it's not the real crc function, but so what... |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
266 while (len--) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
267 a=*(pch++); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
268 // a=a+(a<<6); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
269 // a^=0x555; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
270 // b=(crc>>29)&7; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
271 // crc=((crc<<3)+b)^a; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
272 crc^=a; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
273 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
274 return crc; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
275 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
276 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
277 #define MIN(a,b) ((a)<(b)?(a):(b)) |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
278 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
279 // p1=input data (stream) |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
280 // p2=output buffer |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
281 // p3=input struct |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
282 // p4=output struct |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
283 // p5=rvyuv_main |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
284 ulong RV20toYUV420Transform(ulong p1,ulong p2,ulong p3,ulong p4,ulong p5) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
285 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
286 //result=RV20toYUV420Transform(char *input_stream, char *output_data, |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
287 // struct transin *, struct transout *, struct rvyuvMain *); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
288 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
289 ulong result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
290 ulong *pp3=p3; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
291 ulong *pp4=p4; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
292 void *v; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
293 ulong temp[128]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
294 int i; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
295 |
24219 | 296 unsigned long crc_src, crc0; |
297 // unsigned long len, crc1, crc2; | |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
298 unsigned char *pch=(char *)p1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
299 fprintf(stderr, "#R# RV20toYUV420Transform(in=%p,out=%p,tin=%p,tout=%p,yuv=%p)\n",p1,p2,p3,p4,p5); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
300 // input data, length=*p3 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
301 // hexdump((void*)p1, /*MIN(64,*/ *((ulong*)p3) /*)*/ ); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
302 // v=p5; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
303 // v+=0x3c; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
304 // v=*((void **)v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
305 // pp3=v; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
306 // len=pp3[3]*pp3[4]*3/2; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
307 // pch=p2; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
308 // while(--len) *(pch++)=0; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
309 // hexdump((char*)p2, 64); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
310 // hexdump((void*)p3, 32); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
311 // hexdump((void*)p5, 64); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
312 // pp3=p3; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
313 // if (pp3[3]>1024) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
314 // hexdump((void*)(pp3[3]),32); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
315 // pp3=pp3[3]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
316 // } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
317 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
318 pp3=p3; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
319 // it's not the real crc function, but so what... |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
320 pch=p1; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
321 crc_src=build_crc(pch, pp3[0]); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
322 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
323 pp4=pp3[3]; |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
324 fprintf(stderr,"transin1[%p]: {%ld/%ld} ",pp4,pp3[2],pp3[0]); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
325 // pp4[0],pp4[1],pp4[2],pp4[3], |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
326 // pp4[4],pp4[5],pp4[6],pp4[7]); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
327 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
328 memset(temp,0x77,128*4); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
329 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
330 memcpy(temp,pp4,8*(pp3[2]+1)); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
331 for(i=0;i<=pp3[2];i++){ |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
332 fprintf(stderr," %p(%ld)",temp[i*2],temp[i*2+1]); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
333 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
334 fprintf(stderr,"\n"); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
335 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
336 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
337 pp3[3]=pp4=temp; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
338 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
339 // pp4[2]= |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
340 // pp4[3]= |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
341 // pp4[4]=NULL; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
342 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
343 //pp4[6]=pp4[5]; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
344 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
345 v=p5; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
346 /* fprintf(stderr, "rvyuvMain=0x%0x\n", v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
347 v+=0x3c; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
348 v=*((void **)v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
349 fprintf(stderr, "[$+3ch]=0x%0x\n", v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
350 hexdump(v, 512); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
351 v+=0x60; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
352 v=*((void **)v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
353 fprintf(stderr, "[$+60h]=0x%0x\n", v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
354 hexdump(v, 512); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
355 v+=0x28; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
356 v=*((void **)v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
357 fprintf(stderr, "[$+28h]=0x%0x\n", v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
358 hexdump(v, 512); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
359 */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
360 /* v+=0x178; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
361 hexdump(v, 16); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
362 v=*((void **)v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
363 if (v>0x8000000) { |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
364 fprintf(stderr, "[$+178h]=0x%0x\n", v); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
365 hexdump(v, 128); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
366 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
367 */ |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
368 // tic(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
369 result=(*rvyuvTransform)(p1,p2,p3,p4,p5); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
370 // toc(); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
371 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
372 crc0=build_crc(p2, 176*144); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
373 // crc1=build_crc(p2+pp4[3]*pp4[4]/2, pp4[3]*pp4[4]/2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
374 // crc2=build_crc(p2+pp4[3]*pp4[4], pp4[3]*pp4[4]/2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
375 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
376 // pp3=p3; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
377 // TRANSFORM: <timestamp> <numblocks> <len> <crc_src> <crc_dest> <p4[4]> |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
378 // fprintf(stderr, "TRAFO:\t%ld\t%ld\t%ld\t%.8lX\t%.8lX\t%ld\n", |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
379 // pp3[5], pp3[2], pp3[0], crc_src, crc0, pp3[4]); |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
380 fprintf(stderr, "#R# Decode: %ld(%ld) [%08lX] pts=%ld -> %ld [%08lX]\n", |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
381 pp3[0],pp3[2],crc_src,pp3[5], |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
382 result,crc0); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
383 |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
384 // output |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
385 // hexdump((char*)p2, /*64*/ pp4[3]*pp4[4]/2); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
386 // hexdump((void*)p4, 20); |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
387 // hexdump((void*)p5, 512); |
25313
9e13376e0daa
Fix printf format string length modifiers, removes about a trillion warnings.
diego
parents:
24219
diff
changeset
|
388 // fprintf(stderr, "RV20toYUV420Transform --> 0x%0lx(%ld)\n\n\n", result, result); |
7110
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
389 return result; |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
390 } |
86c478bea7ce
realplayer codecs wrappers, originaly written by Florian Schneider, extended
arpi
parents:
diff
changeset
|
391 |