[FFmpeg-devel] [PATCH 1/3] lavc/hevcdec: remove a duplicate variable

Anton Khirnov anton at khirnov.net
Tue Sep 10 09:39:41 EEST 2024


In hls_decode_entry_wpp(), self_id is always identical to thread.
---
 libavcodec/hevc/hevcdec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index c8c425fd71..993349b678 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -2587,9 +2587,9 @@ static int hls_decode_entry(HEVCContext *s, GetBitContext *gb)
 }
 
 static int hls_decode_entry_wpp(AVCodecContext *avctx, void *hevc_lclist,
-                                int job, int self_id)
+                                int job, int thread)
 {
-    HEVCLocalContext *lc = &((HEVCLocalContext*)hevc_lclist)[self_id];
+    HEVCLocalContext *lc = &((HEVCLocalContext*)hevc_lclist)[thread];
     const HEVCContext *const s = lc->parent;
     const HEVCLayerContext *const l = &s->layers[s->cur_layer];
     const HEVCPPS   *const pps = s->pps;
@@ -2599,7 +2599,6 @@ static int hls_decode_entry_wpp(AVCodecContext *avctx, void *hevc_lclist,
     int ctb_row = job;
     int ctb_addr_rs = s->sh.slice_ctb_addr_rs + ctb_row * ((sps->width + ctb_size - 1) >> sps->log2_ctb_size);
     int ctb_addr_ts = pps->ctb_addr_rs_to_ts[ctb_addr_rs];
-    int thread = ctb_row % avctx->thread_count;
 
     const uint8_t *data      = s->data + s->sh.offset[ctb_row];
     const size_t   data_size = s->sh.size[ctb_row];
-- 
2.43.0



More information about the ffmpeg-devel mailing list