git-svn-id: http://webrtc.googlecode.com/svn/trunk@702 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org 2011-10-06 16:23:38 +00:00
parent 3a6d4f4268
commit d6132f54d2
2 changed files with 16 additions and 36 deletions

View File

@ -87,7 +87,7 @@ int convert_test(CmdArgs& args)
resI420Buffer);
}
tticks = clock() - tticks;
printf("RGB24->I420 Time(1000): %d\n", tticks);
printf("RGB24->I420 Time(1000): %d\n", (int)tticks);
TestRetVal(retVal, width*height*3/2);
fwrite(resI420Buffer, lengthSourceFrame, 1, outputFile);
@ -109,9 +109,9 @@ int convert_test(CmdArgs& args)
}
ticks = clock() - ticks;
#ifndef SCALEOPT
fprintf(logFile, "\nConvertI420ToUYVY, before opt: %d\n", ticks);
fprintf(logFile, "\nConvertI420ToUYVY, before opt: %d\n", (int)ticks);
#else
fprintf(logFile, "\nConvertI420ToUYVY, after opt: %d\n", ticks);
fprintf(logFile, "\nConvertI420ToUYVY, after opt: %d\n", (int)ticks);
#endif
TestRetVal(retVal, width*height*2);
@ -150,9 +150,9 @@ int convert_test(CmdArgs& args)
}
ticks = clock() - ticks;
#ifndef SCALEOPT
fprintf(logFile, "\nConvertI420ToYV12, before opt: %d\n", ticks);
fprintf(logFile, "\nConvertI420ToYV12, before opt: %d\n", (int)ticks);
#else
fprintf(logFile, "\nConvertI420ToYV12, after opt: %d\n", ticks);
fprintf(logFile, "\nConvertI420ToYV12, after opt: %d\n", (int)ticks);
#endif
TestRetVal(retVal, width*height*3/2);
retVal = webrtc::ConvertYV12ToI420(outI420Buffer, width, height,
@ -195,9 +195,9 @@ int convert_test(CmdArgs& args)
}
ticks = clock() - ticks;
#ifndef SCALEOPT
fprintf(logFile, "\nConvertI420ToYUY2, before opt: %d\n", ticks);
fprintf(logFile, "\nConvertI420ToYUY2, before opt: %d\n", (int)ticks);
#else
fprintf(logFile, "\nConvertI420ToYUY2, after opt: %d\n", ticks);
fprintf(logFile, "\nConvertI420ToYUY2, after opt: %d\n", (int)ticks);
#endif
TestRetVal(retVal, width*height*2);
ticks = clock();
@ -208,9 +208,9 @@ int convert_test(CmdArgs& args)
}
ticks = clock() - ticks;
#ifndef SCALEOPT
fprintf(logFile, "\nConvertYUY2ToI420, before opt: %d\n", ticks);
fprintf(logFile, "\nConvertYUY2ToI420, before opt: %d\n", (int)ticks);
#else
fprintf(logFile, "\nConvertYUY2ToI420, after opt: %d\n", ticks);
fprintf(logFile, "\nConvertYUY2ToI420, after opt: %d\n", (int)ticks);
#endif
TestRetVal(retVal, width*height*3/2);
fwrite(resI420Buffer, lengthSourceFrame, 1, outputFile);

View File

