From 136ada2fc372e8fd2dcdc2b3b7256529ebcbe275 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 29 Jun 2022 17:47:06 +0200 Subject: avcodec/hevc_mvs: Pass HEVCLocalContext when slice-threading The HEVC decoder has both HEVCContext and HEVCLocalContext structures. The latter is supposed to be the structure containing the per-slicethread state. Yet that is not how it is handled in practice: Each HEVCLocalContext has a unique HEVCContext allocated for it and each of these coincides except in exactly one field: The corresponding HEVCLocalContext. This makes it possible to pass the HEVCContext everywhere where logically a HEVCLocalContext should be used. This commit stops doing this for lavc/hevc_mvs.c; it also constifies everything that is possible in order to ensure that no slice thread accidentally modifies the main HEVCContext state. Reviewed-by: Anton Khirnov Signed-off-by: Andreas Rheinhardt --- libavcodec/hevcdec.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavcodec/hevcdec.h') diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index 271a55df2f..3bb3fdb90a 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -667,12 +667,12 @@ void ff_hevc_bump_frame(HEVCContext *s); void ff_hevc_unref_frame(HEVCContext *s, HEVCFrame *frame, int flags); -void ff_hevc_set_neighbour_available(HEVCContext *s, int x0, int y0, +void ff_hevc_set_neighbour_available(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH); -void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, +void ff_hevc_luma_mv_merge_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv); -void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, +void ff_hevc_luma_mv_mvp_mode(HEVCLocalContext *lc, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv, int mvp_lx_flag, int LX); -- cgit v1.2.3