changeset 10973:c17dea580e1e

encoder: DCT coefficients are always 16-bit
author Deepthi Nandakumar <deepthi@multicorewareinc.com>
date Tue, 01 Sep 2015 13:43:49 +0530
parents 9f669a8d959e
children 86b915fdd88a
files source/encoder/encoder.cpp
diffstat 1 files changed, 2 insertions(+-), 3 deletions(-) [+]
line wrap: on
line diff
--- a/source/encoder/encoder.cpp	Tue Sep 01 11:38:47 2015 +0530
+++ b/source/encoder/encoder.cpp	Tue Sep 01 13:43:49 2015 +0530
@@ -255,11 +255,10 @@ void Encoder::create()
 
                 for (int i = 0; i < coefCount; i++)
                 {
-                    uint16_t max = (1 << (7 + X265_DEPTH)) - 1;
                     /* True "emergency mode": remove all DCT coefficients */
                     if (q == QP_MAX_MAX - QP_MAX_SPEC - 1)
                     {
-                        nrOffset[i] = max;
+                        nrOffset[i] = INT16_MAX;
                         continue;
                     }
 
@@ -277,7 +276,7 @@ void Encoder::create()
 
                     // Formula chosen as an exponential scale to vaguely mimic the effects of a higher quantizer.
                     double bias = (pow(2, pos * (QP_MAX_MAX - QP_MAX_SPEC)) * 0.003 - 0.003) * start;
-                    nrOffset[i] = (uint16_t)X265_MIN(bias + 0.5, max);
+                    nrOffset[i] = (uint16_t)X265_MIN(bias + 0.5, INT16_MAX);
                 }
             }
         }