summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorJason Garrett-Glaser <darkshikari@gmail.com>2009-12-06 15:38:05 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2009-12-06 15:38:05 +0000
commitbfb5a8cec6261307c5c1e972873e77a830eac9ff (patch)
tree6e9280cc5397a0675684ae58fe44252e42c7a29e /libavcodec
parent50ba3fd7133e0b57216a9a1c2b8a1300fa1f8434 (diff)
Simplified deblocking checks.
Patch by Dark Shikari Originally committed as revision 20751 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp3.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index f0fe9c13a9..e04cfc94df 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -1641,17 +1641,21 @@ static void apply_loop_filter(Vp3DecodeContext *s)
for (y = 0; y < height; y++) {
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 */
- if ((x > 0) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY)) {
+ if (x > 0) {
s->dsp.vp3_h_loop_filter(
plane_data + s->all_fragments[fragment].first_pixel,
stride, bounding_values);
}
/* do not perform top edge filter for top row fragments */
- if ((y > 0) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY)) {
+ if (y > 0) {
s->dsp.vp3_v_loop_filter(
plane_data + s->all_fragments[fragment].first_pixel,
stride, bounding_values);
@@ -1661,7 +1665,6 @@ static void apply_loop_filter(Vp3DecodeContext *s)
* fragments or if right fragment neighbor is also coded
* in this frame (it will be filtered in next iteration) */
if ((x < width - 1) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY) &&
(s->all_fragments[fragment + 1].coding_method == MODE_COPY)) {
s->dsp.vp3_h_loop_filter(
plane_data + s->all_fragments[fragment + 1].first_pixel,
@@ -1672,12 +1675,12 @@ static void apply_loop_filter(Vp3DecodeContext *s)
* fragments or if bottom fragment neighbor is also coded
* in this frame (it will be filtered in the next row) */
if ((y < height - 1) &&
- (s->all_fragments[fragment].coding_method != MODE_COPY) &&
(s->all_fragments[fragment + width].coding_method == MODE_COPY)) {
s->dsp.vp3_v_loop_filter(
plane_data + s->all_fragments[fragment + width].first_pixel,
stride, bounding_values);
}
+ }
fragment++;
}