View Full Version : another anime xvid thread


helix
22nd June 2004, 06:15
I'm having some real troubles with encoding anime into xvid. I've looked at just about every thread thats been posted on these fourms regarding anime, and I still can't seem to get my video to look very good. I'm not using a .avs, but insted a VFAPI. Yes, yes, I know it's old and slow but I'm seem to be getting slightly better results as of right now and it's simpler. I'm sure I'd get better ones if I wasn't a noob to avisynth and script editing. The particular show I'm encoding is Lodoss, which is a DVD rip of my own, (I used DVD2AVI to make .dv2) so the source is realativly clean but lodoss is an older show so I need quite a few filters to reduce noise, better the color and increase sharness. I'm trying to get each episode around 175Mb, so I can fit four to a disk. I realize I could probally have better filters with avisynth and make it look better and get faster encode times at the same time, maybe someone could explain script editing to me, or at least what filters I should use in there. I know from the threads that a few of you guys have done older shows. I'm also encoding an entire CD of the box set, six episodes at a time in one big stream, which perhaps isn't such a good idea. Maybe I should just do them one by one. I'm not sure if I should disable B-frames or not since they increase quality. I'd like to stick with Xvid and not move to Divx or RV10 but Xvid is really starting to annoyed me, although sirber's RealAnime looks promising.

Here are the Xvid settings:

Motion Search Precision: 6 - Ultra High
Quantization Type: - H.263
VHQ: 1 - Mode Decision
Maximum I-frame Interval: 300
Minimum I-frame Interval: 1
Chroma Motion: enabled

Maximum B-frames : 2
B-frame Quantizer ratio: 150
B-frame Quantizer offset: 100
B-frame Threshold: 0
DX50 B-VOP compatibility: enabled


Min I-frame Quantizer: 2
Max I-frame Quantizer: 31
Min P-frame Quantizer: 2
Max P-frame Quantizer: 31

I-frame boost %: 0
Discard first pass: enabled
Below I-frame distance: 10
I-frame bitrate reduction %: 20
High bitrate scenes %: 0
Low bitrate scenes %: 0
Playback with Bias

Curve aggression: Medium
High distance from average %: 200
Low distance from average %: 100
Automatic minimum realative quality strength %: 50

Leak
22nd June 2004, 10:19
Originally posted by helix
Curve aggression: Medium
High distance from average %: 200
Low distance from average %: 100
Automatic minimum realative quality strength %: 50

Just one comment - if you've really got those options in your config dialog, you're using a prehistoric version of XviD.

Try using the current version (http://www.koepi.org/), you might even get better quality with it...

np: Jah Wobble & Deep Space - Five Beat Pt. I (Five Beat)


EDITED by Koepi: hey, I've a new domain now, just remember "www.koepi.org" ;)

sysKin
22nd June 2004, 10:26
Exactly how ancient xvid are you trying to use here?

[edit]Oh look, I should have reloaded the page before answering ;) Leak was here long before me.

lordadmira
22nd June 2004, 10:37
Greetings fellow anime encoder.

First off u should upgrade to version 1.0.1 which is out now. I assume by "VFAPI" u mean Virtual Dub? Ur basic settings seem ok though I would set the Curve and I frame stuff back to defaults, enable VHQ 4, Trellis, Chroma Optimizer, GMC, and Adaptive Quantization. I haven't seen the original Lodoss War so I don't know what kinds of motions it has. That only matters if u want to tweak the B frame settings. If there aren't many moving objects u might get better quality by disabling BVOPs. If u aren't sure just leave it at defaults.

Cleaning up grungy video is a piece of cake, I do it every week when I encode my Inuyasha eps. :D Assuming ur using Virtual Dub u can use these filters:

VirtualDub.video.filters.Add("smoother");
VirtualDub.video.filters.instance[1].Config(750,1);
VirtualDub.video.filters.Add("temporal smoother");
VirtualDub.video.filters.instance[2].Config(3);
VirtualDub.video.filters.Add("warp sharp");
VirtualDub.video.filters.instance[3].Config(76, 2);
VirtualDub.video.filters.Add("resize");
VirtualDub.video.filters.instance[4].Config(640,480,7); U only have to obtain the Warp Sharpener filter, the rest are built in. The smoothers get rid of static and grain and warp sharp makes the lines more crisp. Finally u resize into 4:3 aspect ratio. Play with the filter intensities until it looks just right; they should be as low as possible. If it's interlaced then u want to use Smart Deinterlacer. If it's telecined try the built in inverse telecine function. If that pukes then u can try Telecide or other IVT filters out there on the Net. If no IVT filters/settings seem to work out u can just use Smart Deinterlacer on it.

After u get that setup u'll want to do a 2-pass encoding. The only wildcard is the B frames. Depending on the source material they can help a lot or be totally useless. Since u want to get rather small file sizes it's probably best to leave them be. Also u might have to reduce the resolution to get good quality at that low of a bitrate.

LA

edit: Wow, 3 people replied in the time since I started writing. :P

helix
22nd June 2004, 11:52
I was almost certain I was using Xvid 1.01 guess I should try to reinstall. :confused: By VFAPI I mean the frameserver. I'm just converting the .dv2 from DVD2AVI into a pseudo-AVI using vfapi convert. perhaps I should update this whole process and move to .avs, though i wouldn't prefer it. I don't have any trouble with the filters, it's just the encoding times that i'm worried about. Right now in virual dub i'm gettig about 8-13Fps. With 2 hours and 30 mins of video to encode with 2 passes. It takes about 13 hours, so i'm looking for anything that will decrease that. The six filters I was using with lodoss were: (listed in no specific order)

Deinterlace
Null transform
Resize to 640x480 - lanzos3
Warp sharp
Smoother
Brightness and contrast

I'll try the ones you listed and see if i can get better picture quality with less filters to minimise time. And I assume by upgrading to 1.01, if I do indeed have a older version, will shorten encodes times a bit. But thanks for the replies1. I think I can finally make some progress on this huge pile of anime I have lined up to encode, lodoss and a few other shows.

lordadmira
22nd June 2004, 11:59
Speed wise I don't think u have anything to complain about. A 2 pass encode of one Inuyasha ep takes 9-10 hours on my system. Instead of deinterlacing I would really try to get IVT to work. That will lower the framerate to 23.976 fps and make achieving 175 MB more realistic.

Koepi
22nd June 2004, 12:01
vfapi involves at least two colour space conversions.

So using avisynth in YV12 color space will save you plenty of time by not converting the color space. Also, the filters work faster - they're more optimized _and_ operate on less data (staying in the yv12 colour space... ;) ).

Needless to say, the eyes of some hundred testers verified the YV12 chain has a better visual result when encoded.

Koepi

helix
22nd June 2004, 12:59
Originally posted by lordadmira
Speed wise I don't think u have anything to complain about. A 2 pass encode of one Inuyasha ep takes 9-10 hours on my system. Instead of deinterlacing I would really try to get IVT to work. That will lower the framerate to 23.976 fps and make achieving 175 MB more realistic.

Wow, I guess I don't. What speed is your CPU running at? I' at 2.5Ghz on a XP2400

Leak
22nd June 2004, 13:06
Originally posted by Leak
EDITED by Koepi: hey, I've a new domain now, just remember "www.koepi.org" ;)

True, but since it only stuffs your old address in a frameset it's hard to link directly to subpages - and I didn't want to take chances with him missing the XviD binaries page... ;)

np: Giardini Di Miro - Pearl Harbor (Hits For Broken Hearts And Asses)

Koepi
22nd June 2004, 13:55
Sorry for the OT again, but http://www.koepi.org/xvid.shtml works perfectly ;)

