60 #define DNXHD_VLC_BITS 9
61 #define DNXHD_DC_VLC_BITS 7
81 if (cid != ctx->
cid) {
119 static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
120 static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
123 if (buf_size < 0x280) {
129 if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
138 "interlaced %d, cur field %d\n", buf[5] & 3, ctx->
cur_field);
150 if (buf[0x21] == 0x58) {
153 if (buf[0x4] == 0x2) {
161 }
else if (buf[0x21] == 0x38) {
205 "mb height too big: %d\n", ctx->
mb_height);
214 "invalid mb scan index (%d < %d).\n",
230 int i, j, index1, index2,
len,
flags;
231 int level, component, sign;
241 component = 1 + (n & 1);
250 component = (n >> 1) % 3;
266 level = (
NEG_USR32(sign ^ level, len) ^ sign) - sign;
269 block[0] = ctx->
last_dc[component];
277 while (index1 != eob_index) {
278 level = ac_level[index1];
279 flags = ac_flags[index1];
303 if (level_bias < 32 || weight_matrix[i] != level_bias)
305 level >>= level_shift;
307 block[j] = (level ^ sign) - sign;
339 int dct_linesize_luma = frame->
linesize[0];
340 int dct_linesize_chroma = frame->
linesize[1];
341 uint8_t *dest_y, *dest_u, *dest_v;
342 int dct_y_offset, dct_x_offset;
349 for (i = 0; i < 64; i++) {
356 for (i = 0; i < 8; i++) {
361 for (; i < 12; i++) {
368 dct_linesize_luma <<= 1;
369 dct_linesize_chroma <<= 1;
372 dest_y = frame->
data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 +
shift1));
373 dest_u = frame->
data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
374 dest_v = frame->
data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
382 dct_y_offset = dct_linesize_luma << 3;
383 dct_x_offset = 8 <<
shift1;
388 ctx->
idsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[5]);
391 dct_y_offset = dct_linesize_chroma << 3;
401 ctx->
idsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[7]);
404 dct_y_offset = dct_linesize_chroma << 3;
408 ctx->
idsp.
idct_put(dest_u + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[9]);
412 ctx->
idsp.
idct_put(dest_v + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[11]);
428 for (x = 0; x < ctx->
mb_width; x++) {
441 int buf_size = avpkt->
size;
448 av_dlog(avctx,
"frame size %d\n", buf_size);
484 goto decode_coding_unit;