ed7bb87d | 13-May-2022 |
Nicolas Dufresne <nicolas.dufresne@collabora.com> |
media: rkvdec: Enable capture buffer holding for H264
In order to support interlaced video decoding, the driver must allow holding the capture buffer so that the second field can be decoded into it.
media: rkvdec: Enable capture buffer holding for H264
In order to support interlaced video decoding, the driver must allow holding the capture buffer so that the second field can be decoded into it.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
6f32ea37 | 13-May-2022 |
Nicolas Dufresne <nicolas.dufresne@collabora.com> |
media: rkvdec-h264: Add field decoding support
This makes use of the new feature in the reference builder to program up to 32 references when doing field decoding. It also signals the parity (top or
media: rkvdec-h264: Add field decoding support
This makes use of the new feature in the reference builder to program up to 32 references when doing field decoding. It also signals the parity (top or bottom) of the field to the hardware.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
5e57a860 | 13-May-2022 |
Jonas Karlman <jonas@kwiboo.se> |
media: rkvdec: Ensure decoded resolution fit coded resolution
Ensure decoded CAPTURE buffer resolution is larger or equal to the coded OUTPUT buffer resolution.
Signed-off-by: Jonas Karlman <jonas@
media: rkvdec: Ensure decoded resolution fit coded resolution
Ensure decoded CAPTURE buffer resolution is larger or equal to the coded OUTPUT buffer resolution.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
f942d10d | 13-May-2022 |
Jonas Karlman <jonas@kwiboo.se> |
media: rkvdec: h264: Fix reference frame_num wrap for second field
When decoding the second field in a complementary field pair the second field is sharing the same frame_num with the first field.
media: rkvdec: h264: Fix reference frame_num wrap for second field
When decoding the second field in a complementary field pair the second field is sharing the same frame_num with the first field.
Currently the frame_num for the first field is wrapped when it matches the field being decoded, this caused issues decoding the second field in a complementary field pair.
Fix this by using inclusive comparison: 'less than or equal'.
Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
77e74be8 | 13-May-2022 |
Jonas Karlman <jonas@kwiboo.se> |
media: rkvdec: h264: Validate and use pic width and height in mbs
The width and height in macroblocks is currently configured based on OUTPUT buffer resolution, this works for frame pictures but can
media: rkvdec: h264: Validate and use pic width and height in mbs
The width and height in macroblocks is currently configured based on OUTPUT buffer resolution, this works for frame pictures but can cause issues for field pictures.
When frame_mbs_only_flag is 0 the height in mbs should be height of the field instead of height of frame.
Validate pic_width_in_mbs_minus1 and pic_height_in_map_units_minus1 against OUTPUT buffer resolution and use these values to configure HW. The validation is happening in both try_ctrt() and start() since it is otherwise possible to trick the driver during initialization by changing the OUTPUT format after having set a valid control.
[hverkuil: when -> When (first word in a comment block)]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
cf76bb4d | 13-May-2022 |
Nicolas Dufresne <nicolas.dufresne@collabora.com> |
media: rkvdec: Move H264 SPS validation in rkvdec-h264
No functional change, this moves H264 specific validation into the H264 specific code. This is in preparation of improving this validation and
media: rkvdec: Move H264 SPS validation in rkvdec-h264
No functional change, this moves H264 specific validation into the H264 specific code. This is in preparation of improving this validation and reusing it when VIDIOC_STREAMON is called.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
a074aa47 | 13-May-2022 |
Jonas Karlman <jonas@kwiboo.se> |
media: rkvdec: h264: Fix bit depth wrap in pps packet
The luma and chroma bit depth fields in the pps packet are 3 bits wide. 8 is wrongly added to the bit depth values written to these 3 bit fields
media: rkvdec: h264: Fix bit depth wrap in pps packet
The luma and chroma bit depth fields in the pps packet are 3 bits wide. 8 is wrongly added to the bit depth values written to these 3 bit fields. Because only the 3 LSB are written, the hardware was configured correctly.
Correct this by not adding 8 to the luma and chroma bit depth value.
Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
7ab889f0 | 13-May-2022 |
Nicolas Dufresne <nicolas.dufresne@collabora.com> |
media: rkvdec: h264: Fix dpb_valid implementation
The ref builder only provided references that are marked as valid in the dpb. Thus the current implementation of dpb_valid would always set the flag
media: rkvdec: h264: Fix dpb_valid implementation
The ref builder only provided references that are marked as valid in the dpb. Thus the current implementation of dpb_valid would always set the flag to 1. This is not representing missing frames (this is called 'non-existing' pictures in the spec). In some context, these non-existing pictures still need to occupy a slot in the reference list according to the spec.
Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
9998943f | 13-May-2022 |
Nicolas Dufresne <nicolas.dufresne@collabora.com> |
media: rkvdec: Stop overclocking the decoder
While this overclock hack seems to work on some implementations (some ChromeBooks, RockPi4) it also causes instability on other implementations (notably
media: rkvdec: Stop overclocking the decoder
While this overclock hack seems to work on some implementations (some ChromeBooks, RockPi4) it also causes instability on other implementations (notably LibreComputer Renegade, but there were more reports in the LibreELEC project, where this has been removed). While performance is indeed affected (tested with GStreamer), 4K playback still works as long as you don't operate in lock step and keep at least 1 frame ahead of time in the decode queue.
After discussion with ChromeOS members, it would seem that their implementation indeed used to synchronously decode each frame, so this hack was simply compensating for their code being less efficient. In my opinion, this hack should not have been included upstream.
Fixes: cd33c830448ba ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
26e45205 | 13-May-2022 |
Nicolas Dufresne <nicolas.dufresne@collabora.com> |
media: h264: Increase reference lists size to 32
This is to accommodate support for field decoding, which splits the top and the bottom references into the reference list.
Signed-off-by: Nicolas Du
media: h264: Increase reference lists size to 32
This is to accommodate support for field decoding, which splits the top and the bottom references into the reference list.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|