[FFmpeg-devel] [PATCH 2/5] libx265: Support 4:4:4

Derek Buitenhuis derek.buitenhuis at gmail.com
Fri Feb 21 18:15:30 CET 2014


Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 libavcodec/libx265.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index a1932f6..9392f1b 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -109,6 +109,17 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
     else if (x265_max_bit_depth == 12)
         ctx->params->internalBitDepth = 10;
 
+    switch (avctx->pix_fmt) {
+    case AV_PIX_FMT_YUV420P:
+    case AV_PIX_FMT_YUV420P10:
+        ctx->params->internalCsp = X265_CSP_I420;
+        break;
+    case AV_PIX_FMT_YUV444P:
+    case AV_PIX_FMT_YUV444P10:
+        ctx->params->internalCsp = X265_CSP_I444;
+        break;
+    }
+
     if (avctx->bit_rate > 0) {
         ctx->params->rc.bitrate         = avctx->bit_rate / 1000;
         ctx->params->rc.rateControlMode = X265_RC_ABR;
@@ -242,12 +253,15 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static const enum AVPixelFormat x265_csp_eight[] = {
     AV_PIX_FMT_YUV420P,
+    AV_PIX_FMT_YUV444P,
     AV_PIX_FMT_NONE
 };
 
 static const enum AVPixelFormat x265_csp_twelve[] = {
     AV_PIX_FMT_YUV420P,
+    AV_PIX_FMT_YUV444P,
     AV_PIX_FMT_YUV420P10,
+    AV_PIX_FMT_YUV444P10,
     AV_PIX_FMT_NONE
 };
 
-- 
1.9.0.rc3



More information about the ffmpeg-devel mailing list