i'll change my code to use reference motion vector > > if((y*16)+my_vector[2*(x+mb_width*y)+1]<0) i decrease quant for all mblock that have his reference out of the image my problem is that sometimes it does not work.. i'll ack my code and sent you encoder.c so you can try it and see what will happen to image