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 15:50:04 +0000 |
commit | d00a504b244e136a0c82a55e21ed94659e0674ad (patch) | |
tree | 24562510e7ae4efa8512292ab9135432d43e50be /libavcodec/libx265.c | |
parent | 30517a9f056c8d01b3790871db4aee95d9c176e6 (diff) | |
download | ffmpeg-d00a504b244e136a0c82a55e21ed94659e0674ad.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>
Diffstat (limited to 'libavcodec/libx265.c')
-rw-r--r-- | libavcodec/libx265.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 9f2d310eb7..102e5fc1af 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, |