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
c7479da1
Commit
c7479da1
authored
Aug 20, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packetizer: h264: rename NAL startcode escaping functions
parent
0d302380
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
9 deletions
+10
-9
modules/demux/mpeg/hevc.c
modules/demux/mpeg/hevc.c
+1
-1
modules/demux/mpeg/mpeg_parser_helpers.h
modules/demux/mpeg/mpeg_parser_helpers.h
+2
-1
modules/mux/mp4.c
modules/mux/mp4.c
+2
-2
modules/packetizer/h264.c
modules/packetizer/h264.c
+2
-2
modules/packetizer/h264_nal.c
modules/packetizer/h264_nal.c
+1
-1
modules/packetizer/h264_nal.h
modules/packetizer/h264_nal.h
+2
-2
No files found.
modules/demux/mpeg/hevc.c
View file @
c7479da1
...
@@ -231,7 +231,7 @@ static uint8_t * CreateDecodedNAL( int *pi_ret,
...
@@ -231,7 +231,7 @@ static uint8_t * CreateDecodedNAL( int *pi_ret,
if
(
!
dst
)
if
(
!
dst
)
return
NULL
;
return
NULL
;
*
pi_ret
=
nal_
decode
(
src
,
dst
,
i_src
);
*
pi_ret
=
nal_
to_rbsp
(
src
,
dst
,
i_src
);
return
dst
;
return
dst
;
}
}
...
...
modules/demux/mpeg/mpeg_parser_helpers.h
View file @
c7479da1
...
@@ -70,7 +70,8 @@ static inline int32_t bs_read_se( bs_t *s )
...
@@ -70,7 +70,8 @@ static inline int32_t bs_read_se( bs_t *s )
return
val
&
0x01
?
(
val
+
1
)
/
2
:
-
(
val
/
2
);
return
val
&
0x01
?
(
val
+
1
)
/
2
:
-
(
val
/
2
);
}
}
static
inline
size_t
nal_decode
(
const
uint8_t
*
p_src
,
uint8_t
*
p_dst
,
size_t
i_size
)
/* 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
)
{
{
size_t
j
=
0
;
size_t
j
=
0
;
for
(
size_t
i
=
0
;
i
<
i_size
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
i_size
;
i
++
)
{
...
...
modules/mux/mp4.c
View file @
c7479da1
...
@@ -1173,7 +1173,7 @@ static void hevcParseVPS(uint8_t * p_buffer, size_t i_buffer, uint8_t *general,
...
@@ -1173,7 +1173,7 @@ static void hevcParseVPS(uint8_t * p_buffer, size_t i_buffer, uint8_t *general,
const
size_t
i_decoded_nal_size
=
512
;
const
size_t
i_decoded_nal_size
=
512
;
uint8_t
p_dec_nal
[
i_decoded_nal_size
];
uint8_t
p_dec_nal
[
i_decoded_nal_size
];
size_t
i_size
=
(
i_buffer
<
i_decoded_nal_size
)
?
i_buffer
:
i_decoded_nal_size
;
size_t
i_size
=
(
i_buffer
<
i_decoded_nal_size
)
?
i_buffer
:
i_decoded_nal_size
;
nal_
decode
(
p_buffer
,
p_dec_nal
,
i_size
);
nal_
to_rbsp
(
p_buffer
,
p_dec_nal
,
i_size
);
/* first two bytes are the NAL header, 3rd and 4th are:
/* first two bytes are the NAL header, 3rd and 4th are:
vps_video_parameter_set_id(4)
vps_video_parameter_set_id(4)
...
@@ -1196,7 +1196,7 @@ static void hevcParseSPS(uint8_t * p_buffer, size_t i_buffer, uint8_t * chroma_i
...
@@ -1196,7 +1196,7 @@ static void hevcParseSPS(uint8_t * p_buffer, size_t i_buffer, uint8_t * chroma_i
const
size_t
i_decoded_nal_size
=
512
;
const
size_t
i_decoded_nal_size
=
512
;
uint8_t
p_dec_nal
[
i_decoded_nal_size
];
uint8_t
p_dec_nal
[
i_decoded_nal_size
];
size_t
i_size
=
(
i_buffer
<
i_decoded_nal_size
)
?
i_buffer
-
2
:
i_decoded_nal_size
;
size_t
i_size
=
(
i_buffer
<
i_decoded_nal_size
)
?
i_buffer
-
2
:
i_decoded_nal_size
;
nal_
decode
(
p_buffer
+
2
,
p_dec_nal
,
i_size
);
nal_
to_rbsp
(
p_buffer
+
2
,
p_dec_nal
,
i_size
);
bs_t
bs
;
bs_t
bs
;
bs_init
(
&
bs
,
p_dec_nal
,
i_size
);
bs_init
(
&
bs
,
p_dec_nal
,
i_size
);
...
...
modules/packetizer/h264.c
View file @
c7479da1
...
@@ -894,7 +894,7 @@ static void ParseSlice( decoder_t *p_dec, bool *pb_new_picture, slice_t *p_slice
...
@@ -894,7 +894,7 @@ static void ParseSlice( decoder_t *p_dec, bool *pb_new_picture, slice_t *p_slice
bs_t
s
;
bs_t
s
;
/* do not convert the whole frame */
/* do not convert the whole frame */
Create
Decoded
NAL
(
&
pb_dec
,
&
i_dec
,
&
p_frag
->
p_buffer
[
5
],
Create
RbspFrom
NAL
(
&
pb_dec
,
&
i_dec
,
&
p_frag
->
p_buffer
[
5
],
__MIN
(
p_frag
->
i_buffer
-
5
,
60
)
);
__MIN
(
p_frag
->
i_buffer
-
5
,
60
)
);
bs_init
(
&
s
,
pb_dec
,
i_dec
);
bs_init
(
&
s
,
pb_dec
,
i_dec
);
...
@@ -1000,7 +1000,7 @@ static void ParseSei( decoder_t *p_dec, block_t *p_frag )
...
@@ -1000,7 +1000,7 @@ static void ParseSei( decoder_t *p_dec, block_t *p_frag )
int
i_dec
;
int
i_dec
;
/* */
/* */
Create
Decoded
NAL
(
&
pb_dec
,
&
i_dec
,
&
p_frag
->
p_buffer
[
5
],
p_frag
->
i_buffer
-
5
);
Create
RbspFrom
NAL
(
&
pb_dec
,
&
i_dec
,
&
p_frag
->
p_buffer
[
5
],
p_frag
->
i_buffer
-
5
);
if
(
!
pb_dec
)
if
(
!
pb_dec
)
return
;
return
;
...
...
modules/packetizer/h264_nal.c
View file @
c7479da1
...
@@ -404,7 +404,7 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
...
@@ -404,7 +404,7 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
return
-
1
;
return
-
1
;
memset
(
p_sps
,
0
,
sizeof
(
struct
nal_sps
)
);
memset
(
p_sps
,
0
,
sizeof
(
struct
nal_sps
)
);
Create
Decoded
NAL
(
&
pb_dec
,
&
i_dec
,
&
p_sps_buf
[
5
],
Create
RbspFrom
NAL
(
&
pb_dec
,
&
i_dec
,
&
p_sps_buf
[
5
],
i_sps_size
-
5
);
i_sps_size
-
5
);
bs_init
(
&
s
,
pb_dec
,
i_dec
);
bs_init
(
&
s
,
pb_dec
,
i_dec
);
...
...
modules/packetizer/h264_nal.h
View file @
c7479da1
...
@@ -103,7 +103,7 @@ struct nal_pps
...
@@ -103,7 +103,7 @@ struct nal_pps
int
i_pic_order_present_flag
;
int
i_pic_order_present_flag
;
};
};
static
inline
void
Create
Decoded
NAL
(
uint8_t
**
pp_ret
,
int
*
pi_ret
,
static
inline
void
Create
RbspFrom
NAL
(
uint8_t
**
pp_ret
,
int
*
pi_ret
,
const
uint8_t
*
src
,
int
i_src
)
const
uint8_t
*
src
,
int
i_src
)
{
{
uint8_t
*
dst
=
malloc
(
i_src
);
uint8_t
*
dst
=
malloc
(
i_src
);
...
@@ -111,7 +111,7 @@ static inline void CreateDecodedNAL( uint8_t **pp_ret, int *pi_ret,
...
@@ -111,7 +111,7 @@ static inline void CreateDecodedNAL( uint8_t **pp_ret, int *pi_ret,
*
pp_ret
=
dst
;
*
pp_ret
=
dst
;
if
(
dst
)
if
(
dst
)
*
pi_ret
=
nal_
decode
(
src
,
dst
,
i_src
);
*
pi_ret
=
nal_
to_rbsp
(
src
,
dst
,
i_src
);
}
}
/* Parse the SPS/PPS Metadata and convert it to annex b format */
/* Parse the SPS/PPS Metadata and convert it to annex b format */
...
...
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