57 #define DNXHD_VLC_BITS 9
58 #define DNXHD_DC_VLC_BITS 7
75 if (cid != ctx->
cid) {
111 static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
112 static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
115 if (buf_size < 0x280)
118 if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
135 if (buf[0x4] == 0x2) {
144 }
else if (buf[0x21] & 0x40) {
206 int i, j, index1, index2,
len,
flags;
207 int level, component, sign;
217 component = 1 + (n&1);
226 component = (n >> 1) % 3;
242 level = (
NEG_USR32(sign ^ level, len) ^ sign) - sign;
245 block[0] = ctx->
last_dc[component];
253 while (index1 != eob_index) {
254 level = ac_level[index1];
255 flags = ac_flags[index1];
279 if (level_bias < 32 || weight_matrix[i] != level_bias)
281 level >>= level_shift;
283 block[j] = (level^sign) - sign;
314 int dct_linesize_luma = frame->
linesize[0];
315 int dct_linesize_chroma = frame->
linesize[1];
316 uint8_t *dest_y, *dest_u, *dest_v;
317 int dct_y_offset, dct_x_offset;
324 for (i = 0; i < 64; i++) {
331 for (i = 0; i < 8; i++) {
336 for (; i < 12; i++) {
343 dct_linesize_luma <<= 1;
344 dct_linesize_chroma <<= 1;
347 dest_y = frame->
data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 +
shift1));
348 dest_u = frame->
data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
349 dest_v = frame->
data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
357 dct_y_offset = dct_linesize_luma << 3;
358 dct_x_offset = 8 <<
shift1;
363 ctx->
dsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[5]);
366 dct_y_offset = dct_linesize_chroma << 3;
376 ctx->
dsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[7]);
379 dct_y_offset = dct_linesize_chroma << 3;
383 ctx->
dsp.
idct_put(dest_u + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[9]);
387 ctx->
dsp.
idct_put(dest_v + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[11]);
403 for (x = 0; x < ctx->
mb_width; x++) {
416 int buf_size = avpkt->
size;
423 av_dlog(avctx,
"frame size %d\n", buf_size);
453 goto decode_coding_unit;