Revision 0ed714a7 libavcodec/h263.c

View differences:

libavcodec/h263.c
288 288

  
289 289
    put_bits(&s->pb, 1, 0);	/* no PEI */
290 290

  
291
    if(s->h263_slice_structured){
292
        put_bits(&s->pb, 1, 1);
293
        
294
        assert(s->mb_x == 0 && s->mb_y == 0);
295
        ff_h263_encode_mba(s);
296

  
297
        put_bits(&s->pb, 1, 1);
298
    }
299

  
291 300
    if(s->h263_aic){
292 301
         s->y_dc_scale_table= 
293 302
         s->c_dc_scale_table= ff_aic_dc_scale_table;
......
2814 2823
    int i, mb_pos;
2815 2824

  
2816 2825
    for(i=0; i<6; i++){
2817
        if(s->mb_num < ff_mba_max[i]) break;
2826
        if(s->mb_num-1 <= ff_mba_max[i]) break;
2818 2827
    }
2819 2828
    mb_pos= get_bits(&s->gb, ff_mba_length[i]);
2820 2829
    s->mb_x= mb_pos % s->mb_width;
......
2828 2837
    int i, mb_pos;
2829 2838

  
2830 2839
    for(i=0; i<6; i++){
2831
        if(s->mb_num < ff_mba_max[i]) break;
2840
        if(s->mb_num-1 <= ff_mba_max[i]) break;
2832 2841
    }
2833 2842
    mb_pos= s->mb_x + s->mb_width*s->mb_y;
2834 2843
    put_bits(&s->pb, ff_mba_length[i], mb_pos);
......
3135 3144
        align_get_bits(&s->gb);
3136 3145
    }
3137 3146

  
3147
//printf("checking next 16 %X\n", show_bits(&s->gb, 24));
3138 3148
    if(show_bits(&s->gb, 16)==0){
3139 3149
        if(s->codec_id==CODEC_ID_MPEG4)
3140 3150
            ret= mpeg4_decode_video_packet_header(s);
......
3146 3156
    //ok, its not where its supposed to be ...
3147 3157
    s->gb= s->last_resync_gb;
3148 3158
    align_get_bits(&s->gb);
3159
printf("align %X\n", show_bits(&s->gb, 24));
3149 3160
    left= s->gb.size_in_bits - get_bits_count(&s->gb);
3150 3161
    
3151 3162
    for(;left>16+1+5+5; left-=8){ 
......
3163 3174
        }
3164 3175
        skip_bits(&s->gb, 8);
3165 3176
    }
3166
    
3177
printf("no resync\n");
3167 3178
    return -1;
3168 3179
}
3169 3180

  
......
4962 4973
            
4963 4974
        s->qscale = get_bits(&s->gb, 5);
4964 4975
    }
4976

  
4965 4977
    /* PEI */
4966 4978
    while (get_bits1(&s->gb) != 0) {
4967 4979
        skip_bits(&s->gb, 8);
4968 4980
    }
4981
    
4982
    if(s->h263_slice_structured){
4983
        if (get_bits1(&s->gb) != 1) {
4984
            av_log(s->avctx, AV_LOG_ERROR, "SEPB1 marker missing\n");
4985
            return -1;
4986
        }
4987

  
4988
        ff_h263_decode_mba(s);
4989

  
4990
        if (get_bits1(&s->gb) != 1) {
4991
            av_log(s->avctx, AV_LOG_ERROR, "SEPB2 marker missing\n");
4992
            return -1;
4993
        }
4994
    }
4969 4995
    s->f_code = 1;
4970 4996
    
4971 4997
    if(s->h263_aic){

Also available in: Unified diff