You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Merge commit '84f226a3bcd8b39801a4c9051c033ab7d61aaf76'
* commit '84f226a3bcd8b39801a4c9051c033ab7d61aaf76':
h264: use the correct SPS during PPS parsing
Conflicts:
libavcodec/h264_ps.c
See: dc35b77b28
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -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)
|
int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
|
||||||
{
|
{
|
||||||
|
const SPS *sps;
|
||||||
unsigned int pps_id = get_ue_golomb(&h->gb);
|
unsigned int pps_id = get_ue_golomb(&h->gb);
|
||||||
PPS *pps;
|
PPS *pps;
|
||||||
SPS *sps;
|
|
||||||
int qp_bd_offset;
|
int qp_bd_offset;
|
||||||
int bits_left;
|
int bits_left;
|
||||||
|
|
||||||
@@ -605,7 +605,6 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
sps = h->sps_buffers[pps->sps_id];
|
sps = h->sps_buffers[pps->sps_id];
|
||||||
qp_bd_offset = 6 * (sps->bit_depth_luma - 8);
|
|
||||||
if (sps->bit_depth_luma > 14) {
|
if (sps->bit_depth_luma > 14) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
"Invalid luma bit depth=%d\n",
|
"Invalid luma bit depth=%d\n",
|
||||||
@@ -663,6 +662,8 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qp_bd_offset = 6 * (sps->bit_depth_luma - 8);
|
||||||
|
|
||||||
pps->weighted_pred = get_bits1(&h->gb);
|
pps->weighted_pred = get_bits1(&h->gb);
|
||||||
pps->weighted_bipred_idc = get_bits(&h->gb, 2);
|
pps->weighted_bipred_idc = get_bits(&h->gb, 2);
|
||||||
pps->init_qp = get_se_golomb(&h->gb) + 26 + qp_bd_offset;
|
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];
|
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, 0, pps->chroma_qp_index_offset[0],
|
||||||
build_qp_table(pps, 1, pps->chroma_qp_index_offset[1], sps->bit_depth_luma);
|
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])
|
if (pps->chroma_qp_index_offset[0] != pps->chroma_qp_index_offset[1])
|
||||||
pps->chroma_qp_diff = 1;
|
pps->chroma_qp_diff = 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user