N.P.: the noise of my keyboard and the practicant next to my work place. Somewhat industrial. I _hate_ industrial.

Leak
22nd June 2004, 14:37
Originally posted by Koepi
Sorry for the OT again, but http://www.koepi.org/xvid.shtml works perfectly ;)

N.P.: the noise of my keyboard and the practicant next to my work place. Somewhat industrial. I _hate_ industrial.

Oh, well then it's a bit of a more advanced redirect than what I'm used to... still, going to www.koepi.org, then to your binaries page and choosing "Show only this frame" in Mozilla lands me at your old URL, and that's what I used.

But I guess the discussion is moot and a bit off-topic, too... ;)

np: Two Lone Swordsmen - Driving With My Gears In Reverse (From The Double Gone Chapel) + 2 servers making quite a lot of fan noises... :(
(Not really industrial, but with a lot more guitar and vocals than their earlier, more electronic albums - not that that's a bad thing... :))

helix
22nd June 2004, 17:18
Originally posted by lordadmira
Speed wise I don't think u have anything to complain about. A 2 pass encode of one Inuyasha ep takes 9-10 hours on my system. Instead of deinterlacing I would really try to get IVT to work. That will lower the framerate to 23.976 fps and make achieving 175 MB more realistic.

What's the difference between using IVT and enabling "forced film" in DVD2AVI? I've never used IVT for any of my anime SVCD encodes, would you explain?

MasterYoshidino
22nd June 2004, 23:26
by "IVT" do you mean "Inverse Telecine"?
Most anime is manually telecined onto NTSC format. That means that two out of every five frames are encoded into MPEG-2 interlaced, which reduces the quality of the frames even when properly deinterlaced and matched. When anime is flag based telecined (few anime are done this way) the original quality of the frames is fully retained as the telecine process is done via the decoder and not the encoder. Most of the time you will have to IVTC unless your source is truly telecined like hollywood movies are (via flags). Then force film is common sense. Kind of like how the quality of subtitle's edges are better if you softsub rather than hardsub, same concept to "soft telecine" (via flags) or "hard telecine" (via hardcoded telecine).

lordadmira
23rd June 2004, 01:44
Originally posted by Koepi
Sorry for the OT again, but http://www.koepi.org/xvid.shtml works perfectly ;) Actually it doesn't. Clicking on the Xvid binary throws a cog on ur site. "Your browser didn't send the correct referer for my site" U have to explode the frame and then click the link to get Xvid.

StainlessSteel
23rd June 2004, 02:05
I just got Armitage III Poly-Matrix (http://www.amazon.com/exec/obidos/tg/detail/-/B00012QLQE/qid=1087952231/sr=1-2/ref=sr_1_2/103-1851739-5539026?v=glance&s=dvd) sent from the US. It's an old movie, like Ghost in the Shell or Lodoss War. Therefore it has much noise, too. So I wonder, if attaching a medium-noise filter would decrease the color quality.

Another question. Is DGIndex (DVD2AVI) always right about the AR? I also got this letterbox Shrek DVD, but DGIndex says it's 16:9; that's why I wonder. What input AR should I state in GKnot for as letterboxed widescreen movie which isn't really "16:9 anamorphic".

By the way, is the "cartoon mode" really any good for anime? For example, Trigun has a lot of dusty scenes, so I would say "cartoon mode" isn't that helpful in that case, or?

Stainless

lordadmira
23rd June 2004, 03:40
Originally posted by helix
What's the difference between using IVT and enabling "forced film" in DVD2AVI? I've never used IVT for any of my anime SVCD encodes, would you explain? I've never used DVD2AVI so I couldn't say. But if it can preempt this whole telecine problem then go for it. But Inverse Telecine is the process by which telecining is undone. Telecining turns 23.976 fps material into 29.97 fps material by unstitching one frame and weaving it into two frames. You can tell if u have telecined material if u have three normal frames followed by two "interlaced" frames. There are numerous technical explanations of this online. The problem with IVT is that a lot of times the telecining is done wrong in the first place which vastly complicates the reverse process. A super video CD is usually interlaced so u wouldn't encounter IVT when dealing with that. If u see interlacing artifacts after u do the IVT process then the source was made wrong. I've heard rumors that there are some good adaptive IVT filters out there that might recover from those errors. U might have to run Smart Deinterlacer after the IVT to clean up the artifacts. If u do that, use field based differencing.

I have a Celeron 1400. :D Sheesh ur even running overclocked! Shame on u!

LA

lordadmira
23rd June 2004, 03:48
Originally posted by StainlessSteel
Armitage III Poly-Matrix sent from the US. It's an old movie, like Ghost in the Shell Those aren't old! If they need any filtering at all some light Smart Smoother should suffice.

By the way, is the "cartoon mode" really any good for anime? For example, Trigun has a lot of dusty scenes, so I would say "cartoon mode" isn't that helpful in that case, or? Cartoon mode raises the threshold for detecting motion/changes in a macroblock. So it makes it easier to detect static blocks. I use it in my Inuyasha encodes but I've had it create artifacts in other encodes. It's source dependant. The artifacts turn up when there's high contrast motion. U'll see a "stacking dirt" effect on the surface that an object has passed over. If ur source is very clean then u shouldn't need this.

LA

helix
23rd June 2004, 06:25
So if my source is already 29.97fps there shouldn't be a problem, Right? If I don't use "forced film" which takes it down to 23.976, what is the process I use to get it to come out to 23.976 in Xvid? Just use a telecine filter? I'm definitly getting interlacing artifacs so would using telecine insted of a deinterlacer give better quality?

Well beside that I got a few screenshots I want to post to get opinions on how I can make quality a bit better. From watching fansubs and looking at thier bitrates I can tell I can tell there's some room for improvment. It's not bad, but some of the scences look pretty blocky around the edges on full screen.

Here's it at 640x480
http://www.clanbbw.com/publicimg/data/images/animescreen1.jpg

Here's a close up
http://www.clanbbw.com/publicimg/data/images/animescreenclose1.jpg

Xvid Settings:

Bitrate: 847Kbs
Quantization type: H.236
Quarter Pixel: enabled

B-VOPs:
Max consecutive B-VOPs: 2
Quantizer Ratio %: 150
Quantizer offset %: 75

Motion Search Precision: 6 - Ultra High
VHQ: 4 - Wide Search
Use chroma motion: enabled
Frame drop ratio: 0
Max I-frame interval: 300
Cartoon mode: enabled

Min I-frame Quantizer: 2
Max I-frame Quantizer: 31
Min P-frame Quantizer: 2
Max P-frame Quantizer: 31
Min B-frame Quantizer: 2
Max B-frame Quantizer: 31

Trellis quantization: enabled

Joe Fenton
23rd June 2004, 07:32
As I understand it, cartoon mode is for CARTOONS. Examples would be Yogi Bear or the Powerpuff Girls. You are encoding anime; you shouldn't use cartoon mode for it.

The problem with inverse telecine on modern animation is they mix the animation with computer generated effects. It is easy to see in things like Cowboy Bebop. The animation is drawn and shot on film at 24 FPS, but then telecined and mixed with computer graphics generated at 30 FPS. Cowboy Bebop will look fine in some segments when inverse telecined, then hit a section with computer graphics and start to stutter. You see this often in the scrolling credits at the end of anime. The English credits are computer generated at 30 FPS and don't scroll smoothly when inverse telecined.

Modern animation needs variable frame rates to allow the best encoding. This is an ongoing discussion in many of the forum groups here. Matroska supports VFR, and some folks have written programs to help generate the data needed to do a VFR encode. It's very cutting edge at the moment. The other solution you see are encodes done at 120Hz. They encode the 24 FPS sections by inserting 4 dropped frames for every frame, and the 30 FPS sections by inserting 3 dropped frames for every frame. The TW Naruto encodes are done that way.

Teegedeck
23rd June 2004, 07:45
Anime is not that different from cartoons; use cartoon mode. It doesn't 'flatten' or 'smoother' your anime in a way that would make it look like a Hannah-Barbera cartoon, don't worry. It just adjusts ME's sensitivity to that kind of non-natural material. And there is no way this could create artifacts.

lordadmira
23rd June 2004, 09:15
Originally posted by Teegedeck
And there is no way this could create artifacts. I've seen it. When I tried to encode the FLCL manga sequence with cartoon mode. This sequence is black & white and consists of pans over manga panels. It left a trail of "dirt" where the line drawings had passed by. I think this is because the "background grain" of the panels was not caught by the ME when it should have, due to the threshold change. I seem to remember this being discussed in another thread. I have not seen any artifacts in other anime/ation encodes I've done.

lordadmira
23rd June 2004, 09:33
First u need to upgrade that old Xvid!!

Originally posted by helix
So if my source is already 29.97fps there should be a problem, Right? If I don't use "forced film" which takes it down to 23.976, what is the process I use to get it to come out to 23.976 in Xvid? Just use a telecine filter? I'm definitly getting interlacing artifacs so would using telecine insted of a deinterlacer give better quality?

It's not bad, but some of the scences look pretty blocky around the edges on full screen. Yeah, Virtual Dub has a decent built in IVT function and the Telecide filter is also good. But first I would try that "force film" function. If u can get rid of the telecining at the ripping stage that's ur best bet.

At 175MB per ep there's no way ur going to eliminate blockiness. That's why going to 24 fps is important. U can disable Quarter Pixel, it's just sucking up space that u need for the basic picture quality. Also increase the max I frame to 600 frames, anime can have long staticky scenes so u want to exploit those.

Another filter option u have is to try replacing the standard smoother and temporal smoother with either Smart Smoother or Temporal Cleaner. Those filters might give u better results. Noise reduction is the key since it's effect on anime is so much greater than live action.

LA

helix
23rd June 2004, 10:20
Yeah I got the new version, apparently I had it installed but the old version stayed in the virtual dub list of compressors and didn't change over. Thoes screen shots are from 23.976fps so "forced film" was enabled. I think at this point i'm not going to bother with telecine and just stick with "forced film", unless I can get sweepingly better results using telecine. About thoes filters, are they inherent to Vdub or do I have do download them? But anyway, thanks for the advice about disableing Quarter Pixel and boosting max I-frame to 600, I'll change thoes things and i'll see if I can find thoes filters and post up some new screen shots once I encode.

Soulhunter
23rd June 2004, 18:37
Originally posted by StainlessSteel
So I wonder, if attaching a medium-noise filter would decrease the color quality.For slight denoising, I prefer VagueDenoiser !!!

You could seperate its luma/chroma processing like this...

Clip=last

# Luma denoising
Clip1=Clip.VagueDenoiser( threshold=0.50, method=1, nsteps=6, chroma= false )

# Chroma denoising
Clip2=Clip.VagueDenoiser( threshold=1.00, method=1, nsteps=6, chroma= true )

Clip1.mergechroma(Clip2)

Bye

helix
23rd June 2004, 19:31
Alright, I used Smart Smoother and got the grain to go down a little bit, plus I changed thoes settings - Max I-frame to 600 and disableing Quarter Pixel. Here are the new screenshots, the quality looks slightly better. (these are using "forced film")

http://www.clanbbw.com/publicimg/data/images/lodossscreen.jpg
http://www.clanbbw.com/publicimg/data/images/lodossscreenzoom.jpg

Caspar
24th June 2004, 00:25
@lordadmira
Do you want to share some ideas on how one can deal with mouth combs in anime? I hate removing those manually. It takes me up to 3 hours per 25min Ep to clean those up. I use decomb for all my anime encodes, and I have tried setting a low vthreash with it then use kernaldeint, but the results are always bad. So what I end up doing is disable postprocessing and do the mouth combs manually...

I would be nice if there's another method to go about doing this. It is just way too time consuming.

helix
24th June 2004, 05:45
I did some googleing and came upon this http://www.doom9.org/ivtc-tut.htm

Theres a short passage on anime

"ANIME. Anime is the “I don’t get no respect” bastard child of video encoding. But it shouldn’t be. Because Anime NTSC DVDs are frequently the most difficult to IVTC properly, the greatest skill is required to work with them. As far as I know, for the best results, very few anime movies and none of the OVAs or TV series DVDs should be Force Filmed in DVD2AVI. On the other hand, almost all can be IVTC’d with good results (Neon Genesis Evangelion and Record Of Lodoss War being two possible well known exceptions). With no other kinds of DVDs do you find more strongly held opinions about which IVTC to use and at what settings. So, to avoid the issue entirely, I’ll just recommend studying the .avs carefully in VDub-Nandub before encoding. Know all the possible parameters and settings of the IVTC you choose to use and be prepared to use them. Unless the video stream is very clean, I also recommend using some kind of Deinterlacer to take care of any remaining interlacing of flapping mouths, dark areas, post creation edits, etc."

So maybe I would in fact be better off using IVTC after all. I'd like to try and see if i get anything better, problem is I don't really know how to configure it in avisynth. Should I perhaps use the one in Vdub insted?

Leak
24th June 2004, 11:00
Originally posted by Caspar
(anime mouth-combs)
I would be nice if there's another method to go about doing this. It is just way too time consuming.

Well, I've been taking a different approach here for some time:

I use KernelBob on my anime sources to up the framerate to 59.xxFPS, then I use an AviSynth function I've written (http://desdemona.ssw.uni-linz.ac.at/DBV/Software/AviSynth/MyBobs.avsi) to match every other frame to either it's previous or next frame (whatever has a lower metric based on several different luma differences) and blend those two together yielding a 29.xxFPS video again (kinda like what Telecide does, but by blending upscaled fields rather than just field matching).

This has the added bonus that you just need to tune the threshold on KernelBob (which at a value of 8 worked quite well for any anime source I've used it on yet) but none for field matching; if the match really goes awry (mostly at scene changes, or if there's really really low motion (i.e. just mouths flapping)), you'll get blended frames, which IMHO is much less annoying than combs.

Of course, you'll want to use Decimate after this to remove duplicate frames like you'd do with Telecide...

Works for me at least. Now I just have to find the time to make a proper AviSynth plugin out of it as the YPlaneMinMaxDifferences re-analyze the image everytime even though you can do it in one step per image, which would yield quite some speedup... :)

np: Phoenecia - Jpace (Brownout)

helix
25th June 2004, 15:22
Well I tried using IVTC insted of "Forced film" and I did see slightly better quality as a result. Some of the block noise and fuzziness around the lines decreased. So i'm getting pretty good looking video using Vdub's IVTC, Smart smoother and warp sharp. I am however, still seeing slight interlacing artfacts in people's mouths when they talk. I guess from what Casper and Leak said, Decomb is the best wat to go about removing the artifacts. I've never used it and when I read the directions I found it a bit to hard to understand what I needed to put in my script to do what I wanted it to. Could somebody could post a general script thats used to clean up artifacts?

Leak
25th June 2004, 22:09
Originally posted by helix
Could somebody could post a general script thats used to clean up artifacts?

Well, with Decomb alone you'd use something like

Telecide(order=1) # use order=0 if the result is way jerky
Decimate()

and tweak Telecide and Decimate settings while going through the video with show=true set for them (well, one or another, not both at once) until there's no or almost no artefacts left.

With my script I've linked to above, you just put it into your AviSynth plugin directory and then use something like

KernelBob(1,8) # first parameter is the same as order above
BlendBob(false)
Decimate()

and tweak that 8 (threshold for KernelBob) and probably some Decimate settings.

Of course, my script isn't perfect, since it doesn't take chroma into account when matching fields, which might lead to some color blotches now and then, but I hope I'll get time to fix that next month.

np: Autechre - EP7/Envane (Bogdan Raczynski Remix) (WARP 10+3 Remixes comp.)

lordadmira
26th June 2004, 14:41
Yeah the left over artifacts are a tough bugger. The way I get rid of post IVTC artifacts is by using Smart Deinterlacer in Frame&Field mode with a low/mid threshold. That should clean up the mouth artifacts and leave everything else.

There is a major drawback to using Decimate to lower the framerate, and that is that it doesn't know which frames to drop. It just drops them. This is because it doesn't know the difference between the real original frames and the junk frames. Telecide (the AVS one atleast, dunno about VDub) just unstitches the telecining, that's why u need Decimate to kill the newly made redundant frame. If the telecining sequence changes, u are now throwing away real frames and keeping junk. Like this: RRRJJ -> RRRJ. When it should be: RRRJJ -> RRRR. That's why a good adaptive IVT filter is crucial.

If that DVD is particularly dirty ur going to need a lot of filters to fix it up. Don't be afraid to crank up the smoothing, warp sharp will recover the lines for u. About resizing: the resize should always be the last filter in ur chain. U want the resizer to have the best quality image to work with. Go ahead and enable Cartoon Mode, and don't forget AQ and GMC.

If ur still not satisfied then it's time to start playing with the B frame settings. :devil: Do some experiments with no BVOPs, (Bmax/ratio/offset) 2/1/0, 8/1/0, 28/1/0, with Bsens around 30. Use the settings that give u the best results, extreme (read: non-default) B frame settings can give a dramatic quality boost or put ur encode in the toilet, it all depends on the source. If the video has a high motion compensation potential then u'll get a big boost in size/quality the more B frames there are but if the MCP is low it'll make it look worse. But anime has been known to benefit from extreme settings.

Also at some point ur going to have to decide whether ur going to go with all AviSynth or all VirtualDub filters. Not all the filters are available for both formats.

The next extreme measures u can take to try and make it look better are lowering the resolution and framerate even more. 624x464 and 608x448 will save considerable space and the visual quality will still be high. Those resolutions will save u 69 and 136 macroblocks respectively. The next option of dropping the framerate even lower to 23 or 22 fps is about the last possible resort. Even 15 fps is watchable. :D Actually if u can find out what the original cell animation framerate is u can drop it all the way to there and it will still look perfect. For instance if it was drawn at 12 fps or 18 fps. U'll have to frame through the video looking for non moving frames to find that out.

Aren't u glad u decided to start encoding anime!!

LA

PS: I was flipping back and forth between the first frame u posted and the post-filtered one and I can say u've got it looking noticably better. Needs more Warp Sharp.

helix
26th June 2004, 19:56
Thanks for that post. I'll try to grind away at it this weekend and see what I can get. I'm still quite new to whole telecide - decimate thing so it's going to be a while. Lordadmira, do you think you could do me a favor and possibly post or e-mail me your basic avisynth script? Our sources or probally of a completly different nature, but I'd just like to have a script with all the configurations for the nessisary filters already there. I'm finding it hard to "configure" the filters I myself have put there, so it would be a big help if I could have the fields for filter settings already there and just change them for my video. I'd also hate to change the frame rate and size from 640x480 and 23.96fps, except as a last resort for quality. Another thing is i'm having trouble finding where GMC is, I can't seem to find it in v1.01 under any of the tabs or config settings. But thanks again for that post, I'll work on tring to get that noise cleaned up as best I can. And yes, I'm certainly glad I started anime encoding, i'v only lost half my hair over it!

one more Q, Should I enable Trellis Quantization?

Philk15@stny.rr.com

niamh
26th June 2004, 21:09
If you really want to learn about IVTC and field order then I'd recommend you to download the decomb plugin from there (http://www.avisynth.org/warpenterprises/) and read very carefully all the docs that come with it. It's extensive...the doc by Hakko and manono et al. is compulsory as well, I think it's the one you got by googling :)
Personally I'm a big fan of the convolution3D avisynth plugin(available in the same place), I suggest you try something like
convolution3d("animeHQ") or
convolution3d("animeLQ") or even
convolution3d("animeBQ") if it's really dirty, though you will need some resharpening after :D

To learn about avisynth, you can start studying at http://www.avisynth.org or/and get apps like AVSedit that will spit out a script for you that you can study afterwards to learn faster.

I think too that you might get better results by lowering the resolution, if the output has a lowish bitrate :)

GMC is where AQ and B-vops are, clicking on the "more" tab beside profile@level (global motion compensation)
Yes , you should tick trellis no matter what, at least the majority seems to think so.

Another thing, you don't say which matrix you use(or I missed it), that can make a big difference...a matrix like Mpeg for example can turn nasty on low bitrates...and you could try custom matrices, most come bundled in the XviD folder ... there are plenty of threads about matrices :)
That's my 2 cents anyway ;)

helix
26th June 2004, 22:19
Thanks for that info on avisynth. I'm using H.263. I tried using MPEG with a CG-animimation matrix and it didn't really look all that great, so i'm sticking with H.263. Maybe I should use MPEG with another matrix? I fianlly noticed GMC. In the previous version I had, GMC was just shown as "GMC". but in v1.01 it's shown as "Global Motion Compensation" so i got a tad confused while hunting around for "GMC".

lordadmira
27th June 2004, 12:29
I'm using Virtual Dub for my filtering right now so I don't have any AviSynth scripts. VDub is better for tweaking and tinkering because of the GUI. It's a real pain with AviSynth. But once u have a "standard procedure" AviSynth is good.

I posted the Virtual Dub piece already, above. Here's the deinterlacing piece I used for encoding a music video.

VirtualDub.video.filters.Add("smart deinterlace (2.7 beta 2)");
VirtualDub.video.filters.instance[0].SetClipping(4,0,4,0);
VirtualDub.video.filters.instance[0].Config(0,0,20,100,0,0,0,0,1,0,1,1);
VirtualDub.video.filters.Add("smart smoother (1.1)");
VirtualDub.video.filters.instance[1].Config(5, 25, 0);
VirtualDub.video.filters.Add("resize");
VirtualDub.video.filters.instance[2].Config(632,480,7); Another thing about resizing, if ur cropping the video u don't need to resize to 640x480. Vertically no change is necessary, so if u cropped to 476 u can just leave it at that. Horizontally, the original (720) needs to be reduced by a factor of 1.125 to achieve the 4:3 aspect ratio. So if u crop to 715 for example 715 / 1.125 is 635.55.. or 636. U always need to round it to the nearest even number.

U should stick with the H263 matrx.

LA

helix
27th June 2004, 12:57
Oh, ok. I though you did your filtering in avisynth. Thanks for that list and the resize info.

kitanai
28th June 2004, 14:01
Ok, I see there is some speed and filter discussion going on...

I am also trying to encode an animation file.

However, encoding is VERY slow on my P4 2.8 GHz: 8fps
My DVD backups encode at 50fps(1st pass) and 24fps(2nd pass).
Is that due to all the filtering???

I use the following AviSynth script which was originally created by GordianKnot and manually modified. The source file was captured from TV.
# SOURCE
avisource("E:\noir_src.avi", pixel_type="YUY2")
Trim(1802,32450) ++ Trim(37606,43460) ++ Trim(43467,43468)
Telecide(order=1,guide=1).Decimate()

# CROPPING
crop(16,82,688,412)

Convolution3d(0, 32, 128, 16, 64, 10, 0)
FluxSmooth(7, 7)

# RESIZING
LanczosResize(560,336)

Undot()
Levels(0, 1.1, 255, 0, 255)

lordadmira
28th June 2004, 14:16
Most definately. Ur running it through 7 filters!

kitanai
28th June 2004, 17:09
How true! :D

I encoded the file without "FluxSmooth" and I get 15fps.
However it is definitely "Convolution3d" that slows the whole process down so dramatically.

But my cable signal is a little noisy, so I don't get around it :mad:

lordadmira
28th June 2004, 17:20
Same here but I just use smooth, temporal smooth, and warp sharp and I get dramatically cleaner video. Methinks ur doing a little overkill.

kitanai
28th June 2004, 17:27
Well, I surely accept suggestions:

Please tell me a little more about your filters.
But I know: temporal smooth on its own is not strong enough!

-----------

I just checked with:

Temporalsoften(4,8,8,mode=2,scenechange=10) # heavy noise

and it does the job very well.
Sorry, my overkill ;)

