Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#2903 closed patch (invalid)

Patch to fix refresh rate calculation for interlaced modelines, allows Bobdeint on 50Hz displays

Reported by: drvik@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: 0.20
Severity: medium Keywords:
Cc: Ticket locked: no

Description

videoout_xv calculates refresh rates based on Vtotal and Htotal only... this only works for progressive modelines... interlaced modelines have effectively a double refresh rate than is able to be calculated via the existing method...

for example... I run a 576i modeline that has a 50.00Hz refresh rate and I play back material that is PAL DVB also 576i and at 25 FPS... I should be able to utilise Bob deinterlacing using this setup but Myth will not allow it....

Myth calculates refresh rate at 40000 (incorrect for 50Hz) and frame interval at 40000 (correct for 25FPS), then disables Bobdeint because the refresh rate is not high enough (when it infact is)

My simple patch completely fixes this...

In the rate calculation code, it checks if the interlace flag is set, and if it is will double the calculated refresh rate... here is the relevant output from '-v playback'

2007-01-09 11:29:17.438 Using deinterlace method bobdeint 2007-01-09 11:29:17.554 Refresh rate: 20000, frame interval: 40000

Myth will then happily play 25FPS material at a 50FPS with Bobdeint... it looks great!

Attachments (3)

interlaced_refresh_rate.diff (558 bytes) - added by drvik@… 13 years ago.
Fixes miscalculation of refresh rate on interlaced modelines
mythtv-0.21-interlaced-display-rate.patch (1.2 KB) - added by mythtv@… 11 years ago.
New patch
mythtv-0.21-interlaced-display-rate.2.patch (1.1 KB) - added by Tom Dexter <digitalaudiorock@…> 11 years ago.
New patch for 0.21-fixes

Download all attachments as: .zip

Change History (12)

Changed 13 years ago by drvik@…

Fixes miscalculation of refresh rate on interlaced modelines

comment:1 Changed 13 years ago by danielk

Resolution: invalid
Status: newclosed

Incorrect, a 50Hz interlaced display only has a 25Hz frame rate.

You also don't want to use bob-deint with an interlaced display, use kernel or linear blend when there is a resolution missmatch and no deinterlacing when the source and destination line count matches.

See mythtv-vid branch for configuring such a setup.

comment:2 in reply to:  1 Changed 12 years ago by anonymous

Resolution: invalid
Status: closednew

Replying to danielk:

Incorrect, a 50Hz interlaced display only has a 25Hz frame rate.

This is true, but irrelevant. Interlacing is simply a way of space-time subsampling the normal progressive picture. Pairs of fields tend to get treated as one frame when discussing broadcast standards or when digitally encoded, but this pairing is entirely artificial for true interlaced video.

You also don't want to use bob-deint with an interlaced display, use kernel or linear blend when there is a resolution missmatch and no deinterlacing when the source and destination line count matches.

When you have interlaced content and an interlaced display, one solution is for the display to show each field independently. If there is a resolution mismatch, this can be accomplished with a bob (which is needed to compensate for the different size of the vertical offset between fields) and rescale to the output resolution. It is true that only half of the lines need to be computed for each output field, but with hardware scaling it's not worth the effort.

In fact, I can't think of a good reason (aside from the possible need for vertical filtering to avoid flickering) why a 50Hz interlaced display should be treated differently than a 50Hz progressive display by MythTV.

Actually, after reading my last paragraph, I realized that some of the more sophisticated deinterlacers like yadif could give better results than bob, but there is still a good reason to output at the full field rate, rather than be restricted to half the field rate.

See mythtv-vid branch for configuring such a setup.

I actually don't have an interlaced display, but after reading a forum post with a link here stating that many people use bob deinterlacing with the above patch, I felt compelled to respond.

comment:3 Changed 12 years ago by danielk

Resolution: invalid
Status: newclosed

comment:4 in reply to:  3 Changed 12 years ago by anonymous

Replying to danielk: I guess you've made your decision, but I would be grateful if you could very briefly show me where I am wrong. I was brought here by the post at http://www.mythtvtalk.com/forum/viewtopic.php?p=29966#29966 which indicates that the above patch gives the desired output. Would the patch have undesired consequences for other users?

comment:5 Changed 12 years ago by anonymous

One more question: what is the proper course of action when I feel that I can add to the discussion for a ticket that was quickly closed? Is it better to reopen the ticket, or should I have left it closed and simply replied?

comment:6 Changed 12 years ago by sphery <mtdean@…>

Discussion belongs on the mailing lists. Add to the discussion by starting a thread there (generally by replying to the commit message or, at least, by quoting the ticket number/subject in the e-mail subject). http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev or http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

comment:7 Changed 11 years ago by mythtv@…

Just adding a new patch which avoids doubling the frame rate should it already have been doubled by use of a dummy modeline with a doubled dotclock rate.

Changed 11 years ago by mythtv@…

New patch

comment:8 Changed 11 years ago by markk

(In [20277]) Double the calculated refresh rate when an interlaced modeline is detected. Refs #2903.

comment:9 Changed 11 years ago by Tom Dexter <digitalaudiorock@…>

I discovered today that the mythtv-0.21-interlaced-display-rate.patch patch posed above does not work (at least not in my case) as the comparisons used to check the extisting refresh rate (for example rate == 30) don't work with double values that have any decimals. Mine had a calculated value of 30.0267.

I'm uploading a new 0.21-fixes version using the checks as in the 20277 trunk change set.

Changed 11 years ago by Tom Dexter <digitalaudiorock@…>

New patch for 0.21-fixes

Note: See TracTickets for help on using tickets.