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)
126 if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
135 "interlaced %d, cur field %d\n", buf[5] & 3, ctx->
cur_field);
144 if (buf[0x4] == 0x2) {
154 }
else if (buf[0x21] & 0x40) {
197 "mb height too big: %d\n", ctx->
mb_height);
220 int i, j, index1, index2,
len,
flags;
221 int level, component, sign;
231 component = 1 + (n & 1);
240 component = (n >> 1) % 3;
256 level = (
NEG_USR32(sign ^ level, len) ^ sign) - sign;
259 block[0] = ctx->
last_dc[component];
267 while (index1 != eob_index) {
268 level = ac_level[index1];
269 flags = ac_flags[index1];
293 if (level_bias < 32 || weight_matrix[i] != level_bias)
295 level >>= level_shift;
297 block[j] = (level ^ sign) - sign;
329 int dct_linesize_luma = frame->
linesize[0];
330 int dct_linesize_chroma = frame->
linesize[1];
331 uint8_t *dest_y, *dest_u, *dest_v;
332 int dct_y_offset, dct_x_offset;
339 for (i = 0; i < 64; i++) {
346 for (i = 0; i < 8; i++) {
351 for (; i < 12; i++) {
358 dct_linesize_luma <<= 1;
359 dct_linesize_chroma <<= 1;
362 dest_y = frame->
data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 +
shift1));
363 dest_u = frame->
data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
364 dest_v = frame->
data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
372 dct_y_offset = dct_linesize_luma << 3;
373 dct_x_offset = 8 <<
shift1;
378 ctx->
idsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[5]);
381 dct_y_offset = dct_linesize_chroma << 3;
391 ctx->
idsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[7]);
394 dct_y_offset = dct_linesize_chroma << 3;
398 ctx->
idsp.
idct_put(dest_u + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[9]);
402 ctx->
idsp.
idct_put(dest_v + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[11]);
418 for (x = 0; x < ctx->
mb_width; x++) {
431 int buf_size = avpkt->
size;
438 av_dlog(avctx,
"frame size %d\n", buf_size);
474 goto decode_coding_unit;