Commit 39ce6e49 authored by cehoyos's avatar cehoyos

Simplified deblocking checks.

Patch by Dark Shikari


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20751 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 4a6da829
...@@ -1641,17 +1641,21 @@ static void apply_loop_filter(Vp3DecodeContext *s) ...@@ -1641,17 +1641,21 @@ static void apply_loop_filter(Vp3DecodeContext *s)
for (y = 0; y < height; y++) { for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) { for (x = 0; x < width; x++) {
/* This code basically just deblocks on the edges of coded blocks.
* However, it has to be much more complicated because of the
* braindamaged deblock ordering used in VP3/Theora. Order matters
* because some pixels get filtered twice. */
if( s->all_fragments[fragment].coding_method != MODE_COPY )
{
/* do not perform left edge filter for left columns frags */ /* do not perform left edge filter for left columns frags */
if ((x > 0) && if (x > 0) {
(s->all_fragments[fragment].coding_method != MODE_COPY)) {
s->dsp.vp3_h_loop_filter( s->dsp.vp3_h_loop_filter(
plane_data + s->all_fragments[fragment].first_pixel, plane_data + s->all_fragments[fragment].first_pixel,
stride, bounding_values); stride, bounding_values);
} }
/* do not perform top edge filter for top row fragments */ /* do not perform top edge filter for top row fragments */
if ((y > 0) && if (y > 0) {
(s->all_fragments[fragment].coding_method != MODE_COPY)) {
s->dsp.vp3_v_loop_filter( s->dsp.vp3_v_loop_filter(
plane_data + s->all_fragments[fragment].first_pixel, plane_data + s->all_fragments[fragment].first_pixel,
stride, bounding_values); stride, bounding_values);
...@@ -1661,7 +1665,6 @@ static void apply_loop_filter(Vp3DecodeContext *s) ...@@ -1661,7 +1665,6 @@ static void apply_loop_filter(Vp3DecodeContext *s)
* fragments or if right fragment neighbor is also coded * fragments or if right fragment neighbor is also coded
* in this frame (it will be filtered in next iteration) */ * in this frame (it will be filtered in next iteration) */
if ((x < width - 1) && if ((x < width - 1) &&
(s->all_fragments[fragment].coding_method != MODE_COPY) &&
(s->all_fragments[fragment + 1].coding_method == MODE_COPY)) { (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
s->dsp.vp3_h_loop_filter( s->dsp.vp3_h_loop_filter(
plane_data + s->all_fragments[fragment + 1].first_pixel, plane_data + s->all_fragments[fragment + 1].first_pixel,
...@@ -1672,12 +1675,12 @@ static void apply_loop_filter(Vp3DecodeContext *s) ...@@ -1672,12 +1675,12 @@ static void apply_loop_filter(Vp3DecodeContext *s)
* fragments or if bottom fragment neighbor is also coded * fragments or if bottom fragment neighbor is also coded
* in this frame (it will be filtered in the next row) */ * in this frame (it will be filtered in the next row) */
if ((y < height - 1) && if ((y < height - 1) &&
(s->all_fragments[fragment].coding_method != MODE_COPY) &&
(s->all_fragments[fragment + width].coding_method == MODE_COPY)) { (s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
s->dsp.vp3_v_loop_filter( s->dsp.vp3_v_loop_filter(
plane_data + s->all_fragments[fragment + width].first_pixel, plane_data + s->all_fragments[fragment + width].first_pixel,
stride, bounding_values); stride, bounding_values);
} }
}
fragment++; fragment++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment