]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/png.h
Merge remote branch 'qatar/master'
[ffmpeg] / libavcodec / png.h
index 97e81f5628a2f297177e44369ad882dd20ed442b..d6fac3e67391c69b1ee27e48e967284736123ac4 100644 (file)
@@ -23,6 +23,9 @@
 #define AVCODEC_PNG_H
 
 #include <stdint.h>
+#include <zlib.h>
+
+#include "avcodec.h"
 
 #define PNG_COLOR_MASK_PALETTE    1
 #define PNG_COLOR_MASK_COLOR      2
@@ -55,12 +58,6 @@ extern const uint8_t ff_mngsig[8];
 /* Mask to determine which y pixels are valid in a pass */
 extern const uint8_t ff_png_pass_ymask[NB_PASSES];
 
-/* minimum x value */
-extern const uint8_t ff_png_pass_xmin[NB_PASSES];
-
-/* x shift to get row width */
-extern const uint8_t ff_png_pass_xshift[NB_PASSES];
-
 /* Mask to determine which pixels are valid in a pass */
 extern const uint8_t ff_png_pass_mask[NB_PASSES];
 
@@ -73,4 +70,43 @@ int ff_png_get_nb_channels(int color_type);
 /* compute the row size of an interleaved pass */
 int ff_png_pass_row_size(int pass, int bits_per_pixel, int width);
 
+void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp);
+
+typedef struct PNGDecContext {
+    const uint8_t *bytestream;
+    const uint8_t *bytestream_start;
+    const uint8_t *bytestream_end;
+    AVFrame picture1, picture2;
+    AVFrame *current_picture, *last_picture;
+
+    int state;
+    int width, height;
+    int bit_depth;
+    int color_type;
+    int compression_type;
+    int interlace_type;
+    int filter_type;
+    int channels;
+    int bits_per_pixel;
+    int bpp;
+
+    uint8_t *image_buf;
+    int image_linesize;
+    uint32_t palette[256];
+    uint8_t *crow_buf;
+    uint8_t *last_row;
+    uint8_t *tmp_row;
+    int pass;
+    int crow_size; /* compressed row size (include filter type) */
+    int row_size; /* decompressed row size */
+    int pass_row_size; /* decompress row size of the current pass */
+    int y;
+    z_stream zstream;
+
+    void (*add_bytes_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w);
+    void (*add_paeth_prediction)(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp);
+} PNGDecContext;
+
+void ff_png_init_mmx(PNGDecContext *s);
+
 #endif /* AVCODEC_PNG_H */