diff mbox

[FFmpeg-devel,2/2] libavcodec/zmbvenc: add support for 24-bit encoding, using pix_fmt BGR24.

Message ID 20190326221306.1004-2-matthew.w.fearnley@gmail.com
State Accepted
Commit b97a7dd03185898db0b5bf1a144a6848fb3010b3
Headers show

Commit Message

matthew.w.fearnley@gmail.com March 26, 2019, 10:13 p.m. UTC
Support is #ifdef'd out at this stage, using ZMBV_ENABLE_24BPP (like in
the zmbv.c decoder)
---
 libavcodec/zmbvenc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tomas Härdin March 27, 2019, 9:42 a.m. UTC | #1
tis 2019-03-26 klockan 22:13 +0000 skrev Matthew Fearnley:
> Support is #ifdef'd out at this stage, using ZMBV_ENABLE_24BPP (like in
> the zmbv.c decoder)
> ---
>  libavcodec/zmbvenc.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c
> index 98029de5f6..48871758e0 100644
> --- a/libavcodec/zmbvenc.c
> +++ b/libavcodec/zmbvenc.c
> @@ -340,6 +340,12 @@ static av_cold int encode_init(AVCodecContext *avctx)
>          c->fmt = ZMBV_FMT_16BPP;
>          c->bypp = 2;
>          break;
> +#ifdef ZMBV_ENABLE_24BPP
> +    case AV_PIX_FMT_BGR24:
> +        c->fmt = ZMBV_FMT_24BPP;
> +        c->bypp = 3;
> +        break;
> +#endif //ZMBV_ENABLE_24BPP

Should be fine, since our encoder is byte-oriented rather than word-
oriented like the DosBox encoder

/Tomas
Tomas Härdin April 2, 2019, 3:48 p.m. UTC | #2
tis 2019-03-26 klockan 22:13 +0000 skrev Matthew Fearnley:
> Support is #ifdef'd out at this stage, using ZMBV_ENABLE_24BPP (like in
> the zmbv.c decoder)
> ---
>  libavcodec/zmbvenc.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

Pushed

/Tomas
diff mbox

Patch

diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c
index 98029de5f6..48871758e0 100644
--- a/libavcodec/zmbvenc.c
+++ b/libavcodec/zmbvenc.c
@@ -340,6 +340,12 @@  static av_cold int encode_init(AVCodecContext *avctx)
         c->fmt = ZMBV_FMT_16BPP;
         c->bypp = 2;
         break;
+#ifdef ZMBV_ENABLE_24BPP
+    case AV_PIX_FMT_BGR24:
+        c->fmt = ZMBV_FMT_24BPP;
+        c->bypp = 3;
+        break;
+#endif //ZMBV_ENABLE_24BPP
     case AV_PIX_FMT_BGR0:
         c->fmt = ZMBV_FMT_32BPP;
         c->bypp = 4;
@@ -434,6 +440,9 @@  AVCodec ff_zmbv_encoder = {
     .pix_fmts       = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8,
                                                      AV_PIX_FMT_RGB555LE,
                                                      AV_PIX_FMT_RGB565LE,
+#ifdef ZMBV_ENABLE_24BPP
+                                                     AV_PIX_FMT_BGR24,
+#endif //ZMBV_ENABLE_24BPP
                                                      AV_PIX_FMT_BGR0,
                                                      AV_PIX_FMT_NONE },
 };