avcodec/snowenc: allow larger mb variances
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 21 Mar 2014 17:29:16 +0000 (18:29 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 21 Mar 2014 17:34:54 +0000 (18:34 +0100)
Fixes assertion failure
Fixes Ticket3463

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/snowenc.c

index da79e75..5fea269 100644 (file)
@@ -1502,8 +1502,8 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
     }
 
     /* ugly, ratecontrol just takes a sqrt again */
-    coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
     av_assert0(coef_sum < INT_MAX);
+    coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
 
     if(pict->pict_type == AV_PICTURE_TYPE_I){
         s->m.current_picture.mb_var_sum= coef_sum;