diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2015-02-17 17:04:51 -0500 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2015-02-18 10:21:54 -0500 |
commit | b920db67317a31f0e8d4a010faa26dbd12b0dcdb (patch) | |
tree | cc0e86a52de9df31aca897af958b5a594cf1d092 /libavcodec/libx265.c | |
parent | b68d902b6eec9882213ab860ff8a5f27ba49c7a0 (diff) | |
download | ffmpeg-b920db67317a31f0e8d4a010faa26dbd12b0dcdb.tar.gz |
libx265: Reduce the scope of some variables
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/libx265.c')
-rw-r--r-- | libavcodec/libx265.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index aee7ae2274..9f40e95f41 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -76,10 +76,6 @@ static av_cold int libx265_encode_close(AVCodecContext *avctx) static av_cold int libx265_encode_init(AVCodecContext *avctx) { libx265Context *ctx = avctx->priv_data; - x265_nal *nal; - char sar[12]; - int sar_num, sar_den; - int nnal; if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL && !av_pix_fmt_desc_get(avctx->pix_fmt)->log2_chroma_w) { @@ -114,6 +110,9 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx) ctx->params->bEnablePsnr = !!(avctx->flags & CODEC_FLAG_PSNR); if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) { + char sar[12]; + int sar_num, sar_den; + av_reduce(&sar_num, &sar_den, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 65535); @@ -180,6 +179,9 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx) } if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) { + x265_nal *nal; + int nnal; + avctx->extradata_size = x265_encoder_headers(ctx->encoder, &nal, &nnal); if (avctx->extradata_size <= 0) { av_log(avctx, AV_LOG_ERROR, "Cannot encode headers.\n"); |