[x265] [PATCH] asm: fix dynamic range of input to quant primitive

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Fri Aug 28 07:30:55 CEST 2015


# HG changeset patch
# User Dnyaneshwar G <dnyaneshwar at multicorewareinc.com>
# Date 1440736935 -19800
#      Fri Aug 28 10:12:15 2015 +0530
# Node ID dce85f739efeea842e490a0f555d4abdc89a5c80
# Parent  905c4f2e203ec082bd50b361865a7d4d297e45ce
asm: fix dynamic range of input to quant primitive

diff -r 905c4f2e203e -r dce85f739efe source/test/mbdstharness.cpp
--- a/source/test/mbdstharness.cpp	Thu Aug 27 10:13:56 2015 +0530
+++ b/source/test/mbdstharness.cpp	Fri Aug 28 10:12:15 2015 +0530
@@ -215,8 +215,14 @@
         uint32_t optReturnValue = 0;
         uint32_t refReturnValue = 0;
 
-        int bits = (rand() % 24) + 8;
-        int valueToAdd = rand() % (1 << bits);
+        int sliceType = rand() % 2;
+        int log2TrSize = rand() % 4 + 2;
+        int qp = rand() % (QP_MAX_SPEC + QP_BD_OFFSET + 1);
+        int per = qp / 6;
+        int transformShift = MAX_TR_DYNAMIC_RANGE - X265_DEPTH - log2TrSize;
+
+        int bits = QUANT_SHIFT + per + transformShift;
+        int valueToAdd = (sliceType == 1 ? 171 : 85) << (bits - 9);
         int cmp_size = sizeof(int) * height * width;
         int cmp_size1 = sizeof(short) * height * width;
         int numCoeff = height * width;


More information about the x265-devel mailing list