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>
This commit is contained in:
Andreas Rheinhardt
2020-07-14 15:20:09 +02:00
parent 2d5407d390
commit cbb6ba2e86
4 changed files with 16 additions and 16 deletions

View File

@@ -136,7 +136,7 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal,
for (i = 0; i < ps->pps->num_extra_slice_header_bits; i++)
skip_bits(gb, 1); // slice_reserved_undetermined_flag[]
slice_type = get_ue_golomb(gb);
slice_type = get_ue_golomb_31(gb);
if (!(slice_type == HEVC_SLICE_I || slice_type == HEVC_SLICE_P ||
slice_type == HEVC_SLICE_B)) {
av_log(avctx, AV_LOG_ERROR, "Unknown slice type: %d.\n",