[FFmpeg-cvslog] avcodec/hevc: Simplify entry_point_offset parsing
Michael Niedermayer
git at videolan.org
Wed May 13 14:33:36 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed May 13 13:24:36 2015 +0200| [6679d5f29a1719b6aa53b74649e8b199bf562f53] | committer: Michael Niedermayer
avcodec/hevc: Simplify entry_point_offset parsing
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6679d5f29a1719b6aa53b74649e8b199bf562f53
---
libavcodec/hevc.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 54cb341..459030c 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -717,8 +717,6 @@ static int hls_slice_header(HEVCContext *s)
sh->num_entry_point_offsets = num_entry_point_offsets;
if (sh->num_entry_point_offsets > 0) {
int offset_len = get_ue_golomb_long(gb) + 1;
- int segments = offset_len >> 4;
- int rest = (offset_len & 15);
if (offset_len < 1 || offset_len > 32) {
sh->num_entry_point_offsets = 0;
@@ -738,15 +736,7 @@ static int hls_slice_header(HEVCContext *s)
return AVERROR(ENOMEM);
}
for (i = 0; i < sh->num_entry_point_offsets; i++) {
- int val = 0;
- for (j = 0; j < segments; j++) {
- val <<= 16;
- val += get_bits(gb, 16);
- }
- if (rest) {
- val <<= rest;
- val += get_bits(gb, rest);
- }
+ unsigned val = get_bits_long(gb, offset_len);
sh->entry_point_offset[i] = val + 1; // +1; // +1 to get the size
}
if (s->threads_number > 1 && (s->pps->num_tile_rows > 1 || s->pps->num_tile_columns > 1)) {
More information about the ffmpeg-cvslog
mailing list