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 A71D9435D6 for ; Fri, 17 Jun 2022 20:37:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 32A3768B393; Fri, 17 Jun 2022 23:37:57 +0300 (EEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D24F968B17E for ; Fri, 17 Jun 2022 23:37:50 +0300 (EEST) Received: by mail-pj1-f52.google.com with SMTP id x1-20020a17090abc8100b001ec7f8a51f5so1530967pjr.0 for ; Fri, 17 Jun 2022 13:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=op7gTdK8dGF6YzpF1PHcfqB0okNzolkr2iiXlVLAUsI=; b=R6OqKd2aJdGulCRJ64zQJtcP8aeXTb+Pr5mxdX0vyt2lRT14ogKzf43F6J68bssPgD kMsmiuRNb5TCnBGykmSIzVti433PR1SGuyboqwCUV7axDTUO+3Mu0AWDzMOb+qFOqYds p2V/tzTjkDCLWj/meatv72O0DGpKGqskF8mIkaTIR/LovNLcxE8ftttE9tcNgG1SJFmf DLyYXKRvGTA9IE9i0ObkfEwBr8DNTKXf4aMgrsXYgNRpCz+WcjIRGZj8KeuJQHKS2L63 fUdZyK3SCbTYarh7p0vglHpS1gmTrtc4u6HUKodWcAYfSWGFeDHGmHEDKYMx02Xwi7G1 NHvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=op7gTdK8dGF6YzpF1PHcfqB0okNzolkr2iiXlVLAUsI=; b=bZC729i+H3Y2Dw6dfzjY7Ir6oZ9/jftGH2BGEO6HHaIGqNAP00AjsZyiXTHTFAl+vZ hvc4EgrEtfPbE0eCl3ux+jdJwiIfEixC2BjwZN9L89t1mFA5etx/ybseIYbegSxTXnaX Mc68ul3C9kTigCwT8vHMHdU50zem6YkZz27wESrsGu156MXVBHighRpxtvVzQsj1A1b3 g1kkRm974tocGo3F5ug1zwbeDn+U/9D12I/LGu3z6V2ptb0+9eJ0anEwQI3/eg415AVM /mtRkCUSzO+3nxJ2pKhtiaNeroGEiVB1mvT2MGluoJYPGNNqmtoOo0u8qNddsfJIzcMt 6CBA== X-Gm-Message-State: AJIora9t1j8TcdN3BWIWW3wmql5GKgQvJed6AUYZJG7d4ETKpR5Z6DPx 2BfD4NI1fgpsujkgYySeD/+eUCBgrRjIg+R7jvey6OKeoiU= X-Google-Smtp-Source: AGRyM1teqJWA5MTxbKWcz91SB5JYpJF46hnvb7jTQdIuaJDz48z7lnheSeWA5EkuS+Af+0OCazlwnCb6CLN72VtWfpM= X-Received: by 2002:a17:90b:4f4a:b0:1e3:49c9:aab0 with SMTP id pj10-20020a17090b4f4a00b001e349c9aab0mr23391498pjb.223.1655498268594; Fri, 17 Jun 2022 13:37:48 -0700 (PDT) MIME-Version: 1.0 References: <20220617193436.78-1-tcChlisop0@gmail.com> <20220617193436.78-2-tcChlisop0@gmail.com> In-Reply-To: From: quietvoid Date: Fri, 17 Jun 2022 16:37:37 -0400 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH v2 1/2] libavutil/dovi_meta: Add nlq_pivots to AVDOVIDataMapping 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: On Fri, Jun 17, 2022 at 4:20 PM Andreas Rheinhardt wrote: > > quietvoid: > > The NLQ pivots are not documented but should be present > > in the header for profile 7 RPU format. > > It has been verified using Dolby's verification toolkit. > > > > Also implemented the parsing in libavcodec/dovi_rpu.c. > > And added the info to ffprobe and showinfo. > > > > Signed-off-by: quietvoid > > --- > > fftools/ffprobe.c | 4 ++++ > > libavcodec/dovi_rpu.c | 7 +++++++ > > libavfilter/vf_showinfo.c | 8 ++++++++ > > libavutil/dovi_meta.h | 1 + > > 4 files changed, 20 insertions(+) > > > > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c > > index 4e2fdbaec8..bc4f7ec0a1 100644 > > --- a/fftools/ffprobe.c > > +++ b/fftools/ffprobe.c > > @@ -2001,6 +2001,10 @@ static void print_dovi_metadata(WriterContext *w, const AVDOVIMetadata *dovi) > > break; > > } > > > > + if (mapping->nlq_method_idc != AV_DOVI_NLQ_NONE) { > > + print_list_fmt("nlq_pivots", "%"PRIu16, 2, mapping->nlq_pivots[idx]); > > + } > > + > > print_int("num_x_partitions", mapping->num_x_partitions); > > print_int("num_y_partitions", mapping->num_y_partitions); > > > > diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c > > index a87562c8a3..17837eb845 100644 > > --- a/libavcodec/dovi_rpu.c > > +++ b/libavcodec/dovi_rpu.c > > @@ -315,7 +315,14 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size) > > } > > > > if (use_nlq) { > > + int nlq_pivot = 0; > > vdr->mapping.nlq_method_idc = get_bits(gb, 3); > > + > > + for (int i = 0; i < 2; i++) { > > + nlq_pivot += get_bits(gb, hdr->bl_bit_depth); > > + vdr->mapping.nlq_pivots[i] = av_clip_uint16(nlq_pivot); > > + } > > + > > /** > > * The patent mentions another legal value, NLQ_MU_LAW, but it's > > * not documented anywhere how to parse or apply that type of NLQ. > > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c > > index 6efcafce28..f8c04fb2fa 100644 > > --- a/libavfilter/vf_showinfo.c > > +++ b/libavfilter/vf_showinfo.c > > @@ -535,6 +535,14 @@ static void dump_dovi_metadata(AVFilterContext *ctx, const AVFrameSideData *sd) > > av_log(ctx, AV_LOG_INFO, "mapping_color_space=%"PRIu8"; ", mapping->mapping_color_space); > > av_log(ctx, AV_LOG_INFO, "mapping_chroma_format_idc=%"PRIu8"; ", mapping->mapping_chroma_format_idc); > > av_log(ctx, AV_LOG_INFO, "nlq_method_idc=%d; ", (int) mapping->nlq_method_idc); > > + > > + if (mapping->nlq_method_idc != AV_DOVI_NLQ_NONE) { > > + av_log(ctx, AV_LOG_INFO, "nlq_pivots={ "); > > + for (int i = 0; i < 2; i++) > > + av_log(ctx, AV_LOG_INFO, "%"PRIu16" ", mapping->nlq_pivots[i]); > > + av_log(ctx, AV_LOG_INFO, "}; "); > > Don't use four calls to av_log for something that is so simple. Besides > having higher overhead and binary size it also adds the risk that these > av_logs are disturbed by another av_log in the middle, breaking the > output (at least with the default log callback). Fixed in v3. I've made it into a single log call: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297733.html > (The same btw applies to other av_logs in this very function. Is it > actually intended for this to be one big line?) I'm not exactly sure how the showinfo filters usually look like. I'm only basing this on the existing logging for this part. > > > + } > > + > > av_log(ctx, AV_LOG_INFO, "num_x_partitions=%"PRIu32"; ", mapping->num_x_partitions); > > av_log(ctx, AV_LOG_INFO, "num_y_partitions=%"PRIu32"\n", mapping->num_y_partitions); > > > > diff --git a/libavutil/dovi_meta.h b/libavutil/dovi_meta.h > > index 3d11e02bff..6afc7b055a 100644 > > --- a/libavutil/dovi_meta.h > > +++ b/libavutil/dovi_meta.h > > @@ -147,6 +147,7 @@ typedef struct AVDOVIDataMapping { > > uint32_t num_x_partitions; > > uint32_t num_y_partitions; > > AVDOVINLQParams nlq[3]; /* per component */ > > + uint16_t nlq_pivots[2]; /* nlq_pred_pivot_value */ > > } AVDOVIDataMapping; > > > > /** > > _______________________________________________ > 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". _______________________________________________ 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".