Ticket #3001: 3001_revert_ffmpeg_6942_and_6953.diff

File 3001_revert_ffmpeg_6942_and_6953.diff, 1.9 KB (added by Janne Grunau, 17 years ago)
  • mythtv/libs/libavcodec/h263.c

    diff --git a/mythtv/libs/libavcodec/h263.c b/mythtv/libs/libavcodec/h263.c
    index 057428a..2603098 100644
    a b void ff_mpeg4_encode_video_packet_header(MpegEncContext *s) 
    32093209 * @return 0 if not
    32103210 */
    32113211static inline int mpeg4_is_resync(MpegEncContext *s){
    3212     int bits_count= get_bits_count(&s->gb);
    3213     int v= show_bits(&s->gb, 16);
     3212    const int bits_count= get_bits_count(&s->gb);
    32143213
    32153214    if(s->workaround_bugs&FF_BUG_NO_PADDING){
    32163215        return 0;
    32173216    }
    32183217
    3219     while(v<=0xFF){
    3220         if(s->pict_type==B_TYPE || (v>>(8-s->pict_type)!=1) || s->partitioned_frame)
    3221             break;
    3222         skip_bits(&s->gb, 8+s->pict_type);
    3223         bits_count+= 8+s->pict_type;
    3224         v= show_bits(&s->gb, 16);
    3225     }
    3226 
    32273218    if(bits_count + 8 >= s->gb.size_in_bits){
    3228         v>>=8;
     3219        int v= show_bits(&s->gb, 8);
    32293220        v|= 0x7F >> (7-(bits_count&7));
    32303221
    32313222        if(v==0x7F)
    32323223            return 1;
    32333224    }else{
    3234         if(v == ff_mpeg4_resync_prefix[bits_count&7]){
     3225        if(show_bits(&s->gb, 16) == ff_mpeg4_resync_prefix[bits_count&7]){
    32353226            int len;
    32363227            GetBitContext gb= s->gb;
    32373228
    end: 
    45504541
    45514542        /* per-MB end of slice check */
    45524543    if(s->codec_id==CODEC_ID_MPEG4){
     4544#if 0 //http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_IEC_14496-4_2004_Conformance_Testing/video_conformance/version_1/simple/ERROR.ZIP/mit025.m4v needs this but its unclear if the mpeg4 standard allows this at all (MN)
     4545        if(s->pict_type != B_TYPE){
     4546            while(show_bits(&s->gb, 9 + (s->pict_type == P_TYPE)) == 1)
     4547                skip_bits(&s->gb, 9 + (s->pict_type == P_TYPE));
     4548        }
     4549#endif
    45534550        if(mpeg4_is_resync(s)){
    45544551            const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1;
    45554552            if(s->pict_type==B_TYPE && s->next_picture.mbskip_table[xy + delta])