40 "Valid DV profiles are:\n",
77 *vlc = 0xfe00 | (level << 1) | sign;
81 *vlc |= ((run < 16) ?
dv_vlc_map[run-1][0].vlc :
82 (0x1f80 | (run - 1))) <<
size;
83 size += (run < 16) ?
dv_vlc_map[run-1][0].size : 13;
100 size += (run < 16) ?
dv_vlc_map[run-1][0].size : 13;
147 put_bits(pb, bits_left, vlc >> size);
148 vlc = vlc & ((1 <<
size) - 1);
150 if (pb + 1 >= pb_end) {
177 int ps = s->
ildct_cmp(NULL, data, NULL, linesize, 8) - 400;
179 int is = s->
ildct_cmp(NULL, data , NULL, linesize<<1, 4) +
180 s->
ildct_cmp(NULL, data + linesize, NULL, linesize<<1, 4);
190 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536,
191 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935,
192 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916,
193 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433,
194 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704,
195 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568,
196 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627,
197 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258,
200 131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754,
201 224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536,
202 211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568,
203 242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965,
204 200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627,
205 229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965,
206 175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364,
207 195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651,
227 static const int classes[] = {12, 24, 36, 0xffff};
229 static const int classes[] = {-1, -1, 255, 0xffff};
231 int max = classes[0];
247 memset(blk, 0, 64*
sizeof(*blk));
255 for (area = 0; area < 4; area++) {
256 bi->
prev[area] = prev;
259 int level = blk[zigzag_scan[i]];
261 if (level + 15 > 30
U) {
262 bi->
sign[i] = (level >> 31) & 1;
266 level = (
FFABS(level) * weight[i] + (1 << (dv_weight_bits+3))) >> (dv_weight_bits+4);
277 for (bi->
cno = 0; max > classes[bi->
cno]; bi->
cno++);
285 for (area = 0; area < 4; area++) {
286 bi->
prev[area] = prev;
307 int i, j, k,
a, prev,
a2;
310 size[0] = size[1] = size[2] = size[3] = size[4] = 1 << 24;
313 for (i = 0; i < 5; i++) {
319 for (j = 0; j < 6; j++, b++) {
320 for (a = 0; a < 4; a++) {
353 }
while (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]);
359 for (j = 0; j < 6 *5; j++, b++) {
361 for (k = b->
next[prev]; k < 64; k = b->next[k]) {
362 if (b->
mb[k] < a && b->
mb[k] > -a){
378 int mb_x, mb_y, c_offset, linesize, y_stride;
387 int qnos[5] = {15, 15, 15, 15, 15};
388 int* qnosp = &qnos[0];
391 enc_blk = &enc_blks[0];
392 for (mb_index = 0; mb_index < 5; mb_index++) {
398 (s->
sys->
height >= 720 && mb_y != 134)) {
424 for (j = 2; j; j--) {
431 for (i = 0; i < 8; i++) {
432 d = c_ptr + (linesize << 3);
433 b[0] = c_ptr[0]; b[1] = c_ptr[1]; b[2] = c_ptr[2]; b[3] = c_ptr[3];
434 b[4] = d[0]; b[5] = d[1]; b[6] = d[2]; b[7] = d[3];
453 for (j=0; j<5*s->
sys->
bpm;) {
460 for (i=0; i<s->
sys->
bpm; i++, j++) {
464 put_sbits(&pbs[j], 9, ((enc_blks[j].
mb[0] >> 3) - 1024 + 2) >> 2);
465 put_bits(&pbs[j], 1, enc_blks[j].dct_mode);
466 put_bits(&pbs[j], 2, enc_blks[j].cno);
474 for (i=0; i<s->
sys->
bpm; i++) {
475 if (enc_blks[start_mb+i].partial_bit_count)
482 for (j=0; j<5*s->
sys->
bpm; j++) {
483 if (enc_blks[j].partial_bit_count)
485 if (enc_blks[j].partial_bit_count)
489 for (j=0; j<5*s->
sys->
bpm; j++) {
498 memset(pbs[j].
buf + pos, 0xff, size - pos);
572 buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
582 buf[1] = (seq_num << 4) |
592 if (syb_num == 0 || syb_num == 6) {
597 else if (syb_num == 11) {
618 memset(buf, 0xff, 80 * 6);
626 for (j = 0; j < 2; j++) {
628 for (k = 0; k < 6; k++)
634 for (j = 0; j < 3; j++) {
645 for (j = 0; j < 135; j++) {
647 memset(buf, 0xff, 80);