<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><pre>>- X265_CHECK((int)numSig == primitives.count_nonzero(coeff, 1 << log2TrSize * 2), "numSig differ\n");
>+ /* This section of code is to safely convert int32_t coefficients to int16_t, once the caller function is
>+ * optimize to take coefficients as int16_t*, it will be cleanse.*/
>+ int numCoeff = (1 << (log2TrSize * 2));
>+ assert(numCoeff <= 1024);
>+ ALIGN_VAR_16(int16_t, qCoeff[32 * 32]);
>+ for (int i = 0; i < numCoeff; i++)
>+ {
>+ qCoeff[i] = (coeff[i] & 0xFFFF);
>+ }
I suggest use clip on it, to avoid value problem (eg: 0x10000 become zero) and asm instruction match to clip</pre></div>