[FFmpeg-cvslog] avcodec: deprecate v308 de/encoder

James Almer git at videolan.org
Sat Oct 12 18:02:24 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Oct  7 00:26:05 2024 -0300| [3c64d614c765a0c541fc99b67813be0b2c60406c] | committer: James Almer

avcodec: deprecate v308 de/encoder

The vyu444 pixel format was recently added, so this lavc workaround is no longer
needed.

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/allcodecs.c  | 2 +-
 libavcodec/codec_desc.c | 2 +-
 libavcodec/codec_id.h   | 2 +-
 libavcodec/v308dec.c    | 2 ++
 libavcodec/v308enc.c    | 2 ++
 libavformat/isom_tags.c | 2 +-
 libavformat/movenc.c    | 2 +-
 libavformat/riff.c      | 2 +-
 8 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index f6c09d3c36..a0a569fe58 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -345,9 +345,9 @@ extern const FFCodec ff_utvideo_decoder;
 extern const FFCodec ff_v210_encoder;
 extern const FFCodec ff_v210_decoder;
 extern const FFCodec ff_v210x_decoder;
+#if FF_API_V408_CODECID
 extern const FFCodec ff_v308_encoder;
 extern const FFCodec ff_v308_decoder;
-#if FF_API_V408_CODECID
 extern const FFCodec ff_v408_encoder;
 extern const FFCodec ff_v408_decoder;
 #endif
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 4badf9d250..0b100c3a41 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1477,6 +1477,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("Pinnacle TARGA CineWave YUV16"),
         .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
     },
+#if FF_API_V408_CODECID
     {
         .id        = AV_CODEC_ID_V308,
         .type      = AVMEDIA_TYPE_VIDEO,
@@ -1484,7 +1485,6 @@ static const AVCodecDescriptor codec_descriptors[] = {
         .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"),
         .props     = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
     },
-#if FF_API_V408_CODECID
     {
         .id        = AV_CODEC_ID_V408,
         .type      = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index 9f77593db7..cf351a1aa9 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -254,8 +254,8 @@ enum AVCodecID {
     AV_CODEC_ID_012V,
     AV_CODEC_ID_AVUI,
     AV_CODEC_ID_TARGA_Y216,
-    AV_CODEC_ID_V308,
 #if FF_API_V408_CODECID
+    AV_CODEC_ID_V308,
     AV_CODEC_ID_V408,
 #endif
     AV_CODEC_ID_YUV4,
diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c
index b591a79dd2..64876b7e5a 100644
--- a/libavcodec/v308dec.c
+++ b/libavcodec/v308dec.c
@@ -30,6 +30,8 @@ static av_cold int v308_decode_init(AVCodecContext *avctx)
     if (avctx->width & 1)
         av_log(avctx, AV_LOG_WARNING, "v308 requires width to be even.\n");
 
+    av_log(avctx, AV_LOG_WARNING, "This decoder is deprecated and will be removed.\n");
+
     return 0;
 }
 
diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c
index 68f9c3310b..2941ba3f03 100644
--- a/libavcodec/v308enc.c
+++ b/libavcodec/v308enc.c
@@ -33,6 +33,8 @@ static av_cold int v308_encode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
+    av_log(avctx, AV_LOG_WARNING, "This encoder is deprecated and will be removed.\n");
+
     avctx->bits_per_coded_sample = 24;
     avctx->bit_rate = ff_guess_coded_bitrate(avctx);
 
diff --git a/libavformat/isom_tags.c b/libavformat/isom_tags.c
index d1b6b52db4..e999aa7fef 100644
--- a/libavformat/isom_tags.c
+++ b/libavformat/isom_tags.c
@@ -63,8 +63,8 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
     { AV_CODEC_ID_AVRP,   MKTAG('S', 'U', 'D', 'S') }, /* Avid DS Uncompressed */
     { AV_CODEC_ID_V210,   MKTAG('v', '2', '1', '0') }, /* uncompressed 10-bit 4:2:2 */
     { AV_CODEC_ID_V210,   MKTAG('b', 'x', 'y', '2') }, /* BOXX 10-bit 4:2:2 */
-    { AV_CODEC_ID_V308,   MKTAG('v', '3', '0', '8') }, /* uncompressed  8-bit 4:4:4 */
 #if FF_API_V408_CODECID
+    { AV_CODEC_ID_V308,   MKTAG('v', '3', '0', '8') }, /* uncompressed  8-bit 4:4:4 */
     { AV_CODEC_ID_V408,   MKTAG('v', '4', '0', '8') }, /* uncompressed  8-bit 4:4:4:4 */
 #endif
     { AV_CODEC_ID_V410,   MKTAG('v', '4', '1', '0') }, /* uncompressed 10-bit 4:4:4 */
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 3d5bfa946e..ba0914ebff 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2618,8 +2618,8 @@ static int mov_write_video_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContex
                            || (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_VYU444)
                            || (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_UYVA)
                            || (track->par->codec_id == AV_CODEC_ID_RAWVIDEO && track->par->format == AV_PIX_FMT_V30X)
-                           ||  track->par->codec_id == AV_CODEC_ID_V308
 #if FF_API_V408_CODECID
+                           ||  track->par->codec_id == AV_CODEC_ID_V308
                            ||  track->par->codec_id == AV_CODEC_ID_V408
 #endif
                            ||  track->par->codec_id == AV_CODEC_ID_V410
diff --git a/libavformat/riff.c b/libavformat/riff.c
index c1e48810b6..0f5682313e 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -305,8 +305,8 @@ const AVCodecTag ff_codec_bmp_tags[] = {
     { AV_CODEC_ID_R210,         MKTAG('r', '2', '1', '0') },
     { AV_CODEC_ID_V210,         MKTAG('v', '2', '1', '0') },
     { AV_CODEC_ID_V210,         MKTAG('C', '2', '1', '0') },
-    { AV_CODEC_ID_V308,         MKTAG('v', '3', '0', '8') },
 #if FF_API_V408_CODECID
+    { AV_CODEC_ID_V308,         MKTAG('v', '3', '0', '8') },
     { AV_CODEC_ID_V408,         MKTAG('v', '4', '0', '8') },
 #endif
     { AV_CODEC_ID_V410,         MKTAG('v', '4', '1', '0') },



More information about the ffmpeg-cvslog mailing list