Commit b6ddadea authored by Francois Cartegnie's avatar Francois Cartegnie

vlc_bits.h: move in exp golomb bitstream decoding

parent 4bc2db94
...@@ -208,4 +208,23 @@ static inline void bs_align_1( bs_t *s ) ...@@ -208,4 +208,23 @@ static inline void bs_align_1( bs_t *s )
} }
} }
/* Read unsigned Exp-Golomb code */
static inline uint32_t bs_read_ue( bs_t * bs )
{
int32_t i = 0;
while( bs_read1( bs ) == 0 && bs->p < bs->p_end && i < 32 )
i++;
return (1 << i) - 1 + bs_read( bs, i );
}
/* Read signed Exp-Golomb code */
static inline int32_t bs_read_se( bs_t *s )
{
int val = bs_read_ue( s );
return val&0x01 ? (val+1)/2 : -(val/2);
}
#endif #endif
...@@ -51,25 +51,6 @@ static inline void hevc_skip_profile_tiers_level( bs_t * bs, int32_t max_sub_lay ...@@ -51,25 +51,6 @@ static inline void hevc_skip_profile_tiers_level( bs_t * bs, int32_t max_sub_lay
} }
} }
/* Read unsigned Exp-Golomb code */
static inline uint32_t bs_read_ue( bs_t * bs )
{
int32_t i = 0;
while( bs_read1( bs ) == 0 && bs->p < bs->p_end && i < 32 )
i++;
return (1 << i) - 1 + bs_read( bs, i );
}
/* Read signed Exp-Golomb code */
static inline int32_t bs_read_se( bs_t *s )
{
int val = bs_read_ue( s );
return val&0x01 ? (val+1)/2 : -(val/2);
}
/* Discards emulation prevention three bytes */ /* Discards emulation prevention three bytes */
static inline size_t nal_to_rbsp(const uint8_t * p_src, uint8_t * p_dst, size_t i_size) static inline size_t nal_to_rbsp(const uint8_t * p_src, uint8_t * p_dst, size_t i_size)
{ {
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#include <vlc_iso_lang.h> #include <vlc_iso_lang.h>
#include <vlc_meta.h> #include <vlc_meta.h>
//#include "../demux/mpeg/mpeg_parser_helpers.h"
#include "../demux/mp4/libmp4.h" #include "../demux/mp4/libmp4.h"
#include "libmp4mux.h" #include "libmp4mux.h"
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include "../codec/cc.h" #include "../codec/cc.h"
#include "h264_nal.h" #include "h264_nal.h"
#include "packetizer_helper.h" #include "packetizer_helper.h"
#include "../demux/mpeg/mpeg_parser_helpers.h"
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
......
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