diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2014-02-21 11:26:40 -0500 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2014-02-24 11:09:30 -0500 |
commit | d3736471948cd06851f6b3aef352ef285b7c6480 (patch) | |
tree | 36f799558a3de338e125286f8812732635737d55 | |
parent | 2a3cb1cfcaf45fb548b0cddc7c9e155f43582aec (diff) | |
download | ffmpeg-d3736471948cd06851f6b3aef352ef285b7c6480.tar.gz |
libx265: Update API usage
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>
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | libavcodec/libx265.c | 12 |
2 files changed, 11 insertions, 5 deletions
@@ -4520,8 +4520,8 @@ enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 & { check_cpp_condition x264.h "X264_BUILD >= 118" || die "ERROR: libx264 must be installed and 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 libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 3b9123704d..01833d99d6 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -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, |