]> git.sesse.net Git - ffmpeg/commitdiff
libx265: Update API usage
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Fri, 21 Feb 2014 16:26:40 +0000 (11:26 -0500)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Mon, 24 Feb 2014 15:50:04 +0000 (15:50 +0000)
Framerate is now a sane rational instead of an integer, and
inputDepth is changed to what it actually is.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
configure
libavcodec/libx265.c

index 53afde0ce210a4abcf67d383c54eb1e45b3d8eac..bd26c9a9d1f56dd9addee9e370a11f23da012f3c 100755 (executable)
--- a/configure
+++ b/configure
@@ -3982,8 +3982,8 @@ enabled libx264           && require libx264 x264.h x264_encoder_encode -lx264 &
                              { check_cpp_condition x264.h "X264_BUILD >= 118" ||
                                die "ERROR: libx264 version must be >= 0.118."; }
 enabled libx265           && require_pkg_config x265 x265.h x265_encoder_encode &&
-                             { check_cpp_condition x265.h "X265_BUILD >= 5" ||
-                               die "ERROR: libx265 version must be >= 5."; }
+                             { check_cpp_condition x265.h "X265_BUILD >= 7" ||
+                               die "ERROR: libx265 version must be >= 7."; }
 enabled libxavs           && require libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvid           && require libxvid xvid.h xvid_global -lxvidcore
 enabled openssl           && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
index 9f2d310eb75d305302ef3dc85d78a6b9ba92cb83..102e5fc1afbc262f1c6e78a5c0d790019b639edb 100644 (file)
@@ -99,10 +99,15 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
     }
 
     ctx->params->frameNumThreads = avctx->thread_count;
-    ctx->params->frameRate       = (int) (avctx->time_base.den / avctx->time_base.num);
+    ctx->params->fpsNum          = avctx->time_base.den;
+    ctx->params->fpsDenom        = avctx->time_base.num * avctx->ticks_per_frame;
     ctx->params->sourceWidth     = avctx->width;
     ctx->params->sourceHeight    = avctx->height;
-    ctx->params->inputBitDepth   = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1;
+
+    if (x265_max_bit_depth == 8)
+        ctx->params->internalBitDepth = 8;
+    else if (x265_max_bit_depth == 12)
+        ctx->params->internalBitDepth = 10;
 
     if (avctx->bit_rate > 0) {
         ctx->params->rc.bitrate         = avctx->bit_rate / 1000;
@@ -189,7 +194,8 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
            x265pic.stride[i] = pic->linesize[i];
         }
 
-        x265pic.pts = pic->pts;
+        x265pic.pts      = pic->pts;
+        x265pic.bitDepth = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].depth_minus1 + 1;
     }
 
     ret = x265_encoder_encode(ctx->encoder, &nal, &nnal,