summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-05-08 15:46:22 -0300
committerJames Almer <jamrial@gmail.com>2017-05-26 11:15:45 -0300
commit000fb61a71c6288c377167fea1541700aef3612d (patch)
treee4a5d4c5c6ab8184017eef6617442d4907af7f0e /libavcodec/hevc_parser.c
parent43c394dcaebe9eec5802b420f273385473380909 (diff)
avcodec/hevcdec: export cropping information instead of handling it internally
This merges commit a02ae1c6837a54ed9e7735da2b1f789b2f4b6e13 from libav, originally written by Anton Khirnov and skipped in fc63d5ceb357c4b760cb02772de0b50d0557140f. libavcodec/hevc_parser.c | 6 ++++-- libavcodec/hevc_ps.c | 31 ++++++++++++------------------- libavcodec/hevc_ps.h | 2 -- libavcodec/hevc_refs.c | 18 +++++------------- libavcodec/hevcdec.c | 7 ++++--- libavcodec/hevcdec.h | 2 -- 6 files changed, 25 insertions(+), 41 deletions(-) Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevc_parser.c')
-rw-r--r--libavcodec/hevc_parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 2b58eb62fe..dc63c6b954 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -57,6 +57,7 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal,
HEVCSEIContext *sei = &ctx->sei;
SliceHeader *sh = &ctx->sh;
GetBitContext *gb = &nal->gb;
+ const HEVCWindow *ow;
int i, num = 0, den = 0;
sh->first_slice_in_pic_flag = get_bits1(gb);
@@ -83,11 +84,12 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal,
ps->sps = (HEVCSPS*)ps->sps_list[ps->pps->sps_id]->data;
ps->vps = (HEVCVPS*)ps->vps_list[ps->sps->vps_id]->data;
}
+ ow = &ps->sps->output_window;
s->coded_width = ps->sps->width;
s->coded_height = ps->sps->height;
- s->width = ps->sps->output_width;
- s->height = ps->sps->output_height;
+ s->width = ps->sps->width - ow->left_offset - ow->right_offset;
+ s->height = ps->sps->height - ow->top_offset - ow->bottom_offset;
s->format = ps->sps->pix_fmt;
avctx->profile = ps->sps->ptl.general_ptl.profile_idc;
avctx->level = ps->sps->ptl.general_ptl.level_idc;