int ReadNext(BitStreamCtxRL ctx) { if (ctx.run_len > 0) { ctx.run_len--; return 1; } int d = Coder.Decode (this.Stream, ctx); if (d == 1) { ctx.run_len = Coder.Decode (this.Stream, ctx) - 1; } return d; }