Commit f2c4e194 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

packetizer: h2xx: switch DCR test to negated AnnexB extradata test

As some encoders do set something else than bits to 1 into reserved
fields.
parent e111adbe
......@@ -37,10 +37,13 @@
bool h264_isavcC( const uint8_t *p_buf, size_t i_buf )
{
return ( i_buf >= H264_MIN_AVCC_SIZE &&
p_buf[0] == 0x01 &&
p_buf[0] != 0x00 &&
p_buf[1] != 0x00
/* /!\Broken quicktime streams does not respect reserved bits
(p_buf[4] & 0xFC) == 0xFC &&
(p_buf[4] & 0x03) != 0x02 &&
(p_buf[5] & 0x1F) > 0x00 ); /* Broken quicktime streams using reserved bits */
(p_buf[5] & 0x1F) > 0x00 */
);
}
static size_t get_avcC_to_AnnexB_NAL_size( const uint8_t *p_buf, size_t i_buf )
......
......@@ -121,13 +121,15 @@ enum hevc_slice_type_e
static inline bool hevc_ishvcC( const uint8_t *p_buf, size_t i_buf )
{
return ( i_buf >= HEVC_MIN_HVCC_SIZE &&
p_buf[0] == 0x01 &&
(p_buf[13] & 0xF0) == 0xF0 && /* Match all reserved bits */
p_buf[0] != 0x00 &&
p_buf[1] != 0x00
/* /!\Broken quicktime streams does not respect reserved bits
(p_buf[13] & 0xF0) == 0xF0 && // Match all reserved bits
(p_buf[15] & 0xFC) == 0xFC &&
(p_buf[16] & 0xFC) == 0xFC &&
(p_buf[17] & 0xF8) == 0xF8 &&
(p_buf[18] & 0xF8) == 0xF8 &&
(p_buf[21] & 0x03) != 0x02
(p_buf[21] & 0x03) != 0x02 */
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment