]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/hevc_parser.c
avcodec/tiff: Use av_fast_padded_malloc() in tiff_unpack_fax()
[ffmpeg] / libavcodec / hevc_parser.c
index c72b1465f12d1df7977dcc9238dec65a84201c2d..dc63c6b95433bf3e13dbd84fa35ef914dc04f980 100644 (file)
@@ -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;
@@ -267,7 +269,7 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
 
         nut = (pc->state64 >> 2 * 8 + 1) & 0x3F;
         // Beginning of access unit
-        if ((nut >= HEVC_NAL_VPS && nut <= HEVC_NAL_AUD) || nut == HEVC_NAL_SEI_PREFIX ||
+        if ((nut >= HEVC_NAL_VPS && nut <= HEVC_NAL_EOB_NUT) || nut == HEVC_NAL_SEI_PREFIX ||
             (nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) {
             if (pc->frame_start_found) {
                 pc->frame_start_found = 0;