Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
bf011695
Commit
bf011695
authored
Sep 07, 2016
by
Matthieu Bouron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/hevc: store VPS/SPS/PPS data
parent
7055b28d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
hevc.h
libavcodec/hevc.h
+9
-0
hevc_ps.c
libavcodec/hevc_ps.c
+36
-0
No files found.
libavcodec/hevc.h
View file @
bf011695
...
...
@@ -387,6 +387,9 @@ typedef struct HEVCVPS {
uint8_t
vps_poc_proportional_to_timing_flag
;
int
vps_num_ticks_poc_diff_one
;
///< vps_num_ticks_poc_diff_one_minus1 + 1
int
vps_num_hrd_parameters
;
uint8_t
data
[
4096
];
int
data_size
;
}
HEVCVPS
;
typedef
struct
ScalingList
{
...
...
@@ -483,6 +486,9 @@ typedef struct HEVCSPS {
int
vshift
[
3
];
int
qp_bd_offset
;
uint8_t
data
[
4096
];
int
data_size
;
}
HEVCSPS
;
typedef
struct
HEVCPPS
{
...
...
@@ -557,6 +563,9 @@ typedef struct HEVCPPS {
int
*
tile_pos_rs
;
///< TilePosRS
int
*
min_tb_addr_zs
;
///< MinTbAddrZS
int
*
min_tb_addr_zs_tab
;
///< MinTbAddrZS
uint8_t
data
[
4096
];
int
data_size
;
}
HEVCPPS
;
typedef
struct
HEVCParamSets
{
...
...
libavcodec/hevc_ps.c
View file @
bf011695
...
...
@@ -399,6 +399,7 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
{
int
i
,
j
;
int
vps_id
=
0
;
ptrdiff_t
nal_size
;
HEVCVPS
*
vps
;
AVBufferRef
*
vps_buf
=
av_buffer_allocz
(
sizeof
(
*
vps
));
...
...
@@ -408,6 +409,17 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Decoding VPS
\n
"
);
nal_size
=
gb
->
buffer_end
-
gb
->
buffer
;
if
(
nal_size
>
sizeof
(
vps
->
data
))
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Truncating likely oversized VPS "
"(%"
PTRDIFF_SPECIFIER
" > %"
SIZE_SPECIFIER
")
\n
"
,
nal_size
,
sizeof
(
vps
->
data
));
vps
->
data_size
=
sizeof
(
vps
->
data
);
}
else
{
vps
->
data_size
=
nal_size
;
}
memcpy
(
vps
->
data
,
gb
->
buffer
,
vps
->
data_size
);
vps_id
=
get_bits
(
gb
,
4
);
if
(
vps_id
>=
MAX_VPS_COUNT
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"VPS id out of range: %d
\n
"
,
vps_id
);
...
...
@@ -1177,6 +1189,7 @@ int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx,
AVBufferRef
*
sps_buf
=
av_buffer_allocz
(
sizeof
(
*
sps
));
unsigned
int
sps_id
;
int
ret
;
ptrdiff_t
nal_size
;
if
(
!
sps_buf
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -1184,6 +1197,17 @@ int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Decoding SPS
\n
"
);
nal_size
=
gb
->
buffer_end
-
gb
->
buffer
;
if
(
nal_size
>
sizeof
(
sps
->
data
))
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Truncating likely oversized SPS "
"(%"
PTRDIFF_SPECIFIER
" > %"
SIZE_SPECIFIER
")
\n
"
,
nal_size
,
sizeof
(
sps
->
data
));
sps
->
data_size
=
sizeof
(
sps
->
data
);
}
else
{
sps
->
data_size
=
nal_size
;
}
memcpy
(
sps
->
data
,
gb
->
buffer
,
sps
->
data_size
);
ret
=
ff_hevc_parse_sps
(
sps
,
gb
,
&
sps_id
,
apply_defdispwin
,
ps
->
vps_list
,
avctx
);
...
...
@@ -1407,6 +1431,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
HEVCSPS
*
sps
=
NULL
;
int
i
,
ret
=
0
;
unsigned
int
pps_id
=
0
;
ptrdiff_t
nal_size
;
AVBufferRef
*
pps_buf
;
HEVCPPS
*
pps
=
av_mallocz
(
sizeof
(
*
pps
));
...
...
@@ -1423,6 +1448,17 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
av_log
(
avctx
,
AV_LOG_DEBUG
,
"Decoding PPS
\n
"
);
nal_size
=
gb
->
buffer_end
-
gb
->
buffer
;
if
(
nal_size
>
sizeof
(
pps
->
data
))
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Truncating likely oversized PPS "
"(%"
PTRDIFF_SPECIFIER
" > %"
SIZE_SPECIFIER
")
\n
"
,
nal_size
,
sizeof
(
pps
->
data
));
pps
->
data_size
=
sizeof
(
pps
->
data
);
}
else
{
pps
->
data_size
=
nal_size
;
}
memcpy
(
pps
->
data
,
gb
->
buffer
,
pps
->
data_size
);
// Default values
pps
->
loop_filter_across_tiles_enabled_flag
=
1
;
pps
->
num_tile_columns
=
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