summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl/vl_vlc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_vlc.h')
-rw-r--r--src/gallium/auxiliary/vl/vl_vlc.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/vl/vl_vlc.h b/src/gallium/auxiliary/vl/vl_vlc.h
index 4db1334d6a4..e17eae83fb3 100644
--- a/src/gallium/auxiliary/vl/vl_vlc.h
+++ b/src/gallium/auxiliary/vl/vl_vlc.h
@@ -113,9 +113,10 @@ vl_vlc_init(struct vl_vlc *vlc, const uint8_t *data, unsigned len)
}
static INLINE unsigned
-vl_vlc_bytes_left(struct vl_vlc *vlc)
+vl_vlc_bits_left(struct vl_vlc *vlc)
{
- return ((uint8_t*)vlc->end)-((uint8_t*)vlc->data);
+ signed bytes_left = ((uint8_t*)vlc->end)-((uint8_t*)vlc->data);
+ return bytes_left * 8 + vlc->valid_bits;
}
static INLINE unsigned