55 #define DNXHD_VLC_BITS 9
56 #define DNXHD_DC_VLC_BITS 7
74 if (cid != ctx->
cid) {
105 static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
108 if (buf_size < 0x280)
111 if (memcmp(buf, header_prefix, 5)) {
127 if (buf[0x21] & 0x40) {
189 int i, j, index1, index2,
len;
190 int level, component, sign;
195 component = 1 + (n&1);
208 level = (
NEG_USR32(sign ^ level, len) ^ sign) - sign;
211 block[0] = ctx->
last_dc[component];
242 level = (2*level+1) * qscale * weight_matrix[i];
243 if (level_bias < 32 || weight_matrix[i] != level_bias)
245 level >>= level_shift;
247 block[j] = (level^sign) - sign;
270 uint8_t *dest_y, *dest_u, *dest_v;
271 int dct_y_offset, dct_x_offset;
277 for (i = 0; i < 8; i++) {
283 dct_linesize_luma <<= 1;
284 dct_linesize_chroma <<= 1;
287 dest_y = ctx->
picture.
data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 +
shift1));
288 dest_u = ctx->
picture.
data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 +
shift1));
289 dest_v = ctx->
picture.
data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 +
shift1));
297 dct_y_offset = dct_linesize_luma << 3;
298 dct_x_offset = 8 <<
shift1;
302 ctx->
dsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[5]);
305 dct_y_offset = dct_linesize_chroma << 3;
323 for (x = 0; x < ctx->
mb_width; x++) {
336 int buf_size = avpkt->
size;
341 av_dlog(avctx,
"frame size %d\n", buf_size);
373 goto decode_coding_unit;