DSPContext dsp;
int flipped_image;
int last_slice_end;
+ int skip_loop_filter;
int qps[3];
int nqps;
} else {
/* unpack the list of partially-coded superblocks */
- bit = get_bits1(gb);
+ bit = get_bits1(gb) ^ 1;
+ current_run = 0;
+
while (current_superblock < s->superblock_count && get_bits_left(gb) > 0) {
+ if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
+ bit = get_bits1(gb);
+ else
+ bit ^= 1;
+
current_run = get_vlc2(gb,
s->superblock_run_length_vlc.table, 6, 2) + 1;
if (current_run == 34)
current_superblock += current_run;
if (bit)
num_partial_superblocks += current_run;
-
- if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
- bit = get_bits1(gb);
- else
- bit ^= 1;
}
/* unpack the list of fully coded superblocks if any of the blocks were
int superblocks_decoded = 0;
current_superblock = 0;
- bit = get_bits1(gb);
+ bit = get_bits1(gb) ^ 1;
+ current_run = 0;
+
while (superblocks_decoded < s->superblock_count - num_partial_superblocks
&& get_bits_left(gb) > 0) {
+
+ if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
+ bit = get_bits1(gb);
+ else
+ bit ^= 1;
+
current_run = get_vlc2(gb,
s->superblock_run_length_vlc.table, 6, 2) + 1;
if (current_run == 34)
}
}
superblocks_decoded += current_run;
-
- if (s->theora && current_run == MAXIMUM_LONG_BIT_RUN)
- bit = get_bits1(gb);
- else
- bit ^= 1;
}
}
for (qpi = 0; qpi < s->nqps-1 && num_blocks > 0; qpi++) {
i = blocks_decoded = num_blocks_at_qpi = 0;
- bit = get_bits1(gb);
+ bit = get_bits1(gb) ^ 1;
+ run_length = 0;
do {
+ if (run_length == MAXIMUM_LONG_BIT_RUN)
+ bit = get_bits1(gb);
+ else
+ bit ^= 1;
+
run_length = get_vlc2(gb, s->superblock_run_length_vlc.table, 6, 2) + 1;
if (run_length == 34)
run_length += get_bits(gb, 12);
j++;
}
}
-
- if (run_length == MAXIMUM_LONG_BIT_RUN)
- bit = get_bits1(gb);
- else
- bit ^= 1;
} while (blocks_decoded < num_blocks && get_bits_left(gb) > 0);
num_blocks -= num_blocks_at_qpi;
y = s->height - y - h;
}
- cy = y >> 1;
+ cy = y >> s->chroma_y_shift;
offset[0] = s->current_frame.linesize[0]*y;
offset[1] = s->current_frame.linesize[1]*cy;
offset[2] = s->current_frame.linesize[2]*cy;
}
// Filter up to the last row in the superblock row
- apply_loop_filter(s, plane, 4*sb_y - !!sb_y, FFMIN(4*sb_y+3, fragment_height-1));
+ if (!s->skip_loop_filter)
+ apply_loop_filter(s, plane, 4*sb_y - !!sb_y, FFMIN(4*sb_y+3, fragment_height-1));
}
}
s->keyframe?"key":"", counter, s->qps[0]);
counter++;
+ s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] ||
+ avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL : AVDISCARD_NONKEY);
+
if (s->qps[0] != s->last_qps[0])
init_loop_filter(s);