From 749bc4ea7e20312e312e48f14995b18668df13b6 Mon Sep 17 00:00:00 2001 From: dongzhang Date: Fri, 16 May 2014 09:29:57 +0800 Subject: [PATCH] Fix QP<18 dequant UT bug at encoder side This should be UT for QP<12. --- test/encoder/EncUT_DecodeMbAux.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/test/encoder/EncUT_DecodeMbAux.cpp b/test/encoder/EncUT_DecodeMbAux.cpp index 4149b84d..82bbe87c 100644 --- a/test/encoder/EncUT_DecodeMbAux.cpp +++ b/test/encoder/EncUT_DecodeMbAux.cpp @@ -63,17 +63,18 @@ TEST(DecodeMbAuxTest, TestIhdm_4x4_dc) { 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) {