Opened 16 years ago

Closed 14 years ago

#4653 closed enhancement (fixed)

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

Reported by: reidjr_at_lineone_net Owned by: JYA
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 (8)

skip_loopfilter_settings.diff (9.7 KB) - added by reidjr_at_lineone_net 16 years ago.
Reduce CPU load h.264 ffmpeg decoding.
skiplooppatch_16446.diff.txt (13.3 KB) - added by robert.mcnamara@… 16 years ago.
Patch updated to work with 16446 for anyone interested
25_skiploop_option.dpatch (13.8 KB) - added by laga@… 16 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 15 years ago.
27_minimal_skiploop.dpatch (1.1 KB) - added by reidjr_at_lineone.net 15 years ago.
28_skiploop_multithread.dpatch (1.2 KB) - added by reidjr_at_lineone_net 15 years ago.
as described above
29_skiploop_trunk_22847.2.diff (14.6 KB) - added by JYA 14 years ago.
Updated for trunk r22847
29_skiploop_fixes_022.diff (14.5 KB) - added by JYA 14 years ago.
Updated for 0.22-fixes r22847

Download all attachments as: .zip

Change History (23)

Changed 16 years ago by reidjr_at_lineone_net

Reduce CPU load h.264 ffmpeg decoding.

comment:1 Changed 16 years ago by Janne Grunau

Milestone: unknown0.22
Owner: changed from Isaac Richards to Janne Grunau
Status: newassigned

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

Changed 16 years ago by robert.mcnamara@…

Patch updated to work with 16446 for anyone interested

comment:2 Changed 16 years ago by stuartm

Cc: stuartm added

comment:3 Changed 16 years ago by stuartm

Owner: changed from Janne Grunau to stuartm
Version: unknownhead

comment:4 Changed 16 years ago by Janne Grunau

Owner: changed from stuartm to Janne Grunau
Status: assignedstarted

Changed 16 years ago by laga@…

Attachment: 25_skiploop_option.dpatch added

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

comment:5 Changed 15 years ago by Janne Grunau

Milestone: 0.220.23
Status: startedaccepted

deprecated started state

Changed 15 years ago by anonymous

Changed 15 years ago by reidjr_at_lineone.net

Attachment: 27_minimal_skiploop.dpatch added

comment:6 Changed 15 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 15 years ago by Janne Grunau

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 15 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 15 years ago by reidjr_at_lineone_net

as described above

comment:9 Changed 15 years ago by stuartm

Component: mythtvMythTV - Video Playback

Changed 14 years ago by JYA

Updated for trunk r22847

Changed 14 years ago by JYA

Attachment: 29_skiploop_fixes_022.diff added

Updated for 0.22-fixes r22847

comment:10 Changed 14 years ago by JYA

Updated for 0.22-fixes and trunk

comment:11 Changed 14 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 14 years ago by robertm

Ticket locked: set

comment:13 Changed 14 years ago by robertm

Milestone: 0.230.24

Pushing to .24 since we're in freeze.

comment:14 Changed 14 years ago by JYA

Owner: changed from Janne Grunau to JYA
Status: acceptedassigned

comment:15 Changed 14 years ago by JYA

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.