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 5F2F14C48C for ; Sun, 28 Jul 2024 10:28:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F19C68D983; Sun, 28 Jul 2024 13:26:05 +0300 (EEST) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8A6FE68D90F for ; Sun, 28 Jul 2024 13:25:41 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1722162337; bh=EU0E3FwQVe/A1BAwcpsKlRRx+/iNt5Au6PIbfxCuQ9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KmTI+1T44ASHr8AxVTqxnf2g5YXS+xWMW4k8GqnEBZ7UyIbT0r8JLS8hynT+Zv1gF f9g6hGTs/QThvqcvKG3FyljeOUt0AguTV0hv3wiOfeysx58kznFCkFat1Ki9dqx1VT jEyXHpQCQ/5OhbnI6taQnBMqOio15udyMd5xie0g= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id EDBE442AB2; Sun, 28 Jul 2024 12:25:36 +0200 (CEST) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sun, 28 Jul 2024 12:25:13 +0200 Message-ID: <20240728102527.17991-8-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240728102527.17991-1-ffmpeg@haasn.xyz> References: <20240728102527.17991-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/22] avcodec/dovi_rpuenc: add a flag to enable compression 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 Cc: Niklas Haas 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: From: Niklas Haas Keyframes must reset the metadata compression state, so we need to also signal this at rpu generation time. Default to uncompressed, because encoders cannot generally know if a given frame will be a keyframe before they finish encoding, but also cannot retroactively attach the RPU. (Within the confines of current APIs) --- libavcodec/dovi_rpu.h | 1 + libavcodec/dovi_rpuenc.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/dovi_rpu.h b/libavcodec/dovi_rpu.h index 226a769bff..e2e7635cfb 100644 --- a/libavcodec/dovi_rpu.h +++ b/libavcodec/dovi_rpu.h @@ -126,6 +126,7 @@ int ff_dovi_configure(DOVIContext *s, AVCodecContext *avctx); enum { FF_DOVI_WRAP_NAL = 1 << 0, ///< wrap inside NAL RBSP FF_DOVI_WRAP_T35 = 1 << 1, ///< wrap inside T.35+EMDF + FF_DOVI_COMPRESS_RPU = 1 << 2, ///< enable compression for this RPU }; /** diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c index 73db9437a0..0d4e613a72 100644 --- a/libavcodec/dovi_rpuenc.c +++ b/libavcodec/dovi_rpuenc.c @@ -444,6 +444,7 @@ int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, int vdr_dm_metadata_present, vdr_rpu_id, use_prev_vdr_rpu, profile, buffer_size, rpu_size, pad, zero_run; int num_ext_blocks_v1, num_ext_blocks_v2; + int dv_md_compression = s->cfg.dv_md_compression; uint32_t crc; uint8_t *dst; if (!metadata) { @@ -463,6 +464,9 @@ int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, return AVERROR_INVALIDDATA; } + if (!(flags & FF_DOVI_COMPRESS_RPU)) + dv_md_compression = AV_DOVI_COMPRESSION_NONE; + vdr_rpu_id = mapping->vdr_rpu_id; use_prev_vdr_rpu = 0; @@ -472,7 +476,7 @@ int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, return AVERROR(ENOMEM); } - switch (s->cfg.dv_md_compression) { + switch (dv_md_compression) { case AV_DOVI_COMPRESSION_LIMITED: /* Limited metadata compression requires vdr_rpi_id == 0 */ if (vdr_rpu_id != 0) -- 2.45.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".