[FFmpeg-devel] [PATCH] avcodec/h264bsd_dec: add h264dec base on h264bsd

Lynne dev at lynne.ee
Wed Apr 16 09:43:37 EEST 2025


On 16/04/2025 08:12, Shiqi Zhu wrote:
> h264bsd url https://github.com/oneam/h264bsd
> ./configure --enable-decoder="h264_bsd" --extra-cflags="-I<path>/h264bsd/src" --extra-ldflags="-L<path>/h264bsd/posix/lib" --extra-libs="-lh264bsd"
> Test
> ./ffmpeg -y -codec:v h264_bsd -i <path>/h264bsd/test/test_640x360.h264 ./test_640x360.yuv

Yes, but we already have the best and fastest H264 decoder out there, 
and (for no more than a year or so, until its patents expire and its 
made redundant), an libopenh264 backend.

> Signed-off-by: Shiqi Zhu <hiccupzhu at gmail.com>
> ---
>   libavcodec/Makefile      |   1 +
>   libavcodec/allcodecs.c   |   1 +
>   libavcodec/h264bsd_dec.c | 183 +++++++++++++++++++++++++++++++++++++++
>   3 files changed, 185 insertions(+)
>   create mode 100644 libavcodec/h264bsd_dec.c
> 
> +
> +const FFCodec ff_h264_bsd_decoder = {
> +    .p.name = "h264_bsd",
> +    CODEC_LONG_NAME("h264bsd video decoder for ffmpeg"),
> +    .p.type = AVMEDIA_TYPE_VIDEO,
> +    .p.id = AV_CODEC_ID_H264,
> +    .priv_data_size = sizeof(DecodeContext),
> +    .init = h264_bsd_init_decoder,
> +    .close = h264_bsd_close_decoder,
> +    FF_CODEC_DECODE_CB(h264_bsd_decode_frame),
> +    .flush = h264_bsd_flush,
> +    .p.priv_class = &h264_bsd_dec_class,
> +    .bsfs = "h264_mp4toannexb",
> +    .p.capabilities = AV_CODEC_CAP_DELAY,
> +    .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE },
> +    .p.wrapper_name = "ff_h264_bsd_decoder",
> +    .caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING,
> +};
> \ No newline at end of file
^^
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250416/63bb4676/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250416/63bb4676/attachment.sig>


More information about the ffmpeg-devel mailing list