summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/vl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/vl')
-rw-r--r--src/gallium/auxiliary/vl/vl_rbsp.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/vl/vl_rbsp.h b/src/gallium/auxiliary/vl/vl_rbsp.h
index 160b2f82773..4d90c2de09c 100644
--- a/src/gallium/auxiliary/vl/vl_rbsp.h
+++ b/src/gallium/auxiliary/vl/vl_rbsp.h
@@ -56,8 +56,6 @@ static inline void vl_rbsp_init(struct vl_rbsp *rbsp, struct vl_vlc *nal, unsign
/* copy the position */
rbsp->nal = *nal;
- rbsp->escaped = 16;
-
/* search for the end of the NAL unit */
while (vl_vlc_search_byte(nal, num_bits, 0x00)) {
if (vl_vlc_peekbits(nal, 24) == 0x000001 ||
@@ -76,6 +74,10 @@ static inline void vl_rbsp_init(struct vl_rbsp *rbsp, struct vl_vlc *nal, unsign
i += 8;
}
}
+
+ valid = vl_vlc_valid_bits(&rbsp->nal);
+
+ rbsp->escaped = (valid >= 16) ? 16 : ((valid >= 8) ? 8 : 0);
}
/**