Revision 2f16af06

View differences:

libavcodec/motion_est.c
1843 1843
    get_limits(s, 16*mb_x, 16*mb_y);
1844 1844

  
1845 1845
    c->skip=0;
1846

  
1847
    if(s->codec_id == CODEC_ID_MPEG4 && s->next_picture.mbskip_table[xy]){
1848
        int score= direct_search(s, mb_x, mb_y); //FIXME just check 0,0
1849

  
1850
        score= ((unsigned)(score*score + 128*256))>>16;
1851
        c->mc_mb_var_sum_temp += score;
1852
        s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE
1853
        s->mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_DIRECT0;
1854

  
1855
        return;
1856
    }
1857

  
1846 1858
    if(c->avctx->me_threshold){
1847 1859
        int vard= check_input_motion(s, mb_x, mb_y, 0);
1848 1860

  
libavcodec/mpegvideo.c
5226 5226
                    }
5227 5227
                }
5228 5228

  
5229
                if(s->flags & CODEC_FLAG_QP_RD){
5230
                    if(best_s.mv_type==MV_TYPE_16X16 && !(best_s.mv_dir&MV_DIRECT)){
5229
                if((s->flags & CODEC_FLAG_QP_RD) && dmin < INT_MAX){
5230
                    if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD
5231 5231
                        const int last_qp= backup_s.qscale;
5232 5232
                        int qpi, qp, dc[6];
5233 5233
                        DCTELEM ac[6][16];
......
5283 5283
                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
5284 5284
                                 &dmin, &next_block, mx, my);
5285 5285
                }
5286
                if(mb_type&CANDIDATE_MB_TYPE_DIRECT0){
5287
                    backup_s.dquant = 0;
5288
                    s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT;
5289
                    s->mb_intra= 0;
5290
                    ff_mpeg4_set_direct_mv(s, 0, 0);
5291
                    encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb,
5292
                                 &dmin, &next_block, 0, 0);
5293
                }
5286 5294
                s->current_picture.qscale_table[xy]= best_s.qscale;
5287 5295

  
5288 5296
                copy_context_after_encode(s, &best_s, -1);
libavcodec/mpegvideo.h
402 402
#define CANDIDATE_MB_TYPE_BACKWARD_I 0x400
403 403
#define CANDIDATE_MB_TYPE_BIDIR_I    0x800
404 404

  
405
#define CANDIDATE_MB_TYPE_DIRECT0    0x1000
406

  
405 407
    int block_index[6]; ///< index to current MB in block based arrays with edges
406 408
    int block_wrap[6];
407 409
    uint8_t *dest[3];
tests/rotozoom.regression.ref
67 67
6455232 ./data/a-huffyuv.avi
68 68
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
69 69
stddev:  0.00 PSNR:99.99 bytes:7602176
70
1fd3bddc95fa01ee4c4b383373803c67 *./data/a-mpeg4-rc.avi
71
227936 ./data/a-mpeg4-rc.avi
72
fa9079e35ff819c39656de95319846fb *./data/out.yuv
70
968ca132d8cf46f84e657abcf8473b7c *./data/a-mpeg4-rc.avi
71
227934 ./data/a-mpeg4-rc.avi
72
895773fe8250c806a0d1592a6dd12401 *./data/out.yuv
73 73
stddev:  4.24 PSNR:35.56 bytes:7602176
74 74
9001cf571eb7f26fa5592bdec6538583 *./data/a-mpeg4-adv.avi
75 75
173590 ./data/a-mpeg4-adv.avi
76 76
699edf05648fdc42196b7bebef9be269 *./data/out.yuv
77 77
stddev:  4.84 PSNR:34.41 bytes:7602176
78
7006aa0ad8643348ec0d6d87bf03202c *./data/a-mpeg4-qprd.avi
79
235016 ./data/a-mpeg4-qprd.avi
80
224969c07440a23b376521c484936e75 *./data/out.yuv
81
stddev:  4.24 PSNR:35.56 bytes:7602176
78
edd969be2816c13ae078b7a0416a5715 *./data/a-mpeg4-qprd.avi
79
234852 ./data/a-mpeg4-qprd.avi
80
51fa46add28e145c1a5ce6b27a4c57b8 *./data/out.yuv
81
stddev:  4.24 PSNR:35.57 bytes:7602176
82 82
7ecfbb848740d316e2fcf573b32cb848 *./data/a-mpeg4-adap.avi
83 83
205454 ./data/a-mpeg4-adap.avi
84 84
c9225addf2e620e0094d26e805693af1 *./data/out.yuv

Also available in: Unified diff