51 "Valid DV profiles are:\n",
72 memset(&dsp,0,
sizeof(dsp));
105 *vlc = 0xfe00 | (level << 1) | sign;
109 *vlc |= ((run < 16) ?
dv_vlc_map[run-1][0].vlc :
110 (0x1f80 | (run - 1))) <<
size;
111 size += (run < 16) ?
dv_vlc_map[run-1][0].size : 13;
128 size += (run < 16) ?
dv_vlc_map[run-1][0].size : 13;
175 put_bits(pb, bits_left, vlc >> size);
176 vlc = vlc & ((1 <<
size) - 1);
178 if (pb + 1 >= pb_end) {
205 int ps = s->
ildct_cmp(NULL, data, NULL, linesize, 8) - 400;
207 int is = s->
ildct_cmp(NULL, data , NULL, linesize<<1, 4) +
208 s->
ildct_cmp(NULL, data + linesize, NULL, linesize<<1, 4);
218 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536,
219 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935,
220 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916,
221 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433,
222 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704,
223 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568,
224 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627,
225 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258,
228 131072, 242189, 257107, 237536, 229376, 200636, 242189, 223754,
229 224969, 196781, 262144, 242189, 229376, 200636, 257107, 237536,
230 211916, 185364, 235923, 217965, 229376, 211916, 206433, 180568,
231 242189, 223754, 224969, 196781, 211916, 185364, 235923, 217965,
232 200704, 175557, 222935, 205965, 200636, 185364, 195068, 170627,
233 229376, 211916, 206433, 180568, 200704, 175557, 222935, 205965,
234 175557, 153560, 188995, 174609, 165371, 144651, 200636, 185364,
235 195068, 170627, 175557, 153560, 188995, 174609, 165371, 144651,
255 static const int classes[] = {12, 24, 36, 0xffff};
257 static const int classes[] = {-1, -1, 255, 0xffff};
259 int max = classes[0];
275 memset(blk, 0, 64*
sizeof(*blk));
283 for (area = 0; area < 4; area++) {
284 bi->
prev[area] = prev;
287 int level = blk[zigzag_scan[i]];
289 if (level + 15 > 30
U) {
290 bi->
sign[i] = (level >> 31) & 1;
294 level = (
FFABS(level) * weight[i] + (1 << (dv_weight_bits+3))) >> (dv_weight_bits+4);
305 for (bi->
cno = 0; max > classes[bi->
cno]; bi->
cno++);
313 for (area = 0; area < 4; area++) {
314 bi->
prev[area] = prev;
335 int i, j, k,
a, prev,
a2;
338 size[0] = size[1] = size[2] = size[3] = size[4] = 1 << 24;
341 for (i = 0; i < 5; i++) {
347 for (j = 0; j < 6; j++, b++) {
348 for (a = 0; a < 4; a++) {
381 }
while (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]);
387 for (j = 0; j < 6 *5; j++, b++) {
389 for (k = b->
next[prev]; k < 64; k = b->next[k]) {
390 if (b->
mb[k] < a && b->
mb[k] > -a){
406 int mb_x, mb_y, c_offset, linesize, y_stride;
415 int qnos[5] = {15, 15, 15, 15, 15};
416 int* qnosp = &qnos[0];
419 enc_blk = &enc_blks[0];
420 for (mb_index = 0; mb_index < 5; mb_index++) {
426 (s->
sys->
height >= 720 && mb_y != 134)) {
452 for (j = 2; j; j--) {
459 for (i = 0; i < 8; i++) {
460 d = c_ptr + (linesize << 3);
461 b[0] = c_ptr[0]; b[1] = c_ptr[1]; b[2] = c_ptr[2]; b[3] = c_ptr[3];
462 b[4] = d[0]; b[5] = d[1]; b[6] = d[2]; b[7] = d[3];
481 for (j=0; j<5*s->
sys->
bpm;) {
488 for (i=0; i<s->
sys->
bpm; i++, j++) {
492 put_sbits(&pbs[j], 9, ((enc_blks[j].
mb[0] >> 3) - 1024 + 2) >> 2);
493 put_bits(&pbs[j], 1, enc_blks[j].dct_mode);
494 put_bits(&pbs[j], 2, enc_blks[j].cno);
502 for (i=0; i<s->
sys->
bpm; i++) {
503 if (enc_blks[start_mb+i].partial_bit_count)
510 for (j=0; j<5*s->
sys->
bpm; j++) {
511 if (enc_blks[j].partial_bit_count)
513 if (enc_blks[j].partial_bit_count)
517 for (j=0; j<5*s->
sys->
bpm; j++) {
526 memset(pbs[j].
buf + pos, 0xff, size - pos);
600 buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
610 buf[1] = (seq_num << 4) |
620 if (syb_num == 0 || syb_num == 6) {
625 else if (syb_num == 11) {
646 memset(buf, 0xff, 80 * 6);
654 for (j = 0; j < 2; j++) {
656 for (k = 0; k < 6; k++)
662 for (j = 0; j < 3; j++) {
673 for (j = 0; j < 135; j++) {
675 memset(buf, 0xff, 80);