summaryrefslogtreecommitdiff
path: root/libavcodec/hevcdec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-12-18 21:11:47 +0100
committerAnton Khirnov <anton@khirnov.net>2017-01-12 16:27:56 +0100
commita02ae1c6837a54ed9e7735da2b1f789b2f4b6e13 (patch)
tree204060552648d600f0a9f68090fde798692cfe80 /libavcodec/hevcdec.c
parent019ab88a95cb31b698506d90e8ce56695a7f1cc5 (diff)
hevcdec: export cropping information instead of handling it internally
Diffstat (limited to 'libavcodec/hevcdec.c')
-rw-r--r--libavcodec/hevcdec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 700b5f09a0..a4c936ee05 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -338,13 +338,14 @@ static void export_stream_params(AVCodecContext *avctx, const HEVCParamSets *ps,
const HEVCSPS *sps)
{
const HEVCVPS *vps = (const HEVCVPS*)ps->vps_list[sps->vps_id]->data;
+ const HEVCWindow *ow = &sps->output_window;
unsigned int num = 0, den = 0;
avctx->pix_fmt = sps->pix_fmt;
avctx->coded_width = sps->width;
avctx->coded_height = sps->height;
- avctx->width = sps->output_width;
- avctx->height = sps->output_height;
+ avctx->width = sps->width - ow->left_offset - ow->right_offset;
+ avctx->height = sps->height - ow->top_offset - ow->bottom_offset;
avctx->has_b_frames = sps->temporal_layer[sps->max_sub_layers - 1].num_reorder_pics;
avctx->profile = sps->ptl.general_ptl.profile_idc;
avctx->level = sps->ptl.general_ptl.level_idc;
@@ -2864,7 +2865,6 @@ static int hevc_ref_frame(HEVCContext *s, HEVCFrame *dst, HEVCFrame *src)
dst->poc = src->poc;
dst->ctb_count = src->ctb_count;
- dst->window = src->window;
dst->flags = src->flags;
dst->sequence = src->sequence;
@@ -3092,4 +3092,5 @@ AVCodec ff_hevc_decoder = {
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_FRAME_THREADS,
.profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
+ .caps_internal = FF_CODEC_CAP_EXPORTS_CROPPING,
};