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
879330c5
Commit
879330c5
authored
Jun 21, 2016
by
Benoit Fouet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: make H264ParamSets sps const
parent
4cc1ce4a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
9 deletions
+8
-9
h264.h
libavcodec/h264.h
+1
-2
h264_parser.c
libavcodec/h264_parser.c
+1
-1
h264_ps.c
libavcodec/h264_ps.c
+2
-2
h264_sei.c
libavcodec/h264_sei.c
+2
-2
h264_slice.c
libavcodec/h264_slice.c
+2
-2
No files found.
libavcodec/h264.h
View file @
879330c5
...
...
@@ -234,8 +234,7 @@ typedef struct H264ParamSets {
AVBufferRef
*
sps_ref
;
/* currently active parameters sets */
const
PPS
*
pps
;
// FIXME this should properly be const
SPS
*
sps
;
const
SPS
*
sps
;
}
H264ParamSets
;
/**
...
...
libavcodec/h264_parser.c
View file @
879330c5
...
...
@@ -373,7 +373,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
"non-existing SPS %u referenced
\n
"
,
p
->
ps
.
pps
->
sps_id
);
goto
fail
;
}
p
->
ps
.
sps
=
(
SPS
*
)
p
->
ps
.
sps_list
[
p
->
ps
.
pps
->
sps_id
]
->
data
;
p
->
ps
.
sps
=
(
const
SPS
*
)
p
->
ps
.
sps_list
[
p
->
ps
.
pps
->
sps_id
]
->
data
;
sps
=
p
->
ps
.
sps
;
...
...
libavcodec/h264_ps.c
View file @
879330c5
...
...
@@ -712,7 +712,7 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
H264ParamSets
*
ps
,
int
bit_length
)
{
AVBufferRef
*
pps_buf
;
SPS
*
sps
;
const
SPS
*
sps
;
unsigned
int
pps_id
=
get_ue_golomb
(
gb
);
PPS
*
pps
;
int
qp_bd_offset
;
...
...
@@ -743,7 +743,7 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
ret
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
sps
=
(
SPS
*
)
ps
->
sps_list
[
pps
->
sps_id
]
->
data
;
sps
=
(
const
SPS
*
)
ps
->
sps_list
[
pps
->
sps_id
]
->
data
;
if
(
sps
->
bit_depth_luma
>
14
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid luma bit depth=%d
\n
"
,
...
...
libavcodec/h264_sei.c
View file @
879330c5
...
...
@@ -278,7 +278,7 @@ static int decode_buffering_period(H264SEIBufferingPeriod *h, GetBitContext *gb,
{
unsigned
int
sps_id
;
int
sched_sel_idx
;
SPS
*
sps
;
const
SPS
*
sps
;
sps_id
=
get_ue_golomb_31
(
gb
);
if
(
sps_id
>
31
||
!
ps
->
sps_list
[
sps_id
])
{
...
...
@@ -286,7 +286,7 @@ static int decode_buffering_period(H264SEIBufferingPeriod *h, GetBitContext *gb,
"non-existing SPS %d referenced in buffering period
\n
"
,
sps_id
);
return
sps_id
>
31
?
AVERROR_INVALIDDATA
:
AVERROR_PS_NOT_FOUND
;
}
sps
=
(
SPS
*
)
ps
->
sps_list
[
sps_id
]
->
data
;
sps
=
(
const
SPS
*
)
ps
->
sps_list
[
sps_id
]
->
data
;
// NOTE: This is really so duplicated in the standard... See H.264, D.1.1
if
(
sps
->
nal_hrd_parameters_present_flag
)
{
...
...
libavcodec/h264_slice.c
View file @
879330c5
...
...
@@ -356,7 +356,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
h
->
ps
.
sps_ref
=
av_buffer_ref
(
h1
->
ps
.
sps_ref
);
if
(
!
h
->
ps
.
sps_ref
)
return
AVERROR
(
ENOMEM
);
h
->
ps
.
sps
=
(
SPS
*
)
h
->
ps
.
sps_ref
->
data
;
h
->
ps
.
sps
=
(
const
SPS
*
)
h
->
ps
.
sps_ref
->
data
;
}
if
(
need_reinit
||
!
inited
)
{
...
...
@@ -873,7 +873,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
/* export coded and cropped frame dimensions to AVCodecContext */
static
int
init_dimensions
(
H264Context
*
h
)
{
SPS
*
sps
=
h
->
ps
.
sps
;
const
SPS
*
sps
=
(
const
SPS
*
)
h
->
ps
.
sps
;
int
width
=
h
->
width
-
(
sps
->
crop_right
+
sps
->
crop_left
);
int
height
=
h
->
height
-
(
sps
->
crop_top
+
sps
->
crop_bottom
);
av_assert0
(
sps
->
crop_right
+
sps
->
crop_left
<
(
unsigned
)
h
->
width
);
...
...
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