54 #define DNXHD_VLC_BITS 9
55 #define DNXHD_DC_VLC_BITS 7
73 if (cid != ctx->
cid) {
104 static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
107 if (buf_size < 0x280)
110 if (memcmp(buf, header_prefix, 5)) {
126 if (buf[0x21] & 0x40) {
188 int i, j, index1, index2,
len;
189 int level, component, sign;
190 const uint8_t *weight_matrix;
194 component = 1 + (n&1);
207 level = (
NEG_USR32(sign ^ level, len) ^ sign) - sign;
210 block[0] = ctx->
last_dc[component];
247 level = (2*level+1) * qscale * weight_matrix[i];
248 if (level_bias < 32 || weight_matrix[i] != level_bias)
250 level >>= level_shift;
253 block[j] = (level^sign) - sign;
276 uint8_t *dest_y, *dest_u, *dest_v;
277 int dct_y_offset, dct_x_offset;
284 for (i = 0; i < 8; i++) {
290 dct_linesize_luma <<= 1;
291 dct_linesize_chroma <<= 1;
294 dest_y = ctx->
picture.
data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 +
shift1));
295 dest_u = ctx->
picture.
data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 +
shift1));
296 dest_v = ctx->
picture.
data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 +
shift1));
304 dct_y_offset = dct_linesize_luma << 3;
305 dct_x_offset = 8 <<
shift1;
309 ctx->
dsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[5]);
312 dct_y_offset = dct_linesize_chroma << 3;
330 for (x = 0; x < ctx->
mb_width; x++) {
342 const uint8_t *buf = avpkt->
data;
343 int buf_size = avpkt->
size;
348 av_dlog(avctx,
"frame size %d\n", buf_size);
380 goto decode_coding_unit;