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 87ED34A1B5 for ; Sat, 23 Mar 2024 17:38:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1839968D44E; Sat, 23 Mar 2024 19:37:52 +0200 (EET) Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1A6EB68D329 for ; Sat, 23 Mar 2024 19:37:42 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1711215461; bh=UV+7GcBmwo5wgEs7bcHEIr2C4JP7DiZE/POvPBQVutg=; h=From:To:Cc:Subject:Date:From; b=CqXvsKeBz/lzDebaVVCu+WmLiPFlPkgKzTXHBGqzBOxOfznnPvqb/8DzYyTOaU6+Z LgHkJwTtsLIQPkkYdBOX/aqJ95D+dRFpoSvfrwyJr1amPLNgVallqSfpQyrg66bMQ/ y6mHcgYpUl3GoSiKche+z4kBzmj/1GuRbpCtWeOQ= Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 168E640015; Sat, 23 Mar 2024 18:37:41 +0100 (CET) From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sat, 23 Mar 2024 18:37:30 +0100 Message-ID: <20240323173735.26224-1-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] avutil/dovi_meta: add AVDOVIDataMapping.nlq_pivots 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: quietvoid , 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: 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. Signed-off-by: quietvoid Signed-off-by: Niklas Haas --- doc/APIchanges | 3 +++ libavcodec/dovi_rpu.c | 9 ++++++++- libavutil/dovi_meta.h | 1 + libavutil/version.h | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 2796b4d0c25..739f33501e9 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 API changes, most recent first: +2024-03-xx - xxxxxxxxxx - lavu 59.5.100 - dovi_meta.h + Add AVDOVIDataMapping.nlq_pivots. + 2024-03-xx - xxxxxxxxxx - lavc 61.3.100 - jni.h Add av_jni_set_android_app_ctx() and av_jni_get_android_app_ctx(). diff --git a/libavcodec/dovi_rpu.c b/libavcodec/dovi_rpu.c index 31c64fb0602..c84a942f476 100644 --- a/libavcodec/dovi_rpu.c +++ b/libavcodec/dovi_rpu.c @@ -109,7 +109,7 @@ int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame) /* Copy only the parts of these structs known to us at compiler-time. */ #define COPY(t, a, b, last) memcpy(a, b, offsetof(t, last) + sizeof((b)->last)) COPY(AVDOVIRpuDataHeader, av_dovi_get_header(dovi), &s->header, disable_residual_flag); - COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq[2].linear_deadzone_threshold); + COPY(AVDOVIDataMapping, av_dovi_get_mapping(dovi), s->mapping, nlq_pivots); COPY(AVDOVIColorMetadata, av_dovi_get_color(dovi), s->color, source_diagonal); return 0; } @@ -346,7 +346,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/libavutil/dovi_meta.h b/libavutil/dovi_meta.h index 3d11e02bffc..6afc7b055a7 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; /** diff --git a/libavutil/version.h b/libavutil/version.h index 882003f7199..8a1ecd44516 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 59 -#define LIBAVUTIL_VERSION_MINOR 4 +#define LIBAVUTIL_VERSION_MINOR 5 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ -- 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".