[FFmpeg-cvslog] avcodec/Makefile: remove redundant object

2025-03-15 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Mar  
2 19:03:29 2025 +0100| [4c7d0f88f5075df4f1997334eda841d24cb59725] | committer: 
Timo Rothenpieler

avcodec/Makefile: remove redundant object

It's already listed in OBJS-$(CONFIG_JNI), which should cover all cases
STLIBOBJS does and more.

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

 libavcodec/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index acd6b8b5f3..3c7043a617 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1085,7 +1085,6 @@ STLIBOBJS-$(CONFIG_ISO_MEDIA)  += mpegaudiotabs.o
 STLIBOBJS-$(CONFIG_FLV_MUXER)  += mpeg4audio_sample_rates.o
 STLIBOBJS-$(CONFIG_HLS_DEMUXER)+= ac3_channel_layout_tab.o
 STLIBOBJS-$(CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER) += jpegxl_parse.o
-STLIBOBJS-$(CONFIG_JNI)+= ffjni.o
 STLIBOBJS-$(CONFIG_JPEGXL_ANIM_DEMUXER)   += jpegxl_parse.o
 STLIBOBJS-$(CONFIG_MATROSKA_DEMUXER)   += mpeg4audio_sample_rates.o
 STLIBOBJS-$(CONFIG_MOV_DEMUXER)+= ac3_channel_layout_tab.o

___
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/swscale_unscaled: account for semi planar formats with data in the msb

2025-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Mar 14 11:25:20 
2025 -0300| [819dec697a93f42dc23c4efbcf86e05bb7e128ac] | committer: James Almer

swscale/swscale_unscaled: account for semi planar formats with data in the msb

Fixes fate failures introduced by recent tests that exercise the faulty code.

Signed-off-by: James Almer 

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

 libswscale/swscale_unscaled.c | 74 ++-
 tests/ref/pixfmt/p410-nv24|  2 +-
 tests/ref/pixfmt/p410-p412be  |  2 +-
 tests/ref/pixfmt/p410-p412le  |  2 +-
 tests/ref/pixfmt/p410-p416be  |  2 +-
 tests/ref/pixfmt/p410-p416le  |  2 +-
 tests/ref/pixfmt/p412-nv24|  2 +-
 tests/ref/pixfmt/p412-p410be  |  2 +-
 tests/ref/pixfmt/p412-p410le  |  2 +-
 tests/ref/pixfmt/p412-p416be  |  2 +-
 tests/ref/pixfmt/p412-p416le  |  2 +-
 11 files changed, 48 insertions(+), 46 deletions(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 1ab36b9568..92d5386567 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -2146,17 +2146,17 @@ static int packedCopyWrapper(SwsInternal *c, const 
uint8_t *const src[],
 if (c->opts.dither == SWS_DITHER_NONE) {\
 for (i = 0; i < height; i++) {\
 for (j = 0; j < length-7; j+=8) {\
-tmp = (bswap(src[j+0]) + bias)>>shift; dst[j+0] = dbswap(tmp - 
(tmp>>dst_depth));\
-tmp = (bswap(src[j+1]) + bias)>>shift; dst[j+1] = dbswap(tmp - 
(tmp>>dst_depth));\
-tmp = (bswap(src[j+2]) + bias)>>shift; dst[j+2] = dbswap(tmp - 
(tmp>>dst_depth));\
-tmp = (bswap(src[j+3]) + bias)>>shift; dst[j+3] = dbswap(tmp - 
(tmp>>dst_depth));\
-tmp = (bswap(src[j+4]) + bias)>>shift; dst[j+4] = dbswap(tmp - 
(tmp>>dst_depth));\
-tmp = (bswap(src[j+5]) + bias)>>shift; dst[j+5] = dbswap(tmp - 
(tmp>>dst_depth));\
-tmp = (bswap(src[j+6]) + bias)>>shift; dst[j+6] = dbswap(tmp - 
(tmp>>dst_depth));\
-tmp = (bswap(src[j+7]) + bias)>>shift; dst[j+7] = dbswap(tmp - 
(tmp>>dst_depth));\
+tmp = ((bswap(src[j+0]) >> src_shift) + bias)>>shift; dst[j+0] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+1]) >> src_shift) + bias)>>shift; dst[j+1] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+2]) >> src_shift) + bias)>>shift; dst[j+2] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+3]) >> src_shift) + bias)>>shift; dst[j+3] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+4]) >> src_shift) + bias)>>shift; dst[j+4] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+5]) >> src_shift) + bias)>>shift; dst[j+5] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+6]) >> src_shift) + bias)>>shift; dst[j+6] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+7]) >> src_shift) + bias)>>shift; dst[j+7] 
= dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
 }\
 for (; j < length; j++) {\
-tmp = (bswap(src[j]) + bias)>>shift; dst[j] = dbswap(tmp - 
(tmp>>dst_depth));\
+tmp = (bswap(src[j]) + bias)>>shift; dst[j] = dbswap(tmp - 
(tmp>>dst_depth) << dst_shift);\
 }\
 dst += dstStride;\
 src += srcStride;\
