From: Cosmin Stejerean via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: "FFmpeg development discussions and patches" <ffmpeg-devel@ffmpeg.org>
Cc: "Cosmin Stejerean" <cosmin@cosmin.at>, "Niklas Haas" <git@haasn.dev>
Subject: Re: [FFmpeg-devel] [PATCH 2/5] avformat/dovi_isom: implement dv_md_compression
Date: Tue, 16 Jul 2024 11:40:03 +0000
Message-ID: <01010190bb57aab5-167629dc-2149-4bbd-90d7-9b61a480632c-000000@us-west-2.amazonses.com> (raw)
In-Reply-To: <20240716112317.35745-2-ffmpeg@haasn.xyz>
> On Jul 16, 2024, at 1:23 PM, Niklas Haas <ffmpeg@haasn.xyz> wrote:
>
> From: Niklas Haas <git@haasn.dev>
>
> ---
> libavformat/dovi_isom.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/libavformat/dovi_isom.c b/libavformat/dovi_isom.c
> index d49aa5a75f..269374cff9 100644
> --- a/libavformat/dovi_isom.c
> +++ b/libavformat/dovi_isom.c
> @@ -57,11 +57,14 @@ int ff_isom_parse_dvcc_dvvc(void *logctx, AVStream *st,
>
> // Has enough remaining data
> if (size >= 5) {
> - dovi->dv_bl_signal_compatibility_id = ((*buf_ptr++) >> 4) & 0x0f; // 4 bits
> + uint8_t buf = *buf_ptr++;
> + dovi->dv_bl_signal_compatibility_id = (buf >> 4) & 0x0f; // 4 bits
> + dovi->dv_md_compression = (buf >> 2) & 0x03; // 2 bits
This seems fine based on what this code is currently doing, but I'm curious, should this be moved to something like get_bits at some point?
> } else {
> // 0 stands for None
> // Dolby Vision V1.2.93 profiles and levels
> dovi->dv_bl_signal_compatibility_id = 0;
> + dovi->dv_md_compression = AV_DOVI_COMPRESSION_NONE;
> }
>
> if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
> @@ -71,13 +74,14 @@ int ff_isom_parse_dvcc_dvvc(void *logctx, AVStream *st,
> }
>
> av_log(logctx, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, profile: %d, level: %d, "
> - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n",
> + "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d, compression: %d\n",
> dovi->dv_version_major, dovi->dv_version_minor,
> dovi->dv_profile, dovi->dv_level,
> dovi->rpu_present_flag,
> dovi->el_present_flag,
> dovi->bl_present_flag,
> - dovi->dv_bl_signal_compatibility_id);
> + dovi->dv_bl_signal_compatibility_id,
> + dovi->dv_md_compression);
>
> return 0;
> }
> @@ -97,8 +101,9 @@ void ff_isom_put_dvcc_dvvc(void *logctx, uint8_t out[ISOM_DVCC_DVVC_SIZE],
> put_bits(&pb, 1, !!dovi->el_present_flag);
> put_bits(&pb, 1, !!dovi->bl_present_flag);
> put_bits(&pb, 4, dovi->dv_bl_signal_compatibility_id & 0x0f);
> + put_bits(&pb, 2, dovi->dv_md_compression & 0x03);
>
> - put_bits(&pb, 28, 0); /* reserved */
> + put_bits(&pb, 26, 0); /* reserved */
> put_bits32(&pb, 0); /* reserved */
> put_bits32(&pb, 0); /* reserved */
> put_bits32(&pb, 0); /* reserved */
> @@ -108,12 +113,14 @@ void ff_isom_put_dvcc_dvvc(void *logctx, uint8_t out[ISOM_DVCC_DVVC_SIZE],
>
> av_log(logctx, AV_LOG_DEBUG,
> "DOVI in %s box, version: %d.%d, profile: %d, level: %d, "
> - "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n",
> + "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d, "
> + "compression: %d\n",
would it be more user friendly to log the display value like limited, none, extended rather than numeric value here?
> dovi->dv_profile > 10 ? "dvwC" : (dovi->dv_profile > 7 ? "dvvC" : "dvcC"),
> dovi->dv_version_major, dovi->dv_version_minor,
> dovi->dv_profile, dovi->dv_level,
> dovi->rpu_present_flag,
> dovi->el_present_flag,
> dovi->bl_present_flag,
> - dovi->dv_bl_signal_compatibility_id);
> + dovi->dv_bl_signal_compatibility_id,
> + dovi->dv_md_compression);
> }
> --
>
Overall LGTM.
- Cosmin
_______________________________________________
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".
next prev parent reply other threads:[~2024-07-16 11:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 11:23 [FFmpeg-devel] [PATCH 1/5] avutil/dovi_meta: add dv_md_compression to cfg record Niklas Haas
2024-07-16 11:23 ` [FFmpeg-devel] [PATCH 2/5] avformat/dovi_isom: implement dv_md_compression Niklas Haas
[not found] ` <21B56119-B46F-409D-B398-746420438132@cosmin.at>
2024-07-16 11:40 ` Cosmin Stejerean via ffmpeg-devel [this message]
2024-07-16 11:23 ` [FFmpeg-devel] [PATCH 3/5] avformat/mpegts: " Niklas Haas
[not found] ` <5F5C69A3-01BC-4F25-A69A-C397509AE652@cosmin.at>
2024-07-16 11:41 ` Cosmin Stejerean via ffmpeg-devel
2024-07-16 11:23 ` [FFmpeg-devel] [PATCH 4/5] avformat/dump: " Niklas Haas
[not found] ` <FB82B6B8-716A-4F38-BD26-57AE355678D3@cosmin.at>
2024-07-16 11:41 ` Cosmin Stejerean via ffmpeg-devel
2024-07-16 11:23 ` [FFmpeg-devel] [PATCH 5/5] fftools/ffprobe: " Niklas Haas
[not found] ` <157FF15A-BCC1-4BAC-9875-6E5CF4928FDC@cosmin.at>
2024-07-16 11:32 ` Cosmin Stejerean via ffmpeg-devel
2024-07-17 18:07 ` Michael Niedermayer
2024-07-18 10:52 ` Niklas Haas
[not found] ` <71460422-4A3C-45F1-A588-3DCE4600AE51@cosmin.at>
2024-07-16 11:30 ` [FFmpeg-devel] [PATCH 1/5] avutil/dovi_meta: add dv_md_compression to cfg record Cosmin Stejerean via ffmpeg-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01010190bb57aab5-167629dc-2149-4bbd-90d7-9b61a480632c-000000@us-west-2.amazonses.com \
--to=ffmpeg-devel@ffmpeg.org \
--cc=cosmin@cosmin.at \
--cc=git@haasn.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git