OUTPinged_
22nd June 2003, 10:59
Yesterday my encode got 0wned by overflow. Basically it was getting too high quantizer values (going up to 17 with average at 4 and pretty strict alt.cc settings that shouldnt be allowing to jump over 10) at second pass so i begun looking at why does that happen. Switching to default settings (bitrate excluding) didn't help it. Duh.
For some reason the resulting framesize wasnt anywhere close to "scaled" in debug, and overhead of about -20 to -30 kbytes was appearing at "large frame" portions of the video. It wouldnt be anything special but for some strange reason codec wanted to compensate them right now and at once. So overhead was scaling to low positives too fast, producing quantizers that had little relation to CC settings.
Bad.
Settings: XviD-14052003-1 by Koepi (latest and greatest,:-/ ), encoding with no qpel/bframes/gmc, alt.cc is off(so that "no-alt.cc" dudes could check that too). h263, me=6, vhq=0, chroma_opt and trellis are off. CC settings: high=0, low=0, payback=250(default), bonus=proportional.
Now we are supposed to get encode with quantizers pretty close to average, right? Wrong! Look at debug:
[1012] 2nd-pass: quant:6 H.263 inter stats1:5542 scaled:2612 actual:1974 overflow:-8390 movie
[1012] 2nd-pass: quant:5 H.263 inter stats1:5463 scaled:2575 actual:2947 overflow:-8809 movie
[1012] 2nd-pass: quant:3 H.263 intra stats1:64289 scaled:40313 actual:51756 overflow:-8885 movie
[1012] 2nd-pass: quant:2 H.263 inter stats1:169 scaled:161 actual:2699 overflow:-11689 movie
[1012] P-frame quantizer prevented from rising too steeply
[1012] 2nd-pass: quant:4 H.263 inter stats1:55181 scaled:26016 actual:36329 overflow:-22268 movie
[1012] P-frame quantizer prevented from rising too steeply
[1012] 2nd-pass: quant:6 H.263 inter stats1:52059 scaled:24545 actual:20493 overflow:-18482 movie
[1012] 2nd-pass: quant:8 H.263 inter stats1:50403 scaled:23764 actual:16224 overflow:-11208 movie
[1012] 2nd-pass: quant:6 H.263 inter stats1:49303 scaled:23245 actual:22972 overflow:-11201 movie
[1012] 2nd-pass: quant:6 H.263 inter stats1:52980 scaled:24979 actual:20200 overflow:-6688 movie
[1012] 2nd-pass: quant:6 H.263 inter stats1:63462 scaled:29920 actual:26250 overflow:-3284 movie
Looks wierd. Here we can see quant4 frame deviating 28% from "scaled" size and quant8 frame that gets hit by overflow too much, too.
2-8 range with 0/0 cc :/ It only gets worse if i bump up cc settings. Increasing payback interval didnt help things a tiny bit. Only by decreasing "maximum overflow improvement/degradation" values to 10, i get a more tolerable behaviour.
like this
[1012] 2nd-pass: quant:4 H.263 inter stats1:64259 scaled:30296 actual:38736 overflow:-153598 movie
[1012] 2nd-pass: quant:4 H.263 inter stats1:79938 scaled:37688 actual:50226 overflow:-166381 movie
[1012] 2nd-pass: quant:4 H.263 inter stats1:75400 scaled:35549 actual:44537 overflow:-175614 movie
[1012] 2nd-pass: quant:5 H.263 inter stats1:73478 scaled:34642 actual:37420 overflow:-178637 movie
[1012] 2nd-pass: quant:4 H.263 inter stats1:60487 scaled:28518 actual:37141 overflow:-187505 movie
Why does "actual" framesize differ from "scaled" that much? why are frames being hit by overflow that hard? in "quant8 frame" case it was 22kb to compensate over 250 frames - less than 100bytes/frame. That shouldnt even have shifted quantizer by 1 only due to overflow. Why does this happen? Could it be that rate control got messed up? Maybe overflow control is?
For some reason the resulting framesize wasnt anywhere close to "scaled" in debug, and overhead of about -20 to -30 kbytes was appearing at "large frame" portions of the video. It wouldnt be anything special but for some strange reason codec wanted to compensate them right now and at once. So overhead was scaling to low positives too fast, producing quantizers that had little relation to CC settings.
Bad.
Settings: XviD-14052003-1 by Koepi (latest and greatest,:-/ ), encoding with no qpel/bframes/gmc, alt.cc is off(so that "no-alt.cc" dudes could check that too). h263, me=6, vhq=0, chroma_opt and trellis are off. CC settings: high=0, low=0, payback=250(default), bonus=proportional.
Now we are supposed to get encode with quantizers pretty close to average, right? Wrong! Look at debug:
[1012] 2nd-pass: quant:6 H.263 inter stats1:5542 scaled:2612 actual:1974 overflow:-8390 movie
[1012] 2nd-pass: quant:5 H.263 inter stats1:5463 scaled:2575 actual:2947 overflow:-8809 movie
[1012] 2nd-pass: quant:3 H.263 intra stats1:64289 scaled:40313 actual:51756 overflow:-8885 movie
[1012] 2nd-pass: quant:2 H.263 inter stats1:169 scaled:161 actual:2699 overflow:-11689 movie
[1012] P-frame quantizer prevented from rising too steeply
[1012] 2nd-pass: quant:4 H.263 inter stats1:55181 scaled:26016 actual:36329 overflow:-22268 movie
[1012] P-frame quantizer prevented from rising too steeply
[1012] 2nd-pass: quant:6 H.263 inter stats1:52059 scaled:24545 actual:20493 overflow:-18482 movie
[1012] 2nd-pass: quant:8 H.263 inter stats1:50403 scaled:23764 actual:16224 overflow:-11208 movie
[1012] 2nd-pass: quant:6 H.263 inter stats1:49303 scaled:23245 actual:22972 overflow:-11201 movie
[1012] 2nd-pass: quant:6 H.263 inter stats1:52980 scaled:24979 actual:20200 overflow:-6688 movie
[1012] 2nd-pass: quant:6 H.263 inter stats1:63462 scaled:29920 actual:26250 overflow:-3284 movie
Looks wierd. Here we can see quant4 frame deviating 28% from "scaled" size and quant8 frame that gets hit by overflow too much, too.
2-8 range with 0/0 cc :/ It only gets worse if i bump up cc settings. Increasing payback interval didnt help things a tiny bit. Only by decreasing "maximum overflow improvement/degradation" values to 10, i get a more tolerable behaviour.
like this
[1012] 2nd-pass: quant:4 H.263 inter stats1:64259 scaled:30296 actual:38736 overflow:-153598 movie
[1012] 2nd-pass: quant:4 H.263 inter stats1:79938 scaled:37688 actual:50226 overflow:-166381 movie
[1012] 2nd-pass: quant:4 H.263 inter stats1:75400 scaled:35549 actual:44537 overflow:-175614 movie
[1012] 2nd-pass: quant:5 H.263 inter stats1:73478 scaled:34642 actual:37420 overflow:-178637 movie
[1012] 2nd-pass: quant:4 H.263 inter stats1:60487 scaled:28518 actual:37141 overflow:-187505 movie
Why does "actual" framesize differ from "scaled" that much? why are frames being hit by overflow that hard? in "quant8 frame" case it was 22kb to compensate over 250 frames - less than 100bytes/frame. That shouldnt even have shifted quantizer by 1 only due to overflow. Why does this happen? Could it be that rate control got messed up? Maybe overflow control is?