53 "Valid DV profiles are:\n",
74 memset(&fdsp,0,
sizeof(fdsp));
75 memset(&mecc,0,
sizeof(mecc));
76 memset(&pdsp,0,
sizeof(pdsp));
109 *vlc = 0xfe00 | (level << 1) | sign;
113 *vlc |= ((run < 16) ?
dv_vlc_map[run - 1][0].vlc :
114 (0x1f80 | (run - 1))) <<
size;
115 size += (run < 16) ?
dv_vlc_map[run - 1][0].size : 13;
131 size += (run < 16) ?
dv_vlc_map[run - 1][0].size : 13;
178 put_bits(pb, bits_left, vlc >> size);
179 vlc = vlc & ((1 <<
size) - 1);
181 if (pb + 1 >= pb_end) {
225 131072, 257107, 257107, 242189, 252167, 242189, 235923, 237536,
226 237536, 235923, 229376, 231390, 223754, 231390, 229376, 222935,
227 224969, 217965, 217965, 224969, 222935, 200636, 218652, 211916,
228 212325, 211916, 218652, 200636, 188995, 196781, 205965, 206433,
229 206433, 205965, 196781, 188995, 185364, 185364, 200636, 200704,
230 200636, 185364, 185364, 174609, 180568, 195068, 195068, 180568,
231 174609, 170091, 175557, 189591, 175557, 170091, 165371, 170627,
232 170627, 165371, 160727, 153560, 160727, 144651, 144651, 136258,
235 131072, 262144, 257107, 257107, 242189, 242189, 242189, 242189,
236 237536, 237536, 229376, 229376, 200636, 200636, 224973, 224973,
237 223754, 223754, 235923, 235923, 229376, 229376, 217965, 217965,
238 211916, 211916, 196781, 196781, 185364, 185364, 206433, 206433,
239 211916, 211916, 222935, 222935, 200636, 200636, 205964, 205964,
240 200704, 200704, 180568, 180568, 175557, 175557, 195068, 195068,
241 185364, 185364, 188995, 188995, 174606, 174606, 175557, 175557,
242 170627, 170627, 153560, 153560, 165371, 165371, 144651, 144651,
264 static const int classes[] = { 12, 24, 36, 0xffff };
266 static const int classes[] = { -1, -1, 255, 0xffff };
268 int max = classes[0];
288 memset(blk, 0, 64 *
sizeof(*blk));
296 for (area = 0; area < 4; area++) {
297 bi->
prev[area] = prev;
300 int level = blk[zigzag_scan[i]];
302 if (level + 15 > 30
U) {
303 bi->
sign[i] = (level >> 31) & 1;
307 level = (
FFABS(level) * weight[i] + (1 << (dv_weight_bits + 3))) >>
308 (dv_weight_bits + 4);
319 for (bi->
cno = 0; max > classes[bi->
cno]; bi->
cno++)
328 for (area = 0; area < 4; area++) {
329 bi->
prev[area] = prev;
351 int i, j, k,
a, prev,
a2;
361 for (i = 0; i < 5; i++) {
367 for (j = 0; j < 6; j++, b++) {
368 for (a = 0; a < 4; a++) {
393 b->
prev[a + 1] = prev;
401 }
while (qnos[0] | qnos[1] | qnos[2] | qnos[3] | qnos[4]);
406 for (j = 0; j < 6 * 5; j++, b++) {
408 for (k = b->
next[prev]; k < 64; k = b->next[k]) {
409 if (b->
mb[k] < a && b->
mb[k] > -a) {
425 int mb_x, mb_y, c_offset, linesize, y_stride;
434 int qnos[5] = { 15, 15, 15, 15, 15 };
435 int *qnosp = &qnos[0];
438 enc_blk = &enc_blks[0];
439 for (mb_index = 0; mb_index < 5; mb_index++) {
445 (s->
sys->
height >= 720 && mb_y != 134)) {
472 for (j = 2; j; j--) {
479 for (i = 0; i < 8; i++) {
480 d = c_ptr + (linesize << 3);
507 for (j = 0; j < 5 * s->
sys->
bpm;) {
514 for (i = 0; i < s->
sys->
bpm; i++, j++) {
518 put_sbits(&pbs[j], 9, ((enc_blks[j].
mb[0] >> 3) - 1024 + 2) >> 2);
519 put_bits(&pbs[j], 1, enc_blks[j].dct_mode);
520 put_bits(&pbs[j], 2, enc_blks[j].cno);
528 for (i = 0; i < s->
sys->
bpm; i++)
529 if (enc_blks[start_mb + i].partial_bit_count)
531 &pbs[start_mb + s->
sys->
bpm]);
536 for (j = 0; j < 5 * s->
sys->
bpm; j++) {
537 if (enc_blks[j].partial_bit_count)
539 if (enc_blks[j].partial_bit_count)
543 for (j = 0; j < 5 * s->
sys->
bpm; j++) {
550 "bitstream written beyond buffer size\n");
553 memset(pbs[j].
buf + pos, 0xff, size - pos);
641 buf[1] = (seq_num << 4) |
650 if (syb_num == 0 || syb_num == 6) {
654 }
else if (syb_num == 11) {
674 memset(buf, 0xff, 80 * 6);
683 for (j = 0; j < 2; j++) {
685 for (k = 0; k < 6; k++)
691 for (j = 0; j < 3; j++) {
702 for (j = 0; j < 135; j++) {
704 memset(buf, 0xff, 80);