Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Valerii Zapodovnikov via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Valerii Zapodovnikov <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PR] avcodec/hevc/hevcdec: take into account YUV400 in block length (PR #21630)
Date: Mon, 02 Feb 2026 21:46:11 -0000
Message-ID: <177006877173.25.6859219608372993501@4457048688e7> (raw)

PR #21630 opened by Valerii Zapodovnikov (Balling)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21630
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21630.patch

Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>


See issue #11551.


>From 90447b420fdc2b2a693623ecccdefe5e5845ec59 Mon Sep 17 00:00:00 2001
From: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
Date: Tue, 3 Feb 2026 00:42:35 +0300
Subject: [PATCH] avcodec/hevc/hevcdec: take into account YUV400 in block
 length

Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
---
 libavcodec/hevc/hevcdec.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c
index 531d1c26f3..fd8e269a8c 100644
--- a/libavcodec/hevc/hevcdec.c
+++ b/libavcodec/hevc/hevcdec.c
@@ -1668,10 +1668,11 @@ static int hls_pcm_sample(HEVCLocalContext *lc, const HEVCLayerContext *l,
     uint8_t *dst1 = &s->cur_frame->f->data[1][(y0 >> sps->vshift[1]) * stride1 + ((x0 >> sps->hshift[1]) << sps->pixel_shift)];
     uint8_t *dst2 = &s->cur_frame->f->data[2][(y0 >> sps->vshift[2]) * stride2 + ((x0 >> sps->hshift[2]) << sps->pixel_shift)];
 
-    int length         = cb_size * cb_size * sps->pcm.bit_depth +
-                         (((cb_size >> sps->hshift[1]) * (cb_size >> sps->vshift[1])) +
-                          ((cb_size >> sps->hshift[2]) * (cb_size >> sps->vshift[2]))) *
-                          sps->pcm.bit_depth_chroma;
+    int length = cb_size * cb_size * sps->pcm.bit_depth +
+	    sps->chroma_format_idc != 0 ? (
+        (((cb_size >> sps->hshift[1]) * (cb_size >> sps->vshift[1])) +
+        ((cb_size >> sps->hshift[2]) * (cb_size >> sps->vshift[2]))) *
+        sps->pcm.bit_depth_chroma : 0 );
     const uint8_t *pcm = skip_bytes(&lc->cc, (length + 7) >> 3);
     int ret;
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2026-02-02 21:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=177006877173.25.6859219608372993501@4457048688e7 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@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