Mercurial > libavcodec.hg
comparison vp3.c @ 10651:abcff3c8c463 libavcodec
Simplified deblocking checks.
Patch by Dark Shikari
author | cehoyos |
---|---|
date | Sun, 06 Dec 2009 15:38:05 +0000 |
parents | e267d3e4b964 |
children | b6116b343122 |
comparison
equal
deleted
inserted
replaced
10650:e267d3e4b964 | 10651:abcff3c8c463 |
---|---|
1639 if (!s->flipped_image) stride = -stride; | 1639 if (!s->flipped_image) stride = -stride; |
1640 | 1640 |
1641 for (y = 0; y < height; y++) { | 1641 for (y = 0; y < height; y++) { |
1642 | 1642 |
1643 for (x = 0; x < width; x++) { | 1643 for (x = 0; x < width; x++) { |
1644 /* This code basically just deblocks on the edges of coded blocks. | |
1645 * However, it has to be much more complicated because of the | |
1646 * braindamaged deblock ordering used in VP3/Theora. Order matters | |
1647 * because some pixels get filtered twice. */ | |
1648 if( s->all_fragments[fragment].coding_method != MODE_COPY ) | |
1649 { | |
1644 /* do not perform left edge filter for left columns frags */ | 1650 /* do not perform left edge filter for left columns frags */ |
1645 if ((x > 0) && | 1651 if (x > 0) { |
1646 (s->all_fragments[fragment].coding_method != MODE_COPY)) { | |
1647 s->dsp.vp3_h_loop_filter( | 1652 s->dsp.vp3_h_loop_filter( |
1648 plane_data + s->all_fragments[fragment].first_pixel, | 1653 plane_data + s->all_fragments[fragment].first_pixel, |
1649 stride, bounding_values); | 1654 stride, bounding_values); |
1650 } | 1655 } |
1651 | 1656 |
1652 /* do not perform top edge filter for top row fragments */ | 1657 /* do not perform top edge filter for top row fragments */ |
1653 if ((y > 0) && | 1658 if (y > 0) { |
1654 (s->all_fragments[fragment].coding_method != MODE_COPY)) { | |
1655 s->dsp.vp3_v_loop_filter( | 1659 s->dsp.vp3_v_loop_filter( |
1656 plane_data + s->all_fragments[fragment].first_pixel, | 1660 plane_data + s->all_fragments[fragment].first_pixel, |
1657 stride, bounding_values); | 1661 stride, bounding_values); |
1658 } | 1662 } |
1659 | 1663 |
1660 /* do not perform right edge filter for right column | 1664 /* do not perform right edge filter for right column |
1661 * fragments or if right fragment neighbor is also coded | 1665 * fragments or if right fragment neighbor is also coded |
1662 * in this frame (it will be filtered in next iteration) */ | 1666 * in this frame (it will be filtered in next iteration) */ |
1663 if ((x < width - 1) && | 1667 if ((x < width - 1) && |
1664 (s->all_fragments[fragment].coding_method != MODE_COPY) && | |
1665 (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) { | 1668 (s->all_fragments[fragment + 1].coding_method == MODE_COPY)) { |
1666 s->dsp.vp3_h_loop_filter( | 1669 s->dsp.vp3_h_loop_filter( |
1667 plane_data + s->all_fragments[fragment + 1].first_pixel, | 1670 plane_data + s->all_fragments[fragment + 1].first_pixel, |
1668 stride, bounding_values); | 1671 stride, bounding_values); |
1669 } | 1672 } |
1670 | 1673 |
1671 /* do not perform bottom edge filter for bottom row | 1674 /* do not perform bottom edge filter for bottom row |
1672 * fragments or if bottom fragment neighbor is also coded | 1675 * fragments or if bottom fragment neighbor is also coded |
1673 * in this frame (it will be filtered in the next row) */ | 1676 * in this frame (it will be filtered in the next row) */ |
1674 if ((y < height - 1) && | 1677 if ((y < height - 1) && |
1675 (s->all_fragments[fragment].coding_method != MODE_COPY) && | |
1676 (s->all_fragments[fragment + width].coding_method == MODE_COPY)) { | 1678 (s->all_fragments[fragment + width].coding_method == MODE_COPY)) { |
1677 s->dsp.vp3_v_loop_filter( | 1679 s->dsp.vp3_v_loop_filter( |
1678 plane_data + s->all_fragments[fragment + width].first_pixel, | 1680 plane_data + s->all_fragments[fragment + width].first_pixel, |
1679 stride, bounding_values); | 1681 stride, bounding_values); |
1682 } | |
1680 } | 1683 } |
1681 | 1684 |
1682 fragment++; | 1685 fragment++; |
1683 } | 1686 } |
1684 } | 1687 } |