diff png.c @ 3777:20545fbb6f7c libavcodec

add some #ifdef CONFIG_ENCODERS/DECODERS
author mru
date Wed, 27 Sep 2006 19:54:07 +0000
parents 82277c821113
children c8c591fe26f8
line wrap: on
line diff
--- a/png.c	Wed Sep 27 19:47:39 2006 +0000
+++ b/png.c	Wed Sep 27 19:54:07 2006 +0000
@@ -90,12 +90,14 @@
     return ((*b)[-4]<<24) + ((*b)[-3]<<16) + ((*b)[-2]<<8) + (*b)[-1];
 }
 
+#ifdef CONFIG_ENCODERS
 static void put32(uint8_t **b, unsigned int v){
     *(*b)++= v>>24;
     *(*b)++= v>>16;
     *(*b)++= v>>8;
     *(*b)++= v;
 }
+#endif
 
 static const uint8_t pngsig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
 
@@ -233,6 +235,7 @@
     }
 }
 
+#ifdef CONFIG_ENCODERS
 static void png_get_interlaced_row(uint8_t *dst, int row_size,
                                    int bits_per_pixel, int pass,
                                    const uint8_t *src, int width)
@@ -270,6 +273,7 @@
         break;
     }
 }
+#endif
 
 /* XXX: optimize */
 /* NOTE: 'dst' can be equal to 'last' */
@@ -338,6 +342,7 @@
     }
 }
 
+#ifdef CONFIG_ENCODERS
 static void convert_from_rgba32(uint8_t *dst, const uint8_t *src, int width)
 {
     uint8_t *d;
@@ -354,7 +359,9 @@
         d += 4;
     }
 }
+#endif
 
+#ifdef CONFIG_DECODERS
 static void convert_to_rgba32(uint8_t *dst, const uint8_t *src, int width)
 {
     int j;
@@ -684,7 +691,9 @@
     ret = -1;
     goto the_end;
 }
+#endif
 
+#ifdef CONFIG_ENCODERS
 static void png_write_chunk(uint8_t **f, uint32_t tag,
                             const uint8_t *buf, int length)
 {
@@ -736,6 +745,7 @@
     }
     return 0;
 }
+#endif /* CONFIG_ENCODERS */
 
 static int common_init(AVCodecContext *avctx){
     PNGContext *s = avctx->priv_data;
@@ -747,6 +757,7 @@
     return 0;
 }
 
+#ifdef CONFIG_ENCODERS
 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
     PNGContext *s = avctx->priv_data;
     AVFrame *pict = data;
@@ -920,7 +931,9 @@
     ret = -1;
     goto the_end;
 }
+#endif
 
+#ifdef CONFIG_PNG_DECODER
 AVCodec png_decoder = {
     "png",
     CODEC_TYPE_VIDEO,
@@ -933,6 +946,7 @@
     0 /*CODEC_CAP_DR1*/ /*| CODEC_CAP_DRAW_HORIZ_BAND*/,
     NULL
 };
+#endif
 
 #ifdef CONFIG_PNG_ENCODER
 AVCodec png_encoder = {