Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-13 01:03:45 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-13 01:03:45 +0300
commit5620ed355716896dc1feee2c2a95ab12a982e276 (patch)
tree26b890f32a805a409b8adf18031b38d7dac58554 /libavcodec/hevc.c
parent93aa84c1ea9aace875c3e853911e3a4a0ae4c32b (diff)
avcodec/hevc: Remove skipped_bytes_nal, simplify code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc.c')
-rw-r--r--libavcodec/hevc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 4d87d447eb..1efd0787a8 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2422,8 +2422,10 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
return 0;
}
-static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
+static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
{
+ const uint8_t *data = nal->data;
+ int length = nal->size;
HEVCLocalContext *lc = s->HEVClc;
int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
@@ -2452,7 +2454,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
offset = (lc->gb.index >> 3);
- for (j = 0, cmpt = 0, startheader = offset + s->sh.entry_point_offset[0]; j < s->skipped_bytes; j++) {
+ 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) {
startheader--;
cmpt++;
@@ -2462,7 +2464,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
for (i = 1; i < s->sh.num_entry_point_offsets; i++) {
offset += (s->sh.entry_point_offset[i - 1] - cmpt);
for (j = 0, cmpt = 0, startheader = offset
- + s->sh.entry_point_offset[i]; j < s->skipped_bytes; j++) {
+ + s->sh.entry_point_offset[i]; j < nal->skipped_bytes; j++) {
if (s->skipped_bytes_pos[j] >= offset && s->skipped_bytes_pos[j] < startheader) {
startheader--;
cmpt++;
@@ -2478,7 +2480,7 @@ static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
s->sh.offset[s->sh.num_entry_point_offsets - 1] = offset;
}
- s->data = nal;
+ s->data = data;
for (i = 1; i < s->threads_number; i++) {
s->sList[i]->HEVClc->first_qp_group = 1;
@@ -2720,7 +2722,7 @@ static int decode_nal_unit(HEVCContext *s, const HEVCNAL *nal)
goto fail;
} else {
if (s->threads_number > 1 && s->sh.num_entry_point_offsets > 0)
- ctb_addr_ts = hls_slice_data_wpp(s, nal->data, nal->size);
+ ctb_addr_ts = hls_slice_data_wpp(s, nal);
else
ctb_addr_ts = hls_slice_data(s);
if (ctb_addr_ts >= (s->ps.sps->ctb_width * s->ps.sps->ctb_height)) {
@@ -2779,7 +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 = s->skipped_bytes_nal[i];
s->skipped_bytes_pos = s->skipped_bytes_pos_nal[i];
ret = decode_nal_unit(s, &s->pkt.nals[i]);
@@ -2974,7 +2975,6 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
av_freep(&s->skipped_bytes_pos_nal[i]);
}
av_freep(&s->skipped_bytes_pos_size_nal);
- av_freep(&s->skipped_bytes_nal);
av_freep(&s->skipped_bytes_pos_nal);
av_freep(&s->cabac_state);