]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pcxenc.c
timecode: support >24h timecode.
[ffmpeg] / libavcodec / pcxenc.c
index 816223e7368a2a2ac3f0f34975eb000160f3db6d..a39e221805499eb292552e6e438dfa6e061707ac 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "avcodec.h"
 #include "bytestream.h"
+#include "libavutil/imgutils.h"
 
 typedef struct PCXContext {
     AVFrame picture;
@@ -105,6 +106,7 @@ static int pcx_encode_frame(AVCodecContext *avctx,
 
     int bpp, nplanes, i, y, line_bytes, written;
     const uint32_t *pal = NULL;
+    uint32_t palette256[256];
     const uint8_t *src;
 
     *pict = *(AVFrame *)data;
@@ -126,6 +128,11 @@ static int pcx_encode_frame(AVCodecContext *avctx,
     case PIX_FMT_RGB4_BYTE:
     case PIX_FMT_BGR4_BYTE:
     case PIX_FMT_GRAY8:
+        bpp = 8;
+        nplanes = 1;
+        ff_set_systematic_pal2(palette256, avctx->pix_fmt);
+        pal = palette256;
+        break;
     case PIX_FMT_PAL8:
         bpp = 8;
         nplanes = 1;