From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6F55B4B5C8 for ; Sun, 9 Jun 2024 08:25:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CC31768D763; Sun, 9 Jun 2024 11:25:25 +0300 (EEST) Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 43F5C68D73D for ; Sun, 9 Jun 2024 11:25:16 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id E100EC02F9 for ; Sun, 9 Jun 2024 11:25:15 +0300 (EEST) From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 9 Jun 2024 11:25:15 +0300 Message-ID: <20240609082515.1325134-4-remi@remlab.net> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240609082515.1325134-1-remi@remlab.net> References: <20240609082515.1325134-1-remi@remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] lavc/mpv_enc: rationalize dct_quantize init X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On entry the function pointer is always NULL. We just need to set the pointer before probing x86 CPU optimisations. Note that there is a third code path setting this function pointer, but it does so *after* calling this function: the DNxHD encoder. --- libavcodec/mpegvideo_enc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index af04db70d8..49eed6301b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -371,14 +371,13 @@ static void mpv_encode_defaults(MpegEncContext *s) av_cold int ff_dct_encode_init(MpegEncContext *s) { + s->dct_quantize = dct_quantize_c; #if ARCH_X86 ff_dct_encode_init_x86(s); #endif if (CONFIG_H263_ENCODER) ff_h263dsp_init(&s->h263dsp); - if (!s->dct_quantize) - s->dct_quantize = dct_quantize_c; if (!s->denoise_dct) s->denoise_dct = denoise_dct_c; s->fast_dct_quantize = s->dct_quantize; -- 2.45.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".