ref: 3e258ea74ea0ca38c5b7e7690997e3e1201ff9fe
parent: 7f3f397706835dfa376ead7b5a5d222507d31a6c
parent: 749bc4ea7e20312e312e48f14995b18668df13b6
author: huili2 <huili2@cisco.com>
date: Sat May 17 17:51:35 EDT 2014
Merge pull request #853 from dongzha/FixEncUTDequantBugMaster Fix encoder dequant Unit Test bug for master
--- a/test/encoder/EncUT_DecodeMbAux.cpp
+++ b/test/encoder/EncUT_DecodeMbAux.cpp
@@ -63,17 +63,18 @@
TEST(DecodeMbAuxTest, TestDequant_4x4_luma_dc) {
short T[16],W[16];
srand((uint32_t)time(NULL));
- for(int i=0;i<16;i++) {
- T[i]=rand()%256+1;
- W[i]=T[i];
- }
- //TODO: QP<18 will cause case fail, need fix and enable the test afterwards
- for (int qp=18;qp<52;qp++) {
+ for (int qp=0; qp<12; qp++) {
+ for(int i=0; i<16; i++) {
+ T[i]=rand()%256+1;
+ W[i]=T[i];
+ }
WelsDequantLumaDc4x4(W,qp);
- for(int i=0;i<16;i++)
- EXPECT_EQ(((T[i]*g_kuiDequantCoeff[qp%6][0]+(1 << (1 - qp / 6))))>>(2- qp / 6),W[i]);
- }
+ for(int i=0; i<16; i++) {
+ T[i]= (((T[i]*g_kuiDequantCoeff[qp%6][0]+(1 << (1 - qp / 6))))>>(2- qp / 6));
+ EXPECT_EQ(T[i],W[i]);
+ }
+ }
}
TEST(DecodeMbAuxTest, TestDequant_ihdm_4x4_c) {