From d12b5b2f135aade4099f4b26b0fe678656158c13 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 17 Mar 2016 19:13:17 +0100 Subject: build: Split test programs off into separate files This avoids spurious library rebuilds when only the test program code is changed and simplifies the build system. --- libavcodec/rangecoder.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'libavcodec/rangecoder.c') diff --git a/libavcodec/rangecoder.c b/libavcodec/rangecoder.c index 86bc362..4c4731d 100644 --- a/libavcodec/rangecoder.c +++ b/libavcodec/rangecoder.c @@ -113,47 +113,3 @@ int ff_rac_terminate(RangeCoder *c) return c->bytestream - c->bytestream_start; } - -#ifdef TEST -#define SIZE 10240 - -#include "libavutil/lfg.h" -#include "libavutil/log.h" - -int main(void) -{ - RangeCoder c; - uint8_t b[9 * SIZE]; - uint8_t r[9 * SIZE]; - int i; - uint8_t state[10]; - AVLFG prng; - - av_lfg_init(&prng, 1); - - ff_init_range_encoder(&c, b, SIZE); - ff_build_rac_states(&c, 0.05 * (1LL << 32), 128 + 64 + 32 + 16); - - memset(state, 128, sizeof(state)); - - for (i = 0; i < SIZE; i++) - r[i] = av_lfg_get(&prng) % 7; - - for (i = 0; i < SIZE; i++) - put_rac(&c, state, r[i] & 1); - - ff_rac_terminate(&c); - - ff_init_range_decoder(&c, b, SIZE); - - memset(state, 128, sizeof(state)); - - for (i = 0; i < SIZE; i++) - if ((r[i] & 1) != get_rac(&c, state)) { - av_log(NULL, AV_LOG_ERROR, "rac failure at %d\n", i); - return 1; - } - - return 0; -} -#endif /* TEST */ -- cgit v1.1