#include "dnxhddata.h"
#include "idctdsp.h"
#include "internal.h"
+#include "profiles.h"
#include "thread.h"
typedef struct RowContext {
return 0;
}
+static int dnxhd_get_profile(int cid)
+{
+ switch(cid) {
+ case 1270:
+ return FF_PROFILE_DNXHR_444;
+ case 1271:
+ return FF_PROFILE_DNXHR_HQX;
+ case 1272:
+ return FF_PROFILE_DNXHR_HQ;
+ case 1273:
+ return FF_PROFILE_DNXHR_SQ;
+ case 1274:
+ return FF_PROFILE_DNXHR_LB;
+ }
+ return FF_PROFILE_DNXHD;
+}
+
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
const uint8_t *buf, int buf_size,
int first_field)
}
cid = AV_RB32(buf + 0x28);
+
+ ctx->avctx->profile = dnxhd_get_profile(cid);
+
if ((ret = dnxhd_init_vlc(ctx, cid, bitdepth)) < 0)
return ret;
if (ctx->mbaff && ctx->cid_table->cid != 1260)
ctx->bit_depth, ctx->mbaff, ctx->act);
// Newer format supports variable mb_scan_index sizes
- if (header_prefix == DNXHD_HEADER_HR2) {
+ if (ctx->mb_height > 68 && ff_dnxhd_check_header_prefix_hr(header_prefix)) {
ctx->data_offset = 0x170 + (ctx->mb_height << 2);
} else {
if (ctx->mb_height > 68 ||
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS |
AV_CODEC_CAP_SLICE_THREADS,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(dnxhd_decode_init_thread_copy),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
};