kitanai
28th June 2004, 22:08
As mentioned before, I still try to encode 24 min of anime.
I tried several matrices and the result was always undersized. :mad:
I aimed at 332MB, but the outcome was (incl. 23MB audio!):

CG-Anmination Matrix: 191 MB
hvs-best-picture: 219 MB
h.263: 267 MB

Settings:
B-VOBs:
max c. Bvobs : 2
Quant. ratio : 1.50
Quant. offset: 0.50

Quantization:
all mins : 2
all maxs : 31
no trellis

No GMC
No Quartel Pixel
Do you have some suggestions? :confused:

I searched the forum, and it has been asked quite a few times, but the answers don't make sense to me. And this has never happed before (well those file were always aimed at 700MB...)

thoralf
28th June 2004, 23:16
Originally posted by Koepi
Somewhat industrial. I _hate_ industrial.

Why don't you get yourself headphones? I used to do that while I was translating and proof-reading computergames. Some Aphex Twin or ambient stuff and you're all set :-)

lordadmira
29th June 2004, 00:52
Originally posted by kitanai
As mentioned before, I still try to encode 24 min of anime. I tried several matrices and the result was always undersized. :mad: I aimed at 332MB, but the outcome was (incl. 23MB audio!): Ur ape for overkill aren't ya. 332 MB is too much for a standard anime episode even at DVD resolution. 233 MB with 192 kbps audio will cover 95% of what's out there. But if u really want to suck up more space to make that size target, enable QP, GMC, Trellis, and disable BVOPs. If that's still not enough use the Fox Home Entertainment matrix. :devil:

