X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcabac.c;h=9a3bdafb8fd133de80c9b4a7e2cf451778b82b97;hb=4b5fee0205a825e5f0c7b414af6776803e55a78e;hp=c6da6292a2103339e4469fd4c2e5a3532683a2e3;hpb=a0f2c6ba38b2159f5f23edfffa204e11533b0b41;p=ffmpeg diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c index c6da6292a21..9a3bdafb8fd 100644 --- a/libavcodec/cabac.c +++ b/libavcodec/cabac.c @@ -17,18 +17,17 @@ * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * */ /** - * @file cabac.c + * @file libavcodec/cabac.c * Context Adaptive Binary Arithmetic Coder. */ #include -#include "common.h" -#include "bitstream.h" +#include "libavutil/common.h" +#include "get_bits.h" #include "cabac.h" static const uint8_t lps_range[64][4]= { @@ -179,23 +178,27 @@ void ff_init_cabac_states(CABACContext *c){ } } -#if 0 //selftest +#ifdef TEST #define SIZE 10240 +#include "libavutil/lfg.h" #include "avcodec.h" +#include "cabac.h" -int main(){ +int main(void){ CABACContext c; uint8_t b[9*SIZE]; uint8_t r[9*SIZE]; int i; uint8_t state[10]= {0}; + AVLFG prng; + av_lfg_init(&prng, 1); ff_init_cabac_encoder(&c, b, SIZE); - ff_init_cabac_states(&c, ff_h264_lps_range, ff_h264_mps_state, ff_h264_lps_state, 64); + ff_init_cabac_states(&c); for(i=0; i