#35 All my patches in one

open
Feature (21)
5
2007-07-22
2007-07-22
Robert
No

For convenience, here are all my patches in one patch against CVS head. It includes:

"New deinterlacing algorithm"
"Reduce delay in displaying video frames"
"Save matte setting in config file + matte tweaks"

Discussion

  • Billy Biggs

    Billy Biggs - 2007-07-22

    Logged In: YES
    user_id=153320
    Originator: NO

    Huh. We should talk about the overscan change, I don't think your change is capital-C correct, but I could be wrong. Please send me an email saying exactly what you're trying to do to vektor@gmail.com.

    Your change in tvtime_main to show the bottom field seems completely wrong. Why do you want to do this?

     
  • Robert

    Robert - 2007-07-24

    Logged In: YES
    user_id=1121906
    Originator: YES

    See patch 1729934 for additional comments on the changes to when the fields are shown.

    The overscan change was to fix a bug where overscan wasn't applied when matte was enabled. It also allows 16:10 and 4:3 Matte in anamorphic 16:9 aspect ratio mode (cutting off the sides instead of top and bottom).

    I have made it so that whenever overscan changes matte_changed is set to 1. Matte an overscan are calculated together inside the if(matte_changed) block. The calculation is a little complicated and I wrote it years ago so it took me several minutes to work out what I had done! Here's how it works:

    1. Calculate overscan. matte_x, matte_y, matte_w, and matte_h define the viewable rectangle within the (0,width)-(0-height) rectangle, with overscan cropped.
    2. Compensate for the fact that the aspect ratio of the image from the TV card isn't the same as the aspect ratio it should be displayed as by calculating sqwidth and sqheight. Actually only one of these every gets used - I should move these statements inside the final if. In the normal case sqwidth is used and it is height times aspect ratio (I should have done matte_h*pixel_aspect variable). This is what the width would be if the image was stretched horizonally to make the aspect ratio right.
    3. matte_mode is translated to matte (matte can be 4/3, 1.6, 16/9, 1.85, 2.35).
    4. Check to see if we need to cut off sides, or top and bottom.
    5. Let's say we are cutting off the top and bottom (the else part of the statement). matte_h and matte_y are recalculated. matte_h = sqwidth/matte is equivalent to matte_h = matte_h * pixel_aspect/matte. It should be obvious that if pixel_aspect and matte are the same then matte_h is unchanged an nothing is cut off the top and bottom. If matte is greater than pixel_aspect then matte_h will be reduced proportionally. matte_y is then recalculated using matte_h. Finally output->set_matte() is called.

    If we're cutting off the sides then the the final if is true and we do a similar calculation to change matte_w and matte_x using sqheight.

    As for it being correct: the amount of the image cropped by the overscan is calculated based on the dimensions of the image captured by the TV card. I suppose it should take into account the aspect ratio (e.g. for a 4:3 image, if 4 horizontal pixels are cut then only 3 vertical ones should be cut). So you might be right to suggest it is not correct, though the error is small.

    I realise now that it's not the easiest bit of code to follow. I could tweak the calculation and make it more readable if you think it's necessary.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks