00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "libavutil/common.h"
00023 #include "vp56.h"
00024
00025 const uint8_t ff_vp56_norm_shift[256]= {
00026 8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,
00027 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
00028 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
00029 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
00030 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00031 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00032 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00033 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
00034 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00035 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00036 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00037 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
00038 };
00039
00040 void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size)
00041 {
00042 c->high = 255;
00043 c->bits = -16;
00044 c->buffer = buf;
00045 c->end = buf + buf_size;
00046 c->code_word = bytestream_get_be24(&c->buffer);
00047 }