thetoof
11th October 2008, 05:42
Well, the thread title says it... here are some results to show that the concept can work:
http://img252.imageshack.us/img252/6420/working0005co2.th.jpg (http://img252.imageshack.us/my.php?image=working0005co2.jpg)http://img252.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)http://img373.imageshack.us/img373/4545/working0008gl6.th.jpg (http://img373.imageshack.us/my.php?image=working0008gl6.jpg)http://img373.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)
However, it doesn't work in a few cases, one being if the same field is blended for 2 successive frames:
http://img518.imageshack.us/img518/5404/not0000nb6.th.jpg (http://img518.imageshack.us/my.php?image=not0000nb6.jpg)http://img518.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)http://img147.imageshack.us/img147/4082/not0001eu9.th.jpg (http://img147.imageshack.us/my.php?image=not0001eu9.jpg)
This is what it currently does (based on this (http://forum.doom9.org/showpost.php?p=1192032&postcount=253) script, mod in the next post):
- separatefields + selecteven/odd
- blend detection on the even field clip
- blend detection on the odd field clip
- if a frame in the even field clip is declared blended, drop that field in the source clip and use the odd field to do spatial interpolation of the missing field
- opposite happens if odd field is blended
- if none are blended, use source frame
Problem:
The even/odd fields are compared together, so if two successive top (or bottom) fields are blended, it'll screw up blend detection and the function won't work as expected
Solution:
Compare the even and odd fields of the same frame to declare them as clear or blended
Concept (and this is where I need help :p):
- assumetff().separatefields() to make blend calculation possible on the fields (that "became" frames)
- compare the fields of the same frame for blend detection (after previous operation, separatefields' frame 0 & 1 (top and bottom fields of source's frame 0), frame 2 & 3 (top and bottom fields of source's frame 1) and so on.
Since both fields are very similar if the frame is clear, the comparison could be about "are they almost duplicates or not"
- compare even frame to next frame (let's say it's frame 32 & 33, corresponding to even and odd field of source's frame 16)
- if even (32) is considered as a blend, source's frame 16's top field is blended
- discard top field of source's frame 16 and use interpolation to replace it (like nnedi(0))
- compare odd frame to the previous frame (to compare the even (top) field of the same frame)
- if odd (33) is considered as a blend, source's frame 16's bottom field is blended
- discard bottom field of source's frame 16 and use interpolation to replace it (like nnedi(1))
- If none are blended, use source frame
- If the difference with previous or next frame is very small (duplicate), use that other frame instead of the one created with interpolation (interpolated frame will most likely contain less detail than the duplicate)
Stream to play with (http://www.mediafire.com/download.php?jgi2morjvvy)
Script to play with (or totally rewrite :p) is right below
Improvements to consider if the concept ever works fully:
- Using cheap (faster) interpolation before checking if neighbor frame is a duplicate of the current one & then replace current // if not, use good interpolation
- Use mo-comp interpolation instead of spatial-only (nnedi for now)
- Speed improvements with optimal conditional environment usage
Have fun! ^_^
http://img252.imageshack.us/img252/6420/working0005co2.th.jpg (http://img252.imageshack.us/my.php?image=working0005co2.jpg)http://img252.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)http://img373.imageshack.us/img373/4545/working0008gl6.th.jpg (http://img373.imageshack.us/my.php?image=working0008gl6.jpg)http://img373.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)
However, it doesn't work in a few cases, one being if the same field is blended for 2 successive frames:
http://img518.imageshack.us/img518/5404/not0000nb6.th.jpg (http://img518.imageshack.us/my.php?image=not0000nb6.jpg)http://img518.imageshack.us/images/thpix.gif (http://g.imageshack.us/thpix.php)http://img147.imageshack.us/img147/4082/not0001eu9.th.jpg (http://img147.imageshack.us/my.php?image=not0001eu9.jpg)
This is what it currently does (based on this (http://forum.doom9.org/showpost.php?p=1192032&postcount=253) script, mod in the next post):
- separatefields + selecteven/odd
- blend detection on the even field clip
- blend detection on the odd field clip
- if a frame in the even field clip is declared blended, drop that field in the source clip and use the odd field to do spatial interpolation of the missing field
- opposite happens if odd field is blended
- if none are blended, use source frame
Problem:
The even/odd fields are compared together, so if two successive top (or bottom) fields are blended, it'll screw up blend detection and the function won't work as expected
Solution:
Compare the even and odd fields of the same frame to declare them as clear or blended
Concept (and this is where I need help :p):
- assumetff().separatefields() to make blend calculation possible on the fields (that "became" frames)
- compare the fields of the same frame for blend detection (after previous operation, separatefields' frame 0 & 1 (top and bottom fields of source's frame 0), frame 2 & 3 (top and bottom fields of source's frame 1) and so on.
Since both fields are very similar if the frame is clear, the comparison could be about "are they almost duplicates or not"
- compare even frame to next frame (let's say it's frame 32 & 33, corresponding to even and odd field of source's frame 16)
- if even (32) is considered as a blend, source's frame 16's top field is blended
- discard top field of source's frame 16 and use interpolation to replace it (like nnedi(0))
- compare odd frame to the previous frame (to compare the even (top) field of the same frame)
- if odd (33) is considered as a blend, source's frame 16's bottom field is blended
- discard bottom field of source's frame 16 and use interpolation to replace it (like nnedi(1))
- If none are blended, use source frame
- If the difference with previous or next frame is very small (duplicate), use that other frame instead of the one created with interpolation (interpolated frame will most likely contain less detail than the duplicate)
Stream to play with (http://www.mediafire.com/download.php?jgi2morjvvy)
Script to play with (or totally rewrite :p) is right below
Improvements to consider if the concept ever works fully:
- Using cheap (faster) interpolation before checking if neighbor frame is a duplicate of the current one & then replace current // if not, use good interpolation
- Use mo-comp interpolation instead of spatial-only (nnedi for now)
- Speed improvements with optimal conditional environment usage
Have fun! ^_^