@@ -2165,17 +2165,17 @@ static int packedCopyWrapper(SwsInternal *c, const 
uint8_t *const src[],
 for (i = 0; i < height; i++) {\
 const uint8_t *dither= dithers[shift-1][i&7];\
 for (j = 0; j < length-7; j+=8) {\
-tmp = (bswap(src[j+0]) + dither[0])>>shift; dst[j+0] = 
dbswap(tmp - (tmp>>dst_depth));\
-tmp = (bswap(src[j+1]) + dither[1])>>shift; dst[j+1] = 
dbswap(tmp - (tmp>>dst_depth));\
-tmp = (bswap(src[j+2]) + dither[2])>>shift; dst[j+2] = 
dbswap(tmp - (tmp>>dst_depth));\
-tmp = (bswap(src[j+3]) + dither[3])>>shift; dst[j+3] = 
dbswap(tmp - (tmp>>dst_depth));\
-tmp = (bswap(src[j+4]) + dither[4])>>shift; dst[j+4] = 
dbswap(tmp - (tmp>>dst_depth));\
-tmp = (bswap(src[j+5]) + dither[5])>>shift; dst[j+5] = 
dbswap(tmp - (tmp>>dst_depth));\
-tmp = (bswap(src[j+6]) + dither[6])>>shift; dst[j+6] = 
dbswap(tmp - (tmp>>dst_depth));\
-tmp = (bswap(src[j+7]) + dither[7])>>shift; dst[j+7] = 
dbswap(tmp - (tmp>>dst_depth));\
+tmp = ((bswap(src[j+0]) >> src_shift) + dither[0])>>shift; 
dst[j+0] = dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+1]) >> src_shift) + dither[1])>>shift; 
dst[j+1] = dbswap((tmp - (tmp>>dst_depth)) << dst_shift);\
+tmp = ((bswap(src[j+2]) >> src_shift) 

[FFmpeg-cvslog] swscale/swscale_unscaled: make the fast planar copy path work with more formats

2025-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Mar 14 22:14:19 
2025 -0300| [63fa1f52b9c4b37ebf7661a9851acf3ba71db303] | committer: James Almer

swscale/swscale_unscaled: make the fast planar copy path work with more formats

dst_depth - src_depth where the result is 6 or 7 in a high bd path means this
is only executed for 16 -> 10 and 16 -> 9.
This patch makes this path general, supporting arbitrary formats as long as
dst_depth > src_depth > 8.

Signed-off-by: James Almer 

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

 libswscale/swscale_unscaled.c | 30 +++---
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 92d5386567..1df160daaa 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -2267,42 +2267,34 @@ static int planarCopyWrapper(SwsInternal *c, const 
uint8_t *const src[],
 srcPtr  += srcStride[plane];
 }
 } else if (src_depth <= dst_depth) {
+unsigned shift = dst_depth - src_depth;
 for (i = 0; i < height; i++) {
 j = 0;
 if(isBE(c->opts.src_format) == HAVE_BIGENDIAN &&
isBE(c->opts.dst_format) == HAVE_BIGENDIAN &&
shiftonly) {
- unsigned shift = dst_depth - src_depth;
 #if HAVE_FAST_64BIT
-#define FAST_COPY_UP(shift) \
-for (; j < length - 3; j += 4) { \
-uint64_t v = AV_RN64A(srcPtr2 + j) >> src_shift; \
-AV_WN64A(dstPtr2 + j, v << shift); \
-}
+for (; j < length - 3; j += 4) {
+uint64_t v = AV_RN64A(srcPtr2 + j) >> 
src_shift;
+AV_WN64A(dstPtr2 + j, (v << shift) << 
dst_shift);
+}
 #else
-#define FAST_COPY_UP(shift) \
-for (; j < length - 1; j += 2) { \
-uint32_t v = AV_RN32A(srcPtr2 + j) >> src_shift; \
-AV_WN32A(dstPtr2 + j, v << shift); \
-}
+for (; j < length - 1; j += 2) {
+uint32_t v = AV_RN32A(srcPtr2 + j) >> 
src_shift;
+AV_WN32A(dstPtr2 + j, (v << shift) << 
dst_shift);
+}
 #endif
- switch (shift)
- {
- case 6: FAST_COPY_UP(6); break;
- case 7: FAST_COPY_UP(7); break;
- }
 }
 #define COPY_UP(r,w) \
 if(shiftonly){\
 for (; j < length; j++){ \
 unsigned int v= r(&srcPtr2[j]) >> src_shift;\
-w(&dstPtr2[j], (v << (dst_depth-src_depth)) << dst_shift);\
+w(&dstPtr2[j], (v << shift) << dst_shift);\
 }\
 }else{\
 for (; j < length; j++){ \
 unsigned int v= r(&srcPtr2[j]) >> src_shift;\
-w(&dstPtr2[j], ((v<<(dst_depth-src_depth)) | \
-(v>>(2*src_depth-dst_depth))) << dst_shift);\
+w(&dstPtr2[j], ((v << shift) | (v>>(2*src_depth-dst_depth))) << 
dst_shift);\
 }\
 }
 if(isBE(c->opts.src_format)){

___
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/ffv1dec: set the FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability

2025-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat Mar 15 16:09:28 
2025 -0300| [3f57063c58faf6b931ebdd239ac568f77c878cc3] | committer: James Almer

avcodec/ffv1dec: set the FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM capability

Will prevent decoding frame data during probing.

Signed-off-by: James Almer 

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

 libavcodec/ffv1dec.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index b731f11297..aa60a6c31b 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -697,6 +697,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*rframe,
 if (ret < 0)
 return ret;
 
+if (avctx->debug & FF_DEBUG_PICT_INFO)
+av_log(avctx, AV_LOG_DEBUG, "ver:%d keyframe:%d coder:%d ec:%d 
slices:%d bps:%d\n",
+   f->version, !!f->key_frame, f->ac, f->ec, f->slice_count, 
f->avctx->bits_per_raw_sample);
+
+if (avctx->skip_frame >= AVDISCARD_ALL)
+return avpkt->size;
+
 ret = ff_progress_frame_get_buffer(avctx, &f->picture,
AV_GET_BUFFER_FLAG_REF);
 if (ret < 0)
@@ -714,10 +721,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*rframe,
 p->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
 }
 
-if (avctx->debug & FF_DEBUG_PICT_INFO)
-av_log(avctx, AV_LOG_DEBUG, "ver:%d keyframe:%d coder:%d ec:%d 
slices:%d bps:%d\n",
-   f->version, !!(p->flags & AV_FRAME_FLAG_KEY), f->ac, f->ec, 
f->slice_count, f->avctx->bits_per_raw_sample);
-
 ff_thread_finish_setup(avctx);
 
 ret = decode_slices(avctx, c, avpkt);
@@ -821,5 +824,6 @@ const FFCodec ff_ffv1_decoder = {
 .p.capabilities = AV_CODEC_CAP_DR1 |
   AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_SLICE_THREADS,
 .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
+  FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM |
   FF_CODEC_CAP_USES_PROGRESSFRAMES,
 };

___
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/d3d12va_encode: use the correct specifier to log size_t values

2025-03-15 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat Mar 15 21:06:33 
2025 -0300| [c88614662cd3bcc102255665953e047ca0c381d7] | committer: James Almer

avcodec/d3d12va_encode: use the correct specifier to log size_t values

Signed-off-by: James Almer 

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

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

diff --git a/libavcodec/d3d12va_encode.c b/libavcodec/d3d12va_encode.c
index 68fb9927a8..4d738200fe 100644
--- a/libavcodec/d3d12va_encode.c
+++ b/libavcodec/d3d12va_encode.c
@@ -634,7 +634,7 @@ static int d3d12va_encode_get_coded_data(AVCodecContext 
*avctx,
 goto end;
 
 total_size += pic->header_size;
-av_log(avctx, AV_LOG_DEBUG, "Output buffer size %"PRId64"\n", total_size);
+av_log(avctx, AV_LOG_DEBUG, "Output buffer size %"SIZE_SPECIFIER"\n", 
total_size);
 
 hr = ID3D12Resource_Map(pic->output_buffer, 0, NULL, (void 
**)&mapped_data);
 if (FAILED(hr)) {

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/7.1 | Brad Smith  | 
Fri Aug 18 15:32:39 2023 -0400| [ea34bf796251d1108f34b0962a8529fe78586f8d] | 
committer: Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

(cherry picked from commit 30a8641465f7b7923e92d8724ef6a595fccb9e58)
Signed-off-by: Brad Smith 

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

 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index ffa407d53d..eedf066c38 100755
--- a/configure
+++ b/configure
@@ -2212,6 +2212,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2759,6 +2760,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6389,6 +6391,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+   vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled riscv; then
 
 enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
@@ -7941,6 +7948,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/7.1 | Brad Smith  | Tue Mar 11 
00:31:47 2025 -0400| [dca3b4760f2f77aa2f71ad2ebb63bb0144d7edfd] | committer: 
Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX

(cherry picked from commit 49c8f33262d7c113c71cee9cd30b990a92afa0a1)
Signed-off-by: Brad Smith 

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index eedf066c38..ed56cf0155 100755
--- a/configure
+++ b/configure
@@ -6391,7 +6391,7 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
-if enabled altivec && disabled vsx; then
+if enabled altivec; then
 check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
 fi

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/7.0 | Brad Smith  | 
Fri Aug 18 15:32:39 2023 -0400| [70fe76385da3b59387ca2d5d262cc05697ba5107] | 
committer: Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

(cherry picked from commit 30a8641465f7b7923e92d8724ef6a595fccb9e58)
Signed-off-by: Brad Smith 

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

 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 323476cdd7..7ed9188478 100755
--- a/configure
+++ b/configure
@@ -2212,6 +2212,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2749,6 +2750,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6353,6 +6355,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+   vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled riscv; then
 
 enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
@@ -7899,6 +7906,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/7.0 | Brad Smith  | Tue Mar 11 
00:31:47 2025 -0400| [94e94becb133cc0ca89705c98587757b96b3a232] | committer: 
Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX

(cherry picked from commit 49c8f33262d7c113c71cee9cd30b990a92afa0a1)
Signed-off-by: Brad Smith 

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 7ed9188478..819e1ae1e9 100755
--- a/configure
+++ b/configure
@@ -6355,7 +6355,7 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
-if enabled altivec && disabled vsx; then
+if enabled altivec; then
 check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
 fi

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/6.1 | Brad Smith  | 
Fri Aug 18 15:32:39 2023 -0400| [9c235c2c75f4c834720cfb8f42160bff9e5ecb2f] | 
committer: Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

(cherry picked from commit 30a8641465f7b7923e92d8724ef6a595fccb9e58)
Signed-off-by: Brad Smith 

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

 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8be78ad46e..7328f06721 100755
--- a/configure
+++ b/configure
@@ -2146,6 +2146,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2676,6 +2677,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6218,6 +6220,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+   vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled riscv; then
 
 enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
@@ -7754,6 +7761,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/6.1 | Brad Smith  | Tue Mar 11 
00:31:47 2025 -0400| [e16ff06adb9acd647c0c33aa3c27438e1009b822] | committer: 
Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX

(cherry picked from commit 49c8f33262d7c113c71cee9cd30b990a92afa0a1)
Signed-off-by: Brad Smith 

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 7328f06721..17bc0d7b85 100755
--- a/configure
+++ b/configure
@@ -6220,7 +6220,7 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
-if enabled altivec && disabled vsx; then
+if enabled altivec; then
 check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
 fi

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/6.0 | Brad Smith  | 
Fri Aug 18 15:32:39 2023 -0400| [2a341fc5b24616650f14eeba7d21253209dcd675] | 
committer: Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

(cherry picked from commit 30a8641465f7b7923e92d8724ef6a595fccb9e58)
Signed-off-by: Brad Smith 

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

 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 6db69dd5c4..b6a383cde6 100755
--- a/configure
+++ b/configure
@@ -2110,6 +2110,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2632,6 +2633,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6121,6 +6123,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+   vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled riscv; then
 
 enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
@@ -7618,6 +7625,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/6.0 | Brad Smith  | Tue Mar 11 
00:31:47 2025 -0400| [b67a6631a27e63e1040ef8b484b20b657798b227] | committer: 
Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX

(cherry picked from commit 49c8f33262d7c113c71cee9cd30b990a92afa0a1)
Signed-off-by: Brad Smith 

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index b6a383cde6..b5b073fbcc 100755
--- a/configure
+++ b/configure
@@ -6123,7 +6123,7 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
-if enabled altivec && disabled vsx; then
+if enabled altivec; then
 check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
 fi

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/5.1 | Brad Smith  | 
Fri Aug 18 15:32:39 2023 -0400| [6ad0eab0b5b92738c946d9031d74b34bce53300a] | 
committer: Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

(cherry picked from commit 30a8641465f7b7923e92d8724ef6a595fccb9e58)
Signed-off-by: Brad Smith 

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

 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 471475b08e..2c8ec632b9 100755
--- a/configure
+++ b/configure
@@ -2121,6 +2121,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2634,6 +2635,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6091,6 +6093,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+   vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled x86; then
 
 check_builtin rdtscintrin.h   "__rdtsc()"
@@ -7542,6 +7549,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/5.1 | Brad Smith  | Tue Mar 11 
00:31:47 2025 -0400| [c0067757ab5972a709d4d437d81163a501079eaf] | committer: 
Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX

(cherry picked from commit 49c8f33262d7c113c71cee9cd30b990a92afa0a1)
Signed-off-by: Brad Smith 

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 2c8ec632b9..87b65d86d1 100755
--- a/configure
+++ b/configure
@@ -6093,7 +6093,7 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
-if enabled altivec && disabled vsx; then
+if enabled altivec; then
 check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
 fi

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/5.0 | Brad Smith  | 
Fri Aug 18 15:32:39 2023 -0400| [c7e3a1b6afb493458ab35cf1053d250c80a8f47a] | 
committer: Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

(cherry picked from commit 30a8641465f7b7923e92d8724ef6a595fccb9e58)
Signed-off-by: Brad Smith 

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

 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 0b0a17cd98..9bd66700af 100755
--- a/configure
+++ b/configure
@@ -2117,6 +2117,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2625,6 +2626,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6085,6 +6087,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+   vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled x86; then
 
 check_builtin rdtscintrin.h   "__rdtsc()"
@@ -7524,6 +7531,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/5.0 | Brad Smith  | Tue Mar 11 
00:31:47 2025 -0400| [ce2b636fe31e675b24850d1c505423c4e1aa9a9e] | committer: 
Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX

(cherry picked from commit 49c8f33262d7c113c71cee9cd30b990a92afa0a1)
Signed-off-by: Brad Smith 

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 9bd66700af..7638f0382c 100755
--- a/configure
+++ b/configure
@@ -6087,7 +6087,7 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
-if enabled altivec && disabled vsx; then
+if enabled altivec; then
 check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
 fi

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/4.4 | Brad Smith  | 
Fri Aug 18 15:32:39 2023 -0400| [793a472df5965520dafe6f87f0b779d4ad2d3a17] | 
committer: Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

(cherry picked from commit 30a8641465f7b7923e92d8724ef6a595fccb9e58)
Signed-off-by: Brad Smith 

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

 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 1f9f27d359..5e609b43a0 100755
--- a/configure
+++ b/configure
@@ -2060,6 +2060,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2550,6 +2551,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -5966,6 +5968,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+   vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled x86; then
 
 check_builtin rdtscintrin.h   "__rdtsc()"
@@ -7365,6 +7372,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 echo "debug symbols ${debug-no}"
 echo "strip symbols ${stripping-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \

___
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] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

2025-03-15 Thread Brad Smith
ffmpeg | branch: release/4.4 | Brad Smith  | Tue Mar 11 
00:31:47 2025 -0400| [2d18c6b8ab21fdfbc5a02b756a9ce9fb9ca84038] | committer: 
Brad Smith

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX

(cherry picked from commit 49c8f33262d7c113c71cee9cd30b990a92afa0a1)
Signed-off-by: Brad Smith 

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

 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 5e609b43a0..41d3017f3b 100755
--- a/configure
+++ b/configure
@@ -5968,7 +5968,7 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
-if enabled altivec && disabled vsx; then
+if enabled altivec; then
 check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
 fi

___
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/msmpeg4enc: Inline constant

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 15:42:18 2025 +0100| [248a6578a3dee63e9cb2e2508a34bc003a4a24b2] | 
committer: Andreas Rheinhardt

avcodec/msmpeg4enc: Inline constant

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/msmpeg4enc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 2a9e16975f..8310e0a578 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -354,9 +354,8 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int 
val)
 int range, bit_size, sign, code, bits;
 
 if (val == 0) {
-/* zero vector */
-code = 0;
-put_bits(&s->pb, ff_mvtab[code][1], ff_mvtab[code][0]);
+/* zero vector; corresponds to ff_mvtab[0] */
+put_bits(&s->pb, 1, 0x1);
 } else {
 bit_size = s->f_code - 1;
 range = 1 << bit_size;

___
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/mdec: Optimize processing escape codes

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 03:57:30 2025 +0100| [9aeb6940a22f8cf5a8fff3f161aaf7963021f61c] | 
committer: Andreas Rheinhardt

avcodec/mdec: Optimize processing escape codes

Said escape code is only six bits long, so that one has at least 25 - 6
bits in the bitstream reader's cache after reading it; therefore the
whole following 16 bits (containing the actual code) are already in the
bitstream reader's cache, making it unnecessary to reload the cache.

This is the mdec analogue of fe9bc1cc45e2bebba1efa7b9a20b0d66679bf2d5.

Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 66331d9059..9789a94396 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -100,8 +100,8 @@ static inline int mdec_decode_block_intra(MDECContext *a, 
int16_t *block, int n)
 LAST_SKIP_BITS(re, &a->gb, 1);
 } else {
 /* escape */
-run = SHOW_UBITS(re, &a->gb, 6)+1; LAST_SKIP_BITS(re, &a->gb, 
6);
-UPDATE_CACHE(re, &a->gb);
+run = SHOW_UBITS(re, &a->gb, 6) + 1;
+SKIP_BITS(re, &a->gb, 6);
 level = SHOW_SBITS(re, &a->gb, 10); SKIP_BITS(re, &a->gb, 10);
 i += run;
 if (i > 63) {

___
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/mpegvideo_dec: Mark init, flush, close functions as av_cold

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 01:51:49 2025 +0100| [594b97e4333fee7c3dd9b81a56afa4b91add8622] | 
committer: Andreas Rheinhardt

avcodec/mpegvideo_dec: Mark init, flush, close functions as av_cold

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/mpegvideo_dec.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index 532d8cf5c1..2856dbfbd6 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -43,7 +43,7 @@
 #include "threadprogress.h"
 #include "wmv2dec.h"
 
-int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx)
+av_cold int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx)
 {
 enum ThreadingStatus thread_status;
 
@@ -141,7 +141,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
 return 0;
 }
 
-int ff_mpv_decode_close(AVCodecContext *avctx)
+av_cold int ff_mpv_decode_close(AVCodecContext *avctx)
 {
 MpegEncContext *s = avctx->priv_data;
 
@@ -150,7 +150,7 @@ int ff_mpv_decode_close(AVCodecContext *avctx)
 return 0;
 }
 
-int ff_mpv_common_frame_size_change(MpegEncContext *s)
+av_cold int ff_mpv_common_frame_size_change(MpegEncContext *s)
 {
 int err = 0;
 
@@ -427,7 +427,7 @@ void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int 
h)
s->first_field, s->low_delay);
 }
 
