[FFmpeg-cvslog] avcodec/fmvc: Move frame allocation to a later stage

2022-09-10 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Jun 10 23:09:09 2022 +0200| [9783749c66bf6ca2ce7a6db4c74957fe77cbe803] | 
committer: Michael Niedermayer

avcodec/fmvc: Move frame allocation to a later stage

This way more things are checked before allocation

Signed-off-by: Michael Niedermayer 

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

 libavcodec/fmvc.c | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c
index 863c65c351..3ee915cc4c 100644
--- a/libavcodec/fmvc.c
+++ b/libavcodec/fmvc.c
@@ -400,20 +400,17 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 GetByteContext *gb = &s->gb;
 PutByteContext *pb = &s->pb;
 int ret, y, x;
+int key_frame;
 
 if (avpkt->size < 8)
 return AVERROR_INVALIDDATA;
 
-if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-return ret;
-
 bytestream2_init(gb, avpkt->data, avpkt->size);
 bytestream2_skip(gb, 2);
 
-frame->key_frame = !!bytestream2_get_le16(gb);
-frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : 
AV_PICTURE_TYPE_P;
+key_frame = !!bytestream2_get_le16(gb);
 
-if (frame->key_frame) {
+if (key_frame) {
 const uint8_t *src;
 unsigned type, size;
 uint8_t *dst;
@@ -433,6 +430,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 return AVERROR_PATCHWELCOME;
 }
 
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
+frame->key_frame = 1;
+frame->pict_type = AV_PICTURE_TYPE_I;
+
 src = s->buffer;
 dst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
 for (y = 0; y < avctx->height; y++) {
@@ -513,6 +516,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 dst = &rect[block_h * s->stride];
 }
 
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
+frame->key_frame = 0;
+frame->pict_type = AV_PICTURE_TYPE_P;
+
 ssrc = s->buffer;
 ddst = frame->data[0] + (avctx->height - 1) * frame->linesize[0];
 for (y = 0; y < avctx->height; y++) {

___
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] tools/target_dec_fuzzer: Adjust threshold for UTVIDEO

2022-09-10 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Sep  8 23:07:47 2022 +0200| [9af7de086768b089c882f37a64717da616ef1de6] | 
committer: Michael Niedermayer

tools/target_dec_fuzzer: Adjust threshold for UTVIDEO

Fixes: Timeout
Fixes: 
47969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5097256832860160

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 tools/target_dec_fuzzer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index aa3ba0e523..5b335d3130 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -281,6 +281,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 case AV_CODEC_ID_TQI: maxpixels  /= 1024;  break;
 case AV_CODEC_ID_TRUEMOTION2: maxpixels  /= 1024;  break;
 case AV_CODEC_ID_TSCC:maxpixels  /= 1024;  break;
+case AV_CODEC_ID_UTVIDEO: maxpixels  /= 1024;  break;
 case AV_CODEC_ID_VB:  maxpixels  /= 1024;  break;
 case AV_CODEC_ID_VC1: maxpixels  /= 8192;  break;
 case AV_CODEC_ID_VC1IMAGE:maxpixels  /= 8192;  break;

___
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] libavformat/hls: Free keys

2022-09-10 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Fri 
Sep  9 00:32:23 2022 +0200| [d32a9f3137c91de86547601a38fea0693c3497f1] | 
committer: Michael Niedermayer

libavformat/hls: Free keys

Fixes: memleak
Fixes: 
50703/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-6399058578636800

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Steven Liu 
Signed-off-by: Michael Niedermayer 

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

 libavformat/hls.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 3dc7bd3930..e622425e80 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -250,6 +250,7 @@ static void free_init_section_list(struct playlist *pls)
 {
 int i;
 for (i = 0; i < pls->n_init_sections; i++) {
+av_freep(&pls->init_sections[i]->key);
 av_freep(&pls->init_sections[i]->url);
 av_freep(&pls->init_sections[i]);
 }

___
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] swscale/output: add support for P012

2022-09-10 Thread Philip Langdale
ffmpeg | branch: master | Philip Langdale  | Mon Sep  5 
14:53:50 2022 -0700| [caf8d4d256cc21f09570bdcbdbe8dde4406834ca] | committer: 
Philip Langdale

swscale/output: add support for P012

