Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] avutil/x86/intreadwrite: Add ability to detect whether MMX code is used
@ 2022-09-08 13:19 Andreas Rheinhardt
  2022-09-08 13:20 ` [FFmpeg-devel] [PATCH 2/2] avcodec/dca_core: Only call emms_c() if needed Andreas Rheinhardt
  2022-09-09 13:26 ` [FFmpeg-devel] [PATCH 1/2] avutil/x86/intreadwrite: Add ability to detect whether MMX code is used Andreas Rheinhardt
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Rheinhardt @ 2022-09-08 13:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

It can be used to call emms_c() only when needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavutil/x86/intreadwrite.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/x86/intreadwrite.h b/libavutil/x86/intreadwrite.h
index 4061d19231..40f375b013 100644
--- a/libavutil/x86/intreadwrite.h
+++ b/libavutil/x86/intreadwrite.h
@@ -29,6 +29,8 @@
 
 #if !HAVE_FAST_64BIT && defined(__MMX__)
 
+#define FF_COPY_SWAP_ZERO_USES_MMX
+
 #define AV_COPY64 AV_COPY64
 static av_always_inline void AV_COPY64(void *d, const void *s)
 {
-- 
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".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [FFmpeg-devel] [PATCH 2/2] avcodec/dca_core: Only call emms_c() if needed
  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
  2022-09-09 13:26 ` [FFmpeg-devel] [PATCH 1/2] avutil/x86/intreadwrite: Add ability to detect whether MMX code is used Andreas Rheinhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Rheinhardt @ 2022-09-08 13:20 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

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".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/2] avutil/x86/intreadwrite: Add ability to detect whether MMX code is used
  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 ` [FFmpeg-devel] [PATCH 2/2] avcodec/dca_core: Only call emms_c() if needed Andreas Rheinhardt
@ 2022-09-09 13:26 ` Andreas Rheinhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Rheinhardt @ 2022-09-09 13:26 UTC (permalink / raw)
  To: ffmpeg-devel

Andreas Rheinhardt:
> It can be used to call emms_c() only when needed.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavutil/x86/intreadwrite.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavutil/x86/intreadwrite.h b/libavutil/x86/intreadwrite.h
> index 4061d19231..40f375b013 100644
> --- a/libavutil/x86/intreadwrite.h
> +++ b/libavutil/x86/intreadwrite.h
> @@ -29,6 +29,8 @@
>  
>  #if !HAVE_FAST_64BIT && defined(__MMX__)
>  
> +#define FF_COPY_SWAP_ZERO_USES_MMX
> +
>  #define AV_COPY64 AV_COPY64
>  static av_always_inline void AV_COPY64(void *d, const void *s)
>  {

Will apply this patchset tomorrow unless there are objections.

- Andreas
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-09 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [FFmpeg-devel] [PATCH 2/2] avcodec/dca_core: Only call emms_c() if needed Andreas Rheinhardt
2022-09-09 13:26 ` [FFmpeg-devel] [PATCH 1/2] avutil/x86/intreadwrite: Add ability to detect whether MMX code is used Andreas Rheinhardt

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