Commit graph

126 commits

Author SHA1 Message Date
Pavel Krajcevski 94db169582 Add a utility Bits class to help work with bit ranges in integers. Ideally we should add a bunch of other classical bitwise operations here 2014-03-07 19:31:22 -05:00
Pavel Krajcevski c6948e8421 Merge branch 'master' into ModularizeBPTC 2014-02-27 14:20:50 -05:00
Pavel Krajcevski ba0b5df59e Finish matrix unit tests 2014-02-21 17:45:07 -05:00
Pavel Krajcevski 8b9e8cd9b5 Add matrix multiplication infrastructure 2014-02-21 16:18:00 -05:00
Pavel Krajcevski 05eeb09f36 Constify 2014-02-21 16:11:49 -05:00
Pavel Krajcevski 0c4b226c78 Add matrix transpose 2014-02-20 16:15:13 -05:00
Pavel Krajcevski 98bc157e00 Add matrix multiplication test 2014-02-20 16:11:25 -05:00
Pavel Krajcevski d4ec0a3b3b Stub out remaining tests 2014-02-20 15:48:08 -05:00
Pavel Krajcevski 4ca6141be6 Add simple 4x4 matrix file 2014-02-20 15:47:48 -05:00
Pavel Krajcevski 2af172e5e5 Add power method iteration for square matrices 2014-02-20 15:47:14 -05:00
Pavel Krajcevski 7ed5c13405 Allow additional indexable types
Instead of using operator() to index into the second operand of the
VectorAddition function, use operator[]. This way we can add to pointers
and std::vector types as well.
2014-02-20 15:36:59 -05:00
Pavel Krajcevski 1b7691993d Add initial matrix tests 2014-02-20 15:34:12 -05:00
Pavel Krajcevski 62cce58c2f Fix some of the vector multiplication and divide routines.
In general, we want the scalar division of vectors and matrices to
have the matrix come first and the scalar come second. It doesn't make
sense to divide a scalar by a vector or to divide a matrix by a vector,
so these should now produce errors at compile time.

Also, make sure to add additional types that can be multiplied together
using the * operator. If we multiply two vectors together, that's a dot
product. The size restrictions should be enforced at compile time by the
template parameters for VectorBase<T, N>::Dot

In this way, we can support vector/matrix multiplication by retaining the
* operator as well.
2014-02-20 14:49:35 -05:00
Pavel Krajcevski 2d7ee21fb7 Let the compiler choose what precision we want to do the vector-scalar multiplication/division in. 2014-02-19 19:36:28 -05:00
Pavel Krajcevski 366a7cdfe4 Add some YCoCg tests 2014-02-19 19:35:29 -05:00
Pavel Krajcevski 9dc23db287 Add YCoCg pixel type 2014-02-18 13:25:29 -05:00
Pavel Krajcevski 4fc75f22dc Fix vector operators to avoid needing overloads 2014-02-17 13:02:43 -05:00
Pavel Krajcevski 0875ee0ddb Constify 2014-02-16 18:29:08 -05:00
Pavel Krajcevski 2213e1b7d6 Add tests for special vector cases 2014-02-16 18:28:37 -05:00
Pavel Krajcevski 45b739a44a Add some tests for VectorBase 2014-02-16 17:17:25 -05:00
Pavel Krajcevski 92f5893650 Add first vector tests 2014-02-16 13:20:43 -05:00
Pavel Krajcevski 9f0603aaa8 Add scaling tests to make sure that bit depths are preserved. 2014-02-16 12:33:05 -05:00
Pavel Krajcevski 543185fe2a Add normalization function to vectors 2014-02-16 12:30:37 -05:00
Pavel Krajcevski e20d84b1ee Fix gross bug in VectorBase 2014-02-16 12:30:09 -05:00
Pavel Krajcevski a530ae937e Fix a few bugs. 2014-02-04 12:55:47 -05:00
Pavel Krajcevski f32a943a90 Some small bugs, fixed #2 2014-01-30 14:12:55 -05:00
Pavel Krajcevski 1a5b748b2c Check for C++11 types in base library 2014-01-30 13:55:55 -05:00
Pavel Krajcevski 37ffc102d0 Add shuffle operator to pixels. 2014-01-30 13:34:52 -05:00
Pavel Krajcevski e62400eb01 Merge from master 2014-01-29 14:51:00 -05:00
Pavel Krajcevski d0ff861551 Alphabetize 2014-01-23 14:42:54 -05:00
Pavel Krajcevski 917c4dc9dd Add a scoped allocator in order to deal with errors cleaner 2014-01-23 14:38:02 -05:00
Pavel Krajcevski ea953979fe Move bitstream to FasTC base lib 2014-01-21 15:04:39 -05:00
Pavel Krajcevski f12ee09f7e Some formatting and rearrange the BPTC code to be more structured like the others 2014-01-21 14:46:25 -05:00
Pavel Krajcevski 86741f7a89 Fix some configuration issues with VS2012 2013-11-17 14:17:00 -05:00
Pavel Krajcevski a80944901e Refactor CompressionJob struct.
In order to better facilitate the change from block stream order to non-block stream order,
a lot of changes were introduced to the way that we feed texture data to the compressors. This
data is embodied in the CompressionJob struct. We have made it so that the compression job
points to both the in and out pointers for our compressed and uncompressed data. Furthermore,
we have made sure that the struct also contains the format that its compressing for, so that if
any threading programs would like to chop up a compression job into smaller chunks based on the
format, it doesn't need to know the format explicitly, it just needs to know certain properties
about the format.

