Skip to content

Commit f1685ea

Browse files
authored
h264: Use asynchronous decoding when possible (#1257)
1 parent 4b9c7c0 commit f1685ea

File tree

8 files changed

+782
-640
lines changed

8 files changed

+782
-640
lines changed

src/Cafe/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ add_library(CemuCafe
374374
OS/libs/gx2/GX2_Texture.h
375375
OS/libs/gx2/GX2_TilingAperture.cpp
376376
OS/libs/h264_avc/H264Dec.cpp
377+
OS/libs/h264_avc/H264DecBackendAVC.cpp
377378
OS/libs/h264_avc/h264dec.h
379+
OS/libs/h264_avc/H264DecInternal.h
378380
OS/libs/h264_avc/parser
379381
OS/libs/h264_avc/parser/H264Parser.cpp
380382
OS/libs/h264_avc/parser/H264Parser.h

src/Cafe/OS/libs/coreinit/coreinit_SysHeap.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ namespace coreinit
1414
return coreinit::MEMAllocFromExpHeapEx(_sysHeapHandle, size, alignment);
1515
}
1616

17-
void export_OSAllocFromSystem(PPCInterpreter_t* hCPU)
17+
void OSFreeToSystem(void* ptr)
1818
{
19-
ppcDefineParamU32(size, 0);
20-
ppcDefineParamS32(alignment, 1);
21-
MEMPTR<void> mem = OSAllocFromSystem(size, alignment);
22-
cemuLog_logDebug(LogType::Force, "OSAllocFromSystem(0x{:x}, {}) -> 0x{:08x}", size, alignment, mem.GetMPTR());
23-
osLib_returnFromFunction(hCPU, mem.GetMPTR());
19+
_sysHeapFreeCounter++;
20+
coreinit::MEMFreeToExpHeap(_sysHeapHandle, ptr);
2421
}
2522

2623
void InitSysHeap()
@@ -34,7 +31,8 @@ namespace coreinit
3431

3532
void InitializeSysHeap()
3633
{
37-
osLib_addFunction("coreinit", "OSAllocFromSystem", export_OSAllocFromSystem);
34+
cafeExportRegister("h264", OSAllocFromSystem, LogType::CoreinitMem);
35+
cafeExportRegister("h264", OSFreeToSystem, LogType::CoreinitMem);
3836
}
3937

4038
}

src/Cafe/OS/libs/coreinit/coreinit_SysHeap.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ namespace coreinit
44
{
55
void InitSysHeap();
66

7+
void* OSAllocFromSystem(uint32 size, uint32 alignment);
8+
void OSFreeToSystem(void* ptr);
9+
710
void InitializeSysHeap();
811
}

0 commit comments

Comments
 (0)