[x265] [PATCH] entropy: pad size of context array to 32 * 5 bytes

Steve Borho steve at borho.org
Fri Aug 8 04:24:26 CEST 2014


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1407464655 18000
#      Thu Aug 07 21:24:15 2014 -0500
# Node ID aa7141c4803e3126a193d8875fd0abae7286a12c
# Parent  4473573270392b5d6dc2af5637a7e404d5d450bf
entropy: pad size of context array to 32 * 5 bytes

diff -r 447357327039 -r aa7141c4803e source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Thu Aug 07 20:20:00 2014 -0500
+++ b/source/encoder/entropy.cpp	Thu Aug 07 21:24:15 2014 -0500
@@ -36,6 +36,7 @@
 Entropy::Entropy()
     : m_fracBits(0)
 {
+    X265_CHECK(sizeof(m_contextState) >= sizeof(m_contextState[0]) * MAX_OFF_CTX_MOD, "context state table is too small\n");
     memset(m_contextState, 0, sizeof(m_contextState));
 }
 
diff -r 447357327039 -r aa7141c4803e source/encoder/entropy.h
--- a/source/encoder/entropy.h	Thu Aug 07 20:20:00 2014 -0500
+++ b/source/encoder/entropy.h	Thu Aug 07 21:24:15 2014 -0500
@@ -90,7 +90,7 @@
 public:
 
     uint64_t      m_pad;
-    uint8_t       m_contextState[MAX_OFF_CTX_MOD];
+    uint8_t       m_contextState[160]; // MAX_OFF_CTX_MOD + padding
 
     /* CABAC state */
     uint32_t      m_low;


More information about the x265-devel mailing list