Log in

View Full Version : Direct YV12 compression and compressibility


FunMan
24th November 2002, 16:05
Hi,

I'm using the last Koepi XviD release 21112002-1 and I'm making some tests in order to notice differencies between stable and development XviD version and "direct YV12" compression, in terms of compressibility and so, fixing a target container size, in order to enstabilish wich can archieve the best quality. I'm using to do it a small piece of movie (1000 frames from the Queen "Freddie Mercury Tribute Concert", track 06, 'cause this source is very hard to compress).

With the stable version, with firts pass at fixed quant of 2, I obtained a file of 11 Mb

With the development version, enabling Qpel, croma motion and b-frame (4/125) I obtained a file of 8 Mb, with the same visual quality. Great! And infact yesterday I made all the 1st time of the concert I sayd (660 mb video data) and it's ok.

Now, today watching the forum I read a thread about direct YV12 compression with XviD, so I downloaded Avysynth 2.5, VirtualDubMod and all the new YV12 plugin I use, such as Mpeg2Dec3.dll, UnFilter.dll and other. I ran the same test (obviously updating all the plugins) and........ (negative) surpise! the file is 11 Mb!!! So it seems that using YV12 the source is less compressible! I disabled qPel, bframe and croma and I obtained a file of 13 Mb! 2 Mb bigger than using YUV....... And 2 Mb on a small piece of movie of 1000 frames @ 25 fps is not little.....:/

Any idea about this?

The script I used is the same

<_script_>
LoadPlugin("C:\PROGRA~1\GORDIA~1\yv12\mpeg2dec3.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\yv12\UnFilter.dll")

mpeg2source("C:\CD da lavorare\Concerto Queen\test\2\1.d2v",cpu=0,idct=4)
trim(0,1000)
LumaFilter() # for macroblock in dark area, default is -2, 1
UnFilter(5,5)

crop(15,14,694,551)
LanczosResize(528,288)
</_script_>

Thanks in advance,
FunMan

FunMan
24th November 2002, 21:19
These are results of the 1st pass of the test I said above, read with StatReader

Stable version -> 1367 Mb
Dev version with bframe -> 1246 Mb
Dev version with bframe YV12 -> 1437 Mb

Using YV12 decrease compressibility!!!

Can anybody do a similar test?
Is necessary to follow particular settings in order to compress using YV12?

FunMan

trbarry
24th November 2002, 21:44
You might want to test with the minimum filters to see what is happening. But I can see some possible explanations.

1) You probably have a bit more chroma detail using YV12 because some would be lost in the conversion to YUY2. But that is extra info that might be harder to compress.

2) UnFilter also sharpens chroma for YV12 but not for YUY2. And it is new so there may be a bug. (at least one)

3) Your strange cropping numbers will be rounded somehow by Avisynth but possibly differently for YV12. Why don't you try it with all multiples of 4.

4) Try with and without Force Film (or TomsMoComp) to see if it is related to handing of interlace.

5) Something else is broke. ;)

- Tom

FunMan
24th November 2002, 22:00
1) You probably have a bit more chroma detail using YV12 because some would be lost in the conversion to YUY2. But that is extra info that might be harder to compress.


This is possible, infact seems that YV12 is more brilliant then YUV...... this could be.......:)


2) UnFilter also sharpens chroma for YV12 but not for YUY2. And it is new so there may be a bug. (at least one)


I'll try smoothing and not sharpening........


3) Your strange cropping numbers will be rounded somehow by Avisynth but possibly differently for YV12. Why don't you try it with all multiples of 4.


The final output (after the resize) is multiple of 16, so is also multiple of 4. I knew that the ouput have to be multiple of 4......also the "stream" in the process?


4) Try with and without Force Film (or TomsMoComp) to see if it is related to handing of interlace.


It's PAL content, not NTSC/FILM........

FunMan

trbarry
25th November 2002, 07:09
he final output (after the resize) is multiple of 16, so is also multiple of 4. I knew that the ouput have to be multiple of 4......also the "stream" in the process?

I don't remember how Sh0dan said he finally implemented it but I know there is only 1 chroma pixel horizontally for every 2 luma pixels. So if you say you want to crop horizontally at 13 pixels Avisynth will either have to give an error, interpolate something, or round/truncate to at least an even number. In YV12 this is also true for vertical cropping, and may not have exactly the same rules as for YUY2. That's why I suggested trying it with a multiple of 4 so you don't have to second guess what Avisynth is helpfully doing.

It's PAL content, not NTSC/FILM........

Pal content can still be subject to interlace or telecining. For instance, GreedyHMA can handle both, though not yet for YV12. And even more importantly Pal content can be stored in 2 fields, changing how any color conversions are done in YV12. You may be able to see the difference by throwing in an AssumeFrameBased statement, though hopefully no conversions are being done anyway except maybe in Vdub preview mode.

You could probably devise tests for all of these things if you wanted it bad enough. ;)

- Tom

FunMan
25th November 2002, 12:03
@trbarry,

first of all thanks for your replies.....Now I'm at work and cannot do any test but at home I think I'll do some......)

Anyway, yesterday I made other tests, on a little little piece of the same source (2000 frames). Using AviSynth 2.0.6 (YUV) I obtained 19 Mb in first pass stat file. Using AviSynth 2.5 alpha (YV12) I obtained 21 Mb. Using UnDot and UnFilter(-5,-5) the size was 20 Mb, similar to 19. Now I would try Convolution3D (if I find it!! I followed the link in YV12 but..... where is the software?)....

How can I increase compressibility (and so, fixing target size, quality) not reducing quality? How good is Convolution3D?

Thanks,

FunMan

HarryM
25th November 2002, 14:18
Originally posted by FunMan

How can I increase compressibility (and so, fixing target size, quality) not reducing quality? How good is Convolution3D?

Thanks,

FunMan [/B]

Convolution3D increase compressibility about 3-10% at 'movieHQ' predefined setting.

I dont recommend to use Convolution3D at movies with very soft look, it is blurrible.

Wilbert
26th November 2002, 17:27
Now I would try Convolution3D (if I find it!! I followed the link in YV12 but..... where is the software?)....
AviSynth --> YV12 faq --> YV12 plugins --> Convolution3dYV12 --> the last post of Vlad59 on that page (page 4, attachment)