Chen-tao / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

Decoder can't read zero delta-q correctly #610

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Encoder writes delta-q value in the following way:

static void write_delta_q(struct vp9_write_bit_buffer *wb, int delta_q) {
  if (delta_q != 0) {
    vp9_wb_write_bit(wb, 1);
    vp9_wb_write_literal(wb, abs(delta_q), 4);
    vp9_wb_write_bit(wb, delta_q < 0);
  } else {
    vp9_wb_write_bit(wb, 0);
  }
}

But decoder doesn't handle the case when delta_q == 0 and uses some garbage 
value instead:

static int read_delta_q(struct vp9_read_bit_buffer *rb, int *delta_q) {
  const int old = *delta_q;
  if (vp9_rb_read_bit(rb))
    *delta_q = vp9_rb_read_signed_literal(rb, 4);
  return old != *delta_q;
}

Original issue reported on code.google.com by dkova...@google.com on 29 Aug 2013 at 7:18

GoogleCodeExporter commented 8 years ago
fixed in https://gerrit.chromium.org/gerrit/#/c/67072/

Original comment by ya...@google.com on 4 Sep 2013 at 9:22