AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > Anime Related Topics > Fansub Groups

Reply
 
Thread Tools
Old 2007-03-27, 05:53   Link #21
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
In theory maybe, but most resampling filters are pretty damn good. If you notice any percievable difference (except if using a nearest neighbor algorithm or something), your eyes are a lot better than mine.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2007-03-27, 07:11   Link #22
Quarkboy
Anime Translator
 
 
Join Date: Nov 2003
Location: Tokyo, Japan
Age: 34
Send a message via AIM to Quarkboy
Quote:
Originally Posted by TheFluff View Post
In theory maybe, but most resampling filters are pretty damn good. If you notice any percievable difference (except if using a nearest neighbor algorithm or something), your eyes are a lot better than mine.
Hmm, there IS a way to test this. Take a frame at 1280x720, and then resize it to 640x360, then back to 1280x720.
Then repeat starting from the original image at 1280x720 and resizing to 640x368, and then back to 1280x720. Then compare the two results to each other.

Let's use a standard test image for such a thing:

1. I loaded the gif into paint shop pro.
2. I resized it to both 128x128 (50%) and 128x130 (a very slight AR change) using the bicubic method.


First, the 128x128 reduction:

Then the 128x130 reduction:


Then, after resizing them back to 256x256 also using bicubic resize:

and from the non-square one


So, clearly, at least in this particular contrived example, there is a HUGE artifact that can be introduced using bicubic resizing algorithms when not resizing with a fixed aspect ratio.


