1 (edited by Procrastinating 04-07-2014 15:19:24)

Topic: 64/128px Block size?

I was following the guide to optimize SVP for anime sources, but I was getting very unsatisfactory results.

The best compromise between smoothness and artifacts I could obtain were using these settings:
http://i.imgur.com/GmuS9p0.png
Here is my justification for each setting:
1m, combined with "Above normal" smoothens camera motion a little without causing big relative motion drops when masking.
Sharp works best, though "standard" can "hide" the artifacts a little.
Wide search, precision and grid step had little effect on the artifacts or smoothness, though a small, slow search radius helped a little.

The interesting parts are the vector grid/block size and the frame size.

32px Interpolated camera motion had the least artifacts, while decreasing frame size also decreased artifacts further. Here is an image to show this:
http://i.imgur.com/rJ5wjrE.gif
In the scene, a series of tables are rotating and moving while the camera itself is also rotating and moving. I'm not too concerned about interpolating the table rotation, as no SVP algorithm can elegantly handle sudden movements like that. I'm more interested in getting the camera rotation to be smooth, without causing the objects in the scene to also interpolate.

This suggests that having a 64px or even 128px block option would contribute even further towards reducing artifacts, or better yet an adaptive block size ala x264.

The problem with reducing framesize is that while the artifacts are reduced, the drawbacks are quite obvious.

Would it be possible for the SVP developers to at least add a 64px and 128px block size option into SVAnalyse? And likewise as a preset in SVP.

Thanks.

Re: 64/128px Block size?

more motion => more artifacts
bigger block size => less "local" motion
less motion => less artifacts wink

this's all about a balance between motion (smoothness) and artifacts

though 64/128 blocks could be useful for 4k video...

3 (edited by Procrastinating 10-07-2014 07:43:01)

Re: 64/128px Block size?

The problem with "local" motion Is that unless the algorithm improves, it's no good for anime  :> Plus, large block size still preserves camera motion, so you at least remove those unsightly 24fps camera pans!

Giving the option, even if it is in preparation for 4K would be nice, though.

4 (edited by Procrastinating 10-07-2014 08:17:17)

Re: 64/128px Block size?

Looking further into the code, it would appear that in src\svpflow1\MVAnalyse.cpp the following code is present on lines 102-107

    if (( ad.nBlkSizeX != 8 || ad.nBlkSizeY != 8 ) &&
            ( ad.nBlkSizeX != 16 || ad.nBlkSizeY != 8 ) &&
            ( ad.nBlkSizeX != 16 || ad.nBlkSizeY != 16 ) &&
            ( ad.nBlkSizeX != 32 || ad.nBlkSizeY != 32 ) &&
            ( ad.nBlkSizeX != 32 || ad.nBlkSizeY != 16))
        env->ThrowError("SVAnalyse: Block's size must be 8x8, 16x8, 16x16, 32x16, 32x32");

Would it break the code in any way to simply add 64, 128 and 256 options? I'm not sure how to compile the code, so I couldn't test it myself.

Re: 64/128px Block size?

Procrastinating
Would it break the code in any way to simply add 64, 128 and 256 options?

sure it will

Re: 64/128px Block size?

Fair enough, so it is not a priority for development then?

Re: 64/128px Block size?

historically MVTools was only supported 4-16 blocks mainly because that is what used inside x264 coder

at some point MAG79 asked MVTool's co-author Fizick to add 32px block size
it was added in ver. 2.4.5 (11.07.2009)

since then there're no real evidences that 32px block is somehow better than 16px  hmm
and now you want 64 and 128 px

we just don't want to do useless job wink

8 (edited by Procrastinating 11-07-2014 05:27:49)

Re: 64/128px Block size?

Chainik wrote:

historically MVTools
since then there're no real evidences that 32px block is somehow better than 16px  hmm
and now you want 64 and 128 px

we just don't want to do useless job wink

But I gave you the evidence you want in the OP. I used a GIF in the OP to show that reducing the frame size(in effect emulating larger block sizes) dramatically reduces the artifacts of animated footage, while preserving camera motion interpolation.


