mbox series

[RFC,00/12] media: hantro: H264 fixes and improvements

Message ID HE1PR06MB40117D0EE96E6FA638A04B78ACBF0@HE1PR06MB4011.eurprd06.prod.outlook.com (mailing list archive)
Headers show
Series media: hantro: H264 fixes and improvements | expand

Message

Jonas Karlman Sept. 1, 2019, 12:42 p.m. UTC
This series contains fixes and improvements for the hantro H264 decoder.

Patch 1-6 fixes issues and limitations observed when preparing support
for field encoded content.

Patch 7 introduce new DPB entry flags that is used to signal how a reference
frame is referenced. This information is needed to correctly build a
reference list for field encoded content.

Patch 8 adds bits to handle field encoded content, this is a rough patch
and should be reworked with proper code style and formatting.
Please get back with feedback on how to improve this.

The following samples from [1] are now playable with patch 1-8
- H264_1080i-25-interlace_Kaesescheibchen.mkv
- H264_10_1080i_50_AC3-Astra19.2_ProSieben_HD.ts
- big_buck_bunny_1080p_H264_AAC_25fps_7200K.mp4
- h264_tivo_sample.ts

The rest of the patches refactors G1 H264 code to more closely match
the code generated by my rockchip-vpu-regtool at [2] and then adds
support for H264 decoding on RK3399/RK3328 using the VPU2 block.
This code is early work and needs proper code style and formatting,
I just wanted to share the early work and get some initial feedback.

This series has been tested using ffmpeg v4l2 request hwaccel at [3] [4]

[1] http://kwiboo.libreelec.tv/test/samples/
[2] https://github.com/Kwiboo/rockchip-vpu-regtool
[3] https://github.com/Kwiboo/FFmpeg/commits/v4l2-request-hwaccel-4.0.4
[4] https://github.com/Kwiboo/FFmpeg/compare/4.0.4-Leia-18.4...45df99d31062e068073cf899dce559e334c9127f

Regards,
Jonas

Jonas Karlman (12):
  media: hantro: Fix H264 max frmsize supported on RK3288
  media: hantro: Do not reorder H264 scaling list
  media: hantro: Fix H264 motion vector buffer offset
  media: hantro: Reduce H264 extra space for motion vectors
  media: hantro: Remove now unused H264 pic_size
  media: hantro: Set H264 FIELDPIC_FLAG_E flag correctly
  media: uapi: h264: Add DPB entry field reference flags
  media: hantro: Fix H264 decoding of field encoded content
  media: hantro: Refactor G1 H264 code
  media: hantro: Add support for H264 decoding on RK3399
  media: hantro: Enable H264 decoding on RK3399
  media: hantro: Enable H264 decoding on RK3328

 .../media/uapi/v4l/ext-ctrls-codec.rst        |  12 +
 drivers/staging/media/hantro/Makefile         |   1 +
 .../staging/media/hantro/hantro_g1_h264_dec.c | 685 +++++++++++-------
 drivers/staging/media/hantro/hantro_h264.c    | 209 +++---
 drivers/staging/media/hantro/hantro_hw.h      |  10 +-
 drivers/staging/media/hantro/hantro_v4l2.c    |   6 +-
 drivers/staging/media/hantro/rk3288_vpu_hw.c  |   4 +-
 drivers/staging/media/hantro/rk3399_vpu_hw.c  |  24 +-
 .../media/hantro/rk3399_vpu_hw_h264_dec.c     | 486 +++++++++++++
 include/media/h264-ctrls.h                    |   4 +
 10 files changed, 1091 insertions(+), 350 deletions(-)
 create mode 100644 drivers/staging/media/hantro/rk3399_vpu_hw_h264_dec.c

Comments

Ezequiel Garcia Sept. 2, 2019, 1:02 p.m. UTC | #1
Hi Jonas,

Thanks for the series, I'll be reviewing this shortly.

On Sun, 2019-09-01 at 12:42 +0000, Jonas Karlman wrote:
> This series contains fixes and improvements for the hantro H264 decoder.
> 
> Patch 1-6 fixes issues and limitations observed when preparing support
> for field encoded content.
> 
> Patch 7 introduce new DPB entry flags that is used to signal how a reference
> frame is referenced. This information is needed to correctly build a
> reference list for field encoded content.
> 
> Patch 8 adds bits to handle field encoded content, this is a rough patch
> and should be reworked with proper code style and formatting.
> Please get back with feedback on how to improve this.
> 
> The following samples from [1] are now playable with patch 1-8
> - H264_1080i-25-interlace_Kaesescheibchen.mkv
> - H264_10_1080i_50_AC3-Astra19.2_ProSieben_HD.ts
> - big_buck_bunny_1080p_H264_AAC_25fps_7200K.mp4
> - h264_tivo_sample.ts
> 
> The rest of the patches refactors G1 H264 code to more closely match
> the code generated by my rockchip-vpu-regtool at [2] and then adds
> support for H264 decoding on RK3399/RK3328 using the VPU2 block.
> This code is early work and needs proper code style and formatting,
> I just wanted to share the early work and get some initial feedback.
> 
> This series has been tested using ffmpeg v4l2 request hwaccel at [3] [4]
> 

What boards have you tested this on?

Thanks,
Ezequiel
Jonas Karlman Sept. 2, 2019, 4:28 p.m. UTC | #2
On 2019-09-02 15:02, Ezequiel Garcia wrote:
> Hi Jonas,
>
> Thanks for the series, I'll be reviewing this shortly.
>
> On Sun, 2019-09-01 at 12:42 +0000, Jonas Karlman wrote:
>> This series contains fixes and improvements for the hantro H264 decoder.
>>
>> Patch 1-6 fixes issues and limitations observed when preparing support
>> for field encoded content.
>>
>> Patch 7 introduce new DPB entry flags that is used to signal how a reference
>> frame is referenced. This information is needed to correctly build a
>> reference list for field encoded content.
>>
>> Patch 8 adds bits to handle field encoded content, this is a rough patch
>> and should be reworked with proper code style and formatting.
>> Please get back with feedback on how to improve this.
>>
>> The following samples from [1] are now playable with patch 1-8
>> - H264_1080i-25-interlace_Kaesescheibchen.mkv
>> - H264_10_1080i_50_AC3-Astra19.2_ProSieben_HD.ts
>> - big_buck_bunny_1080p_H264_AAC_25fps_7200K.mp4
>> - h264_tivo_sample.ts
>>
>> The rest of the patches refactors G1 H264 code to more closely match
>> the code generated by my rockchip-vpu-regtool at [2] and then adds
>> support for H264 decoding on RK3399/RK3328 using the VPU2 block.
>> This code is early work and needs proper code style and formatting,
>> I just wanted to share the early work and get some initial feedback.
>>
>> This series has been tested using ffmpeg v4l2 request hwaccel at [3] [4]
>>
> What boards have you tested this on?

Main testing has been done on a Tinker Board S (RK3288) and a Rock64 (RK3328) device.
Very limited testing on a Rock Pi 4 (RK3399) using earlier version of the patchset,
I will redo some RK3399 testing to make sure it is not only VPU2 on RK3328 that works.

Regards,
Jonas

>
> Thanks,
> Ezequiel
>