[FFmpeg-devel] [PATCH 1/5] dnxhd: add decoder support for DNxHR
Christophe Gisquet
christophe.gisquet at gmail.com
Fri Oct 2 21:00:42 CEST 2015
From: Jeremy James <jeremy.james at gmail.com>
Signed-off-by: Christophe Gisquet <christophe.gisquet at gmail.com>
---
libavcodec/dnxhddata.c | 7 +++++++
libavcodec/dnxhddec.c | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 0cbc57b..e39208d 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -1058,6 +1058,13 @@ const CIDEntry ff_dnxhd_cid_table[] = {
dnxhd_1237_ac_flags,
dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
{ 80, 90, 100, 110 } },
+ { 1274, 0, 0, 0, 0, 0, 4, 8, 3,
+ dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
+ dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
+ dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
+ dnxhd_1237_ac_flags,
+ dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
+ { 0 } },
};
int ff_dnxhd_get_cid_table(int cid)
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 296f7f7..1c8660e 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -152,6 +152,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
{
static const uint8_t header_prefix[] = { 0x00, 0x00, 0x02, 0x80, 0x01 };
static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
+ static const uint8_t header_prefixhr[] = { 0x00, 0x00, 0x02, 0x80, 0x03 };
int i, cid, ret;
int old_bit_depth = ctx->bit_depth;
@@ -161,7 +162,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
return AVERROR_INVALIDDATA;
}
- if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
+ if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5) && memcmp(buf, header_prefixhr, 5)) {
av_log(ctx->avctx, AV_LOG_ERROR,
"unknown header 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\n",
buf[0], buf[1], buf[2], buf[3], buf[4]);
@@ -229,7 +230,7 @@ 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 != 0) {
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