[vlc-commits] hxxx_nal: add nal to rbsp conversion helpers

Francois Cartegnie git at videolan.org
Tue Dec 15 17:23:47 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 14 11:26:15 2015 +0100| [4bdb1e9931fa99262bf1f28933005416a28d74e4] | committer: Francois Cartegnie

hxxx_nal: add nal to rbsp conversion helpers

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4bdb1e9931fa99262bf1f28933005416a28d74e4
---

 modules/packetizer/hxxx_nal.h |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/modules/packetizer/hxxx_nal.h b/modules/packetizer/hxxx_nal.h
index b309b85..8e116e5 100644
--- a/modules/packetizer/hxxx_nal.h
+++ b/modules/packetizer/hxxx_nal.h
@@ -74,4 +74,21 @@ static inline uint8_t * hxxx_ep3b_to_rbsp(const uint8_t *p_src, size_t i_src, si
     return p_dst;
 }
 
+static inline uint8_t * hxxx_AnnexB_NAL_to_rbsp(const uint8_t *p_src, size_t i_src, size_t *pi_ret)
+{
+    if(!hxxx_strip_AnnexB_startcode(&p_src, &i_src))
+        return NULL;
+    return hxxx_ep3b_to_rbsp(p_src, i_src, pi_ret);
+}
+
+static inline uint8_t * hxxx_xvc1_NAL_to_rbsp(const uint8_t *p_src, size_t i_src,
+                                              uint8_t i_nal_length_size, size_t *pi_ret)
+{
+    if(i_src < i_nal_length_size)
+        return NULL;
+    p_src += i_nal_length_size;
+    i_src -= i_nal_length_size;
+    return hxxx_ep3b_to_rbsp(p_src, i_src, pi_ret);
+}
+
 #endif // HXXX_NAL_H



More information about the vlc-commits mailing list