Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 3/4] avcodec/h264dec: implement export of video coding info for H.264
Date: Fri, 18 Jul 2025 16:17:34 +0200
Message-ID: <20250718141734.GB29660@pb2> (raw)
In-Reply-To: <20250718103055.1172733-3-timothee.informatique@regaud-chapuy.fr>


[-- Attachment #1.1: Type: text/plain, Size: 2863 bytes --]

On Fri, Jul 18, 2025 at 12:30:54PM +0200, Timothée Regaud wrote:
> From: Timothee Regaud <timothee.informatique@regaud-chapuy.fr>
> 
> Hooks into the H.264 decoder to populate the new generic video coding info structures. It handles allocation of the side data buffer, collection of modes/MVs/refs for all macroblock types, and attach the final side data buffer to the output frame.
> 
> This should serve as a template for adding support for other codecs down the line.
> 
> Signed-off-by: Timothee Regaud <timothee.informatique@regaud-chapuy.fr>
> ---
>  Changelog                     |   1 +
>  libavcodec/h264_mb.c          | 150 ++++++++++++++++++++++++++++++++++
>  libavcodec/h264_mb_template.c |   3 +
>  libavcodec/h264_picture.c     |   3 +
>  libavcodec/h264_slice.c       |  19 +++++
>  libavcodec/h264dec.c          |  17 ++++
>  libavcodec/h264dec.h          |  12 +++
>  7 files changed, 205 insertions(+)
> 
[...]
> @@ -102,6 +103,14 @@
>  // does this mb use listX, note does not work if subMBs
>  #define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list))))
>  
> +/* Constants for AVVideoCodingInfo buffer allocation for H.264.
> + * Max sub-data per MB is for inter prediction with 16 partitions. */
> +static const size_t H264_MAX_MV_SIZE_PER_LIST = 16 * sizeof(int16_t[2]);
> +static const size_t H264_MAX_REF_SIZE_PER_LIST = 16 * sizeof(int8_t);
> +static const size_t H264_INTER_SUB_DATA_SIZE = 2 * (H264_MAX_MV_SIZE_PER_LIST + H264_MAX_REF_SIZE_PER_LIST);
> +static const size_t H264_INTRA_SUB_DATA_SIZE = 16 * sizeof(int8_t);
> +static const size_t H264_MAX_SUB_DATA_PER_MB = FFMAX(H264_INTER_SUB_DATA_SIZE, H264_INTRA_SUB_DATA_SIZE);

CC	libavfilter/vf_codecview.o
In file included from src/libavfilter/vf_codecview.c:45:0:
src/libavcodec/h264dec.h:110:48: error: initializer element is not constant
 static const size_t H264_INTER_SUB_DATA_SIZE = 2 * (H264_MAX_MV_SIZE_PER_LIST + H264_MAX_REF_SIZE_PER_LIST);
                                                ^
In file included from src/libavutil/error.h:30:0,
                 from src/libavutil/common.h:43,
                 from src/libavutil/avutil.h:300,
                 from src/libavutil/opt.h:31,
                 from src/libavfilter/vf_codecview.c:34:
src/libavutil/macros.h:47:20: error: initializer element is not constant
 #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
                    ^
src/libavcodec/h264dec.h:112:48: note: in expansion of macro ‘FFMAX’
 static const size_t H264_MAX_SUB_DATA_PER_MB = FFMAX(H264_INTER_SUB_DATA_SIZE, H264_INTRA_SUB_DATA_SIZE);

arm-linux-gnueabi-gcc-7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: 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-07-18 14:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18 10:30 [FFmpeg-devel] [PATCH 1/4] avutil: add generic side data for video coding info Timothée Regaud
2025-07-18 10:30 ` [FFmpeg-devel] [PATCH 2/4] avcodec: add option to export " Timothée Regaud
2025-07-18 10:30 ` [FFmpeg-devel] [PATCH 3/4] avcodec/h264dec: implement export of video coding info for H.264 Timothée Regaud
2025-07-18 14:17   ` Michael Niedermayer [this message]
2025-07-18 10:30 ` [FFmpeg-devel] [PATCH 4/4] vf_codecview: add support for AV_FRAME_DATA_VIDEO_CODING_INFO Timothée Regaud
2025-07-18 15:48 ` [FFmpeg-devel] [PATCH 1/4] avutil: add generic side data for video coding info Michael Niedermayer

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=20250718141734.GB29660@pb2 \
    --to=michael@niedermayer.cc \
    --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