Moreover, the user can now define the start and end pixels from which we would like to compress
to. We can compress subsets of data by changing the in and out pointers and the width and height
values. The compressors will read data linearly until they reach the out pixels based on the width
of the given pixel.
2013-11-08 16:31:19 -05:00
Pavel Krajcevski f70b26a47f Change interface of compression/decompression jobs. 2013-11-06 18:55:53 -05:00
Pavel Krajcevski 8e76d149ba Remove a bunch of code that assumes that we get our pixel data in block stream order... 2013-11-06 18:23:19 -05:00
Pavel Krajcevski 692cfbcf77 Some compiler SNAFUs on windows. 2013-10-21 15:49:42 -04:00
Pavel Krajcevski f597ec2f77 Add entropy calculation to images. 2013-10-18 04:12:32 -04:00
Pavel Krajcevski bcf7c5c389 Some more compiler error and warning fixes. 2013-10-15 10:32:38 -04:00
Pavel Krajcevski 89110be602 Get rid of a bunch of MSVC compiler warnings. 2013-10-15 00:31:33 -04:00
Pavel Krajcevski f1b564fdb2 Only report MSSIM 2013-10-12 16:37:48 -04:00
Pavel Krajcevski 996c81ef01 Specialize the FilterValid routine to not consider the pixels as pixels but rather as values. This seems somewhat inelegant but it's fine in terms of a quick fix. 2013-10-12 16:32:09 -04:00
Pavel Krajcevski 5af29c87d0 Fix bug with kernel generation. 2013-10-11 21:38:49 -04:00
Pavel Krajcevski 68f2f4a8b3 If the intensity is greater than one, then we're treating it as a float value, so when packing it into a pixel, just pack the value instead of scaling it to 255... 2013-10-11 21:38:28 -04:00
Pavel Krajcevski d3fd98c8fa Fix Intensity calculation for pixel. 2013-10-11 21:37:06 -04:00
Pavel Krajcevski 855683983c SSIM measurement is usually the smallest SSIm index, so report that instead of MSSIM, but if the user wants SSIM we can do that, too. 2013-10-11 13:06:29 -04:00
Pavel Krajcevski 2d8c291107 Fix some small bugs with SSIM. 2013-10-11 13:05:59 -04:00
Pavel Krajcevski 8d37d6eee5 Add MSSIM metric for images based on matlab implementation. 2013-10-11 12:12:32 -04:00
Pavel Krajcevski 42c6f85642 Add some convenience Image functions. 2013-10-11 12:12:08 -04:00
Pavel Krajcevski dd1c3351ea Fix small bug in Gaussian kernel generation. 2013-10-11 12:11:32 -04:00
Pavel Krajcevski bf5429cd0c Add Gaussian kernel generating function. 2013-10-10 20:06:12 -04:00
Pavel Krajcevski 654ee23446 Force PSNR comparison between images to use the same pixeltype 2013-10-10 20:06:02 -04:00
Pavel Krajcevski 72697f650c Add filtering operation. 2013-10-10 19:36:19 -04:00
Pavel Krajcevski 076ca07bcf Fix color into rgba packing. 2013-10-10 19:36:10 -04:00
Pavel Krajcevski b07fe9b670 Make IPixels single vectors in order to allow us to use their operators and other convenience functions. 2013-10-10 14:36:45 -04:00
Pavel Krajcevski 127fd7b365 Add Image template instantiation for IPixel 2013-10-10 11:35:28 -04:00
Pavel Krajcevski ad5f012a4c Add the ability to treat intensity pixels as floats. 2013-10-10 11:35:01 -04:00
Pavel Krajcevski 51cec12938 Add intensity pixels 2013-10-10 11:27:54 -04:00
Pavel Krajcevski 3e35fb2c0d Merge SplitCoreLibrary 2013-10-10 11:04:40 -04:00
Pavel Krajcevski 47074c1224 Abstract away a bit more logic in order to allow us to easily override the core vector operations if need be. 2013-10-08 20:29:56 -04:00
Pavel Krajcevski 01a38dc76b Add more generic structures for performing scalar multiplication with vectors (i.e. ones that actually compile) 2013-10-08 18:39:32 -04:00
Pavel Krajcevski 0add6a5ee9 Allow FasTC::Image<Color> 2013-10-08 18:38:11 -04:00
Pavel Krajcevski a4a289c177 Change the pixel channel size to 16 bits so that our arithmetic operations don't overflow. 2013-10-08 18:37:38 -04:00
Pavel Krajcevski dd12cc92cd Revert "Pixels are actually 4vecs of ints"
This reverts commit 85c3f9fc90.
2013-10-08 17:32:40 -04:00
Pavel Krajcevski 2159a6688a Add colors. 2013-10-08 15:07:43 -04:00
Pavel Krajcevski 85c3f9fc90 Pixels are actually 4vecs of ints 2013-10-08 15:07:11 -04:00
Pavel Krajcevski 473a1c1869 Move the operators out of the class definition so that we can derive from Vectors. 2013-10-08 15:06:20 -04:00
Pavel Krajcevski 4baf2ce311 Combine image functionality from PVRTCEncoder into Base library. 2013-10-04 18:35:18 -04:00
Pavel Krajcevski ab598c9ef7 Move Pixel class from PVRTCEncoder to FasTCBase. 2013-10-03 17:25:15 -04:00
Pavel Krajcevski cb348c3598 Reappropriate vexlib math headers into FasTC. 2013-10-03 17:19:28 -04:00
Pavel Krajcevski 89fbaf8170 Keep track of the image size with the base image rather than the compressed image. It's not always the case that the image data is RGBA8 data. 2013-09-28 22:40:48 -04:00
Pavel Krajcevski baab69dc99 Fix some MSVC compiler snafus 2013-09-28 22:21:31 -04:00
Pavel Krajcevski dcf389d346 Merge PVRTC compressor into split library. 2013-09-27 17:30:16 -04:00
Pavel Krajcevski 1a70ddf57a Remove spurious comment 2013-09-17 18:52:02 -04:00
Pavel Krajcevski 28cf254fe5 Initial decoupling of base library from core library. Includes a few formatting changes as well. 2013-09-13 19:36:37 -04:00