[FFmpeg-cvslog] avformat/img2: Add support for AVIF mux in image2

2022-05-19 Thread Vignesh Venkatasubramanian
ffmpeg | branch: master | Vignesh Venkatasubramanian 
 | Mon May 16 10:40:21 2022 -0700| 
[dd99d34d67e2612a8f133f8a86db9f64b4dfa20d] | committer: Gyan Doshi

avformat/img2: Add support for AVIF mux in image2

Add support for AVIF muxing in the image2 muxer.

Tested with this example:
ffmpeg -lavfi testsrc=duration=1:size=320x320 -g 1 -flags global_header -c:v 
libaom-av1 -f image2 img-%2d.avif

Signed-off-by: Vignesh Venkatasubramanian 

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

 libavformat/img2enc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 5ed97bb833..0015297ec2 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -58,6 +58,8 @@ static int write_header(AVFormatContext *s)
 img->muxer = "gif";
 } else if (st->codecpar->codec_id == AV_CODEC_ID_FITS) {
 img->muxer = "fits";
+} else if (st->codecpar->codec_id == AV_CODEC_ID_AV1) {
+img->muxer = "avif";
 } else if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
 const char *str = strrchr(s->url, '.');
 img->split_planes = str
@@ -265,7 +267,7 @@ const AVOutputFormat ff_image2_muxer = {
 .long_name  = NULL_IF_CONFIG_SMALL("image2 sequence"),
 .extensions = 
"bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,"
   
"png,ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,"
-  "im24,sunras,vbn,xbm,xface,pix,y",
+  "im24,sunras,vbn,xbm,xface,pix,y,avif",
 .priv_data_size = sizeof(VideoMuxData),
 .video_codec= AV_CODEC_ID_MJPEG,
 .write_header   = write_header,

___
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] Makefile: remove sccenc dependency on subtitles

2022-05-19 Thread Limin Wang
ffmpeg | branch: master | Limin Wang  | Sun Apr 10 
20:33:09 2022 +0800| [4607868b98715929b8f87b7231cf60ae66f13aa6] | committer: 
Limin Wang

Makefile: remove sccenc dependency on subtitles

Signed-off-by: Limin Wang 

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

 libavformat/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 3b9995a9d3..8e612b6cc7 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -514,7 +514,7 @@ OBJS-$(CONFIG_SBC_DEMUXER)   += sbcdec.o 
rawdec.o
 OBJS-$(CONFIG_SBC_MUXER) += rawenc.o
 OBJS-$(CONFIG_SBG_DEMUXER)   += sbgdec.o
 OBJS-$(CONFIG_SCC_DEMUXER)   += sccdec.o subtitles.o
-OBJS-$(CONFIG_SCC_MUXER) += sccenc.o subtitles.o
+OBJS-$(CONFIG_SCC_MUXER) += sccenc.o
 OBJS-$(CONFIG_SCD_DEMUXER)   += scd.o
 OBJS-$(CONFIG_SDP_DEMUXER)   += rtsp.o
 OBJS-$(CONFIG_SDR2_DEMUXER)  += sdr2.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] avcodec/dvdsubenc: return error if canvas_size is too small for subtitle render

2022-05-19 Thread Limin Wang
ffmpeg | branch: master | Limin Wang  | Sun May  8 
22:52:14 2022 +0800| [94968dbc1116e23cb658c09538e9bce52b63d654] | committer: 
Limin Wang

avcodec/dvdsubenc: return error if canvas_size is too small for subtitle render

Signed-off-by: Limin Wang 

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

 libavcodec/dvdsubenc.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
index fc3b7d1816..d29db7d49c 100644
--- a/libavcodec/dvdsubenc.c
+++ b/libavcodec/dvdsubenc.c
@@ -376,6 +376,12 @@ static int encode_dvd_subtitles(AVCodecContext *avctx,
 x2 = vrect.x + vrect.w - 1;
 y2 = vrect.y + vrect.h - 1;
 
+if (x2 > avctx->width || y2 > avctx->height) {
+av_log(avctx, AV_LOG_ERROR, "canvas_size(%d:%d) is too small(%d:%d) 
for render\n",
+   avctx->width, avctx->height, x2, y2);
+ret = AVERROR(EINVAL);;
+goto fail;
+}
 *q++ = 0x05;
 // x1 x2 -> 6 nibbles
 *q++ = vrect.x >> 4;

___
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] avformat/sccenc: avoid potential invalid access

