[FFmpeg-devel] [PATCH] lavfi/super2xsai: fix table used to update color matrix at the end of each y loop

Stefano Sabatini stefasab at gmail.com
Fri Jun 15 00:56:36 CEST 2012


The previous table appears to be wrong (it was copied from the original
MPlayer super2xsai filter in order to keep binary compatibility).

The new table is consistent with the init code and apparently fix a
combing artifact on the left edge of the generated image.
---
 libavfilter/vf_super2xsai.c        |    6 +++---
 tests/ref/lavfi/pixfmts_super2xsai |   20 ++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavfilter/vf_super2xsai.c b/libavfilter/vf_super2xsai.c
index 4406a43..c16c837 100644
--- a/libavfilter/vf_super2xsai.c
+++ b/libavfilter/vf_super2xsai.c
@@ -225,19 +225,19 @@ static void super2xsai(AVFilterContext *ctx,
         case 4:
             READ_COLOR4(color[0][0], src_line[0], 0); color[0][1] = color[0][0]; READ_COLOR4(color[0][2], src_line[0], 1); READ_COLOR4(color[0][3], src_line[0], 2);
             READ_COLOR4(color[1][0], src_line[1], 0); color[1][1] = color[1][0]; READ_COLOR4(color[1][2], src_line[1], 1); READ_COLOR4(color[1][3], src_line[1], 2);
-            READ_COLOR4(color[2][0], src_line[2], 0); color[2][1] = color[2][1]; READ_COLOR4(color[2][2], src_line[2], 1); READ_COLOR4(color[2][3], src_line[2], 2);
+            READ_COLOR4(color[2][0], src_line[2], 0); color[2][1] = color[2][0]; READ_COLOR4(color[2][2], src_line[2], 1); READ_COLOR4(color[2][3], src_line[2], 2);
             READ_COLOR4(color[3][0], src_line[3], 0); color[3][1] = color[3][0]; READ_COLOR4(color[3][2], src_line[3], 1); READ_COLOR4(color[3][3], src_line[3], 2);
             break;
         case 3:
             READ_COLOR3(color[0][0], src_line[0], 0); color[0][1] = color[0][0]; READ_COLOR3(color[0][2], src_line[0], 1); READ_COLOR3(color[0][3], src_line[0], 2);
             READ_COLOR3(color[1][0], src_line[1], 0); color[1][1] = color[1][0]; READ_COLOR3(color[1][2], src_line[1], 1); READ_COLOR3(color[1][3], src_line[1], 2);
-            READ_COLOR3(color[2][0], src_line[2], 0); color[2][1] = color[2][1]; READ_COLOR3(color[2][2], src_line[2], 1); READ_COLOR3(color[2][3], src_line[2], 2);
+            READ_COLOR3(color[2][0], src_line[2], 0); color[2][1] = color[2][0]; READ_COLOR3(color[2][2], src_line[2], 1); READ_COLOR3(color[2][3], src_line[2], 2);
             READ_COLOR3(color[3][0], src_line[3], 0); color[3][1] = color[3][0]; READ_COLOR3(color[3][2], src_line[3], 1); READ_COLOR3(color[3][3], src_line[3], 2);
             break;
         default:
             READ_COLOR2(color[0][0], src_line[0], 0); color[0][1] = color[0][0]; READ_COLOR2(color[0][2], src_line[0], 1); READ_COLOR2(color[0][3], src_line[0], 2);
             READ_COLOR2(color[1][0], src_line[1], 0); color[1][1] = color[1][0]; READ_COLOR2(color[1][2], src_line[1], 1); READ_COLOR2(color[1][3], src_line[1], 2);
-            READ_COLOR2(color[2][0], src_line[2], 0); color[2][1] = color[2][1]; READ_COLOR2(color[2][2], src_line[2], 1); READ_COLOR2(color[2][3], src_line[2], 2);
+            READ_COLOR2(color[2][0], src_line[2], 0); color[2][1] = color[2][0]; READ_COLOR2(color[2][2], src_line[2], 1); READ_COLOR2(color[2][3], src_line[2], 2);
             READ_COLOR2(color[3][0], src_line[3], 0); color[3][1] = color[3][0]; READ_COLOR2(color[3][2], src_line[3], 1); READ_COLOR2(color[3][3], src_line[3], 2);
         }
     } // y loop
diff --git a/tests/ref/lavfi/pixfmts_super2xsai b/tests/ref/lavfi/pixfmts_super2xsai
index 5980e74..0009d0d 100644
--- a/tests/ref/lavfi/pixfmts_super2xsai
+++ b/tests/ref/lavfi/pixfmts_super2xsai
@@ -1,10 +1,10 @@
-abgr                7d8f4b961ee4808945d41290f7cf49b2
-argb                9a5676a350e52769d8293f395e8e83b2
-bgr24               6f6ad5b5d266d3643a8632fe96f8567a
-bgr555le            f4a33c43cbdac9df03637fd6901fe245
-bgr565le            fa0cf3a3fc1baae3717cac81717f7e7b
-bgra                17f36236c59c3ccf4eb9cb8bbf2f6310
-rgb24               37c805a0002d3a327a922a5b77e283e2
-rgb555le            19c7655936ad580ae859ef18c1b74c4f
-rgb565le            90e38143a89c28feef72f8e920df19b8
-rgba                d4b9d34c66e39d4549aea500d3fedf3b
+abgr                7df21399eedd7094a5c345035c220ebe
+argb                6de1f5a66d6517951243bb2a751180d2
+bgr24               6ff4af0eb9ab72eb723ed12469d559bc
+bgr555le            38c2e84751c3ad108a55bf77ab8afbf5
+bgr565le            2efbb9c15f22d5c704a00d11a241c1da
+bgra                ab589a165007d5b0dbacb26df4bbe5e0
+rgb24               c4ed6e5ad7eb4e66ea18deef3584231f
+rgb555le            3b313e94f2bf70c8972af69b6dc331c9
+rgb565le            de2cf048dcd48c0a39dfcc9b6eac36fe
+rgba                e97cd6a0393fc354e95088065e668eb2
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list