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 47E5749715 for ; Tue, 19 Mar 2024 19:17:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 831DC68D430; Tue, 19 Mar 2024 21:16:57 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6AD6D68D2E9 for ; Tue, 19 Mar 2024 21:16:48 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1710875808; bh=eVGnSdhu9/rBV00q4o4i75HFO+5yqgyrEBZW2BJANNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPJioO5orZ21RGY9Z9C2lOuuoW03EkPAfU+NSCENnbPkWE5D/DBfICKO5/gO+9cxe kJL6Ct/RFVgNoVP+Uz7a47MNr7gFAc5cv1SLEk09xYmEsa8YBBHMlFYFhT+NbDn0r4 ugFfV363ahpnurkDlST/egaYBnRZq288lE5iZZPg= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 4025240B76; Tue, 19 Mar 2024 20:16:48 +0100 (CET) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 20:16:42 +0100 Message-ID: <20240319191642.95217-4-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240319191642.95217-1-ffmpeg@haasn.xyz> References: <20240319191642.95217-1-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] avcodec/libx265: encode dovi RPUs 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 libx265 supports these natively, we just need to forward them to the x265picture. --- libavcodec/libx265.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 92183b9ca26..92b25844ef6 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -560,6 +560,7 @@ static av_cold int libx265_encode_set_roi(libx265Context *ctx, const AVFrame *fr static void free_picture(libx265Context *ctx, x265_picture *pic) { x265_sei *sei = &pic->userSEI; + av_free(pic->rpu.payload); for (int i = 0; i < sei->numPayloads; i++) av_free(sei->payloads[i].payload); @@ -594,6 +595,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, sei->numPayloads = 0; if (pic) { + AVFrameSideData *sd; ReorderedData *rd; int rd_idx; @@ -694,6 +696,15 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, sei->numPayloads++; } } + + if ((sd = av_frame_get_side_data(pic, AV_FRAME_DATA_DOVI_RPU_BUFFER))) { + x265pic.rpu.payload = av_memdup(sd->data, sd->size); + if (!x265pic.rpu.payload) { + free_picture(ctx, &x265pic); + return AVERROR(ENOMEM); + } + x265pic.rpu.payloadSize = sd->size; + } } ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal, -- 2.44.0 _______________________________________________ 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".