Commit d7647e7c authored by Maxime Jourdan's avatar Maxime Jourdan Committed by Mauro Carvalho Chehab

media: meson: vdec: add H.264 decoding support

Add support for the H264 compressed format (V4L2_PIX_FMT_H264).
Signed-off-by: default avatarMaxime Jourdan <mjourdan@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 876f123b
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
meson-vdec-objs = esparser.o vdec.o vdec_helpers.o vdec_platform.o meson-vdec-objs = esparser.o vdec.o vdec_helpers.o vdec_platform.o
meson-vdec-objs += vdec_1.o meson-vdec-objs += vdec_1.o
meson-vdec-objs += codec_mpeg12.o meson-vdec-objs += codec_mpeg12.o codec_h264.o
obj-$(CONFIG_VIDEO_MESON_VDEC) += meson-vdec.o obj-$(CONFIG_VIDEO_MESON_VDEC) += meson-vdec.o
This diff is collapsed.
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2019 BayLibre, SAS
* Author: Maxime Jourdan <mjourdan@baylibre.com>
*/
#ifndef __MESON_VDEC_CODEC_H264_H_
#define __MESON_VDEC_CODEC_H264_H_
#include "vdec.h"
extern struct amvdec_codec_ops codec_h264_ops;
#endif
...@@ -9,9 +9,22 @@ ...@@ -9,9 +9,22 @@
#include "vdec_1.h" #include "vdec_1.h"
#include "codec_mpeg12.h" #include "codec_mpeg12.h"
#include "codec_h264.h"
static const struct amvdec_format vdec_formats_gxbb[] = { static const struct amvdec_format vdec_formats_gxbb[] = {
{ {
.pixfmt = V4L2_PIX_FMT_H264,
.min_buffers = 2,
.max_buffers = 24,
.max_width = 1920,
.max_height = 1080,
.vdec_ops = &vdec_1_ops,
.codec_ops = &codec_h264_ops,
.firmware_path = "meson/vdec/gxbb_h264.bin",
.pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 },
.flags = V4L2_FMT_FLAG_COMPRESSED |
V4L2_FMT_FLAG_DYN_RESOLUTION,
}, {
.pixfmt = V4L2_PIX_FMT_MPEG1, .pixfmt = V4L2_PIX_FMT_MPEG1,
.min_buffers = 8, .min_buffers = 8,
.max_buffers = 8, .max_buffers = 8,
...@@ -38,6 +51,18 @@ static const struct amvdec_format vdec_formats_gxbb[] = { ...@@ -38,6 +51,18 @@ static const struct amvdec_format vdec_formats_gxbb[] = {
static const struct amvdec_format vdec_formats_gxl[] = { static const struct amvdec_format vdec_formats_gxl[] = {
{ {
.pixfmt = V4L2_PIX_FMT_H264,
.min_buffers = 2,
.max_buffers = 24,
.max_width = 3840,
.max_height = 2160,
.vdec_ops = &vdec_1_ops,
.codec_ops = &codec_h264_ops,
.firmware_path = "meson/vdec/gxl_h264.bin",
.pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 },
.flags = V4L2_FMT_FLAG_COMPRESSED |
V4L2_FMT_FLAG_DYN_RESOLUTION,
}, {
.pixfmt = V4L2_PIX_FMT_MPEG1, .pixfmt = V4L2_PIX_FMT_MPEG1,
.min_buffers = 8, .min_buffers = 8,
.max_buffers = 8, .max_buffers = 8,
...@@ -64,6 +89,18 @@ static const struct amvdec_format vdec_formats_gxl[] = { ...@@ -64,6 +89,18 @@ static const struct amvdec_format vdec_formats_gxl[] = {
static const struct amvdec_format vdec_formats_gxm[] = { static const struct amvdec_format vdec_formats_gxm[] = {
{ {
.pixfmt = V4L2_PIX_FMT_H264,
.min_buffers = 2,
.max_buffers = 24,
.max_width = 3840,
.max_height = 2160,
.vdec_ops = &vdec_1_ops,
.codec_ops = &codec_h264_ops,
.firmware_path = "meson/vdec/gxm_h264.bin",
.pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 },
.flags = V4L2_FMT_FLAG_COMPRESSED |
V4L2_FMT_FLAG_DYN_RESOLUTION,
}, {
.pixfmt = V4L2_PIX_FMT_MPEG1, .pixfmt = V4L2_PIX_FMT_MPEG1,
.min_buffers = 8, .min_buffers = 8,
.max_buffers = 8, .max_buffers = 8,
...@@ -90,6 +127,18 @@ static const struct amvdec_format vdec_formats_gxm[] = { ...@@ -90,6 +127,18 @@ static const struct amvdec_format vdec_formats_gxm[] = {
static const struct amvdec_format vdec_formats_g12a[] = { static const struct amvdec_format vdec_formats_g12a[] = {
{ {
.pixfmt = V4L2_PIX_FMT_H264,
.min_buffers = 2,
.max_buffers = 24,
.max_width = 3840,
.max_height = 2160,
.vdec_ops = &vdec_1_ops,
.codec_ops = &codec_h264_ops,
.firmware_path = "meson/vdec/g12a_h264.bin",
.pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 },
.flags = V4L2_FMT_FLAG_COMPRESSED |
V4L2_FMT_FLAG_DYN_RESOLUTION,
}, {
.pixfmt = V4L2_PIX_FMT_MPEG1, .pixfmt = V4L2_PIX_FMT_MPEG1,
.min_buffers = 8, .min_buffers = 8,
.max_buffers = 8, .max_buffers = 8,
...@@ -116,6 +165,18 @@ static const struct amvdec_format vdec_formats_g12a[] = { ...@@ -116,6 +165,18 @@ static const struct amvdec_format vdec_formats_g12a[] = {
static const struct amvdec_format vdec_formats_sm1[] = { static const struct amvdec_format vdec_formats_sm1[] = {
{ {
.pixfmt = V4L2_PIX_FMT_H264,
.min_buffers = 2,
.max_buffers = 24,
.max_width = 3840,
.max_height = 2160,
.vdec_ops = &vdec_1_ops,
.codec_ops = &codec_h264_ops,
.firmware_path = "meson/vdec/g12a_h264.bin",
.pixfmts_cap = { V4L2_PIX_FMT_NV12M, 0 },
.flags = V4L2_FMT_FLAG_COMPRESSED |
V4L2_FMT_FLAG_DYN_RESOLUTION,
}, {
.pixfmt = V4L2_PIX_FMT_MPEG1, .pixfmt = V4L2_PIX_FMT_MPEG1,
.min_buffers = 8, .min_buffers = 8,
.max_buffers = 8, .max_buffers = 8,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment