Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 09/13] avcodec/mpegvideo_enc: Add AV_CODEC_CAP_DR1
Date: Mon,  1 Jul 2024 14:16:06 +0200
Message-ID: <GV1P250MB0737A6D00FFADD3F416F11D78FD32@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <GV1P250MB0737B9F8B8BA2F37597B5A598FD32@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>

The mpegvideo-based encoders do one uncommon thing with
the packet's data given by ff_alloc_packet(): They potentially
reallocate it. But this only affects the internal buffer
and is not user-facing at all, so one can nevertheless
use the AV_CODEC_CAP_DR1 for them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/flvenc.c        | 2 +-
 libavcodec/h261enc.c       | 2 +-
 libavcodec/ituh263enc.c    | 5 +++--
 libavcodec/mjpegenc.c      | 5 +++--
 libavcodec/mpeg12enc.c     | 6 ++++--
 libavcodec/mpeg4videoenc.c | 3 ++-
 libavcodec/msmpeg4enc.c    | 6 +++---
 libavcodec/rv10enc.c       | 2 +-
 libavcodec/rv20enc.c       | 2 +-
 libavcodec/speedhqenc.c    | 2 +-
 libavcodec/wmv2enc.c       | 2 +-
 11 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c
index 6a96cb0f2f..97323ac655 100644
--- a/libavcodec/flvenc.c
+++ b/libavcodec/flvenc.c
@@ -98,6 +98,7 @@ const FFCodec ff_flv_encoder = {
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_FLV1,
     .p.priv_class   = &ff_mpv_enc_class,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(MpegEncContext),
     .init           = ff_mpv_encode_init,
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
@@ -105,5 +106,4 @@ const FFCodec ff_flv_encoder = {
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
                                                      AV_PIX_FMT_NONE},
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
 };
diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c
index d3d724bef6..e0ff1a03da 100644
--- a/libavcodec/h261enc.c
+++ b/libavcodec/h261enc.c
@@ -383,6 +383,7 @@ const FFCodec ff_h261_encoder = {
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_H261,
     .p.priv_class   = &ff_mpv_enc_class,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(H261EncContext),
     .init           = ff_mpv_encode_init,
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
@@ -390,5 +391,4 @@ const FFCodec ff_h261_encoder = {
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
                                                      AV_PIX_FMT_NONE },
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
 };
diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index 3982b1e675..ad2d1a044f 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -921,7 +921,7 @@ const FFCodec ff_h263_encoder = {
     .p.id           = AV_CODEC_ID_H263,
     .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE},
     .p.priv_class   = &h263_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .priv_data_size = sizeof(MpegEncContext),
     .init           = ff_mpv_encode_init,
@@ -952,7 +952,8 @@ const FFCodec ff_h263p_encoder = {
     .p.id           = AV_CODEC_ID_H263P,
     .p.pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
     .p.priv_class   = &h263p_class,
-    .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS |
+                      AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .priv_data_size = sizeof(MpegEncContext),
     .init           = ff_mpv_encode_init,
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index 9d4c3a4f41..c4f72743ca 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -649,7 +649,8 @@ const FFCodec ff_mjpeg_encoder = {
     .init           = ff_mpv_encode_init,
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
     .close          = mjpeg_encode_close,
-    .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS |
+    .p.capabilities = AV_CODEC_CAP_DR1 |
+                      AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS |
                       AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES,
     .p.pix_fmts     = (const enum AVPixelFormat[]) {
@@ -675,6 +676,7 @@ const FFCodec ff_amv_encoder = {
     CODEC_LONG_NAME("AMV Video"),
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_AMV,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(MJPEGEncContext),
     .init           = ff_mpv_encode_init,
     FF_CODEC_ENCODE_CB(amv_encode_picture),
@@ -684,6 +686,5 @@ const FFCodec ff_amv_encoder = {
         AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE
     },
     .p.priv_class   = &amv_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
 };
 #endif
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 72b2caab7e..6b156772df 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -1243,7 +1243,8 @@ const FFCodec ff_mpeg1video_encoder = {
     .p.supported_framerates = ff_mpeg12_frame_rate_tab + 1,
     .p.pix_fmts           = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
                                                            AV_PIX_FMT_NONE },
-    .p.capabilities       = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
+    .p.capabilities       = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+                            AV_CODEC_CAP_SLICE_THREADS |
                             AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal        = FF_CODEC_CAP_INIT_CLEANUP,
     .p.priv_class         = &mpeg1_class,
@@ -1262,7 +1263,8 @@ const FFCodec ff_mpeg2video_encoder = {
     .p.pix_fmts           = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P,
                                                            AV_PIX_FMT_YUV422P,
                                                            AV_PIX_FMT_NONE },
-    .p.capabilities       = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
+    .p.capabilities       = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+                            AV_CODEC_CAP_SLICE_THREADS |
                             AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal        = FF_CODEC_CAP_INIT_CLEANUP,
     .p.priv_class         = &mpeg2_class,
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 0b18776497..abbf4180e9 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -1393,7 +1393,8 @@ const FFCodec ff_mpeg4_encoder = {
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
     .close          = ff_mpv_encode_end,
     .p.pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
-    .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+                      AV_CODEC_CAP_SLICE_THREADS |
                       AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .p.priv_class   = &mpeg4enc_class,
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 3103a73663..a78ab7b2d8 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -682,7 +682,7 @@ const FFCodec ff_msmpeg4v2_encoder = {
     .p.id           = AV_CODEC_ID_MSMPEG4V2,
     .p.pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
     .p.priv_class   = &ff_mpv_enc_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .priv_data_size = sizeof(MSMPEG4EncContext),
     .init           = ff_mpv_encode_init,
@@ -697,7 +697,7 @@ const FFCodec ff_msmpeg4v3_encoder = {
     .p.id           = AV_CODEC_ID_MSMPEG4V3,
     .p.pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
     .p.priv_class   = &ff_mpv_enc_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .priv_data_size = sizeof(MSMPEG4EncContext),
     .init           = ff_mpv_encode_init,
@@ -712,7 +712,7 @@ const FFCodec ff_wmv1_encoder = {
     .p.id           = AV_CODEC_ID_WMV1,
     .p.pix_fmts     = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
     .p.priv_class   = &ff_mpv_enc_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .priv_data_size = sizeof(MSMPEG4EncContext),
     .init           = ff_mpv_encode_init,
diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c
index 8a405b8686..b12248636d 100644
--- a/libavcodec/rv10enc.c
+++ b/libavcodec/rv10enc.c
@@ -71,7 +71,7 @@ const FFCodec ff_rv10_encoder = {
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_RV10,
     .p.priv_class   = &ff_mpv_enc_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(MpegEncContext),
     .init           = ff_mpv_encode_init,
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c
index dc26877d5e..4f90182b76 100644
--- a/libavcodec/rv20enc.c
+++ b/libavcodec/rv20enc.c
@@ -68,7 +68,7 @@ const FFCodec ff_rv20_encoder = {
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_RV20,
     .p.priv_class   = &ff_mpv_enc_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(MpegEncContext),
     .init           = ff_mpv_encode_init,
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c
index 4995b19f3b..93b249497b 100644
--- a/libavcodec/speedhqenc.c
+++ b/libavcodec/speedhqenc.c
@@ -294,7 +294,7 @@ const FFCodec ff_speedhq_encoder = {
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_SPEEDHQ,
     .p.priv_class   = &ff_mpv_enc_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(SpeedHQEncContext),
     .init           = ff_mpv_encode_init,
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c
index 13ec2bf6ff..57bf931cc6 100644
--- a/libavcodec/wmv2enc.c
+++ b/libavcodec/wmv2enc.c
@@ -243,7 +243,7 @@ const FFCodec ff_wmv2_encoder = {
     .p.type         = AVMEDIA_TYPE_VIDEO,
     .p.id           = AV_CODEC_ID_WMV2,
     .p.priv_class   = &ff_mpv_enc_class,
-    .p.capabilities = AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
+    .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
     .priv_data_size = sizeof(WMV2EncContext),
     .init           = wmv2_encode_init,
     FF_CODEC_ENCODE_CB(ff_mpv_encode_picture),
-- 
2.40.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

  parent reply	other threads:[~2024-07-01 12:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01 12:01 [FFmpeg-devel] [PATCH 01/13] avcodec/h261enc: Use LUT to write motion vector differences Andreas Rheinhardt
2024-07-01 12:15 ` [FFmpeg-devel] [PATCH 02/13] avcodec/mpeg12dec: Move resetting last_dc to decoder Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 03/13] avcodec/mpeg12enc: Move resetting last_dc to encoder Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 04/13] avcodec/h263dec: Clean intra tables in decoder, not ff_mpv_reconstruct_mb Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 05/13] avcodec/mpegvideo_enc: Don't reset intra buffers in mpv_reconstruct_mb() Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 06/13] avcodec/mpv_reconstruct_mb_template: Merge template into its users Andreas Rheinhardt
2024-07-01 13:04   ` Rémi Denis-Courmont
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 07/13] avcodec/mpegvideo_{dec, enc}: Reindent after the previous commit Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 08/13] avcodec/mpegvideo_enc: Don't set qscale_table value prematurely Andreas Rheinhardt
2024-07-01 12:16 ` Andreas Rheinhardt [this message]
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 10/13] avcodec/motion_est: Avoid branches for put(_no_rnd) selection Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 11/13] avcodec/mpegvideo_dec: Use picture-dimensions in ff_print_debug_info() Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 12/13] avcodec/vc1dec: Reenable debug-info output for field pictures Andreas Rheinhardt
2024-07-01 12:16 ` [FFmpeg-devel] [PATCH 13/13] avcodec/h261dec: Remove dead check Andreas Rheinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=GV1P250MB0737A6D00FFADD3F416F11D78FD32@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git