[FFmpeg-cvslog] riscv: Use the correct path for including asm.S

2022-09-28 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Wed Sep 28 
10:12:42 2022 +0300| [dd2e524ffa10aba1939acdfa43a0fca06db65921] | committer: 
Martin Storsjö

riscv: Use the correct path for including asm.S

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd2e524ffa10aba1939acdfa43a0fca06db65921
---

 libavcodec/riscv/fmtconvert_rvv.S  | 2 +-
 libavcodec/riscv/pixblockdsp_rvi.S | 2 +-
 libavcodec/riscv/vorbisdsp_rvv.S   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/riscv/fmtconvert_rvv.S 
b/libavcodec/riscv/fmtconvert_rvv.S
index c79f80cc47..49893ec8d7 100644
--- a/libavcodec/riscv/fmtconvert_rvv.S
+++ b/libavcodec/riscv/fmtconvert_rvv.S
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "../libavutil/riscv/asm.S"
+#include "libavutil/riscv/asm.S"
 
 func ff_int32_to_float_fmul_scalar_rvv, zve32f
 NOHWF   fmv.w.x fa0, a2
diff --git a/libavcodec/riscv/pixblockdsp_rvi.S 
b/libavcodec/riscv/pixblockdsp_rvi.S
index 93ece4405e..e84170244b 100644
--- a/libavcodec/riscv/pixblockdsp_rvi.S
+++ b/libavcodec/riscv/pixblockdsp_rvi.S
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "../libavutil/riscv/asm.S"
+#include "libavutil/riscv/asm.S"
 
 func ff_get_pixels_8_rvi
 .irp row, 0, 1, 2, 3, 4, 5, 6, 7
diff --git a/libavcodec/riscv/vorbisdsp_rvv.S b/libavcodec/riscv/vorbisdsp_rvv.S
index e8953fb548..bbe9c7dc6d 100644
--- a/libavcodec/riscv/vorbisdsp_rvv.S
+++ b/libavcodec/riscv/vorbisdsp_rvv.S
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "../libavutil/riscv/asm.S"
+#include "libavutil/riscv/asm.S"
 
 func ff_vorbis_inverse_coupling_rvv, zve32f
 fmv.w.x   ft0, zero

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] lavu/riscv: helper to read the vector length

2022-09-28 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Tue Sep 27 
23:04:21 2022 +0300| [c47ebfa141565a6bcaf6eeb699f135f81efacc63] | committer: 
Lynne

lavu/riscv: helper to read the vector length

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c47ebfa141565a6bcaf6eeb699f135f81efacc63
---

 libavutil/riscv/cpu.h | 45 +
 1 file changed, 45 insertions(+)

diff --git a/libavutil/riscv/cpu.h b/libavutil/riscv/cpu.h
new file mode 100644
index 00..56035f8556
--- /dev/null
+++ b/libavutil/riscv/cpu.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright © 2022 Rémi Denis-Courmont.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_RISCV_CPU_H
+#define AVUTIL_RISCV_CPU_H
+
+#include "config.h"
+#include 
+#include "libavutil/cpu.h"
+
+#if HAVE_RVV
+/**
+ * Returns the vector size in bytes (always a power of two and at least 4).
+ * This is undefined behaviour if vectors are not implemented.
+ */
+static inline size_t ff_get_rv_vlenb(void)
+{
+size_t vlenb;
+
+__asm__ (
+".option push\n"
+".option arch, +v\n"
+"csrr %0, vlenb\n"
+".option pop\n" : "=r" (vlenb));
+return vlenb;
+}
+#endif
+#endif

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] lavc/idctdsp: RISC-V V put_pixels_clamped function

2022-09-28 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Tue Sep 27 
23:04:22 2022 +0300| [b29ee63a1b70263c8e69cd1b66ec9a44bcb8f0c8] | committer: 
Lynne

lavc/idctdsp: RISC-V V put_pixels_clamped function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b29ee63a1b70263c8e69cd1b66ec9a44bcb8f0c8
---

 libavcodec/idctdsp.c|  2 ++
 libavcodec/idctdsp.h|  2 ++
 libavcodec/riscv/Makefile   |  2 ++
 libavcodec/riscv/idctdsp_init.c | 41 +++
 libavcodec/riscv/idctdsp_rvv.S  | 43 +
 5 files changed, 90 insertions(+)

diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 9035003b72..4ee9c3aa74 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -312,6 +312,8 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, 
AVCodecContext *avctx)
 ff_idctdsp_init_arm(c, avctx, high_bit_depth);
 #elif ARCH_PPC
 ff_idctdsp_init_ppc(c, avctx, high_bit_depth);
+#elif ARCH_RISCV
+ff_idctdsp_init_riscv(c, avctx, high_bit_depth);
 #elif ARCH_X86
 ff_idctdsp_init_x86(c, avctx, high_bit_depth);
 #elif ARCH_MIPS
diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h
index e8f20acaf2..2bd9820f72 100644
--- a/libavcodec/idctdsp.h
+++ b/libavcodec/idctdsp.h
@@ -114,6 +114,8 @@ void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext 
*avctx,
  unsigned high_bit_depth);
 void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
  unsigned high_bit_depth);
+void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx,
+   unsigned high_bit_depth);
 void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
  unsigned high_bit_depth);
 void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index 829a1823d2..96925afdab 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -5,6 +5,8 @@ OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o \
 RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
 OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_init.o
 RVV-OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_rvv.o
+OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_init.o
+RVV-OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_rvv.o
 OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \
   riscv/pixblockdsp_rvi.o
 OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_init.o
diff --git a/libavcodec/riscv/idctdsp_init.c b/libavcodec/riscv/idctdsp_init.c
new file mode 100644
index 00..1a6add80da
--- /dev/null
+++ b/libavcodec/riscv/idctdsp_init.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright © 2022 Rémi Denis-Courmont.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/riscv/cpu.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/idctdsp.h"
+
+void ff_put_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels,
+   ptrdiff_t stride);
+
+av_cold void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx,
+   unsigned high_bit_depth)
+{
+#if HAVE_RVV
+int flags = av_get_cpu_flags();
+
+if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16)
+c->put_pixels_clamped = ff_put_pixels_clamped_rvv;
+#endif
+}
diff --git a/libavcodec/riscv/idctdsp_rvv.S b/libavcodec/riscv/idctdsp_rvv.S
new file mode 100644
index 00..1987c8a8f6
--- /dev/null
+++ b/libavcodec/riscv/idctdsp_rvv.S
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2022 Rémi Denis-Courmont.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should

[FFmpeg-cvslog] lavc/idctdsp: RISC-V V add_pixels_clamped function

