WMC picture quality - jaggies, moire, shimmering

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#21

Post by tzr916 » Wed Nov 20, 2013 2:44 pm

richard1980 wrote:...The reason it looks correct with LAV as the decoder is because you have disabled deinterlacing in LAV....
These are the settings I use in LAV. Doesn't look like I have disabled deinterlacing. Jaggies only appear if I set HW Decoder to None and/or uncheck Enable HW/GPU Adaptive HW Deinterlacing and/or YADIF.

Image

richard1980

Posts: 2623
Joined: Wed Jun 08, 2011 3:15 am
Location:

HTPC Specs: Show details

#22

Post by richard1980 » Thu Nov 21, 2013 3:08 am

barnabas1969 wrote:So, you're saying that some decoders are able to examine the content on the fly, and correctly decode it regardless of the flags?
No. I'm saying the first step to correctly handling an incorrectly flagged frame is identifying the flag as "incorrectly flagged". Go back to my previous post. Can you classify the frame as "incorrectly flagged" or "correctly flagged"? No. Why? Because there's not enough information to make that determination. If you want to answer the question, you need to see the composed frame. Once you answer the question, you can decide how to compose the frame. But you can't answer the question until you compose the frame, and you can't compose the frame until you answer the question. Do you see the problem?
tzr916 wrote:Doesn't look like I have disabled deinterlacing.
It's counter-intuitive, but you have. YADIF is detecting soft-telecine and is reacting by not deinterlacing any of the frames. However, YADIF's behavior is incorrect. Here is a quote from the developer:

"The way soft telecine is done is that every other frame is marked as interlaced and repeat, and the frames in between are marked as progressive."

And here is what the MPEG specification states:
If progressive_sequence is equal to 0 and progressive_frame is equal to 0, repeat_first_field shall be zero, and the output of the decoding process corresponding to this reconstructed frame consists of two fields.

...

If progressive_frame is set to 0 it indicates that the two fields of the frame are interlaced fields in which an interval of time of the field period exists between (corresponding spatial samples) of the two fields. In this case the following restriction applies:

  • repeat_first_field shall be zero (two field duration).

If progressive_frame is set to 1 it indicates that the two fields (of the frame) are actually from the same time instant as one another. In this case a number of restrictions to other parameters and flags in the bitstream apply:

  • picture_structure shall be “Frame”
  • frame_pred_frame_dct shall be 1
The MPEG specification explicitly forbids a frame from being "interlaced and repeat". Additionally, soft-telecined content does not contain any frames that meet the criteria for having a progressive_frame value of 0. Every frame is supposed to be set to 1.

(On a side note, I like how nevcairiel calls deinterlacers that comply with the MPEG specification "bad". I would argue that deinterlacers that fail to comply with the MPEG specification are actually the ones that are bad.)

If you fail to see the deinterlacing artifacts when YADIF is disabled but CUVID is enabled, CUDA is doing the same thing that YADIF is doing (Edit: I'd like to clarify that I am ignoring the possibility that CUDA is adaptively deinterlacing the frame because I cover that in the next paragraph.) QuickSync does not do this. QuickSync properly honors the progressive_frame flag.

Adaptive deinterlacing disregards the flags and analyzes the composed frame to determine what parts of the frame need to be deinterlaced. When you put the two fields of a progressive frame together, no part of the frame needs to be deinterlaced, so a good adaptive deinterlacing algorithm will not react.

richard1980

Posts: 2623
Joined: Wed Jun 08, 2011 3:15 am
Location:

HTPC Specs: Show details

#23

Post by richard1980 » Thu Nov 21, 2013 12:57 pm

For anyone that is interested, I have created a correctly-flagged soft-telecined MPG test file. The original source file is 1080p24 and can be downloaded here. Pulldown flags were added using DGPulldown (using the 24 -> 29.97 setting). The resulting soft-telecined file can be downloaded here.

Attached is a dump of the relevant flags. You'll notice that each frame is properly marked with a progressive_frame value of 1 (that's the column that says "PF = 1".) Also attached is a dump of the flags from the recording sample provided earlier in this thread, which is flagged incorrectly.
Attachments
Manual_Recording_Sample_Soft_Telecine_Wrong.zip
(39.51 KiB) Downloaded 31 times
Soft_Telecine_Correct.zip
(9.42 KiB) Downloaded 30 times

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#24

