Mercurial > libavcodec.hg
comparison motion_est_template.c @ 952:f348d302a51e libavcodec
pre motion estimation cleanup/bugfix
author | michaelni |
---|---|
date | Thu, 02 Jan 2003 12:48:09 +0000 |
parents | 371bc36a9c5c |
children | 13aec7e50c52 |
comparison
equal
deleted
inserted
replaced
951:ad264a7d4f94 | 952:f348d302a51e |
---|---|
833 CMP(dmin, 0, 0, size); | 833 CMP(dmin, 0, 0, size); |
834 map[0]= map_generation; | 834 map[0]= map_generation; |
835 score_map[0]= dmin; | 835 score_map[0]= dmin; |
836 | 836 |
837 /* first line */ | 837 /* first line */ |
838 if ((s->mb_y == 0 || s->first_slice_line)) { | 838 if (s->mb_y == 0) { |
839 CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) | 839 CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) |
840 CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, | 840 CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, |
841 (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) | 841 (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) |
842 }else{ | 842 }else{ |
843 if(dmin<256 && ( P_LEFT[0] |P_LEFT[1] | 843 if(dmin<256 && ( P_LEFT[0] |P_LEFT[1] |
856 CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift) | 856 CHECK_MV(P_TOP[0] >>shift, P_TOP[1] >>shift) |
857 CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) | 857 CHECK_MV(P_TOPRIGHT[0]>>shift, P_TOPRIGHT[1]>>shift) |
858 } | 858 } |
859 } | 859 } |
860 if(dmin>256*4){ | 860 if(dmin>256*4){ |
861 CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, | 861 if(s->me.pre_pass){ |
862 (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) | 862 CHECK_CLIPED_MV((last_mv[ref_mv_xy-1][0]*ref_mv_scale + (1<<15))>>16, |
863 CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, | 863 (last_mv[ref_mv_xy-1][1]*ref_mv_scale + (1<<15))>>16) |
864 (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) | 864 CHECK_CLIPED_MV((last_mv[ref_mv_xy-ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, |
865 (last_mv[ref_mv_xy-ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) | |
866 }else{ | |
867 CHECK_CLIPED_MV((last_mv[ref_mv_xy+1][0]*ref_mv_scale + (1<<15))>>16, | |
868 (last_mv[ref_mv_xy+1][1]*ref_mv_scale + (1<<15))>>16) | |
869 CHECK_CLIPED_MV((last_mv[ref_mv_xy+ref_mv_stride][0]*ref_mv_scale + (1<<15))>>16, | |
870 (last_mv[ref_mv_xy+ref_mv_stride][1]*ref_mv_scale + (1<<15))>>16) | |
871 } | |
865 } | 872 } |
866 | 873 |
867 if(s->avctx->last_predictor_count){ | 874 if(s->avctx->last_predictor_count){ |
868 const int count= s->avctx->last_predictor_count; | 875 const int count= s->avctx->last_predictor_count; |
869 const int xstart= FFMAX(0, s->mb_x - count); | 876 const int xstart= FFMAX(0, s->mb_x - count); |
936 map_generation= update_map_generation(s); | 943 map_generation= update_map_generation(s); |
937 | 944 |
938 dmin = 1000000; | 945 dmin = 1000000; |
939 //printf("%d %d %d %d //",xmin, ymin, xmax, ymax); | 946 //printf("%d %d %d %d //",xmin, ymin, xmax, ymax); |
940 /* first line */ | 947 /* first line */ |
941 if ((s->mb_y == 0 || s->first_slice_line) && block<2) { | 948 if (s->mb_y == 0 && block<2) { |
942 CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) | 949 CHECK_MV(P_LEFT[0]>>shift, P_LEFT[1]>>shift) |
943 CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, | 950 CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, |
944 (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) | 951 (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) |
945 CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) | 952 CHECK_MV(P_MV1[0]>>shift, P_MV1[1]>>shift) |
946 }else{ | 953 }else{ |