diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index c29435b..7622f50 100644
|
a
|
b
|
|
| 23 | 23 | #include "bytestream.h" |
| 24 | 24 | #include "dsputil.h" |
| 25 | 25 | #include "png.h" |
| | 26 | #include "libavutil/pixdesc.h" |
| 26 | 27 | |
| 27 | 28 | /* TODO: |
| 28 | 29 | * - add 2, 4 and 16 bit depth support |
| … |
… |
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
| 232 | 233 | p->key_frame= 1; |
| 233 | 234 | |
| 234 | 235 | is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT); |
| | 236 | avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]); |
| 235 | 237 | switch(avctx->pix_fmt) { |
| 236 | 238 | case PIX_FMT_RGBA64BE: |
| 237 | 239 | bit_depth = 16; |
| … |
… |
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
| 250 | 252 | color_type = PNG_COLOR_TYPE_RGB; |
| 251 | 253 | break; |
| 252 | 254 | case PIX_FMT_GRAY16BE: |
| | 255 | avctx->bits_per_coded_sample = 0x30; |
| 253 | 256 | bit_depth = 16; |
| 254 | 257 | color_type = PNG_COLOR_TYPE_GRAY; |
| 255 | 258 | break; |
| 256 | 259 | case PIX_FMT_GRAY8: |
| | 260 | avctx->bits_per_coded_sample = 0x28; |
| 257 | 261 | bit_depth = 8; |
| 258 | 262 | color_type = PNG_COLOR_TYPE_GRAY; |
| 259 | 263 | break; |
diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index a80053b..77446d8 100644
|
a
|
b
|
static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
| 96 | 96 | /* image descriptor byte: origin is always top-left, bits 0-3 specify alpha */ |
| 97 | 97 | pkt->data[17] = 0x20 | (avctx->pix_fmt == PIX_FMT_BGRA ? 8 : 0); |
| 98 | 98 | |
| | 99 | avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]); |
| 99 | 100 | switch(avctx->pix_fmt) { |
| 100 | 101 | case PIX_FMT_GRAY8: |
| 101 | 102 | pkt->data[2] = TGA_BW; /* uncompressed grayscale image */ |
| | 103 | avctx->bits_per_coded_sample = 0x28; |
| 102 | 104 | pkt->data[16] = 8; /* bpp */ |
| 103 | 105 | break; |
| 104 | 106 | case PIX_FMT_RGB555LE: |