Post by tzr916 » Wed Nov 27, 2013 1:27 am

RyC wrote:... Extenders seem to play it back correctly though, I don't see it get shimmery or jagged at all on an extender.
I tested the clip on my xbox and echos. They all show the jaggies, shimmering, etc. So an external player with LAV really only helps on my main Tv, only for previously recorded shows, only from unprotected channels.

There have been so many 29/59 threads over the years and nothing has been done to fix the playback hardware/software. I know it's a long shot but why not go after the service/content provider(s)?

I know Comcast can provide properly flagged content because I never see the issue on the big networks (abc, cbs, nbc, fox). So why are the other channels so bad? Do they re-encode those channels differently than the networks? Do they get the content from a different source? Do those channels run through different paths before it's sent out?

RyC

Posts: 724
Joined: Tue Aug 21, 2012 10:21 pm
Location:

HTPC Specs: Show details

#25

Post by RyC » Wed Nov 27, 2013 1:29 am

Really? I guess my eyes just suck.

richard1980

Posts: 2623
Joined: Wed Jun 08, 2011 3:15 am
Location:

HTPC Specs: Show details

#26

Post by richard1980 » Wed Nov 27, 2013 5:10 am

tzr916 wrote:There have been so many 29/59 threads over the years and nothing has been done to fix the playback hardware/software.
Ironically, only broken software can display some 29/59 content correctly. You won't find a piece of software that is actually designed correctly that will display 29/59 content correctly (because correctly written software will obey the progressive_frame flags).
tzr916 wrote:I know it's a long shot but why not go after the service/content provider(s)?
That is the correct answer. Fix the problem at its source.
tzr916 wrote:I know Comcast can provide properly flagged content because I never see the issue on the big networks (abc, cbs, nbc, fox). So why are the other channels so bad? Do they re-encode those channels differently than the networks? Do they get the content from a different source? Do those channels run through different paths before it's sent out?
Yes, yes, and yes.

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#27

Post by tzr916 » Wed Nov 27, 2013 5:58 am

richard1980 wrote:Ironically, only broken software can display some 29/59 content correctly. You won't find a piece of software that is actually designed correctly that will display 29/59 content correctly (because correctly written software will obey the progressive_frame flags)...

I guess I'm not as concerned about the rules and being designed correctly. I just want a picture that looked like my Tivo did. MS can throw the rules out as far as I care.... Strange thing is that xbox and echo show the 29/59 problem yet a Tivo does not. Tivo captures the same mpeg2 stream. Tivo runs an OS/software. Tivo has a gpu. If Tivo can do it, why can't a PC? Is it the OS? Would a linux box not show the 29/59 problem?

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#28

Post by barnabas1969 » Wed Nov 27, 2013 1:46 pm

TiVo was probably more responsive to their customers' demands than Microsoft was/is.

I agree that asking the content provider to fix it at their end is the right thing to do, but you won't get very far with the cable co. They couldn't care less about whether or not Media Center displays the content correctly... they want to rent you a cable box.

richard1980

Posts: 2623
Joined: Wed Jun 08, 2011 3:15 am
Location:

HTPC Specs: Show details

#29

Post by richard1980 » Thu Nov 28, 2013 12:00 am

