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
c3dec45d
Commit
c3dec45d
authored
Jul 29, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264_nal: remove unused H264ConvertState
parent
0706192d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
29 deletions
+19
-29
modules/codec/mft.c
modules/codec/mft.c
+1
-2
modules/codec/omxil/mediacodec.c
modules/codec/omxil/mediacodec.c
+2
-4
modules/codec/omxil/omxil.c
modules/codec/omxil/omxil.c
+1
-2
modules/packetizer/h264_nal.c
modules/packetizer/h264_nal.c
+14
-13
modules/packetizer/h264_nal.h
modules/packetizer/h264_nal.h
+1
-8
No files found.
modules/codec/mft.c
View file @
c3dec45d
...
...
@@ -575,8 +575,7 @@ static int ProcessInputStream(decoder_t *p_dec, DWORD stream_id, block_t *p_bloc
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_H264
)
{
/* in-place NAL to annex B conversion. */
struct
H264ConvertState
convert_state
=
{
0
,
0
};
convert_h264_to_annexb
(
buffer_start
,
p_block
->
i_buffer
,
p_sys
->
nal_size
,
&
convert_state
);
convert_h264_to_annexb
(
buffer_start
,
p_block
->
i_buffer
,
p_sys
->
nal_size
);
}
hr
=
IMFMediaBuffer_Unlock
(
input_media_buffer
);
...
...
modules/codec/omxil/mediacodec.c
View file @
c3dec45d
...
...
@@ -1126,14 +1126,13 @@ static void H264ProcessBlock(decoder_t *p_dec, block_t *p_block,
bool
*
p_csd_changed
,
bool
*
p_size_changed
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
struct
H264ConvertState
convert_state
=
{
0
,
0
};
assert
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_H264
&&
p_block
);
if
(
p_sys
->
u
.
video
.
i_nal_size
)
{
convert_h264_to_annexb
(
p_block
->
p_buffer
,
p_block
->
i_buffer
,
p_sys
->
u
.
video
.
i_nal_size
,
&
convert_state
);
p_sys
->
u
.
video
.
i_nal_size
);
}
else
if
(
H264SetCSD
(
p_dec
,
p_block
->
p_buffer
,
p_block
->
i_buffer
,
p_size_changed
)
==
VLC_SUCCESS
)
{
...
...
@@ -1145,14 +1144,13 @@ static void HEVCProcessBlock(decoder_t *p_dec, block_t *p_block,
bool
*
p_csd_changed
,
bool
*
p_size_changed
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
struct
H264ConvertState
convert_state
=
{
0
,
0
};
assert
(
p_dec
->
fmt_in
.
i_codec
==
VLC_CODEC_HEVC
&&
p_block
);
if
(
p_sys
->
u
.
video
.
i_nal_size
)
{
convert_h264_to_annexb
(
p_block
->
p_buffer
,
p_block
->
i_buffer
,
p_sys
->
u
.
video
.
i_nal_size
,
&
convert_state
);
p_sys
->
u
.
video
.
i_nal_size
);
}
/* TODO */
...
...
modules/codec/omxil/omxil.c
View file @
c3dec45d
...
...
@@ -1430,7 +1430,6 @@ static int DecodeVideoInput( decoder_t *p_dec, OmxPort *p_port, block_t **pp_blo
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
OMX_BUFFERHEADERTYPE
*
p_header
;
struct
H264ConvertState
convert_state
=
{
0
,
0
};
block_t
*
p_block
=
*
pp_block
;
/* Send the input buffer to the component */
...
...
@@ -1486,7 +1485,7 @@ static int DecodeVideoInput( decoder_t *p_dec, OmxPort *p_port, block_t **pp_blo
* i_nal_size_length == 0, which is the case for codecs other
* than H.264 */
convert_h264_to_annexb
(
p_header
->
pBuffer
,
p_header
->
nFilledLen
,
p_sys
->
i_nal_size_length
,
&
convert_state
);
p_sys
->
i_nal_size_length
);
OMX_DBG
(
"EmptyThisBuffer %p, %p, %i, %"
PRId64
,
p_header
,
p_header
->
pBuffer
,
(
int
)
p_header
->
nFilledLen
,
FromOmxTicks
(
p_header
->
nTimeStamp
)
);
OMX_EmptyThisBuffer
(
p_port
->
omx_handle
,
p_header
);
...
...
modules/packetizer/h264_nal.c
View file @
c3dec45d
...
...
@@ -102,40 +102,41 @@ int convert_sps_pps( decoder_t *p_dec, const uint8_t *p_buf,
}
void
convert_h264_to_annexb
(
uint8_t
*
p_buf
,
uint32_t
i_len
,
size_t
i_nal_size
,
struct
H264ConvertState
*
state
)
size_t
i_nal_size
)
{
uint32_t
nal_len
=
0
,
nal_pos
=
0
;
if
(
i_nal_size
<
3
||
i_nal_size
>
4
)
return
;
/* This only works for NAL sizes 3-4 */
while
(
i_len
>
0
)
{
if
(
state
->
nal_pos
<
i_nal_size
)
{
if
(
nal_pos
<
i_nal_size
)
{
unsigned
int
i
;
for
(
i
=
0
;
state
->
nal_pos
<
i_nal_size
&&
i
<
i_len
;
i
++
,
state
->
nal_pos
++
)
{
state
->
nal_len
=
(
state
->
nal_len
<<
8
)
|
p_buf
[
i
];
for
(
i
=
0
;
nal_pos
<
i_nal_size
&&
i
<
i_len
;
i
++
,
nal_pos
++
)
{
nal_len
=
(
nal_len
<<
8
)
|
p_buf
[
i
];
p_buf
[
i
]
=
0
;
}
if
(
state
->
nal_pos
<
i_nal_size
)
if
(
nal_pos
<
i_nal_size
)
return
;
p_buf
[
i
-
1
]
=
1
;
p_buf
+=
i
;
i_len
-=
i
;
}
if
(
state
->
nal_len
>
INT_MAX
)
if
(
nal_len
>
INT_MAX
)
return
;
if
(
state
->
nal_len
>
i_len
)
if
(
nal_len
>
i_len
)
{
state
->
nal_len
-=
i_len
;
nal_len
-=
i_len
;
return
;
}
else
{
p_buf
+=
state
->
nal_len
;
i_len
-=
state
->
nal_len
;
state
->
nal_len
=
0
;
state
->
nal_pos
=
0
;
p_buf
+=
nal_len
;
i_len
-=
nal_len
;
nal_len
=
0
;
nal_pos
=
0
;
}
}
}
...
...
modules/packetizer/h264_nal.h
View file @
c3dec45d
...
...
@@ -120,15 +120,8 @@ int convert_sps_pps( decoder_t *p_dec, const uint8_t *p_buf,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint32_t
*
p_nal_size
);
/* Convert H.264 NAL format to annex b in-place */
struct
H264ConvertState
{
uint32_t
nal_len
;
uint32_t
nal_pos
;
};
void
convert_h264_to_annexb
(
uint8_t
*
p_buf
,
uint32_t
i_len
,
size_t
i_nal_size
,
struct
H264ConvertState
*
state
);
size_t
i_nal_size
);
/* Get the SPS/PPS pointers from an Annex B buffer
* Returns 0 if a SPS and/or a PPS is found */
...
...
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