[FFmpeg-devel] [PATCH] lavc/pngdec: actually use SIMD version for bpp<=2

Nicolas Frattaroli ffmpeg at fratti.ch
Wed May 12 08:07:27 EEST 2021


The SIMD version was only used by the bpp > 2 case. This patch
uses the SIMD version for both code paths.

Change has been tested to still work with a 1-bpp image that uses
paeth, to generate one:

pngnq-s9 input.png
optipng -f4 -force input-nq8.png
---
 libavcodec/pngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index f2e6f689b0..2cb7946b49 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -311,7 +311,7 @@ void ff_png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
                 i = w;
             }
         }
-        ff_add_png_paeth_prediction(dst + i, src + i, last + i, size - i, bpp);
+        dsp->add_paeth_prediction(dst + i, src + i, last + i, size - i, bpp);
         break;
     }
 }
-- 
2.31.1



More information about the ffmpeg-devel mailing list