tzr916 wrote:I guess I'm not as concerned about the rules and being designed correctly. I just want a picture that looked like my Tivo did. MS can throw the rules out as far as I care....
And the first time you play content that is flagged correctly but doesn't display properly (because the software isn't obeying the flags), you'd blame Microsoft for not obeying the flags.
tzr916 wrote:If Tivo can do it, why can't a PC? Is it the OS? Would a linux box not show the 29/59 problem?
If a Porsche 911 Spyder can do 0-60 in 2.7 seconds, why can't a Honda Civic? (Here's a hint: Consumer-grade PC GPUs process video about as well as the engine in a Honda Civic produces horsepower, but the graphics processors in consumer electronics devices like TVs, AVRs, DVD/Blu-ray players, and set-top-boxes (including TiVo boxes) process video about as well as the engine in the Porsche 911 Spyder produces horsepower. Contrary to what you or anyone else may believe, the PC GPU is a terrible video processing device.)

And no, the OS has nothing to do with it.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#30

Post by barnabas1969 » Thu Nov 28, 2013 1:09 am

You can drive a screw with a Swiss army knife, but it's much easier to use a screwdriver. The PC's GPU is multi-purpose like a swiss army knife, while the chip in a piece of consumer electronics is built for a singe purpose like a screwdriver.

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#31

Post by tzr916 » Thu Nov 28, 2013 5:17 pm

So all PC gpu's (nvidia, amd, intel), and the xbox, and the echo all suffer the 29/59 bug. I guess I'm still confused. Is it the graphics chips? Is it the mpeg2 decoder? Is it how the two talk to each other? The xbox obviously uses a MS mpeg2 decoder. What decoder does an echo use?

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#32

Post by barnabas1969 » Fri Nov 29, 2013 2:41 pm

I'm not sure if it's true that the XBox suffers from the 29/59 issue. I haven't tested it on the XBox, I'll have to dig up the sample video that Richard supplied and test it now that I have an XBox. The HP and Linksys extenders definitely handle the 29/59 issue correctly.

Some PC GPU's (and some versions of firmware) suffer from the 29/59 issue, but not all of them. The problem is that the GPU (or firmware) can't reset the interlacer/deinterlacer fast enough so that they don't drop frames.

But the problem with incorrectly flagged material is not related to the 29/59 issue, so I think you're mixing them up. The 29/59 issue is simply a matter of whether or not the GPU can reset the interlacer/deinterlacer in less than one frame (1/60th of a second).

The problem you're seeing with jaggies, etc. is a different problem entirely. If you have a video that has incorrect progressive frame flags, then the MS decoder will not display it correctly. If that same video is made up of frames that are all progressive, and you've set your LAV decoder to ignore the progressive frame flag and decode everything as progressive, then it will look OK on your LAV decoder.

tzr916

Posts: 445
Joined: Tue May 28, 2013 11:56 pm
Location: Stockton CA

HTPC Specs: Show details

#33

Post by tzr916 » Fri Nov 29, 2013 3:00 pm

Ah, yes I thought 29/59 meant improper flagged i/p frames.

I tested my "bad" clip (and many others) on my xbox and echos and they all show the jaggies. From everyone here testing my clip we have nvidia, amd, and intel gpu's all showing the jaggies. So is there any gpu or extender that can "reset the interlacer/deinterlacer in less than one frame"? (Pretend that money is no object) I remember the old days of hardware mpeg2 pci cards like Hollywood Magic for dvd. Is there anything like that with HDMI?

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#34

Post by barnabas1969 » Fri Nov 29, 2013 3:47 pm

tzr916 wrote:Ah, yes I thought 29/59 meant improper flagged i/p frames.

I tested my "bad" clip (and many others) on my xbox and echos and they all show the jaggies. From everyone here testing my clip we have nvidia, amd, and intel gpu's all showing the jaggies. So is there any gpu or extender that can "reset the interlacer/deinterlacer in less than one frame"? (Pretend that money is no object) I remember the old days of hardware mpeg2 pci cards like Hollywood Magic for dvd. Is there anything like that with HDMI?
No, you're still confusing the issues. Resetting the interlacer/deinterlacer is related to the 29/59 issue, not the jaggies, etc.

