summaryrefslogtreecommitdiff
path: root/libavcodec/hevc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-13 00:52:18 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-13 01:09:21 +0200
commit99558270ed1e1c0d8906439b47085860ee0b08bd (patch)
tree1ce2a0eb9ea06f631ca19beeface093a6d76b8b6 /libavcodec/hevc.c
parentad92410d900b985cdabc499f0badaad72dd5ea2d (diff)
avcodec/hevc: Simplify skipped_bytes_pos code further
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 63a2c2f66d..fa5a505189 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2455,7 +2455,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
offset = (lc->gb.index >> 3);
for (j = 0, cmpt = 0, startheader = offset + s->sh.entry_point_offset[0]; j < nal->skipped_bytes; j++) {
- if (s->skipped_bytes_pos[j] >= offset && s->skipped_bytes_pos[j] < startheader) {
+ if (nal->skipped_bytes_pos[j] >= offset && nal->skipped_bytes_pos[j] < startheader) {
startheader--;
cmpt++;
}
@@ -2465,7 +2465,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
offset += (s->sh.entry_point_offset[i - 1] - cmpt);
for (j = 0, cmpt = 0, startheader = offset
+ s->sh.entry_point_offset[i]; j < nal->skipped_bytes; j++) {
- if (s->skipped_bytes_pos[j] >= offset && s->skipped_bytes_pos[j] < startheader) {
+ if (nal->skipped_bytes_pos[j] >= offset && nal->skipped_bytes_pos[j] < startheader) {
startheader--;
cmpt++;
}
@@ -2781,8 +2781,6 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
/* decode the NAL units */
for (i = 0; i < s->pkt.nb_nals; i++) {
- s->skipped_bytes_pos = s->pkt.nals[i].skipped_bytes_pos_nal;
-
ret = decode_nal_unit(s, &s->pkt.nals[i]);
if (ret < 0) {
av_log(s->avctx, AV_LOG_WARNING,
@@ -3011,7 +3009,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
for (i = 0; i < s->pkt.nals_allocated; i++) {
av_freep(&s->pkt.nals[i].rbsp_buffer);
- av_freep(&s->pkt.nals[i].skipped_bytes_pos_nal);
+ av_freep(&s->pkt.nals[i].skipped_bytes_pos);
}
av_freep(&s->pkt.nals);
s->pkt.nals_allocated = 0;