Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b7cd2ab2
Commit
b7cd2ab2
authored
May 11, 2018
by
Jun Zhao
Committed by
Jun Zhao
May 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/h2645_parse: add h264_nal_unit_name for h264 NAL type.
Signed-off-by:
Jun Zhao
<
mypopydev@gmail.com
>
parent
7582a907
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
3 deletions
+66
-3
h264.h
libavcodec/h264.h
+22
-1
h2645_parse.c
libavcodec/h2645_parse.c
+44
-2
No files found.
libavcodec/h264.h
View file @
b7cd2ab2
...
@@ -26,8 +26,12 @@
...
@@ -26,8 +26,12 @@
#define QP_MAX_NUM (51 + 6*6) // The maximum supported qp
#define QP_MAX_NUM (51 + 6*6) // The maximum supported qp
/* NAL unit types */
/*
* Table 7-1 – NAL unit type codes, syntax element categories, and NAL unit type classes in
* T-REC-H.264-201704
*/
enum
{
enum
{
H264_NAL_UNSPECIFIED
=
0
,
H264_NAL_SLICE
=
1
,
H264_NAL_SLICE
=
1
,
H264_NAL_DPA
=
2
,
H264_NAL_DPA
=
2
,
H264_NAL_DPB
=
3
,
H264_NAL_DPB
=
3
,
...
@@ -41,7 +45,24 @@ enum {
...
@@ -41,7 +45,24 @@ enum {
H264_NAL_END_STREAM
=
11
,
H264_NAL_END_STREAM
=
11
,
H264_NAL_FILLER_DATA
=
12
,
H264_NAL_FILLER_DATA
=
12
,
H264_NAL_SPS_EXT
=
13
,
H264_NAL_SPS_EXT
=
13
,
H264_NAL_PREFIX
=
14
,
H264_NAL_SUB_SPS
=
15
,
H264_NAL_DPS
=
16
,
H264_NAL_RESERVED17
=
17
,
H264_NAL_RESERVED18
=
18
,
H264_NAL_AUXILIARY_SLICE
=
19
,
H264_NAL_AUXILIARY_SLICE
=
19
,
H264_NAL_EXTEN_SLICE
=
20
,
H264_NAL_DEPTH_EXTEN_SLICE
=
21
,
H264_NAL_RESERVED22
=
22
,
H264_NAL_RESERVED23
=
23
,
H264_NAL_UNSPECIFIED24
=
24
,
H264_NAL_UNSPECIFIED25
=
25
,
H264_NAL_UNSPECIFIED26
=
26
,
H264_NAL_UNSPECIFIED27
=
27
,
H264_NAL_UNSPECIFIED28
=
28
,
H264_NAL_UNSPECIFIED29
=
29
,
H264_NAL_UNSPECIFIED30
=
30
,
H264_NAL_UNSPECIFIED31
=
31
,
};
};
...
...
libavcodec/h2645_parse.c
View file @
b7cd2ab2
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "bytestream.h"
#include "bytestream.h"
#include "hevc.h"
#include "hevc.h"
#include "h264.h"
#include "h2645_parse.h"
#include "h2645_parse.h"
int
ff_h2645_extract_rbsp
(
const
uint8_t
*
src
,
int
length
,
int
ff_h2645_extract_rbsp
(
const
uint8_t
*
src
,
int
length
,
...
@@ -218,6 +219,47 @@ static const char *hevc_nal_unit_name(int nal_type)
...
@@ -218,6 +219,47 @@ static const char *hevc_nal_unit_name(int nal_type)
return
hevc_nal_type_name
[
nal_type
];
return
hevc_nal_type_name
[
nal_type
];
}
}
static
const
char
*
h264_nal_type_name
[
32
]
=
{
"Unspecified 0"
,
//H264_NAL_UNSPECIFIED
"Coded slice of a non-IDR picture"
,
// H264_NAL_SLICE
"Coded slice data partition A"
,
// H264_NAL_DPA
"Coded slice data partition B"
,
// H264_NAL_DPB
"Coded slice data partition C"
,
// H264_NAL_DPC
"IDR"
,
// H264_NAL_IDR_SLICE
"SEI"
,
// H264_NAL_SEI
"SPS"
,
// H264_NAL_SPS
"PPS"
,
// H264_NAL_PPS
"AUD"
,
// H264_NAL_AUD
"End of sequence"
,
// H264_NAL_END_SEQUENCE
"End of stream"
,
// H264_NAL_END_STREAM
"Filler data"
,
// H264_NAL_FILLER_DATA
"SPS extension"
,
// H264_NAL_SPS_EXT
"Prefix"
,
// H264_NAL_PREFIX
"Subset SPS"
,
// H264_NAL_SUB_SPS
"Depth parameter set"
,
// H264_NAL_DPS
"Reserved 17"
,
// H264_NAL_RESERVED17
"Reserved 18"
,
// H264_NAL_RESERVED18
"Auxiliary coded picture without partitioning"
,
// H264_NAL_AUXILIARY_SLICE
"Slice extension"
,
// H264_NAL_EXTEN_SLICE
"Slice extension for a depth view or a 3D-AVC texture view"
,
// H264_NAL_DEPTH_EXTEN_SLICE
"Reserved 22"
,
// H264_NAL_RESERVED22
"Reserved 23"
,
// H264_NAL_RESERVED23
"Unspecified 24"
,
// H264_NAL_UNSPECIFIED24
"Unspecified 25"
,
// H264_NAL_UNSPECIFIED25
"Unspecified 26"
,
// H264_NAL_UNSPECIFIED26
"Unspecified 27"
,
// H264_NAL_UNSPECIFIED27
"Unspecified 28"
,
// H264_NAL_UNSPECIFIED28
"Unspecified 29"
,
// H264_NAL_UNSPECIFIED29
"Unspecified 30"
,
// H264_NAL_UNSPECIFIED30
"Unspecified 31"
,
// H264_NAL_UNSPECIFIED31
};
static
const
char
*
h264_nal_unit_name
(
int
nal_type
)
{
av_assert0
(
nal_type
>=
0
&&
nal_type
<
32
);
return
h264_nal_type_name
[
nal_type
];
}
static
int
get_bit_length
(
H2645NAL
*
nal
,
int
skip_trailing_zeros
)
static
int
get_bit_length
(
H2645NAL
*
nal
,
int
skip_trailing_zeros
)
{
{
int
size
=
nal
->
size
;
int
size
=
nal
->
size
;
...
@@ -280,8 +322,8 @@ static int h264_parse_nal_header(H2645NAL *nal, void *logctx)
...
@@ -280,8 +322,8 @@ static int h264_parse_nal_header(H2645NAL *nal, void *logctx)
nal
->
type
=
get_bits
(
gb
,
5
);
nal
->
type
=
get_bits
(
gb
,
5
);
av_log
(
logctx
,
AV_LOG_DEBUG
,
av_log
(
logctx
,
AV_LOG_DEBUG
,
"nal_unit_type: %d, nal_ref_idc: %d
\n
"
,
"nal_unit_type: %d
(%s)
, nal_ref_idc: %d
\n
"
,
nal
->
type
,
nal
->
ref_idc
);
nal
->
type
,
h264_nal_unit_name
(
nal
->
type
),
nal
->
ref_idc
);
return
1
;
return
1
;
}
}
...
...
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