This generalises the existing P010 support.

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

 libswscale/output.c | 140 ++--
 libswscale/utils.c  |   4 +-
 libswscale/version.h|   2 +-
 tests/ref/fate/filter-pixdesc-p012be|   1 +
 tests/ref/fate/filter-pixdesc-p012le|   1 +
 tests/ref/fate/filter-pixfmts-copy  |   2 +
 tests/ref/fate/filter-pixfmts-crop  |   2 +
 tests/ref/fate/filter-pixfmts-field |   2 +
 tests/ref/fate/filter-pixfmts-hflip |   2 +
 tests/ref/fate/filter-pixfmts-il|   2 +
 tests/ref/fate/filter-pixfmts-null  |   2 +
 tests/ref/fate/filter-pixfmts-pad   |   1 +
 tests/ref/fate/filter-pixfmts-scale |   2 +
 tests/ref/fate/filter-pixfmts-transpose |   2 +
 tests/ref/fate/filter-pixfmts-vflip |   2 +
 15 files changed, 105 insertions(+), 62 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 40a4476c6d..da6c026916 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -460,17 +460,18 @@ static void yuv2nv12cX_c(enum AVPixelFormat dstFormat, 
const uint8_t *chrDither,
 
 #define output_pixel(pos, val) \
 if (big_endian) { \
-AV_WB16(pos, av_clip_uintp2(val >> shift, 10) << 6); \
+AV_WB16(pos, av_clip_uintp2(val >> shift, output_bits) << 
output_shift); \
 } else { \
-AV_WL16(pos, av_clip_uintp2(val >> shift, 10) << 6); \
+AV_WL16(pos, av_clip_uintp2(val >> shift, output_bits) << 
output_shift); \
 }
 
-static void yuv2p010l1_c(const int16_t *src,
+static void yuv2p01xl1_c(const int16_t *src,
  uint16_t *dest, int dstW,
- int big_endian)
+ int big_endian, int output_bits)
 {
 int i;
-int shift = 5;
+int shift = 15 - output_bits;
+int output_shift = 16 - output_bits;
 
 for (i = 0; i < dstW; i++) {
 int val = src[i] + (1 << (shift - 1));
@@ -478,12 +479,13 @@ static void yuv2p010l1_c(const int16_t *src,
 }
 }
 
-static void yuv2p010lX_c(const int16_t *filter, int filterSize,
+static void yuv2p01xlX_c(const int16_t *filter, int filterSize,
  const int16_t **src, uint16_t *dest, int dstW,
- int big_endian)
+ int big_endian, int output_bits)
 {
 int i, j;
-int shift = 17;
+int shift = 11 + 16 - output_bits;
+int output_shift = 16 - output_bits;
 
 for (i = 0; i < dstW; i++) {
 int val = 1 << (shift - 1);
@@ -495,14 +497,15 @@ static void yuv2p010lX_c(const int16_t *filter, int 
filterSize,
 }
 }
 
-static void yuv2p010cX_c(int big_endian, const uint8_t *chrDither,
+static void yuv2p01xcX_c(int big_endian, const uint8_t *chrDither,
  const int16_t *chrFilter, int chrFilterSize,
  const int16_t **chrUSrc, const int16_t **chrVSrc,
- uint8_t *dest8, int chrDstW)
+ uint8_t *dest8, int chrDstW, int output_bits)
 {
 uint16_t *dest = (uint16_t*)dest8;
-int shift = 17;
 int i, j;
+int shift = 11 + 16 - output_bits;
+int output_shift = 16 - output_bits;
 
 for (i = 0; i < chrDstW; i++) {
 int u = 1 << (shift - 1);
@@ -518,52 +521,65 @@ static void yuv2p010cX_c(int big_endian, const uint8_t 
*chrDither,
 }
 }
 
-static void yuv2p010l1_LE_c(const int16_t *src,
-uint8_t *dest, int dstW,
-const uint8_t *dither, int offset)
-{
-yuv2p010l1_c(src, (uint16_t*)dest, dstW, 0);
-}
-
-static void yuv2p010l1_BE_c(const int16_t *src,
-uint8_t *dest, int dstW,
-const uint8_t *dither, int offset)
-{
-yuv2p010l1_c(src, (uint16_t*)dest, dstW, 1);
-}
-
-static void yuv2p010lX_LE_c(const int16_t *filter, int filterSize,
-const int16_t **src, uint8_t *dest, int dstW,
-const uint8_t *dither, int offset)
-{
-yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 0);
-}
-
-static void yuv2p010lX_BE_c(const int16_t *filter, int filterSize,
-const int16_t **src, uint8_t *dest, int dstW,
-const uint8_t *dither, int offset)
-{
-yuv2p010lX_c(filter, filterSize, src, (uint16_t*)dest, dstW, 1);
-}
-
-static void yuv2p010cX_LE_c(enum AVPixelFormat dstFormat, const uint8_t 
*chrDither,
-const int16_t *chrFilter, int chrFilterSize,
-const int16_t **chrUSrc, const int16_t **chrVSrc,
-uint8_t *dest8, int chrDstW)
-{
-yuv2p010cX_c(0,

[FFmpeg-cvslog] swscale/output: add support for XV36LE

2022-09-10 Thread Philip Langdale
ffmpeg | branch: master | Philip Langdale  | Mon Sep  5 
13:41:00 2022 -0700| [366f073c624779af852bacbc9a0a416e27ff96f7] | committer: 
Philip Langdale

swscale/output: add support for XV36LE

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

 libswscale/output.c  | 29 +
 libswscale/utils.c   |  2 +-
 libswscale/version.h |  2 +-
 tests/ref/fate/filter-pixdesc-xv36le |  1 +
 tests/ref/fate/filter-pixfmts-copy   |  1 +
 tests/ref/fate/filter-pixfmts-crop   |  1 +
 tests/ref/fate/filter-pixfmts-field  |  1 +
 tests/ref/fate/filter-pixfmts-fieldorder |  1 +
 tests/ref/fate/filter-pixfmts-hflip  |  1 +
 tests/ref/fate/filter-pixfmts-il |  1 +
 tests/ref/fate/filter-pixfmts-null   |  1 +
 tests/ref/fate/filter-pixfmts-scale  |  1 +
 tests/ref/fate/filter-pixfmts-transpose  |  1 +
 tests/ref/fate/filter-pixfmts-vflip  |  1 +
 14 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index da6c026916..228dab462e 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2600,6 +2600,32 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
 }
 }
 
+static void
+yuv2xv36le_X_c(SwsContext *c, const int16_t *lumFilter,
+   const int16_t **lumSrc, int lumFilterSize,
+   const int16_t *chrFilter, const int16_t **chrUSrc,
+   const int16_t **chrVSrc, int chrFilterSize,
+   const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+{
+int i;
+for (i = 0; i < dstW; i++) {
+int Y = 1 << 14, U = 1 << 14, V = 1 << 14;
+int j;
+
+for (j = 0; j < lumFilterSize; j++)
+Y += lumSrc[j][i] * lumFilter[j];
+
+for (j = 0; j < chrFilterSize; j++) {
+U += chrUSrc[j][i] * chrFilter[j];
+V += chrVSrc[j][i] * chrFilter[j];
+}
+
+AV_WL16(dest + 8 * i + 2, av_clip_uintp2(Y >> 15, 12) << 4);
+AV_WL16(dest + 8 * i + 0, av_clip_uintp2(U >> 15, 12) << 4);
+AV_WL16(dest + 8 * i + 4, av_clip_uintp2(V >> 15, 12) << 4);
+}
+}
+
 static void
 yuv2vuyX_X_c(SwsContext *c, const int16_t *lumFilter,
  const int16_t **lumSrc, int lumFilterSize,
@@ -3192,5 +3218,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
 case AV_PIX_FMT_VUYX:
 *yuv2packedX = yuv2vuyx_X_c;
 break;
+case AV_PIX_FMT_XV36LE:
+*yuv2packedX = yuv2xv36le_X_c;
+break;
 }
 }
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 599c326754..9166e80002 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -266,7 +266,7 @@ static const FormatEntry format_entries[] = {
 [AV_PIX_FMT_RGBAF16BE]   = { 1, 0 },
 [AV_PIX_FMT_RGBAF16LE]   = { 1, 0 },
 [AV_PIX_FMT_XV30LE]  = { 1, 0 },
-[AV_PIX_FMT_XV36LE]  = { 1, 0 },
+[AV_PIX_FMT_XV36LE]  = { 1, 1 },
 };
 
 int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos,
diff --git a/libswscale/version.h b/libswscale/version.h
index 284c13cc23..c35e51138d 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -29,7 +29,7 @@
 #include "version_major.h"
 
 #define LIBSWSCALE_VERSION_MINOR   8
-#define LIBSWSCALE_VERSION_MICRO 109
+#define LIBSWSCALE_VERSION_MICRO 110
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
diff --git a/tests/ref/fate/filter-pixdesc-xv36le 
b/tests/ref/fate/filter-pixdesc-xv36le
new file mode 100644
index 00..8ba8099423
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-xv36le
@@ -0,0 +1 @@
+pixdesc-xv36le  9d00bb58092f8b6d5d6fd71a8aec719a
diff --git a/tests/ref/fate/filter-pixfmts-copy 
b/tests/ref/fate/filter-pixfmts-copy
index d92dd169dc..c88594f3aa 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -95,6 +95,7 @@ vuya3d5e934651cae1ce334001cb1829ad22
 vuyx3f68ea6ec492b30d867cb5401562264e
 x2bgr10le   550c0d190cf695afa4eaacb644db6b75
 x2rgb10le   c1e3ac21be04a16bb157b22784524520
+xv36le  3f8ced42a081639a39ec5929dd77b017
 xyz12be a1ef56bf746d71f59669c28e48fc8450
 xyz12le 831ff03c1ba4ef19374686f16a064d8c
 ya16be  37c07787e544f900c87b853253bfc8dd
diff --git a/tests/ref/fate/filter-pixfmts-crop 
b/tests/ref/fate/filter-pixfmts-crop
index f7103a5906..bdad0d02cd 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -92,6 +92,7 @@ vuya76578a705ff3a37559653c1289bd03dd
 vuyx5d2bae51a2f4892bd5f177f190cc323b
 x2bgr10le   84de725b85662c362862820dc4a309aa
 x2rgb10le   f4265aca7a67dbfa9354370098ca6f33
+xv36le  90a187adf00a1b15c33d064ae2582804
 xyz12be cb4571f9aaa7b59f999e

[FFmpeg-cvslog] swscale/output: add support for XV30LE

2022-09-10 Thread Philip Langdale
ffmpeg | branch: master | Philip Langdale  | Mon Sep  5 
20:00:59 2022 -0700| [68181623e984b249402ac6fd0849c032b05ae143] | committer: 
Philip Langdale

swscale/output: add support for XV30LE

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

 libswscale/output.c  | 31 +++
 libswscale/utils.c   |  2 +-
 libswscale/version.h |  2 +-
 tests/ref/fate/filter-pixdesc-xv30le |  1 +
 tests/ref/fate/filter-pixfmts-copy   |  1 +
 tests/ref/fate/filter-pixfmts-crop   |  1 +
 tests/ref/fate/filter-pixfmts-field  |  1 +
 tests/ref/fate/filter-pixfmts-fieldorder |  1 +
 tests/ref/fate/filter-pixfmts-hflip  |  1 +
 tests/ref/fate/filter-pixfmts-il |  1 +
 tests/ref/fate/filter-pixfmts-null   |  1 +
 tests/ref/fate/filter-pixfmts-scale  |  1 +
 tests/ref/fate/filter-pixfmts-transpose  |  1 +
 tests/ref/fate/filter-pixfmts-vflip  |  1 +
 14 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 228dab462e..39e2a04609 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2600,6 +2600,34 @@ yuv2ayuv64le_X_c(SwsContext *c, const int16_t *lumFilter,
 }
 }
 
+static void
+yuv2xv30le_X_c(SwsContext *c, const int16_t *lumFilter,
+   const int16_t **lumSrc, int lumFilterSize,
+   const int16_t *chrFilter, const int16_t **chrUSrc,
+   const int16_t **chrVSrc, int chrFilterSize,
+   const int16_t **alpSrc, uint8_t *dest, int dstW, int y)
+{
+int i;
+for (i = 0; i < dstW; i++) {
+int Y = 1 << 16, U = 1 << 16, V = 1 << 16;
+int j;
+
+for (j = 0; j < lumFilterSize; j++)
+Y += lumSrc[j][i] * lumFilter[j];
+
+for (j = 0; j < chrFilterSize; j++) {
+U += chrUSrc[j][i] * chrFilter[j];
+V += chrVSrc[j][i] * chrFilter[j];
+}
+
+Y = av_clip_uintp2(Y >> 17, 10);
+U = av_clip_uintp2(U >> 17, 10);
+V = av_clip_uintp2(V >> 17, 10);
+
+AV_WL32(dest + 4 * i, U | Y << 10 | V << 20);
+}
+}
+
 static void
 yuv2xv36le_X_c(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
@@ -3218,6 +3246,9 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
 case AV_PIX_FMT_VUYX:
 *yuv2packedX = yuv2vuyx_X_c;
 break;
+case AV_PIX_FMT_XV30LE:
+*yuv2packedX = yuv2xv30le_X_c;
+break;
 case AV_PIX_FMT_XV36LE:
 *yuv2packedX = yuv2xv36le_X_c;
 break;
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 9166e80002..ec67020cc9 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -265,7 +265,7 @@ static const FormatEntry format_entries[] = {
 [AV_PIX_FMT_VUYX]= { 1, 1 },
 [AV_PIX_FMT_RGBAF16BE]   = { 1, 0 },
 [AV_PIX_FMT_RGBAF16LE]   = { 1, 0 },
-[AV_PIX_FMT_XV30LE]  = { 1, 0 },
+[AV_PIX_FMT_XV30LE]  = { 1, 1 },
 [AV_PIX_FMT_XV36LE]  = { 1, 1 },
 };
 
diff --git a/libswscale/version.h b/libswscale/version.h
index c35e51138d..e8f1dadb8b 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -29,7 +29,7 @@
 #include "version_major.h"
 
 #define LIBSWSCALE_VERSION_MINOR   8
-#define LIBSWSCALE_VERSION_MICRO 110
+#define LIBSWSCALE_VERSION_MICRO 111
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \
diff --git a/tests/ref/fate/filter-pixdesc-xv30le 
b/tests/ref/fate/filter-pixdesc-xv30le
new file mode 100644
index 00..9b5ad5417e
--- /dev/null
+++ b/tests/ref/fate/filter-pixdesc-xv30le
@@ -0,0 +1 @@
+pixdesc-xv30le  fb76a14d6d5cf3a0b48f30b2fb59becd
diff --git a/tests/ref/fate/filter-pixfmts-copy 
b/tests/ref/fate/filter-pixfmts-copy
index c88594f3aa..67383c43f8 100644
--- a/tests/ref/fate/filter-pixfmts-copy
+++ b/tests/ref/fate/filter-pixfmts-copy
@@ -95,6 +95,7 @@ vuya3d5e934651cae1ce334001cb1829ad22
 vuyx3f68ea6ec492b30d867cb5401562264e
 x2bgr10le   550c0d190cf695afa4eaacb644db6b75
 x2rgb10le   c1e3ac21be04a16bb157b22784524520
+xv30le  c14b5a953bf3be56346f66ca174a5b1b
 xv36le  3f8ced42a081639a39ec5929dd77b017
 xyz12be a1ef56bf746d71f59669c28e48fc8450
 xyz12le 831ff03c1ba4ef19374686f16a064d8c
diff --git a/tests/ref/fate/filter-pixfmts-crop 
b/tests/ref/fate/filter-pixfmts-crop
index bdad0d02cd..bdb2536f7d 100644
--- a/tests/ref/fate/filter-pixfmts-crop
+++ b/tests/ref/fate/filter-pixfmts-crop
@@ -92,6 +92,7 @@ vuya76578a705ff3a37559653c1289bd03dd
 vuyx5d2bae51a2f4892bd5f177f190cc323b
 x2bgr10le   84de725b85662c362862820dc4a309aa
 x2rgb10le   f4265aca7a67dbfa9354370098ca6f33
+xv30le  a9edb820819b900a4a897fee4562a4fb
 xv36le 

[FFmpeg-cvslog] swscale/output: add support for Y210LE and Y212LE

2022-09-10 Thread Philip Langdale
ffmpeg | branch: master | Philip Langdale  | Mon Sep  5 
21:47:29 2022 -0700| [09a8e5debb284984871bd3eabd139b7207eedcdc] | committer: 
Philip Langdale

swscale/output: add support for Y210LE and Y212LE

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

 libswscale/output.c  | 48 
 libswscale/utils.c   |  4 +--
 libswscale/version.h |  2 +-
 tests/ref/fate/filter-pixdesc-y210le |  1 +
 tests/ref/fate/filter-pixdesc-y212le |  1 +
 tests/ref/fate/filter-pixfmts-copy   |  2 ++
 tests/ref/fate/filter-pixfmts-field  |  2 ++
 tests/ref/fate/filter-pixfmts-fieldorder |  2 ++
 tests/ref/fate/filter-pixfmts-il |  2 ++
 tests/ref/fate/filter-pixfmts-null   |  2 ++
 tests/ref/fate/filter-pixfmts-scale  |  2 ++
 tests/ref/fate/filter-pixfmts-vflip  |  2 ++
 12 files changed, 67 insertions(+), 3 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 39e2a04609..2f599698e9 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2732,6 +2732,48 @@ yuv2vuyx_X_c(SwsContext *c, const int16_t *lumFilter,
  chrUSrc, chrVSrc, chrFilterSize, alpSrc, dest, dstW, y, 0);
 }
 
+#define output_pixel(pos, val, bits) \
+AV_WL16(pos, av_clip_uintp2(val >> shift, bits) << output_shift);
+
+#define yuv2y2xx_wrapper(bits)  \
+static void \
+yuv2y2 ## bits ## le_X_c(SwsContext *c, const int16_t *lumFilter,   \
+const int16_t **lumSrc, int lumFilterSize,  \
+const int16_t *chrFilter,   \
+const int16_t **chrUSrc,\
+const int16_t **chrVSrc, int chrFilterSize, \
+const int16_t **alpSrc, \
+uint8_t *dest, int dstW, int y) \
+{   \
+int i, j;   \
+int shift = 11 + 16 - bits; \
+int output_shift = 16 - bits;   \
+for (i = 0; i < ((dstW + 1) >> 1); i++) {   \
+int Y1 = 1 << (shift - 1), Y2 = 1 << (shift - 1);   \
+int U  = 1 << (shift - 1), V  = 1 << (shift - 1);   \
+\
+for (j = 0; j < lumFilterSize; j++) {   \
+Y1 += lumSrc[j][i * 2] * lumFilter[j];  \
+Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j];  \
+}   \
+\
+for (j = 0; j < chrFilterSize; j++) {   \
+U += chrUSrc[j][i] * chrFilter[j];  \
+V += chrVSrc[j][i] * chrFilter[j];  \
+}   \
+\
+output_pixel(dest + 8 * i + 0, Y1, bits);   \
+output_pixel(dest + 8 * i + 2,  U, bits);   \
+output_pixel(dest + 8 * i + 4, Y2, bits);   \
+output_pixel(dest + 8 * i + 6,  V, bits);   \
+}   \
+}
+
+yuv2y2xx_wrapper(10)
+yuv2y2xx_wrapper(12)
+
+#undef output_pixel
+
 av_cold void ff_sws_init_output_funcs(SwsContext *c,
   yuv2planar1_fn *yuv2plane1,
   yuv2planarX_fn *yuv2planeX,
@@ -3252,5 +3294,11 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
 case AV_PIX_FMT_XV36LE:
 *yuv2packedX = yuv2xv36le_X_c;
 break;
+case AV_PIX_FMT_Y210LE:
+*yuv2packedX = yuv2y210le_X_c;
+break;
+case AV_PIX_FMT_Y212LE:
+*yuv2packedX = yuv2y212le_X_c;
+break;
 }
 }
