This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit e41799d6ec1bdc89b102f0add9b5b5c347e16e5b Author: Andreas Rheinhardt <[email protected]> AuthorDate: Fri Mar 20 03:06:38 2026 +0100 Commit: Andreas Rheinhardt <[email protected]> CommitDate: Tue Mar 24 18:09:43 2026 +0100 avcodec/vvc: Use static_assert where appropriate Reviewed-by: Frank Plowman <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/vvc/cabac.c | 7 +++++-- libavcodec/vvc/filter.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libavcodec/vvc/cabac.c b/libavcodec/vvc/cabac.c index c2dbd46709..e386cdf4c8 100644 --- a/libavcodec/vvc/cabac.c +++ b/libavcodec/vvc/cabac.c @@ -19,6 +19,9 @@ * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include <assert.h> + #include "libavcodec/cabac_functions.h" #include "cabac.h" @@ -108,6 +111,8 @@ enum SyntaxElement { SYNTAX_ELEMENT_LAST = COEFF_SIGN_FLAG + 6, }; +static_assert(VVC_CONTEXTS == SYNTAX_ELEMENT_LAST, "VVC_CONTEXTS wrong"); + static const uint8_t init_values[4][SYNTAX_ELEMENT_LAST] = { { //alf_ctb_flag @@ -817,8 +822,6 @@ static void cabac_init_state(VVCLocalContext *lc) const int qp = av_clip_uintp2(lc->sc->sh.slice_qp_y, 6); int init_type = 2 - rsh->sh_slice_type; - av_assert0(VVC_CONTEXTS == SYNTAX_ELEMENT_LAST); - ff_vvc_ep_init_stat_coeff(lc->ep, sps->bit_depth, sps->r->sps_persistent_rice_adaptation_enabled_flag); if (rsh->sh_cabac_init_flag && !IS_I(rsh)) diff --git a/libavcodec/vvc/filter.c b/libavcodec/vvc/filter.c index 3815668bcf..b99901e219 100644 --- a/libavcodec/vvc/filter.c +++ b/libavcodec/vvc/filter.c @@ -19,6 +19,9 @@ * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include <assert.h> + #include "libavutil/frame.h" #include "libavutil/imgutils.h" @@ -1029,8 +1032,8 @@ static void alf_filter_luma(VVCLocalContext *lc, uint8_t *dst, const uint8_t *sr int16_t *coeff = (int16_t*)lc->tmp; int16_t *clip = (int16_t *)lc->tmp1; - av_assert0(ALF_MAX_FILTER_SIZE <= sizeof(lc->tmp)); - av_assert0(ALF_MAX_FILTER_SIZE * sizeof(int16_t) <= sizeof(lc->tmp1)); + static_assert(ALF_MAX_FILTER_SIZE <= sizeof(lc->tmp), "VVCLocalContext.tmp too small"); + static_assert(ALF_MAX_FILTER_SIZE * sizeof(int16_t) <= sizeof(lc->tmp1), "VVCLocalContext.tmp1 too small"); alf_get_coeff_and_clip(lc, coeff, clip, src, src_stride, width, height, vb_pos, alf); fc->vvcdsp.alf.filter[LUMA](dst, dst_stride, src, src_stride, width, height, coeff, clip, vb_pos); _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
