/*
* VC3/DNxHD decoder.
* Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
+ * Copyright (c) 2011 MirriAd Ltd
+ *
+ * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com>
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
DNXHDContext *ctx = avctx->priv_data;
ctx->avctx = avctx;
- dsputil_init(&ctx->dsp, avctx);
avctx->coded_frame = &ctx->picture;
+ avcodec_get_frame_defaults(&ctx->picture);
ctx->picture.type = AV_PICTURE_TYPE_I;
ctx->picture.key_frame = 1;
return 0;
av_dlog(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
if (buf[0x21] & 0x40) {
- av_log(ctx->avctx, AV_LOG_ERROR, "10 bit per component\n");
- return -1;
+ ctx->avctx->pix_fmt = PIX_FMT_YUV422P10;
+ ctx->avctx->bits_per_raw_sample = 10;
+ if (ctx->bit_depth != 10) {
+ dsputil_init(&ctx->dsp, ctx->avctx);
+ ctx->bit_depth = 10;
+ ctx->decode_dct_block = dnxhd_decode_dct_block_10;
+ }
+ } else {
+ ctx->avctx->pix_fmt = PIX_FMT_YUV422P;
+ ctx->avctx->bits_per_raw_sample = 8;
+ if (ctx->bit_depth != 8) {
+ dsputil_init(&ctx->dsp, ctx->avctx);
+ ctx->bit_depth = 8;
+ ctx->decode_dct_block = dnxhd_decode_dct_block_8;
+ }
}
- ctx->cid = AV_RB32(buf + 0x28);
- av_dlog(ctx->avctx, "compression id %d\n", ctx->cid);
+ cid = AV_RB32(buf + 0x28);
+ av_dlog(ctx->avctx, "compression id %d\n", cid);
- if (dnxhd_init_vlc(ctx, ctx->cid) < 0)
+ if (dnxhd_init_vlc(ctx, cid) < 0)
return -1;
if (buf_size < ctx->cid_table->coding_unit_size) {
/*
* VC3/DNxHD encoder
* Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
+ * Copyright (c) 2011 MirriAd Ltd
*
* VC-3 encoder funded by the British Broadcasting Corporation
+ * 10 bit support added by MirriAd Ltd, Joseph Artsimovich <joseph@mirriad.com>
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
void FUNCC(ff_avg_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
FUNCC(avg_pixels16)(dst, src, stride, 16);
}
- static void FUNCC(clear_block)(DCTELEM *block)
- {
- memset(block, 0, sizeof(dctcoef)*64);
- }
-
- /**
- * memset(blocks, 0, sizeof(DCTELEM)*6*64)
- */
- static void FUNCC(clear_blocks)(DCTELEM *blocks)
- {
- memset(blocks, 0, sizeof(dctcoef)*6*64);
- }
-
+
--- /dev/null
-3ed972af47641d39a19916b0cd119120 *./tests/data/vsynth1/dnxhd-720p-10bit.dnxhd
++cb29b6ae4e1562d95f9311991fef98df *./tests/data/vsynth1/dnxhd-720p-10bit.dnxhd
+ 2293760 ./tests/data/vsynth1/dnxhd-720p-10bit.dnxhd
-b64efb0b4eb934bb66f4530c12d5d7fa *./tests/data/dnxhd_720p_10bit.vsynth1.out.yuv
-stddev: 6.27 PSNR: 32.18 MAXDIFF: 65 bytes: 760320/ 7603200
++2f45bb1af7da5dd3dca870ac87237b7d *./tests/data/dnxhd_720p_10bit.vsynth1.out.yuv
++stddev: 6.27 PSNR: 32.18 MAXDIFF: 64 bytes: 760320/ 7603200
--- /dev/null
-0b8389955cce583bd2db7d2e727a6f15 *./tests/data/vsynth2/dnxhd-720p-10bit.dnxhd
++8648511257afb816b5b911706ca391db *./tests/data/vsynth2/dnxhd-720p-10bit.dnxhd
+ 2293760 ./tests/data/vsynth2/dnxhd-720p-10bit.dnxhd
-bde04e992df2473e89aef4460265332d *./tests/data/dnxhd_720p_10bit.vsynth2.out.yuv
-stddev: 1.45 PSNR: 44.89 MAXDIFF: 22 bytes: 760320/ 7603200
++391b6f5aa7c7b488b479cb43d420b860 *./tests/data/dnxhd_720p_10bit.vsynth2.out.yuv
++stddev: 1.35 PSNR: 45.46 MAXDIFF: 23 bytes: 760320/ 7603200