changeset 2420:842e5e7f3b7a libavcodec

fixing selftest
author michael
date Tue, 11 Jan 2005 03:18:08 +0000
parents 0c5ceb97815d
children e326490f58c4
files cabac.c
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/cabac.c	Mon Jan 10 23:41:25 2005 +0000
+++ b/cabac.c	Tue Jan 11 03:18:08 2005 +0000
@@ -150,6 +150,9 @@
 
 #if 0 //selftest
 #define SIZE 10240
+
+#include "avcodec.h"
+
 int main(){
     CABACContext c;
     uint8_t b[9*SIZE];
@@ -197,33 +200,33 @@
     for(i=0; i<SIZE; i++){
 START_TIMER
         if( (r[i]&1) != get_cabac_bypass(&c) )
-            printf("CABAC bypass failure at %d\n", i);
+            av_log(NULL, AV_LOG_ERROR, "CABAC bypass failure at %d\n", i);
 STOP_TIMER("get_cabac_bypass")
     }
     
     for(i=0; i<SIZE; i++){
 START_TIMER
         if( (r[i]&1) != get_cabac(&c, state) )
-            printf("CABAC failure at %d\n", i);
+            av_log(NULL, AV_LOG_ERROR, "CABAC failure at %d\n", i);
 STOP_TIMER("get_cabac")
     }
-
+#if 0
     for(i=0; i<SIZE; i++){
 START_TIMER
         if( r[i] != get_cabac_u(&c, state, (i&1) ? 6 : 7, 3, i&1) )
-            printf("CABAC unary (truncated) binarization failure at %d\n", i);
+            av_log(NULL, AV_LOG_ERROR, "CABAC unary (truncated) binarization failure at %d\n", i);
 STOP_TIMER("get_cabac_u")
     }
 
     for(i=0; i<SIZE; i++){
 START_TIMER
         if( r[i] != get_cabac_ueg(&c, state, 3, 0, 1, 2))
-            printf("CABAC unary (truncated) binarization failure at %d\n", i);
+            av_log(NULL, AV_LOG_ERROR, "CABAC unary (truncated) binarization failure at %d\n", i);
 STOP_TIMER("get_cabac_ueg")
     }
-
+#endif
     if(!get_cabac_terminate(&c))
-        printf("where's the Terminator?\n");
+        av_log(NULL, AV_LOG_ERROR, "where's the Terminator?\n");
     
     return 0;
 }