Even the "animation guide" on the SVP website recommends 32px block size, albeit with overlap. I don't recommend the overlap as it doesn't improve camera motion and only increases artifacts, but this and my GIF proves the trend that increasing block size reduces object artifacts while preserving camera motion.

The reason few if any anime/cartoon watchers use SVP is because animation is impossible to motion interpolate without introducing awful artifacts everywhere.
It doesn't matter if you argue that "the algorithm does a pretty good job", because one bad frame is enough to turn off most interested people, and you are guaranteed to get a few bad frames in any animated video.

Increasing the block size allows for camera interpolation in the place of object motion interpolation, which delivers only the benefits of SVP with none of the drawbacks.
64 and say 128px block size would in effect create an option where those who like the idea of camera interpolation, but hate the idea of object interpolation, can still enjoy some benefits to SVP.

Plus as you mentioned, the benefits are also present outside of animated footage, as 4K footage is essentially double the frame size of 1080p footage, so it would make sense to have at least double the block size available, and 8K video is obviously going to happen in the distant future, but could be brought into consideration now.

As a stopgap, I suppose it could be possible to analyse a downsampled 1080/720p-540/360p video but then apply the interpolation to the original footage? I'm not sure if this would reduce performance, though I imagine it could be implemented easily.

Re: 64/128px Block size?

I agree with Procrastinating - I can see less artifacts even with regular video (not anime) when I set Motion Vector Grid to the biggest possible.
And I'd be very interested to see bigger values then 32 pixels, or to have other way to smooth only panning shots and only big objects on the screen. The biggest amount of artifacts I can observe are associated with moving small and medium objects.

So dev team, please do not procrastinate and consider this enhancement for next release for fix pack smile

Re: 64/128px Block size?

tehen
or to have other way to smooth only panning shots and only big objects on the screen

this's the correct question!
there're tons of options in motion vectors search algorithm, and with "analyse.main.penalty" options group it's possible to get global motion only

try to set analyse.main.penalty.lambda in override.js file to some higher value, for example 100.0

Re: 64/128px Block size?

I'll test those options later then, that's awesome if there needs to be no changes to get the same desired effects.

It still seems like a reasonable idea to implement in the future as an option moving into 4K, as I'd imagine 32px was requested because of the rise of 1080p video.

12 (edited by Procrastinating 04-10-2014 01:05:46)

Re: 64/128px Block size?

Bringing this post back from the dead a little, but over the past month I have tried manipulating just about every combination of variable in the override.js, including the settings recommended by chainik.

analyse.main.penalty.lambda actually benefited from lower values, and most other variables barely affected the resulting interpolation at all. Even trying to mask artefacts will create new artefacts in many cases.

The only setting that made a consistent reduction in all the artefacts was increasing the block size to its highest-possible value. Sadly of course this means that 480p video is just about perfect, 720p video has problems, and 1080p video is unwatchable.

At some point I gave up and stopped using SVP, but In the hopes that someone can shed some light on this problem case, I have uploaded a webm of this scene.

http://a.pomf.se/aojlih.webm

13 (edited by mashingan 07-10-2014 00:08:03)

Re: 64/128px Block size?

Hi, the guide actually is already old big_smile

The best setting is your default setting. Then you can change several setting to fine tuning it.
Of course you wouldn't want change the setting too far away from the default big_smile

I've compared it, the guide setting and my default setting. The default setting definitely better.

You could select your favorite "benchmark" video big_smile and see the differences when you change the setting.

Oh, this is the screenshot from my "benchmark" video
http://www.svp-team.com/forum/misc.php?item=3257
But this is kinda extreme and very rare case, additionally, the scene movement is very fast.
(That's why I made it my "benchmark" video  lol )

Edit:

Procrastinating wrote:

http://a.pomf.se/aojlih.webm

I've seen your webm video, the image really smooth and sharp in my player.

I don't watch the Kill la Kill, but I didn't notice any distorted image. Your webm file is even better than my "benchmark" video. big_smile

Post's attachments

is2-8.jpg 156.37 kb, 165 downloads since 2014-10-06