-void ff_mpeg_flush(AVCodecContext *avctx)
+av_cold void ff_mpeg_flush(AVCodecContext *avctx)
 {
 MpegEncContext *const s = avctx->priv_data;
 

___
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/intrax8: Stop setting write-only block_last_index

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 02:16:10 2025 +0100| [461b86fe7d647ae8412ce4d6a8081fa9fc901147] | 
committer: Andreas Rheinhardt

avcodec/intrax8: Stop setting write-only block_last_index

These values are only used by the mpegvideo unquantize functions,
yet these are not active when intrax is in use. Furthermore,
given that ff_intrax8_decode_picture() decodes multiple
macroblocks in a given call, it makes no sense to return
any value (that was in practice the maximum of the indices
of all the macroblocks decoded).

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/intrax8.c | 12 
 libavcodec/intrax8.h |  3 ---
 libavcodec/vc1dec.c  |  3 +--
 libavcodec/wmv2dec.c |  3 +--
 4 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index f1dce86a50..684f15d904 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -480,24 +480,18 @@ static void x8_ac_compensation(IntraX8Context *const w, 
const int direction,
 
 t= T(1084); // g
 B(1, 1) += t;
-
-w->block_last_index[0] = FFMAX(w->block_last_index[0], 7 * 8);
 break;
 case 1:
 B(0, 1) -= T(6269);
 B(0, 3) -= T(708);
 B(0, 5) -= T(172);
 B(0, 7) -= T(73);
-
-w->block_last_index[0] = FFMAX(w->block_last_index[0], 7 * 8);
 break;
 case 2:
 B(1, 0) -= T(6269);
 B(3, 0) -= T(708);
 B(5, 0) -= T(172);
 B(7, 0) -= T(73);
-
-w->block_last_index[0] = FFMAX(w->block_last_index[0], 7);
 break;
 }
 #undef B
@@ -599,10 +593,7 @@ static int x8_decode_intra_mb(IntraX8Context *const w, 
const int chroma)
 
 w->block[0][scantable[pos]] = level;
 } while (!final);
