Added profiler sections to (threaded) chroma subsampling

This commit is contained in:
palana 2013-09-06 16:47:03 +02:00
parent aeeb5f9227
commit 5eb23e0344
2 changed files with 5 additions and 0 deletions

View File

@ -21,6 +21,7 @@
void Convert444toI420(LPBYTE input, int width, int pitch, int height, int startY, int endY, LPBYTE *output) void Convert444toI420(LPBYTE input, int width, int pitch, int height, int startY, int endY, LPBYTE *output)
{ {
profileSegment("Convert444toI420");
LPBYTE lumPlane = output[0]; LPBYTE lumPlane = output[0];
LPBYTE uPlane = output[1]; LPBYTE uPlane = output[1];
LPBYTE vPlane = output[2]; LPBYTE vPlane = output[2];
@ -73,6 +74,7 @@ void Convert444toI420(LPBYTE input, int width, int pitch, int height, int startY
void Convert444toNV12(LPBYTE input, int width, int inPitch, int outPitch, int height, int startY, int endY, LPBYTE *output) void Convert444toNV12(LPBYTE input, int width, int inPitch, int outPitch, int height, int startY, int endY, LPBYTE *output)
{ {
profileSegment("Convert444toNV12");
LPBYTE lumPlane = output[0]; LPBYTE lumPlane = output[0];
LPBYTE uvPlane = output[1]; LPBYTE uvPlane = output[1];

View File

@ -54,6 +54,7 @@ struct Convert444Data
bool bKillThread; bool bKillThread;
HANDLE hSignalConvert, hSignalComplete; HANDLE hSignalConvert, hSignalComplete;
int width, height, inPitch, outPitch, startY, endY; int width, height, inPitch, outPitch, startY, endY;
DWORD numThreads;
}; };
DWORD STDCALL Convert444Thread(Convert444Data *data) DWORD STDCALL Convert444Thread(Convert444Data *data)
@ -62,6 +63,7 @@ DWORD STDCALL Convert444Thread(Convert444Data *data)
{ {
WaitForSingleObject(data->hSignalConvert, INFINITE); WaitForSingleObject(data->hSignalConvert, INFINITE);
if(data->bKillThread) break; if(data->bKillThread) break;
profileParallelSegment("Convert444Thread(s)", data->numThreads);
if(data->bNV12) if(data->bNV12)
Convert444toNV12(data->input, data->width, data->inPitch, data->outPitch, data->height, data->startY, data->endY, data->output); Convert444toNV12(data->input, data->width, data->inPitch, data->outPitch, data->height, data->startY, data->endY, data->output);
else else
@ -604,6 +606,7 @@ void OBS::MainCaptureLoop()
convertInfo[i].hSignalConvert = CreateEvent(NULL, FALSE, FALSE, NULL); convertInfo[i].hSignalConvert = CreateEvent(NULL, FALSE, FALSE, NULL);
convertInfo[i].hSignalComplete = CreateEvent(NULL, FALSE, FALSE, NULL); convertInfo[i].hSignalComplete = CreateEvent(NULL, FALSE, FALSE, NULL);
convertInfo[i].bNV12 = bUsingQSV; convertInfo[i].bNV12 = bUsingQSV;
convertInfo[i].numThreads = numThreads;
if(i == 0) if(i == 0)
convertInfo[i].startY = 0; convertInfo[i].startY = 0;