2022-09-28 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Tue Sep 27 
23:04:23 2022 +0300| [fa983b56560ede2d9e3e3e21c80bbe0352b8794d] | committer: 
Lynne

lavc/idctdsp: RISC-V V add_pixels_clamped function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa983b56560ede2d9e3e3e21c80bbe0352b8794d
---

 libavcodec/riscv/idctdsp_init.c |  6 +-
 libavcodec/riscv/idctdsp_rvv.S  | 16 
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/libavcodec/riscv/idctdsp_init.c b/libavcodec/riscv/idctdsp_init.c
index 1a6add80da..58b8a6c97a 100644
--- a/libavcodec/riscv/idctdsp_init.c
+++ b/libavcodec/riscv/idctdsp_init.c
@@ -28,6 +28,8 @@
 
 void ff_put_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels,
ptrdiff_t stride);
+void ff_add_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels,
+   ptrdiff_t stride);
 
 av_cold void ff_idctdsp_init_riscv(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
@@ -35,7 +37,9 @@ av_cold void ff_idctdsp_init_riscv(IDCTDSPContext *c, 
AVCodecContext *avctx,
 #if HAVE_RVV
 int flags = av_get_cpu_flags();
 
-if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16)
+if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) {
 c->put_pixels_clamped = ff_put_pixels_clamped_rvv;
+c->add_pixels_clamped = ff_add_pixels_clamped_rvv;
+}
 #endif
 }
diff --git a/libavcodec/riscv/idctdsp_rvv.S b/libavcodec/riscv/idctdsp_rvv.S
index 1987c8a8f6..3b504f5866 100644
--- a/libavcodec/riscv/idctdsp_rvv.S
+++ b/libavcodec/riscv/idctdsp_rvv.S
@@ -24,6 +24,7 @@
 func ff_put_pixels_clamped_rvv, zve32x
 vsetivlizero, 8, e16, m1, ta, ma
 vlseg8e16.v v24, (a0)
+1:
 /* RVV only has signed-signed and unsigned-unsigned clipping.
  * We need two steps for signed-to-unsigned clipping. */
 vsetvli t0, zero, e16, m8, ta, ma
@@ -41,3 +42,18 @@ func ff_put_pixels_clamped_rvv, zve32x
 vssseg8e8.v v16, (a1), a2
 ret
 endfunc
+
+func ff_add_pixels_clamped_rvv, zve32x
+vsetivlizero, 8, e8, mf2, ta, ma
+vlseg8e16.v v24, (a0)
+vlsseg8e8.v v16, (a1), a2
+vwaddu.wv   v24, v24, v16
+vwaddu.wv   v25, v25, v17
+vwaddu.wv   v26, v26, v18
+vwaddu.wv   v27, v27, v19
+vwaddu.wv   v28, v28, v20
+vwaddu.wv   v29, v29, v21
+vwaddu.wv   v30, v30, v22
+vwaddu.wv   v31, v31, v23
+j   1b
+endfunc

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] lavc/pixblockdsp: RISC-V V 8-bit get_pixels & get_pixels_unaligned

2022-09-28 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Tue Sep 27 
23:04:25 2022 +0300| [676b08cb703d412e4b60a598615365928489300b] | committer: 
Lynne

lavc/pixblockdsp: RISC-V V 8-bit get_pixels & get_pixels_unaligned

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=676b08cb703d412e4b60a598615365928489300b
---

 libavcodec/riscv/Makefile   |  1 +
 libavcodec/riscv/pixblockdsp_init.c | 12 
 libavcodec/riscv/pixblockdsp_rvv.S  | 37 +
 3 files changed, 50 insertions(+)

diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index 96925afdab..0fb2c81c75 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -9,5 +9,6 @@ OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_init.o
 RVV-OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_rvv.o
 OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \
   riscv/pixblockdsp_rvi.o
+RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o
 OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_init.o
 RVV-OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_rvv.o
diff --git a/libavcodec/riscv/pixblockdsp_init.c 
b/libavcodec/riscv/pixblockdsp_init.c
index 04bf52649f..69dbd18918 100644
--- a/libavcodec/riscv/pixblockdsp_init.c
+++ b/libavcodec/riscv/pixblockdsp_init.c
@@ -20,8 +20,10 @@
 
 #include 
 
+#include "config.h"
 #include "libavutil/attributes.h"
 #include "libavutil/cpu.h"
+#include "libavutil/riscv/cpu.h"
 #include "libavcodec/avcodec.h"
 #include "libavcodec/pixblockdsp.h"
 
@@ -30,6 +32,9 @@ void ff_get_pixels_8_rvi(int16_t *block, const uint8_t 
*pixels,
 void ff_get_pixels_16_rvi(int16_t *block, const uint8_t *pixels,
   ptrdiff_t stride);
 
+void ff_get_pixels_8_rvv(int16_t *block, const uint8_t *pixels,
+ ptrdiff_t stride);
+
 av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
AVCodecContext *avctx,
unsigned high_bit_depth)
@@ -42,4 +47,11 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
 else
 c->get_pixels = ff_get_pixels_8_rvi;
 }
+
+#if HAVE_RVV
+if ((cpu_flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) {
+if (!high_bit_depth)
+c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_8_rvv;
+}
+#endif
 }
