[XviD-devel] Z-frames

Marc FD xvid-devel@xvid.org
Wed, 24 Jul 2002 18:15:46 +0200


> over the weekend i added frame dropping support to xvidcore. there is an
> extra 'frame_drop_ratio' field in XVID_ENC_PARAM which is only included
when
> #def BFRAMES. pframes are dropped if the number of ublks (dropped/skipped
> macroblocks) exceeds the given ratio. to disable frame dropping, simply
set
> frame_drop_ratio to zero.
>
> dropped frames decode correctly with divx 5.02 and the msfdam decoders.
>
> however divx v4.02 displays some nasty artifacts; i think it ignores the
> "not_coded" field. 4.02 is the most recent v4 divx to work on my pc. the
> problem may well be fixed in 4.11/4.12.
>
> -- pete

I tested it :

Log of a basic test : frame 170 is freezed. (see log at eof)
XivD CVS 22.07.2002 used (DEBUG,BFRAMES)
frame drop ratio used : 1 / 1st pass only.

The problem is that i seems that there is some inertia in the MC so frames
#171-186 (who are bit2bit 100% equal to #170)
have mblocks. frame_drop_ratio is set to 1 so when the mblock number is
beyound (720*1)/100 the frame is dropped.
see frames #187-188-189
It's a VERY big problem because the Z-frames should be dropped IMMEDIATLY,
because there are between P-frames :
there are IZPZPZPZ or IZZPZZPZZ rows. but a Z-frames after just after a
P-frame is NOT recognised : See
frame 171 : it's 2000% oversized... (it's 2086 bytes big. and it could be
only 10 bytes big )
I think the best way to fix it is too make a raw bit2bit comparaison between
frame in encoding (with early-stop)
so Z-frames could be recognised and it would not slow the encode. I think
the actual approach is not the best :
There should be a way to drop ONLY perfect 0-frames (with
frame_drop_ratio=0)
I think if the Z-frame is tested before MC, it could even speed the encode
(2x in some scenes :)

And higher frame_drop_ratio are really not the solution because they drop
the bad frames. the MC inertia make
the frame_drop_ratio "mess" the real Z-frames (created by my filter)

But i must say i look very promising for animes. And my filter is now very
good (about 100% accurate :)
It's so powerfull that i think i could even have an undersized file satured
at quant 2 with a 1h40 anime !!!
I will compare it with RV when a clean Z-frame dropping will be implemented.
I think the "last" advantage
of realvideo will be blow away with Z-frames....

PS : I don't know the MPEG-4 specs. the GMC could not use Z-frames to make
some interpolation and give
even a bit smooth movement to such frames ?? It would really be a must for
Low-Bitrate encodes (and even HQ)

B-frames and Z-frames in the meantime... I eager to see that..

Log here :

00000160 21.79027418 [988] 1st-pass: size:52960 total-kbytes:51 intra
quant:2 MPEG kblocks:720 mblocks:0
00000161 21.89031902 [988] 1st-pass: size:4267 total-kbytes:55 inter quant:2
MPEG kblocks:0 mblocks:682
00000162 21.92435659 [988] 1st-pass: size:5514 total-kbytes:61 inter quant:2
MPEG kblocks:0 mblocks:703
00000163 21.98481371 [988] 1st-pass: size:18822 total-kbytes:79 inter
quant:2 MPEG kblocks:17 mblocks:668
00000164 22.06359775 [988] 1st-pass: size:6238 total-kbytes:85 inter quant:2
MPEG kblocks:0 mblocks:704
00000165 22.12148667 [988] 1st-pass: size:6863 total-kbytes:92 inter quant:2
MPEG kblocks:0 mblocks:712
00000166 22.19747622 [988] 1st-pass: size:20014 total-kbytes:111 inter
quant:2 MPEG kblocks:14 mblocks:688
00000167 22.25709888 [988] 1st-pass: size:6460 total-kbytes:118 inter
quant:2 MPEG kblocks:0 mblocks:701
00000168 22.31746577 [988] 1st-pass: size:6088 total-kbytes:124 inter
quant:2 MPEG kblocks:0 mblocks:703
00000169 22.38763614 [988] 1st-pass: size:18106 total-kbytes:141 inter
quant:2 MPEG kblocks:5 mblocks:680

>> 00000170 22.61681582 [988] 1st-pass: size:36839 total-kbytes:177 inter
quant:2 MPEG kblocks:137 mblocks:583
00000171 22.72913513 [988] 1st-pass: size:2086 total-kbytes:179 inter
quant:2 MPEG kblocks:0 mblocks:572
00000172 22.74724162 [988] 1st-pass: size:888 total-kbytes:180 inter quant:2
MPEG kblocks:0 mblocks:317
00000173 22.78446311 [988] 1st-pass: size:587 total-kbytes:181 inter quant:2
MPEG kblocks:0 mblocks:230
00000174 22.81494380 [988] 1st-pass: size:512 total-kbytes:181 inter quant:2
MPEG kblocks:0 mblocks:206
00000175 22.84571670 [988] 1st-pass: size:377 total-kbytes:182 inter quant:2
MPEG kblocks:0 mblocks:153
00000176 22.88544606 [988] 1st-pass: size:384 total-kbytes:182 inter quant:2
MPEG kblocks:0 mblocks:157
00000177 22.91571946 [988] 1st-pass: size:323 total-kbytes:182 inter quant:2
MPEG kblocks:0 mblocks:131
00000178 22.95693168 [988] 1st-pass: size:315 total-kbytes:183 inter quant:2
MPEG kblocks:0 mblocks:125
00000179 23.01569250 [988] 1st-pass: size:271 total-kbytes:183 inter quant:2
MPEG kblocks:0 mblocks:102
00000180 23.07482040 [988] 1st-pass: size:259 total-kbytes:183 inter quant:2
MPEG kblocks:0 mblocks:94
00000181 23.13862935 [988] 1st-pass: size:207 total-kbytes:183 inter quant:2
MPEG kblocks:0 mblocks:66
00000182 23.18886842 [988] 1st-pass: size:210 total-kbytes:184 inter quant:2
MPEG kblocks:0 mblocks:65
00000183 23.23929801 [988] 1st-pass: size:194 total-kbytes:184 inter quant:2
MPEG kblocks:0 mblocks:55
00000184 23.29926513 [988] 1st-pass: size:181 total-kbytes:184 inter quant:2
MPEG kblocks:0 mblocks:48
00000185 23.34887702 [988] 1st-pass: size:141 total-kbytes:184 inter quant:2
MPEG kblocks:0 mblocks:24
00000186 23.40778646 [988] 1st-pass: size:126 total-kbytes:184 inter quant:2
MPEG kblocks:0 mblocks:16
00000187 23.46993598 [988] 1st-pass: size:10 total-kbytes:184 inter quant:2
MPEG kblocks:0 mblocks:0
00000188 23.50039321 [988] 1st-pass: size:118 total-kbytes:184 inter quant:2
MPEG kblocks:0 mblocks:9
00000189 23.55996949 [988] 1st-pass: size:115 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:8
00000190 23.63514246 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000191 23.66692946 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000192 23.69938889 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000193 23.73113426 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000194 23.76267598 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000195 23.79514100 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000196 23.82718614 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000197 23.85900638 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000198 23.89053860 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000199 23.92300250 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0
00000200 23.95498897 [988] 1st-pass: size:10 total-kbytes:185 inter quant:2
MPEG kblocks:0 mblocks:0