Food for thought, eh? Anyone want to experiment with a real world source?
__________________
Yomiuri Television Enterprise
International Media Strategy Chief
Sam Pinansky
Quarkboy is offline   Reply With Quote
Old 2007-03-27, 07:15   Link #23
checkers
Part 8
*IT Support
 
 
Join Date: Jul 2006
Location: Western Australia
Age: 25
Send a message via MSN to checkers
Not very thoughtful. As you said yourself, (but didn't too much attention too) it's a pathological test case. If you can duplicate this effect to the same degree in a real world source, it will definately be interesting, but for resizers, practice > theory.
checkers is offline   Reply With Quote
Old 2007-03-27, 07:34   Link #24
Quarkboy
Anime Translator
 
 
Join Date: Nov 2003
Location: Tokyo, Japan
Age: 34
Send a message via AIM to Quarkboy
Quote:
Originally Posted by checkers View Post
Not very thoughtful. As you said yourself, (but didn't too much attention too) it's a pathological test case. If you can duplicate this effect to the same degree in a real world source, it will definately be interesting, but for resizers, practice > theory.
Ask, and you shall recieve.

Here is the source frame I used (resized for bandwith saving )



This was all done using Avisynth and BicubicResize commands. In order to enhance the effects, I did 4 rounds of shinking and enlarging.
I did what I suggested about, and oscillated between 1280x720 and 640x360, or 1280x720 and 640x368. Then, I took a screen cap for each, and loaded the two caps as 2 layers in paint shop pro, and chose the "difference" option to combine them. I enhanced the contrast a lot in order to make the differences somewhat obvious, and here's what I got:



Well, it might not be visible, but it makes an interesting edge filter, I guess. My point stands, however... I think that you get more information loss when resizing to a different aspect ratio.
__________________
Yomiuri Television Enterprise
International Media Strategy Chief
Sam Pinansky
Quarkboy is offline   Reply With Quote
Old 2007-03-27, 07:40   Link #25
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
True to some degree, but your point is pretty moot in practice anyway, I'm afraid. You pretty much always have to crop a few pixels off SOMEWHERE, and that screws up all the nice even divisors, unless you want to upsize back before you halve the size.

Edit: actually, stop trying to make the issue seem larger than it really is just for the sake of winning the argument. You did the shrinking/resizing 4 times, not once, and to see the difference at all you had to raise the contrast a lot in the difference map. In real-world applications, the difference IS NOT SIGNIFICANT (although it may be with certain test images). Try the following Avisynth script on any 720p source of your choice and see for yourself:

Code:
avisource("source.avi")

a = last.bicubicresize(640,360).bicubicresize(1280,720)
b = last.bicubicresize(640,368).bicubicresize(1280,720)

subtract(a,b)
#levels(127,1,129,0,255)
Comment in the levels() statement to nuke the contrast to hell and back if you want to acually see anything besides plain gray (the subtract() filter sets every pixel in the output clip to 50% gray + <pixel in clip a> - <pixel in clip b>). You DO get some differences around edges, but if you can actually tell the difference with unaided eyes, you have a lot better eyes than I do.

Try these two images, for example:
1
2
If you can tell which one is which, you win something. I think. There IS a subtle difference in some places, if you look very closely, but I would hardly call it significant.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read

Last edited by TheFluff; 2007-03-27 at 10:31.
TheFluff is offline   Reply With Quote
Old 2007-03-27, 08:22   Link #26
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 29
Hmm, I tried using the various resizers in IrfanView on that aritificial test image, and interestingly none but point-resize gives that effect with additional high-power rings. All of Photoshop CS2's resampling filters to give that effect however.
Same goes for the case of Avisynth, only the point resizer produces the same effect as the PSP bicubic resiszer. (I ran all of the resizers with their default parameters.)

Here's resized to 128x128 with IrfanView Lanczos resampling: (All of IV's resamplers produced results similar to this.)


And here's 7 different resizes done with Avisynth:


Code:
src = imagesource("z256.bmp", pixel_type="rgb24")
a = src.pointresize(128,128)
b = src.bilinearresize(128,128)
c = src.lanczosresize(128,128)
d = src.lanczos4resize(128,128)
e = src.gaussresize(128,128)
f = src.spline16resize(128,128)
g = src.spline36resize(128,128)
h = src.bicubicresize(128,128)
stackhorizontal(a, b, h, c, d, e, f, g)
Be sure to save the image as a 24 bit bitmap, otherwise Avisynth doesn't read it properly.
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's

Last edited by jfs; 2007-03-27 at 08:57. Reason: As per Fluff, forgot one resizer in AVS sample
jfs is offline   Reply With Quote
Old 2007-03-27, 08:29   Link #27
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
Interesting and related link: http://virtualdub.org/blog/pivot/entry.php?id=86#body

Seems Paint Shop Pro's resizers still are borked

Edit: jfs, you missed bicubic.

Edit2: what Avisynth makes of it:
Scaled down
Scaled down, then up again

Edit3: beaten by jfs. But mine has bicubic, too!
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read

Last edited by TheFluff; 2007-03-27 at 08:50.
TheFluff is offline   Reply With Quote
Old 2007-03-27, 09:11   Link #28
Mentar
Sore wa himitsu desu!
 
 
Join Date: Nov 2003
Location: Hamburg
Age: 44
Quarkboy: On a theoretical level, I'll certainly agree that you have a point. Resizing to mod16 with slight AR correction will cause minimal changes in the frames compared to a perfect 1:2:1 transformation, but that doesn't necessarily have to be bad. By this logic alone, any form of filtering would be a distortion of the original aswell

To give a concrete example: An effective way to use minimal-resizing to your advantage is mild dehaloing. Resize *2 or *1.5, then apply filtering, mild linemending/linethinning, and then resize back *0.5 is the best and least intrusive way to reduce or even suppress nasty halos of problematic source material with too much edge enhancement that I know of. Why? Because the minimal interpolation of the resizers are actually working to your advantage here.

I understand the point you're trying to make, but your example isn't really rooted in real-life issues. You don't resize from big to small to big. Never. The _other_ way round, small to big to small, certainly - supersampling with filtering is a common practice. And more often than you'd want, you're forced to minimal-resize anyway, due to cropping. Here, the few pixels you have to crop to achieve mod16 are even less noticeable.

Overall, I'd strongly discourage any encoder from ignoring the mod16 rule for h264 content. The bitrate losses in x264 aside, the fact that too many decoders out there can't properly deal with non-mod16 content should be reason enough. It even happens to serious encoding veterans - I remember that 5 months ago I only realized that I had my playback shot was that one non-mod16 release suddenly gave it trouble. What was the reason? I had accidentally deactivated ffdshow to test the latest CoreAVC, deinstalled it again, forgot to turn ffdshow back on, and suddenly my DVD player software decided that this was its prime time ^_^; ... if something like that happens to "normal" anime fans, I doubt that they'd have been able to find out the reason.
Mentar is offline   Reply With Quote
Old 2007-03-27, 10:39   Link #29
Quarkboy
Anime Translator
 
 
Join Date: Nov 2003
Location: Tokyo, Japan
Age: 34
Send a message via AIM to Quarkboy
Quote:
Originally Posted by TheFluff View Post
Interesting and related link: http://virtualdub.org/blog/pivot/entry.php?id=86#body

Seems Paint Shop Pro's resizers still are borked

Edit: jfs, you missed bicubic.

Edit2: what Avisynth makes of it:
Scaled down
Scaled down, then up again

Edit3: beaten by jfs. But mine has bicubic, too!
PSP's resizers are borked... Hmm, that explains more than you might know.

And I only try to inspire people to think and explore more deeply about things. Me being right or wrong is not really the intention. Clearly, in this case, I am mostly wrong .
__________________
Yomiuri Television Enterprise
International Media Strategy Chief
Sam Pinansky
Quarkboy is offline   Reply With Quote
Old 2007-03-27, 13:53   Link #30
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 27
Actually, the really interesting question is why the Avisynth pointresized and the PSP resized test image looks like it does. Crosstalk? Something else? I have no idea, I'm actually not very good at all at signal processing maths. I can kinda see why it happens on the pointresized one, although I can't really explain it...
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2007-03-27, 15:37   Link #31
jfs
Aegisub dev
 
 
Join Date: Sep 2004
Location: Stockholm, Sweden
Age: 29
Yes, it can (probably) be explained using the sampling theorem/some talk about Nyquist frequency, but I really don't feel like investigating it An investigation would probably also require some proper mathematical definition of the image, ie. expressing it as a sum of sin/cos functions (or whatever) of X and Y coordinates. Ugh.
What I can see though, is that at the points where the "additional circles" appear, the ripples are approaching the Nyquist frequency, ie. each pixel center is exactly at at an extrema. Let's just stick to an intuitive understanding
__________________

Aegisub developer [ Forum | Manual | Feature requests | Bug reports | IRC ]
Don't ask for: More VSFilter changes (I won't), karaoke effects, help in PM's
jfs is offline   Reply With Quote
Old 2007-03-27, 17:32   Link #32
Starks
I see what you did there!
*Scanlator
 
 
Join Date: Apr 2004
Age: 26
Send a message via AIM to Starks
Are the rings lost during the transformation or is that by virtue of the image creating some kind unintentional illusion?
__________________
Starks is offline   Reply With Quote
Old 2009-01-18, 06:02   Link #33
guest0815
Member
 
