|
|
@@ -24,6 +24,7 @@ |
|
|
|
#include "avcodec.h" |
|
|
|
#include "bytestream.h" |
|
|
|
#include "bmp.h" |
|
|
|
#include <assert.h> |
|
|
|
|
|
|
|
static const uint32_t monoblack_pal[] = { 0x000000, 0xFFFFFF }; |
|
|
|
static const uint32_t rgb565_masks[] = { 0xF800, 0x07E0, 0x001F }; |
|
|
@@ -69,6 +70,7 @@ static int bmp_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_s |
|
|
|
AVFrame * const p= (AVFrame*)&s->picture; |
|
|
|
int n_bytes_image, n_bytes_per_row, n_bytes, i, n, hsize; |
|
|
|
const uint32_t *pal = NULL; |
|
|
|
uint32_t palette256[256]; |
|
|
|
int pad_bytes_per_row, pal_entries = 0, compression = BMP_RGB; |
|
|
|
int bit_count = avctx->bits_per_coded_sample; |
|
|
|
uint8_t *ptr; |
|
|
@@ -87,7 +89,10 @@ static int bmp_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_s |
|
|
|
case PIX_FMT_RGB4_BYTE: |
|
|
|
case PIX_FMT_BGR4_BYTE: |
|
|
|
case PIX_FMT_GRAY8: |
|
|
|
ff_set_systematic_pal2((uint32_t*)p->data[1], avctx->pix_fmt); |
|
|
|
assert(bit_count == 8); |
|
|
|
ff_set_systematic_pal2(palette256, avctx->pix_fmt); |
|
|
|
pal = palette256; |
|
|
|
break; |
|
|
|
case PIX_FMT_PAL8: |
|
|
|
pal = (uint32_t *)p->data[1]; |
|
|
|
break; |
|
|
|