[FFmpeg-cvslog] avcodec/libdav1d: add support for 12bit streams

James Almer git at videolan.org
Wed Dec 12 05:08:32 EET 2018


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Dec 12 00:06:05 2018 -0300| [0e833f615b59cd7611374d1d77257eaf00635ad7] | committer: James Almer

avcodec/libdav1d: add support for 12bit streams

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e833f615b59cd7611374d1d77257eaf00635ad7
---

 libavcodec/libdav1d.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 52a7c10617..7f0b96e0cd 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -79,11 +79,11 @@ static void libdav1d_frame_free(void *opaque, uint8_t *data) {
     dav1d_picture_unref(&p);
 }
 
-static const enum AVPixelFormat pix_fmt[][2] = {
-    [DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8,   AV_PIX_FMT_GRAY10 },
-    [DAV1D_PIXEL_LAYOUT_I420] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10 },
-    [DAV1D_PIXEL_LAYOUT_I422] = { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10 },
-    [DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10 },
+static const enum AVPixelFormat pix_fmt[][3] = {
+    [DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8,   AV_PIX_FMT_GRAY10,    AV_PIX_FMT_GRAY12 },
+    [DAV1D_PIXEL_LAYOUT_I420] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12 },
+    [DAV1D_PIXEL_LAYOUT_I422] = { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12 },
+    [DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12 },
 };
 
 static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
@@ -151,7 +151,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
     frame->linesize[2] = p.stride[1];
 
     c->profile = p.seq_hdr->profile;
-    frame->format = c->pix_fmt = pix_fmt[p.p.layout][p.p.bpc == 10];
+    frame->format = c->pix_fmt = pix_fmt[p.p.layout][p.seq_hdr->hbd];
     frame->width = p.p.w;
     frame->height = p.p.h;
     if (c->width != p.p.w || c->height != p.p.h) {



More information about the ffmpeg-cvslog mailing list