The only way you're going to get rid of the jaggies, etc. is to get your cable provider to correctly flag the content.

richard1980

Posts: 2623
Joined: Wed Jun 08, 2011 3:15 am
Location:

HTPC Specs: Show details

#35

Post by richard1980 » Sat Nov 30, 2013 12:35 am

tzr916 wrote:So all PC gpu's (nvidia, amd, intel), and the xbox, and the echo all suffer the 29/59 bug.
There is no such thing as "the 29/59 bug". That term originated during an investigation of stuttering playback, when someone discovered that the stuttering coincided with fluctuations in the listed frame rated in the Debug: Presentation screen in WMC (the listed frame rate would fluctuate between 29.97 and 59.9401). Many people (without any actual knowledge of what was happening) jumped to the conclusion that there was a bug in WMC that was causing the stuttering, and after the discovery of the frame rate fluctuation, the term "29/59 bug" was born. In reality, it was never a bug. The frame rate listed in the Debug: Presentation screen in WMC depicts the current state of the progressive_frame flag embedded in the MPEG stream, so when the flag fluctuates, so does the listed frame rate. Additionally, Microsoft's MPEG decoder honors the progressive_frame flag and changes the state of the GPU's interlacer/deinterlacer in response to changes in the progressive_frame flag, and some GPUs can't perform the change without dropping frames (i.e., stuttering). Microsoft explained all of this several years ago, but despite the obvious truth that there wasn't a bug, people continued to use the term "29/59 bug" to describe anything that resulted from the fluctuations in the progressive_frame flag, and that practice continues today.

To be clear "29/59" simply refers to the fluctuation of the progressive_frame flag on US content. But "29/59" is not actually the best terminology to use because the fluctuation of the flag occurs in content from other countries at other frame rates. For example, there is a thread here that discusses the fluctuation in UK content, which is either 25p or 50i. So "29/59" becomes "25/50" in that conversation. So "29/59" should actually be "fluctuating progressive_frame flags". When you use that terminology, the statement "the GPU suffers the 29/59" becomes "the GPU suffers the fluctuating progressive_frame flags", and that clearly is not correct. The GPU doesn't have any progressive_frame flags...the MPEG stream does. So it's the MPEG stream that suffers the issue, not the GPU.

When people say "the GPU suffers the 29/59 bug", what they really mean is the GPU shows an adverse on-screen reaction to the fluctuation of the progressive_frame flag. The problem for those people isn't the flag's value...it's the fact that the flag is changing from one value to another value. The stuttering referenced in the first paragraph is an example of this. The flag's value didn't cause the stuttering. It was the fluctuation of the flag's value that ultimately caused the stuttering. There are also other things that GPUs are known to do when the flag changes. Some GPUs have a dynamic contrast "enhancement" that when enabled causes fluctuations in the progressive_frame flag to appear as on-screen flickering. Some GPUs even go completely blank when the flag changes. All of these are examples of problems that result from fluctuation of the flag.

What you are experiencing is not the result of fluctuation of the flag. Your GPU handles the fluctuation just fine. You don't have any stuttering, flickering, screen blanking, or anything else that results from the fluctuation itself. What you are experiencing is simply the result of the flag being wrong part of the time (in your sample, the flag was wrong about 50% of the time.) If the flags actually matched the content, you wouldn't be complaining at all.

The progressive_frame flag affects every playback device that doesn't ignore the flag. As I stated in the first paragraph, Microsoft's MPEG decoder honors the flag and changes the state of the GPU's interlacer/deinterlacer in response to changes in the flag. If the progressive_frame flag is wrong (i.e., it is set to 0 when the frame is actually progressive, or it is set to 1 when the frame is actually interlaced), Microsoft's decoder ends up setting the GPU's interlacer/deinterlacer to the wrong state (it gets set to the "on" state when it should be set to the "off" state, and vice-versa), which results in picture quality issues such as what you see with your sample clip. If the frames were flagged correctly, Microsoft's decoder would end up setting the state of the interlacer/deinterlacer correctly and there would be no picture quality issues.

