22 #define CACHED_BITSTREAM_READER !ARCH_X86_32
23 #define SHEER_VLC_BITS 12
42 uint16_t *dst_y, *dst_u, *dst_v, *dst_a;
45 dst_a = (uint16_t *)p->
data[3];
46 dst_y = (uint16_t *)p->
data[0];
47 dst_u = (uint16_t *)p->
data[1];
48 dst_v = (uint16_t *)p->
data[2];
50 for (y = 0; y < avctx->
height; y++) {
52 for (x = 0; x < avctx->
width; x++) {
59 int pred[4] = { 502, 512, 512, 502 };
61 for (x = 0; x < avctx->
width; x++) {
69 dst_a[x] =
pred[3] = (
a +
pred[3]) & 0x3ff;
70 dst_y[x] =
pred[0] = (y +
pred[0]) & 0x3ff;
71 dst_u[x] =
pred[1] = (
u +
pred[1]) & 0x3ff;
72 dst_v[x] =
pred[2] = (v +
pred[2]) & 0x3ff;
86 uint16_t *dst_y, *dst_u, *dst_v, *dst_a;
89 dst_a = (uint16_t *)p->
data[3];
90 dst_y = (uint16_t *)p->
data[0];
91 dst_u = (uint16_t *)p->
data[1];
92 dst_v = (uint16_t *)p->
data[2];
95 for (x = 0; x < avctx->
width; x++) {
102 int pred[4] = { 502, 512, 512, 502 };
104 for (x = 0; x < avctx->
width; x++) {
112 dst_a[x] =
pred[3] = (
a +
pred[3]) & 0x3ff;
113 dst_y[x] =
pred[0] = (y +
pred[0]) & 0x3ff;
114 dst_u[x] =
pred[1] = (
u +
pred[1]) & 0x3ff;
115 dst_v[x] =
pred[2] = (v +
pred[2]) & 0x3ff;
124 for (y = 1; y < avctx->
height; y++) {
126 for (x = 0; x < avctx->
width; x++) {
133 int pred_TL[4], pred_L[4], pred_T[4];
136 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0] / 2];
137 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1] / 2];
138 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2] / 2];
139 pred_TL[3] = pred_L[3] = dst_a[-p->
linesize[3] / 2];
141 for (x = 0; x < avctx->
width; x++) {
142 pred_T[0] = dst_y[-p->
linesize[0] / 2 + x];
143 pred_T[1] = dst_u[-p->
linesize[1] / 2 + x];
144 pred_T[2] = dst_v[-p->
linesize[2] / 2 + x];
145 pred_T[3] = dst_a[-p->
linesize[3] / 2 + x];
152 dst_a[x] = pred_L[3] = (
a + ((3 * (pred_T[3] + pred_L[3]) - 2 * pred_TL[3]) >> 2)) & 0x3ff;
153 dst_y[x] = pred_L[0] = (y + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0x3ff;
154 dst_u[x] = pred_L[1] = (
u + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0x3ff;
155 dst_v[x] = pred_L[2] = (v + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0x3ff;
157 pred_TL[0] = pred_T[0];
158 pred_TL[1] = pred_T[1];
159 pred_TL[2] = pred_T[2];
160 pred_TL[3] = pred_T[3];
174 uint16_t *dst_y, *dst_u, *dst_v;
177 dst_y = (uint16_t *)p->
data[0];
178 dst_u = (uint16_t *)p->
data[1];
179 dst_v = (uint16_t *)p->
data[2];
183 for (x = 0; x < avctx->
width; x++) {
189 int pred[4] = { 502, 512, 512, 512 };
191 for (x = 0; x < avctx->
width; x++) {
198 dst_y[x] =
pred[0] = (y +
pred[0]) & 0x3ff;
199 dst_u[x] =
pred[1] = (
u +
pred[1]) & 0x3ff;
200 dst_v[x] =
pred[2] = (v +
pred[2]) & 0x3ff;
213 uint16_t *dst_y, *dst_u, *dst_v;
216 dst_y = (uint16_t *)p->
data[0];
217 dst_u = (uint16_t *)p->
data[1];
218 dst_v = (uint16_t *)p->
data[2];
221 for (x = 0; x < avctx->
width; x++) {
227 int pred[4] = { 502, 512, 512, 512 };
229 for (x = 0; x < avctx->
width; x++) {
236 dst_y[x] =
pred[0] = (y +
pred[0]) & 0x3ff;
237 dst_u[x] =
pred[1] = (
u +
pred[1]) & 0x3ff;
238 dst_v[x] =
pred[2] = (v +
pred[2]) & 0x3ff;
246 for (y = 1; y < avctx->
height; y++) {
248 for (x = 0; x < avctx->
width; x++) {
254 int pred_TL[4], pred_L[4], pred_T[4];
257 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0] / 2];
258 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1] / 2];
259 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2] / 2];
261 for (x = 0; x < avctx->
width; x++) {
262 pred_T[0] = dst_y[-p->
linesize[0] / 2 + x];
263 pred_T[1] = dst_u[-p->
linesize[1] / 2 + x];
264 pred_T[2] = dst_v[-p->
linesize[2] / 2 + x];
270 dst_y[x] = pred_L[0] = (y + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0x3ff;
271 dst_u[x] = pred_L[1] = (
u + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0x3ff;
272 dst_v[x] = pred_L[2] = (v + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0x3ff;
274 pred_TL[0] = pred_T[0];
275 pred_TL[1] = pred_T[1];
276 pred_TL[2] = pred_T[2];
289 uint16_t *dst_y, *dst_u, *dst_v;
292 dst_y = (uint16_t *)p->
data[0];
293 dst_u = (uint16_t *)p->
data[1];
294 dst_v = (uint16_t *)p->
data[2];
298 for (x = 0; x < avctx->
width; x += 2) {
305 int pred[4] = { 502, 512, 512, 0 };
307 for (x = 0; x < avctx->
width; x += 2) {
315 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0x3ff;
316 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0x3ff;
317 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0x3ff;
318 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0x3ff;
331 uint16_t *dst_y, *dst_u, *dst_v;
334 dst_y = (uint16_t *)p->
data[0];
335 dst_u = (uint16_t *)p->
data[1];
336 dst_v = (uint16_t *)p->
data[2];
339 for (x = 0; x < avctx->
width; x += 2) {
346 int pred[4] = { 502, 512, 512, 0 };
348 for (x = 0; x < avctx->
width; x += 2) {
356 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0x3ff;
357 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0x3ff;
358 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0x3ff;
359 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0x3ff;
367 for (y = 1; y < avctx->
height; y++) {
369 for (x = 0; x < avctx->
width; x += 2) {
376 int pred_TL[6], pred_L[6], pred_T[6];
379 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0] / 2];
380 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1] / 2];
381 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2] / 2];
383 for (x = 0; x < avctx->
width; x += 2) {
384 pred_T[0] = dst_y[-p->
linesize[0] / 2 + x];
385 pred_T[3] = dst_y[-p->
linesize[0] / 2 + x + 1];
386 pred_T[1] = dst_u[-p->
linesize[1] / 2 + x / 2];
387 pred_T[2] = dst_v[-p->
linesize[2] / 2 + x / 2];
394 dst_y[x ] = pred_L[0] = (y1 + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0x3ff;
395 dst_u[x / 2] = pred_L[1] = (
u + (((pred_L[1] - pred_TL[1]) >> 1) + pred_T[1])) & 0x3ff;
396 dst_y[x + 1] = pred_L[0] = (y2 + ((3 * (pred_T[3] + pred_L[0]) - 2 * pred_T[0]) >> 2)) & 0x3ff;
397 dst_v[x / 2] = pred_L[2] = (v + (((pred_L[2] - pred_TL[2]) >> 1) + pred_T[2])) & 0x3ff;
399 pred_TL[0] = pred_T[3];
400 pred_TL[1] = pred_T[1];
401 pred_TL[2] = pred_T[2];
414 uint16_t *dst_y, *dst_u, *dst_v, *dst_a;
417 dst_y = (uint16_t *)p->
data[0];
418 dst_u = (uint16_t *)p->
data[1];
419 dst_v = (uint16_t *)p->
data[2];
420 dst_a = (uint16_t *)p->
data[3];
422 for (y = 0; y < avctx->
height; y++) {
424 for (x = 0; x < avctx->
width; x += 2) {
433 int pred[4] = { 502, 512, 512, 502 };
435 for (x = 0; x < avctx->
width; x += 2) {
436 int y1, y2,
u, v,
a1,
a2;
445 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0x3ff;
446 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0x3ff;
447 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0x3ff;
449 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0x3ff;
450 dst_a[x + 1] =
pred[3] = (
a2 +
pred[3]) & 0x3ff;
464 uint16_t *dst_y, *dst_u, *dst_v, *dst_a;
467 dst_y = (uint16_t *)p->
data[0];
468 dst_u = (uint16_t *)p->
data[1];
469 dst_v = (uint16_t *)p->
data[2];
470 dst_a = (uint16_t *)p->
data[3];
473 for (x = 0; x < avctx->
width; x += 2) {
482 int pred[4] = { 502, 512, 512, 502 };
484 for (x = 0; x < avctx->
width; x += 2) {
485 int y1, y2,
u, v,
a1,
a2;
494 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0x3ff;
495 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0x3ff;
496 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0x3ff;
498 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0x3ff;
499 dst_a[x + 1] =
pred[3] = (
a2 +
pred[3]) & 0x3ff;
508 for (y = 1; y < avctx->
height; y++) {
510 for (x = 0; x < avctx->
width; x += 2) {
519 int pred_TL[6], pred_L[6], pred_T[6];
520 int y1, y2,
u, v,
a1,
a2;
522 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0] / 2];
523 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1] / 2];
524 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2] / 2];
525 pred_TL[4] = pred_L[4] = dst_a[-p->
linesize[3] / 2];
527 for (x = 0; x < avctx->
width; x += 2) {
528 pred_T[0] = dst_y[-p->
linesize[0] / 2 + x];
529 pred_T[3] = dst_y[-p->
linesize[0] / 2 + x + 1];
530 pred_T[1] = dst_u[-p->
linesize[1] / 2 + x / 2];
531 pred_T[2] = dst_v[-p->
linesize[2] / 2 + x / 2];
532 pred_T[4] = dst_a[-p->
linesize[3] / 2 + x];
533 pred_T[5] = dst_a[-p->
linesize[3] / 2 + x + 1];
542 dst_y[x ] = pred_L[0] = (y1 + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0x3ff;
543 dst_u[x / 2] = pred_L[1] = (
u + (((pred_L[1] - pred_TL[1]) >> 1) + pred_T[1])) & 0x3ff;
544 dst_y[x + 1] = pred_L[0] = (y2 + ((3 * (pred_T[3] + pred_L[0]) - 2 * pred_T[0]) >> 2)) & 0x3ff;
545 dst_v[x / 2] = pred_L[2] = (v + (((pred_L[2] - pred_TL[2]) >> 1) + pred_T[2])) & 0x3ff;
546 dst_a[x ] = pred_L[4] = (
a1 + ((3 * (pred_T[4] + pred_L[4]) - 2 * pred_TL[4]) >> 2)) & 0x3ff;
547 dst_a[x + 1] = pred_L[4] = (
a2 + ((3 * (pred_T[5] + pred_L[4]) - 2 * pred_T[4]) >> 2)) & 0x3ff;
549 pred_TL[0] = pred_T[3];
550 pred_TL[1] = pred_T[1];
551 pred_TL[2] = pred_T[2];
552 pred_TL[4] = pred_T[5];
566 uint8_t *dst_y, *dst_u, *dst_v, *dst_a;
574 for (y = 0; y < avctx->
height; y += 1) {
576 for (x = 0; x < avctx->
width; x += 2) {
585 int pred[4] = { 125, -128, -128, 125 };
587 for (x = 0; x < avctx->
width; x += 2) {
588 int y1, y2,
u, v,
a1,
a2;
597 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0xff;
598 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0xff;
599 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0xff;
600 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0xff;
602 dst_a[x + 1] =
pred[3] = (
a2 +
pred[3]) & 0xff;
616 uint8_t *dst_y, *dst_u, *dst_v, *dst_a;
625 for (x = 0; x < avctx->
width; x += 2) {
634 int pred[4] = { 125, -128, -128, 125 };
636 for (x = 0; x < avctx->
width; x += 2) {
637 int y1, y2,
u, v,
a1,
a2;
646 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0xff;
647 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0xff;
648 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0xff;
650 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0xff;
651 dst_a[x + 1] =
pred[3] = (
a2 +
pred[3]) & 0xff;
660 for (y = 1; y < avctx->
height; y++) {
662 for (x = 0; x < avctx->
width; x += 2) {
671 int pred_TL[6], pred_L[6], pred_T[6];
672 int y1, y2,
u, v,
a1,
a2;
674 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0]];
675 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1]];
676 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2]];
677 pred_TL[4] = pred_L[4] = dst_a[-p->
linesize[3]];
679 for (x = 0; x < avctx->
width; x += 2) {
680 pred_T[0] = dst_y[-p->
linesize[0] + x];
681 pred_T[3] = dst_y[-p->
linesize[0] + x + 1];
682 pred_T[1] = dst_u[-p->
linesize[1] + x / 2];
683 pred_T[2] = dst_v[-p->
linesize[2] + x / 2];
684 pred_T[4] = dst_a[-p->
linesize[3] + x];
685 pred_T[5] = dst_a[-p->
linesize[3] + x + 1];
694 dst_y[x ] = pred_L[0] = (y1 + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0xff;
695 dst_u[x / 2] = pred_L[1] = (
u + (((pred_L[1] - pred_TL[1]) >> 1) + pred_T[1])) & 0xff;
696 dst_y[x + 1] = pred_L[0] = (y2 + ((3 * (pred_T[3] + pred_L[0]) - 2 * pred_T[0]) >> 2)) & 0xff;
697 dst_v[x / 2] = pred_L[2] = (v + (((pred_L[2] - pred_TL[2]) >> 1) + pred_T[2])) & 0xff;
698 dst_a[x ] = pred_L[4] = (
a1 + ((3 * (pred_T[4] + pred_L[4]) - 2 * pred_TL[4]) >> 2)) & 0xff;
699 dst_a[x + 1] = pred_L[4] = (
a2 + ((3 * (pred_T[5] + pred_L[4]) - 2 * pred_T[4]) >> 2)) & 0xff;
701 pred_TL[0] = pred_T[3];
702 pred_TL[1] = pred_T[1];
703 pred_TL[2] = pred_T[2];
704 pred_TL[4] = pred_T[5];
718 uint8_t *dst_y, *dst_u, *dst_v;
726 for (x = 0; x < avctx->
width; x += 2) {
728 dst_u[x / 2] =
get_bits(gb, 8) + 128;
730 dst_v[x / 2] =
get_bits(gb, 8) + 128;
733 int pred[4] = { -128, 128, 128, 0 };
735 for (x = 0; x < avctx->
width; x += 2) {
743 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0xff;
744 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0xff;
745 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0xff;
746 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0xff;
754 for (y = 1; y < avctx->
height; y++) {
756 for (x = 0; x < avctx->
width; x += 2) {
758 dst_u[x / 2] =
get_bits(gb, 8) + 128;
760 dst_v[x / 2] =
get_bits(gb, 8) + 128;
763 int pred_TL[4], pred_L[4], pred_T[4];
766 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0]];
767 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1]];
768 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2]];
770 for (x = 0; x < avctx->
width; x += 2) {
771 pred_T[0] = dst_y[-p->
linesize[0] + x];
772 pred_T[3] = dst_y[-p->
linesize[0] + x + 1];
773 pred_T[1] = dst_u[-p->
linesize[1] + x / 2];
774 pred_T[2] = dst_v[-p->
linesize[2] + x / 2];
781 dst_y[x ] = pred_L[0] = (y1 + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0xff;
782 dst_u[x / 2] = pred_L[1] = (
u + (((pred_L[1] - pred_TL[1]) >> 1) + pred_T[1])) & 0xff;
783 dst_y[x + 1] = pred_L[0] = (y2 + ((3 * (pred_T[3] + pred_L[0]) - 2 * pred_T[0]) >> 2)) & 0xff;
784 dst_v[x / 2] = pred_L[2] = (v + (((pred_L[2] - pred_TL[2]) >> 1) + pred_T[2])) & 0xff;
786 pred_TL[0] = pred_T[3];
787 pred_TL[1] = pred_T[1];
788 pred_TL[2] = pred_T[2];
801 uint8_t *dst_y, *dst_u, *dst_v;
809 for (x = 0; x < avctx->
width; x += 2) {
816 int pred[4] = { 125, -128, -128, 0 };
818 for (x = 0; x < avctx->
width; x += 2) {
826 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0xff;
827 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0xff;
828 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0xff;
829 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0xff;
837 for (y = 1; y < avctx->
height; y++) {
839 for (x = 0; x < avctx->
width; x += 2) {
853 for (x = 0; x < avctx->
width; x += 2) {
859 dst_y[x ] = pred_L[0] = (y1 + pred_L[0]) & 0xff;
860 dst_u[x / 2] = pred_L[1] = (
u + pred_L[1]) & 0xff;
861 dst_y[x + 1] = pred_L[0] = (y2 + pred_L[0]) & 0xff;
862 dst_v[x / 2] = pred_L[2] = (v + pred_L[2]) & 0xff;
875 uint8_t *dst_y, *dst_u, *dst_v;
883 for (x = 0; x < avctx->
width; x += 2) {
890 int pred[4] = { 125, -128, -128, 0 };
892 for (x = 0; x < avctx->
width; x += 2) {
900 dst_y[x ] =
pred[0] = (y1 +
pred[0]) & 0xff;
901 dst_u[x / 2] =
pred[1] = (
u +
pred[1]) & 0xff;
902 dst_y[x + 1] =
pred[0] = (y2 +
pred[0]) & 0xff;
903 dst_v[x / 2] =
pred[2] = (v +
pred[2]) & 0xff;
911 for (y = 1; y < avctx->
height; y++) {
913 for (x = 0; x < avctx->
width; x += 2) {
920 int pred_TL[4], pred_L[4], pred_T[4];
923 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0]];
924 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1]];
925 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2]];
927 for (x = 0; x < avctx->
width; x += 2) {
928 pred_T[0] = dst_y[-p->
linesize[0] + x];
929 pred_T[3] = dst_y[-p->
linesize[0] + x + 1];
930 pred_T[1] = dst_u[-p->
linesize[1] + x / 2];
931 pred_T[2] = dst_v[-p->
linesize[2] + x / 2];
938 dst_y[x ] = pred_L[0] = (y1 + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0xff;
939 dst_u[x / 2] = pred_L[1] = (
u + (((pred_L[1] - pred_TL[1]) >> 1) + pred_T[1])) & 0xff;
940 dst_y[x + 1] = pred_L[0] = (y2 + ((3 * (pred_T[3] + pred_L[0]) - 2 * pred_T[0]) >> 2)) & 0xff;
941 dst_v[x / 2] = pred_L[2] = (v + (((pred_L[2] - pred_TL[2]) >> 1) + pred_T[2])) & 0xff;
943 pred_TL[0] = pred_T[3];
944 pred_TL[1] = pred_T[1];
945 pred_TL[2] = pred_T[2];
958 uint8_t *dst_y, *dst_u, *dst_v;
966 for (x = 0; x < avctx->
width; x++) {
972 int pred[4] = {
s->alt ? 125 : -146, -128, -128, -128 };
974 for (x = 0; x < avctx->
width; x++) {
981 dst_y[x] =
pred[0] = (y +
pred[0]) & 0xff;
982 dst_u[x] =
pred[1] = (
u +
pred[1]) & 0xff;
983 dst_v[x] =
pred[2] = (v +
pred[2]) & 0xff;
991 for (y = 1; y < avctx->
height; y++) {
993 for (x = 0; x < avctx->
width; x++) {
1002 pred_L[0] = dst_y[-p->
linesize[0]];
1003 pred_L[1] = dst_u[-p->
linesize[1]];
1004 pred_L[2] = dst_v[-p->
linesize[2]];
1006 for (x = 0; x < avctx->
width; x++) {
1011 dst_y[x] = pred_L[0] = (y + pred_L[0]) & 0xff;
1012 dst_u[x] = pred_L[1] = (
u + pred_L[1]) & 0xff;
1013 dst_v[x] = pred_L[2] = (v + pred_L[2]) & 0xff;
1026 uint8_t *dst_y, *dst_u, *dst_v;
1034 for (x = 0; x < avctx->
width; x++) {
1040 int pred[4] = {
s->alt ? 125 : -146, -128, -128, -128 };
1042 for (x = 0; x < avctx->
width; x++) {
1049 dst_y[x] =
pred[0] = (y +
pred[0]) & 0xff;
1050 dst_u[x] =
pred[1] = (
u +
pred[1]) & 0xff;
1051 dst_v[x] =
pred[2] = (v +
pred[2]) & 0xff;
1059 for (y = 1; y < avctx->
height; y++) {
1061 for (x = 0; x < avctx->
width; x++) {
1067 int pred_TL[4], pred_L[4], pred_T[4];
1070 pred_TL[0] = pred_L[0] = dst_y[-p->
linesize[0]];
1071 pred_TL[1] = pred_L[1] = dst_u[-p->
linesize[1]];
1072 pred_TL[2] = pred_L[2] = dst_v[-p->
linesize[2]];
1074 for (x = 0; x < avctx->
width; x++) {
1075 pred_T[0] = dst_y[-p->
linesize[0] + x];
1076 pred_T[1] = dst_u[-p->
linesize[1] + x];
1077 pred_T[2] = dst_v[-p->
linesize[2] + x];
1083 dst_y[x] = pred_L[0] = (y + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0xff;
1084 dst_u[x] = pred_L[1] = (
u + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0xff;
1085 dst_v[x] = pred_L[2] = (v + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0xff;
1087 pred_TL[0] = pred_T[0];
1088 pred_TL[1] = pred_T[1];
1089 pred_TL[2] = pred_T[2];
1102 uint8_t *dst_a, *dst_y, *dst_u, *dst_v;
1111 for (x = 0; x < avctx->
width; x++) {
1118 int pred[4] = { 125,
s->alt ? 125 : -146, -128, -128 };
1120 for (x = 0; x < avctx->
width; x++) {
1128 dst_a[x] =
pred[0] = (
a +
pred[0]) & 0xff;
1129 dst_y[x] =
pred[1] = (y +
pred[1]) & 0xff;
1130 dst_u[x] =
pred[2] = (
u +
pred[2]) & 0xff;
1131 dst_v[x] =
pred[3] = (v +
pred[3]) & 0xff;
1140 for (y = 1; y < avctx->
height; y++) {
1142 for (x = 0; x < avctx->
width; x++) {
1152 pred_L[0] = dst_a[-p->
linesize[3]];
1153 pred_L[1] = dst_y[-p->
linesize[0]];
1154 pred_L[2] = dst_u[-p->
linesize[1]];
1155 pred_L[3] = dst_v[-p->
linesize[2]];
1157 for (x = 0; x < avctx->
width; x++) {
1163 dst_a[x] = pred_L[0] = (
a + pred_L[0]) & 0xff;
1164 dst_y[x] = pred_L[1] = (y + pred_L[1]) & 0xff;
1165 dst_u[x] = pred_L[2] = (
u + pred_L[2]) & 0xff;
1166 dst_v[x] = pred_L[3] = (v + pred_L[3]) & 0xff;
1180 uint8_t *dst_a, *dst_y, *dst_u, *dst_v;
1189 for (x = 0; x < avctx->
width; x++) {
1196 int pred[4] = { 125,
s->alt ? 125 : -146, -128, -128 };
1198 for (x = 0; x < avctx->
width; x++) {
1206 dst_a[x] =
pred[0] = (
a +
pred[0]) & 0xff;
1207 dst_y[x] =
pred[1] = (y +
pred[1]) & 0xff;
1208 dst_u[x] =
pred[2] = (
u +
pred[2]) & 0xff;
1209 dst_v[x] =
pred[3] = (v +
pred[3]) & 0xff;
1218 for (y = 1; y < avctx->
height; y++) {
1220 for (x = 0; x < avctx->
width; x++) {
1227 int pred_TL[4], pred_L[4], pred_T[4];
1230 pred_TL[0] = pred_L[0] = dst_a[-p->
linesize[3]];
1231 pred_TL[1] = pred_L[1] = dst_y[-p->
linesize[0]];
1232 pred_TL[2] = pred_L[2] = dst_u[-p->
linesize[1]];
1233 pred_TL[3] = pred_L[3] = dst_v[-p->
linesize[2]];
1235 for (x = 0; x < avctx->
width; x++) {
1236 pred_T[0] = dst_a[-p->
linesize[3] + x];
1237 pred_T[1] = dst_y[-p->
linesize[0] + x];
1238 pred_T[2] = dst_u[-p->
linesize[1] + x];
1239 pred_T[3] = dst_v[-p->
linesize[2] + x];
1246 dst_a[x] = pred_L[0] = (
a + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0xff;
1247 dst_y[x] = pred_L[1] = (y + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0xff;
1248 dst_u[x] = pred_L[2] = (
u + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0xff;
1249 dst_v[x] = pred_L[3] = (v + ((3 * (pred_T[3] + pred_L[3]) - 2 * pred_TL[3]) >> 2)) & 0xff;
1251 pred_TL[0] = pred_T[0];
1252 pred_TL[1] = pred_T[1];
1253 pred_TL[2] = pred_T[2];
1254 pred_TL[3] = pred_T[3];
1268 uint16_t *dst_r, *dst_g, *dst_b, *dst_a;
1271 dst_r = (uint16_t *)p->
data[2];
1272 dst_g = (uint16_t *)p->
data[0];
1273 dst_b = (uint16_t *)p->
data[1];
1274 dst_a = (uint16_t *)p->
data[3];
1276 for (y = 0; y < avctx->
height; y++) {
1278 for (x = 0; x < avctx->
width; x++) {
1285 int pred[4] = { 512, 512, 512, 512 };
1287 for (x = 0; x < avctx->
width; x++) {
1295 dst_a[x] =
pred[3] = (
a +
pred[3]) & 0x3ff;
1296 dst_r[x] =
pred[0] = (
r +
pred[0]) & 0x3ff;
1297 dst_g[x] =
pred[1] = (
r +
g +
pred[1]) & 0x3ff;
1298 dst_b[x] =
pred[2] = (
r +
g +
b +
pred[2]) & 0x3ff;
1312 uint16_t *dst_r, *dst_g, *dst_b, *dst_a;
1315 dst_r = (uint16_t *)p->
data[2];
1316 dst_g = (uint16_t *)p->
data[0];
1317 dst_b = (uint16_t *)p->
data[1];
1318 dst_a = (uint16_t *)p->
data[3];
1321 for (x = 0; x < avctx->
width; x++) {
1328 int pred[4] = { 512, 512, 512, 512 };
1330 for (x = 0; x < avctx->
width; x++) {
1338 dst_a[x] =
pred[3] = (
a +
pred[3]) & 0x3ff;
1339 dst_r[x] =
pred[0] = (
r +
pred[0]) & 0x3ff;
1340 dst_g[x] =
pred[1] = (
r +
g +
pred[1]) & 0x3ff;
1341 dst_b[x] =
pred[2] = (
r +
g +
b +
pred[2]) & 0x3ff;
1350 for (y = 1; y < avctx->
height; y++) {
1352 for (x = 0; x < avctx->
width; x++) {
1359 int pred_TL[4], pred_L[4], pred_T[4];
1362 pred_TL[0] = pred_L[0] = dst_r[-p->
linesize[2] / 2];
1363 pred_TL[1] = pred_L[1] = dst_g[-p->
linesize[0] / 2];
1364 pred_TL[2] = pred_L[2] = dst_b[-p->
linesize[1] / 2];
1365 pred_TL[3] = pred_L[3] = dst_a[-p->
linesize[3] / 2];
1367 for (x = 0; x < avctx->
width; x++) {
1368 pred_T[0] = dst_r[-p->
linesize[2] / 2 + x];
1369 pred_T[1] = dst_g[-p->
linesize[0] / 2 + x];
1370 pred_T[2] = dst_b[-p->
linesize[1] / 2 + x];
1371 pred_T[3] = dst_a[-p->
linesize[3] / 2 + x];
1378 dst_a[x] = pred_L[3] = (
a + ((3 * (pred_T[3] + pred_L[3]) - 2 * pred_TL[3]) >> 2)) & 0x3ff;
1379 dst_r[x] = pred_L[0] = (
r + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0x3ff;
1380 dst_g[x] = pred_L[1] = (
r +
g + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0x3ff;
1381 dst_b[x] = pred_L[2] = (
r +
g +
b + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0x3ff;
1383 pred_TL[0] = pred_T[0];
1384 pred_TL[1] = pred_T[1];
1385 pred_TL[2] = pred_T[2];
1386 pred_TL[3] = pred_T[3];
1400 uint16_t *dst_r, *dst_g, *dst_b;
1403 dst_r = (uint16_t *)p->
data[2];
1404 dst_g = (uint16_t *)p->
data[0];
1405 dst_b = (uint16_t *)p->
data[1];
1409 for (x = 0; x < avctx->
width; x++) {
1415 int pred[4] = { 512, 512, 512, 0 };
1417 for (x = 0; x < avctx->
width; x++) {
1424 dst_r[x] =
pred[0] = (
r +
pred[0]) & 0x3ff;
1425 dst_g[x] =
pred[1] = (
r +
g +
pred[1]) & 0x3ff;
1426 dst_b[x] =
pred[2] = (
r +
g +
b +
pred[2]) & 0x3ff;
1439 uint16_t *dst_r, *dst_g, *dst_b;
1442 dst_r = (uint16_t *)p->
data[2];
1443 dst_g = (uint16_t *)p->
data[0];
1444 dst_b = (uint16_t *)p->
data[1];
1447 for (x = 0; x < avctx->
width; x++) {
1453 int pred[4] = { 512, 512, 512, 0 };
1455 for (x = 0; x < avctx->
width; x++) {
1462 dst_r[x] =
pred[0] = (
r +
pred[0]) & 0x3ff;
1463 dst_g[x] =
pred[1] = (
r +
g +
pred[1]) & 0x3ff;
1464 dst_b[x] =
pred[2] = (
r +
g +
b +
pred[2]) & 0x3ff;
1472 for (y = 1; y < avctx->
height; y++) {
1474 for (x = 0; x < avctx->
width; x++) {
1480 int pred_TL[4], pred_L[4], pred_T[4];
1483 pred_TL[0] = pred_L[0] = dst_r[-p->
linesize[2] / 2];
1484 pred_TL[1] = pred_L[1] = dst_g[-p->
linesize[0] / 2];
1485 pred_TL[2] = pred_L[2] = dst_b[-p->
linesize[1] / 2];
1487 for (x = 0; x < avctx->
width; x++) {
1488 pred_T[0] = dst_r[-p->
linesize[2] / 2 + x];
1489 pred_T[1] = dst_g[-p->
linesize[0] / 2 + x];
1490 pred_T[2] = dst_b[-p->
linesize[1] / 2 + x];
1496 dst_r[x] = pred_L[0] = (
r + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0x3ff;
1497 dst_g[x] = pred_L[1] = (
r +
g + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0x3ff;
1498 dst_b[x] = pred_L[2] = (
r +
g +
b + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0x3ff;
1500 pred_TL[0] = pred_T[0];
1501 pred_TL[1] = pred_T[1];
1502 pred_TL[2] = pred_T[2];
1520 for (x = 0; x < avctx->
width; x++) {
1527 int pred[4] = { -128, -128, -128, -128 };
1529 for (x = 0; x < avctx->
width; x++) {
1545 for (y = 1; y < avctx->
height; y++) {
1547 for (x = 0; x < avctx->
width; x++) {
1562 for (x = 0; x < avctx->
width; x++) {
1568 dst[4 * x + 0] = pred_L[0] = (
a + pred_L[0]) & 0xff;
1569 dst[4 * x + 1] = pred_L[1] = (
r + pred_L[1]) & 0xff;
1570 dst[4 * x + 2] = pred_L[2] = (
r +
g + pred_L[2]) & 0xff;
1571 dst[4 * x + 3] = pred_L[3] = (
r +
g +
b + pred_L[3]) & 0xff;
1586 for (x = 0; x < avctx->
width; x++) {
1593 int pred[4] = { -128, -128, -128, -128 };
1595 for (x = 0; x < avctx->
width; x++) {
1611 for (y = 1; y < avctx->
height; y++) {
1613 for (x = 0; x < avctx->
width; x++) {
1620 int pred_TL[4], pred_L[4], pred_T[4];
1623 pred_TL[0] = pred_L[0] =
dst[-p->
linesize[0] + 0];
1624 pred_TL[1] = pred_L[1] =
dst[-p->
linesize[0] + 1];
1625 pred_TL[2] = pred_L[2] =
dst[-p->
linesize[0] + 2];
1626 pred_TL[3] = pred_L[3] =
dst[-p->
linesize[0] + 3];
1628 for (x = 0; x < avctx->
width; x++) {
1639 dst[4 * x + 0] = pred_L[0] = (
a + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0xff;
1640 dst[4 * x + 1] = pred_L[1] = (
r + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0xff;
1641 dst[4 * x + 2] = pred_L[2] = (
r +
g + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0xff;
1642 dst[4 * x + 3] = pred_L[3] = (
r +
g +
b + ((3 * (pred_T[3] + pred_L[3]) - 2 * pred_TL[3]) >> 2)) & 0xff;
1644 pred_TL[0] = pred_T[0];
1645 pred_TL[1] = pred_T[1];
1646 pred_TL[2] = pred_T[2];
1647 pred_TL[3] = pred_T[3];
1662 for (x = 0; x < avctx->
width; x++) {
1668 int pred[4] = { -128, -128, -128, -128 };
1670 for (x = 0; x < avctx->
width; x++) {
1684 for (y = 1; y < avctx->
height; y++) {
1686 for (x = 0; x < avctx->
width; x++) {
1699 for (x = 0; x < avctx->
width; x++) {
1704 dst[4 * x + 0] = pred_L[0] = (
r + pred_L[0]) & 0xff;
1705 dst[4 * x + 1] = pred_L[1] = (
r +
g + pred_L[1]) & 0xff;
1706 dst[4 * x + 2] = pred_L[2] = (
r +
g +
b + pred_L[2]) & 0xff;
1721 for (x = 0; x < avctx->
width; x++) {
1727 int pred[4] = { -128, -128, -128, -128 };
1729 for (x = 0; x < avctx->
width; x++) {
1743 for (y = 1; y < avctx->
height; y++) {
1745 for (x = 0; x < avctx->
width; x++) {
1751 int pred_TL[4], pred_L[4], pred_T[4];
1754 pred_TL[0] = pred_L[0] =
dst[-p->
linesize[0] + 0];
1755 pred_TL[1] = pred_L[1] =
dst[-p->
linesize[0] + 1];
1756 pred_TL[2] = pred_L[2] =
dst[-p->
linesize[0] + 2];
1758 for (x = 0; x < avctx->
width; x++) {
1767 dst[4 * x + 0] = pred_L[0] = (
r + ((3 * (pred_T[0] + pred_L[0]) - 2 * pred_TL[0]) >> 2)) & 0xff;
1768 dst[4 * x + 1] = pred_L[1] = (
r +
g + ((3 * (pred_T[1] + pred_L[1]) - 2 * pred_TL[1]) >> 2)) & 0xff;
1769 dst[4 * x + 2] = pred_L[2] = (
r +
g +
b + ((3 * (pred_T[2] + pred_L[2]) - 2 * pred_TL[2]) >> 2)) & 0xff;
1771 pred_TL[0] = pred_T[0];
1772 pred_TL[1] = pred_T[1];
1773 pred_TL[2] = pred_T[2];
1782 const uint8_t *cur =
table->lens;
1787 unsigned new_count = count;
1790 new_count +=
table->nb_16s;
1793 new_count += *cur++;
1795 for (; count < new_count; count++)
1801 lens,
sizeof(*lens),
NULL, 0, 0, 0, 0,
NULL);
1813 if (avpkt->
size <= 20)
1824 case MKTAG(
' ',
'R',
'G',
'B'):
1829 case MKTAG(
' ',
'r',
'G',
'B'):
1834 case MKTAG(
'A',
'R',
'G',
'X'):
1839 case MKTAG(
'A',
'r',
'G',
'X'):
1844 case MKTAG(
'R',
'G',
'B',
'X'):
1849 case MKTAG(
'r',
'G',
'B',
'X'):
1854 case MKTAG(
'A',
'R',
'G',
'B'):
1859 case MKTAG(
'A',
'r',
'G',
'B'):
1864 case MKTAG(
'A',
'Y',
'B',
'R'):
1866 case MKTAG(
'A',
'Y',
'b',
'R'):
1871 case MKTAG(
'A',
'y',
'B',
'R'):
1873 case MKTAG(
'A',
'y',
'b',
'R'):
1878 case MKTAG(
' ',
'Y',
'B',
'R'):
1880 case MKTAG(
' ',
'Y',
'b',
'R'):
1885 case MKTAG(
' ',
'y',
'B',
'R'):
1887 case MKTAG(
' ',
'y',
'b',
'R'):
1892 case MKTAG(
'Y',
'B',
'R', 0x0a):
1897 case MKTAG(
'y',
'B',
'R', 0x0a):
1902 case MKTAG(
'C',
'A',
'4',
'p'):
1907 case MKTAG(
'C',
'A',
'4',
'i'):
1912 case MKTAG(
'B',
'Y',
'R',
'Y'):
1917 case MKTAG(
'B',
'Y',
'R',
'y'):
1922 case MKTAG(
'Y',
'b',
'Y',
'r'):
1927 case MKTAG(
'C',
'8',
'2',
'p'):
1932 case MKTAG(
'C',
'8',
'2',
'i'):
1937 case MKTAG(0xa2,
'Y',
'R',
'Y'):
1942 case MKTAG(0xa2,
'Y',
'R',
'y'):
1947 case MKTAG(
'C',
'A',
'2',
'p'):
1952 case MKTAG(
'C',
'A',
'2',
'i'):
1981 s->decode_frame(avctx, p, &gb);
1999 .
p.
name =
"sheervideo",