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] swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure.
@ 2024-07-25  9:39 Shiyou Yin
  2024-07-25 10:01 ` 陈昊
  0 siblings, 1 reply; 3+ messages in thread
From: Shiyou Yin @ 2024-07-25  9:39 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libswscale/loongarch/swscale_init_loongarch.c | 104 +++++++++---------
 libswscale/loongarch/yuv2rgb_lasx.c           |   4 +-
 2 files changed, 56 insertions(+), 52 deletions(-)

diff --git a/libswscale/loongarch/swscale_init_loongarch.c b/libswscale/loongarch/swscale_init_loongarch.c
index 4af62ad9f8..2a95ede6d9 100644
--- a/libswscale/loongarch/swscale_init_loongarch.c
+++ b/libswscale/loongarch/swscale_init_loongarch.c
@@ -112,60 +112,64 @@ av_cold SwsFunc ff_yuv2rgb_init_loongarch(SwsContext *c)
     int cpu_flags = av_get_cpu_flags();
 #if HAVE_LASX
     if (have_lasx(cpu_flags)) {
-        switch (c->dstFormat) {
-            case AV_PIX_FMT_RGB24:
-                return yuv420_rgb24_lasx;
-            case AV_PIX_FMT_BGR24:
-                return yuv420_bgr24_lasx;
-            case AV_PIX_FMT_RGBA:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_rgba32_lasx;
-            case AV_PIX_FMT_ARGB:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_argb32_lasx;
-            case AV_PIX_FMT_BGRA:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_bgra32_lasx;
-            case AV_PIX_FMT_ABGR:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_abgr32_lasx;
+        if (c->srcFormat == AV_PIX_FMT_YUV420P) {
+            switch (c->dstFormat) {
+                case AV_PIX_FMT_RGB24:
+                    return yuv420_rgb24_lasx;
+                case AV_PIX_FMT_BGR24:
+                    return yuv420_bgr24_lasx;
+                case AV_PIX_FMT_RGBA:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_rgba32_lasx;
+                case AV_PIX_FMT_ARGB:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_argb32_lasx;
+                case AV_PIX_FMT_BGRA:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_bgra32_lasx;
+                case AV_PIX_FMT_ABGR:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_abgr32_lasx;
+            }
         }
     }
 #endif // #if HAVE_LASX
     if (have_lsx(cpu_flags)) {
-        switch (c->dstFormat) {
-            case AV_PIX_FMT_RGB24:
-                return yuv420_rgb24_lsx;
-            case AV_PIX_FMT_BGR24:
-                return yuv420_bgr24_lsx;
-            case AV_PIX_FMT_RGBA:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_rgba32_lsx;
-            case AV_PIX_FMT_ARGB:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_argb32_lsx;
-            case AV_PIX_FMT_BGRA:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_bgra32_lsx;
-            case AV_PIX_FMT_ABGR:
-                if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
-                    break;
-                } else
-                    return yuv420_abgr32_lsx;
+        if (c->srcFormat == AV_PIX_FMT_YUV420P) {
+            switch (c->dstFormat) {
+                case AV_PIX_FMT_RGB24:
+                    return yuv420_rgb24_lsx;
+                case AV_PIX_FMT_BGR24:
+                    return yuv420_bgr24_lsx;
+                case AV_PIX_FMT_RGBA:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_rgba32_lsx;
+                case AV_PIX_FMT_ARGB:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_argb32_lsx;
+                case AV_PIX_FMT_BGRA:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_bgra32_lsx;
+                case AV_PIX_FMT_ABGR:
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                        break;
+                    } else
+                        return yuv420_abgr32_lsx;
+            }
         }
     }
     return NULL;
diff --git a/libswscale/loongarch/yuv2rgb_lasx.c b/libswscale/loongarch/yuv2rgb_lasx.c
index 64e434f50c..0ce553005a 100644
--- a/libswscale/loongarch/yuv2rgb_lasx.c
+++ b/libswscale/loongarch/yuv2rgb_lasx.c
@@ -82,8 +82,8 @@
 #define YUV2RGB_RES                                                        \
     m_y1 = __lasx_xvldrepl_d(py_1, 0);                       \
     m_y2 = __lasx_xvldrepl_d(py_2, 0);                       \
-    m_u  = __lasx_xvldrepl_d(pu, 0);                         \
-    m_v  = __lasx_xvldrepl_d(pv, 0);                         \
+    m_u  = __lasx_xvldrepl_w(pu, 0);                         \
+    m_v  = __lasx_xvldrepl_w(pv, 0);                         \
     m_y1 = __lasx_xvilvl_d(m_y2, m_y1);                      \
     m_u  = __lasx_xvilvl_b(m_u, m_u);                        \
     m_v  = __lasx_xvilvl_b(m_v, m_v);                        \
-- 
2.20.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] swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure.
  2024-07-25  9:39 [FFmpeg-devel] [PATCH] swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure Shiyou Yin
@ 2024-07-25 10:01 ` 陈昊
  2024-07-27 22:12   ` Michael Niedermayer
  0 siblings, 1 reply; 3+ messages in thread
From: 陈昊 @ 2024-07-25 10:01 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

LGTM


本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. 


_______________________________________________
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] swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure.
  2024-07-25 10:01 ` 陈昊
@ 2024-07-27 22:12   ` Michael Niedermayer
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Niedermayer @ 2024-07-27 22:12 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 277 bytes --]

On Thu, Jul 25, 2024 at 06:01:52PM +0800, 陈昊 wrote:
> LGTM

will apply and backport (if it applies cleanly)

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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:[~2024-07-27 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-25  9:39 [FFmpeg-devel] [PATCH] swscale: [loongarch] Fix checkasm-sw_yuv2rgb failure Shiyou Yin
2024-07-25 10:01 ` 陈昊
2024-07-27 22:12   ` Michael Niedermayer

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