X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=blobdiff_plain;f=libavcodec%2Fhevcdec.c;h=23a89345a840e02c7fe605857ea819137fad4711;hp=fc9a5b749e1be3ecad6b02ba535cf5d12f26d2bb;hb=000fb61a71c6288c377167fea1541700aef3612d;hpb=43c394dcaebe9eec5802b420f273385473380909 diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index fc9a5b749e..23a89345a8 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -288,13 +288,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; @@ -3118,7 +3119,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; @@ -3404,6 +3404,6 @@ AVCodec ff_hevc_decoder = { .init_thread_copy = hevc_init_thread_copy, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, - .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING, .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), };