29 #define BITSTREAM_READER_LE
93 #define DEQUANT(val, q) (((q) * (val) + 0x80) >> 8)
94 #define DCT1D(d0, d1, d2, d3, s0, s1, s2, s3, OP) \
95 OP(d0, 5 * ((s0) + (s1) + (s2)) + 2 * (s3)); \
96 OP(d1, 5 * ((s0) - (s2) - (s3)) + 2 * (s1)); \
97 OP(d2, 5 * ((s0) - (s2) + (s3)) - 2 * (s1)); \
98 OP(d3, 5 * ((s0) - (s1) + (s2)) - 2 * (s3)); \
100 #define COL_OP(a, b) a = (b)
101 #define ROW_OP(a, b) a = ((b) + 0x20) >> 6
109 for (i = 0; i < 4; i++) {
110 t0 =
DEQUANT(q[0 + (i & 1)], in[0 * 4 + i]);
111 t1 =
DEQUANT(q[1 + (i & 1)], in[1 * 4 + i]);
112 t2 =
DEQUANT(q[0 + (i & 1)], in[2 * 4 + i]);
113 t3 =
DEQUANT(q[1 + (i & 1)], in[3 * 4 + i]);
114 DCT1D(tblk[0 * 4 + i], tblk[1 * 4 + i],
115 tblk[2 * 4 + i], tblk[3 * 4 + i],
118 for (i = 0; i < 4; i++) {
119 DCT1D(dst[0], dst[1], dst[2], dst[3],
120 tblk[i * 4 + 0], tblk[i * 4 + 1],
121 tblk[i * 4 + 2], tblk[i * 4 + 3],
ROW_OP);
130 int prev_dc,
dc, nc, ac, bpos,
val;
136 for (i = 0; i < 8; i++, dst += stride)
137 memset(dst, val, 16);
141 for (i = 0; i < 8; i++) {
142 for (j = 0; j < 16; j++)
151 for (j = 0; j < 2; j++) {
152 for (k = 0; k < 4; k++) {
162 dc = (dc + prev_dc) & 0xFF;
171 memset(c->
block + 1, 0, 15 *
sizeof(*c->
block));
172 for (l = 0; l < nc; l++) {
200 for (mb_x = 0; mb_x < c->
mb_width; mb_x++) {
203 if (q == 0 || q == 3)
205 for (i = 0; i < 3; i++) {
221 int buf_size = avpkt->
size;
224 uint32_t frame_type,
size;
230 frame_type = bytestream2_get_byte(&gb);
231 if (frame_type > 1) {
241 if (frame_type == 0) {
254 c->
quant[0] = bytestream2_get_byte(&gb);
255 c->
quant[1] = bytestream2_get_byte(&gb);
263 for (i = 0; i < 3; i++) {
270 size = bytestream2_get_le32(&gb);
276 for (i = 0; i <
size; i++) {
277 val = bytestream2_get_byte(&gb);
280 if (pos + len > num_mb) {
294 size = bytestream2_peek_byte(&gb);
296 size = bytestream2_get_byte(&gb) - 1;
298 size = bytestream2_get_le32(&gb) >> 1;
301 int skip_row = 1, j, off = i * c->
mb_width;