diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-14 15:20:09 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-29 05:11:54 +0200 |
commit | cbb6ba2e86923349ff9c5602976bb02ffa9d3fff (patch) | |
tree | e5bee7cbe6e680cec6c9b4c29ce5feb99db4bcbe /libavcodec/h264_parse.c | |
parent | 2d5407d390728d4d4a4d8f36a8fe69ff490f54e4 (diff) | |
download | ffmpeg-cbb6ba2e86923349ff9c5602976bb02ffa9d3fff.tar.gz |
avcodec/cavsdec, h264*, hevc_parser: Use get_ue_golomb_31 where possible
instead of get_ue_golomb(). The difference between the two is that the
latter also has to take into account the case in which the read code is
more than 9 bits (four preceding zeroes + at most five value bits) long,
leading to more code.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/h264_parse.c')
-rw-r--r-- | libavcodec/h264_parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c index 352ffea948..1c1d1c04b0 100644 --- a/libavcodec/h264_parse.c +++ b/libavcodec/h264_parse.c @@ -35,7 +35,7 @@ int ff_h264_pred_weight_table(GetBitContext *gb, const SPS *sps, pwt->use_weight = 0; pwt->use_weight_chroma = 0; - pwt->luma_log2_weight_denom = get_ue_golomb(gb); + pwt->luma_log2_weight_denom = get_ue_golomb_31(gb); if (pwt->luma_log2_weight_denom > 7U) { av_log(logctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of range\n", pwt->luma_log2_weight_denom); pwt->luma_log2_weight_denom = 0; @@ -43,7 +43,7 @@ int ff_h264_pred_weight_table(GetBitContext *gb, const SPS *sps, luma_def = 1 << pwt->luma_log2_weight_denom; if (sps->chroma_format_idc) { - pwt->chroma_log2_weight_denom = get_ue_golomb(gb); + pwt->chroma_log2_weight_denom = get_ue_golomb_31(gb); if (pwt->chroma_log2_weight_denom > 7U) { av_log(logctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of range\n", pwt->chroma_log2_weight_denom); pwt->chroma_log2_weight_denom = 0; |