On the flip side, the progressive_frame flag does not affect any playback device that ignores the flag. That's what you are doing with LAV. You're telling LAV to ignore the flag and treat every frame as progressive. And your feeding LAV all progressive frames. So naturally none of the frames get deinterlaced, thus there are no picture quality issues.

As was previously stated, CE GPUs are much better at processing video than PC GPUs. But more importantly, CE GPUs are built specifically for video processing and have more things implemented for that specific purpose than what you'll find in a PC GPU. CE devices are powerful enough to ignore the progressive_frame flag and use their own internal interlace-detection algorithms to determine whether the frame is interlaced or progressive, and I suspect that is exactly what is happening in most CE devices...hence the reason you never hear anyone outside of the HTPC community complaining.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#36

Post by barnabas1969 » Sun Dec 01, 2013 11:02 pm

Richard, you are the reason why I write "29/59 issue" instead of 29/59 bug. Don't get so upset by the semantics.

richard1980

Posts: 2623
Joined: Wed Jun 08, 2011 3:15 am
Location:

HTPC Specs: Show details

#37

Post by richard1980 » Sun Dec 01, 2013 11:35 pm

I'm not upset...I just wanted to offer an in-depth explanation in the hopes that perhaps it would help tzr916.

slowbiscuit

Posts: 386
Joined: Wed Jun 29, 2011 8:52 pm
Location: In the ATL

HTPC Specs: Show details

#38

Post by slowbiscuit » Mon Dec 02, 2013 5:45 pm

barnabas1969 wrote:
tzr916 wrote:Ah, yes I thought 29/59 meant improper flagged i/p frames.

I tested my "bad" clip (and many others) on my xbox and echos and they all show the jaggies. From everyone here testing my clip we have nvidia, amd, and intel gpu's all showing the jaggies. So is there any gpu or extender that can "reset the interlacer/deinterlacer in less than one frame"? (Pretend that money is no object) I remember the old days of hardware mpeg2 pci cards like Hollywood Magic for dvd. Is there anything like that with HDMI?
No, you're still confusing the issues. Resetting the interlacer/deinterlacer is related to the 29/59 issue, not the jaggies, etc.

The only way you're going to get rid of the jaggies, etc. is to get your cable provider to correctly flag the content.
And wait for pigs to start flying, of course.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#39

Post by barnabas1969 » Mon Dec 02, 2013 5:49 pm

slowbiscuit wrote:And wait for pigs to start flying, of course.
Well, yeah... it will be frustrating dealing with the cable company.

glugglug

Posts: 391
Joined: Thu Jun 09, 2011 1:34 am
Location:

HTPC Specs: Show details

#40

Post by glugglug » Thu Dec 05, 2013 7:14 pm

I'm pretty sure video drivers for all 3 popular chipset families (AMD/NVidia/Intel) have some setting that effectively makes them not have the flag fluctuating issue with the corresponding DXVA codecs.

For example, some of the HD HBO channels have this issue on FIOS (curiously none of the SD ones or other premiums do), and turning off dynamic contrast in the Intel integrated graphics settings seems to fix it for some bizarre reason (I don't get how the 2 are related).

If I'm following Richard's explanation correctly of this being an interlacing issue, turning off the honoring of the progressive_frame flag (even when progressive_sequence 0 is seen) and treating interlaced fields as progressive should not have the shimmering effect, but instead cut your effective vertical resolution in half -- I think I observed this yesterday with the XBOX Netflix app -- the on screen display told me it was streaming "Super Why" in 480SD, but the jaggies in the image made it pretty obvious it wasn't really above 240.

Post Reply