53 #define DNXHD_VLC_BITS 9
54 #define DNXHD_DC_VLC_BITS 7
70 if (cid != ctx->
cid) {
102 static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
103 static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
106 if (buf_size < 0x280)
109 if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
126 if (buf[0x4] == 0x2) {
135 }
else if (buf[0x21] & 0x40) {
191 int16_t *
block,
int n,
197 int i, j, index1, index2,
len;
198 int level, component, sign;
204 component = 1 + (n&1);
211 component = (n >> 1) % 3;
225 level = (
NEG_USR32(sign ^ level, len) ^ sign) - sign;
228 block[0] = ctx->
last_dc[component];
259 level = (2*level+1) * qscale * weight_matrix[i];
260 if (level_bias < 32 || weight_matrix[i] != level_bias)
262 level >>= level_shift;
264 block[j] = (level^sign) - sign;
291 int dct_linesize_luma = frame->
linesize[0];
292 int dct_linesize_chroma = frame->
linesize[1];
293 uint8_t *dest_y, *dest_u, *dest_v;
294 int dct_y_offset, dct_x_offset;
300 for (i = 0; i < 8; i++) {
305 for (; i < 12; i++) {
312 dct_linesize_luma <<= 1;
313 dct_linesize_chroma <<= 1;
316 dest_y = frame->
data[0] + ((y * dct_linesize_luma) << 4) + (x << (4 +
shift1));
317 dest_u = frame->
data[1] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
318 dest_v = frame->
data[2] + ((y * dct_linesize_chroma) << 4) + (x << (3 + shift1 + ctx->
is_444));
326 dct_y_offset = dct_linesize_luma << 3;
327 dct_x_offset = 8 <<
shift1;
332 ctx->
dsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[5]);
335 dct_y_offset = dct_linesize_chroma << 3;
345 ctx->
dsp.
idct_put(dest_y + dct_y_offset + dct_x_offset, dct_linesize_luma, ctx->
blocks[7]);
348 dct_y_offset = dct_linesize_chroma << 3;
352 ctx->
dsp.
idct_put(dest_u + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[9]);
356 ctx->
dsp.
idct_put(dest_v + dct_y_offset + dct_x_offset, dct_linesize_chroma, ctx->
blocks[11]);
364 const uint8_t *buf,
int buf_size)
372 for (x = 0; x < ctx->
mb_width; x++) {
385 int buf_size = avpkt->
size;
391 av_dlog(avctx,
"frame size %d\n", buf_size);
423 goto decode_coding_unit;