-
-w->block_last_index[0] = pos;
 } else { // DC only
-w->block_last_index[0] = 0;
 if (w->flat_dc && ((unsigned) (dc_level + 1)) < 3) { // [-1; 1]
 int32_t divide_quant = !chroma ? w->divide_quant_dc_luma
: w->divide_quant_dc_chroma;
@@ -633,7 +624,6 @@ static int x8_decode_intra_mb(IntraX8Context *const w, 
const int chroma)
  * -> 01'10' 10'10' 00'00' 00'01' 01'11' 11'00 => 0x6A017C */
 direction = (0x6A017C >> (w->orient * 2)) & 3;
 if (direction != 3) {
-// modify block_last[]
 x8_ac_compensation(w, direction, w->block[0][0]);
 }
 }
@@ -689,7 +679,6 @@ static void x8_init_block_index(IntraX8Context *w, AVFrame 
*frame)
 av_cold int ff_intrax8_common_init(AVCodecContext *avctx,
IntraX8Context *w,
int16_t (*block)[64],
-   int block_last_index[12],
int mb_width, int mb_height)
 {
 static AVOnce init_static_once = AV_ONCE_INIT;
@@ -698,7 +687,6 @@ av_cold int ff_intrax8_common_init(AVCodecContext *avctx,
 w->mb_width  = mb_width;
 w->mb_height = mb_height;
 w->block = block;
-w->block_last_index = block_last_index;
 
 // two rows, 2 blocks per cannon mb
 w->prediction_table = av_mallocz(w->mb_width * 2 * 2);
diff --git a/libavcodec/intrax8.h b/libavcodec/intrax8.h
index b9f8c4250b..38ad09c837 100644
--- a/libavcodec/intrax8.h
+++ b/libavcodec/intrax8.h
@@ -38,7 +38,6 @@ typedef struct IntraX8Context {
 WMV2DSPContext wdsp;
 uint8_t idct_permutation[64];
 AVCodecContext *avctx;
-int *block_last_index;  ///< last nonzero coefficient in block
 int16_t (*block)[64];
 
 // set by the caller codec
@@ -77,7 +76,6 @@ typedef struct IntraX8Context {
  * @param avctx pointer to AVCodecContext
  * @param w pointer to IntraX8Context
  * @param block pointer to block array
- * @param block_last_index pointer to index array
  * @param mb_width macroblock width
  * @param mb_height macroblock height
  * @return 0 on success, a negative AVERROR value on error
@@ -85,7 +83,6 @@ typedef struct IntraX8Context {
 int ff_intrax8_common_init(AVCodecContext *avctx,
IntraX8Context *w,
int16_t (*block)[64],
-   int block_last_index[12],
int mb_width, int mb_height);
 
 /**
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index d92a7da8ab..b9ca38d20d 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -422,8 +422,7 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context 
*v)
 return AVERROR(ENOMEM);
 }
 
-ret = ff_intrax8_common_init(s->avctx, &v->x8,
- s->block, s->block_last_index,
+ret = ff_intrax8_common_init(s->avctx, &v->x8, s->block,
  s->mb_width, s->mb_height);
 if (ret < 0)
 return ret;
diff --git a/libavcod

[FFmpeg-cvslog] avcodec/mdec: Don't update cache unnecessarily

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 03:59:36 2025 +0100| [2e5f01e06464f7b34bab38328c85fd7af1f89728] | 
committer: Andreas Rheinhardt

avcodec/mdec: Don't update cache unnecessarily

It won't be used anyway.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/mdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 9789a94396..c8865d7c63 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -102,7 +102,8 @@ static inline int mdec_decode_block_intra(MDECContext *a, 
int16_t *block, int n)
 /* escape */
 run = SHOW_UBITS(re, &a->gb, 6) + 1;
 SKIP_BITS(re, &a->gb, 6);
-level = SHOW_SBITS(re, &a->gb, 10); SKIP_BITS(re, &a->gb, 10);
+level = SHOW_SBITS(re, &a->gb, 10);
+LAST_SKIP_BITS(re, &a->gb, 10);
 i += run;
 if (i > 63) {
 av_log(a->avctx, AV_LOG_ERROR,

___
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/vc1_block: Stop setting write-only block_last_index

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 02:06:40 2025 +0100| [1a564c1afff461a36f6ac0df178d87f105ed485f] | 
committer: Andreas Rheinhardt

avcodec/vc1_block: Stop setting write-only block_last_index

It is only used by the mpegvideo unquantize functions which
this decoder does not use at all.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/vc1_block.c | 32 +---
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 8babbde38c..26adfbca1d 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -585,7 +585,6 @@ static int vc1_decode_i_block(VC1Context *v, int16_t 
block[64], int n,
 GetBitContext *gb = &v->s.gb;
 MpegEncContext *s = &v->s;
 int dc_pred_dir = 0; /* Direction of the DC prediction used */
-int i;
 int16_t *dc_val;
 int16_t *ac_val, *ac_val2;
 int dcdiff, scale;
@@ -622,7 +621,6 @@ static int vc1_decode_i_block(VC1Context *v, int16_t 
block[64], int n,
 scale = v->pq * 2 + v->halfpq;
 
 //AC Decoding
-i = !!coded;
 
 if (coded) {
 int last = 0, skip, value;
@@ -637,14 +635,14 @@ static int vc1_decode_i_block(VC1Context *v, int16_t 
block[64], int n,
 } else
 zz_table = v->zz_8x8[1];
 
-while (!last) {
+for (int i = 1; !last; ++i) {
 int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
 if (ret < 0)
 return ret;
 i += skip;
 if (i > 63)
 break;
-block[zz_table[i++]] = value;
+block[zz_table[i]] = value;
 }
 
 /* apply AC prediction if needed */
@@ -696,8 +694,6 @@ static int vc1_decode_i_block(VC1Context *v, int16_t 
block[64], int n,
 }
 }
 }
-if (s->ac_pred) i = 63;
-s->block_last_index[n] = i;
 
 return 0;
 }
@@ -716,7 +712,6 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t 
block[64], int n,
 GetBitContext *gb = &v->s.gb;
 MpegEncContext *s = &v->s;
 int dc_pred_dir = 0; /* Direction of the DC prediction used */
-int i;
 int16_t *dc_val = NULL;
 int16_t *ac_val, *ac_val2;
 int dcdiff;
@@ -778,7 +773,6 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t 
block[64], int n,
 }
 
 //AC Decoding
-i = 1;
 
 if (coded) {
 int last = 0, skip, value;
@@ -801,14 +795,14 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t 
block[64], int n,
 zz_table = v->zzi_8x8;
 }
 
-while (!last) {
+for (int i = 1; !last; ++i) {
 int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
 if (ret < 0)
 return ret;
 i += skip;
 if (i > 63)
 break;
-block[zz_table[i++]] = value;
+block[zz_table[i]] = value;
 }
 
 /* apply AC prediction if needed */
@@ -880,8 +874,6 @@ static int vc1_decode_i_block_adv(VC1Context *v, int16_t 
block[64], int n,
 }
 }
 }
-if (use_pred) i = 63;
-s->block_last_index[n] = i;
 
 return 0;
 }
@@ -900,7 +892,6 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t 
block[64], int n,
 GetBitContext *gb = &v->s.gb;
 MpegEncContext *s = &v->s;
 int dc_pred_dir = 0; /* Direction of the DC prediction used */
-int i;
 int16_t *dc_val = NULL;
 int16_t *ac_val, *ac_val2;
 int dcdiff;
@@ -942,7 +933,6 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t 
block[64], int n,
 block[0] = dcdiff * s->y_dc_scale;
 
 //AC Decoding
-i = 1;
 
 /* check if AC is needed at all and adjust direction if needed */
 if (!a_avail) dc_pred_dir = 1;
@@ -973,7 +963,7 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t 
block[64], int n,
 int last = 0, skip, value;
 int k;
 
-while (!last) {
+for (int i = 1; !last; ++i) {
 int ret = vc1_decode_ac_coeff(v, &last, &skip, &value, codingset);
 if (ret < 0)
 return ret;
@@ -981,15 +971,15 @@ static int vc1_decode_intra_block(VC1Context *v, int16_t 
block[64], int n,
 if (i > 63)
 break;
 if (v->fcm == PROGRESSIVE)
-block[v->zz_8x8[0][i++]] = value;
+block[v->zz_8x8[0][i]] = value;
 else {
 if (use_pred && (v->fcm == ILACE_FRAME)) {
 if (!dc_pred_dir) // top
-block[v->zz_8x8[2][i++]] = value;
+block[v->zz_8x8[2][i]] = value;
 else // left
-block[v->zz_8x8[3][i++]] = value;
+block[v->zz_8x8[3][i]] = value;
 } else {
-blo

[FFmpeg-cvslog] avcodec/mdec: Remove write-only block_last_index

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 03:34:02 2025 +0100| [de562e8069d9befff1e775de5c05dca8eb536d10] | 
committer: Andreas Rheinhardt

avcodec/mdec: Remove write-only block_last_index

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/mdec.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 5ab40719ac..66331d9059 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -56,7 +56,6 @@ typedef struct MDECContext {
 DECLARE_ALIGNED(16, uint16_t, quant_matrix)[64];
 uint8_t *bitstream_buffer;
 unsigned int bitstream_buffer_size;
-int block_last_index[6];
 } MDECContext;
 
 //very similar to MPEG-1
@@ -126,7 +125,6 @@ static inline int mdec_decode_block_intra(MDECContext *a, 
int16_t *block, int n)
 }
 CLOSE_READER(re, &a->gb);
 }
-a->block_last_index[n] = i;
 return 0;
 }
 

___
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/eamad: Optimize processing escape codes

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 04:20:52 2025 +0100| [f6366cb5ea1d0d84ba7592155b3f30c85645edb4] | 
committer: Andreas Rheinhardt

avcodec/eamad: Optimize processing escape codes

Said escape code is only six bits long, so that one has at least 25 - 6
bits in the bitstream reader's cache after reading it; therefore the
whole following 16 bits (containing the actual code) are already in the
bitstream reader's cache, making it unnecessary to reload the cache.

This is the eamad analogue of fe9bc1cc45e2bebba1efa7b9a20b0d66679bf2d5.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/eamad.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 1c3f97653c..41a133c424 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -160,10 +160,8 @@ static inline int decode_block_intra(MadContext *s, 
int16_t * block)
 LAST_SKIP_BITS(re, &s->gb, 1);
 } else {
 /* escape */
-UPDATE_CACHE(re, &s->gb);
 level = SHOW_SBITS(re, &s->gb, 10); SKIP_BITS(re, &s->gb, 10);
 
-UPDATE_CACHE(re, &s->gb);
 run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 
6);
 
 i += run;

___
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/eamad: Don't store transient macroblock indices in context

2025-03-15 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar  7 14:15:02 2025 +0100| [b5be0c0aa9566448756ada8e3064904c225b0a1d] | 
committer: Andreas Rheinhardt

avcodec/eamad: Don't store transient macroblock indices in context

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/eamad.c | 29 -
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 41a133c424..44dac46083 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -58,8 +58,6 @@ typedef struct MadContext {
 unsigned int bitstream_buf_size;
 DECLARE_ALIGNED(32, int16_t, block)[64];
 uint16_t quant_matrix[64];
-int mb_x;
-int mb_y;
 } MadContext;
 
 static av_cold int decode_init(AVCodecContext *avctx)
@@ -148,11 +146,8 @@ static inline int decode_block_intra(MadContext *s, 
int16_t * block)
 break;
 } else if (level != 0) {
 i += run;
-if (i > 63) {
-av_log(s->avctx, AV_LOG_ERROR,
-   "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
+if (i > 63)
 return -1;
-}
 j = scantable[i];
 level = (level*quant_matrix[j]) >> 4;
 level = (level-1)|1;
@@ -165,11 +160,8 @@ static inline int decode_block_intra(MadContext *s, 
int16_t * block)
 run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 
6);
 
 i += run;
-if (i > 63) {
-av_log(s->avctx, AV_LOG_ERROR,
-   "ac-tex damaged at %d %d\n", s->mb_x, s->mb_y);
+if (i > 63)
 return -1;
-}
 j = scantable[i];
 if (level < 0) {
 level = -level;
@@ -200,7 +192,7 @@ static int decode_motion(GetBitContext *gb)
 return value;
 }
 
-static int decode_mb(MadContext *s, AVFrame *frame, int inter)
+static int decode_mb(MadContext *s, AVFrame *frame, int inter, int mb_x, int 
mb_y)
 {
 int mv_map = 0;
 int av_uninit(mv_x), av_uninit(mv_y);
@@ -219,12 +211,15 @@ static int decode_mb(MadContext *s, AVFrame *frame, int 
inter)
 if (mv_map & (1last_frame->data[0])
-comp_block(s, frame, s->mb_x, s->mb_y, j, mv_x, mv_y, add);
+comp_block(s, frame, mb_x, mb_y, j, mv_x, mv_y, add);
 } else {
 s->bdsp.clear_block(s->block);
-if(decode_block_intra(s, s->block) < 0)
+if (decode_block_intra(s, s->block) < 0) {
+av_log(s->avctx, AV_LOG_ERROR,
+"ac-tex damaged at %d %d\n", mb_x, mb_y);
 return -1;
-idct_put(s, frame, s->block, s->mb_x, s->mb_y, j);
+}
+idct_put(s, frame, s->block, mb_x, mb_y, j);
 }
 }
 return 0;
@@ -308,9 +303,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 memset((uint8_t*)s->bitstream_buf + bytestream2_get_bytes_left(&gb), 0, 
AV_INPUT_BUFFER_PADDING_SIZE);
 init_get_bits(&s->gb, s->bitstream_buf, 
8*(bytestream2_get_bytes_left(&gb)));
 
-for (s->mb_y=0; s->mb_y < (avctx->height+15)/16; s->mb_y++)
-for (s->mb_x=0; s->mb_x < (avctx->width +15)/16; s->mb_x++)
-if(decode_mb(s, frame, inter) < 0)
+for (int mb_y = 0; mb_y < (avctx->height + 15) / 16; mb_y++)
+for (int mb_x = 0; mb_x < (avctx->width + 15) / 16; mb_x++)
+if (decode_mb(s, frame, inter, mb_x, mb_y) < 0)
 return AVERROR_INVALIDDATA;
 
 *got_frame = 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".