View Full Version : Macroblock size? Best resolution divisible by?
JimiK
4th July 2003, 12:36
I've got some questions about macroblocks (MBs) and resolutions (res). IIRC, your resolution should be at least be divisible by 8. The compressibilty gets up when you choose a res, divisible by 16 or even 32. Teegedeck posted in the Newbie forum, that the size (width and heigth) of a single macroblock gets bigger when you can divide the res by 16 instead of 8. Now I wonder if it's always better to have big MBs. Sometimes they get compressed so heavy, that every pixel in this block has the same color. That's when you see these blocks in the blue sky. Now with smaller blocks I think this wouldn't be that obvious. Or is it less likely that a big blocks gets one single color, because of a "higher diversity" in the block? Or is it just better, because even if there is a disadvantage with bigger blocks, it would be made up by a higher compressibilty. Maybe I did not think far enough. Maybe you won't even understand what I'm trying to say (that happens often even to me, even when I'm talking german).
Best regards,
JimiK
Teegedeck
4th July 2003, 14:53
Hm, I think MPEG-4 macroblocks can be either 16x16 or 8x8 but AFAIK accuracy doesn't suffer from a divisible-by-16-resolution; XviD should just describe motion for the 4 8x8-sized macroblocks, that a 16x16 macroblock consists of, separately if the vectors aren't the same for all of them. Or so I believe. :)
trbarry
4th July 2003, 16:11
Xvid used to do some screwy things with green stripes if the size was not a multiple of 16. Dunno if that's true anymore.
- Tom
sysKin
4th July 2003, 16:43
Macroblocks are 16x16. Mod 16 is the best resolution.
Mod 32 will not help more than that.
XviD can handle any mod 2 res.
Radek
OUTPinged_
7th July 2003, 12:43
@sysKin:
Large amount of old videocards cant use overlay to display video that is not mod32 width - that is where "use mod32" comes from.
hellgauss
7th July 2003, 12:57
AFAIK i think that horizontal resolution should be mod32, while vertical res should be mod16.
I had some problems if the horizontal res is only mod16, since sometimaes it appears a green horizontal flashing line in the bottom of the video. (I have a nvidia geforce4 440 go)
I have no problem if vertical res is mod16 but not mod32.
BoNz1
10th July 2003, 06:12
Originally posted by trbarry
Xvid used to do some screwy things with green stripes if the size was not a multiple of 16. Dunno if that's true anymore.
- Tom
Looks like it may still have some problems with this kind of thing. http://www.geocities.com/bonzi5252/grab00250.JPG what you can't see in this screenshot is that there is a green stripe at the bottom of the screen. I am decoding with ffdshow with XviD idct, my graphics card is a Geforce 2 MX 400. As you can see the resolution is 716x356, mod 4. Possibly though, it could be a decoder problem I am not sure. I don't want to rush anyone to fix it, it certainly is not a rush for me, I just wanted to encode a small clip to see if this was still a problem.
EDIT: I should also probably show you guys the source, though I think you know what the problem is, http://www.geocities.com/bonzi5252/grab00250source.JPG
EDIT 2: Guess, I should give all my settings too, huh? ;) Here we go, it was a 2 pass encode aiming for a size of 20480KB using Umaniac's build from the 26th:
Motion Search Precision 6
Mpeg quants
VHQ 4
Max I-frame 240
Min I-frame 1
Qpel checked
Chroma Motion checked
B-frames 2,150,75
Playback with bias
The rest were defaults
And the avisynth script:
LoadPlugin("C:\Video\Avisynth Plugins\Mpeg2Dec3.dll")
Mpeg2Source("C:\DIEANOTHERDAY_DISC1\VIDEO_TS\Die Another Day.d2v",idct=5)
Trim(184518,0)
crop(2,60,716,356)
BoNz1
12th July 2003, 07:22
Just tried encoding a movie with the width mod 8 and height mod 4, all is good in a the little 1000 test frames when decoding. So time to make a gigantic anamorphic video, ;)
Koepi
12th July 2003, 08:31
I had "green lines" and stuff when i was cropping to non-mod-4 resolutions and working with the filters on that in avisynth 2.5.
You have to respect the limits of the avisynth filters in your AVS, else the errors may come from there.
Regards
Koepi
trbarry
12th July 2003, 15:35
This is complicated by YV12 processing where non mod 2 horizontal resolutions are not even valid data. And with interlaced YV12 you need a mod 4 vertical resolution and also have to top crop mod 4.
That's not just an Avisynth restriction but the nature of the data. Though I think Sh0dan has put in a number of checks and fixes in that area.
- Tom
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.