2022-05-19 Thread Limin Wang
ffmpeg | branch: master | Limin Wang  | Sun Apr 10 
22:20:04 2022 +0800| [8e828ee1add997ff3d1ca5539773a15df6b9f05e] | committer: 
Limin Wang

avformat/sccenc: avoid potential invalid access

Signed-off-by: Limin Wang 

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

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

diff --git a/libavformat/sccenc.c b/libavformat/sccenc.c
index c8c4d097e4..2b924ba6e7 100644
--- a/libavformat/sccenc.c
+++ b/libavformat/sccenc.c
@@ -72,11 +72,11 @@ static int scc_write_packet(AVFormatContext *avf, AVPacket 
*pkt)
 s = (int)(pts /  1000) % 60;
 f = (int)(pts %  1000) / 33;
 
-for (i = 0; i < pkt->size; i+=3) {
+for (i = 0; i < pkt->size - 2; i+=3) {
 if (pkt->data[i] == 0xfc && ((pkt->data[i + 1] != 0x80 || pkt->data[i 
+ 2] != 0x80)))
 break;
 }
-if (i >= pkt->size)
+if (i >= pkt->size - 2)
 return 0;
 
 if (!scc->inside && (scc->prev_h != h || scc->prev_m != m || scc->prev_s 
!= s || scc->prev_f != f)) {

___
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: Move float.h inclusion to mpegvideoenc.h

2022-05-19 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon May 16 18:15:37 2022 +0200| [2c8f97831ad290c24f69b6d3fdaf9153830ce743] | 
committer: Andreas Rheinhardt

avcodec/mpegvideo: Move float.h inclusion to mpegvideoenc.h

It is only needed for the options in mpegvideoenc.h.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/mpegvideo.h| 2 --
 libavcodec/mpegvideoenc.h | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 0f816e5807..a832369f7f 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -28,8 +28,6 @@
 #ifndef AVCODEC_MPEGVIDEO_H
 #define AVCODEC_MPEGVIDEO_H
 
-#include 
-
 #include "avcodec.h"
 #include "blockdsp.h"
 #include "error_resilience.h"
diff --git a/libavcodec/mpegvideoenc.h b/libavcodec/mpegvideoenc.h
index fae41457bf..a0e8913ea6 100644
--- a/libavcodec/mpegvideoenc.h
+++ b/libavcodec/mpegvideoenc.h
@@ -28,6 +28,8 @@
 #ifndef AVCODEC_MPEGVIDEOENC_H
 #define AVCODEC_MPEGVIDEOENC_H
 
+#include 
+
 #include "libavutil/opt.h"
 #include "mpegvideo.h"
 

___
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/error_resilience: Only keep what is needed from MECmpContext

2022-05-19 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar 25 18:39:16 2022 +0100| [6e5acb6c88e00335a60b235a45d49e03424046ac] | 
committer: Andreas Rheinhardt

avcodec/error_resilience: Only keep what is needed from MECmpContext

ERContext currently has an embedded MECmpContext, despite only
needing exactly one function from it. This is wasteful because
MECmpContext is pretty large (135 pointers, 1080 B for eight byte
pointers). So keep only what is needed.

Signed-off-by: Andreas Rheinhardt 

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

 libavcodec/error_resilience.c | 14 --
 libavcodec/error_resilience.h |  3 ++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index e9764f8d96..f957c68d2c 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -766,12 +766,12 @@ static int is_intra_more_likely(ERContext *s)
 } else {
 ff_thread_await_progress(s->last_pic.tf, mb_y, 0);
 }
-is_intra_likely += s->mecc.sad[0](NULL, last_mb_ptr, mb_ptr,
-  linesize[0], 16);
+is_intra_likely += s->sad(NULL, last_mb_ptr, mb_ptr,
+  linesize[0], 16);
 // FIXME need await_progress() here
-is_intra_likely -= s->mecc.sad[0](NULL, last_mb_ptr,
-  last_mb_ptr + linesize[0] * 
16,
-  linesize[0], 16);
+is_intra_likely -= s->sad(NULL, last_mb_ptr,
+  last_mb_ptr + linesize[0] * 16,
+  linesize[0], 16);
 } else {
 if (IS_INTRA(s->cur_pic.mb_type[mb_xy]))
is_intra_likely++;
@@ -790,7 +790,9 @@ void ff_er_frame_start(ERContext *s)
 return;
 
 if (!s->mecc_inited) {
-ff_me_cmp_init(&s->mecc, s->avctx);
+MECmpContext mecc;
+ff_me_cmp_init(&mecc, s->avctx);
+s->sad = mecc.sad[0];
 s->mecc_inited = 1;
 }
 
diff --git a/libavcodec/error_resilience.h b/libavcodec/error_resilience.h
index 2187586618..53e5cf2621 100644
--- a/libavcodec/error_resilience.h
+++ b/libavcodec/error_resilience.h
@@ -52,7 +52,8 @@ typedef struct ERPicture {
 
 typedef struct ERContext {
 AVCodecContext *avctx;
-MECmpContext mecc;
+
+me_cmp_func sad;
 int mecc_inited;
 
 int *mb_index2xy;

___
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/mss2: Remove write-only QpelDSPContext

2022-05-19 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Fri Mar 25 00:58:07 2022 +0100| [9cc38cc636badb675b2757fc665d9b8d2f28870f] | 
committer: Andreas Rheinhardt

avcodec/mss2: Remove write-only QpelDSPContext

Signed-off-by: Andreas Rheinhardt 

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

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

diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index ab42d12217..228f66afc0 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -42,7 +42,6 @@ typedef struct MSS2Context {
 AVFrame   *last_pic;
 MSS12Context   c;
 MSS2DSPContext dsp;
-QpelDSPContext qdsp;
 SliceContext   sc[2];
 } MSS2Context;
 
@@ -837,7 +836,6 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx)
 return ret;
 }
 ff_mss2dsp_init(&ctx->dsp);
-ff_qpeldsp_init(&ctx->qdsp);
 
 avctx->pix_fmt = c->free_colours == 127 ? AV_PIX_FMT_RGB555
 : AV_PIX_FMT_RGB24;

___
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] avfilter/formats: Constify channel_layout in ff_add_channel_layout()

