diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-06-29 15:20:45 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-07-25 17:54:16 +0200 |
commit | c8d9d15f5e8194bfde538481387383918dda6ebc (patch) | |
tree | 2eaa1c84ea3500bec32e53ee27f25dc872306f95 | |
parent | 26ab6afcac05d7c1a689f354b7b48659901898f0 (diff) | |
download | ffmpeg-c8d9d15f5e8194bfde538481387383918dda6ebc.tar.gz |
avcodec/hevcdec: Don't initialize HEVCContexts twice
The slicethread contexts need to be initialized for
every frame, not only the first one, so one can
remove the initialization when allocating these contexts,
because the ordinary per-frame initialization will
initialize them again just a few lines below.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/hevcdec.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 3c95398b96..79e4c36d86 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2662,8 +2662,6 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) res = AVERROR(ENOMEM); goto error; } - memcpy(s->sList[i], s, sizeof(HEVCContext)); - s->sList[i]->HEVClc = s->HEVClcList[i]; } offset = (lc->gb.index >> 3); @@ -2702,10 +2700,10 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal) s->data = data; for (i = 1; i < s->threads_number; i++) { - s->sList[i]->HEVClc->first_qp_group = 1; - s->sList[i]->HEVClc->qp_y = s->sList[0]->HEVClc->qp_y; memcpy(s->sList[i], s, sizeof(HEVCContext)); s->sList[i]->HEVClc = s->HEVClcList[i]; + s->sList[i]->HEVClc->first_qp_group = 1; + s->sList[i]->HEVClc->qp_y = s->sList[0]->HEVClc->qp_y; } atomic_store(&s->wpp_err, 0); |