diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 4690380a0e8e93efd250ebb9855e5c8580086a3c..1c4ba3d40c202bdd2d83f69e9f5375d952f700da 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -4349,9 +4349,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
                 if(s->codec_id==CODEC_ID_MPEG4){
                     if(!s->mb_intra){
                         if(s->pict_type == B_TYPE){
-                            if(s->dquant&1)
-                                s->dquant= 0;
-                            if(s->mv_dir&MV_DIRECT)
+                            if(s->dquant&1 || s->mv_dir&MV_DIRECT)
                                 s->dquant= 0;
                         }
                         if(s->mv_type==MV_TYPE_8X8)