2022-05-19 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon May 16 11:35:20 2022 +0200| [41a558fea06cc0a23b8d2d0dfb03ef6a25cf5100] | 
committer: Andreas Rheinhardt

avfilter/formats: Constify channel_layout in ff_add_channel_layout()

It copies, not moves the channel layout.

Signed-off-by: Andreas Rheinhardt 

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

 libavfilter/formats.c | 3 ++-
 libavfilter/formats.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index f2c474e279..e8c2888c0c 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -464,7 +464,8 @@ do {
  \
 (*f)->nb++;   \
 } while (0)
 
-int ff_add_channel_layout(AVFilterChannelLayouts **l, AVChannelLayout 
*channel_layout)
+int ff_add_channel_layout(AVFilterChannelLayouts **l,
+  const AVChannelLayout *channel_layout)
 {
 av_assert1(!(*l && (*l)->all_layouts));
 ADD_FORMAT(l, channel_layout, ff_channel_layouts_unref, AVChannelLayout, 
channel_layouts, nb_channel_layouts);
diff --git a/libavfilter/formats.h b/libavfilter/formats.h
index caf23d0792..4dce2d 100644
--- a/libavfilter/formats.h
+++ b/libavfilter/formats.h
@@ -180,7 +180,8 @@ av_warn_unused_result
 int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts);
 
 av_warn_unused_result
-int ff_add_channel_layout(AVFilterChannelLayouts **l, AVChannelLayout 
*channel_layout);
+int ff_add_channel_layout(AVFilterChannelLayouts **l,
+  const AVChannelLayout *channel_layout);
 
 /**
  * Add *ref as a new reference to f.

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