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
dc35b77b
Commit
dc35b77b
authored
May 05, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ff_h264_decode_picture_parameter_set: use the correct sps
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7c23922c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
h264_ps.c
libavcodec/h264_ps.c
+13
-9
No files found.
libavcodec/h264_ps.c
View file @
dc35b77b
...
...
@@ -580,18 +580,13 @@ static int more_rbsp_data_in_pps(H264Context *h, PPS *pps)
int
ff_h264_decode_picture_parameter_set
(
H264Context
*
h
,
int
bit_length
){
unsigned
int
pps_id
=
get_ue_golomb
(
&
h
->
gb
);
PPS
*
pps
;
const
int
qp_bd_offset
=
6
*
(
h
->
sps
.
bit_depth_luma
-
8
);
SPS
*
sps
;
int
qp_bd_offset
;
int
bits_left
;
if
(
pps_id
>=
MAX_PPS_COUNT
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"pps_id (%d) out of range
\n
"
,
pps_id
);
return
-
1
;
}
else
if
(
h
->
sps
.
bit_depth_luma
>
14
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Invalid luma bit depth=%d
\n
"
,
h
->
sps
.
bit_depth_luma
);
return
AVERROR_INVALIDDATA
;
}
else
if
(
h
->
sps
.
bit_depth_luma
==
11
||
h
->
sps
.
bit_depth_luma
==
13
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Unimplemented luma bit depth=%d
\n
"
,
h
->
sps
.
bit_depth_luma
);
return
AVERROR_PATCHWELCOME
;
}
pps
=
av_mallocz
(
sizeof
(
PPS
));
...
...
@@ -602,6 +597,15 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"sps_id out of range
\n
"
);
goto
fail
;
}
sps
=
h
->
sps_buffers
[
pps
->
sps_id
];
qp_bd_offset
=
6
*
(
sps
->
bit_depth_luma
-
8
);
if
(
sps
->
bit_depth_luma
>
14
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Invalid luma bit depth=%d
\n
"
,
sps
->
bit_depth_luma
);
return
AVERROR_INVALIDDATA
;
}
else
if
(
sps
->
bit_depth_luma
==
11
||
sps
->
bit_depth_luma
==
13
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"Unimplemented luma bit depth=%d
\n
"
,
sps
->
bit_depth_luma
);
return
AVERROR_PATCHWELCOME
;
}
pps
->
cabac
=
get_bits1
(
&
h
->
gb
);
pps
->
pic_order_present
=
get_bits1
(
&
h
->
gb
);
...
...
@@ -673,8 +677,8 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){
pps
->
chroma_qp_index_offset
[
1
]
=
pps
->
chroma_qp_index_offset
[
0
];
}
build_qp_table
(
pps
,
0
,
pps
->
chroma_qp_index_offset
[
0
],
h
->
sps
.
bit_depth_luma
);
build_qp_table
(
pps
,
1
,
pps
->
chroma_qp_index_offset
[
1
],
h
->
sps
.
bit_depth_luma
);
build_qp_table
(
pps
,
0
,
pps
->
chroma_qp_index_offset
[
0
],
sps
->
bit_depth_luma
);
build_qp_table
(
pps
,
1
,
pps
->
chroma_qp_index_offset
[
1
],
sps
->
bit_depth_luma
);
if
(
pps
->
chroma_qp_index_offset
[
0
]
!=
pps
->
chroma_qp_index_offset
[
1
])
pps
->
chroma_qp_diff
=
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