@thoralf: Whaa???


LA

kitanai
29th June 2004, 07:17
Ok, you are probably right. ;)

I did not know, that anime would compress that good.

This might sound odd now, but where do I get the Fox Matrix? :confused:

And so I don't make the same mistake again:

I have a tape I would like to backup with XviD. It is approx. 1h long, non-anmie movie and it encodes with 680*560.
I can go to a final size of 1450MB since I want to compress with the least amount of quality loss (well, the source is already crappy enough).

Which Matrix do you recommend here?

helix
29th June 2004, 18:46
Found this thread, any opinions about it? seems like they're taking a different approach to some of the options.

http://forums.animesuki.com/printthread.php?t=1685&page=1&pp=20

lordadmira
29th June 2004, 18:57
What a useless thread. :p

LA

helix
30th June 2004, 00:57
Heh, O well. Will I be hurting anything or denying myself anything by trying some of the things they've suggested? I'm still getting a good amount of edge artifacts with my current method, so i'm open to new stuff.

lordadmira
30th June 2004, 10:16
Well from what I read it didn't seem like they really knew what they were talking about. (do we know what we're talking about? :p) Saying stuff like "don't use GMC or Trellis" is stupid. Plus that thread is old, dev-api era.

LA

helix
30th June 2004, 15:23
Yeah I noticed they were talking about v1.0. But I did try a few things that were mentioned like changing the zone values (rate control to qunatizer mode set at 3.05). I've never heard anything about the rate control before so I went ahead with altering it. I also changed some other stuff, and it didn't really look like it changed much quality wise. I'm still looking for a way to get rid of noise and such around the egdes, it looks terrible. It's getting to the point where I can no longer watch fansubbes and see the nice smooth quality and noiceless picture without getting angry at Xvid. There must be a avisynth filter for noice problems like that. Well, i'll keep working at it, it's already been quite a learning experence. And i'd of cource take your advice over thiers :D

