Revision fe9a3fbe libavcodec/h264.c

View differences:

libavcodec/h264.c
1678 1678
}
1679 1679

  
1680 1680
/**
1681
 * computes profile from profile_idc and constraint_set?_flags
1682
 *
1683
 * @param sps SPS
1684
 *
1685
 * @return profile as defined by FF_PROFILE_H264_*
1686
 */
1687
int ff_h264_get_profile(SPS *sps)
1688
{
1689
    int profile = sps->profile_idc;
1690

  
1691
    switch(sps->profile_idc) {
1692
    case FF_PROFILE_H264_BASELINE:
1693
        // constraint_set1_flag set to 1
1694
        profile |= (sps->constraint_set_flags & 1<<1) ? FF_PROFILE_H264_CONSTRAINED : 0;
1695
        break;
1696
    case FF_PROFILE_H264_HIGH_10:
1697
    case FF_PROFILE_H264_HIGH_422:
1698
    case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
1699
        // constraint_set3_flag set to 1
1700
        profile |= (sps->constraint_set_flags & 1<<3) ? FF_PROFILE_H264_INTRA : 0;
1701
        break;
1702
    }
1703

  
1704
    return profile;
1705
}
1706

  
1707
/**
1681 1708
 * decodes a slice header.
1682 1709
 * This will also call MPV_common_init() and frame_start() as needed.
1683 1710
 *
......
1756 1783
    }
1757 1784
    h->sps = *h0->sps_buffers[h->pps.sps_id];
1758 1785

  
1759
    s->avctx->profile = h->sps.profile_idc;
1786
    s->avctx->profile = ff_h264_get_profile(&h->sps);
1760 1787
    s->avctx->level   = h->sps.level_idc;
1761 1788
    s->avctx->refs    = h->sps.ref_frame_count;
1762 1789

  

Also available in: Unified diff