Commit 1f4ff53a authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Michael Niedermayer

dnxhddec: Introduce DNXHD_VARIABLE

Currently not used, but will be used to indicate that a CIDEntry field
is not set, because it is variable, and that checks should be adapted.
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 52256860
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
#define DNXHD_INTERLACED (1<<0) #define DNXHD_INTERLACED (1<<0)
#define DNXHD_444 (1<<1) #define DNXHD_444 (1<<1)
/** Indicate that a CIDEntry value must be read in the bitstream */
#define DNXHD_VARIABLE 0
typedef struct CIDEntry { typedef struct CIDEntry {
int cid; int cid;
unsigned int width, height; unsigned int width, height;
......
...@@ -106,7 +106,8 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid) ...@@ -106,7 +106,8 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid)
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid); av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
} }
if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth) { if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth &&
ff_dnxhd_cid_table[index].bit_depth != DNXHD_VARIABLE) {
av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth); av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
...@@ -228,7 +229,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, ...@@ -228,7 +229,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
// make sure profile size constraints are respected // make sure profile size constraints are respected
// DNx100 allows 1920->1440 and 1280->960 subsampling // DNx100 allows 1920->1440 and 1280->960 subsampling
if (ctx->width != ctx->cid_table->width) { if (ctx->width != ctx->cid_table->width &&
ctx->cid_table->width != DNXHD_VARIABLE) {
av_reduce(&ctx->avctx->sample_aspect_ratio.num, av_reduce(&ctx->avctx->sample_aspect_ratio.num,
&ctx->avctx->sample_aspect_ratio.den, &ctx->avctx->sample_aspect_ratio.den,
ctx->width, ctx->cid_table->width, 255); ctx->width, ctx->cid_table->width, 255);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment