From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6685545D56 for ; Sun, 7 May 2023 13:35:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 37D4B68C1A5; Sun, 7 May 2023 16:33:34 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 44B9F68C14D for ; Sun, 7 May 2023 16:33:22 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id B91A02404EC for ; Sun, 7 May 2023 15:33:21 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id gqLhOPX3mxE2 for ; Sun, 7 May 2023 15:33:19 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 1F5A92406CB for ; Sun, 7 May 2023 15:33:14 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 4A7883A11B4 for ; Sun, 7 May 2023 15:33:05 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 7 May 2023 15:32:45 +0200 Message-Id: <20230507133255.20881-3-anton@khirnov.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230507133255.20881-1-anton@khirnov.net> References: <20230507133255.20881-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/13] lavc/codec_desc: add a property for codecs that support field coding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Multiple places currently use AVCodecContext.ticks_per_frame > 1 to identify such codecs, which * requires a codec context * requires it to be open --- doc/APIchanges | 3 +++ libavcodec/codec_desc.c | 16 ++++++++++++---- libavcodec/codec_desc.h | 6 ++++++ libavcodec/version.h | 2 +- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index fd01def1b2..777485ce86 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09 API changes, most recent first: +2023-05-xx - xxxxxxxxxx - lavc 60.11.100 - codec_desc.h + Add AV_CODEC_PROP_FIELDS. + 2023-05-04 - xxxxxxxxxx - lavu 58.7.100 - frame.h Deprecate AVFrame.interlaced_frame, AVFrame.top_field_first, and AVFrame.key_frame. diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index d40977d6b3..49dddd1a49 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -38,14 +38,20 @@ static const AVCodecDescriptor codec_descriptors[] = { .type = AVMEDIA_TYPE_VIDEO, .name = "mpeg1video", .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), - .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, + .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER | + // FIXME this is strigly speaking not true, as MPEG-1 does + // not allow field coding, but our mpeg12 code (decoder and + // parser) can sometimes change codec id at runtime, so + // this is safer + AV_CODEC_PROP_FIELDS, }, { .id = AV_CODEC_ID_MPEG2VIDEO, .type = AVMEDIA_TYPE_VIDEO, .name = "mpeg2video", .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), - .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, + .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER | + AV_CODEC_PROP_FIELDS, .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles), }, { @@ -225,7 +231,8 @@ static const AVCodecDescriptor codec_descriptors[] = { .type = AVMEDIA_TYPE_VIDEO, .name = "h264", .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), - .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_REORDER, + .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS | + AV_CODEC_PROP_REORDER | AV_CODEC_PROP_FIELDS, .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles), }, { @@ -529,7 +536,8 @@ static const AVCodecDescriptor codec_descriptors[] = { .type = AVMEDIA_TYPE_VIDEO, .name = "vc1", .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"), - .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, + .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER | + AV_CODEC_PROP_FIELDS, .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles), }, { diff --git a/libavcodec/codec_desc.h b/libavcodec/codec_desc.h index 126b52df47..dd4491112b 100644 --- a/libavcodec/codec_desc.h +++ b/libavcodec/codec_desc.h @@ -90,6 +90,12 @@ typedef struct AVCodecDescriptor { * equal. */ #define AV_CODEC_PROP_REORDER (1 << 3) + +/** + * Video codec supports separate coding of fields in interlaced frames. + */ +#define AV_CODEC_PROP_FIELDS (1 << 4) + /** * Subtitle codec is bitmap based * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. diff --git a/libavcodec/version.h b/libavcodec/version.h index 80e2ae630d..8b53586be1 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 10 +#define LIBAVCODEC_VERSION_MINOR 11 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ -- 2.39.2 _______________________________________________ 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".