[FFmpeg-devel] [PATCH 4/9] dnxhddec: Introduce DNXHD_VARIABLE
Christophe Gisquet
christophe.gisquet at gmail.com
Sat Oct 3 18:59:17 CEST 2015
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.
---
libavcodec/dnxhddata.h | 3 +++
libavcodec/dnxhddec.c | 6 ++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h
index ade0b0b..e960fc9 100644
--- a/libavcodec/dnxhddata.h
+++ b/libavcodec/dnxhddata.h
@@ -30,6 +30,9 @@
#define DNXHD_INTERLACED (1<<0)
#define DNXHD_444 (1<<1)
+/** Indicate that a CIDEntry value must be read in the bitstream */
+#define DNXHD_VARIABLE 0
+
typedef struct CIDEntry {
int cid;
unsigned int width, height;
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 2f2d989..d7370a6 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -105,7 +105,8 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid)
av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
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);
return AVERROR_INVALIDDATA;
}
@@ -227,7 +228,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
// make sure profile size constraints are respected
// 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,
&ctx->avctx->sample_aspect_ratio.den,
ctx->width, ctx->cid_table->width, 255);
--
2.5.2
More information about the ffmpeg-devel
mailing list