diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-26 15:04:29 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-26 15:04:29 +0100 |
commit | ee38234c43b6b3280304be7a43dc569cef683c43 (patch) | |
tree | d8988b87ec816f608ac38eb18a2d236220a3ac8a /libavcodec/h264.c | |
parent | 79aafd43fd255fc04e4f4db4c45d6d1f5a9b9fff (diff) | |
parent | e481458bc308ee838deaeacac51929514762e7a7 (diff) |
Merge commit 'e481458bc308ee838deaeacac51929514762e7a7'
* commit 'e481458bc308ee838deaeacac51929514762e7a7':
h264: factor out pred weight table parsing into a separate file
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 88768af733..22375aa2db 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -999,78 +999,6 @@ static void decode_postinit(H264Context *h, int setup_finished) } } -int ff_pred_weight_table(H264Context *h, H264SliceContext *sl) -{ - int list, i; - int luma_def, chroma_def; - - sl->use_weight = 0; - sl->use_weight_chroma = 0; - sl->luma_log2_weight_denom = get_ue_golomb(&sl->gb); - if (h->sps.chroma_format_idc) - 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); - sl->luma_log2_weight_denom = 0; - } - if (sl->chroma_log2_weight_denom > 7U) { - av_log(h->avctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of range\n", sl->chroma_log2_weight_denom); - sl->chroma_log2_weight_denom = 0; - } - - luma_def = 1 << sl->luma_log2_weight_denom; - chroma_def = 1 << sl->chroma_log2_weight_denom; - - for (list = 0; list < 2; list++) { - sl->luma_weight_flag[list] = 0; - sl->chroma_weight_flag[list] = 0; - for (i = 0; i < sl->ref_count[list]; i++) { - int luma_weight_flag, chroma_weight_flag; - - luma_weight_flag = get_bits1(&sl->gb); - if (luma_weight_flag) { - 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; - sl->luma_weight_flag[list] = 1; - } - } else { - sl->luma_weight[i][list][0] = luma_def; - sl->luma_weight[i][list][1] = 0; - } - - if (h->sps.chroma_format_idc) { - 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(&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; - sl->chroma_weight_flag[list] = 1; - } - } - } else { - int j; - for (j = 0; j < 2; j++) { - sl->chroma_weight[i][list][j][0] = chroma_def; - sl->chroma_weight[i][list][j][1] = 0; - } - } - } - } - if (sl->slice_type_nos != AV_PICTURE_TYPE_B) - break; - } - sl->use_weight = sl->use_weight || sl->use_weight_chroma; - return 0; -} - /** * instantaneous decoder refresh. */ |