Revision 098eefe1 libavcodec/h263.c

View differences:

libavcodec/h263.c
245 245
		    int motion_x, int motion_y)
246 246
{
247 247
    int cbpc, cbpy, i, cbp, pred_x, pred_y;
248
    int bits;
248 249
    
249 250
    //    printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
250 251
    if (!s->mb_intra) {
......
257 258
        if ((cbp | motion_x | motion_y) == 0) {
258 259
            /* skip macroblock */
259 260
            put_bits(&s->pb, 1, 1);
261
            s->misc_bits++;
262
            s->last_bits++;
263
            s->skip_count++;
260 264
            return;
261 265
        }
262 266
        put_bits(&s->pb, 1, 0);	/* mb coded */
......
267 271
        cbpy = cbp >> 2;
268 272
        cbpy ^= 0xf;
269 273
        put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
274
            
275
        bits= get_bit_count(&s->pb);
276
        s->misc_bits+= bits - s->last_bits;
277
        s->last_bits=bits;
270 278

  
271 279
        /* motion vectors: 16x16 mode only now */
272 280
        h263_pred_motion(s, 0, &pred_x, &pred_y);
......
274 282
        h263_encode_motion(s, motion_x - pred_x);
275 283
        h263_encode_motion(s, motion_y - pred_y);
276 284

  
285
        bits= get_bit_count(&s->pb);
286
        s->mv_bits+= bits - s->last_bits;
287
        s->last_bits=bits;
288

  
277 289
        /* encode each block */
278 290
        for (i = 0; i < 6; i++) {
279 291
            mpeg4_encode_block(s, block[i], i, 0, zigzag_direct);
280 292
        }
293
        bits= get_bit_count(&s->pb);
294
        s->p_tex_bits+= bits - s->last_bits;
295
        s->last_bits=bits;
296
        s->p_count++;
281 297
    } else {
282 298
        int dc_diff[6];   //dc values with the dc prediction subtracted 
283 299
        int dir[6];  //prediction direction
......
340 356
        cbpy = cbp >> 2;
341 357
        put_bits(&s->pb, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]);
342 358

  
359
        bits= get_bit_count(&s->pb);
360
        s->misc_bits+= bits - s->last_bits;
361
        s->last_bits=bits;
362

  
343 363
        /* encode each block */
344 364
        for (i = 0; i < 6; i++) {
345 365
            mpeg4_encode_block(s, block[i], i, dc_diff[i], scan_table[i]);
346 366
        }
347 367

  
368
        bits= get_bit_count(&s->pb);
369
        s->i_tex_bits+= bits - s->last_bits;
370
        s->last_bits=bits;
371
        s->i_count++;
372

  
348 373
        /* restore ac coeffs & last_index stuff if we messed them up with the prediction */
349 374
        if(s->ac_pred){
350 375
            for(i=0; i<6; i++){

Also available in: Unified diff