59 #define DNXHD_VLC_BITS 9
60 #define DNXHD_DC_VLC_BITS 7
80 if (cid != ctx->
cid) {
118 static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
119 static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
122 if (buf_size < 0x280)
125 if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
134 "interlaced %d, cur field %d\n", buf[5] & 3, ctx->
cur_field);
143 if (buf[0x4] == 0x2) {
153 }
else if (buf[0x21] & 0x40) {
196 "mb height too big: %d\n", ctx->
mb_height);
219 int i, j, index1, index2,
len,
flags;
220 int level, component, sign;
230 component = 1 + (n & 1);
239 component = (n >> 1) % 3;
255 level = (
NEG_USR32(sign ^ level, len) ^ sign) - sign;
258 block[0] = ctx->
last_dc[component];
266 while (index1 != eob_index) {
267 level = ac_level[index1];
268 flags = ac_flags[index1];
292 if (level_bias < 32 || weight_matrix[i] != level_bias)
294 level >>= level_shift;
296 block[j] = (level ^ sign) - sign;
328 int dct_linesize_luma = frame->
linesize[0];
329 int dct_linesize_chroma = frame->
linesize[1];
330 uint8_t *dest_y, *dest_u, *dest_v;
331 int dct_y_offset, dct_x_offset;
338 for (i = 0; i < 64; i++) {
345 for (i = 0; i < 8; i++) {
350 for (; i < 12; i++) {
357 dct_linesize_luma <<= 1;
358 dct_linesize_chroma <<= 1;
361 dest_y = frame->
data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 +
shift1));
362 dest_u = frame->
data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
363 dest_v = frame->
data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
371 dct_y_offset = dct_linesize_luma << 3;
372 dct_x_offset = 8 <<
shift1;
377 ctx->
idsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[5]);
380 dct_y_offset = dct_linesize_chroma << 3;
390 ctx->
idsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[7]);
393 dct_y_offset = dct_linesize_chroma << 3;
397 ctx->
idsp.
idct_put(dest_u + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[9]);
401 ctx->
idsp.
idct_put(dest_v + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[11]);
417 for (x = 0; x < ctx->
mb_width; x++) {
430 int buf_size = avpkt->
size;
437 av_dlog(avctx,
"frame size %d\n", buf_size);
467 goto decode_coding_unit;