This source file includes following definitions.
- change_video_tables
- set_quality
- save_original_bitrates
- modify_bitrate
- movie_record_task
- liveimage_task
- sub_FF134C54_my
- sub_FF133528_my
- sub_FF133344_my
1
2
3
4 #include "conf.h"
5
6 static int bitrate_multiplier = 4;
7 static int bitrate_changed = 0;
8 extern int video_target_framesize;
9 extern int video_target_framesize2;
10
11
12 static int orig_bitrate[2];
13
14 void change_video_tables(int a, int b) {
15 bitrate_multiplier = (a<<2)/b;
16 bitrate_changed = 1;
17 }
18
19
20 void set_quality(int *x){
21 if (conf.video_mode) *x=12-((conf.video_quality-1)*(12+17)/(99-1));
22 }
23
24 void save_original_bitrates() {
25 orig_bitrate[0] = video_target_framesize;
26 orig_bitrate[1] = video_target_framesize2;
27 bitrate_changed = 1;
28 }
29
30 void modify_bitrate() {
31 if (bitrate_changed) {
32 bitrate_changed = 0;
33 video_target_framesize = (orig_bitrate[0] * bitrate_multiplier) >> 2;
34 video_target_framesize2 = (orig_bitrate[1] * bitrate_multiplier) >> 2;
35 }
36 }
37
38
39
40
41 void __attribute__((naked,noinline)) movie_record_task() {
42 asm volatile (
43 " STMFD SP!, {R2-R10,LR} \n"
44 " LDR R8, =0xFF214F08 \n"
45 " LDR R4, =0xA580 \n"
46 " LDR R9, =0x709 \n"
47 " LDR R10, =0x2710 \n"
48 " MVN R7, #0 \n"
49 " MOV R5, #1 \n"
50 " MOV R6, #0 \n"
51
52 "loc_FF215378:\n"
53 " LDR R0, [R4, #0x30] \n"
54 " MOV R2, #0 \n"
55 " ADD R1, SP, #4 \n"
56 " BL sub_006B849C /*_ReceiveMessageQueue*/ \n"
57 " LDR R0, [R4, #0x38] \n"
58 " CMP R0, #0 \n"
59 " LDRNE R0, [R4, #0x14] \n"
60 " CMPNE R0, #2 \n"
61 " LDRNE R0, [R4, #0x4C] \n"
62 " CMPNE R0, #6 \n"
63 " BNE loc_FF215540 \n"
64 " LDR R0, [SP, #4] \n"
65 " LDR R1, [R0] \n"
66 " SUB R1, R1, #2 \n"
67 " CMP R1, #0x12 \n"
68 " ADDCC PC, PC, R1, LSL#2 \n"
69 " B loc_FF215540 \n"
70 " B loc_FF215454 \n"
71 " B loc_FF21547C \n"
72 " B loc_FF21548C \n"
73 " B loc_FF215494 \n"
74 " B loc_FF21549C \n"
75 " B loc_FF2154B8 \n"
76 " B loc_FF2154C0 \n"
77 " B loc_FF2154CC \n"
78 " B loc_FF2154D4 \n"
79 " B loc_FF21545C \n"
80 " B loc_FF215500 \n"
81 " B loc_FF21552C \n"
82 " B loc_FF215534 \n"
83 " B loc_FF215464 \n"
84 " B loc_FF215540 \n"
85 " B loc_FF21553C \n"
86 " B loc_FF215430 \n"
87 " B loc_FF215404 \n"
88
89 "loc_FF215404:\n"
90 " STR R6, [R4, #0x48] \n"
91 " STR R6, [R4, #0x3C] \n"
92 " STR R7, [R4, #0x10C] \n"
93 " STRH R6, [R4, #8] \n"
94 " STR R8, [R4, #0xEC] \n"
95 " LDR R0, [R4, #0x14] \n"
96 " ADD R0, R0, #1 \n"
97 " STR R0, [R4, #0x14] \n"
98 " MOV R0, #6 \n"
99 " STR R0, [R4, #0x4C] \n"
100 " B loc_FF21544C \n"
101
102 "loc_FF215430:\n"
103 " STR R6, [R4, #0x48] \n"
104 " STR R7, [R4, #0x10C] \n"
105 " STR R8, [R4, #0xEC] \n"
106 " LDR R0, [R4, #0x14] \n"
107 " ADD R0, R0, #1 \n"
108 " STR R0, [R4, #0x14] \n"
109 " STR R5, [R4, #0x4C] \n"
110
111 "loc_FF21544C:\n"
112 " STR R5, [R4, #0xC] \n"
113 " B loc_FF215540 \n"
114
115 "loc_FF215454:\n"
116 " BL sub_FF214B0C \n"
117 " BL save_original_bitrates \n"
118 " B loc_FF215540 \n"
119
120 "loc_FF21545C:\n"
121 " LDR R1, [R4, #0xEC] \n"
122 " B loc_FF2154B0 \n"
123
124 "loc_FF215464:\n"
125 " LDR R1, [R0, #0x18] \n"
126 " LDR R2, [R0, #0x28] \n"
127 " LDR R3, [R0, #0x24] \n"
128 " LDR R0, [R0, #4] \n"
129 " BL sub_FF3CF9CC \n"
130 " B loc_FF215540 \n"
131
132 "loc_FF21547C:\n"
133 " LDR R0, [R4, #0x4C] \n"
134 " CMP R0, #5 \n"
135 " STRNE R5, [R4, #0x3C] \n"
136 " B loc_FF215540 \n"
137
138 "loc_FF21548C:\n"
139 " BL sub_FF2143AC \n"
140 " B loc_FF215540 \n"
141
142 "loc_FF215494:\n"
143 " BL sub_FF214284 \n"
144 " B loc_FF215540 \n"
145
146 "loc_FF21549C:\n"
147 " BL sub_FF213F38 \n"
148 " LDR R1, [R4, #0xBC] \n"
149 " CMP R1, #0 \n"
150 " BEQ loc_FF215540 \n"
151 " LDR R0, [R4, #0xC0] \n"
152
153 "loc_FF2154B0:\n"
154 " BLX R1 \n"
155
156 " LDR R0, =video_compression_rate \n"
157 " BL set_quality \n"
158 " BL modify_bitrate \n"
159
160 " B loc_FF215540 \n"
161
162 "loc_FF2154B8:\n"
163 " BL sub_FF213C74 \n"
164 " B loc_FF215540 \n"
165
166 "loc_FF2154C0:\n"
167 " LDR R0, =0xFF213C00 \n"
168 " BL sub_FF3CF688 \n"
169 " B loc_FF215540 \n"
170
171 "loc_FF2154CC:\n"
172 " BL sub_FF21388C \n"
173 " B loc_FF215540 \n"
174
175 "loc_FF2154D4:\n"
176 " LDR R1, [R4, #0xA4] \n"
177 " LDR R0, =0x49AF430C \n"
178 " CMP R1, #1 \n"
179 " LDRNE R1, =0xFF21382C \n"
180 " LDRNE R0, [R4, #0xA8] \n"
181 " BNE loc_FF2154F8 \n"
182 " BL sub_FF3D035C \n"
183 " LDR R1, =0xFF21382C \n"
184 " MOV R0, #0 \n"
185
186 "loc_FF2154F8:\n"
187 " BL sub_FF3CE948 \n"
188 " B loc_FF215540 \n"
189
190 "loc_FF215500:\n"
191 " LDR R0, =0x182CD0 \n"
192 " LDR R0, [R0, #8] \n"
193 " CMP R0, #0 \n"
194 " LDRNE R2, =0xFF213780 \n"
195 " LDRNE R0, =0xFF213808 \n"
196 " MOVNE R3, #0 \n"
197 " MOVNE R1, R3 \n"
198 " BLNE sub_FF078200 \n"
199 " MOV R0, #3 \n"
200 " STR R0, [R4, #0x4C] \n"
201 " B loc_FF215540 \n"
202
203 "loc_FF21552C:\n"
204 " BL sub_FF2136E8 \n"
205 " B loc_FF215540 \n"
206
207 "loc_FF215534:\n"
208 " BL sub_FF215F54 \n"
209 " B loc_FF215540 \n"
210
211 "loc_FF21553C:\n"
212 " BL sub_FF2135BC \n"
213
214 "loc_FF215540:\n"
215 " LDR R1, [SP, #4] \n"
216 " LDR R3, =0xFF2130F0 /*'MovieRecorder.c'*/ \n"
217 " STR R6, [R1] \n"
218 " STR R9, [SP] \n"
219 " LDR R0, [R4, #0x34] \n"
220 " MOV R2, R10 \n"
221 " BL sub_006B7D38 /*_PostMessageQueueStrictly*/ \n"
222 " B loc_FF215378 \n"
223 );
224 }
225
226
227
228 void __attribute__((naked,noinline)) liveimage_task() {
229 asm volatile (
230 " STMFD SP!, {R3-R5,LR} \n"
231 " LDR R4, =0x5FA8 \n"
232 " MOV R5, #0 \n"
233
234 "loc_FF134984:\n"
235 " LDR R0, [R4, #0xC] \n"
236 " MOV R2, #0 \n"
237 " MOV R1, SP \n"
238 " BL sub_006B849C /*_ReceiveMessageQueue*/ \n"
239 " TST R0, #1 \n"
240 " BEQ loc_FF1349B4 \n"
241 " MOV R2, #0x78 \n"
242 " LDR R1, =0xFF134B90 /*'LiveImageTask.c'*/ \n"
243 " MOV R0, #0 \n"
244 " BL _DebugAssert \n"
245 " BL _ExitTask \n"
246 " LDMFD SP!, {R3-R5,PC} \n"
247
248 "loc_FF1349B4:\n"
249 " LDR R1, [SP] \n"
250 " LDR R0, [R1] \n"
251 " CMP R0, #0 \n"
252 " BEQ loc_FF1349FC \n"
253 " CMP R0, #1 \n"
254 " MOVEQ R1, #1 \n"
255 " BEQ loc_FF134A14 \n"
256 " CMP R0, #2 \n"
257 " BEQ loc_FF134A10 \n"
258 " CMP R0, #3 \n"
259 " BNE loc_FF134A20 \n"
260 " LDR R0, [R4, #4] \n"
261 " CMP R0, #1 \n"
262 " BEQ loc_FF134984 \n"
263 " LDR R0, [R4, #8] \n"
264 " BLX R0 \n"
265 " STR R5, [R4, #8] \n"
266 " B loc_FF134984 \n"
267
268 "loc_FF1349FC:\n"
269 " LDR R0, [R4, #4] \n"
270 " CMP R0, #1 \n"
271 " ADDNE R0, R1, #4 \n"
272 " BLNE sub_FF134C54_my \n"
273 " B loc_FF134984 \n"
274
275 "loc_FF134A10:\n"
276 " MOV R1, #2 \n"
277
278 "loc_FF134A14:\n"
279 " LDR R0, [R4, #0x10] \n"
280 " BL sub_006B8230 /*_SetEventFlag*/ \n"
281 " B loc_FF134984 \n"
282
283 "loc_FF134A20:\n"
284 " MOV R2, #0x97 \n"
285 " LDR R1, =0xFF134B90 /*'LiveImageTask.c'*/ \n"
286 " MOV R0, #0 \n"
287 " BL _DebugAssert \n"
288 " B loc_FF134984 \n"
289 );
290 }
291
292
293
294 void __attribute__((naked,noinline)) sub_FF134C54_my() {
295 asm volatile (
296 " LDR R1, [R0] \n"
297 " CMP R1, #0x18 \n"
298 " ADDCC PC, PC, R1, LSL#2 \n"
299 " B loc_FF134CF8 \n"
300 " B sub_FF132EEC \n"
301 " B sub_FF133160 \n"
302 " B loc_FF134CF8 \n"
303 " B loc_FF134CC8 \n"
304 " B sub_FF133AE4 \n"
305 " B sub_FF133CE0 \n"
306 " B sub_FF1340CC \n"
307 " B sub_FF132EEC \n"
308 " B sub_FF1338CC \n"
309 " B loc_FF134CF8 \n"
310 " B loc_FF134CF8 \n"
311 " B loc_FF134CF8 \n"
312 " B loc_FF134CC8 \n"
313 " B sub_FF1343F4 \n"
314 " B sub_FF1343F4 \n"
315 " B loc_FF134CF8 \n"
316 " B sub_FF13378C \n"
317 " B loc_FF134CF8 \n"
318 " B loc_FF134CF8 \n"
319 " B loc_FF134CF8 \n"
320 " B loc_FF134CF8 \n"
321 " B loc_FF134CF8 \n"
322 " B loc_FF134CF8 \n"
323 " B sub_FF13303C \n"
324
325 "loc_FF134CC4:\n"
326 " B sub_FF13303C \n"
327
328 "loc_FF134CC8:\n"
329
330 " LDR R1, [R0, #0x64] \n"
331 " CMP R1, #1 \n"
332 " BNE sub_FF133528_my \n"
333 " BEQ sub_FF133344_my \n"
334
335 "loc_FF134CD8:\n"
336 " B sub_FF133160 \n"
337
338 "loc_FF134CDC:\n"
339 " B sub_FF133AE4 \n"
340
341 "loc_FF134CE0:\n"
342 " B sub_FF132EEC \n"
343
344 "loc_FF134CE4:\n"
345 " B sub_FF133CE0 \n"
346
347 "loc_FF134CE8:\n"
348 " B sub_FF13378C \n"
349
350 "loc_FF134CEC:\n"
351 " B sub_FF1338CC \n"
352
353 "loc_FF134CF0:\n"
354 " B sub_FF1340CC \n"
355
356 "loc_FF134CF4:\n"
357 " B sub_FF1343F4 \n"
358
359 "loc_FF134CF8:\n"
360 " MOV R2, #0x69 \n"
361 " LDR R1, =0xFF134B90 /*'LiveImageTask.c'*/ \n"
362 " MOV R0, #0 \n"
363 " B _DebugAssert \n"
364 );
365 }
366
367
368
369 void __attribute__((naked,noinline)) sub_FF133528_my() {
370 asm volatile (
371
372
373 " PUSH {LR} \n"
374 " MOV LR, PC \n"
375 " LDR PC, =0xFF133528 \n"
376 " LDR R0, =video_compression_rate \n"
377 " BL set_quality \n"
378 " BL modify_bitrate \n"
379 " POP {PC} \n"
380 );
381 }
382
383
384
385 void __attribute__((naked,noinline)) sub_FF133344_my() {
386 asm volatile (
387
388
389 " PUSH {LR} \n"
390 " MOV LR, PC \n"
391 " LDR PC, =0xFF133344 \n"
392 " LDR R0, =video_compression_rate \n"
393 " BL set_quality \n"
394 " BL modify_bitrate \n"
395 " POP {PC} \n"
396 );
397 }