Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Timothée <timothee.informatique@regaud-chapuy.fr>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avfilter/codecview: Enable QP visualization for H.264
Date: Thu, 19 Jun 2025 11:37:43 +0200
Message-ID: <522ab438-41c6-45d4-8292-78ead2f6b206@regaud-chapuy.fr> (raw)
In-Reply-To: <20250619001725.GQ29660@pb2>

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

Context from the first version : Subject was "avcodec/h264: fixed qp table attach for h264"


> Here is a patch where I fixed the attach of per-macroblock qp tables for
> H.264. It was implemented for MPEG2 so I have only extended it.
>
> I tested the functionality with the codecview filter using the following
> command: `./ffmpeg -export_side_data 4 -i input.mp4 -vf codecview=qp=1
> output.mp4`

Here is the new version of the patch.

I have remove the unnecessary line in qp_table.h and changed the commit 
message.

Timothee

[-- Attachment #2: 0001-avfilter-codecview-Enable-QP-visualization-for-H.264.patch --]
[-- Type: text/x-patch, Size: 1414 bytes --]

From 74b3fc3cc9f10a9483b3ca1c838d69fe4cb6c3ba Mon Sep 17 00:00:00 2001
From: Timothee <timothee.informatique@regaud-chapuy.fr>
Date: Thu, 19 Jun 2025 11:23:45 +0200
Subject: [PATCH] avfilter/codecview: Enable QP visualization for H.264

The codecviewfilter, when used with qp=1, did not display quantization parameter values for H.264 streams because the QP table extraction was restricted to MPEG-2 video.

This patch enables H.264 support by updating ff_qp_table_extractto accept AV_VIDEO_ENC_PARAMS_H264. This allows for correct QP overlay on H.264 video

Signed-off-by: Timothee <timothee.informatique@regaud-chapuy.fr>
---
 libavfilter/qp_table.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavfilter/qp_table.c b/libavfilter/qp_table.c
index 8137dc019f..abe46e810b 100644
--- a/libavfilter/qp_table.c
+++ b/libavfilter/qp_table.c
@@ -39,8 +39,9 @@ int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table
     sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_ENC_PARAMS);
     if (!sd)
         return 0;
-    par = (AVVideoEncParams*)sd->data;
-    if (par->type != AV_VIDEO_ENC_PARAMS_MPEG2 ||
+    par = (AVVideoEncParams *)sd->data;
+    if ((par->type != AV_VIDEO_ENC_PARAMS_MPEG2 &&
+         par->type != AV_VIDEO_ENC_PARAMS_H264) ||
         (par->nb_blocks != 0 && par->nb_blocks != nb_mb))
         return AVERROR(ENOSYS);
 
-- 
2.39.5


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
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:[~2025-06-19  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2dc54cad-932f-4c30-9f9d-0a943e0a7be3@regaud-chapuy.fr>
2025-06-16  9:14 ` [FFmpeg-devel] Fwd: [PATCH v2] avcodec/h264: fixed qp table attach for h264 Timothee
2025-06-16  9:32   ` Andreas Rheinhardt
2025-06-16 12:52     ` Timothee
2025-06-16 19:41       ` Andreas Rheinhardt
2025-06-17  7:29     ` [FFmpeg-devel] [PATCH v3] " Timothee
2025-06-17 23:56       ` Michael Niedermayer
2025-06-18 11:04         ` Timothée
2025-06-19  0:17           ` Michael Niedermayer
2025-06-19  9:37             ` Timothée [this message]

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=522ab438-41c6-45d4-8292-78ead2f6b206@regaud-chapuy.fr \
    --to=timothee.informatique@regaud-chapuy.fr \
    --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