diff --git a/libavcodec/riscv/pixblockdsp_rvv.S 
b/libavcodec/riscv/pixblockdsp_rvv.S
new file mode 100644
index 00..8d4322d8bc
--- /dev/null
+++ b/libavcodec/riscv/pixblockdsp_rvv.S
@@ -0,0 +1,37 @@
+/*
+ * Copyright © 2022 Rémi Denis-Courmont.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "libavutil/riscv/asm.S"
+
+func ff_get_pixels_8_rvv, zve32x
+vsetivli zero, 8, e8, mf2, ta, ma
+vlsseg8e8.v  v16, (a1), a2
+vwcvtu.x.x.v v8, v16
+vwcvtu.x.x.v v9, v17
+vwcvtu.x.x.v v10, v18
+vwcvtu.x.x.v v11, v19
+vwcvtu.x.x.v v12, v20
+vwcvtu.x.x.v v13, v21
+vwcvtu.x.x.v v14, v22
+vwcvtu.x.x.v v15, v23
+vsseg8e16.v  v8, (a0)
+ret
+endfunc

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] lavc/pixblockdsp: RISC-V V 16-bit get_pixels & get_pixels_unaligned

2022-09-28 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Tue Sep 27 
23:04:26 2022 +0300| [ebee25855a453de56ff3bd06e666d07b26fa15b2] | committer: 
Lynne

lavc/pixblockdsp: RISC-V V 16-bit get_pixels & get_pixels_unaligned

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ebee25855a453de56ff3bd06e666d07b26fa15b2
---

 libavcodec/riscv/pixblockdsp_init.c | 6 +-
 libavcodec/riscv/pixblockdsp_rvv.S  | 7 +++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/riscv/pixblockdsp_init.c 
b/libavcodec/riscv/pixblockdsp_init.c
index 69dbd18918..bbda381c12 100644
--- a/libavcodec/riscv/pixblockdsp_init.c
+++ b/libavcodec/riscv/pixblockdsp_init.c
@@ -34,6 +34,8 @@ void ff_get_pixels_16_rvi(int16_t *block, const uint8_t 
*pixels,
 
 void ff_get_pixels_8_rvv(int16_t *block, const uint8_t *pixels,
  ptrdiff_t stride);
+void ff_get_pixels_16_rvv(int16_t *block, const uint8_t *pixels,
+  ptrdiff_t stride);
 
 av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
AVCodecContext *avctx,
@@ -50,7 +52,9 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
 
 #if HAVE_RVV
 if ((cpu_flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) {
-if (!high_bit_depth)
+if (high_bit_depth)
+c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_16_rvv;
+else
 c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_8_rvv;
 }
 #endif
diff --git a/libavcodec/riscv/pixblockdsp_rvv.S 
b/libavcodec/riscv/pixblockdsp_rvv.S
index 8d4322d8bc..3392b4b2eb 100644
--- a/libavcodec/riscv/pixblockdsp_rvv.S
+++ b/libavcodec/riscv/pixblockdsp_rvv.S
@@ -35,3 +35,10 @@ func ff_get_pixels_8_rvv, zve32x
 vsseg8e16.v  v8, (a0)
 ret
 endfunc
+
+func ff_get_pixels_16_rvv, zve32x
+vsetivli zero, 8, e16, m1, ta, ma
+vlsseg8e16.v v0, (a1), a2
+vsseg8e16.v  v0, (a0)
+ret
+endfunc

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] lavc/idctdsp: RISC-V V put_signed_pixels_clamped function

2022-09-28 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Tue Sep 27 
23:04:24 2022 +0300| [2746329ce25fb3d30bbf2aab187e90e21ae98064] | committer: 
Lynne

lavc/idctdsp: RISC-V V put_signed_pixels_clamped function

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2746329ce25fb3d30bbf2aab187e90e21ae98064
---

 libavcodec/riscv/idctdsp_init.c |  3 +++
 libavcodec/riscv/idctdsp_rvv.S  | 21 +
 2 files changed, 24 insertions(+)

diff --git a/libavcodec/riscv/idctdsp_init.c b/libavcodec/riscv/idctdsp_init.c
index 58b8a6c97a..e6e616a555 100644
--- a/libavcodec/riscv/idctdsp_init.c
+++ b/libavcodec/riscv/idctdsp_init.c
@@ -28,6 +28,8 @@
 
 void ff_put_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels,
ptrdiff_t stride);
+void ff_put_signed_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels,
+  ptrdiff_t stride);
 void ff_add_pixels_clamped_rvv(const int16_t *block, uint8_t *pixels,
ptrdiff_t stride);
 
@@ -39,6 +41,7 @@ av_cold void ff_idctdsp_init_riscv(IDCTDSPContext *c, 
AVCodecContext *avctx,
 
 if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16) {
 c->put_pixels_clamped = ff_put_pixels_clamped_rvv;
+c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_rvv;
 c->add_pixels_clamped = ff_add_pixels_clamped_rvv;
 }
 #endif
diff --git a/libavcodec/riscv/idctdsp_rvv.S b/libavcodec/riscv/idctdsp_rvv.S
index 3b504f5866..f5e1165eee 100644
--- a/libavcodec/riscv/idctdsp_rvv.S
+++ b/libavcodec/riscv/idctdsp_rvv.S
@@ -43,6 +43,27 @@ func ff_put_pixels_clamped_rvv, zve32x
 ret
 endfunc
 
+func ff_put_signed_pixels_clamped_rvv, zve32x
+vsetivlizero, 8, e16, m1, ta, ma
+vlseg8e16.v v24, (a0)
+
+li  t1, 128
+vsetivlizero, 8, e8, mf2, ta, ma
+vnclip.wi   v16, v24, 0
+vnclip.wi   v17, v25, 0
+vnclip.wi   v18, v26, 0
+vnclip.wi   v19, v27, 0
+vnclip.wi   v20, v28, 0
+vnclip.wi   v21, v29, 0
+vnclip.wi   v22, v30, 0
+vnclip.wi   v23, v31, 0
+vsetvli t0, zero, e8, m8, ta, ma
+vadd.vx v16, v16, t1
+vsetivlizero, 8, e8, mf2, ta, ma
+vssseg8e8.v v16, (a1), a2
+ret
+endfunc
+
 func ff_add_pixels_clamped_rvv, zve32x
 vsetivlizero, 8, e8, mf2, ta, ma
 vlseg8e16.v v24, (a0)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] lavc/pixblockdsp: RISC-V diff_pixels & diff_pixels_unaligned

2022-09-28 Thread Rémi Denis-Courmont
ffmpeg | branch: master | Rémi Denis-Courmont  | Tue Sep 27 
23:04:27 2022 +0300| [d31013166ac3727ae7c7ebbb756e1e5800bc2b40] | committer: 
Lynne

lavc/pixblockdsp: RISC-V diff_pixels & diff_pixels_unaligned

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d31013166ac3727ae7c7ebbb756e1e5800bc2b40
---

 libavcodec/riscv/pixblockdsp_init.c |  4 
 libavcodec/riscv/pixblockdsp_rvv.S  | 16 
 2 files changed, 20 insertions(+)

diff --git a/libavcodec/riscv/pixblockdsp_init.c 
b/libavcodec/riscv/pixblockdsp_init.c
index bbda381c12..aa39a8a665 100644
--- a/libavcodec/riscv/pixblockdsp_init.c
+++ b/libavcodec/riscv/pixblockdsp_init.c
@@ -36,6 +36,8 @@ void ff_get_pixels_8_rvv(int16_t *block, const uint8_t 
*pixels,
  ptrdiff_t stride);
 void ff_get_pixels_16_rvv(int16_t *block, const uint8_t *pixels,
   ptrdiff_t stride);
+void ff_diff_pixels_rvv(int16_t *block, const uint8_t *s1, const uint8_t *s2,
+ptrdiff_t stride);
 
 av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
AVCodecContext *avctx,
@@ -56,6 +58,8 @@ av_cold void ff_pixblockdsp_init_riscv(PixblockDSPContext *c,
 c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_16_rvv;
 else
 c->get_pixels_unaligned = c->get_pixels = ff_get_pixels_8_rvv;
+
+c->diff_pixels_unaligned = c->diff_pixels = ff_diff_pixels_rvv;
 }
 #endif
 }
diff --git a/libavcodec/riscv/pixblockdsp_rvv.S 
b/libavcodec/riscv/pixblockdsp_rvv.S
index 3392b4b2eb..c125408523 100644
--- a/libavcodec/riscv/pixblockdsp_rvv.S
+++ b/libavcodec/riscv/pixblockdsp_rvv.S
@@ -42,3 +42,19 @@ func ff_get_pixels_16_rvv, zve32x
 vsseg8e16.v  v0, (a0)
 ret
 endfunc
+
+func ff_diff_pixels_rvv, zve32x
+vsetivlizero, 8, e8, mf2, ta, ma
+vlsseg8e8.v v16, (a1), a3
+vlsseg8e8.v v24, (a2), a3
+vwsubu.vv   v8, v16, v24
+vwsubu.vv   v9, v17, v25
+vwsubu.vv   v10, v18, v26
+vwsubu.vv   v11, v19, v27
+vwsubu.vv   v12, v20, v28
+vwsubu.vv   v13, v21, v29
+vwsubu.vv   v14, v22, v30
+vwsubu.vv   v15, v23, v31
+vsseg8e16.v v8, (a0)
+ret
+endfunc

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/mjpegdec: check that index is not negative

2022-09-28 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Sep 25 19:17:25 
2022 +0200| [4f022e67822c286e0974fe27191186d80342feb1] | committer: Paul B Mahol

avcodec/mjpegdec: check that index is not negative

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f022e67822c286e0974fe27191186d80342feb1
---

 libavcodec/mjpegdec.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index c594950500..559bda5e6f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -373,7 +373,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 s->v_max = 1;
 for (i = 0; i < nb_components; i++) {
 /* component id */
