[normative]palette_delta_encoding: don't waste bit
When the range is less than 2, we don't need to transmit any bits,
but we still transmited 1 bit that is always 0. This patch makes the
codec skip this unnecessary bit.
Tested on the screen_content testset, no coding stats changes.
BUG=aomedia:1604
Change-Id: Ia21b669aea00fd94852559affd69fa25895fd368
diff --git a/av1/common/entropymode.h b/av1/common/entropymode.h
index 45c3ba5..750c214 100644
--- a/av1/common/entropymode.h
+++ b/av1/common/entropymode.h
@@ -298,6 +298,7 @@
void av1_setup_past_independence(struct AV1Common *cm);
static INLINE int av1_ceil_log2(int n) {
+ if (n < 2) return 0;
int i = 1, p = 2;
while (p < n) {
i++;