-
-
Save mbondaru/2743b31b94dde085eaf2e6dfd8e63add to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
undefined4 camplus_setup_isp(int param_1,int param_2) | |
{ | |
short sVar1; | |
byte bVar2; | |
void *pvVar3; | |
int iVar4; | |
undefined4 extraout_r1; | |
undefined4 extraout_r1_00; | |
undefined4 extraout_r1_01; | |
int extraout_r1_02; | |
int extraout_r1_03; | |
int extraout_r1_04; | |
undefined4 extraout_r2; | |
undefined4 extraout_r2_00; | |
undefined4 extraout_r2_01; | |
undefined4 extraout_r2_02; | |
code *pcVar5; | |
undefined4 extraout_r3; | |
undefined4 extraout_r3_00; | |
undefined4 extraout_r3_01; | |
undefined4 uVar6; | |
char cVar7; | |
undefined4 extraout_r4; | |
undefined4 extraout_r4_00; | |
undefined4 extraout_r4_01; | |
undefined4 uVar8; | |
undefined4 in_r5; | |
uint extraout_r5; | |
uint uVar9; | |
uint extraout_r5_00; | |
undefined4 extraout_r5_01; | |
undefined4 extraout_r5_02; | |
int iVar10; | |
uint uVar11; | |
int iVar12; | |
uint *puVar13; | |
undefined8 uVar14; | |
int local_44; | |
int local_40; | |
char local_39; | |
iVar10 = param_2 * 0x35110 + param_1; | |
iVar12 = iVar10 + 0x65d8 + (uint)*(byte *)(iVar10 + 0x284ef) * 0x40; | |
uVar11 = (uint)*(ushort *)(iVar12 + 0x12); | |
local_40 = 0; | |
logging_message(0x800, | |
"camplus_setup_isp [%d]: new isp frame, isp_frames_done=%d, prep_frames_done=%d", | |
param_2,*(undefined4 *)(param_1 + 0x646c),*(undefined4 *)(param_1 + 0x64d8),in_r5) | |
; | |
uVar6 = extraout_r1; | |
uVar8 = extraout_r2; | |
uVar9 = extraout_r5; | |
if (*(char *)(iVar10 + 0x3b196) != '\0') { | |
*(undefined *)(param_1 + 0x64a8) = 1; | |
pcVar5 = *(code **)(*(int *)(param_1 + 0x64fc) + 0xd4); | |
(*pcVar5)(iVar10 + 0x28594,iVar10 + 0x3a044,pcVar5); | |
*(undefined *)(iVar10 + 0x3b196) = 0; | |
*(undefined *)(iVar10 + 0x3b198) = 1; | |
uVar9 = (uint)*(byte *)(iVar10 + 0x3b197); | |
uVar6 = extraout_r1_00; | |
uVar8 = extraout_r2_00; | |
if (uVar9 != 0) { | |
camplus_set_isp_lresize(param_1,param_2); | |
uVar6 = extraout_r1_01; | |
uVar8 = extraout_r2_01; | |
uVar9 = extraout_r5_00; | |
} | |
} | |
if (((*(byte *)(param_1 + 0x65be) < 2) || ((*(uint *)(param_1 + 4) & 0x10000) == 0)) || | |
((uint)*(byte *)(param_1 + 0x65be) != (uint)*(byte *)(param_1 + 0x65bb))) { | |
local_40 = camplus_set_isp_buffers(param_1,param_2); | |
} | |
else if (param_2 == 0) { | |
local_40 = camplus_set_multichannel_isp_buffers | |
(param_1,uVar6,uVar8,*(uint *)(param_1 + 4), | |
(uint)*(byte *)(param_1 + 0x65bb),uVar9); | |
} | |
if (local_40 != 0) { | |
camplus_unlock(param_1); | |
if (*(short *)(iVar10 + 0x3b2f2) == *(short *)(iVar10 + 0x3b1aa)) { | |
iVar12 = *(int *)(param_1 + 0x65a8) + 1; | |
*(int *)(param_1 + 0x65a8) = iVar12; | |
logging_message(0x800,"camplus_setup_isp [%d]: dropping frame no buffers available.",param_2, | |
extraout_r3,extraout_r4,iVar12); | |
if (((*(uint *)(param_1 + 0x645c) & 2) == 0) || (*(char *)(param_1 + 0x3c) == '\x01')) { | |
iVar12 = *(int *)(iVar10 + 0x3b3a8) + 1; | |
*(int *)(iVar10 + 0x3b3a8) = iVar12; | |
if (iVar12 == 0x32) { | |
if (*(code **)(param_1 + 0x54) != (code *)0x0) { | |
(**(code **)(param_1 + 0x54))(param_1,0xfffffffe,0,*(undefined4 *)(param_1 + 0x58)); | |
} | |
*(undefined4 *)(iVar10 + 0x3b3a8) = 0; | |
} | |
if (*(char *)(param_1 + 0x3c) == '\x01') { | |
rtos_delay(2000,1); | |
_tx_event_flags_set(param_1 + 0x6404,1,0); | |
logging_message(0x400,"camplus_setup_isp: sending DATA_READY to preprocessor", | |
extraout_r2_02,extraout_r3_00,extraout_r4_00,extraout_r5_01); | |
} | |
} | |
else if (*(code **)(param_1 + 0x54) != (code *)0x0) { | |
(**(code **)(param_1 + 0x54))(param_1,0xfffffffe,0,*(undefined4 *)(param_1 + 0x58)); | |
} | |
} | |
return 0xffffffff; | |
} | |
if (*(char *)(iVar10 + 0x3b364) != '\0') { | |
camplus_set_isp_output_params(); | |
} | |
if (*(char *)(iVar10 + 0x3b365) != '\0') { | |
camplus_set_isp_input_params(param_1,param_2); | |
} | |
*(undefined2 *)(iVar10 + 0x284e0) = 0; | |
*(undefined2 *)(iVar10 + 0x284dc) = 0; | |
*(undefined4 *)(iVar10 + 0x3b3a8) = 0; | |
if ((*(int *)(iVar12 + 0x2c) != 0) && (*(char *)(param_1 + 0x3c) != '\x02')) { | |
if ((*(char *)(param_1 + 0x3c) == '\x01') && (*(char *)(param_1 + 0x3d) == '\x01')) { | |
puVar13 = *(uint **)(iVar10 + 0x28574); | |
} | |
else { | |
puVar13 = *(uint **)(iVar10 + 0x28534); | |
} | |
pvVar3 = (void *)vc_metadata_get((void *)0x0,*(int *)(iVar12 + 0x2c),0x43444d44,&local_44); | |
if (local_44 == 0) { | |
vc_metadata_clear((int *)puVar13); | |
vc_metadata_add(puVar13,pvVar3,0x43444d44,100); | |
iVar4 = vc_metadata_get((void *)0x0,(int)puVar13,0x43444d44,&local_44); | |
vc_metadata_lock((int)puVar13); | |
*(undefined4 *)(iVar4 + 0x24) = *(undefined4 *)(param_1 + 0x6468); | |
*(undefined *)(iVar4 + 0x44) = *(undefined *)(param_1 + 0x6458); | |
*(short *)(iVar4 + 0x50) = | |
(short)((int)((uint)*(ushort *)(iVar4 + 0x50) * (uint)*(ushort *)(iVar10 + 0x3a048)) / | |
(int)(uint)*(ushort *)(iVar10 + 0x3b1a8)); | |
*(short *)(iVar4 + 0x52) = | |
(short)((int)((uint)*(ushort *)(iVar4 + 0x52) * (uint)*(ushort *)(iVar10 + 0x3a04a)) / | |
(int)(uint)*(ushort *)(iVar10 + 0x3b1aa)); | |
vc_metadata_unlock((int)puVar13); | |
if (*(char *)(iVar4 + 0x22) != '\0') { | |
*(uint *)(param_1 + 4) = *(uint *)(param_1 + 4) | 8; | |
} | |
} | |
vc_metadata_set_readonly(*(int *)(iVar12 + 0x2c),0); | |
} | |
camplus_unlock(param_1); | |
iVar4 = *(int *)(iVar12 + 0x2c); | |
if (iVar4 != 0) { | |
if (*(char *)(param_1 + 0x45) == '\0') { | |
if ((*(uint *)(param_1 + 4) & 0x100000) == 0) { | |
if (*(char *)(param_1 + 0x44) != '\0') { | |
uVar14 = vc_metadata_get((void *)0x0,iVar4,0x53544142,&local_40); | |
iVar4 = (int)((ulonglong)uVar14 >> 0x20); | |
if (local_40 == 0) { | |
bVar2 = camplus_stabilise_compensate | |
(param_1,param_2,(int)uVar14,extraout_r3_01,extraout_r4_01, | |
extraout_r5_02); | |
iVar4 = extraout_r1_04; | |
goto LAB_0eca5008; | |
} | |
} | |
} | |
else { | |
uVar14 = vc_metadata_get((void *)0x0,iVar4,0x4446,&local_40); | |
iVar4 = (int)((ulonglong)uVar14 >> 0x20); | |
if ((int)uVar14 != 0) { | |
bVar2 = camplus_df_crop(param_1,param_2); | |
iVar4 = extraout_r1_03; | |
LAB_0eca5008: | |
*(byte *)(iVar10 + 0x3b198) = bVar2 | *(byte *)(iVar10 + 0x3b198); | |
} | |
} | |
} | |
else { | |
uVar14 = vc_metadata_get((void *)0x0,iVar4,0x484452,&local_40); | |
iVar4 = (int)((ulonglong)uVar14 >> 0x20); | |
if ((int)uVar14 != 0) { | |
bVar2 = camplus_hdr_crop(param_1,param_2); | |
*(byte *)(iVar10 + 0x3b198) = *(byte *)(iVar10 + 0x3b198) | bVar2; | |
iVar4 = extraout_r1_02; | |
} | |
} | |
} | |
pcVar5 = *(code **)(*(int *)(param_1 + 0x64fc) + 0x24); | |
(*pcVar5)(iVar10 + 0x28594,iVar4,pcVar5); | |
uVar9 = *(uint *)(param_1 + 4); | |
if ((uint)*(ushort *)(iVar10 + 0x3b1aa) + (uint)*(ushort *)(iVar10 + 0x3b1ae) <= uVar11) { | |
uVar11 = uVar11 - *(ushort *)(iVar10 + 0x3b1ae); | |
} | |
if ((uVar9 & 0x80000) == 0) { | |
if ((uVar9 & 0x10000000) != 0) { | |
uVar11 = (uVar11 - *(ushort *)(iVar10 + 0x3b1f8)) - (uint)*(ushort *)(iVar10 + 0x3b1fc); | |
} | |
} | |
else { | |
uVar11 = (int)uVar11 / 3; | |
} | |
sVar1 = *(short *)(iVar12 + 0xc); | |
if (sVar1 == 3) { | |
pcVar5 = *(code **)(*(int *)(param_1 + 0x64fc) + 0x118); | |
iVar4 = *(int *)(iVar12 + 0x1c); | |
uVar6 = *(undefined4 *)(iVar12 + 0x20); | |
uVar9 = (int)(uint)*(ushort *)(iVar12 + 0x12) >> 1; | |
uVar8 = *(undefined4 *)(iVar12 + 0x24); | |
} | |
else { | |
if ((((sVar1 != 0x2d) && (sVar1 != 0x2e)) && (sVar1 != 0x30)) && (sVar1 != 0x2f)) { | |
if (sVar1 == 0x21) { | |
iVar4 = *(int *)(iVar12 + 0x1c); | |
if ((uVar9 & 0x10000000) != 0) { | |
iVar4 = iVar4 + *(int *)(iVar12 + 0x14) * (uint)*(ushort *)(iVar10 + 0x3b1f8) + | |
((int)((uint)*(ushort *)(iVar10 + 0x3b1f6) * 10) >> 3); | |
} | |
uVar6 = 0; | |
pcVar5 = *(code **)(*(int *)(param_1 + 0x64fc) + 0x114); | |
uVar8 = 0; | |
uVar9 = 0; | |
goto LAB_0eca5072; | |
} | |
if (sVar1 != 5 && sVar1 != 0x1f) goto LAB_0eca5074; | |
} | |
iVar4 = *(int *)(iVar12 + 0x1c); | |
uVar6 = 0; | |
pcVar5 = *(code **)(*(int *)(param_1 + 0x64fc) + 0x118); | |
uVar9 = (uint)*(ushort *)(iVar12 + 0x12); | |
uVar8 = 0; | |
} | |
LAB_0eca5072: | |
(*pcVar5)(iVar10 + 0x28594,iVar4,uVar11,uVar6,uVar8,uVar9); | |
LAB_0eca5074: | |
bVar2 = get_isp_pass(param_1); | |
pcVar5 = *(code **)(*(int *)(iVar10 + 0x3b19c) + 0x18); | |
(*pcVar5)(*(undefined4 *)(param_1 + param_2 * 4 + 0x6500),*(undefined4 *)(iVar12 + 0x2c),0,bVar2, | |
&local_39,pcVar5); | |
if (local_39 == '\0') { | |
cVar7 = *(char *)(iVar10 + 0x3b198); | |
} | |
else { | |
cVar7 = '\x01'; | |
*(undefined *)(iVar10 + 0x3b198) = 1; | |
} | |
if (cVar7 != '\0') { | |
if (local_39 == '\0') { | |
local_39 = '\x01'; | |
} | |
local_40 = (**(code **)(*(int *)(param_1 + 0x64fc) + 0x30))(iVar10 + 0x28594); | |
if ((local_40 != 0) && (*(code **)(param_1 + 0x54) != (code *)0x0)) { | |
(**(code **)(param_1 + 0x54))(param_1,0xfffffffc,0,*(undefined4 *)(param_1 + 0x58)); | |
} | |
*(undefined *)(iVar10 + 0x3b198) = 0; | |
} | |
iVar12 = vc_metadata_get((void *)0x0,*(int *)(iVar12 + 0x2c),0x54445250,&local_40); | |
if (iVar12 != 0) { | |
*(uint *)(param_1 + 4) = *(uint *)(param_1 + 4) | 8; | |
} | |
if ((*(uint *)(param_1 + 0x645c) & 1) != 0) { | |
if ((*(int *)(iVar10 + 0x2850c) != 0) && | |
(uVar9 = *(uint *)(iVar10 + 0x28524), uVar9 == (uVar9 & 0x3fffffff))) { | |
vclib_dcache_invalidate_range(uVar9,*(undefined4 *)(iVar10 + 0x28520)); | |
} | |
if ((*(int *)(iVar10 + 0x28510) != 0) && | |
(uVar9 = *(uint *)(iVar10 + 0x28564), uVar9 == (uVar9 & 0x3fffffff))) { | |
vclib_dcache_invalidate_range(uVar9,*(undefined4 *)(iVar10 + 0x28560)); | |
} | |
} | |
iVar12 = *(int *)(param_1 + 0x6474); | |
if (iVar12 != 0) { | |
_tx_timer_deactivate(iVar10 + 0x3b334); | |
_tx_timer_change(iVar10 + 0x3b334,(iVar12 + 9U) / 10,0); | |
_tx_timer_activate(iVar10 + 0x3b334); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment