+ ctx->is_444 = (buf[0x2C] >> 6) & 1;
+ if (ctx->is_444) {
+ if (bitdepth == 8) {
+ avpriv_request_sample(ctx->avctx, "4:4:4 8 bits\n");
+ return AVERROR_INVALIDDATA;
+ } else if (bitdepth == 10) {
+ ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
+ ctx->pix_fmt = ctx->act ? AV_PIX_FMT_YUV444P10
+ : AV_PIX_FMT_GBRP10;
+ } else {
+ ctx->decode_dct_block = dnxhd_decode_dct_block_12_444;
+ ctx->pix_fmt = ctx->act ? AV_PIX_FMT_YUV444P12
+ : AV_PIX_FMT_GBRP12;
+ }
+ } else if (bitdepth == 12) {
+ ctx->decode_dct_block = dnxhd_decode_dct_block_12;
+ ctx->pix_fmt = AV_PIX_FMT_YUV422P12;
+ } else if (bitdepth == 10) {
+ ctx->decode_dct_block = dnxhd_decode_dct_block_10;
+ ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
+ } else {
+ ctx->decode_dct_block = dnxhd_decode_dct_block_8;
+ ctx->pix_fmt = AV_PIX_FMT_YUV422P;
+ }
+
+ ctx->avctx->bits_per_raw_sample = ctx->bit_depth = bitdepth;
+ if (ctx->bit_depth != old_bit_depth) {
+ ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
+ ff_idctdsp_init(&ctx->idsp, ctx->avctx);
+ ff_init_scantable(ctx->idsp.idct_permutation, &ctx->scantable,
+ ff_zigzag_direct);
+ }
+