-s->component_id[i] = get_bits(&s->gb, 8) - 1;
+int id = get_bits(&s->gb, 8);
+if (id == 0)
+return AVERROR_INVALIDDATA;
+s->component_id[i] = id - 1;
 h_count[i] = get_bits(&s->gb, 4);
 v_count[i] = get_bits(&s->gb, 4);
 /* compute hmax and vmax (only used in interleaved case) */
@@ -1677,7 +1680,10 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const 
uint8_t *mb_bitmask,
 return AVERROR_INVALIDDATA;
 }
 for (i = 0; i < nb_components; i++) {
-id = get_bits(&s->gb, 8) - 1;
+id = get_bits(&s->gb, 8);
+if (id == 0)
+return AVERROR_INVALIDDATA;
+id -= 1;
 av_log(s->avctx, AV_LOG_DEBUG, "component: %d\n", id);
 /* find component index */
 for (index = 0; index < s->nb_components; index++)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/version: bump minor for the new RISC-V cpu flags

2022-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 12:15:42 
2022 -0300| [bcd2e7d685730838a07c0e88650ea8bbbe460df1] | committer: James Almer

avutil/version: bump minor for the new RISC-V cpu flags

Forgotten in 0c0a3deb1826638915775daa7cefb891a300060b.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bcd2e7d685730838a07c0e88650ea8bbbe460df1
---

 libavutil/version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/version.h b/libavutil/version.h
index 9c44cef6aa..5aca550f45 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  57
-#define LIBAVUTIL_VERSION_MINOR  37
+#define LIBAVUTIL_VERSION_MINOR  38
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/channel_layout: move and improve the comment about unknown orders

2022-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Sun Sep 25 20:00:46 
2022 -0300| [299253ae1b01081d5a2f291a490627fa482d] | committer: James Almer

avutil/channel_layout: move and improve the comment about unknown orders

Don't place it as doxy specific for the order field, and generalize it both to
also cover already defined orders and to not make it seem like the user is
required to handle a layout they don't fully support or understand.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=299253ae1b01081d5a2f291a490627fa482d
---

 libavutil/channel_layout.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
index 9e685fab72..ff2b57bbe3 100644
--- a/libavutil/channel_layout.h
+++ b/libavutil/channel_layout.h
@@ -266,6 +266,9 @@ typedef struct AVChannelCustom {
  * A channel layout here is defined as a set of channels ordered in a specific
  * way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an
  * AVChannelLayout carries only the channel count).
+ * All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by
+ * ignoring everything but the channel count, as long as 
av_channel_layout_check()
+ * considers they are valid.
  *
  * Unlike most structures in Libav, sizeof(AVChannelLayout) is a part of the
  * public ABI and may be used by the caller. E.g. it may be allocated on stack
@@ -290,9 +293,6 @@ typedef struct AVChannelCustom {
 typedef struct AVChannelLayout {
 /**
  * Channel order used in this layout.
- * Any value not defined in the AVChannelOrder enum in a layout that
- * av_channel_layout_check() doesn't reject must be treated as if it was
- * AV_CHANNEL_ORDER_UNSPEC.
  * This is a mandatory field.
  */
 enum AVChannelOrder order;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/aacdectab: Remove empty channel layouts

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Sep 26 02:14:45 2022 +0200| [6573e65ac00e22ba7c5add70f8f499a3d946f601] | 
committer: Andreas Rheinhardt

avcodec/aacdectab: Remove empty channel layouts

They will be mistaken for the sentinel of the arrays
they are in, thereby hiding the 6.1, 7.1 and 22.2 layouts.
(This doesn't really matter, as these arrays are informational
only for decoders.)

Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6573e65ac00e22ba7c5add70f8f499a3d946f601
---

 libavcodec/aacdectab.h | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h
index e03026806d..e38b93a534 100644
--- a/libavcodec/aacdectab.h
+++ b/libavcodec/aacdectab.h
@@ -73,7 +73,7 @@ static const uint8_t aac_channel_layout_map[16][16][3] = {
 };
 
 #if FF_API_OLD_CHANNEL_LAYOUT
-static const uint64_t aac_channel_layout[16] = {
+static const uint64_t aac_channel_layout[] = {
 AV_CH_LAYOUT_MONO,
 AV_CH_LAYOUT_STEREO,
 AV_CH_LAYOUT_SURROUND,
@@ -81,9 +81,6 @@ static const uint64_t aac_channel_layout[16] = {
 AV_CH_LAYOUT_5POINT0_BACK,
 AV_CH_LAYOUT_5POINT1_BACK,
 AV_CH_LAYOUT_7POINT1_WIDE_BACK,
-0,
-0,
-0,
 AV_CH_LAYOUT_6POINT1,
 AV_CH_LAYOUT_7POINT1,
 AV_CH_LAYOUT_22POINT2,
@@ -92,7 +89,7 @@ static const uint64_t aac_channel_layout[16] = {
 };
 #endif
 
-static const AVChannelLayout aac_ch_layout[16] = {
+static const AVChannelLayout aac_ch_layout[] = {
 AV_CHANNEL_LAYOUT_MONO,
 AV_CHANNEL_LAYOUT_STEREO,
 AV_CHANNEL_LAYOUT_SURROUND,
@@ -100,9 +97,6 @@ static const AVChannelLayout aac_ch_layout[16] = {
 AV_CHANNEL_LAYOUT_5POINT0_BACK,
 AV_CHANNEL_LAYOUT_5POINT1_BACK,
 AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK,
-{ 0 },
-{ 0 },
-{ 0 },
 AV_CHANNEL_LAYOUT_6POINT1,
 AV_CHANNEL_LAYOUT_7POINT1,
 AV_CHANNEL_LAYOUT_22POINT2,

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/dirac_dwt: Avoid conversions between function pointers and void*

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Sep 25 23:19:42 2022 +0200| [4393331250d1f61be0d159de2a7976087a118c25] | 
committer: Andreas Rheinhardt

avcodec/dirac_dwt: Avoid conversions between function pointers and void*

Pointers to void can be converted to any pointer to incomplete or
object type and back; but they are nevertheless not completely generic
pointers: There is no provision in the C standard that guarantees their
convertibility with function pointers. C90 lacks a generic function
pointer, C99 made every function pointer a generic function pointer and
still disallows the convertibility with void *. Both GCC as well as
Clang warn about this when using -pedantic.

Therefore use unions to avoid these conversions.

Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4393331250d1f61be0d159de2a7976087a118c25
---

 libavcodec/dirac_dwt.h  | 13 +++
 libavcodec/dirac_dwt_template.c | 52 -
 libavcodec/x86/dirac_dwt_init.c | 16 ++---
 3 files changed, 42 insertions(+), 39 deletions(-)

diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h
index 994dc21d70..84f71d9120 100644
--- a/libavcodec/dirac_dwt.h
+++ b/libavcodec/dirac_dwt.h
@@ -61,11 +61,14 @@ typedef struct DWTContext {
 int support;
 
 void (*spatial_compose)(struct DWTContext *cs, int level, int width, int 
height, int stride);
-void (*vertical_compose_l0)(void);
-void (*vertical_compose_h0)(void);
-void (*vertical_compose_l1)(void);
-void (*vertical_compose_h1)(void);
-void (*vertical_compose)(void); ///< one set of lowpass and highpass 
combined
+union {
+vertical_compose_3tap tap3;
+vertical_compose_5tap tap5;
+vertical_compose_9tap tap9;
+} vertical_compose_l0, vertical_compose_h0;
+vertical_compose_3tap vertical_compose_l1;
+vertical_compose_3tap vertical_compose_h1;
+vertical_compose_2tap vertical_compose; ///< one set of lowpass and 
highpass combined
 void (*horizontal_compose)(uint8_t *b, uint8_t *tmp, int width);
 
 DWTCompose cs[MAX_DECOMPOSITIONS];
diff --git a/libavcodec/dirac_dwt_template.c b/libavcodec/dirac_dwt_template.c
index f1d7f8b22f..0d39754ed8 100644
--- a/libavcodec/dirac_dwt_template.c
+++ b/libavcodec/dirac_dwt_template.c
@@ -338,8 +338,8 @@ static void RENAME(vertical_compose_daub97iL1)(uint8_t 
*_b0, uint8_t *_b1, uint8
 
 static void RENAME(spatial_compose_dd97i_dy)(DWTContext *d, int level, int 
width, int height, int stride)
 {
-vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
-vertical_compose_5tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
+vertical_compose_3tap vertical_compose_l0 = d->vertical_compose_l0.tap3;
+vertical_compose_5tap vertical_compose_h0 = d->vertical_compose_h0.tap5;
 DWTCompose *cs = d->cs + level;
 
 int i, y = cs->y;
@@ -362,8 +362,8 @@ static void RENAME(spatial_compose_dd97i_dy)(DWTContext *d, 
int level, int width
 
 static void RENAME(spatial_compose_dirac53i_dy)(DWTContext *d, int level, int 
width, int height, int stride)
 {
-vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
-vertical_compose_3tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
+vertical_compose_3tap vertical_compose_l0 = d->vertical_compose_l0.tap3;
+vertical_compose_3tap vertical_compose_h0 = d->vertical_compose_h0.tap3;
 DWTCompose *cs = d->cs + level;
 
 int y= cs->y;
@@ -384,8 +384,8 @@ static void RENAME(spatial_compose_dirac53i_dy)(DWTContext 
*d, int level, int wi
 
 static void RENAME(spatial_compose_dd137i_dy)(DWTContext *d, int level, int 
width, int height, int stride)
 {
-vertical_compose_5tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
-vertical_compose_5tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
+vertical_compose_5tap vertical_compose_l0 = d->vertical_compose_l0.tap5;
+vertical_compose_5tap vertical_compose_h0 = d->vertical_compose_h0.tap5;
 DWTCompose *cs = d->cs + level;
 
 int i, y = cs->y;
@@ -409,7 +409,7 @@ static void RENAME(spatial_compose_dd137i_dy)(DWTContext 
*d, int level, int widt
 // haar makes the assumption that height is even (always true for dirac)
 static void RENAME(spatial_compose_haari_dy)(DWTContext *d, int level, int 
width, int height, int stride)
 {
-vertical_compose_2tap vertical_compose = (void*)d->vertical_compose;
+vertical_compose_2tap vertical_compose = d->vertical_compose;
 int y = d->cs[level].y;
 uint8_t *b0 = d->buffer + (y-1)*stride;
 uint8_t *b1 = d->buffer + (y  )*stride;
@@ -425,8 +425,8 @@ static void RENAME(spatial_compose_haari_dy)(DWTContext *d, 
int level, int width
 // Fortunately, this filter isn't used in practice.
 static void RENAME(spatial_compose_fidelity)(DWTContext *d, int level, int 
width, int height, int stride)
 {
-vertical_compose_9tap vertical_compose_l0 

[FFmpeg-cvslog] avcodec/dirac_dwt(_template): Don't use ff_-prefix for static func

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Sep 25 19:56:35 2022 +0200| [a91ddce6894af70ed7389eaf2a84f844e9f7b7e9] | 
committer: Andreas Rheinhardt

avcodec/dirac_dwt(_template): Don't use ff_-prefix for static func

Reviewed-by: Lynne 
Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a91ddce6894af70ed7389eaf2a84f844e9f7b7e9
---

 libavcodec/dirac_dwt.c  | 6 +++---
 libavcodec/dirac_dwt_template.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c
index af29932c6d..4039899cf0 100644
--- a/libavcodec/dirac_dwt.c
+++ b/libavcodec/dirac_dwt.c
@@ -45,11 +45,11 @@ int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum 
dwt_type type,
 d->decomposition_count = decomposition_count;
 
 if (bit_depth == 8)
-ret = ff_spatial_idwt_init_8bit(d, type);
+ret = spatial_idwt_init_8bit(d, type);
 else if (bit_depth == 10)
-ret = ff_spatial_idwt_init_10bit(d, type);
+ret = spatial_idwt_init_10bit(d, type);
 else if (bit_depth == 12)
-ret = ff_spatial_idwt_init_12bit(d, type);
+ret = spatial_idwt_init_12bit(d, type);
 else
 av_log(NULL, AV_LOG_WARNING, "Unsupported bit depth = %i\n", 
bit_depth);
 
diff --git a/libavcodec/dirac_dwt_template.c b/libavcodec/dirac_dwt_template.c
index 5d55d932a1..f1d7f8b22f 100644
--- a/libavcodec/dirac_dwt_template.c
+++ b/libavcodec/dirac_dwt_template.c
@@ -516,7 +516,7 @@ static void RENAME(spatial_compose_dd137i_init)(DWTCompose 
*cs, uint8_t *buffer,
 cs->y = -5;
 }
 
-static int RENAME(ff_spatial_idwt_init)(DWTContext *d, enum dwt_type type)
+static int RENAME(spatial_idwt_init)(DWTContext *d, enum dwt_type type)
 {
 int level;
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/codec_internal: Avoid deprecation warnings for channel_layouts

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Sep 26 01:10:51 2022 +0200| [fdff1b9cbfd8cf5a9810c29efa4baf13a4786742] | 
committer: Andreas Rheinhardt

avcodec/codec_internal: Avoid deprecation warnings for channel_layouts

AVCodec.channel_layouts is deprecated and Clang (unlike GCC)
warns when setting this field in a codec definition.
Fortunately, Clang (unlike GCC) allows to use
FF_DISABLE_DEPRECATION_WARNINGS inside a definition (of an FFCodec),
so that one can create simple macros to set AVCodec.channel_layouts
that also suppress deprecation warnings for Clang.

(Notice that some of the codec definitions were already
inside FF_DISABLE/ENABLE_DEPRECATION_WARNINGS (that were not
guarded by FF_API_OLD_CHANNEL_LAYOUT); these have been removed.
Also notice that setting AVCodec.channel_layouts was not guarded
by FF_API_OLD_CHANNEL_LAYOUT either, so testing disabling it
it without removing all the codeblocks would not have worked.)

Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fdff1b9cbfd8cf5a9810c29efa4baf13a4786742
---

 libavcodec/aacdec.c |  8 ++--
 libavcodec/aacdec_fixed.c   |  4 +---
 libavcodec/ac3enc_fixed.c   |  6 +-
 libavcodec/ac3enc_float.c   |  6 +-
 libavcodec/alacenc.c|  6 +-
 libavcodec/aptxdec.c|  8 ++--
 libavcodec/aptxenc.c|  8 ++--
 libavcodec/audiotoolboxenc.c|  2 +-
 libavcodec/codec_internal.h | 19 +++
 libavcodec/dcaenc.c | 11 +++
 libavcodec/eac3enc.c|  6 +-
 libavcodec/g722enc.c|  4 +---
 libavcodec/libcodec2.c  |  8 ++--
 libavcodec/libfdk-aacenc.c  |  4 +---
 libavcodec/libgsmenc.c  |  8 ++--
 libavcodec/libmp3lame.c |  6 +-
 libavcodec/libshine.c   |  6 +-
 libavcodec/libspeexenc.c|  6 +-
 libavcodec/libtwolame.c |  7 +--
 libavcodec/mlpenc.c |  8 ++--
 libavcodec/mpegaudioenc_fixed.c |  6 +-
 libavcodec/mpegaudioenc_float.c |  6 +-
 libavcodec/opusenc.c|  5 +
 libavcodec/pcm-blurayenc.c  |  7 ++-
 libavcodec/pcm-dvdenc.c |  9 ++---
 libavcodec/ra144enc.c   |  4 +---
 libavcodec/s302menc.c   |  5 -
 libavcodec/sbcdec.c |  5 +
 libavcodec/sbcenc.c |  5 +
 libavcodec/vorbisdec.c  |  4 +---
 30 files changed, 57 insertions(+), 140 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 2d448103df..2fdfd6b221 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -566,9 +566,7 @@ const FFCodec ff_aac_decoder = {
 },
 .p.capabilities  = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
 .caps_internal   = FF_CODEC_CAP_INIT_CLEANUP,
-#if FF_API_OLD_CHANNEL_LAYOUT
-.p.channel_layouts = aac_channel_layout,
-#endif
+CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout)
 .p.ch_layouts= aac_ch_layout,
 .flush = flush,
 .p.priv_class= &aac_decoder_class,
@@ -594,9 +592,7 @@ const FFCodec ff_aac_latm_decoder = {
 },
 .p.capabilities  = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
 .caps_internal   = FF_CODEC_CAP_INIT_CLEANUP,
-#if FF_API_OLD_CHANNEL_LAYOUT
-.p.channel_layouts = aac_channel_layout,
-#endif
+CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout)
 .p.ch_layouts= aac_ch_layout,
 .flush = flush,
 .p.profiles  = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index 4b2085335d..8c5dad2813 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -464,9 +464,7 @@ const FFCodec ff_aac_fixed_decoder = {
 },
 .p.capabilities  = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
 .caps_internal   = FF_CODEC_CAP_INIT_CLEANUP,
-#if FF_API_OLD_CHANNEL_LAYOUT
-.p.channel_layouts = aac_channel_layout,
-#endif
+CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout)
 .p.ch_layouts= aac_ch_layout,
 .p.priv_class= &aac_decoder_class,
 .p.profiles  = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
diff --git a/libavcodec/ac3enc_fixed.c b/libavcodec/ac3enc_fixed.c
index a22d3b4abf..a52a598152 100644
--- a/libavcodec/ac3enc_fixed.c
+++ b/libavcodec/ac3enc_fixed.c
@@ -119,7 +119,6 @@ static av_cold int ac3_fixed_encode_init(AVCodecContext 
*avctx)
 }
 
 
-FF_DISABLE_DEPRECATION_WARNINGS
 const FFCodec ff_ac3_fixed_encoder = {
 .p.name  = "ac3_fixed",
 CODEC_LONG_NAME("ATSC A/52A (AC-3)"),
@@ -135,10 +134,7 @@ const FFCodec ff_ac3_fixed_encoder = {
 .p.priv_class= &ff_ac3enc_class,
 .caps_internal   = FF_CODEC_CAP_INIT_CLEANUP,
 .p.supported_samplerates = ff_ac3_sample_rate_tab,
-#if FF_API_OLD_CHANNEL_LAYOUT
-.p.channel_layouts = ff_ac3_channel_layouts,
-#endif
+CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_ac3_channel_layouts)
 .p.ch_layouts= ff_ac3_ch_layouts,
 

[FFmpeg-cvslog] avcodec/amrwbdec,lsp: Include mips headers only #if ARCH_MIPS

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Sep 25 16:09:01 2022 +0200| [ba07c84bf961e034b8b8f80603358f8ebab6c171] | 
committer: Andreas Rheinhardt

avcodec/amrwbdec,lsp: Include mips headers only #if ARCH_MIPS

Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba07c84bf961e034b8b8f80603358f8ebab6c171
---

 libavcodec/amrwbdec.c | 4 
 libavcodec/lsp.c  | 4 
 2 files changed, 8 insertions(+)

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index ea3812cd9a..b59066adcf 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -24,6 +24,8 @@
  * AMR wideband decoder
  */
 
+#include "config.h"
+
 #include "libavutil/channel_layout.h"
 #include "libavutil/common.h"
 #include "libavutil/lfg.h"
@@ -42,7 +44,9 @@
 #include "amr.h"
 
 #include "amrwbdata.h"
+#if ARCH_MIPS
 #include "mips/amrwbdec_mips.h"
+#endif /* ARCH_MIPS */
 
 typedef struct AMRWBContext {
 AMRWBFrame frame; ///< AMRWB parameters 
decoded from bitstream
diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c
index 90f2efaafe..9e7bc5f87a 100644
--- a/libavcodec/lsp.c
+++ b/libavcodec/lsp.c
@@ -23,11 +23,15 @@
 
 #include 
 
+#include "config.h"
+
 #define FRAC_BITS 14
 #include "libavutil/macros.h"
 #include "mathops.h"
 #include "lsp.h"
+#if ARCH_MIPS
 #include "libavcodec/mips/lsp_mips.h"
+#endif /* ARCH_MIPS */
 #include "libavutil/avassert.h"
 
 void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, 
int lsfq_max, int lp_order)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/lsp: Move ff_lsp2polyf() upwards in lsp.c

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Sep 25 16:14:53 2022 +0200| [e0980629d8ef1970488e56a55e198d5549d4] | 
committer: Andreas Rheinhardt

avcodec/lsp: Move ff_lsp2polyf() upwards in lsp.c

Will avoid a forward declaration lateron.
Also adapt the function to modern style while at it.

Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e0980629d8ef1970488e56a55e198d5549d4
---

 libavcodec/lsp.c | 35 ---
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c
index 9e7bc5f87a..9536d8078b 100644
--- a/libavcodec/lsp.c
+++ b/libavcodec/lsp.c
@@ -124,6 +124,22 @@ static void lsp2poly(int* f, const int16_t* lsp, int 
lp_half_order)
 }
 }
 
+#ifndef ff_lsp2polyf
+void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order)
+{
+f[0] = 1.0;
+f[1] = -2 * lsp[0];
+lsp -= 2;
+for (int i = 2; i <= lp_half_order; i++) {
+double val = -2 * lsp[2*i];
+f[i] = val * f[i-1] + 2*f[i-2];
+for (int j = i-1; j > 1; j--)
+f[j] += f[j-1] * val + f[j-2];
+f[1] += val;
+}
+}
+#endif /* ff_lsp2polyf */
+
 void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
 {
 int i;
@@ -191,25 +207,6 @@ void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, 
const int16_t* lsp_2nd
 ff_acelp_lsp2lpc(lp_2nd, lsp_2nd, lp_order >> 1);
 }
 
-#ifndef ff_lsp2polyf
-void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order)
-{
-int i, j;
-
-f[0] = 1.0;
-f[1] = -2 * lsp[0];
-lsp -= 2;
-for(i=2; i<=lp_half_order; i++)
-{
-double val = -2 * lsp[2*i];
-f[i] = val * f[i-1] + 2*f[i-2];
-for(j=i-1; j>1; j--)
-f[j] += f[j-1] * val + f[j-2];
-f[1] += val;
-}
-}
-#endif /* ff_lsp2polyf */
-
 void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order)
 {
 double pa[MAX_LP_HALF_ORDER+1], qa[MAX_LP_HALF_ORDER+1];

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/lsp: Make ff_lsp2polyf() static

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Sep 25 16:22:21 2022 +0200| [c35a6709d077c3221f50235446c88d7c96234d5b] | 
committer: Andreas Rheinhardt

avcodec/lsp: Make ff_lsp2polyf() static

Possible since 48ac225db2563fe534b1d9e999bf8e70d5a577f8.
Furthermore, the current code would not work on mips
in case ff_lsp2polyf() were used outside of lsp.c,
because it is not compiled on mips since commit
3827a86eacd04d9d7b356f769be553f7b8cca361 at all;
instead it is overridden with a static av_always_inline
function which only works for the callers in lsp.c.

Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c35a6709d077c3221f50235446c88d7c96234d5b
---

 libavcodec/lsp.c   | 24 +---
 libavcodec/lsp.h   | 12 
 libavcodec/mips/lsp_mips.h | 12 ++--
 3 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/libavcodec/lsp.c b/libavcodec/lsp.c
index 9536d8078b..275984097d 100644
--- a/libavcodec/lsp.c
+++ b/libavcodec/lsp.c
@@ -124,8 +124,18 @@ static void lsp2poly(int* f, const int16_t* lsp, int 
lp_half_order)
 }
 }
 
-#ifndef ff_lsp2polyf
-void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order)
+#ifndef lsp2polyf
+/**
+ * Compute the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients
+ * needed for LSP to LPC conversion.
+ * We only need to calculate the 6 first elements of the polynomial.
+ *
+ * @param lsp line spectral pairs in cosine domain
+ * @param[out] f polynomial input/output as a vector
+ *
+ * TIA/EIA/IS-733 2.4.3.3.5-1/2
+ */
+static void lsp2polyf(const double *lsp, double *f, int lp_half_order)
 {
 f[0] = 1.0;
 f[1] = -2 * lsp[0];
@@ -138,7 +148,7 @@ void ff_lsp2polyf(const double *lsp, double *f, int 
lp_half_order)
 f[1] += val;
 }
 }
-#endif /* ff_lsp2polyf */
+#endif /* lsp2polyf */
 
 void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order)
 {
@@ -172,8 +182,8 @@ void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int 
lp_order)
 
 qa[-1] = 0.0;
 
-ff_lsp2polyf(lsp, pa, lp_half_order);
-ff_lsp2polyf(lsp + 1, qa, lp_half_order - 1);
+lsp2polyf(lsp, pa, lp_half_order);
+lsp2polyf(lsp + 1, qa, lp_half_order - 1);
 
 for (i = 1, j = lp_order - 1; i < lp_half_order; i++, j--) {
 double paf =  pa[i]* (1 + lsp[lp_order - 1]);
@@ -214,8 +224,8 @@ void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int 
lp_half_order)
 
 av_assert2(lp_half_order <= MAX_LP_HALF_ORDER);
 
-ff_lsp2polyf(lsp, pa, lp_half_order);
-ff_lsp2polyf(lsp + 1, qa, lp_half_order);
+lsp2polyf(lsp, pa, lp_half_order);
+lsp2polyf(lsp + 1, qa, lp_half_order);
 
 while (lp_half_order--) {
 double paf = pa[lp_half_order+1] + pa[lp_half_order];
diff --git a/libavcodec/lsp.h b/libavcodec/lsp.h
index 621ebeaebe..26b1382eda 100644
--- a/libavcodec/lsp.h
+++ b/libavcodec/lsp.h
@@ -115,16 +115,4 @@ void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int 
lp_half_order);
  */
 void ff_sort_nearly_sorted_floats(float *vals, int len);
 
-/**
- * Compute the Pa / (1 + z(-1)) or Qa / (1 - z(-1)) coefficients
- * needed for LSP to LPC conversion.
- * We only need to calculate the 6 first elements of the polynomial.
- *
- * @param lsp line spectral pairs in cosine domain
- * @param[out] f polynomial input/output as a vector
- *
- * TIA/EIA/IS-733 2.4.3.3.5-1/2
- */
-void ff_lsp2polyf(const double *lsp, double *f, int lp_half_order);
-
 #endif /* AVCODEC_LSP_H */
diff --git a/libavcodec/mips/lsp_mips.h b/libavcodec/mips/lsp_mips.h
index c69f8b770c..2d67403888 100644
--- a/libavcodec/mips/lsp_mips.h
+++ b/libavcodec/mips/lsp_mips.h
@@ -61,7 +61,7 @@
 #include "libavutil/attributes.h"
 #include "libavutil/mips/asmdefs.h"
 
-static av_always_inline void ff_lsp2polyf_mips(const double *lsp, double *f, 
int lp_half_order)
+static av_always_inline void lsp2polyf_mips(const double *lsp, double *f, int 
lp_half_order)
 {
 int i, j = 0;
 double * p_fi = f;
@@ -88,8 +88,8 @@ static av_always_inline void ff_lsp2polyf_mips(const double 
*lsp, double *f, int
 "addiu  %[j],   %[i], -2\n\t"
 "ldc1   %[f_j_2],   -8(%[p_f])  \n\t"
 "sdc1   %[tmp], 16(%[p_f])  \n\t"
-"beqz   %[j],   ff_lsp2polyf_lp_j_end%= \n\t"
-"ff_lsp2polyf_lp_j%=:   \n\t"
+"beqz   %[j],   lsp2polyf_lp_j_end%=\n\t"
+"lsp2polyf_lp_j%=:  \n\t"
 "add.d  %[tmp], %[f_j], %[f_j_2]\n\t"
 "madd.d %[tmp], %[tmp], %[f_j_1], %[val]\n\t"
 "mov.d  %[f_j], %[f_j_1]\n\t"
@@ -98,8 +98,8 @@ static av_always_inline void ff_lsp2polyf_mips(const double 
*lsp, double *f, int
 "ldc1   %[f_j_2],   -16(%[p_

[FFmpeg-cvslog] avutil/display: Drop wrong comments about matrices being allocated

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sun Sep 25 19:09:51 2022 +0200| [3d8754cd091d81ed8e39978618cb441ebbc69ea5] | 
committer: Andreas Rheinhardt

avutil/display: Drop wrong comments about matrices being allocated

These functions work just as well with stack based matrices.

Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d8754cd091d81ed8e39978618cb441ebbc69ea5
---

 libavutil/display.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/display.h b/libavutil/display.h
index 31d8bef361..0c73bff5da 100644
--- a/libavutil/display.h
+++ b/libavutil/display.h
@@ -90,8 +90,8 @@ double av_display_rotation_get(const int32_t matrix[9]);
  * Initialize a transformation matrix describing a pure clockwise
  * rotation by the specified angle (in degrees).
  *
- * @param matrix an allocated transformation matrix (will be fully overwritten
- *   by this function)
+ * @param[out] matrix a transformation matrix (will be fully overwritten
+ *by this function)
  * @param angle rotation angle in degrees.
  */
 void av_display_rotation_set(int32_t matrix[9], double angle);
@@ -99,7 +99,7 @@ void av_display_rotation_set(int32_t matrix[9], double angle);
 /**
  * Flip the input matrix horizontally and/or vertically.
  *
- * @param matrix an allocated transformation matrix
+ * @param[in,out] matrix a transformation matrix
  * @param hflip whether the matrix should be flipped horizontally
  * @param vflip whether the matrix should be flipped vertically
  */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/jpeg2000dwt: Fix left shift of negative number

2022-09-28 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Tue Sep 27 01:09:59 2022 +0200| [fff010591b35874b4c7a7e9fe00d7541f0b7c994] | 
committer: Andreas Rheinhardt

avcodec/jpeg2000dwt: Fix left shift of negative number

Fixes the j2k-dwt FATE-test; also fixes #9945.
(I don't know whether the multiplication can overflow.)

Reviewed-by: Tomas Härdin 
Signed-off-by: Andreas Rheinhardt 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fff010591b35874b4c7a7e9fe00d7541f0b7c994
---

 libavcodec/jpeg2000dwt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index f2da7307c4..34e33553f7 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -81,7 +81,7 @@ static void sd_1d53(int *p, int i0, int i1)
 
 if (i1 <= i0 + 1) {
 if (i0 == 1)
-p[1] <<= 1;
+p[1] *= 2;
 return;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".