linux-stable/drivers/media/v4l2-core
Nicolas Dufresne 2d6c05d4ac media: v4l2-core: Initialize h264 scaling matrix
[ Upstream commit 0f6146d476 ]

In the final H264 API, it is not required to set scaling matrix if
they are not present in the bitstream. A flag was added in order to let
the driver know. The downside is that it leaves the default control
value to 0, which isn't valid. As per the spec (see formulas 7-8/7-9),
when the scaling matrix are absent from the bitstream, flat values
of 16 should be used. This improves this control semantic in a way
that the control value are always valid. Drivers can then use
the scaling_matrix control values without having to check its presence.
Same method was employed for MPEG2_QUANTISATION.

This fixes issues with MTK VCODEC H264 decoder when using GStreamer.
GStreamer does not set this control if its not present in the bitstream.
As MTK VDCODEC was using the initialized to 0 values, the frames ended
up completely gray.

Fixes: 54889c51b8 ("media: uapi: h264: Rename and clarify PPS_FLAG_SCALING_MATRIX_PRESENT")
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 13:57:48 +02:00
..
Kconfig media: Add VP9 v4l2 library 2021-11-22 07:47:13 +00:00
Makefile media: Add VP9 v4l2 library 2021-11-22 07:47:13 +00:00
tuner-core.c
v4l2-async.c media: v4l: async: Rename async nf functions, clean up long lines 2021-09-30 10:07:35 +02:00
v4l2-common.c media: Add NV12_4L4 tiled format 2021-09-30 10:07:40 +02:00
v4l2-compat-ioctl32.c media: v4l2-core: fix VIDIOC_DQEVENT handling on non-x86 2021-11-10 11:38:26 +00:00
v4l2-ctrls-api.c media: v4l2-ctrls: split up into four source files 2021-05-25 17:03:29 +02:00
v4l2-ctrls-core.c media: v4l2-core: Initialize h264 scaling matrix 2022-04-08 13:57:48 +02:00
v4l2-ctrls-defs.c media: uapi: Add VP9 stateless decoder controls 2021-11-22 07:44:55 +00:00
v4l2-ctrls-priv.h media: v4l2-ctrls: split up into four source files 2021-05-25 17:03:29 +02:00
v4l2-ctrls-request.c media: v4l2-ctrls: split up into four source files 2021-05-25 17:03:29 +02:00
v4l2-dev.c media: v4l2-dev.c: Modified the macro SET_VALID_IOCTL 2021-06-02 14:18:01 +02:00
v4l2-device.c media: v4l: subdev: Set sd->devnode before registering the subdev 2020-12-02 15:55:44 +01:00
v4l2-dv-timings.c media: v4l2-dv-timings.c: fix wrong condition in two for-loops 2021-08-04 14:43:52 +02:00
v4l2-event.c media: v4l2-event: Modified variable type 'unsigned' to 'unsigned int' 2021-06-17 10:22:59 +02:00
v4l2-fh.c media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release 2021-06-02 13:17:44 +02:00
v4l2-flash-led-class.c media: v4l2-flash: Check whether setting LED brightness succeeded 2021-08-04 14:43:51 +02:00
v4l2-fwnode.c media: v4l2-fwnode: Simplify v4l2_async_nf_parse_fwnode_endpoints() 2021-09-30 10:07:35 +02:00
v4l2-h264.c media: uapi: h264: Clean slice invariants syntax elements 2020-09-01 14:13:28 +02:00
v4l2-i2c.c media: v4l2-core: v4l2-i2c: convert to new API with ERRPTR 2020-02-24 15:21:52 +01:00
v4l2-ioctl.c media: v4l: Avoid unaligned access warnings when printing 4cc modifiers 2022-04-08 13:57:43 +02:00
v4l2-jpeg.c media: Avoid parsing quantization and huffman tables 2021-03-22 10:40:13 +01:00
v4l2-mc.c media: v4l2-mc: fix a warning message 2021-03-22 13:06:39 +01:00
v4l2-mem2mem.c media: v4l2-mem2mem: Apply DST_QUEUE_OFF_BASE on MMAP buffers across ioctls 2022-04-08 13:57:42 +02:00
v4l2-spi.c
v4l2-subdev.c media: subdev: remove VIDIOC_DQEVENT_TIME32 handling 2021-06-17 10:16:34 +02:00
v4l2-trace.c
v4l2-vp9.c media: Add VP9 v4l2 library 2021-11-22 07:47:13 +00:00
videobuf-core.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
videobuf-dma-contig.c mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
videobuf-dma-sg.c media: videobuf-dma-sg: void function return statements are not generally useful 2021-06-02 14:18:36 +02:00
videobuf-vmalloc.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00