helix
2nd July 2004, 21:36
Should either packed bitstream or closed GOV be enabled? Don't they have somthing to do with MPEG-4 compatability?

lordadmira
6th July 2004, 18:02
Playing with the zone weights won't do anything for u. Those are only for dealing with "problem areas" or other parts that should have special settings. Like if the standard rate control isn't giving enough bitage to a scene u can set a zone to increase that scene's bit bank account, either by increasing the weight or setting a low fixed quantizer. U can also use it to take away bitage from low importance scenes like credits, bumps, or intros and redistribute it to the rest of the video.

Closed GOV should always be enabled since that is a compatibility issue. It ensures that each GOP ends on a P frame and is self contained. Packed Bitstream should be enabled unless u have an issue with a standalone player. It prevents a "bug" in the VfW interface and also slightly speeds up decoding.

Here's another tip/trick. Use Ogg Vorbis audio and encode into OGM format. Vorbis is a higher quality audio codec than MP3 so u can encode the audio at a lower bitrate with the same quality. 80 kbps Vorbis should give u the same quality as 128 kbps MP3. U can then devote the saved space to the video stream. U can't encode (properly) Vorbis within Virtual Dub so u have to use OggDropXP or equivalent to encode it externally and then add it into the stream list.


LA

RadicalEd
6th July 2004, 22:35
Originally posted by lordadmira

Here's another tip/trick. Use Ogg Vorbis audio and encode into OGM format. Vorbis is a higher quality audio codec than MP3 so u can encode the audio at a lower bitrate with the same quality. 80 kbps Vorbis should give u the same quality as 128 kbps MP3. U can then devote the saved space to the video stream. U can't encode (properly) Vorbis within Virtual Dub so u have to use OggDropXP or equivalent to encode it externally and then add it into the stream list.

Here's an even better trick, use AAC and encode to MP4.
WUH OH FORMAT WARS

helix
7th July 2004, 06:59
So should I have a zone weight of 1.00, or should I just delete the zone all together?

lordadmira
7th July 2004, 14:58
1.0, u need atleast one zone so u can set B frame sensitivity and chroma.

helix
7th July 2004, 19:54
Yeah thats what I though, thanks.

helix
8th July 2004, 06:48
Well, after long last I think I 've fianlly succeded in getting a good quality file. Here are my setting as of now, let me know if theres anything I should change. Further below is the Divx DRF analyzer log to look at. This particular clip was one minute long and had a size of 6.9Mb, I was aiming for 7Mb, so it looks like I can keep it to 175Mb a full episode.


fourCC: DX50
Quantization Type: H.263
Didn't enable AQ
Didn't enable GMC

Max consecutive BVOPs: 2
Quantizer ratio: 1.50
Qualtizer offset: 0.00
Packed bitstream enabled
Closed GOV enabled

Chroma optimizer enabled
BVOP sens: 0
Max I-frame interval: 600
Use chroma motion enabled
MSP: 6-ultra high
VHQ: 4-wide search
Cartoon mode enabled

------------------------------------------------

DivX DRF Analyzer v0.9.5 Report!
File Name: D:\Lodoss ripping project\avs frameserv 2.avi
FourCC: DX50
Codec: XviD0035C
Resolution: [ Width: 640 Height: 480 ]
Frame Rate: 23.976 frames per second
The Video has 1438 frames [ 00:00:59 ]

Average Frame quality is MEDIUM [Average DRF/quantizer is 3.29]
Standard Deviation: Quality is HIGH [Std. Deviation is 0.58]
Image Resolution is HIGH

The file has Packeted Frames!

There are NO frame drops ( NO drops is better )

Recomended Resolution: [576x432] (Target DRF/quantizer=2.8)

Performance Caracteristics:
Macroblocks per frame: 1200 ( Poor Playback in Slow Computers, PIII450 or better required )
The Width is multiple of 32

Kilobits per Second: 801.06
Kilobits per Frame: 32.86
Kilobits per Macroblock: 0.027
Bits per Pixel: 0.11

Frame Type Statistics :
I Frames: 0.90%
P Frames: 65.99%
B Frames: 33.10%
S Frames: 0.00%
N Frames: 0.00%
(More Advanced Codecs use B and S frames)
Frame Quality Statistics :

DRF=1&2: 40 2.8%
DRF=3: 971 68.1%
DRF=4: 369 25.9%
DRF=5: 41 2.9%
DRF=6: 4 0.3%
DRF=7: 0 0.0%
DRF=8: 0 0.0%
DRF=9: 0 0.0%
DRF>9: 0 0.0%
KeyF/DeltaF: 0.91%
KeyDRF<4: 13
KeyDRF=4: 0
KeyDRF>4: 0

AverageKeyDRF: 2.69
MAXDRF: 6
AverageDRF: 3.29
Deviation: 0.58

lordadmira
8th July 2004, 20:02
That's good. Finally getting somewhere. Three things: Why set the FourCC to DX50? Are u planning to distribute this? If so I would change the 4CC afterwards with AVIC. I've had strange things happen when setting the 4CC inside Xvid (playback/sync issues). Maybe some insiders know what's going on with that. U should have GMC turned on unless u want it to work with current stand-alone players. GMC will save some space with the motion vectors. Hopefully in the near future the stand-alones will have full GMC support. Were u seeing extra blockiness with AQ turned on? It's not perfect yet but works reasonably well. I would leave it on unless u see artifacts from it. It'll save space u can use for basic picture quality.

LA

helix
8th July 2004, 21:27
I'm not really sure why i'm using DX50. I used alot of fansubs I had as a "template" for my encode hoping that I could obtain the same level of quality. A sharp clear looking 24 minute fansub at 140Mb seemed pretty impressive. Since I won't be distributing this, I'll just stick with DX50 I guess. I'll also try turning on GMC as well and see if I get a size decrease. AQ did tend to leave a tad more blockiness, so I decided not use it in that particular encode. I might try it with some other shows though to see if it helps any.

Thanks

Caspar
8th July 2004, 23:59
I think you will have a problem with DX50 and BVOPs: 2 with Packed bitstream enabled. The last I checked, the DivX5 decoder have problems decoding more than 1 b-frame with packed bitstream enabled.

I don't think you should enable Cartoon Mode, but that's just me.

lordadmira
9th July 2004, 01:28
If u don't need DX50 4CC for some distro/compatibility reason u should leave it at Xvid. It tells ur system what filter to use to decode the video.

helix
9th July 2004, 04:27
This thing was, it seemed like I was getting better quality when I used DX50 rather than Xvid. It really puzzeled me because when i'd check the fourCC of various fansubs I had, the fourCC would sometimes be Xvid, but still produce a perfect level of quality when played. When I used Xvid with my encode it would look blocky and parts of the picture around lines would shake. DX50 has given me pretty good results that seem to be up to par with fansubs of similar size.

lordadmira
9th July 2004, 05:30
Well all it does is tell ur system what decoder to use. It could be that u were seeing some postprocessing from the Divx filter and not from the Xvid filter. If u go into the media player properties while ur playing the video it'll tell u what Direct Show filter is being used. The new ffDshow filter is better than either of em so I'ld use that. It decodes all MPEG-4 streams. It's not surprising that u'ld be confused, installing lots of codecs can really muck up ur video system.

helix
9th July 2004, 05:39
Yeah, thats one of the reasons why it was so confusing. All the fourCC is suppost to do it specify which codec decodes the file. So why would the quality change on my file when I went from Xvid to DX50 and fansubs look the same regardless of what they have - Xvid, DX50 and Divx? Anyway, here is what is listed under the filters menu in BSplayer. I'm not sure if it's using the red or the black, (i'm assuming the red) so here is a screen shot. This is while playing my one minute encode with DX50. I do by the way have a ton of codecs installed on my computer.

http://www.clanbbw.com/publicimg/data/images/filters.jpg

lordadmira
9th July 2004, 06:12
Well like I said, the only reason they would (should) look different is the postprocessing settings in one filter vs. another. That screen shot indicates that Xvid is the filter in use. So even though u set DX50, XVid is handling that 4CC. :D Another thing u could be experiencing is a possible bug in setting the 4CC inside of Xvid. I've seen strangeness because of that. ffDshow is the best decoder right now I think.

helix
9th July 2004, 06:19
So should I uninstall Direct show and install FFDshow? Thought I had it installed already... O well. Once I do, I'll try using an Xvid fourCC and see if I get better looking video.

lordadmira
9th July 2004, 06:26
No :p ffDshow is a Direct Show video rendering filter. Like Xvid and Divx. Direct Show is the Microsoft video acceleration API.

helix
9th July 2004, 06:41
Oh... Didn't know they were the same thing. :D So, what should I do regarding fourCCs? I'm at a dead end :confused:

lordadmira
9th July 2004, 06:51
Just set it to Xvid and forget about it.

lamer_de
9th July 2004, 07:08
Fansubs used DX50 as fourcc for a long time (or are still using it) because people were too computer illiterate to install xvid or ffdshow, so that they could play it back with divx. So yes, only compatibility reasons. If you uncheck packed bistream you can use more than 1 bframe with dx50, which is reccomended, as packed bistream seems to be only causing problems for many people. But setting the fourcc to XVID ain't no bad either,after all, it's XVID and not DX50 ;)

CU,
lamer_de

helix
9th July 2004, 07:33
So I really wouldn't be "hurting" anything by using DX50, but it makes more sence to use Xvid if i'm keeping this file for myself and not distributing it. Right?

lamer_de
9th July 2004, 12:21
In my opinion, yes.

Sirber
9th July 2004, 12:29
I'm recompressing all my anime to RV10 in order to cut filesize by half or more with no significant quality loss, since I don't redistribute.

