Modify

Ticket #4653 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

Allow Enable/Disable of deblocking loopfilter for h.264 ffmpeg (BBC HD support)

Reported by: reidjr_at_lineone_net Owned by: jyavenard
Priority: minor Milestone: 0.24
Component: MythTV - Video Playback Version: head
Severity: medium Keywords: h.264 skip loop filter BBC HD
Cc: stuartm Ticket locked: yes

Description

Adds a selct box in the videoprofile settings that will enable/disable the de-blocking loopfilter for h.264 ffmpeg. Disabling the deblocking loop filter makes a significant diffrence to cpu load for h.264 decoding. When used with both CPU's of a core2duo e4300, disabling the loopfilter will allow playing back BBC HD at 60-70% of both cores. With th eloopfilter active (current default) then frames are dropped. As the setting is part of the videoprofile, it can selectively be used for HD.

Attachments

skip_loopfilter_settings.diff (9.7 KB) - added by reidjr_at_lineone_net 4 years ago.
Reduce CPU load h.264 ffmpeg decoding.
skiplooppatch_16446.diff.txt (13.3 KB) - added by robert.mcnamara@… 4 years ago.
Patch updated to work with 16446 for anyone interested
25_skiploop_option.dpatch (13.8 KB) - added by laga@… 4 years ago.
Updated the patch to work if you only have one playback thread. Thanks to janneg for pointing this out
26_updated_skiploop_options.dpatch (14.3 KB) - added by anonymous 3 years ago.
27_minimal_skiploop.dpatch (1.1 KB) - added by reidjr_at_lineone.net 3 years ago.
28_skiploop_multithread.dpatch (1.2 KB) - added by reidjr_at_lineone_net 3 years ago.
as described above
29_skiploop_trunk_22847.2.diff (14.6 KB) - added by jyavenard 3 years ago.
Updated for trunk r22847
29_skiploop_fixes_022.diff (14.5 KB) - added by jyavenard 3 years ago.
Updated for 0.22-fixes r22847

Change History

Changed 4 years ago by reidjr_at_lineone_net

Reduce CPU load h.264 ffmpeg decoding.

comment:1 Changed 4 years ago by janne

  • Owner changed from ijr to janne
  • Status changed from new to assigned
  • Milestone changed from unknown to 0.22

I'll work on a general way of setting avcodec options

Changed 4 years ago by robert.mcnamara@…

Patch updated to work with 16446 for anyone interested

comment:2 Changed 4 years ago by stuartm

  • Cc stuartm added

comment:3 Changed 4 years ago by stuartm

  • Owner changed from janne to stuartm
  • Version changed from unknown to head

comment:4 Changed 4 years ago by janne

  • Owner changed from stuartm to janne
  • Status changed from assigned to started

Changed 4 years ago by laga@…

Updated the patch to work if you only have one playback thread. Thanks to janneg for pointing this out

comment:5 Changed 3 years ago by janne

  • Status changed from started to accepted
  • Milestone changed from 0.22 to 0.23

deprecated started state

Changed 3 years ago by anonymous

Changed 3 years ago by reidjr_at_lineone.net

comment:6 follow-up: ↓ 7 Changed 3 years ago by reidjr_at_lineone_net

I've updated the patch for trunk, as it looks like it will miss another release. I have also added a really minimalist patch. which just hard codes the loopfilter off.

There is a strange thing I am seing though. Without the patch, multithreading h264 doesnt work, whatever you set max CPUs to. With the patch Setting the loopfilter option to off, doesnt save any overall cpu load, but does allow multithreading to work. Looks like either ffmpeg or underlying code has changed.

I would suggest only applying this patch if you have multi-core cpu.

comment:7 in reply to: ↑ 6 Changed 3 years ago by janne

Replying to reidjr_at_lineone_net:

There is a strange thing I am seing though. Without the patch, multithreading h264 doesnt work, whatever you set max CPUs to. With the patch Setting the loopfilter option to off, doesnt save any overall cpu load, but does allow multithreading to work. Looks like either ffmpeg or underlying code has changed.

The deblocking loop filter can prevent the slice paralell decoding. It's a known limitation of ffmpeg's slice level multithreaded decoding.

comment:8 Changed 3 years ago by reidjr_at_lineone_net

Ok, as multi cpu / thread decoding doesnt work with loop filter enabled, a really trivial patch for those in the UK that need it. Sett max CPUs to more than 1 and the loop filter is disabled, and multiple threading is enabled for BBC-HD, and although ITV-HD stays single threaded, the cpu load is reduced.

Changed 3 years ago by reidjr_at_lineone_net

as described above

comment:9 Changed 3 years ago by stuartm

  • Component changed from mythtv to MythTV - Video Playback

Changed 3 years ago by jyavenard

Updated for trunk r22847

Changed 3 years ago by jyavenard

Updated for 0.22-fixes r22847

comment:10 Changed 3 years ago by jyavenard

Updated for 0.22-fixes and trunk

comment:11 Changed 2 years ago by helge.jensen@…

This is a welcome tradeoff for me. I would rather see my HD-content in slightly reduced quality than jittering at ~46fps (or 0.9x which also works for me :)

The patch is pretty small, how come it has not been included yet? 2 (two) years down the line.

comment:12 Changed 2 years ago by robertm

  • Ticket locked set

comment:13 Changed 2 years ago by robertm

  • Milestone changed from 0.23 to 0.24

Pushing to .24 since we're in freeze.

comment:14 Changed 2 years ago by jyavenard

  • Owner changed from janne to jyavenard
  • Status changed from accepted to assigned

comment:15 Changed 2 years ago by jyavenard

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in r23981

Add ability to disable the deblocking skiploop filter for h264 decoding. This will speedup h264 decoding, but may drastically reduce quality. Original patch from reidjr_at_lineone_net with various other contributors. Thank you all

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.