Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
99986702
Commit
99986702
authored
Aug 01, 2014
by
Felix Abecassis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: refactor Exp-Golomb reading functions with existing mpeg demuxing code
parent
d3571381
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
33 deletions
+24
-33
modules/demux/mpeg/hevc.c
modules/demux/mpeg/hevc.c
+4
-4
modules/demux/mpeg/mpeg_parser_helpers.h
modules/demux/mpeg/mpeg_parser_helpers.h
+9
-1
modules/mux/mp4.c
modules/mux/mp4.c
+10
-10
modules/packetizer/h264.c
modules/packetizer/h264.c
+1
-18
No files found.
modules/demux/mpeg/hevc.c
View file @
99986702
...
@@ -263,12 +263,12 @@ static int32_t getFPS( demux_t *p_demux, block_t * p_block )
...
@@ -263,12 +263,12 @@ static int32_t getFPS( demux_t *p_demux, block_t * p_block )
int32_t
i
=
vps_sub_layer_ordering_info_present_flag
?
0
:
max_sub_layer_minus1
;
int32_t
i
=
vps_sub_layer_ordering_info_present_flag
?
0
:
max_sub_layer_minus1
;
for
(
;
i
<=
max_sub_layer_minus1
;
i
++
)
for
(
;
i
<=
max_sub_layer_minus1
;
i
++
)
{
{
read_ue
(
&
bs
);
bs_
read_ue
(
&
bs
);
read_ue
(
&
bs
);
bs_
read_ue
(
&
bs
);
read_ue
(
&
bs
);
bs_
read_ue
(
&
bs
);
}
}
uint32_t
vps_max_layer_id
=
bs_read
(
&
bs
,
6
);
uint32_t
vps_max_layer_id
=
bs_read
(
&
bs
,
6
);
uint32_t
vps_num_layer_sets_minus1
=
read_ue
(
&
bs
);
uint32_t
vps_num_layer_sets_minus1
=
bs_
read_ue
(
&
bs
);
bs_skip
(
&
bs
,
vps_max_layer_id
*
vps_num_layer_sets_minus1
);
bs_skip
(
&
bs
,
vps_max_layer_id
*
vps_num_layer_sets_minus1
);
if
(
bs_read1
(
&
bs
))
if
(
bs_read1
(
&
bs
))
...
...
modules/demux/mpeg/mpeg_parser_helpers.h
View file @
99986702
...
@@ -51,7 +51,8 @@ static inline void hevc_skip_profile_tiers_level( bs_t * bs, int32_t max_sub_lay
...
@@ -51,7 +51,8 @@ static inline void hevc_skip_profile_tiers_level( bs_t * bs, int32_t max_sub_lay
}
}
}
}
static
inline
uint32_t
read_ue
(
bs_t
*
bs
)
/* Read unsigned Exp-Golomb code */
static
inline
uint32_t
bs_read_ue
(
bs_t
*
bs
)
{
{
int32_t
i
=
0
;
int32_t
i
=
0
;
...
@@ -61,6 +62,13 @@ static inline uint32_t read_ue( bs_t * bs )
...
@@ -61,6 +62,13 @@ static inline uint32_t read_ue( bs_t * bs )
return
(
1
<<
i
)
-
1
+
bs_read
(
bs
,
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
);
}
static
inline
size_t
nal_decode
(
uint8_t
*
p_src
,
uint8_t
*
p_dst
,
size_t
i_size
)
static
inline
size_t
nal_decode
(
uint8_t
*
p_src
,
uint8_t
*
p_dst
,
size_t
i_size
)
{
{
...
...
modules/mux/mp4.c
View file @
99986702
...
@@ -856,26 +856,26 @@ static void hevcParseSPS(uint8_t * p_buffer, size_t i_buffer, uint8_t * chroma_i
...
@@ -856,26 +856,26 @@ static void hevcParseSPS(uint8_t * p_buffer, size_t i_buffer, uint8_t * chroma_i
hevc_skip_profile_tiers_level
(
&
bs
,
sps_max_sublayer_minus1
);
hevc_skip_profile_tiers_level
(
&
bs
,
sps_max_sublayer_minus1
);
/* skip sps id */
/* skip sps id */
(
void
)
read_ue
(
&
bs
);
(
void
)
bs_
read_ue
(
&
bs
);
*
chroma_idc
=
read_ue
(
&
bs
);
*
chroma_idc
=
bs_
read_ue
(
&
bs
);
if
(
*
chroma_idc
==
3
)
if
(
*
chroma_idc
==
3
)
bs_skip
(
&
bs
,
1
);
bs_skip
(
&
bs
,
1
);
/* skip width and heigh */
/* skip width and heigh */
(
void
)
read_ue
(
&
bs
);
(
void
)
bs_
read_ue
(
&
bs
);
(
void
)
read_ue
(
&
bs
);
(
void
)
bs_
read_ue
(
&
bs
);
uint32_t
conformance_window_flag
=
bs_read1
(
&
bs
);
uint32_t
conformance_window_flag
=
bs_read1
(
&
bs
);
if
(
conformance_window_flag
)
{
if
(
conformance_window_flag
)
{
/* skip offsets*/
/* skip offsets*/
(
void
)
read_ue
(
&
bs
);
(
void
)
bs_
read_ue
(
&
bs
);
(
void
)
read_ue
(
&
bs
);
(
void
)
bs_
read_ue
(
&
bs
);
(
void
)
read_ue
(
&
bs
);
(
void
)
bs_
read_ue
(
&
bs
);
(
void
)
read_ue
(
&
bs
);
(
void
)
bs_
read_ue
(
&
bs
);
}
}
*
bit_depth_luma_minus8
=
read_ue
(
&
bs
);
*
bit_depth_luma_minus8
=
bs_
read_ue
(
&
bs
);
*
bit_depth_chroma_minus8
=
read_ue
(
&
bs
);
*
bit_depth_chroma_minus8
=
bs_
read_ue
(
&
bs
);
}
}
static
bo_t
*
GetHvcCTag
(
mp4_stream_t
*
p_stream
)
static
bo_t
*
GetHvcCTag
(
mp4_stream_t
*
p_stream
)
...
...
modules/packetizer/h264.c
View file @
99986702
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#include <vlc_bits.h>
#include <vlc_bits.h>
#include "../codec/cc.h"
#include "../codec/cc.h"
#include "packetizer_helper.h"
#include "packetizer_helper.h"
#include "../demux/mpeg/mpeg_parser_helpers.h"
/*****************************************************************************
/*****************************************************************************
* Module descriptor
* Module descriptor
...
@@ -572,24 +573,6 @@ static void CreateDecodedNAL( uint8_t **pp_ret, int *pi_ret,
...
@@ -572,24 +573,6 @@ static void CreateDecodedNAL( uint8_t **pp_ret, int *pi_ret,
*
pi_ret
=
dst
-
*
pp_ret
;
*
pi_ret
=
dst
-
*
pp_ret
;
}
}
static
inline
int
bs_read_ue
(
bs_t
*
s
)
{
int
i
=
0
;
while
(
bs_read1
(
s
)
==
0
&&
s
->
p
<
s
->
p_end
&&
i
<
32
)
{
i
++
;
}
return
(
(
1
<<
i
)
-
1
+
bs_read
(
s
,
i
)
);
}
static
inline
int
bs_read_se
(
bs_t
*
s
)
{
int
val
=
bs_read_ue
(
s
);
return
val
&
0x01
?
(
val
+
1
)
/
2
:
-
(
val
/
2
);
}
/*****************************************************************************
/*****************************************************************************
* ParseNALBlock: parses annexB type NALs
* ParseNALBlock: parses annexB type NALs
* All p_frag blocks are required to start with 0 0 0 1 4-byte startcode
* All p_frag blocks are required to start with 0 0 0 1 4-byte startcode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment