private void xingSeekTable(VBRSeekInfo v, sbyte[] t) { if (v.pos <= 0) { return; } for (var i = 1; i < NUMTOCENTRIES; ++i) { float j = i / (float)NUMTOCENTRIES, act, sum; var indx = (int)Math.Floor(j * v.pos); if (indx > v.pos - 1) { indx = v.pos - 1; } act = v.bag[indx]; sum = v.sum; var seek_point = (int)(256.0 * act / sum); if (seek_point > 255) { seek_point = 255; } t[i] = (sbyte)seek_point; } }
/// <summary> /// ********************************************************************* /// Robert Hegemann 2001-01-17 /// ********************************************************************** /// </summary> private void addVbr(VBRSeekInfo v, int bitrate) { v.nVbrNumFrames++; v.sum += bitrate; v.seen++; if (v.seen < v.want) { return; } if (v.pos < v.size) { v.bag[v.pos] = v.sum; v.pos++; v.seen = 0; } if (v.pos == v.size) { for (var i = 1; i < v.size; i += 2) { v.bag[i / 2] = v.bag[i]; } v.want *= 2; v.pos /= 2; } }