aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer2015-04-05 20:43:32 +0200
committerMichael Niedermayer2015-04-05 20:48:14 +0200
commitcde98920da78801a40f9120cfef650ac05a22224 (patch)
tree928fd16b1392ccc810fcc480dd5d407e6397a47d
parent0968180f028a3afdf60e030084753164df0adb5b (diff)
parent84f226a3bcd8b39801a4c9051c033ab7d61aaf76 (diff)
Merge commit '84f226a3bcd8b39801a4c9051c033ab7d61aaf76'
* commit '84f226a3bcd8b39801a4c9051c033ab7d61aaf76': h264: use the correct SPS during PPS parsing Conflicts: libavcodec/h264_ps.c See: dc35b77b28f40c99d27c073fe2c22219ba600202 Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264_ps.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 7174d5b775..362b8ea15f 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -584,9 +584,9 @@ static int more_rbsp_data_in_pps(H264Context *h, PPS *pps)
int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
{
+ const SPS *sps;
unsigned int pps_id = get_ue_golomb(&h->gb);
PPS *pps;
- SPS *sps;
int qp_bd_offset;
int bits_left;
@@ -605,7 +605,6 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
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",
@@ -663,6 +662,8 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
goto fail;
}
+ qp_bd_offset = 6 * (sps->bit_depth_luma - 8);
+
pps->weighted_pred = get_bits1(&h->gb);
pps->weighted_bipred_idc = get_bits(&h->gb, 2);
pps->init_qp = get_se_golomb(&h->gb) + 26 + qp_bd_offset;
@@ -691,8 +692,10 @@ 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], sps->bit_depth_luma);
- build_qp_table(pps, 1, pps->chroma_qp_index_offset[1], 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;