Join Date: Aug 2008
Isn't there a risk of unexpected line breaks when applying 1280x720 scripts after a resize to 704x400? I once had a script where a two-liner was so close to the margins it would come out as a three liner.
guest0815 is offline   Reply With Quote
Old 2009-01-18, 07:12   Link #34
Quarkboy
Anime Translator
 
 
Join Date: Nov 2003
Location: Tokyo, Japan
Age: 34
Send a message via AIM to Quarkboy
Quote:
Originally Posted by guest0815 View Post
Isn't there a risk of unexpected line breaks when applying 1280x720 scripts after a resize to 704x400? I once had a script where a two-liner was so close to the margins it would come out as a three liner.
Not if you appropriately change the playresx and playresy variables in the script.

Although I suppose theoretically the change in the border sizes might possibly push it out of bounds if not also modified...
__________________
Yomiuri Television Enterprise
International Media Strategy Chief
Sam Pinansky
Quarkboy is offline   Reply With Quote
Old 2009-01-18, 11:54   Link #35
guest0815
Member
 
Join Date: Aug 2008
Quote:
Originally Posted by Quarkboy View Post
Not if you appropriately change the playresx and playresy variables in the script.
Like, when working on a 1280x720 video in aegisub, setting the script resolution to 1280x727 before resize(704x400).textsub? That seems to work. I would have expected 1267x720 to have the same effect but was getting lots of strange results when trying to fix it with the width.
guest0815 is offline   Reply With Quote
Old 2009-01-18, 17:43   Link #36
Mentar
Sore wa himitsu desu!
 
 
Join Date: Nov 2003
Location: Hamburg
Age: 44
Quote:
Originally Posted by guest0815 View Post
Isn't there a risk of unexpected line breaks when applying 1280x720 scripts after a resize to 704x400? I once had a script where a two-liner was so close to the margins it would come out as a three liner.
Simple answer: Yes. This is why I always proof on aegisub with 704x400 resolution.
Mentar is offline   Reply With Quote
Old 2009-01-19, 09:38   Link #37
Starks
I see what you did there!
*Scanlator
 
 
Join Date: Apr 2004
Age: 26
Send a message via AIM to Starks
Not to stir the hornet's nest again, but I'd like to know where 704x396 even came from
__________________
Starks is offline   Reply With Quote
Old 2009-01-19, 09:53   Link #38
martino
makes no files now
 
 
Join Date: May 2006
704/396 = 16/9, that's where.
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2009-01-19, 11:31   Link #39
Starks
I see what you did there!
*Scanlator
 
 
Join Date: Apr 2004
Age: 26
Send a message via AIM to Starks
I know that. But how was that specific resolution derived?

It's close to NTSC, but that's it as far as I can understand.
__________________
Starks is offline   Reply With Quote
Old 2009-01-19, 12:45   Link #40
Quarkboy
Anime Translator
 
 
Join Date: Nov 2003
Location: Tokyo, Japan
Age: 34
Send a message via AIM to Quarkboy
Quote:
Originally Posted by Starks View Post
I know that. But how was that specific resolution derived?

It's close to NTSC, but that's it as far as I can understand.
It's quite simple really: An anamorphic DVD contains a 720x480 resolution video which is supposed to be displayed with a 16:9 aspect ratio.

Now name the closest 16:9 integer fraction where both the numerator and denominator are no larger than 720 and 480 respectively.

Answer: 704x396.
__________________
Yomiuri Television Enterprise
International Media Strategy Chief
Sam Pinansky
Quarkboy is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:30.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
We use Silk.