@ -83,7 +83,6 @@ void ValidateImage2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* pt
void ValidateImage3_2(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8* ptrFrame, WebRtc_Word32 offset, WebRtc_Word32 factor)
{
WebRtc_Word32 k = 0;
bool inc = true;
WebRtc_Word32 res = offset*factor;
for (WebRtc_Word32 i = 1; i <= height; i++)
{
@ -114,25 +113,6 @@ void ValidateImage1_3(WebRtc_Word32 width, WebRtc_Word32 height, WebRtc_UWord8*
}
}
static void VerifyInBounds(const WebRtc_UWord8* ptrImage, const WebRtc_Word32 imageLength,
const WebRtc_Word32 startOffset, const WebRtc_Word32 endOffset)
{
// Verify that function does not write outside buffer
const WebRtc_UWord8* ptrFrameStart = ptrImage - startOffset;
const WebRtc_UWord8* ptrFrameEnd = ptrImage + imageLength;
// Verify that function does not write outside buffer
for (WebRtc_Word32 i = 0; i < startOffset; i++)
{
assert(ptrFrameStart[i] == 255);
}
for (WebRtc_Word32 i = 0; i < endOffset; i++)
{
assert(ptrFrameEnd[i] == 255);
}
}
WebRtc_Word32
VerifyAndAllocateTest(WebRtc_UWord8*& buffer, WebRtc_Word32 currentSize, WebRtc_Word32 newSize)
{
@ -201,7 +181,7 @@ scale_test()
retVal = ScaleI420Up2(width, height + 2, testFrame,length, scW, scH); // width, height > allocated buffer size
assert(retVal == -1);
retVal = ScaleI420Up2(width, height, testFrame,length, scW, scH); // width, height == allocated buffer size, OK
assert(retVal == scW * scH * 3 / 2);
assert((WebRtc_UWord32) retVal == scW * scH * 3 / 2);
delete [] testFrame;
testFrame = new WebRtc_UWord8[ length * 4 + startBufferOffset * 2];
@ -224,7 +204,7 @@ scale_test()
PrintFrame(testFrame, scaledWidth, scaledHeight, "Output Frame");
// Validate results
assert(retVal == scaledWidth * scaledHeight * 3 / 2);
assert((WebRtc_UWord32)retVal == scaledWidth * scaledHeight * 3 / 2);
ptrFrameY = testFrame;
ptrFrameCb = ptrFrameY + scaledWidth*scaledHeight;
ptrFrameCr = ptrFrameCb + scaledWidth*scaledHeight/4;
@ -271,7 +251,7 @@ scale_test()
retVal = ScaleI420Up3_2(width, height + 2, testFrame,length, scW, scH); // width, height > allocated buffer size
assert(retVal == -1);
retVal = ScaleI420Up3_2(width, height, testFrame,length, scW, scH); // width, height == allocated buffer size, OK
assert(retVal == scW * scH * 3 / 2);
assert((WebRtc_UWord32)retVal == scW * scH * 3 / 2);
delete [] testFrame;
@ -296,7 +276,7 @@ scale_test()
PrintFrame(testFrame, scaledWidth, scaledHeight, "Output Frame");
// Validate results
assert(retVal == scaledWidth * scaledHeight * 3 / 2);
assert((WebRtc_UWord32)retVal == scaledWidth * scaledHeight * 3 / 2);
// Verify that function does not write outside buffer
ptrFrameY = testFrame;//imageBuffer.GetBuffer();
@ -340,7 +320,7 @@ scale_test()
retVal = ScaleI420Down1_3(width, height + 2, testFrame, length, scW, scH); // width, height > allocated buffer size
assert(retVal == -1);
retVal = ScaleI420Down1_3(width, height, testFrame, length, scW, scH); // width, height == allocated buffer size, ok
assert(retVal == scW * scH * 3 / 2);
assert((WebRtc_UWord32)retVal == scW * scH * 3 / 2);
delete [] testFrame;
@ -363,7 +343,7 @@ scale_test()
PrintFrame(testFrame, scaledWidth, scaledHeight, "Output Frame");
// Validate results
assert(retVal == scaledWidth * scaledHeight * 3 / 2);
assert((WebRtc_UWord32)retVal == scaledWidth * scaledHeight * 3 / 2);
// Verify that function does not write outside buffer
ptrFrameY = testFrame;//imageBuffer.GetBuffer();
@ -520,7 +500,7 @@ scale_test()
}
// Validate results
assert(retVal == scaledWidth * scaledHeight * 3 / 2);
assert((WebRtc_UWord32)retVal == scaledWidth * scaledHeight * 3 / 2);
}
}