summaryrefslogtreecommitdiff
path: root/libavcodec/cabac.c
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2015-04-10 10:27:34 -0700
committerMichael Niedermayer <michaelni@gmx.at>2015-04-10 21:49:37 +0200
commit744594685e815583fab8db515419f80b4cf0deec (patch)
tree533dce05696c5e92c297a5d08c14b601db82463e /libavcodec/cabac.c
parent61090db29a3e8364431d46c16770425815f7608a (diff)
cabac-test: Return 1 if there are any errors
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cabac.c')
-rw-r--r--libavcodec/cabac.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index 81a75dd52a..c755d7f6d9 100644
--- a/libavcodec/cabac.c
+++ b/libavcodec/cabac.c
@@ -174,7 +174,7 @@ int main(void){
CABACContext c;
uint8_t b[9*SIZE];
uint8_t r[9*SIZE];
- int i;
+ int i, ret = 0;
uint8_t state[10]= {0};
AVLFG prng;
@@ -207,21 +207,27 @@ STOP_TIMER("put_cabac")
for(i=0; i<SIZE; i++){
START_TIMER
- if( (r[i]&1) != get_cabac_bypass(&c) )
+ if( (r[i]&1) != get_cabac_bypass(&c) ) {
av_log(NULL, AV_LOG_ERROR, "CABAC bypass failure at %d\n", i);
+ ret = 1;
+ }
STOP_TIMER("get_cabac_bypass")
}
for(i=0; i<SIZE; i++){
START_TIMER
- if( (r[i]&1) != get_cabac_noinline(&c, state) )
+ if( (r[i]&1) != get_cabac_noinline(&c, state) ) {
av_log(NULL, AV_LOG_ERROR, "CABAC failure at %d\n", i);
+ ret = 1;
+ }
STOP_TIMER("get_cabac")
}
- if(!get_cabac_terminate(&c))
+ if(!get_cabac_terminate(&c)) {
av_log(NULL, AV_LOG_ERROR, "where's the Terminator?\n");
+ ret = 1;
+ }
- return 0;
+ return ret;
}
#endif /* TEST */