[FFmpeg-cvslog] snowenc: change a bunch of assert() to av_assert()

Michael Niedermayer git at videolan.org
Sat Aug 24 01:11:08 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Aug 23 22:31:27 2013 +0200| [3941a4f5c2a48d46dd67a788983de89594231479] | committer: Michael Niedermayer

snowenc: change a bunch of assert() to av_assert()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3941a4f5c2a48d46dd67a788983de89594231479
---

 libavcodec/snowenc.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 9d4efa4..ff96f89 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -390,8 +390,8 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
     s->m.mb_y= 0;
     c->skip= 0;
 
-    assert(c->  stride ==   stride);
-    assert(c->uvstride == uvstride);
+    av_assert1(c->  stride ==   stride);
+    av_assert1(c->uvstride == uvstride);
 
     c->penalty_factor    = get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_cmp);
     c->sub_penalty_factor= get_penalty_factor(s->lambda, s->lambda2, c->avctx->me_sub_cmp);
@@ -430,10 +430,10 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
         ref_score= ff_epzs_motion_search(&s->m, &ref_mx, &ref_my, P, 0, /*ref_index*/ 0, last_mv,
                                          (1<<16)>>shift, level-LOG2_MB_SIZE+4, block_w);
 
-        assert(ref_mx >= c->xmin);
-        assert(ref_mx <= c->xmax);
-        assert(ref_my >= c->ymin);
-        assert(ref_my <= c->ymax);
+        av_assert2(ref_mx >= c->xmin);
+        av_assert2(ref_mx <= c->xmax);
+        av_assert2(ref_my >= c->ymin);
+        av_assert2(ref_my <= c->ymax);
 
         ref_score= c->sub_motion_search(&s->m, &ref_mx, &ref_my, ref_score, 0, 0, level-LOG2_MB_SIZE+4, block_w);
         ref_score= ff_get_mb_score(&s->m, ref_mx, ref_my, 0, 0, level-LOG2_MB_SIZE+4, block_w, 0);
@@ -776,7 +776,7 @@ static int get_block_rd(SnowContext *s, int mb_x, int mb_y, int plane_index, uin
             }
         }
     }else{
-        assert(block_w==8);
+        av_assert2(block_w==8);
         distortion = s->dsp.me_cmp[0](&s->m, src + sx + sy*ref_stride, dst + sx + sy*ref_stride, ref_stride, block_w*2);
     }
 
@@ -997,8 +997,8 @@ static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y, int
     unsigned value;
     int rd, index;
 
-    assert(mb_x>=0 && mb_y>=0);
-    assert(mb_x<b_stride);
+    av_assert2(mb_x>=0 && mb_y>=0);
+    av_assert2(mb_x<b_stride);
 
     if(intra){
         block->color[0] = p[0];
@@ -1051,9 +1051,9 @@ static av_always_inline int check_4block_inter(SnowContext *s, int mb_x, int mb_
     backup[2] = block[b_stride];
     backup[3] = block[b_stride + 1];
 
-    assert(mb_x>=0 && mb_y>=0);
-    assert(mb_x<b_stride);
-    assert(((mb_x|mb_y)&1) == 0);
+    av_assert2(mb_x>=0 && mb_y>=0);
+    av_assert2(mb_x<b_stride);
+    av_assert2(((mb_x|mb_y)&1) == 0);
 
     index= (p0 + 31*p1) & (ME_CACHE_SIZE-1);
     value= s->me_cache_generation + (p0>>10) + (p1<<6) + (block->ref<<12);
@@ -1601,7 +1601,7 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
 
     /* ugly, ratecontrol just takes a sqrt again */
     coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
-    assert(coef_sum < INT_MAX);
+    av_assert0(coef_sum < INT_MAX);
 
     if(pict->pict_type == AV_PICTURE_TYPE_I){
         s->m.current_picture.mb_var_sum= coef_sum;



More information about the ffmpeg-cvslog mailing list