1 /*
2 * Bink video decoder
3 * Copyright (c) 2009 Konstantin Shishkov
4 * Copyright (C) 2011 Peter Ross <pross@xvid.org>
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
28
29 #define BITSTREAM_READER_LE
38
39 #define BINK_FLAG_ALPHA 0x00100000
40 #define BINK_FLAG_GRAY 0x00020000
41
43
44 /**
45 * IDs for different data types used in old version of Bink video codec
46 */
58
60 };
61
63 4, 8, 8, 5, 5, 11, 11, 4, 4, 7
64 };
65
67 0, 0, 0, 1, 1, 0, 1, 0, 0, 0
68 };
69
72
73 /**
74 * IDs for different data types used in Bink video codec
75 */
86
88 };
89
90 /**
91 * data needed to decode 4-bit Huffman-coded value
92 */
94 int vlc_num;
///< tree number (in bink_trees[])
95 uint8_t
syms[16];
///< leaf value to symbol mapping
97
98 #define GET_HUFF(gb, tree) (tree).syms[get_vlc2(gb, bink_trees[(tree).vlc_num].table,\
99 bink_trees[(tree).vlc_num].bits, 1)]
100
101 /**
102 * data structure used for decoding single Bink data type
103 */
105 int len;
///< length of number of entries to decode (in bits)
107 uint8_t *
data;
///< buffer for decoded symbols
109 uint8_t *
cur_dec;
///< pointer to the not yet decoded part of the buffer
110 uint8_t *
cur_ptr;
///< pointer to the data that is not read from buffer yet
112
113 /*
114 * Decoder context
115 */
126
128 Tree col_high[16];
///< trees for decoding high nibble in "colours" data type
129 int col_lastval;
///< value of last decoded high nibble in "colours" data type
131
132 /**
133 * Bink video block types
134 */
138 MOTION_BLOCK,
///< block is copied from previous frame with some offset
139 RUN_BLOCK,
///< block is composed from runs of colours with custom scan order
144 PATTERN_BLOCK,
///< block is filled with two colours following custom pattern
146 };
147
148 /**
149 * Initialize length in all bundles.
150 *
151 * @param c decoder context
152 * @param width plane width
153 * @param bw plane width in 8x8 blocks
154 */
156 {
158
160
162
164
169
171
173 }
174
175 /**
176 * Allocate memory for bundles.
177 *
178 * @param c decoder context
179 */
181 {
182 int bw, bh, blocks;
185
186 bw = (
c->avctx->width + 7) >> 3;
187 bh = (
c->avctx->height + 7) >> 3;
188 blocks = bw * bh;
189
194 c->bundle[
i].data =
tmp;
196 c->bundle[
i].data_end =
tmp;
197 }
198
199 return 0;
200 }
201
202 /**
203 * Free memory used by bundles.
204 *
205 * @param c decoder context
206 */
208 {
210 }
211
212 /**
213 * Merge two consequent lists of equal size depending on bits read.
214 *
215 * @param gb context for reading bits
216 * @param dst buffer where merged list will be written to
217 * @param src pointer to the head of the first list (the second lists starts at src+size)
218 * @param size input lists size
219 */
221 {
224
225 do {
229 } else {
230 *dst++ = *src2++;
231 size2--;
232 }
233 }
while (
size && size2);
234
237 while (size2--)
238 *dst++ = *src2++;
239 }
240
241 /**
242 * Read information about Huffman tree used to decode data.
243 *
244 * @param gb context for reading bits
245 * @param tree pointer for storing tree data
246 */
248 {
249 uint8_t tmp1[16] = { 0 }, tmp2[16], *in = tmp1, *
out = tmp2;
251
254
257 for (
i = 0;
i < 16;
i++)
259 return 0;
260 }
263 for (
i = 0;
i <=
len;
i++) {
265 tmp1[tree->
syms[
i]] = 1;
266 }
267 for (
i = 0;
i < 16 &&
len < 16 - 1;
i++)
270 } else {
272 for (
i = 0;
i < 16;
i++)
274 for (
i = 0;
i <=
len;
i++) {
276 for (t = 0; t < 16; t +=
size << 1)
279 }
280 memcpy(tree->
syms, in, 16);
281 }
282 return 0;
283 }
284
285 /**
286 * Prepare bundle for decoding data.
287 *
288 * @param gb context for reading bits
289 * @param c decoder context
290 * @param bundle_num number of the bundle to initialize
291 */
293 {
295
297 for (
i = 0;
i < 16;
i++) {
301 }
303 }
308 }
309 c->bundle[bundle_num].cur_dec =
310 c->bundle[bundle_num].cur_ptr =
c->bundle[bundle_num].data;
311
312 return 0;
313 }
314
315 /**
316 * common check before starting decoding bundle data
317 *
318 * @param gb context for reading bits
319 * @param b bundle
320 * @param t variable where number of elements to decode will be stored
321 */
322 #define CHECK_READ_VAL(gb, b, t) \
323 if (!b->cur_dec || (b->cur_dec > b->cur_ptr)) \
324 return 0; \
325 t = get_bits(gb, b->len); \
326 if (!t) { \
327 b->cur_dec = NULL; \
328 return 0; \
329 } \
330
332 {
333 int t, v;
334 const uint8_t *dec_end;
335
337 dec_end =
b->cur_dec + t;
338 if (dec_end >
b->data_end) {
341 }
346 memset(
b->cur_dec, v, t);
348 } else {
349 while (
b->cur_dec < dec_end)
351 }
352 return 0;
353 }
354
356 {
357 int t, sign, v;
358 const uint8_t *dec_end;
359
361 dec_end =
b->cur_dec + t;
362 if (dec_end >
b->data_end) {
365 }
370 if (v) {
372 v = (v ^ sign) - sign;
373 }
374 memset(
b->cur_dec, v, t);
376 } else {
377 while (
b->cur_dec < dec_end) {
379 if (v) {
381 v = (v ^ sign) - sign;
382 }
384 }
385 }
386 return 0;
387 }
388
390
392 {
394 int t, v;
395 int last = 0;
396 const uint8_t *dec_end;
397
399 if (
c->version ==
'k') {
401 if (t == 0) {
403 return 0;
404 }
405 }
406 dec_end =
b->cur_dec + t;
407 if (dec_end >
b->data_end) {
410 }
415 memset(
b->cur_dec, v, t);
417 } else {
418 while (
b->cur_dec < dec_end) {
420 if (v < 12) {
421 last = v;
423 } else {
425
426 if (dec_end -
b->cur_dec <
run)
428 memset(
b->cur_dec, last,
run);
430 }
431 }
432 }
433 return 0;
434 }
435
437 {
438 int t, v;
439 const uint8_t *dec_end;
440
442 dec_end =
b->cur_dec + t;
443 if (dec_end >
b->data_end) {
446 }
447 while (
b->cur_dec < dec_end) {
453 }
454
455 return 0;
456 }
457
459 {
460 int t, sign, v;
461 const uint8_t *dec_end;
462
464 dec_end =
b->cur_dec + t;
465 if (dec_end >
b->data_end) {
468 }
472 c->col_lastval =
GET_HUFF(gb,
c->col_high[
c->col_lastval]);
474 v = (
c->col_lastval << 4) | v;
475 if (
c->version <
'i') {
476 sign = ((int8_t) v) >> 7;
477 v = ((v & 0x7F) ^ sign) - sign;
478 v += 0x80;
479 }
480 memset(
b->cur_dec, v, t);
482 } else {
483 while (
b->cur_dec < dec_end) {
486 c->col_lastval =
GET_HUFF(gb,
c->col_high[
c->col_lastval]);
488 v = (
c->col_lastval << 4) | v;
489 if (
c->version <
'i') {
490 sign = ((int8_t) v) >> 7;
491 v = ((v & 0x7F) ^ sign) - sign;
492 v += 0x80;
493 }
495 }
496 }
497 return 0;
498 }
499
500 /** number of bits used to store first DC value in bundle */
501 #define DC_START_BITS 11
502
504 int start_bits, int has_sign)
505 {
506 int i, j,
len, len2, bsize, sign, v, v2;
507 int16_t *dst = (int16_t*)
b->cur_dec;
508 int16_t *dst_end = (int16_t*)
b->data_end;
509
513 v =
get_bits(gb, start_bits - has_sign);
514 if (v && has_sign) {
516 v = (v ^ sign) - sign;
517 }
518 if (dst_end - dst < 1)
520 *dst++ = v;
522 for (
i = 0;
i <
len;
i += 8) {
524 if (dst_end - dst < len2)
527 if (bsize) {
528 for (j = 0; j < len2; j++) {
530 if (v2) {
532 v2 = (v2 ^ sign) - sign;
533 }
534 v += v2;
535 *dst++ = v;
536 if (v < -32768 || v > 32767) {
539 }
540 }
541 } else {
542 for (j = 0; j < len2; j++)
543 *dst++ = v;
544 }
545 }
546
547 b->cur_dec = (uint8_t*)dst;
548 return 0;
549 }
550
551 /**
552 * Retrieve next value from bundle.
553 *
554 * @param c decoder context
555 * @param bundle bundle number
556 */
558 {
560
562 return *
c->bundle[bundle].cur_ptr++;
564 return (int8_t)*
c->bundle[bundle].cur_ptr++;
565 ret = *(int16_t*)
c->bundle[bundle].cur_ptr;
566 c->bundle[bundle].cur_ptr += 2;
568 }
569
571 {
572 c->bundle[bundle_num].cur_dec =
573 c->bundle[bundle_num].cur_ptr =
c->bundle[bundle_num].data;
574 c->bundle[bundle_num].len = 13;
575 }
576
578 {
582 }
583
585 {
591
593 if (
b->data_end -
b->cur_dec <
len * (1 + (
bits > 8)))
596 if (!issigned) {
599 } else {
602 }
603 } else {
604 int16_t *dst = (int16_t*)
b->cur_dec;
605
609 } else {
612 }
613 b->cur_dec = (uint8_t*)dst;
614 }
615 return 0;
616 }
617
619 {
622
624 int val = *
c->bundle[bundle_num].cur_ptr++;
626 }
627 ret = *(int16_t*)
c->bundle[bundle_num].cur_ptr;
628 c->bundle[bundle_num].cur_ptr += 2;
630 }
631
632 /**
633 * Read 8x8 block of DCT coefficients.
634 *
635 * @param gb context for reading bits
636 * @param block place for storing coefficients
637 * @param scan scan order table
638 * @param quant_matrices quantization matrices
639 * @return 0 for success, negative value in other cases
640 */
642 const uint8_t *scan, int *coef_count_,
643 int coef_idx[64], int q)
644 {
645 int coef_list[128];
646 int mode_list[128];
648 int list_start = 64, list_end = 64, list_pos;
649 int coef_count = 0;
650 int quant_idx;
651
654
655 coef_list[list_end] = 4; mode_list[list_end++] = 0;
656 coef_list[list_end] = 24; mode_list[list_end++] = 0;
657 coef_list[list_end] = 44; mode_list[list_end++] = 0;
658 coef_list[list_end] = 1; mode_list[list_end++] = 3;
659 coef_list[list_end] = 2; mode_list[list_end++] = 3;
660 coef_list[list_end] = 3; mode_list[list_end++] = 3;
661
663 list_pos = list_start;
664 while (list_pos < list_end) {
665 if (!(mode_list[list_pos] | coef_list[list_pos]) || !
get_bits1(gb)) {
666 list_pos++;
667 continue;
668 }
669 ccoef = coef_list[list_pos];
670 mode = mode_list[list_pos];
672 case 0:
673 coef_list[list_pos] = ccoef + 4;
674 mode_list[list_pos] = 1;
675 case 2:
677 coef_list[list_pos] = 0;
678 mode_list[list_pos++] = 0;
679 }
680 for (
i = 0;
i < 4;
i++, ccoef++) {
682 coef_list[--list_start] = ccoef;
683 mode_list[ list_start] = 3;
684 } else {
687 } else {
690 t = (t ^ sign) - sign;
691 }
692 block[scan[ccoef]] = t;
693 coef_idx[coef_count++] = ccoef;
694 }
695 }
696 break;
697 case 1:
698 mode_list[list_pos] = 2;
699 for (
i = 0;
i < 3;
i++) {
700 ccoef += 4;
701 coef_list[list_end] = ccoef;
702 mode_list[list_end++] = 2;
703 }
704 break;
705 case 3:
708 } else {
711 t = (t ^ sign) - sign;
712 }
713 block[scan[ccoef]] = t;
714 coef_idx[coef_count++] = ccoef;
715 coef_list[list_pos] = 0;
716 mode_list[list_pos++] = 0;
717 break;
718 }
719 }
720 }
721
722 if (q == -1) {
724 } else {
725 quant_idx = q;
726 if (quant_idx > 15
U) {
729 }
730 }
731
732 *coef_count_ = coef_count;
733
734 return quant_idx;
735 }
736
738 int coef_count, int coef_idx[64],
739 const uint8_t *scan)
740 {
743 for (
i = 0;
i < coef_count;
i++) {
744 int idx = coef_idx[
i];
746 }
747 }
748
749 /**
750 * Read 8x8 block with residue after motion compensation.
751 *
752 * @param gb context for reading bits
753 * @param block place to store read data
754 * @param masks_count number of masks to decode
755 * @return 0 on success, negative value in other cases
756 */
758 {
759 int coef_list[128];
760 int mode_list[128];
762 int list_start = 64, list_end = 64, list_pos;
763 int nz_coeff[64];
764 int nz_coeff_count = 0;
765
766 coef_list[list_end] = 4; mode_list[list_end++] = 0;
767 coef_list[list_end] = 24; mode_list[list_end++] = 0;
768 coef_list[list_end] = 44; mode_list[list_end++] = 0;
769 coef_list[list_end] = 0; mode_list[list_end++] = 2;
770
772 for (
i = 0;
i < nz_coeff_count;
i++) {
774 continue;
775 if (
block[nz_coeff[
i]] < 0)
777 else
779 masks_count--;
780 if (masks_count < 0)
781 return 0;
782 }
783 list_pos = list_start;
784 while (list_pos < list_end) {
785 if (!(coef_list[list_pos] | mode_list[list_pos]) || !
get_bits1(gb)) {
786 list_pos++;
787 continue;
788 }
789 ccoef = coef_list[list_pos];
790 mode = mode_list[list_pos];
792 case 0:
793 coef_list[list_pos] = ccoef + 4;
794 mode_list[list_pos] = 1;
795 case 2:
797 coef_list[list_pos] = 0;
798 mode_list[list_pos++] = 0;
799 }
800 for (
i = 0;
i < 4;
i++, ccoef++) {
802 coef_list[--list_start] = ccoef;
803 mode_list[ list_start] = 3;
804 } else {
805 nz_coeff[nz_coeff_count++] =
bink_scan[ccoef];
808 masks_count--;
809 if (masks_count < 0)
810 return 0;
811 }
812 }
813 break;
814 case 1:
815 mode_list[list_pos] = 2;
816 for (
i = 0;
i < 3;
i++) {
817 ccoef += 4;
818 coef_list[list_end] = ccoef;
819 mode_list[list_end++] = 2;
820 }
821 break;
822 case 3:
823 nz_coeff[nz_coeff_count++] =
bink_scan[ccoef];
826 coef_list[list_pos] = 0;
827 mode_list[list_pos++] = 0;
828 masks_count--;
829 if (masks_count < 0)
830 return 0;
831 break;
832 }
833 }
834 }
835
836 return 0;
837 }
838
839 /**
840 * Copy 8x8 block from source to destination, where src and dst may be overlapped
841 */
843 {
846 for (
i = 0;
i < 8;
i++)
848 for (
i = 0;
i < 8;
i++)
850 }
851
853 int plane_idx, int is_key, int is_chroma)
854 {
857 uint8_t *dst, *
ref, *ref_start, *ref_end;
858 int v, col[2];
859 const uint8_t *scan;
860 int xoff, yoff;
863 int coordmap[64];
864 int ybias = is_key ? -15 : 0;
865 int qp, quant_idx, coef_count, coef_idx[64];
866
868 int bw = is_chroma ? (
c->avctx->width + 15) >> 4 : (
c->avctx->width + 7) >> 3;
869 int bh = is_chroma ? (
c->avctx->height + 15) >> 4 : (
c->avctx->height + 7) >> 3;
870
872 ref_start =
frame->data[plane_idx];
873 ref_end =
frame->data[plane_idx] + (bh *
frame->linesize[plane_idx] + bw) * 8;
874
875 for (
i = 0;
i < 64;
i++)
876 coordmap[
i] = (
i & 7) + (
i >> 3) *
stride;
877
878 for (by = 0; by < bh; by++) {
882 }
883
885 for (bx = 0; bx < bw; bx++, dst += 8) {
888 case 0:
889 break;
890 case 1:
893 do {
895
898
903 }
906 for (j = 0; j <
run; j++)
907 dst[coordmap[*scan++]] = v;
908 } else {
909 for (j = 0; j <
run; j++)
911 }
915 break;
916 case 2:
917 memset(dctblock, 0, sizeof(*dctblock) * 64);
921 return quant_idx;
923 c->binkdsp.idct_put(dst,
stride, dctblock);
924 break;
925 case 3:
929 if (ref < ref_start || ref + 8*stride > ref_end) {
931 }
else if (
ref + 8*stride < dst || ref >= dst + 8*
stride) {
933 } else {
935 }
936 c->bdsp.clear_block(
block);
940 break;
941 case 4:
945 if (ref < ref_start || ref + 8 * stride > ref_end) {
947 }
else if (
ref + 8*stride < dst || ref >= dst + 8*
stride) {
949 } else {
951 }
952 memset(dctblock, 0, sizeof(*dctblock) * 64);
956 return quant_idx;
958 c->binkdsp.idct_add(dst,
stride, dctblock);
959 break;
960 case 5:
962 c->bdsp.fill_block_tab[1](dst, v,
stride, 8);
963 break;
964 case 6:
965 for (
i = 0;
i < 2;
i++)
967 for (
i = 0;
i < 8;
i++) {
969 for (j = 0; j < 8; j++, v >>= 1)
970 dst[
i*
stride + j] = col[v & 1];
971 }
972 break;
973 case 7:
977 if (ref < ref_start || ref + 8 * stride > ref_end) {
979 }
else if (
ref + 8*stride < dst || ref >= dst + 8*
stride) {
981 } else {
983 }
984 break;
985 case 8:
986 for (
i = 0;
i < 8;
i++)
989 break;
990 default:
993 }
994 }
995 }
996 if (
get_bits_count(gb) & 0x1F)
//next plane data starts at 32-bit boundary
998
999 return 0;
1000 }
1001
1003 uint8_t *dst, uint8_t *prev,
int stride,
1004 uint8_t *ref_start,
1005 uint8_t *ref_end)
1006 {
1009 uint8_t *
ref = prev + xoff + yoff *
stride;
1010 if (ref < ref_start || ref > ref_end) {
1012 xoff, yoff);
1014 }
1016
1017 return 0;
1018 }
1019
1021 int plane_idx, int is_chroma)
1022 {
1025 uint8_t *dst, *prev, *ref_start, *ref_end;
1026 int v, col[2];
1027 const uint8_t *scan;
1031 int coordmap[64], quant_idx, coef_count, coef_idx[64];
1032
1034 int bw = is_chroma ? (
c->avctx->width + 15) >> 4 : (
c->avctx->width + 7) >> 3;
1035 int bh = is_chroma ? (
c->avctx->height + 15) >> 4 : (
c->avctx->height + 7) >> 3;
1036 int width =
c->avctx->width >> is_chroma;
1037 int height =
c->avctx->height >> is_chroma;
1038
1041
1042 dst =
frame->data[plane_idx];
1043
1046 goto end;
1047 }
1048
1054 }
1055
1056 ref_start =
c->last->data[plane_idx] ?
c->last->data[plane_idx]
1057 :
frame->data[plane_idx];
1058 ref_end = ref_start
1059 + (bw - 1 +
c->last->linesize[plane_idx] * (bh - 1)) * 8;
1060
1061 for (
i = 0;
i < 64;
i++)
1062 coordmap[
i] = (
i & 7) + (
i >> 3) *
stride;
1063
1064 for (by = 0; by < bh; by++) {
1083
1085 prev = (
c->last->data[plane_idx] ?
c->last->data[plane_idx]
1087 for (bx = 0; bx < bw; bx++, dst += 8, prev += 8) {
1089 // 16x16 block type on odd line means part of the already decoded block, so skip it
1091 bx++;
1092 dst += 8;
1093 prev += 8;
1094 continue;
1095 }
1098 c->put_pixels_tab(dst, prev,
stride, 8);
1099 break;
1108 do {
1110
1115 }
1118 for (j = 0; j <
run; j++)
1119 ublock[*scan++] = v;
1120 } else {
1121 for (j = 0; j <
run; j++)
1123 }
1127 break;
1129 memset(dctblock, 0, sizeof(*dctblock) * 64);
1132 return quant_idx;
1134 c->binkdsp.idct_put(ublock, 8, dctblock);
1135 break;
1138 c->bdsp.fill_block_tab[0](dst, v,
stride, 16);
1139 break;
1141 for (
i = 0;
i < 2;
i++)
1143 for (j = 0; j < 8; j++) {
1145 for (
i = 0; i < 8; i++, v >>= 1)
1146 ublock[
i + j*8] = col[v & 1];
1147 }
1148 break;
1150 for (j = 0; j < 8; j++)
1151 for (
i = 0;
i < 8;
i++)
1153 break;
1154 default:
1157 }
1159 c->binkdsp.scale_block(ublock, dst,
stride);
1160 bx++;
1161 dst += 8;
1162 prev += 8;
1163 break;
1166 ref_start, ref_end);
1169 break;
1173 do {
1175
1180 }
1183 for (j = 0; j <
run; j++)
1184 dst[coordmap[*scan++]] = v;
1185 } else {
1186 for (j = 0; j <
run; j++)
1188 }
1192 break;
1195 ref_start, ref_end);
1198 c->bdsp.clear_block(
block);
1202 break;
1204 memset(dctblock, 0, sizeof(*dctblock) * 64);
1207 return quant_idx;
1209 c->binkdsp.idct_put(dst,
stride, dctblock);
1210 break;
1213 c->bdsp.fill_block_tab[1](dst, v,
stride, 8);
1214 break;
1217 ref_start, ref_end);
1220 memset(dctblock, 0, sizeof(*dctblock) * 64);
1223 return quant_idx;
1225 c->binkdsp.idct_add(dst,
stride, dctblock);
1226 break;
1228 for (
i = 0;
i < 2;
i++)
1230 for (
i = 0;
i < 8;
i++) {
1232 for (j = 0; j < 8; j++, v >>= 1)
1233 dst[
i*
stride + j] = col[v & 1];
1234 }
1235 break;
1237 for (
i = 0;
i < 8;
i++)
1240 break;
1241 default:
1244 }
1245 }
1246 }
1247
1248 end:
1249 if (
get_bits_count(gb) & 0x1F)
//next plane data starts at 32-bit boundary
1251
1252 return 0;
1253 }
1254
1256 {
1260 int plane, plane_idx,
ret;
1261 int bits_count =
pkt->
size << 3;
1262
1263 if (
c->version >
'b') {
1266 } else {
1271 }
1272
1275 if (
c->version >=
'i')
1279 }
1280 if (
c->version >=
'i')
1282
1284
1285 for (plane = 0; plane < 3; plane++) {
1286 plane_idx = (!plane || !
c->swap_planes) ? plane : (plane ^ 3);
1287
1288 if (
c->version >
'b') {
1291 } else {
1293 c->frame_num == 1, !!plane)) < 0)
1295 }
1297 break;
1298 }
1299 emms_c();
1300
1301 if (
c->version >
'b') {
1305 }
1306
1307 *got_frame = 1;
1308
1309 /* always report that the buffer was completely consumed */
1311 }
1312
1314 {
1315 for (
int i = 0,
offset = 0;
i < 16;
i++) {
1324 }
1325 }
1326
1327 /**
1328 * Calculate quantization tables for version b
1329 */
1331 {
1332 uint8_t inv_bink_scan[64];
1333 static const int s[64]={
1334 1073741824,1489322693,1402911301,1262586814,1073741824, 843633538, 581104888, 296244703,
1335 1489322693,2065749918,1945893874,1751258219,1489322693,1170153332, 806015634, 410903207,
1336 1402911301,1945893874,1832991949,1649649171,1402911301,1102260336, 759250125, 387062357,
1337 1262586814,1751258219,1649649171,1484645031,1262586814, 992008094, 683307060, 348346918,
1338 1073741824,1489322693,1402911301,1262586814,1073741824, 843633538, 581104888, 296244703,
1339 843633538,1170153332,1102260336, 992008094, 843633538, 662838617, 456571181, 232757969,
1340 581104888, 806015634, 759250125, 683307060, 581104888, 456571181, 314491699, 160326478,
1341 296244703, 410903207, 387062357, 348346918, 296244703, 232757969, 160326478, 81733730,
1342 };
1344 #define C (1LL<<30)
1345 for (
i = 0;
i < 64;
i++)
1347
1348 for (j = 0; j < 16; j++) {
1349 for (
i = 0;
i < 64;
i++) {
1350 int k = inv_bink_scan[
i];
1355 }
1356 }
1357 }
1358
1360 {
1366
1371 }
1374 c->swap_planes =
c->version >=
'h';
1376
1379
1383
1386
1391
1394
1395 if (
c->version ==
'b') {
1398 }
1400
1401 return 0;
1402 }
1403
1405 {
1407
1409
1411 return 0;
1412 }
1413
1415 {
1417
1419 }
1420
1422 .
name =
"binkvideo",
1433 };