aboutsummaryrefslogtreecommitdiff
path: root/tjunittest.c
AgeCommit message (Collapse)Author
2014-08-22Ensure that tjFree() is used for any JPEG buffers that might have been ↵dcommander
dynamically allocated by the compress/transform functions. To keep things simple, we use tjAlloc() for the statically-allocated buffer as well, so that tjFree() can always be used to free the buffer, regardless of whether it was allocated by tjbench or by the TurboJPEG library. This fixes crashes that occurred on Windows when running tjunittest or tjbench with the -alloc flag. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1383 632fc199-4ca6-4c93-a231-07263d6284db
2014-08-21If the output buffer in the TurboJPEG destination manager was allocated by ↵dcommander
the destination manager and is being reused from a previous compression operation, then we need to get the buffer size from the previous operation, since the calling program doesn't know the actual buffer size. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1368 632fc199-4ca6-4c93-a231-07263d6284db
2014-03-14Remove unneeded/unused codedcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1169 632fc199-4ca6-4c93-a231-07263d6284db
2014-03-10When tjDecodeYUV() is used with a "fresh" decompressor instance (one that ↵dcommander
hasn't been previously used to decompress a JPEG image), then it needs comps_in_scan, data_precision, and the quantization tables to be defined. This patch also extends TJUnitTest to check for this error. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1143 632fc199-4ca6-4c93-a231-07263d6284db
2014-03-08Silence valgrind false positives about uninitialized values. Even with this ↵dcommander
patch, valgrind still complains about uninitialized values when decompressing or decoding to a buffer with an alpha-enabled colorspace. Not sure why this happens, but it occurs in libjpeg-turbo 1.3 as well, and only when the x86/x86-64 SIMD code is being used. It is my belief that these remaining warnings are also false positives, because if the output buffer is memset to all 0's prior to invoking tjDecodeYUV()/tjDecompress(), no errors are reported. If any of the alpha channel bits were in fact not being initialized, then they would still be 0 after invoking tjDecodeYUV()/tjDecompress(), and TJUnitTest would report an error. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1142 632fc199-4ca6-4c93-a231-07263d6284db
2014-03-08Add a blank line before the alpha-enabled colorspace tests in order to ↵dcommander
improve readability git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1141 632fc199-4ca6-4c93-a231-07263d6284db
2014-02-28Implement a YUV decode function in the TurboJPEG API, to be symmetric with ↵dcommander
tjEncodeYUV(). git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1132 632fc199-4ca6-4c93-a231-07263d6284db
2014-02-28Remove benchmarks. They were originally intended as a way of measuring ↵dcommander
overhead for small compress/decompress operations, but using TJBench with a small image is a better way to accomplish that. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1131 632fc199-4ca6-4c93-a231-07263d6284db
2014-02-11Fix an issue that prevented tjEncodeYUV3() and TJCompressor.encodeYUV() from ↵dcommander
working properly if the source image was very tiny. Basically, jpeg_start_compress() was attempting to write the JPEG headers, which was overrunning the YUV buffer. This patch removes the call to jpeg_start_compress() in tjEncodeYUV3() and replaces it with calls to the individual routines that are necessary to initialize the color converter and downsampler. TJUnitTest has also been modified to test for this condition (the buffer size regression test now works in YUV mode.) git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1118 632fc199-4ca6-4c93-a231-07263d6284db
2013-10-31Clean up formatting code and rename the JPEG files generated during the YUV ↵dcommander
decode tests to reflect the fact that they are being generated from YUV source images. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1068 632fc199-4ca6-4c93-a231-07263d6284db
2013-10-30Extend the TurboJPEG C API to support compressing JPEG images from YUV ↵dcommander
planar images git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1067 632fc199-4ca6-4c93-a231-07263d6284db
2013-08-23Add CMYK support to the TurboJPEG Java API & clean up a few things in the C APIdcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1020 632fc199-4ca6-4c93-a231-07263d6284db
2013-08-23Add CMYK support to the TurboJPEG C APIdcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1019 632fc199-4ca6-4c93-a231-07263d6284db
2013-08-18Add 4:1:1 subsampling support in the TurboJPEG C APIdcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1014 632fc199-4ca6-4c93-a231-07263d6284db
2013-05-07Fix incorrect data output and buffer overruns in the new ↵dcommander
tjDecompressToYUV2() function whenever scaling is used along with a 4:2:0 JPEG image; extend tjunittest and TJUnitTest to test for these issues. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@982 632fc199-4ca6-4c93-a231-07263d6284db
2013-05-04Clean up the output of tjunittest and TJUnitTestdcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@981 632fc199-4ca6-4c93-a231-07263d6284db
2013-04-28Extend the TurboJPEG Java API to support generating YUV images with ↵dcommander
arbitrary padding and to support image scaling when decompressing to YUV git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@975 632fc199-4ca6-4c93-a231-07263d6284db
2013-04-26Extend the TurboJPEG C API to support generating YUV images with arbitrary ↵dcommander
padding and to support image scaling when decompressing to YUV git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@962 632fc199-4ca6-4c93-a231-07263d6284db
2012-03-16Fix the behavior of the alpha-enabled colorspace constants whenever ↵dcommander
libjpeg-turbo is built without SIMD support and merged upsampling is used. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@810 632fc199-4ca6-4c93-a231-07263d6284db
2011-12-19Added new alpha channel colorspace constants/pixel formats, so applications ↵dcommander
can specify that they need the unused byte in a 4-component RGB output buffer set to 0xFF when decompressing. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@732 632fc199-4ca6-4c93-a231-07263d6284db
2011-09-08When decompressing to a 4-byte RGB buffer, set the unused byte to 0xFF so it ↵dcommander
can be interpreted as an opaque alpha channel. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@699 632fc199-4ca6-4c93-a231-07263d6284db
2011-07-15Windows doesn't have random()dcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@672 632fc199-4ca6-4c93-a231-07263d6284db
2011-07-12Use random noise to ensure that the JPEG image generated in the buffer size ↵dcommander
test exceeds the size of the uncompressed source image. git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@669 632fc199-4ca6-4c93-a231-07263d6284db
2011-07-12Re-work TJBUFSIZE() to take into account the level of chrominance subsamplingdcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@668 632fc199-4ca6-4c93-a231-07263d6284db
2011-06-15git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@661 ↵dcommander
632fc199-4ca6-4c93-a231-07263d6284db
2011-05-27Re-factor checkBufYUV() function to more closely resemble re-factored ↵dcommander
checkBuf() function git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@654 632fc199-4ca6-4c93-a231-07263d6284db
2011-05-25"jpegut"="tjunittest" & "jpgtest"="tjbench"dcommander
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@644 632fc199-4ca6-4c93-a231-07263d6284db