27 #define BITSTREAM_READER_LE
91 #define DEQUANT(val, q) ((q * val + 0x80) >> 8)
92 #define DCT1D(d0, d1, d2, d3, s0, s1, s2, s3, OP) \
93 OP(d0, 5 * ((s0) + (s1) + (s2)) + 2 * (s3)); \
94 OP(d1, 5 * ((s0) - (s2) - (s3)) + 2 * (s1)); \
95 OP(d2, 5 * ((s0) - (s2) + (s3)) - 2 * (s1)); \
96 OP(d3, 5 * ((s0) - (s1) + (s2)) - 2 * (s3)); \
98 #define COL_OP(a, b) a = b
99 #define ROW_OP(a, b) a = ((b) + 0x20) >> 6
107 for (i = 0; i < 4; i++) {
108 t0 =
DEQUANT(q[0 + (i & 1)], in[0 * 4 + i]);
109 t1 =
DEQUANT(q[1 + (i & 1)], in[1 * 4 + i]);
110 t2 =
DEQUANT(q[0 + (i & 1)], in[2 * 4 + i]);
111 t3 =
DEQUANT(q[1 + (i & 1)], in[3 * 4 + i]);
112 DCT1D(tblk[0 * 4 + i], tblk[1 * 4 + i],
113 tblk[2 * 4 + i], tblk[3 * 4 + i],
116 for (i = 0; i < 4; i++) {
117 DCT1D(dst[0], dst[1], dst[2], dst[3],
118 tblk[i * 4 + 0], tblk[i * 4 + 1],
119 tblk[i * 4 + 2], tblk[i * 4 + 3],
ROW_OP);
128 int prev_dc,
dc, nc, ac, bpos,
val;
134 for (i = 0; i < 8; i++, dst +=
stride)
135 memset(dst, val, 16);
139 for (i = 0; i < 8; i++) {
140 for (j = 0; j < 16; j++)
149 for (j = 0; j < 2; j++) {
150 for (k = 0; k < 4; k++) {
160 dc = (dc + prev_dc) & 0xFF;
169 memset(c->
block + 1, 0, 15 *
sizeof(*c->
block));
170 for (l = 0; l < nc; l++) {
197 for (mb_x = 0; mb_x < c->
mb_width; mb_x++) {
200 if (q == 0 || q == 3)
202 for (i = 0; i < 3; i++) {
218 int buf_size = avpkt->
size;
221 uint32_t frame_type,
size;
227 frame_type = bytestream2_get_byte(&gb);
228 if (frame_type > 1) {
237 if (frame_type == 0) {
250 c->
quant[0] = bytestream2_get_byte(&gb);
251 c->
quant[1] = bytestream2_get_byte(&gb);
259 for (i = 0; i < 3; i++) {
266 size = bytestream2_get_le32(&gb);
272 for (i = 0; i <
size; i++) {
273 val = bytestream2_get_byte(&gb);
276 if (pos + len > num_mb) {
290 size = bytestream2_peek_byte(&gb);
292 size = bytestream2_get_byte(&gb) - 1;
294 size = bytestream2_get_le32(&gb) >> 1;