Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/dca_core: Only call emms_c() if needed
Date: Thu,  8 Sep 2022 15:20:27 +0200
Message-ID: <AS8P250MB0744D6B2B5C9061B99B004EE8F409@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB07444CED33F8E1BBAFF2E4F58F409@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>

It is not needed on x64, because the AV_COPY* and AV_ZERO*
macros never use MMX on x64.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/dca_core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c
index 1655116eed..bbf36ea678 100644
--- a/libavcodec/dca_core.c
+++ b/libavcodec/dca_core.c
@@ -767,7 +767,9 @@ static void erase_adpcm_history(DCACoreDecoder *s)
         for (band = 0; band < DCA_SUBBANDS; band++)
             AV_ZERO128(s->subband_samples[ch][band] - DCA_ADPCM_COEFFS);
 
+#ifdef FF_COPY_SWAP_ZERO_USES_MMX
     emms_c();
+#endif
 }
 
 static int alloc_sample_buffer(DCACoreDecoder *s)
@@ -831,7 +833,9 @@ static int parse_frame_data(DCACoreDecoder *s, enum HeaderType header, int xch_b
         }
     }
 
+#ifdef FF_COPY_SWAP_ZERO_USES_MMX
     emms_c();
+#endif
 
     return 0;
 }
@@ -1276,7 +1280,9 @@ static void erase_x96_adpcm_history(DCACoreDecoder *s)
         for (band = 0; band < DCA_SUBBANDS_X96; band++)
             AV_ZERO128(s->x96_subband_samples[ch][band] - DCA_ADPCM_COEFFS);
 
+#ifdef FF_COPY_SWAP_ZERO_USES_MMX
     emms_c();
+#endif
 }
 
 static int alloc_x96_sample_buffer(DCACoreDecoder *s)
@@ -1506,7 +1512,9 @@ static int parse_x96_frame_data(DCACoreDecoder *s, int exss, int xch_base)
         }
     }
 
+#ifdef FF_COPY_SWAP_ZERO_USES_MMX
     emms_c();
+#endif
 
     return 0;
 }
-- 
2.34.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".

  reply	other threads:[~2022-09-08 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 13:19 [FFmpeg-devel] [PATCH 1/2] avutil/x86/intreadwrite: Add ability to detect whether MMX code is used Andreas Rheinhardt
2022-09-08 13:20 ` Andreas Rheinhardt [this message]
2022-09-09 13:26 ` Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS8P250MB0744D6B2B5C9061B99B004EE8F409@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git