From fe4e1b8991e34a934bef9e20da2392b760b45c08 Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Thu, 1 Jun 2017 00:00:40 +0200 Subject: [PATCH] h264: add write functions for NAL header --- NEWS | 7 +++++++ mpeg/h264.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/NEWS b/NEWS index 83a7e95..3a020b0 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +1.3 +=== + - Add support for avcC and hvcC structures + - Add support for LOAS AAC + - Improve support for RTP + - Use ISO 6937 as default DVB charset + 1.2 (31 Jan 2017) ================= - Add partial support for ITU-T H.265 diff --git a/mpeg/h264.h b/mpeg/h264.h index 9bea568..4db78c2 100644 --- a/mpeg/h264.h +++ b/mpeg/h264.h @@ -92,11 +92,28 @@ static inline uint8_t h264nal_get_type(const uint8_t *p_h264nal) return p_h264nal[3] & 0x1f; } +static inline void h264nalst_init(uint8_t *p_start) +{ + p_start[0] = 0; +} + +static inline void h264nalst_set_ref(uint8_t *p_start, uint8_t ref) +{ + p_start[0] &= 0x1f; + p_start[0] |= ref << 5; +} + static inline uint8_t h264nalst_get_ref(uint8_t start) { return (start & 0x60) >> 5; } +static inline void h264nalst_set_type(uint8_t *p_start, uint8_t type) +{ + p_start[0] &= 0xe0; + p_start[0] |= type; +} + static inline uint8_t h264nalst_get_type(uint8_t start) { return start & 0x1f;