[x265] [PATCH] Fix: scaling_list_delta_coef out of range
tamura at pegasys-inc.com
tamura at pegasys-inc.com
Tue Mar 5 08:11:48 CET 2019
# HG changeset patch
# User Masaharu Tamura <tamura at pegasys-inc.com>
# Date 1551769822 -32400
# Tue Mar 05 16:10:22 2019 +0900
# Node ID c32f7d697eb32e19789caf4c0304d0e1ab276b7d
# Parent 31ab7e09a3b5b15ffcc532826d4dd5d37e611483
Fix: scaling_list_delta_coef out of range.
diff -r 31ab7e09a3b5 -r c32f7d697eb3 source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp Tue Feb 26 13:52:24 2019 +0530
+++ b/source/encoder/entropy.cpp Tue Mar 05 16:10:22 2019 +0900
@@ -530,6 +530,10 @@
for (int i = 0; i < coefNum; i++)
{
data = src[scan[i]] - nextCoef;
+ if (data < -128)
+ data += 256;
+ if (data > 127)
+ data -= 256;
nextCoef = (nextCoef + data + 256) % 256;
WRITE_SVLC(data, "scaling_list_delta_coef");
}
More information about the x265-devel
mailing list