From 0a629df0a81e5a4a75eec94d03e4c6965236265c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sun, 8 Feb 2026 21:48:56 +0100 Subject: [PATCH] avcodec/ratecontrol: Move emms_c() to the only callsite needing it Namely to one of the three callsites in snowenc.c. Signed-off-by: Andreas Rheinhardt --- libavcodec/ratecontrol.c | 2 -- libavcodec/snowenc.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index a789277c9f..d48ede909c 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -26,7 +26,6 @@ */ #include "libavutil/attributes.h" -#include "libavutil/emms.h" #include "libavutil/internal.h" #include "libavutil/mem.h" @@ -924,7 +923,6 @@ float ff_rate_estimate_qscale(MPVMainEncContext *const m, int dry_run) double rate_factor; int64_t var; const int pict_type = s->c.pict_type; - emms_c(); get_qminmax(&qmin, &qmax, m, pict_type); diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index abb452c1ef..20a41f11a4 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -1700,6 +1700,7 @@ static int ratecontrol_1pass(SnowEncContext *enc, AVFrame *pict) coef_sum+= abs(buf[x+y*stride]) * qdiv >> 16; } } + emms_c(); /* ugly, ratecontrol just takes a sqrt again */ av_assert0(coef_sum < INT_MAX);