Note: Sorry to talk about realvideo in xvid thread!!! :(

Soulhunter
10th July 2004, 03:37
Originally posted by Sirber
Note: Sorry to talk about realvideo in xvid thread!!! :(
Think in your case its some sort of common law... :D


Bye

helix
10th July 2004, 06:58
Just a few questions. If I need to turn up the warpsharp which takes away alot of the detail, would it be better if I used MPEG insted of H.263? I'v heard it can help in situations like that. Another thing is that the camera pans look a tad jerky, any way to decrease that?

Note: i'm going on a damn vacation for a week, so i'll have to wait till I get back to experiment. :(

MasterYoshidino
10th July 2004, 07:45
how about a line darkening warpsharp?warpsharp(depth=50,blur=2,bump=100,cubic=-0.5)
mpeg won't make a difference in pans, thats quantization difference. using mpeg would mean less potential macroblocks in pans due to reduced compression. even better would be custom quantization and all intra be at 8 and all inter be at 16.

knight_inferno
12th July 2004, 06:04
Originally posted by helix
Well, after long last I think I 've fianlly succeded in getting a good quality file. Here are my setting as of now, let me know if theres anything I should change. Further below is the Divx DRF analyzer log to look at. This particular clip was one minute long and had a size of 6.9Mb, I was aiming for 7Mb, so it looks like I can keep it to 175Mb a full episode.


fourCC: DX50
Quantization Type: H.263
Didn't enable AQ
Didn't enable GMC

Max consecutive BVOPs: 2
Quantizer ratio: 1.50
Qualtizer offset: 0.00
Packed bitstream enabled
Closed GOV enabled

Chroma optimizer enabled
BVOP sens: 0
Max I-frame interval: 600
Use chroma motion enabled
MSP: 6-ultra high
VHQ: 4-wide search
Cartoon mode enabled


Heyas :)
Just wondering Helix, did you end up using Trellis Quantization?

I am currently encoding Gokudo (Yes it's anime) with the settings above, I don't know the end result yet :)

My AVS looks like

==================

mpeg2source("D:\01\01.d2v")

crop(14,2,692,476)

Telecide(order=1,guide=1).Decimate()

Undot()
Convolution3d("AnimeLQ")
Temporalsoften(4,4,8,mode=2,scenechange=8)
VagueDenoiser(threshold=4,method=1,nsteps=6,chroma=true,debug=false)

LanczosResize(640,480)
awarpsharp()
====================

Anyone want to pick at it? :)

helix
17th July 2004, 20:50
Yeah, I think I used Trellis Quantization.

Teegedeck
17th July 2004, 22:07
Don't use packed bitstream; it doesn't work well if you use more than 1 b-frame.

kitanai
19th July 2004, 09:46
Somewhere on my way through the Doom9 forum, I read about this phenomenon, but I cannot find it anymore :(

My anime encodings show the following blocks in almost every scene:
http://www.nt-internet.de/doom9/noir_01.jpg -> http://www.nt-internet.de/doom9/noir_02.jpg

The clip is 560x336 (I know it's not mod 32, but always worked fine before), H.263 Matrix, Cartoon flag.

Avisynth:
------------------------------------------------------------
avisource("E:\noir_src.avi", pixel_type="YUY2")
Trim(775,25181) ++ Trim(31323,43170)
crop(14,84,696,416)
FieldDeinterlace()
Temporalsoften(4,8,8,mode=2,scenechange=10) # heavy noise
LanczosResize(560,336)
Levels(0, 1.1, 255, 0, 255)
Undot()
------------------------------------------------------------

Leak
19th July 2004, 22:01
Originally posted by kitanai
The clip is 560x336 (I know it's not mod 32, but always worked fine before), H.263 Matrix, Cartoon flag.


Well, have you tried encoding a short clip without cartoon mode for comparison?

Are you using B-frames, by the way? And which version of XviD did you use?

np: Amorphous Androgynous - Rural Green (The Otherness)

helix
19th July 2004, 22:24
I wanted to ask, does using cartoon mode for older anime make a differnce in the final encode as opposed to a newer anime with CG and the like? I'm starting to think the reason why i'm getting such poor results with Xvid and lodoss is becuase of the nature of the video itself. Lodoss has pretty flat colors with little shading and CG, so i'm not sure if thats some kind of factor in getting bad quality. I though cartoon mode might be optimized for "newer" looking anime or cartoons.

Leak
20th July 2004, 00:28
Originally posted by helix
Lodoss has pretty flat colors with little shading and CG, so i'm not sure if thats some kind of factor in getting bad quality. I though cartoon mode might be optimized for "newer" looking anime or cartoons.

Well, actually cartoon mode is meant for old cartoons (and probably also stuff like the Simpsons) that have little to no gradients and well-defined high contrast boundaries...

np: Radiohead - Skttrbrain (Four Tet Remix) (Com Lag (2+2=5))

lordadmira
20th July 2004, 01:21
Speaking of Cartoon Mode, I've just encountered another artifact situation from using it. And this was on good old flat primitive 2D animation. The camera was following a bus driving down the road with trees going by. Where the black lines from the trees passed by left a trail of blackish artifacts in the green of the trees. It disappeared when I turned off Cartoon Mode. So I'm thinking that the threshold change is too strong.

LA


PS, What Cartoon Mode actually does is raise the threshold whereby the codec senses "motion". It's meant to keep noise and grain from triggering motion detection. Theoretically this will result in better looking video since the block can be carried forward without having any/as much texture applied to it. But if this happens when it shouldn't have, u get an artifact.

kitanai
20th July 2004, 07:33
I use XviD 1.0.1 from Doom9 and yes, with B-frames.

Interesting: I recall encoding the first two episodes with XviD 1.0 and the last two (which show these blocks) with XviD 1.0.1. All with the same settings and Cartoon Mode.

helix
20th July 2004, 09:09
Does using Trellis make that much of a differnce, in my case I don't think it really does anything at all. I compared the DRF/quantization average of two clips, one with Trellis and one without, and they were practically the same. :confused:

lordadmira
20th July 2004, 10:58
Trellis is one of those "incremental" quality improvements. Add up enough nickels and u'll get a dollar.


LA

haibane
21st July 2004, 19:32
Originally posted by kitanai
Somewhere on my way through the Doom9 forum, I read about this phenomenon, but I cannot find it anymore :(

My anime encodings show the following blocks in almost every scene:
http://www.nt-internet.de/doom9/noir_01.jpg -> http://www.nt-internet.de/doom9/noir_02.jpg

The clip is 560x336 (I know it's not mod 32, but always worked fine before), H.263 Matrix, Cartoon flag.

Avisynth:
------------------------------------------------------------
avisource("E:\noir_src.avi", pixel_type="YUY2")
Trim(775,25181) ++ Trim(31323,43170)
crop(14,84,696,416)
FieldDeinterlace()
Temporalsoften(4,8,8,mode=2,scenechange=10) # heavy noise
LanczosResize(560,336)
Levels(0, 1.1, 255, 0, 255)
Undot()
------------------------------------------------------------

I use to have similar problem like this, I found the cause to be the divx postprocessing filter, it seems force it to decode with xvid(change fourcc) would solve the problem for me.

It could be other reason or just the classic invert luma block thing from ages ago.

helix
22nd July 2004, 06:12
Well, I can't seem to get rid of all the block noise, my video is still looking pretty crummy. I've been playing around with B-frames, but still with no sucess, I just can't seem to get a smooth picture. I also can't get below a 3.7 quantization/DRF average. the only option I can see at this point is to increase the file size. Is there anything elts I can do?

lordadmira
23rd July 2004, 01:28
What I would probably do in this situation is crank up the preprocessing. Meaning smart smoother and temporal cleaner. Crank it up ridiculously high and see how it looks. Once I was convinced there was nothing more to gain from that I would reduce the resolution. 175MB per episode is just a stressful thing for the codec at full rez. Try some 233 MB encodes to see how they look, u might me convinced.


LA

helix
23rd July 2004, 02:40
I'm probally going to want to disable B-frames if i'm going to 233Mb right?

kitanai
23rd July 2004, 08:11
Originally posted by haibane
I use to have similar problem like this, I found the cause to be the divx postprocessing filter, it seems force it to decode with xvid(change fourcc) would solve the problem for me.

You are so right! I disabled the DivX 5 MPEP4-support and the avis play fine. (I use DivX to decode because I am still waiting for the brightness slider to reappear in XviD ;) )

Teegedeck
23rd July 2004, 08:15
Originally posted by helix
I'm probally going to want to disable B-frames if i'm going to 233Mb right?
Why would you want to do that? You were trying to bring the average p-frame quantizer down, weren't you?

BTW, I don't know DRF-analyzer. Are you sure the 3.7 average quant you get aren't weighing b-frame quantizers, too?

helix
23rd July 2004, 08:29
Yeah, i'm almost positive it looks at them too, the b-frame quantizers that is. I was wondering whether or not to disable b-frames becuase I though that b-frames improved compression but degraded quality. So by raising the file size I was "ignoring" compression and could then disable b-frames and get that much bigger of a quality boost. But I guess now i'll trying using them and see if I can't get the DRF average lower. I tried 233mb and was getting a DRF average of 3.4, so not a big change.

unmei
23rd July 2004, 09:14
If this average Quant from DRF-Analyzer includes B-frames (what i think, else it wouldnt make much sense) it is not surprising you seemingly cant get it any lower at least if you use default / close to default B-frame settings. It is at lowest Q2 for P and Q4 for B, and with anime you have lots of b-frames often even 2 consecutive. This gives you 50-67% B-frames with 50% the lowest you can get is Quant 3, the same as in the first pass, with 67% it is even at least 3.3.

But what scares you about that? I always thought anime encoding people are funny (no offense!) i encode almost exclusively anime but most of the time i have average quantisers ranging from 3.5 to 6(!) Now i wouldn't dare to say these are top encodes, but they are very watchable and imo still not inferior to *cough* AX *cough* or *cough* a4e *cough* and similar encodes. After all it is a matter of taste, and i DO prefer a block you notice in freeze-frame but not in motion over a overfiltered but block-free encode (else i would also be using Real-Video or VP6 and not Xvid). Finally i encode PAL DVD episodes unresized to 170mb and i don't think this is so stressful for the encoder ..great expression lordadmira btw :).

Teegedeck
23rd July 2004, 10:51
My thoughts exactly. :)

lordadmira
23rd July 2004, 12:28
Originally posted by helix
I was wondering whether or not to disable b-frames becuase I though that b-frames improved compression but degraded quality. So by raising the file size I was "ignoring" compression and could then disable b-frames and get that much bigger of a quality boost. Sort of. By going to 233 MB u can now "afford" to use all P frames. IMHO no BVOPs will always look better than with BVOPs when u have enough breathing room. When I encode an Inuyasha ep at 233 MB and 192 kbps audio the quantizer usually comes out to about 3. Some 2's some 4's but vastly mostly 3's. Honestly I think they look even better without BVOPs than they ever did with BVOPs. Think of B frames as "decreasing the quality drop" from higher compression, not "increasing quality". For the DRF thing, I think u need to consider average P quants and average B quants seperately since they are so different.


LA

helix
23rd July 2004, 23:40
Originally posted by unmei
But what scares you about that? I always thought anime encoding people are funny (no offense!) i encode almost exclusively anime but most of the time i have average quantisers ranging from 3.5 to 6(!) Now i wouldn't dare to say these are top encodes, but they are very watchable and imo still not inferior to *cough* AX *cough* or *cough* a4e *cough* and similar encodes. After all it is a matter of taste, and i DO prefer a block you notice in freeze-frame but not in motion over a overfiltered but block-free encode (else i would also be using Real-Video or VP6 and not Xvid). Finally i encode PAL DVD episodes unresized to 170mb and i don't think this is so stressful for the encoder ..great expression lordadmira btw :).

The thing that eventually annoys me into trying to get around a 3 quantizer encode is alot of the fansubs I have, like I said before. I just can't seem to figure out how they get these 160Mb files with quantizers of 3.2 and still get excellent picture quality without vitually any block noise. It's mind numbing to think of how they do it. Plus, i'm comming from a DVD source, granted not one with supurb quality, but still a DVD source. Block noise for me is seeming to be one of the hardest things to eliminate from my encodes, I was almost sure that at 175Mb and 640x480 that I could get a pretty smooth looking video file. I wish I could talk to someone who's done lodoss into Xvid before so I could see if thier getting they same results as I am, and what I can do to make it better. Well, I guess i'll just keep playing around with BVOPs and prefiltering and hope I get a good looking file with a decent quantizer average. Thanks for the recent comments though :) .

lordadmira
25th July 2004, 11:38
My bet is that they're using strong filtering and crystal clean sources. Anime can be filtered to extremes and still look good. U can't do that with live stuff.

unmei
25th July 2004, 13:27
Yes fansubs, at least most, are something completely different since they are made from noisy TV captures. Of course there is a lot of filtering involved there, probably no way around that - but still there are those that look more overfiltered than others :)
If the sources were crystal clear, no filtering at all were necessary..


Some 2's some 4's but vastly mostly 3's
I'm pretty convinced a vanilla encode with P-Quant ~2 and B-Quant ~4 would look better in my eyes. And this is what you would get with B-frames (when a P-only turns out to be ~3).
Alone by the simple fact that the vanilla one would have all frames referring Quant 2 P-frames, while the P-only one would have P-frames referring Quant 3 P-frames.
Actually the vanilla encode were almost certainly 'undersized', but that's not my point.

lordadmira
25th July 2004, 13:59
I'm starting to think that B frames aren't so great for anime as they are for live. In clean anime all the motion is simple. So simple that essentially all the motion can be captured by P -> P ME on almost every frame. This is because anime is fundamentally made up of static backgrounds and sprites. I think everyone will agree that Xvid's current BVOPs were designed for live material. And on anime the frame mean quantizer can be especially deceptive. An I frame at quant 2 will propagate *a lot* of blocks through to the P frames with mean quants of 3 and 4, even all the way to the end of the GOP. I wish there was some block based analyzer tool.

LA

Teegedeck
25th July 2004, 14:08
Hm. What makes you think that b-frames aren't good for 'simple' motion? B-frames do a fantastic jobs on compressing end-credits, and I cannot think of any motion simpler than that...

lordadmira
25th July 2004, 14:57
I think it's because a BVOP is overkill for just relocating blocks virtually unchanged. It's like using a 747 for going to the corner store. Recent tests (ahem) have pretty much proved that BVOPs are no good without higher quants. And when I did the Inuyasha test the no BVOP encode just blew away everything else so totally that I think it would even beat a default BVOP encode on quality:size. As for credits, that's a whole nother ballgame with anime. Anime rarely has scrolling credits over black like movies. They have "ending sequences" which are just like the main part of the program except with credits and a catchy tune playing in the background. ;)

LA

Teegedeck
25th July 2004, 15:23
Ah; then I understand your findings. You still use that offset=1, ratio=1 setting, don't you? I thought we had that discussion. Use the default setting or if you cannot bring yourself to that don't use b-frames at all.

BTW, b-frames are no overkill, unchanged blocks will be skipped, as usual...

lordadmira
25th July 2004, 16:32
I'm just saying BVOPs don't give u the kind of pay offs with anime as they do with live action, no matter what their settings are. Simply because they were made for live stuff. I held the "skipped block" argument too, but the tests just don't hold up.

unmei
25th July 2004, 17:04
http://www.hta-bi.bfh.ch/~seilf/doom9/quant_p3.png
http://www.hta-bi.bfh.ch/~seilf/doom9/quant_p2q4.png
this is what i think..

helix
28th July 2004, 08:31
Well, I think i've found why Lodoss was looking so bad. What I did was take another DVD rip, one that was excellent quality, and encode it with the same settings that I had Lodoss on. The resulting video was of a much better quality than any of my other Lodoss encodes were. This test was sort of a confirmation that the DVD source itself was causing the bad quality and not Xvid like I had somewhat suspected. If only I had done this test sooner and saved myself loads of time. The problem is that theres nothing I can do about the DVD source, and adding more filters just seems to make it look worse. I guess the saying "crap in, crap out" holds true in this case. Here's a screen shot of the unfilted DVD source of Lodoss so you can see how bad it is.

http://www.imagepit.com/uploaded/lodoos-b0328088.jpg