Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/dovi_rpudec - correctly read el_bit_depth_minus8 when ext_mapping_idc is non-zero
Date: Tue, 21 May 2024 07:56:42 +0200
Message-ID: <GV1P250MB07375180ED51E100A8C10A978FEA2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <0101018f98b99e17-5074658e-5904-4d46-8d6f-4a7f3630bdd4-000000@us-west-2.amazonses.com>

Cosmin Stejerean via ffmpeg-devel:
> From: Cosmin Stejerean <cosmin@cosmin.at>
> 
> It looks like the el_bitdepth_minus8 value in the header can also encode
> ext_mapping_idc in the upper 8 bits.
> 
> Samples having a non-zero ext_mapping_idc fail validation currently because the
> value returned is out of range. This bypasses this by currently ignoring the
> ext_mapping_idc and using only the lower 8 bits for el_bitdepth_minus8.
> 
> ---
>  libavcodec/dovi_rpudec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c
> index 7c7eda9d09..1b11ad3640 100644
> --- a/libavcodec/dovi_rpudec.c
> +++ b/libavcodec/dovi_rpudec.c
> @@ -411,7 +411,9 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size,
>  
>          if ((hdr->rpu_format & 0x700) == 0) {
>              int bl_bit_depth_minus8 = get_ue_golomb_31(gb);
> -            int el_bit_depth_minus8 = get_ue_golomb_31(gb);
> +            // this can encode a two byte value, with higher byte being ext_mapping_idc
> +            // use only the lower byte for el_bit_depth_minus8
> +            uint8_t el_bit_depth_minus8 = get_ue_golomb_long(gb) & 0xFF;
>              int vdr_bit_depth_minus8 = get_ue_golomb_31(gb);
>              VALIDATE(bl_bit_depth_minus8, 0, 8);
>              VALIDATE(el_bit_depth_minus8, 0, 8);

So there is a field (ext_mapping_idc) in RPU that neither rpudec nor
rpuenc (nor dovi_meta.h) know about? In this case, we should disable the
encoding parts.

- Andreas

_______________________________________________
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".

  reply	other threads:[~2024-05-21  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240521011728.29347-1-cosmin@cosmin.at>
2024-05-21  1:17 ` Cosmin Stejerean via ffmpeg-devel
2024-05-21  5:56   ` Andreas Rheinhardt [this message]
2024-05-21 10:21   ` Niklas Haas
     [not found]     ` <DE3EBDBF-57F4-466B-8881-1FCD4A750852@cosmin.at>
2024-05-21 15:23       ` Cosmin Stejerean via ffmpeg-devel
     [not found] ` <20240521011728.29347-2-cosmin@cosmin.at>
2024-05-21  1:17   ` [FFmpeg-devel] [PATCH] avcodec/libsvtav1: send the EOS signal without a one frame delay to allow for the library to operate in a low-delay mode Cosmin Stejerean via ffmpeg-devel
     [not found]     ` <A69148C5-81DD-495E-926C-62D0D6F81862@cosmin.at>
2024-05-21  3:38       ` 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=GV1P250MB07375180ED51E100A8C10A978FEA2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /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