ref: b41574e379f43988171165fa340545d91022edae
parent: 64cf3987131bf7ad1b19b7eb10cd2ceb5b0b7a1f
author: Dmitry Kovalev <[email protected]>
date: Fri Dec 13 13:05:15 EST 2013
Removing unnecessary assert(delta != 0) from encode_loopfilter(). Change-Id: I8ae093d0b61d71d3c294b95d98d0178f7f67c8f6
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -777,38 +777,27 @@
vp9_wb_write_bit(wb, lf->mode_ref_delta_enabled);
if (lf->mode_ref_delta_enabled) {
- // Do the deltas need to be updated
vp9_wb_write_bit(wb, lf->mode_ref_delta_update);
if (lf->mode_ref_delta_update) {
- // Send update
for (i = 0; i < MAX_REF_LF_DELTAS; i++) {
const int delta = lf->ref_deltas[i];
-
- // Frame level data
- if (delta != lf->last_ref_deltas[i]) {
+ const int changed = delta != lf->last_ref_deltas[i];
+ vp9_wb_write_bit(wb, changed);
+ if (changed) {
lf->last_ref_deltas[i] = delta;
- vp9_wb_write_bit(wb, 1);
-
- assert(delta != 0);
vp9_wb_write_literal(wb, abs(delta) & 0x3F, 6);
vp9_wb_write_bit(wb, delta < 0);
- } else {
- vp9_wb_write_bit(wb, 0);
}
}
- // Send update
for (i = 0; i < MAX_MODE_LF_DELTAS; i++) {
const int delta = lf->mode_deltas[i];
- if (delta != lf->last_mode_deltas[i]) {
+ const int changed = delta != lf->last_mode_deltas[i];
+ vp9_wb_write_bit(wb, changed);
+ if (changed) {
lf->last_mode_deltas[i] = delta;
- vp9_wb_write_bit(wb, 1);
-
- assert(delta != 0);
vp9_wb_write_literal(wb, abs(delta) & 0x3F, 6);
vp9_wb_write_bit(wb, delta < 0);
- } else {
- vp9_wb_write_bit(wb, 0);
}
}
}