libavformat/avisynth: enable additional pix_fmts
authorStephen Hutchinson <qyot27@gmail.com>
Sun, 24 Mar 2019 20:25:37 +0000 (16:25 -0400)
committerGyan Doshi <ffmpeg@gyani.pro>
Sat, 4 May 2019 06:29:00 +0000 (11:59 +0530)
These pix_fmts have been added to FFmpeg in the 31 months since
commit 92916e8542e425ca20daddb490261a5818643206 added support for
the larger number of pix_fmts that AviSynth+ can use. They were
present in AviSynth+ even then, just not in libavutil.

libavformat/avisynth.c

index 250a489..2181510 100644 (file)
@@ -323,6 +323,10 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
         st->codecpar->format = AV_PIX_FMT_YUVA420P10;
         planar               = 4;
         break;
+    case AVS_CS_YUVA422P12:
+        st->codecpar->format = AV_PIX_FMT_YUVA422P12;
+        planar               = 4;
+        break;
     case AVS_CS_YUVA444P16:
         st->codecpar->format = AV_PIX_FMT_YUVA444P16;
         planar               = 4;
@@ -356,6 +360,11 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
         st->codecpar->format = AV_PIX_FMT_GBRP16;
         planar               = 3;
         break;
+    /* Single precision floating point Planar RGB (AviSynth+) */
+    case AVS_CS_RGBPS:
+        st->codecpar->format = AV_PIX_FMT_GBRPF32;
+        planar               = 3;
+        break;
     /* Planar RGB pix_fmts with Alpha (AviSynth+) */
     case AVS_CS_RGBAP:
         st->codecpar->format = AV_PIX_FMT_GBRAP;
@@ -373,11 +382,33 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
         st->codecpar->format = AV_PIX_FMT_GBRAP16;
         planar               = 5;
         break;
-    /* GRAY16 (AviSynth+) */
+    /* Single precision floating point Planar RGB with Alpha (AviSynth+) */
+    case AVS_CS_RGBAPS:
+        st->codecpar->format = AV_PIX_FMT_GBRAPF32;
+        planar               = 5;
+        break;
+    /* 10~16-bit gray pix_fmts (AviSynth+) */
+    case AVS_CS_Y10:
+        st->codecpar->format = AV_PIX_FMT_GRAY10;
+        planar               = 2;
+        break;
+    case AVS_CS_Y12:
+        st->codecpar->format = AV_PIX_FMT_GRAY12;
+        planar               = 2;
+        break;
+    case AVS_CS_Y14:
+        st->codecpar->format = AV_PIX_FMT_GRAY14;
+        planar               = 2;
+        break;
     case AVS_CS_Y16:
         st->codecpar->format = AV_PIX_FMT_GRAY16;
         planar               = 2;
         break;
+    /* Single precision floating point gray (AviSynth+) */
+    case AVS_CS_Y32:
+        st->codecpar->format = AV_PIX_FMT_GRAYF32;
+        planar               = 2;
+        break;
     /* pix_fmts added in AviSynth 2.6 */
     case AVS_CS_YV24:
         st->codecpar->format = AV_PIX_FMT_YUV444P;