diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-06-29 19:02:41 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-07-25 23:31:37 +0200 |
commit | 8c4f95e1e1488bbbaca19bc6c6214393136e1b51 (patch) | |
tree | 704d8dd506528d9731a2ef2355ad014ec2138853 /libavcodec/hevcdec.h | |
parent | 136ada2fc372e8fd2dcdc2b3b7256529ebcbe275 (diff) | |
download | ffmpeg-8c4f95e1e1488bbbaca19bc6c6214393136e1b51.tar.gz |
avcodec/hevc_filter: 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 with the main HEVCContext 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_filter.c; it also constifies
everything that is possible in order to ensure that no slice thread
accidentally modifies the main HEVCContext state.
There are places where this was not possible, namely with the SAOParams
in sao_filter_CTB() or with sao_pixels_buffer_h in copy_CTB_to_hv().
Both of these instances lead to data races, see
https://fate.ffmpeg.org/report.cgi?time=20220629145651&slot=x86_64-archlinux-gcc-tsan-slices
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/hevcdec.h')
-rw-r--r-- | libavcodec/hevcdec.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index 3bb3fdb90a..e2dba54f26 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -676,16 +676,16 @@ 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); -void ff_hevc_set_qPy(HEVCContext *s, int xBase, int yBase, +void ff_hevc_hls_filter(HEVCLocalContext *lc, int x, int y, int ctb_size); +void ff_hevc_hls_filters(HEVCLocalContext *lc, int x_ctb, int y_ctb, int ctb_size); +void ff_hevc_set_qPy(HEVCLocalContext *lc, int xBase, int yBase, int log2_cb_size); -void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, +void ff_hevc_deblocking_boundary_strengths(HEVCLocalContext *lc, int x0, int y0, int log2_trafo_size); int ff_hevc_cu_qp_delta_sign_flag(HEVCContext *s); int ff_hevc_cu_qp_delta_abs(HEVCContext *s); int ff_hevc_cu_chroma_qp_offset_flag(HEVCContext *s); int ff_hevc_cu_chroma_qp_offset_idx(HEVCContext *s); -void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size); -void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size); void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx); |