Merge branch 'master' into DiscreteCosine

This commit is contained in:
Pavel Krajcevski 2015-02-19 00:54:12 -08:00
commit 84f25a353b
2 changed files with 20 additions and 20 deletions

View File

@ -58,50 +58,50 @@ TEST(IntegerEncoding, GetEncoding) {
// According to table C.2.7 // According to table C.2.7
IntegerEncodedValue val = IntegerEncodedValue::CreateEncoding(1); IntegerEncodedValue val = IntegerEncodedValue::CreateEncoding(1);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits);
EXPECT_EQ(val.BaseBitLength(), 1); EXPECT_EQ(val.BaseBitLength(), 1U);
val = IntegerEncodedValue::CreateEncoding(2); val = IntegerEncodedValue::CreateEncoding(2);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit);
EXPECT_EQ(val.BaseBitLength(), 0); EXPECT_EQ(val.BaseBitLength(), 0U);
val = IntegerEncodedValue::CreateEncoding(3); val = IntegerEncodedValue::CreateEncoding(3);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits);
EXPECT_EQ(val.BaseBitLength(), 2); EXPECT_EQ(val.BaseBitLength(), 2U);
val = IntegerEncodedValue::CreateEncoding(4); val = IntegerEncodedValue::CreateEncoding(4);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint);
EXPECT_EQ(val.BaseBitLength(), 0); EXPECT_EQ(val.BaseBitLength(), 0U);
val = IntegerEncodedValue::CreateEncoding(5); val = IntegerEncodedValue::CreateEncoding(5);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit);
EXPECT_EQ(val.BaseBitLength(), 1); EXPECT_EQ(val.BaseBitLength(), 1U);
val = IntegerEncodedValue::CreateEncoding(7); val = IntegerEncodedValue::CreateEncoding(7);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits);
EXPECT_EQ(val.BaseBitLength(), 3); EXPECT_EQ(val.BaseBitLength(), 3U);
val = IntegerEncodedValue::CreateEncoding(9); val = IntegerEncodedValue::CreateEncoding(9);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint);
EXPECT_EQ(val.BaseBitLength(), 1); EXPECT_EQ(val.BaseBitLength(), 1U);
val = IntegerEncodedValue::CreateEncoding(11); val = IntegerEncodedValue::CreateEncoding(11);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit);
EXPECT_EQ(val.BaseBitLength(), 2); EXPECT_EQ(val.BaseBitLength(), 2U);
val = IntegerEncodedValue::CreateEncoding(15); val = IntegerEncodedValue::CreateEncoding(15);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits);
EXPECT_EQ(val.BaseBitLength(), 4); EXPECT_EQ(val.BaseBitLength(), 4U);
val = IntegerEncodedValue::CreateEncoding(19); val = IntegerEncodedValue::CreateEncoding(19);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Quint);
EXPECT_EQ(val.BaseBitLength(), 2); EXPECT_EQ(val.BaseBitLength(), 2U);
val = IntegerEncodedValue::CreateEncoding(23); val = IntegerEncodedValue::CreateEncoding(23);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_Trit);
EXPECT_EQ(val.BaseBitLength(), 3); EXPECT_EQ(val.BaseBitLength(), 3U);
val = IntegerEncodedValue::CreateEncoding(31); val = IntegerEncodedValue::CreateEncoding(31);
EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits); EXPECT_EQ(val.GetEncoding(), ASTCC::eIntegerEncoding_JustBits);
EXPECT_EQ(val.BaseBitLength(), 5); EXPECT_EQ(val.BaseBitLength(), 5U);
} }

View File

@ -74,15 +74,15 @@ TEST(Image, BilinearUpscale) {
for(uint32 i = 0; i < img.GetWidth(); i++) { for(uint32 i = 0; i < img.GetWidth(); i++) {
for(uint32 j = 0; j < img.GetHeight(); j++) { for(uint32 j = 0; j < img.GetHeight(); j++) {
if(i == 0) { if(i == 0) {
EXPECT_EQ(img(i, j).R(), i); EXPECT_EQ(static_cast<uint32>(img(i, j).R()), i);
} else { } else {
EXPECT_EQ(img(i, j).R(), i-1); EXPECT_EQ(static_cast<uint32>(img(i, j).R()), i-1);
} }
if(j == 0) { if(j == 0) {
EXPECT_EQ(img(i, j).G(), j); EXPECT_EQ(static_cast<uint32>(img(i, j).G()), j);
} else { } else {
EXPECT_EQ(img(i, j).G(), j-1); EXPECT_EQ(static_cast<uint32>(img(i, j).G()), j-1);
} }
} }
} }
@ -145,13 +145,13 @@ TEST(Image, NonuniformBilinearUpscale) {
} else if(i == 15) { } else if(i == 15) {
EXPECT_EQ(img(i, j).R(), 12); EXPECT_EQ(img(i, j).R(), 12);
} else { } else {
EXPECT_EQ(img(i, j).R(), i-2); EXPECT_EQ(static_cast<uint32>(img(i, j).R()), i-2);
} }
if(j == 0) { if(j == 0) {
EXPECT_EQ(img(i, j).G(), 0); EXPECT_EQ(img(i, j).G(), 0);
} else { } else {
EXPECT_EQ(img(i, j).G(), j-1); EXPECT_EQ(static_cast<uint32>(img(i, j).G()), j-1);
} }
} }
} }
@ -198,7 +198,7 @@ TEST(Image, BilinearUpscaleWrapped) {
} else if(i == 15) { } else if(i == 15) {
EXPECT_EQ(p.R(), 9); EXPECT_EQ(p.R(), 9);
} else { } else {
EXPECT_EQ(p.R(), i-2); EXPECT_EQ(static_cast<uint32>(p.R()), i-2);
} }
if(j == 0) { if(j == 0) {
@ -208,7 +208,7 @@ TEST(Image, BilinearUpscaleWrapped) {
} else if(j == 15) { } else if(j == 15) {
EXPECT_EQ(p.G(), 9); EXPECT_EQ(p.G(), 9);
} else { } else {
EXPECT_EQ(p.G(), j-2); EXPECT_EQ(static_cast<uint32>(p.G()), j-2);
} }
} }
} }