[FFmpeg-devel] [PATCH] Add 1bpp, 8bpp, 15bpp, and 16bpp support to BMP encoder

Stefan Gehrer stefan.gehrer
Tue Mar 10 23:14:46 CET 2009


Daniel Verkamp wrote:
+    n_bytes_per_row = (avctx->width * bit_count) >> 3;
+    pad_bytes_per_row = (4 - n_bytes_per_row) & 3;
+    n_bytes_image = avctx->height * (n_bytes_per_row + pad_bytes_per_row);

For the case of PIX_FMT_MONOBLACK, a picture that is e.g. 36 pixels
wide would only get 32 bit allocated for a line. Could that become
a problem?

Maybe

n_bytes_per_row = (avctx->width * bit_count + 7) >> 3;

would be enough to fix that.

Stefan




More information about the ffmpeg-devel mailing list