diff --git a/libswscale/utils.c b/libswscale/utils.c
index ec67020cc9..14e2700733 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -248,8 +248,8 @@ static const FormatEntry format_entries[] = {
 [AV_PIX_FMT_YUVA444P12LE] = { 1, 1 },
 [AV_PIX_FMT_NV24]= { 1, 1 },
 [AV_PIX_FMT_NV42]= { 1, 1 },
-[AV_PIX_FMT_Y210LE]  = { 1, 0 },
-[AV_PIX_FMT_Y212LE]  = { 1, 0 },
+[AV_PIX_FMT_Y210LE]  = { 1, 1 },
+[AV_PIX_FMT_Y212LE]  = { 1, 1 },
 [AV_PIX_FMT_X2RGB10LE]   = { 1, 1 },
 [AV_PIX_FMT_X2BGR10LE]   = { 1, 1 },
 

[FFmpeg-cvslog] avfilter/vf_gblur: allow filtering with zero horizontal sigma

2022-09-10 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Sep 10 22:06:16 
2022 +0200| [09cce812453f989a0537c62b6db1020ea266553d] | committer: Paul B Mahol

avfilter/vf_gblur: allow filtering with zero horizontal sigma

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

 libavfilter/vf_gblur.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c
index bb4c342116..ca1dcb3dab 100644
--- a/libavfilter/vf_gblur.c
+++ b/libavfilter/vf_gblur.c
@@ -125,7 +125,7 @@ static void gaussianiir2d(AVFilterContext *ctx, int plane)
 const int nb_threads = ff_filter_get_nb_threads(ctx);
 ThreadData td;
 
-if (s->sigma <= 0 || s->steps < 0)
+if (s->sigma < 0 || s->steps < 0)
 return;
 
 td.width = width;
@@ -247,7 +247,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 uint16_t *dst16 = (uint16_t *)out->data[plane];
 int y, x;
 
-if (!s->sigma || !(s->planes & (1 << plane))) {
+if (!(s->planes & (1 << plane))) {
 if (out != in)
 av_image_copy_plane(out->data[plane], out->linesize[plane],
 in->data[plane], in->linesize[plane],

___
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] swscale/la: Optimize hscale functions with lasx.

2022-09-10 Thread Hao Chen
ffmpeg | branch: master | Hao Chen  | Fri Sep  9 17:00:24 
2022 +0800| [38cacce22a613d660d4d78e65b0ecdb7be0b908c] | committer: Michael 
Niedermayer

swscale/la: Optimize hscale functions with lasx.

ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -s 640x480 -y /dev/null -an
before: 101fps
after:  138fps

Signed-off-by: Hao Chen 
Reviewed-by: yinshiyou...@loongson.cn
Signed-off-by: Michael Niedermayer 

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

 libswscale/loongarch/Makefile |   3 +
 libswscale/loongarch/input_lasx.c | 202 ++
 libswscale/loongarch/swscale_init_loongarch.c |  50 ++
 libswscale/loongarch/swscale_lasx.c   | 972 ++
 libswscale/loongarch/swscale_loongarch.h  |  50 ++
 libswscale/swscale.c  |   2 +
 libswscale/swscale_internal.h |   2 +
 libswscale/utils.c|  13 +-
 8 files changed, 1293 insertions(+), 1 deletion(-)

diff --git a/libswscale/loongarch/Makefile b/libswscale/loongarch/Makefile
new file mode 100644
index 00..586a1717b6
--- /dev/null
+++ b/libswscale/loongarch/Makefile
@@ -0,0 +1,3 @@
+OBJS-$(CONFIG_SWSCALE)  += loongarch/swscale_init_loongarch.o
+LASX-OBJS-$(CONFIG_SWSCALE) += loongarch/swscale_lasx.o \
+   loongarch/input_lasx.o   \
diff --git a/libswscale/loongarch/input_lasx.c 
b/libswscale/loongarch/input_lasx.c
new file mode 100644
index 00..4830072eaf
--- /dev/null
+++ b/libswscale/loongarch/input_lasx.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2022 Loongson Technology Corporation Limited
+ * Contributed by Hao Chen(chen...@loongson.cn)
+ *
+ * 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 "swscale_loongarch.h"
+#include "libavutil/loongarch/loongson_intrinsics.h"
+
+void planar_rgb_to_uv_lasx(uint8_t *_dstU, uint8_t *_dstV, const uint8_t 
*src[4],
+   int width, int32_t *rgb2yuv, void *opq)
+{
+int i;
+uint16_t *dstU   = (uint16_t *)_dstU;
+uint16_t *dstV   = (uint16_t *)_dstV;
+int set  = 0x4001 << (RGB2YUV_SHIFT - 7);
+int len  = width - 15;
+int32_t tem_ru   = rgb2yuv[RU_IDX], tem_gu = rgb2yuv[GU_IDX];
+int32_t tem_bu = rgb2yuv[BU_IDX], tem_rv   = rgb2yuv[RV_IDX];
+int32_t tem_gv = rgb2yuv[GV_IDX], tem_bv = rgb2yuv[BV_IDX];
+int shift= RGB2YUV_SHIFT - 6;
+const uint8_t *src0 = src[0], *src1 = src[1], *src2 = src[2];
+__m256i ru, gu, bu, rv, gv, bv;
+__m256i mask = {0x0D0C090805040100, 0x1D1C191815141110,
+0x0D0C090805040100, 0x1D1C191815141110};
+__m256i temp = __lasx_xvreplgr2vr_w(set);
+__m256i sra  = __lasx_xvreplgr2vr_w(shift);
+
+ru = __lasx_xvreplgr2vr_w(tem_ru);
+gu = __lasx_xvreplgr2vr_w(tem_gu);
+bu = __lasx_xvreplgr2vr_w(tem_bu);
+rv = __lasx_xvreplgr2vr_w(tem_rv);
+gv = __lasx_xvreplgr2vr_w(tem_gv);
+bv = __lasx_xvreplgr2vr_w(tem_bv);
+for (i = 0; i < len; i += 16) {
+__m256i _g, _b, _r;
+__m256i g_l, g_h, b_l, b_h, r_l, r_h;
+__m256i v_l, v_h, u_l, u_h, u_lh, v_lh;
+
+_g  = __lasx_xvldx(src0, i);
+_b  = __lasx_xvldx(src1, i);
+_r  = __lasx_xvldx(src2, i);
+g_l = __lasx_vext2xv_wu_bu(_g);
+b_l = __lasx_vext2xv_wu_bu(_b);
+r_l = __lasx_vext2xv_wu_bu(_r);
+_g  = __lasx_xvpermi_d(_g, 0x01);
+_b  = __lasx_xvpermi_d(_b, 0x01);
+_r  = __lasx_xvpermi_d(_r, 0x01);
+g_h = __lasx_vext2xv_wu_bu(_g);
+b_h = __lasx_vext2xv_wu_bu(_b);
+r_h = __lasx_vext2xv_wu_bu(_r);
+u_l  = __lasx_xvmadd_w(temp, ru, r_l);
+u_h  = __lasx_xvmadd_w(temp, ru, r_h);
+v_l  = __lasx_xvmadd_w(temp, rv, r_l);
+v_h  = __lasx_xvmadd_w(temp, rv, r_h);
+u_l  = __lasx_xvmadd_w(u_l, gu, g_l);
+u_l  = __lasx_xvmadd_w(u_l, bu, b_l);
+u_h  = __lasx_xvmadd_w(u_h, gu, g_h);
+u_h  = __lasx_xvmadd_w(u_h, bu, b_h);
+v_l  = __lasx_xvmadd_w(v_l, gv, g_l);
+v_l  = __lasx_xvmadd_w(v_l, bv, b_l);
+v_h  = __lasx_xvmadd_w(v_h, gv, g_h);
+v_h  = __lasx_xvmadd_w(v_h, bv, b_h);
+u_l  = __

[FFmpeg-cvslog] swscale/la: Add yuv2rgb_lasx.c and rgb2rgb_lasx.c files

2022-09-10 Thread Hao Chen
ffmpeg | branch: master | Hao Chen  | Fri Sep  9 17:00:25 
2022 +0800| [74d09b068dad88b037f6d0be4b0594eb2e2759e9] | committer: Michael 
Niedermayer

swscale/la: Add yuv2rgb_lasx.c and rgb2rgb_lasx.c files

ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -pix_fmt rgb24 -y /dev/null 
-an
before: 178fps
after:  210fps

Signed-off-by: Hao Chen 
Reviewed-by: yinshiyou...@loongson.cn
Signed-off-by: Michael Niedermayer 

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

 libswscale/loongarch/Makefile |   2 +
 libswscale/loongarch/rgb2rgb_lasx.c   |  52 +
 libswscale/loongarch/swscale_init_loongarch.c |  42 
 libswscale/loongarch/swscale_loongarch.h  |  22 ++
 libswscale/loongarch/yuv2rgb_lasx.c   | 321 ++
 libswscale/rgb2rgb.c  |   2 +
 libswscale/rgb2rgb.h  |   1 +
 libswscale/yuv2rgb.c  |   2 +
 8 files changed, 444 insertions(+)

diff --git a/libswscale/loongarch/Makefile b/libswscale/loongarch/Makefile
index 586a1717b6..4345971514 100644
--- a/libswscale/loongarch/Makefile
+++ b/libswscale/loongarch/Makefile
@@ -1,3 +1,5 @@
 OBJS-$(CONFIG_SWSCALE)  += loongarch/swscale_init_loongarch.o
 LASX-OBJS-$(CONFIG_SWSCALE) += loongarch/swscale_lasx.o \
loongarch/input_lasx.o   \
+   loongarch/yuv2rgb_lasx.o \
+   loongarch/rgb2rgb_lasx.o
diff --git a/libswscale/loongarch/rgb2rgb_lasx.c 
b/libswscale/loongarch/rgb2rgb_lasx.c
new file mode 100644
index 00..1b6be90217
--- /dev/null
+++ b/libswscale/loongarch/rgb2rgb_lasx.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2022 Loongson Technology Corporation Limited
+ * Contributed by Hao Chen(chen...@loongson.cn)
+ *
+ * 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 "swscale_loongarch.h"
+#include "libavutil/loongarch/loongson_intrinsics.h"
+
+void ff_interleave_bytes_lasx(const uint8_t *src1, const uint8_t *src2,
+  uint8_t *dest, int width, int height,
+  int src1Stride, int src2Stride, int dstStride)
+{
+int h;
+int len = width & (0xFFF0);
+
+for (h = 0; h < height; h++) {
+int w, index = 0;
+__m256i src_1, src_2, dst;
+
+for (w = 0; w < len; w += 16) {
+DUP2_ARG2(__lasx_xvld, src1 + w, 0, src2 + w, 0, src_1, src_2);
+src_1 = __lasx_xvpermi_d(src_1, 0xD8);
+src_2 = __lasx_xvpermi_d(src_2, 0xD8);
+dst   = __lasx_xvilvl_b(src_2, src_1);
+__lasx_xvst(dst, dest + index, 0);
+index  += 32;
+}
+for (; w < width; w++) {
+dest[(w << 1) + 0] = src1[w];
+dest[(w << 1) + 1] = src2[w];
+}
+dest += dstStride;
+src1 += src1Stride;
+src2 += src2Stride;
+}
+}
diff --git a/libswscale/loongarch/swscale_init_loongarch.c 
b/libswscale/loongarch/swscale_init_loongarch.c
index 197dc6e1e7..1e0bb1b116 100644
--- a/libswscale/loongarch/swscale_init_loongarch.c
+++ b/libswscale/loongarch/swscale_init_loongarch.c
@@ -21,6 +21,7 @@
 
 #include "swscale_loongarch.h"
 #include "libswscale/swscale_internal.h"
+#include "libswscale/rgb2rgb.h"
 #include "libavutil/loongarch/cpu.h"
 
 av_cold void ff_sws_init_swscale_loongarch(SwsContext *c)
@@ -48,3 +49,44 @@ av_cold void ff_sws_init_swscale_loongarch(SwsContext *c)
 }
 }
 }
+
+av_cold void rgb2rgb_init_loongarch(void)
+{
+int cpu_flags = av_get_cpu_flags();
+if (have_lasx(cpu_flags))
+interleaveBytes = ff_interleave_bytes_lasx;
+}
+
+av_cold SwsFunc ff_yuv2rgb_init_loongarch(SwsContext *c)
+{
+int cpu_flags = av_get_cpu_flags();
+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_P

[FFmpeg-cvslog] swscale/la: Add output_lasx.c file.

2022-09-10 Thread Hao Chen
ffmpeg | branch: master | Hao Chen  | Fri Sep  9 17:00:26 
2022 +0800| [925ac0da32697ef5853e90e0be56e106208099e2] | committer: Michael 
Niedermayer

swscale/la: Add output_lasx.c file.

ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -s 640x480 -pix_fmt
rgb24 -y /dev/null -an
before: 150fps
after:  183fps

Signed-off-by: Hao Chen 
Reviewed-by: yinshiyou...@loongson.cn
Signed-off-by: Michael Niedermayer 

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

 libswscale/loongarch/Makefile |3 +-
 libswscale/loongarch/output_lasx.c| 1982 +
 libswscale/loongarch/swscale_init_loongarch.c |3 +
 libswscale/loongarch/swscale_loongarch.h  |6 +
 4 files changed, 1993 insertions(+), 1 deletion(-)

diff --git a/libswscale/loongarch/Makefile b/libswscale/loongarch/Makefile
index 4345971514..8e665e826c 100644
--- a/libswscale/loongarch/Makefile
+++ b/libswscale/loongarch/Makefile
@@ -2,4 +2,5 @@ OBJS-$(CONFIG_SWSCALE)  += 
loongarch/swscale_init_loongarch.o
 LASX-OBJS-$(CONFIG_SWSCALE) += loongarch/swscale_lasx.o \
loongarch/input_lasx.o   \
loongarch/yuv2rgb_lasx.o \
-   loongarch/rgb2rgb_lasx.o
+   loongarch/rgb2rgb_lasx.o \
+   loongarch/output_lasx.o
diff --git a/libswscale/loongarch/output_lasx.c 
b/libswscale/loongarch/output_lasx.c
new file mode 100644
index 00..36a4c4503b
--- /dev/null
+++ b/libswscale/loongarch/output_lasx.c
@@ -0,0 +1,1982 @@
+/*
+ * Copyright (C) 2022 Loongson Technology Corporation Limited
+ * Contributed by Hao Chen(chen...@loongson.cn)
+ *
+ * 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 "swscale_loongarch.h"
+#include "libavutil/loongarch/loongson_intrinsics.h"
+
+void ff_yuv2planeX_8_lasx(const int16_t *filter, int filterSize,
+  const int16_t **src, uint8_t *dest, int dstW,
+  const uint8_t *dither, int offset)
+{
+int i;
+int len = dstW - 15;
+__m256i mask = {0x1C0C180814041000, 0x1C1814100C080400,
+0x1C0C180814041000, 0x1C1814100C080400};
+__m256i val1, val2, val3;
+uint8_t dither0 = dither[offset & 7];
+uint8_t dither1 = dither[(offset + 1) & 7];
+uint8_t dither2 = dither[(offset + 2) & 7];
+uint8_t dither3 = dither[(offset + 3) & 7];
+uint8_t dither4 = dither[(offset + 4) & 7];
+uint8_t dither5 = dither[(offset + 5) & 7];
+uint8_t dither6 = dither[(offset + 6) & 7];
+uint8_t dither7 = dither[(offset + 7) & 7];
+int val_1[8] = {dither0, dither2, dither4, dither6,
+dither0, dither2, dither4, dither6};
+int val_2[8] = {dither1, dither3, dither5, dither7,
+dither1, dither3, dither5, dither7};
+int val_3[8] = {dither0, dither1, dither2, dither3,
+dither4, dither5, dither6, dither7};
+
+DUP2_ARG2(__lasx_xvld, val_1, 0, val_2, 0, val1, val2);
+val3 = __lasx_xvld(val_3, 0);
+
+for (i = 0; i < len; i += 16) {
+int j;
+__m256i src0, filter0, val;
+__m256i val_ev, val_od;
+
+val_ev = __lasx_xvslli_w(val1, 12);
+val_od = __lasx_xvslli_w(val2, 12);
+
+for (j = 0; j < filterSize; j++) {
+src0  = __lasx_xvld(src[j]+ i, 0);
+filter0 = __lasx_xvldrepl_h((filter + j), 0);
+val_ev = __lasx_xvmaddwev_w_h(val_ev, src0, filter0);
+val_od = __lasx_xvmaddwod_w_h(val_od, src0, filter0);
+}
+val_ev = __lasx_xvsrai_w(val_ev, 19);
+val_od = __lasx_xvsrai_w(val_od, 19);
+val_ev = __lasx_xvclip255_w(val_ev);
+val_od = __lasx_xvclip255_w(val_od);
+val= __lasx_xvshuf_b(val_od, val_ev, mask);
+__lasx_xvstelm_d(val, (dest + i), 0, 0);
+__lasx_xvstelm_d(val, (dest + i), 8, 2);
+}
+if (dstW - i >= 8){
+int j;
+__m256i src0, filter0, val_h;
+__m256i val_l;
+
+val_l = __lasx_xvslli_w(val3, 12);
+
+for (j = 0; j < filterSize; j++) {
+src0  = __lasx_xvld(src[j] + i, 0);
+src0  = __lasx_vext2x

[FFmpeg-cvslog] lavu/tx: remove av_cold from table definitions

2022-09-10 Thread Lynne
ffmpeg | branch: master | Lynne  | Sun Sep 11 03:16:43 2022 
+0200| [f1b35fc8f01b3882490f626a18fcf0b407d41848] | committer: Lynne

lavu/tx: remove av_cold from table definitions

How did this get here?

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

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

diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index 0c7ddd26f6..5e7159bd87 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -104,7 +104,7 @@ static FFSRTabsInitOnce sr_tabs_init_once[] = {
 { TX_TAB(ff_tx_init_tab_131072), AV_ONCE_INIT },
 };
 
-static av_cold void TX_TAB(ff_tx_init_tab_53)(void)
+static void TX_TAB(ff_tx_init_tab_53)(void)
 {
 TX_TAB(ff_tx_tab_53)[0] = RESCALE(cos(2 * M_PI / 12));
 TX_TAB(ff_tx_tab_53)[1] = RESCALE(cos(2 * M_PI / 12));
@@ -116,7 +116,7 @@ static av_cold void TX_TAB(ff_tx_init_tab_53)(void)
 TX_TAB(ff_tx_tab_53)[7] = RESCALE(sin(6 * M_PI /  5));
 }
 
-static av_cold void TX_TAB(ff_tx_init_tab_7)(void)
+static void TX_TAB(ff_tx_init_tab_7)(void)
 {
 TX_TAB(ff_tx_tab_7)[0] = RESCALE(cos(2 * M_PI /  7));
 TX_TAB(ff_tx_tab_7)[1] = RESCALE(sin(2 * M_PI /  7));
@@ -126,7 +126,7 @@ static av_cold void TX_TAB(ff_tx_init_tab_7)(void)
 TX_TAB(ff_tx_tab_7)[5] = RESCALE(sin(2 * M_PI / 14));
 }
 
-static av_cold void TX_TAB(ff_tx_init_tab_9)(void)
+static void TX_TAB(ff_tx_init_tab_9)(void)
 {
 TX_TAB(ff_tx_tab_9)[0] = RESCALE(cos(2 * M_PI /  3));
 TX_TAB(ff_tx_tab_9)[1] = RESCALE(sin(2 * M_PI /  3));

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