diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 17:13:24 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 17:13:24 +0100 |
commit | 55215383dc04365935c86f8a4db7b5396f1e3541 (patch) | |
tree | 416380f73859591236b30e05a5213f66525c6822 /libavcodec/h264.c | |
parent | 727b202330712eb981eb008b1e7a936d71092f71 (diff) | |
parent | f42485dbce614b3f63182845da43db690b427b7c (diff) | |
download | ffmpeg-55215383dc04365935c86f8a4db7b5396f1e3541.tar.gz |
Merge commit 'f42485dbce614b3f63182845da43db690b427b7c'
* commit 'f42485dbce614b3f63182845da43db690b427b7c':
h264: use a separate GetBitContext for slice data
Conflicts:
libavcodec/h264.c
libavcodec/h264_cavlc.c
libavcodec/h264_parser.c
libavcodec/h264_slice.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 1c71e3fb8a..a68a911cd4 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1010,9 +1010,9 @@ int ff_pred_weight_table(H264Context *h, H264SliceContext *sl) sl->use_weight = 0; sl->use_weight_chroma = 0; - sl->luma_log2_weight_denom = get_ue_golomb(&h->gb); + sl->luma_log2_weight_denom = get_ue_golomb(&sl->gb); if (h->sps.chroma_format_idc) - sl->chroma_log2_weight_denom = get_ue_golomb(&h->gb); + sl->chroma_log2_weight_denom = get_ue_golomb(&sl->gb); if (sl->luma_log2_weight_denom > 7U) { av_log(h->avctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of range\n", sl->luma_log2_weight_denom); @@ -1032,10 +1032,10 @@ int ff_pred_weight_table(H264Context *h, H264SliceContext *sl) for (i = 0; i < sl->ref_count[list]; i++) { int luma_weight_flag, chroma_weight_flag; - luma_weight_flag = get_bits1(&h->gb); + luma_weight_flag = get_bits1(&sl->gb); if (luma_weight_flag) { - sl->luma_weight[i][list][0] = get_se_golomb(&h->gb); - sl->luma_weight[i][list][1] = get_se_golomb(&h->gb); + sl->luma_weight[i][list][0] = get_se_golomb(&sl->gb); + sl->luma_weight[i][list][1] = get_se_golomb(&sl->gb); if (sl->luma_weight[i][list][0] != luma_def || sl->luma_weight[i][list][1] != 0) { sl->use_weight = 1; @@ -1047,12 +1047,12 @@ int ff_pred_weight_table(H264Context *h, H264SliceContext *sl) } if (h->sps.chroma_format_idc) { - chroma_weight_flag = get_bits1(&h->gb); + chroma_weight_flag = get_bits1(&sl->gb); if (chroma_weight_flag) { int j; for (j = 0; j < 2; j++) { - sl->chroma_weight[i][list][j][0] = get_se_golomb(&h->gb); - sl->chroma_weight[i][list][j][1] = get_se_golomb(&h->gb); + sl->chroma_weight[i][list][j][0] = get_se_golomb(&sl->gb); + sl->chroma_weight[i][list][j][1] = get_se_golomb(&sl->gb); if (sl->chroma_weight[i][list][j][0] != chroma_def || sl->chroma_weight[i][list][j][1] != 0) { sl->use_weight_chroma = 1; @@ -1307,13 +1307,13 @@ int ff_set_ref_count(H264Context *h, H264SliceContext *sl) max[0] = max[1] = h->picture_structure == PICT_FRAME ? 15 : 31; if (sl->slice_type_nos == AV_PICTURE_TYPE_B) - sl->direct_spatial_mv_pred = get_bits1(&h->gb); - num_ref_idx_active_override_flag = get_bits1(&h->gb); + sl->direct_spatial_mv_pred = get_bits1(&sl->gb); + num_ref_idx_active_override_flag = get_bits1(&sl->gb); if (num_ref_idx_active_override_flag) { - ref_count[0] = get_ue_golomb(&h->gb) + 1; + ref_count[0] = get_ue_golomb(&sl->gb) + 1; if (sl->slice_type_nos == AV_PICTURE_TYPE_B) { - ref_count[1] = get_ue_golomb(&h->gb) + 1; + ref_count[1] = get_ue_golomb(&sl->gb) + 1; } else // full range is spec-ok in this case, even for frames ref_count[1] = 1; @@ -1569,7 +1569,7 @@ again: idr_cleared = 1; h->has_recovery_point = 1; case NAL_SLICE: - init_get_bits(&hx->gb, ptr, bit_length); + init_get_bits(&sl->gb, ptr, bit_length); if ((err = ff_h264_decode_slice_header(hx, sl, h))) break; |